Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadDataCalculate.java @ 8169:856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
author | "Tom Gottfried <tom@intevation.de>" |
---|---|
date | Mon, 01 Sep 2014 09:43:55 +0200 |
parents | ce35bdf3d750 |
children | bb770daccd1d |
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()) { |
8146
ce35bdf3d750
Let the facet know the period of it's data.
Tom Gottfried <tom@intevation.de>
parents:
8137
diff
changeset
|
173 logger.debug("Adding facet for fraction '" + fract.getName() + |
ce35bdf3d750
Let the facet know the period of it's data.
Tom Gottfried <tom@intevation.de>
parents:
8137
diff
changeset
|
174 "' and period '" + fract.getPeriod() + "'"); |
8133
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
175 facets.add(new SedimentLoadDataFacet(i++, fract.getName(), |
8146
ce35bdf3d750
Let the facet know the period of it's data.
Tom Gottfried <tom@intevation.de>
parents:
8137
diff
changeset
|
176 unit, fract.getPeriod(), |
ce35bdf3d750
Let the facet know the period of it's data.
Tom Gottfried <tom@intevation.de>
parents:
8137
diff
changeset
|
177 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
|
178 } |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
179 |
8133
45b1d71110c3
Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8126
diff
changeset
|
180 facets.add( |
8125
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
181 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
|
182 |
8085
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
183 /* 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
|
184 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
185 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
|
186 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
187 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
|
188 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
|
189 return res; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
190 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
191 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
192 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
|
193 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
|
194 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
|
195 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
196 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
|
197 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
|
198 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
199 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
|
200 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
|
201 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
202 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
|
203 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
204 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
|
205 SedimentLoadLSData[] unknown = |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
206 SedimentLoadFactory.getSedimentLoadUnknown(river, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
207 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
|
208 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
209 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
|
210 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
211 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
|
212 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
|
213 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
214 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
215 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
|
216 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
|
217 i, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
218 (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
|
219 unknown[i].getDescription(), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
220 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
221 getID(), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
222 hash)); |
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 */ |
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 return res; |
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 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
231 /* |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
232 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
|
233 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
|
234 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
235 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
236 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
|
237 List<Facet> newFacets, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
238 SedimentLoadResult[] results, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
239 String stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
240 String hash, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
241 SedimentLoadAccess access |
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 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
|
244 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
245 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
|
246 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
|
247 String unit = (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
248 ? 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
|
249 : 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
|
250 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
251 // 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
|
252 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
|
253 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
|
254 if (res.hasCoarseData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
255 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
|
256 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
257 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
258 ?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
|
259 :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
|
260 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
261 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
262 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
|
263 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
|
264 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
265 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
266 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
267 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
268 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
269 if (res.hasSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
270 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
|
271 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
272 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
273 ?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
|
274 :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
|
275 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
276 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
277 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
|
278 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
|
279 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
280 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
281 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
282 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
283 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
284 if (res.hasFineMiddleData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
285 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
|
286 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
287 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
288 ?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
|
289 :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
|
290 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
291 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
292 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
|
293 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
|
294 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
295 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
296 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
297 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
298 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
299 if (res.hasSuspSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
300 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
|
301 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
302 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
303 ?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
|
304 :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
|
305 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
306 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
307 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
|
308 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
|
309 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
310 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
311 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
312 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
313 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
314 if (res.hasSuspSandBedData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
315 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
|
316 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
317 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
318 ?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
|
319 :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
|
320 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
321 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
322 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
|
323 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
|
324 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
325 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
326 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
327 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
328 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
329 if (res.hasSuspSedimentData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
330 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
|
331 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
332 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
333 ?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
|
334 :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
|
335 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
336 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
337 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
|
338 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
|
339 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
340 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
341 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
342 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
343 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
344 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
345 if (res.hasTotalData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
346 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
|
347 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
348 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
349 ?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
|
350 :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
|
351 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
352 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
353 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
|
354 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
|
355 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
356 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
357 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
358 hash)); |
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 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
362 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
363 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
|
364 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
|
365 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
366 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
367 protected void generateEpochFacets( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
368 CallContext context, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
369 List<Facet> newFacets, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
370 SedimentLoadResult[] results, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
371 String stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
372 String hash, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
373 SedimentLoadAccess access |
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 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
|
376 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
377 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
|
378 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
|
379 String unit = (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
380 ? 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
|
381 : 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
|
382 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
383 // 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
|
384 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
|
385 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
|
386 if (res.hasCoarseData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
387 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
|
388 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
389 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
390 ?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
|
391 :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
|
392 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
393 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
394 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
|
395 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
|
396 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
397 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
398 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
399 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
400 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
401 if (res.hasSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
402 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
|
403 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
404 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
405 ?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
|
406 :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
|
407 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
408 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
409 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
|
410 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
|
411 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
412 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
413 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
414 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
415 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
416 if (res.hasFineMiddleData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
417 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
|
418 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
419 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
420 ?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
|
421 :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
|
422 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
423 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
424 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
|
425 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
|
426 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
427 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
428 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
429 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
430 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
431 if (res.hasSuspSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
432 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
|
433 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
434 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
435 ?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
|
436 :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
|
437 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
438 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
439 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
|
440 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
|
441 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
442 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
443 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
444 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
445 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
446 if (res.hasSuspSandBedData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
447 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
|
448 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
449 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
450 ?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
|
451 :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
|
452 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
453 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
454 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
|
455 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
|
456 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
457 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
458 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
459 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
460 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
461 if (res.hasSuspSedimentData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
462 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
|
463 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
464 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
465 ?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
|
466 :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
|
467 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
468 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
469 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
|
470 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
|
471 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
472 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
473 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
474 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
475 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
476 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
477 if (res.hasTotalLoadData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
478 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
|
479 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
480 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
481 ?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
|
482 :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
|
483 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
484 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
485 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
|
486 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
|
487 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
488 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
489 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
490 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
491 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
492 if (res.hasTotalData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
493 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
|
494 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
495 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
496 ?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
|
497 :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
|
498 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
499 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
500 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
|
501 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
|
502 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
503 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
504 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
505 hash)); |
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 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
509 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
510 protected void generateOffEpochFacets( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
511 CallContext context, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
512 List<Facet> newFacets, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
513 SedimentLoadResult[] results, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
514 String stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
515 String hash, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
516 SedimentLoadAccess access |
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 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
|
519 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
520 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
|
521 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
|
522 String unit = (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
523 ? 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
|
524 : 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
|
525 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
526 // 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
|
527 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
|
528 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
|
529 if (res.hasCoarseData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
530 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
|
531 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
532 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
533 ?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
|
534 :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
|
535 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
536 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
537 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
|
538 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
|
539 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
540 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
541 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
542 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
543 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
544 if (res.hasSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
545 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
|
546 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
547 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
548 ?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
|
549 :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
|
550 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
551 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
552 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
|
553 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
|
554 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
555 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
556 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
557 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
558 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
559 if (res.hasFineMiddleData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
560 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
|
561 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
562 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
563 ?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
|
564 :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
|
565 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
566 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
567 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
|
568 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
|
569 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
570 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
571 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
572 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
573 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
574 if (res.hasSuspSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
575 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
|
576 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
577 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
578 ?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
|
579 :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
|
580 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
581 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
582 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
|
583 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
|
584 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
585 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
586 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
587 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
588 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
589 if (res.hasSuspSandBedData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
590 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
|
591 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
592 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
593 ?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
|
594 :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
|
595 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
596 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
597 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
|
598 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
|
599 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
600 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
601 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
602 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
603 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
604 if (res.hasSuspSedimentData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
605 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
|
606 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
607 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
608 ?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
|
609 :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
|
610 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
611 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
612 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
|
613 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
|
614 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
615 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
616 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
617 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
618 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
619 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
620 if (res.hasTotalLoadData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
621 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
|
622 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
623 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
624 ?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
|
625 :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
|
626 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
627 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
628 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
|
629 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
|
630 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
631 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
632 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
633 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
634 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
635 if (res.hasTotalData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
636 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
|
637 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
638 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
639 ?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
|
640 :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
|
641 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
642 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
643 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
|
644 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
|
645 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
646 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
647 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
648 hash)); |
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 */ |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
653 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
654 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |