Commit 04387e46 authored by Riegel's avatar Riegel
Browse files

Fix: Rework error counting in PDF reporter

2 merge requests!28Version 3.17.0 Release,!26Add ZIP-archive support
Showing with 29 additions and 6 deletions
+29 -6
......@@ -314,13 +314,20 @@ public class PdfStreamReporter implements StreamReporter {
Section bSection = buildings.createSubSection(co.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), bSection);
if (hasError) {
numErrorBuildings++;
bSection.setHeadlineColor(ERROR_COLOR);
} else {
numOkBuildings++;
bSection.setHeadlineColor(OK_COLOR);
}
writeErrorForCityObject(co, bSection);
Building b = (Building) co;
for (BuildingPart bp : b.getBuildingParts()) {
if (containsError(bp)) {
numErrorBuildings++;
} else {
numOkBuildings++;
}
sectionMap.put(bp.getGmlId().getGmlString(), bSection);
writeCheckResultForAbstractBuilding(bp, bSection);
}
......@@ -334,8 +341,10 @@ public class PdfStreamReporter implements StreamReporter {
Section tSection = tunnel.createSubSection(co.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), tSection);
if (hasError) {
numErrorTunnel++;
tSection.setHeadlineColor(ERROR_COLOR);
} else {
numOkTunnel++;
tSection.setHeadlineColor(OK_COLOR);
}
writeErrorForCityObject(co, tSection);
......@@ -350,8 +359,10 @@ public class PdfStreamReporter implements StreamReporter {
Section cfSection = cityFurniture.createSubSection(co.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), cfSection);
if (hasError) {
numErrorCityFurniture++;
cfSection.setHeadlineColor(ERROR_COLOR);
} else {
numOkCityFurniture++;
cfSection.setHeadlineColor(OK_COLOR);
}
writeErrorForCityObject(co, cfSection);
......@@ -364,8 +375,10 @@ public class PdfStreamReporter implements StreamReporter {
Section gcSection = genericCityObject.createSubSection(co.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), gcSection);
if (hasError) {
numErrorGenericCityObject++;
gcSection.setHeadlineColor(ERROR_COLOR);
} else {
numOkGenericCityObject++;
gcSection.setHeadlineColor(OK_COLOR);
}
writeErrorForCityObject(co, gcSection);
......@@ -410,7 +423,6 @@ public class PdfStreamReporter implements StreamReporter {
for (AbstractFurniture af : ab.getBuildingRoomFurnitureList()) {
writeCheckResultForAbstractFurniture(af, root);
}
for (Storey s : ab.getBuildingStoreys()) {
writeCheckResultForStorey(s, root);
}
......@@ -428,9 +440,14 @@ public class PdfStreamReporter implements StreamReporter {
private void writeCheckResultForBridgeObject(BridgeObject bo, Section root) {
Map<CheckId, CheckResult> results = bo.getAllCheckResults();
writeCheckResults(results.values(), root);
for (BridgeObject parts : bo.getParts()) {
for (BridgeObject part : bo.getParts()) {
if (containsError(part)) {
numErrorBridge++;
} else {
numOkBridge++;
}
sectionMap.put(bo.getGmlId().getGmlString(), root);
writeCheckResultForBridgeObject(parts, root);
writeCheckResultForBridgeObject(part, root);
}
for (Geometry geom : bo.getGeometries()) {
writeCheckResultForGeometry(geom, root);
......@@ -503,6 +520,11 @@ public class PdfStreamReporter implements StreamReporter {
Map<CheckId, CheckResult> results = at.getAllCheckResults();
writeCheckResults(results.values(), root);
for (TunnelPart tp : at.getTunnelParts()) {
if (containsError(tp)) {
numErrorTunnel++;
} else {
numOkTunnel++;
}
sectionMap.put(tp.getGmlId().getGmlString(), root);
writeCheckResultForAbstractTunnel(tp, root);
}
......@@ -639,9 +661,10 @@ public class PdfStreamReporter implements StreamReporter {
@Override
public void finishReport() throws CheckReportWriteException {
if (buildings != null) {
countFinishedReportBuildings();
}
//if (buildings != null) {
// countFinishedReportBuildings();
//}
int numBuildings = numErrorBuildings + numOkBuildings;
if (numBuildings > 0) {
statistics.addDistributionBar("Buildings", numErrorBuildings, numOkBuildings);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment