Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java @ 8420:8a14605fb64a
Removed morpho width from bed height diffs.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 17 Oct 2014 12:50:35 +0200 |
parents | e4606eae8ea5 |
children | 96bf5135cd0e |
comparison
equal
deleted
inserted
replaced
8419:d7d74392cc46 | 8420:8a14605fb64a |
---|---|
57 "export.minfo.beddifference.diff"; | 57 "export.minfo.beddifference.diff"; |
58 | 58 |
59 private static final String CSV_HEADER_DIFF_PAIR = | 59 private static final String CSV_HEADER_DIFF_PAIR = |
60 "export.minfo.beddifference.diff.pair"; | 60 "export.minfo.beddifference.diff.pair"; |
61 | 61 |
62 /* | |
62 private static final String CSV_HEADER_MORPH1 = | 63 private static final String CSV_HEADER_MORPH1 = |
63 "export.minfo.beddifference.morph1"; | 64 "export.minfo.beddifference.morph1"; |
64 | 65 |
65 private static final String CSV_HEADER_MORPH2 = | 66 private static final String CSV_HEADER_MORPH2 = |
66 "export.minfo.beddifference.morph2"; | 67 "export.minfo.beddifference.morph2"; |
68 */ | |
67 | 69 |
68 public static final String JASPER_FILE = | 70 public static final String JASPER_FILE = |
69 "export.minfo.beddifference.pdf.file"; | 71 "export.minfo.beddifference.pdf.file"; |
70 | 72 |
71 public static final String PDF_TITLE= | 73 public static final String PDF_TITLE= |
89 for (BedDifferencesResult result : results) { | 91 for (BedDifferencesResult result : results) { |
90 if (result instanceof BedDiffYearResult) { | 92 if (result instanceof BedDiffYearResult) { |
91 BedDiffYearResult yResult = (BedDiffYearResult) result; | 93 BedDiffYearResult yResult = (BedDiffYearResult) result; |
92 String desc = result.getDiffDescription(); | 94 String desc = result.getDiffDescription(); |
93 double[][] kms = yResult.getDifferencesData(); | 95 double[][] kms = yResult.getDifferencesData(); |
94 double[][] morph1 = yResult.getMorphWidth1Data(); | 96 //double[][] morph1 = yResult.getMorphWidth1Data(); |
95 double[][] morph2 = yResult.getMorphWidth2Data(); | 97 //double[][] morph2 = yResult.getMorphWidth2Data(); |
96 for (int j = 0; j < kms[0].length; j++) { | 98 for (int j = 0; j < kms[0].length; j++) { |
97 writer.writeNext(new String[] { | 99 writer.writeNext(new String[] { |
98 kmf.format(kms[0][j]), | 100 kmf.format(kms[0][j]), |
99 desc, | 101 desc, |
100 mf.format(kms[1][j]), | 102 mf.format(kms[1][j]), |
101 mf.format(morph1[1][j]), | 103 //mf.format(morph1[1][j]), |
102 mf.format(morph2[1][j]), | 104 //mf.format(morph2[1][j]), |
103 }); | 105 }); |
104 } | 106 } |
105 } | 107 } |
106 else { | 108 else { |
107 double[][] kms = result.getDifferencesData(); | 109 double[][] kms = result.getDifferencesData(); |
160 source.addMetaData("kmheader", | 162 source.addMetaData("kmheader", |
161 msg(CSV_HEADER_KM, "km")); | 163 msg(CSV_HEADER_KM, "km")); |
162 source.addMetaData("diffpairheader", | 164 source.addMetaData("diffpairheader", |
163 msg(CSV_HEADER_DIFF_PAIR, "Difference pair")); | 165 msg(CSV_HEADER_DIFF_PAIR, "Difference pair")); |
164 source.addMetaData("diffheader", msg(CSV_HEADER_DIFF, "cm")); | 166 source.addMetaData("diffheader", msg(CSV_HEADER_DIFF, "cm")); |
167 /* | |
165 source.addMetaData("morph1header", | 168 source.addMetaData("morph1header", |
166 msg(CSV_HEADER_MORPH1, "Morph. active width minuend")); | 169 msg(CSV_HEADER_MORPH1, "Morph. active width minuend")); |
167 source.addMetaData("morph2header", | 170 source.addMetaData("morph2header", |
168 msg(CSV_HEADER_MORPH2, "Morph. active width subtrahend")); | 171 msg(CSV_HEADER_MORPH2, "Morph. active width subtrahend")); |
172 */ | |
169 } | 173 } |
170 | 174 |
171 | 175 |
172 protected void writeCSVHeader(CSVWriter writer) { | 176 protected void writeCSVHeader(CSVWriter writer) { |
173 log.debug("writeCSVHeader()"); | 177 log.debug("writeCSVHeader()"); |
175 List<String> header = new ArrayList<String>(); | 179 List<String> header = new ArrayList<String>(); |
176 if (results != null) { | 180 if (results != null) { |
177 header.add(msg(CSV_HEADER_KM, "km")); | 181 header.add(msg(CSV_HEADER_KM, "km")); |
178 header.add(msg(CSV_HEADER_DIFF_PAIR, "difference pair")); | 182 header.add(msg(CSV_HEADER_DIFF_PAIR, "difference pair")); |
179 header.add(msg(CSV_HEADER_DIFF, "cm")); | 183 header.add(msg(CSV_HEADER_DIFF, "cm")); |
184 /* | |
180 if (results.length > 0 && | 185 if (results.length > 0 && |
181 results[0] instanceof BedDiffYearResult) { | 186 results[0] instanceof BedDiffYearResult) { |
182 header.add(msg(CSV_HEADER_MORPH1, "morph width minuend [m]")); | 187 header.add(msg(CSV_HEADER_MORPH1, "morph width minuend [m]")); |
183 header.add(msg(CSV_HEADER_MORPH2, "morph width subtrahend [m]")); | 188 header.add(msg(CSV_HEADER_MORPH2, "morph width subtrahend [m]")); |
184 } | 189 } |
190 */ | |
185 } | 191 } |
186 writer.writeNext(header.toArray(new String[header.size()])); | 192 writer.writeNext(header.toArray(new String[header.size()])); |
187 } | 193 } |
188 | 194 |
189 protected BedDifferenceJRDataSource createJRData() { | 195 protected BedDifferenceJRDataSource createJRData() { |
194 NumberFormat mf = Formatter.getMeterFormat(context); | 200 NumberFormat mf = Formatter.getMeterFormat(context); |
195 for (BedDifferencesResult result: results) { | 201 for (BedDifferencesResult result: results) { |
196 BedDiffYearResult yResult = (BedDiffYearResult) result; | 202 BedDiffYearResult yResult = (BedDiffYearResult) result; |
197 double[][] kms = result.getDifferencesData(); | 203 double[][] kms = result.getDifferencesData(); |
198 String desc = result.getDiffDescription(); | 204 String desc = result.getDiffDescription(); |
199 double[][] morph1 = yResult.getMorphWidth1Data(); | 205 //double[][] morph1 = yResult.getMorphWidth1Data(); |
200 double[][] morph2 = yResult.getMorphWidth2Data(); | 206 //double[][] morph2 = yResult.getMorphWidth2Data(); |
201 for (int j = 0; j < kms[0].length; j++) { | 207 for (int j = 0; j < kms[0].length; j++) { |
202 source.addData(new String[] { | 208 source.addData(new String[] { |
203 kmf.format(kms[0][j]), | 209 kmf.format(kms[0][j]), |
204 desc, | 210 desc, |
205 mf.format(kms[1][j]), | 211 mf.format(kms[1][j]), |
206 mf.format(morph1[1][j]), | 212 //mf.format(morph1[1][j]), |
207 mf.format(morph2[1][j]) | 213 //mf.format(morph2[1][j]) |
208 }); | 214 }); |
209 } | 215 } |
210 } | 216 } |
211 return source; | 217 return source; |
212 } | 218 } |