Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java @ 3091:179e38aa678d
Some fixing charts are generated now
flys-artifacts/trunk@4690 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Mon, 18 Jun 2012 13:29:15 +0000 |
parents | 960307cf2adc |
children | 6ea299c208cd |
comparison
equal
deleted
inserted
replaced
3090:22def36d37b7 | 3091:179e38aa678d |
---|---|
70 doSectorAverageOut(aaf, doc, visible); | 70 doSectorAverageOut(aaf, doc, visible); |
71 } | 71 } |
72 else if(FIX_ANALYSIS_EVENTS_WQ.equals(name)) { | 72 else if(FIX_ANALYSIS_EVENTS_WQ.equals(name)) { |
73 doAnalysisEventsOut(aaf, doc, visible); | 73 doAnalysisEventsOut(aaf, doc, visible); |
74 } | 74 } |
75 else if(FIX_ANALYSIS_PERIODS_WQ.equals(name)) { | |
76 doAnalysisPeriodsOut(aaf, doc, visible); | |
77 } | |
78 else if(FIX_REFERENCE_EVENTS_WQ.equals(name)) { | 75 else if(FIX_REFERENCE_EVENTS_WQ.equals(name)) { |
79 doReferenceEventsOut(aaf, doc, visible); | 76 doReferenceEventsOut(aaf, doc, visible); |
80 } | 77 } |
81 else if(FIX_WQ_CURVE.equals(name)) { | 78 else if(FIX_WQ_CURVE.equals(name)) { |
82 doWQCurveOut(aaf, doc, visible); | 79 doWQCurveOut(aaf, doc, visible); |
88 logger.warn("Unknown facet name " + name); | 85 logger.warn("Unknown facet name " + name); |
89 return; | 86 return; |
90 } | 87 } |
91 } | 88 } |
92 | 89 |
90 /** Add sector average points to chart */ | |
93 protected void doSectorAverageOut(ArtifactAndFacet aaf, Document doc, boolean visible) { | 91 protected void doSectorAverageOut(ArtifactAndFacet aaf, Document doc, boolean visible) { |
94 logger.debug("doSectorAverageOut"); | 92 logger.debug("doSectorAverageOut"); |
95 | 93 |
96 QWD[] qwds = (QWD[])aaf.getData(context); | 94 QWD[] qwds = (QWD[])aaf.getData(context); |
97 | 95 |
98 if(qwds != null) { | 96 if(qwds != null) { |
99 // TODO | 97 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), doc); |
100 } | 98 for(QW qw : qwds) { |
101 } | 99 if(qw != null) { |
102 | 100 series.add(qw.getQ(), qw.getW()); |
101 } | |
102 } | |
103 | |
104 addAxisSeries(series, 0, visible); | |
105 } | |
106 } | |
107 | |
108 /** Add analysis event points to chart */ | |
103 protected void doAnalysisEventsOut(ArtifactAndFacet aaf, Document doc, boolean visible) { | 109 protected void doAnalysisEventsOut(ArtifactAndFacet aaf, Document doc, boolean visible) { |
104 logger.debug("doAnalysisEventsOut"); | 110 logger.debug("doAnalysisEventsOut"); |
105 | 111 |
106 QWD[] qwds = (QWD[])aaf.getData(context); | 112 QWD[] qwds = (QWD[])aaf.getData(context); |
107 if(qwds != null) { | 113 if(qwds != null) { |
112 | 118 |
113 addAxisSeries(series, 0, visible); | 119 addAxisSeries(series, 0, visible); |
114 } | 120 } |
115 } | 121 } |
116 | 122 |
117 protected void doAnalysisPeriodsOut(ArtifactAndFacet aaf, Document doc, boolean visible) { | 123 /** Add reference event points to chart */ |
118 logger.debug("doAnalysisPeriodsOut"); | |
119 | |
120 DateRange[] dateRanges = (DateRange[])aaf.getData(context); | |
121 //TODO What to do with Date ranges? | |
122 } | |
123 | |
124 protected void doReferenceEventsOut(ArtifactAndFacet aaf, Document doc, boolean visible) { | 124 protected void doReferenceEventsOut(ArtifactAndFacet aaf, Document doc, boolean visible) { |
125 logger.debug("doReferenceEventsOut"); | 125 logger.debug("doReferenceEventsOut"); |
126 | 126 |
127 QW[] qws = (QW[])aaf.getData(context); | 127 QW[] qws = (QW[])aaf.getData(context); |
128 addQWSeries(qws, aaf, doc, visible); | 128 addQWSeries(qws, aaf, doc, visible); |
129 } | 129 } |
130 | 130 |
131 protected void doWQCurveOut(ArtifactAndFacet aaf, Document doc, boolean visible) { | 131 protected void doWQCurveOut(ArtifactAndFacet aaf, Document doc, boolean visible) { |
139 logger.warn("doWQCurveOut: Facet does not contain FixFunction"); | 139 logger.warn("doWQCurveOut: Facet does not contain FixFunction"); |
140 return; | 140 return; |
141 } | 141 } |
142 | 142 |
143 double maxQ = func.getMaxQ(); | 143 double maxQ = func.getMaxQ(); |
144 maxQ = Math.min(2000.0, Math.abs(maxQ)); | |
145 maxQ += maxQ * 0.05; | |
146 | 144 |
147 if(maxQ > 0) { | 145 if(maxQ > 0) { |
148 XYSeries series = DatasetUtilities.sampleFunction2DToSeries( | 146 XYSeries series = DatasetUtilities.sampleFunction2DToSeries( |
149 new Function2DAdapter(func.getFunction()), | 147 new Function2DAdapter(func.getFunction()), |
150 0, // start | 148 0, // start |