OpenTTD: src/timetable.h File Reference

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

Functions
timetable.h File Reference

Functions related to time tabling. More...

`#include "date_type.h"`
`#include "vehicle_type.h"`

Go to the source code of this file.

## Functions
void | ShowTimetableWindow (const Vehicle *v)
| Show the timetable for a given vehicle.
void | UpdateVehicleTimetable (Vehicle *v, bool travelling)
| Update the timetable for the vehicle.
void | SetTimetableParams (int param1, int param2, Ticks ticks)
| Set the timetable parameters in the format as described by the setting.

## Detailed Description

Functions related to time tabling.

Definition in file timetable.h.

## Function Documentation

void SetTimetableParams | ( | int | param1,
|  | int | param2,
|  | Ticks | ticks
| ) |  |

Set the timetable parameters in the format as described by the setting.

Parameters

  param1 | the first DParam to fill
  param2 | the second DParam to fill
  ticks | the number of ticks to 'draw'

Definition at line 47 of file timetable_gui.cpp.

References _settings_client, DAY_TICKS, ClientSettings::gui, SetDParam(), and GUISettings::timetable_in_ticks.

Referenced by DrawOrderString(), and TimetableWindow::DrawWidget().

void ShowTimetableWindow | ( | const Vehicle * | v | ) |

Show the timetable for a given vehicle.

Parameters

  v | The vehicle to show the timetable for.

Definition at line 710 of file timetable_gui.cpp.

References DeleteWindowById(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, WC_VEHICLE_DETAILS, and WC_VEHICLE_ORDERS.

Referenced by OrdersWindow::OnClick(), and VehicleViewWindow::OnClick().

void UpdateVehicleTimetable | ( | Vehicle * | v,
|  | bool | travelling
| ) |  |

Update the timetable for the vehicle.

Parameters

  v | The vehicle to update the timetable for.
  travelling | Whether we just travelled or waited at a station.

Definition at line 379 of file timetable_cmd.cpp.

References _date, _date_fract, CeilDiv(), ChangeTimetable(), ClrBit(), BaseConsist::cur_real_order_index, Vehicle::current_order, BaseConsist::current_order_time, DAY_TICKS, Vehicle::FirstShared(), Vehicle::GetFirstOrder(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), Order::GetTimetabledTravel(), Order::GetTimetabledWait(), OrderList::GetTimetableTotalDuration(), Order::GetWaitTime(), HasBit(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, INVALID_TICKS, Order::IsTravelTimetabled(), Order::IsType(), Order::IsWaitTimetabled(), BaseConsist::lateness_counter, Vehicle::list, max(), MTF_TRAVEL_TIME, MTF_WAIT_TIME, Vehicle::NextShared(), Vehicle::orders, SetBit(), Order::SetWaitTime(), SetWindowDirty(), BaseConsist::timetable_start, BaseConsist::vehicle_flags, VF_AUTOFILL_PRES_WAIT_TIME, VF_AUTOFILL_TIMETABLE, VF_TIMETABLE_STARTED, and WC_VEHICLE_TIMETABLE.

Referenced by Vehicle::BeginLoading(), Vehicle::LeaveStation(), ProcessOrders(), UpdateOrderDest(), and VehicleEnterDepot().