Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstMainCalculationResult.java @ 9444:ecadc9ed0ba0
Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
author | mschaefer |
---|---|
date | Tue, 21 Aug 2018 13:41:18 +0200 |
parents | d2f5375ede26 |
children | 7228bd10a8cc |
comparison
equal
deleted
inserted
replaced
9443:515643b2c49a | 9444:ecadc9ed0ba0 |
---|---|
9 */ | 9 */ |
10 package org.dive4elements.river.artifacts.bundu.bezugswst; | 10 package org.dive4elements.river.artifacts.bundu.bezugswst; |
11 | 11 |
12 import java.util.ArrayList; | 12 import java.util.ArrayList; |
13 import java.util.Collection; | 13 import java.util.Collection; |
14 import java.util.List; | |
14 | 15 |
15 import org.dive4elements.river.artifacts.bundu.BunduResultType; | 16 import org.dive4elements.river.artifacts.bundu.BunduResultType; |
16 import org.dive4elements.river.artifacts.common.AbstractCalculationExportableResult; | 17 import org.dive4elements.river.artifacts.common.AbstractCalculationExportableResult; |
17 import org.dive4elements.river.artifacts.common.ExportContextCSV; | 18 import org.dive4elements.river.artifacts.common.ExportContextCSV; |
18 import org.dive4elements.river.artifacts.common.ExportContextPDF; | 19 import org.dive4elements.river.artifacts.common.ExportContextPDF; |
22 import org.dive4elements.river.artifacts.common.ResultRow; | 23 import org.dive4elements.river.artifacts.common.ResultRow; |
23 import org.dive4elements.river.artifacts.model.WQKms; | 24 import org.dive4elements.river.artifacts.model.WQKms; |
24 import org.dive4elements.river.artifacts.sinfo.util.BedHeightInfo; | 25 import org.dive4elements.river.artifacts.sinfo.util.BedHeightInfo; |
25 import org.dive4elements.river.artifacts.sinfo.util.RiverInfo; | 26 import org.dive4elements.river.artifacts.sinfo.util.RiverInfo; |
26 import org.dive4elements.river.artifacts.sinfo.util.WstInfo; | 27 import org.dive4elements.river.artifacts.sinfo.util.WstInfo; |
28 | |
29 import gnu.trove.TDoubleArrayList; | |
27 | 30 |
28 /** | 31 /** |
29 * Contains the results of a //TODO LINK{@link BezugswstCalculation}. | 32 * Contains the results of a //TODO LINK{@link BezugswstCalculation}. |
30 * | 33 * |
31 * @author Gernot Belger | 34 * @author Gernot Belger |
167 exportContextPDF.addJRMetadata(source, "waterlevel_name_header", GeneralResultType.waterlevelLabel); | 170 exportContextPDF.addJRMetadata(source, "waterlevel_name_header", GeneralResultType.waterlevelLabel); |
168 exportContextPDF.addJRMetadata(source, "gauge_header", GeneralResultType.gaugeLabel); | 171 exportContextPDF.addJRMetadata(source, "gauge_header", GeneralResultType.gaugeLabel); |
169 exportContextPDF.addJRMetadata(source, "location_header", GeneralResultType.location); | 172 exportContextPDF.addJRMetadata(source, "location_header", GeneralResultType.location); |
170 | 173 |
171 } | 174 } |
175 | |
176 /** | |
177 * Gets a longitudinal section of a result type value of a cross section field | |
178 * | |
179 * @param fieldIndex | |
180 * 1-based field index | |
181 * @param type | |
182 * result type like bedHeightField | |
183 */ | |
184 public final double[][] getFieldValuePoints(final int fieldIndex, final BunduResultType type) { | |
185 | |
186 final TDoubleArrayList x = new TDoubleArrayList(this.getRows().size()); | |
187 final TDoubleArrayList y = new TDoubleArrayList(this.getRows().size()); | |
188 | |
189 for (final ResultRow row : this.getRows()) { | |
190 x.add(row.getDoubleValue(GeneralResultType.station)); | |
191 @SuppressWarnings("unchecked") | |
192 final List<Double> fieldHeights = (List<Double>) row.getValue(type); | |
193 y.add(fieldHeights.get(fieldIndex - 1)); | |
194 } | |
195 | |
196 return new double[][] { x.toNativeArray(), y.toNativeArray() }; | |
197 } | |
172 } | 198 } |