changeset 3450:22790758b132

FixA/Vollmer: return the result now. flys-artifacts/trunk@5113 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 23 Jul 2012 15:59:51 +0000
parents fc351f12b906
children b5eec54bd4a2
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation4.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisResult.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixRealizingCalculation.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixRealizingResult.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixResult.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java
diffstat 7 files changed, 116 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Jul 23 15:24:14 2012 +0000
+++ b/flys-artifacts/ChangeLog	Mon Jul 23 15:59:51 2012 +0000
@@ -1,3 +1,21 @@
+2012-07-23	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/fixings/FixResult.java:
+	  New base class for fixing analysis results.
+
+	* src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisResult.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/FixRealizingResult.java:
+	  Inherits from FixResult.
+
+	* src/main/java/de/intevation/flys/artifacts/model/fixings/FixRealizingCalculation.java:
+	  Calculation returns FixRealizingResult.
+
+	* src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java:
+	  Remove superfluous import.
+
+	* src/main/java/de/intevation/flys/artifacts/model/Calculation4.java:
+	  Cosmetics.
+
 2012-07-23	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation4.java	Mon Jul 23 15:24:14 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation4.java	Mon Jul 23 15:59:51 2012 +0000
@@ -232,7 +232,7 @@
     }
 
     protected String createName(int index) {
-        // TODO: I18N
+        // TODO: i18n
         StringBuilder sb = new StringBuilder(isQ ? "Q" : "W");
         sb.append(" benutzerdefiniert (");
         for (int i = 0, N = segments.size(); i < N; ++i) {
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisResult.java	Mon Jul 23 15:24:14 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisResult.java	Mon Jul 23 15:59:51 2012 +0000
@@ -4,14 +4,9 @@
 
 import de.intevation.flys.utils.KMIndex;
 
-import java.io.Serializable;
-
 public class FixAnalysisResult
-implements   Serializable
+extends      FixResult
 {
-    protected Parameters                 parameters;
-    protected KMIndex<QWD []>            referenced;
-    protected KMIndex<QW []>             outliers;
     protected KMIndex<AnalysisPeriod []> analysisPeriods;
 
     public FixAnalysisResult() {
@@ -23,9 +18,7 @@
         KMIndex<QW []>             outliers,
         KMIndex<AnalysisPeriod []> analysisPeriods
     ) {
-        this.parameters      = parameters;
-        this.referenced      = referenced;
-        this.outliers        = outliers;
+        super(parameters, referenced, outliers);
         this.analysisPeriods = analysisPeriods;
     }
 
@@ -44,14 +37,6 @@
         return result;
     }
 
-    public Parameters getParameters() {
-        return parameters;
-    }
-
-    public void setParameters(Parameters parameters) {
-        this.parameters = parameters;
-    }
-
     public KMIndex<AnalysisPeriod []> getAnalysisPeriods() {
         return analysisPeriods;
     }
@@ -59,21 +44,5 @@
     public void setAnalysisPeriods(KMIndex<AnalysisPeriod []> analysisPeriods) {
         this.analysisPeriods = analysisPeriods;
     }
-
-    public KMIndex<QWD []> getReferenced() {
-        return referenced;
-    }
-
-    public void setReferenced(KMIndex<QWD []> referenced) {
-        this.referenced = referenced;
-    }
-
-    public KMIndex<QW []> getOutliers() {
-        return outliers;
-    }
-
-    public void setOutliers(KMIndex<QW []> outliers) {
-        this.outliers = outliers;
-    }
 }
 // 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/FixRealizingCalculation.java	Mon Jul 23 15:24:14 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixRealizingCalculation.java	Mon Jul 23 15:59:51 2012 +0000
@@ -132,7 +132,13 @@
             results[i].setName(createName(i));
         }
 
-        return new CalculationResult(this);
+        FixRealizingResult frr = new FixRealizingResult(
+            parameters,
+            fitResult.getReferenced(),
+            fitResult.getOutliers(),
+            results);
+
+        return new CalculationResult(frr, this);
     }
 
     protected String createName(int index) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixRealizingResult.java	Mon Jul 23 15:59:51 2012 +0000
@@ -0,0 +1,35 @@
+package de.intevation.flys.artifacts.model.fixings;
+
+import de.intevation.flys.artifacts.model.WQKms;
+
+import de.intevation.flys.artifacts.model.Parameters;
+
+import de.intevation.flys.utils.KMIndex;
+
+public class FixRealizingResult
+extends      FixResult
+{
+    public WQKms [] wqkms;
+
+    public FixRealizingResult() {
+    }
+
+    public FixRealizingResult(
+        Parameters      parameters,
+        KMIndex<QWD []> referenced,
+        KMIndex<QW []>  outliers,
+        WQKms []        wqkms
+    ) {
+        super(parameters, referenced, outliers);
+        this.wqkms = wqkms;
+    }
+
+    public WQKms [] getWQKms() {
+        return wqkms;
+    }
+
+    public void setWQKms(WQKms [] wqkms) {
+        this.wqkms = wqkms;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixResult.java	Mon Jul 23 15:59:51 2012 +0000
@@ -0,0 +1,53 @@
+package de.intevation.flys.artifacts.model.fixings;
+
+import de.intevation.flys.artifacts.model.Parameters;
+
+import de.intevation.flys.utils.KMIndex;
+
+import java.io.Serializable;
+
+public class FixResult
+implements   Serializable
+{
+    protected Parameters      parameters;
+    protected KMIndex<QWD []> referenced;
+    protected KMIndex<QW []>  outliers;
+
+    public FixResult() {
+    }
+
+    public FixResult(
+        Parameters      parameters,
+        KMIndex<QWD []> referenced,
+        KMIndex<QW []>  outliers
+    ) {
+        this.parameters = parameters;
+        this.referenced = referenced;
+        this.outliers   = outliers;
+    }
+
+    public KMIndex<QWD []> getReferenced() {
+        return referenced;
+    }
+
+    public void setReferenced(KMIndex<QWD []> referenced) {
+        this.referenced = referenced;
+    }
+
+    public KMIndex<QW []> getOutliers() {
+        return outliers;
+    }
+
+    public void setOutliers(KMIndex<QW []> outliers) {
+        this.outliers = outliers;
+    }
+
+    public Parameters getParameters() {
+        return parameters;
+    }
+
+    public void setParameters(Parameters parameters) {
+        this.parameters = parameters;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java	Mon Jul 23 15:24:14 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java	Mon Jul 23 15:59:51 2012 +0000
@@ -22,7 +22,6 @@
 import de.intevation.flys.model.River;
 import de.intevation.flys.model.Wst;
 
-import de.intevation.flys.artifacts.WINFOArtifact;
 import de.intevation.flys.artifacts.FLYSArtifact;
 
 import de.intevation.flys.artifacts.model.RangeWithValues;

http://dive4elements.wald.intevation.org