From 10e68f58b7f7d74c4ba02cb0561e2c1d59f6d92b Mon Sep 17 00:00:00 2001
From: William Joye
Date: Fri, 12 Jan 2018 13:23:03 -0500
Subject: add precision command tests
---
ds9/doc/ref/command.html | 56 +++++++++++++++++++++++++++++++++-
ds9/doc/ref/samp.html | 78 +++++++++++++++++++++++++++++++++++++++++++++++
ds9/doc/ref/xpa.html | 78 ++++++++++++++++++++++++++++++++++++++++++++++-
ds9/doc/release/r7.6.html | 1 +
ds9/library/comm.tcl | 2 ++
ds9/library/command.tcl | 1 +
ds9/library/ds9.tcl | 12 ++++++--
ds9/library/frame.tcl | 4 +++
ds9/library/util.tcl | 55 +++++++++++++++++++++++++++++++++
ds9/library/xpa.tcl | 18 +++++++++++
10 files changed, 301 insertions(+), 4 deletions(-)
diff --git a/ds9/doc/ref/command.html b/ds9/doc/ref/command.html
index b8a3b24..1d9a7fb 100644
--- a/ds9/doc/ref/command.html
+++ b/ds9/doc/ref/command.html
@@ -93,6 +93,7 @@
pixeltable
plot
png
+ precision
prefs
preserve
psprint
@@ -515,6 +516,7 @@
+
[crosshair]
[<ref>] [dec
<col>]
@@ -626,6 +628,7 @@
+
[match error <value> degrees|arcmin|arcsec]
[<ref>]
@@ -718,6 +721,7 @@
+
[match function 1and2|1not2|2not1]
[<ref>]
@@ -810,6 +814,7 @@
+
[match return 1and2|1only|2only]
[<ref>]
@@ -902,6 +907,7 @@
+
[match unique yes|no]
[<ref>] [maxrows
<number>]
@@ -1050,6 +1056,7 @@
+
[update]
[<ref>] [x
<col>]
@@ -1440,6 +1447,7 @@
+
[match <coordsys>]
[lock
<coordsys>|none]
@@ -2328,6 +2336,7 @@
+
[pan]
@@ -2463,6 +2472,7 @@
+
[crosshair]
@@ -2598,6 +2608,7 @@
+
[open|close]
Example:
@@ -2836,6 +2847,7 @@
+
[yes|open]
[no|close]
@@ -2941,6 +2953,7 @@
+
duplicate
@@ -3008,6 +3021,7 @@
+
[<plotname>] stats
[<plotname>]
@@ -3075,6 +3089,7 @@
+
list
[<plotname>]
@@ -3142,6 +3157,7 @@
+
loadconfig <filename>
[<plotname>] saveconfig
<filename>
@@ -3216,6 +3232,7 @@
+
[<plotname>] print
[<plotname>] print
destination [printer|file]
@@ -3292,6 +3309,7 @@
+
mode [pointer|zoom]
# configure graph
@@ -3395,6 +3413,7 @@
+
shape
[circle|square|diamond|plus|splus|scross|triangle|arrow]
[<plotname>]
@@ -3463,6 +3482,7 @@
+
shape fill [yes|no]
[<plotname>]
@@ -3533,6 +3553,7 @@
+
[<plotname>]
@@ -3599,6 +3620,7 @@
+
smooth
[step|linear|cubic|quadratic|catrom]
@@ -3667,6 +3689,7 @@
+
[<plotname>]
@@ -3734,6 +3757,7 @@
+
color
<value>
@@ -3802,6 +3826,7 @@
+
[<plotname>]
@@ -3868,6 +3893,7 @@
+
width
<value>
@@ -3936,6 +3962,7 @@
+
@@ -4003,6 +4030,7 @@
+
[<plotname>]
@@ -4069,6 +4097,7 @@
+
dash [yes|no]
@@ -4136,6 +4165,7 @@
+
[<plotname>]
@@ -4203,6 +4233,7 @@
+
error [yes|no]
@@ -4270,6 +4301,7 @@
+
[<plotname>]
@@ -4337,6 +4369,7 @@
+
error color
<value>
@@ -4405,6 +4438,7 @@
+
[<plotname>]
@@ -4472,6 +4506,7 @@
+
error width
<value>
@@ -4540,6 +4575,7 @@
+
[<plotname>]
@@ -4606,6 +4642,7 @@
+
name
<string>
# select current dataset
@@ -4711,7 +4748,17 @@
-pow
Example:
- $ds9 -pow
+ $ds9 -pow
+
+ precision
+ Set region and coordinate output format precision.
+ Syntax:
+ -precision <linear> <degree> <hms>
+ <dms>
+ <arcmin> <arcsec>
+
+ Example:
+ $ds9 -precision 8 10 4 3 5 3
prefs
Controls various preference settings.
Syntax:
@@ -5105,6 +5152,7 @@
+
<filename> [image|table|slice]
Example:
@@ -5347,6 +5395,7 @@
+
[sigma <value>]
@@ -5354,6 +5403,7 @@
+
[sigmaminor <value>]
@@ -5361,6 +5411,7 @@
+
[angle <value>]
@@ -5368,6 +5419,7 @@
+
[match]
[lock [yes|no]]
@@ -5385,6 +5437,7 @@
+
-smooth sigmaminor 2.0
$ds9
@@ -5392,6 +5445,7 @@
+
-smooth angle 45
$ds9 -smooth
match
diff --git a/ds9/doc/ref/samp.html b/ds9/doc/ref/samp.html
index 0d0a32c..7bdf8d0 100644
--- a/ds9/doc/ref/samp.html
+++ b/ds9/doc/ref/samp.html
@@ -110,6 +110,7 @@
pixeltable
plot
png
+ precision
prefs
preserve
psprint
@@ -567,6 +568,7 @@
+
[crosshair]
[<ref>] [dec
<col>]
@@ -676,6 +678,7 @@
+
[match error <value> degrees|arcmin|arcsec]
[<ref>]
@@ -766,6 +769,7 @@
+
[match function 1and2|1not2|2not1]
[<ref>]
@@ -856,6 +860,7 @@
+
[match return 1and2|1only|2only]
[<ref>]
@@ -946,6 +951,7 @@
+
[match unique yes|no]
[<ref>] [maxrows
<number>]
@@ -1091,6 +1097,7 @@
+
[update]
[<ref>] [x
<col>]
@@ -2137,6 +2144,7 @@
+
Macros for more information.
Syntax:
iexam []
@@ -2252,6 +2260,7 @@
+
quality (1-100)
Syntax:
jpeg [new|slice] [<filename>] [1-100]
@@ -2760,6 +2769,7 @@
+
# title, title xaxis, title yaxis, dimension on line 1
[new [name <plotname>]
[line|bar|scatter] <title> <xaxis label> <yaxis
@@ -2837,6 +2847,7 @@
+
duplicate
@@ -2903,6 +2914,7 @@
+
[<plotname>] stats
[<plotname>]
@@ -2968,6 +2980,7 @@
+
list
[<plotname>]
@@ -3033,6 +3046,7 @@
+
loadconfig <filename>
[<plotname>] saveconfig
<filename>
@@ -3100,6 +3114,7 @@
+
[<plotname>] pagesetup orient [portrait|landscape]
[<plotname>] pagesetup
size [letter|legal|tabloid|poster|a4]
@@ -3167,6 +3182,7 @@
+
[<plotname>] print
[<plotname>] print destination
[printer|file]
@@ -3256,6 +3272,7 @@
+
legend [yes|no]
[<plotname>] legend position
[right|left|top|bottom]
@@ -3340,6 +3357,7 @@
+
shape
[circle|square|diamond|plus|splus|scross|triangle|arrow]
[<plotname>]
@@ -3406,6 +3424,7 @@
+
shape fill [yes|no]
[<plotname>]
@@ -3475,6 +3494,7 @@
+
[<plotname>]
@@ -3539,6 +3559,7 @@
+
smooth
[step|linear|cubic|quadratic|catrom]
@@ -3606,6 +3627,7 @@
+
[<plotname>]
@@ -3670,6 +3692,7 @@
+
color
<value>
@@ -3737,6 +3760,7 @@
+
[<plotname>]
@@ -3801,6 +3825,7 @@
+
width
<value>
@@ -3868,6 +3893,7 @@
+
[<plotname>]
@@ -3932,6 +3958,7 @@
+
dash [yes|no]
@@ -3998,6 +4025,7 @@
+
[<plotname>]
@@ -4062,6 +4090,7 @@
+
error [yes|no]
@@ -4128,6 +4157,7 @@
+
[<plotname>]
@@ -4192,6 +4222,7 @@
+
error color
<value>
@@ -4259,6 +4290,7 @@
+
[<plotname>]
@@ -4323,6 +4355,7 @@
+
color
<value>
@@ -4390,6 +4423,7 @@
+
[<plotname>]
@@ -4454,6 +4488,7 @@
+
error width
<value>
@@ -4521,6 +4556,7 @@
+
[<plotname>]
@@ -4585,6 +4621,7 @@
+
name
<string>
@@ -4676,6 +4713,7 @@
+
value = ds9.get(string cmd)
plot
stats
@@ -4771,6 +4809,7 @@
+
axis x auto
plot
@@ -4832,6 +4871,7 @@
+
axis x min
plot
@@ -4893,6 +4933,7 @@
+
axis x max
plot
@@ -4954,6 +4995,7 @@
+
axis x format
plot
@@ -5015,6 +5057,7 @@
+
legend
plot legend
position
@@ -5084,6 +5127,7 @@
+
font numbers size
plot
@@ -5149,6 +5193,7 @@
+
font numbers weight
plot
@@ -5214,6 +5259,7 @@
+
font numbers slant
plot
@@ -5279,6 +5325,7 @@
+
title
plot
@@ -5344,6 +5391,7 @@
+
title x
plot barmode
@@ -5441,6 +5489,7 @@
+
dash
plot
@@ -5506,6 +5555,7 @@
+
error
plot
@@ -5571,6 +5621,7 @@
+
error color
plot
@@ -5636,6 +5687,7 @@
+
error width
plot
@@ -5701,6 +5753,7 @@
+
name
ds9.set(string
@@ -5766,6 +5819,7 @@
+
cmd)
plot show yes
plot shape circle
@@ -5803,6 +5857,19 @@
png
png new
png slice
+ precision
+ Set region and coordinate output format precision.
+ Syntax:
+ precision <linear> <degree> <hms>
+ <dms>
+ <arcmin> <arcsec>
+
+ Example:
+ string value = ds9.get(string cmd)
+ precision
+ ds9.set(string cmd)
+ precision 8 10 4 3 5 3
+
prefs
Controls various preference settings.
Syntax:
@@ -6416,6 +6483,7 @@
+
[crosshair]
[<ref>]
[export sb|tsv <filename>]
@@ -6523,6 +6591,7 @@
+
[update]
Example:
@@ -6634,12 +6703,14 @@
+
[sigma <value>]
+
[sigmaminor <value>]
@@ -6647,6 +6718,7 @@
+
[angle <value>]
@@ -6654,6 +6726,7 @@
+
[match]
[lock [yes|no]]
[open|close]
@@ -6680,6 +6753,7 @@
+
sigma 2.0
smooth
@@ -6687,6 +6761,7 @@
+
sigmaminor 2.0
smooth
@@ -6694,6 +6769,7 @@
+
angle 45
smooth
@@ -6701,6 +6777,7 @@
+
open
smooth close
smooth match
@@ -6817,6 +6894,7 @@
+
compression method.
Syntax:
tiff [new|slice] [<filename>] [none|jpeg|packbits|deflate]
diff --git a/ds9/doc/ref/xpa.html b/ds9/doc/ref/xpa.html
index 4e21ce9..1987282 100644
--- a/ds9/doc/ref/xpa.html
+++ b/ds9/doc/ref/xpa.html
@@ -80,6 +80,7 @@
pixeltable
plot
png
+ precision
prefs
preserve
psprint
@@ -206,6 +207,7 @@
+
-p ds9 3d match
$xpaset -p ds9 3d lock
yes
@@ -213,6 +215,7 @@
+
-p ds9 3d open
$xpaset -p ds9 3d close
@@ -538,6 +541,7 @@
+
[crosshair]
[<ref>] [dec
<col>]
@@ -651,6 +655,7 @@
+
[match error <value> degrees|arcmin|arcsec]
[<ref>]
@@ -745,6 +750,7 @@
+
[match function 1and2|1not2|2not1]
[<ref>]
@@ -839,6 +845,7 @@
+
[match return 1and2|1only|2only]
[<ref>]
@@ -933,6 +940,7 @@
+
[match unique yes|no]
[<ref>] [maxrows
<number>]
@@ -1080,6 +1088,7 @@
+
[update]
[<ref>] [x
<col>]
@@ -1663,6 +1672,7 @@
+
-p ds9 export envi foo.hdr foo.bsq little
$xpaset -p ds9 export tiff
foo.tiff jpeg
@@ -2179,6 +2189,7 @@
+
quality (1-100)
Syntax:
jpeg [new|slice] [<filename>] [1-100]
@@ -2662,6 +2673,7 @@
+
# title, title xaxis, title yaxis, dimension on line 1
[new [name <plotname>]
[line|bar|scatter] <title> <xaxis label> <yaxis
@@ -2740,6 +2752,7 @@
+
duplicate
@@ -2807,6 +2820,7 @@
+
[<plotname>] stats
[<plotname>]
@@ -2873,6 +2887,7 @@
+
list
[<plotname>]
@@ -2939,6 +2954,7 @@
+
loadconfig <filename>
[<plotname>] saveconfig
<filename>
@@ -3007,6 +3023,7 @@
+
[<plotname>] pagesetup orient [portrait|landscape]
[<plotname>] pagesetup
size [letter|legal|tabloid|poster|a4]
@@ -3075,6 +3092,7 @@
+
[<plotname>] print
[<plotname>] print destination
[printer|file]
@@ -3165,6 +3183,7 @@
+
legend [yes|no]
[<plotname>] legend position
[right|left|top|bottom]
@@ -3242,6 +3261,7 @@
+
barmode [normal|stacked|aligned|overlap]
# configure current dataset
@@ -3311,6 +3331,7 @@
+
shape
[circle|square|diamond|plus|splus|scross|triangle|arrow]
[<plotname>]
@@ -3378,6 +3399,7 @@
+
shape fill [yes|no]
[<plotname>]
@@ -3448,6 +3470,7 @@
+
[<plotname>]
@@ -3513,6 +3536,7 @@
+
smooth
[step|linear|cubic|quadratic|catrom]
@@ -3581,6 +3605,7 @@
+
[<plotname>]
@@ -3646,6 +3671,7 @@
+
color
<value>
@@ -3714,6 +3740,7 @@
+
[<plotname>]
@@ -3779,6 +3806,7 @@
+
width
<value>
@@ -3847,6 +3875,7 @@
+
[<plotname>]
@@ -3912,6 +3941,7 @@
+
dash [yes|no]
@@ -3979,6 +4009,7 @@
+
[<plotname>]
@@ -4044,6 +4075,7 @@
+
error [yes|no]
@@ -4111,6 +4143,7 @@
+
[<plotname>]
@@ -4176,6 +4209,7 @@
+
error color
<value>
@@ -4244,6 +4278,7 @@
+
[<plotname>]
@@ -4309,6 +4344,7 @@
+
color
<value>
@@ -4377,6 +4413,7 @@
+
[<plotname>]
@@ -4442,6 +4479,7 @@
+
error width
<value>
@@ -4510,6 +4548,7 @@
+
[<plotname>]
@@ -4575,6 +4614,7 @@
+
name
<string>
@@ -4703,6 +4743,7 @@
+
ds9 plot axis x min
$xpaget
@@ -4769,6 +4810,7 @@
+
ds9 plot axis x max
$xpaget ds9 plot axis x format
$xpaget
@@ -4832,6 +4874,7 @@
+
ds9 plot legend
$xpaget ds9 plot
legend position
@@ -4902,6 +4945,7 @@
+
ds9 plot font numbers size
$xpaget
@@ -4968,6 +5012,7 @@
+
ds9 plot font numbers weight
$xpaget
@@ -5034,6 +5079,7 @@
+
ds9 plot font numbers slant
$xpaget
@@ -5100,6 +5146,7 @@
+
ds9 plot title
$xpaget
@@ -5166,6 +5213,7 @@
+
ds9 plot title x
$xpaget ds9 plot barmode
@@ -5261,6 +5309,7 @@
+
ds9 plot dash
$xpaget
@@ -5327,6 +5376,7 @@
+
ds9 plot error
$xpaget
@@ -5393,6 +5443,7 @@
+
ds9 plot error
color
$xpaget
@@ -5460,6 +5511,7 @@
+
ds9 plot error
width
$xpaget
@@ -5527,6 +5579,7 @@
+
ds9 plot name
$xpaset
@@ -5593,6 +5646,7 @@
+
-p ds9 plot show yes
$xpaset -p ds9 plot shape circle
$xpaset -p ds9 plot shape fill no
@@ -5625,7 +5679,18 @@
$cat foo.png | xpaset ds9 png new
# not available windows
$cat foo.png | xpaset ds9 png slice
- # not available windows
+ # not available windows
+
+ precision
+ Set region and coordinate output format precision.
+ Syntax:
+ precision <linear> <degree> <hms>
+ <dms>
+ <arcmin> <arcsec>
+
+ Example:
+ $xpaget ds9 precision
+ $xpaset -p ds9 precision 8 10 4 3 5 3
prefs
Controls various preference settings.
Syntax:
@@ -6111,6 +6176,7 @@
+
method.
Syntax:
saveimage [fits|eps|gif|tiff|jpeg|png] <filename>
@@ -6339,6 +6405,7 @@
+
[sigma <value>]
@@ -6346,6 +6413,7 @@
+
[sigmaminor <value>]
@@ -6353,6 +6421,7 @@
+
[angle <value>]
@@ -6360,6 +6429,7 @@
+
[match]
[lock [yes|no]]
[open|close]
@@ -6375,6 +6445,7 @@
+
ds9 smooth sigmaminor
$xpaget
ds9 smooth lock
@@ -6390,6 +6461,7 @@
+
-p ds9 smooth sigma 2.0
$xpaset
@@ -6397,6 +6469,7 @@
+
-p ds9 smooth sigmaminor 2.0
$xpaset
@@ -6404,6 +6477,7 @@
+
-p ds9 smooth angle 45
$xpaset
@@ -6411,6 +6485,7 @@
+
-p ds9 smooth match
$xpaset -p ds9 smooth lock yes
$xpaset -p ds9 smooth open
@@ -6526,6 +6601,7 @@
+
compression method.
Syntax:
tiff [new|slice] [<filename>] [none|jpeg|packbits|deflate]
diff --git a/ds9/doc/release/r7.6.html b/ds9/doc/release/r7.6.html
index 5b5dab7..6a3e836 100644
--- a/ds9/doc/release/r7.6.html
+++ b/ds9/doc/release/r7.6.html
@@ -163,6 +163,7 @@
01.09.2018 AST: updated to version 8.6.2.
01.10.2018 GUI: up prec of displayed coords for deg and hms.
01.11.2018 CATALOGS: update CDS server list.
+ 01.12.2018 PREFS: add support for precision.
xx.xx.2018 RELEASE version 7.6rc
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}
--
cgit v0.12