diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/WQKmsInterpolArtifact.java @ 3585:c105b4466b4e

Basedata in FixA WQ DC and diagram. flys-artifacts/trunk@5201 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 14 Aug 2012 08:42:08 +0000
parents afc7bfb4800b
children 001e35349203
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WQKmsInterpolArtifact.java	Mon Aug 13 13:50:45 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WQKmsInterpolArtifact.java	Tue Aug 14 08:42:08 2012 +0000
@@ -122,12 +122,12 @@
                     name = STATIC_WQ;
                 }
 
-                Facet facet = new WQFacet(name,
+                Facet wQFacet = new WQFacet(name,
                     Resources.getMsg(
                         callMeta,
                         wkmsName,
                         wkmsName));
-                fs.add(facet);
+                fs.add(wQFacet);
                 facets.put(state.getID(), fs);
             }
         }
@@ -190,8 +190,10 @@
 
     /**
      * Get WQ at a given km.
+     * @param currentKm the requested km. If NULL, ld_location data
+     *        will be used.
      */
-    public double [][] getWQAtKm(double km) {
+    public double [][] getWQAtKm(Double currentKm) {
 
         WstValueTable interpolator = null;
         // Get WstValueTable
@@ -204,7 +206,10 @@
                 getDataAsInt("wst_id"));
         }
 
-        Double tmp = getDataAsDouble("ld_locations");
+        Double tmp = (currentKm != null)
+                     ? currentKm
+                     : getDataAsDouble("ld_locations");
+
         double [][] vs = interpolator.interpolateWQColumnwise(
             tmp != null ? tmp : 0);
 

http://dive4elements.wald.intevation.org