Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelData.java @ 8915:d9dbf0b74bc2
Refaktoring of flow depth calculation, extracting tkh part. First implementation of tkh calculation.
author | gernotbelger |
---|---|
date | Wed, 28 Feb 2018 17:27:15 +0100 |
parents | a536e1aacf0f |
children | cef37cc093f2 |
comparison
equal
deleted
inserted
replaced
8914:e3519c3e7a0a | 8915:d9dbf0b74bc2 |
---|---|
8 * documentation coming with Dive4Elements River for details. | 8 * documentation coming with Dive4Elements River for details. |
9 */ | 9 */ |
10 package org.dive4elements.river.artifacts.states; | 10 package org.dive4elements.river.artifacts.states; |
11 | 11 |
12 import org.dive4elements.river.artifacts.model.WKms; | 12 import org.dive4elements.river.artifacts.model.WKms; |
13 import org.dive4elements.river.model.Gauge; | |
14 import org.dive4elements.river.model.River; | |
15 | 13 |
16 /** | 14 /** |
17 * Represents a waterlevel fetched with the {@link WaterlevelFetcher}. | 15 * Represents a waterlevel fetched with the {@link WaterlevelFetcher}. |
18 * | 16 * |
19 * @author Gernot Belger | 17 * @author Gernot Belger |
66 | 64 |
67 public boolean isShowAllGauges() { | 65 public boolean isShowAllGauges() { |
68 return this.showAllGauges; | 66 return this.showAllGauges; |
69 } | 67 } |
70 | 68 |
71 public Gauge findReferenceGauge(final River river) { | |
72 final double[] wstFromTo = findWstFromTo(); | |
73 return river.determineRefGauge(wstFromTo, true); | |
74 } | |
75 | |
76 private double[] findWstFromTo() { | |
77 | |
78 final double from = this.wkms.getKm(0); | |
79 final double to = this.wkms.getKm(this.wkms.size() - 1); | |
80 | |
81 final boolean waterIncreasing = this.wkms.guessWaterIncreasing(); | |
82 if (waterIncreasing) | |
83 return new double[] { to, from }; | |
84 | |
85 return new double[] { from, to }; | |
86 } | |
87 | |
88 public int getYear() { | 69 public int getYear() { |
89 return this.year; | 70 return this.year; |
90 } | 71 } |
91 } | 72 } |