changeset 3753:b3fdb5a12613

Add also min and max q values to the river info. flys-artifacts/trunk@5448 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Bjoern Ricks <bjoern.ricks@intevation.de>
date Thu, 13 Sep 2012 09:09:44 +0000
parents 854666f70a80
children a93b79cca2ca
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/GaugeOverviewInfoService.java
diffstat 2 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Sep 12 14:17:28 2012 +0000
+++ b/flys-artifacts/ChangeLog	Thu Sep 13 09:09:44 2012 +0000
@@ -1,3 +1,8 @@
+2012-09-13	Björn Ricks	<bjoern.ricks@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/services/GaugeOverviewInfoService.java:
+	  Add also min and max q values to the river info.
+
 2012-09-12	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/services/BedloadKMChartService.java,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/GaugeOverviewInfoService.java	Wed Sep 12 14:17:28 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/GaugeOverviewInfoService.java	Thu Sep 13 09:09:44 2012 +0000
@@ -56,7 +56,8 @@
 
         Element go = ec.create("gauge-info");
 
-        double[] minmax = river.determineMinMaxDistance();
+        double[] minmax  = river.determineMinMaxDistance();
+        double[] minmaxq = river.determineMinMaxQ();
 
         Element r = ec.create("river");
         ec.addAttr(r, "name", river.getName(), true);
@@ -64,9 +65,8 @@
         ec.addAttr(r, "end", Double.toString(minmax[1]), true);
         ec.addAttr(r, "wstunit", river.getWstUnit().getName(), true);
         ec.addAttr(r, "kmup", Boolean.toString(river.getKmUp()), true);
-        //TODO
-        /* ec.addAttr(r, "qmin", , true); */
-        /* ec.addAttr(r, "qmax", , true); */
+        ec.addAttr(r, "minq", Double.toString(minmaxq[0]), true);
+        ec.addAttr(r, "maxq", Double.toString(minmaxq[1]), true);
 
         Element egs = ec.create("gauges");
 
@@ -96,8 +96,11 @@
 
             Range range = gauge.getRange();
             if (range != null) {
-                double min = range.getA().doubleValue();
-                ec.addAttr(eg, "start", Double.toString(min), true);
+                BigDecimal a = range.getA();
+                if (a != null) {
+                    double min = a.doubleValue();
+                    ec.addAttr(eg, "start", Double.toString(min), true);
+                }
 
                 BigDecimal b = range.getB();
                 if (b != null) {

http://dive4elements.wald.intevation.org