Switch Point Functions
Aus EEP Handbuch
Version vom 7. September 2018, 13:47 Uhr von Marc Horstmann (Diskussion | Beiträge)
EEPSetSwitch() | EEPSetSwitch(ID,Direction,Callback) | |
---|---|---|
type: | function |
-- set switch point 0067 to 1 (main line) EEPSetSwitch(67, 1) -- set switch point 0089 to 1 and call EEPOnSwitch_89() EEPSetSwitch(89, 1, 1) |
caller: | script | |
defined in: | EEP | |
parameters: | two or three | |
returns: | one | |
requires: | EEP 10.2 plug-in 2 | |
purpose: | Switches a switch-point. | |
notes: |
|
EEPGetSwitch() | EEPGetSwitch(ID) | |
---|---|---|
type: | function |
currentDirection = EEPGetSwitch(1) if currentDirection == 0 then print("Switch point 1 doesn’t exist") elseif currentDirection == 1 then print("Switch point 1 set to main line") elseif currentDirection == 2 then print("Switch point 1 set to branch line") end |
caller: | script | |
defined in: | EEP | |
parameters: | one | |
returns: | one | |
requires: | EEP 10.2 plug-in 2 | |
purpose: | Provides the current state of a switch point. | |
notes: |
|
EEPRegisterSwitch() | EEPRegisterSwitch(ID) | |
---|---|---|
type: | function |
EEPRegisterSwitch(1) function EEPOnSwitch_1(Direction) print("switch point 1 changed to ", Direction) end |
caller: | script | |
defined in: | EEP | |
parameters: | one | |
returns: | one | |
requires: | EEP 10.2 plug-in 2 | |
purpose: | Registers a switch for the callback function EEPOnSwitch_x(). The requirement of a registration prevents switches from triggering a callback when no appropriate function was declared. | |
notes: |
|
EEPOnSwitch_x() | EEPOnSwitch_x(Direction) | |
---|---|---|
type: | function |
EEPRegisterSwitch(1) function EEPOnSwitch_1(Direction) print("switch point 1 changed to ", Direction) end |
caller: | EEP | |
defined in: | script | |
parameters: | one | |
returns: | none | |
requires: | EEP 10.2 plug-in 2 | |
purpose: | Every aspect change induced by a contact or by manual operation (directly or in a link chain) triggers this callback function if the switch has been registerd for callbacks. However: Changing this or a linked switch’s state by Lua function will not trigger the callback, unless the third argument in that function was a 1. | |
notes: |
|