Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/Calculation6.java @ 6839:fe03337c8011
(issue1353) Add river name handling
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 15 Aug 2013 16:05:17 +0200 |
parents | 20a32dbdbb59 |
children | a56fe3bc6700 |
comparison
equal
deleted
inserted
replaced
6838:a895eb07a7dc | 6839:fe03337c8011 |
---|---|
35 | 35 |
36 private int mode; | 36 private int mode; |
37 private long [] timerange; | 37 private long [] timerange; |
38 private double [] values; | 38 private double [] values; |
39 private Long officialGaugeNumber; | 39 private Long officialGaugeNumber; |
40 private String riverName; | |
40 | 41 |
41 | 42 |
42 public Calculation6(HistoricalDischargeAccess access) { | 43 public Calculation6(HistoricalDischargeAccess access) { |
43 EvaluationMode mode = access.getEvaluationMode(); | 44 EvaluationMode mode = access.getEvaluationMode(); |
44 Timerange tr = access.getEvaluationTimerange(); | 45 Timerange tr = access.getEvaluationTimerange(); |
45 double [] vs = mode != null && mode == EvaluationMode.W | 46 double [] vs = mode != null && mode == EvaluationMode.W |
46 ? access.getWs() | 47 ? access.getWs() |
47 : access.getQs(); | 48 : access.getQs(); |
49 riverName = access.getRiver(); | |
48 | 50 |
49 Long officialGaugeNumber = access.getOfficialGaugeNumber(); | 51 Long officialGaugeNumber = access.getOfficialGaugeNumber(); |
50 | 52 |
51 if (mode == null) { | 53 if (mode == null) { |
52 // TODO: i18n | 54 // TODO: i18n |
96 if (hasProblems()) { | 98 if (hasProblems()) { |
97 log.warn("Parameters not valid for calculation."); | 99 log.warn("Parameters not valid for calculation."); |
98 return null; | 100 return null; |
99 } | 101 } |
100 | 102 |
101 Gauge gauge = Gauge.getGaugeByOfficialNumber(officialGaugeNumber); | 103 Gauge gauge = Gauge.getGaugeByOfficialNumber(officialGaugeNumber, |
104 riverName); | |
102 if (gauge == null) { | 105 if (gauge == null) { |
103 // TODO: i18n | 106 // TODO: i18n |
104 return error("hist.discharge.gauge.not.found"); | 107 return error("hist.discharge.gauge.not.found"); |
105 } | 108 } |
106 | 109 |