changeset 4623:89322548b044

Set the discharge zone type to be able to generate the appropriate facets.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 03 Dec 2012 17:04:28 +0100
parents 900064815369
children bb267a0aa8c2
files flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FlowVelocityCalculation.java
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FlowVelocityCalculation.java	Mon Dec 03 17:01:45 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FlowVelocityCalculation.java	Mon Dec 03 17:04:28 2012 +0100
@@ -58,6 +58,7 @@
         if (mainIds != null) {
             for (int id: mainIds) {
                 DischargeZone zone = DischargeZone.getDischargeZoneById(id);
+                zone.putType("main");
 
                 if (zone != null) {
                     zones.add(zone);
@@ -68,9 +69,16 @@
         if (totalIds != null) {
             for (int id: totalIds) {
                 DischargeZone zone = DischargeZone.getDischargeZoneById(id);
-
                 if (zone != null) {
-                    zones.add(zone);
+                    int ndx = zones.indexOf(zone);
+                    if (zones.contains(zone) &&
+                        zones.get(ndx).fetchType().equals("main")) {
+                        zone.putType("main_total");
+                    }
+                    else {
+                        zone.putType("total");
+                        zones.add(zone);
+                    }
                 }
             }
         }
@@ -133,6 +141,7 @@
         String        lo   = zone.getLowerDischarge();
         String        hi   = zone.getUpperDischarge();
 
+        data.setType(zone.fetchType());
         if (lo.equals(hi)) {
             data.setZone(lo);
         }
@@ -152,7 +161,6 @@
         logger.debug("Prepare data for km range: " + kmLo + " - " + kmHi);
 
         FlowVelocityData[] data = new FlowVelocityData[models.size()];
-
         for (int i = 0, n = models.size(); i < n; i++) {
             FlowVelocityData d = new FlowVelocityData();
 

http://dive4elements.wald.intevation.org