[PATCH 1 of 2] work on u-info/s-info states
Wald Commits
scm-commit at wald.intevation.org
Mon Apr 30 18:09:10 CEST 2018
# HG changeset patch
# User gernotbelger
# Date 1525104182 -7200
# Node ID c265c9fc915c55bb34fb4ed490ed837c2489b40f
# Parent 8aa7d9eaaa218b85dbed2b8b9d4775ef0da94332
work on u-info/s-info states
diff -r 8aa7d9eaaa21 -r c265c9fc915c artifacts/doc/conf/artifacts/sinfo.xml
--- a/artifacts/doc/conf/artifacts/sinfo.xml Mon Apr 30 10:13:15 2018 +0200
+++ b/artifacts/doc/conf/artifacts/sinfo.xml Mon Apr 30 18:03:02 2018 +0200
@@ -213,6 +213,32 @@
</outputmodes>
</state>
+
+
+
+ <!-- Calculation Mode: Grundberührungen -->
+
+ <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"/>
+ </transition>
+
+
+
+ <!-- Calculation Mode: Überflutungsdauern Infrastrukturen BWaStr -->
+
+ <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_infrastructures_inundation_duration" operator="equal"/>
+ </transition>
+
+ <state id="state.sinfo.wspl" description="state.sinfo.wspl" state="org.dive4elements.river.artifacts.sinfo.inundation.WsplChoice" helpText="help.state.sinfo.wspl">
+ <data name="wspl" type="Boolean"/>
+ </state>
+
+
<!-- Calculation Mode: Transportkörperhöhen -->
<transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
<from state="state.sinfo.calculation_mode"/>
diff -r 8aa7d9eaaa21 -r c265c9fc915c artifacts/doc/conf/artifacts/uinfo.xml
--- a/artifacts/doc/conf/artifacts/uinfo.xml Mon Apr 30 10:13:15 2018 +0200
+++ b/artifacts/doc/conf/artifacts/uinfo.xml Mon Apr 30 18:03:02 2018 +0200
@@ -21,20 +21,54 @@
<data name="calculation_mode" type="String" />
</state>
+ <state id="state.uinfo.distance_only" description="state.uinfo.distance_only" state="org.dive4elements.river.artifacts.states.DistanceOnlySelect" helpText="help.state.uinfo.distance_only">
+ <data name="ld_from" type="Double"/>
+ <data name="ld_to" type="Double"/>
+ </state>
+
+ <!-- Calculation Mode: Salix Linie -->
+
+ <transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
+ <from state="state.uinfo.calculation_mode"/>
+ <to state="state.uinfo.distance_only"/>
+ <condition data="calculation_mode" value="uinfo_salix_line" operator="equal"/>
+ </transition>
+
- <!-- Calculation Mode: Salix Linie -->
- <transition
- transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
- <from state="state.uinfo.calculation_mode" />
- <to state="state.uinfo.salix_line" />
- <condition data="calculation_mode" value="uinfo_salix_line"
- operator="equal" />
- <to state="state.sinfo.distance_only" /> <!-- TODO: KLONEN und U-Info daraus machen -->
- </transition>
-
+ <transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
+ <from state="state.uinfo.distance_only"/>
+ <to state="state.uinfo.use_scenario"/>
+ <condition data="calculation_mode" value="uinfo_salix_line" operator="equal"/>
+ </transition>
+
+
+ <state id="state.uinfo.use_scenario" description="state.uinfo.use_scenario" state="org.dive4elements.river.artifacts.uinfo.salix.UseScenarioChoice" helpText="help.state.uinfo.use_scenario">
+ <data name="use_scenario" type="Boolean"/>
+ </state>
+
+ <transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
+ <from state="state.uinfo.use_scenario"/>
+ <to state="state.uinfo.scenario_type"/>
+ <condition data="calculation_mode" value="uinfo_salix_line" operator="equal"/>
+ </transition>
+ <!-- FIXME: der State soll nur angezeigt werden, wenn zuvor bei Szenario-Betrachtung "Ja" angeklickt wurde... -->
+ <state id="state.uinfo.scenario_type" description="state.uinfo.scenario_type" state="org.dive4elements.river.artifacts.uinfo.salix.ScenarioTypeState" helpText="help.state.uinfo.scenario_type">
+ <!--Probleme, wenn, der DefaultState genommen wird! <data name="scenario_type" type="Integer"/> -->
+ <data name ="test" type ="String" />
+ </state>
+
+
+
+ <transition transition="org.dive4elements.river.artifacts.transitions.DefaultTransition">
+ <from state="state.uinfo.scenario_type"/>
+ <to state="state.uinfo.salix_line"/>
+ <!-- condition data="calculation_mode" value="uinfo_salix_line" operator="equal"/> -->
+ </transition>
+
+
<state id="state.uinfo.salix_line"
description="state.uinfo.salix_line"
state="org.dive4elements.river.artifacts.uinfo.salix.SalixLineState"
@@ -73,6 +107,13 @@
+
+
+
+
+
+
+
<!-- Calculation Mode: Vegetation Zones -->
<transition
transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
@@ -80,7 +121,7 @@
<to state="state.uinfo.vegetation_zones" />
<condition data="calculation_mode"
value="uinfo_vegetation_zones" operator="equal" />
- <to state="state.sinfo.distance_only" /> <!-- TODO: KLONEN und U-Info daraus machen -->
+
</transition>
<state id="state.uinfo.vegetation_zones"
@@ -126,7 +167,7 @@
<to state="state.uinfo.inundation_duration" />
<condition data="calculation_mode"
value="uinfo_inundation_duration" operator="equal" />
- <to state="state.sinfo.distance_only" /> <!-- TODO: KLONEN und U-Info daraus machen -->
+
</transition>
<state id="state.uinfo.inundation_duration"
diff -r 8aa7d9eaaa21 -r c265c9fc915c artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/WsplChoice.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/WsplChoice.java Mon Apr 30 18:03:02 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.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("wspl.option", "wspl.active", "wspl.inactive");
+ }
+}
\ No newline at end of file
diff -r 8aa7d9eaaa21 -r c265c9fc915c artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/CalculationSelectUinfo.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/CalculationSelectUinfo.java Mon Apr 30 10:13:15 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/CalculationSelectUinfo.java Mon Apr 30 18:03:02 2018 +0200
@@ -53,9 +53,9 @@
public boolean validate(final Artifact artifact) throws IllegalArgumentException {
log.debug("CalculationSelect.validate");
- final UINFOArtifact sinfo = (UINFOArtifact) artifact;
+ final UINFOArtifact uinfo = (UINFOArtifact) artifact;
/* throws an exception if calculation mode is invalid */
- sinfo.getCalculationMode();
+ uinfo.getCalculationMode();
return true;
}
}
\ No newline at end of file
diff -r 8aa7d9eaaa21 -r c265c9fc915c artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/UINFOArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/UINFOArtifact.java Mon Apr 30 10:13:15 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/UINFOArtifact.java Mon Apr 30 18:03:02 2018 +0200
@@ -10,78 +10,72 @@
package org.dive4elements.river.artifacts.uinfo;
import org.apache.commons.lang.StringUtils;
-import org.dive4elements.artifactdatabase.state.Facet;
import org.dive4elements.artifactdatabase.state.FacetActivity;
-import org.dive4elements.artifacts.Artifact;
import org.dive4elements.river.artifacts.D4EArtifact;
/**
- * The default SINFO artifact.
+ * The default UINFO artifact.
*
* @author Gernot Belger
*/
public class UINFOArtifact extends D4EArtifact {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- /** Error message that is thrown if no mode has been chosen. */
- private static final String ERROR_NO_CALCULATION_MODE = "error_feed_no_calculation_mode";
+ /** Error message that is thrown if no mode has been chosen. */
+ private static final String ERROR_NO_CALCULATION_MODE = "error_feed_no_calculation_mode";
- /**
- * Error message that is thrown if an invalid calculation mode has been chosen.
- */
- private static final String ERROR_INVALID_CALCULATION_MODE = "error_feed_invalid_calculation_mode";
+ /**
+ * Error message that is thrown if an invalid calculation mode has been chosen.
+ */
+ private static final String ERROR_INVALID_CALCULATION_MODE = "error_feed_invalid_calculation_mode";
- /** The name of the artifact. */
- private static final String ARTIFACT_NAME = "uinfo";
+ /** The name of the artifact. */
+ private static final String ARTIFACT_NAME = "uinfo";
- private static final String FIELD_RIVER = "river";
+ private static final String FIELD_RIVER = "river";
- private static final String FIELD_MODE = "calculation_mode";
+ private static final String FIELD_MODE = "calculation_mode";
- static {
- // Active/deactivate facets.
- // BEWARE: we can only define one activity for "sinfo", so we use the artifact
- // as place for this
- FacetActivity.Registry.getInstance().register(ARTIFACT_NAME, new FacetActivity() {
- @Override
- public Boolean isInitialActive(final Artifact artifact, final Facet facet, final String output) {
- return null;
- }
- });
- }
+ static {
+ // Active/deactivate facets.
+ // BEWARE: we can only define one activity for "sinfo", so we use the artifact
+ // as place for this
+ FacetActivity.Registry.getInstance().register(ARTIFACT_NAME, (artifact, facet, output) -> null);
+ }
- /**
- * Default constructor, because it's serializable.
- */
- public UINFOArtifact() {
- }
+ /**
+ * Default constructor, because it's serializable.
+ */
+ public UINFOArtifact() {
+ }
- /**
- * Returns the name of the concrete artifact.
- *
- * @return the name of the concrete artifact.
- */
- @Override
- public String getName() {
- return ARTIFACT_NAME;
- }
+ /**
+ * Returns the name of the concrete artifact.
+ *
+ * @return the name of the concrete artifact.
+ */
+ @Override
+ public String getName() {
+ return ARTIFACT_NAME;
+ }
- public UinfoCalcMode getCalculationMode() {
+ public UinfoCalcMode getCalculationMode() {
- final String calc = getDataAsString(FIELD_MODE);
- if (calc == null) {
- throw new IllegalArgumentException(ERROR_NO_CALCULATION_MODE);
- }
+ final String calc = getDataAsString(FIELD_MODE);
+ if (calc == null) {
+ throw new IllegalArgumentException(ERROR_NO_CALCULATION_MODE);
+ }
- try {
- return UinfoCalcMode.valueOf(StringUtils.trimToEmpty(calc).toLowerCase());
- } catch (final Exception e) {
- throw new IllegalArgumentException(ERROR_INVALID_CALCULATION_MODE, e);
- }
- }
+ try {
+ return UinfoCalcMode.valueOf(StringUtils.trimToEmpty(calc).toLowerCase());
+ }
+ catch (final Exception e) {
+ throw new IllegalArgumentException(ERROR_INVALID_CALCULATION_MODE, e);
+ }
+ }
- public String getRiver() {
- return getDataAsString(FIELD_RIVER);
- }
+ public String getRiver() {
+ return getDataAsString(FIELD_RIVER);
+ }
}
\ No newline at end of file
diff -r 8aa7d9eaaa21 -r c265c9fc915c artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/ScenarioTypeState.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/ScenarioTypeState.java Mon Apr 30 18:03:02 2018 +0200
@@ -0,0 +1,17 @@
+
+package org.dive4elements.river.artifacts.uinfo.salix;
+
+import org.dive4elements.river.artifacts.states.BooleanChoiceState;
+
+/**
+ * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
+ */
+public class ScenarioTypeState extends BooleanChoiceState {
+
+ private static final long serialVersionUID = 1L;
+
+ public ScenarioTypeState() {
+ super("activeMsg1", "activeMsg2", "activeMsg3"); // kriege den state irgendwie nicht selbst hin
+ }
+
+}
\ No newline at end of file
diff -r 8aa7d9eaaa21 -r c265c9fc915c artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/UseScenarioChoice.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/UseScenarioChoice.java Mon Apr 30 18:03:02 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.uinfo.salix;
+
+import org.dive4elements.river.artifacts.states.BooleanChoiceState;
+
+/**
+ * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
+ */
+public class UseScenarioChoice extends BooleanChoiceState {
+
+ private static final long serialVersionUID = 1L;
+
+ public UseScenarioChoice() {
+ super("useScenario.option", "useScenario.active", "useScenario.inactive");
+ }
+}
\ No newline at end of file
diff -r 8aa7d9eaaa21 -r c265c9fc915c artifacts/src/main/resources/messages.properties
--- a/artifacts/src/main/resources/messages.properties Mon Apr 30 10:13:15 2018 +0200
+++ b/artifacts/src/main/resources/messages.properties Mon Apr 30 18:03:02 2018 +0200
@@ -833,6 +833,10 @@
state.sinfo.flowdepthdevlopment_historical_select = Historisches Differenzenpaar
help.state.sinfo.flowdepthdevlopment_historical_select = ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.flowdepthdevlopment_historical_select
+state.sinfo.wspl = Wasserspiegellagen
+state.sinfo.wspl.option = Wasserspiegellagen zus\u00e4tzlich darstellen?
+help.state.sinfo.wspl= ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.wspl
+
sinfo.export.flow_depth.csv.meta.header.result = ## {0} - {1} - {2}
sinfo.export.flow_depth.csv.meta.header.result.label = Calculation Output
sinfo.export.flow_depth.csv.meta.version = # {0}: {1}
@@ -985,6 +989,22 @@
flowdepthdevelopmentcalculation.yearDifferenceCurrent = aktuelles Differenzenpaar
flowdepthdevelopmentcalculation.yearDifferenceHistorical = = historisches Differenzenpaar
+state.uinfo.use_scenario=Szenariobetrachtung
+useScenario.option = Zus\u00e4tzlich Szenariobetrachtung miteinbeziehen?
+useScenario.active = Activ
+useScenario.inactive = Inactiv
+help.state.uinfo.use_scenario=${help.url}/OnlineHilfe/UINFO#help.state.uinfo.use_scenario
+
+
+state.uinfo.scenario_type=Auswahl des Szenariotyps
+scenarioType.option1 = Regional wirkende Eingriffe
+scenarioType.option2 = \u00dcberregional wirkende Eingriffe
+scenarioType.option1 = Historische Betrachtung
+help.state.uinfo.scenario_type=${help.url}/OnlineHilfe/UINFO#help.state.uinfo.scenario_type
+
+state.uinfo.distance_only = Range selection
+help.state.uinfo.distance_only = ${help.url}/OnlineHilfe/UINFO#help.state.uinfo.distance_only
+
uinfo_salix_line = Salix-Linie
uinfo_inundation_duration = \u00dcberflutungsdauern Aue
uinfo_vegetation_zones = Vegetationszonen
diff -r 8aa7d9eaaa21 -r c265c9fc915c artifacts/src/main/resources/messages_de.properties
--- a/artifacts/src/main/resources/messages_de.properties Mon Apr 30 10:13:15 2018 +0200
+++ b/artifacts/src/main/resources/messages_de.properties Mon Apr 30 18:03:02 2018 +0200
@@ -833,6 +833,10 @@
state.sinfo.flowdepthdevlopment_historical_select = Historisches Differenzenpaar
help.state.sinfo.flowdepthdevlopment_historical_select = ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.flowdepthdevlopment_historical_select
+state.sinfo.wspl = Wasserspiegellagen
+state.sinfo.wspl.option = Wasserspiegellagen zus\u00e4tzlich darstellen?
+help.state.sinfo.wspl= ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.wspl
+
sinfo.export.flow_depth.csv.meta.header.result = ##{0} - {1} - {2}
sinfo.export.flow_depth.csv.meta.header.result.label = Ergebnisausgabe
sinfo.export.flow_depth.csv.meta.version = # {0}: {1}
@@ -985,6 +989,16 @@
flowdepthdevelopmentcalculation.yearDifferenceCurrent = aktuelles Differenzenpaar
flowdepthdevelopmentcalculation.yearDifferenceHistorical = = historisches Differenzenpaar
+state.uinfo.use_scenario=Szenariobetrachtung
+useScenario.option = Zus\u00e4tzlich Szenariobetrachtung miteinbeziehen?
+useScenario.active = Ja
+useScenario.inactive = Nein
+help.state.uinfo.use_scenario=${help.url}/OnlineHilfe/UINFO#help.state.uinfo.use_scenario
+
+state.uinfo.distance_only = Wahl der Berechnungsstrecke
+help.state.uinfo.distance_only = ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.distance_only
+
+
uinfo_salix_line = Salix-Linie
uinfo_inundation_duration = \u00dcberflutungsdauern Aue
uinfo_vegetation_zones = Vegetationszonen
diff -r 8aa7d9eaaa21 -r c265c9fc915c gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties Mon Apr 30 10:13:15 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties Mon Apr 30 18:03:02 2018 +0200
@@ -14,7 +14,7 @@
projectlist_creationTime = Anlegezeitpunkt
projectlist_title = Titel
projectlist_favorite = Dauerhaft
-projectlist_close = Schlie\u1e9een
+projectlist_close = Schlie\u00dfen
really_delete = Wollen Sie dieses Projekt wirklich l\u00f6schen?
project_name_too_long = Der eingegebene Projektname ist zu lang. Die maximale L\u00e4nge betr\u00e4gt $LEN Zeichen.
switch_language = Englisch
More information about the Dive4Elements-commits
mailing list