Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/process/WOutProcessor.java @ 7289:015e12aac2dc
issue1512: Adjusted Q and WOutProcessors to handle data
coming from FlowVelocityMeasurementArtifacts.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 11 Oct 2013 12:12:52 +0200 |
parents | c882fcf75a0d |
children | 01d1ed168b24 |
comparison
equal
deleted
inserted
replaced
7288:01e103ad8845 | 7289:015e12aac2dc |
---|---|
21 import org.dive4elements.river.exports.XYChartGenerator; | 21 import org.dive4elements.river.exports.XYChartGenerator; |
22 import org.dive4elements.river.exports.DiagramGenerator; | 22 import org.dive4elements.river.exports.DiagramGenerator; |
23 import org.dive4elements.river.jfree.StyledAreaSeriesCollection; | 23 import org.dive4elements.river.jfree.StyledAreaSeriesCollection; |
24 import org.dive4elements.river.jfree.StyledXYSeries; | 24 import org.dive4elements.river.jfree.StyledXYSeries; |
25 import org.dive4elements.river.themes.ThemeDocument; | 25 import org.dive4elements.river.themes.ThemeDocument; |
26 import org.dive4elements.river.model.FlowVelocityMeasurementValue.FastFlowVelocityMeasurementValue; | |
26 import org.dive4elements.river.utils.RiverUtils; | 27 import org.dive4elements.river.utils.RiverUtils; |
27 | 28 |
28 /** | 29 /** |
29 * Add data to chart/generator. | 30 * Add data to chart/generator. |
30 * | 31 * |
44 @Override | 45 @Override |
45 public void doOut( | 46 public void doOut( |
46 DiagramGenerator generator, | 47 DiagramGenerator generator, |
47 ArtifactAndFacet bundle, | 48 ArtifactAndFacet bundle, |
48 ThemeDocument theme, | 49 ThemeDocument theme, |
49 boolean visible) { | 50 boolean visible |
51 ) { | |
52 logger.debug("Processing facet: " + bundle.getFacetName()); | |
50 CallContext context = generator.getCallContext(); | 53 CallContext context = generator.getCallContext(); |
51 Object data = bundle.getData(context); | 54 Object data = bundle.getData(context); |
52 WKms wkms = (WKms) data; | |
53 | |
54 logger.debug("Processing facet: " + bundle.getFacetName()); | |
55 | 55 |
56 XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); | 56 XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); |
57 | |
58 // Handle non WKms data. | |
59 if (bundle.getFacetName().equals(FacetTypes.FLOW_VELOCITY_WATERLEVEL)) { | |
60 FastFlowVelocityMeasurementValue fData = | |
61 (FastFlowVelocityMeasurementValue) data; | |
62 double[][] points = new double[][] {{fData.getStation()},{fData.getW()}}; | |
63 StyledSeriesBuilder.addPoints(series, points, true); | |
64 generator.addAxisSeries(series, axisName, visible); | |
65 return; | |
66 } | |
67 | |
68 // Handle WKms data. | |
69 WKms wkms = (WKms) data; | |
57 | 70 |
58 if (bundle.getFacetName().equals(FacetTypes.DISCHARGE_LONGITUDINAL_C)) { | 71 if (bundle.getFacetName().equals(FacetTypes.DISCHARGE_LONGITUDINAL_C)) { |
59 // Add corrected values | 72 // Add corrected values |
60 WQCKms wqckms = (WQCKms) data; | 73 WQCKms wqckms = (WQCKms) data; |
61 int size = wqckms.size(); | 74 int size = wqckms.size(); |
160 if (facetType.equals(FacetTypes.LONGITUDINAL_W) | 173 if (facetType.equals(FacetTypes.LONGITUDINAL_W) |
161 || facetType.equals(FacetTypes.STATIC_WKMS) | 174 || facetType.equals(FacetTypes.STATIC_WKMS) |
162 || facetType.equals(FacetTypes.HEIGHTMARKS_POINTS) | 175 || facetType.equals(FacetTypes.HEIGHTMARKS_POINTS) |
163 || facetType.equals(FacetTypes.STATIC_WQKMS) | 176 || facetType.equals(FacetTypes.STATIC_WQKMS) |
164 || facetType.equals(FacetTypes.STATIC_WQKMS_W) | 177 || facetType.equals(FacetTypes.STATIC_WQKMS_W) |
178 || facetType.equals(FacetTypes.FLOW_VELOCITY_WATERLEVEL) | |
165 || facetType.equals(FacetTypes.DISCHARGE_LONGITUDINAL_W) | 179 || facetType.equals(FacetTypes.DISCHARGE_LONGITUDINAL_W) |
166 || facetType.equals(FacetTypes.DISCHARGE_LONGITUDINAL_C)) { | 180 || facetType.equals(FacetTypes.DISCHARGE_LONGITUDINAL_C)) { |
167 return true; | 181 return true; |
168 } | 182 } |
169 return false; | 183 return false; |