diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-05-10 16:38:20 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-05-10 16:38:20 (GMT) |
commit | 583f23d32829ac3d0c605747f3c08b686ed49c66 (patch) | |
tree | df9e202d10c25c7a67f97433a90f49bf946e5e85 /ds9/library/rgbcube.tcl | |
parent | 862a4a9a3489bc2f064416e8d567c4e7d5c8fd62 (diff) | |
download | blt-583f23d32829ac3d0c605747f3c08b686ed49c66.zip blt-583f23d32829ac3d0c605747f3c08b686ed49c66.tar.gz blt-583f23d32829ac3d0c605747f3c08b686ed49c66.tar.bz2 |
add ds9 rgbcube parser
Diffstat (limited to 'ds9/library/rgbcube.tcl')
-rw-r--r-- | ds9/library/rgbcube.tcl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ds9/library/rgbcube.tcl b/ds9/library/rgbcube.tcl index dfd2e2f..76424ce 100644 --- a/ds9/library/rgbcube.tcl +++ b/ds9/library/rgbcube.tcl @@ -111,6 +111,18 @@ proc ProcessRGBCubeCmd {varname iname sock fn} { upvar $varname var upvar $iname i + global debug + if {$debug(tcl,parser)} { + global rgbcube + set rgbcube(load,sock) $sock + set rgbcube(load,fn) $fn + + rgbcube::YY_FLUSH_BUFFER + rgbcube::yy_scan_string [lrange $var $i end] + rgbcube::yyparse + incr i [expr $rgbcube::yycnt-1] + } else { + switch -- [string tolower [lindex $var $i]] { new { incr i @@ -143,6 +155,27 @@ proc ProcessRGBCubeCmd {varname iname sock fn} { } FinishLoad } +} + +proc RGBCubeCmdLoad {param} { + global rgbcube + + if {$rgbcube(load,sock) != {}} { + # xpa + if {![LoadRGBCubeSocket $rgbcube(load,sock) $param]} { + InitError xpa + LoadRGBCubeFile $param + } + } else { + # comm + if {$rgbcube(load,fn) != {}} { + LoadRGBCubeAlloc $rgbcube(load,fn) $param + } else { + LoadRGBCubeFile $param + } + } + FinishLoad +} proc ProcessSendRGBCubeCmd {proc id param sock fn} { global current |