summaryrefslogtreecommitdiffstats
path: root/ds9/library/cube.tcl
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-06-07 19:10:36 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-06-07 19:10:36 (GMT)
commit75d81565076d3bab3e92a10c8e04fd949faaea90 (patch)
tree98452c618b63405efd457fc3621e7fc84d20e93e /ds9/library/cube.tcl
parent4fc3cdba34e1f5656fd0ecd62dbd10d3f608a399 (diff)
downloadblt-75d81565076d3bab3e92a10c8e04fd949faaea90.zip
blt-75d81565076d3bab3e92a10c8e04fd949faaea90.tar.gz
blt-75d81565076d3bab3e92a10c8e04fd949faaea90.tar.bz2
add ds9 cube send parser
Diffstat (limited to 'ds9/library/cube.tcl')
-rw-r--r--ds9/library/cube.tcl33
1 files changed, 12 insertions, 21 deletions
diff --git a/ds9/library/cube.tcl b/ds9/library/cube.tcl
index de4beca..d94955c 100644
--- a/ds9/library/cube.tcl
+++ b/ds9/library/cube.tcl
@@ -727,27 +727,18 @@ proc CubeCmdCoord {ss sys axis} {
}
proc ProcessSendCubeCmd {proc id param {sock {}} {fn {}}} {
- global cube
- global current
+ global parse
+ set parse(proc) $proc
+ set parse(id) $id
+
+ cubesend::YY_FLUSH_BUFFER
+ cubesend::yy_scan_string $param
+ cubesend::yyparse
+}
+
+proc CubeSendCmdInterval {} {
+ global parse
global blink
- switch -- [string tolower [lindex $param 0]] {
- lock {$proc $id "$cube(lock)\n"}
- axes -
- order {
- switch -- [string tolower [lindex $param 1]] {
- lock {$proc $id [ToYesNo $cube(lock,axes)]}
- default {$proc $id "$cube(axes)\n"}
- }
- }
- interval {$proc $id "[expr $blink(interval)/1000.]\n"}
- axis {$proc $id "$cube(axis)\n"}
- default {
- if {$current(frame) != {}} {
- $proc $id "[$current(frame) get fits slice $cube(axis)]\n"
- } else {
- $proc $id "1\n"
- }
- }
- }
+ $parse(proc) $parse(id) "[expr $blink(interval)/1000.]\n"
}