Difference between revisions of "Component: Traffic Light 2 Way (Scenarios)"
Line 187: | Line 187: | ||
Amount of time to wait in milliseconds when the lights are red or green. | Amount of time to wait in milliseconds when the lights are red or green. | ||
+ | |||
<span style="font-weight: normal;"><u>Transition Time</u></span> | <span style="font-weight: normal;"><u>Transition Time</u></span> |
Revision as of 10:34, 24 May 2018
Author | Matrix TSL |
Version | 1.0 (Release) |
Category | Scenarios |
Contents
Traffic Light 2_Way component
A set of two way traffic lights complete with manual light control, a simple state machine and an automatic mode to allow the lights to take care of themselves.
Examples
There is a detailed walk through of the scenario detailed at the link below to go with this component.
Downloadable macro reference
This component does not contain any downloadable macros
Simulation macro reference
GetStopGo
Reads one of the light sets to determine if it is safe to go through the lights.
Returns 1 for a Green light, otherwise returns 0.
Parameters
- BOOL LightSet
- 0 = Light Set 1, 1 = Light Set 2
Return value
- BOOL : Returns true if the operation is a success, else false
AutomaticMode
Enables or Disables automatic mode where the lights will automatically cycle between modes.
Parameters
- BOOL Mode
- 0 = Auto Mode Disabled, 1 = Auto Mode Enabled
Return value
- This call does not return a value
GetLightState
Reads the state of one of the light sets.
Returns the state as a number.
0=Red, 1=Red+Amber, 2=Green, 3=Amber, 4=Unknown State
Parameters
- BOOL LightSet
- 0 = Light Set 1, 1 = Light Set 2
Return value
SetSingleLight
Direct control over one set of lights.
Parameters
- BOOL LightSet
- 0 = Light Set 1, 1 = Light Set 2
- BOOL Red
- Red - 0 = Off, 1 = On
- BOOL Amber
- Amber - 0 = Off, 1 = On
- BOOL Green
- Green - 0 = Off, 1 = On
Return value
- This call does not return a value
SetLights
Direct control over all 6 of the lights.
Parameters
- BOOL Red0
- 0 = Off, 1 = On
- BOOL Amber0
- 0 = Off, 1 = On
- BOOL Green0
- 0 = Off, 1 = On
- BOOL Red1
- 0 = Off, 1 = On
- BOOL Amber1
- 0 = Off, 1 = On
- BOOL Green1
- 0 = Off, 1 = On
Return value
- This call does not return a value
SetLightState
Follows the standard traffic light sequence.
Parameters
- BOOL LightSet
- 0 = Light Set 1, 1 = Light Set 2
- BYTE SequenceNumber
- 0 = Red, 1 = Red+Amber, 2 = Green, 3 = Amber
Return value
- This call does not return a value
Property reference
Red Colour
This property is of type Color picker and can be referenced with the variable name Red.
Colour Picker to set the Colour of the Red indicators when they are switched on.
Amber Colour
This property is of type Color picker and can be referenced with the variable name Amber.
Colour Picker to set the Colour of the Amber indicators when they are switched on.
Green Colour
This property is of type Color picker and can be referenced with the variable name Green.
Colour Picker to set the Colour of the Green indicators when they are switched on.
Off Colour
This property is of type Color picker and can be referenced with the variable name Off.
Colour Picker to set the Colour of all indicators when they are switched off.
Flow Time
This property is of type Unsigned integer and can be referenced with the variable name Flow.
Amount of time to wait in milliseconds when the lights are red or green.
Transition Time
This property is of type Unsigned integer and can be referenced with the variable name Trans.
Amount of time to wait in milliseconds when the lights are transitioning between flows.