[Dive4elements-commits] [PATCH] merged changes from default into double-precision branch

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


# HG changeset patch
# User Tom Gottfried <tom.gottfried at intevation.de>
# Date 1372160043 -7200
# Branch double-precision
# Node ID 9787773e7bee81d29220415842f842f0a4050964
# Parent  1bdfc099286e2fa6a8f703ea7ca2a981461d0c0c
# Parent  c1b01cf2e91bd901b61f558fdf11aecf4e9fa882
merged changes from default into double-precision branch

diff -r 1bdfc099286e -r 9787773e7bee 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	Tue Jun 25 13:22:25 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java	Tue Jun 25 13:34:03 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());
diff -r 1bdfc099286e -r 9787773e7bee artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java	Tue Jun 25 13:22:25 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java	Tue Jun 25 13:34:03 2013 +0200
@@ -84,13 +84,13 @@
             if (station.getRange() == null || station.getMeasurementType() == null) {
                 continue;
             }
-            if (FacetTypes.IS.SEDIMENT_LOAD_NO_FLOAT(this.getName())
-                && station.getMeasurementType().equals("Geschiebe")) {
+            if (this.getName().contains("susp_sediment")
+                && station.getMeasurementType().equals("Schwebstoff")) {
                 stations.add(station);
                 sortedStarts.add(station.getStation());
             }
-            else if (!FacetTypes.IS.SEDIMENT_LOAD_NO_FLOAT(this.getName())
-                && station.getMeasurementType().equals("Schwebstoff")) {
+            else if (!this.getName().contains("susp_sediment")
+                && station.getMeasurementType().equals("Geschiebe")) {
                 stations.add(station);
                 sortedStarts.add(station.getStation());
             }
diff -r 1bdfc099286e -r 9787773e7bee artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFactory.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFactory.java	Tue Jun 25 13:22:25 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFactory.java	Tue Jun 25 13:34:03 2013 +0200
@@ -355,8 +355,8 @@
             getValues("fine_middle", sqlQuery, load, floatStations);
             getValues("sand", sqlQuery, load, floatStations);
             getValues("suspended_sediment", sqlQuery, load, suspStations);
-            getValues("susp_sand_bed", sqlQuery, load, suspStations);
-            getValues("susp_sand", sqlQuery, load, suspStations);
+            getValues("susp_sand_bed", sqlQuery, load, floatStations);
+            getValues("susp_sand", sqlQuery, load, floatStations);
 
             return load;
         }
@@ -402,8 +402,8 @@
             getValues("fine_middle", sqlQuery, load, floatStations);
             getValues("sand", sqlQuery, load, floatStations);
             getValues("suspended_sediment", sqlQuery, load, suspStations);
-            getValues("susp_sand_bed", sqlQuery, load, suspStations);
-            getValues("susp_sand", sqlQuery, load, suspStations);
+            getValues("susp_sand_bed", sqlQuery, load, floatStations);
+            getValues("susp_sand", sqlQuery, load, floatStations);
             return load;
         }
         return new SedimentLoad();
diff -r 1bdfc099286e -r 9787773e7bee gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQAdaptedInputPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQAdaptedInputPanel.java	Tue Jun 25 13:22:25 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQAdaptedInputPanel.java	Tue Jun 25 13:34:03 2013 +0200
@@ -163,6 +163,13 @@
 
         initTableListeners();
 
+        // We actually want the first Q tab to be selected and all
+        // Q tabs to be enabled. I sense a bug in TabSet here, as
+        // the code in the W/Q radiogroup-changehandler behaves
+        // exactly vice versa (enabling Q, selecting tab 0).
+        enableWTabs();
+        tabs.selectTab(1);
+
         return layout;
     }
 
@@ -195,7 +202,7 @@
 
             tabs.addTab(wTab, i*2+0);
             tabs.addTab(qTab, i*2+1);
-            tabs.disableTab(i*2+1);
+            //tabs.disableTab(i*2+1);
         }
 
         // Defaults at "Q", first input field.


More information about the Dive4elements-commits mailing list