diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/MiddleBedHeight.java @ 2715:250a370c377d

Added chart generator for middle bed height charts. flys-artifacts/trunk@4441 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 18 May 2012 11:58:38 +0000
parents b60751cfdd6c
children b888c5eb65b3
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/MiddleBedHeight.java	Fri May 18 10:51:04 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/MiddleBedHeight.java	Fri May 18 11:58:38 2012 +0000
@@ -52,14 +52,26 @@
         int    idx = 0;
 
         for (MiddleBedHeightData d: data) {
-            newFacets.add(new MiddleBedHeightFacet(
-                idx,
-                MIDDLE_BED_HEIGHT,
-                buildMiddleBedHeightName(artifact, context, d),
-                ComputeType.ADVANCE,
-                id,
-                hash
-            ));
+            if (d.getStartYear() == d.getEndYear()) {
+                newFacets.add(new MiddleBedHeightFacet(
+                    idx,
+                    MIDDLE_BED_HEIGHT_SINGLE,
+                    d.getSoundingName(context),
+                    ComputeType.ADVANCE,
+                    id,
+                    hash
+                ));
+            }
+            else {
+                newFacets.add(new MiddleBedHeightFacet(
+                    idx,
+                    MIDDLE_BED_HEIGHT_EPOCH,
+                    d.getSoundingName(context),
+                    ComputeType.ADVANCE,
+                    id,
+                    hash
+                ));
+            }
 
             idx++;
         }
@@ -77,15 +89,5 @@
 
         return res;
     }
-
-
-    protected String buildMiddleBedHeightName(
-        FLYSArtifact        artifact,
-        CallContext         cc,
-        MiddleBedHeightData data
-    ) {
-        logger.error("TODO: Implement buildMiddleBedHeightName");
-        return "TODO: Implement buildMiddleBedHeightName";
-    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org