diff options
Diffstat (limited to 'ds9/library/imgsvr.tcl')
-rw-r--r-- | ds9/library/imgsvr.tcl | 56 |
1 files changed, 21 insertions, 35 deletions
diff --git a/ds9/library/imgsvr.tcl b/ds9/library/imgsvr.tcl index 2af43fd..21262da 100644 --- a/ds9/library/imgsvr.tcl +++ b/ds9/library/imgsvr.tcl @@ -568,19 +568,11 @@ proc IMGSVRProcessCmd {varname iname vvarname} { } } -proc IMGSVRProcessSendCmd {proc id param vvarname} { - upvar #0 $vvarname vvar +proc IMGSVRCmd {varname which value} { + upvar #0 $varname var + global $varname - switch -- [string tolower [lindex $param 0]] { - save {$proc $id [ToYesNo $vvar(save)]} - frame {$proc $id "$vvar(mode)\n"} - survey {$proc $id "$vvar(survey)\n"} - size {$proc $id "$vvar(width) $vvar(height) $vvar(rformat)\n"} - pixels {$proc $id "$vvar(width,pixels) $vvar(height,pixels)\n"} - coord {$proc $id "$vvar(x) $vvar(y) $vvar(skyformat)\n"} - name - - default {$proc $id "$vvar(name)\n"} - } + set var($which) $value } proc IMGSVRCmdName {varname name} { @@ -622,39 +614,33 @@ proc IMGSVRCmdPixels {varname ww hh} { set var(height,pixels) $hh } -proc IMGSVRCmdSave {varname save} { +proc IMGSVRCmdUpdate {varname} { upvar #0 $varname var global $varname - set var(save) $save -} - -proc IMGSVRCmdMode {varname mode} { - upvar #0 $varname var - global $varname - - set var(mode) $mode -} - -proc IMGSVRCmdSurvey {varname survey} { - upvar #0 $varname var - global $varname - - set var(survey) $survey + IMGSVRUpdate $varname + IMGSVRApply $varname 1 } -proc IMGSVRCmdUpdateFrame {varname} { +proc IMGSVRCmdCrosshair {varname} { upvar #0 $varname var global $varname - IMGSVRUpdate $varname + IMGSVRCrosshair $varname IMGSVRApply $varname 1 } -proc IMGSVRCmdUpdateCrosshair {varname} { - upvar #0 $varname var - global $varname +proc IMGSVRProcessSendCmd {proc id param vvarname} { + upvar #0 $vvarname vvar - IMGSVRUpdate $varname - IMGSVRApply $varname 1 + switch -- [string tolower [lindex $param 0]] { + save {$proc $id [ToYesNo $vvar(save)]} + frame {$proc $id "$vvar(mode)\n"} + survey {$proc $id "$vvar(survey)\n"} + size {$proc $id "$vvar(width) $vvar(height) $vvar(rformat)\n"} + pixels {$proc $id "$vvar(width,pixels) $vvar(height,pixels)\n"} + coord {$proc $id "$vvar(x) $vvar(y) $vvar(skyformat)\n"} + name - + default {$proc $id "$vvar(name)\n"} + } } |