changeset 3644:fa633f6a5fd9

smaller part of issue825 fixed (column ordering of dwt-export). flys-artifacts/trunk@5364 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 06 Sep 2012 11:08:58 +0000
parents 171db4d5d3cb
children d92079b7c591
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/DeltaWtExporter.java
diffstat 2 files changed, 23 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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	<felix.wolfsteller@intevation.de>
+
+	* 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	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/fixings/FixATWriter.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<AnalysisPeriod []> periods: analysisPeriods) {
 
-            String analyisS = MessageFormat.format(
-                analysisTemplate, analysisCount);
 
             for (KMIndex.Entry<AnalysisPeriod []> 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)
         });
     }

http://dive4elements.wald.intevation.org