Handling and displaying operating periods (de: Beachtung und Anzeige der Verkehrstage)
There are multiple possibilities to restrict the operation of certain train parts and/or service at certain operation points to certain days.
#25 describes further handling of operating periods as enhancement.
This tickets describes some basic features. Operating periods are needed for multiple functionality of the viewer:
- Filtering of trains in the tabular timetable viewer
- Filtering of trains in the graphical timetable viewer
- Displaying symbols in the table heading in the tabular timetable viewer (see also #9 (closed))
- Displaying notes as footer in the tabular timetable viewer
How to filter the time span of a certain train?
- Lookup all
train/trainPartSequence/trainPartRef/@ref
- At each corresponding train part (
trainPart[@id = trainPartRef/@ref]
) lookup for@startDate
and@endDate
- Otherwise (if
@startDate
and@endDate
are not available) lookup for the correspondingoperatingPeriod[@id = trainPart/operatingPeriodRef/@ref]
. This element is optional and may occur only once. - Look for
operatingPeriod/@startDate
andoperatingPeriod/@endDate
for the largest possible time span. - Otherwise (if
@startDate
and@endDate
are not available) look at the correspondingtimetablePeriod[@id = operatingPeriod/@timetablePeriodRef]
- Look for
timetablePeriod/@startDate
andtimetablePeriod/@endDate
for the largest possible time span. - Otherwise (if
operatingPeriodRef
is not available) lookup fortimetablePeriod[@id = trainPart/@timetablePeriodRef]
- Look for
timetablePeriod/@startDate
andtimetablePeriod/@endDate
for the largest possible time span. - Otherwise (if no
trainPart/operatingPeriodRef
and notrainPart/@timetablePeriodRef
and notrainPart/@startDate
and notrainPart/@endDate
is available no calender constraints will work for filtering.
How to filter, at which days of the discovered time span the train will be operated?
- If
operatingPeriod/@bitMask
is available, match these binary data to the just discovered dates. - Otherwise (if
@bitMask
is not available) calculate this for the case, that at minimum oneoperatingPeriod/operatingDay
element is available. - Consider all
operatingPeriod/operatingDay
elements and add their constraints withoperatingDay/@operatingCode
as bit mask for the 7 days of the week starting at Monday, rolled out at the period of time between (inclusively)operatingDay/@startDate
andoperatingDay/@endDate
. Assuming, that theoperatingDay
constraints are disjunctive. - Consider all
operatingDay/operatingDayDeviance
elements for holiday. In caseholidayOffset="0"
theoperatingCode
describes the operation related to the 7 days of week starting with Monday. The applicable holiday are defined in thetimetablePeriod[@id = operatingPeriod/@timetablePeriodRef]/holidays/holiday/@holidayDate
. - Otherwise (if
@bitMask
andoperatingPeriod/operatingDay
are not available) assume a daily service.
Which data is useful for displaying?
- Look at
operatingPeriod[@id = trainPart/operatingPeriodRef/@ref]
. - Otherwise (if
operatingPeriodRef
is not available) assume a daily service and display no symbol and no notes for the train in the tabular timetable viewer. - If there is at minimum one
operatingPeriod/specialService
element, display operation period notes, but no symbol. - Otherwise (if
specialService
is not available) look foroperatingPeriod/operatingDay
. If there is no such element, display operation period notes, but no symbol. - Otherwise (if
operatingDay
is available) look for more than oneoperatingPeriod/operatingDay
element. If there are more than one of these elements, display operation period notes, but no symbol. - Otherwise (if at maximum one
operatingDay
element is present) look foroperatingDayDeviance/@holidayOffset ne 0
. If there are furtheroperatingDayDeviance
elements for pre- or post-holiday, display operation period notes, but no symbol. - Otherwise (if only holiday deviances are defined) look for more than one of these definitions. If there is more than one definition for on-holiday deviances, display operation period notes, but no symbol.
- Otherwise (if only one
operatingDay
with at maximum oneoperatingDayDeviance
for a on-holiday is available) deduce typical operation patterns fromoperatingPeriod/operatingDay/@operatingCode
andoperatingPeriod/operatingDay/operatingDayDeviance/@operatingCode
. See also #9 (closed) for a list of these operation patterns.
This data may be used for displaying symbols in the table heading in the tabular timetable viewer. (see also #9 (closed))
What to display just in case, when no symbol is applicable?
- That's the case for all "display operation period notes, but no symbol" hints.
- Look for
operatingPeriod/@name
for the footer of the tabular timetable viewer. - Otherwise (if
@name
is not available) look foroperatingPeriod/@code
. - Otherwise (if
@code
is not available) look foroperatingPeriod/@description
. - Otherwise (if
@description
is not available) display a text "irregular operating period, but no name available"
Samples
- OpenTrack: No
operatingPeriod
s and notimetablePeriod
s - Viriato:
operatingPeriod
s andtimetablePeriod
s, but nooperatingDay
s for "symbols" - TPS:
operatingPeriod
s andtimetablePeriod
s andoperatingDay
s andoperatingDayDeviance
s, but no data for "notes" - FBS:
operatingPeriod
s andtimetablePeriod
s andoperatingDay
s andoperatingDayDeviance
s - IVU:
operatingPeriod
s andtimetablePeriod
s, but nooperatingDay
s for "symbols"