# HG changeset patch # User Ingo Weinzierl # Date 1336991696 0 # Node ID 28c3f65880115f21a38378fb188c5ee367323d72 # Parent edaa2297aea314a101a83d14dfcf297101225754 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 diff -r edaa2297aea3 -r 28c3f6588011 flys-artifacts/ChangeLog --- 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 + + * 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 * doc/conf/artifacts/minfo.xml: New Artifact configuration for module diff -r edaa2297aea3 -r 28c3f6588011 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputationRangeState.java --- 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 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 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);