[PATCH 08 of 19] issue1435: Store id of sediment yield only

Wald Commits scm-commit at wald.intevation.org
Mon Sep 30 17:30:33 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1380555031 -7200
# Node ID 29233085472238713bfc3639c90d353624b1c736
# Parent  99c5e4148859767af07b470976172149a254de3f
issue1435: Store id of sediment yield only.

diff -r 99c5e4148859 -r 292330854722 artifacts/src/main/java/org/dive4elements/river/artifacts/SedimentDensityArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/SedimentDensityArtifact.java	Mon Sep 30 17:30:06 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/SedimentDensityArtifact.java	Mon Sep 30 17:30:31 2013 +0200
@@ -57,7 +57,6 @@
     protected transient State state = null;
 
     protected String DATA_ID = "ID";
-    protected String DATA_YEAR = "YEAR";
 
     /**
      * Trivial Constructor.
@@ -77,10 +76,9 @@
     private Object getSedimentDensity() {
         logger.debug("SedimentDensityArtifact.getSedimentDensity");
         Integer id = getDataAsInteger(DATA_ID);
-        Integer year = getDataAsInteger(DATA_YEAR);
 
         // TODO use cache if possible
-        return SedimentDensityFactory.getSedimentDensityUncached(id, year);
+        return SedimentDensityFactory.getSedimentDensityUncached(id);
     }
 
 
@@ -123,7 +121,6 @@
     {
         logger.debug("SedimentDensityArtifact.setup");
 
-        // Store id, yield yields.
         state = newDensityState();
         if (logger.isDebugEnabled()) {
             logger.debug(XMLUtils.toString(data));
@@ -135,13 +132,12 @@
 
         if (code != null) {
             //String name = SedimentDensityFactory.getSedimentDensityDescription(Integer.valueOf(code));
-            //id: and year?
 
             String name = "facet";
 
             Facet facet = new SedimentDensityFacet(
                 0,
-                SEDIMENT_LOAD_COARSE,
+                SEDIMENT_DENSITY,
                 name,
                 //????
                 ComputeType.ADVANCE, state.getID(), "hash"
@@ -149,7 +145,9 @@
             fs.add(facet);
             addFacets(state.getID(), fs);
             addStringData(DATA_ID, code);
-            addStringData(DATA_YEAR, code);
+        }
+        else {
+            logger.error("No id given.");
         }
 
         spawnState();


More information about the Dive4elements-commits mailing list