# HG changeset patch # User Tom Gottfried # Date 1401898934 -7200 # Node ID c0843a658474aa2df2a6438d375bb188dba83f69 # Parent 931dffefc3dd7ace8ee2c00cd48acdc310e625fa Adapted bed differences PDF export to CSV export and some cleanup of field names. diff -r 931dffefc3dd -r c0843a658474 artifacts/doc/conf/jasper/beddifference.jasper Binary file artifacts/doc/conf/jasper/beddifference.jasper has changed diff -r 931dffefc3dd -r c0843a658474 artifacts/doc/conf/jasper/beddifference.jrxml --- a/artifacts/doc/conf/jasper/beddifference.jrxml Wed Jun 04 15:34:22 2014 +0200 +++ b/artifacts/doc/conf/jasper/beddifference.jrxml Wed Jun 04 18:22:14 2014 +0200 @@ -4,15 +4,20 @@ - + - + + + + + + @@ -86,40 +91,60 @@ - - - - - - + - + - + + + + + + + + + + + + + + + + - + - + - + - + + + + + + + + + + + diff -r 931dffefc3dd -r c0843a658474 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDifferenceJRDataSource.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDifferenceJRDataSource.java Wed Jun 04 15:34:22 2014 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDifferenceJRDataSource.java Wed Jun 04 18:22:14 2014 +0200 @@ -62,20 +62,35 @@ else if ("differences".equals(fieldName)) { value = metaData.get("differences"); } - else if ("unit".equals(fieldName)) { - value = metaData.get("unit"); + else if ("kmheader".equals(fieldName)) { + value = metaData.get("kmheader"); + } + else if ("diffpairheader".equals(fieldName)) { + value = metaData.get("diffpairheader"); + } + else if ("diffheader".equals(fieldName)) { + value = metaData.get("diffheader"); + } + else if ("morph1header".equals(fieldName)) { + value = metaData.get("morph1header"); + } + else if ("morph2header".equals(fieldName)) { + value = metaData.get("morph2header"); } else if ("km".equals(fieldName)) { value = data.get(index)[0]; } - else if ("meter".equals(fieldName)) { + else if ("diffpair".equals(fieldName)) { value = data.get(index)[1]; } - else if ("diffpair".equals(fieldName)) { + else if ("diff".equals(fieldName)) { value = data.get(index)[2]; } - else if ("diffpairheader".equals(fieldName)) { - value = metaData.get("diffpairheader"); + else if ("morph1".equals(fieldName)) { + value = data.get(index)[3]; + } + else if ("morph2".equals(fieldName)) { + value = data.get(index)[4]; } return value; } diff -r 931dffefc3dd -r c0843a658474 artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java Wed Jun 04 15:34:22 2014 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java Wed Jun 04 18:22:14 2014 +0200 @@ -160,9 +160,15 @@ source.addMetaData("differences", StringUtils.join( access.getDifferenceArtifactNamePairs(), "\n")); - source.addMetaData("unit", msg(CSV_HEADER_DIFF, "cm")); + source.addMetaData("kmheader", + msg(CSV_HEADER_KM, "km")); source.addMetaData("diffpairheader", msg(CSV_HEADER_DIFF_PAIR, "Difference pair")); + source.addMetaData("diffheader", msg(CSV_HEADER_DIFF, "cm")); + source.addMetaData("morph1header", + msg(CSV_HEADER_MORPH1, "Morph. active width minuend")); + source.addMetaData("morph2header", + msg(CSV_HEADER_MORPH2, "Morph. active width subtrahend")); } @@ -190,13 +196,19 @@ NumberFormat kmf = Formatter.getCalculationKm(context.getMeta()); NumberFormat mf = Formatter.getMeterFormat(context); for (BedDifferencesResult result: results) { + BedDiffYearResult yResult = (BedDiffYearResult) result; double[][] kms = result.getDifferencesData(); String desc = result.getDiffDescription(); + double[][] morph1 = yResult.getMorphWidth1Data(); + double[][] morph2 = yResult.getMorphWidth2Data(); for (int j = 0; j < kms[0].length; j++) { source.addData(new String[] { kmf.format(kms[0][j]), + desc, mf.format(kms[1][j]), - desc }); + mf.format(morph1[1][j]), + mf.format(morph2[1][j]) + }); } } return source;