changeset 2694:28c3f6588011

Removed the unused computeFeed() from ComputationRangeState to make this State ready to use it in MINFO calculations. flys-artifacts/trunk@4400 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 14 May 2012 10:34:56 +0000
parents edaa2297aea3
children ae0742f92cd5
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputationRangeState.java
diffstat 2 files changed, 6 insertions(+), 82 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon May 14 08:09:10 2012 +0000
+++ b/flys-artifacts/ChangeLog	Mon May 14 10:34:56 2012 +0000
@@ -1,3 +1,9 @@
+2012-05-14  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/states/ComputationRangeState.java:
+	  Removed the computeFeed() method that created Facets for discharge
+	  curves to make this state ready to use in MINFO calculations.
+
 2012-05-14  Ingo Weinzierl <ingo@intevation.de>
 
 	* doc/conf/artifacts/minfo.xml: New Artifact configuration for module
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputationRangeState.java	Mon May 14 08:09:10 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputationRangeState.java	Mon May 14 10:34:56 2012 +0000
@@ -152,88 +152,6 @@
 
 
     @Override
-    public Object computeFeed(
-        FLYSArtifact artifact,
-        String       hash,
-        CallContext  context,
-        List<Facet>  facets,
-        Object       old
-    ) {
-        logger.debug("computeFeed");
-
-        if (artifact instanceof ChartArtifact) {
-            return null;
-        }
-        WINFOArtifact winfo = (WINFOArtifact)artifact;
-
-        CalculationResult res = old instanceof CalculationResult
-            ? (CalculationResult)old
-            : winfo.getDischargeCurveData();
-
-        if (facets == null) {
-            logger.debug("generate no facets");
-            return res;
-        }
-
-        WQKms [] wqkms = (WQKms [])res.getData();
-
-        logger.debug("generate " + wqkms.length + " facets.");
-
-        String stateID = winfo.getCurrentStateId();
-
-        for (int i = 0; i < wqkms.length; ++i) {
-            String name = getSeriesName(context, wqkms[i].getName());
-            facets.add(new WaterlevelFacet(
-                i, DISCHARGE_CURVE, name, ComputeType.FEED, stateID, hash));
-        }
-
-
-        return res;
-    }
-
-    protected String getSeriesName(CallContext cc, String gaugeName) {
-        Gauge gauge = GaugesFactory.getGauge(gaugeName);
-
-        if (gauge == null) {
-            logger.warn("Cannot determine Gauge for name: " + gaugeName);
-            return gaugeName;
-        }
-
-        List<DischargeTable> dts = gauge.getDischargeTables();
-
-        for (DischargeTable dt: dts) {
-            if (dt.getKind() == 0) {
-                TimeInterval ti = dt.getTimeInterval();
-
-                Date start = ti.getStartTime();
-                Date end   = ti.getStopTime();
-
-                String name  = gauge.getName();
-
-                if (end == null) {
-                    Object[] args = new Object[] { name, start };
-                    return Resources.getMsg(
-                        cc.getMeta(),
-                        "chart.discharge.curve.curve.valid.from",
-                        "",
-                        args);
-                }
-                else {
-                    Object[] args = new Object[] { name, start, end };
-                    return Resources.getMsg(
-                        cc.getMeta(),
-                        "chart.discharge.curve.curve.valid.range",
-                        "",
-                        args);
-                }
-            }
-        }
-
-        return gauge.getName();
-    }
-
-
-    @Override
     protected double[] getMinMax(Artifact artifact) {
         FLYSArtifact flysArtifact = (FLYSArtifact) artifact;
         return FLYSUtils.getRiverMinMax(flysArtifact);

http://dive4elements.wald.intevation.org