annotate artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadDataCalculate.java @ 8125:f01c65261963

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

http://dive4elements.wald.intevation.org