summaryrefslogtreecommitdiffstats
path: root/ds9
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-06-01 18:15:41 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-06-01 18:15:41 (GMT)
commit15bd8441b3977ccd664fdbc4a8d07e8931be480a (patch)
tree5adeafbad450db1c655a35ac12cf529f31a3e6df /ds9
parent8e8bd1009288bdd7b174c9d2da42bbd4681bc6d2 (diff)
downloadblt-15bd8441b3977ccd664fdbc4a8d07e8931be480a.zip
blt-15bd8441b3977ccd664fdbc4a8d07e8931be480a.tar.gz
blt-15bd8441b3977ccd664fdbc4a8d07e8931be480a.tar.bz2
update ds9 send parsers
Diffstat (limited to 'ds9')
-rw-r--r--ds9/library/crop.tcl74
-rw-r--r--ds9/library/source.tcl2
-rw-r--r--ds9/parsers/binsendparser.tac2
-rw-r--r--ds9/parsers/blocksendparser.tac2
-rw-r--r--ds9/parsers/cropsendlex.fcl17
-rw-r--r--ds9/parsers/cropsendparser.tac53
-rw-r--r--ds9/parsers/gridsendparser.tac2
7 files changed, 84 insertions, 68 deletions
diff --git a/ds9/library/crop.tcl b/ds9/library/crop.tcl
index b505b18..3082a4a 100644
--- a/ds9/library/crop.tcl
+++ b/ds9/library/crop.tcl
@@ -400,73 +400,11 @@ proc ProcessCropCmd {varname iname} {
}
proc ProcessSendCropCmd {proc id param {sock {}} {fn {}}} {
- global crop
- global current
- switch -- [string tolower [lindex $param 0]] {
- lock {$proc $id "$crop(lock)\n"}
- 3d {
- set sys [lindex $param 1]
- FixSpecSystem sys physical
-
- if {$current(frame) != {}} {
- $proc $id "[$current(frame) get crop 3d $sys]\n"
- }
- }
- default {
- set sys [lindex $param 0]
- set sky [lindex $param 1]
- set format [lindex $param 2]
- set dformat [lindex $param 3]
- FixSpec sys sky format physical fk5 degrees
-
- if {$current(frame) != {}} {
- $proc $id "[$current(frame) get crop center $sys $sky $format $sys $dformat]\n"
- }
- }
- }
-}
-
-proc FixSpecSystem {sysname defsys} {
- upvar $sysname sys
-
- set rr 0
-
- switch -- $sys {
- image -
- physical -
- detector -
- amplifier -
- wcs -
- wcsa -
- wcsb -
- wcsc -
- wcsd -
- wcse -
- wcsf -
- wcsg -
- wcsh -
- wcsi -
- wcsj -
- wcsk -
- wcsl -
- wcsm -
- wcsn -
- wcso -
- wcsp -
- wcsq -
- wcsr -
- wcss -
- wcst -
- wcsu -
- wcsv -
- wcsw -
- wcsx -
- wcsy -
- wcsz {incr rr}
- default {
- set sys $defsys
- }
- }
+ global parse
+ set parse(proc) $proc
+ set parse(id) $id
- return $rr
+ cropsend::YY_FLUSH_BUFFER
+ cropsend::yy_scan_string $param
+ cropsend::yyparse
}
diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl
index 581b9a7..60862b5 100644
--- a/ds9/library/source.tcl
+++ b/ds9/library/source.tcl
@@ -218,6 +218,8 @@ source $ds9(root)/library/contourparser.tcl
source $ds9(root)/library/contourlex.tcl
source $ds9(root)/library/cropparser.tcl
source $ds9(root)/library/croplex.tcl
+source $ds9(root)/library/cropsendparser.tcl
+source $ds9(root)/library/cropsendlex.tcl
source $ds9(root)/library/crosshairparser.tcl
source $ds9(root)/library/crosshairlex.tcl
source $ds9(root)/library/cubeparser.tcl
diff --git a/ds9/parsers/binsendparser.tac b/ds9/parsers/binsendparser.tac
index 859551d..7c6266f 100644
--- a/ds9/parsers/binsendparser.tac
+++ b/ds9/parsers/binsendparser.tac
@@ -12,6 +12,8 @@
%token FUNCTION_
%token LOCK_
+%start binsend
+
%%
binsend : LOCK_ {ProcessSendCmdYesNo bin lock}
diff --git a/ds9/parsers/blocksendparser.tac b/ds9/parsers/blocksendparser.tac
index 551f7ca..786928d 100644
--- a/ds9/parsers/blocksendparser.tac
+++ b/ds9/parsers/blocksendparser.tac
@@ -3,6 +3,8 @@
#include string.tin
+%start blocksend
+
%token LOCK_
%%
diff --git a/ds9/parsers/cropsendlex.fcl b/ds9/parsers/cropsendlex.fcl
new file mode 100644
index 0000000..10ec937
--- /dev/null
+++ b/ds9/parsers/cropsendlex.fcl
@@ -0,0 +1,17 @@
+#tab cropsendparser.tab.tcl
+
+%{
+%}
+
+#include defs.fin
+
+%%
+
+3d {return $3D_}
+
+#include matchlock.fin
+#include coords.fin
+#include string.fin
+
+%%
+
diff --git a/ds9/parsers/cropsendparser.tac b/ds9/parsers/cropsendparser.tac
new file mode 100644
index 0000000..b6100cb
--- /dev/null
+++ b/ds9/parsers/cropsendparser.tac
@@ -0,0 +1,53 @@
+%{
+%}
+
+#include matchlock.tin
+#include coords.tin
+#include string.tin
+
+%start cropsend
+
+%token 3D_
+
+%%
+
+#include matchlock.trl
+#include coords.trl
+
+cropsend : {ProcessSendCmdCurrent "get crop center physical fk5 degrees physical degrees"}
+ | coordsys {ProcessSendCmdCurrent "get crop center $1 fk5 degrees $1 degrees"}
+
+ | wcssys {ProcessSendCmdCurrent "get crop center $1 fk5 degrees $1 degrees"}
+ | skyframe {ProcessSendCmdCurrent "get crop center wcs $1 degrees wcs degrees"}
+
+ | wcssys skyformat
+ {ProcessSendCmdCurrent "get crop center $1 fk5 $2 $1 degrees"}
+ | skyframe skyformat
+ {ProcessSendCmdCurrent "get crop center wcs $1 $2 wcs degrees"}
+
+ | wcssys skyformat rformat
+ {ProcessSendCmdCurrent "get crop center $1 fk5 $2 $1 $3"}
+ | skyframe skyformat rformat
+ {ProcessSendCmdCurrent "get crop center wcs $1 $2 wcs $3"}
+
+ | wcssys skyframe skyformat rformat
+ {ProcessSendCmdCurrent "get crop center $1 $2 $3 $1 $4"}
+
+ | 3D_ 3d
+ | LOCK_ {ProcessSendCmdGet crop lock}
+ ;
+
+3d : {ProcessSendCmdCurrent "get crop 3d image"}
+ | coordsys {ProcessSendCmdCurrent "get crop 3d $1"}
+ | wcssys {ProcessSendCmdCurrent "get crop 3d $1"}
+ ;
+
+%%
+
+proc cropsend::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}
diff --git a/ds9/parsers/gridsendparser.tac b/ds9/parsers/gridsendparser.tac
index 769c824..c0509e9 100644
--- a/ds9/parsers/gridsendparser.tac
+++ b/ds9/parsers/gridsendparser.tac
@@ -4,6 +4,8 @@
#include font.tin
#include string.tin
+%start gridsend
+
%token AXES_
%token BORDER_
%token COLOR_