Mercurial > dive4elements > river
annotate flys-aft/src/main/java/de/intevation/aft/DIPSGauge.java @ 4707:2b0426b79a92
Documentation.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 19 Dec 2012 11:39:46 +0100 |
parents | 83c72bc07591 |
children | b195fede1c3b |
rev | line source |
---|---|
4079
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.aft; |
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import org.w3c.dom.Element; |
4080
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
4 import org.w3c.dom.NodeList; |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
5 |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
6 import java.util.ArrayList; |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
7 import java.util.List; |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
8 import java.util.Date; |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
9 import java.util.Calendar; |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
10 import java.util.Collections; |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
11 import java.util.Comparator; |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
12 |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
13 import java.util.regex.Pattern; |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
14 import java.util.regex.Matcher; |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
15 |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
16 import org.apache.log4j.Logger; |
4079
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 |
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 public class DIPSGauge |
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 { |
4080
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
20 private static Logger log = Logger.getLogger(DIPSGauge.class); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
21 |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
22 public static final Pattern DATE_PATTERN = Pattern.compile( |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
23 "(\\d{4})-(\\d{2})-(\\d{2})\\s+(\\d{2}):(\\d{2}):(\\d{2})"); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
24 |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
25 public static final Comparator<Datum> DATE_CMP = new Comparator<Datum>() { |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
26 public int compare(Datum a, Datum b) { |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
27 return a.date.compareTo(b.date); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
28 } |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
29 }; |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
30 |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
31 public static class Datum { |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
32 |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
33 protected double value; |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
34 protected Date date; |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
35 |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
36 public Datum() { |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
37 } |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
38 |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
39 public Datum(Element element) { |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
40 value = Double.parseDouble(element.getAttribute("WERT")); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
41 String dateString = element.getAttribute("GUELTIGAB"); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
42 if (dateString.length() == 0) { |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
43 throw |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
44 new IllegalArgumentException("missing GUELTIGAB attribute"); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
45 } |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
46 Matcher m = DATE_PATTERN.matcher(dateString); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
47 if (!m.matches()) { |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
48 throw |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
49 new IllegalArgumentException("GUELTIGAB does not match"); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
50 } |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
51 |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
52 int year = Integer.parseInt(m.group(1)); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
53 int month = Integer.parseInt(m.group(2)); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
54 int day = Integer.parseInt(m.group(3)); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
55 int hours = Integer.parseInt(m.group(4)); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
56 int mins = Integer.parseInt(m.group(5)); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
57 int secs = Integer.parseInt(m.group(6)); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
58 |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
59 Calendar cal = Calendar.getInstance(); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
60 cal.set(year, month, day, hours, mins, secs); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
61 |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
62 date = cal.getTime(); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
63 } |
4087
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
64 |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
65 public double getValue() { |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
66 return value; |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
67 } |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
68 |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
69 public void setValue(double value) { |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
70 this.value = value; |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
71 } |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
72 |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
73 public Date getDate() { |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
74 return date; |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
75 } |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
76 |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
77 public void setDate(Date date) { |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
78 this.date = date; |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
79 } |
4080
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
80 } // class datum |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
81 |
4079
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
82 protected double aeo; |
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
83 |
4087
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
84 protected double station; |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
85 |
4082
d13011e53022
Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4080
diff
changeset
|
86 protected String name; |
d13011e53022
Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4080
diff
changeset
|
87 |
4085
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
88 protected String riverName; |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
89 |
4080
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
90 protected List<Datum> datums; |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
91 |
4085
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
92 protected int flysId; |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
93 |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
94 protected String aftName; |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
95 |
4097
83c72bc07591
Load all discharge tables from AFT and FLYS of a gauge which needs updating.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4087
diff
changeset
|
96 protected Long officialNumber; |
83c72bc07591
Load all discharge tables from AFT and FLYS of a gauge which needs updating.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4087
diff
changeset
|
97 |
4079
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
98 public DIPSGauge() { |
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 } |
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 |
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
101 public DIPSGauge(Element element) { |
4082
d13011e53022
Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4080
diff
changeset
|
102 |
4087
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
103 name = element.getAttribute("NAME"); |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
104 riverName = element.getAttribute("GEWAESSER"); |
4082
d13011e53022
Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4080
diff
changeset
|
105 |
4080
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
106 String aeoString = element.getAttribute("EINZUGSGEBIET_AEO"); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
107 if (aeoString.length() == 0) { |
4082
d13011e53022
Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4080
diff
changeset
|
108 log.warn("DIPS: Setting AEO of gauge '" + name + "' to zero."); |
4080
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
109 aeoString = "0"; |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
110 } |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
111 aeo = Double.parseDouble(aeoString); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
112 |
4087
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
113 String stationString = element.getAttribute("STATIONIERUNG"); |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
114 if (stationString.length() == 0) { |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
115 log.warn("DIPS: Setting station of gauge '" + name + "' to zero."); |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
116 stationString = "0"; |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
117 } |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
118 station = Double.parseDouble(stationString); |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
119 if (station == 0d) { |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
120 log.warn("DIPS: Station of gauge '" + name + "' is zero."); |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
121 } |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
122 |
4080
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
123 datums = new ArrayList<Datum>(); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
124 NodeList nodes = element.getElementsByTagName("PNP"); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
125 for (int i = 0, N = nodes.getLength(); i < N; ++i) { |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
126 Element e = (Element)nodes.item(i); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
127 Datum datum = new Datum(e); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
128 datums.add(datum); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
129 } |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
130 Collections.sort(datums, DATE_CMP); |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
131 } |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
132 |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
133 public List<Datum> getDatums() { |
fd6d0bc84117
Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4079
diff
changeset
|
134 return datums; |
4079
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
135 } |
4082
d13011e53022
Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4080
diff
changeset
|
136 |
d13011e53022
Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4080
diff
changeset
|
137 public String getName() { |
d13011e53022
Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4080
diff
changeset
|
138 return name; |
d13011e53022
Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4080
diff
changeset
|
139 } |
4085
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
140 |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
141 public String getRiverName() { |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
142 return riverName; |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
143 } |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
144 |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
145 public int getFlysId() { |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
146 return flysId; |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
147 } |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
148 |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
149 public void setFlysId(int flysId) { |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
150 this.flysId = flysId; |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
151 } |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
152 |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
153 public String getAftName() { |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
154 return aftName != null ? aftName : name; |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
155 } |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
156 |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
157 public void setAftName(String aftName) { |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
158 this.aftName = aftName; |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
159 } |
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
160 |
4087
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
161 public double getStation() { |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
162 return station; |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
163 } |
4085
067341e86375
Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4082
diff
changeset
|
164 |
4087
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
165 public double getAeo() { |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
166 return aeo; |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
167 } |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
168 |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
169 public void setAeo(double aeo) { |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
170 this.aeo = aeo; |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
171 } |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
172 |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
173 public void setStation(double station) { |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
174 this.station = station; |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
175 } |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
176 |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
177 public boolean hasDatums() { |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
178 return !datums.isEmpty(); |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
179 } |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
180 |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
181 public Datum getLatestDatum() { |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
182 return datums.get(datums.size()-1); |
aad1886ea226
Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4085
diff
changeset
|
183 } |
4097
83c72bc07591
Load all discharge tables from AFT and FLYS of a gauge which needs updating.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4087
diff
changeset
|
184 |
83c72bc07591
Load all discharge tables from AFT and FLYS of a gauge which needs updating.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4087
diff
changeset
|
185 public Long getOfficialNumber() { |
83c72bc07591
Load all discharge tables from AFT and FLYS of a gauge which needs updating.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4087
diff
changeset
|
186 return officialNumber; |
83c72bc07591
Load all discharge tables from AFT and FLYS of a gauge which needs updating.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4087
diff
changeset
|
187 } |
83c72bc07591
Load all discharge tables from AFT and FLYS of a gauge which needs updating.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4087
diff
changeset
|
188 |
83c72bc07591
Load all discharge tables from AFT and FLYS of a gauge which needs updating.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4087
diff
changeset
|
189 public void setOfficialNumber(Long officialNumber) { |
83c72bc07591
Load all discharge tables from AFT and FLYS of a gauge which needs updating.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4087
diff
changeset
|
190 this.officialNumber = officialNumber; |
83c72bc07591
Load all discharge tables from AFT and FLYS of a gauge which needs updating.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4087
diff
changeset
|
191 } |
4079
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
192 } |
42094f01afa6
Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
193 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |