diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-05-17 18:14:32 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-05-17 18:14:32 (GMT) |
commit | fe9e2f84b0be4fe156e2e2945c1b24acc3afc074 (patch) | |
tree | 8585d5401906ee60493487cd5ef66f6f28e870f8 /ds9/library/fits.tcl | |
parent | 59df5db3b995a8af29721dda14dad28e99307913 (diff) | |
download | blt-fe9e2f84b0be4fe156e2e2945c1b24acc3afc074.zip blt-fe9e2f84b0be4fe156e2e2945c1b24acc3afc074.tar.gz blt-fe9e2f84b0be4fe156e2e2945c1b24acc3afc074.tar.bz2 |
add ds9 fits parser
Diffstat (limited to 'ds9/library/fits.tcl')
-rw-r--r-- | ds9/library/fits.tcl | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/ds9/library/fits.tcl b/ds9/library/fits.tcl index 6ceb311..36548cd 100644 --- a/ds9/library/fits.tcl +++ b/ds9/library/fits.tcl @@ -107,12 +107,20 @@ proc ProcessFitsCmd {varname iname sock fn} { return } - global loadParam - global current + global debug + if {$debug(tcl,parser)} { + global parse + set parse(sock) $sock + set parse(fn) $fn + + fits::YY_FLUSH_BUFFER + fits::yy_scan_string [lrange $var $i end] + fits::yyparse + incr i [expr $fits::yycnt-1] + } else { set layer {} set mode {} - switch -- [string tolower [lindex $var $i]] { new { incr i @@ -145,6 +153,27 @@ proc ProcessFitsCmd {varname iname sock fn} { } FinishLoad } +} + +proc FitsCmdLoad {param layer mode} { + global parse + + if {$parse(sock) != {}} { + # xpa + if {![LoadFitsSocket $parse(sock) $param $layer $mode]} { + InitError xpa + LoadFitsFile $param $layer $mode + } + } else { + # comm + if {$parse(fn) != {}} { + LoadFitsAlloc $parse(fn) $param $layer $mode + } else { + LoadFitsFile $param $layer $mode + } + } + FinishLoad +} proc ProcessSendFitsCmd {proc id param sock fn} { global current |