changeset 6416:9787773e7bee double-precision

merged changes from default into double-precision branch
author Tom Gottfried <tom.gottfried@intevation.de>
date Tue, 25 Jun 2013 13:34:03 +0200
parents 1bdfc099286e (current diff) c1b01cf2e91b (diff)
children 28c390debd9b
files
diffstat 4 files changed, 24 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- 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());
--- 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());
             }
--- 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();
--- 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.

http://dive4elements.wald.intevation.org