Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationState.java @ 9205:3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
author | gernotbelger |
---|---|
date | Mon, 02 Jul 2018 19:01:09 +0200 |
parents | b4402594213b |
children | 0fc9c82e744e |
comparison
equal
deleted
inserted
replaced
9204:4f411c6ee3ae | 9205:3dae6b78e1da |
---|---|
74 if (facets == null) | 74 if (facets == null) |
75 return res; | 75 return res; |
76 | 76 |
77 final FloodDurationCalculationResults results = (FloodDurationCalculationResults) res.getData(); | 77 final FloodDurationCalculationResults results = (FloodDurationCalculationResults) res.getData(); |
78 final List<FloodDurationCalculationResult> resultList = results.getResults(); | 78 final List<FloodDurationCalculationResult> resultList = results.getResults(); |
79 int index = 0; | 79 int resultIndex = 0; |
80 int themeCount = 0; | |
80 for (final FloodDurationCalculationResult result : resultList) { | 81 for (final FloodDurationCalculationResult result : resultList) { |
81 | 82 |
82 facets.add(FloodDurationProcessor.createFloodDurationFacet(context, hash, this.id, result, index)); | 83 facets.add(FloodDurationProcessor.createFloodDurationFacet(context, hash, this.id, result, resultIndex)); |
83 for (int j = 0; j <= 2; j++) { | 84 |
84 if (result.getMainValueLabel(j) != null) | 85 final int waterlevelCount = result.getWaterlevelCount(); |
85 facets.add(FloodDurationProcessor.createMainValueDurationFacet(context, hash, this.id, result, j)); | 86 |
86 } | 87 facets.add(FloodHeightProcessor.createFloodHeightFacet(context, hash, this.id, result, resultIndex)); |
87 facets.add(FloodHeightProcessor.createFloodHeightFacet(context, hash, this.id, result, index)); | 88 |
88 for (int j = 0; j <= 2; j++) { | 89 for (int j = 0; j < waterlevelCount; j++) { |
89 if (result.getMainValueLabel(j) != null) | 90 |
90 facets.add(FloodHeightProcessor.createMainValueHeightFacet(context, hash, this.id, result, j)); | 91 final String waterlevelLabel = result.getMainValueLabel(j); |
92 // FIXME: use label as label for theme | |
93 | |
94 facets.add(FloodDurationProcessor.createMainValueDurationFacet(context, hash, this.id, result, themeCount, resultIndex, j)); | |
95 facets.add(FloodHeightProcessor.createMainValueHeightFacet(context, hash, this.id, result, themeCount, resultIndex, j)); | |
96 | |
97 themeCount++; | |
91 } | 98 } |
92 | 99 |
93 facets.add(new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id)); | 100 facets.add(new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id)); |
94 facets.add(new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id)); | 101 facets.add(new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id)); |
95 | 102 |
96 index++; | 103 resultIndex++; |
97 } | 104 } |
98 | 105 |
99 final Calculation report = res.getReport(); | 106 final Calculation report = res.getReport(); |
100 if (report.hasProblems()) | 107 if (report.hasProblems()) |
101 facets.add(new ReportFacet(ComputeType.ADVANCE, hash, this.id)); | 108 facets.add(new ReportFacet(ComputeType.ADVANCE, hash, this.id)); |