diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2020-01-20 20:28:42 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2020-01-20 20:28:42 (GMT) |
commit | 559240ae6be98048ce122178026ea249407aa38f (patch) | |
tree | fde07b3a364aa17c4aa531c588119a901c6ade83 /ds9 | |
parent | 6afd340f889d6c2d672ddece8e971368b39fcb16 (diff) | |
download | blt-559240ae6be98048ce122178026ea249407aa38f.zip blt-559240ae6be98048ce122178026ea249407aa38f.tar.gz blt-559240ae6be98048ce122178026ea249407aa38f.tar.bz2 |
cleanup code
Diffstat (limited to 'ds9')
-rw-r--r-- | ds9/library/catcdssrch.tcl | 2 | ||||
-rw-r--r-- | ds9/library/catcdssrchdialog.tcl | 173 |
2 files changed, 2 insertions, 173 deletions
diff --git a/ds9/library/catcdssrch.tcl b/ds9/library/catcdssrch.tcl index 017fbfa..a4c6e0f 100644 --- a/ds9/library/catcdssrch.tcl +++ b/ds9/library/catcdssrch.tcl @@ -46,7 +46,7 @@ proc CATCDSSrchProcess {varname} { puts stderr "CATCDSSrchProcess $varname" } - $var(proc,parser) $var(catdb) $var(token) + CATCDSSrchVOTParse $var(catdb) $var(token) ARDone $varname CATCDSSrchTable $varname diff --git a/ds9/library/catcdssrchdialog.tcl b/ds9/library/catcdssrchdialog.tcl index 28c5214..4a579ca 100644 --- a/ds9/library/catcdssrchdialog.tcl +++ b/ds9/library/catcdssrchdialog.tcl @@ -27,9 +27,9 @@ proc CATCDSSrchDialog {varname} { } # procs - set var(proc,parser) CATCDSSrchVOTParse set var(proc,process) CATCDSSrchProcess set var(proc,load) CATCDSSrchLoad + set var(proc,error) ARError # defaults # maybe modified @@ -356,174 +356,3 @@ proc CATCDSSrchDestroy {varname} { ARDestroy $varname } - -# CATCDSSrchConfig - -proc CATCDSSrchConfig {varname} { - upvar #0 $varname var - global $varname - - global debug - if {$debug(tcl,cat)} { - puts stderr "CATCDSSrchConfig $varname" - } - - set site [CATCDSURL $var(server)] - set cgidir {viz-bin} - set script {votable} - - set url "http://$site/$cgidir/$script" - set query [http::formatQuery -meta.aladin all] - - CATCDSSrchConfigLoad $varname $url $query - return -} - -proc CATCDSSrchConfigLoad {varname url query} { - upvar #0 $varname var - global $varname - - global debug - if {$debug(tcl,cat)} { - puts stderr "CATCDSSrchConfigLoad $varname" - } - - TBLGetURL $varname $url $query - return -} - -proc CATCDSSrchConfigDone {varname} { - upvar #0 $varname var - global $varname - - global debug - if {$debug(tcl,cat)} { - puts stderr "CATCDSSrchConfigDone $varname" - } - - CATCDSSrchConfigParse -} - -# Parser - -proc CATCDSSrchConfigParse {t token} { - upvar #0 $t T - global $t - global debug - - global debug - if {$debug(tcl,cat)} { - puts stderr "CATCDSSrchConfigParse" - } - if {$debug(tcl,cat)} { - set fp [open debug.xml w] - puts $fp [http::data $token] - close $fp - } - - set xml [xml::parser \ - -elementstartcommand [list CATCDSSrchConfigElemStartCB $t] \ - -elementendcommand [list CATCDSSrchConfigElemEndCB $t] \ - -ignorewhitespace 1 \ - ] - - set T(tree,enable) 0 - set T(tree,state) {} - if {[catch {$xml parse [http::data $token]} err]} { - if {$debug(tcl,cat)} { - puts stderr "CATCDSSrchConfigParse: $err" - } - } - unset ${t}(tree,enable) - unset ${t}(tree,state) - - $xml free -} - -proc CATCDSSrchConfigElemStartCB {t name attlist args} { - upvar #0 $t T - global $t - global debug - - # hardcoded - set varname catcdssrch1 - upvar #0 $varname var - global $varname - - switch -- $name { - RESOURCE { - set id {} - set type {} - foreach {key value} $attlist { - switch -- [string tolower $key] { - type {set type "$value"} - id {set id "$value"} - } - } - if {[string tolower $id] == "vizier"} { - set T(tree,enable) 1 - - set ${varname}(list,wave) [list none] - set ${varname}(list,mission) [list none] - set ${varname}(list,astro) [list none] - } - } - PARAM { - if {$T(tree,enable)} { - set id {} - set fname {} - foreach {key value} $attlist { - switch -- [string tolower $key] { - name {set fname "$value"} - id {set id "$value"} - } - } - set T(tree,state) [string trim [string tolower $id]] - switch -- $T(tree,state) { - wavelength {set ${varname}(list,wave,param) $fname} - mission {set ${varname}(list,mission,param) $fname} - astronomy {set ${varname}(list,astro,param) $fname} - } - - } - } - VALUES {} - OPTION { - if {$T(tree,enable)} { - set item {} - foreach {key value} $attlist { - switch -- [string tolower $key] { - value {set item "$value"} - } - } - if {$item != {}} { - global icatcdssrch - switch -- $T(tree,state) { - wavelength {lappend ${varname}(list,wave) $item} - mission {lappend ${varname}(list,mission) $item} - astronomy {lappend ${varname}(list,astro) $item} - } - } - } - } - } - - return {} -} - -proc CATCDSSrchConfigElemEndCB {t name args} { - upvar #0 $t T - global $t - global debug - - # we can't count on this being called for all end-tags - switch -- $name { - RESOURCE { - # ok, we're done - set T(tree,enable) 0 - return -code break - } - } - - return {} -} |