diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-06-04 18:56:09 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-06-04 18:56:09 (GMT) |
commit | b2e4e09a867e5818a145eaf346e69cd88efeadc5 (patch) | |
tree | 306de34d0d914e9970f24aa6b3bbec57f4507355 /ds9/library/cat.tcl | |
parent | c4d56a837ea043404ca8cff41330770bc0614b1f (diff) | |
download | blt-b2e4e09a867e5818a145eaf346e69cd88efeadc5.zip blt-b2e4e09a867e5818a145eaf346e69cd88efeadc5.tar.gz blt-b2e4e09a867e5818a145eaf346e69cd88efeadc5.tar.bz2 |
add ds9 catalog send parser
Diffstat (limited to 'ds9/library/cat.tcl')
-rw-r--r-- | ds9/library/cat.tcl | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/ds9/library/cat.tcl b/ds9/library/cat.tcl index c97c12e..0fc90fa 100644 --- a/ds9/library/cat.tcl +++ b/ds9/library/cat.tcl @@ -1541,8 +1541,24 @@ proc CatalogCmdSymbolSave {fn} { } proc ProcessSendCatalogCmd {proc id param sock fn} { + if {1} { + global parse + set parse(proc) $proc + set parse(id) $id + set parse(sock) $sock + set parse(fn) $fn + global icat + set ref [lindex $icat(cats) end] + global cvarname + set cvarname $ref + + catsend::YY_FLUSH_BUFFER + catsend::yy_scan_string $param + catsend::yyparse + } else { + global icat set cc [lindex $icat(cats) end] switch -- [string tolower [lindex $param 0]] { header {} @@ -1557,3 +1573,24 @@ proc ProcessSendCatalogCmd {proc id param sock fn} { header {ProcessSend $proc $id $sock $fn {.txt} "[CATGetHeader $cc]\n"} } } +} + +proc CatalogSendCmdRef {ref} { + global icat + global cvarname + + # backward compatibility + if {$ref == "catcxc"} { + set ref catcsc + } + + # look for reference in current list + if {[lsearch $icat(cats) $ref] < 0} { + Error "[msgcat::mc {Unable to find catalog window}] $ref" + return 0 + } + + set cvarname $ref + return [CatalogCmdCheck] +} + |