diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-05-09 17:40:14 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-05-09 17:40:14 (GMT) |
commit | 564e1f08a369740a5b081c0c29d88459c9ae1002 (patch) | |
tree | 8d1612660f2e751f187fe487395e3e6e60d26943 /ds9/library/photo.tcl | |
parent | 20f0238cf86a6819ed9071d84a4620e6b2ce5d2d (diff) | |
download | blt-564e1f08a369740a5b081c0c29d88459c9ae1002.zip blt-564e1f08a369740a5b081c0c29d88459c9ae1002.tar.gz blt-564e1f08a369740a5b081c0c29d88459c9ae1002.tar.bz2 |
add ds9 photo parsers
Diffstat (limited to 'ds9/library/photo.tcl')
-rw-r--r-- | ds9/library/photo.tcl | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/ds9/library/photo.tcl b/ds9/library/photo.tcl index 60d5557..5fc43f1 100644 --- a/ds9/library/photo.tcl +++ b/ds9/library/photo.tcl @@ -203,11 +203,22 @@ proc ProcessPhotoCmd {varname iname ch fn} { upvar 2 $varname var upvar 2 $iname i + global debug + if {$debug(tcl,parser)} { + global photo + set photo(load,ch) $ch + set photo(load,fn) $fn + set photo(load,mode) {} + + photo::YY_FLUSH_BUFFER + photo::yy_scan_string [lrange $var $i end] + photo::yyparse + incr i [expr $photo::yycnt-1] + } else { + global loadParam global current - set mode {} - switch -- [string tolower [lindex $var $i]] { new { incr i @@ -248,6 +259,41 @@ proc ProcessPhotoCmd {varname iname ch fn} { } FinishLoad } +} + +proc PhotoCmdLoad {param} { + global photo + + if {$photo(load,ch) != {}} { + # xpa + global tcl_platform + switch $tcl_platform(os) { + Linux - + Darwin - + SunOS { + if {![ImportPhotoSocket $photo(load,ch) $param $photo(load,mode)]} { + InitError xpa + ImportPhotoFile $param $photo(load,mode) + } + } + {Windows NT} {ImportPhotoFile $param $photo(load,mode)} + } + } else { + # comm + if {$photo(load,fn) != {}} { + ImportPhotoAlloc $photo(load,fn) $param $photo(load,mode) + } else { + ImportPhotoFile $param $phto(load,mode) + } + } + FinishLoad +} + +proc PhotoCmdSet {which value} { + global photo + + set photo($which) $value +} proc ProcessSendGIFCmd {proc id param ch fn} { global current |