//Tarcza ostrzegawcza świetlna, trzykomorowa na słupie odchylonym dla toru N.
//Autorzy: Kudłacz, ZiomalCl

origin (p2) (p3) (p4)
rotate 0 (p5) 0
// model tarczy ostrzegawczej:
node 1000 0 (p1) model 0 0 0 0 sem/glowice/To3YLzpp_dd.t3d tabl/(p6) Lights 0 1 0 endmodel            //glowica 
node 200 0 none model 0 0 0 0 sem/slupy/ToSpTmYLbg.t3d sem/slupy.dds endmodel       //slup
node 100 0 none model 0 0 0 0 sem/drabinki/D3YL.t3d sem/slupy.dds endmodel
node 400 0 none model 0 0 0 0 sem/wskazniki/W1new_d.t3d sem/slupy.dds endmodel

node 700 100 none lines 80 80 80 100.0                                          //szara linia zeby byl maszt widoczny z daleka
0.0 0.0 0.0	0.0 4 0.0 
endline

rotate 0 0 0
endorigin

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

// ZDARZENA ZASADNICZE
event (p1)_os1 multiple 0.0 none (p1)_ligh1 (p1)_sem_distinfo_slow endevent
event (p1)_os2 multiple 0.0 none (p1)_ligh2 (p1)_sem_distinfo_fast endevent
event (p1)_os3 multiple 0.0 none (p1)_ligh3 (p1)_sem_distinfo_v100 endevent
event (p1)_os4 multiple 0.0 none (p1)_ligh4 (p1)_sem_distinfo_v40 endevent

event (p1)_sem_distinfo getvalues 1.0 (p1)_sem_distmem endevent

node -1 0 (p1)_sem_distmem memcell (p2) (p3) (p4) SetProximityVelocity 500.0 0.0 none endmemcell

//zdarzenia okreslajace przyblizona predkosc przy nastepnym semaforze
event (p1)_sem_distinfo_slow updatevalues 0.0 (p1)_sem_distmem SetProximityVelocity 500 0 endevent
event (p1)_sem_distinfo_fast updatevalues 0.0 (p1)_sem_distmem SetProximityVelocity 500 -1 endevent
event (p1)_sem_distinfo_v100 updatevalues 0.0 (p1)_sem_distmem SetProximityVelocity 500 100 endevent
event (p1)_sem_distinfo_v40 updatevalues 0.0 (p1)_sem_distmem SetProximityVelocity 500 40 endevent

// przelaczanie swiatel
event (p1)_ligh1 lights 0.0 (p1) 0 1 0 endevent
event (p1)_ligh2 lights 0.0 (p1) 1 0 0 endevent
event (p1)_ligh3 lights 0.0 (p1) 2 0 0 endevent
event (p1)_ligh4 lights 0.0 (p1) 0 0 2 endevent

// uszkodzony semafor - nieoswietlony:
event (p1)_uszk lights 0.0 (p1) 0 0 0 endevent