Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java @ 2731:55a3b575f644
Handle 'classical' discharges, theoretically.
flys-artifacts/trunk@4464 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 22 May 2012 18:50:57 +0000 |
parents | 5652a851f1b4 |
children | de60d1dfdcdf |
comparison
equal
deleted
inserted
replaced
2730:0657e7966c87 | 2731:55a3b575f644 |
---|---|
12 import org.jfree.data.xy.XYSeries; | 12 import org.jfree.data.xy.XYSeries; |
13 | 13 |
14 import de.intevation.artifactdatabase.state.ArtifactAndFacet; | 14 import de.intevation.artifactdatabase.state.ArtifactAndFacet; |
15 import de.intevation.artifactdatabase.state.Facet; | 15 import de.intevation.artifactdatabase.state.Facet; |
16 | 16 |
17 import de.intevation.flys.artifacts.WINFOArtifact; | |
18 | |
17 import de.intevation.flys.artifacts.model.FacetTypes; | 19 import de.intevation.flys.artifacts.model.FacetTypes; |
18 import de.intevation.flys.artifacts.model.WQKms; | 20 import de.intevation.flys.artifacts.model.WQKms; |
21 import de.intevation.flys.artifacts.model.WKms; | |
19 | 22 |
20 import de.intevation.flys.jfree.FLYSAnnotation; | 23 import de.intevation.flys.jfree.FLYSAnnotation; |
21 import de.intevation.flys.jfree.StickyAxisAnnotation; | 24 import de.intevation.flys.jfree.StickyAxisAnnotation; |
22 import de.intevation.flys.jfree.StyledXYSeries; | 25 import de.intevation.flys.jfree.StyledXYSeries; |
23 | 26 |
89 protected String getDefaultYAxisLabel(int pos) { | 92 protected String getDefaultYAxisLabel(int pos) { |
90 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); | 93 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); |
91 } | 94 } |
92 | 95 |
93 | 96 |
97 /** | |
98 * Process data, build up plot. | |
99 */ | |
94 @Override | 100 @Override |
95 public void doOut( | 101 public void doOut( |
96 ArtifactAndFacet artifactFacet, | 102 ArtifactAndFacet artifactFacet, |
97 Document attr, | 103 Document attr, |
98 boolean visible | 104 boolean visible |
127 || name.equals(MAINVALUES_W) | 133 || name.equals(MAINVALUES_W) |
128 ) { | 134 ) { |
129 doAnnotations((FLYSAnnotation) | 135 doAnnotations((FLYSAnnotation) |
130 artifactFacet.getData(context), artifactFacet, attr, visible); | 136 artifactFacet.getData(context), artifactFacet, attr, visible); |
131 } | 137 } |
132 else if (name.equals(STATIC_WKMS_INTERPOL)) { | 138 else if (name.equals(STATIC_WKMS_INTERPOL) || name.equals(HEIGHTMARKS_POINTS)) { |
133 doWAnnotations( | 139 doWAnnotations( |
134 artifactFacet.getData(context), | 140 artifactFacet.getData(context), |
135 artifactFacet, | 141 artifactFacet, |
136 attr, | 142 attr, |
137 visible); | 143 visible); |
139 else if (FacetTypes.IS.MANUALPOINTS(name)) { | 145 else if (FacetTypes.IS.MANUALPOINTS(name)) { |
140 doPoints(artifactFacet.getData(context), | 146 doPoints(artifactFacet.getData(context), |
141 artifactFacet, | 147 artifactFacet, |
142 attr, visible, YAXIS.W.idx); | 148 attr, visible, YAXIS.W.idx); |
143 } | 149 } |
150 else if (name.equals(DISCHARGE_CURVE)) { | |
151 doDischargeOut( | |
152 (WINFOArtifact) artifactFacet.getArtifact(), | |
153 artifactFacet.getData(context), | |
154 artifactFacet.getFacetDescription(), | |
155 attr, | |
156 visible); | |
157 } | |
144 else { | 158 else { |
145 logger.warn("Unknown facet type for computed discharge: " + name); | 159 logger.warn("Unknown facet type for computed discharge: " + name); |
146 return; | 160 return; |
147 } | 161 } |
148 } | 162 } |
222 boolean visible | 236 boolean visible |
223 ) { | 237 ) { |
224 Facet facet = aandf.getFacet(); | 238 Facet facet = aandf.getFacet(); |
225 | 239 |
226 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>(); | 240 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>(); |
227 double [][] data = (double [][]) wqkms; | 241 // Try to find them as WKms as well... |
228 for (int i = 0; i< data[0].length; i++) { | 242 if (wqkms instanceof double[][]) { |
229 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), | 243 double [][] data = (double [][]) wqkms; |
230 (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); | 244 for (int i = 0; i< data[0].length; i++) { |
231 } | 245 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), |
232 | 246 (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); |
233 doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), | 247 } |
234 aandf, theme, visible); | 248 |
249 doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), | |
250 aandf, theme, visible); | |
251 } | |
252 else { | |
253 WKms data = (WKms) wqkms; | |
254 // assume its WKms | |
255 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), | |
256 (float) data.getW(0), StickyAxisAnnotation.SimpleAxis.Y_AXIS)); | |
257 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), | |
258 (float) 180f, StickyAxisAnnotation.SimpleAxis.Y_AXIS)); | |
259 | |
260 doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), | |
261 aandf, theme, visible); | |
262 } | |
235 } | 263 } |
236 } | 264 } |
237 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 265 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |