From 02ee45abe855be05bacb2b65edd518a4b8f6f51b Mon Sep 17 00:00:00 2001 From: William Joye Date: Fri, 7 Jun 2019 12:45:02 -0400 Subject: support multiple graphs per plot --- ds9/library/catcmd.tcl | 8 ++++---- ds9/library/plot.tcl | 1 + ds9/library/plotelement.tcl | 17 ----------------- ds9/library/plotline.tcl | 4 ++-- ds9/library/plotprocess.tcl | 14 ++++++++++++++ 5 files changed, 21 insertions(+), 23 deletions(-) delete mode 100644 ds9/library/plotelement.tcl diff --git a/ds9/library/catcmd.tcl b/ds9/library/catcmd.tcl index 6032a2a..dbc5b76 100644 --- a/ds9/library/catcmd.tcl +++ b/ds9/library/catcmd.tcl @@ -120,7 +120,7 @@ proc CATSelectBrowseCmd {varname ss rc} { # plot if {$var(plot)} { - PlotHighliteElement $var(plot,var) $rowlist + PlotCmdHighliteElement $var(plot,var) $rowlist } # samp @@ -196,7 +196,7 @@ proc CATSelectRows {varname src rowlist} { switch $src { samp { if {$var(plot)} { - PlotHighliteElement $var(plot,var) $rowlist + PlotCmdHighliteElement $var(plot,var) $rowlist } } plot { @@ -748,7 +748,7 @@ proc CATRelease {which x y} { CATStatusRows $varname $rowlist # plot if {$var(plot)} { - PlotHighliteElement $var(plot,var) $rowlist + PlotCmdHighliteElement $var(plot,var) $rowlist } # samp if {[info exists samp]} { @@ -773,7 +773,7 @@ proc CATRelease {which x y} { CATStatusRows $varname $rowlist #plot if {$var(plot)} { - PlotHighliteElement $var(plot,var) $rowlist + PlotCmdHighliteElement $var(plot,var) $rowlist } # samp if {[info exists samp]} { diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl index 880d18a..f7a9b33 100644 --- a/ds9/library/plot.tcl +++ b/ds9/library/plot.tcl @@ -561,3 +561,4 @@ proc PlotBackup {ch dir} { } } } + diff --git a/ds9/library/plotelement.tcl b/ds9/library/plotelement.tcl deleted file mode 100644 index e0dea8a..0000000 --- a/ds9/library/plotelement.tcl +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 1999-2018 -# Smithsonian Astrophysical Observatory, Cambridge, MA, USA -# For conditions of distribution and use, see copyright notice in "copyright" - -package provide DS9 1.0 - -proc PlotHighliteElement {varname rowlist} { - upvar #0 $varname var - global $varname - - # rowlist starts at 1 - set result {} - foreach rr $rowlist { - append result "[expr $rr-1] " - } - $var(proc,highlite) $varname $result -} diff --git a/ds9/library/plotline.tcl b/ds9/library/plotline.tcl index 6516d71..b846012 100644 --- a/ds9/library/plotline.tcl +++ b/ds9/library/plotline.tcl @@ -46,8 +46,8 @@ proc PlotLineDialog {varname wtt title xaxis yaxis} { set var(proc,updatecanvas) PlotUpdateCanvas set var(proc,updategraph) PlotUpdateGraph set var(proc,updateelement) PlotLineUpdateElement - set var(proc,highlite) PlotLineHighliteElement - set var(proc,button) PlotLineButton + set var(proc,highlite) PlotHighliteElement + set var(proc,button) PlotButton PlotDialog $varname $wtt $title $xaxis $yaxis PlotAddGraph $varname diff --git a/ds9/library/plotprocess.tcl b/ds9/library/plotprocess.tcl index e4af856..0283af0 100644 --- a/ds9/library/plotprocess.tcl +++ b/ds9/library/plotprocess.tcl @@ -346,6 +346,20 @@ proc PlotCmdSelectData {which} { PlotCurrentData $cvarname } +# used by SAMP and CATALOG +proc PlotCmdHighliteElement {varname rowlist} { + upvar #0 $varname var + global $varname + + # rowlist starts at 1 + set result {} + foreach rr $rowlist { + append result "[expr $rr-1] " + } + + $var(proc,highlite) $varname $result +} + proc ProcessSendPlotCmd {proc id param {sock {}} {fn {}}} { global iap global parse -- cgit v0.12