Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/GaugeOverviewInfoService.java @ 3750:e560a9a10eb1
Removed trailing whitespace.
flys-artifacts/trunk@5440 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 12 Sep 2012 13:57:07 +0000 |
parents | 99f80469ba2b |
children | b3fdb5a12613 |
rev | line source |
---|---|
3739
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.services; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
2 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
3 import java.math.BigDecimal; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
5 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
6 import org.apache.log4j.Logger; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
7 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
8 import org.w3c.dom.Document; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
9 import org.w3c.dom.Element; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
10 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.artifacts.CallMeta; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.artifacts.GlobalContext; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
13 import de.intevation.artifacts.common.ArtifactNamespaceContext; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifacts.common.utils.XMLUtils; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
15 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.flys.artifacts.model.RiverFactory; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
17 import de.intevation.flys.model.Gauge; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.flys.model.MinMaxWQ; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.flys.model.Range; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.flys.model.River; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
21 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
22 /** |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
23 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
24 */ |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
25 public class GaugeOverviewInfoService extends FLYSService { |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
26 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
27 private static final Logger logger = Logger.getLogger( |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
28 GaugeOverviewInfoService.class); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
29 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
30 public static final String RIVER_XPATH = "/art:river/text()"; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
31 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
32 @Override |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
33 public Document doProcess( |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
34 Document data, |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
35 GlobalContext globalContext, |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
36 CallMeta callMeta |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
37 ) { |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
38 logger.debug("GaugeOverviewInfoService.process"); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
39 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
40 String riverstr = XMLUtils.xpathString( |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
41 data, RIVER_XPATH, ArtifactNamespaceContext.INSTANCE); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
42 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
43 River river = RiverFactory.getRiver(riverstr); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
44 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
45 Document result = XMLUtils.newDocument(); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
46 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
47 if (river == null) { |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
48 logger.warn("No river with name " + riverstr + " found."); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
49 return result; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
50 } |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
51 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
52 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator( |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
53 result, |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
54 ArtifactNamespaceContext.NAMESPACE_URI, |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
55 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
56 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
57 Element go = ec.create("gauge-info"); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
58 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
59 double[] minmax = river.determineMinMaxDistance(); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
60 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
61 Element r = ec.create("river"); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
62 ec.addAttr(r, "name", river.getName(), true); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
63 ec.addAttr(r, "start", Double.toString(minmax[0]), true); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
64 ec.addAttr(r, "end", Double.toString(minmax[1]), true); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
65 ec.addAttr(r, "wstunit", river.getWstUnit().getName(), true); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
66 ec.addAttr(r, "kmup", Boolean.toString(river.getKmUp()), true); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
67 //TODO |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
68 /* ec.addAttr(r, "qmin", , true); */ |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
69 /* ec.addAttr(r, "qmax", , true); */ |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
70 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
71 Element egs = ec.create("gauges"); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
72 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
73 List<Gauge> gauges = river.getGauges(); |
3748
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
74 |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
75 if (logger.isDebugEnabled()) { |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
76 logger.debug("Loaded gauges: " + gauges); |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
77 } |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
78 |
3739
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
79 for (Gauge gauge: river.getGauges()) { |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
80 Element eg = ec.create("gauge"); |
3748
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
81 |
3739
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
82 String name = gauge.getName(); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
83 if (name != null) { |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
84 ec.addAttr(eg, "name", gauge.getName(), true); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
85 } |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
86 |
3748
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
87 String aeo = getGaugeValue(gauge.getAeo()); |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
88 if (aeo != null) { |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
89 ec.addAttr(eg, "aeo", aeo, true); |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
90 } |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
91 |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
92 String datum = getGaugeValue(gauge.getDatum()); |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
93 if (datum != null) { |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
94 ec.addAttr(eg, "datum", datum, true); |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
95 } |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
96 |
3739
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
97 Range range = gauge.getRange(); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
98 if (range != null) { |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
99 double min = range.getA().doubleValue(); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
100 ec.addAttr(eg, "start", Double.toString(min), true); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
101 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
102 BigDecimal b = range.getB(); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
103 if (b != null) { |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
104 double max = range.getB().doubleValue(); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
105 ec.addAttr(eg, "end", Double.toString(max), true); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
106 } |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
107 } |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
108 MinMaxWQ minmaxwq = gauge.fetchMaxMinWQ(); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
109 String minw = getGaugeValue(minmaxwq.getMinW()); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
110 String maxw = getGaugeValue(minmaxwq.getMaxW()); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
111 String minq = getGaugeValue(minmaxwq.getMinQ()); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
112 String maxq = getGaugeValue(minmaxwq.getMaxQ()); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
113 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
114 if (minw != null) { |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
115 ec.addAttr(eg, "minw", minw, true); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
116 } |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
117 if (maxw != null) { |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
118 ec.addAttr(eg, "maxw", maxw, true); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
119 } |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
120 if (minq != null) { |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
121 ec.addAttr(eg, "minq", minq, true); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
122 } |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
123 if (maxq != null) { |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
124 ec.addAttr(eg, "maxq", maxq, true); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
125 } |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
126 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
127 egs.appendChild(eg); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
128 } |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
129 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
130 go.appendChild(r); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
131 go.appendChild(egs); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
132 result.appendChild(go); |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
133 |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
134 return result; |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
135 } |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
136 |
3747
a33df17ac9bb
Use getGaugeValue method also for aeo and datum
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3739
diff
changeset
|
137 /** |
a33df17ac9bb
Use getGaugeValue method also for aeo and datum
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3739
diff
changeset
|
138 * Returns a Double from a BigDecimal value or null if value is null |
a33df17ac9bb
Use getGaugeValue method also for aeo and datum
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3739
diff
changeset
|
139 */ |
3748
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
140 private static String getGaugeValue(BigDecimal value) { |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
141 return value != null |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
142 ? Double.toString(value.doubleValue()) |
99f80469ba2b
Pegelinfo: Made generation of datum and aeo NPE proof.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3747
diff
changeset
|
143 : ""; |
3739
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
144 } |
0edc05642fa4
Add new artifact service for the gauge overview
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
145 } |