Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/GaugeFinder.java @ 5728:c08f691652cf
WQKmsFactory: Add functionality to fetch WQKms if only column id is known.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 16 Apr 2013 12:39:47 +0200 |
parents | 61f4d4164a30 |
children |
rev | line source |
---|---|
3142
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import java.io.Serializable; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 import java.util.List; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 import org.apache.log4j.Logger; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 import org.hibernate.SQLQuery; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 import org.hibernate.Session; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 import org.hibernate.type.StandardBasicTypes; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 |
5343
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
14 /** Find Gauges and respective Q main values. */ |
3142
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 public class GaugeFinder |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 implements Serializable |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 private static Logger log = Logger.getLogger(GaugeFinder.class); |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 public static final String SQL_DISCHARGE_SECTORS = |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 "SELECT" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 " g.id AS gauge_id," + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 " nmv.name AS name," + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 " CAST(mv.value AS NUMERIC(38,2)) AS value " + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 "FROM gauges g" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 " JOIN main_values mv ON g.id = mv.gauge_id" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 " JOIN named_main_values nmv ON nmv.id = mv.named_value_id" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 " JOIN main_value_types mvt ON nmv.type_id = mvt.id " + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 "WHERE" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 " mvt.name = 'Q' AND (" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 " nmv.name = 'MNQ' OR" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 " nmv.name LIKE 'MNQ(%' OR" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 " nmv.name = 'MQ' OR" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 " nmv.name LIKE 'MQ(%' OR" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 " nmv.name = 'MHQ' OR" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 " nmv.name LIKE 'MHQ(%' OR" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 " nmv.name = 'HQ5' OR" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 " nmv.name LIKE 'HQ5(%') AND" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 " g.river_id = :river_id " + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 "ORDER BY" + |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 " g.id"; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 protected List<GaugeRange> gauges; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 protected boolean isKmUp; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 public GaugeFinder(List<GaugeRange> gauges) { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 this(gauges, true); |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 public GaugeFinder( |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
51 List<GaugeRange> gauges, |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
52 boolean isKmUp |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
53 ) { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
54 this.gauges = gauges; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
55 this.isKmUp = isKmUp; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
56 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
57 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
58 public boolean getIsKmUp() { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
59 return isKmUp; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
60 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
61 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
62 public void setIsKmUp(boolean isKmUp) { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
63 this.isKmUp = isKmUp; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
64 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
65 |
5335
05eeedc5b156
Doc, cosmetic and TODO fixes, renamed field in WQTimeRange.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3401
diff
changeset
|
66 |
05eeedc5b156
Doc, cosmetic and TODO fixes, renamed field in WQTimeRange.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3401
diff
changeset
|
67 /** Find GaugeRange at kilometer. */ |
3143
29022c93027d
FixA: Create a cached GaugeFinderFactory to access the gauge along a river
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3142
diff
changeset
|
68 public GaugeRange find(double km) { |
3142
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
69 for (GaugeRange gauge: gauges) { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
70 if (gauge.inside(km)) { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
71 return gauge; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
72 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
73 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
74 return null; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
75 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
76 |
3143
29022c93027d
FixA: Create a cached GaugeFinderFactory to access the gauge along a river
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3142
diff
changeset
|
77 public GaugeRange find(Range range) { |
29022c93027d
FixA: Create a cached GaugeFinderFactory to access the gauge along a river
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3142
diff
changeset
|
78 return find(isKmUp ? range.start : range.end); |
29022c93027d
FixA: Create a cached GaugeFinderFactory to access the gauge along a river
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3142
diff
changeset
|
79 } |
29022c93027d
FixA: Create a cached GaugeFinderFactory to access the gauge along a river
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3142
diff
changeset
|
80 |
3142
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
81 public GaugeRange find(int gaugeId) { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
82 for (GaugeRange gauge: gauges) { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
83 if (gauge.gaugeId == gaugeId) { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
84 return gauge; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
85 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
86 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
87 return null; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
88 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
89 |
3401
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
90 public List<GaugeRange> getGauges() { |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
91 return gauges; |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
92 } |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
93 |
3142
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
94 public boolean loadDischargeSectors(Session session, int riverId) { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
95 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
96 SQLQuery query = session.createSQLQuery(SQL_DISCHARGE_SECTORS) |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
97 .addScalar("gauge_id", StandardBasicTypes.INTEGER) |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
98 .addScalar("name", StandardBasicTypes.STRING) |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 .addScalar("value", StandardBasicTypes.DOUBLE); |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
101 query.setInteger("river_id", riverId); |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
102 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
103 List<Object []> list = query.list(); |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
104 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
105 if (list.isEmpty()) { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
106 log.warn("River " + riverId + " has no discharge sectors."); |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
107 return false; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
108 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
109 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
110 GaugeRange gauge = null; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
111 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
112 for (Object [] row: list) { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
113 int gaugeId = (Integer)row[0]; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
114 String label = (String) row[1]; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
115 Double value = (Double) row[2]; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
116 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
117 if (gauge == null || gauge.gaugeId != gaugeId) { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
118 if ((gauge = find(gaugeId)) == null) { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
119 log.warn("Cannot find gauge for id " + gaugeId + "."); |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
120 continue; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
121 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
122 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
123 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
124 gauge.addMainValue(label, value); |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
125 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
126 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
127 for (GaugeRange g: gauges) { |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
128 g.buildClasses(); |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
129 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
130 |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
131 return true; |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
132 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
133 } |
9aed2e4de3ca
FixA: Moved GaugeFinder into top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
134 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |