# HG changeset patch # User Raimund Renkert # Date 1329476608 0 # Node ID efb2038783f956347bc1245f437ba9c757fa05c7 # Parent ba46af45b6e49a6b86c6c0dbb52770f143d4efe5 Renamed state data fields for W/Q input. flys-artifacts/trunk@4074 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r ba46af45b6e4 -r efb2038783f9 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Fri Feb 17 09:20:02 2012 +0000 +++ b/flys-artifacts/ChangeLog Fri Feb 17 11:03:28 2012 +0000 @@ -1,3 +1,14 @@ +2012-02-17 Raimund Renkert + + * src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java, + src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java, + src/main/java/de/intevation/flys/artifacts/states/WQSelect.java, + src/main/java/de/intevation/flys/utils/FLYSUtils.java, + doc/conf/artifacts/winfo.xml: + Renamed state data fields: wq_mode -> wq_isq + wq_free -> wq_isfree + wq_selection -> wq_isrange + 2012-02-17 Raimund Renkert * src/main/java/de/intevation/flys/exports/WaterlevelExporter.java: diff -r ba46af45b6e4 -r efb2038783f9 flys-artifacts/doc/conf/artifacts/winfo.xml --- a/flys-artifacts/doc/conf/artifacts/winfo.xml Fri Feb 17 09:20:02 2012 +0000 +++ b/flys-artifacts/doc/conf/artifacts/winfo.xml Fri Feb 17 11:03:28 2012 +0000 @@ -154,9 +154,9 @@ - - - + + + @@ -165,7 +165,7 @@ - + diff -r ba46af45b6e4 -r efb2038783f9 flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java Fri Feb 17 09:20:02 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java Fri Feb 17 11:03:28 2012 +0000 @@ -1116,8 +1116,8 @@ * @return the selected Q values or null, if no Q values are selected. */ public double[] getQs() { - StateData dMode = getData("wq_mode"); - StateData dSelection = getData("wq_selection"); + StateData dMode = getData("wq_isq"); + StateData dSelection = getData("wq_isrange"); boolean isRange = dSelection != null ? Boolean.valueOf((String)dSelection.getValue()) @@ -1139,13 +1139,13 @@ public boolean isQ() { - StateData mode = getData("wq_mode"); + StateData mode = getData("wq_isq"); String value = (mode != null) ? (String) mode.getValue() : null; return value != null ? Boolean.valueOf(value) : false; } public boolean isW() { - StateData mode = getData("wq_mode"); + StateData mode = getData("wq_isq"); String value = (mode != null) ? (String) mode.getValue() : null; return value != null ? !Boolean.valueOf(value) : false; } @@ -1154,7 +1154,7 @@ if(!isW()) { return false; } - StateData mode = getData("wq_free"); + StateData mode = getData("wq_isfree"); String value = (mode != null) ? (String) mode.getValue() : null; return value != null ? Boolean.valueOf(value) : false; @@ -1173,7 +1173,7 @@ if(!isQ()) { return false; } - StateData mode = getData("wq_free"); + StateData mode = getData("wq_isfree"); String value = (mode != null) ? (String) mode.getValue() : null; logger.debug("isFreeQ: " + value); @@ -1190,7 +1190,7 @@ * @return an array of Q values. */ public double[] getQs(double[] range) { - StateData dMode = getData("wq_mode"); + StateData dMode = getData("wq_isq"); if (isQ()) { return getWQForDist(range); diff -r ba46af45b6e4 -r efb2038783f9 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java Fri Feb 17 09:20:02 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java Fri Feb 17 11:03:28 2012 +0000 @@ -38,7 +38,7 @@ private static Logger logger = Logger.getLogger(WQAdapted.class); - public static final String FIELD_WQ_MODE = "wq_mode"; + public static final String FIELD_WQ_MODE = "wq_isq"; public static final String FIELD_WQ_VALUES = "wq_values"; diff -r ba46af45b6e4 -r efb2038783f9 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java Fri Feb 17 09:20:02 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java Fri Feb 17 11:03:28 2012 +0000 @@ -48,13 +48,13 @@ public static final int MAX_STEPS = 30; /** The name of the 'mode' field. */ - public static final String WQ_MODE = "wq_mode"; + public static final String WQ_MODE = "wq_isq"; /** Them name fo the 'free' field. */ - public static final String WQ_FREE = "wq_free"; + public static final String WQ_FREE = "wq_isfree"; /** The name of the 'selection' field. */ - public static final String WQ_SELECTION = "wq_selection"; + public static final String WQ_SELECTION = "wq_isrange"; /** The name of the 'from' field. */ public static final String WQ_FROM = "wq_from"; @@ -89,8 +89,8 @@ return super.createStaticData(flys, creator, cc, name, value, type); } - boolean isQ = flys.getDataAsBoolean(WQ_MODE); - boolean isFree = flys.getDataAsBoolean(WQ_FREE); + Boolean isQ = flys.getDataAsBoolean(WQ_MODE); + Boolean isFree = flys.getDataAsBoolean(WQ_FREE); WINFOArtifact winfo = (WINFOArtifact) flys; @@ -454,10 +454,12 @@ WINFOArtifact flys = (WINFOArtifact) artifact; StateData data = getData(flys, WQ_SELECTION); - boolean isRange = data != null + boolean isRange = data != null ? Boolean.valueOf((String) data.getValue()) : false; + + if (!isRange) { return validateSingle(artifact); } diff -r ba46af45b6e4 -r efb2038783f9 flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java --- a/flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java Fri Feb 17 09:20:02 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java Fri Feb 17 11:03:28 2012 +0000 @@ -163,7 +163,7 @@ /** * This method returns an WQ_MODE enum which is based on the parameters - * stored in flys Artifact. If there is no wq_mode parameter + * stored in flys Artifact. If there is no wq_isq parameter * existing, WQ_MODE.NONE is returned. * * @param flys The FLYSArtifact that stores wq mode relevant parameters. @@ -176,13 +176,13 @@ } String values = flys.getDataAsString("wq_values"); - Boolean isQ = flys.getDataAsBoolean("wq_mode"); + Boolean isQ = flys.getDataAsBoolean("wq_isq"); if (values != null) { return isQ ? WQ_MODE.QGAUGE : WQ_MODE.WGAUGE; } - Boolean isFree = flys.getDataAsBoolean("wq_free"); + Boolean isFree = flys.getDataAsBoolean("wq_isfree"); if (isQ) { return isFree ? WQ_MODE.QFREE : WQ_MODE.QGAUGE; @@ -201,7 +201,7 @@ return WQ_INPUT.NONE; } - Boolean selection = flys.getDataAsBoolean("wq_selection"); + Boolean selection = flys.getDataAsBoolean("wq_isrange"); String adapted = flys.getDataAsString("wq_values"); if(adapted != null && adapted.length() > 0) {