Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadDataCalculate.java @ 8126:353f93d5d9f7
Correctly output problems in SedimentLoadDataCalculate
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 25 Aug 2014 16:04:35 +0200 |
parents | f01c65261963 |
children | 45b1d71110c3 |
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.ArrayList; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
12 import java.util.Date; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
13 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
|
14 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
15 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
|
16 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
|
17 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
|
18 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
|
19 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
|
20 import org.dive4elements.artifacts.CallMeta; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
21 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
|
22 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
|
23 import org.dive4elements.river.artifacts.model.CalculationResult; |
8126
353f93d5d9f7
Correctly output problems in SedimentLoadDataCalculate
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8125
diff
changeset
|
24 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
|
25 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
|
26 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
|
27 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
|
28 import org.dive4elements.river.artifacts.model.minfo.SedimentLoadDataCalculation; |
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.model.minfo.SedimentLoadLSData; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
30 import org.dive4elements.river.artifacts.model.minfo.SedimentLoadFacet; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
31 import org.dive4elements.river.artifacts.model.minfo.SedimentLoadFactory; |
8125
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
32 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
|
33 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
|
34 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
|
35 import org.dive4elements.river.artifacts.model.minfo.SedimentLoadUnknownFacet; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
36 import org.dive4elements.river.artifacts.resources.Resources; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
37 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
|
38 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
39 /** 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
|
40 public class SedimentLoadDataCalculate |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
41 extends DefaultState |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
42 implements FacetTypes |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
43 { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
44 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
45 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
|
46 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
47 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
|
48 .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
|
49 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
50 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
|
51 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
|
52 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
|
53 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
|
54 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
|
55 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
|
56 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
|
57 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
|
58 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
59 static { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
60 // Active/deactivate facets. |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
61 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
|
62 "minfo", |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
63 new FacetActivity() { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
64 @Override |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
65 public Boolean isInitialActive( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
66 Artifact artifact, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
67 Facet facet, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
68 String output |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
69 ) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
70 return null; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
71 //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
|
72 /* |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
73 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
|
74 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
|
75 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
|
76 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
|
77 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
|
78 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
|
79 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
|
80 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
|
81 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
|
82 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
|
83 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
|
84 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
|
85 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
|
86 return Boolean.FALSE; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
87 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
88 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
|
89 || 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
|
90 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
|
91 SedimentLoadUnknownFacet f = |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
92 (SedimentLoadUnknownFacet) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
93 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
|
94 SedimentLoadLSData load = |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
95 (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
|
96 SedimentLoadAccess access = |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
97 new SedimentLoadAccess(d4e); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
98 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
|
99 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
|
100 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
|
101 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
102 else { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
103 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
|
104 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
|
105 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
|
106 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
107 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
108 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
|
109 try { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
110 Date s = |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
111 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
|
112 Date e = |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
113 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
|
114 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
|
115 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
|
116 return Boolean.TRUE; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
117 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
118 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
119 catch (IllegalArgumentException iae) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
120 return Boolean.FALSE; |
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 return Boolean.FALSE; |
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 else { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
126 return null; |
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 */ |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
129 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
130 }); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
131 } |
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 public SedimentLoadDataCalculate() { |
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 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
136 @Override |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
137 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
|
138 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
|
139 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
|
140 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
141 List<Facet> newFacets = new ArrayList<Facet>(); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
142 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
143 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
|
144 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
145 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
|
146 ? (CalculationResult) old |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
147 : 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
|
148 |
8125
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
149 |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
150 if (res == null) { |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
151 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
|
152 } |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
153 |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
154 Object raw = res.getData(); |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
155 if (raw == null) { |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
156 logger.warn("No result data."); |
8126
353f93d5d9f7
Correctly output problems in SedimentLoadDataCalculate
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8125
diff
changeset
|
157 Calculation report = res.getReport(); |
353f93d5d9f7
Correctly output problems in SedimentLoadDataCalculate
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8125
diff
changeset
|
158 if (report != null) { |
353f93d5d9f7
Correctly output problems in SedimentLoadDataCalculate
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8125
diff
changeset
|
159 logger.warn ("Problems : " + report.problemsToString()); |
353f93d5d9f7
Correctly output problems in SedimentLoadDataCalculate
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8125
diff
changeset
|
160 } |
8085
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
161 return res; |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
162 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
163 |
8126
353f93d5d9f7
Correctly output problems in SedimentLoadDataCalculate
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8125
diff
changeset
|
164 SedimentLoadDataResult sdRes; |
8125
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
165 if (raw instanceof SedimentLoadDataResult) { |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
166 sdRes = (SedimentLoadDataResult) raw; |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
167 } else { |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
168 logger.error ("Unknown result"); |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
169 return null; |
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 |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
172 int i = 0; |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
173 for (Fraction fract: sdRes.getFractions()) { |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
174 logger.debug("Adding facet for fraction: " + fract.getName()); |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
175 newFacets.add(new SedimentLoadDataFacet(i++, fract.getName(), |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
176 fract.getUnit(), ComputeType.ADVANCE, id, hash, context)); |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
177 } |
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 newFacets.add( |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
180 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
|
181 |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
182 if (facets != null) { |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
183 facets.addAll(newFacets); |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
184 } else { |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
185 facets = newFacets; |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
186 } |
f01c65261963
(issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8085
diff
changeset
|
187 |
8085
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
188 /* 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
|
189 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
190 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
|
191 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
192 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
|
193 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
|
194 return res; |
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 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
197 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
|
198 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
|
199 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
|
200 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
201 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
|
202 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
|
203 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
204 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
|
205 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
|
206 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
207 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
|
208 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
209 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
|
210 SedimentLoadLSData[] unknown = |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
211 SedimentLoadFactory.getSedimentLoadUnknown(river, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
212 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
|
213 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
214 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
|
215 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
216 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
|
217 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
|
218 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
219 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
220 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
|
221 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
|
222 i, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
223 (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
|
224 unknown[i].getDescription(), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
225 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
226 getID(), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
227 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
228 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
229 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
230 |
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 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
233 return res; |
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 /* |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
237 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
|
238 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
|
239 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
240 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
241 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
|
242 List<Facet> newFacets, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
243 SedimentLoadResult[] results, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
244 String stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
245 String hash, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
246 SedimentLoadAccess access |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
247 ) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
248 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
|
249 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
250 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
|
251 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
|
252 String unit = (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
253 ? 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
|
254 : 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
|
255 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
256 // 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
|
257 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
|
258 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
|
259 if (res.hasCoarseData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
260 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
|
261 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
262 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
263 ?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
|
264 :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
|
265 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
266 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
267 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
|
268 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
|
269 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
270 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
271 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
272 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
273 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
274 if (res.hasSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
275 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
|
276 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
277 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
278 ?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
|
279 :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
|
280 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
281 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
282 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
|
283 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
|
284 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
285 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
286 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
287 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
288 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
289 if (res.hasFineMiddleData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
290 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
|
291 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
292 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
293 ?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
|
294 :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
|
295 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
296 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
297 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
|
298 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
|
299 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
300 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
301 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
302 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
303 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
304 if (res.hasSuspSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
305 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
|
306 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
307 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
308 ?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
|
309 :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
|
310 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
311 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
312 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
|
313 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
|
314 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
315 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
316 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
317 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
318 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
319 if (res.hasSuspSandBedData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
320 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
|
321 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
322 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
323 ?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
|
324 :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
|
325 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
326 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
327 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
|
328 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
|
329 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
330 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
331 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
332 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
333 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
334 if (res.hasSuspSedimentData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
335 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
|
336 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
337 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
338 ?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
|
339 :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
|
340 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
341 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
342 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
|
343 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
|
344 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
345 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
346 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
347 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
348 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
349 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
350 if (res.hasTotalData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
351 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
|
352 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
353 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
354 ?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
|
355 :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
|
356 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
357 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
358 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
|
359 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
|
360 facetNameInfo(res, unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
361 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
362 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
363 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
364 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
365 } |
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 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
368 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
|
369 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
|
370 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
371 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
372 protected void generateEpochFacets( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
373 CallContext context, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
374 List<Facet> newFacets, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
375 SedimentLoadResult[] results, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
376 String stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
377 String hash, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
378 SedimentLoadAccess access |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
379 ) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
380 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
|
381 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
382 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
|
383 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
|
384 String unit = (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
385 ? 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
|
386 : 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
|
387 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
388 // 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
|
389 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
|
390 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
|
391 if (res.hasCoarseData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
392 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
|
393 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
394 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
395 ?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
|
396 :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
|
397 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
398 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
399 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
|
400 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
|
401 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
402 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
403 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
404 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
405 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
406 if (res.hasSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
407 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
|
408 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
409 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
410 ?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
|
411 :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
|
412 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
413 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
414 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
|
415 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
|
416 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
417 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
418 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
419 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
420 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
421 if (res.hasFineMiddleData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
422 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
|
423 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
424 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
425 ?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
|
426 :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
|
427 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
428 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
429 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
|
430 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
|
431 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
432 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
433 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
434 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
435 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
436 if (res.hasSuspSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
437 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
|
438 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
439 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
440 ?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
|
441 :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
|
442 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
443 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
444 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
|
445 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
|
446 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
447 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
448 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
449 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
450 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
451 if (res.hasSuspSandBedData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
452 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
|
453 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
454 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
455 ?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
|
456 :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
|
457 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
458 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
459 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
|
460 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
|
461 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
462 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
463 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
464 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
465 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
466 if (res.hasSuspSedimentData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
467 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
|
468 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
469 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
470 ?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
|
471 :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
|
472 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
473 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
474 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
|
475 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
|
476 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
477 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
478 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
479 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
480 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
481 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
482 if (res.hasTotalLoadData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
483 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
|
484 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
485 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
486 ?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
|
487 :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
|
488 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
489 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
490 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
|
491 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
|
492 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
493 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
494 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
495 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
496 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
497 if (res.hasTotalData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
498 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
|
499 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
500 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
501 ?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
|
502 :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
|
503 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
504 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
505 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
|
506 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
|
507 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
508 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
509 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
510 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
511 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
512 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
513 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
514 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
515 protected void generateOffEpochFacets( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
516 CallContext context, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
517 List<Facet> newFacets, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
518 SedimentLoadResult[] results, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
519 String stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
520 String hash, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
521 SedimentLoadAccess access |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
522 ) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
523 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
|
524 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
525 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
|
526 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
|
527 String unit = (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
528 ? 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
|
529 : 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
|
530 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
531 // 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
|
532 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
|
533 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
|
534 if (res.hasCoarseData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
535 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
|
536 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
537 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
538 ?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
|
539 :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
|
540 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
541 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
542 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
|
543 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
|
544 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
545 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
546 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
547 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
548 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
549 if (res.hasSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
550 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
|
551 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
552 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
553 ?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
|
554 :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
|
555 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
556 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
557 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
|
558 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
|
559 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
560 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
561 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
562 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
563 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
564 if (res.hasFineMiddleData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
565 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
|
566 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
567 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
568 ?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
|
569 :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
|
570 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
571 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
572 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
|
573 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
|
574 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
575 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
576 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
577 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
578 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
579 if (res.hasSuspSandData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
580 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
|
581 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
582 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
583 ?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
|
584 :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
|
585 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
586 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
587 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
|
588 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
|
589 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
590 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
591 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
592 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
593 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
594 if (res.hasSuspSandBedData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
595 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
|
596 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
597 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
598 ?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
|
599 :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
|
600 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
601 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
602 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
|
603 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
|
604 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
605 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
606 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
607 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
608 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
609 if (res.hasSuspSedimentData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
610 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
|
611 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
612 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
613 ?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
|
614 :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
|
615 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
616 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
617 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
|
618 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
|
619 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
620 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
621 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
622 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
623 |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
624 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
625 if (res.hasTotalLoadData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
626 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
|
627 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
628 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
629 ?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
|
630 :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
|
631 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
632 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
633 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
|
634 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
|
635 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
636 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
637 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
638 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
639 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
640 if (res.hasTotalData()) { |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
641 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
|
642 idx, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
643 (isUnitTA) |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
644 ?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
|
645 :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
|
646 Resources.getMsg( |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
647 meta, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
648 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
|
649 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
|
650 epochFacetNameInfo(res,unit), |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
651 ComputeType.ADVANCE, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
652 stateId, |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
653 hash)); |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
654 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
655 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
656 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
657 */ |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
658 } |
75e62ea0e307
Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
659 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |