Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java @ 6987:4126ff35beb8 interaktive-karte
Closing branch 'interaktive-karte', the contents must have been merged (without hg tracking it) to default long ago because it is in there.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Wed, 11 Sep 2013 11:41:29 +0200 |
parents | 14db045d6368 |
children |
rev | line source |
---|---|
399
53cc794fee07
Improved the transition model and added states to enable the 'discharge longitudinal section' computation - NOTE: the work in this computation has not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.states; |
53cc794fee07
Improved the transition model and added states to enable the 'discharge longitudinal section' computation - NOTE: the work in this computation has not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
4812
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
3 import de.intevation.artifactdatabase.state.Facet; |
5138
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
4 import de.intevation.artifactdatabase.state.FacetActivity; |
4812
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
5 |
5138
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
6 import de.intevation.artifacts.Artifact; |
4812
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
7 import de.intevation.artifacts.CallContext; |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
8 |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
9 import de.intevation.flys.artifacts.ChartArtifact; |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
10 import de.intevation.flys.artifacts.FLYSArtifact; |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
11 |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
12 import de.intevation.flys.artifacts.access.Calculation4Access; |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
13 |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
14 import de.intevation.flys.artifacts.model.Calculation4; |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
15 import de.intevation.flys.artifacts.model.CalculationResult; |
4835
8e72777c961c
Introduced a fake ConstantWQKms class to have type information to only generate w facets for curves which really carry w data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4812
diff
changeset
|
16 import de.intevation.flys.artifacts.model.ConstantWQKms; |
4812
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
17 import de.intevation.flys.artifacts.model.CrossSectionWaterLineFacet; |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
18 import de.intevation.flys.artifacts.model.DataFacet; |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
19 import de.intevation.flys.artifacts.model.EmptyFacet; |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
20 import de.intevation.flys.artifacts.model.FacetTypes; |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
21 import de.intevation.flys.artifacts.model.ReportFacet; |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
22 import de.intevation.flys.artifacts.model.WQCKms; |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
23 import de.intevation.flys.artifacts.model.WQKms; |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
24 import de.intevation.flys.artifacts.model.WaterlevelFacet; |
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
25 |
687
06689035024c
Added a compute() method to WINFOArtifact which acts as a dispatcher for different computations. It triggers a calculation based on ComputeCallbacks that are generated by the current states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
661
diff
changeset
|
26 import java.util.List; |
06689035024c
Added a compute() method to WINFOArtifact which acts as a dispatcher for different computations. It triggers a calculation based on ComputeCallbacks that are generated by the current states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
661
diff
changeset
|
27 |
399
53cc794fee07
Improved the transition model and added states to enable the 'discharge longitudinal section' computation - NOTE: the work in this computation has not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 import org.apache.log4j.Logger; |
53cc794fee07
Improved the transition model and added states to enable the 'discharge longitudinal section' computation - NOTE: the work in this computation has not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 |
692
22e4bffbe240
Generated facets for each output aspect.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
689
diff
changeset
|
30 public class DischargeLongitudinalSection |
22e4bffbe240
Generated facets for each output aspect.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
689
diff
changeset
|
31 extends DefaultState |
22e4bffbe240
Generated facets for each output aspect.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
689
diff
changeset
|
32 implements FacetTypes |
22e4bffbe240
Generated facets for each output aspect.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
689
diff
changeset
|
33 { |
4812
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
34 private static Logger log = |
399
53cc794fee07
Improved the transition model and added states to enable the 'discharge longitudinal section' computation - NOTE: the work in this computation has not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 Logger.getLogger(DischargeLongitudinalSection.class); |
687
06689035024c
Added a compute() method to WINFOArtifact which acts as a dispatcher for different computations. It triggers a calculation based on ComputeCallbacks that are generated by the current states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
661
diff
changeset
|
36 |
5138
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
37 static { |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
38 // Active/deactivate facets. |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
39 FacetActivity.Registry.getInstance().register( |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
40 "winfo", |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
41 new FacetActivity() { |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
42 @Override |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
43 public Boolean isInitialActive( |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
44 Artifact artifact, |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
45 Facet facet, |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
46 String output |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
47 ) { |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
48 String name = facet.getName(); |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
49 if (name.equals(DISCHARGE_LONGITUDINAL_Q_INFOLD_CUT)) { |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
50 return Boolean.FALSE; |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
51 } |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
52 return Boolean.TRUE; |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
53 } |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
54 }); |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
55 } |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
56 |
687
06689035024c
Added a compute() method to WINFOArtifact which acts as a dispatcher for different computations. It triggers a calculation based on ComputeCallbacks that are generated by the current states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
661
diff
changeset
|
57 @Override |
697
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
58 public Object computeAdvance( |
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
59 FLYSArtifact artifact, |
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
60 String hash, |
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
61 CallContext context, |
742
c09c9e05ecfa
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
711
diff
changeset
|
62 List<Facet> facets, |
697
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
63 Object old |
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
64 ) { |
2132
e8fc770d2f8c
'New Chart' for computed discharge curve.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2014
diff
changeset
|
65 if (artifact instanceof ChartArtifact) { |
2135
77cdc344ef77
'New Chart' for discharge longitudinal section curve.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2132
diff
changeset
|
66 ChartArtifact chart = (ChartArtifact)artifact; |
77cdc344ef77
'New Chart' for discharge longitudinal section curve.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2132
diff
changeset
|
67 facets.add(new EmptyFacet()); |
2132
e8fc770d2f8c
'New Chart' for computed discharge curve.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2014
diff
changeset
|
68 return null; |
e8fc770d2f8c
'New Chart' for computed discharge curve.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2014
diff
changeset
|
69 } |
e8fc770d2f8c
'New Chart' for computed discharge curve.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2014
diff
changeset
|
70 |
4812
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
71 Calculation4Access access = new Calculation4Access(artifact); |
692
22e4bffbe240
Generated facets for each output aspect.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
689
diff
changeset
|
72 |
711
69c8541edcc7
Generate report facets if there are problems with the calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
709
diff
changeset
|
73 CalculationResult res = old instanceof CalculationResult |
69c8541edcc7
Generate report facets if there are problems with the calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
709
diff
changeset
|
74 ? (CalculationResult)old |
4812
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
75 : new Calculation4(access).calculate(); |
692
22e4bffbe240
Generated facets for each output aspect.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
689
diff
changeset
|
76 |
705
853dceead0f4
Only generate facets when needed.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
703
diff
changeset
|
77 if (facets == null) { |
853dceead0f4
Only generate facets when needed.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
703
diff
changeset
|
78 return res; |
853dceead0f4
Only generate facets when needed.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
703
diff
changeset
|
79 } |
853dceead0f4
Only generate facets when needed.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
703
diff
changeset
|
80 |
709
3b7e9ddf6bb1
New model to transport data and error reports of calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
705
diff
changeset
|
81 WQKms [] wqkms = (WQKms [])res.getData(); |
3b7e9ddf6bb1
New model to transport data and error reports of calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
705
diff
changeset
|
82 |
3b7e9ddf6bb1
New model to transport data and error reports of calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
705
diff
changeset
|
83 for (int i = 0; i < wqkms.length; i++) { |
697
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
84 String nameW = null; |
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
85 String nameQ = null; |
692
22e4bffbe240
Generated facets for each output aspect.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
689
diff
changeset
|
86 |
4812
65bfb6faa538
Bring Access pattern to "W fuer ungleichwertige Abflusslaengsschnitte".
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3124
diff
changeset
|
87 if (access.isQ()) { |
709
3b7e9ddf6bb1
New model to transport data and error reports of calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
705
diff
changeset
|
88 nameQ = wqkms[i].getName(); |
697
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
89 nameW = "W(" + nameQ + ")"; |
687
06689035024c
Added a compute() method to WINFOArtifact which acts as a dispatcher for different computations. It triggers a calculation based on ComputeCallbacks that are generated by the current states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
661
diff
changeset
|
90 } |
697
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
91 else { |
709
3b7e9ddf6bb1
New model to transport data and error reports of calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
705
diff
changeset
|
92 nameW = wqkms[i].getName(); |
2014
b11793a3e7c7
#419 Fixed broken Facet name creation in discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1712
diff
changeset
|
93 nameQ = "Q(" + nameW + ")"; |
697
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
94 } |
687
06689035024c
Added a compute() method to WINFOArtifact which acts as a dispatcher for different computations. It triggers a calculation based on ComputeCallbacks that are generated by the current states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
661
diff
changeset
|
95 |
5282
14db045d6368
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5138
diff
changeset
|
96 // Do not generate Waterlevel/Waterline facets |
4835
8e72777c961c
Introduced a fake ConstantWQKms class to have type information to only generate w facets for curves which really carry w data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4812
diff
changeset
|
97 // for Q only curves. |
8e72777c961c
Introduced a fake ConstantWQKms class to have type information to only generate w facets for curves which really carry w data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4812
diff
changeset
|
98 if (!(wqkms[i] instanceof ConstantWQKms)) { |
8e72777c961c
Introduced a fake ConstantWQKms class to have type information to only generate w facets for curves which really carry w data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4812
diff
changeset
|
99 |
8e72777c961c
Introduced a fake ConstantWQKms class to have type information to only generate w facets for curves which really carry w data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4812
diff
changeset
|
100 Facet w = new WaterlevelFacet( |
8e72777c961c
Introduced a fake ConstantWQKms class to have type information to only generate w facets for curves which really carry w data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4812
diff
changeset
|
101 i, DISCHARGE_LONGITUDINAL_W, nameW); |
8e72777c961c
Introduced a fake ConstantWQKms class to have type information to only generate w facets for curves which really carry w data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4812
diff
changeset
|
102 |
8e72777c961c
Introduced a fake ConstantWQKms class to have type information to only generate w facets for curves which really carry w data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4812
diff
changeset
|
103 Facet s = new CrossSectionWaterLineFacet(i, nameW); |
8e72777c961c
Introduced a fake ConstantWQKms class to have type information to only generate w facets for curves which really carry w data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4812
diff
changeset
|
104 |
5138
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
105 Facet q = new WaterlevelFacet( |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
106 i, DISCHARGE_LONGITUDINAL_Q, nameQ); |
4835
8e72777c961c
Introduced a fake ConstantWQKms class to have type information to only generate w facets for curves which really carry w data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4812
diff
changeset
|
107 facets.add(s); |
8e72777c961c
Introduced a fake ConstantWQKms class to have type information to only generate w facets for curves which really carry w data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4812
diff
changeset
|
108 facets.add(w); |
5138
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
109 facets.add(q); |
4835
8e72777c961c
Introduced a fake ConstantWQKms class to have type information to only generate w facets for curves which really carry w data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4812
diff
changeset
|
110 } |
5138
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
111 else { |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
112 Facet q; |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
113 if (nameQ.contains("geschnitten")) { |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
114 q = new WaterlevelFacet( |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
115 i, DISCHARGE_LONGITUDINAL_Q_INFOLD_CUT, nameQ); |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
116 } |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
117 else { |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
118 q = new WaterlevelFacet( |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
119 i, DISCHARGE_LONGITUDINAL_Q_INFOLD, nameQ); |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
120 } |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
121 facets.add(q); |
fc0cdcae8f07
New facet types and renaming for infoldings.
Raimund Renkert <rrenkert@intevation.de>
parents:
4835
diff
changeset
|
122 } |
697
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
123 |
709
3b7e9ddf6bb1
New model to transport data and error reports of calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
705
diff
changeset
|
124 if (wqkms[i] instanceof WQCKms) { |
697
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
125 // TODO DO i18n |
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
126 |
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
127 String nameC = nameW.replace( |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
742
diff
changeset
|
128 "benutzerdefiniert", |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
742
diff
changeset
|
129 "benutzerdefiniert [korrigiert]"); |
697
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
130 |
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
131 Facet c = new WaterlevelFacet( |
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
132 i, DISCHARGE_LONGITUDINAL_C, nameC); |
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
133 |
3124
555ed85af32e
fix issue680; hack.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2730
diff
changeset
|
134 // Here, avoid index clash with Facet "s" above and |
555ed85af32e
fix issue680; hack.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2730
diff
changeset
|
135 // signal the WINFO later that we want to access Cs. |
555ed85af32e
fix issue680; hack.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2730
diff
changeset
|
136 Facet r = new CrossSectionWaterLineFacet(i + 1, nameC); |
2730
0657e7966c87
Add cross-section output to dischargelong.section.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2135
diff
changeset
|
137 |
697
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
138 facets.add(c); |
2730
0657e7966c87
Add cross-section output to dischargelong.section.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2135
diff
changeset
|
139 facets.add(r); |
697
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
140 } |
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
141 } |
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
142 |
709
3b7e9ddf6bb1
New model to transport data and error reports of calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
705
diff
changeset
|
143 if (wqkms.length > 0) { |
703
af3b5d9e91a4
Generate data facets for the computed states.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
697
diff
changeset
|
144 facets.add(new DataFacet(CSV, "CSV data")); |
af3b5d9e91a4
Generate data facets for the computed states.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
697
diff
changeset
|
145 facets.add(new DataFacet(WST, "WST data")); |
af3b5d9e91a4
Generate data facets for the computed states.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
697
diff
changeset
|
146 } |
af3b5d9e91a4
Generate data facets for the computed states.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
697
diff
changeset
|
147 |
711
69c8541edcc7
Generate report facets if there are problems with the calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
709
diff
changeset
|
148 if (res.getReport().hasProblems()) { |
69c8541edcc7
Generate report facets if there are problems with the calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
709
diff
changeset
|
149 facets.add(new ReportFacet()); |
69c8541edcc7
Generate report facets if there are problems with the calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
709
diff
changeset
|
150 } |
69c8541edcc7
Generate report facets if there are problems with the calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
709
diff
changeset
|
151 |
697
b972eba2ed8a
Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
152 return res; |
687
06689035024c
Added a compute() method to WINFOArtifact which acts as a dispatcher for different computations. It triggers a calculation based on ComputeCallbacks that are generated by the current states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
661
diff
changeset
|
153 } |
399
53cc794fee07
Improved the transition model and added states to enable the 'discharge longitudinal section' computation - NOTE: the work in this computation has not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 } |
53cc794fee07
Improved the transition model and added states to enable the 'discharge longitudinal section' computation - NOTE: the work in this computation has not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |