# HG changeset patch # User Ingo Weinzierl # Date 1304336012 0 # Node ID 46bb2b9e0bdc06391a4142c3f12b3d2319520313 # Parent f9653fc8ef7b1c60691c5a8bf19038d7c33d0098 Introduced a 'scale' parameter in Gauge.determineMinMaxW(). flys-backend/trunk@1787 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r f9653fc8ef7b -r 46bb2b9e0bdc flys-backend/ChangeLog --- a/flys-backend/ChangeLog Sun May 01 11:14:18 2011 +0000 +++ b/flys-backend/ChangeLog Mon May 02 11:33:32 2011 +0000 @@ -1,3 +1,8 @@ +2011-05-02 Ingo Weinzierl + + * src/main/java/de/intevation/flys/model/Gauge.java: Introduced a 'scale' + that is used to adjust the range of min/max W values. + 2011-05-01 Sascha L. Teichmann * src/main/java/de/intevation/flys/importer/WstParser.java: diff -r f9653fc8ef7b -r 46bb2b9e0bdc flys-backend/src/main/java/de/intevation/flys/model/Gauge.java --- a/flys-backend/src/main/java/de/intevation/flys/model/Gauge.java Sun May 01 11:14:18 2011 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/model/Gauge.java Mon May 02 11:33:32 2011 +0000 @@ -28,6 +28,8 @@ public class Gauge implements Serializable { + public static final int DEFAULT_SCALE = 100; + private Integer id; private String name; private River river; @@ -142,11 +144,21 @@ /** + * Returns min and max W values of this gauge based with a DEFAULT_SCALE. + * + * @return min and max W value of this gauge [min,max]. + */ + public double[] determineMinMaxW() { + return determineMinMaxW(DEFAULT_SCALE); + } + + + /** * Returns min and max W values of this gauge. * * @return the min and max W value of this gauge [min,max]. */ - public double[] determineMinMaxW() { + public double[] determineMinMaxW(int scale) { Session session = SessionHolder.HOLDER.get(); List tables = getDischargeTables(); @@ -173,8 +185,8 @@ return result != null ? new double[] { - ((BigDecimal) result[0]).doubleValue(), - ((BigDecimal) result[1]).doubleValue() } + ((BigDecimal) result[0]).doubleValue() * scale, + ((BigDecimal) result[1]).doubleValue() * scale} : null; } }