changeset 3445:b6c301cb3871

Handle FixationArtifacts in WQAdapted-State. flys-artifacts/trunk@5108 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 23 Jul 2012 15:11:12 +0000
parents f903f1e5aed6
children 5325040d35e3
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java
diffstat 2 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Jul 23 15:08:28 2012 +0000
+++ b/flys-artifacts/ChangeLog	Mon Jul 23 15:11:12 2012 +0000
@@ -1,3 +1,9 @@
+2012-07-23	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java:
+	  Handle FixationArtifacts with as much care as WINFOArtifacts,
+	  by using refactore FLYSUtils.
+
 2012-07-23	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	Towards per-Gauge-input of W/Q values for FixationArtifact.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java	Mon Jul 23 15:08:28 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java	Mon Jul 23 15:11:12 2012 +0000
@@ -23,6 +23,7 @@
 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;
 import de.intevation.flys.artifacts.model.WstFactory;
@@ -37,7 +38,6 @@
     /** The logger used in this state.*/
     private static Logger logger = Logger.getLogger(WQAdapted.class);
 
-
     public static final String FIELD_WQ_MODE = "wq_isq";
 
     public static final String FIELD_WQ_VALUES = "wq_values";
@@ -60,6 +60,7 @@
     public WQAdapted() {
     }
 
+
     /**
      * This method creates one element for each gauge of the selected river that
      * is intersected by the given kilometer range. Each element is a tuple of
@@ -120,12 +121,12 @@
     {
         logger.debug("WQAdapted.createValueItems");
 
-        WINFOArtifact flysArtifact = (WINFOArtifact) artifact;
+        FLYSArtifact flysArtifact = (FLYSArtifact) artifact;
 
         double[]    dist   = FLYSUtils.getKmRange(flysArtifact);
         River       river  = FLYSUtils.getRiver(flysArtifact);
         Wst         wst    = WstFactory.getWst(river);
-        List<Gauge> gauges = flysArtifact.getGauges();
+        List<Gauge> gauges = FLYSUtils.getGauges(flysArtifact);
 
         int num = gauges != null ? gauges.size() : 0;
 
@@ -278,7 +279,7 @@
     {
         logger.debug("WQAdapted.validate");
 
-        WINFOArtifact flys = (WINFOArtifact) artifact;
+        FLYSArtifact flys = (FLYSArtifact) artifact;
         StateData    data = getData(flys, FIELD_WQ_MODE);
 
         String mode = data != null ? (String) data.getValue() : null;
@@ -302,7 +303,7 @@
     throws IllegalArgumentException
     {
         logger.debug("WQAdapted.validateW");
-        WINFOArtifact flys = (WINFOArtifact) artifact;
+        FLYSArtifact flys = (FLYSArtifact) artifact;
 
         RangeWithValues[] rwvs = extractInput(getData(flys, "wq_values"));
 
@@ -310,7 +311,7 @@
             throw new IllegalArgumentException("error_missing_wq_data");
         }
 
-        List<Gauge>     gauges = ((WINFOArtifact) artifact).getGauges();
+        List<Gauge> gauges = FLYSUtils.getGauges((FLYSArtifact) artifact);
 
         for (Gauge gauge: gauges) {
             Range range  = gauge.getRange();
@@ -332,7 +333,7 @@
     throws IllegalArgumentException
     {
         logger.debug("WQAdapted.validateQ");
-        WINFOArtifact flys = (WINFOArtifact) artifact;
+        FLYSArtifact flys = (FLYSArtifact) artifact;
 
         RangeWithValues[] rwvs = extractInput(getData(flys, "wq_values"));
 
@@ -340,7 +341,7 @@
             throw new IllegalArgumentException("error_missing_wq_data");
         }
 
-        List<Gauge> gauges = flys.getGauges();
+        List<Gauge> gauges = FLYSUtils.getGauges(flys);
         River        river = FLYSUtils.getRiver(flys);
         Wst            wst = WstFactory.getWst(river);
 

http://dive4elements.wald.intevation.org