Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/states/StaticWQKmsState.java @ 9801:1d7a72a50183 3.2.x tip
Assume Compose V2, consistently
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 23 Nov 2023 10:14:13 +0100 |
parents | 0a5239a1e46e |
children |
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 |
9726 | 15 import org.apache.logging.log4j.Logger; |
16 import org.apache.logging.log4j.LogManager; | |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
17 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
18 import org.dive4elements.artifacts.CallContext; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
19 import org.dive4elements.artifacts.CallMeta; |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
21 import org.dive4elements.artifactdatabase.state.Facet; |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
22 |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
23 import org.dive4elements.river.artifacts.D4EArtifact; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
24 import org.dive4elements.river.artifacts.StaticWQKmsArtifact; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
25 |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
26 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
|
27 import org.dive4elements.river.artifacts.model.DataFacet; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
28 import org.dive4elements.river.artifacts.model.FacetTypes; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
29 import org.dive4elements.river.artifacts.model.RelativePointFacet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
30 import org.dive4elements.river.artifacts.model.WQKms; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5799
diff
changeset
|
31 import org.dive4elements.river.artifacts.model.WQKmsFacet; |
2124
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 /** |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 * Only state of WQKmsArtifact. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 */ |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 public class StaticWQKmsState |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
37 extends DefaultState |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
38 implements FacetTypes |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7703
diff
changeset
|
40 /** The log that is used in this state. */ |
9726 | 41 private static Logger log = LogManager.getLogger(StaticWQKmsState.class); |
2124
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 /** |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 * From this state can not be continued. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 */ |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 @Override |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 protected String getUIProvider() { |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
49 return "noinput"; |
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 /** |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 * 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
|
55 */ |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
56 protected Object compute( |
7584
c7638c971574
Renamed winfo variable to more fitting name artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7254
diff
changeset
|
57 StaticWQKmsArtifact artifact, |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
58 CallMeta metaLocale, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
59 String hash, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
60 List<Facet> facets, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 Object old |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
62 ) { |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
63 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
|
64 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
|
65 String [] parts = code.split("-"); |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
66 |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
67 // Return from cache, if present. |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
68 WQKms res = old instanceof WQKms |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
69 ? (WQKms)old |
7584
c7638c971574
Renamed winfo variable to more fitting name artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7254
diff
changeset
|
70 : artifact.getWQKms(); |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
71 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
72 WQKms wqkms = res; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
73 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
74 if (facets == null) { |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
75 return res; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
76 } |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
77 |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
78 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
|
79 |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
80 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
|
81 STATIC_WQ, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
82 wkmsName); |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
83 facets.add(wqfacet); |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
84 |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
85 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
|
86 // 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
|
87 return res; |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
88 } |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
89 |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
90 /* |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
91 * TODO: re-enable HEIGHTMARKS_POINTS-thing |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
92 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
93 String name; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
94 if (parts[0].equals(HEIGHTMARKS_POINTS)) { |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
95 name = HEIGHTMARKS_POINTS; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
96 } |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
97 else { |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
98 name = STATIC_WQKMS; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
99 } |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
100 */ |
7066
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
101 // 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
|
102 // is != -1 |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
103 boolean qEmpty = true; |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
104 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
|
105 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
|
106 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
|
107 qEmpty = false; |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
108 break; |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
109 } |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
110 } |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
111 |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
112 // 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
|
113 if (!qEmpty) { |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
114 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
|
115 STATIC_WQKMS_Q, |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
116 wkmsName |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
117 // 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
|
118 /* |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
119 Resources.getMsg( |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
120 metaLocale, |
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 wkmsName)*/); |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
123 facets.add(qfacet); |
39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
124 } |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
125 |
5799
5a2c7d24fd29
StaticWQKmsState: Also spawn RelativePoint and CrossSectionFacet .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
126 Facet rpFacet = new RelativePointFacet(wkmsName); |
5a2c7d24fd29
StaticWQKmsState: Also spawn RelativePoint and CrossSectionFacet .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
127 facets.add(rpFacet); |
5a2c7d24fd29
StaticWQKmsState: Also spawn RelativePoint and CrossSectionFacet .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
128 |
5a2c7d24fd29
StaticWQKmsState: Also spawn RelativePoint and CrossSectionFacet .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
129 Facet csFacet = new CrossSectionWaterLineFacet(0, |
5a2c7d24fd29
StaticWQKmsState: Also spawn RelativePoint and CrossSectionFacet .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
130 wkmsName); |
5a2c7d24fd29
StaticWQKmsState: Also spawn RelativePoint and CrossSectionFacet .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
131 facets.add(csFacet); |
5a2c7d24fd29
StaticWQKmsState: Also spawn RelativePoint and CrossSectionFacet .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
132 |
7703
5484818087de
(issue1577, issue1494) Wrap wst name depending on Q > 0
Andre Heinecke <aheinecke@intevation.de>
parents:
7653
diff
changeset
|
133 if (!qEmpty) { |
5484818087de
(issue1577, issue1494) Wrap wst name depending on Q > 0
Andre Heinecke <aheinecke@intevation.de>
parents:
7653
diff
changeset
|
134 wkmsName = "W (" + wkmsName + ")"; |
5484818087de
(issue1577, issue1494) Wrap wst name depending on Q > 0
Andre Heinecke <aheinecke@intevation.de>
parents:
7653
diff
changeset
|
135 } |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
136 |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
137 Facet wfacet = new WQKmsFacet( |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
138 STATIC_WQKMS_W, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
139 wkmsName |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
140 /* |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
141 // TODO re-enable translations. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
142 Resources.getMsg( |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
143 metaLocale, |
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 wkmsName)*/); |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
146 facets.add(wfacet); |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
147 |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
148 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
|
149 WST, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
150 wkmsName, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
151 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
|
152 facets.add(wstfacet); |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
153 |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
154 return res; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
155 } |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
156 |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
157 @Override |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
158 public Object computeAdvance( |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
159 D4EArtifact artifact, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
160 String hash, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
161 CallContext context, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
162 List<Facet> facets, |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
163 Object old |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
164 ) { |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
165 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
|
166 hash, facets, old); |
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
167 } |
2124
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 /** |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
170 * Get data, create the facets. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
171 * |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
172 * @param context Ignored. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
173 */ |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
174 @Override |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
175 public Object computeFeed( |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
176 D4EArtifact artifact, |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
177 String hash, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
178 CallContext context, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
179 List<Facet> facets, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
180 Object old |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
181 ) { |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
182 return compute((StaticWQKmsArtifact) artifact, context.getMeta(), |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
183 hash, facets, old); |
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 /** |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
188 * Create the facets. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
189 * @param context Ignored. |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
190 */ |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
191 @Override |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
192 public Object computeInit( |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
193 D4EArtifact artifact, |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
194 String hash, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
195 Object context, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
196 CallMeta meta, |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
197 List<Facet> facets |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
198 ) { |
7653
e609722a1e86
issue1020 and others: Let StaticWQKmsState spawn other facets, implement computeAdvance.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7584
diff
changeset
|
199 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
|
200 hash, facets, null); |
2124
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 } |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
203 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |