comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelState.java @ 1138:d90f5bfa3ddf

Fix profile loading of cross section diagram. flys-artifacts/trunk@2659 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 07 Sep 2011 07:48:03 +0000
parents 111794adf285
children 96d7842e80ee
comparison
equal deleted inserted replaced
1137:073c36bb94ed 1138:d90f5bfa3ddf
31 31
32 32
33 @Override 33 @Override
34 protected String getUIProvider() { 34 protected String getUIProvider() {
35 return "continue"; 35 return "continue";
36 }
37
38
39 // TODO This is a duplicate of computeAdvance. Resolve.
40 public Object computeFeed(
41 FLYSArtifact artifact,
42 String hash,
43 CallContext context,
44 List<Facet> facets,
45 Object old
46 ) {
47 WINFOArtifact winfo = (WINFOArtifact)artifact;
48
49 String id = getID();
50
51 CalculationResult res = old instanceof CalculationResult
52 ? (CalculationResult)old
53 : winfo.getWaterlevelData();
54
55 if (facets == null) {
56 return res;
57 }
58
59 WQKms [] wqkms = (WQKms [])res.getData();
60
61 for (int i = 0; i < wqkms.length; i++) {
62 String nameW = null;
63 String nameQ = null;
64
65 if (winfo.isQ()) {
66 nameQ = wqkms[i].getName();
67 nameW = "W(" + nameQ + ")";
68 }
69 else {
70 nameW = wqkms[i].getName();
71 nameQ = "Q(" + nameQ + ")";
72 }
73
74 logger.debug("Create facet: " + nameW);
75 logger.debug("Create facet: " + nameQ);
76
77 Facet w = new WaterlevelFacet(
78 i, LONGITUDINAL_W, nameW, ComputeType.ADVANCE, id, hash);
79 Facet q = new WaterlevelFacet(
80 i, LONGITUDINAL_Q, nameQ, ComputeType.ADVANCE, id, hash);
81
82 facets.add(w);
83 facets.add(q);
84 }
85
86 if (wqkms.length > 0) {
87 Facet wst = new DataFacet(
88 WST, "WST data", ComputeType.ADVANCE, hash, id);
89 Facet csv = new DataFacet(
90 CSV, "CSV data", ComputeType.ADVANCE, hash, id);
91
92 facets.add(wst);
93 facets.add(csv);
94 }
95
96 if (res.getReport().hasProblems()) {
97 facets.add(new ReportFacet(ComputeType.ADVANCE, hash, id));
98 }
99
100 // Also register the CrossSectionFacet (added to respective out).
101 facets.add(new CrossSectionFacet("facet.cross_section"));
102 facets.add(new CrossSectionWaterLineFacet("facet.cross_section_water_line"));
103 return res;
36 } 104 }
37 105
38 106
39 @Override 107 @Override
40 public Object computeAdvance( 108 public Object computeAdvance(

http://dive4elements.wald.intevation.org