changeset 3604:2382b26079ac

FixA: Store unique coulun index into QW models. flys-artifacts/trunk@5230 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 22 Aug 2012 11:02:56 +0000 (2012-08-22)
parents d2ae58f6730d
children 7196f06e0928
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/QW.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/QWD.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/FixingsKMChartService.java
diffstat 6 files changed, 36 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Aug 22 10:51:29 2012 +0000
+++ b/flys-artifacts/ChangeLog	Wed Aug 22 11:02:56 2012 +0000
@@ -1,3 +1,16 @@
+2012-08-20	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/fixings/QW.java:
+	  Store index, too.
+
+	* src/main/java/de/intevation/flys/artifacts/model/fixings/QWD.java:
+	  Adjusted to keep constructors in sync.
+
+	* src/main/java/de/intevation/flys/artifacts/services/FixingsKMChartService.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java:
+	  Set QD index to the values of the column cache columns.
+
 2012-08-20	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	Use the column cache to establish a consistent index scheme.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java	Wed Aug 22 10:51:29 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java	Wed Aug 22 11:02:56 2012 +0000
@@ -200,7 +200,10 @@
                         String description = column.getDescription();
 
                         QWD qwd = new QWD(
-                            wq[1], wq[0], description, date, true, dw);
+                            wq[1], wq[0],
+                            description,
+                            date, true,
+                            dw, column.getIndex());
 
                         qwds.add(qwd);
 
@@ -225,7 +228,7 @@
                             String avgDescription = "avg.deltawt." + qSector;
 
                             QWD avgQWD = new QWD(
-                                avgQ, avgW, avgDescription, avgDate, true, avgDw);
+                                avgQ, avgW, avgDescription, avgDate, true, avgDw, 0);
 
                             qSectorAverages[qSector] = avgQWD;
                         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java	Wed Aug 22 10:51:29 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java	Wed Aug 22 11:02:56 2012 +0000
@@ -298,7 +298,8 @@
                             column.getDescription(),
                             column.getDate(),
                             interpolated[i],
-                            0d);
+                            0d,
+                            column.getIndex());
                     }
                 }
                 log.warn("cannot find column for (" + q + ", " + w + ")");
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/QW.java	Wed Aug 22 10:51:29 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/QW.java	Wed Aug 22 11:02:56 2012 +0000
@@ -12,6 +12,7 @@
     protected String  description;
     protected Date    date;
     protected boolean interpolated;
+    protected int     index;
 
     public QW() {
     }
@@ -26,12 +27,14 @@
         double  w,
         String  description,
         Date    date,
-        boolean interpolated
+        boolean interpolated,
+        int     index
     ) {
         this(q, w);
         this.description  = description;
         this.date         = date;
         this.interpolated = interpolated;
+        this.index        = index;
     }
 
     public double getQ() {
@@ -73,5 +76,13 @@
     public void setInterpolated(boolean interpolated) {
         this.interpolated = interpolated;
     }
+
+    public int getIndex() {
+        return index;
+    }
+
+    public void setIndex(int index) {
+        this.index = index;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/QWD.java	Wed Aug 22 10:51:29 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/QWD.java	Wed Aug 22 11:02:56 2012 +0000
@@ -20,9 +20,10 @@
         String  description,
         Date    date,
         boolean interpolated,
-        double  deltaW
+        double  deltaW,
+        int     index
     ) {
-        super(q, w, description, date, interpolated);
+        super(q, w, description, date, interpolated, index);
         this.deltaW = deltaW;
     }
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/FixingsKMChartService.java	Wed Aug 22 10:51:29 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/FixingsKMChartService.java	Wed Aug 22 11:02:56 2012 +0000
@@ -280,7 +280,7 @@
                     q, w[0],
                     col.getA().getDescription(),
                     col.getA().getStartTime(),
-                    interpolated);
+                    interpolated, 0);
                 dataset.add(qw);
             }
         }

http://dive4elements.wald.intevation.org