Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/HistoricalDischargeDifferenceFacet.java @ 2311:b8df8d1476ba
Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
flys-artifacts/trunk@3991 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 09 Feb 2012 10:57:35 +0000 |
parents | |
children | 49cb65d5932d |
comparison
equal
deleted
inserted
replaced
2310:ecb76933362f | 2311:b8df8d1476ba |
---|---|
1 package de.intevation.flys.artifacts.model; | |
2 | |
3 import org.apache.log4j.Logger; | |
4 | |
5 import de.intevation.artifacts.Artifact; | |
6 import de.intevation.artifacts.CallContext; | |
7 | |
8 import de.intevation.flys.artifacts.FLYSArtifact; | |
9 import de.intevation.flys.artifacts.states.DefaultState.ComputeType; | |
10 | |
11 | |
12 /** | |
13 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
14 */ | |
15 public class HistoricalDischargeDifferenceFacet | |
16 extends HistoricalDischargeFacet | |
17 { | |
18 private static final Logger logger = | |
19 Logger.getLogger(HistoricalDischargeDifferenceFacet.class); | |
20 | |
21 | |
22 public HistoricalDischargeDifferenceFacet( | |
23 int index, | |
24 String name, | |
25 String desc | |
26 ) { | |
27 super(index, name, desc, ComputeType.ADVANCE, null, null); | |
28 } | |
29 | |
30 | |
31 public HistoricalDischargeDifferenceFacet( | |
32 int index, | |
33 String name, | |
34 String description, | |
35 ComputeType type, | |
36 String stateID, | |
37 String hash | |
38 | |
39 ) { | |
40 super(index, name, description, type, hash, stateID); | |
41 } | |
42 | |
43 | |
44 @Override | |
45 public Object getData(Artifact artifact, CallContext context) { | |
46 if (logger.isDebugEnabled()) { | |
47 logger.debug("Get data for historical discharge difference curves" + | |
48 " at index: " + index + " / stateId: " + stateId); | |
49 } | |
50 | |
51 FLYSArtifact flys = (FLYSArtifact) artifact; | |
52 | |
53 CalculationResult res = (CalculationResult) | |
54 flys.compute(context, hash, stateId, type, false); | |
55 | |
56 HistoricalWQTimerange[] wqts = (HistoricalWQTimerange[]) res.getData(); | |
57 | |
58 return wqts[index]; | |
59 } | |
60 } | |
61 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |