Mercurial > dive4elements > river
changeset 2329:d999062c20e6
Add W(cm) column to csv export of reference curves.
flys-artifacts/trunk@4013 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 10 Feb 2012 08:28:17 +0000 |
parents | 0cc0e232fa35 |
children | 594885703687 d0e7afb3696b |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WW.java flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveExporter.java |
diffstat | 3 files changed, 35 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Thu Feb 09 22:03:07 2012 +0000 +++ b/flys-artifacts/ChangeLog Fri Feb 10 08:28:17 2012 +0000 @@ -1,3 +1,10 @@ +2012-02-10 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/model/WW.java: + Add accessors to relative heights. + + * + 2012-02-09 Ingo Weinzierl <ingo@intevation.de> * pom.xml: Added dependency to GeoTools swing module.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WW.java Thu Feb 09 22:03:07 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WW.java Fri Feb 10 08:28:17 2012 +0000 @@ -181,5 +181,20 @@ public double minWs2() { return ws2.min(); } + + // Note that we can also easily define a Function to do so. + public double getRelHeight1Cm(int idx) { + if (this.startAtGauge()) { + return (ws.getQuick(idx) - getStartDatum())*100d; + } + else return ws.getQuick(idx)*100d; + } + + public double getRelHeight2Cm(int idx) { + if (this.endAtGauge()) { + return (ws2.getQuick(idx) - getEndDatum())*100d; + } + else return ws2.getQuick(idx)*100d; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveExporter.java Thu Feb 09 22:03:07 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveExporter.java Fri Feb 10 08:28:17 2012 +0000 @@ -48,8 +48,11 @@ public static final String RC_CSV_KM_HEADER = "export.reference_curve.csv.header.km"; - public static final String RC_CSV_W_HEADER = - "export.reference_curve.csv.header.w"; + public static final String RC_CSV_W_CM_HEADER = + "export.reference_curve.csv.header.w.cm"; + + public static final String RC_CSV_W_M_HEADER = + "export.reference_curve.csv.header.w.m"; public static final String RC_CSV_Q_HEADER = "export.reference_curve.csv.header.q"; @@ -60,7 +63,8 @@ public static final String DEFAULT_CSV_LOCATION_HEADER = "Lage"; public static final String RC_DEFAULT_CSV_KM_HEADER = "Fluss-Km"; - public static final String RC_DEFAULT_CSV_W_HEADER = "m"; + public static final String RC_DEFAULT_CSV_W_M_HEADER = "m"; + public static final String RC_DEFAULT_CSV_W_CM_HEADER = "cm"; public static final String RC_DEFAULT_CSV_Q_HEADER = "Q"; public static final String PDF_HEADER_MODE = "export.reference_curve.pdf.mode"; @@ -158,11 +162,13 @@ writer.writeNext(new String[] { msg(RC_CSV_KM_HEADER, RC_DEFAULT_CSV_KM_HEADER), msg(CSV_LOCATION_HEADER, DEFAULT_CSV_LOCATION_HEADER), - msg(RC_CSV_W_HEADER, RC_DEFAULT_CSV_W_HEADER), + msg(RC_CSV_W_M_HEADER, RC_DEFAULT_CSV_W_M_HEADER), + msg(RC_CSV_W_CM_HEADER, RC_DEFAULT_CSV_W_CM_HEADER), msg(RC_CSV_Q_HEADER, RC_DEFAULT_CSV_Q_HEADER), msg(RC_CSV_KM_HEADER, RC_DEFAULT_CSV_KM_HEADER), msg(CSV_LOCATION_HEADER, DEFAULT_CSV_LOCATION_HEADER), - msg(RC_CSV_W_HEADER, RC_DEFAULT_CSV_W_HEADER), + msg(RC_CSV_W_M_HEADER, RC_DEFAULT_CSV_W_M_HEADER), + msg(RC_CSV_W_CM_HEADER, RC_DEFAULT_CSV_W_CM_HEADER), msg(RC_CSV_Q_HEADER, RC_DEFAULT_CSV_Q_HEADER), }); } @@ -191,10 +197,12 @@ kmf.format(ww.getStartKm()), startLocationDescription, wf.format(ww.getW1(i)), + wf.format(ww.getRelHeight1Cm(i)), qf.format(ww.getQ1(i)), // "Q" kmf.format(ww.getEndKm()), endLocationDescription, wf.format(ww.getW2(i)), + wf.format(ww.getRelHeight2Cm(i)), qf.format(ww.getQ2(i)) // "Q" }); }