annotate artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadDataCalculate.java @ 9726:0a5239a1e46e 3.2.x

Upgrade to Log4j 2
author Tom Gottfried <tom@intevation.de>
date Wed, 02 Mar 2022 10:26:50 +0100
parents 5e38e2924c07
children
rev   line source
8085
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
3 *
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
6 * documentation coming with Dive4Elements River for details.
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
7 */
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
8
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
9 package org.dive4elements.river.artifacts.states.minfo;
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
10
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
11 import java.util.List;
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
12
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
13 import org.apache.logging.log4j.Logger;
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
14 import org.apache.logging.log4j.LogManager;
8085
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
15 import org.dive4elements.artifactdatabase.state.Facet;
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.FacetActivity;
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
17 import org.dive4elements.artifacts.Artifact;
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.CallContext;
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
19 import org.dive4elements.river.artifacts.D4EArtifact;
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
20 import org.dive4elements.river.artifacts.access.SedimentLoadAccess;
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.model.CalculationResult;
8126
353f93d5d9f7 Correctly output problems in SedimentLoadDataCalculate
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8125
diff changeset
22 import org.dive4elements.river.artifacts.model.Calculation;
8085
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
23 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
24 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
25 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
26 import org.dive4elements.river.artifacts.model.minfo.SedimentLoadDataCalculation;
8125
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
27 import org.dive4elements.river.artifacts.model.minfo.SedimentLoadDataResult;
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
28 import org.dive4elements.river.artifacts.model.minfo.SedimentLoadDataResult.Fraction;
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
29 import org.dive4elements.river.artifacts.model.minfo.SedimentLoadDataFacet;
8085
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
30 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
31
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
32 /** 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
33 public class SedimentLoadDataCalculate
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
34 extends DefaultState
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
35 implements FacetTypes
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
36 {
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
37
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
38 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
39
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
40 private static final Logger log = LogManager
8125
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
41 .getLogger(SedimentLoadDataCalculate.class);
8085
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
42
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
43 public static final String I18N_FACET_SEDIMENTLOAD_COARSE =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
44 "facet.sedimentload.coarse";
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
45 public static final String I18N_FACET_SEDIMENTLOAD_SAND =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
46 "facet.sedimentload.sand";
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
47 public static final String I18N_FACET_SEDIMENTLOAD_FINE_MIDDLE =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
48 "facet.sedimentload.fine_middle";
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
49 public static final String I18N_FACET_SEDIMENTLOAD_SUSPSAND =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
50 "facet.sedimentload.susp_sand";
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
51 public static final String I18N_FACET_SEDIMENTLOAD_SUSPSANDBED =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
52 "facet.sediemntload.susp_sand_bed";
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
53 public static final String I18N_FACET_SEDIMENTLOAD_SUSPSEDIMENT =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
54 "facet.sedimentload.susp_sediment";
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
55 public static final String I18N_FACET_SEDIMENTLOAD_TOTAL_LOAD =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
56 "facet.sedimentload.total_load";
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
57 public static final String I18N_FACET_SEDIMENTLOAD_TOTAL =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
58 "facet.sedimentload.total";
8085
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
59
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
60 static {
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
61 // Active/deactivate facets.
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
62 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
63 "minfo",
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
64 new FacetActivity() {
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
65 @Override
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
66 public Boolean isInitialActive(
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
67 Artifact artifact,
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
68 Facet facet,
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
69 String output
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
70 ) {
8173
16be0ceee25b Only calculated sums of fractions should be initially shown in diagram.
Tom Gottfried <tom@intevation.de>
parents: 8171
diff changeset
71 String name = facet.getName();
16be0ceee25b Only calculated sums of fractions should be initially shown in diagram.
Tom Gottfried <tom@intevation.de>
parents: 8171
diff changeset
72 if (name.endsWith("total") || name.endsWith("bed_load")
16be0ceee25b Only calculated sums of fractions should be initially shown in diagram.
Tom Gottfried <tom@intevation.de>
parents: 8171
diff changeset
73 || name.endsWith("bed_load_susp_sand")) {
16be0ceee25b Only calculated sums of fractions should be initially shown in diagram.
Tom Gottfried <tom@intevation.de>
parents: 8171
diff changeset
74 return Boolean.TRUE;
16be0ceee25b Only calculated sums of fractions should be initially shown in diagram.
Tom Gottfried <tom@intevation.de>
parents: 8171
diff changeset
75 }
16be0ceee25b Only calculated sums of fractions should be initially shown in diagram.
Tom Gottfried <tom@intevation.de>
parents: 8171
diff changeset
76 return Boolean.FALSE;
8085
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
77 }
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
78 });
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
79 }
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
80
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
81 public SedimentLoadDataCalculate() {
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
82 }
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
83
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
84 @Override
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
85 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
86 CallContext context, List<Facet> facets, Object old) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8174
diff changeset
87 log.debug("SedimentLoadDataCalculate.computeAdvance");
8085
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
88
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
89 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
90
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
91 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
92 ? (CalculationResult) old
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
93 : 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
94
8125
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
95
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
96 if (res == null) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8174
diff changeset
97 log.error ("No calculation result.");
8125
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
98 }
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
99
8133
45b1d71110c3 Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8126
diff changeset
100 if (facets == null) {
45b1d71110c3 Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8126
diff changeset
101 /* No need to create facets as they already exist in this case. */
45b1d71110c3 Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8126
diff changeset
102 return res;
45b1d71110c3 Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8126
diff changeset
103 }
45b1d71110c3 Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8126
diff changeset
104
45b1d71110c3 Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8126
diff changeset
105 Calculation report = res.getReport();
45b1d71110c3 Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8126
diff changeset
106
45b1d71110c3 Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8126
diff changeset
107 if (report != null && report.hasProblems()) {
45b1d71110c3 Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8126
diff changeset
108 facets.add(new ReportFacet(ComputeType.ADVANCE, hash, id));
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8174
diff changeset
109 log.warn ("Problems : " + report.problemsToString());
8133
45b1d71110c3 Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8126
diff changeset
110 }
45b1d71110c3 Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8126
diff changeset
111
8125
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
112 Object raw = res.getData();
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
113 if (raw == null) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8174
diff changeset
114 log.warn("No result data.");
8085
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
115 return res;
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
116 }
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
117
8126
353f93d5d9f7 Correctly output problems in SedimentLoadDataCalculate
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8125
diff changeset
118 SedimentLoadDataResult sdRes;
8125
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
119 if (raw instanceof SedimentLoadDataResult) {
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
120 sdRes = (SedimentLoadDataResult) raw;
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
121 } else {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8174
diff changeset
122 log.error ("Unknown result");
8125
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
123 return null;
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
124 }
8133
45b1d71110c3 Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8126
diff changeset
125 String unit = access.getUnit().replace("_per_","/");
8125
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
126
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
127 int i = 0;
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
128 for (Fraction fract: sdRes.getFractions()) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8174
diff changeset
129 log.debug("Adding facet for fraction '" + fract.getName() +
8146
ce35bdf3d750 Let the facet know the period of it's data.
Tom Gottfried <tom@intevation.de>
parents: 8137
diff changeset
130 "' and period '" + fract.getPeriod() + "'");
8174
4b2b7593815c Make sedimentload loadable as old calculation.
Tom Gottfried <tom@intevation.de>
parents: 8173
diff changeset
131 facets.add(new SedimentLoadDataFacet(i, fract.getName(),
8146
ce35bdf3d750 Let the facet know the period of it's data.
Tom Gottfried <tom@intevation.de>
parents: 8137
diff changeset
132 unit, fract.getPeriod(),
ce35bdf3d750 Let the facet know the period of it's data.
Tom Gottfried <tom@intevation.de>
parents: 8137
diff changeset
133 ComputeType.ADVANCE, id, hash, context));
8174
4b2b7593815c Make sedimentload loadable as old calculation.
Tom Gottfried <tom@intevation.de>
parents: 8173
diff changeset
134 i++;
8125
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
135 }
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
136
8133
45b1d71110c3 Correctly handle not creating facets and error reports.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8126
diff changeset
137 facets.add(
8125
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
138 new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id));
f01c65261963 (issue1448) Add WIP SedimentLoadDataFacet and use it in calculation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 8085
diff changeset
139
8085
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
140 return res;
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
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
143 }
75e62ea0e307 Added the broken calculation state of the new sediment load calc.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
144 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org