// tarcza manewrowa, dwukomorowa, na słupie prostym.
//autorzy: kudłacz, ziomalcl

origin (p2) (p3) (p4)
rotate 0 (p5) 0
//model semafora:
node 1000 0 (p1) model 0 0 0 0 sem/glowice/tminb_dd.t3d tabl/(p6) lights 1 0 endmodel            //glowica 
node 200 0 none model 0 0 0 0 sem/slupy/tosptmibg.t3d sem/slupy endmodel //slup
node 100 0 none model 0 0 0 0 sem/drabinki/d2i.t3d sem/slupy 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

// podstawowe zdarzenia:

//odczyt z pamieci (zdarzenie przypisane do toru przy ktorym stoi semafor):
event (p1)_sem_info getvalues 1.0 (p1)_sem_mem endevent

//stany semafora:

event (p1)_ms1 multiple 0 none (p1)_sem_ligh1 (p1)_sem_info_stop endevent                  

event (p1)_sz multiple 0 none (p1)_sem_ligh2 (p1)_sem_info_v20 (p1)_wyg_sz endevent
event (p1)_wyg_sz multiple 90 (p1)_sem_mem (p1)_ms1 condition memcompare SetVelocity 20 0 endevent

event (p1)_ms2 multiple 0 none (p1)_sem_ligh22 (p1)_sem_info_Shunt25 endevent
event (p1)_m40 multiple 0 none (p1)_sem_ligh22 (p1)_sem_info_Shunt40 endevent




//powyzsze zdarzenia skladaja sie z:


//memcell do pamietania predkosci:
node -1 0 (p1)_sem_mem memcell (p2) (p3) (p4) SetVelocity 0.0 0.0 none endmemcell

//zdarzenia wpisujace w memcell predkosci przy semaforze:
event (p1)_sem_info_stop updatevalues 0.0 (p1)_sem_mem SetVelocity 0.0 0.0 endevent
event (p1)_sem_info_v20 updatevalues 1.0 (p1)_sem_mem SetVelocity 20 0 endevent
event (p1)_sem_info_Shunt25 updatevalues 1.0 (p1)_sem_mem ShuntVelocity 25 0 endevent
event (p1)_sem_info_Shunt40 updatevalues 1.0 (p1)_sem_mem ShuntVelocity 40 0 endevent

//zdarzenia sterujace swiatlami:
event (p1)_sem_ligh1 lights 0.0 (p1) 1 0  endevent
event (p1)_sem_ligh2 lights 0.0 (p1) 1 2 endevent
event (p1)_sem_ligh22 lights 0.0 (p1) 0 1 endevent

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