[Dive4elements-commits] [PATCH 1 of 2] Revert to rev 6404 for issue1235

Wald Commits scm-commit at wald.intevation.org
Tue Jun 25 07:56:17 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1372139984 -7200
# Node ID a21f7a3e4be567ba8201d8979189d376abd86445
# Parent  19066b1220b58158ec17ae66eaf377cb4e350009
Revert to rev 6404 for issue1235

diff -r 19066b1220b5 -r a21f7a3e4be5 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 15:02:26 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java	Tue Jun 25 07:59:44 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.getSand() == 0d &&
+            fraction.getSuspSand() == 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.getSand() != 0d &&
+            fraction.getSuspSand() != 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() + fraction.getSuspSand();
+                        lastSuspValue = fraction.getSuspSediment();
                         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() + fraction.getSuspSand();
+                        lastSuspValue = fraction.getSuspSediment();
                         lastOtherRange = null;
                     }
                     else {
@@ -417,7 +417,7 @@
                 }
                 else {
                     lastSuspRange = suspSedimentRange;
-                    lastSuspValue = fraction.getSuspSediment() + fraction.getSuspSand();
+                    lastSuspValue = fraction.getSuspSediment();
                     lastOtherRange = null;
                 }
             }
@@ -426,6 +426,7 @@
                 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