Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DurationCurveFacet.java @ 709:3b7e9ddf6bb1
New model to transport data and error reports of calculations.
flys-artifacts/trunk@2165 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 20 Jun 2011 12:32:32 +0000 |
parents | 853dceead0f4 |
children | b1b0a0b61845 |
comparison
equal
deleted
inserted
replaced
708:757ff56b43b3 | 709:3b7e9ddf6bb1 |
---|---|
15 public class DurationCurveFacet extends DefaultFacet { | 15 public class DurationCurveFacet extends DefaultFacet { |
16 | 16 |
17 private static Logger logger = Logger.getLogger(DurationCurveFacet.class); | 17 private static Logger logger = Logger.getLogger(DurationCurveFacet.class); |
18 | 18 |
19 | 19 |
20 public DurationCurveFacet(int index, String name, String description) { | 20 public DurationCurveFacet(String name, String description) { |
21 super(index, name, description); | 21 super(0, name, description); |
22 } | 22 } |
23 | 23 |
24 | 24 |
25 public Object getData(Artifact artifact, CallContext context) { | 25 public Object getData(Artifact artifact, CallContext context) { |
26 logger.debug("Get data for duration curve data at index: " + index); | 26 logger.debug("Get data for duration curve data"); |
27 | 27 |
28 WINFOArtifact winfo = (WINFOArtifact) artifact; | 28 WINFOArtifact winfo = (WINFOArtifact)artifact; |
29 | 29 |
30 WQDay[] wqday = | 30 CalculationResult cr = (CalculationResult)winfo.compute( |
31 (WQDay[])winfo.compute(context, ComputeType.ADVANCE, false); | 31 context, ComputeType.ADVANCE, false); |
32 | 32 |
33 return wqday[index]; | 33 return cr.getData(); |
34 } | 34 } |
35 } | 35 } |
36 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 36 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |