Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepth/FlowDepthCalculation.java @ 8863:1009cab0f86b
Some work on flow depth exporter
author | gernotbelger |
---|---|
date | Fri, 19 Jan 2018 18:47:53 +0100 |
parents | 7bbfb24e6eec |
children | 9f7a285b0ee3 |
comparison
equal
deleted
inserted
replaced
8862:5b5bdce5a216 | 8863:1009cab0f86b |
---|---|
38 this.context = context; | 38 this.context = context; |
39 } | 39 } |
40 | 40 |
41 public CalculationResult calculate(final SINFOArtifact sinfo) { | 41 public CalculationResult calculate(final SINFOArtifact sinfo) { |
42 | 42 |
43 // FIXME: find user of this artifact; probably only possible by selecting the collection that contains this artifact... | |
44 final String user = "unbekannt"; | |
45 | |
43 /* access input data */ | 46 /* access input data */ |
44 final FlowDepthAccess access = new FlowDepthAccess(sinfo); | 47 final FlowDepthAccess access = new FlowDepthAccess(sinfo); |
45 final River river = access.getRiver(); | 48 final River river = access.getRiver(); |
46 | 49 |
47 final Collection<DifferencesPair> diffPairs = access.getDifferencePairs(); | 50 final Collection<DifferencesPair> diffPairs = access.getDifferencePairs(); |
55 final Calculation problems = new Calculation(); | 58 final Calculation problems = new Calculation(); |
56 | 59 |
57 final List<Gauge> gauges = river.determineGauges(from, to); | 60 final List<Gauge> gauges = river.determineGauges(from, to); |
58 final GaugeIndex gaugeIndex = new GaugeIndex(gauges); | 61 final GaugeIndex gaugeIndex = new GaugeIndex(gauges); |
59 | 62 |
60 final FlowDepthCalculationResults results = new FlowDepthCalculationResults(river, from, to, useTkh); | 63 final String calcModeLabel = Resources.getMsg(context.getMeta(),sinfo.getCalculationMode().name() ); |
64 | |
65 | |
66 final FlowDepthCalculationResults results = new FlowDepthCalculationResults(calcModeLabel, user, river, from, to, useTkh); | |
61 | 67 |
62 for (final DifferencesPair diffPair : diffPairs) { | 68 for (final DifferencesPair diffPair : diffPairs) { |
63 final FlowDepthCalculationResult result = calculateResult( river, from, to, diffPair, problems, gaugeIndex ); | 69 final FlowDepthCalculationResult result = calculateResult( river, from, to, diffPair, problems, gaugeIndex ); |
64 if( result != null ) | 70 if( result != null ) |
65 results.addResult(result); | 71 results.addResult(result); |