diff options
Diffstat (limited to 'ds9')
-rw-r--r-- | ds9/library/plot.tcl | 124 | ||||
-rw-r--r-- | ds9/library/plotbar.tcl | 18 | ||||
-rw-r--r-- | ds9/library/plotline.tcl | 18 | ||||
-rw-r--r-- | ds9/library/plotscatter.tcl | 22 | ||||
-rw-r--r-- | ds9/parsers/plotsendparser.tac | 8 | ||||
-rw-r--r-- | ds9/parsers/plotsendparser.tcl | 8 |
6 files changed, 112 insertions, 86 deletions
diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl index e8f8b0b..aad4c12 100644 --- a/ds9/library/plot.tcl +++ b/ds9/library/plot.tcl @@ -64,9 +64,6 @@ proc PlotDef {} { set pap(axis,font,slant) roman set pap(show) 1 - set pap(shape,symbol) none - set pap(shape,fill) 1 - set pap(shape,color) red set pap(smooth) linear set pap(color) black set pap(fill) 0 @@ -74,6 +71,10 @@ proc PlotDef {} { set pap(width) 1 set pap(dash) 0 + set pap(shape,symbol) none + set pap(shape,fill) 1 + set pap(shape,color) red + set pap(error) 1 set pap(error,cap) 0 set pap(error,color) red @@ -135,6 +136,11 @@ proc PlotAddGraph {varname} { set var(graph$cc,width) $pap(width) set var(graph$cc,dash) $pap(dash) + set var(graph$cc,error) $pap(error) + set var(graph$cc,error,cap) $pap(error,cap) + set var(graph$cc,error,color) $pap(error,color) + set var(graph$cc,error,width) $pap(error,width) + $var(proc,addgraph) $varname # set up zoom stack, assuming mode is zoom @@ -201,34 +207,6 @@ proc PlotAddData {varname} { } } -proc PlotAxisFormat {varname axis w nn} { - upvar #0 $varname var - global $varname - - return [format $var(axis,$axis,format) $nn] -} - -proc PlotChangeMode {varname} { - upvar #0 $varname var - global $varname - - set tt $var(graph,total) - set cc $var(graph,current) - - for {set ii 1} {$ii<=$tt} {incr ii} { - switch $var(mode) { - pointer { - blt::RemoveBindTag $var(graph$ii) zoom-$var(graph$ii) - bind $var(graph$ii) <1> [list PlotButton $varname %x %y] - } - zoom { - bind $var(graph$ii) <1> {} - blt::AddBindTag $var(graph$ii) zoom-$var(graph$ii) - } - } - } -} - proc PlotDeleteData {varname} { upvar #0 $varname var global $varname @@ -311,6 +289,18 @@ proc PlotDeleteData {varname} { } } +proc PlotCurrentGraph {varname} { + upvar #0 $varname var + global $varname + + set tt $var(graph,total) + set cc $var(graph,current) + + if {$tt > 0} { + PlotCurrentData $varname + } +} + proc PlotCurrentData {varname} { upvar #0 $varname var global $varname @@ -336,6 +326,34 @@ proc PlotCurrentData {varname} { PlotList $varname } +proc PlotAxisFormat {varname axis w nn} { + upvar #0 $varname var + global $varname + + return [format $var(axis,$axis,format) $nn] +} + +proc PlotChangeMode {varname} { + upvar #0 $varname var + global $varname + + set tt $var(graph,total) + set cc $var(graph,current) + + for {set ii 1} {$ii<=$tt} {incr ii} { + switch $var(mode) { + pointer { + blt::RemoveBindTag $var(graph$ii) zoom-$var(graph$ii) + bind $var(graph$ii) <1> [list PlotButton $varname %x %y] + } + zoom { + bind $var(graph$ii) <1> {} + blt::AddBindTag $var(graph$ii) zoom-$var(graph$ii) + } + } + } +} + proc PlotDataSet {varname dim data} { upvar #0 $varname var global $varname @@ -628,10 +646,12 @@ proc PlotDupData {varname mm} { [PlotNextColor $var(graph$cc,$mm,fill,color)] set var(graph$cc,$nn,width) $var(graph$cc,$mm,width) set var(graph$cc,$nn,dash) $var(graph$cc,$mm,dash) - set var($nn,error) $var($mm,error) - set var($nn,error,cap) $var($mm,error,cap) - set var($nn,error,color) $var($mm,error,color) - set var($nn,error,width) $var($mm,error,width) + + set var(graph$cc,$nn,error) $var(graph$cc,$mm,error) + set var(graph$cc,$nn,error,cap) $var(graph$cc,$mm,error,cap) + set var(graph$cc,$nn,error,color) $var(graph$cc,$mm,error,color) + set var(graph$cc,$nn,error,width) $var(graph$cc,$mm,error,width) + set var($nn,bar,relief) $var($mm,bar,relief) # update data set menu @@ -1353,19 +1373,22 @@ proc PlotSetVar {varname nn} { set var(graph$cc,name) $var(graph$cc,$nn,name) set var(graph$cc,show) $var(graph$cc,$nn,show) - set var(graph$cc,shape,symbol) $var(graph$cc,$nn,shape,symbol) - set var(graph$cc,shape,fill) $var(graph$cc,$nn,shape,fill) - set var(graph$cc,shape,color) $var(graph$cc,$nn,shape,color) set var(graph$cc,smooth) $var(graph$cc,$nn,smooth) set var(graph$cc,color) $var(graph$cc,$nn,color) set var(graph$cc,fill) $var(graph$cc,$nn,fill) set var(graph$cc,fill,color) $var(graph$cc,$nn,fill,color) set var(graph$cc,width) $var(graph$cc,$nn,width) set var(graph$cc,dash) $var(graph$cc,$nn,dash) - set var(error) $var($nn,error) - set var(error,cap) $var($nn,error,cap) - set var(error,color) $var($nn,error,color) - set var(error,width) $var($nn,error,width) + + set var(graph$cc,shape,symbol) $var(graph$cc,$nn,shape,symbol) + set var(graph$cc,shape,fill) $var(graph$cc,$nn,shape,fill) + set var(graph$cc,shape,color) $var(graph$cc,$nn,shape,color) + + set var(graph$cc,error) $var(graph$cc,$nn,error) + set var(graph$cc,error,cap) $var(graph$cc,$nn,error,cap) + set var(graph$cc,error,color) $var(graph$cc,$nn,error,color) + set var(graph$cc,error,width) $var(graph$cc,$nn,error,width) + set var(bar,relief) $var($nn,bar,relief) } @@ -1378,19 +1401,22 @@ proc PlotGetVar {varname nn} { set var(graph$cc,$nn,name) $var(graph$cc,name) set var(graph$cc,$nn,show) $var(graph$cc,show) - set var(graph$cc,$nn,shape,symbol) $var(graph$cc,shape,symbol) - set var(graph$cc,$nn,shape,fill) $var(graph$cc,shape,fill) - set var(graph$cc,$nn,shape,color) $var(graph$cc,shape,color) set var(graph$cc,$nn,smooth) $var(graph$cc,smooth) set var(graph$cc,$nn,color) $var(graph$cc,color) set var(graph$cc,$nn,fill) $var(graph$cc,fill) set var(graph$cc,$nn,fill,color) $var(graph$cc,fill,color) set var(graph$cc,$nn,width) $var(graph$cc,width) set var(graph$cc,$nn,dash) $var(graph$cc,dash) - set var($nn,error) $var(error) - set var($nn,error,cap) $var(error,cap) - set var($nn,error,color) $var(error,color) - set var($nn,error,width) $var(error,width) + + set var(graph$cc,$nn,shape,symbol) $var(graph$cc,shape,symbol) + set var(graph$cc,$nn,shape,fill) $var(graph$cc,shape,fill) + set var(graph$cc,$nn,shape,color) $var(graph$cc,shape,color) + + set var(graph$cc,$nn,error) $var(graph$cc,error) + set var(graph$cc,$nn,error,cap) $var(graph$cc,error,cap) + set var(graph$cc,$nn,error,color) $var(graph$cc,error,color) + set var(graph$cc,$nn,error,width) $var(graph$cc,error,width) + set var($nn,bar,relief) $var(bar,relief) } diff --git a/ds9/library/plotbar.tcl b/ds9/library/plotbar.tcl index c42c18d..875b1ef 100644 --- a/ds9/library/plotbar.tcl +++ b/ds9/library/plotbar.tcl @@ -113,10 +113,10 @@ proc PlotBarDialog {varname wtt title xaxis yaxis} { # Error menu $var(mb).data.error $var(mb).data.error add checkbutton -label [msgcat::mc {Show}] \ - -variable ${varname}(error) \ + -variable ${varname}(graph$cc,error) \ -command [list PlotBarUpdateElement $varname] $var(mb).data.error add checkbutton -label [msgcat::mc {Cap}] \ - -variable ${varname}(error,cap) \ + -variable ${varname}(graph$cc,error,cap) \ -command [list PlotBarUpdateElement $varname] $var(mb).data.error add separator $var(mb).data.error add cascade -label [msgcat::mc {Color}] \ @@ -124,9 +124,9 @@ proc PlotBarDialog {varname wtt title xaxis yaxis} { $var(mb).data.error add cascade -label [msgcat::mc {Width}] \ -menu $var(mb).data.error.width - PlotColorMenu $var(mb).data.error.color $varname error,color \ + PlotColorMenu $var(mb).data.error.color $varname graph$cc,error,color \ [list PlotBarUpdateElement $varname] - WidthDashMenu $var(mb).data.error.width $varname error,width {} \ + WidthDashMenu $var(mb).data.error.width $varname graph$cc,error,width {} \ [list PlotBarUpdateElement $varname] {} } @@ -176,14 +176,14 @@ proc PlotBarUpdateElement {varname} { set nn $var(graph$cc,data,current) PlotGetVar $varname $nn - if {$var(error)} { + if {$var(graph$cc,error)} { set show both } else { set show none } - if {$var(error,cap)} { - set cap [expr $var(error,width)+3] + if {$var(graph$cc,error,cap)} { + set cap [expr $var(graph$cc,error,width)+3] } else { set cap 0 } @@ -191,8 +191,8 @@ proc PlotBarUpdateElement {varname} { $var(graph$cc) element configure "d-${nn}" \ -label $var(graph$cc,name) -hide [expr !$var(graph$cc,show)] \ -relief $var(bar,relief) -color $var(graph$cc,color) \ - -showerrorbars $show -errorbarcolor $var(error,color) \ - -errorbarwidth $var(error,width) -errorbarcap $cap + -showerrorbars $show -errorbarcolor $var(graph$cc,error,color) \ + -errorbarwidth $var(graph$cc,error,width) -errorbarcap $cap } proc PlotBarButton {varname x y} { diff --git a/ds9/library/plotline.tcl b/ds9/library/plotline.tcl index e6570cd..6e2bc03 100644 --- a/ds9/library/plotline.tcl +++ b/ds9/library/plotline.tcl @@ -193,10 +193,10 @@ proc PlotLineDialog {varname wtt title xaxis yaxis} { # Error menu $var(mb).data.error $var(mb).data.error add checkbutton -label [msgcat::mc {Show}] \ - -variable ${varname}(error) \ + -variable ${varname}(graph$cc,error) \ -command [list PlotLineUpdateElement $varname] $var(mb).data.error add checkbutton -label [msgcat::mc {Cap}] \ - -variable ${varname}(error,cap) \ + -variable ${varname}(graph$cc,error,cap) \ -command [list PlotLineUpdateElement $varname] $var(mb).data.error add separator $var(mb).data.error add cascade -label [msgcat::mc {Color}] \ @@ -204,9 +204,9 @@ proc PlotLineDialog {varname wtt title xaxis yaxis} { $var(mb).data.error add cascade -label [msgcat::mc {Width}] \ -menu $var(mb).data.error.width - PlotColorMenu $var(mb).data.error.color $varname error,color \ + PlotColorMenu $var(mb).data.error.color $varname graph$cc,error,color \ [list PlotLineUpdateElement $varname] - WidthDashMenu $var(mb).data.error.width $varname error,width {} \ + WidthDashMenu $var(mb).data.error.width $varname graph$cc,error,width {} \ [list PlotLineUpdateElement $varname] {} } @@ -258,14 +258,14 @@ proc PlotLineUpdateElement {varname} { set dash { } } - if {$var(error)} { + if {$var(graph$cc,error)} { set show both } else { set show none } - if {$var(error,cap)} { - set cap [expr $var(error,width)+3] + if {$var(graph$cc,error,cap)} { + set cap [expr $var(graph$cc,error,width)+3] } else { set cap 0 } @@ -277,8 +277,8 @@ proc PlotLineUpdateElement {varname} { -smooth $var(graph$cc,smooth) \ -color $var(graph$cc,color) -areabackground $fillClr \ -linewidth $var(graph$cc,width) -dashes $dash \ - -showerrorbars $show -errorbarcolor $var(error,color) \ - -errorbarwidth $var(error,width) -errorbarcap $cap + -showerrorbars $show -errorbarcolor $var(graph$cc,error,color) \ + -errorbarwidth $var(graph$cc,error,width) -errorbarcap $cap } proc PlotLineButton {varname x y} { diff --git a/ds9/library/plotscatter.tcl b/ds9/library/plotscatter.tcl index a7dbaf4..d949f5b 100644 --- a/ds9/library/plotscatter.tcl +++ b/ds9/library/plotscatter.tcl @@ -120,10 +120,10 @@ proc PlotScatterDialog {varname wtt title xaxis yaxis} { # Error menu $var(mb).data.error $var(mb).data.error add checkbutton -label [msgcat::mc {Show}] \ - -variable ${varname}(error) \ + -variable ${varname}(graph$cc,error) \ -command [list PlotScatterUpdateElement $varname] $var(mb).data.error add checkbutton -label [msgcat::mc {Cap}] \ - -variable ${varname}(error,cap) \ + -variable ${varname}(graph$cc,error,cap) \ -command [list PlotScatterUpdateElement $varname] $var(mb).data.error add separator $var(mb).data.error add cascade -label [msgcat::mc {Color}] \ @@ -131,9 +131,9 @@ proc PlotScatterDialog {varname wtt title xaxis yaxis} { $var(mb).data.error add cascade -label [msgcat::mc {Width}] \ -menu $var(mb).data.error.width - PlotColorMenu $var(mb).data.error.color $varname error,color \ + PlotColorMenu $var(mb).data.error.color $varname graph$cc,error,color \ [list PlotScatterUpdateElement $varname] - WidthDashMenu $var(mb).data.error.width $varname error,width {} \ + WidthDashMenu $var(mb).data.error.width $varname graph$cc,error,width {} \ [list PlotScatterUpdateElement $varname] {} } @@ -176,14 +176,14 @@ proc PlotScatterUpdateElement {varname} { set clr {} } - if {$var(error)} { + if {$var(graph$cc,error)} { set show both } else { set show none } - if {$var(error,cap)} { - set cap [expr $var(error,width)+3] + if {$var(graph$cc,error,cap)} { + set cap [expr $var(graph$cc,error,width)+3] } else { set cap 0 } @@ -193,14 +193,14 @@ proc PlotScatterUpdateElement {varname} { -symbol $var(graph$cc,shape,symbol) -fill $clr -scalesymbols no \ -outline $var(graph$cc,shape,color) \ -linewidth 0 -pixels 5 \ - -showerrorbars $show -errorbarcolor $var(error,color) \ - -errorbarwidth $var(error,width) -errorbarcap $cap + -showerrorbars $show -errorbarcolor $var(graph$cc,error,color) \ + -errorbarwidth $var(graph$cc,error,width) -errorbarcap $cap $var(graph$cc) pen configure active -color blue \ -symbol $var(graph$cc,shape,symbol) \ -linewidth 0 -pixels 5 \ - -showerrorbars $show -errorbarcolor $var(error,color) \ - -errorbarwidth $var(error,width) -errorbarcap $cap + -showerrorbars $show -errorbarcolor $var(graph$cc,error,color) \ + -errorbarwidth $var(graph$cc,error,width) -errorbarcap $cap } proc PlotScatterButton {varname x y} { diff --git a/ds9/parsers/plotsendparser.tac b/ds9/parsers/plotsendparser.tac index 2424089..551a8be 100644 --- a/ds9/parsers/plotsendparser.tac +++ b/ds9/parsers/plotsendparser.tac @@ -143,10 +143,10 @@ title : {ProcessSendCmdCVARGet graph,title} | LEGEND_ {ProcessSendCmdCVARGet legend,title} ; -errorr : {ProcessSendCmdCVARYesNo error} - | CAP_ {ProcessSendCmdCVARYesNo error,cap} - | COLOR_ {ProcessSendCmdCVARGet error,color} - | WIDTH_ {ProcessSendCmdCVARGet error,width} +errorr : {PlotSendCmdCVARYesNo error} + | CAP_ {PlotSendCmdCVARYesNo error,cap} + | COLOR_ {PlotSendCmdCVARGet error,color} + | WIDTH_ {PlotSendCmdCVARGet error,width} ; shape : {PlotSendCmdCVARGet shape,symbol} diff --git a/ds9/parsers/plotsendparser.tcl b/ds9/parsers/plotsendparser.tcl index ebc5af0..d20d8c6 100644 --- a/ds9/parsers/plotsendparser.tcl +++ b/ds9/parsers/plotsendparser.tcl @@ -1532,10 +1532,10 @@ proc plotsend::yyparse {} { 63 { ProcessSendCmdCVARGet "axis,$1,title" } 64 { ProcessSendCmdCVARGet "axis,$1,title" } 65 { ProcessSendCmdCVARGet legend,title } - 66 { ProcessSendCmdCVARYesNo error } - 67 { ProcessSendCmdCVARYesNo error,cap } - 68 { ProcessSendCmdCVARGet error,color } - 69 { ProcessSendCmdCVARGet error,width } + 66 { PlotSendCmdCVARYesNo error } + 67 { PlotSendCmdCVARYesNo error,cap } + 68 { PlotSendCmdCVARGet error,color } + 69 { PlotSendCmdCVARGet error,width } 70 { PlotSendCmdCVARGet shape,symbol } 71 { PlotSendCmdCVARYesNo shape,fill } 72 { PlotSendCmdCVARGet shape,color } |