summaryrefslogtreecommitdiffstats
path: root/ds9
diff options
context:
space:
mode:
Diffstat (limited to 'ds9')
-rw-r--r--ds9/library/backup.tcl10
-rw-r--r--ds9/library/cat.tcl37
-rw-r--r--ds9/library/util.tcl40
-rw-r--r--ds9/parsers/backupparser.tac2
-rw-r--r--ds9/parsers/catparser.tac15
-rw-r--r--ds9/parsers/restoreparser.tac2
6 files changed, 48 insertions, 58 deletions
diff --git a/ds9/library/backup.tcl b/ds9/library/backup.tcl
index 3ad1c27..8390834 100644
--- a/ds9/library/backup.tcl
+++ b/ds9/library/backup.tcl
@@ -789,11 +789,6 @@ proc ProcessBackupCmd {varname iname} {
incr i [expr $backup::yycnt-1]
}
-proc BackupCmd {fn} {
- FileLast backupfbox $fn
- Backup $fn
-}
-
proc ProcessRestoreCmd {varname iname} {
upvar $varname var
upvar $iname i
@@ -804,9 +799,4 @@ proc ProcessRestoreCmd {varname iname} {
incr i [expr $restore::yycnt-1]
}
-proc RestoreCmd {fn} {
- FileLast backupfbox $fn
- Restore $fn
-}
-
diff --git a/ds9/library/cat.tcl b/ds9/library/cat.tcl
index 69391a6..0661ff7 100644
--- a/ds9/library/cat.tcl
+++ b/ds9/library/cat.tcl
@@ -1300,15 +1300,6 @@ proc CatalogCmdRef {ref} {
}
}
-proc CatalogCmdCoord {xx yy skyframe} {
- global cvarname
- upvar #0 $cvarname cvar
-
- set cvar(x) $xx
- set cvar(y) $yy
- set cvar(sky) $skyframe
-}
-
proc CatalogCmdFilterLoad {fn} {
global cvarname
upvar #0 $cvarname cvar
@@ -1358,24 +1349,6 @@ proc CatalogCmdMatchParams {cat1 cat2} {
}
}
-proc CatalogCmdMatchError {error eformat} {
- global icat
-
- set icat(error) $error
- set icat(eformat) $eformat
-}
-
-proc CatalogCmdPlot {xx yy xerr yerr} {
- global cvarname
- upvar #0 $cvarname cvar
-
- set cvar(plot,x) $xx
- set cvar(plot,y) $yy
- set cvar(plot,xerr) $xerr
- set cvar(plot,yerr) $yerr
- CATPlotGenerate $cvarname
-}
-
proc CatalogCmdSAMP {} {
global cvarname
global samp
@@ -1414,16 +1387,6 @@ proc CatalogCmdSave {fn writer} {
}
}
-proc CatalogCmdSize {width height rformat} {
- global cvarname
- upvar #0 $cvarname cvar
-
- set cvar(width) $width
- set cvar(height) $height
- set cvar(rformat) $rformat
- set cvar(rformat,msg) $rformat
-}
-
proc CatalogCmdSkyframe {skyframe} {
global cvarname
upvar #0 $cvarname cvar
diff --git a/ds9/library/util.tcl b/ds9/library/util.tcl
index 3bf1339..09cbe48 100644
--- a/ds9/library/util.tcl
+++ b/ds9/library/util.tcl
@@ -217,11 +217,47 @@ proc ProcessCmdAppend {varname key value {cmd {}}} {
}
}
-proc ProcessCmdCVAR {which value {cmd {}}} {
+proc ProcessCmdCVAR {key value {cmd {}}} {
global cvarname
upvar #0 $cvarname cvar
- set cvar($which) $value
+ set cvar($key) $value
+ if {$cmd != {}} {
+ eval $cmd $cvarname
+ }
+}
+
+proc ProcessCmdCVAR2 {key value key2 value2 {cmd {}}} {
+ global cvarname
+ upvar #0 $cvarname cvar
+
+ set cvar($key) $value
+ set cvar($key2) $value2
+ if {$cmd != {}} {
+ eval $cmd $cvarname
+ }
+}
+
+proc ProcessCmdCVAR3 {key value key2 value2 key3 value3 {cmd {}}} {
+ global cvarname
+ upvar #0 $cvarname cvar
+
+ set cvar($key) $value
+ set cvar($key2) $value2
+ set cvar($key3) $value3
+ if {$cmd != {}} {
+ eval $cmd $cvarname
+ }
+}
+
+proc ProcessCmdCVAR4 {key value key2 value2 key3 value3 key4 value4 {cmd {}}} {
+ global cvarname
+ upvar #0 $cvarname cvar
+
+ set cvar($key) $value
+ set cvar($key2) $value2
+ set cvar($key3) $value3
+ set cvar($key4) $value4
if {$cmd != {}} {
eval $cmd $cvarname
}
diff --git a/ds9/parsers/backupparser.tac b/ds9/parsers/backupparser.tac
index 5cf575e..256af50 100644
--- a/ds9/parsers/backupparser.tac
+++ b/ds9/parsers/backupparser.tac
@@ -11,7 +11,7 @@ command : backup
| backup {yyclearin; YYACCEPT} STRING_
;
-backup : STRING_ {BackupCmd $1}
+backup : STRING_ {FileLast backupfbox $1; Backup $1}
;
%%
diff --git a/ds9/parsers/catparser.tac b/ds9/parsers/catparser.tac
index b7b2b67..f4f3d0f 100644
--- a/ds9/parsers/catparser.tac
+++ b/ds9/parsers/catparser.tac
@@ -148,7 +148,7 @@ catCmd : coordinate
| MAXROWS_ INT_ {ProcessCmdCVAR max $2}
| NAME_ STRING_ {ProcessCmdCVAR name $2}
| PANTO_ yesno {ProcessCmdCVAR panto $2}
- | PLOT_ STRING_ STRING_ STRING_ STRING_ {CatalogCmdPlot $2 $3 $4 $5}
+ | PLOT_ STRING_ STRING_ STRING_ STRING_ {ProcessCmdCVAR4 plot,x $2 plot,y $3 plot,xerr $4 plot,yerr $5 CATPlotGenerate}
| PRINT_ {global cvarname; CATPrint $cvarname}
| PSKY_ skyframe {ProcessCmdCVAR psky $2 CATGenerate}
| PSYSTEM_ wcssys {ProcessCmdCVAR psystem $2 CATGenerate}
@@ -158,7 +158,8 @@ catCmd : coordinate
| SAVE_ STRING_ {CatalogCmdSave $2 VOTWrite}
| SERVER_ server {ProcessCmdCVAR server $2}
| SHOW_ yesno {ProcessCmdCVAR show $2 CATGenerate}
- | SIZE_ numeric numeric rformat {CatalogCmdSize $2 $3 $4}
+ | SIZE_ numeric numeric rformat {ProcessCmdCVAR4 width $2 height $3 rformat $4 rformat,msg $4}
+# | SIZE_ numeric numeric rformat {CatalogCmdSize $2 $3 $4}
| SKY_ skyframe {CatalogCmdSkyframe $2}
| SKYFORMAT_ skyformat {ProcessCmdCVAR skyformat $2}
| SORT_ sort
@@ -172,10 +173,10 @@ catCmd : coordinate
| DEC_ STRING_ {ProcessCmdCVAR coly $2 CATGenerate}
;
-coordinate : numeric numeric {CatalogCmdCoord $1 $2 fk5}
- | numeric numeric skyframe {CatalogCmdCoord $1 $2 $3}
- | SEXSTR_ SEXSTR_ {CatalogCmdCoord $1 $2 fk5}
- | SEXSTR_ SEXSTR_ skyframe {CatalogCmdCoord $1 $2 $3}
+coordinate : numeric numeric {ProcessCmdCVAR3 x $1 y $2 sky fk5}
+ | numeric numeric skyframe {ProcessCmdCVAR3 x $1 y $2 sky $3}
+ | SEXSTR_ SEXSTR_ {ProcessCmdCVAR3 x $1 y $2 sky fk5}
+ | SEXSTR_ SEXSTR_ skyframe {ProcessCmdCVAR3 x $1 y $2 sky $3}
;
filter : LOAD_ STRING_ {CatalogCmdFilterLoad $2}
@@ -183,7 +184,7 @@ filter : LOAD_ STRING_ {CatalogCmdFilterLoad $2}
;
match : {CatalogCmdMatch}
- | ERROR_ numeric rformat {CatalogCmdMatchError $2 $3}
+ | ERROR_ numeric rformat {ProcessCmdSet2 icat error $2 eformat $3}
| FUNCTION_ matchFunction {ProcessCmdSet icat function $2}
| UNIQUE_ yesno {ProcessCmdSet icat unique $2}
| RETURN_ matchReturn {ProcessCmdSet icat return $2}
diff --git a/ds9/parsers/restoreparser.tac b/ds9/parsers/restoreparser.tac
index 6d9a6a6..157abce 100644
--- a/ds9/parsers/restoreparser.tac
+++ b/ds9/parsers/restoreparser.tac
@@ -11,7 +11,7 @@ command : restore
| restore {yyclearin; YYACCEPT} STRING_
;
-restore : STRING_ {RestoreCmd $1}
+restore : STRING_ {FileLast backupfbox $1; Restore $1}
;
%%