Mercurial > dive4elements > river
changeset 2631:87085ccea466
Issue 528, 637.
Added columns for 'W at gauge' and fixed column header.
flys-artifacts/trunk@4227 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 13 Apr 2012 07:44:25 +0000 |
parents | 0fa2722abf5b |
children | 7d163c2c6e6d |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WWQQJRDataSource.java flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveExporter.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 | 7 files changed, 64 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Fri Apr 13 07:40:22 2012 +0000 +++ b/flys-artifacts/ChangeLog Fri Apr 13 07:44:25 2012 +0000 @@ -1,3 +1,19 @@ +2012-04-13 Raimund Renkert <raimund.renkert@intevation.de> + + Issue 528, 637 + + * src/main/java/de/intevation/flys/artifacts/model/WWQQJRDataSource.java: + Added fields for new columns. + + * src/main/java/de/intevation/flys/exports/ReferenceCurveExporter.java: + Added columns for 'W at gauge' and fixed column header. + + * src/main/resources/messages.properties, + src/main/resources/messages_de_DE.properties, + src/main/resources/messages_en.properties, + src/main/resources/messages_de.properties: + Added filenames for new pdf export templates. + 2012-04-13 Raimund Renkert <raimund.renkert@intevation.de> * doc/conf/jasper/reference_gauge_end.jasper,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WWQQJRDataSource.java Fri Apr 13 07:40:22 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WWQQJRDataSource.java Fri Apr 13 07:44:25 2012 +0000 @@ -109,6 +109,12 @@ if ("Q2".equals(fieldName)) { value = data.get(index)[7]; } + if ("Wcm1".equals(fieldName)) { + value = data.get(index)[8]; + } + if("Wcm2".equals(fieldName)) { + value = data.get(index)[9]; + } return value; } }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveExporter.java Fri Apr 13 07:40:22 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveExporter.java Fri Apr 13 07:44:25 2012 +0000 @@ -56,7 +56,7 @@ "export.reference_curve.csv.header.w.m"; public static final String RC_CSV_Q_HEADER = - "export.reference_curve.csv.header.q"; + "export.reference_curve.csv.header.w.q"; public static final String CSV_LOCATION_HEADER = "export.waterlevel.csv.header.location"; @@ -66,10 +66,13 @@ public static final String RC_DEFAULT_CSV_KM_HEADER = "Fluss-Km"; public static final String RC_DEFAULT_CSV_W_M_HEADER = "W (m + NHN)"; public static final String RC_DEFAULT_CSV_W_CM_HEADER = "W (cm am Pegel)"; - public static final String RC_DEFAULT_CSV_Q_HEADER = "gleichw. Q (m/s)"; + public static final String RC_DEFAULT_CSV_Q_HEADER = "gleichw. Q (m\u00b3/s)"; public static final String PDF_HEADER_MODE = "export.reference_curve.pdf.mode"; public static final String JASPER_FILE = "export.reference_curve.pdf.file"; + public static final String JASPER_FILE_GAUGE = "export.reference_curve.pdf.file.gauge"; + public static final String JASPER_FILE_GAUGE_END = "export.reference_curve.pdf.file.gauge.end"; + public static final String JASPER_FILE_GAUGE_START_END = "export.reference_curve.pdf.file.gauge.start.end"; /** The storage that contains all WKms objects for the different facets. */ protected List<WWQQ[]> data; @@ -257,9 +260,20 @@ protected void writePDF(OutputStream out) { WWQQJRDataSource source = createJRData(); + String filename = JASPER_FILE; + if (startAtGauge && endAtGauge) { + filename = JASPER_FILE_GAUGE_START_END; + } + else if (startAtGauge) { + filename = JASPER_FILE_GAUGE; + } + else if (endAtGauge) { + filename = JASPER_FILE_GAUGE_END; + } + String jasperFile = Resources.getMsg( context.getMeta(), - JASPER_FILE, + filename, "/jasper/reference_en.jasper"); String confPath = Config.getConfigDirectory().toString(); @@ -326,8 +340,15 @@ String endLocationDescription = FLYSUtils.getLocationDescription( flys, ww.getEndKm()); - // TODO missing 'relative' W(cm). for (int i = 0; i < size; i ++) { + String start = "-"; + String end = "-"; + if (startAtGauge) { + start = wf.format(ww.getRelHeight1Cm(i)); + } + if (ww.endAtGauge()) { + end = wf.format(ww.getRelHeight2Cm(i)); + } source.addData(new String[] { kmf.format(ww.getStartKm()), startLocationDescription, @@ -336,7 +357,9 @@ kmf.format(ww.getEndKm()), endLocationDescription, wf.format(ww.getW2(i)), - qf.format(ww.getQ2(i)) // "Q" + qf.format(ww.getQ2(i)), // "Q" + start, + end }); } }
--- a/flys-artifacts/src/main/resources/messages.properties Fri Apr 13 07:40:22 2012 +0000 +++ b/flys-artifacts/src/main/resources/messages.properties Fri Apr 13 07:44:25 2012 +0000 @@ -143,7 +143,7 @@ export.reference_curve.csv.header.km = km export.reference_curve.csv.header.w.cm = W (cm at Gauge) export.reference_curve.csv.header.w.m = W (m + NHN) -export.reference_curve.csv.header.w.q = Q (m\u00b3/s) +export.reference_curve.csv.header.w.q = equiv. Q (m\u00b3/s) export.waterlevel.pdf.mode = Waterlevel export.computed.discharge.pdf.mode = Computed Dischargecurve @@ -157,6 +157,9 @@ export.wdifferences.pdf.file = /jasper/wdifferences_en.jasper export.historical.discharge.pdf.file = /jasper/historical-discharge_en.jasper export.reference_curve.pdf.file = /jasper/reference_en.jasper +export.reference_curve.pdf.file.gauge = /jasper/reference_en_gauge.jasper +export.reference_curve.pdf.file.gauge.end = /jasper/reference_en_gauge_end.jasper +export.reference_curve.pdf.file.gauge.start.end = /jasper/reference_en_gauge_start_end.jasper floodmap.wmsbackground = Background Map floodmap.riveraxis = River Axis
--- a/flys-artifacts/src/main/resources/messages_de.properties Fri Apr 13 07:40:22 2012 +0000 +++ b/flys-artifacts/src/main/resources/messages_de.properties Fri Apr 13 07:44:25 2012 +0000 @@ -157,6 +157,9 @@ export.wdifferences.pdf.file = /jasper/wdifferences.jasper export.historical.discharge.pdf.file = /jasper/historical-discharge.jasper export.reference_curve.pdf.file = /jasper/reference.jasper +export.reference_curve.pdf.file.gauge = /jasper/reference_gauge.jasper +export.reference_curve.pdf.file.gauge.end = /jasper/reference_gauge_end.jasper +export.reference_curve.pdf.file.gauge.start.end = /jasper/reference_gauge_start_end.jasper floodmap.wmsbackground = Hintergrundkarte floodmap.riveraxis = Flussachse
--- a/flys-artifacts/src/main/resources/messages_de_DE.properties Fri Apr 13 07:40:22 2012 +0000 +++ b/flys-artifacts/src/main/resources/messages_de_DE.properties Fri Apr 13 07:44:25 2012 +0000 @@ -156,6 +156,9 @@ export.wdifferences.pdf.file = /jasper/wdifferences.jasper export.historical.discharge.pdf.file = /jasper/historical-discharge.jasper export.reference_curve.pdf.file = /jasper/reference.jasper +export.reference_curve.pdf.file.gauge = /jasper/reference_gauge.jasper +export.reference_curve.pdf.file.gauge.end = /jasper/reference_gauge_end.jasper +export.reference_curve.pdf.file.gauge.start.end = /jasper/reference_gauge_start_end.jasper floodmap.wmsbackground = Hintergrundkarte floodmap.riveraxis = Flussachse
--- a/flys-artifacts/src/main/resources/messages_en.properties Fri Apr 13 07:40:22 2012 +0000 +++ b/flys-artifacts/src/main/resources/messages_en.properties Fri Apr 13 07:44:25 2012 +0000 @@ -142,8 +142,7 @@ export.reference_curve.csv.header.km = km export.reference_curve.csv.header.w.cm = W (cm at Gauge) export.reference_curve.csv.header.w.m = W (m + NHN) -export.reference_curve.csv.header.w.q = Q (m\u00b3/s) - +export.reference_curve.csv.header.w.q = equiv. Q (m\u00b3/s) export.waterlevel.pdf.mode = Waterlevel export.computed.discharge.pdf.mode = Computed Dischargecurve @@ -157,6 +156,9 @@ export.wdifferences.pdf.file = /jasper/wdifferences_en.jasper export.historical.discharge.pdf.file = /jasper/historical-discharge_en.jasper export.reference_curve.pdf.file = /jasper/reference_en.jasper +export.reference_curve.pdf.file.gauge = /jasper/reference_en_gauge.jasper +export.reference_curve.pdf.file.gauge.end = /jasper/reference_en_gauge_end.jasper +export.reference_curve.pdf.file.gauge.start.end = /jasper/reference_en_gauge_start_end.jasper floodmap.wmsbackground = Background Map floodmap.riveraxis = River Axis