summaryrefslogtreecommitdiffstats
path: root/ds9/library
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-06-19 21:24:38 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-06-19 21:24:38 (GMT)
commit764b96185d0b6778f50724d14609e5083f81abec (patch)
tree6882bebdb2fb63caa89923b080e83a94e9e86b00 /ds9/library
parent621489ea721d60c8472d234b97e6757327292daa (diff)
downloadblt-764b96185d0b6778f50724d14609e5083f81abec.zip
blt-764b96185d0b6778f50724d14609e5083f81abec.tar.gz
blt-764b96185d0b6778f50724d14609e5083f81abec.tar.bz2
add ds9 iexam send parser
Diffstat (limited to 'ds9/library')
-rw-r--r--ds9/library/iexam.tcl108
-rw-r--r--ds9/library/source.tcl2
2 files changed, 110 insertions, 0 deletions
diff --git a/ds9/library/iexam.tcl b/ds9/library/iexam.tcl
index 144bd14..aeea756 100644
--- a/ds9/library/iexam.tcl
+++ b/ds9/library/iexam.tcl
@@ -54,6 +54,114 @@ proc IExamKey {which K xx yy} {
}
proc ProcessSendIExamCmd {proc id param {sock {}} {fn {}}} {
+ global parse
+ set parse(proc) $proc
+ set parse(id) $id
+
+ global iexam
+ global icursor
+ global current
+ set iexam(frame) {}
+ set iexam(x) {}
+ set iexam(y) {}
+ set iexam(event) {}
+ set iexam(mode) $current(mode)
+
+ set current(mode) iexam
+
+ set iexam(button) 1
+ set iexam(key) 0
+ set iexam(any) 0
+
+ global cvarname
+ set cvarname {iexam(button)}
+
+ # turn on blinking cursor
+ set icursor(timer) 1
+ CursorTimer
+
+ iexamsend::YY_FLUSH_BUFFER
+ iexamsend::yy_scan_string $param
+ iexamsend::yyparse
+
+ # turn off blinking cursor
+ set icursor(timer) 0
+
+ set current(mode) $iexam(mode)
+
+ set iexam(button) 0
+ set iexam(key) 0
+
+ set iexam(frame) {}
+ set iexam(x) {}
+ set iexam(y) {}
+ set iexam(event) {}
+ set iexam(mode) {}
+
+ unset cvarname
+}
+
+proc IExamSendCmdDest {which} {
+ global iexam
+ global cvarname
+
+ set iexam($which) 1
+ set cvarname "iexam($which)"
+}
+
+proc IExamSendCmdData {ww hh} {
+ global iexam
+
+ global cvarname
+ vwait $cvarname
+ ProcessSendCmdTxt "$iexam(event) [$iexam(frame) get data canvas $iexam(x) $iexam(y) $ww $hh]"
+}
+
+proc IExamSendCmdCoord {sys sky skyformat} {
+ global iexam
+
+ global cvarname
+ vwait $cvarname
+ ProcessSendCmdTxt "$iexam(event) [$iexam(frame) get coordinates $iexam(x) $iexam(y) $sys $sky $skyformat]"
+}
+
+proc IExamSendCmdMacro {cmd} {
+ global iexam
+
+ global cvarname
+ vwait $cvarname
+
+ # $width,$height,$depth,$bitpix
+ ParseXYBitpixMacro cmd $iexam(frame)
+
+ # $filename[$regions]
+ ParseFilenameRegionMacro cmd $iexam(frame)
+
+ # $filename
+ ParseFilenameMacro cmd $iexam(frame)
+
+ # $regions
+ ParseRegionMacro cmd $iexam(frame)
+
+ # $env
+ ParseEnvMacro cmd
+
+ # $pan
+ ParsePanMacro cmd $iexam(frame)
+
+ # $value
+ ParseValueMacro cmd $iexam(frame) $iexam(x) $iexam(y)
+
+ # $x,$y
+ ParseXYMacro cmd $iexam(frame) $iexam(x) $iexam(y)
+
+ # $z
+ ParseZMacro cmd $iexam(frame)
+
+ ProcessSendCmdTxt "$iexam(event) $cmd"
+}
+
+proc ProcessSendIExamCmdOld {proc id param {sock {}} {fn {}}} {
global iexam
global icursor
diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl
index 2fdd76d..88d3d76 100644
--- a/ds9/library/source.tcl
+++ b/ds9/library/source.tcl
@@ -268,6 +268,8 @@ source $ds9(root)/library/gridparser.tcl
source $ds9(root)/library/gridlex.tcl
source $ds9(root)/library/gridsendparser.tcl
source $ds9(root)/library/gridsendlex.tcl
+source $ds9(root)/library/iexamsendparser.tcl
+source $ds9(root)/library/iexamsendlex.tcl
source $ds9(root)/library/headerparser.tcl
source $ds9(root)/library/headerlex.tcl
source $ds9(root)/library/heightparser.tcl