Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstMissVolCalculationResult3.java @ 9535:3fa8551c3d1b
Fixed error in bundu bzws missing volume calculation for mean bed height;
added various additional output columns (field bed height, field flow depth etc.)
author | mschaefer |
---|---|
date | Fri, 12 Oct 2018 18:49:38 +0200 |
parents | af163ce96eb4 |
children |
rev | line source |
---|---|
9444
ecadc9ed0ba0
Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents:
9432
diff
changeset
|
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
9332 | 2 * Software engineering by |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 package org.dive4elements.river.artifacts.bundu.bezugswst; | |
11 | |
12 import java.util.ArrayList; | |
13 import java.util.Collection; | |
14 | |
15 import org.dive4elements.river.artifacts.bundu.BunduResultType; | |
16 import org.dive4elements.river.artifacts.common.AbstractCalculationExportableResult; | |
17 import org.dive4elements.river.artifacts.common.AbstractExportContext; | |
18 import org.dive4elements.river.artifacts.common.ExportContextCSV; | |
19 import org.dive4elements.river.artifacts.common.ExportContextPDF; | |
20 import org.dive4elements.river.artifacts.common.MetaAndTableJRDataSource; | |
21 import org.dive4elements.river.artifacts.common.ResultRow; | |
22 import org.dive4elements.river.artifacts.sinfo.util.RiverInfo; | |
23 | |
24 /** | |
25 * Contains the results of a //TODO LINK{@link BezugswstCalculation}. | |
26 * | |
27 * @author Gernot Belger | |
28 */ | |
29 final class BezugswstMissVolCalculationResult3 extends AbstractCalculationExportableResult implements BunduWstExporter.MissResultType { | |
30 | |
31 private static final long serialVersionUID = 1L; | |
32 | |
33 private static final String JASPER_FILE = "/jasper/templates/bundu.bezugswst.result3.jrxml"; | |
34 | |
35 public BezugswstMissVolCalculationResult3(final String label, final Collection<ResultRow> rows) { | |
36 super(label, rows); | |
37 | |
38 } | |
39 | |
40 @Override | |
41 protected void writeCSVResultMetadata(final ExportContextCSV exportContextCSV) { | |
42 // no metadata | |
43 } | |
44 | |
45 @Override | |
46 protected String getJasperFile() { | |
47 return JASPER_FILE; | |
48 } | |
49 | |
50 protected String[] formatRow(final AbstractExportContext exportContext, final ResultRow row) { | |
51 | |
9535
3fa8551c3d1b
Fixed error in bundu bzws missing volume calculation for mean bed height;
mschaefer
parents:
9452
diff
changeset
|
52 final Collection<String> lines = new ArrayList<>(6); |
9332 | 53 |
9444
ecadc9ed0ba0
Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents:
9432
diff
changeset
|
54 lines.add(exportContext.formatRowValue(row, BunduResultType.missStationRangeFrom)); |
ecadc9ed0ba0
Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents:
9432
diff
changeset
|
55 lines.add(exportContext.formatRowValue(row, BunduResultType.missStationRangeTo)); |
9432
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9332
diff
changeset
|
56 lines.add(exportContext.formatRowValue(row, BunduResultType.missVolumeTotal)); |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9332
diff
changeset
|
57 lines.add(exportContext.formatRowValue(row, BunduResultType.missMassTotal)); |
9535
3fa8551c3d1b
Fixed error in bundu bzws missing volume calculation for mean bed height;
mschaefer
parents:
9452
diff
changeset
|
58 lines.add(exportContext.formatRowValue(row, BunduResultType.excavationVolumeTotal)); |
3fa8551c3d1b
Fixed error in bundu bzws missing volume calculation for mean bed height;
mschaefer
parents:
9452
diff
changeset
|
59 lines.add(exportContext.formatRowValue(row, BunduResultType.excavationCostsTotal)); |
9332 | 60 return lines.toArray(new String[lines.size()]); |
61 } | |
62 | |
63 @Override | |
64 public void writeCSVHeader(final ExportContextCSV exportContextCSV, final RiverInfo river) { | |
65 | |
9535
3fa8551c3d1b
Fixed error in bundu bzws missing volume calculation for mean bed height;
mschaefer
parents:
9452
diff
changeset
|
66 final int colSize = 6; |
9332 | 67 exportContextCSV.writeTitleForTabs("bundu.export.csv.title.bezugswst.result3", colSize); // Voraussetzung für Tabs ist, dass der Titel vor den Headern |
68 final Collection<String> header = new ArrayList<>(colSize); | |
69 | |
9444
ecadc9ed0ba0
Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents:
9432
diff
changeset
|
70 header.add(exportContextCSV.formatCsvHeader(BunduResultType.missStationRangeFrom)); |
ecadc9ed0ba0
Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents:
9432
diff
changeset
|
71 header.add(exportContextCSV.formatCsvHeader(BunduResultType.missStationRangeTo)); |
9432
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9332
diff
changeset
|
72 header.add(exportContextCSV.formatCsvHeader(BunduResultType.missVolumeTotal)); |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9332
diff
changeset
|
73 header.add(exportContextCSV.formatCsvHeader(BunduResultType.missMassTotal)); |
9535
3fa8551c3d1b
Fixed error in bundu bzws missing volume calculation for mean bed height;
mschaefer
parents:
9452
diff
changeset
|
74 header.add(exportContextCSV.formatCsvHeader(BunduResultType.excavationVolumeTotal)); |
3fa8551c3d1b
Fixed error in bundu bzws missing volume calculation for mean bed height;
mschaefer
parents:
9452
diff
changeset
|
75 header.add(exportContextCSV.formatCsvHeader(BunduResultType.excavationCostsTotal)); |
9332 | 76 |
77 exportContextCSV.writeCSVLine(header.toArray(new String[header.size()])); | |
78 | |
79 } | |
80 | |
81 @Override | |
82 protected String[] formatCSVRow(final ExportContextCSV exportContextCSV, final ResultRow row) { | |
83 | |
84 return this.formatRow(exportContextCSV, row); | |
85 } | |
86 | |
87 @Override | |
88 protected String[] formatPDFRow(final ExportContextPDF exportContextPDF, final ResultRow row) { | |
89 | |
90 return this.formatRow(exportContextPDF, row); | |
91 } | |
92 | |
93 @Override | |
94 protected void addJRTableHeader(final ExportContextPDF exportContextPDF, final MetaAndTableJRDataSource source) { | |
95 /* column headings */ | |
96 | |
9452 | 97 exportContextPDF.addJRMetadata(source, "station_from_header", BunduResultType.missStationRangeFrom); |
98 exportContextPDF.addJRMetadata(source, "station_to_header", BunduResultType.missStationRangeTo); | |
9432
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9332
diff
changeset
|
99 exportContextPDF.addJRMetadata(source, "channel_miss_volume_header", BunduResultType.missVolumeTotal); |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9332
diff
changeset
|
100 exportContextPDF.addJRMetadata(source, "channel_miss_mass_header", BunduResultType.missMassTotal); |
9535
3fa8551c3d1b
Fixed error in bundu bzws missing volume calculation for mean bed height;
mschaefer
parents:
9452
diff
changeset
|
101 exportContextPDF.addJRMetadata(source, "excavation_volume_header", BunduResultType.excavationVolumeTotal); |
3fa8551c3d1b
Fixed error in bundu bzws missing volume calculation for mean bed height;
mschaefer
parents:
9452
diff
changeset
|
102 exportContextPDF.addJRMetadata(source, "excavation_costs_header", BunduResultType.excavationCostsTotal); |
9332 | 103 |
104 } | |
105 } |