annotate artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadDataCalculate.java @ 8085:75e62ea0e307

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

http://dive4elements.wald.intevation.org