Mercurial > dive4elements > river
changeset 3629:f3717e625b0a
MINFO: Added states and config for bed quality calculation.
flys-artifacts/trunk@5328 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 31 Aug 2012 11:26:49 +0000 |
parents | 7467b091fb8e |
children | 28be160b5870 |
files | flys-artifacts/ChangeLog flys-artifacts/doc/conf/artifacts/minfo.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/BedQualityState.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/CharDiameter.java |
diffstat | 4 files changed, 141 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Fri Aug 31 11:23:32 2012 +0000 +++ b/flys-artifacts/ChangeLog Fri Aug 31 11:26:49 2012 +0000 @@ -1,3 +1,12 @@ +2012-08-31 Raimund Renkert <raimund.renkert@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/states/minfo/BedQualityState.java, + src/main/java/de/intevation/flys/artifacts/states/minfo/CharDiameter.java: + New. States for minfo bed quality calculation. + + * doc/conf/artifacts/minfo.xml: + Added states and transitions for minfo bed quality calculation. + 2012-08-31 Raimund Renkert <raimund.renkert@intevation.de> * src/main/java/de/intevation/flys/artifacts/states/LocationDistanceSelect.java:
--- a/flys-artifacts/doc/conf/artifacts/minfo.xml Fri Aug 31 11:23:32 2012 +0000 +++ b/flys-artifacts/doc/conf/artifacts/minfo.xml Fri Aug 31 11:26:49 2012 +0000 @@ -39,6 +39,12 @@ <condition data="calculation_mode" value="calc.bed.diff" operator="equal"/> </transition> + <transition transition="de.intevation.flys.artifacts.transitions.ValueCompareTransition"> + <from state="state.minfo.calculation_mode"/> + <to state="state.minfo.bed.location"/> + <condition data="calculation_mode" value="calc.bed.quality" operator="equal"/> + </transition> + <state id="state.minfo.distance_only" description="state.minfo.distance_only" state="de.intevation.flys.artifacts.states.DistanceOnlySelect" helpText="help.minfo.distance"> <data name="ld_from" type="Double" /> <data name="ld_to" type="Double" /> @@ -52,6 +58,14 @@ <data name="ld_locations" type="double"/> </state> + <state id="state.minfo.bed.location" description="state.minfo.bed.location" state="de.intevation.flys.artifacts.states.LocationDistanceSelect" helpText="help.minfo.bed.loaction"> + <data name="ld_mode" type="String" /> + <data name="ld_locations" type="Double[]" /> + <data name="ld_from" type="Double" /> + <data name="ld_to" type="Double" /> + <data name="ld_step" type="Double" /> + </state> + <transition transition="de.intevation.flys.artifacts.transitions.ValueCompareTransition"> <from state="state.minfo.distance_only"/> <to state="state.minfo.dischargestate"/> @@ -74,6 +88,11 @@ <to state="state.minfo.bed.difference_select"/> </transition> + <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition"> + <from state="state.minfo.bed.location"/> + <to state="state.minfo.bed.periods"/> + </transition> + <state id="state.minfo.dischargestate" description="state.minfo.dischargestate" state="de.intevation.flys.artifacts.states.DischargeState" helpText="help.minfo.dischargestate"> <data name="total.channel" type="intoptions"/> <data name="main.channel" type="intoptions"/> @@ -92,6 +111,10 @@ <data name="diffids" type="String" /> </state> + <state id="state.minfo.bed.periods" description="state.minfo.bed.periods" state="de.intevation.flys.artifacts.states.PeriodsSelect"> + <data name="periods" type="String"/> + </state> + <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition"> <from state="state.minfo.dischargestate"/> <to state="state.minfo.flow_velocity"/> @@ -112,6 +135,11 @@ <to state="state.minfo.bed.differences"/> </transition> + <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition"> + <from state="state.minfo.bed.periods"/> + <to state="state.minfo.bed.char_diameter"/> + </transition> + <state id="state.minfo.flow_velocity" description="state.minfo.flow_velocity" state="de.intevation.flys.artifacts.states.FlowVelocityState" helpText="help.minfo.flowvelocity"> <outputmodes> <outputmode name="flow_velocity" description="output.flow_velocity" mime-type="image/png" type="chart"> @@ -168,11 +196,20 @@ </outputmodes> </state> + <state id="state.minfo.bed.char_diameter" description="state.minfo.bed.char_diameter" state="de.intevation.flys.artifacts.states.minfo.CharDiameter"> + <data name="diameter" type="String"/> + </state> + <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition"> <from state="state.minfo.sq.outliers"/> <to state="state.minfo.sq.relation"/> </transition> + <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition"> + <from state="state.minfo.bed.char_diameter"/> + <to state="state.minfo.bed.bed_quality"/> + </transition> + <state id="state.minfo.sq.relation" description="state.minfo.sq.relation" state="de.intevation.flys.artifacts.states.SQRelation"> <outputmodes> <outputmode name="sq_relation_a" description="output.sq_relation" type="chart"> @@ -242,6 +279,15 @@ </outputmode> </outputmodes> </state> + + <state id="state.minfo.bed.bed_quality" description="state.minfo.bed.bed_quality" state="de.intevation.flys.artifacts.states.minfo.BedQualityState" helpText="help.minfo.bed.bed_quality"> + <outputmodes> + <outputmode name="bed_longitudinal_section" description="output.bed_longitudinal_section" mime-type="image/png" type="chart"> + <facets> + </facets> + </outputmode> + </outputmodes> + </state> </states> </artifact>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/BedQualityState.java Fri Aug 31 11:26:49 2012 +0000 @@ -0,0 +1,7 @@ +package de.intevation.flys.artifacts.states.minfo; + +import de.intevation.flys.artifacts.states.DefaultState; + +public class BedQualityState extends DefaultState { + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/CharDiameter.java Fri Aug 31 11:26:49 2012 +0000 @@ -0,0 +1,79 @@ +package de.intevation.flys.artifacts.states.minfo; + +import org.w3c.dom.Element; + +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.CallContext; +import de.intevation.artifacts.CallMeta; +import de.intevation.artifacts.common.utils.XMLUtils; +import de.intevation.flys.artifacts.resources.Resources; +import de.intevation.flys.artifacts.states.DefaultState; + +public class CharDiameter extends DefaultState { + + public static final String UI_PROVIDER = "minfo.bed.char_diameter"; + + private static final String CHAR_DIAMETER_MIN = "calc.bed.dmin"; + private static final String CHAR_DIAMETER_MAX = "calc.bed.dmax"; + private static final String CHAR_DIAMETER_MID = "calc.bed.dmid"; + private static final String CHAR_DIAMETER_90 = "calc.bed.d90"; + private static final String CHAR_DIAMETER_84 = "calc.bed.d84"; + private static final String CHAR_DIAMETER_80 = "calc.bed.d80"; + private static final String CHAR_DIAMETER_75 = "calc.bed.d75"; + private static final String CHAR_DIAMETER_70 = "calc.bed.d70"; + private static final String CHAR_DIAMETER_60 = "calc.bed.d60"; + private static final String CHAR_DIAMETER_50 = "calc.bed.d50"; + private static final String CHAR_DIAMETER_40 = "calc.bed.d40"; + private static final String CHAR_DIAMETER_30 = "calc.bed.d30"; + private static final String CHAR_DIAMETER_25 = "calc.bed.d25"; + private static final String CHAR_DIAMETER_20 = "calc.bed.d20"; + private static final String CHAR_DIAMETER_16 = "calc.bed.d16"; + private static final String CHAR_DIAMETER_10 = "calc.bed.d10"; + + public static final String[] CHAR_DIAMETER = { + CHAR_DIAMETER_10, + CHAR_DIAMETER_16, + CHAR_DIAMETER_20, + CHAR_DIAMETER_25, + CHAR_DIAMETER_30, + CHAR_DIAMETER_40, + CHAR_DIAMETER_50, + CHAR_DIAMETER_60, + CHAR_DIAMETER_70, + CHAR_DIAMETER_75, + CHAR_DIAMETER_80, + CHAR_DIAMETER_84, + CHAR_DIAMETER_90, + CHAR_DIAMETER_MAX, + CHAR_DIAMETER_MID, + CHAR_DIAMETER_MIN + }; + + @Override + public String getUIProvider() { + return UI_PROVIDER; + } + + @Override + protected Element[] createItems( + XMLUtils.ElementCreator cr, + Artifact artifact, + String name, + CallContext context) + { + CallMeta meta = context.getMeta(); + Element[] calcs = new Element[CHAR_DIAMETER.length]; + + for (int i = 0; i < CHAR_DIAMETER.length; ++i) { + String calc = CHAR_DIAMETER[i]; + calcs[i] = createItem( + cr, new String[] { + Resources.getMsg(meta, calc, calc), + calc + }); + } + + return calcs; + } + +}