[PATCH 4 of 4] issue1157: Make a better choice for master and active CrossSection

Wald Commits scm-commit at wald.intevation.org
Thu Jul 4 12:03:20 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1372932757 -7200
# Node ID 4c463ca9b36ee1a03743ae7640e957fc64df3133
# Parent  de62db0f203528ac46feedc6a8e7946035a3bf0b
issue1157: Make a better choice for master and active CrossSection.

diff -r de62db0f2035 -r 4c463ca9b36e artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java	Thu Jul 04 11:52:06 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java	Thu Jul 04 12:12:37 2013 +0200
@@ -143,7 +143,7 @@
         fs.add(new CrossSectionFacet(0, cs.getDescription()));
 
         // Find out if we are newest and become master if so.
-        boolean isNewest = CrossSectionFactory.isNewest(cs);
+        boolean isNewest = cs.shouldBeMaster(getParentKm());
         String newString = (isNewest) ? "1" : "0";
         addStringData(DATA_IS_NEWEST, newString);
         addStringData(DATA_IS_MASTER, newString);
@@ -165,11 +165,10 @@
 
         RangeAccess rangeAccess = new RangeAccess(flys);
         double[] range = rangeAccess.getKmRange();
-        double min = 0.0f;
         if (range != null && range.length > 0) {
-            min = range[0];
+            this.addStringData(DATA_KM, Double.toString(range[0]));
+            this.addStringData(PARENT_KM, Double.toString(range[0]));
         }
-        this.addStringData(DATA_KM, Double.toString(min));
     }
 
 


More information about the Dive4elements-commits mailing list