[Dive4elements-commits] [PATCH 3 of 4] issue1235: Respect that suspSand values are also measured at "suspended" (Schwebstoff)

Wald Commits scm-commit at wald.intevation.org
Mon Jun 24 10:35:45 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1372062895 -7200
# Node ID 74b8362f6a4c25af34863d746a17dbeca98be5cf
# Parent  e6ceab9e309129416de65530e216e2ba4779a7eb
issue1235: Respect that suspSand values are also measured at "suspended" (Schwebstoff)
measurement stations.

diff -r e6ceab9e3091 -r 74b8362f6a4c artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java	Mon Jun 24 10:15:34 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java	Mon Jun 24 10:34:55 2013 +0200
@@ -300,20 +300,20 @@
     /** Returns true if all fraction values except SuspSediment are unset. */
     private boolean hasOnlySuspValues(SedimentLoadFraction fraction) {
         return (fraction.getSuspSediment() != 0d &&
+            fraction.getSuspSand() != 0d &&
             fraction.getCoarse() == 0d &&
             fraction.getFineMiddle() == 0d &&
-            fraction.getSand() == 0d &&
-            fraction.getSuspSand() == 0d);
+            fraction.getSand() == 0d);
     }
 
 
     /** Returns true if all fraction values except SuspSediment are set. */
     private boolean hasButSuspValues(SedimentLoadFraction fraction) {
         return (fraction.getSuspSediment() == 0d &&
+            fraction.getSuspSand() == 0d &&
             fraction.getCoarse() != 0d &&
             fraction.getFineMiddle() != 0d &&
-            fraction.getSand() != 0d &&
-            fraction.getSuspSand() != 0d);
+            fraction.getSand() != 0d);
     }
 
 
@@ -369,7 +369,7 @@
                         // Adjust and remember schwebstoffs range and value.
                         lastSuspRange = (Range) fraction.getSuspSedimentRange().clone();
                         lastSuspRange.setStart(fraction.getCoarseRange().getEnd());
-                        lastSuspValue = fraction.getSuspSediment();
+                        lastSuspValue = fraction.getSuspSediment() + fraction.getSuspSand();
                         lastOtherRange = null;
                         fairLoad.setTotal(km, total, fraction.getCoarseRange());
                     }
@@ -401,7 +401,7 @@
                     if (suspSedimentRange.getEnd() > lastOtherRange.getEnd()) {
                         lastSuspRange = (Range) suspSedimentRange.clone();
                         lastSuspRange.setStart(lastOtherRange.getEnd());
-                        lastSuspValue = fraction.getSuspSediment();
+                        lastSuspValue = fraction.getSuspSediment() + fraction.getSuspSand();
                         lastOtherRange = null;
                     }
                     else {
@@ -417,7 +417,7 @@
                 }
                 else {
                     lastSuspRange = suspSedimentRange;
-                    lastSuspValue = fraction.getSuspSediment();
+                    lastSuspValue = fraction.getSuspSediment() + fraction.getSuspSand();
                     lastOtherRange = null;
                 }
             }
@@ -426,7 +426,6 @@
                 double total = fraction.getCoarse() +
                     fraction.getFineMiddle() +
                     fraction.getSand() +
-                    fraction.getSuspSand() +
                     lastSuspValue;
                 double maxStart = Math.max(fraction.getCoarseRange().getStart(),
                     lastSuspRange.getStart());


More information about the Dive4elements-commits mailing list