Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/SQRelation.java @ 3297:79c8e0d9fdea
SQ relation: Use only first time period.
flys-artifacts/trunk@4982 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 13 Jul 2012 10:12:45 +0000 |
parents | 45af081061e7 |
children | 0f7abd95c6e2 |
rev | line source |
---|---|
3058
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.states; |
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
3 import de.intevation.artifactdatabase.state.Facet; |
3058
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
5 import de.intevation.artifacts.CallContext; |
3116
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
6 import de.intevation.artifacts.CallMeta; |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
7 |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
8 import de.intevation.flys.artifacts.FLYSArtifact; |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
9 |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
10 import de.intevation.flys.artifacts.access.SQRelationAccess; |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
11 |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
12 import de.intevation.flys.artifacts.model.CalculationResult; |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
13 import de.intevation.flys.artifacts.model.DataFacet; |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
14 import de.intevation.flys.artifacts.model.FacetTypes; |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
15 |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
16 import de.intevation.flys.artifacts.model.sq.SQCurveFacet; |
3101
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
17 import de.intevation.flys.artifacts.model.sq.SQFractionResult; |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
18 import de.intevation.flys.artifacts.model.sq.SQMeasurementFacet; |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
19 import de.intevation.flys.artifacts.model.sq.SQOutlierFacet; |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
20 import de.intevation.flys.artifacts.model.sq.SQRelationCalculation; |
3079
8ad8a227d983
Added model classes for SQ calculation; generate fake results and improved the SQRelationGenerator which now draws the outliers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3072
diff
changeset
|
21 import de.intevation.flys.artifacts.model.sq.SQResult; |
3296
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
22 import de.intevation.flys.artifacts.model.sq.SQOverviewFacet; |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
23 |
3116
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
24 import de.intevation.flys.artifacts.resources.Resources; |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
25 |
3058
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 import de.intevation.flys.artifacts.states.DefaultState; |
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
28 import java.util.List; |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
29 |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
30 import org.apache.log4j.Logger; |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
31 |
3058
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 /** |
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 */ |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
35 public class SQRelation extends DefaultState implements FacetTypes { |
3058
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
37 private static Logger log = Logger.getLogger(SQRelation.class); |
3058
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 |
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 |
3116
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
40 public static final String I18N_FACET_CURVE = |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
41 "facet.sq_relation.curve"; |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
42 |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
43 public static final String I18N_FACET_MEASUREMENTS = |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
44 "facet.sq_relation.measurements"; |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
45 |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
46 public static final String I18N_FACET_OUTLIERS = |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
47 "facet.sq_relation.outliers"; |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
48 |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
49 |
3058
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 public SQRelation() { |
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 } |
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
53 |
3058
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 @Override |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
55 public Object computeAdvance( |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
56 FLYSArtifact artifact, |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
57 String hash, |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
58 CallContext context, |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
59 List<Facet> facets, |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
60 Object old |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
61 ) { |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
62 log.debug("SQRelation.computeAdvance"); |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
63 |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
64 CalculationResult res = old instanceof CalculationResult |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
65 ? (CalculationResult)old |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
66 : new SQRelationCalculation( |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
67 new SQRelationAccess(artifact)).calculate(); |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
68 |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
69 if (facets == null) { |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
70 return res; |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
71 } |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
72 |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
73 SQResult [] sqr = (SQResult [])res.getData(); |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
74 if (sqr == null) { |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
75 return res; |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
76 } |
3101
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
77 |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
78 createFacets(context, facets, sqr, hash); |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
79 |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
80 Facet csv = new DataFacet( |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
81 CSV, "CSV data", ComputeType.ADVANCE, hash, id); |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
82 |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
83 Facet pdf = new DataFacet( |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
84 PDF, "PDF data", ComputeType.ADVANCE, hash, id); |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
85 |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
86 facets.add(csv); |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
87 facets.add(pdf); |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
88 |
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
89 return res; |
3058
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
90 } |
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
91 |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
92 |
3079
8ad8a227d983
Added model classes for SQ calculation; generate fake results and improved the SQRelationGenerator which now draws the outliers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3072
diff
changeset
|
93 protected void createFacets( |
3116
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
94 CallContext context, |
3079
8ad8a227d983
Added model classes for SQ calculation; generate fake results and improved the SQRelationGenerator which now draws the outliers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3072
diff
changeset
|
95 List<Facet> container, |
8ad8a227d983
Added model classes for SQ calculation; generate fake results and improved the SQRelationGenerator which now draws the outliers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3072
diff
changeset
|
96 SQResult[] sqr, |
8ad8a227d983
Added model classes for SQ calculation; generate fake results and improved the SQRelationGenerator which now draws the outliers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3072
diff
changeset
|
97 String hash |
8ad8a227d983
Added model classes for SQ calculation; generate fake results and improved the SQRelationGenerator which now draws the outliers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3072
diff
changeset
|
98 ) { |
3116
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
99 CallMeta meta = context.getMeta(); |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
100 String stateId = getID(); |
3296
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
101 for (int i = 0; i < 6; i++) { |
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
102 container.add(new SQOverviewFacet( |
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
103 i, |
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
104 i, |
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
105 "sq_chart_overview", |
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
106 Resources.getMsg( |
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
107 context.getMeta(), |
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
108 I18N_FACET_CURVE, |
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
109 I18N_FACET_CURVE |
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
110 ), |
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
111 hash, |
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
112 getID() |
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
113 )); |
45af081061e7
Added overview output for sq relation. Currently the overview generator is
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3222
diff
changeset
|
114 } |
3101
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
115 for (int res = 0, n = sqr.length; res < n; res++) { |
3099
ef0dd585b5e0
Display measurements in SQ relation charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3087
diff
changeset
|
116 |
3101
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
117 for (int i = 0; i < 6; i++) { |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
118 SQFractionResult result = sqr[res].getFraction(i); |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
119 |
3101
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
120 if (result == null) { |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
121 log.warn("Fraction at index " + i + " is empty!"); |
3101
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
122 continue; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
123 } |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
124 |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
125 container.add(new SQMeasurementFacet( |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
126 res, |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
127 i, |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
128 getFractionFacetname(1, i), |
3116
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
129 Resources.getMsg( |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
130 meta, |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
131 I18N_FACET_MEASUREMENTS, |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
132 I18N_FACET_MEASUREMENTS |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
133 ), |
3101
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
134 hash, |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
135 stateId |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
136 )); |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
137 |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
138 container.add(new SQCurveFacet( |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
139 res, |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
140 i, |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
141 getFractionFacetname(0, i), |
3116
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
142 Resources.getMsg( |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
143 meta, |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
144 I18N_FACET_CURVE, |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
145 I18N_FACET_CURVE |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
146 ), |
3101
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
147 hash, |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
148 stateId |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
149 )); |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
150 |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
151 for (int j = 0, C = result.getOutliersCount(); j < C; j++) { |
3119
238803b2cb8b
Create a compound index for SQOutlierFacets based on result index and iteration number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3116
diff
changeset
|
152 int index = res; |
238803b2cb8b
Create a compound index for SQOutlierFacets based on result index and iteration number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3116
diff
changeset
|
153 index = index << 16; |
238803b2cb8b
Create a compound index for SQOutlierFacets based on result index and iteration number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3116
diff
changeset
|
154 index = index + j; |
238803b2cb8b
Create a compound index for SQOutlierFacets based on result index and iteration number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3116
diff
changeset
|
155 |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
156 if (log.isDebugEnabled()) { |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
157 log.debug("new outliers facet (index=" +index+ ")"); |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
158 log.debug(" result index = " + res); |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
159 log.debug(" fraction idx = " + i); |
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
160 log.debug(" iteration = " + j); |
3119
238803b2cb8b
Create a compound index for SQOutlierFacets based on result index and iteration number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3116
diff
changeset
|
161 } |
238803b2cb8b
Create a compound index for SQOutlierFacets based on result index and iteration number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3116
diff
changeset
|
162 |
3101
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
163 container.add(new SQOutlierFacet( |
3119
238803b2cb8b
Create a compound index for SQOutlierFacets based on result index and iteration number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3116
diff
changeset
|
164 index, |
3101
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
165 i, |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
166 getFractionFacetname(2, i), |
3116
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
167 Resources.getMsg( |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
168 meta, |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
169 I18N_FACET_OUTLIERS, |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
170 I18N_FACET_OUTLIERS, |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
171 new Object[] { j } |
2feed9b50047
SQ relation now creates Facets with proper i18n labels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3101
diff
changeset
|
172 ), |
3101
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
173 hash, |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
174 stateId |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
175 )); |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
176 } |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
177 } |
3079
8ad8a227d983
Added model classes for SQ calculation; generate fake results and improved the SQRelationGenerator which now draws the outliers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3072
diff
changeset
|
178 } |
3072
0d3dd8230064
Added component stubs for SQ relation calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3058
diff
changeset
|
179 } |
3101
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
180 |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
181 |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
182 protected String getFractionFacetname(int type, int fractionIdx) { |
3222
116b342893e3
SQ: Connect calculation with artifact parameter access.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3119
diff
changeset
|
183 log.debug("getFractionFacetname(): " + type + " | " + fractionIdx); |
3101
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
184 |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
185 switch (type) { |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
186 case 0: |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
187 switch (fractionIdx) { |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
188 case 0: return SQ_A_CURVE; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
189 case 1: return SQ_B_CURVE; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
190 case 2: return SQ_C_CURVE; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
191 case 3: return SQ_D_CURVE; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
192 case 4: return SQ_E_CURVE; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
193 case 5: return SQ_F_CURVE; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
194 } |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
195 case 1: |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
196 switch (fractionIdx) { |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
197 case 0: return SQ_A_MEASUREMENT; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
198 case 1: return SQ_B_MEASUREMENT; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
199 case 2: return SQ_C_MEASUREMENT; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
200 case 3: return SQ_D_MEASUREMENT; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
201 case 4: return SQ_E_MEASUREMENT; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
202 case 5: return SQ_F_MEASUREMENT; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
203 } |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
204 case 2: |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
205 switch (fractionIdx) { |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
206 case 0: return SQ_A_OUTLIER; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
207 case 1: return SQ_B_OUTLIER; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
208 case 2: return SQ_C_OUTLIER; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
209 case 3: return SQ_D_OUTLIER; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
210 case 4: return SQ_E_OUTLIER; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
211 case 5: return SQ_F_OUTLIER; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
212 } |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
213 } |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
214 |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
215 return null; |
b31397addf2f
Create Facets for each SQResult and SQFractionResult.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3099
diff
changeset
|
216 } |
3058
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
217 } |
df4d6b286af8
Added states and transitions for S-Q-relation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
218 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |