diff artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataCalculation.java @ 8062:8489565ff563

Sedimen load: Added bundle for fraction results.
author Sascha L. Teichmann <teichmann@intevation.de>
date Wed, 30 Jul 2014 16:50:26 +0200
parents 25feef564d09
children fe5ef780f8b1
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataCalculation.java	Wed Jul 23 18:19:15 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataCalculation.java	Wed Jul 30 16:50:26 2014 +0200
@@ -245,6 +245,8 @@
             return error("minfo.sediment.load.no.data");
         }
 
+        SedimentLoadDataResult sldr = new SedimentLoadDataResult();
+
         boolean isKmUp = isKmUp();
         Set<Integer> missingFractions = new TreeSet<Integer>();
 
@@ -268,13 +270,14 @@
                         gf.getDescription());
                     continue;
                 }
-                // TODO: Generate result data set for calculation.
                 // TODO: Optionally transform units.
+                SedimentLoadDataResult.Fraction sldrf =
+                    new SedimentLoadDataResult.Fraction(gf.getDescription(), result);
+                sldr.addFraction(sldrf);
             }
         }
         // TODO: Generate messages for missing fractions.
-        // TODO: Bundle sub results.
-        return null;
+        return new CalculationResult(sldr, this);
     }
 
     private CalculationResult calculateEpochs() {
@@ -285,6 +288,8 @@
             return error("minfo.sediment.load.no.data");
         }
 
+        SedimentLoadDataResult sldr = new SedimentLoadDataResult();
+
         boolean isKmUp = isKmUp();
         Set<Integer> missingFractions = new TreeSet<Integer>();
 
@@ -309,13 +314,14 @@
                         gf.getDescription());
                     continue;
                 }
-                // TODO: Generate result data set for calculation.
                 // TODO: Optionally transform units.
+                SedimentLoadDataResult.Fraction sldrf =
+                    new SedimentLoadDataResult.Fraction(gf.getDescription(), result);
+                sldr.addFraction(sldrf);
             }
         }
         // TODO: Generate messages for missing fractions.
-        // TODO: Bundle sub results.
-        return null;
+        return new CalculationResult(sldr, this);
     }
 
     private CalculationResult calculateOffEpochs() {
@@ -326,6 +332,8 @@
             return error("minfo.sediment.load.no.data");
         }
 
+        SedimentLoadDataResult sldr = new SedimentLoadDataResult();
+
         boolean isKmUp = isKmUp();
         Set<Integer> missingFractions = new TreeSet<Integer>();
 
@@ -347,14 +355,14 @@
                         gf.getDescription());
                     continue;
                 }
-                // TODO: Generate result data set for calculation.
                 // TODO: Optionally transform units.
+                SedimentLoadDataResult.Fraction sldrf =
+                    new SedimentLoadDataResult.Fraction(gf.getDescription(), result);
+                sldr.addFraction(sldrf);
             }
         }
         // TODO: Generate messages for missing fractions.
-        // TODO: Bundle sub results.
-        // TODO: Implement me!
-        return null;
+        return new CalculationResult(sldr, this);
     }
 
     /** Figure out flow direction of river. */

http://dive4elements.wald.intevation.org