Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java @ 393:befedd7629d5
Enabled the WINFO artifact to compute the data for discharge curves (computed) - ComputedDischargeCurveGenerator uses those values now to create the chart.
flys-artifacts/trunk@1818 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 04 May 2011 08:24:50 +0000 |
parents | 72177020db92 |
children | 7e5c2e93e449 |
comparison
equal
deleted
inserted
replaced
392:72177020db92 | 393:befedd7629d5 |
---|---|
3 import org.apache.log4j.Logger; | 3 import org.apache.log4j.Logger; |
4 | 4 |
5 import org.w3c.dom.Document; | 5 import org.w3c.dom.Document; |
6 | 6 |
7 import de.intevation.artifacts.Artifact; | 7 import de.intevation.artifacts.Artifact; |
8 | |
9 import de.intevation.flys.artifacts.WINFOArtifact; | |
10 import de.intevation.flys.artifacts.model.WQKms; | |
8 | 11 |
9 | 12 |
10 /** | 13 /** |
11 * An OutGenerator that generates discharge curves. | 14 * An OutGenerator that generates discharge curves. |
12 * | 15 * |
20 | 23 |
21 | 24 |
22 @Override | 25 @Override |
23 public void doOut(Artifact artifact, String facet, Document attr) { | 26 public void doOut(Artifact artifact, String facet, Document attr) { |
24 logger.debug("ComputedDischargeCurveGenerator.doOut"); | 27 logger.debug("ComputedDischargeCurveGenerator.doOut"); |
25 // TODO FILL ME | 28 |
29 WQKms wqkms = getData(artifact); | |
30 | |
31 int size = wqkms.size(); | |
32 | |
33 double[][] data = new double[2][size]; | |
34 double[] res = new double[3]; | |
35 | |
36 for (int i = 0; i < size; i++) { | |
37 res = wqkms.get(i, res); | |
38 | |
39 data[0][i] = res[1]; | |
40 data[1][i] = res[0]; | |
41 } | |
42 | |
43 // TODO find the correct name | |
44 dataset.addSeries("Abflusskurve", data); | |
45 } | |
46 | |
47 | |
48 protected WQKms getData(Artifact artifact) { | |
49 logger.debug("ComputedDischargeCurveGenerator.getData"); | |
50 | |
51 WINFOArtifact winfoArtifact = (WINFOArtifact) artifact; | |
52 | |
53 return winfoArtifact.getComputedDischargeCurveData(); | |
26 } | 54 } |
27 } | 55 } |
28 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 56 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |