Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeCompute.java @ 9425:3f49835a00c3
Extended CrossSectionFacet so it may fetch different data from within the artifact result.
Also allows to have acces to the potentially already computed artifact result via its normal computation cache.
author | gernotbelger |
---|---|
date | Fri, 17 Aug 2018 15:31:02 +0200 |
parents | 5e38e2924c07 |
children |
comparison
equal
deleted
inserted
replaced
9424:da19f1f58d72 | 9425:3f49835a00c3 |
---|---|
78 if (res.getReport().hasProblems()) { | 78 if (res.getReport().hasProblems()) { |
79 facets.add(new ReportFacet()); | 79 facets.add(new ReportFacet()); |
80 } | 80 } |
81 | 81 |
82 ExtremeResult eres = (ExtremeResult) res.getData(); | 82 ExtremeResult eres = (ExtremeResult) res.getData(); |
83 WQKms [] wqkms = (WQKms []) eres.getWQKms(); | 83 WQKms [] wqkms = eres.getWQKms(); |
84 | 84 |
85 if (wqkms == null) { | 85 if (wqkms == null) { |
86 log.error("No computation result!"); | 86 log.error("No computation result!"); |
87 return res; | 87 return res; |
88 } | 88 } |
91 String name = wqkms[i].getName(); | 91 String name = wqkms[i].getName(); |
92 // The name already contains "W(...)". | 92 // The name already contains "W(...)". |
93 String qname = name.replace("W(","Q="); | 93 String qname = name.replace("W(","Q="); |
94 qname = qname.substring(0,qname.length()-1); | 94 qname = qname.substring(0,qname.length()-1); |
95 | 95 |
96 Facet w = new WaterlevelFacet( | 96 Facet w = new WaterlevelFacet( i, LONGITUDINAL_W, name, ComputeType.ADVANCE, id, hash ); |
97 i, LONGITUDINAL_W, name, ComputeType.ADVANCE, id, hash); | 97 Facet q = new WaterlevelFacet( i, LONGITUDINAL_Q, qname, ComputeType.ADVANCE, id, hash ); |
98 Facet q = new WaterlevelFacet( | 98 Facet csFacet = new CrossSectionWaterLineFacet( i, name, ComputeType.ADVANCE, hash, getID(), Integer.valueOf(i) ); |
99 i, LONGITUDINAL_Q, qname, ComputeType.ADVANCE, id, hash); | |
100 Facet csFacet = new CrossSectionWaterLineFacet(i, name); | |
101 | 99 |
102 facets.add(w); | 100 facets.add(w); |
103 facets.add(q); | 101 facets.add(q); |
104 facets.add(csFacet); | 102 facets.add(csFacet); |
105 } | 103 } |
106 | 104 |
107 | 105 |
108 facets.add( | 106 facets.add(new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); |
109 new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); | 107 facets.add(new DataFacet(PDF, "PDF data", ComputeType.ADVANCE, hash, id)); |
110 facets.add( | 108 facets.add(new DataFacet(WST, "WST data", ComputeType.ADVANCE, hash, id)); |
111 new DataFacet(PDF, "PDF data", ComputeType.ADVANCE, hash, id)); | |
112 facets.add( | |
113 new DataFacet(WST, "WST data", ComputeType.ADVANCE, hash, id)); | |
114 | 109 |
115 facets.add(new ExtremeCurveFacet(Resources.getMsg(context.getMeta(), | 110 facets.add(new ExtremeCurveFacet(Resources.getMsg(context.getMeta(), "extreme_wq_curve", "extreme_wq_curve"))); |
116 "extreme_wq_curve", "extreme_wq_curve"))); | 111 facets.add(new ExtremeCurveFacet(Resources.getMsg(context.getMeta(), "extreme_wq_base_curve", "extreme_wq_base_curve"), true)); |
117 facets.add(new ExtremeCurveFacet(Resources.getMsg(context.getMeta(), | |
118 "extreme_wq_base_curve", "extreme_wq_base_curve"), | |
119 true)); | |
120 | 112 |
121 return res; | 113 return res; |
122 } | 114 } |
123 } | 115 } |
124 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : | 116 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |