[Dive4elements-commits] [PATCH 1 of 2] ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports

Wald Commits scm-commit at wald.intevation.org
Wed Mar 13 09:21:10 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1363162773 -3600
# Node ID 1e403a0efc2107786659cb633509b9435a61810c
# Parent  8f71fe38977ce2418d49db8c131e40eaa2e85f98
ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.

diff -r 8f71fe38977c -r 1e403a0efc21 flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java	Tue Mar 12 19:43:11 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java	Wed Mar 13 09:19:33 2013 +0100
@@ -130,6 +130,9 @@
 
     protected List<ImportWst> floodProtection;
 
+    /** Wst-structures from waterlevel-csv files. */
+    protected List<ImportWst> waterlevels;
+
     /** Wst-structures from waterlevel-difference-csv files. */
     protected List<ImportWst> waterlevelDifferences;
 
@@ -203,6 +206,7 @@
         fixations                 = new ArrayList<ImportWst>();
         officialLines             = new ArrayList<ImportWst>();
         floodWater                = new ArrayList<ImportWst>();
+        waterlevels               = new ArrayList<ImportWst>();
         waterlevelDifferences     = new ArrayList<ImportWst>();
         floodProtection           = new ArrayList<ImportWst>();
         sedimentDensities         = new ArrayList<ImportSedimentDensity>();
@@ -564,7 +568,7 @@
         for(ImportWst iw: parser.getWaterlevels()) {
             iw.setDescription("CSV/" + iw.getDescription());
             iw.setKind(6);
-            fixations.add(iw);
+            waterlevels.add(iw);
         }
     }
 
@@ -1083,6 +1087,7 @@
         storeMorphologicalWidth();
         storeFlowVelocity();
         storeSedimentYield();
+        storeWaterlevels();
         storeWaterlevelDifferences();
         storeMeasurementStations();
         storeSQRelations();
@@ -1129,14 +1134,27 @@
         if (!Config.INSTANCE.skipFixations() || !Config.INSTANCE.skipWaterlevels()) {
             log.info("store fixation wsts and/or csvs");
             River river = getPeer();
-            for (ImportWst fwst: fixations) {
-                log.debug("name: " + fwst.getDescription());
-                fwst.storeDependencies(river);
+            for (ImportWst fWst: fixations) {
+                log.debug("Fixation name: " + fWst.getDescription());
+                fWst.storeDependencies(river);
             }
         }
     }
 
 
+    /** Store wsts from waterlevel-csv files. */
+    public void storeWaterlevels() {
+        if (!Config.INSTANCE.skipWaterlevels())
+        
+        log.info("store waterlevel wsts from csv");
+        River river = getPeer();
+        for (ImportWst wWst: waterlevels) {
+            log.debug("Waterlevel name: " + wWst.getDescription());
+            wWst.storeDependencies(river);
+        }
+    }
+        
+
     /** Store wsts from waterleveldifference-csv files. */
     public void storeWaterlevelDifferences() {
         if (!Config.INSTANCE.skipWaterlevelDifferences())


More information about the Dive4elements-commits mailing list