{trigger:parkeon_card}
	1 (S.L.parkeon_card_click)
{end}

{trigger:parkeon_card_off}
	0 (S.L.parkeon_card_click)
{end}

{macro:parkeon_init}
	0 (S.L.parkeon_clock) (S.L.parkeon_screen) (S.L.parkeon_boot_timer) (S.L.parkeon_card_timer_bad) (S.L.parkeon_card_timer_good) (S.L.parkeon_card_click) (S.L.parkeon_card_light)
        0 (S.L.parkeon_boot_stage1_done) (S.L.parkeon_boot_stage2_done) (S.L.parkeon_boot_stage3_done) (S.L.parkeon_boot_done)  (S.L.parkeon_card_show_pax) (S.L.parkeon_card_show_drv)
{end}

{macro:parkeon_frame}

(L.S.Time) 3600 / s6 trunc s7 "02" $IntToStrEnh ":" $+
		l6 l7 - 60 * trunc "02" $IntToStrEnh $+
		(S.$.parkeon_time)
		
  (L.L.elec_busbar_main) 0 >
  {if}
  
    (L.L.parkeon_boot_done) 0 =    
    {if}

    (L.L.parkeon_boot_timer) (L.S.TimeGap) + (S.L.parkeon_boot_timer)


    (L.L.parkeon_boot_stage1_done) 0 =    
    (L.L.parkeon_boot_timer) (C.L.parkeon_boot_stage1) < &&
    {if}
      0 (S.L.parkeon_screen) (S.L.parkeon_clock)
      1 (S.L.parkeon_LED_red) (S.L.parkeon_LED_yellow) (S.L.parkeon_LED_green) (S.L.parkeon_card_light)
    {endif}

    (L.L.parkeon_boot_timer) (C.L.parkeon_boot_stage1) >
    {if}
      1 (S.L.parkeon_boot_stage1_done) 
    {endif}

    (L.L.parkeon_boot_stage1_done) 1 =
    (L.L.parkeon_boot_timer) (C.L.parkeon_boot_stage2) <= &&
    {if}
      0 (S.L.parkeon_LED_red) (S.L.parkeon_LED_yellow) (S.L.parkeon_LED_green) (S.L.parkeon_card_light)
    {endif}

    (L.L.parkeon_boot_timer) (C.L.parkeon_boot_stage2) >
    {if}
    1 (S.L.parkeon_boot_stage2_done) 
    {endif}

    (L.L.parkeon_boot_stage1_done) 1 =
    (L.L.parkeon_boot_stage2_done) 1 = &&
    (L.L.parkeon_boot_timer) (C.L.parkeon_boot_stage3) <= &&
    {if}
      1 (S.L.parkeon_screen)
      0 (S.L.parkeon_LED_red) (S.L.parkeon_LED_yellow) (S.L.parkeon_LED_green)
    {endif}

    (L.L.parkeon_boot_timer) (C.L.parkeon_boot_stage3) >
    {if}
    1 (S.L.parkeon_boot_stage3_done) 
    {endif}

    (L.L.parkeon_boot_stage2_done) 1 =
    (L.L.parkeon_boot_stage3_done) 1 = &&
    (L.L.parkeon_boot_timer) (C.L.parkeon_boot_stage4) <= &&
    {if}
      2 (S.L.parkeon_screen)
      1 (S.L.parkeon_boot_done)
    {endif}
    {else}
    1 (S.L.parkeon_clock)
  
    (L.L.parkeon_card_click)
    (L.L.parkeon_card_timer_bad) 0.01 >= || 
    (L.L.parkeon_card_timer_bad) (C.L.parkeon_timer_delay) < &&
    {if}
      1 (S.L.parkeon_card_show_drv)
      (L.L.parkeon_card_timer_bad) (L.S.TimeGap) + (S.L.parkeon_card_timer_bad)
    {else}
      0 (S.L.parkeon_card_timer_bad) (S.L.parkeon_card_show_drv)
    {endif}

    2 (M.V.GetHumanCountOnPathLink)
    (L.L.parkeon_card_timer_good) 0.01 >= || 
    (L.L.parkeon_card_timer_good) (C.L.parkeon_timer_delay) < &&
    {if}
      1 (S.L.parkeon_card_show_pax)
      (L.L.parkeon_card_timer_good) (L.S.TimeGap) + (S.L.parkeon_card_timer_good)
    {else}
      0 (S.L.parkeon_card_timer_good) (S.L.parkeon_card_show_pax)
    {endif}

    (L.L.parkeon_card_show_pax)
    (L.L.parkeon_card_show_drv) ||
    {if}
  
      (L.L.parkeon_card_show_drv)
      {if}
        1 (S.L.parkeon_LED_yellow) (S.L.parkeon_LED_red)
        3 (S.L.parkeon_card_light)
        4 (S.L.parkeon_screen)
		
		(L.L.parkeon_timer) (C.L.parkeon_beep_long) <
		(L.L.parkeon_screen) 4 = &&
		{if}
		  (T.L.parkeon_card_bad)
		  (L.L.parkeon_timer) (L.S.TimeGap) + (S.L.parkeon_timer)
		{endif}
      {endif}

      (L.L.parkeon_card_show_pax)
      {if}
        1 (S.L.parkeon_LED_green)
        2 (S.L.parkeon_card_light)
        3 (S.L.parkeon_screen)
		
		(L.L.parkeon_timer) (C.L.parkeon_beep_short) <
		(L.L.parkeon_screen) 3 = &&
		{if}
		  (T.L.parkeon_card_good)
		  (L.L.parkeon_timer) (L.S.TimeGap) + (S.L.parkeon_timer)
		{endif}
      {endif}
    {else}
        0 (S.L.parkeon_LED_green) (S.L.parkeon_LED_yellow) (S.L.parkeon_LED_red) (S.L.parkeon_timer)
        1 (S.L.parkeon_card_light)
        2 (S.L.parkeon_screen)
      {endif}
    {endif}
  {else}
    0 (S.L.parkeon_clock) (S.L.parkeon_screen) (S.L.parkeon_boot_timer) (S.L.parkeon_boot_done) (S.L.parkeon_LED_red) (S.L.parkeon_LED_yellow) (S.L.parkeon_LED_green) (S.L.parkeon_boot_stage1_done) (S.L.parkeon_boot_stage2_done) (S.L.parkeon_boot_stage3_done) (S.L.parkeon_card_light) (S.L.parkeon_card_show_pax) (S.L.parkeon_card_show_drv)
{endif}
{end}
