/tg/ Station 13 - Modules - TypesVar Details - Proc Details

crossing_signal

Pedestrian crossing signal for tram

Vars

amber_distance_threshold
inboundInbound station
operating_statusIf us or anything else in the operation chain is broken
outboundOutbound station
sensor_refthe sensor we use
signal_stategreen, amber, or red for tram, blue if it's emag, tram missing, etc.

Procs

set_signal_stateSet the signal state and update appearance.
update_operatingUpdate processing state.
wake_upOnly process if the tram is actually moving

Var Details

amber_distance_threshold

inbound

Inbound station

operating_status

If us or anything else in the operation chain is broken

outbound

Outbound station

sensor_ref

the sensor we use

signal_state

green, amber, or red for tram, blue if it's emag, tram missing, etc.

Proc Details

set_signal_state

Set the signal state and update appearance.

Arguments: new_state - the new state (XING_STATE_RED, etc) force_update - force appearance to update even if state didn't change.

update_operating

Update processing state.

Returns whether we are still processing.

wake_up

Only process if the tram is actually moving