Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/HistoricalDischargeDifferenceFacet.java @ 5838:5aa05a7a34b7
Rename modules to more fitting names.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 15:23:37 +0200 |
parents | flys-artifacts/src/main/java/org/dive4elements/river/artifacts/model/HistoricalDischargeDifferenceFacet.java@bd047b71ab37 |
children | 4897a58c8746 |
comparison
equal
deleted
inserted
replaced
5837:d9901a08d0a6 | 5838:5aa05a7a34b7 |
---|---|
1 package org.dive4elements.river.artifacts.model; | |
2 | |
3 import org.apache.log4j.Logger; | |
4 | |
5 import org.dive4elements.artifacts.Artifact; | |
6 import org.dive4elements.artifacts.CallContext; | |
7 | |
8 import org.dive4elements.river.artifacts.FLYSArtifact; | |
9 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; | |
10 | |
11 | |
12 /** | |
13 * Difference of historical discharge curve to ... | |
14 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
15 */ | |
16 public class HistoricalDischargeDifferenceFacet | |
17 extends HistoricalDischargeFacet | |
18 { | |
19 private static final Logger logger = | |
20 Logger.getLogger(HistoricalDischargeDifferenceFacet.class); | |
21 | |
22 | |
23 public HistoricalDischargeDifferenceFacet( | |
24 int index, | |
25 String name, | |
26 String desc | |
27 ) { | |
28 super(index, name, desc, ComputeType.ADVANCE, null, null); | |
29 } | |
30 | |
31 | |
32 public HistoricalDischargeDifferenceFacet( | |
33 int index, | |
34 String name, | |
35 String description, | |
36 ComputeType type, | |
37 String stateID, | |
38 String hash | |
39 | |
40 ) { | |
41 super(index, name, description, type, hash, stateID); | |
42 } | |
43 | |
44 | |
45 @Override | |
46 public Object getData(Artifact artifact, CallContext context) { | |
47 if (logger.isDebugEnabled()) { | |
48 logger.debug("Get data for historical discharge difference curves" + | |
49 " at index: " + index + " / stateId: " + stateId); | |
50 } | |
51 | |
52 FLYSArtifact flys = (FLYSArtifact) artifact; | |
53 | |
54 CalculationResult res = (CalculationResult) | |
55 flys.compute(context, hash, stateId, type, false); | |
56 | |
57 HistoricalDischargeData data = (HistoricalDischargeData) res.getData(); | |
58 WQTimerange[] wqts = (WQTimerange[]) data.getWQTimeranges(); | |
59 | |
60 return wqts[index]; | |
61 } | |
62 } | |
63 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |