Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java @ 9556:9b8e8fc1f408
Use facetName in all processors as themeType for legend aggregation.
author | gernotbelger |
---|---|
date | Tue, 23 Oct 2018 16:26:58 +0200 |
parents | ddcd52d239cd |
children |
comparison
equal
deleted
inserted
replaced
9555:ef5754ba5573 | 9556:9b8e8fc1f408 |
---|---|
164 ArtifactAndFacet artifactFacet, | 164 ArtifactAndFacet artifactFacet, |
165 ThemeDocument theme, | 165 ThemeDocument theme, |
166 boolean visible | 166 boolean visible |
167 ) { | 167 ) { |
168 String name = artifactFacet.getFacetName(); | 168 String name = artifactFacet.getFacetName(); |
169 String facetDescription = artifactFacet.getFacetDescription(); | |
170 | |
169 log.debug("FixDeltaWtGenerator.doOut: " + name); | 171 log.debug("FixDeltaWtGenerator.doOut: " + name); |
170 log.debug("Theme description is: " | 172 log.debug("Theme description is: " |
171 + artifactFacet.getFacetDescription()); | 173 + facetDescription); |
172 | 174 |
173 this.artifact = (D4EArtifact)artifactFacet.getArtifact(); | 175 this.artifact = (D4EArtifact)artifactFacet.getArtifact(); |
174 | 176 |
175 final CallContext context = getContext(); | 177 final CallContext context = getContext(); |
176 | 178 |
177 if (name.contains(FIX_SECTOR_AVERAGE_DWT)) { | 179 if (name.contains(FIX_SECTOR_AVERAGE_DWT)) { |
178 doSectorAverageOut( | 180 doSectorAverageOut( |
181 name, | |
179 artifactFacet.getData(context), | 182 artifactFacet.getData(context), |
180 artifactFacet.getFacetDescription(), | 183 facetDescription, |
181 theme, | 184 theme, |
182 visible); | 185 visible); |
183 } | 186 } |
184 else if (name.equals(FIX_REFERENCE_EVENTS_DWT)) { | 187 else if (name.equals(FIX_REFERENCE_EVENTS_DWT)) { |
185 doReferenceEventsOut( | 188 doReferenceEventsOut( |
189 name, | |
186 artifactFacet.getData(context), | 190 artifactFacet.getData(context), |
187 artifactFacet.getFacetDescription(), | 191 facetDescription, |
188 theme, | 192 theme, |
189 visible); | 193 visible); |
190 } | 194 } |
191 else if (name.equals(FIX_ANALYSIS_EVENTS_DWT)) { | 195 else if (name.equals(FIX_ANALYSIS_EVENTS_DWT)) { |
192 doAnalysisEventsOut( | 196 doAnalysisEventsOut( |
197 name, | |
193 artifactFacet.getData(context), | 198 artifactFacet.getData(context), |
194 artifactFacet.getFacetDescription(), | 199 facetDescription, |
195 theme, | 200 theme, |
196 visible); | 201 visible); |
197 } | 202 } |
198 else if (name.equals(FIX_DEVIATION_DWT)) { | 203 else if (name.equals(FIX_DEVIATION_DWT)) { |
199 doDeviationOut( | 204 doDeviationOut( |
200 artifactFacet.getData(context), | 205 artifactFacet.getData(context), |
201 artifactFacet.getFacetDescription(), | 206 facetDescription, |
202 theme, | 207 theme, |
203 visible); | 208 visible); |
204 } | 209 } |
205 else if (name.equals(FIX_ANALYSIS_PERIODS_DWT)) { | 210 else if (name.equals(FIX_ANALYSIS_PERIODS_DWT)) { |
206 doAnalysisPeriodsOut( | 211 doAnalysisPeriodsOut( |
253 : uniqueDate(date+30L*1000L); // add 30secs. | 258 : uniqueDate(date+30L*1000L); // add 30secs. |
254 } | 259 } |
255 | 260 |
256 | 261 |
257 protected void doSectorAverageOut( | 262 protected void doSectorAverageOut( |
263 String facetName, | |
258 Object data, | 264 Object data, |
259 String desc, | 265 String desc, |
260 ThemeDocument theme, | 266 ThemeDocument theme, |
261 boolean visible) | 267 boolean visible) |
262 { | 268 { |
263 log.debug("doSectorAverageOut(): description = " + desc); | 269 log.debug("doSectorAverageOut(): description = " + desc); |
264 | 270 |
265 QWDDateRange qwd = (QWDDateRange) data; | 271 QWDDateRange qwd = (QWDDateRange) data; |
266 TimeSeriesCollection tsc = new TimeSeriesCollection(); | 272 TimeSeriesCollection tsc = new TimeSeriesCollection(); |
267 TimeSeries series = new StyledTimeSeries(desc, theme); | 273 TimeSeries series = new StyledTimeSeries(facetName, desc, theme); |
268 | 274 |
269 if (qwd == null || qwd.qwd == null || qwd.dateRange == null) { | 275 if (qwd == null || qwd.qwd == null || qwd.dateRange == null) { |
270 return; | 276 return; |
271 } | 277 } |
272 RegularTimePeriod rtp = new FixedMillisecond(qwd.qwd.getDate()); | 278 RegularTimePeriod rtp = new FixedMillisecond(qwd.qwd.getDate()); |
299 } | 305 } |
300 } | 306 } |
301 | 307 |
302 | 308 |
303 protected void doAnalysisEventsOut( | 309 protected void doAnalysisEventsOut( |
310 String facetName, | |
304 Object data, | 311 Object data, |
305 String desc, | 312 String desc, |
306 ThemeDocument theme, | 313 ThemeDocument theme, |
307 boolean visible | 314 boolean visible |
308 ) { | 315 ) { |
309 log.debug("doAnalysisEventsOut: desc = " + desc); | 316 log.debug("doAnalysisEventsOut: desc = " + desc); |
310 | 317 |
311 QWD qwd = (QWD) data; | 318 QWD qwd = (QWD) data; |
312 doQWDEventsOut(qwd, desc, theme, visible); | 319 doQWDEventsOut(facetName, qwd, desc, theme, visible); |
313 } | 320 } |
314 | 321 |
315 | 322 |
316 protected void doQWDEventsOut( | 323 protected void doQWDEventsOut( |
324 String facetName, | |
317 QWD qwd, | 325 QWD qwd, |
318 String desc, | 326 String desc, |
319 ThemeDocument theme, | 327 ThemeDocument theme, |
320 boolean visible | 328 boolean visible |
321 ) { | 329 ) { |
334 | 342 |
335 final long time = uniqueDate(qwd.getDate().getTime()); | 343 final long time = uniqueDate(qwd.getDate().getTime()); |
336 final RegularTimePeriod rtp = new FixedMillisecond(time); | 344 final RegularTimePeriod rtp = new FixedMillisecond(time); |
337 final double value = qwd.getDeltaW(); | 345 final double value = qwd.getDeltaW(); |
338 | 346 |
339 final TimeSeries series = new StyledTimeSeries(label, themeInterpolated, shape); | 347 final TimeSeries series = new StyledTimeSeries(facetName,label, themeInterpolated, shape); |
340 series.addOrUpdate(rtp, value); | 348 series.addOrUpdate(rtp, value); |
341 | 349 |
342 tsc.addSeries(series); | 350 tsc.addSeries(series); |
343 | 351 |
344 addAxisDataset(tsc, 0, visible); | 352 addAxisDataset(tsc, 0, visible); |
375 flysAnno.setTextAnnotations(textAnnos); | 383 flysAnno.setTextAnnotations(textAnnos); |
376 addAnnotations(flysAnno); | 384 addAnnotations(flysAnno); |
377 } | 385 } |
378 | 386 |
379 protected void doReferenceEventsOut( | 387 protected void doReferenceEventsOut( |
388 String facetName, | |
380 Object data, | 389 Object data, |
381 String desc, | 390 String desc, |
382 ThemeDocument theme, | 391 ThemeDocument theme, |
383 boolean visible | 392 boolean visible |
384 ) { | 393 ) { |
385 log.debug("doReferenceEventsOut: desc = " + desc); | 394 log.debug("doReferenceEventsOut: desc = " + desc); |
386 | 395 |
387 QWD qwd = (QWD) data; | 396 QWD qwd = (QWD) data; |
388 doQWDEventsOut(qwd, desc, theme, visible); | 397 doQWDEventsOut(facetName, qwd, desc, theme, visible); |
389 } | 398 } |
390 | 399 |
391 | 400 |
392 protected void doDeviationOut( | 401 protected void doDeviationOut( |
393 Object data, | 402 Object data, |