Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ReportFacet.java @ 2792:fe987587ebc9
Merged revisions 4539-4540,4543,4545-4546 via svnmerge from
file:///home/clients/bsh/bsh-generischer-viewer/Material/SVN/flys-artifacts/trunk
........
r4539 | teichmann | 2012-05-27 20:02:13 +0200 (So, 27 Mai 2012) | 1 line
FixA: Added forgotten csv/report facets/generators to conf.
........
r4540 | teichmann | 2012-05-27 20:11:31 +0200 (So, 27 Mai 2012) | 1 line
FixA: Fixed class cast bug in report facet.
........
r4543 | teichmann | 2012-05-28 20:35:01 +0200 (Mo, 28 Mai 2012) | 1 line
FixA: Added facet to return delta w/t as CSV
........
r4545 | teichmann | 2012-05-28 22:59:27 +0200 (Mo, 28 Mai 2012) | 1 line
FixA: Made Delta W/t calculation finally work
........
r4546 | teichmann | 2012-05-28 23:34:24 +0200 (Mo, 28 Mai 2012) | 1 line
FixA: corrected fitting (Q->W instead W->Q).
........
flys-artifacts/tags/2.7@4547 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 29 May 2012 04:58:29 +0000 |
parents | ea80e652f033 |
children |
rev | line source |
---|---|
710
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model; |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import de.intevation.artifacts.Artifact; |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 import de.intevation.artifacts.CallContext; |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 import de.intevation.artifactdatabase.state.DefaultFacet; |
1061
b1b0a0b61845
Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
929
diff
changeset
|
7 import de.intevation.artifactdatabase.state.Facet; |
710
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 import de.intevation.flys.artifacts.states.DefaultState.ComputeType; |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 |
2792
fe987587ebc9
Merged revisions 4539-4540,4543,4545-4546 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
11 import de.intevation.flys.artifacts.FLYSArtifact; |
710
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 import org.apache.log4j.Logger; |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 public class ReportFacet |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 extends DefaultFacet |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 implements FacetTypes |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 { |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 private static Logger logger = Logger.getLogger(ReportFacet.class); |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 protected ComputeType type; |
929
960dc6328e70
Facets created by the WaterlevelState store information about state's id and artifact's hash value now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
711
diff
changeset
|
23 protected String hash; |
960dc6328e70
Facets created by the WaterlevelState store information about state's id and artifact's hash value now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
711
diff
changeset
|
24 protected String stateId; |
710
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 public ReportFacet() { |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 this(ComputeType.ADVANCE); |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 } |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 public ReportFacet(ComputeType type) { |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 super(0, REPORT, "report"); |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 this.type = type; |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 } |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 |
929
960dc6328e70
Facets created by the WaterlevelState store information about state's id and artifact's hash value now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
711
diff
changeset
|
35 |
960dc6328e70
Facets created by the WaterlevelState store information about state's id and artifact's hash value now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
711
diff
changeset
|
36 public ReportFacet(ComputeType type, String hash, String stateId) { |
960dc6328e70
Facets created by the WaterlevelState store information about state's id and artifact's hash value now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
711
diff
changeset
|
37 super(0, REPORT, "report"); |
960dc6328e70
Facets created by the WaterlevelState store information about state's id and artifact's hash value now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
711
diff
changeset
|
38 this.type = type; |
960dc6328e70
Facets created by the WaterlevelState store information about state's id and artifact's hash value now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
711
diff
changeset
|
39 this.hash = hash; |
960dc6328e70
Facets created by the WaterlevelState store information about state's id and artifact's hash value now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
711
diff
changeset
|
40 this.stateId = stateId; |
960dc6328e70
Facets created by the WaterlevelState store information about state's id and artifact's hash value now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
711
diff
changeset
|
41 } |
960dc6328e70
Facets created by the WaterlevelState store information about state's id and artifact's hash value now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
711
diff
changeset
|
42 |
710
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 public Object getData(Artifact artifact, CallContext context) { |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 logger.debug("get report data"); |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 |
2792
fe987587ebc9
Merged revisions 4539-4540,4543,4545-4546 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
46 FLYSArtifact flys = (FLYSArtifact)artifact; |
710
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 |
2792
fe987587ebc9
Merged revisions 4539-4540,4543,4545-4546 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
48 CalculationResult cr = (CalculationResult)flys.compute( |
1117
ea80e652f033
Reordered some parameters in a FLYSArtifact method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1061
diff
changeset
|
49 context, hash, stateId, type, false); |
710
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 |
711
69c8541edcc7
Generate report facets if there are problems with the calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
710
diff
changeset
|
51 return cr.getReport(); |
710
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
52 } |
1061
b1b0a0b61845
Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
929
diff
changeset
|
53 |
b1b0a0b61845
Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
929
diff
changeset
|
54 @Override |
b1b0a0b61845
Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
929
diff
changeset
|
55 public Facet deepCopy() { |
b1b0a0b61845
Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
929
diff
changeset
|
56 ReportFacet copy = new ReportFacet(); |
b1b0a0b61845
Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
929
diff
changeset
|
57 copy.set(this); |
b1b0a0b61845
Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
929
diff
changeset
|
58 copy.type = type; |
b1b0a0b61845
Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
929
diff
changeset
|
59 copy.hash = hash; |
b1b0a0b61845
Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
929
diff
changeset
|
60 copy.stateId = stateId; |
b1b0a0b61845
Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
929
diff
changeset
|
61 return copy; |
b1b0a0b61845
Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
929
diff
changeset
|
62 } |
710
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
63 } |
cded0924193d
Added generator and facet for error reports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
64 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |