summaryrefslogtreecommitdiffstats
path: root/ds9
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-07-12 15:29:41 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-07-12 15:29:41 (GMT)
commit805e9585c25c2bffbf1249f2706f31441c1ed569 (patch)
tree84bc01c9071b1da53c2049f0c1fda1d23b28dcb8 /ds9
parentc8702dff53493e0e91851f4206af846c41ef4491 (diff)
downloadblt-805e9585c25c2bffbf1249f2706f31441c1ed569.zip
blt-805e9585c25c2bffbf1249f2706f31441c1ed569.tar.gz
blt-805e9585c25c2bffbf1249f2706f31441c1ed569.tar.bz2
update parser
Diffstat (limited to 'ds9')
-rw-r--r--ds9/library/lex.fcl7
-rw-r--r--ds9/library/parser.tac18
-rw-r--r--ds9/library/util.tcl27
3 files changed, 50 insertions, 2 deletions
diff --git a/ds9/library/lex.fcl b/ds9/library/lex.fcl
index d96d55d..7586ac8 100644
--- a/ds9/library/lex.fcl
+++ b/ds9/library/lex.fcl
@@ -23,11 +23,15 @@ E [Ee][+-]?{D}+
-asinh {return $::ASINHCMD_}
-bg {return $::BGCMD_}
-background {return $::BGCMD_}
+-cursor {return $::CURSORCMD_}
-exit {return $::QUITCMD_}
-help {return $::HELPCMD_}
-histequ {return $::HISTEQUCMD_}
+-iconify {return $::ICONIFYCMD_}
+-irafalign {return $::IRAFALIGNCMD_}
-linear {return $::LINEARCMD_}
-log {return $::LOGCMD_}
+-lower {return $::LOWERCMD_}
-nan {return $::NANCMD_}
-orient {return $::ORIENTCMD_}
-pan {return $::PANCMD_}
@@ -36,11 +40,14 @@ E [Ee][+-]?{D}+
-private {return $::PRIVATECMD_}
-pow {return $::POWCMD_}
-quit {return $::QUITCMD_}
+-raise {return $::RAISECMD_}
-scale {return $::SCALECMD_}
-sinh {return $::SINHCMD_}
-sleep {return $::SLEEPCMD_}
+-source {return $::SOURCECMD_}
-squared {return $::SQUAREDCMD_}
-sqrt {return $::SQRTCMD_}
+-theme {return $::THREMECMD_}
-threads {return $::THREADSCMD_}
-zoom {return $::ZOOMCMD_}
-zscale {return $::ZSCALECMD_}
diff --git a/ds9/library/parser.tac b/ds9/library/parser.tac
index acf1868..9ce1e6f 100644
--- a/ds9/library/parser.tac
+++ b/ds9/library/parser.tac
@@ -19,11 +19,14 @@ set file(load) 0
%token ALIGNCMD_
%token ASINHCMD_
%token BGCMD_
+%token CURSORCMD_
%token HELPCMD_
%token HISTEQUCMD_
+%token ICONIFYCMD_
%token IRAFALIGNCMD_
%token LINEARCMD_
%token LOGCMD_
+%token LOWERCMD_
%token NANCMD_
%token ORIENTCMD_
%token PANCMD_
@@ -32,11 +35,14 @@ set file(load) 0
%token PRIVATECMD_
%token POWCMD_
%token QUITCMD_
+%token RAISECMD_
%token SCALECMD_
%token SINHCMD_
%token SLEEPCMD_
+%token SOURCECMD_
%token SQUAREDCMD_
%token SQRTCMD_
+%token THEMECMD_
%token THREADSCMD_
%token ZOOMCMD_
%token ZSCALECMD_
@@ -125,12 +131,15 @@ command : 2MASSCMD_ {2MASSDialog} 2mass
| ALIGNCMD_ align
| ASINHCMD_ {global scale; set scale(type) asinh; ChangeScale}
| BGCMD_ STRING_ {global pds9; set pds9(bg) $2; PrefsBgColor}
+ | CURSORCMD_ INT_ INT_ {CursorCmd $2 $3}
| HELPCMD_ {HelpCommand}
| HISTEQUCMD_ {global scale; set scale(type) histequ; ChangeScale}
# backward compatibility
+ | ICONIFYCMD_ iconify
| IRAFALIGNCMD_ yesno {global pds9; set pds9(iraf) $2; PrefsIRAFAlign}
| LINEARCMD_ {global scale; set scale(type) linear; ChangeScale}
| LOGCMD_ {global scale; set scale(type) log; ChangeScale}
+ | LOWERCMD_ {global ds9; lower $ds9(top)}
| NANCMD_ STRING_ {global pds9; set pds9(nan) $2; PrefsNanColor}
| ORIENTCMD_ orient
| PANCMD_ pan
@@ -140,11 +149,15 @@ command : 2MASSCMD_ {2MASSDialog} 2mass
| PRIVATECMD_
| POWCMD_ {global scale; set scale(type) pow; ChangeScale}
| QUITCMD_ {QuitDS9}
+ | RAISECMD_ {global ds9; raise $ds9(top)}
| SINHCMD_ {global scale; set scale(type) sinh; ChangeScale}
| SLEEPCMD_ {UpdateDS9; RealizeDS9} sleep
+ | SOURCECMD_ STRING_ {SourceFileCmd $2}
| SQUAREDCMD_ {global scale; set scale(type) squared; ChangeScale}
| SQRTCMD_ {global scale; set scale(type) sqrt; ChangeScale}
| SCALECMD_ scale
+ # backward compatibility
+ | THEMECMD_
| THREADSCMD_ INT_ {global ds9; set ds9(threads) $2; ChangeThreads}
| ZOOMCMD_ {ProcessRealizeDS9} zoom
| ZSCALECMD_ zscale
@@ -282,6 +295,11 @@ align : {global current; set current(align) 1; AlignWCSFrame}
| yesno {global current; set current(align) $1; AlignWCSFrame}
;
+iconify : {global ds9; wm iconify $ds9(top)}
+ | yes {global ds9; wm iconify $ds9(top)}
+ | no {global ds9; wm deiconify $ds9(top)}
+ ;
+
orient : orientation {global current; set current(orient) $1; ChangeOrient}
| OPEN_ {PanZoomDialog}
| CLOSE_ {PanZoomDestroyDialog}
diff --git a/ds9/library/util.tcl b/ds9/library/util.tcl
index 808dcd1..c14a43b 100644
--- a/ds9/library/util.tcl
+++ b/ds9/library/util.tcl
@@ -1336,6 +1336,28 @@ proc ProcessCursorCmd {varname iname} {
}
}
+proc CursorCmd {x y} {
+ global current
+
+ if {$current(frame) != {}} {
+ switch -- $current(mode) {
+ none {$current(frame) warp $x $y}
+ pointer -
+ region {MarkerArrowKey $current(frame) $x $y}
+ catalog {MarkerArrowKey $current(frame) $x $y}
+ crosshair {CrosshairArrowKey $current(frame) $x $y}
+ colorbar {}
+ pan {Pan $x $y canvas}
+ zoom -
+ rotate -
+ crop {}
+ analysis {IMEArrowKey $current(frame) $x $y}
+ examine -
+ iexam {}
+ }
+ }
+}
+
proc ProcessSendDataCmd {proc id param sock fn} {
global cube
global blink
@@ -1489,12 +1511,13 @@ proc ProcessSleepCmd {varname iname} {
proc ProcessSourceCmd {varname iname} {
upvar $varname var
upvar $iname i
+ SourceFileCmd [lindex $var $i]
+}
+proc SourceFileCmd {fn} {
# we need to be realized
# you never know what someone will try to do
ProcessRealizeDS9
-
- set fn [lindex $var $i]
uplevel #0 "source $fn"
}