annotate artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityGenerator.java @ 6794:23ab795f2f0e longitudinal-symmetry

Moved most of the functionality of FlowVelocityGenerator to LongitudinalSectionGenerator on the way to longitudinal-section symmetry. ToDos left.
author Tom Gottfried <tom@intevation.de>
date Fri, 09 Aug 2013 12:11:53 +0200
parents ef3b02034f6a
children 7089f338138a
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5549
diff changeset
9 package org.dive4elements.river.exports;
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
4626
5b551e3a58d5 Add start and end km of current chart zoomlevel to the context and use these
Raimund Renkert <rrenkert@intevation.de>
parents: 4468
diff changeset
11 import java.util.Arrays;
5b551e3a58d5 Add start and end km of current chart zoomlevel to the context and use these
Raimund Renkert <rrenkert@intevation.de>
parents: 4468
diff changeset
12
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import org.apache.log4j.Logger;
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 import org.jfree.data.xy.XYSeries;
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 import org.w3c.dom.Document;
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5549
diff changeset
19 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5549
diff changeset
20 import org.dive4elements.artifactdatabase.state.Facet;
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
22 import org.dive4elements.river.artifacts.D4EArtifact;
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5549
diff changeset
24 import org.dive4elements.river.artifacts.access.FlowVelocityAccess;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5549
diff changeset
25 import org.dive4elements.river.artifacts.model.FacetTypes;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5549
diff changeset
26 import org.dive4elements.river.artifacts.model.FlowVelocityData;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5549
diff changeset
27 import org.dive4elements.river.artifacts.model.minfo.BedDiameterResult;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5549
diff changeset
28 import org.dive4elements.river.artifacts.model.minfo.BedloadDiameterResult;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5549
diff changeset
29 import org.dive4elements.river.model.FlowVelocityMeasurementValue;
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5549
diff changeset
31 import org.dive4elements.river.jfree.Bounds;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5549
diff changeset
32 import org.dive4elements.river.jfree.DoubleBounds;
5864
f2e46a668fe6 River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
33 import org.dive4elements.river.jfree.RiverAnnotation;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5549
diff changeset
34 import org.dive4elements.river.jfree.StyledXYSeries;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5549
diff changeset
35
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5864
diff changeset
36 import org.dive4elements.river.utils.RiverUtils;
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 /**
6794
23ab795f2f0e Moved most of the functionality of FlowVelocityGenerator to LongitudinalSectionGenerator on the way to longitudinal-section symmetry. ToDos left.
Tom Gottfried <tom@intevation.de>
parents: 6517
diff changeset
40 * An OutGenerator that generates flow velocity diagramms.
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 *
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 */
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 public class FlowVelocityGenerator
6517
ef3b02034f6a More consistent labeling for longitudinal section diagrams
Tom Gottfried <tom@intevation.de>
parents: 6101
diff changeset
45 extends LongitudinalSectionGenerator
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 implements FacetTypes
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 {
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 public enum YAXIS {
6794
23ab795f2f0e Moved most of the functionality of FlowVelocityGenerator to LongitudinalSectionGenerator on the way to longitudinal-section symmetry. ToDos left.
Tom Gottfried <tom@intevation.de>
parents: 6517
diff changeset
49 V(0), // flow velocity
23ab795f2f0e Moved most of the functionality of FlowVelocityGenerator to LongitudinalSectionGenerator on the way to longitudinal-section symmetry. ToDos left.
Tom Gottfried <tom@intevation.de>
parents: 6517
diff changeset
50 T(1), // tau (shear stress)
23ab795f2f0e Moved most of the functionality of FlowVelocityGenerator to LongitudinalSectionGenerator on the way to longitudinal-section symmetry. ToDos left.
Tom Gottfried <tom@intevation.de>
parents: 6517
diff changeset
51 Q(2), // discharge
23ab795f2f0e Moved most of the functionality of FlowVelocityGenerator to LongitudinalSectionGenerator on the way to longitudinal-section symmetry. ToDos left.
Tom Gottfried <tom@intevation.de>
parents: 6517
diff changeset
52 O(3), // diameter
23ab795f2f0e Moved most of the functionality of FlowVelocityGenerator to LongitudinalSectionGenerator on the way to longitudinal-section symmetry. ToDos left.
Tom Gottfried <tom@intevation.de>
parents: 6517
diff changeset
53 W(4), // waterlevel
23ab795f2f0e Moved most of the functionality of FlowVelocityGenerator to LongitudinalSectionGenerator on the way to longitudinal-section symmetry. ToDos left.
Tom Gottfried <tom@intevation.de>
parents: 6517
diff changeset
54 D(5); // waterlevel-difference
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 protected int idx;
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 private YAXIS(int c) {
6794
23ab795f2f0e Moved most of the functionality of FlowVelocityGenerator to LongitudinalSectionGenerator on the way to longitudinal-section symmetry. ToDos left.
Tom Gottfried <tom@intevation.de>
parents: 6517
diff changeset
57 idx = c;
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58 }
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 }
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 /** The logger that is used in this generator. */
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62 private static Logger logger = Logger.getLogger(FlowVelocityGenerator.class);
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 /**
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 * Key to look up internationalized String for LongitudinalSection diagrams
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 * titles.
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 */
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 public static final String I18N_CHART_TITLE =
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 "chart.flow_velocity.section.title";
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70
6794
23ab795f2f0e Moved most of the functionality of FlowVelocityGenerator to LongitudinalSectionGenerator on the way to longitudinal-section symmetry. ToDos left.
Tom Gottfried <tom@intevation.de>
parents: 6517
diff changeset
71 /** TODO:
23ab795f2f0e Moved most of the functionality of FlowVelocityGenerator to LongitudinalSectionGenerator on the way to longitudinal-section symmetry. ToDos left.
Tom Gottfried <tom@intevation.de>
parents: 6517
diff changeset
72 * are the following defined somewhere else too?
23ab795f2f0e Moved most of the functionality of FlowVelocityGenerator to LongitudinalSectionGenerator on the way to longitudinal-section symmetry. ToDos left.
Tom Gottfried <tom@intevation.de>
parents: 6517
diff changeset
73 * remove them here!
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 */
5549
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
75 private void doBedQualityLoadDiameter(
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
76 BedloadDiameterResult data,
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
77 ArtifactAndFacet aandf,
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
78 Document attr,
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
79 boolean visible) {
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
80 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), attr);
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
81 StyledSeriesBuilder.addPoints(series, data.getDiameterData(), true);
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
82
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
83 addAxisSeries(series, YAXIS.D.idx, visible);
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
84 }
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
85
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
86
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
87 private void doBedQualityTopLayerOut(
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
88 BedDiameterResult data,
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
89 ArtifactAndFacet aandf,
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
90 Document attr,
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
91 boolean visible) {
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
92 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), attr);
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
93 StyledSeriesBuilder.addPoints(series, data.getDiameterSubData(), true);
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
94 addAxisSeries(series, YAXIS.D.idx, visible);
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
95 }
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
96
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
97
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
98 private void doBedQualitySubLayerOut(
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
99 BedDiameterResult data,
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
100 ArtifactAndFacet aandf,
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
101 Document attr,
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
102 boolean visible
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
103 ) {
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
104 logger.debug("Do beddiametersubout");
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
105 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), attr);
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
106 StyledSeriesBuilder.addPoints(series, data.getDiameterSubData(), true);
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
107 addAxisSeries(series, YAXIS.D.idx, visible);
38acd82feeac Added bed quality facets to flow velocity datacage.
Raimund Renkert <rrenkert@intevation.de>
parents: 4826
diff changeset
108 }
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109 }
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org