annotate flys-aft/src/main/java/de/intevation/aft/DIPSGauge.java @ 4092:b3fc044f75ba

Added code to store W/Q values into FLYS database. flys-aft/trunk@3602 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 05 Jan 2012 17:06:29 +0000
parents aad1886ea226
children 83c72bc07591
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
4079
42094f01afa6 Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
96 public DIPSGauge() {
42094f01afa6 Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
97 }
42094f01afa6 Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
98
42094f01afa6 Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
99 public DIPSGauge(Element element) {
4082
d13011e53022 Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4080
diff changeset
100
4087
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
101 name = element.getAttribute("NAME");
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
102 riverName = element.getAttribute("GEWAESSER");
4082
d13011e53022 Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4080
diff changeset
103
4080
fd6d0bc84117 Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4079
diff changeset
104 String aeoString = element.getAttribute("EINZUGSGEBIET_AEO");
fd6d0bc84117 Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4079
diff changeset
105 if (aeoString.length() == 0) {
4082
d13011e53022 Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4080
diff changeset
106 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
107 aeoString = "0";
fd6d0bc84117 Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4079
diff changeset
108 }
fd6d0bc84117 Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4079
diff changeset
109 aeo = Double.parseDouble(aeoString);
fd6d0bc84117 Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4079
diff changeset
110
4087
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
111 String stationString = element.getAttribute("STATIONIERUNG");
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
112 if (stationString.length() == 0) {
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
113 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
114 stationString = "0";
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
115 }
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
116 station = Double.parseDouble(stationString);
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
117 if (station == 0d) {
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
118 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
119 }
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
120
4080
fd6d0bc84117 Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4079
diff changeset
121 datums = new ArrayList<Datum>();
fd6d0bc84117 Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4079
diff changeset
122 NodeList nodes = element.getElementsByTagName("PNP");
fd6d0bc84117 Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4079
diff changeset
123 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
124 Element e = (Element)nodes.item(i);
fd6d0bc84117 Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4079
diff changeset
125 Datum datum = new Datum(e);
fd6d0bc84117 Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4079
diff changeset
126 datums.add(datum);
fd6d0bc84117 Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4079
diff changeset
127 }
fd6d0bc84117 Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4079
diff changeset
128 Collections.sort(datums, DATE_CMP);
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
fd6d0bc84117 Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4079
diff changeset
131 public List<Datum> getDatums() {
fd6d0bc84117 Parse PNP from DIPS, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4079
diff changeset
132 return datums;
4079
42094f01afa6 Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
133 }
4082
d13011e53022 Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4080
diff changeset
134
d13011e53022 Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4080
diff changeset
135 public String getName() {
d13011e53022 Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4080
diff changeset
136 return name;
d13011e53022 Make DIPS check more verbose
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4080
diff changeset
137 }
4085
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
138
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
139 public String getRiverName() {
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
140 return riverName;
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
141 }
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
142
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
143 public int getFlysId() {
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
144 return flysId;
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
145 }
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
146
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
147 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
148 this.flysId = flysId;
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
149 }
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
150
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
151 public String getAftName() {
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
152 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
153 }
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
154
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
155 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
156 this.aftName = aftName;
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
157 }
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
158
4087
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
159 public double getStation() {
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
160 return station;
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
161 }
4085
067341e86375 Separate FLYS gauges to be updated or to create.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4082
diff changeset
162
4087
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
163 public double getAeo() {
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
164 return aeo;
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
165 }
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
166
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
167 public void setAeo(double aeo) {
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
168 this.aeo = aeo;
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
169 }
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
170
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
171 public void setStation(double station) {
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
172 this.station = station;
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
173 }
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
174
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
175 public boolean hasDatums() {
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
176 return !datums.isEmpty();
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
177 }
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
178
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
179 public Datum getLatestDatum() {
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
180 return datums.get(datums.size()-1);
aad1886ea226 Store new gauges in FLYS db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4085
diff changeset
181 }
4079
42094f01afa6 Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
182 }
42094f01afa6 Added model for DIPS gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
183 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org