From a89d01d5ec3346e680a29a2f496cdccbaddd0551 Mon Sep 17 00:00:00 2001 From: William Joye Date: Thu, 17 May 2018 13:26:42 -0400 Subject: update ds9 parsers --- ds9/library/colorbar.tcl | 30 ++++++++++++------------------ ds9/library/grid.tcl | 8 +++++++- ds9/library/plotprocess.tcl | 1 + ds9/parsers/arrayparser.tac | 2 +- ds9/parsers/mosaicimageirafparser.tac | 2 +- ds9/parsers/mosaicimagewcsparser.tac | 2 +- ds9/parsers/mosaicimagewfpc2parser.tac | 2 +- ds9/parsers/mosaicirafparser.tac | 2 +- ds9/parsers/mosaicwcsparser.tac | 2 +- ds9/parsers/rgbarrayparser.tac | 2 +- ds9/parsers/rgbcubeparser.tac | 2 +- ds9/parsers/rgbimageparser.tac | 2 +- ds9/parsers/smosaicirafparser.tac | 2 +- ds9/parsers/smosaicwcsparser.tac | 2 +- ds9/parsers/srgbcubeparser.tac | 2 +- 15 files changed, 32 insertions(+), 31 deletions(-) diff --git a/ds9/library/colorbar.tcl b/ds9/library/colorbar.tcl index f23bdd5..6e40275 100644 --- a/ds9/library/colorbar.tcl +++ b/ds9/library/colorbar.tcl @@ -1357,7 +1357,6 @@ proc ProcessSendCmapCmd {proc id param} { file {$proc $id "[$current(colorbar) get file name]\n"} invert {$proc $id [ToYesNo $colorbar(invert)]} value {$proc $id "[$current(colorbar) get contrast] [$current(colorbar) get bias]\n"} - # backward compatibility lock {$proc $id [ToYesNo $colorbar(lock)]} {} {$proc $id "[$current(colorbar) get name]\n"} } @@ -1494,32 +1493,27 @@ proc ColorbarCmdSet {which value {cmd {}}} { } } -proc ColorbarCmdFontStyle {value} { - global cvarname - upvar #0 $cvarname cvar - global $cvar(symdb) +proc ColorbarCmdFontStyle {value {cmd {}}} { + global colorbar switch $value { normal { - starbase_set $cvar(symdb) $cvar(row) \ - [starbase_colnum $cvar(symdb) fontweigth] normal - starbase_set $cvar(symdb) $cvar(row) \ - [starbase_colnum $cvar(symdb) fontslant] roman + set colorbar(font,weight) normal + set colorbar(font,slant) roman } bold { - starbase_set $cvar(symdb) $cvar(row) \ - [starbase_colnum $cvar(symdb) fontweight] bold - starbase_set $cvar(symdb) $cvar(row) \ - [starbase_colnum $cvar(symdb) fontslant] roman + set colorbar(font,weight) bold + set colorbar(font,slant) roman } italic { - starbase_set $cvar(symdb) $cvar(row) \ - [starbase_colnum $cvar(symdb) weight] normal - starbase_set $cvar(symdb) $cvar(row) \ - [starbase_colnum $cvar(symdb) slant] italic + set colorbar(font,weight) normal + set colorbar(font,slant) italic } } - CATGenerate $cvarname + + if {$cmd != {}} { + eval $cmd + } } proc ProcessSendColorbarCmd {proc id param} { diff --git a/ds9/library/grid.tcl b/ds9/library/grid.tcl index 314a804..789421c 100644 --- a/ds9/library/grid.tcl +++ b/ds9/library/grid.tcl @@ -1410,7 +1410,9 @@ proc GridCmdSet {which value {cmd {}}} { } } -proc GridCmdFontStyle {which value} { +proc GridCmdFontStyle {which value {cmd {}}} { + global grid + switch $value { normal { set grid($which,weight) normal @@ -1425,6 +1427,10 @@ proc GridCmdFontStyle {which value} { set grid($which,slant) italic } } + + if {$cmd != {}} { + eval $cmd + } } proc ProcessSendGridCmd {proc id param} { diff --git a/ds9/library/plotprocess.tcl b/ds9/library/plotprocess.tcl index 2d0a23b..3f7f631 100644 --- a/ds9/library/plotprocess.tcl +++ b/ds9/library/plotprocess.tcl @@ -729,6 +729,7 @@ proc PlotCmdFontStyle {which value} { set cvar($which,slant) italic } } + $cvar(proc,updategraph) $cvarname } diff --git a/ds9/parsers/arrayparser.tac b/ds9/parsers/arrayparser.tac index 8676d43..170565b 100644 --- a/ds9/parsers/arrayparser.tac +++ b/ds9/parsers/arrayparser.tac @@ -11,8 +11,8 @@ %% +# XPA/SAMP only command : array - | array {yyclearin; YYACCEPT} STRING_ ; array : opts {ArrayCmdLoad {} $1} diff --git a/ds9/parsers/mosaicimageirafparser.tac b/ds9/parsers/mosaicimageirafparser.tac index 819c260..2c7f162 100644 --- a/ds9/parsers/mosaicimageirafparser.tac +++ b/ds9/parsers/mosaicimageirafparser.tac @@ -10,8 +10,8 @@ %% +# XPA/SAMP only command : mosaicimageiraf - | mosaicimageiraf {yyclearin; YYACCEPT} STRING_ ; mosaicimageiraf : opts {MosaicImageIRAFCmdLoad {} $1} diff --git a/ds9/parsers/mosaicimagewcsparser.tac b/ds9/parsers/mosaicimagewcsparser.tac index 93737c2..361ea79 100644 --- a/ds9/parsers/mosaicimagewcsparser.tac +++ b/ds9/parsers/mosaicimagewcsparser.tac @@ -13,8 +13,8 @@ #include coords.trl +# XPA/SAMP only command : mosaicimagewcs - | mosaicimagewcs {yyclearin; YYACCEPT} STRING_ ; mosaicimagewcs : opts sys {MosaicImageWCSCmdLoad {} $1 $2} diff --git a/ds9/parsers/mosaicimagewfpc2parser.tac b/ds9/parsers/mosaicimagewfpc2parser.tac index 1f3aaa8..702e607 100644 --- a/ds9/parsers/mosaicimagewfpc2parser.tac +++ b/ds9/parsers/mosaicimagewfpc2parser.tac @@ -9,8 +9,8 @@ %% +# XPA/SAMP only command : mosaicimagewfpc2 - | mosaicimagewfpc2 {yyclearin; YYACCEPT} STRING_ ; mosaicimagewfpc2 : opts {MosaicImageWFPC2CmdLoad {}} diff --git a/ds9/parsers/mosaicirafparser.tac b/ds9/parsers/mosaicirafparser.tac index 1ecf784..fb8611f 100644 --- a/ds9/parsers/mosaicirafparser.tac +++ b/ds9/parsers/mosaicirafparser.tac @@ -10,8 +10,8 @@ %% +# XPA/SAMP only command : mosaiciraf - | mosaiciraf {yyclearin; YYACCEPT} STRING_ ; mosaiciraf : opts {MosaicIRAFCmdLoad {} $1} diff --git a/ds9/parsers/mosaicwcsparser.tac b/ds9/parsers/mosaicwcsparser.tac index bf6df9c..8d99ae6 100644 --- a/ds9/parsers/mosaicwcsparser.tac +++ b/ds9/parsers/mosaicwcsparser.tac @@ -13,8 +13,8 @@ #include coords.trl +# XPA/SAMP only command : mosaicwcs - | mosaicwcs {yyclearin; YYACCEPT} STRING_ ; mosaicwcs : opts sys {MosaicWCSCmdLoad {} $1 $2} diff --git a/ds9/parsers/rgbarrayparser.tac b/ds9/parsers/rgbarrayparser.tac index 4fdf433..31beb70 100644 --- a/ds9/parsers/rgbarrayparser.tac +++ b/ds9/parsers/rgbarrayparser.tac @@ -9,8 +9,8 @@ %% +# XPA/SAMP only command : rgbarray - | rgbarray {yyclearin; YYACCEPT} STRING_ ; rgbarray : opts {RGBArrayCmdLoad {}} diff --git a/ds9/parsers/rgbcubeparser.tac b/ds9/parsers/rgbcubeparser.tac index 61142c5..fc72a14 100644 --- a/ds9/parsers/rgbcubeparser.tac +++ b/ds9/parsers/rgbcubeparser.tac @@ -9,8 +9,8 @@ %% +# XPA/SAMP only command : rgbcube - | rgbcube {yyclearin; YYACCEPT} STRING_ ; rgbcube : opts {RGBCubeCmdLoad {}} diff --git a/ds9/parsers/rgbimageparser.tac b/ds9/parsers/rgbimageparser.tac index 4997c0b..976e4a8 100644 --- a/ds9/parsers/rgbimageparser.tac +++ b/ds9/parsers/rgbimageparser.tac @@ -9,8 +9,8 @@ %% +# XPA/SAMP only command : rgbimage - | rgbimage {yyclearin; YYACCEPT} STRING_ ; rgbimage : opts {RGBImageCmdLoad {}} diff --git a/ds9/parsers/smosaicirafparser.tac b/ds9/parsers/smosaicirafparser.tac index daa6a3b..5c63873 100644 --- a/ds9/parsers/smosaicirafparser.tac +++ b/ds9/parsers/smosaicirafparser.tac @@ -10,8 +10,8 @@ %% +# XPA/SAMP only command : smosaiciraf - | smosaiciraf {yyclearin; YYACCEPT} STRING_ ; smosaiciraf : opts STRING_ STRING_ {LoadSMosaicIRAFFile $2 $3 $1} diff --git a/ds9/parsers/smosaicwcsparser.tac b/ds9/parsers/smosaicwcsparser.tac index e75864c..8710e69 100644 --- a/ds9/parsers/smosaicwcsparser.tac +++ b/ds9/parsers/smosaicwcsparser.tac @@ -13,8 +13,8 @@ #include coords.trl +# XPA/SAMP only command : smosaicwcs - | smosaicwcs {yyclearin; YYACCEPT} STRING_ ; smosaicwcs : opts sys STRING_ STRING_ {LoadSMosaicWCSFile $3 $4 $2 $1} diff --git a/ds9/parsers/srgbcubeparser.tac b/ds9/parsers/srgbcubeparser.tac index b0bab2d..87b8603 100644 --- a/ds9/parsers/srgbcubeparser.tac +++ b/ds9/parsers/srgbcubeparser.tac @@ -9,8 +9,8 @@ %% +# XPA/SAMP only command : srgbcube - | srgbcube {yyclearin; YYACCEPT} STRING_ ; srgbcube : opts STRING_ STRING_ {LoadSRGBCubeFile $2 $3} -- cgit v0.12