PyANGKernel.GKPublicLineTimeTable¶
- class GKPublicLineTimeTable¶
-
Synopsis¶
Methods¶
def
__init__()def
addSchedule()def
getDuration()def
getEndTime()def
getPublicLine()def
getSchedules()def
getStartTime()def
removeSchedule()def
setPublicLine()def
sortSchedules()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
A timetable for a transit line.
A line has several timetables (for week-ends, for holidays, for work days…). A timetable holds several schedules, by time of the day (
GKPublicLineTimeTableSchedule).A timetable is created using the
newObjectcall, filled with data and then added to the line:timeTable = GKSystem.getSystem().newObject( "GKPublicLineTimeTable", model ); ... line.addTimeTable( timeTable )
The user will create a schedule using the
createNewSchedulemethod, then will set any information on it (departures, stops time, initial time) and add it to this timetable (addSchedule)schedule = timeTable.createNewSchedule() ... timeTable.addSchedule( schedule )
When setting the schedule, the user will create stop times either directly:
schedule.setStopTime( busStop, 0, 10.0, 2.0 )
or indirectly:
stopTime = GKPublicLineTimeTableScheduleStopTime() stopTime.mean = 10.0 stopTime.deviation = 2.0 schedule.setStopTime( busStop, 0, stopTime )
And will also set the departure times:
departure = GKPublicLineTimeTableScheduleDeparture() schedule.setDepartureType( GKPublicLineTimeTableSchedule.eInterval ) departure.setMeanTime( GKTimeDuration( 0, 5, 0 ) ) ... schedule.addDeparture( departure )
- __init__()¶
- addSchedule(aschedule)¶
- Parameters:
aschedule –
GKPublicLineTimeTableSchedule
Adds a new schedule to this timetable. The pointer is adopted.
- checkSchedulesBusStops()¶
- createNewSchedule()¶
- Return type:
Creates a new
GKPublicLineTimeTableScheduleinstance and returns it. This function doesn’t add the schedule to the timetable, so you must add it afterwards with theaddSchedulefunction.- createNewScheduleWithTime(iTime, iVehicleID)¶
- Parameters:
iTime – str
iVehicleID – int
- getDuration()¶
- Return type:
- getPublicLine()¶
- Return type:
Returns the line for this timetable. Set by the line when the timetable is added to the line.
- getSchedules()¶
- Return type:
.list of GKPublicLineTimeTableSchedule
Returns all the schedules.
get the start time of the first schedule
- getTotalNumberOfVehicles(iStart, iEnd)¶
Get total number of vehicles for a given time window
Returns a list of the vehicles used in this transit timetable.
- removeSchedule(aschedule)¶
- Parameters:
aschedule –
GKPublicLineTimeTableSchedule
Removes the schedule from the list of schedules of this timetable. The schedule itself is not deleted.
- removeSchedules()¶
Removes all the schedules from the list of schedules of this timetable. The schedules themselves are not deleted.
- setPublicLine(aline)¶
- Parameters:
aline –
GKPublicLine
Sets the line for this timetable. Set by the line when the timetable is added to the line.
- sortSchedules()¶
Sorts schedules by time.