changeset 5420:0bb57e72b8ea

Fix flys/issue1206 (reference system in discharge curve).
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 26 Mar 2013 11:20:36 +0100
parents 0548b70e7b39
children 420c553bc86d
files flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveExporter.java flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java flys-artifacts/src/main/resources/messages.properties flys-artifacts/src/main/resources/messages_de.properties flys-artifacts/src/main/resources/messages_de_DE.properties flys-artifacts/src/main/resources/messages_en.properties
diffstat 6 files changed, 23 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveExporter.java	Tue Mar 26 11:08:23 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveExporter.java	Tue Mar 26 11:20:36 2013 +0100
@@ -119,8 +119,11 @@
     protected void writeCSVHeader(CSVWriter writer) {
         logger.debug("ComputedDischargeCurveExporter.writeCSVHeader");
 
+        // TODO i18n with wst unit from river.
+        String unit = FLYSUtils.getRiver((FLYSArtifact) master).getWstUnit().getName();
+
         writer.writeNext(new String[] {
-            msg(CSV_W_HEADER, DEFAULT_CSV_W_HEADER),
+            msg(CSV_W_HEADER, DEFAULT_CSV_W_HEADER, new Object[] { unit }),
             msg(CSV_Q_HEADER, DEFAULT_CSV_Q_HEADER)
         });
     }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java	Tue Mar 26 11:08:23 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java	Tue Mar 26 11:20:36 2013 +0100
@@ -2,6 +2,7 @@
 
 import de.intevation.artifactdatabase.state.ArtifactAndFacet;
 import de.intevation.artifactdatabase.state.Facet;
+import de.intevation.flys.artifacts.FLYSArtifact;
 import de.intevation.flys.artifacts.StaticWKmsArtifact;
 import de.intevation.flys.artifacts.WINFOArtifact;
 import de.intevation.flys.artifacts.model.FacetTypes;
@@ -11,6 +12,8 @@
 import de.intevation.flys.jfree.StickyAxisAnnotation;
 import de.intevation.flys.jfree.StyledXYSeries;
 
+import de.intevation.flys.utils.FLYSUtils;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -74,7 +77,11 @@
 
     @Override
     protected String getDefaultYAxisLabel(int pos) {
-        return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT);
+        FLYSArtifact flys = (FLYSArtifact) master;
+
+        String unit = FLYSUtils.getRiver(flys).getWstUnit().getName();
+
+        return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT, new Object[] { unit });
     }
 
 
--- a/flys-artifacts/src/main/resources/messages.properties	Tue Mar 26 11:08:23 2013 +0100
+++ b/flys-artifacts/src/main/resources/messages.properties	Tue Mar 26 11:20:36 2013 +0100
@@ -169,7 +169,7 @@
 chart.discharge.curve.curve.valid.range = {0} (valid from {1,date,short} - {2,date,short})
 chart.computed.discharge.curve.title = Discharge Curve
 chart.computed.discharge.curve.subtitle = {0}-km: {1,number,#.###}
-chart.computed.discharge.curve.yaxis.label = W [NN + m]
+chart.computed.discharge.curve.yaxis.label = W [{0}]
 chart.computed.discharge.curve.curve.label = Discharge Curve {0} km {1}
 chart.computed.discharge.curve.gauge = Discharge curve at gauge {0} (km {1})
 chart.duration.curve.title = Duration Curve
@@ -324,7 +324,7 @@
 export.waterlevel.csv.meta.q = # Q (m\u00b3/s): {0}
 export.waterlevel.csv.meta.w = # W (NN + m): {0} - {1}
 export.waterlevel.csv.not.in.gauge.range = Outside selected gauge
-export.computed.discharge.curve.csv.header.w = W [NN + m]
+export.computed.discharge.curve.csv.header.w = W [{0}]
 export.computed.discharge.curve.csv.header.q = Q [m\u00b3/s]
 export.duration.curve.csv.header.duration = D [Days]
 export.duration.curve.csv.header.w = W [NN + m]
--- a/flys-artifacts/src/main/resources/messages_de.properties	Tue Mar 26 11:08:23 2013 +0100
+++ b/flys-artifacts/src/main/resources/messages_de.properties	Tue Mar 26 11:20:36 2013 +0100
@@ -169,7 +169,7 @@
 chart.discharge.curve.curve.valid.range = {0} (g\u00fcltig ab {1,date,medium} - {2,date,medium})
 chart.computed.discharge.curve.title = Abflusskurve
 chart.computed.discharge.curve.subtitle = {0}-km: {1,number,#.###}
-chart.computed.discharge.curve.yaxis.label = W [NN + m]
+chart.computed.discharge.curve.yaxis.label = W [{0}]
 chart.computed.discharge.curve.curve.label = Abflusskurve {0} km {1}
 chart.computed.discharge.curve.gauge = Abflusskurve an Pegel {0} (km {1})
 chart.duration.curve.title = Dauerlinie
@@ -324,10 +324,10 @@
 export.waterlevel.csv.meta.q = # Q (m\u00b3/s): {0}
 export.waterlevel.csv.meta.w = # W (NN + m): {0} - {1}
 export.waterlevel.csv.not.in.gauge.range = au\u00dferhalb gew\u00e4hlter Bezugspegels
-export.computed.discharge.curve.csv.header.w = W [NN + m]
+export.computed.discharge.curve.csv.header.w = W [{0}]
 export.computed.discharge.curve.csv.header.q = Q [m\u00b3/s]
 export.duration.curve.csv.header.duration = D [Tagen]
-export.duration.curve.csv.header.w = W [NN + m]
+export.duration.curve.csv.header.w = W [{0]]
 export.duration.curve.csv.header.q = Q [m\u00b3/s]
 export.discharge.longitudinal.section.csv.header.km = Fluss-Km
 export.discharge.longitudinal.section.csv.header.w = W [NN + m]
--- a/flys-artifacts/src/main/resources/messages_de_DE.properties	Tue Mar 26 11:08:23 2013 +0100
+++ b/flys-artifacts/src/main/resources/messages_de_DE.properties	Tue Mar 26 11:20:36 2013 +0100
@@ -168,7 +168,7 @@
 chart.discharge.curve.curve.valid.range = {0} (g\u00fcltig ab {1,date,medium} - {2,date,medium})
 chart.computed.discharge.curve.title = Abflusskurve
 chart.computed.discharge.curve.subtitle = {0}-km: {1,number,#.###}
-chart.computed.discharge.curve.yaxis.label = W [NN + m]
+chart.computed.discharge.curve.yaxis.label = W [{0}]
 chart.computed.discharge.curve.curve.label = Abflusskurve {0} km {1}
 chart.computed.discharge.curve.gauge = Abflusskurve an Pegel {0} (km {1})
 chart.duration.curve.title = Dauerlinie
@@ -321,10 +321,10 @@
 export.waterlevel.csv.meta.q = # Q (m\u00b3/s): {0}
 export.waterlevel.csv.meta.w = # W (NN + m): {0} - {1}
 export.waterlevel.csv.not.in.gauge.range = au\u00dferhalb gew\u00e4hlter Bezugspegels
-export.computed.discharge.curve.csv.header.w = W [NN + m]
+export.computed.discharge.curve.csv.header.w = W [{0}]
 export.computed.discharge.curve.csv.header.q = Q [m\u00b3/s]
 export.duration.curve.csv.header.duration = D [Tagen]
-export.duration.curve.csv.header.w = W [NN + m]
+export.duration.curve.csv.header.w = W [{0}]
 export.duration.curve.csv.header.q = Q [m\u00b3/s]
 export.discharge.longitudinal.section.csv.header.km = Fluss-Km
 export.discharge.longitudinal.section.csv.header.w = W [NN + m]
--- a/flys-artifacts/src/main/resources/messages_en.properties	Tue Mar 26 11:08:23 2013 +0100
+++ b/flys-artifacts/src/main/resources/messages_en.properties	Tue Mar 26 11:20:36 2013 +0100
@@ -169,7 +169,7 @@
 chart.discharge.curve.curve.valid.range = {0} (valid from {1,date,short} - {2,date,short})
 chart.computed.discharge.curve.title = Discharge Curve
 chart.computed.discharge.curve.subtitle = {0}-km: {1,number,#.###}
-chart.computed.discharge.curve.yaxis.label = W [NN + m]
+chart.computed.discharge.curve.yaxis.label = W [{0}]
 chart.computed.discharge.curve.curve.label = Discharge Curve {0} km {1}
 chart.duration.curve.title = Duration Curve
 chart.duration.curve.subtitle = {0}-km: {1,number,#.###}
@@ -326,10 +326,10 @@
 export.waterlevel.csv.meta.q = # Q (m\u00b3/s): {0}
 export.waterlevel.csv.meta.w = # W (NN + m): {0} - {1}
 export.waterlevel.csv.not.in.gauge.range = Outside selected gauge
-export.computed.discharge.curve.csv.header.w = W [NN + m]
+export.computed.discharge.curve.csv.header.w = W [{0}]
 export.computed.discharge.curve.csv.header.q = Q [m\u00b3/s]
 export.duration.curve.csv.header.duration = D [Days]
-export.duration.curve.csv.header.w = W [NN + m]
+export.duration.curve.csv.header.w = W [{0}]
 export.duration.curve.csv.header.q = Q [m\u00b3/s]
 export.discharge.longitudinal.section.csv.header.km = River-Km
 export.discharge.longitudinal.section.csv.header.w = W [NN + m]

http://dive4elements.wald.intevation.org