[PATCH] rename grounding->collision; inundation_duration->flood_duration
Wald Commits
scm-commit at wald.intevation.org
Fri May 4 13:36:09 CEST 2018
# HG changeset patch
# User gernotbelger
# Date 1525433761 -7200
# Node ID 95643dffd006411eef111c0a2b9321ed3dd1c708
# Parent ad2ae847e10e5d3fa3ec178a88888c9cd9afa943
rename grounding->collision; inundation_duration->flood_duration
diff -r ad2ae847e10e -r 95643dffd006 artifacts/doc/conf/artifacts/sinfo.xml
--- a/artifacts/doc/conf/artifacts/sinfo.xml Fri May 04 13:17:57 2018 +0200
+++ b/artifacts/doc/conf/artifacts/sinfo.xml Fri May 04 13:36:01 2018 +0200
@@ -221,16 +221,16 @@
<transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
<from state="state.sinfo.calculation_mode"/>
<to state="state.sinfo.distance_only"/>
- <condition data="calculation_mode" value="sinfo_calc_grounding" operator="equal"/>
+ <condition data="calculation_mode" value="sinfo_calc_collision" operator="equal"/>
</transition>
<transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
<from state="state.sinfo.distance_only"/>
<to state="state.sinfo.year"/>
- <condition data="calculation_mode" value="sinfo_calc_grounding" operator="equal"/>
+ <condition data="calculation_mode" value="sinfo_calc_collision" operator="equal"/>
</transition>
- <state id="state.sinfo.year" description="state.sinfo.year" state="org.dive4elements.river.artifacts.sinfo.grounding.YearChoice" helpText="help.state.sinfo.year">
+ <state id="state.sinfo.year" description="state.sinfo.year" state="org.dive4elements.river.artifacts.sinfo.collision.YearChoice" helpText="help.state.sinfo.year">
<data name="year" type="Boolean"/>
</state>
@@ -238,13 +238,13 @@
<transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
<from state="state.sinfo.year"/>
- <to state="state.sinfo.grounding"/>
- <condition data="calculation_mode" value="sinfo_calc_grounding" operator="equal"/>
+ <to state="state.sinfo.collision"/>
+ <condition data="calculation_mode" value="sinfo_calc_collision" operator="equal"/>
</transition>
- <state id="state.sinfo.grounding" description="state.sinfo.grounding" state="org.dive4elements.river.artifacts.sinfo.grounding.GroundingState" helpText="help.state.sinfo.grounding">
+ <state id="state.sinfo.collision" description="state.sinfo.collision" state="org.dive4elements.river.artifacts.sinfo.collision.CollisionState" helpText="help.state.sinfo.collision">
<outputmodes>
- <outputmode name="grounding" description="output.grounding" mime-type="image/png" type="chart">
+ <outputmode name="collision" description="output.collision" mime-type="image/png" type="chart">
<facets>
<!-- REMARK: id's that ends with 'filtered' are handled differently ' -->
<facet name="sinfo_facet_flow_depth.filtered" description="flow depth, filtered by current zoom state"/>
@@ -282,27 +282,27 @@
<transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
<from state="state.sinfo.calculation_mode"/>
<to state="state.sinfo.distance"/>
- <condition data="calculation_mode" value="sinfo_calc_infrastructures_inundation_duration" operator="equal"/>
+ <condition data="calculation_mode" value="sinfo_calc_flood_duration" operator="equal"/>
</transition>
<transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
<from state="state.sinfo.distance"/>
<to state="state.sinfo.riverside"/>
- <condition data="calculation_mode" value="sinfo_calc_infrastructures_inundation_duration" operator="equal"/>
+ <condition data="calculation_mode" value="sinfo_calc_flood_duration" operator="equal"/>
</transition>
- <state id="state.sinfo.riverside" description="state.sinfo.riverside" state="org.dive4elements.river.artifacts.sinfo.inundation.RiversideRadioChoice" helpText="help.state.sinfo.riverside">
+ <state id="state.sinfo.riverside" description="state.sinfo.riverside" state="org.dive4elements.river.artifacts.sinfo.flood_duration.RiversideRadioChoice" helpText="help.state.sinfo.riverside">
<data name="riverside" type="String"/>
</state>
- <state id="state.sinfo.wspl" description="state.sinfo.wspl" state="org.dive4elements.river.artifacts.sinfo.inundation.WsplChoice" helpText="help.state.sinfo.wspl">
+ <state id="state.sinfo.wspl" description="state.sinfo.wspl" state="org.dive4elements.river.artifacts.sinfo.flood_duration.WsplChoice" helpText="help.state.sinfo.wspl">
<data name="wspl" type="Boolean"/>
</state>
<transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
<from state="state.sinfo.riverside"/>
<to state="state.sinfo.wspl"/>
- <condition data="calculation_mode" value="sinfo_calc_infrastructures_inundation_duration" operator="equal"/>
+ <condition data="calculation_mode" value="sinfo_calc_flood_duration" operator="equal"/>
</transition>
@@ -314,21 +314,21 @@
<transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
<from state="state.sinfo.wspl"/>
- <to state="state.sinfo.infrastructures_inundation"/>
+ <to state="state.sinfo.flood_duration"/>
<condition data="wspl" value="false" operator="equal"/>
</transition>
<transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
<from state="state.sinfo.wq"/>
- <to state="state.sinfo.infrastructures_inundation"/>
- <condition data="calculation_mode" value="sinfo_calc_infrastructures_inundation_duration" operator="equal"/>
+ <to state="state.sinfo.flood_duration"/>
+ <condition data="calculation_mode" value="sinfo_calc_flood_duration" operator="equal"/>
</transition>
- <state id="state.sinfo.infrastructures_inundation" description="state.sinfo.infrastructures_inundation" state="org.dive4elements.river.artifacts.sinfo.inundation.InundationState" helpText="help.state.sinfo.infrastructures_inundation">
+ <state id="state.sinfo.flood_duration" description="state.sinfo.flood_duration" state="org.dive4elements.river.artifacts.sinfo.flood_duration.FloodDurationState" helpText="help.state.sinfo.flood_duration">
<outputmodes>
- <outputmode name="infrastructures_inundation" description="output.infrastructures_inundation" mime-type="image/png" type="chart">
+ <outputmode name="flood" description="output.flood" mime-type="image/png" type="chart">
<facets>
<!-- REMARK: id's that ends with 'filtered' are handled differently ' -->
<facet name="sinfo_facet_flow_depth.filtered" description="flow depth, filtered by current zoom state"/>
diff -r ad2ae847e10e -r 95643dffd006 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/SinfoCalcMode.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/SinfoCalcMode.java Fri May 04 13:17:57 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/SinfoCalcMode.java Fri May 04 13:36:01 2018 +0200
@@ -14,7 +14,7 @@
sinfo_calc_flow_depth,
sinfo_calc_flow_depth_development,
sinfo_calc_flow_depth_minmax,
- sinfo_calc_grounding,
+ sinfo_calc_collision,
sinfo_calc_transport_bodies_heights,
- sinfo_calc_infrastructures_inundation_duration
+ sinfo_calc_flood_duration
}
\ No newline at end of file
diff -r ad2ae847e10e -r 95643dffd006 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/CollisionState.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/CollisionState.java Fri May 04 13:36:01 2018 +0200
@@ -0,0 +1,114 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.artifacts.sinfo.collision;
+
+import java.util.List;
+
+import org.dive4elements.artifactdatabase.state.Facet;
+import org.dive4elements.artifacts.CallContext;
+import org.dive4elements.river.artifacts.ChartArtifact;
+import org.dive4elements.river.artifacts.D4EArtifact;
+import org.dive4elements.river.artifacts.model.CalculationResult;
+import org.dive4elements.river.artifacts.model.EmptyFacet;
+import org.dive4elements.river.artifacts.sinfo.SINFOArtifact;
+import org.dive4elements.river.artifacts.states.DefaultState;
+
+/** State in which a waterlevel has been calculated. */
+public class CollisionState extends DefaultState {
+
+ /// ** The log that is used in this state. */
+ // private static Logger log = Logger.getLogger(FlowDepthState.class);
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * From this state can only be continued trivially.
+ */
+ @Override
+ protected String getUIProvider() {
+ return "continue";
+ }
+
+ @Override
+ public Object computeFeed(final D4EArtifact artifact, final String hash, final CallContext context, final List<Facet> facets, final Object old) {
+ if (artifact instanceof ChartArtifact) {
+ facets.add(new EmptyFacet());
+ return null;
+ }
+
+ return compute((SINFOArtifact) artifact, context, hash, facets, old);
+ }
+
+ @Override
+ public Object computeAdvance(final D4EArtifact artifact, final String hash, final CallContext context, final List<Facet> facets, final Object old) {
+ if (artifact instanceof ChartArtifact) {
+ facets.add(new EmptyFacet());
+ return null;
+ }
+ return compute((SINFOArtifact) artifact, context, hash, facets, old);
+ }
+
+ /**
+ * Compute result or returned object from cache, create facets.
+ *
+ * @param old
+ * Object that was cached.
+ */
+ private Object compute(final SINFOArtifact sinfo, final CallContext context, final String hash, final List<Facet> facets, final Object old) {
+
+ final CalculationResult res = doCompute(sinfo, context, old);
+
+ if (facets == null)
+ return res;
+ //
+ // final FlowDepthCalculationResults results = (FlowDepthCalculationResults) res.getData();
+ //
+ // /* add themes for chart, for each result */
+ // final List<FlowDepthCalculationResult> resultList = results.getResults();
+ // for (int index = 0; index < resultList.size(); index++) {
+ //
+ // final FlowDepthCalculationResult result = resultList.get(index);
+ //
+ // /* filtered (zoom dependent mean) flow depth */
+ // facets.add(FlowDepthProcessor.createFlowDepthFilteredFacet(context, hash, this.id, result, index));
+ // facets.add(FlowDepthProcessor.createFlowDepthRawFacet(context, hash, this.id, result, index));
+ //
+ // if (results.isUseTkh()) {
+ // /* filtered (zoom dependent mean) flow depth including tkh */
+ // facets.add(FlowDepthProcessor.createFlowDepthTkhFilteredFacet(context, hash, this.id, result, index));
+ // facets.add(FlowDepthProcessor.createFlowDepthTkhRawFacet(context, hash, this.id, result, index));
+ //
+ // facets.add(TkhProcessor.createTkhFacet(context, hash, this.id, result, index));
+ // }
+ // }
+
+ // if (!resultList.isEmpty()) {
+ // final Facet csv = new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id);
+ // final Facet pdf = new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id);
+ //
+ // facets.add(csv);
+ // facets.add(pdf);
+ // }
+ //
+ // final Calculation report = res.getReport();
+ //
+ // if (report.hasProblems()) {
+ // facets.add(new ReportFacet(ComputeType.ADVANCE, hash, this.id));
+ // }
+
+ return res;
+ }
+
+ private CalculationResult doCompute(final SINFOArtifact sinfo, final CallContext context, final Object old) {
+ if (old instanceof CalculationResult)
+ return (CalculationResult) old;
+
+ return null; // new FlowDepthCalculation(context).calculate(sinfo);
+ }
+}
\ No newline at end of file
diff -r ad2ae847e10e -r 95643dffd006 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/YearChoice.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/YearChoice.java Fri May 04 13:36:01 2018 +0200
@@ -0,0 +1,23 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.artifacts.sinfo.collision;
+
+import org.dive4elements.river.artifacts.states.BooleanChoiceState;
+
+/**
+ * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
+ */
+public class YearChoice extends BooleanChoiceState {
+
+ private static final long serialVersionUID = 1L;
+
+ public YearChoice() {
+ super("option", "active", "inactive"); // TODO: RADIO-Btn-Impl
+ }
+}
\ No newline at end of file
diff -r ad2ae847e10e -r 95643dffd006 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationState.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationState.java Fri May 04 13:36:01 2018 +0200
@@ -0,0 +1,114 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.artifacts.sinfo.flood_duration;
+
+import java.util.List;
+
+import org.dive4elements.artifactdatabase.state.Facet;
+import org.dive4elements.artifacts.CallContext;
+import org.dive4elements.river.artifacts.ChartArtifact;
+import org.dive4elements.river.artifacts.D4EArtifact;
+import org.dive4elements.river.artifacts.model.CalculationResult;
+import org.dive4elements.river.artifacts.model.EmptyFacet;
+import org.dive4elements.river.artifacts.sinfo.SINFOArtifact;
+import org.dive4elements.river.artifacts.states.DefaultState;
+
+/** State in which a waterlevel has been calculated. */
+public class FloodDurationState extends DefaultState {
+
+ /// ** The log that is used in this state. */
+ // private static Logger log = Logger.getLogger(FlowDepthState.class);
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * From this state can only be continued trivially.
+ */
+ @Override
+ protected String getUIProvider() {
+ return "continue";
+ }
+
+ @Override
+ public Object computeFeed(final D4EArtifact artifact, final String hash, final CallContext context, final List<Facet> facets, final Object old) {
+ if (artifact instanceof ChartArtifact) {
+ facets.add(new EmptyFacet());
+ return null;
+ }
+
+ return compute((SINFOArtifact) artifact, context, hash, facets, old);
+ }
+
+ @Override
+ public Object computeAdvance(final D4EArtifact artifact, final String hash, final CallContext context, final List<Facet> facets, final Object old) {
+ if (artifact instanceof ChartArtifact) {
+ facets.add(new EmptyFacet());
+ return null;
+ }
+ return compute((SINFOArtifact) artifact, context, hash, facets, old);
+ }
+
+ /**
+ * Compute result or returned object from cache, create facets.
+ *
+ * @param old
+ * Object that was cached.
+ */
+ private Object compute(final SINFOArtifact sinfo, final CallContext context, final String hash, final List<Facet> facets, final Object old) {
+
+ final CalculationResult res = doCompute(sinfo, context, old);
+
+ if (facets == null)
+ return res;
+ //
+ // final FlowDepthCalculationResults results = (FlowDepthCalculationResults) res.getData();
+ //
+ // /* add themes for chart, for each result */
+ // final List<FlowDepthCalculationResult> resultList = results.getResults();
+ // for (int index = 0; index < resultList.size(); index++) {
+ //
+ // final FlowDepthCalculationResult result = resultList.get(index);
+ //
+ // /* filtered (zoom dependent mean) flow depth */
+ // facets.add(FlowDepthProcessor.createFlowDepthFilteredFacet(context, hash, this.id, result, index));
+ // facets.add(FlowDepthProcessor.createFlowDepthRawFacet(context, hash, this.id, result, index));
+ //
+ // if (results.isUseTkh()) {
+ // /* filtered (zoom dependent mean) flow depth including tkh */
+ // facets.add(FlowDepthProcessor.createFlowDepthTkhFilteredFacet(context, hash, this.id, result, index));
+ // facets.add(FlowDepthProcessor.createFlowDepthTkhRawFacet(context, hash, this.id, result, index));
+ //
+ // facets.add(TkhProcessor.createTkhFacet(context, hash, this.id, result, index));
+ // }
+ // }
+
+ // if (!resultList.isEmpty()) {
+ // final Facet csv = new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id);
+ // final Facet pdf = new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id);
+ //
+ // facets.add(csv);
+ // facets.add(pdf);
+ // }
+ //
+ // final Calculation report = res.getReport();
+ //
+ // if (report.hasProblems()) {
+ // facets.add(new ReportFacet(ComputeType.ADVANCE, hash, this.id));
+ // }
+
+ return res;
+ }
+
+ private CalculationResult doCompute(final SINFOArtifact sinfo, final CallContext context, final Object old) {
+ if (old instanceof CalculationResult)
+ return (CalculationResult) old;
+
+ return null; // new FlowDepthCalculation(context).calculate(sinfo);
+ }
+}
\ No newline at end of file
diff -r ad2ae847e10e -r 95643dffd006 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/RiversideRadioChoice.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/RiversideRadioChoice.java Fri May 04 13:36:01 2018 +0200
@@ -0,0 +1,36 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.artifacts.sinfo.flood_duration;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.dive4elements.river.artifacts.states.RadioSelect;
+
+/**
+ * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
+ */
+public class RiversideRadioChoice extends RadioSelect {
+ private static final long serialVersionUID = 1L;
+
+ public RiversideRadioChoice() {
+ super();
+ }
+
+ @Override
+ protected List<String> makeEntries() {
+ final List<String> entries = new ArrayList<>();
+ entries.add("state.sinfo.riverside.left");
+ entries.add("state.sinfo.riverside.right");
+ entries.add("state.sinfo.riverside.both");
+ return entries;
+
+ }
+
+}
\ No newline at end of file
diff -r ad2ae847e10e -r 95643dffd006 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/WqinputChoice.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/WqinputChoice.java Fri May 04 13:36:01 2018 +0200
@@ -0,0 +1,23 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.artifacts.sinfo.flood_duration;
+
+import org.dive4elements.river.artifacts.states.BooleanChoiceState;
+
+/**
+ * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
+ */
+public class WqinputChoice extends BooleanChoiceState {
+
+ private static final long serialVersionUID = 1L;
+
+ public WqinputChoice() {
+ super("state.sinfo.wqinput.option", "wspl.active", "wspl.inactive");
+ }
+}
\ No newline at end of file
diff -r ad2ae847e10e -r 95643dffd006 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/WsplChoice.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/WsplChoice.java Fri May 04 13:36:01 2018 +0200
@@ -0,0 +1,23 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.artifacts.sinfo.flood_duration;
+
+import org.dive4elements.river.artifacts.states.BooleanChoiceState;
+
+/**
+ * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
+ */
+public class WsplChoice extends BooleanChoiceState {
+
+ private static final long serialVersionUID = 1L;
+
+ public WsplChoice() {
+ super("state.sinfo.wspl.option", "state.sinfo.wspl.active", "state.sinfo.wspl.inactive");
+ }
+}
\ No newline at end of file
diff -r ad2ae847e10e -r 95643dffd006 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/grounding/GroundingState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/grounding/GroundingState.java Fri May 04 13:17:57 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU AGPL (>=v3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out the
- * documentation coming with Dive4Elements River for details.
- */
-
-package org.dive4elements.river.artifacts.sinfo.grounding;
-
-import java.util.List;
-
-import org.dive4elements.artifactdatabase.state.Facet;
-import org.dive4elements.artifacts.CallContext;
-import org.dive4elements.river.artifacts.ChartArtifact;
-import org.dive4elements.river.artifacts.D4EArtifact;
-import org.dive4elements.river.artifacts.model.CalculationResult;
-import org.dive4elements.river.artifacts.model.EmptyFacet;
-import org.dive4elements.river.artifacts.sinfo.SINFOArtifact;
-import org.dive4elements.river.artifacts.states.DefaultState;
-
-/** State in which a waterlevel has been calculated. */
-public class GroundingState extends DefaultState {
-
- /// ** The log that is used in this state. */
- // private static Logger log = Logger.getLogger(FlowDepthState.class);
-
- private static final long serialVersionUID = 1L;
-
- /**
- * From this state can only be continued trivially.
- */
- @Override
- protected String getUIProvider() {
- return "continue";
- }
-
- @Override
- public Object computeFeed(final D4EArtifact artifact, final String hash, final CallContext context, final List<Facet> facets, final Object old) {
- if (artifact instanceof ChartArtifact) {
- facets.add(new EmptyFacet());
- return null;
- }
-
- return compute((SINFOArtifact) artifact, context, hash, facets, old);
- }
-
- @Override
- public Object computeAdvance(final D4EArtifact artifact, final String hash, final CallContext context, final List<Facet> facets, final Object old) {
- if (artifact instanceof ChartArtifact) {
- facets.add(new EmptyFacet());
- return null;
- }
- return compute((SINFOArtifact) artifact, context, hash, facets, old);
- }
-
- /**
- * Compute result or returned object from cache, create facets.
- *
- * @param old
- * Object that was cached.
- */
- private Object compute(final SINFOArtifact sinfo, final CallContext context, final String hash, final List<Facet> facets, final Object old) {
-
- final CalculationResult res = doCompute(sinfo, context, old);
-
- if (facets == null)
- return res;
- //
- // final FlowDepthCalculationResults results = (FlowDepthCalculationResults) res.getData();
- //
- // /* add themes for chart, for each result */
- // final List<FlowDepthCalculationResult> resultList = results.getResults();
- // for (int index = 0; index < resultList.size(); index++) {
- //
- // final FlowDepthCalculationResult result = resultList.get(index);
- //
- // /* filtered (zoom dependent mean) flow depth */
- // facets.add(FlowDepthProcessor.createFlowDepthFilteredFacet(context, hash, this.id, result, index));
- // facets.add(FlowDepthProcessor.createFlowDepthRawFacet(context, hash, this.id, result, index));
- //
- // if (results.isUseTkh()) {
- // /* filtered (zoom dependent mean) flow depth including tkh */
- // facets.add(FlowDepthProcessor.createFlowDepthTkhFilteredFacet(context, hash, this.id, result, index));
- // facets.add(FlowDepthProcessor.createFlowDepthTkhRawFacet(context, hash, this.id, result, index));
- //
- // facets.add(TkhProcessor.createTkhFacet(context, hash, this.id, result, index));
- // }
- // }
-
- // if (!resultList.isEmpty()) {
- // final Facet csv = new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id);
- // final Facet pdf = new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id);
- //
- // facets.add(csv);
- // facets.add(pdf);
- // }
- //
- // final Calculation report = res.getReport();
- //
- // if (report.hasProblems()) {
- // facets.add(new ReportFacet(ComputeType.ADVANCE, hash, this.id));
- // }
-
- return res;
- }
-
- private CalculationResult doCompute(final SINFOArtifact sinfo, final CallContext context, final Object old) {
- if (old instanceof CalculationResult)
- return (CalculationResult) old;
-
- return null; // new FlowDepthCalculation(context).calculate(sinfo);
- }
-}
\ No newline at end of file
diff -r ad2ae847e10e -r 95643dffd006 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/grounding/YearChoice.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/grounding/YearChoice.java Fri May 04 13:17:57 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU AGPL (>=v3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out the
- * documentation coming with Dive4Elements River for details.
- */
-
-package org.dive4elements.river.artifacts.sinfo.grounding;
-
-import org.dive4elements.river.artifacts.states.BooleanChoiceState;
-
-/**
- * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
- */
-public class YearChoice extends BooleanChoiceState {
-
- private static final long serialVersionUID = 1L;
-
- public YearChoice() {
- super("option", "active", "inactive"); // TODO: RADIO-Btn-Impl
- }
-}
\ No newline at end of file
diff -r ad2ae847e10e -r 95643dffd006 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/InundationState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/InundationState.java Fri May 04 13:17:57 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU AGPL (>=v3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out the
- * documentation coming with Dive4Elements River for details.
- */
-
-package org.dive4elements.river.artifacts.sinfo.inundation;
-
-import java.util.List;
-
-import org.dive4elements.artifactdatabase.state.Facet;
-import org.dive4elements.artifacts.CallContext;
-import org.dive4elements.river.artifacts.ChartArtifact;
-import org.dive4elements.river.artifacts.D4EArtifact;
-import org.dive4elements.river.artifacts.model.CalculationResult;
-import org.dive4elements.river.artifacts.model.EmptyFacet;
-import org.dive4elements.river.artifacts.sinfo.SINFOArtifact;
-import org.dive4elements.river.artifacts.states.DefaultState;
-
-/** State in which a waterlevel has been calculated. */
-public class InundationState extends DefaultState {
-
- /// ** The log that is used in this state. */
- // private static Logger log = Logger.getLogger(FlowDepthState.class);
-
- private static final long serialVersionUID = 1L;
-
- /**
- * From this state can only be continued trivially.
- */
- @Override
- protected String getUIProvider() {
- return "continue";
- }
-
- @Override
- public Object computeFeed(final D4EArtifact artifact, final String hash, final CallContext context, final List<Facet> facets, final Object old) {
- if (artifact instanceof ChartArtifact) {
- facets.add(new EmptyFacet());
- return null;
- }
-
- return compute((SINFOArtifact) artifact, context, hash, facets, old);
- }
-
- @Override
- public Object computeAdvance(final D4EArtifact artifact, final String hash, final CallContext context, final List<Facet> facets, final Object old) {
- if (artifact instanceof ChartArtifact) {
- facets.add(new EmptyFacet());
- return null;
- }
- return compute((SINFOArtifact) artifact, context, hash, facets, old);
- }
-
- /**
- * Compute result or returned object from cache, create facets.
- *
- * @param old
- * Object that was cached.
- */
- private Object compute(final SINFOArtifact sinfo, final CallContext context, final String hash, final List<Facet> facets, final Object old) {
-
- final CalculationResult res = doCompute(sinfo, context, old);
-
- if (facets == null)
- return res;
- //
- // final FlowDepthCalculationResults results = (FlowDepthCalculationResults) res.getData();
- //
- // /* add themes for chart, for each result */
- // final List<FlowDepthCalculationResult> resultList = results.getResults();
- // for (int index = 0; index < resultList.size(); index++) {
- //
- // final FlowDepthCalculationResult result = resultList.get(index);
- //
- // /* filtered (zoom dependent mean) flow depth */
- // facets.add(FlowDepthProcessor.createFlowDepthFilteredFacet(context, hash, this.id, result, index));
- // facets.add(FlowDepthProcessor.createFlowDepthRawFacet(context, hash, this.id, result, index));
- //
- // if (results.isUseTkh()) {
- // /* filtered (zoom dependent mean) flow depth including tkh */
- // facets.add(FlowDepthProcessor.createFlowDepthTkhFilteredFacet(context, hash, this.id, result, index));
- // facets.add(FlowDepthProcessor.createFlowDepthTkhRawFacet(context, hash, this.id, result, index));
- //
- // facets.add(TkhProcessor.createTkhFacet(context, hash, this.id, result, index));
- // }
- // }
-
- // if (!resultList.isEmpty()) {
- // final Facet csv = new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id);
- // final Facet pdf = new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id);
- //
- // facets.add(csv);
- // facets.add(pdf);
- // }
- //
- // final Calculation report = res.getReport();
- //
- // if (report.hasProblems()) {
- // facets.add(new ReportFacet(ComputeType.ADVANCE, hash, this.id));
- // }
-
- return res;
- }
-
- private CalculationResult doCompute(final SINFOArtifact sinfo, final CallContext context, final Object old) {
- if (old instanceof CalculationResult)
- return (CalculationResult) old;
-
- return null; // new FlowDepthCalculation(context).calculate(sinfo);
- }
-}
\ No newline at end of file
diff -r ad2ae847e10e -r 95643dffd006 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/RiversideRadioChoice.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/RiversideRadioChoice.java Fri May 04 13:17:57 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU AGPL (>=v3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out the
- * documentation coming with Dive4Elements River for details.
- */
-
-package org.dive4elements.river.artifacts.sinfo.inundation;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.dive4elements.river.artifacts.states.RadioSelect;
-
-/**
- * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
- */
-public class RiversideRadioChoice extends RadioSelect {
- private static final long serialVersionUID = 1L;
-
- public RiversideRadioChoice() {
- super();
- }
-
- @Override
- protected List<String> makeEntries() {
- final List<String> entries = new ArrayList<>();
- entries.add("state.sinfo.riverside.left");
- entries.add("state.sinfo.riverside.right");
- entries.add("state.sinfo.riverside.both");
- return entries;
-
- }
-
-}
\ No newline at end of file
diff -r ad2ae847e10e -r 95643dffd006 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/WqinputChoice.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/WqinputChoice.java Fri May 04 13:17:57 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU AGPL (>=v3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out the
- * documentation coming with Dive4Elements River for details.
- */
-
-package org.dive4elements.river.artifacts.sinfo.inundation;
-
-import org.dive4elements.river.artifacts.states.BooleanChoiceState;
-
-/**
- * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
- */
-public class WqinputChoice extends BooleanChoiceState {
-
- private static final long serialVersionUID = 1L;
-
- public WqinputChoice() {
- super("state.sinfo.wqinput.option", "wspl.active", "wspl.inactive");
- }
-}
\ No newline at end of file
diff -r ad2ae847e10e -r 95643dffd006 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/WsplChoice.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/WsplChoice.java Fri May 04 13:17:57 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU AGPL (>=v3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out the
- * documentation coming with Dive4Elements River for details.
- */
-
-package org.dive4elements.river.artifacts.sinfo.inundation;
-
-import org.dive4elements.river.artifacts.states.BooleanChoiceState;
-
-/**
- * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
- */
-public class WsplChoice extends BooleanChoiceState {
-
- private static final long serialVersionUID = 1L;
-
- public WsplChoice() {
- super("state.sinfo.wspl.option", "state.sinfo.wspl.active", "state.sinfo.wspl.inactive");
- }
-}
\ No newline at end of file
diff -r ad2ae847e10e -r 95643dffd006 gwt-client/src/test/java/test/TestMain.java
--- a/gwt-client/src/test/java/test/TestMain.java Fri May 04 13:17:57 2018 +0200
+++ b/gwt-client/src/test/java/test/TestMain.java Fri May 04 13:36:01 2018 +0200
@@ -27,9 +27,9 @@
* sinfo_calc_flow_depth
* sinfo_calc_flow_depth_development
* sinfo_calc_flow_depth_minmax
- * sinfo_calc_grounding
+ * sinfo_calc_collision
* Transportkörperhöhen
- * sinfo_calc_infrastructures_inundation_duration
+ * sinfo_calc_flood_duration
*/
final SinfoTest proof = new SinfoTest("belger", "belger", "sinfo", "sinfo_calc_flow_depth_minmax");
More information about the Dive4Elements-commits
mailing list