[PATCH] S/Q relation be more correct with judgment if a sieve is correct. Needs load and diameter

Wald Commits scm-commit at wald.intevation.org
Thu Dec 19 10:45:21 CET 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1387446314 -3600
# Node ID a8fd76b15d41e8d51320defd785df3e1aca3b303
# Parent  0737573aa9ac310a1ebd2df71261ed0890971781
S/Q relation be more correct with judgment if a sieve is correct. Needs load and diameter.

diff -r 0737573aa9ac -r a8fd76b15d41 artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/MeasurementFactory.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/MeasurementFactory.java	Wed Dec 18 19:51:23 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/MeasurementFactory.java	Thu Dec 19 10:45:14 2013 +0100
@@ -211,7 +211,7 @@
 
             }
             for (Sieve s: sieves) {
-                if (s != null && !Double.isNaN(s.getLoad())) {
+                if (s != null && s.isValid()) {
                     validSieves.add(s);
                 }
             }
diff -r 0737573aa9ac -r a8fd76b15d41 artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/Sieve.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/Sieve.java	Wed Dec 18 19:51:23 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/Sieve.java	Thu Dec 19 10:45:14 2013 +0100
@@ -83,5 +83,13 @@
     public boolean hasDiameter() {
         return !Double.isNaN(diameter);
     }
+
+    public boolean hasLoad() {
+        return !Double.isNaN(load);
+    }
+
+    public boolean isValid() {
+        return hasDiameter() && hasLoad();
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :


More information about the Dive4elements-commits mailing list