changeset 8276:7e54b27f4780

merged.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 16 Sep 2014 14:57:55 +0200
parents 97e148487186 (current diff) b0d7b0d79d6e (diff)
children a3ecddb5503f e8283197d889
files
diffstat 8 files changed, 111 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java	Tue Sep 16 14:57:14 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java	Tue Sep 16 14:57:55 2014 +0200
@@ -44,7 +44,7 @@
             if (pair[0].getYear() == null || pair[1].getYear() == null) {
                 addProblem("beddiff.missing.year");
             }
-            results[i] = calculateYearDifference(pair);
+            results[i] = calculateYearDifference(pair, heightIds[i]);
         }
 
         return new CalculationResult(results, this);
@@ -59,7 +59,8 @@
     }
 
     private BedDiffYearResult calculateYearDifference(
-            BedHeightSingleData[] pair
+        BedHeightSingleData[] pair,
+        int[] ids
         ) {
         log.debug("BedDiffCalculation.calculateYearDifference");
         BedHeightSingleData s1 = pair[0];
@@ -125,7 +126,9 @@
             s1.getYear(),
             s2.getYear(),
             s1.getName(),
-            s2.getName());
+            s2.getName(),
+            ids[0],
+            ids[1]);
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFacet.java	Tue Sep 16 14:57:14 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFacet.java	Tue Sep 16 14:57:55 2014 +0200
@@ -4,7 +4,12 @@
 import org.dive4elements.artifactdatabase.state.Facet;
 import org.dive4elements.artifacts.Artifact;
 import org.dive4elements.artifacts.CallContext;
+
+import org.dive4elements.river.model.BedHeightSingle;
+
 import org.dive4elements.river.artifacts.D4EArtifact;
+import org.dive4elements.river.artifacts.access.RiverAccess;
+import org.dive4elements.river.artifacts.resources.Resources;
 import org.dive4elements.river.artifacts.model.CalculationResult;
 import org.dive4elements.river.artifacts.model.DataFacet;
 import org.dive4elements.river.artifacts.model.FacetTypes;
@@ -40,6 +45,22 @@
 
         if (resultData != null && resultData.length > index) {
             BedDiffYearResult data = resultData[index];
+
+            BedHeightSingle first = BedHeightSingle.getBedHeightSingleById(
+                data.getIdFirst());
+            this.addMetaData(Resources.getMsg(
+                    context.getMeta(),
+                    "meta.bedheight.cur.elevation"),
+                first.getCurElevationModel().getName());
+            this.addMetaData(Resources.getMsg(
+                    context.getMeta(),
+                    "meta.bedheight.old.elevation"),
+                first.getOldElevationModel().getName());
+            this.addMetaData(Resources.getMsg(
+                    context.getMeta(),
+                    "meta.bedheight.river.elevation"),
+                new RiverAccess(flys).getRiver().getWstUnit().getName());
+
             return data.getHeights1Data();
         }
         return null;
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFilterFacet.java	Tue Sep 16 14:57:14 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFilterFacet.java	Tue Sep 16 14:57:55 2014 +0200
@@ -13,6 +13,9 @@
 import org.dive4elements.artifactdatabase.state.Facet;
 import org.dive4elements.artifacts.Artifact;
 import org.dive4elements.artifacts.CallContext;
+
+import org.dive4elements.river.model.BedHeightSingle;
+
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.access.RiverAccess;
 import org.dive4elements.river.artifacts.context.RiverContext;
@@ -64,6 +67,22 @@
             this.metaData.put(
                 Resources.getMsg(context.getMeta(),
                     "chart.subtitle.radius", new Object[] { radius }), "");
+
+            BedHeightSingle first = BedHeightSingle.getBedHeightSingleById(
+                oldData.getIdFirst());
+            this.addMetaData(Resources.getMsg(
+                    context.getMeta(),
+                    "meta.bedheight.cur.elevation"),
+                first.getCurElevationModel().getName());
+            this.addMetaData(Resources.getMsg(
+                    context.getMeta(),
+                    "meta.bedheight.old.elevation"),
+                first.getOldElevationModel().getName());
+            this.addMetaData(Resources.getMsg(
+                    context.getMeta(),
+                    "meta.bedheight.river.elevation"),
+                access.getRiver().getWstUnit().getName());
+
             return heights;
         }
         return null;
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFacet.java	Tue Sep 16 14:57:14 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFacet.java	Tue Sep 16 14:57:55 2014 +0200
@@ -4,7 +4,12 @@
 import org.dive4elements.artifactdatabase.state.Facet;
 import org.dive4elements.artifacts.Artifact;
 import org.dive4elements.artifacts.CallContext;
+
+import org.dive4elements.river.model.BedHeightSingle;
+
 import org.dive4elements.river.artifacts.D4EArtifact;
+import org.dive4elements.river.artifacts.access.RiverAccess;
+import org.dive4elements.river.artifacts.resources.Resources;
 import org.dive4elements.river.artifacts.model.CalculationResult;
 import org.dive4elements.river.artifacts.model.DataFacet;
 import org.dive4elements.river.artifacts.model.FacetTypes;
@@ -40,6 +45,22 @@
 
         if (resultData != null && resultData.length > index) {
             BedDiffYearResult data = resultData[index];
+
+            BedHeightSingle second = BedHeightSingle.getBedHeightSingleById(
+                data.getIdSecond());
+            this.addMetaData(Resources.getMsg(
+                    context.getMeta(),
+                    "meta.bedheight.cur.elevation"),
+                second.getCurElevationModel().getName());
+            this.addMetaData(Resources.getMsg(
+                    context.getMeta(),
+                    "meta.bedheight.old.elevation"),
+                second.getOldElevationModel().getName());
+            this.addMetaData(Resources.getMsg(
+                    context.getMeta(),
+                    "meta.bedheight.river.elevation"),
+                new RiverAccess(flys).getRiver().getWstUnit().getName());
+
             return data.getHeights2Data();
         }
         return null;
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFilterFacet.java	Tue Sep 16 14:57:14 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFilterFacet.java	Tue Sep 16 14:57:55 2014 +0200
@@ -13,6 +13,9 @@
 import org.dive4elements.artifactdatabase.state.Facet;
 import org.dive4elements.artifacts.Artifact;
 import org.dive4elements.artifacts.CallContext;
+
+import org.dive4elements.river.model.BedHeightSingle;
+
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.access.RiverAccess;
 import org.dive4elements.river.artifacts.context.RiverContext;
@@ -64,6 +67,22 @@
             this.metaData.put(
                 Resources.getMsg(context.getMeta(),
                     "chart.subtitle.radius", new Object[] { radius }), "");
+
+            BedHeightSingle second = BedHeightSingle.getBedHeightSingleById(
+                oldData.getIdSecond());
+            this.addMetaData(Resources.getMsg(
+                    context.getMeta(),
+                    "meta.bedheight.cur.elevation"),
+                second.getCurElevationModel().getName());
+            this.addMetaData(Resources.getMsg(
+                    context.getMeta(),
+                    "meta.bedheight.old.elevation"),
+                second.getOldElevationModel().getName());
+            this.addMetaData(Resources.getMsg(
+                    context.getMeta(),
+                    "meta.bedheight.river.elevation"),
+                access.getRiver().getWstUnit().getName());
+
             return heights;
         }
         return null;
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffYearResult.java	Tue Sep 16 14:57:14 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffYearResult.java	Tue Sep 16 14:57:55 2014 +0200
@@ -24,6 +24,8 @@
     protected Integer end;
     protected String nameFirst;
     protected String nameSecond;
+    protected int idFirst;
+    protected int idSecond;
 
     public BedDiffYearResult () {
         super();
@@ -54,7 +56,9 @@
         Integer start,
         Integer end,
         String nameFirst,
-        String nameSecond
+        String nameSecond,
+        int idFirst,
+        int idSecond
     ) {
         super(kms, differences, heights1, heights2);
         this.diffsPerYear = diffsPerYear;
@@ -66,6 +70,8 @@
         this.end = end;
         this.nameFirst = nameFirst;
         this.nameSecond = nameSecond;
+        this.idFirst = idFirst;
+        this.idSecond = idSecond;
     }
 
     public TDoubleArrayList getBedHeights() {
@@ -114,6 +120,16 @@
         return this.nameSecond;
     }
 
+    /** Get id of the first BedHeight (minuend). */
+    public int getIdFirst() {
+        return this.idFirst;
+    }
+
+    /** Get id of the second BedHeight (subtrahend). */
+    public int getIdSecond() {
+        return this.idSecond;
+    }
+
     public void addMorphWidth1(double value) {
         this.morphWidth1.add(value);
     }
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityState.java	Tue Sep 16 14:57:14 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityState.java	Tue Sep 16 14:57:55 2014 +0200
@@ -84,9 +84,14 @@
                         name.equals(BEDLOAD_DIAMETER_DATA)){
                         return Boolean.FALSE;
                     }
-                    else {
-                        return null;
+                    if (name.equals(BED_QUALITY_POROSITY_TOPLAYER) ||
+                        name.equals(BED_QUALITY_POROSITY_SUBLAYER) ||
+                        name.equals(BED_QUALITY_BED_DIAMETER_TOPLAYER) ||
+                        name.equals(BED_QUALITY_BED_DIAMETER_SUBLAYER) ||
+                        name.equals(BED_QUALITY_BEDLOAD_DIAMETER)) {
+                        return Boolean.TRUE;
                     }
+                    return null;
                 }
             });
     }
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java	Tue Sep 16 14:57:14 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java	Tue Sep 16 14:57:55 2014 +0200
@@ -226,7 +226,7 @@
                     ComputeType.ADVANCE,
                     stateId,
                     hash));
-                 newFacets.add(new BedDiffHeightSubFilterFacet(
+                newFacets.add(new BedDiffHeightSubFilterFacet(
                     idx,
                     BED_DIFFERENCE_YEAR_HEIGHT2_FILTERED,
                     createBedDiffHeightDescription(

http://dive4elements.wald.intevation.org