[Dive4elements-commits] [PATCH 06 of 11] Set the discharge zone type to be able to generate the appropriate facets

Wald Commits scm-commit at wald.intevation.org
Mon Dec 3 17:27:26 CET 2012


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1354550668 -3600
# Node ID 89322548b04485024c797eed19e74f842ce9431a
# Parent  9000648153692a0798fbb7d41e9293256aaaf5c4
Set the discharge zone type to be able to generate the appropriate facets.

diff -r 900064815369 -r 89322548b044 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FlowVelocityCalculation.java
--- 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();
 


More information about the Dive4elements-commits mailing list