[PATCH 4 of 5] issue1399: Use WKms instead of WQKms object, as W-Difference artifact themselves

Wald Commits scm-commit at wald.intevation.org
Fri Jul 19 13:30:02 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1374233805 -7200
# Node ID e8e76d50d119b2e85e96d5d55741e0dd16e37fdc
# Parent  67b4728723dfd5ef7ea38b839809884270e95650
issue1399: Use WKms instead of WQKms object, as W-Difference artifact themselves
only deliver WKms, and no Q-Difference is ever built.

diff -r 67b4728723df -r e8e76d50d119 artifacts/src/main/java/org/dive4elements/river/artifacts/states/WDifferencesState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WDifferencesState.java	Fri Jul 19 10:04:47 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WDifferencesState.java	Fri Jul 19 13:36:45 2013 +0200
@@ -113,16 +113,16 @@
             logger.debug("Get WKms from WINFOArtifact");
             WINFOArtifact flys = (WINFOArtifact) d4eArtifact;
 
-            WQKms[] wqkms = (WQKms[]) flys.getWaterlevelData().
+            WKms[] wkms = (WKms[]) flys.getWaterlevelData(context).
                                               getData();
-            if (wqkms == null) {
+            if (wkms == null || wkms.length == 0) {
                 logger.warn("no waterlevels in artifact");
             }
-            else if (wqkms.length < idx+1) {
-                logger.warn("not enough waterlevels in artifact");
+            else if (wkms.length < idx+1) {
+                logger.warn("Not enough waterlevels in artifact.");
                 return new WQKms();
             }
-            return wqkms[idx];
+            return wkms[idx];
         }
         else if (d4eArtifact instanceof MINFOArtifact) {
             logger.debug("Get WKms from MINFOArtifact");


More information about the Dive4elements-commits mailing list