// tarcza ostrzegawcza ksztaltowa: (p6) symbol tarczy (np. toa)

origin (p2) (p3) (p4)
rotate 0 (p5) 0
// model tarczy ostrzegawczej:
node 1500 0 (p1)_tk1 model 0 0 0 0 pkp/tk1old.t3d tabl/(p6) lights 0 0 0 endmodel                 
node 1500 0 none model 0.0 0.0 0.15 180.0 pkp/w1n.t3d ip/pkp/2006/w1-2 endmodel
node 800 150 none lines 80 80 80 100.0
0.0 0.0 0.0	0.0 2.5 0.0 
endline
rotate 0 0 0
endorigin

// zdarzena zasadnicze
event (p1)_od1 multiple 0.0 none 
	(p1)_tarczadol 
	(p1)_przeslona1dol 
	(p1)_sem_distinfo_slow 
	(p1)_status_sem_1
	(p1)_sem_od1n
endevent

event (p1)_od2 multiple 0.0 none 
	(p1)_tarczagora 
	(p1)_przeslona1gora 
	(p1)_sem_distinfo_fast 
	(p1)_status_sem_2
	(p1)_sem_od2n
endevent

node -1 0 (p1)_sem_distmem memcell (p2) (p3) (p4) SetProximityVelocity 500.0 0.0 none endmemcell
node -1 0 (p1)_sem_swiatlo memcell (p2) (p3) (p4) 0 1 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

// zmiana obrazu tarczy
event (p1)_tarczadol animation 1 (p1)_tk1 rotate glowica 0 0 0 100 endevent
event (p1)_przeslona1dol animation 1 (p1)_tk1 rotate przeslona_01 0 0 0 60 endevent

event (p1)_tarczagora animation 1 (p1)_tk1 rotate glowica 83 0 0 100 endevent
event (p1)_przeslona1gora animation 1 (p1)_tk1 rotate przeslona_01 0 -44 0 60 endevent

event (p1)_sem_od1n multiple 1.0 (p1)_sem_swiatlo (p1)_sem_ligh1n condition memcompare * 1 1 endevent
event (p1)_sem_od2n multiple 1.0 (p1)_sem_swiatlo (p1)_sem_ligh2n condition memcompare * 2 1 endevent

event (p1)_sem_ligh1n lights 0.0 (p1)_tk1 1 1 0 endevent
event (p1)_sem_ligh2n lights 0.0 (p1)_tk1 1 0 1 endevent

event (p1)_sem_lighd lights 0.0 (p1)_tk1 0 0 0 endevent

event (p1)_zmien_na_dzien updatevalues 0.0 (p1)_sem_swiatlo * * 0 endevent
event (p1)_zmien_na_noc updatevalues 0.0 (p1)_sem_swiatlo * * 1 endevent

event (p1)_status_sem_1 updatevalues 0.0 (p1)_sem_swiatlo * 1 * endevent
event (p1)_status_sem_2 updatevalues 0.0 (p1)_sem_swiatlo * 2 * endevent

event (p1)_dzienny multiple 0.0 none (p1)_zmien_na_dzien (p1)_sem_lighd endevent
event (p1)_nocny multiple 0.0 none (p1)_zmien_na_noc (p1)_sem_od1n (p1)_sem_od2n endevent

//odczyt z pamieci:
event (p1)_sem_distinfo getvalues 1.0 (p1)_sem_distmem endevent

