changeset 7501:aab63784a80f

issue1658: Adjust Facet to new facet-types (t/a and m^3/a).
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 01 Nov 2013 16:27:49 +0100
parents aaa48ad40bbd
children f2d97537f48a
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java
diffstat 1 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java	Fri Nov 01 16:26:15 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java	Fri Nov 01 16:27:49 2013 +0100
@@ -101,7 +101,8 @@
 
         // Handle sediment load differently, as it respects already
         // the ranges that were added to SedimentLoad/Fraction.
-        if (getName().equals(FacetTypes.SEDIMENT_LOAD_TOTAL)) {
+        if (getName().equals(FacetTypes.SEDIMENT_LOAD_TA_TOTAL)
+           ||getName().equals(FacetTypes.SEDIMENT_LOAD_M3A_TOTAL)) {
             SedimentLoad load = result.getLoad();
             TDoubleArrayList xPos = new TDoubleArrayList();
             TDoubleArrayList yPos = new TDoubleArrayList();
@@ -197,24 +198,25 @@
 
     /** Get data according to type of facet. */
     private double[][] getLoadData(SedimentLoadResult result) {
-        if (getName().equals(FacetTypes.SEDIMENT_LOAD_SAND))
+        String name = getName();
+        if (FacetTypes.IS.SEDIMENT_LOAD_SAND(name))
             return result.getSandData();
-        else if (getName().equals(FacetTypes.SEDIMENT_LOAD_COARSE))
+        else if (FacetTypes.IS.SEDIMENT_LOAD_COARSE(name))
             return result.getCoarseData();
-        else if (getName().equals(FacetTypes.SEDIMENT_LOAD_FINEMIDDLE))
+        else if (FacetTypes.IS.SEDIMENT_LOAD_FINEMIDDLE(name))
             return result.getFineMiddleData();
-        else if (getName().equals(FacetTypes.SEDIMENT_LOAD_SUSP_SAND))
+        else if (FacetTypes.IS.SEDIMENT_LOAD_SUSP_SAND(name))
             return result.getSuspSandData();
-        else if (getName().equals(FacetTypes.SEDIMENT_LOAD_SUSP_SAND_BED))
+        else if (FacetTypes.IS.SEDIMENT_LOAD_SUSP_SAND_BED(name))
             return result.getSuspSandBedData();
-        else if (getName().equals(FacetTypes.SEDIMENT_LOAD_SUSP_SEDIMENT))
+        else if (FacetTypes.IS.SEDIMENT_LOAD_SUSP_SEDIMENT(name))
             return result.getSuspSedimentData();
-        else if (getName().equals(FacetTypes.SEDIMENT_LOAD_TOTAL_LOAD))
+        else if (FacetTypes.IS.SEDIMENT_LOAD_TOTAL_LOAD(name))
             return result.getTotalLoadData();
-        else if (getName().equals(FacetTypes.SEDIMENT_LOAD_TOTAL))
+        else if (FacetTypes.IS.SEDIMENT_LOAD_TOTAL(name))
             return result.getTotalData();
         else {
-            logger.error("SedimentLoadFacet " + getName() + " cannot determine data type.");
+            logger.error("SedimentLoadFacet " + name + " cannot determine data type.");
             return null;
         }
     }

http://dive4elements.wald.intevation.org