Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculation.java @ 9236:b515ed950d39
S-Info flood durations with automatic km step width
author | mschaefer |
---|---|
date | Fri, 06 Jul 2018 17:56:18 +0200 |
parents | 0dcd1cd41915 |
children | c2a0028bfa9f |
comparison
equal
deleted
inserted
replaced
9235:d47f6641f597 | 9236:b515ed950d39 |
---|---|
20 import org.dive4elements.river.artifacts.sinfo.flood_duration.RiversideRadioChoice.RiversideChoiceKey; | 20 import org.dive4elements.river.artifacts.sinfo.flood_duration.RiversideRadioChoice.RiversideChoiceKey; |
21 import org.dive4elements.river.artifacts.sinfo.tkhstate.WinfoArtifactWrapper; | 21 import org.dive4elements.river.artifacts.sinfo.tkhstate.WinfoArtifactWrapper; |
22 import org.dive4elements.river.artifacts.sinfo.util.CalculationUtils; | 22 import org.dive4elements.river.artifacts.sinfo.util.CalculationUtils; |
23 import org.dive4elements.river.artifacts.sinfo.util.RiverInfo; | 23 import org.dive4elements.river.artifacts.sinfo.util.RiverInfo; |
24 import org.dive4elements.river.model.River; | 24 import org.dive4elements.river.model.River; |
25 import org.dive4elements.river.model.sinfo.Infrastructure; | |
26 | 25 |
27 /** | 26 /** |
28 * Calculation of the flood durations of the infrastructures of the km range of a river | 27 * Calculation of the flood durations of the infrastructures of the km range of a river |
29 * | 28 * |
30 * @author Matthias Schäfer | 29 * @author Matthias Schäfer |
47 final RiverInfo riverInfo = new RiverInfo(river); | 46 final RiverInfo riverInfo = new RiverInfo(river); |
48 final DoubleRange calcRange = access.getRange(); | 47 final DoubleRange calcRange = access.getRange(); |
49 | 48 |
50 final RiverInfoProvider infoProvider = RiverInfoProvider.forRange(this.context, river, calcRange); | 49 final RiverInfoProvider infoProvider = RiverInfoProvider.forRange(this.context, river, calcRange); |
51 final String calcModeLabel = Resources.getMsg(this.context.getMeta(), sinfo.getCalculationMode().name()); | 50 final String calcModeLabel = Resources.getMsg(this.context.getMeta(), sinfo.getCalculationMode().name()); |
52 final Infrastructure infrasSeries = Infrastructure.getSeries(river); | 51 final String label = Resources.getMsg(this.context.getMeta(), access.getRiverside().getKey()); |
53 final String infrasType = (infrasSeries != null) ? infrasSeries.getType().getName() : "?"; | |
54 final String label = infrasType + ", " + Resources.getMsg(this.context.getMeta(), access.getRiverside().getKey()); | |
55 | 52 |
56 final Calculation problems = new Calculation(); | 53 final Calculation problems = new Calculation(); |
57 | 54 |
58 // Calculate the selected main values, if any | 55 // Calculate the selected main values, if any |
59 /* misuse winfo-artifact to calculate waterlevels in the same way */ | 56 /* misuse winfo-artifact to calculate waterlevels in the same way */ |
60 final WINFOArtifact winfo = new WinfoArtifactWrapper(sinfo); | 57 final WINFOArtifact winfo = new WinfoArtifactWrapper(sinfo); |
61 // TODO Aktivieren wenn Step-Eingabe im Workflow weg: winfo.addStringData("ld_step", "100"); | 58 winfo.addStringData("ld_mode", "distance"); |
59 winfo.addStringData("ld_step", "100"); | |
62 | 60 |
63 final FloodDurationCalculationResults results = new FloodDurationCalculationResults(calcModeLabel, user, riverInfo, calcRange); | 61 final FloodDurationCalculationResults results = new FloodDurationCalculationResults(calcModeLabel, user, riverInfo, calcRange); |
64 | 62 |
65 final FloodDurationCalculationResult result = calculateResult(label, calcRange, infoProvider, access.getRiverside(), problems, winfo); | 63 final FloodDurationCalculationResult result = calculateResult(label, calcRange, infoProvider, access.getRiverside(), problems, winfo); |
66 results.addResult(result, problems); | 64 results.addResult(result, problems); |