Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/states/StaticWQKmsState.java @ 9053:ad2ae847e10e
- RadioButton-Auswahl generisch
- Überflutungsdauern (inudation of infrastructures) Ablauf states
author | gernotbelger |
---|---|
date | Fri, 04 May 2018 13:17:57 +0200 |
parents | e4606eae8ea5 |
children | 3f49835a00c3 0a5239a1e46e |
rev | line source |
---|---|
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
9 package org.dive4elements.river.artifacts.states; |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 import java.util.List; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
12 |
7066
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
13 import gnu.trove.TDoubleArrayList; |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
14 |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 import org.apache.log4j.Logger; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
17 import org.dive4elements.artifacts.CallContext; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
18 import org.dive4elements.artifacts.CallMeta; |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
20 import org.dive4elements.artifactdatabase.state.Facet; |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
22 import org.dive4elements.river.artifacts.D4EArtifact; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
23 import org.dive4elements.river.artifacts.StaticWQKmsArtifact; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
24 |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
25 import org.dive4elements.river.artifacts.model.CrossSectionWaterLineFacet; |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
26 import org.dive4elements.river.artifacts.model.DataFacet; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
27 import org.dive4elements.river.artifacts.model.FacetTypes; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
28 import org.dive4elements.river.artifacts.model.RelativePointFacet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
29 import org.dive4elements.river.artifacts.model.WQKms; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
30 import org.dive4elements.river.artifacts.model.WQKmsFacet; |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 /** |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 * Only state of WQKmsArtifact. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 */ |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 public class StaticWQKmsState |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 extends DefaultState |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
37 implements FacetTypes |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
38 { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7703
diff
changeset
|
39 /** The log that is used in this state. */ |
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7703
diff
changeset
|
40 private static Logger log = Logger.getLogger(StaticWQKmsState.class); |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
41 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
42 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 /** |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 * From this state can not be continued. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 */ |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 @Override |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 protected String getUIProvider() { |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 return "noinput"; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
49 } |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
50 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
51 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
52 /** |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
53 * Compute, create Facets, do the same stuff as all the other states do. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 */ |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
55 protected Object compute( |
7584
c7638c971574
Renamed winfo variable to more fitting name artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7254
diff
changeset
|
56 StaticWQKmsArtifact artifact, |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
57 CallMeta metaLocale, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
58 String hash, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
59 List<Facet> facets, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
60 Object old |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 ) { |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
62 String id = getID(); |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
63 String code = artifact.getDataAsString("ids"); |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
64 String [] parts = code.split("-"); |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
65 |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
66 // Return from cache, if present. |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
67 WQKms res = old instanceof WQKms |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
68 ? (WQKms)old |
7584
c7638c971574
Renamed winfo variable to more fitting name artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7254
diff
changeset
|
69 : artifact.getWQKms(); |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
70 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
71 WQKms wqkms = res; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
72 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
73 if (facets == null) { |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
74 return res; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
75 } |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
76 |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
77 String wkmsName = wqkms.getName(); |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
78 |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
79 Facet wqfacet = new WQKmsFacet( |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
80 STATIC_WQ, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
81 wkmsName); |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
82 facets.add(wqfacet); |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
83 |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
84 if (parts[0].equals("officials_wq")) { |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
85 // Early stop. We only want wq-points in that case. |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
86 return res; |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
87 } |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
88 |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
89 /* |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
90 * TODO: re-enable HEIGHTMARKS_POINTS-thing |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
91 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
92 String name; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
93 if (parts[0].equals(HEIGHTMARKS_POINTS)) { |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
94 name = HEIGHTMARKS_POINTS; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
95 } |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
96 else { |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
97 name = STATIC_WQKMS; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
98 } |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
99 */ |
7066
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
100 // Spawn Q Facet only if at least one discharge value |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
101 // is != -1 |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
102 boolean qEmpty = true; |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
103 TDoubleArrayList qs = wqkms.allQs(); |
7254
fe32a7f9655e
Reduce usage of careless 'for (int i = 0; i < x.size(); i++)' pattern.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7066
diff
changeset
|
104 for (int i = 0, Q = qs.size(); i < Q; i++) { |
7066
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
105 if (qs.getQuick(i) != -1d) { |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
106 qEmpty = false; |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
107 break; |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
108 } |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
109 } |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
110 |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
111 // issue1494: Only spawn qfacet if discharges are given |
7066
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
112 if (!qEmpty) { |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
113 Facet qfacet = new WQKmsFacet( |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
114 STATIC_WQKMS_Q, |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
115 wkmsName |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
116 // TODO re-enable translations. |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
117 /* |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
118 Resources.getMsg( |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
119 metaLocale, |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
120 wkmsName, |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
121 wkmsName)*/); |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
122 facets.add(qfacet); |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
123 } |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
124 |
5799
5a2c7d24fd29
StaticWQKmsState: Also spawn RelativePoint and CrossSectionFacet .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
125 Facet rpFacet = new RelativePointFacet(wkmsName); |
5a2c7d24fd29
StaticWQKmsState: Also spawn RelativePoint and CrossSectionFacet .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
126 facets.add(rpFacet); |
5a2c7d24fd29
StaticWQKmsState: Also spawn RelativePoint and CrossSectionFacet .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
127 |
5a2c7d24fd29
StaticWQKmsState: Also spawn RelativePoint and CrossSectionFacet .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
128 Facet csFacet = new CrossSectionWaterLineFacet(0, |
5a2c7d24fd29
StaticWQKmsState: Also spawn RelativePoint and CrossSectionFacet .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
129 wkmsName); |
5a2c7d24fd29
StaticWQKmsState: Also spawn RelativePoint and CrossSectionFacet .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
130 facets.add(csFacet); |
5a2c7d24fd29
StaticWQKmsState: Also spawn RelativePoint and CrossSectionFacet .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
131 |
7703
5484818087de
(issue1577, issue1494) Wrap wst name depending on Q > 0
Andre Heinecke <aheinecke@intevation.de>
parents:
7653
diff
changeset
|
132 if (!qEmpty) { |
5484818087de
(issue1577, issue1494) Wrap wst name depending on Q > 0
Andre Heinecke <aheinecke@intevation.de>
parents:
7653
diff
changeset
|
133 wkmsName = "W (" + wkmsName + ")"; |
5484818087de
(issue1577, issue1494) Wrap wst name depending on Q > 0
Andre Heinecke <aheinecke@intevation.de>
parents:
7653
diff
changeset
|
134 } |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
135 |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
136 Facet wfacet = new WQKmsFacet( |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
137 STATIC_WQKMS_W, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
138 wkmsName |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
139 /* |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
140 // TODO re-enable translations. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
141 Resources.getMsg( |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
142 metaLocale, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
143 wkmsName, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
144 wkmsName)*/); |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
145 facets.add(wfacet); |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
146 |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
147 Facet wstfacet = new DataFacet( |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
148 WST, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
149 wkmsName, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
150 ComputeType.ADVANCE, hash, id); |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
151 facets.add(wstfacet); |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
152 |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
153 return res; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
154 } |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
155 |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
156 @Override |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
157 public Object computeAdvance( |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
158 D4EArtifact artifact, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
159 String hash, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
160 CallContext context, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
161 List<Facet> facets, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
162 Object old |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
163 ) { |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
164 return compute((StaticWQKmsArtifact) artifact, context.getMeta(), |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
165 hash, facets, old); |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
166 } |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
167 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
168 /** |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
169 * Get data, create the facets. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
170 * |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
171 * @param context Ignored. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
172 */ |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
173 @Override |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
174 public Object computeFeed( |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
175 D4EArtifact artifact, |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
176 String hash, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
177 CallContext context, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
178 List<Facet> facets, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
179 Object old |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
180 ) { |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
181 return compute((StaticWQKmsArtifact) artifact, context.getMeta(), |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
182 hash, facets, old); |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
183 } |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
184 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
185 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
186 /** |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
187 * Create the facets. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
188 * @param context Ignored. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
189 */ |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
190 @Override |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
191 public Object computeInit( |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
192 D4EArtifact artifact, |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
193 String hash, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
194 Object context, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
195 CallMeta meta, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
196 List<Facet> facets |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
197 ) { |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
198 return compute((StaticWQKmsArtifact) artifact, meta, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
199 hash, facets, null); |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
200 } |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
201 } |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
202 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |