Signal Functions: Unterschied zwischen den Versionen
Aus EEP Handbuch
(Die Seite wurde neu angelegt: „ <table width="90%" align="center" border="1" style="border: 1px solid black; border-collapse: collapse;"> <tr> <th colspan="2">EEPSetSi…“) |
(kein Unterschied)
|
Aktuelle Version vom 7. September 2018, 13:16 Uhr
| EEPSetSignal() | EEPSetSignal(ID,Aspect,Callback) | |
|---|---|---|
| type: | function |
-- switch signal 0023 to 1 (aspect depends on signal)
EEPSetSignal(23, 1)
-- switch signal 0045 to 1 and call
EEPOnSignal_45()
EEPSetSignal(45, 1, 1)
|
| caller: | script | |
| defined in: | EEP | |
| parameters: | two or three | |
| returns: | one | |
| requires: | EEP 10.2 plug-in 2 | |
| purpose: | Switches a signal | |
| notes: |
|
|
| EEPGetSignal() | EEPGetSignal(ID) | |
|---|---|---|
| type: | function |
currentAspect = EEPGetSignal(1)
if currentAspect == 0 then
print("Signal 1 doesn’t exist")
elseif currentAspect == 1 then
print("Signal 1 set to Danger")
elseif currentAspect == 2 then
print("Signal 1 set to Clear")
end
|
| caller: | script | |
| defined in: | EEP | |
| parameters: | one | |
| returns: | one | |
| requires: | EEP 10.2 plug-in 2 | |
| purpose: | Provides the current state of a signal. | |
| notes: |
|
|
| EEPRegisterSignal() | EEPRegisterSignal(ID) | |
|---|---|---|
| type: | function |
EEPRegisterSignal(1)
function EEPOnSignal_1(newAspect)
print("Signal 1 switched to ", newAspect)
end
|
| caller: | script | |
| defined in: | EEP | |
| parameters: | one | |
| returns: | one | |
| requires: | EEP 10.2 plug-in 2 | |
| purpose: | Registers a signal for the callback function EEPOnSignal_x(). The requirement of a registration prevents signals from triggering a callback when no appropriate function was declared. | |
| notes: |
|
|
| EEPOnSignal_x() | EEPOnSignal_x(Aspect) | |
|---|---|---|
| type: | function |
EEPRegisterSignal(1)
function EEPOnSignal_1(newAspect)
print("Signal 1 switched to ", newAspect)
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 signal has been registerd for callbacks.However: Changing this or a linked signal’s state by Lua function will not trigger thecallback, unless the third argument in that function was a 1. | |
| notes: |
|
|
| EEPGetSignalTrainsCount() | EEPGetSignalTrainsCount(ID) | |
|---|---|---|
| type: | function |
EEPGetSignalTrainsCount(3)
|
| caller: | script | |
| defined in: | EEP | |
| parameters: | one | |
| returns: | one | |
| requires: | EEP 13.2 plug-in 2 | |
| purpose: | Returns the number of consists waiting at the specified signal. | |
| notes: |
|
|
| EEPGetSignalTrainName() | EEPGetSignalTrainName(ID,Positionsnr.) | |
|---|---|---|
| type: | function |
EEPGetSignalTrainName(3 , 1)
|
| caller: | script | |
| defined in: | EEP | |
| parameters: | two | |
| returns: | one | |
| requires: | EEP 13.2 plug-in 2 | |
| purpose: | Returns the name oft he specified consist waiting at the specified signal. | |
| notes: |
|
|