#sig_carré_RR60_cligno
#
Aspect: red
   IconE: swww_b_r_b_r_b_b_E.xpm
   IconW: swww_b_r_b_r_b_b_W.xpm
   IconN: swww_b_r_b_r_b_b_N.xpm
   IconS: swww_b_r_b_r_b_b_S.xpm
   Action: stop

Aspect: double_red
   IconE: swww_b_r_b_r_b_b_E.xpm
   IconW: swww_b_r_b_r_b_b_W.xpm
   IconN: swww_b_r_b_r_b_b_N.xpm
   IconS: swww_b_r_b_r_b_b_S.xpm
   Action: stop


Aspect: yellow
   IconE: swww_y_b_b_b_b_b_E.xpm
   IconW: swww_y_b_b_b_b_b_W.xpm
   IconN: swww_y_b_b_b_b_b_N.xpm
   IconS: swww_y_b_b_b_b_b_S.xpm
   Action: speedlimit60

Aspect: yellow_sw_blinking
   IconE: swww_b_b_b_b_b_b_E.xpm swww_b_b_b_b_2y_b_E.xpm
   IconW: swww_b_b_b_b_b_b_W.xpm swww_b_b_b_b_2y_b_W.xpm
   IconN: swww_b_b_b_b_b_b_N.xpm swww_b_b_b_b_2y_b_N.xpm
   IconS: swww_b_b_b_b_b_b_S.xpm swww_b_b_b_b_2y_b_S.xpm
   Action: speedlimit60

Aspect: yellow_fix_yellow_sw_blinking
   IconE: swww_y_b_b_b_b_b_E.xpm swww_y_b_b_b_2y_b_E.xpm
   IconW: swww_y_b_b_b_b_b_W.xpm swww_y_b_b_b_2y_b_W.xpm
   IconN: swww_y_b_b_b_b_b_N.xpm swww_y_b_b_b_2y_b_N.xpm
   IconS: swww_y_b_b_b_b_b_S.xpm swww_y_b_b_b_2y_b_S.xpm
   Action: speedlimit60

Aspect: yellow_warn_blinking
   IconE: swww_b_b_b_b_b_b_E.xpm swww_b_b_b_b_b_2y_E.xpm
   IconW: swww_b_b_b_b_b_b_W.xpm swww_b_b_b_b_b_2y_W.xpm
   IconN: swww_b_b_b_b_b_b_N.xpm swww_b_b_b_b_b_2y_N.xpm
   IconS: swww_b_b_b_b_b_b_S.xpm swww_b_b_b_b_b_2y_S.xpm
   Action: speedlimit60

Aspect: green
   IconE: swww_b_b_g_b_b_b_E.xpm
   IconW: swww_b_b_g_b_b_b_W.xpm
   IconN: swww_b_b_g_b_b_b_N.xpm
   IconS: swww_b_b_g_b_b_b_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 
         if .switchThrown
            .aspect = yellow
         else
            .aspect = yellow_fix_yellow_sw_blinking
         end
      else
         if next.aspect = yellow 
            if .switchThrown
               .aspect = green
            else
               .aspect = yellow_sw_blinking
             end
         else
            if next.aspect = yellow_fix_yellow_sw_blinking
               if .switchThrown
                  .aspect = yellow_warn_blinking
               else
                  .aspect = yellow_sw_blinking
               end
            else
               if next.aspect = yellow_blinking_yellow_sw_blinking
                  if .switchThrown
                  .aspect = yellow_warn_blinking
               else
                  .aspect = yellow_sw_blinking
                  end
               else
                  if next.aspect = yellow_sw_blinking
                     if .switchThrown
                   .aspect = yellow_warn_blinking
               else
                  .aspect = yellow_sw_blinking
                     end
                  else
                     if .switchThrown
                       .aspect = green
                    else
                      .aspect = yellow_sw_blinking
                    end
                  end
               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 
         if .switchThrown
            .aspect = yellow
         else
            .aspect = yellow_fix_yellow_sw_blinking
         end
      else
         if next.aspect = yellow 
            if .switchThrown
               .aspect = green
            else
               .aspect = yellow_sw_blinking
            end
         else
            if next.aspect = yellow_fix_yellow_sw_blinking
               if .switchThrown
                  .aspect = yellow_warn_blinking
               else
                  .aspect = yellow_sw_blinking
               end
            else
               if next.aspect = yellow_blinking_yellow_sw_blinking
                  if .switchThrown
                  .aspect = yellow_warn_blinking
               else
                  .aspect = yellow_sw_blinking
                  end
               else
                  if next.aspect = yellow_sw_blinking
                     if .switchThrown
                     .aspect = yellow_warn_blinking
                  else
                     .aspect = yellow_sw_blinking
                  end
                  else
                     if .switchThrown
                         .aspect = green
                     else
                       .aspect = yellow_sw_blinking
                     end
                  end
               end
            end
         end
      end

end

