changeset 4260:e4a415773b0a

Added the 'index' parameter to HistoricalDischargeWQFacet to avoid loosing facets during the merge process in the FLYSArtifactCollection.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 26 Oct 2012 08:51:08 +0200
parents 5cc9453456a7
children 1264fef59bfa
files flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/HistoricalDischargeWQFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/HistoricalDischargeComputeState.java
diffstat 2 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/HistoricalDischargeWQFacet.java	Thu Oct 25 17:25:37 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/HistoricalDischargeWQFacet.java	Fri Oct 26 08:51:08 2012 +0200
@@ -3,6 +3,7 @@
 import de.intevation.artifactdatabase.state.Facet;
 import de.intevation.artifacts.Artifact;
 import de.intevation.artifacts.CallContext;
+import de.intevation.flys.artifacts.states.DefaultState.ComputeType;
 
 
 /**
@@ -15,8 +16,11 @@
     public HistoricalDischargeWQFacet() {
     }
 
-    public HistoricalDischargeWQFacet(String name, String desc, double value) {
-        super(name, desc);
+    public HistoricalDischargeWQFacet(int index, String name,
+        String description, ComputeType type, String hash, String stateId,
+        double value) {
+
+        super(index, name, description, type, hash, stateId);
         this.value = value;
     }
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/HistoricalDischargeComputeState.java	Thu Oct 25 17:25:37 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/HistoricalDischargeComputeState.java	Fri Oct 26 08:51:08 2012 +0200
@@ -137,13 +137,15 @@
         double[] qs = access.getQs();
 
         for (int k = 0; k < ws.length; k++) {
-            facets.add(new HistoricalDischargeWQFacet(
-                HISTORICAL_DISCHARGE_WQ_W, "W=" + ws[k], ws[k]));
+            facets.add(new HistoricalDischargeWQFacet(k,
+                HISTORICAL_DISCHARGE_WQ_W, "W=" + ws[k], ComputeType.ADVANCE,
+                hash, getID(), ws[k]));
         }
 
         for (int k = 0; k < qs.length; k++) {
-            facets.add(new HistoricalDischargeWQFacet(
-                HISTORICAL_DISCHARGE_WQ_Q, "Q=" + qs[k], qs[k]));
+            facets.add(new HistoricalDischargeWQFacet(k,
+                HISTORICAL_DISCHARGE_WQ_Q, "Q=" + qs[k], ComputeType.ADVANCE,
+                hash, getID(), qs[k]));
         }
 
         int idx = 0;

http://dive4elements.wald.intevation.org