improve histogram loading and display in mcpha.tcl
@@ -365,7 +365,7 @@ namespace eval ::mcpha {
}
blt::vector create [my varname xvec](16385)
- blt::vector create [my varname yvec](16384)
+ blt::vector create [my varname yvec](16385)
# fill one vector for the x axis with 16385 points
[my varname xvec] seq -0.5 16383.5
@@ -1079,7 +1079,13 @@ namespace eval ::mcpha {
tk_messageBox -icon info \
-message "File \"$fname\" read successfully"
my cntr_reset
- [my varname yvec] set $yvec_new
+ set i 0
+ foreach value $yvec_new {
+ if {[string is space $value]} continue
+ if {$i > 16383} break
+ set [my varname yvec]($i) $value
+ incr i
+ }
}
}
@@ -1638,7 +1644,7 @@ namespace eval ::mcpha {
}
blt::vector create [my varname xvec](4097)
- blt::vector create [my varname yvec](4096)
+ blt::vector create [my varname yvec](4097)
# fill one vector for the x axis with 4097 points
[my varname xvec] seq -0.5 4095.5
@@ -1949,7 +1955,13 @@ namespace eval ::mcpha {
} else {
tk_messageBox -icon info \
-message "File \"$fname\" read successfully"
- [my varname yvec] set $yvec_new
+ set i 0
+ foreach value $yvec_new {
+ if {[string is space $value]} continue
+ if {$i > 4095} break
+ set [my varname yvec]($i) $value
+ incr i
+ }
}
}
