C# Class TrolleyTracker.Controllers.AssignStopsToRoutes

Datei anzeigen Open project: codeforgreenville/trolley-tracker-api-dot-net Class Usage Examples

Public Methods

Method Description
UpdateRouteStops ( TrolleyTrackerContext db, int routeID, List shapePoints, List stops ) : void

Recalculate which routes the stops belong to, and the order. Call after any change to route or stops

UpdateStopsForAllRoutes ( ) : void
UpdateStopsForRoute ( TrolleyTrackerContext db, int routeID ) : void

Private Methods

Method Description
AngleBetween3Points ( Coordinate A, Coordinate B, Coordinate C ) : double

Find the angle between stop and A-B segment. Used to ensure that stop is only used if it's on the right side of the route

FindDistanceToSegment ( Coordinate stopPosition, Coordinate p1, Coordinate p2, Coordinate &closest ) : double
RemovePreviousRouteStops ( TrolleyTrackerContext db, int routeID ) : void

Method Details

UpdateRouteStops() public method

Recalculate which routes the stops belong to, and the order. Call after any change to route or stops
public UpdateRouteStops ( TrolleyTrackerContext db, int routeID, List shapePoints, List stops ) : void
db TrolleyTracker.Models.TrolleyTrackerContext
routeID int Route being recalculated
shapePoints List
stops List
return void

UpdateStopsForAllRoutes() public method

public UpdateStopsForAllRoutes ( ) : void
return void

UpdateStopsForRoute() public method

public UpdateStopsForRoute ( TrolleyTrackerContext db, int routeID ) : void
db TrolleyTracker.Models.TrolleyTrackerContext
routeID int
return void