Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadDataCalculate.java @ 8137:c200b76145ce
Removed obsolete imports.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Tue, 26 Aug 2014 11:16:21 +0200 |
parents | 45b1d71110c3 |
children | ce35bdf3d750 |
rev | line source |
---|---|
8085
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
3 * |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
7 */ |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
8 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
9 package org.dive4elements.river.artifacts.states.minfo; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
10 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
11 import java.util.List; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
12 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
13 import org.apache.log4j.Logger; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
14 import org.dive4elements.artifactdatabase.state.Facet; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
15 import org.dive4elements.artifactdatabase.state.FacetActivity; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
16 import org.dive4elements.artifacts.Artifact; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
17 import org.dive4elements.artifacts.CallContext; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
18 import org.dive4elements.river.artifacts.D4EArtifact; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
19 import org.dive4elements.river.artifacts.access.SedimentLoadAccess; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
20 import org.dive4elements.river.artifacts.model.CalculationResult; |
8126
353f93d5d9f7
Correctly output problems in SedimentLoadDataCalculate
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8125
diff
changeset
|
21 import org.dive4elements.river.artifacts.model.Calculation; |
8085
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
22 import org.dive4elements.river.artifacts.model.DataFacet; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
23 import org.dive4elements.river.artifacts.model.FacetTypes; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
24 import org.dive4elements.river.artifacts.model.ReportFacet; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
25 import org.dive4elements.river.artifacts.model.minfo.SedimentLoadDataCalculation; |
8125
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
26 import org.dive4elements.river.artifacts.model.minfo.SedimentLoadDataResult; |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
27 import org.dive4elements.river.artifacts.model.minfo.SedimentLoadDataResult.Fraction; |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
28 import org.dive4elements.river.artifacts.model.minfo.SedimentLoadDataFacet; |
8085
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
29 import org.dive4elements.river.artifacts.states.DefaultState; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
30 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
31 /** State in which Sediment Load(s) are calculated/retrieved. */ |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
32 public class SedimentLoadDataCalculate |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
33 extends DefaultState |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
34 implements FacetTypes |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
35 { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
36 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
37 private static final long serialVersionUID = 1L; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
38 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
39 private static final Logger logger = Logger |
8125
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
40 .getLogger(SedimentLoadDataCalculate.class); |
8085
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
41 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
42 public static final String I18N_FACET_SEDIMENTLOAD_COARSE = "facet.sedimentload.coarse"; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
43 public static final String I18N_FACET_SEDIMENTLOAD_SAND = "facet.sedimentload.sand"; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
44 public static final String I18N_FACET_SEDIMENTLOAD_FINE_MIDDLE = "facet.sedimentload.fine_middle"; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
45 public static final String I18N_FACET_SEDIMENTLOAD_SUSPSAND = "facet.sedimentload.susp_sand"; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
46 public static final String I18N_FACET_SEDIMENTLOAD_SUSPSANDBED = "facet.sediemntload.susp_sand_bed"; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
47 public static final String I18N_FACET_SEDIMENTLOAD_SUSPSEDIMENT = "facet.sedimentload.susp_sediment"; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
48 public static final String I18N_FACET_SEDIMENTLOAD_TOTAL_LOAD = "facet.sedimentload.total_load"; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
49 public static final String I18N_FACET_SEDIMENTLOAD_TOTAL = "facet.sedimentload.total"; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
50 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
51 static { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
52 // Active/deactivate facets. |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
53 FacetActivity.Registry.getInstance().register( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
54 "minfo", |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
55 new FacetActivity() { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
56 @Override |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
57 public Boolean isInitialActive( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
58 Artifact artifact, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
59 Facet facet, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
60 String output |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
61 ) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
62 return null; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
63 //XXX: This is all broken. |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
64 /* |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
65 String name = facet.getName(); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
66 if (name.equals(SEDIMENT_LOAD_TA_COARSE) || |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
67 name.equals(SEDIMENT_LOAD_TA_FINEMIDDLE) || |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
68 name.equals(SEDIMENT_LOAD_TA_SAND) || |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
69 name.equals(SEDIMENT_LOAD_TA_SUSP_SAND) || |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
70 name.equals(SEDIMENT_LOAD_TA_SUSP_SEDIMENT) || |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
71 name.equals(SEDIMENT_LOAD_TA_SUSP_SAND_BED) || |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
72 name.equals(SEDIMENT_LOAD_M3A_COARSE) || |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
73 name.equals(SEDIMENT_LOAD_M3A_FINEMIDDLE) || |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
74 name.equals(SEDIMENT_LOAD_M3A_SAND) || |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
75 name.equals(SEDIMENT_LOAD_M3A_SUSP_SAND) || |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
76 name.equals(SEDIMENT_LOAD_M3A_SUSP_SEDIMENT) || |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
77 name.equals(SEDIMENT_LOAD_M3A_SUSP_SAND_BED)){ |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
78 return Boolean.FALSE; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
79 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
80 else if (name.equals(SEDIMENT_LOAD_TA_UNKNOWN) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
81 || name.equals(SEDIMENT_LOAD_M3A_UNKNOWN)) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
82 D4EArtifact d4e = (D4EArtifact)artifact; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
83 SedimentLoadUnknownFacet f = |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
84 (SedimentLoadUnknownFacet) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
85 d4e.getNativeFacet(facet, null); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
86 SedimentLoadLSData load = |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
87 (SedimentLoadLSData)f.getData(artifact, null); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
88 SedimentLoadAccess access = |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
89 new SedimentLoadAccess(d4e); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
90 List<int[]> dates = new ArrayList<int[]>(); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
91 if (access.getYearEpoch().equals("year")) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
92 dates.add(access.getPeriod()); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
93 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
94 else { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
95 int[][] epochs = access.getEpochs(); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
96 for (int i = 0; i < epochs.length; i++) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
97 dates.add(epochs[i]); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
98 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
99 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
100 for (int[] date: dates) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
101 try { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
102 Date s = |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
103 DateUtil.getStartDateFromYear(date[0]); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
104 Date e = |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
105 DateUtil.getEndDateFromYear(date[1]); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
106 if (!(s.after(load.getEnd()) || |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
107 e.before(load.getStart()))) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
108 return Boolean.TRUE; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
109 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
110 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
111 catch (IllegalArgumentException iae) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
112 return Boolean.FALSE; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
113 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
114 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
115 return Boolean.FALSE; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
116 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
117 else { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
118 return null; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
119 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
120 */ |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
121 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
122 }); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
123 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
124 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
125 public SedimentLoadDataCalculate() { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
126 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
127 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
128 @Override |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
129 public Object computeAdvance(D4EArtifact artifact, String hash, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
130 CallContext context, List<Facet> facets, Object old) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
131 logger.debug("SedimentLoadDataCalculate.computeAdvance"); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
132 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
133 SedimentLoadAccess access = new SedimentLoadAccess(artifact); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
134 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
135 CalculationResult res = old instanceof CalculationResult |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
136 ? (CalculationResult) old |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
137 : new SedimentLoadDataCalculation().calculate(access); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
138 |
8125
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
139 |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
140 if (res == null) { |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
141 logger.error ("No calculation result."); |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
142 } |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
143 |
8133
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
144 if (facets == null) { |
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
145 /* No need to create facets as they already exist in this case. */ |
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
146 return res; |
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
147 } |
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
148 |
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
149 Calculation report = res.getReport(); |
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
150 |
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
151 if (report != null && report.hasProblems()) { |
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
152 facets.add(new ReportFacet(ComputeType.ADVANCE, hash, id)); |
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
153 logger.warn ("Problems : " + report.problemsToString()); |
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
154 } |
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
155 |
8125
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
156 Object raw = res.getData(); |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
157 if (raw == null) { |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
158 logger.warn("No result data."); |
8085
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
159 return res; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
160 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
161 |
8126
353f93d5d9f7
Correctly output problems in SedimentLoadDataCalculate
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8125
diff
changeset
|
162 SedimentLoadDataResult sdRes; |
8125
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
163 if (raw instanceof SedimentLoadDataResult) { |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
164 sdRes = (SedimentLoadDataResult) raw; |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
165 } else { |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
166 logger.error ("Unknown result"); |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
167 return null; |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
168 } |
8133
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
169 String unit = access.getUnit().replace("_per_","/"); |
8125
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
170 |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
171 int i = 0; |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
172 for (Fraction fract: sdRes.getFractions()) { |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
173 logger.debug("Adding facet for fraction: " + fract.getName()); |
8133
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
174 facets.add(new SedimentLoadDataFacet(i++, fract.getName(), |
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
175 unit, ComputeType.ADVANCE, id, hash, context)); |
8125
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
176 } |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
177 |
8133
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
178 facets.add( |
8125
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
179 new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
180 |
8085
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
181 /* XXX: THIS IS ALL BROKEN |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
182 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
183 SedimentLoadResult[] results = (SedimentLoadResult[]) res.getData(); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
184 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
185 if (results == null || results.length == 0) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
186 logger.warn("Calculation computed no results!"); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
187 return res; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
188 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
189 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
190 String type = access.getYearEpoch(); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
191 if (type.equals("year")) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
192 generateYearFacets(context, newFacets, results, getID(), hash, access); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
193 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
194 else if (type.equals("epoch")) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
195 generateEpochFacets(context, newFacets, results, getID(), hash, access); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
196 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
197 else if (type.equals("off_epoch")) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
198 generateOffEpochFacets(context, newFacets, results, getID(), hash, access); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
199 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
200 logger.debug("Created " + newFacets.size() + " new Facets."); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
201 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
202 String river = access.getRiverName(); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
203 SedimentLoadLSData[] unknown = |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
204 SedimentLoadFactory.getSedimentLoadUnknown(river, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
205 access.getUnit().replace("_per_","/"), type); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
206 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
207 boolean isUnitTA = access.getUnit().startsWith("t"); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
208 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
209 if (res.getReport().hasProblems()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
210 newFacets.add(new ReportFacet(ComputeType.ADVANCE, hash, id)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
211 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
212 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
213 for (int i = 0; i < unknown.length; i++) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
214 newFacets.add(new SedimentLoadUnknownFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
215 i, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
216 (isUnitTA)? SEDIMENT_LOAD_TA_UNKNOWN:SEDIMENT_LOAD_M3A_UNKNOWN, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
217 unknown[i].getDescription(), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
218 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
219 getID(), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
220 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
221 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
222 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
223 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
224 */ |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
225 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
226 return res; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
227 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
228 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
229 /* |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
230 private String facetNameInfo(SedimentLoadResult result, String unit) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
231 return " - " + result.getStartYear() + " " + unit; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
232 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
233 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
234 protected void generateYearFacets(CallContext context, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
235 List<Facet> newFacets, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
236 SedimentLoadResult[] results, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
237 String stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
238 String hash, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
239 SedimentLoadAccess access |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
240 ) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
241 logger.debug("SedimentLoadCalculate.generateFacets " + access.getUnit()); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
242 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
243 CallMeta meta = context.getMeta(); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
244 boolean isUnitTA = access.getUnit().startsWith("t"); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
245 String unit = (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
246 ? Resources.getMsg(context.getMeta(), "state.minfo.sediment.load.t_per_a", "(t/a)") |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
247 : Resources.getMsg(context.getMeta(), "state.minfo.sediment.load.m3_per_a", "(m^3/a)"); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
248 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
249 // newFacets.add(new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
250 for (int idx = 0; idx < results.length; idx++) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
251 SedimentLoadResult res = results[idx]; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
252 if (res.hasCoarseData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
253 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
254 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
255 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
256 ?SEDIMENT_LOAD_TA_COARSE |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
257 :SEDIMENT_LOAD_M3A_COARSE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
258 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
259 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
260 I18N_FACET_SEDIMENTLOAD_COARSE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
261 I18N_FACET_SEDIMENTLOAD_COARSE) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
262 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
263 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
264 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
265 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
266 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
267 if (res.hasSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
268 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
269 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
270 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
271 ?SEDIMENT_LOAD_TA_SAND |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
272 :SEDIMENT_LOAD_M3A_SAND, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
273 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
274 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
275 I18N_FACET_SEDIMENTLOAD_SAND, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
276 I18N_FACET_SEDIMENTLOAD_SAND) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
277 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
278 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
279 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
280 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
281 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
282 if (res.hasFineMiddleData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
283 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
284 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
285 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
286 ?SEDIMENT_LOAD_TA_FINEMIDDLE |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
287 :SEDIMENT_LOAD_M3A_FINEMIDDLE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
288 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
289 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
290 I18N_FACET_SEDIMENTLOAD_FINE_MIDDLE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
291 I18N_FACET_SEDIMENTLOAD_FINE_MIDDLE) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
292 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
293 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
294 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
295 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
296 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
297 if (res.hasSuspSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
298 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
299 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
300 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
301 ?SEDIMENT_LOAD_TA_SUSP_SAND |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
302 :SEDIMENT_LOAD_M3A_SUSP_SAND, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
303 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
304 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
305 I18N_FACET_SEDIMENTLOAD_SUSPSAND, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
306 I18N_FACET_SEDIMENTLOAD_SUSPSAND) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
307 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
308 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
309 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
310 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
311 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
312 if (res.hasSuspSandBedData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
313 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
314 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
315 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
316 ?SEDIMENT_LOAD_TA_SUSP_SAND_BED |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
317 :SEDIMENT_LOAD_M3A_SUSP_SAND_BED, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
318 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
319 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
320 I18N_FACET_SEDIMENTLOAD_SUSPSANDBED, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
321 I18N_FACET_SEDIMENTLOAD_SUSPSANDBED) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
322 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
323 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
324 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
325 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
326 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
327 if (res.hasSuspSedimentData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
328 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
329 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
330 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
331 ?SEDIMENT_LOAD_TA_SUSP_SEDIMENT |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
332 :SEDIMENT_LOAD_M3A_SUSP_SEDIMENT, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
333 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
334 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
335 I18N_FACET_SEDIMENTLOAD_SUSPSEDIMENT, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
336 I18N_FACET_SEDIMENTLOAD_SUSPSEDIMENT) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
337 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
338 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
339 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
340 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
341 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
342 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
343 if (res.hasTotalData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
344 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
345 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
346 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
347 ?SEDIMENT_LOAD_TA_TOTAL |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
348 :SEDIMENT_LOAD_M3A_TOTAL, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
349 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
350 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
351 I18N_FACET_SEDIMENTLOAD_TOTAL, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
352 I18N_FACET_SEDIMENTLOAD_TOTAL) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
353 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
354 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
355 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
356 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
357 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
358 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
359 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
360 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
361 private String epochFacetNameInfo(SedimentLoadResult result, String unit) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
362 return " - " + result.getStartYear() + "-" + result.getEndYear() + " " + unit; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
363 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
364 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
365 protected void generateEpochFacets( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
366 CallContext context, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
367 List<Facet> newFacets, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
368 SedimentLoadResult[] results, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
369 String stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
370 String hash, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
371 SedimentLoadAccess access |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
372 ) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
373 logger.debug("SedimentLoadCalculate.generateEpochFacets "); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
374 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
375 CallMeta meta = context.getMeta(); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
376 boolean isUnitTA = access.getUnit().startsWith("t"); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
377 String unit = (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
378 ? Resources.getMsg(context.getMeta(), "state.minfo.sediment.load.t_per_a", "(t/a)") |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
379 : Resources.getMsg(context.getMeta(), "state.minfo.sediment.load.m3_per_a", "(m^3/a)"); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
380 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
381 // newFacets.add(new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
382 for (int idx = 0; idx < results.length; idx++) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
383 SedimentLoadResult res = results[idx]; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
384 if (res.hasCoarseData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
385 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
386 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
387 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
388 ?SEDIMENT_LOAD_TA_COARSE |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
389 :SEDIMENT_LOAD_M3A_COARSE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
390 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
391 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
392 I18N_FACET_SEDIMENTLOAD_COARSE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
393 I18N_FACET_SEDIMENTLOAD_COARSE) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
394 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
395 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
396 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
397 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
398 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
399 if (res.hasSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
400 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
401 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
402 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
403 ?SEDIMENT_LOAD_TA_SAND |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
404 :SEDIMENT_LOAD_M3A_SAND, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
405 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
406 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
407 I18N_FACET_SEDIMENTLOAD_SAND, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
408 I18N_FACET_SEDIMENTLOAD_SAND) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
409 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
410 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
411 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
412 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
413 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
414 if (res.hasFineMiddleData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
415 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
416 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
417 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
418 ?SEDIMENT_LOAD_TA_FINEMIDDLE |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
419 :SEDIMENT_LOAD_M3A_FINEMIDDLE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
420 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
421 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
422 I18N_FACET_SEDIMENTLOAD_FINE_MIDDLE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
423 I18N_FACET_SEDIMENTLOAD_FINE_MIDDLE) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
424 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
425 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
426 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
427 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
428 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
429 if (res.hasSuspSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
430 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
431 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
432 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
433 ?SEDIMENT_LOAD_TA_SUSP_SAND |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
434 :SEDIMENT_LOAD_M3A_SUSP_SAND, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
435 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
436 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
437 I18N_FACET_SEDIMENTLOAD_SUSPSAND, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
438 I18N_FACET_SEDIMENTLOAD_SUSPSAND) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
439 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
440 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
441 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
442 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
443 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
444 if (res.hasSuspSandBedData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
445 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
446 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
447 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
448 ?SEDIMENT_LOAD_TA_SUSP_SAND_BED |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
449 :SEDIMENT_LOAD_M3A_SUSP_SAND, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
450 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
451 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
452 I18N_FACET_SEDIMENTLOAD_SUSPSANDBED, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
453 I18N_FACET_SEDIMENTLOAD_SUSPSANDBED) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
454 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
455 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
456 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
457 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
458 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
459 if (res.hasSuspSedimentData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
460 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
461 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
462 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
463 ?SEDIMENT_LOAD_TA_SUSP_SEDIMENT |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
464 :SEDIMENT_LOAD_M3A_SUSP_SEDIMENT, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
465 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
466 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
467 I18N_FACET_SEDIMENTLOAD_SUSPSEDIMENT, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
468 I18N_FACET_SEDIMENTLOAD_SUSPSEDIMENT) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
469 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
470 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
471 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
472 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
473 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
474 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
475 if (res.hasTotalLoadData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
476 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
477 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
478 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
479 ?SEDIMENT_LOAD_TA_TOTAL_LOAD |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
480 :SEDIMENT_LOAD_M3A_TOTAL_LOAD, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
481 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
482 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
483 I18N_FACET_SEDIMENTLOAD_TOTAL_LOAD, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
484 I18N_FACET_SEDIMENTLOAD_TOTAL_LOAD) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
485 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
486 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
487 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
488 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
489 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
490 if (res.hasTotalData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
491 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
492 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
493 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
494 ?SEDIMENT_LOAD_TA_TOTAL |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
495 :SEDIMENT_LOAD_M3A_TOTAL, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
496 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
497 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
498 I18N_FACET_SEDIMENTLOAD_TOTAL, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
499 I18N_FACET_SEDIMENTLOAD_TOTAL) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
500 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
501 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
502 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
503 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
504 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
505 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
506 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
507 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
508 protected void generateOffEpochFacets( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
509 CallContext context, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
510 List<Facet> newFacets, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
511 SedimentLoadResult[] results, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
512 String stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
513 String hash, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
514 SedimentLoadAccess access |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
515 ) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
516 logger.debug("SedimentLoadCalculate.generateOffEpochFacets"); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
517 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
518 CallMeta meta = context.getMeta(); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
519 boolean isUnitTA = access.getUnit().startsWith("t"); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
520 String unit = (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
521 ? Resources.getMsg(context.getMeta(), "state.minfo.sediment.load.t_per_a", "(t/a)") |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
522 : Resources.getMsg(context.getMeta(), "state.minfo.sediment.load.m3_per_a", "(m^3/a)"); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
523 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
524 // newFacets.add(new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
525 for (int idx = 0; idx < results.length; idx++) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
526 SedimentLoadResult res = results[idx]; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
527 if (res.hasCoarseData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
528 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
529 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
530 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
531 ?SEDIMENT_LOAD_TA_COARSE |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
532 :SEDIMENT_LOAD_M3A_COARSE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
533 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
534 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
535 I18N_FACET_SEDIMENTLOAD_COARSE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
536 I18N_FACET_SEDIMENTLOAD_COARSE) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
537 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
538 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
539 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
540 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
541 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
542 if (res.hasSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
543 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
544 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
545 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
546 ?SEDIMENT_LOAD_TA_SAND |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
547 :SEDIMENT_LOAD_M3A_SAND, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
548 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
549 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
550 I18N_FACET_SEDIMENTLOAD_SAND, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
551 I18N_FACET_SEDIMENTLOAD_SAND) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
552 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
553 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
554 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
555 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
556 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
557 if (res.hasFineMiddleData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
558 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
559 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
560 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
561 ?SEDIMENT_LOAD_TA_FINEMIDDLE |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
562 :SEDIMENT_LOAD_M3A_FINEMIDDLE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
563 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
564 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
565 I18N_FACET_SEDIMENTLOAD_FINE_MIDDLE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
566 I18N_FACET_SEDIMENTLOAD_FINE_MIDDLE) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
567 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
568 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
569 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
570 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
571 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
572 if (res.hasSuspSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
573 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
574 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
575 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
576 ?SEDIMENT_LOAD_TA_SUSP_SAND |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
577 :SEDIMENT_LOAD_M3A_SUSP_SAND, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
578 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
579 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
580 I18N_FACET_SEDIMENTLOAD_SUSPSAND, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
581 I18N_FACET_SEDIMENTLOAD_SUSPSAND) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
582 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
583 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
584 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
585 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
586 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
587 if (res.hasSuspSandBedData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
588 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
589 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
590 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
591 ?SEDIMENT_LOAD_TA_SUSP_SAND_BED |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
592 :SEDIMENT_LOAD_M3A_SUSP_SAND_BED, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
593 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
594 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
595 I18N_FACET_SEDIMENTLOAD_SUSPSANDBED, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
596 I18N_FACET_SEDIMENTLOAD_SUSPSANDBED) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
597 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
598 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
599 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
600 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
601 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
602 if (res.hasSuspSedimentData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
603 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
604 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
605 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
606 ?SEDIMENT_LOAD_TA_SUSP_SEDIMENT |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
607 :SEDIMENT_LOAD_M3A_SUSP_SEDIMENT, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
608 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
609 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
610 I18N_FACET_SEDIMENTLOAD_SUSPSEDIMENT, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
611 I18N_FACET_SEDIMENTLOAD_SUSPSEDIMENT) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
612 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
613 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
614 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
615 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
616 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
617 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
618 if (res.hasTotalLoadData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
619 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
620 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
621 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
622 ?SEDIMENT_LOAD_TA_TOTAL_LOAD |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
623 :SEDIMENT_LOAD_M3A_TOTAL_LOAD, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
624 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
625 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
626 I18N_FACET_SEDIMENTLOAD_TOTAL_LOAD, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
627 I18N_FACET_SEDIMENTLOAD_TOTAL_LOAD) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
628 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
629 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
630 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
631 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
632 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
633 if (res.hasTotalData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
634 newFacets.add(new SedimentLoadFacet( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
635 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
636 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
637 ?SEDIMENT_LOAD_TA_TOTAL |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
638 :SEDIMENT_LOAD_M3A_TOTAL, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
639 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
640 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
641 I18N_FACET_SEDIMENTLOAD_TOTAL, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
642 I18N_FACET_SEDIMENTLOAD_TOTAL) + |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
643 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
644 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
645 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
646 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
647 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
648 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
649 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
650 */ |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
651 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
652 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |