#
#
Aspect: red
   IconE: sww_b_r_b_r_b_car_E.xpm
   IconW: sww_b_r_b_r_b_car_W.xpm
   IconN: sww_b_r_b_r_b_car_N.xpm
   IconS: sww_b_r_b_r_b_car_S.xpm
   Action: stop

Aspect: double_red
   IconE: sww_b_r_b_r_b_car_E.xpm
   IconW: sww_b_r_b_r_b_car_W.xpm
   IconN: sww_b_r_b_r_b_car_N.xpm
   IconS: sww_b_r_b_r_b_car_S.xpm
   Action: stop

Aspect: yellow
   IconE: sww_y_b_b_b_b_car_E.xpm
   IconW: sww_y_b_b_b_b_car_W.xpm
   IconN: sww_y_b_b_b_b_car_N.xpm
   IconS: sww_y_b_b_b_b_car_S.xpm
   Action: speedlimit60

Aspect: yellow_blinking
   IconE: sww_b_b_b_b_b_car_E.xpm sww_y_b_b_b_b_car_E.xpm
   IconW: sww_b_b_b_b_b_car_W.xpm sww_y_b_b_b_b_car_W.xpm
   IconN: sww_b_b_b_b_b_car_N.xpm sww_y_b_b_b_b_car_N.xpm
   IconS: sww_b_b_b_b_b_car_S.xpm sww_y_b_b_b_b_car_S.xpm
   Action: speedlimit60

Aspect: yellow_sw_blinking_sw
   IconE: sww_b_b_b_b_b_car_E.xpm sww_b_b_b_b_2y_car_E.xpm
   IconW: sww_b_b_b_b_b_car_W.xpm sww_b_b_b_b_2y_car_W.xpm
   IconN: sww_b_b_b_b_b_car_N.xpm sww_b_b_b_b_2y_car_N.xpm
   IconS: sww_b_b_b_b_b_car_S.xpm sww_b_b_b_b_2y_car_S.xpm
   Action: speedlimit60

Aspect: yellow_blinking_yellow_sw_blinking_sw
   IconE: sww_b_b_b_b_b_car_E.xpm sww_y_b_b_b_2y_car_E.xpm
   IconW: sww_b_b_b_b_b_car_W.xpm sww_y_b_b_b_2y_car_W.xpm
   IconN: sww_b_b_b_b_b_car_N.xpm sww_y_b_b_b_2y_car_N.xpm
   IconS: sww_b_b_b_b_b_car_S.xpm sww_y_b_b_b_2y_car_S.xpm
   Action: speedlimit60

Aspect: green
   IconE: sww_b_b_g_b_b_car_E.xpm
   IconW: sww_b_b_g_b_b_car_W.xpm
   IconN: sww_b_b_g_b_b_car_N.xpm
   IconS: sww_b_b_g_b_b_car_S.xpm
   Action: proceed

OnInit:
   .aspect = double_red
end

OnCleared:
   if .aspect = red or .aspect = double_red 
      if next.aspect = red or next.aspect = double_red 
         .aspect = yellow
      else
         if next.aspect = yellow 
            .aspect = yellow_blinking
         else
            if next.aspect = yellow_fix_yellow_sw_blinking
               .aspect = yellow_blinking_yellow_sw_blinking_sw
            else
               if next.aspect = yellow_blinking_yellow_sw_blinking or next.aspect = yellow_sw_blinking 
                  .aspect = yellow_sw_blinking_sw
               else
                  .aspect = green
               end
            end
         end 
      end 
   end
end

OnUpdate:
  if .aspect = red or .aspect = double_red 
    return
  end
  if next.aspect = red or next.aspect = double_red 
      .aspect = yellow
   else
      if next.aspect = yellow 
         .aspect = yellow_blinking
      else
         if next.aspect = yellow_fix_yellow_sw_blinking
            .aspect = yellow_blinking_yellow_sw_blinking_sw
         else
            if next.aspect = yellow_blinking_yellow_sw_blinking or next.aspect = yellow_sw_blinking
               .aspect = yellow_sw_blinking_sw
             else
               .aspect = green
            end
         end
      end 
    end
end

