# Segnale di protezione automatico ad una luce # Aspetti consentiti: # R via impedita # G o V via libera # Aspect: red IconE: r_PE.xpm IconW: r_PW.xpm IconN: r_PN.xpm IconS: r_PS.xpm Action: stop Aspect: yellow IconE: y_PE.xpm IconW: y_PW.xpm IconN: y_PN.xpm IconS: y_PS.xpm Action: proceed Aspect: green IconE: g_PE.xpm IconW: g_PW.xpm IconN: g_PN.xpm IconS: g_PS.xpm Action: proceed OnInit: .aspect = red .fleeted = 1 end # user cleared the signal # and the path ahead is not occupied by a train OnCleared: if .aspect = red if next.aspect = red .aspect = yellow else .aspect = green end end end # another signal changed aspect, # see if we need to change our aspect as well OnUpdate: if .aspect = red return end if next.aspect = red .aspect = yellow else .aspect = green end end