[PATCH 2 of 3] issue1393/SedimentYieldParser: set kind of SedimentYields

Wald Commits scm-commit at wald.intevation.org
Wed Jul 31 11:03:53 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1375261973 -7200
# Node ID 796750499cd23e529aad92f6fa5fc879e5017381
# Parent  078d56dffc8c90cca4e4729db9eb2c1ab7c815fa
issue1393/SedimentYieldParser: set kind of SedimentYields
epending on import location.

diff -r 078d56dffc8c -r 796750499cd2 backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentYieldParser.java
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentYieldParser.java	Wed Jul 31 11:12:08 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentYieldParser.java	Wed Jul 31 11:12:53 2013 +0200
@@ -248,11 +248,23 @@
         // skip first column (Fluss-km) and last column (Hinweise)
         current = new ImportSedimentYield[columnNames.length-2];
 
+        Integer kind;
+
+        if (inputFile.getAbsolutePath().contains("amtliche Epochen")) {
+            log.warn("is amtlichbamtlich");
+            kind = new Integer(1);
+        }
+        else {
+            log.warn("is unamtlichbamtlich");
+            kind = new Integer(0);
+        }
+
         for (int i = 0, n = columnNames.length; i < n-2; i++) {
             current[i] = new ImportSedimentYield(this.description);
             current[i].setTimeInterval(getTimeInterval(columnNames[i+1]));
             current[i].setUnit(unit);
             current[i].setGrainFraction(grainFraction);
+            current[i].setKind(kind);
         }
     }
 


More information about the Dive4elements-commits mailing list