Train Activation: Difference between revisions
PeterHicks (talk | contribs) No edit summary |
BarryCarlyon (talk | contribs) →Body: updated some ? fields |
||
Line 59: | Line 59: | ||
|- | |- | ||
|tp_origin_timestamp | |tp_origin_timestamp | ||
| | |Appears to be set to Todays date, in the YYYY-mm-dd format | ||
|- | |- | ||
|creation_timestamp | |creation_timestamp | ||
| | |The time in milliseconds of the Activate Message | ||
|- | |- | ||
|tp_origin_stanox | |tp_origin_stanox |
Revision as of 17:09, 6 August 2012
Overview
The Train Activation message is used to link a 10-character unique train identity to a schedule. This unique identity is used in all other message types to refer to the train.
Unique identities are guaranteed unique only within a calendar month, as the final two digits are the day of the month in which the train ran.
Linking a schedule to a unique identity
Schedules are uniquely identified by UID, start date and STP indicator. The activation message has three fields - 'train_uid', 'schedule_start_date' and 'schedule_type'. To find the schedule that a train is running to, look these up in your timetable database.
Auto and Manual Call
Internally, the activation process is known as 'calling', and a train may be called in one of two ways:
- The majority of schedules are set up as Auto Call. Activation messages will automatically be sent for them around an hour before the scheduled departure time.
- Some schedules are set up as Manual Call where a train may operate more than one schedule - usually a freight train which has three timetables available with different destinations, but will only run to one specific one depending on demand on the day.
There is no difference in handling Auto and Manually called trains.
Data structure
Header
Field | Description |
---|---|
msg_type | Set to '0001' for an activation message |
source_dev_id | Always blank for an activation message |
source_system_id | Set to "TRUST" for an activation message |
original_data_source | Set to "TSIA" for an activation message |
Body
Field | Description |
---|---|
schedule_source | Set to 'C' for CIF schedules, or 'V' for VSTP schedules |
train_file_address | Always blank |
schedule_end_date | The end date of the schedule as per CIF or VSTP |
train_id | Set to the 10-character unique identity for this train, and will appear in other TRUST message types |
tp_origin_timestamp | Appears to be set to Todays date, in the YYYY-mm-dd format |
creation_timestamp | The time in milliseconds of the Activate Message |
tp_origin_stanox | STANOX of the originating location, but may be nil |
origin_dep_timestamp | Scheduled departure time |
train_service_code | Train service code as per schedule |
toc_id | Operating company ID as per [TOC_Codes] |
d1266_record_number | '00000' represents a CIF schedule, any other value indicates a VSTP schedule |
train_call_type | 'AUTOMATIC' for trains which are auto-called, or 'MANUAL' for trains which are manually called (e.g. run-as-required) |
train_uid | Schedule UID being activated. Either a letter and five numbers for a CIF schedule, or a space and five numbers for a VSTP schedule where the numbers are the same as the d1266_record_number field |
train_call_mode | Always set to 'NORMAL' |
schedule_type | One of 'C', 'N', 'O', 'P' |
sched_origin_stanox | STANOX of the originating location. May not be nil |
sched_wtt_id | Working Timetable (WTT) identifier - the train reporting number with either '1', '2', '3', '4', 'C', 'M', 'N' or 'O' appended |
sched_start_date | The start date of the schedule |