changeset 3874:2c40832cb596

Fixed some stupid bugs in bed quality data factory and calculation. flys-artifacts/trunk@5507 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 18 Sep 2012 15:03:20 +0000
parents b02bd3eff479
children d12f108ccc9c
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedQualityCalculation.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/QualityMeasurementFactory.java
diffstat 3 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Sep 18 15:00:30 2012 +0000
+++ b/flys-artifacts/ChangeLog	Tue Sep 18 15:03:20 2012 +0000
@@ -1,3 +1,11 @@
+2012-09-18  Raimund Renkert <raimund.renkert@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/minfo/QualityMeasurementFactory.java:
+	  Avoid loading empty data sets.
+
+	* src/main/java/de/intevation/flys/artifacts/model/minfo/BedQualityCalculation.java:
+	  Load bedload data sets...
+
 2012-09-18  Raimund Renkert <raimund.renkert@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/states/minfo/CharDiameter.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedQualityCalculation.java	Tue Sep 18 15:00:30 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedQualityCalculation.java	Tue Sep 18 15:03:20 2012 +0000
@@ -86,7 +86,7 @@
         // Calculate for all time periods.
         for (DateRange dr : ranges) {
             QualityMeasurements loadMeasurements =
-                QualityMeasurementFactory.getBedMeasurements(
+                QualityMeasurementFactory.getBedloadMeasurements(
                     river,
                     from,
                     to,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/QualityMeasurementFactory.java	Tue Sep 18 15:00:30 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/QualityMeasurementFactory.java	Tue Sep 18 15:03:20 2012 +0000
@@ -45,7 +45,7 @@
         "WHERE gw.name = :name AND " +
         "      st.km IS NOT NULL AND " +
         "      sp.tiefevon IS NOT NULL AND " +
-        "      sp.tiefebis IS NOT NULL AND " +
+        "      sp.tiefebis IS NOT NULL AND " + // TODO: Test if char diameter ist null.
         "      st.km BETWEEN :from - 0.001 AND :to + 0.001 AND " +
         "      st.datum BETWEEN :start AND :end";
 
@@ -72,6 +72,7 @@
         "    JOIN gewaesser gw ON gw.gewaesserid = sn.gewaesserid " +
         "WHERE gw.name = :name AND " +
         "      m.km IS NOT NULL AND " +
+        "      m.d10 IS NOT NULL AND" + //TODO: Add all other char. diameter.
         "      m.km BETWEEN :from - 0.001 AND :to + 0.001 AND" +
         "      m.datum BETWEEN :start AND :end";
 
@@ -196,7 +197,7 @@
                 SQL_BEDLOAD_MEASUREMENT);
         }
         finally {
-            session.close();
+            //session.close();
         }
     }
 }
\ No newline at end of file

http://dive4elements.wald.intevation.org