summaryrefslogtreecommitdiffstats
path: root/ds9/library
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-06-20 18:28:04 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-06-20 18:28:04 (GMT)
commit119471842b7169d7d21aae6f3252362accafe52d (patch)
tree0249fcd18152568b8d282b510fca5318410eb5ce /ds9/library
parent5943ac30cb8ec59edd5bb977e9581e874b500f2b (diff)
downloadblt-119471842b7169d7d21aae6f3252362accafe52d.zip
blt-119471842b7169d7d21aae6f3252362accafe52d.tar.gz
blt-119471842b7169d7d21aae6f3252362accafe52d.tar.bz2
update ds9 parsers
Diffstat (limited to 'ds9/library')
-rw-r--r--ds9/library/analysis.tcl50
-rw-r--r--ds9/library/cat.tcl8
-rw-r--r--ds9/library/marker.tcl3
-rw-r--r--ds9/library/util.tcl21
4 files changed, 16 insertions, 66 deletions
diff --git a/ds9/library/analysis.tcl b/ds9/library/analysis.tcl
index 927ee02..2a9ba78 100644
--- a/ds9/library/analysis.tcl
+++ b/ds9/library/analysis.tcl
@@ -1860,56 +1860,10 @@ proc ProcessSendAnalysisCmd {proc id param sock fn} {
analysissend::YY_FLUSH_BUFFER
analysissend::yy_scan_string $param
analysissend::yyparse
- return
-
- global ianalysis
- global ime
-
- set result {}
- switch -- [string tolower [lindex $param 0]] {
- entry {
- AnalysisEntry [lrange $param 1 end] result
- append result "\n"
- $proc $id $result
- }
- mode {$proc $id "$ime(task)\n"}
- task {
- # invoke by name
- for {set ii 0} {$ii<$ianalysis(menu,count)} {incr ii} {
- append result "$ii $ianalysis(menu,$ii,item)\n"
- }
- $proc $id $result
- }
- lock {$proc $id "$ime(lock)\n"}
- default {
- for {set i 0} {$i<$ianalysis(menu,count)} {incr i} {
- append result "\#$i menu"
- append result "\n$ianalysis(menu,$i,item)"
- append result "\n$ianalysis(menu,$i,template)"
- if {$ianalysis(menu,$i,cmd) != {web}} {
- append result "\nmenu"
- append result "\n$ianalysis(menu,$i,cmd)"
- } else {
- append result "\n$ianalysis(menu,$i,cmd)"
- append result "\n$ianalysis(menu,$i,var)"
- }
- append result "\n\n"
- }
- for {set i 0} {$i<$ianalysis(bind,count)} {incr i} {
- set key [string range $ianalysis(bind,$i,item) 1 1]
- append result "\#$i bind"
- append result "\nbind key $ianalysis(bind,$i,item)"
- append result "\n$ianalysis(bind,$i,template)"
- append result "\nbind $key"
- append result "\n$ianalysis(bind,$i,cmd)"
- append result "\n\n"
- }
- ProcessSend $proc $id $sock $fn {.ans} $result
- }
- }
}
proc AnalysisSendCmd {} {
+ global parse
global ianalysis
for {set ii 0} {$ii<$ianalysis(menu,count)} {incr ii} {
@@ -1935,7 +1889,7 @@ proc AnalysisSendCmd {} {
append result "\n\n"
}
- ProcessSendCmdResult {.ans} $result
+ ProcessSend $parse(proc) $parse(id) $parse(sock) $parse(fn) {.ans} $result
}
proc AnalysisSendCmdEntry {txt} {
diff --git a/ds9/library/cat.tcl b/ds9/library/cat.tcl
index dac57ec..a875a36 100644
--- a/ds9/library/cat.tcl
+++ b/ds9/library/cat.tcl
@@ -1518,6 +1518,14 @@ proc ProcessSendCatalogCmd {proc id param sock fn} {
catsend::yyparse
}
+proc CatalogSendCmdHeader {} {
+ global parse
+ global cvarname
+
+ ProcessSend $parse(proc) $parse(id) $parse(sock) $parse(fn) \
+ {.txt} [CATGetHeader $cvarname]
+}
+
proc CatalogSendCmdRef {ref} {
global icat
global cvarname
diff --git a/ds9/library/marker.tcl b/ds9/library/marker.tcl
index a9c8f9e..4c2ebf6 100644
--- a/ds9/library/marker.tcl
+++ b/ds9/library/marker.tcl
@@ -1581,6 +1581,7 @@ proc ProcessSendRegionsCmd {proc id param sock fn} {
}
proc RegionSendCmd {} {
+ global parse
global marker
global current
@@ -1595,5 +1596,5 @@ proc RegionSendCmd {} {
set rr [$current(frame) marker list $marker(load,select) $marker(load,format) $marker(load,system) $marker(load,sky) $marker(load,skyformat) $marker(load,strip) $marker(load,props) $marker(load,tags)]
- ProcessSendCmdResult $ext $rr
+ ProcessSend $parse(proc) $parse(id) $parse(sock) $parse(fn) $ext $rr
}
diff --git a/ds9/library/util.tcl b/ds9/library/util.tcl
index 1bf0be1..9e26186 100644
--- a/ds9/library/util.tcl
+++ b/ds9/library/util.tcl
@@ -372,25 +372,11 @@ proc ProcessSendCmdSend {ext cmd} {
global current
if {$current(frame) == {}} {
- ProcessSendCmdResult $ext [$current(frame) $cmd]
+ ProcessSend $parse(proc) $parse(id) $parse(sock) $parse(fn) \
+ $ext [$current(frame) $cmd]
}
}
-proc ProcessSendCmdResult {ext rr} {
- global parse
-
- if {$parse(fn) != {}} {
- append parse(fn) $ext
- set ch [open $parse(fn) w]
- puts $ch $rr
- close $ch
- $parse(proc) $parse(id) {} $parse(fn)
- } else {
- $parse(proc) $parse(id) $rr
- }
-}
-
-# old
proc ProcessSend {proc id sock fn ext rr} {
if {$fn != {}} {
append fn $ext
@@ -1507,6 +1493,7 @@ proc ProcessSendDataCmd {proc id param sock fn} {
}
proc DataSendCmd {sys sky xx yy ww hh strip} {
+ global parse
global current
if {$current(frame) == {}} {
@@ -1522,7 +1509,7 @@ proc DataSendCmd {sys sky xx yy ww hh strip} {
append ss "$ii = $rr($ii)\n"
}
}
- ProcessSendCmdResult {.dat} $ss
+ ProcessSend $parse(proc) $parse(id) $parse(sock) $parse(fn) {.dat} $ss
}
proc ProcessIconifyCmd {varname iname} {