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

Fix: Rework error counting in PDF reporter

parent 3260bb7e
...@@ -314,13 +314,20 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -314,13 +314,20 @@ public class PdfStreamReporter implements StreamReporter {
Section bSection = buildings.createSubSection(co.getGmlId().getGmlString()); Section bSection = buildings.createSubSection(co.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), bSection); sectionMap.put(co.getGmlId().getGmlString(), bSection);
if (hasError) { if (hasError) {
numErrorBuildings++;
bSection.setHeadlineColor(ERROR_COLOR); bSection.setHeadlineColor(ERROR_COLOR);
} else { } else {
numOkBuildings++;
bSection.setHeadlineColor(OK_COLOR); bSection.setHeadlineColor(OK_COLOR);
} }
writeErrorForCityObject(co, bSection); writeErrorForCityObject(co, bSection);
Building b = (Building) co; Building b = (Building) co;
for (BuildingPart bp : b.getBuildingParts()) { for (BuildingPart bp : b.getBuildingParts()) {
if (containsError(bp)) {
numErrorBuildings++;
} else {
numOkBuildings++;
}
sectionMap.put(bp.getGmlId().getGmlString(), bSection); sectionMap.put(bp.getGmlId().getGmlString(), bSection);
writeCheckResultForAbstractBuilding(bp, bSection); writeCheckResultForAbstractBuilding(bp, bSection);
} }
...@@ -334,8 +341,10 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -334,8 +341,10 @@ public class PdfStreamReporter implements StreamReporter {
Section tSection = tunnel.createSubSection(co.getGmlId().getGmlString()); Section tSection = tunnel.createSubSection(co.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), tSection); sectionMap.put(co.getGmlId().getGmlString(), tSection);
if (hasError) { if (hasError) {
numErrorTunnel++;
tSection.setHeadlineColor(ERROR_COLOR); tSection.setHeadlineColor(ERROR_COLOR);
} else { } else {
numOkTunnel++;
tSection.setHeadlineColor(OK_COLOR); tSection.setHeadlineColor(OK_COLOR);
} }
writeErrorForCityObject(co, tSection); writeErrorForCityObject(co, tSection);
...@@ -350,8 +359,10 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -350,8 +359,10 @@ public class PdfStreamReporter implements StreamReporter {
Section cfSection = cityFurniture.createSubSection(co.getGmlId().getGmlString()); Section cfSection = cityFurniture.createSubSection(co.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), cfSection); sectionMap.put(co.getGmlId().getGmlString(), cfSection);
if (hasError) { if (hasError) {
numErrorCityFurniture++;
cfSection.setHeadlineColor(ERROR_COLOR); cfSection.setHeadlineColor(ERROR_COLOR);
} else { } else {
numOkCityFurniture++;
cfSection.setHeadlineColor(OK_COLOR); cfSection.setHeadlineColor(OK_COLOR);
} }
writeErrorForCityObject(co, cfSection); writeErrorForCityObject(co, cfSection);
...@@ -364,8 +375,10 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -364,8 +375,10 @@ public class PdfStreamReporter implements StreamReporter {
Section gcSection = genericCityObject.createSubSection(co.getGmlId().getGmlString()); Section gcSection = genericCityObject.createSubSection(co.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), gcSection); sectionMap.put(co.getGmlId().getGmlString(), gcSection);
if (hasError) { if (hasError) {
numErrorGenericCityObject++;
gcSection.setHeadlineColor(ERROR_COLOR); gcSection.setHeadlineColor(ERROR_COLOR);
} else { } else {
numOkGenericCityObject++;
gcSection.setHeadlineColor(OK_COLOR); gcSection.setHeadlineColor(OK_COLOR);
} }
writeErrorForCityObject(co, gcSection); writeErrorForCityObject(co, gcSection);
...@@ -410,7 +423,6 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -410,7 +423,6 @@ public class PdfStreamReporter implements StreamReporter {
for (AbstractFurniture af : ab.getBuildingRoomFurnitureList()) { for (AbstractFurniture af : ab.getBuildingRoomFurnitureList()) {
writeCheckResultForAbstractFurniture(af, root); writeCheckResultForAbstractFurniture(af, root);
} }
for (Storey s : ab.getBuildingStoreys()) { for (Storey s : ab.getBuildingStoreys()) {
writeCheckResultForStorey(s, root); writeCheckResultForStorey(s, root);
} }
...@@ -428,9 +440,14 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -428,9 +440,14 @@ public class PdfStreamReporter implements StreamReporter {
private void writeCheckResultForBridgeObject(BridgeObject bo, Section root) { private void writeCheckResultForBridgeObject(BridgeObject bo, Section root) {
Map<CheckId, CheckResult> results = bo.getAllCheckResults(); Map<CheckId, CheckResult> results = bo.getAllCheckResults();
writeCheckResults(results.values(), root); 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); sectionMap.put(bo.getGmlId().getGmlString(), root);
writeCheckResultForBridgeObject(parts, root); writeCheckResultForBridgeObject(part, root);
} }
for (Geometry geom : bo.getGeometries()) { for (Geometry geom : bo.getGeometries()) {
writeCheckResultForGeometry(geom, root); writeCheckResultForGeometry(geom, root);
...@@ -503,6 +520,11 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -503,6 +520,11 @@ public class PdfStreamReporter implements StreamReporter {
Map<CheckId, CheckResult> results = at.getAllCheckResults(); Map<CheckId, CheckResult> results = at.getAllCheckResults();
writeCheckResults(results.values(), root); writeCheckResults(results.values(), root);
for (TunnelPart tp : at.getTunnelParts()) { for (TunnelPart tp : at.getTunnelParts()) {
if (containsError(tp)) {
numErrorTunnel++;
} else {
numOkTunnel++;
}
sectionMap.put(tp.getGmlId().getGmlString(), root); sectionMap.put(tp.getGmlId().getGmlString(), root);
writeCheckResultForAbstractTunnel(tp, root); writeCheckResultForAbstractTunnel(tp, root);
} }
...@@ -639,9 +661,10 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -639,9 +661,10 @@ public class PdfStreamReporter implements StreamReporter {
@Override @Override
public void finishReport() throws CheckReportWriteException { public void finishReport() throws CheckReportWriteException {
if (buildings != null) { //if (buildings != null) {
countFinishedReportBuildings(); // countFinishedReportBuildings();
} //}
int numBuildings = numErrorBuildings + numOkBuildings; int numBuildings = numErrorBuildings + numOkBuildings;
if (numBuildings > 0) { if (numBuildings > 0) {
statistics.addDistributionBar("Buildings", numErrorBuildings, numOkBuildings); 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