8854
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
|
2 * Software engineering by Intevation GmbH |
|
3 * |
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
|
6 * documentation coming with Dive4Elements River for details. |
|
7 */ |
|
8 |
|
9 package org.dive4elements.river.artifacts.sinfo.flowdepth; |
|
10 |
|
11 import java.io.OutputStream; |
|
12 import java.text.DateFormat; |
|
13 import java.util.ArrayList; |
|
14 import java.util.Collection; |
|
15 import java.util.Date; |
|
16 import java.util.HashMap; |
|
17 import java.util.Locale; |
|
18 import java.util.Map; |
|
19 |
8877
|
20 import org.apache.commons.lang.StringUtils; |
8854
|
21 import org.apache.log4j.Logger; |
|
22 import org.dive4elements.artifacts.CallMeta; |
|
23 import org.dive4elements.artifacts.common.utils.Config; |
8863
|
24 import org.dive4elements.river.FLYS; |
8854
|
25 import org.dive4elements.river.artifacts.model.CalculationResult; |
|
26 import org.dive4elements.river.artifacts.resources.Resources; |
|
27 import org.dive4elements.river.artifacts.sinfo.util.MetaAndTableJRDataSource; |
|
28 import org.dive4elements.river.exports.AbstractExporter; |
|
29 import org.dive4elements.river.model.River; |
8863
|
30 import org.dive4elements.river.model.Unit; |
8854
|
31 |
|
32 import au.com.bytecode.opencsv.CSVWriter; |
|
33 import net.sf.jasperreports.engine.JRDataSource; |
|
34 import net.sf.jasperreports.engine.JRException; |
|
35 import net.sf.jasperreports.engine.JasperExportManager; |
|
36 import net.sf.jasperreports.engine.JasperFillManager; |
|
37 import net.sf.jasperreports.engine.JasperPrint; |
|
38 |
|
39 /** |
|
40 * Generates different output formats (csv, pdf) of data that resulted from a flow depths computation. |
|
41 * |
|
42 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
|
43 * @author Gernot Belger |
|
44 */ |
|
45 // REMARK: must be public because its registered in generators.xml |
|
46 public class FlowDepthExporter extends AbstractExporter { |
|
47 |
8877
|
48 /** The log used in this exporter. */ |
8854
|
49 private static Logger log = Logger.getLogger(FlowDepthExporter.class); |
|
50 |
|
51 private static final String CSV_KM_HEADER = "sinfo.export.flow_depth.csv.header.km"; |
|
52 private static final String CSV_FLOWDEPTH_HEADER = "sinfo.export.flow_depth.csv.header.flowdepth"; |
|
53 private static final String CSV_FLOWDEPTHTKH_HEADER = "sinfo.export.flow_depth.csv.header.flowdepthTkh"; |
|
54 private static final String CSV_TKH_HEADER = "sinfo.export.flow_depth.csv.header.tkh"; |
|
55 private static final String CSV_WATERLEVEL_HEADER = "sinfo.export.flow_depth.csv.header.waterlevel"; |
|
56 private static final String CSV_DISCHARGE_HEADER = "sinfo.export.flow_depth.csv.header.discharge"; |
|
57 private static final String CSV_LABEL_HEADER = "sinfo.export.flow_depth.csv.header.label"; |
|
58 private static final String CSV_GAUGE_HEADER = "sinfo.export.flow_depth.csv.header.gauge"; |
|
59 private static final String CSV_MEAN_BED_HEIGHT_HEADER = "sinfo.export.flow_depth.csv.header.mean_bed_height"; |
8863
|
60 private static final String CSV_MEAN_BED_HEIGHT_HEADER_SHORT = "sinfo.export.flow_depth.csv.header.mean_bed_height.short"; |
8854
|
61 private static final String CSV_SOUNDING_HEADER = "sinfo.export.flow_depth.csv.header.sounding"; |
|
62 private static final String CSV_LOCATION_HEADER = "sinfo.export.flow_depth.csv.header.location"; |
|
63 |
8877
|
64 private static final String CSV_META_HEADER_RESULT = "sinfo.export.flow_depth.csv.meta.header.result"; |
8854
|
65 |
8877
|
66 private static final String CSV_META_HEADER_RESULT_LABEL = "sinfo.export.flow_depth.csv.meta.header.result.label"; |
8863
|
67 |
8877
|
68 private static final String CSV_META_VERSION = "sinfo.export.flow_depth.csv.meta.version"; |
|
69 |
|
70 private static final String CSV_META_VERSION_LABEL = "sinfo.export.flow_depth.csv.meta.version.label"; |
|
71 |
|
72 private static final String CSV_META_USER = "sinfo.export.flow_depth.csv.meta.user"; |
|
73 |
|
74 private static final String CSV_META_USER_LABEL = "sinfo.export.flow_depth.csv.meta.user.label"; |
|
75 |
|
76 private static final String CSV_META_CREATION = "sinfo.export.flow_depth.csv.meta.creation"; |
|
77 |
|
78 private static final String CSV_META_CREATION_LABEL = "sinfo.export.flow_depth.csv.meta.creation.label"; |
|
79 |
|
80 private static final String CSV_META_RIVER = "sinfo.export.flow_depth.csv.meta.river"; |
|
81 |
|
82 private static final String CSV_META_RIVER_LABEL = "sinfo.export.flow_depth.csv.meta.river.label"; |
|
83 |
|
84 private static final String CSV_META_HEADER_SOUNDING = "sinfo.export.flow_depth.csv.meta.header.sounding"; |
|
85 |
|
86 private static final String CSV_META_HEADER_SOUNDING_YEAR = "sinfo.export.flow_depth.csv.meta.header.sounding.year"; |
|
87 |
|
88 private static final String CSV_META_HEADER_SOUNDING_TYPE = "sinfo.export.flow_depth.csv.meta.header.sounding.type"; |
|
89 |
|
90 private static final String CSV_META_HEADER_SOUNDING_PRJ = "sinfo.export.flow_depth.csv.meta.header.sounding.prj"; |
|
91 |
|
92 private static final String CSV_META_HEADER_SOUNDING_ELEVATIOIN_MODEL = "sinfo.export.flow_depth.csv.meta.header.sounding.elevationmodel"; |
|
93 |
|
94 private static final String CSV_META_HEADER_SOUNDING_ELEVATIOIN_MODEL_ORIGINAL = "sinfo.export.flow_depth.csv.meta.header.sounding.elevationmodel.original"; |
|
95 |
|
96 private static final String CSV_META_HEADER_WATERLEVEL = "sinfo.export.flow_depth.csv.meta.header.waterlevel"; |
|
97 |
|
98 private static final String CSV_META_HEADER_WATERLEVEL_NAME = "sinfo.export.flow_depth.csv.meta.header.waterlevel.name"; |
|
99 |
|
100 private static final String CSV_META_HEADER_WATERLEVEL_EVALUATOR = "sinfo.export.flow_depth.csv.meta.header.waterlevel.evaluator"; |
|
101 |
|
102 private static final String CSV_META_HEADER_WATERLEVEL_GAUGE = "sinfo.export.flow_depth.csv.meta.header.waterlevel.gauge"; |
|
103 |
|
104 private static final String CSV_META_HEADER_WATERLEVEL_YEAR = "sinfo.export.flow_depth.csv.meta.header.waterlevel.year"; |
|
105 |
|
106 private static final String CSV_META_RANGE = "sinfo.export.flow_depth.csv.meta.range"; |
|
107 |
|
108 private static final String CSV_META_RANGE_LABEL = "sinfo.export.flow_depth.csv.meta.range.label"; |
|
109 |
8863
|
110 private static final String CSV_META_HEIGHT_UNIT_RIVER = "sinfo.export.flow_depth.csv.meta.height_unit.river"; |
8877
|
111 |
|
112 private static final String JASPER_FILE = "/jasper/sinfo.flowdepth.jasper"; |
8863
|
113 |
|
114 private static final String UNIT_M = "m"; |
|
115 |
|
116 private static final String UNIT_CM = "cm"; |
|
117 |
|
118 private static final String UNIT_CUBIC_M = "m³/s"; |
8854
|
119 |
8877
|
120 /** The storage that contains the current calculation result. */ |
8854
|
121 private FlowDepthCalculationResults data = null; |
|
122 |
8877
|
123 /** |
|
124 * Formats header with unit |
|
125 */ |
|
126 private String msgUnit(final String key, final String unit) { |
|
127 |
|
128 final String msg = msg(key); |
|
129 return String.format("%s [%s]", msg, unit); |
8863
|
130 } |
8877
|
131 |
8854
|
132 @Override |
8877
|
133 protected void addData(final Object d) { |
|
134 /* reset */ |
|
135 this.data = null; |
8854
|
136 |
|
137 if (d instanceof CalculationResult) { |
|
138 |
8877
|
139 final Object dat = ((CalculationResult) d).getData(); |
|
140 if (dat != null) |
|
141 this.data = (FlowDepthCalculationResults) dat; |
8854
|
142 } |
|
143 } |
8877
|
144 |
8854
|
145 @Override |
8877
|
146 protected void writeCSVData(final CSVWriter writer) { |
8854
|
147 log.info("FlowDepthExporter.writeCSVData"); |
|
148 |
|
149 /* fetch calculation results */ |
8877
|
150 final FlowDepthCalculationResults results = this.data; |
8854
|
151 |
8863
|
152 final boolean useTkh = results.isUseTkh(); |
|
153 final River river = results.getRiver(); |
8854
|
154 |
8863
|
155 /* write as csv */ |
8854
|
156 writeCSVMeta(writer, results); |
8863
|
157 writeCSVHeader(writer, river, useTkh); |
8854
|
158 |
|
159 for (final FlowDepthCalculationResult result : results.getResults()) { |
8877
|
160 writeCSVFlowDepthResult(writer, result, useTkh); |
|
161 } |
8854
|
162 } |
|
163 |
8877
|
164 private void writeCSVFlowDepthResult(final CSVWriter writer, final FlowDepthCalculationResult result, |
|
165 final boolean useTkh) { |
|
166 |
|
167 /* first some specific metadata */ |
|
168 final BedHeightInfo sounding = result.getSounding(); |
|
169 final WstInfo wst = result.getWst(); |
|
170 |
|
171 // "##METADATEN PEILUNG" |
|
172 writeCSVMetaEntry(writer, CSV_META_HEADER_SOUNDING); |
|
173 |
|
174 // "# Jahr der Peilung: " |
|
175 writeCSVMetaEntry(writer, CSV_META_HEADER_SOUNDING_YEAR, Integer.toString(sounding.getYear())); |
|
176 // "# Aufnahmeart: " |
|
177 writeCSVMetaEntry(writer, CSV_META_HEADER_SOUNDING_TYPE, sounding.getType()); |
|
178 // "# Lagesystem: " |
|
179 writeCSVMetaEntry(writer, CSV_META_HEADER_SOUNDING_PRJ, sounding.getLocationSystem()); |
|
180 // "# Höhensystem: " |
8879
|
181 writeCSVMetaEntry(writer, CSV_META_HEADER_SOUNDING_ELEVATIOIN_MODEL, sounding.getCurElevationModelUnit()); |
8877
|
182 // "# ursprüngliches Höhensystem: " |
|
183 writeCSVMetaEntry(writer, CSV_META_HEADER_SOUNDING_ELEVATIOIN_MODEL_ORIGINAL, |
8879
|
184 sounding.getOldElevationModelUnit()); |
8877
|
185 |
|
186 // "##METADATEN WASSERSPIEGELLAGE" |
|
187 writeCSVMetaEntry(writer, CSV_META_HEADER_WATERLEVEL); |
|
188 // "# Bezeichnung der Wasserspiegellage: " |
|
189 writeCSVMetaEntry(writer, CSV_META_HEADER_WATERLEVEL_NAME, wst.getLabel()); |
8879
|
190 // "# Auswerter: " |
|
191 writeCSVMetaEntry(writer, CSV_META_HEADER_WATERLEVEL_EVALUATOR, wst.getSource()); |
|
192 // "# Bezugspegel: " |
|
193 writeCSVMetaEntry(writer, CSV_META_HEADER_WATERLEVEL_GAUGE, wst.getGauge()); |
8877
|
194 // "# Jahr/Zeitraum der Wasserspiegellage: " |
|
195 writeCSVMetaEntry(writer, CSV_META_HEADER_WATERLEVEL_YEAR, Integer.toString(wst.getYear())); |
|
196 |
|
197 /* nwo the value rows */ |
8854
|
198 final Collection<FlowDepthRow> rows = result.getRows(); |
|
199 for (final FlowDepthRow flowDepthRow : rows) { |
8877
|
200 writeCSVFlowDepthRow(writer, flowDepthRow, useTkh); |
|
201 } |
|
202 } |
8854
|
203 |
8877
|
204 private void writeCSVMeta(final CSVWriter writer, final FlowDepthCalculationResults results) { |
8854
|
205 log.info("FlowDepthExporter.writeCSVMeta"); |
|
206 |
8863
|
207 final String calcModeLabel = results.getCalcModeLabel(); |
8854
|
208 final River river = results.getRiver(); |
8877
|
209 writeCSVMetaEntry(writer, CSV_META_HEADER_RESULT, msg(CSV_META_HEADER_RESULT_LABEL), river.getName(), |
|
210 calcModeLabel); |
8854
|
211 |
8877
|
212 // "# FLYS-Version: " |
|
213 writeCSVMetaEntry(writer, CSV_META_VERSION, msg(CSV_META_VERSION_LABEL), FLYS.VERSION); |
8854
|
214 |
8877
|
215 // "# Bearbeiter: " |
|
216 writeCSVMetaEntry(writer, CSV_META_USER, msg(CSV_META_USER_LABEL), results.getUser()); |
8854
|
217 |
|
218 // "# Datum der Erstellung: " |
8877
|
219 final Locale locale = Resources.getLocale(this.context.getMeta()); |
8854
|
220 final DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale); |
8877
|
221 writeCSVMetaEntry(writer, CSV_META_CREATION, msg(CSV_META_CREATION_LABEL), df.format(new Date())); |
8854
|
222 |
|
223 // "# Gewässer: " |
8877
|
224 writeCSVMetaEntry(writer, CSV_META_RIVER, msg(CSV_META_RIVER_LABEL), river.getName()); |
8854
|
225 |
|
226 // "# Höhensystem des Flusses: " |
8863
|
227 final Unit wstUnit = river.getWstUnit(); |
|
228 writeCSVMetaEntry(writer, CSV_META_HEIGHT_UNIT_RIVER, wstUnit.getName()); |
8854
|
229 |
|
230 // "# Ort/Bereich (km): " |
8877
|
231 writeCSVMetaEntry(writer, CSV_META_RANGE, msg(CSV_META_RANGE_LABEL), getKmFormatter().format(results.getFrom()), |
|
232 getKmFormatter().format(results.getTo())); |
8854
|
233 |
|
234 writer.writeNext(new String[] { "" }); |
|
235 } |
|
236 |
8877
|
237 private void writeCSVMetaEntry(final CSVWriter writer, final String message, final Object... messageArgs) { |
8854
|
238 |
8877
|
239 final CallMeta meta = this.context.getMeta(); |
|
240 |
|
241 writer.writeNext(new String[] { Resources.getMsg(meta, message, message, messageArgs) }); |
8854
|
242 } |
8877
|
243 |
|
244 /** |
8854
|
245 * Write the header, with different headings depending on whether at a |
|
246 * gauge or at a location. |
8877
|
247 * |
|
248 * @param river |
|
249 * @param useTkh |
8854
|
250 */ |
8877
|
251 private void writeCSVHeader(final CSVWriter writer, final River river, final boolean useTkh) { |
8854
|
252 log.info("FlowDepthExporter.writeCSVHeader"); |
|
253 |
|
254 final Collection<String> header = new ArrayList<>(11); |
8877
|
255 |
8863
|
256 header.add(msg(CSV_KM_HEADER)); |
|
257 header.add(msgUnit(CSV_FLOWDEPTH_HEADER, UNIT_M)); |
8877
|
258 if (useTkh) { |
|
259 header.add(msgUnit(CSV_FLOWDEPTHTKH_HEADER, UNIT_M)); |
|
260 header.add(msgUnit(CSV_TKH_HEADER, UNIT_CM)); |
8854
|
261 } |
8863
|
262 |
|
263 final String wstUnitName = river.getWstUnit().getName(); |
|
264 header.add(msgUnit(CSV_WATERLEVEL_HEADER, wstUnitName)); |
|
265 header.add(msgUnit(CSV_DISCHARGE_HEADER, UNIT_CUBIC_M)); |
8854
|
266 header.add(msg(CSV_LABEL_HEADER)); |
|
267 header.add(msg(CSV_GAUGE_HEADER)); |
8863
|
268 header.add(msgUnit(CSV_MEAN_BED_HEIGHT_HEADER, wstUnitName)); |
8854
|
269 header.add(msg(CSV_SOUNDING_HEADER)); |
|
270 header.add(msg(CSV_LOCATION_HEADER)); |
|
271 |
8877
|
272 writer.writeNext(header.toArray(new String[header.size()])); |
8854
|
273 } |
|
274 |
|
275 /** |
|
276 * Format a row of a flow depth result into an array of string, both used by csv and pdf |
8877
|
277 * |
|
278 * @param useTkh |
8854
|
279 */ |
8877
|
280 private String[] formatFlowDepthRow(final FlowDepthRow row, final boolean useTkh) { |
8854
|
281 |
8877
|
282 final Collection<String> lines = new ArrayList<>(11); |
8854
|
283 |
8877
|
284 // Fluss-km |
|
285 lines.add(getKmFormatter().format(row.getStation())); |
|
286 |
|
287 // Fließtiefe [m] |
|
288 lines.add(getFlowDepthFormatter().format(row.getFlowDepth())); |
|
289 |
|
290 if (useTkh) { |
|
291 // Fließtiefe mit TKH [m] |
|
292 lines.add(getFlowDepthFormatter().format(row.getFlowDepthWithTkh())); |
|
293 |
|
294 // TKH [cm] |
|
295 lines.add(getTkhFormatter().format(row.getTkh())); |
|
296 } |
|
297 |
|
298 // Wasserstand [NN + m] |
|
299 lines.add(getW2Formatter().format(row.getWaterlevel())); |
|
300 |
|
301 // Q [m³/s] |
|
302 final double discharge = row.getDischarge(); |
|
303 if( Double.isNaN(discharge)) |
|
304 lines.add(StringUtils.EMPTY); |
|
305 else |
|
306 lines.add(getQFormatter().format(discharge)); |
|
307 |
|
308 // Bezeichnung |
|
309 lines.add(row.getWaterlevelLabel()); |
|
310 |
|
311 // Bezugspegel |
|
312 lines.add(row.getGauge()); |
|
313 |
|
314 // Mittlere Sohlhöhe [NN + m] |
|
315 lines.add(getMeanBedHeighFormatter().format(row.getMeanBedHeight())); |
|
316 |
|
317 // Peilung/Epoche |
|
318 lines.add(row.getSoundageLabel()); |
|
319 |
|
320 // Lage |
|
321 lines.add(row.getLocation()); |
|
322 |
|
323 return lines.toArray(new String[lines.size()]); |
8854
|
324 } |
8877
|
325 |
8854
|
326 /** |
|
327 * Write "rows" of csv data from wqkms with writer. |
8877
|
328 * |
|
329 * @param useTkh |
8854
|
330 */ |
8877
|
331 private void writeCSVFlowDepthRow(final CSVWriter writer, final FlowDepthRow row, final boolean useTkh) { |
8854
|
332 log.debug("FlowDepthExporter.writeCSVFlowDepthRow"); |
|
333 |
|
334 final String[] formattedRow = formatFlowDepthRow(row, useTkh); |
8877
|
335 writer.writeNext(formattedRow); |
8854
|
336 } |
|
337 |
8877
|
338 @Override |
|
339 protected void writePDF(final OutputStream outStream) { |
8854
|
340 log.debug("write PDF"); |
8877
|
341 |
8854
|
342 final JRDataSource source = createJRData(); |
|
343 |
|
344 final String confPath = Config.getConfigDirectory().toString(); |
|
345 |
8877
|
346 // FIXME: distinguish between with and without tkh: we need two jasper reports! |
8854
|
347 |
8877
|
348 final Map<String, Object> parameters = new HashMap<>(); |
8854
|
349 parameters.put("ReportTitle", "Exported Data"); |
|
350 try { |
8877
|
351 final JasperPrint print = JasperFillManager.fillReport(confPath + JASPER_FILE, parameters, source); |
8854
|
352 JasperExportManager.exportReportToPdfStream(print, outStream); |
|
353 } |
8877
|
354 catch (final JRException je) { |
8854
|
355 log.warn("Error generating PDF Report!", je); |
|
356 } |
|
357 } |
|
358 |
|
359 private JRDataSource createJRData() { |
8877
|
360 |
8854
|
361 /* fetch calculation results */ |
8877
|
362 final FlowDepthCalculationResults results = this.data; |
|
363 |
|
364 final MetaAndTableJRDataSource source = new MetaAndTableJRDataSource(); |
|
365 |
8854
|
366 addJRMetaData(source, results); |
|
367 |
|
368 final boolean useTkh = results.isUseTkh(); |
8877
|
369 |
8854
|
370 for (final FlowDepthCalculationResult result : results.getResults()) { |
8877
|
371 addJRTableData(source, result, useTkh); |
|
372 } |
8854
|
373 |
|
374 return source; |
|
375 } |
|
376 |
8877
|
377 private void addJRMetaData(final MetaAndTableJRDataSource source, final FlowDepthCalculationResults results) { |
8854
|
378 |
8877
|
379 final River river = results.getRiver(); |
|
380 final String wstUnitName = river.getWstUnit().getName(); |
8863
|
381 |
8877
|
382 /* general metadata */ |
|
383 source.addMetaData("header", msg(CSV_META_HEADER_RESULT_LABEL)); |
|
384 source.addMetaData("calcMode", results.getCalcModeLabel()); |
|
385 |
|
386 source.addMetaData("version_label", msg(CSV_META_VERSION_LABEL)); |
8863
|
387 source.addMetaData("version", FLYS.VERSION); |
|
388 |
|
389 source.addMetaData("user_label", msg(CSV_META_USER_LABEL)); |
|
390 source.addMetaData("user", results.getUser()); |
8877
|
391 |
|
392 final Locale locale = Resources.getLocale(this.context.getMeta()); |
8854
|
393 final DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale); |
8863
|
394 source.addMetaData("date_label", msg(CSV_META_CREATION_LABEL)); |
8854
|
395 source.addMetaData("date", df.format(new Date())); |
|
396 |
8877
|
397 source.addMetaData("river_label", msg(CSV_META_RIVER_LABEL)); |
8863
|
398 source.addMetaData("river", river.getName()); |
8854
|
399 |
8877
|
400 final String rangeValue = String.format("%s - %s", getKmFormatter().format(results.getFrom()), |
|
401 getKmFormatter().format(results.getTo())); |
8863
|
402 source.addMetaData("range_label", msg(CSV_META_RANGE_LABEL)); |
|
403 source.addMetaData("range", rangeValue); |
8854
|
404 |
8863
|
405 /* column headings */ |
|
406 source.addMetaData("station_header", msg(CSV_KM_HEADER)); |
|
407 source.addMetaData("flowdepth_header", msg(CSV_FLOWDEPTH_HEADER)); |
|
408 source.addMetaData("flowdepth_tkh_header", msg(CSV_FLOWDEPTHTKH_HEADER)); |
|
409 source.addMetaData("tkh_header", msg(CSV_TKH_HEADER)); |
|
410 source.addMetaData("waterlevel_header", msg(CSV_WATERLEVEL_HEADER)); |
|
411 source.addMetaData("river_unit", wstUnitName); |
|
412 source.addMetaData("discharge_header", msg(CSV_DISCHARGE_HEADER)); |
|
413 source.addMetaData("waterlevel_name_header", msg(CSV_LABEL_HEADER)); |
|
414 source.addMetaData("gauge_header", msg(CSV_GAUGE_HEADER)); |
|
415 source.addMetaData("bedheight_header", msg(CSV_MEAN_BED_HEIGHT_HEADER_SHORT)); |
|
416 source.addMetaData("sounding_name_header", msg(CSV_SOUNDING_HEADER)); |
|
417 source.addMetaData("location_header", msg(CSV_LOCATION_HEADER)); |
8854
|
418 } |
|
419 |
8877
|
420 private void addJRTableData(final MetaAndTableJRDataSource source, final FlowDepthCalculationResult result, |
|
421 final boolean useTkh) { |
8863
|
422 |
8877
|
423 final Collection<FlowDepthRow> rows = result.getRows(); |
|
424 |
|
425 for (final FlowDepthRow row : rows) { |
|
426 |
|
427 final String[] formattedRow = formatFlowDepthRow(row, useTkh); |
|
428 source.addData(formattedRow); |
|
429 } |
|
430 } |
|
431 } |