Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/vegetationzones/VegetationZonesCalculation.java @ 9118:431f1c269be5
Veg-Zone Table improved, State change data recovery;
author | gernotbelger |
---|---|
date | Mon, 04 Jun 2018 19:38:59 +0200 |
parents | 41f4bc83aa7a |
children | b570b6fcc052 |
comparison
equal
deleted
inserted
replaced
9117:623b51bf03d7 | 9118:431f1c269be5 |
---|---|
13 import java.util.Collection; | 13 import java.util.Collection; |
14 import java.util.List; | 14 import java.util.List; |
15 | 15 |
16 import org.apache.commons.lang.math.DoubleRange; | 16 import org.apache.commons.lang.math.DoubleRange; |
17 import org.dive4elements.artifacts.CallContext; | 17 import org.dive4elements.artifacts.CallContext; |
18 import org.dive4elements.river.artifacts.access.RangeAccess; | |
19 import org.dive4elements.river.artifacts.common.ResultRow; | 18 import org.dive4elements.river.artifacts.common.ResultRow; |
20 import org.dive4elements.river.artifacts.model.Calculation; | 19 import org.dive4elements.river.artifacts.model.Calculation; |
21 import org.dive4elements.river.artifacts.model.CalculationResult; | 20 import org.dive4elements.river.artifacts.model.CalculationResult; |
22 import org.dive4elements.river.artifacts.resources.Resources; | 21 import org.dive4elements.river.artifacts.resources.Resources; |
23 import org.dive4elements.river.artifacts.sinfo.util.CalculationUtils; | 22 import org.dive4elements.river.artifacts.sinfo.util.CalculationUtils; |
42 final Calculation problems = new Calculation(); | 41 final Calculation problems = new Calculation(); |
43 | 42 |
44 final String calcModeLabel = Resources.getMsg(this.context.getMeta(), uinfo.getCalculationMode().name()); | 43 final String calcModeLabel = Resources.getMsg(this.context.getMeta(), uinfo.getCalculationMode().name()); |
45 final String user = CalculationUtils.findArtifactUser(this.context, uinfo); | 44 final String user = CalculationUtils.findArtifactUser(this.context, uinfo); |
46 | 45 |
47 // FIXME: remove, check other states as well | 46 final VegetationzonesAccess vAccess = new VegetationzonesAccess(uinfo); |
48 final RangeAccess access = new RangeAccess(uinfo); | 47 final River river = vAccess.getRiver(); |
49 final River river = access.getRiver(); | 48 final DoubleRange calcRange = vAccess.getRange(); |
50 final DoubleRange calcRange = access.getRange(); | |
51 final RiverInfo riverInfo = new RiverInfo(river); | 49 final RiverInfo riverInfo = new RiverInfo(river); |
52 | 50 |
53 final VegetationzonesAccess vAccess = new VegetationzonesAccess(uinfo); | |
54 final String zonesRaw = vAccess.getVegZones(); | 51 final String zonesRaw = vAccess.getVegZones(); |
55 final List<VegetationZoneAccessHelper> helpers = VegetationZoneAccessHelper.parse(zonesRaw); | 52 final List<VegetationZone> helpers = VegetationZone.parse(zonesRaw); |
56 final VegetationZonesCalculationResults results = new VegetationZonesCalculationResults(calcModeLabel, user, riverInfo, calcRange); | 53 final VegetationZonesCalculationResults results = new VegetationZonesCalculationResults(calcModeLabel, user, riverInfo, calcRange); |
57 | 54 |
58 final Collection<ResultRow> rows = new ArrayList<>(); | 55 final Collection<ResultRow> rows = new ArrayList<>(); |
59 for (final VegetationZoneAccessHelper zone : helpers) { | 56 for (final VegetationZone zone : helpers) { |
60 final ResultRow row2 = ResultRow.create().// | 57 final ResultRow row2 = ResultRow.create().// |
61 putValue(UInfoResultType.vegname, zone.getZoneName()).// | 58 putValue(UInfoResultType.vegname, zone.getZoneName()).// |
62 putValue(UInfoResultType.vegdauervon, zone.getMin_day_overflow()).// | 59 putValue(UInfoResultType.vegdauervon, zone.getMin_day_overflow()).// |
63 putValue(UInfoResultType.vegdauerbis, zone.getMax_day_overflow()); | 60 putValue(UInfoResultType.vegdauerbis, zone.getMax_day_overflow()); |
64 rows.add(row2); | 61 rows.add(row2); |