annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ReferenceCurveState.java @ 2743:10e6400d4166

Added (dummy-) implementation of relative point facet in staticwkms case. flys-artifacts/trunk@4478 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 23 May 2012 13:48:20 +0000
parents c321b39b39ab
children 23b4ff116015
rev   line source
2170
90dfc25007f1 Added transition/state stubs for "Bezugslinienverfahren".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts.states;
90dfc25007f1 Added transition/state stubs for "Bezugslinienverfahren".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2
2195
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
3 import de.intevation.artifactdatabase.state.Facet;
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
4
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
5 import de.intevation.artifacts.CallContext;
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
6
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
7 import de.intevation.flys.artifacts.FLYSArtifact;
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
8 import de.intevation.flys.artifacts.WINFOArtifact;
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
9
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
10 import de.intevation.flys.artifacts.model.CalculationResult;
2259
0dcb8326be08 Add a not-yet-looked-at CSV facet for Reference Curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2251
diff changeset
11 import de.intevation.flys.artifacts.model.DataFacet;
2195
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
12 import de.intevation.flys.artifacts.model.FacetTypes;
2222
606f4fd7f815 Add more-or-less dummy Facet in ReferenceCurveState.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2195
diff changeset
13 import de.intevation.flys.artifacts.model.ReferenceCurveFacet;
2195
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
14 import de.intevation.flys.artifacts.model.ReportFacet;
2283
d4330439be3a Let reference curve calculation result in wwqq.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2277
diff changeset
15 import de.intevation.flys.artifacts.model.WWQQ;
2195
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
16
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
17 import java.util.List;
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
18
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
19 import org.apache.log4j.Logger;
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
20
2251
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2222
diff changeset
21
2170
90dfc25007f1 Added transition/state stubs for "Bezugslinienverfahren".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
22 public class ReferenceCurveState
90dfc25007f1 Added transition/state stubs for "Bezugslinienverfahren".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
23 extends DefaultState
2195
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
24 implements FacetTypes
2170
90dfc25007f1 Added transition/state stubs for "Bezugslinienverfahren".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
25 {
2259
0dcb8326be08 Add a not-yet-looked-at CSV facet for Reference Curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2251
diff changeset
26 private static Logger logger = Logger.getLogger(ReferenceCurveState.class);
2195
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
27
2170
90dfc25007f1 Added transition/state stubs for "Bezugslinienverfahren".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
28 public ReferenceCurveState() {
90dfc25007f1 Added transition/state stubs for "Bezugslinienverfahren".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
29 }
2195
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
30
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
31 @Override
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
32 public Object computeAdvance(
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
33 FLYSArtifact artifact,
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
34 String hash,
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
35 CallContext context,
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
36 List<Facet> facets,
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
37 Object old
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
38 ) {
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
39 if (!(artifact instanceof WINFOArtifact)) {
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
40 return null;
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
41 }
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
42
2259
0dcb8326be08 Add a not-yet-looked-at CSV facet for Reference Curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2251
diff changeset
43 String id = getID();
0dcb8326be08 Add a not-yet-looked-at CSV facet for Reference Curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2251
diff changeset
44
2195
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
45 WINFOArtifact winfo = (WINFOArtifact)artifact;
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
46
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
47 CalculationResult res = old instanceof CalculationResult
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
48 ? (CalculationResult)old
2326
c321b39b39ab 'Bezugslinienverfahren': Generate valid i18n names for datasets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2323
diff changeset
49 : winfo.getReferenceCurveData(context);
2195
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
50
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
51 if (facets == null) {
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
52 return res;
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
53 }
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
54
2283
d4330439be3a Let reference curve calculation result in wwqq.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2277
diff changeset
55 WWQQ [] wws = (WWQQ [])res.getData();
2195
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
56
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
57 for (int i = 0; i < wws.length; ++i) {
2307
51f530476e36 Better description for reference curve facets (seen in client).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2283
diff changeset
58 String wwsName = wws[i].getName();
2251
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2222
diff changeset
59 facets.add(new ReferenceCurveFacet(i,
c9c788eea200 Improved reference curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2222
diff changeset
60 REFERENCE_CURVE,
2307
51f530476e36 Better description for reference curve facets (seen in client).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2283
diff changeset
61 wwsName
51f530476e36 Better description for reference curve facets (seen in client).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2283
diff changeset
62 ));
2277
3f3e4f94171b Added generator for "Reduzierte Bezugslinie".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2259
diff changeset
63 facets.add(new ReferenceCurveFacet(i,
3f3e4f94171b Added generator for "Reduzierte Bezugslinie".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2259
diff changeset
64 REFERENCE_CURVE_NORMALIZED,
2307
51f530476e36 Better description for reference curve facets (seen in client).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2283
diff changeset
65 wwsName
51f530476e36 Better description for reference curve facets (seen in client).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2283
diff changeset
66 ));
2195
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
67 }
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
68
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
69 if (wws.length > 0) {
2310
ecb76933362f Added PDF export to reference curve calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2307
diff changeset
70 logger.debug("Adding CSV and PDF data facet.");
2259
0dcb8326be08 Add a not-yet-looked-at CSV facet for Reference Curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2251
diff changeset
71 Facet csv = new DataFacet (CSV, "CSV data", ComputeType.ADVANCE, hash, id);
2310
ecb76933362f Added PDF export to reference curve calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2307
diff changeset
72 Facet pdf = new DataFacet (PDF, "PDF data", ComputeType.ADVANCE, hash, id);
2259
0dcb8326be08 Add a not-yet-looked-at CSV facet for Reference Curve.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2251
diff changeset
73 facets.add(csv);
2310
ecb76933362f Added PDF export to reference curve calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2307
diff changeset
74 facets.add(pdf);
2195
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
75 }
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
76
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
77 if (res.getReport().hasProblems()) {
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
78 facets.add(new ReportFacet(ComputeType.ADVANCE, hash, id));
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
79 }
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
80
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
81 return res;
e14beb93a854 "Bezugslinenverfahren": Added stub loop for creating facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2170
diff changeset
82 }
2170
90dfc25007f1 Added transition/state stubs for "Bezugslinienverfahren".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
83 }
90dfc25007f1 Added transition/state stubs for "Bezugslinienverfahren".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
84 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org