[PATCH 06 of 15] issue1658: Adjust Facet to new facet-types (t/a and m^3/a)

Wald Commits scm-commit at wald.intevation.org
Fri Nov 1 18:11:56 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1383319669 -3600
# Node ID aab63784a80f8a8e95eb4a481069d3d4f74c674c
# Parent  aaa48ad40bbd007280ad8b2af5f530c51103d602
issue1658: Adjust Facet to new facet-types (t/a and m^3/a).

diff -r aaa48ad40bbd -r aab63784a80f artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java
--- 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;
         }
     }


More information about the Dive4elements-commits mailing list