[Dive4elements-commits] [PATCH 3 of 4] Refactor ComputedDischargeCurveExporter to support WQKms values and WQKms arrays
Wald Commits
scm-commit at wald.intevation.org
Tue Nov 27 17:43:35 CET 2012
# HG changeset patch
# User Björn Ricks <bjoern.ricks at intevation.de>
# Date 1354034501 -3600
# Node ID b4a95290ec6393d6f2edab9c13d930c89d3ac386
# Parent 9745f37c0d52a989341fe641ba3ef241636bd9f5
Refactor ComputedDischargeCurveExporter to support WQKms values and WQKms arrays
Not only allow CalculationResult objects in ComputedDischargeCurveExporter. Also
generate exports from WQKms values and WQKms arrays.
diff -r 9745f37c0d52 -r b4a95290ec63 flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveExporter.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveExporter.java Tue Nov 27 17:39:38 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveExporter.java Tue Nov 27 17:41:41 2012 +0100
@@ -76,10 +76,16 @@
protected void addData(Object d) {
if (d instanceof CalculationResult) {
d = ((CalculationResult)d).getData();
- if (d instanceof WQKms []) {
- data.addAll(Arrays.asList((WQKms [])d));
- }
}
+ if (d instanceof WQKms[]){
+ data.addAll(Arrays.asList((WQKms [])d));
+ return;
+ }
+ else if (d instanceof WQKms) {
+ data.add((WQKms)d);
+ }
+ logger.warn("Can't add data for csv export. Unkown data type " +
+ d.getClass().getName());
}
More information about the Dive4elements-commits
mailing list