comparison artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java @ 8758:d4caab3fedde

A duration curve is always calculated for a single location. This implies that the gauge can be determined directly from that location using the default for limits between gauge ranges.
author Tom Gottfried <tom@intevation.de>
date Fri, 26 Jun 2015 16:23:32 +0200
parents bd17bd07db69
children 5e38e2924c07
comparison
equal deleted inserted replaced
8757:bd17bd07db69 8758:d4caab3fedde
311 * @return the data computed by a duration curve computation. 311 * @return the data computed by a duration curve computation.
312 */ 312 */
313 public CalculationResult getDurationCurveData() { 313 public CalculationResult getDurationCurveData() {
314 log.debug("WINFOArtifact.getDurationCurveData"); 314 log.debug("WINFOArtifact.getDurationCurveData");
315 315
316 River r = RiverUtils.getRiver(this); 316 RangeAccess rangeAccess = new RangeAccess(this);
317 317
318 River r = rangeAccess.getRiver();
318 if (r == null) { 319 if (r == null) {
319 return error(null, "no.river.selected"); 320 return error(null, "no.river.selected");
320 } 321 }
321 322
322 Gauge g = RiverUtils.getGauge(this); 323 double[] locations = rangeAccess.getLocations();
323 324 if (locations == null) {
325 return error(null, "no.locations.selected");
326 }
327
328 Gauge g = r.determineGaugeByPosition(locations[0]);
324 if (g == null) { 329 if (g == null) {
325 return error(null, "no.gauge.selected"); 330 return error(null, "no.gauge.selected");
326 }
327
328 RangeAccess rangeAccess = new RangeAccess(this);
329 double[] locations = rangeAccess.getLocations();
330
331 if (locations == null) {
332 return error(null, "no.locations.selected");
333 } 331 }
334 332
335 WstValueTable wst = WstValueTableFactory.getTable(r); 333 WstValueTable wst = WstValueTableFactory.getTable(r);
336 if (wst == null) { 334 if (wst == null) {
337 return error(null, "no.wst.for.river"); 335 return error(null, "no.wst.for.river");

http://dive4elements.wald.intevation.org