# HG changeset patch # User Felix Wolfsteller # Date 1346929738 0 # Node ID fa633f6a5fd95afead7bde0db0711ceee804a7be # Parent 171db4d5d3cbeeaedc5042f458255372afc0d18e smaller part of issue825 fixed (column ordering of dwt-export). flys-artifacts/trunk@5364 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 171db4d5d3cb -r fa633f6a5fd9 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Wed Sep 05 08:38:12 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Sep 06 11:08:58 2012 +0000 @@ -1,3 +1,8 @@ +2012-09-06 Felix Wolfsteller + + * src/main/java/de/intevation/flys/exports/fixings/DeltaWtExporter.java: + Comments, changed order of columns as requested in issue825. + 2012-09-05 Sascha L. Teichmann * src/main/java/de/intevation/flys/exports/fixings/FixATWriter.java: diff -r 171db4d5d3cb -r fa633f6a5fd9 flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/DeltaWtExporter.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/DeltaWtExporter.java Wed Sep 05 08:38:12 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/DeltaWtExporter.java Thu Sep 06 11:08:58 2012 +0000 @@ -32,9 +32,11 @@ import org.w3c.dom.Document; +/** Exports fixation analysis deltaw(t) computation results to csv. */ public class DeltaWtExporter extends AbstractExporter { + /** Private logger. */ private static Logger log = Logger.getLogger(DeltaWtExporter.class); public static final String CSV_KM_HEADER = @@ -144,10 +146,10 @@ writer.writeNext(new String[] { kmS, + dateS, qS, wS, referenceS, - dateS, deltaWS }); } @@ -162,10 +164,12 @@ int analysisCount = 1; + // Typically resulting in A1,A2... + String analyisS = MessageFormat.format( + analysisTemplate, analysisCount); + for (KMIndex periods: analysisPeriods) { - String analyisS = MessageFormat.format( - analysisTemplate, analysisCount); for (KMIndex.Entry kmEntry: periods) { @@ -173,6 +177,10 @@ for (AnalysisPeriod period: kmEntry.getValue()) { QWD [] qwds = period.getQWDs(); + /* issue825 + km; Ereignis, Abfluss, GEMESSENER Wasserstand; Status (RECHTSBÜNDIG), del W + */ + if (qwds != null) { for (QWD qwd: qwds) { String deltaWS = dwF.format(qwd.getDeltaW()); @@ -182,10 +190,10 @@ writer.writeNext(new String[] { kmS, + dateS, qS, wS, analyisS, - dateS, deltaWS }); } } @@ -196,6 +204,7 @@ writer.flush(); } + /** Template to create "State" strings like A1,A2... */ protected String getAnalysisTemplate() { return Resources.getMsg( context.getMeta(), @@ -237,12 +246,16 @@ protected void writeCSVHeader(CSVWriter writer) { log.debug("DeltaWtExporter.writeCSVHeader"); + /* issue825 + km; Ereignis, Abfluss, GEMESSENER Wasserstand; Status (RECHTSBÜNDIG), del W + */ + writer.writeNext(new String[] { msg(CSV_KM_HEADER, DEFAULT_CSV_KM_HEADER), + msg(CSV_T_HEADER, DEFAULT_CSV_T_HEADER), msg(CSV_Q_HEADER, DEFAULT_CSV_Q_HEADER), msg(CSV_W_HEADER, DEFAULT_CSV_W_HEADER), msg(CSV_TRANGE_HEADER, DEFAULT_CSV_TRANGE_DESC_HEADER), - msg(CSV_T_HEADER, DEFAULT_CSV_T_HEADER), msg(CSV_DELTA_W_HEADER, DEFAULT_CSV_DELTA_W_HEADER) }); }