Changeset 33464 in osm for applications/editors/josm/plugins/pt_assistant
- Timestamp:
- 2017-07-24T21:37:48+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/pt_assistant
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssistantValidatorTest.java
r33462 r33464 21 21 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 22 22 import org.openstreetmap.josm.data.osm.Relation; 23 import org.openstreetmap.josm.data.osm.RelationMember; 23 24 import org.openstreetmap.josm.data.osm.Way; 24 25 import org.openstreetmap.josm.data.validation.Severity; … … 332 333 private void proceedWithSorting(Relation r) { 333 334 335 PTRouteDataManager manager = new PTRouteDataManager(r); 336 StopToWayAssigner assigner = new StopToWayAssigner(manager.getPTWays()); 337 338 for (RelationMember rm : manager.getFailedMembers()) { 339 List<Relation> primitives = new ArrayList<>(1); 340 primitives.add(r); 341 List<OsmPrimitive> highlighted = new ArrayList<>(1); 342 highlighted.add(rm.getMember()); 343 Builder builder = TestError.builder(this, Severity.WARNING, 344 ERROR_CODE_RELATION_MEMBER_ROLES); 345 builder.message(tr("PT: Relation member roles do not match tags")); 346 builder.primitives(primitives); 347 builder.highlight(highlighted); 348 TestError e = builder.build(); 349 errors.add(e); 350 } 351 334 352 // Check if the relation is correct, or only has a wrong sorting order: 335 353 RouteChecker routeChecker = new RouteChecker(r, this); … … 338 356 339 357 SegmentChecker segmentChecker = new SegmentChecker(r, this); 358 segmentChecker.setManager(manager); 359 segmentChecker.setAssigner(assigner); 340 360 segmentChecker.performFirstStopTest(); 341 361 segmentChecker.performLastStopTest(); -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/SegmentChecker.java
r33449 r33464 65 65 66 66 super(relation, test); 67 68 this.setManager(new PTRouteDataManager(relation));69 70 for (RelationMember rm : getManager().getFailedMembers()) {71 List<Relation> primitives = new ArrayList<>(1);72 primitives.add(relation);73 List<OsmPrimitive> highlighted = new ArrayList<>(1);74 highlighted.add(rm.getMember());75 Builder builder = TestError.builder(this.test, Severity.WARNING,76 PTAssistantValidatorTest.ERROR_CODE_RELATION_MEMBER_ROLES);77 builder.message(tr("PT: Relation member roles do not match tags"));78 builder.primitives(primitives);79 builder.highlight(highlighted);80 TestError e = builder.build();81 this.errors.add(e);82 }83 84 this.setAssigner(new StopToWayAssigner(getManager().getPTWays()));85 86 67 } 87 68 -
applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/SegmentCheckerTest.java
r33429 r33464 11 11 import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest; 12 12 import org.openstreetmap.josm.plugins.pt_assistant.ImportUtils; 13 import org.openstreetmap.josm.plugins.pt_assistant.data.PTRouteDataManager; 13 14 import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; 15 import org.openstreetmap.josm.plugins.pt_assistant.utils.StopToWayAssigner; 14 16 15 17 public class SegmentCheckerTest extends AbstractTest { … … 31 33 32 34 SegmentChecker segmentChecker = new SegmentChecker(route, test); 35 PTRouteDataManager manager = new PTRouteDataManager(route); 36 segmentChecker.setManager(manager); 37 segmentChecker.setAssigner(new StopToWayAssigner(manager.getPTWays())); 33 38 segmentChecker.performStopByStopTest(); 34 39 //since 33425 storing correct segments only of continuous routes
Note:
See TracChangeset
for help on using the changeset viewer.