Mercurial > dive4elements > river
diff flys-aft/src/main/java/de/intevation/aft/DIPSGauge.java @ 4087:aad1886ea226
Store new gauges in FLYS db.
flys-aft/trunk@3568 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 02 Jan 2012 17:45:25 +0000 |
parents | 067341e86375 |
children | 83c72bc07591 |
line wrap: on
line diff
--- a/flys-aft/src/main/java/de/intevation/aft/DIPSGauge.java Mon Jan 02 15:13:58 2012 +0000 +++ b/flys-aft/src/main/java/de/intevation/aft/DIPSGauge.java Mon Jan 02 17:45:25 2012 +0000 @@ -61,10 +61,28 @@ date = cal.getTime(); } + + public double getValue() { + return value; + } + + public void setValue(double value) { + this.value = value; + } + + public Date getDate() { + return date; + } + + public void setDate(Date date) { + this.date = date; + } } // class datum protected double aeo; + protected double station; + protected String name; protected String riverName; @@ -80,8 +98,8 @@ public DIPSGauge(Element element) { - name = element.getAttribute("NAME"); - riverName = element.getAttribute("GEWAESSER"); + name = element.getAttribute("NAME"); + riverName = element.getAttribute("GEWAESSER"); String aeoString = element.getAttribute("EINZUGSGEBIET_AEO"); if (aeoString.length() == 0) { @@ -90,6 +108,16 @@ } aeo = Double.parseDouble(aeoString); + String stationString = element.getAttribute("STATIONIERUNG"); + if (stationString.length() == 0) { + log.warn("DIPS: Setting station of gauge '" + name + "' to zero."); + stationString = "0"; + } + station = Double.parseDouble(stationString); + if (station == 0d) { + log.warn("DIPS: Station of gauge '" + name + "' is zero."); + } + datums = new ArrayList<Datum>(); NodeList nodes = element.getElementsByTagName("PNP"); for (int i = 0, N = nodes.getLength(); i < N; ++i) { @@ -128,6 +156,28 @@ this.aftName = aftName; } + public double getStation() { + return station; + } + public double getAeo() { + return aeo; + } + + public void setAeo(double aeo) { + this.aeo = aeo; + } + + public void setStation(double station) { + this.station = station; + } + + public boolean hasDatums() { + return !datums.isEmpty(); + } + + public Datum getLatestDatum() { + return datums.get(datums.size()-1); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :