// semafor 3-komorowy odchylony: p1=nazwa p2,p3,p4=lokacja, p5=rotacja p6=symbol 
// semafor ten mozna stosowac na glownym torze wyjazdowym jesli nie ma mozliwosci jazdy w bok

origin (p2) (p3) (p4)
rotate 0 (p5) 0
//model semafora 3komorowego:
node -1 0 (p1) model -0.45 0.17 0 0 PKP/head3-grw.t3d (p6) Lights 0 1 0 endmodel          //glowica przesunieta w lewo
node -1 0 none model 0 0 0 0 PKP/post-Y-h3.t3d PKP/pkplight_manpost.tga endmodel          //slup+drabinka

node 800 50 none lines 100 50 20  100.0                                //linia zeby byl maszt widoczny z daleka
0.0 0.0 0.0	0.0 4.0 0.0 
endline
rotate 0 0 0
endorigin

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

//zdarzenia okreslajace predkosc przy tym semaforze
event (p1)_sem_info_stop updatevalues 0.0 (p1)_sem_mem SetVelocity 0.0 0 endevent
event (p1)_sem_info_vmax updatevalues 1.0 (p1)_sem_mem SetVelocity -1 -1 endevent
event (p1)_sem_info_v160 updatevalues 1.0 (p1)_sem_mem SetVelocity 160 100 endevent
event (p1)_sem_info_v20 updatevalues 1.0 (p1)_sem_mem SetVelocity 20 0 endevent
// dziala tylko na pojazdy w trybie manewrowym:
event (p1)_sem_info_shunt2 updatevalues 1.0 (p1)_sem_mem ShuntVelocity 40 0 endevent

event (p1)_s1 multiple 0 none (p1)_sem_ligh1 (p1)_sem_info_stop endevent
event (p1)_sem_ligh1 lights 0.0 (p1) 0 1 0 endevent

event (p1)_s2 multiple 0 none (p1)_sem_ligh2 (p1)_sem_info_vmax endevent
event (p1)_sem_ligh2 lights 0.0 (p1) 1 0 0 endevent

event (p1)_s3 multiple 0 none (p1)_sem_ligh3 (p1)_sem_info_v160 endevent
event (p1)_sem_ligh3 lights 0.0 (p1) 2 0 0 endevent

event (p1)_ms2 multiple 0 none (p1)_sem_ligh22 (p1)_sem_info_shunt2 endevent
event (p1)_sem_ligh22 lights 0.0 (p1) 0 0 1 endevent

event (p1)_sz1 multiple 0 none (p1)_sem_ligh31 (p1)_sem_info_v20 endevent
event (p1)_sem_ligh31 lights 0.0 (p1) 0 1 2 endevent

//odczyt z pamieci:
event (p1)_sem_info getvalues 1.0 (p1)_sem_mem endevent
