[Dive4elements-commits] [PATCH 2 of 3] I999: Epochs and single years are handled in the same way in difference calc

Wald Commits scm-commit at wald.intevation.org
Thu Jun 6 13:29:48 CEST 2013


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1370518085 -7200
# Node ID 0f5cacdd60a9cd5e9b7126288c02c0024408a253
# Parent  467df391317de4044b84596563fd36379b6c3426
I999: Epochs and single years are handled in the same way in difference calc.

diff -r 467df391317d -r 0f5cacdd60a9 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java	Thu Jun 06 13:26:34 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java	Thu Jun 06 13:28:05 2013 +0200
@@ -60,16 +60,16 @@
 
     private CalculationResult internalCalculate() {
 
-        if (yearEpoch.equals("year")) {
-            BedDiffYearResult [] results = new BedDiffYearResult[heightIds.length];
+        BedDiffYearResult [] results = new BedDiffYearResult[heightIds.length];
 
-            for (int i = 0; i < heightIds.length; i++) {
-                BedHeight [] pair = getHeightPair(heightIds[i], "single");
-                results[i] = calculateYearDifference(pair);
-            }
-            return new CalculationResult(results, this);
+        for (int i = 0; i < heightIds.length; i++) {
+            BedHeight [] pair = getHeightPair(heightIds[i], "single");
+            results[i] = calculateYearDifference(pair);
         }
-
+        return new CalculationResult(results, this);
+        // Currently epochs are handled like single years. To handle epochs
+        // uncomment the follwing code and use an if-clause in the code above.
+/*
         if (yearEpoch.equals("epoch")) {
             BedDiffEpochResult [] results = new BedDiffEpochResult[heightIds.length];
 
@@ -81,6 +81,7 @@
         }
 
        return new CalculationResult();
+       */
     }
 
     private static BedHeight [] getHeightPair(int [] ids, String type) {


More information about the Dive4elements-commits mailing list