Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixRealizingCompute.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 | 9744ce3c3853 |
children | 7d7aa54afe0c |
comparison
equal
deleted
inserted
replaced
9424:da19f1f58d72 | 9425:3f49835a00c3 |
---|---|
78 | 78 |
79 if (res.getReport().hasProblems()) { | 79 if (res.getReport().hasProblems()) { |
80 facets.add(new ReportFacet()); | 80 facets.add(new ReportFacet()); |
81 } | 81 } |
82 | 82 |
83 final String id = getID(); | 83 final String stateId = getID(); |
84 final CallMeta meta = context.getMeta(); | 84 final CallMeta meta = context.getMeta(); |
85 | 85 |
86 final FixRealizingResult fixRes = (FixRealizingResult) res.getData(); | 86 final FixRealizingResult fixRes = (FixRealizingResult) res.getData(); |
87 final WQKms[] wqkms = fixRes != null ? fixRes.getWQKms() : new WQKms[0]; | 87 final WQKms[] wqkms = fixRes != null ? fixRes.getWQKms() : new WQKms[0]; |
88 | 88 |
96 } else { | 96 } else { |
97 nameW = wqkms[i].getName(); | 97 nameW = wqkms[i].getName(); |
98 nameQ = "Q(" + nameW + ")"; | 98 nameQ = "Q(" + nameW + ")"; |
99 } | 99 } |
100 | 100 |
101 facets.add(new FixWaterlevelFacet(i, FIX_WQ_LS, nameW, ComputeType.ADVANCE, hash, id)); | 101 facets.add(new FixWaterlevelFacet(i, FIX_WQ_LS, nameW, ComputeType.ADVANCE, hash, stateId)); |
102 facets.add(new FixWaterlevelFacet(i, LONGITUDINAL_W, nameW, ComputeType.ADVANCE, hash, id)); | 102 facets.add(new FixWaterlevelFacet(i, LONGITUDINAL_W, nameW, ComputeType.ADVANCE, hash, stateId)); |
103 facets.add(new FixWaterlevelFacet(i, LONGITUDINAL_Q, nameQ, ComputeType.ADVANCE, hash, id)); | 103 facets.add(new FixWaterlevelFacet(i, LONGITUDINAL_Q, nameQ, ComputeType.ADVANCE, hash, stateId)); |
104 facets.add(new CrossSectionWaterLineFacet(i, nameW)); | 104 facets.add(new CrossSectionWaterLineFacet(i, nameW, ComputeType.ADVANCE, hash, stateId, Integer.valueOf(i))); |
105 | 105 |
106 // XXX: THIS CAN NOT HAPPEN! REMOVE IT! | 106 // XXX: THIS CAN NOT HAPPEN! REMOVE IT! |
107 if (wqkms[i] instanceof WQCKms) { | 107 if (wqkms[i] instanceof WQCKms) { |
108 final String nameC = nameW.replace("benutzerdefiniert", "benutzerdefiniert [korrigiert]"); | 108 final String nameC = nameW.replace("benutzerdefiniert", "benutzerdefiniert [korrigiert]"); |
109 facets.add(new FixWaterlevelFacet(i, DISCHARGE_LONGITUDINAL_C, nameC)); | 109 facets.add(new FixWaterlevelFacet(i, DISCHARGE_LONGITUDINAL_C, nameC)); |
125 final DoubleRange stationRange = event.getStationRange(); | 125 final DoubleRange stationRange = event.getStationRange(); |
126 | 126 |
127 facets.add(new FixReferenceEventsFacet(facetIndex++, event.getColumnId(), FIX_EVENTS, facetDescription, stationRange)); | 127 facets.add(new FixReferenceEventsFacet(facetIndex++, event.getColumnId(), FIX_EVENTS, facetDescription, stationRange)); |
128 } | 128 } |
129 | 129 |
130 facets.add(new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); | 130 facets.add(new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, stateId)); |
131 facets.add(new DataFacet(WST, "WST data", ComputeType.ADVANCE, hash, id)); | 131 facets.add(new DataFacet(WST, "WST data", ComputeType.ADVANCE, hash, stateId)); |
132 facets.add(new DataFacet(PDF, "PDF data", ComputeType.ADVANCE, hash, id)); | 132 facets.add(new DataFacet(PDF, "PDF data", ComputeType.ADVANCE, hash, stateId)); |
133 } | 133 } |
134 | 134 |
135 facets.add(new DataFacet(AT, "AT data", ComputeType.ADVANCE, hash, id)); | 135 facets.add(new DataFacet(AT, "AT data", ComputeType.ADVANCE, hash, stateId)); |
136 | 136 |
137 if (fixRes != null) | 137 if (fixRes != null) |
138 facets.add(new FixWQCurveFacet(0, Resources.getMsg(meta, I18N_WQ_CURVE, I18N_WQ_CURVE) + " (" + access.getFunction() + ")")); | 138 facets.add(new FixWQCurveFacet(0, Resources.getMsg(meta, I18N_WQ_CURVE, I18N_WQ_CURVE) + " (" + access.getFunction() + ")")); |
139 | 139 |
140 return res; | 140 return res; |