From 044bafd3e472dda4b075aed97835ba9436ba7a76 Mon Sep 17 00:00:00 2001 From: William Joye Date: Fri, 1 Mar 2019 15:18:37 -0500 Subject: remove sequence data flag from plot widgets --- ds9/doc/release/r8.1.html | 1 + ds9/library/plot.tcl | 141 ++++++++------------------------------------ ds9/library/plotbar.tcl | 2 - ds9/library/plotline.tcl | 2 - ds9/library/plotscatter.tcl | 2 - 5 files changed, 24 insertions(+), 124 deletions(-) diff --git a/ds9/doc/release/r8.1.html b/ds9/doc/release/r8.1.html index 63d3a9f..e87b39b 100644 --- a/ds9/doc/release/r8.1.html +++ b/ds9/doc/release/r8.1.html @@ -53,6 +53,7 @@
  • 02.15.2019 TCLLIB: updated to version 1.19.
  • 02.26.2019 GUI: add command "preserve scale" for backward compatibility.
  • 02.28.2019 TKBLT: fixed postscript bounding box issue.
  • +
  • 03.01.2019 PLOT: removed old sequence flag from plot widgets.
  • xx.xx.2019 RELEASE version 8.1b1
  • diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl index 6f9d639..27080db 100644 --- a/ds9/library/plot.tcl +++ b/ds9/library/plot.tcl @@ -268,19 +268,8 @@ proc PlotDataSetOne {varname dim data} { set var(yedata) {} for {} {$ii<$ll} {incr ii 2} { - set tx [lindex $data $ii] - if {$var(seq)} { - if {$ox<=$tx} { - set ox $tx - lappend x $tx - lappend y [lindex $data [expr $ii+1]] - } else { - break - } - } else { - lappend x $tx - lappend y [lindex $data [expr $ii+1]] - } + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+1]] } $var(xdata) set $x $var(ydata) set $y @@ -295,21 +284,9 @@ proc PlotDataSetOne {varname dim data} { blt::vector create $var(xedata) for {} {$ii<$ll} {incr ii 3} { - set tx [lindex $data $ii] - if {$var(seq)} { - if {$ox<=$tx} { - set ox $tx - lappend x $tx - lappend y [lindex $data [expr $ii+1]] - lappend xe [lindex $data [expr $ii+2]] - } else { - break - } - } else { - lappend x $tx - lappend y [lindex $data [expr $ii+1]] - lappend xe [lindex $data [expr $ii+2]] - } + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+1]] + lappend xe [lindex $data [expr $ii+2]] } $var(xdata) set $x $var(ydata) set $y @@ -326,21 +303,9 @@ proc PlotDataSetOne {varname dim data} { blt::vector create $var(yedata) for {} {$ii<$ll} {incr ii 3} { - set tx [lindex $data $ii] - if {$var(seq)} { - if {$ox<=$tx} { - set ox $tx - lappend x $tx - lappend y [lindex $data [expr $ii+1]] - lappend ye [lindex $data [expr $ii+2]] - } else { - break - } - } else { - lappend x $tx - lappend y [lindex $data [expr $ii+1]] - lappend ye [lindex $data [expr $ii+2]] - } + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+1]] + lappend ye [lindex $data [expr $ii+2]] } $var(xdata) set $x $var(ydata) set $y @@ -356,23 +321,10 @@ proc PlotDataSetOne {varname dim data} { blt::vector create $var(xedata) $var(yedata) for {} {$ii<$ll} {incr ii 4} { - set tx [lindex $data $ii] - if {$var(seq)} { - if {$ox<=$tx} { - set ox $tx - lappend x $tx - lappend y [lindex $data [expr $ii+1]] - lappend xe [lindex $data [expr $ii+2]] - lappend ye [lindex $data [expr $ii+3]] - } else { - break - } - } else { - lappend x $tx - lappend y [lindex $data [expr $ii+1]] - lappend xe [lindex $data [expr $ii+2]] - lappend ye [lindex $data [expr $ii+3]] - } + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+1]] + lappend xe [lindex $data [expr $ii+2]] + lappend ye [lindex $data [expr $ii+3]] } $var(xdata) set $x $var(ydata) set $y @@ -389,21 +341,9 @@ proc PlotDataSetOne {varname dim data} { blt::vector create $var(yedata) for {} {$ii<$ll} {incr ii 4} { - set tx [lindex $data $ii] - if {$var(seq)} { - if {$ox<=$tx} { - set ox $tx - lappend x $tx - lappend y [lindex $data [expr $ii+1]] - lappend ye [lindex $data [expr $ii+2]] - } else { - break - } - } else { - lappend x $tx - lappend y [lindex $data [expr $ii+1]] - lappend ye [lindex $data [expr $ii+2]] - } + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+1]] + lappend ye [lindex $data [expr $ii+2]] } $var(xdata) set $x $var(ydata) set $y @@ -416,19 +356,8 @@ proc PlotDataSetOne {varname dim data} { set var(yedata) {} for {} {$ii<$ll} {incr ii 4} { - set tx [lindex $data $ii] - if {$var(seq)} { - if {$ox<=$tx} { - set ox $tx - lappend x $tx - lappend y [lindex $data [expr $ii+3]] - } else { - break - } - } else { - lappend x $tx - lappend y [lindex $data [expr $ii+3]] - } + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+3]] } $var(xdata) set $x $var(ydata) set $y @@ -443,21 +372,9 @@ proc PlotDataSetOne {varname dim data} { blt::vector create $var(yedata) for {} {$ii<$ll} {incr ii 5} { - set tx [lindex $data $ii] - if {$var(seq)} { - if {$ox<=$tx} { - set ox $tx - lappend x $tx - lappend y [lindex $data [expr $ii+1]] - lappend ye [lindex $data [expr $ii+2]] - } else { - break - } - } else { - lappend x $tx - lappend y [lindex $data [expr $ii+1]] - lappend ye [lindex $data [expr $ii+2]] - } + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+1]] + lappend ye [lindex $data [expr $ii+2]] } $var(xdata) set $x $var(ydata) set $y @@ -473,21 +390,9 @@ proc PlotDataSetOne {varname dim data} { blt::vector create $var(yedata) for {} {$ii<$ll} {incr ii 5} { - set tx [lindex $data $ii] - if {$var(seq)} { - if {$ox<=$tx} { - set ox $tx - lappend x $tx - lappend y [lindex $data [expr $ii+3]] - lappend ye [lindex $data [expr $ii+4]] - } else { - break - } - } else { - lappend x $tx - lappend y [lindex $data [expr $ii+3]] - lappend ye [lindex $data [expr $ii+4]] - } + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+3]] + lappend ye [lindex $data [expr $ii+4]] } $var(xdata) set $x $var(ydata) set $y diff --git a/ds9/library/plotbar.tcl b/ds9/library/plotbar.tcl index 0c9619a..3a1a75c 100644 --- a/ds9/library/plotbar.tcl +++ b/ds9/library/plotbar.tcl @@ -64,8 +64,6 @@ proc PlotDialogBar {varname} { global ds9 - set var(seq) 1 - # Graph $var(mb).graph add separator $var(mb).graph add cascade -label "[msgcat::mc {Mode}]..." \ diff --git a/ds9/library/plotline.tcl b/ds9/library/plotline.tcl index 773ea6a..50b0f40 100644 --- a/ds9/library/plotline.tcl +++ b/ds9/library/plotline.tcl @@ -64,8 +64,6 @@ proc PlotDialogLine {varname} { global ds9 - set var(seq) 1 - # Dataset $var(mb).dataset add checkbutton -label [msgcat::mc {Show}] \ -variable ${varname}(show) \ diff --git a/ds9/library/plotscatter.tcl b/ds9/library/plotscatter.tcl index d634060..3816cea 100644 --- a/ds9/library/plotscatter.tcl +++ b/ds9/library/plotscatter.tcl @@ -64,8 +64,6 @@ proc PlotDialogScatter {varname} { global ds9 - set var(seq) 0 - # Dataset $var(mb).dataset add checkbutton -label [msgcat::mc {Show}] \ -variable ${varname}(show) \ -- cgit v0.12 From b1c387fe82a3f279fde9c25f3467379a7c3287f1 Mon Sep 17 00:00:00 2001 From: William Joye Date: Fri, 1 Mar 2019 15:24:58 -0500 Subject: remove sequence data flag from plot widgets --- ds9/library/plot.tcl | 310 +++++++++++++++++++++++++-------------------------- 1 file changed, 153 insertions(+), 157 deletions(-) diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl index 27080db..8b626d2 100644 --- a/ds9/library/plot.tcl +++ b/ds9/library/plot.tcl @@ -228,196 +228,192 @@ proc PlotDataSetOne {varname dim data} { # total length set ll [llength $data] - set ii 0 - - while {$ii<$ll} { - # incr count - incr ${varname}(data,total) - set nn $var(data,total) - set var(data,current) $nn - - # new vector names - set xdata ap${varname}xx${nn} - set ydata ap${varname}yy${nn} - set xedata ap${varname}xe${nn} - set yedata ap${varname}ye${nn} - - # basics xy - set var(manage) 1 - set var(name) "Dataset $nn" - set var(xdata) $xdata - set var(ydata) $ydata - global $var(xdata) $var(ydata) - blt::vector create $var(xdata) $var(ydata) - - # substitute all separtors - regsub -all {[\n\r\t, ]+} $data { } data - # remove all non-numeric data - regsub -all {[^0-9.e\- ]+} $data {} data - - set ox [lindex $data $ii] - set x {} - set y {} - set xe {} - set ye {} - switch -- $dim { - 2 - - xy { - set var(dim) xy - set var(xedata) {} - set var(yedata) {} - for {} {$ii<$ll} {incr ii 2} { - lappend x [lindex $data $ii] - lappend y [lindex $data [expr $ii+1]] - } - $var(xdata) set $x - $var(ydata) set $y + # incr count + incr ${varname}(data,total) + set nn $var(data,total) + set var(data,current) $nn + + # new vector names + set xdata ap${varname}xx${nn} + set ydata ap${varname}yy${nn} + set xedata ap${varname}xe${nn} + set yedata ap${varname}ye${nn} + + # basics xy + set var(manage) 1 + set var(name) "Dataset $nn" + set var(xdata) $xdata + set var(ydata) $ydata + global $var(xdata) $var(ydata) + blt::vector create $var(xdata) $var(ydata) + + # substitute all separtors + regsub -all {[\n\r\t, ]+} $data { } data + # remove all non-numeric data + regsub -all {[^0-9.e\- ]+} $data {} data + + set x {} + set y {} + set xe {} + set ye {} + switch -- $dim { + 2 - + xy { + set var(dim) xy + set var(xedata) {} + set var(yedata) {} + + for {set ii 0} {$ii<$ll} {incr ii 2} { + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+1]] } + $var(xdata) set $x + $var(ydata) set $y + } - xyex { - set var(dim) xyex - set var(xedata) $xedata - set var(yedata) {} + xyex { + set var(dim) xyex + set var(xedata) $xedata + set var(yedata) {} - global $var(xedata) - blt::vector create $var(xedata) + global $var(xedata) + blt::vector create $var(xedata) - for {} {$ii<$ll} {incr ii 3} { - lappend x [lindex $data $ii] - lappend y [lindex $data [expr $ii+1]] - lappend xe [lindex $data [expr $ii+2]] - } - $var(xdata) set $x - $var(ydata) set $y - $var(xedata) set $xe + for {set ii 0} {$ii<$ll} {incr ii 3} { + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+1]] + lappend xe [lindex $data [expr $ii+2]] } + $var(xdata) set $x + $var(ydata) set $y + $var(xedata) set $xe + } - 3 - - xyey { - set var(dim) xyey - set var(xedata) {} - set var(yedata) $yedata + 3 - + xyey { + set var(dim) xyey + set var(xedata) {} + set var(yedata) $yedata - global $var(yedata) - blt::vector create $var(yedata) + global $var(yedata) + blt::vector create $var(yedata) - for {} {$ii<$ll} {incr ii 3} { - lappend x [lindex $data $ii] - lappend y [lindex $data [expr $ii+1]] - lappend ye [lindex $data [expr $ii+2]] - } - $var(xdata) set $x - $var(ydata) set $y - $var(yedata) set $ye + for {set ii 0} {$ii<$ll} {incr ii 3} { + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+1]] + lappend ye [lindex $data [expr $ii+2]] } + $var(xdata) set $x + $var(ydata) set $y + $var(yedata) set $ye + } - xyexey { - set var(dim) xyexey - set var(xedata) $xedata - set var(yedata) $yedata - - global $var(xedata) $var(yedata) - blt::vector create $var(xedata) $var(yedata) - - for {} {$ii<$ll} {incr ii 4} { - lappend x [lindex $data $ii] - lappend y [lindex $data [expr $ii+1]] - lappend xe [lindex $data [expr $ii+2]] - lappend ye [lindex $data [expr $ii+3]] - } - $var(xdata) set $x - $var(ydata) set $y - $var(xedata) set $xe - $var(yedata) set $ye + xyexey { + set var(dim) xyexey + set var(xedata) $xedata + set var(yedata) $yedata + + global $var(xedata) $var(yedata) + blt::vector create $var(xedata) $var(yedata) + + for {set ii 0} {$ii<$ll} {incr ii 4} { + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+1]] + lappend xe [lindex $data [expr $ii+2]] + lappend ye [lindex $data [expr $ii+3]] } + $var(xdata) set $x + $var(ydata) set $y + $var(xedata) set $xe + $var(yedata) set $ye + } - 4.1 { - set var(dim) xyey - set var(xedata) {} - set var(yedata) $yedata + 4.1 { + set var(dim) xyey + set var(xedata) {} + set var(yedata) $yedata - global $var(yedata) - blt::vector create $var(yedata) + global $var(yedata) + blt::vector create $var(yedata) - for {} {$ii<$ll} {incr ii 4} { - lappend x [lindex $data $ii] - lappend y [lindex $data [expr $ii+1]] - lappend ye [lindex $data [expr $ii+2]] - } - $var(xdata) set $x - $var(ydata) set $y - $var(yedata) set $ye + for {set ii 0} {$ii<$ll} {incr ii 4} { + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+1]] + lappend ye [lindex $data [expr $ii+2]] } + $var(xdata) set $x + $var(ydata) set $y + $var(yedata) set $ye + } - 4.2 { - set var(dim) xy - set var(xedata) {} - set var(yedata) {} + 4.2 { + set var(dim) xy + set var(xedata) {} + set var(yedata) {} - for {} {$ii<$ll} {incr ii 4} { - lappend x [lindex $data $ii] - lappend y [lindex $data [expr $ii+3]] - } - $var(xdata) set $x - $var(ydata) set $y + for {set ii 0} {$ii<$ll} {incr ii 4} { + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+3]] } + $var(xdata) set $x + $var(ydata) set $y + } - 5.1 { - set var(dim) xyey - set var(xedata) {} - set var(yedata) $yedata + 5.1 { + set var(dim) xyey + set var(xedata) {} + set var(yedata) $yedata - global $var(yedata) - blt::vector create $var(yedata) + global $var(yedata) + blt::vector create $var(yedata) - for {} {$ii<$ll} {incr ii 5} { - lappend x [lindex $data $ii] - lappend y [lindex $data [expr $ii+1]] - lappend ye [lindex $data [expr $ii+2]] - } - $var(xdata) set $x - $var(ydata) set $y - $var(yedata) set $ye + for {set ii 0} {$ii<$ll} {incr ii 5} { + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+1]] + lappend ye [lindex $data [expr $ii+2]] } + $var(xdata) set $x + $var(ydata) set $y + $var(yedata) set $ye + } - 5.2 { - set var(dim) xyey - set var(xedata) {} - set var(yedata) $yedata + 5.2 { + set var(dim) xyey + set var(xedata) {} + set var(yedata) $yedata - global $var(yedata) - blt::vector create $var(yedata) + global $var(yedata) + blt::vector create $var(yedata) - for {} {$ii<$ll} {incr ii 5} { - lappend x [lindex $data $ii] - lappend y [lindex $data [expr $ii+3]] - lappend ye [lindex $data [expr $ii+4]] - } - $var(xdata) set $x - $var(ydata) set $y - $var(yedata) set $ye + for {set ii 0} {$ii<$ll} {incr ii 5} { + lappend x [lindex $data $ii] + lappend y [lindex $data [expr $ii+3]] + lappend ye [lindex $data [expr $ii+4]] } + $var(xdata) set $x + $var(ydata) set $y + $var(yedata) set $ye } + } - set var($nn,manage) 1 - set var($nn,dim) $var(dim) + set var($nn,manage) 1 + set var($nn,dim) $var(dim) - set var($nn,xdata) $var(xdata) - set var($nn,ydata) $var(ydata) - set var($nn,xedata) $var(xedata) - set var($nn,yedata) $var(yedata) + set var($nn,xdata) $var(xdata) + set var($nn,ydata) $var(ydata) + set var($nn,xedata) $var(xedata) + set var($nn,yedata) $var(yedata) - PlotGetVar $varname $nn + PlotGetVar $varname $nn - # update data set menu - $var(mb).select add radiobutton -label "$var(name)" \ - -variable ${varname}(data,current) -value $nn \ - -command [list PlotCurrentData $varname] + # update data set menu + $var(mb).select add radiobutton -label "$var(name)" \ + -variable ${varname}(data,current) -value $nn \ + -command [list PlotCurrentData $varname] - PlotCreateElement $varname - $var(proc,updateelement) $varname - } + PlotCreateElement $varname + $var(proc,updateelement) $varname } proc PlotDupData {varname mm} { -- cgit v0.12