From 88340b6c53f5d9f9c7cc721c1911657964462504 Mon Sep 17 00:00:00 2001 From: William Joye Date: Fri, 27 Jul 2018 13:34:25 -0400 Subject: update ds9 region parser --- ds9/library/marker.tcl | 5 +++- ds9/msgs/cs.msg | 1 + ds9/msgs/da.msg | 1 + ds9/msgs/de.msg | 1 + ds9/msgs/es.msg | 1 + ds9/msgs/fr.msg | 1 + ds9/msgs/ja.msg | 1 + ds9/msgs/pt.msg | 1 + ds9/msgs/zh.msg | 1 + ds9/parsers/regionlex.fcl | 4 ++- ds9/parsers/regionparser.tac | 58 +++++++++++++++++++++++--------------------- 11 files changed, 46 insertions(+), 29 deletions(-) diff --git a/ds9/library/marker.tcl b/ds9/library/marker.tcl index 3cedd7e..23d23e7 100644 --- a/ds9/library/marker.tcl +++ b/ds9/library/marker.tcl @@ -385,7 +385,10 @@ proc MarkerButton {which x y} { } set fn "$ds9(root)/template/$itemplate($marker(shape))" - set ch [open $fn r] + if {[catch {set ch [open $fn r]}]} { + Error "[msgcat::mc {Unable to locate FOV Region}] $marker(shape)" + return + } global vardata set vardata [read $ch] diff --git a/ds9/msgs/cs.msg b/ds9/msgs/cs.msg index 9fe52cd..a052d3d 100644 --- a/ds9/msgs/cs.msg +++ b/ds9/msgs/cs.msg @@ -792,6 +792,7 @@ ::msgcat::mcset cs {Unable to load plot data} ::msgcat::mcset cs {Unable to load region file} ::msgcat::mcset cs {Unable to load} +::msgcat::mcset cs {Unable to locate FOV Region} ::msgcat::mcset cs {Unable to locate URL} ::msgcat::mcset cs {Unable to match target with XPA Mime request} ::msgcat::mcset cs {Unable to open file} diff --git a/ds9/msgs/da.msg b/ds9/msgs/da.msg index 0be8480..1eaea8c 100644 --- a/ds9/msgs/da.msg +++ b/ds9/msgs/da.msg @@ -792,6 +792,7 @@ ::msgcat::mcset da {Unable to load plot data} ::msgcat::mcset da {Unable to load region file} ::msgcat::mcset da {Unable to load} {Kan ikke hente} +::msgcat::mcset da {Unable to locate FOV Region} ::msgcat::mcset da {Unable to locate URL} {Kan ikke finde URL} ::msgcat::mcset da {Unable to match target with XPA Mime request} ::msgcat::mcset da {Unable to open file} [encoding convertfrom iso8859-1 {Kan ikke åbne fil}] diff --git a/ds9/msgs/de.msg b/ds9/msgs/de.msg index ccab317..5c21e2e 100644 --- a/ds9/msgs/de.msg +++ b/ds9/msgs/de.msg @@ -792,6 +792,7 @@ ::msgcat::mcset de {Unable to load plot data} ::msgcat::mcset de {Unable to load region file} ::msgcat::mcset de {Unable to load} [encoding convertfrom iso8859-1 {Nicht möglich zu laden}] +::msgcat::mcset de {Unable to locate FOV Region} ::msgcat::mcset de {Unable to locate URL} [encoding convertfrom iso8859-1 {Nicht möglich URL zu finden}] ::msgcat::mcset de {Unable to match target with XPA Mime request} ::msgcat::mcset de {Unable to open file} [encoding convertfrom iso8859-1 {Nicht möglich Datei zu öffnen}] diff --git a/ds9/msgs/es.msg b/ds9/msgs/es.msg index 729caef..7bacef3 100644 --- a/ds9/msgs/es.msg +++ b/ds9/msgs/es.msg @@ -792,6 +792,7 @@ ::msgcat::mcset es {Unable to load plot data} ::msgcat::mcset es {Unable to load region file} ::msgcat::mcset es {Unable to load} {Incapaz de cargar} +::msgcat::mcset es {Unable to locate FOV Region} ::msgcat::mcset es {Unable to locate URL} {Incapaz de localizar URL} ::msgcat::mcset es {Unable to match target with XPA Mime request} ::msgcat::mcset es {Unable to open file} {Incapaz de abrir fichero} diff --git a/ds9/msgs/fr.msg b/ds9/msgs/fr.msg index 8b955a1..f8b2a84 100644 --- a/ds9/msgs/fr.msg +++ b/ds9/msgs/fr.msg @@ -792,6 +792,7 @@ ::msgcat::mcset fr {Unable to load plot data} ::msgcat::mcset fr {Unable to load region file} ::msgcat::mcset fr {Unable to load} +::msgcat::mcset fr {Unable to locate FOV Region} ::msgcat::mcset fr {Unable to locate URL} ::msgcat::mcset fr {Unable to match target with XPA Mime request} ::msgcat::mcset fr {Unable to open file} diff --git a/ds9/msgs/ja.msg b/ds9/msgs/ja.msg index 58688b2..c882bc3 100644 --- a/ds9/msgs/ja.msg +++ b/ds9/msgs/ja.msg @@ -792,6 +792,7 @@ ::msgcat::mcset ja {Unable to load plot data} ::msgcat::mcset ja {Unable to load region file} [encoding convertfrom euc-jp "\xce\xce\xb0\xe8\xa5\xd5\xa5\xa1\xa5\xa4\xa5\xeb\xa4\xf2\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xe1\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"] ::msgcat::mcset ja {Unable to load} [encoding convertfrom euc-jp "\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xe1\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"] +::msgcat::mcset ja {Unable to locate FOV Region} ::msgcat::mcset ja {Unable to locate URL} [encoding convertfrom euc-jp "\x55\x52\x4c\xa4\xf2\xc6\xc3\xc4\xea\xa4\xc7\xa4\xad\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"] ::msgcat::mcset ja {Unable to match target with XPA Mime request} ::msgcat::mcset ja {Unable to open file} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xa1\xa5\xa4\xa5\xeb\xa4\xf2\xb3\xab\xa4\xb1\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"] diff --git a/ds9/msgs/pt.msg b/ds9/msgs/pt.msg index 917430c..a3e2046 100644 --- a/ds9/msgs/pt.msg +++ b/ds9/msgs/pt.msg @@ -792,6 +792,7 @@ ::msgcat::mcset pt {Unable to load plot data} ::msgcat::mcset pt {Unable to load region file} ::msgcat::mcset pt {Unable to load} {Incapaz de carregar} +::msgcat::mcset pt {Unable to locate FOV Region} ::msgcat::mcset pt {Unable to locate URL} {Incapaz de localizar URL} ::msgcat::mcset pt {Unable to match target with XPA Mime request} ::msgcat::mcset pt {Unable to open file} {Incapaz de abrir arquivo} diff --git a/ds9/msgs/zh.msg b/ds9/msgs/zh.msg index fcc9206..6f382f4 100644 --- a/ds9/msgs/zh.msg +++ b/ds9/msgs/zh.msg @@ -792,6 +792,7 @@ ::msgcat::mcset zh {Unable to load plot data} ::msgcat::mcset zh {Unable to load region file} ::msgcat::mcset zh {Unable to load} +::msgcat::mcset zh {Unable to locate FOV Region} ::msgcat::mcset zh {Unable to locate URL} ::msgcat::mcset zh {Unable to match target with XPA Mime request} ::msgcat::mcset zh {Unable to open file} diff --git a/ds9/parsers/regionlex.fcl b/ds9/parsers/regionlex.fcl index c82d9b1..36e77d3 100644 --- a/ds9/parsers/regionlex.fcl +++ b/ds9/parsers/regionlex.fcl @@ -7,7 +7,6 @@ %% - all {return $ALL_} at {return $AT_} auto {return $AUTO_} @@ -53,6 +52,7 @@ radius {return $RADIUS_} rotate {return $ROTATE_} save {return $SAVE_} savetemplate {return $SAVETEMPLATE_} +segment {return $SEGMENT_} select {return $SELECT_} selectall {return $SELECTALL_} selectnone {return $SELECTNONE_} @@ -89,6 +89,8 @@ ruler {return $RULER_} compass {return $COMPASS_} projection {return $PROJECTION_} annulus {return $ANNULUS_} +ellipseannulus {return $ELLIPSEANNULUS_} +boxannulus {return $BOXANNULUS_} panda {return $PANDA_} epanda {return $EPANDA_} bpanda {return $BPANDA_} diff --git a/ds9/parsers/regionparser.tac b/ds9/parsers/regionparser.tac index 5663bb0..e28c898 100644 --- a/ds9/parsers/regionparser.tac +++ b/ds9/parsers/regionparser.tac @@ -57,6 +57,7 @@ %token ROTATE_ %token SAVE_ %token SAVETEMPLATE_ +%token SEGMENT_ %token SELECT_ %token SELECTALL_ %token SELECTNONE_ @@ -93,6 +94,8 @@ %token COMPASS_ %token PROJECTION_ %token ANNULUS_ +%token ELLIPSEANNULUS_ +%token BOXANNULUS_ %token PANDA_ %token EPANDA_ %token BPANDA_ @@ -236,35 +239,36 @@ format : DS9_ {set _ ds9} | XY_ {set _ xy} ; -shape : CIRCLE_ - | ELLIPSE_ - | BOX_ - | POLYGON_ - | point POINT_ - | LINE_ - | VECTOR_ - | TEXT_ - | RULER_ - | COMPASS_ - | PROJECTION_ - | ANNULUS_ - | ELLIPSE_ ANNULUS_ - | BOX_ ANNULUS_ - | PANDA_ - | EPANDA_ - | BPANDA_ - | COMPOSITE_ +shape : CIRCLE_ {set _ circle} + | ELLIPSE_ {set _ ellipse} + | BOX_ {set _ box} + | POLYGON_ {set _ polygon} + | LINE_ {set _ line} + | VECTOR_ {set _ vector} + | PROJECTION_ {set _ projection} + | SEGMENT_ {set _ segment} + | TEXT_ {set _ text} + | point POINT_ {set _ "$1 point"} + | RULER_ {set _ ruler} + | COMPASS_ {set _ compass} + | ANNULUS_ {set _ annulus} + | ELLIPSEANNULUS_ {set _ ellipseannulus} + | BOXANNULUS_ {set _ boxannulus} + | PANDA_ {set _ panda} + | EPANDA_ {set _ epanda} + | BPANDA_ {set _ bpanda} + | COMPOSITE_ {set _ composite} ; -point : - | CIRCLE_ - | BOX_ - | DIAMOND_ - | CROSS_ - | 'X' - | 'x' - | ARROW_ - | BOXCIRCLE_ +point : {set _ ""} + | CIRCLE_ {set _ circle} + | BOX_ {set _ box} + | DIAMOND_ {set _ diamond} + | CROSS_ {set _ cross} + | 'X' {set _ x} + | 'x' {set _ x} + | ARROW_ {set _ arrow} + | BOXCIRCLE_ {set _ boxcircle} ; delim : NL_ {set _ 0} -- cgit v0.12