changeset 5261:1e403a0efc21

ImportRiver: Light cleaning up, waterlevelimport more parralel to other imports.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 13 Mar 2013 09:19:33 +0100
parents 8f71fe38977c
children 0d9ad1c432b8
files flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java
diffstat 1 files changed, 22 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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())

http://dive4elements.wald.intevation.org