comparison artifacts/src/main/java/org/dive4elements/river/artifacts/MainValuesArtifact.java @ 5865:73da40528cf2

River artifacts: Renamed FLYSUtils to RiverUtils.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 28 Apr 2013 15:09:31 +0200
parents 4897a58c8746
children 59ff03ff48f1
comparison
equal deleted inserted replaced
5864:f2e46a668fe6 5865:73da40528cf2
39 import org.dive4elements.river.artifacts.model.WstValueTableFactory; 39 import org.dive4elements.river.artifacts.model.WstValueTableFactory;
40 40
41 import org.dive4elements.river.artifacts.states.StaticState; 41 import org.dive4elements.river.artifacts.states.StaticState;
42 import org.dive4elements.river.artifacts.resources.Resources; 42 import org.dive4elements.river.artifacts.resources.Resources;
43 43
44 import org.dive4elements.river.utils.FLYSUtils; 44 import org.dive4elements.river.utils.RiverUtils;
45 45
46 46
47 /** 47 /**
48 * Artifact to access main and extreme values of a river. 48 * Artifact to access main and extreme values of a river.
49 * This artifact neglects (Static)FLYSArtifacts capabilities of interaction 49 * This artifact neglects (Static)FLYSArtifacts capabilities of interaction
281 * Access the Gauge that the mainvalues are taken from. 281 * Access the Gauge that the mainvalues are taken from.
282 * @return Gauge that main values are taken from or null in case of 282 * @return Gauge that main values are taken from or null in case of
283 * invalid parameterization. 283 * invalid parameterization.
284 */ 284 */
285 protected Gauge getGauge() { 285 protected Gauge getGauge() {
286 River river = FLYSUtils.getRiver(this); 286 River river = RiverUtils.getRiver(this);
287 287
288 // TODO use helper to get location as double 288 // TODO use helper to get location as double
289 String locationStr = getDataAsString("ld_locations"); 289 String locationStr = getDataAsString("ld_locations");
290 290
291 if (river == null) { 291 if (river == null) {
319 * @return list of Q main values. 319 * @return list of Q main values.
320 */ 320 */
321 public List<NamedDouble> getMainValuesQ(boolean atGauge) { 321 public List<NamedDouble> getMainValuesQ(boolean atGauge) {
322 List<NamedDouble> filteredList = new ArrayList<NamedDouble>(); 322 List<NamedDouble> filteredList = new ArrayList<NamedDouble>();
323 Gauge gauge = getGauge(); 323 Gauge gauge = getGauge();
324 WstValueTable interpolator = WstValueTableFactory.getTable(FLYSUtils.getRiver(this)); 324 WstValueTable interpolator = WstValueTableFactory.getTable(RiverUtils.getRiver(this));
325 Calculation c = new Calculation(); 325 Calculation c = new Calculation();
326 double w_out[] = {0.0f}; 326 double w_out[] = {0.0f};
327 double q_out[] = {0.0f}; 327 double q_out[] = {0.0f};
328 double kms[] = {getLocation()}; 328 double kms[] = {getLocation()};
329 double gaugeStation = gauge.getStation().doubleValue(); 329 double gaugeStation = gauge.getStation().doubleValue();
355 * @return list of W main values. 355 * @return list of W main values.
356 */ 356 */
357 public List<NamedDouble> getMainValuesW(boolean atGauge) { 357 public List<NamedDouble> getMainValuesW(boolean atGauge) {
358 List<NamedDouble> filteredList = new ArrayList<NamedDouble>(); 358 List<NamedDouble> filteredList = new ArrayList<NamedDouble>();
359 Gauge gauge = getGauge(); 359 Gauge gauge = getGauge();
360 WstValueTable interpolator = WstValueTableFactory.getTable(FLYSUtils.getRiver(this)); 360 WstValueTable interpolator = WstValueTableFactory.getTable(RiverUtils.getRiver(this));
361 Calculation c = new Calculation(); 361 Calculation c = new Calculation();
362 362
363 double gaugeStation = gauge.getStation().doubleValue(); 363 double gaugeStation = gauge.getStation().doubleValue();
364 double w_out[] = {0.0f}; 364 double w_out[] = {0.0f};
365 double q_out[] = {0.0f}; 365 double q_out[] = {0.0f};

http://dive4elements.wald.intevation.org