diff options
-rw-r--r-- | ds9/library/nrrd.tcl | 16 | ||||
-rw-r--r-- | ds9/library/photo.tcl | 41 | ||||
-rw-r--r-- | ds9/parsers/photoparser.tac | 8 |
3 files changed, 24 insertions, 41 deletions
diff --git a/ds9/library/nrrd.tcl b/ds9/library/nrrd.tcl index d4c78cd..1193eb1 100644 --- a/ds9/library/nrrd.tcl +++ b/ds9/library/nrrd.tcl @@ -86,9 +86,9 @@ proc ProcessNRRDCmd {varname iname sock fn} { global debug if {$debug(tcl,parser)} { - global nrrd - set nrrd(load,sock) $sock - set nrrd(load,fn) $fn + global parse + set parse(sock) $sock + set parse(fn) $fn nrrd::YY_FLUSH_BUFFER nrrd::yy_scan_string [lrange $var $i end] @@ -132,18 +132,18 @@ proc ProcessNRRDCmd {varname iname sock fn} { } proc NRRDCmdLoad {param layer} { - global nrrd + global parse - if {$nrrd(load,sock) != {}} { + if {$parse(sock) != {}} { # xpa - if {![ImportNRRDSocket $nrrd(load,sock) $param $layer]} { + if {![ImportNRRDSocket $parse(sock) $param $layer]} { InitError xpa ImportNRRDFile $param $layer } } else { # comm - if {$nrrd(load,fn) != {}} { - ImportNRRDAlloc $nrrd(load,fn) $param $layer + if {$parse(fn) != {}} { + ImportNRRDAlloc $parse(fn) $param $layer } else { ImportNRRDFile $param $layer } diff --git a/ds9/library/photo.tcl b/ds9/library/photo.tcl index 5fc43f1..0bdaaaf 100644 --- a/ds9/library/photo.tcl +++ b/ds9/library/photo.tcl @@ -205,10 +205,9 @@ proc ProcessPhotoCmd {varname iname ch fn} { global debug if {$debug(tcl,parser)} { - global photo - set photo(load,ch) $ch - set photo(load,fn) $fn - set photo(load,mode) {} + global parse + set parse(ch) $ch + set parse(fn) $fn photo::YY_FLUSH_BUFFER photo::yy_scan_string [lrange $var $i end] @@ -216,8 +215,6 @@ proc ProcessPhotoCmd {varname iname ch fn} { incr i [expr $photo::yycnt-1] } else { - global loadParam - global current set mode {} switch -- [string tolower [lindex $var $i]] { new { @@ -261,61 +258,47 @@ proc ProcessPhotoCmd {varname iname ch fn} { } } -proc PhotoCmdLoad {param} { - global photo +proc PhotoCmdLoad {param mode} { + global parse - if {$photo(load,ch) != {}} { + if {$parse(ch) != {}} { # xpa global tcl_platform switch $tcl_platform(os) { Linux - Darwin - SunOS { - if {![ImportPhotoSocket $photo(load,ch) $param $photo(load,mode)]} { + if {![ImportPhotoSocket $parse(ch) $param $mode]} { InitError xpa - ImportPhotoFile $param $photo(load,mode) + ImportPhotoFile $param $mode } } - {Windows NT} {ImportPhotoFile $param $photo(load,mode)} + {Windows NT} {ImportPhotoFile $param $mode} } } else { # comm - if {$photo(load,fn) != {}} { - ImportPhotoAlloc $photo(load,fn) $param $photo(load,mode) + if {$parse(fn) != {}} { + ImportPhotoAlloc $parse(fn) $param $mode } else { - ImportPhotoFile $param $phto(load,mode) + ImportPhotoFile $param $mode } } FinishLoad } -proc PhotoCmdSet {which value} { - global photo - - set photo($which) $value -} - proc ProcessSendGIFCmd {proc id param ch fn} { - global current - ProcessSendPhotoCmd gif $proc $id $param $ch $fn } proc ProcessSendJPEGCmd {proc id param ch fn} { - global current - ProcessSendPhotoCmd jpeg $proc $id $param $ch $fn } proc ProcessSendPNGCmd {proc id param ch fn} { - global current - ProcessSendPhotoCmd png $proc $id $param $ch $fn } proc ProcessSendTIFFCmd {proc id param ch fn} { - global current - ProcessSendPhotoCmd tiff $proc $id $param $ch $fn } diff --git a/ds9/parsers/photoparser.tac b/ds9/parsers/photoparser.tac index 2cf3dc7..7e6cb65 100644 --- a/ds9/parsers/photoparser.tac +++ b/ds9/parsers/photoparser.tac @@ -14,13 +14,13 @@ command : photo | photo {yyclearin; YYACCEPT} STRING_ ; -photo : opts {PhotoCmdLoad {}} - | opts STRING_ {PhotoCmdLoad $2} +photo : opts {PhotoCmdLoad {} $1} + | opts STRING_ {PhotoCmdLoad $2 $1} ; opts : - | NEW_ {CreateFrame} - | SLICE_ {PhotoCmdSet load,mode slice} + | NEW_ {CreateFrame; set _ {}} + | SLICE_ {set _ slice} ; %% |