summaryrefslogtreecommitdiffstats
path: root/ds9/library/util.tcl
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-06-20 16:48:48 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-06-20 16:48:48 (GMT)
commitd8a46fb55ae9ce363612f91a453413533bbfa307 (patch)
treef15f52f851a3be542373a19729575b3edf05c620 /ds9/library/util.tcl
parent764b96185d0b6778f50724d14609e5083f81abec (diff)
downloadblt-d8a46fb55ae9ce363612f91a453413533bbfa307.zip
blt-d8a46fb55ae9ce363612f91a453413533bbfa307.tar.gz
blt-d8a46fb55ae9ce363612f91a453413533bbfa307.tar.bz2
add ds9 data send parser
Diffstat (limited to 'ds9/library/util.tcl')
-rw-r--r--ds9/library/util.tcl72
1 files changed, 23 insertions, 49 deletions
diff --git a/ds9/library/util.tcl b/ds9/library/util.tcl
index 5aa9a5f..1bf0be1 100644
--- a/ds9/library/util.tcl
+++ b/ds9/library/util.tcl
@@ -1495,60 +1495,34 @@ proc CursorCmd {x y} {
}
proc ProcessSendDataCmd {proc id param sock fn} {
- global cube
- global blink
+ global parse
+ set parse(proc) $proc
+ set parse(id) $id
+ set parse(sock) $sock
+ set parse(fn) $fn
+
+ datasend::YY_FLUSH_BUFFER
+ datasend::yy_scan_string $param
+ datasend::yyparse
+}
+
+proc DataSendCmd {sys sky xx yy ww hh strip} {
global current
- if {$current(frame) != {}} {
- set sys [lindex $param 0]
- set sky [lindex $param 1]
- set x [lindex $param 2]
- set y [lindex $param 3]
- set w [lindex $param 4]
- set h [lindex $param 5]
- set strip [lindex $param 6]
- switch -- $sys {
- image -
- physical -
- detector -
- amplifier {
- set strip $h
- set h $w
- set w $y
- set y $x
- set x $sky
- set sky fk5
- }
+ if {$current(frame) == {}} {
+ return
+ }
- fk4 -
- b1950 -
- fk5 -
- j2000 -
- icrs -
- galactic -
- ecliptic {
- set strip $h
- set h $w
- set w $y
- set y $x
- set x $sky
- set sky $sys
- set sys wcs
- }
- }
- set strip [FromYesNo $strip]
-
- $current(frame) get data $sys $sky $x $y $w $h rr
- set ss {}
- foreach ii [array names rr] {
- if {$strip} {
- append ss "$rr($ii)\n"
- } else {
- append ss "$ii = $rr($ii)\n"
- }
+ $current(frame) get data $sys $sky $xx $yy $ww $hh rr
+ set ss {}
+ foreach ii [array names rr] {
+ if {$strip} {
+ append ss "$rr($ii)\n"
+ } else {
+ append ss "$ii = $rr($ii)\n"
}
- ProcessSend $proc $id $sock $fn {.dat} $ss
}
+ ProcessSendCmdResult {.dat} $ss
}
proc ProcessIconifyCmd {varname iname} {