diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-01-12 18:23:03 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-01-12 18:23:03 (GMT) |
commit | 10e68f58b7f7d74c4ba02cb0561e2c1d59f6d92b (patch) | |
tree | 87320c5f9cdd3923f5a793aec922ed4195eeca87 /ds9/library | |
parent | a38fd423435acb45ac17f753578632e41824dec3 (diff) | |
download | blt-10e68f58b7f7d74c4ba02cb0561e2c1d59f6d92b.zip blt-10e68f58b7f7d74c4ba02cb0561e2c1d59f6d92b.tar.gz blt-10e68f58b7f7d74c4ba02cb0561e2c1d59f6d92b.tar.bz2 |
add precision command tests
Diffstat (limited to 'ds9/library')
-rw-r--r-- | ds9/library/comm.tcl | 2 | ||||
-rw-r--r-- | ds9/library/command.tcl | 1 | ||||
-rw-r--r-- | ds9/library/ds9.tcl | 12 | ||||
-rw-r--r-- | ds9/library/frame.tcl | 4 | ||||
-rw-r--r-- | ds9/library/util.tcl | 55 | ||||
-rw-r--r-- | ds9/library/xpa.tcl | 18 |
6 files changed, 90 insertions, 2 deletions
diff --git a/ds9/library/comm.tcl b/ds9/library/comm.tcl index c6e1bbc..00b0486 100644 --- a/ds9/library/comm.tcl +++ b/ds9/library/comm.tcl @@ -118,6 +118,7 @@ proc CommSet {fn paramlist {safemode 0}} { pixeltable {ProcessPixelTableCmd param i} plot {ProcessPlotCmd param i {} $fn} png {ProcessPNGCmd param i {} $fn} + precision {ProcessPrecisionCmd param i} prefs {ProcessPrefsCmd param i} preserve {ProcessPreserveCmd param i} print { @@ -315,6 +316,7 @@ proc CommGet {proc id paramlist fn} { pixeltable {ProcessSendPixelTableCmd $proc $id $param {} $fn} plot {ProcessSendPlotCmd $proc $id $param} png {ProcessSendPNGCmd $proc $id $param {} $fn} + precision {ProcessSendPrecisionCmd $proc $id $param} prefs {ProcessSendPrefsCmd $proc $id $param} preserve {ProcessSendPreserveCmd $proc $id $param} pspagesetup {ProcessSendPSPageSetupCmd $proc $id $param} diff --git a/ds9/library/command.tcl b/ds9/library/command.tcl index ef28c4f..9f5cb4b 100644 --- a/ds9/library/command.tcl +++ b/ds9/library/command.tcl @@ -298,6 +298,7 @@ proc ProcessCommand {argv argc} { -nopixeltable {PixelTableDestroyDialog} -plot {incr i; ProcessPlotCmd argv i {} {}} -png {set file(type) png} + -precision {incr i; ProcessPrecisionCmd argv i} -port {incr i; set iis(port) [lindex $argv $i]} -inet_only - -port_only { diff --git a/ds9/library/ds9.tcl b/ds9/library/ds9.tcl index 247cf67..a7794bb 100644 --- a/ds9/library/ds9.tcl +++ b/ds9/library/ds9.tcl @@ -133,10 +133,18 @@ proc DS9Def {} { win32 {set pds9(xpa) 0} } - set pds9(samp) 1 - set pds9(confirm) 1 set pds9(bg) white set pds9(nan) white + + set pds9(prec,linear) 8 + set pds9(prec,deg) 10 + set pds9(prec,hms) 4 + set pds9(prec,dms) 3 + set pds9(prec,arcmin) 5 + set pds9(prec,arcsec) 3 + + set pds9(samp) 1 + set pds9(confirm) 1 set pds9(iraf) 1 switch $ds9(wm) { x11 {set pds9(dialog) motif} diff --git a/ds9/library/frame.tcl b/ds9/library/frame.tcl index 521e8d5..3da0029 100644 --- a/ds9/library/frame.tcl +++ b/ds9/library/frame.tcl @@ -136,6 +136,10 @@ proc CreateNameNumberFrame {which type} { $ds9(next) datasec $scale(datasec) + $ds9(next) precision $pds9(prec,linear) \ + $pds9(prec,deg) $pds9(prec,hms) $pds9(prec,dms) \ + $pds9(prec,arcmin) $pds9(prec,arcsec) + $ds9(next) bg color $pds9(bg) $ds9(next) nan color $pds9(nan) $ds9(next) iraf align $pds9(iraf) diff --git a/ds9/library/util.tcl b/ds9/library/util.tcl index 4901c2b..0de8d5d 100644 --- a/ds9/library/util.tcl +++ b/ds9/library/util.tcl @@ -856,6 +856,17 @@ proc PrefsNanColor {} { } } +proc PrefsPrecision {} { + global ds9 + global pds9 + + foreach ff $ds9(frames) { + $ff precision $pds9(prec,linear) \ + $pds9(prec,deg) $pds9(prec,hms) $pds9(prec,dms) \ + $pds9(prec,arcmin) $pds9(prec,arcsec) + } +} + proc ChangeThreads {} { global ds9 @@ -1152,6 +1163,8 @@ proc FixSpecSystem {sysname defsys} { proc DS9Backup {ch which} { global pds9 + puts $ch "$which precision $pds9(prec,linear) $pds9(prec,deg) $pds9(prec,hms) $pds9(prec,dms) $pds9(prec,arcmin) $pds9(prec,arcsec)" + puts $ch "$which bg color $pds9(bg)" puts $ch "$which nan color $pds9(nan)" } @@ -1167,6 +1180,21 @@ proc ProcessPrefsCmd {varname iname} { switch -- [string tolower [lindex $var $i]] { clear {ClearPrefs} + precision { + incr i + set pds9(prec,linear) [lindex $var $i] + incr i + set pds9(prec,deg) [lindex $var $i] + incr i + set pds9(prec,hms) [lindex $var $i] + incr i + set pds9(prec,dms) [lindex $var $i] + incr i + set pds9(prec,arcmin) [lindex $var $i] + incr i + set pds9(prec,arcsec) [lindex $var $i] + PrefsPrecision + } bgcolor { # backward compatibility incr i @@ -1199,6 +1227,7 @@ proc ProcessSendPrefsCmd {proc id param} { # backward compatibility switch -- [string tolower [lindex $param 0]] { + precision {$proc $id "$pds9(prec,linear) $pds9(prec,deg) $pds9(prec,hms) $pds9(prec,dms) $pds9(prec,arcmin) $pds9(prec,arcsec)\n"} bgcolor {$proc $id "$pds9(bg)\n"} nancolor {$proc $id "$pds9(nan)\n"} threads {$proc $id "$ds9(threads)\n"} @@ -1206,6 +1235,32 @@ proc ProcessSendPrefsCmd {proc id param} { } } +proc ProcessPrecisionCmd {varname iname} { + upvar $varname var + upvar $iname i + + global pds9 + incr i + set pds9(prec,linear) [lindex $var $i] + incr i + set pds9(prec,deg) [lindex $var $i] + incr i + set pds9(prec,hms) [lindex $var $i] + incr i + set pds9(prec,dms) [lindex $var $i] + incr i + set pds9(prec,arcmin) [lindex $var $i] + incr i + set pds9(prec,arcsec) [lindex $var $i] + PrefsPrecision +} + +proc ProcessSendPrecisionCmd {proc id param} { + global pds9 + + $proc $id "$pds9(prec,linear) $pds9(prec,deg) $pds9(prec,hms) $pds9(prec,dms) $pds9(prec,arcmin) $pds9(prec,arcsec)\n" +} + proc ProcessBgCmd {varname iname} { upvar $varname var upvar $iname i diff --git a/ds9/library/xpa.tcl b/ds9/library/xpa.tcl index 2f90cab..cb2fe43 100644 --- a/ds9/library/xpa.tcl +++ b/ds9/library/xpa.tcl @@ -425,6 +425,11 @@ proc CreateXPA {} { XPASendPNG {} {} \ XPARcvdPNG {} "fillbuf=false" + xpacmdadd $xpa precision \ + {} \ + XPASendPrecision {} {} \ + XPARcvdPrecision {} {} + xpacmdadd $xpa prefs \ {} \ XPASendPrefs {} {} \ @@ -1532,6 +1537,19 @@ proc XPARcvdPNG {xpa cdata param buf len} { XPACatchError $xpa } +proc XPASendPrecision {xpa cdata param} { + InitError xpa + catch {ProcessSendPrecisionCmd xpasetbuf $xpa $param} + XPACatchError $xpa +} + +proc XPARcvdPrecision {xpa cdata param buf len} { + XPADebug "XPARcvdPrecision" $param + InitError xpa + catch {set i 0; ProcessPrecisionCmd param i} + XPACatchError $xpa +} + proc XPASendPrefs {xpa cdata param} { InitError xpa catch {ProcessSendPrefsCmd xpasetbuf $xpa $param} |