summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-06-05 19:02:19 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-06-05 19:02:19 (GMT)
commit44b1f9f425e4c7708ad086ff066c3cd92eed5af8 (patch)
treee2af9a4ea4fe18fcd8c8d5470a076f0d2f1d0630
parentdba5cc81beb293afe82fd4f51a9844ae05ce8fe6 (diff)
downloadblt-44b1f9f425e4c7708ad086ff066c3cd92eed5af8.zip
blt-44b1f9f425e4c7708ad086ff066c3cd92eed5af8.tar.gz
blt-44b1f9f425e4c7708ad086ff066c3cd92eed5af8.tar.bz2
add ds9 pan send parser
-rw-r--r--ds9/library/comm.tcl2
-rw-r--r--ds9/library/contour.tcl2
-rw-r--r--ds9/library/marker.tcl130
-rw-r--r--ds9/library/panzoom.tcl15
-rw-r--r--ds9/library/source.tcl2
-rw-r--r--ds9/library/xpa.tcl2
6 files changed, 11 insertions, 142 deletions
diff --git a/ds9/library/comm.tcl b/ds9/library/comm.tcl
index 28c2c15..8be7f98 100644
--- a/ds9/library/comm.tcl
+++ b/ds9/library/comm.tcl
@@ -239,7 +239,7 @@ proc CommGet {proc id paramlist fn} {
colorbar {ProcessSendColorbarCmd $proc $id $param}
console {}
contours -
- contour {ProcessSendContourCmd $proc $id $param {} $fn}
+ contour {ProcessSendContourCmd $proc $id $param}
crop {ProcessSendCropCmd $proc $id $param}
crosshair {ProcessSendCrosshairCmd $proc $id $param}
cursor {}
diff --git a/ds9/library/contour.tcl b/ds9/library/contour.tcl
index b87a587..887e881 100644
--- a/ds9/library/contour.tcl
+++ b/ds9/library/contour.tcl
@@ -1177,7 +1177,7 @@ proc ContourCmdGenerate {} {
UpdateContour
}
-proc ProcessSendContourCmd {proc id param sock fn} {
+proc ProcessSendContourCmd {proc id param {sock {}} {fn {}}} {
global parse
set parse(proc) $proc
set parse(id) $id
diff --git a/ds9/library/marker.tcl b/ds9/library/marker.tcl
index 12a7a52..af426e1 100644
--- a/ds9/library/marker.tcl
+++ b/ds9/library/marker.tcl
@@ -1565,7 +1565,6 @@ proc RegionCmdCommand {cmd} {
}
proc ProcessSendRegionsCmd {proc id param sock fn} {
- if {1} {
global parse
set parse(proc) $proc
set parse(id) $id
@@ -1585,135 +1584,6 @@ proc ProcessSendRegionsCmd {proc id param sock fn} {
regionsend::YY_FLUSH_BUFFER
regionsend::yy_scan_string $param
regionsend::yyparse
- } else {
-
- global current
- global marker
- global pmarker
- if {$current(frame) == {}} {
- return
- }
-
- switch -- [lindex $param 0] {
- epsilon {$proc $id "$pmarker(epsilon)\n"}
- show {$proc $id [ToYesNo $marker(show)]}
- showtext {$proc $id [ToYesNo $marker(show,text)]}
- centroid {
- switch -- [lindex $param 1] {
- auto {$proc $id [ToYesNo $marker(centroid,auto)]}
- radius {$proc $id "$marker(centroid,radius)\n"}
- iteration {$proc $id "$marker(centroid,iteration)\n"}
- }
- }
- autocentroid {$proc $id [ToYesNo $marker(centroid,auto)]}
- format {$proc $id "$marker(format)\n"}
- coord -
- system {$proc $id "$marker(system)\n"}
- sky {$proc $id "$marker(sky)\n"}
- coordformat -
- skyformat {$proc $id "$marker(skyformat)\n"}
- strip {$proc $id [ToYesNo $marker(strip)]}
- delim {
- if {$marker(strip)} {
- $proc $id "semicolon\n"
- } else {
- $proc $id "nl\n"
- }
- }
- shape {$proc $id "$marker(shape)\n"}
- color {$proc $id "$marker(color)\n"}
- width {$proc $id "$marker(width)\n"}
-
- tag -
- tags -
- group -
- groups {$proc $id "[lsort [$current(frame) get marker tag all]]\n"}
-
- default {
- set format $marker(format)
- set sys $marker(system)
- set sky $marker(sky)
- set skyformat $marker(skyformat)
- set strip $marker(strip)
- set select {}
- set props {}
- set tags {}
-
- set i 0
- set l [llength $param]
- while {$i < $l} {
- switch -- [lindex $param $i] {
- -format {incr i; set format [lindex $param $i]}
- -sys -
- -coord -
- -system {
- incr i
- # for backward compatibility
- switch -- [lindex $param $i] {
- fk4 -
- fk5 -
- icrs -
- galactic -
- ecliptic {
- set sys wcs
- set sky [lindex $param $i]
- }
-
- default {set sys [lindex $param $i]}
- }
- }
- -sky {incr i; set sky [lindex $param $i]}
- -coordformat -
- -skyformat {
- incr i
- switch -- [lindex $param $i] {
- deg -
- degree -
- degrees {set skyformat degrees}
- default {set skyformat [lindex $param $i]}
- }
- }
- -strip {
- incr i;
- set strip [FromYesNo [lindex $param $i]]
- }
- -delim {
- incr i;
- if {[lindex $param $i] != "nl"} {
- set strip 1
- } else {
- set strip 0
- }
- }
-
- include {append props " include = 1"}
- exclude {append props " include = 0"}
- source {append props " source = 1"}
- background {append props " source = 0"}
- selected {set select "select"}
- -prop {
- append props " [lindex $param [expr $i+1]] = [lindex $param [expr $i+2]]"
- incr i 2
- }
- -tag -
- -group {
- incr i
- append tags "tag = \{[lindex $param $i]\}"
- }
- }
- incr i
- }
-
- switch -- $format {
- xml {set ext {.xml}}
- default {set ext {.rgn}}
- }
- ProcessSend $proc $id $sock $fn $ext \
- [$current(frame) marker list $select $format \
- $sys $sky $skyformat $strip $props $tags]
- }
- }
-}
}
proc RegionSendCmd {} {
diff --git a/ds9/library/panzoom.tcl b/ds9/library/panzoom.tcl
index 89632a3..b17d8a6 100644
--- a/ds9/library/panzoom.tcl
+++ b/ds9/library/panzoom.tcl
@@ -691,16 +691,13 @@ proc ProcessPanCmd {varname iname} {
}
proc ProcessSendPanCmd {proc id param {sock {}} {fn {}}} {
- global current
-
- set sys [lindex $param 0]
- set sky [lindex $param 1]
- set format [lindex $param 2]
- FixSpec sys sky format physical fk5 degrees
+ global parse
+ set parse(proc) $proc
+ set parse(id) $id
- if {$current(frame) != {}} {
- $proc $id "[$current(frame) get cursor $sys $sky $format]\n"
- }
+ pansend::YY_FLUSH_BUFFER
+ pansend::yy_scan_string $param
+ pansend::yyparse
}
proc ProcessZoomCmd {varname iname} {
diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl
index a9b124b..b97c6a8 100644
--- a/ds9/library/source.tcl
+++ b/ds9/library/source.tcl
@@ -300,6 +300,8 @@ source $ds9(root)/library/pagesetupparser.tcl
source $ds9(root)/library/pagesetuplex.tcl
source $ds9(root)/library/panparser.tcl
source $ds9(root)/library/panlex.tcl
+source $ds9(root)/library/pansendparser.tcl
+source $ds9(root)/library/pansendlex.tcl
source $ds9(root)/library/photoparser.tcl
source $ds9(root)/library/photolex.tcl
source $ds9(root)/library/pixeltableparser.tcl
diff --git a/ds9/library/xpa.tcl b/ds9/library/xpa.tcl
index f071cc3..16aa16b 100644
--- a/ds9/library/xpa.tcl
+++ b/ds9/library/xpa.tcl
@@ -859,7 +859,7 @@ proc XPARcvdConsole {xpa cdata param buf len} {
proc XPASendContour {xpa cdata param} {
InitError xpa
- catch {ProcessSendContourCmd xpasetbuf $xpa $param {} {}}
+ catch {ProcessSendContourCmd xpasetbuf $xpa $param}
XPACatchError $xpa
}