Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/SedimentLoadCalculation.java @ 5685:756df79274e1
SedimentLoadCalculation: Partly fix 1250 (calculate more than one total if possible).
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 12 Apr 2013 16:51:52 +0200 |
parents | b6297a67823e |
children | a4a894b15c35 |
comparison
equal
deleted
inserted
replaced
5684:88cbe798cbab | 5685:756df79274e1 |
---|---|
254 return result; | 254 return result; |
255 } | 255 } |
256 | 256 |
257 private SedimentLoad calculateTotalLoad(SedimentLoad load, int year) { | 257 private SedimentLoad calculateTotalLoad(SedimentLoad load, int year) { |
258 logger.debug("calculateTotalLoad"); | 258 logger.debug("calculateTotalLoad"); |
259 boolean problemThisYear = false; | |
259 if (!load.hasCoarse()) { | 260 if (!load.hasCoarse()) { |
260 addProblem(year, "missing.fraction.coarse"); | 261 addProblem("missing.fraction.coarse", Double.toString(year)); |
262 problemThisYear = true; | |
261 } | 263 } |
262 if (!load.hasFineMiddle()) { | 264 if (!load.hasFineMiddle()) { |
263 addProblem(year, "missing.fraction.fine_middle"); | 265 addProblem("missing.fraction.fine_middle", Double.toString(year)); |
266 problemThisYear = true; | |
264 } | 267 } |
265 if (!load.hasSand()) { | 268 if (!load.hasSand()) { |
266 addProblem(year, "missing.fraction.sand"); | 269 addProblem("missing.fraction.sand", Double.toString(year)); |
270 problemThisYear = true; | |
267 } | 271 } |
268 if (!load.hasSuspSand()) { | 272 if (!load.hasSuspSand()) { |
269 addProblem(year, "missing.fraction.susp_sand"); | 273 addProblem("missing.fraction.susp_sand", Double.toString(year)); |
274 problemThisYear = true; | |
270 } | 275 } |
271 if (!load.hasSuspSediment()) { | 276 if (!load.hasSuspSediment()) { |
272 addProblem(year, "missing.fraction.susp_sediment"); | 277 addProblem("missing.fraction.susp_sediment", Double.toString(year)); |
273 } | 278 problemThisYear = true; |
274 if (hasProblems()) { | 279 } |
280 if (problemThisYear) { | |
281 logger.warn("Some problem, not calculating total load."); | |
275 return load; | 282 return load; |
276 } | 283 } |
277 for(double km : load.getKms()) { | 284 for(double km : load.getKms()) { |
278 SedimentLoadFraction fraction = load.getFraction(km); | 285 SedimentLoadFraction fraction = load.getFraction(km); |
279 double total = 0d; | 286 double total = 0d; |