[Dive4elements-commits] [PATCH 1 of 2] Fix flys/issue1206 (reference system in discharge curve)

Wald Commits scm-commit at wald.intevation.org
Tue Mar 26 11:19:35 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1364293236 -3600
# Node ID 0bb57e72b8eab2d02fad671acedc1271e4f3ff90
# Parent  0548b70e7b39124584f043293f4034ef312a7afc
Fix flys/issue1206 (reference system in discharge curve).

diff -r 0548b70e7b39 -r 0bb57e72b8ea flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveExporter.java
--- 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)
         });
     }
diff -r 0548b70e7b39 -r 0bb57e72b8ea flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java
--- 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 });
     }
 
 
diff -r 0548b70e7b39 -r 0bb57e72b8ea flys-artifacts/src/main/resources/messages.properties
--- 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]
diff -r 0548b70e7b39 -r 0bb57e72b8ea flys-artifacts/src/main/resources/messages_de.properties
--- 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]
diff -r 0548b70e7b39 -r 0bb57e72b8ea flys-artifacts/src/main/resources/messages_de_DE.properties
--- 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]
diff -r 0548b70e7b39 -r 0bb57e72b8ea flys-artifacts/src/main/resources/messages_en.properties
--- 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]


More information about the Dive4elements-commits mailing list