//Semafor Samoczynnej Blokady Liniowej (SBL), trzykomorowy na słupie odchylonym dla toru N, ostatni odstępowy - jako siódmy parametr we wpisie należy podać nazwę poprzedniego semafora SBL.
//Autorzy: Kudłacz, ZiomalCl

origin (p2) (p3) (p4)
rotate 0 (p5) 0
//model semafora 3komorowego blokady liniowej:
node 1000 0 (p1) model 0 0 0 0 sem/glowice/S3YLpcz_dd.t3d tabl/(p6) Lights 1 0 0 endmodel            //glowica 
node 200 0 none model 0 0 0 0 sem/slupy/SBLYLbg.t3d sem/slupy.dds endmodel       //slup
node 100 0 none model 0 0 0 0 sem/drabinki/D4YL.t3d sem/slupy.dds endmodel      //drabinka
node 400 0 none model 0 0 0 0 sem/wskazniki/W18old.t3d sem/slupy.dds endmodel      //wskaznik

node 700 100 none lines 110 110 110  100.0                                      //linia zeby byl maszt widoczny z daleka
0.0 0.0 0.0	0.0 3.0 0.0 
endline

rotate 0 0 0
endorigin

//sygnalizacja SHP:
event (p1)_SHP putvalues 1.0 none (p2) (p3) (p4) CabSignal -1 -1 endevent

node -1 0 (p1)_sem_mem memcell (p2) (p3) (p4) SetVelocity -1 0 none endmemcell

//zdarzenia okreslajace predkosc przy tym semaforze
event (p1)_sem_info_stop updatevalues 10.0 (p1)_sem_mem SetVelocity 0.0 20 endevent
event (p1)_sem_info_vmax updatevalues 1.0 (p1)_sem_mem SetVelocity -1 -1 endevent
event (p1)_sem_info_v100 updatevalues 1.0 (p1)_sem_mem SetVelocity -1 100 endevent
event (p1)_sem_info_v40 updatevalues 1.0 (p1)_sem_mem SetVelocity -1 40 endevent
event (p1)_sem_info_nextstop updatevalues 1.0 (p1)_sem_mem SetVelocity -1 0 endevent

event (p1)_s1 multiple 1 (p1)_sem_mem (p1)_sem_ligh1 (p1)_sem_info_stop (p7)_s5 condition memcompare * -1 * endevent
event (p1)_sem_ligh1 lights 0.0 (p1) 0 1 0 endevent

event (p1)_os1 multiple 1 none (p1)_sem_ligh1o (p1)_sem_info_nextstop (p7)_s2 endevent
event (p1)_sem_ligh1o lights 0.0 (p1) 1 0 0 endevent

//ponizsze zdarzenia os2...os4 wyzwalane sa tylko gdy nie bylo S1:

event (p1)_os2 multiple 1 (p1)_sem_mem (p1)_sem_ligh2o (p1)_sem_info_vmax (p7)_s2 condition memcompare * -1 * endevent
event (p1)_sem_ligh2o lights 0.0 (p1) 0 0 1 endevent

event (p1)_os3 multiple 1 (p1)_sem_mem (p1)_sem_ligh3o (p1)_sem_info_v100 (p7)_s2 condition memcompare * -1 * endevent
event (p1)_sem_ligh3o lights 0.0 (p1) 0 0 2 endevent

event (p1)_os4 multiple 1 (p1)_sem_mem (p1)_sem_ligh4o (p1)_sem_info_v40 (p7)_s2 condition memcompare * -1 * endevent
event (p1)_sem_ligh4o lights 0.0 (p1) 2 0 0 endevent

event (p1)_os4old multiple 1 (p1)_sem_mem (p1)_sem_ligh4oold (p1)_sem_info_v40 (p7)_s2 condition memcompare * -1 * endevent
event (p1)_sem_ligh4oold lights 0.0 (p1) 1 0 1 endevent

//odczyt z pamieci (zdarzenie przypisane do toru przy semaforze):
event (p1)_sem_info getvalues 0 (p1)_sem_mem endevent

// uszkodzony semafor - nieoswietlony:
event (p1)_uszk multiple 0 none (p1)_sem_ligh0 (p7)_s1 (p1)_sem_info_stop endevent
event (p1)_sem_ligh0 lights 0.0 (p1) 0 0 0 endevent