changeset 7324:24023630f693

issue1345: Fix sediment load facet type, adjust theme name.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 14 Oct 2013 17:41:19 +0200
parents 80c14a7e35f3
children 55d9c184f58c
files artifacts/src/main/java/org/dive4elements/river/artifacts/SedimentYieldArtifact.java
diffstat 1 files changed, 25 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/SedimentYieldArtifact.java	Mon Oct 14 17:40:31 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/SedimentYieldArtifact.java	Mon Oct 14 17:41:19 2013 +0200
@@ -151,15 +151,38 @@
             Date[] dates = SedimentLoadFactory.getSedimentYieldTimes(Integer.valueOf(code));
             Calendar date = Calendar.getInstance();
             date.setTime(dates[0]);
-            String name = fractionName + " " + date.get(Calendar.YEAR);
+            String name = fractionName + " - " + date.get(Calendar.YEAR);
             if (dates[1] != null) {
                 date.setTime(dates[1]);
                 name += " - " + date.get(Calendar.YEAR);
             }
 
+            String facetType = "";
+            if (fraction.equals("coarse")) {
+                facetType = SEDIMENT_LOAD_COARSE;
+            }
+            else if (fraction.equals("sand")) {
+                facetType = SEDIMENT_LOAD_SAND;
+            }
+            else if (fraction.equals("fine_middle")) {
+                facetType = SEDIMENT_LOAD_FINEMIDDLE;
+            }
+            else if (fraction.equals("susp_sand")) {
+                facetType = SEDIMENT_LOAD_SUSP_SAND;
+            }
+            else if (fraction.equals("susp_sand_bed")) {
+                facetType = SEDIMENT_LOAD_SUSP_SAND_BED;
+            }
+            else if (fraction.equals("suspended_sediment")) {
+                facetType = SEDIMENT_LOAD_SUSP_SEDIMENT;
+            }
+            else {
+                logger.error("Do not know fraction type " + fraction);
+            }
+
             Facet facet = new SedimentLoadFacet(
                 0,
-                SEDIMENT_LOAD_COARSE,
+                facetType,
                 name,
                 //????
                 ComputeType.ADVANCE, state.getID(), "hash"

http://dive4elements.wald.intevation.org