From f0dd87966fd0c7db5a421f0a2dd4e26a5f13754a Mon Sep 17 00:00:00 2001 From: William Joye Date: Mon, 14 May 2018 17:06:33 -0400 Subject: update ds9 parsers --- ds9/library/marker.tcl | 15 +++++++------ ds9/library/mask.tcl | 8 +++---- ds9/library/plotprocess.tcl | 55 +++++++++++++++++++++++---------------------- ds9/parsers/maskparser.tac | 2 +- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/ds9/library/marker.tcl b/ds9/library/marker.tcl index 71167ad..5ecd893 100644 --- a/ds9/library/marker.tcl +++ b/ds9/library/marker.tcl @@ -69,8 +69,6 @@ proc MarkerDef {} { set marker(load,format) $marker(format) set marker(load,system) $marker(system) set marker(load,sky) $marker(sky) - set marker(load,sock) {} - set marker(load,fn) {} set marker(tag) {} set pmarker(epsilon) 3 @@ -1400,8 +1398,10 @@ proc ProcessRegionsCmd {varname iname sock fn} { global debug if {$debug(tcl,parser)} { - set marker(load,sock) $sock - set marker(load,fn) $fn + global parse + set parse(sock) $sock + set parse(fn) $fn + set marker(load,format) $marker(format) set marker(load,system) $marker(system) set marker(load,sky) $marker(sky) @@ -1984,18 +1984,19 @@ proc PmarkerCmdSet {which value {cmd {}}} { proc RegionCmdLoad {} { global marker global current + global parse if {$current(frame) == {} || ![$current(frame) has fits]} { return } - if {$marker(load,sock) != {}} { + if {$parse(sock) != {}} { # xpa path # fits regions files not supported $current(frame) marker load $marker(load,format) \ - $marker(load,sock) $marker(load,system) $marker(load,sky) + $parse(sock) $marker(load,system) $marker(load,sky) UpdateGroupDialog - } elseif {$marker(load,fn) != {}} { + } elseif {$parse(fn) != {}} { # samp path MarkerLoadFrames $fn $current(frame) \ $marker(load,format) $marker(load,system) $marker(load,sky) diff --git a/ds9/library/mask.tcl b/ds9/library/mask.tcl index 6adf882..a6ba7d9 100644 --- a/ds9/library/mask.tcl +++ b/ds9/library/mask.tcl @@ -17,9 +17,6 @@ proc MaskDef {} { set mask(transparency) 0 array set pmask [array get mask] - - # temporary - set mask(rr) {} } proc MaskMark {} { @@ -267,14 +264,15 @@ proc ProcessMaskCmd {varname iname} { global debug if {$debug(tcl,parser)} { - set mask(rr) {} + global parse + set parse(result) {} mask::YY_FLUSH_BUFFER mask::yy_scan_string [lrange $var $i end] mask::yyparse incr i [expr $mask::yycnt-1] - return $mask(rr) + return $parse(result) } else { set rr {} diff --git a/ds9/library/plotprocess.tcl b/ds9/library/plotprocess.tcl index 4946b3d..2d0a23b 100644 --- a/ds9/library/plotprocess.tcl +++ b/ds9/library/plotprocess.tcl @@ -109,9 +109,10 @@ proc ProcessPlotCmd {xarname iname buf fn} { set ref [lindex $iap(windows) end] global cvarname set cvarname $ref - set iap(name) $iap(tt) - set iap(buf) $buf - set iap(fn) $fn + global parse + set parse(buf) $buf + set parse(fn) $fn + set parse(tt) $iap(tt) plot::YY_FLUSH_BUFFER plot::yy_scan_string [lrange $xar $i end] @@ -576,59 +577,59 @@ proc PlotCmdRef {ref} { } proc PlotCmdNew {name} { - global iap + global parse if {$name != {}} { - set iap(name) $name + set parse(tt) $name } - if {$iap(buf) != {}} { + if {$parse(buf) != {}} { return - } elseif {$iap(fn) != {}} { - if {[file exists $iap(fn)]} { - set ch [open $iap(fn) r] - set iap(buf) [read $ch] + } elseif {$parse(fn) != {}} { + if {[file exists $parse(fn)]} { + set ch [open $parse(fn) r] + set parse(buf) [read $ch] close $ch return } } - set iap(buf) {} + set parse(buf) {} } proc PlotCmdLine {title xaxis yaxis dim} { - global iap - PlotLine $iap(name) {} $title $xaxis $yaxis $dim $iap(buf) + global parse + PlotLine $parse(tt) {} $title $xaxis $yaxis $dim $parse(buf) } proc PlotCmdBar {title xaxis yaxis dim} { - global iap - PlotBar $iap(name) {} $title $xaxis $yaxis $dim $iap(buf) + global parse + PlotBar $parse(tt) {} $title $xaxis $yaxis $dim $parse(buf) } proc PlotCmdScatter {title xaxis yaxis dim} { - global iap - PlotScatter $iap(name) {} $title $xaxis $yaxis $dim $iap(buf) + global parse + PlotScatter $parse(tt) {} $title $xaxis $yaxis $dim $parse(buf) } proc PlotCmdAnalysisPlotStdin {which} { - global iap - AnalysisPlotStdin $which $iap(name) {} $iap(buf) + global parse + AnalysisPlotStdin $which $parse(tt) {} $parse(buf) } proc PlotCmdData {dim} { - global iap + global parse global cvarname upvar #0 $cvarname cvar - if {$iap(buf) == {}} { - if {$iap(fn) != {}} { - if {[file exists $iap(fn)]} { - set ch [open $iap(fn) r] - set iap(buf) [read $ch] + if {$parse(buf) == {}} { + if {$parse(fn) != {}} { + if {[file exists $parse(fn)]} { + set ch [open $parse(fn) r] + set parse(buf) [read $ch] close $ch } } - if {$iap(buf) == {}} { + if {$parse(buf) == {}} { Error "[msgcat::mc {Unable to load plot data}] $fn" plot::YYABORT return @@ -636,7 +637,7 @@ proc PlotCmdData {dim} { } PlotRaise $cvarname - PlotDataSet $cvarname $dim $iap(buf) + PlotDataSet $cvarname $dim $parse(buf) $cvar(proc,updategraph) $cvarname PlotStats $cvarname PlotList $cvarname diff --git a/ds9/parsers/maskparser.tac b/ds9/parsers/maskparser.tac index 4d37592..e1e1dd9 100644 --- a/ds9/parsers/maskparser.tac +++ b/ds9/parsers/maskparser.tac @@ -21,7 +21,7 @@ command : mask | mask {yyclearin; YYACCEPT} STRING_ ; -mask : {MaskCmdSet rr mask} +mask : {global parse; set parse(result) mask} | OPEN_ {MaskDialog} | CLOSE_ {MaskDestroyDialog} | CLEAR_ {MaskClear} -- cgit v0.12