'### VDV Driver's Information Display ###

' (C) 2014 Morphi
' 2015 edited by NightHauler (Actia)

' Version 1.0

{trigger:comp_button_up}
	-1 (S.L.comp_button_sw)
	(M.L.kippschaltersound_toggle)
{end}

{trigger:comp_button_up_off}

	0 (S.L.vdv_display_changeover)

	(L.L.vdv_display_mode) 1 - 1 max (S.L.vdv_display_mode) 1 =
	{if}
		7 (S.L.vdv_display_mode)
	{endif}
	0 (S.L.comp_button_sw)
	(M.L.kippschaltersound_toggle)
{end}

{trigger:comp_button_down}
	1 (S.L.comp_button_sw)
	(M.L.kippschaltersound_toggle)
{end}

{trigger:comp_button_down_off}

	0 (S.L.vdv_display_changeover)

	(L.L.vdv_display_mode) 1 + 7 min (S.L.vdv_display_mode) 7 =
	{if}
		1 (S.L.vdv_display_mode)
	{endif}
	0 (S.L.comp_button_sw)
	(M.L.kippschaltersound_toggle)
{end}


{trigger:cp_display_dim_up}
(L.L.vdv_dim_mode) 1 >
{if}
	(L.L.vdv_dim_mode) 1 - (S.L.vdv_dim_mode)
{endif}

1 (S.L.display_dim_sw) s0
(M.L.kippschaltersound_toggle)
{end}

{trigger:cp_display_dim_up_off}

0 (S.L.display_dim_sw) s0
(M.L.kippschaltersound_toggle)
{end}

{trigger:cp_display_dim_down}
(L.L.vdv_dim_mode) 4 <
{if}
	(L.L.vdv_dim_mode) 1 + (S.L.vdv_dim_mode)
{endif}

1 (S.L.display_dim_sw) s0
(M.L.kippschaltersound_toggle)
{end}

{trigger:cp_display_dim_down_off}

0 (S.L.display_dim_sw) s0
(M.L.kippschaltersound_toggle)
{end}

{trigger:cp_display_clear_mileage_drag}
(L.L.km_counter_timer) (L.S.Timegap) + (S.L.km_counter_timer)
(L.L.km_counter_timer) 2 >
{if}
0 (S.L.odometr_sbros)
0 (S.L.km_counter_timer)
{endif}
{end}

{trigger:cp_display_clear_mileage_off}
0 (S.L.km_counter_timer)
{end}



{macro:VDV_init}
10 100 random + 100 min (S.L.actia_brake_front_left)
10 100 random + 100 min (S.L.actia_brake_front_right)
10 100 random + 100 min (S.L.actia_brake_back_left)
10 100 random + 100 min (S.L.actia_brake_back_right)
(C.L.Fehlertoleranz) (L.L.wearlifespan) * random (S.L.EBS_Error_dist)
(C.L.Fehlertoleranz) (L.L.wearlifespan) * random (S.L.Retarder_Error_dist)
(C.L.Fehlertoleranz) (L.L.wearlifespan) * random (S.L.Gear_Error_dist)
(C.L.Fehlertoleranz) (L.L.wearlifespan) * random (S.L.ECAS_Error_dist)
(C.L.Fehlertoleranz) (L.L.wearlifespan) * random (S.L.EDC_Error_dist)
(C.L.Fehlertoleranz) (L.L.wearlifespan) * random (S.L.Battery_Error_dist)
(C.L.Tuerfehlertoleranz) (L.L.wearlifespan) * random (S.L.Door_Error_Count)
(L.L.engine_tank_content) (S.L.engine_tank_content_last) (S.L.engine_tank_content_last_start)
0 (S.L.kmstand_start) (S.L.m_zaehler_uebertrag) (S.L.kmstand) (S.L.m_zaehler_uebertrag_start) (S.L.zeitgeber) (S.L.zeitgeber_start)
(L.S.Time) (S.L.zeitgeber_zaehler)
1 (S.L.vdv_dim_mode) 
1 (S.L.Fehleranzahl)
0 (S.L.actia_paliwo_losuj)
{end}

{macro:VDV_frame}
'	###Debug###

'	###Debug End###
		
		1 (S.L.Actia_pulpit)

		(L.L.elec_busbar_main)
		{if}
			1 (S.L.actia_visible)
		{endif}
		
		(L.L.actia_paliwo_losuj) 0 =
		{if}
			10 40 random + (S.L.ilosc_adblue)
			5 20 random + (S.L.ilosc_webasto)
			1 (S.L.actia_paliwo_losuj)
		{endif}

		"actia_Display_P.dds" (S.$.vdv_display_p)
'		"" (S.$.vdv_display_retarder)
'		"" (S.$.vdv_display_door1)
'		"" (S.$.vdv_display_door2)
'		"" (S.$.vdv_display_door3)
		"" (S.$.vdv_display_ramp1)
		"" (S.$.vdv_display_ramp2)
		"actia_Display_stopbrake_U12.png" (S.$.vdv_display_stopbrake)
		"actia_Display_kneel1_U12.dds" (S.$.vdv_display_kneel1)
		"actia_Display_kneel2_U12.dds" (S.$.vdv_display_kneel2)
		"actia_Display_kneel3_U12.dds" (S.$.vdv_display_kneel3)
		"" (S.$.vdv_display_AC)
		"" (S.$.vdv_display_mirrorheat)
		"" (S.$.vdv_display_heater)
		"" (S.$.vdv_display_ASR)
		"" (S.$.vdv_display_errorscroll)
		"" (S.$.vdv_display_rooflight)
		"" (S.$.vdv_display_door2clearance)
		"" (S.$.vdv_display_request2)
		
		
		(L.L.door_01_nothahn_sw) !
		{if}
			(L.L.door_0) 0.8 >
			{if}
			"actia_Display_door1_0_open_U12.png" (S.$.vdv_display_door1_0)
			{else}
				(L.L.door_0) 0 =
				{if}
				"actia_Display_door1_0_U12.png" (S.$.vdv_display_door1_0)
				{endif}
			{endif}
			
			(L.L.door_1) 0.8 >
			{if}
			"actia_Display_door1_1_open_U12.png" (S.$.vdv_display_door1_1)
			{else}
				(L.L.door_1) 0 =
				{if}
				"actia_Display_door1_1_U12.png" (S.$.vdv_display_door1_1)
				{endif}
			{endif}
		{else}
			"actia_Display_door1_0_error_U12.png"  (S.$.vdv_display_door1_0)
			"actia_Display_door1_1_error_U12.png"  (S.$.vdv_display_door1_1)
		{endif}
		

'			Zeitgeber

			(L.S.Time) (L.L.zeitgeber_zaehler) - 1 >=
			(L.S.Time) (L.L.zeitgeber_zaehler) - 0 < ||
			(L.L.velocity) 1 > &&
			{if}
				(L.L.zeitgeber) 1 + (S.L.zeitgeber)
				(L.L.zeitgeber_start) 1 + (S.L.zeitgeber_start)
				(L.S.Time) (S.L.zeitgeber_zaehler)
			{endif}
			
'			Kilometer

			(L.L.kmcounter_m) (L.L.m_zaehler) - 1 >=
			(L.L.kmcounter_m) (L.L.m_zaehler) - 0 < ||
			{if}
			(L.L.m_zaehler_uebertrag) 1 + (S.L.m_zaehler_uebertrag)
			(L.L.m_zaehler_uebertrag_start) 1 + (S.L.m_zaehler_uebertrag_start)
			(L.L.kmcounter_m) (S.L.m_zaehler)
			{endif}

			(L.L.m_zaehler_uebertrag) 999 >
			{if}
				(L.L.kmstand) 1 + (S.L.kmstand)
				0 (S.L.m_zaehler_uebertrag)
			{endif}

			(L.L.m_zaehler_uebertrag_start) 999 >
			{if}
				(L.L.kmstand_start) 1 + (S.L.kmstand_start)
				0 (S.L.m_zaehler_uebertrag_start)
			{endif}
			
'			Durchschnittsberechnungen

			(L.L.engine_tank_content_last) (L.L.engine_tank_content) - (S.L.vdv_tank)

			(L.L.engine_n) 200 >
			{if}
				(L.L.engine_tank_content_last_start) (L.L.engine_tank_content) - (S.L.vdv_tank_start)
			{else}
				(L.L.engine_tank_content) (S.L.engine_tank_content_last_start)
				0 (S.L.kmstand_start) (S.L.m_zaehler_uebertrag_start) (S.L.zeitgeber_start)
			{endif}		
			
' 	VDV Display Modes:

'	1 Drive Mode
'	2 Bus Stop Mode (Main)
'	3 Status Mode

	(L.L.elec_busbar_main) 0 >
	(L.L.bremse_feststell) 0.5 > &&
	{if}
	1 (S.L.actia_indic_parking_brake_8_visible)
		{else}
	0 (S.L.actia_indic_parking_brake_8_visible)
	{endif}
	
'	Without power, nothing works

	(L.L.elec_busbar_main) 0 >
	{if}
		0 (S.L.vdv_display_shutdown)
	(L.L.vdv_display_startuptime) 0 = &&
	{if}
		1 (S.L.actia_visible)
	{endif}
	
'	Initialize
		(L.L.vdv_display_startuptime) (L.S.Timegap) + 10 min (S.L.vdv_display_startuptime)
	
		(L.L.vdv_display_startuptime) 2.5 <
		{if}
			0 (S.L.actia_indic_parking_brake_visible) (S.L.actia_indic_low_beam_visible) (S.L.actia_indic_high_beam_visible) (S.L.actia_indic_errpior1_visible) (S.L.actia_indic_errpior2_visible)
			(S.L.actia_indic_request_visible) (S.L.actia_indic_fog_lamps_visible) (S.L.actia_indic_tacho_visible) (S.L.actia_indic_obd_visible) (S.L.actia_indic_engine_visible) (S.L.actia_indic_pneumatic_visible) (S.L.actia_indic_abs_visible)
			"actia_alpha100.dds" (S.$.vdv_display_texture)
		{endif}		
		
		(L.L.vdv_display_startuptime) 2.5 >
		(L.L.vdv_display_startuptime) 3 < &&
		{if}
			"actia_Display_init4.png" (S.$.vdv_display_texture)
		{endif}
		
		(L.L.vdv_display_startuptime) 3 >
		(L.L.vdv_display_startuptime) 8 < &&
		{if}
			1 (S.L.actia_indic_low_beam_visible) (S.L.actia_indic_high_beam_visible) (S.L.actia_indic_errpior1_visible) (S.L.actia_indic_errpior2_visible)
			(S.L.actia_indic_request_visible) (S.L.actia_indic_fog_lamps_visible) (S.L.actia_indic_tacho_visible) (S.L.actia_indic_obd_visible) (S.L.actia_indic_engine_visible) (S.L.actia_indic_pneumatic_visible) (S.L.actia_indic_abs_visible)
			"actia_Display_init2.png" (S.$.vdv_display_texture)
			2 (S.L.vdv_display_mode)
		{endif}

		(L.L.vdv_display_startuptime) 8 =
		{if}
		0 (S.L.actia_indic_parking_brake_visible) (S.L.actia_indic_low_beam_visible) (S.L.actia_indic_high_beam_visible) (S.L.actia_indic_blinker_l_visible) (S.L.actia_indic_blinker_r_visible) (S.L.actia_indic_errpior1_visible) (S.L.actia_indic_errpior2_visible)
		(S.L.actia_indic_request_visible) (S.L.actia_indic_fog_lamps_visible) (S.L.actia_indic_tacho_visible) (S.L.actia_indic_obd_visible) (S.L.actia_indic_engine_visible) (S.L.actia_indic_pneumatic_visible) (S.L.actia_indic_abs_visible)
		{endif}
		
		(L.L.vdv_display_startuptime) 3 >
		(L.L.vdv_display_startuptime) 10 < &&
		{if}
			(L.L.actia_gear_timer) (L.S.Timegap) + 0.8 min (S.L.actia_gear_timer)
			0.8 =
			{if}
			0 (S.L.actia_gear_timer)
			{endif}
			
			(L.L.actia_gear_timer) 0.4 >
			{if}
			0 (S.L.automatic_D_light) (S.L.automatic_N_light) (S.L.automatic_R_light)
			{else}
			1 (S.L.automatic_D_light) (S.L.automatic_N_light) (S.L.automatic_R_light)
			{endif}
		{endif}
		
		(L.L.vdv_display_startuptime) 8 >
		{if}
		
		(L.L.vdv_dim_mode) 1 =
		{if}
			0 (S.L.vdv_visible_dim)
		{endif}
		(L.L.vdv_dim_mode) 2 =
		{if}
			"VDV_Display_dimlight.dds" (S.$.vdv_display_dim)
			1 (S.L.vdv_visible_dim)
		{endif}
		(L.L.vdv_dim_mode) 3 =
		{if}
			"VDV_Display_dimstrong.dds" (S.$.vdv_display_dim)
			1 (S.L.vdv_visible_dim)
		{endif}
		(L.L.vdv_dim_mode) 4 =
		{if}
			"VDV_Display_dimfull.dds" (S.$.vdv_display_dim)
			1 (S.L.vdv_visible_dim)
		{endif}



'	Mode Select

		(L.L.velocity) 1 >
		(L.L.velocity) 2 < &&
		(L.L.vdv_display_mode) 2 = &&
		{if}
			0 (S.L.vdv_display_changeover)
			1 (S.L.vdv_display_mode)
		{endif}
		
		(L.L.door_0) 0 >
		(L.L.door_1) 0 > ||
		(L.L.door_3) 0 > ||
		(L.L.door_5) 0 > ||
		(L.L.bremse_halte) ||
		(L.L.bremse_feststell) ||
		(L.L.antrieb_getr_gangwahl) 1 = ||
      	(L.L.actia_lift_timer) 0 > ||
		(L.L.vdv_display_mode) 1 = &&
		{if}
			0 (S.L.vdv_display_changeover)
			2 (S.L.vdv_display_mode)
		{endif}
		
'	Drive Mode
			(L.L.vdv_display_mode) 1 =
			(L.L.vdv_display_mode) 7 = ||
			{if}
				(L.L.vdv_display_changeover) (L.S.Timegap) + 6 min (S.L.vdv_display_changeover)

				"actia_display_drivemode.png" (S.$.vdv_display_texture)
				1 (S.L.actia_uhr) (S.L.actia_Datum) (S.L.actia_aussentemp) (S.L.actia_visible_fuel) (S.L.actia_visible_adblue) (S.L.actia_visible_consum_l100km_dm)		
				(L.L.vdv_display_changeover) 0.1 >
				{if}
					
'		Main Symbols

					(L.L.antrieb_getr_gangwahl) 0 =
					{if}
						1 (S.L.actia_gangR)
						{if}
							"actia\actia_display_gangR.dds" (S.$.actia_gangR)
						{endif}
					{else}
						0 (S.L.actia_gangR)
					{endif}
					
					(L.L.engine_tank_content) (F.L.tank_balken) trunc s1
					"X" l1 $* (S.$.actia_tankinhalt)
					
					(L.L.engine_adblue_content) (F.L.adblue_balken) trunc s1
					"X" l1 $* (S.$.actia_adblueinhalt)
					
					(L.L.antrieb_getr_gangvorwahl) 1 = 
					{if}
						1 (S.L.actia_gangN)
						{if}
							"actia\actia_display_gangN.dds" (S.$.actia_gangN)
						{endif}
					{else}
						0 (S.L.actia_gangN)
					{endif}

					(L.L.vdv_tank_start) 100 * (L.L.kmstand_start) 1000 * (L.L.m_zaehler_uebertrag_start) + 1000 / / $IntToStr (S.$.actia_l_hk)
						
					(L.L.antrieb_getr_aktugang) 1 =
					(L.L.antrieb_getr_aktugang) 0 = ||
					(L.L.antrieb_getr_gangvorwahl) 1 > &&
					{if}
						1 (S.L.actia_gang1)
						{if}
							"actia\actia_display_gang1.dds" (S.$.actia_gang1)
						{endif}
					{else}
						0 (S.L.actia_gang1)
					{endif}
					
					(L.L.antrieb_getr_aktugang) 2 = 
					{if}
						1 (S.L.actia_gang2)
						{if}
							"actia\actia_display_gang2.dds" (S.$.actia_gang2)
						{endif}
					{else}
						0 (S.L.actia_gang2)
					{endif}
					
					(L.L.antrieb_getr_aktugang) 3 = 
					{if}
						1 (S.L.actia_gang3)
						{if}
							"actia\actia_display_gang3.dds" (S.$.actia_gang3)
						{endif}
					{else}
						0 (S.L.actia_gang3)
					{endif}
					
					(L.L.antrieb_getr_aktugang) 4 = 
					{if}
						1 (S.L.actia_gang4)
						{if}
							"actia\actia_display_gang4.dds" (S.$.actia_gang4)
						{endif}
					{else}
						0 (S.L.actia_gang4)
					{endif}
					
					(L.L.haltewunsch)
					{if}
						"actia\actia_display_haltewunsch.png" (S.$.actia_display_haltewunsch)
						(L.S.GetTime) 1.5 % 1 < (S.L.actia_haltewunsch_visible)
					{else}
						0 (S.L.actia_haltewunsch_visible)
					{endif}
				
					(L.L.lights_nebelschluss)
					{if}
						"actia\actia_display_nebelschluss.png" (S.$.actia_display_nebelschluss)
						1 (S.L.actia_nebelschluss_visible)
					{else}
						0 (S.L.actia_nebelschluss_visible)
					{endif}

					(L.L.ecas_rise_active)
					{if}
						"actia\actia_display_niveau.png" (S.$.actia_display_niveau)
						1 (S.L.actia_niveau_visible)
					{else}
						0 (S.L.actia_niveau_visible)
					{endif}

					(L.L.vdv_error_adblue_active)
					{if}
						"actia\actia_display_adblue.png" (S.$.actia_display_adblue)
						1 (S.L.actia_adblue_visible)
					{else}
						0 (S.L.actia_adblue_visible)
					{endif}
					
					(L.L.door_kinderwagenwunsch)
					{if}
						"actia\actia_display_rollstuhl.png" (S.$.actia_display_rollstuhl)
						1 (S.L.actia_rollstuhl_visible)
					{else}
						0 (S.L.actia_rollstuhl_visible)
					{endif}			

					(L.L.actia_brake_back_left) 20 <
					(L.L.actia_brake_back_right) 20 < ||
					(L.L.actia_brake_front_left) 20 < ||
					(L.L.actia_brake_front_right) 20 < ||
					{if}
						"actia\actia_display_brakewarn.png" (S.$.actia_display_brakewarn)
						1 (S.L.actia_brakewarn_visible)
					{else}
						0 (S.L.actia_brakewarn_visible)
					{endif}
					
					(L.L.antrieb_retarder)
					(L.L.antrieb_retarder_sw_direkt) ||
					{if}
						"actia\actia_display_retarder.png" (S.$.actia_display_retarder)
						1 (S.L.actia_retarder_visible)
					{else}
						0 (S.L.actia_retarder_visible)
					{endif}

					(L.L.cp_ASR_off) 1 =
					(L.L.engine_ASR_eingriff) ||
					(L.L.bremse_ABS_eingriff_0R) ||
					(L.L.bremse_ABS_eingriff_0L) ||
					(L.L.bremse_ABS_eingriff_1R) ||
					(L.L.bremse_ABS_eingriff_1L) ||
					(L.L.vdv_error_EBS_active) ||
					{if}
						"actia\actia_display_asr.png" (S.$.actia_display_asr)
						1 (S.L.actia_asr_visible)
					{else}
						0 (S.L.actia_asr_visible)
					{endif}	
					
				{else}
					0 (S.L.actia_visible_fuel) (S.L.actia_visible_adblue) (S.L.actia_gangR) (S.L.actia_gangN) (S.L.actia_gang1) (S.L.actia_gang2) 
					0 (S.L.actia_gang3) (S.L.actia_gang4) (S.L.actia_uhr) (S.L.actia_Datum) (S.L.actia_aussentemp) (S.L.actia_visible_consum_l100km_dm)
					0 (S.L.actia_haltewunsch_visible) (S.L.actia_nebelschluss_visible) (S.L.actia_niveau_visible) (S.L.actia_adblue_visible) (S.L.actia_asr_visible) (S.L.actia_rollstuhl_visible)
					0 (S.L.actia_brakewarn_visible) (S.L.actia_retarder_visible)
				{endif}
				
				(L.L.door_0) 0 >
				(L.L.door_1) 0 > ||
				(L.L.door_3) 0 > ||
				(L.L.door_5) 0 > ||
				(L.L.bremse_halte) ||
				(L.L.bremse_feststell) ||
				(L.L.antrieb_getr_gangwahl) 1 = ||
				(L.L.actia_lift_timer) 0 > ||
				{if}
					(L.L.vdv_display_changeover) 4 >
					(L.L.vdv_display_changeover_clamped) 0 = &&
					{if}
						2 (S.L.vdv_display_mode)
					{endif}
				{endif}
			{else}
				0 (S.L.actia_visible_fuel) (S.L.actia_visible_adblue) (S.L.actia_gangR) (S.L.actia_gangN) (S.L.actia_gang1) (S.L.actia_gang2) 
				0 (S.L.actia_gang3) (S.L.actia_gang4) (S.L.actia_uhr) (S.L.actia_Datum) (S.L.actia_aussentemp) (S.L.actia_visible_consum_l100km_dm)
				0 (S.L.actia_haltewunsch_visible) (S.L.actia_nebelschluss_visible) (S.L.actia_niveau_visible) (S.L.actia_adblue_visible) (S.L.actia_rollstuhl_visible)
				0 (S.L.actia_asr_visible) (S.L.actia_brakewarn_visible) (S.L.actia_retarder_visible)
			{endif}	
'	Bus Stop Mode (Main)
			(L.L.vdv_display_mode) 2 =
			{if}
				(L.L.vdv_display_changeover) (L.S.Timegap) + 6 min (S.L.vdv_display_changeover)
				(L.L.vdv_display_changeover) 0.1 >
				(L.L.vdv_display_changeover) 0.3 <
				{if}
					1 (S.L.actia_visible)
					(L.L.antrieb_getr_gangwahl) 1 =
					{if}
						"actia_display_stopmode_U12.png" (S.$.vdv_display_texture)
					{else}
						"actia_display_stopmode_U12.png" (S.$.vdv_display_texture)
					{endif}
				{endif}

				(L.L.vdv_display_changeover) 0.3 >
				{if}
					(L.L.antrieb_getr_gangwahl) 1 =
					{if}
						"actia_display_stopmode_U12.png" (S.$.vdv_display_texture)
					{else}
						"actia_display_stopmode_U12.png" (S.$.vdv_display_texture)
					{endif}
					1 (S.L.vdv_visible_door0) (S.L.vdv_visible_door1) (S.L.vdv_visible_door2) (S.L.vdv_visible_door3) (S.L.actia_visible)
				{endif}
					
				(L.L.vdv_display_changeover) 0.1 >
				{if}
					
'		Main symbols
					(L.L.CG_active)
					(L.L.vdv_error_nothahn_active) ! &&
					{if}
					
						
						(L.L.door2_clearance_timer) (L.S.Timegap) + 0.8 min (S.L.door2_clearance_timer)
						0.8 =
						{if}
						0 (S.L.door2_clearance_timer)
						{endif}
								
						(L.L.door2_clearance_timer) 0.4 >
						{if}
							(L.L.door_0) 0 =
							{if}
								0 (S.L.vdv_visible_door0)
							{endif}
						
							(L.L.door_1) 0 =
							{if}
								0 (S.L.vdv_visible_door1)
							{endif}

							(L.L.door_2) 0 =
							(L.L.door_3) 0 = ||
							{if}
							0 (S.L.vdv_visible_door2)
							{endif}
							
							(L.L.door_4) 0 =
							(L.L.door_5) 0 = ||
							{if}
							0 (S.L.vdv_visible_door3)
							{endif}
						{else}
						1 (S.L.vdv_visible_door0) (S.L.vdv_visible_door1) (S.L.vdv_visible_door2) (S.L.vdv_visible_door3)
						{endif}
					{else}
						0 (S.L.door2_clearance_timer)
						1 (S.L.vdv_visible_door0) (S.L.vdv_visible_door1) (S.L.vdv_visible_door2) (S.L.vdv_visible_door3)
					{endif}

					(L.L.door_23_nothahn_sw) !
					{if}
						(L.L.door_2) 0.8 >
						(L.L.door_3) 0.8 > ||
						{if}
							"actia_Display_door2_open_U12.png" (S.$.vdv_display_door2)
						{endif}

						(L.L.door_2) 0 =
						(L.L.door_3) 0 = &&
						{if}
							"actia_Display_door2_U12.png" (S.$.vdv_display_door2)
						{endif}
					{else}
						"actia_Display_door2_error_U12.png" (S.$.vdv_display_door2)
					{endif}
	
					(L.L.door_45_nothahn_sw) !
					{if}
						(L.L.door_4) 0.8 >
						(L.L.door_5) 0.8 > ||
						{if}
							"actia_Display_door3_open_U12.png" (S.$.vdv_display_door3)
						{endif}

						(L.L.door_4) 0 =
						(L.L.door_5) 0 = &&
						{if}
							"actia_Display_door3_U12.png" (S.$.vdv_display_door3)
						{endif}
					{else}
						"actia_Display_door3_error_U12.png" (S.$.vdv_display_door3)
					{endif}
					
					(L.L.bremse_halte)
					{if}
						1 (S.L.vdv_visible_stopbrake)
					{else}
						0 (S.L.vdv_visible_stopbrake)
					{endif}
				{else}
					0 (S.L.vdv_visible_stopbrake) (S.L.vdv_visible_door0) (S.L.vdv_visible_door1) (S.L.vdv_visible_door2) (S.L.vdv_visible_door3) 
				{endif}
				
				(L.L.door_0) !
				(L.L.door_1) ! &&
				(L.L.door_3) ! &&
				(L.L.door_5) ! &&
				(L.L.bremse_halte) ! &&
				(L.L.bremse_feststell) ! &&
				(L.L.antrieb_getr_gangwahl) 1 = ! &&
				(L.L.actia_lift_timer) ! &&
				{if}
					(L.L.vdv_display_changeover) 4 >
					(L.L.vdv_display_changeover_clamped) 0 = &&
					{if}
						1 (S.L.vdv_display_mode)
					{endif}
				{endif}
			{else}
				0 (S.L.vdv_visible_stopbrake) (S.L.vdv_visible_door0) (S.L.vdv_visible_door1) (S.L.vdv_visible_door2) (S.L.vdv_visible_door3)
			{endif}
'	Status Mode
			(L.L.vdv_display_mode) 3 =
			{if}
				0 (S.L.actia_visible)
				(L.L.vdv_display_changeover) (L.S.Timegap) + 6 min (S.L.vdv_display_changeover)

				(L.L.vdv_display_changeover) 4 >
				(L.L.vdv_display_changeover_clamped) 0 = &&
				{if}
					1 (S.L.vdv_display_mode)
				{endif}
				
				(L.L.vdv_display_changeover) 0.1 >
				{if}
					1 (S.L.actia_visible)
					"actia_display_menu1.png" (S.$.vdv_display_texture)

					(L.L.vdv_display_changeover) 0.3 >
					{if}

					"actia_display_menu1.png" (S.$.vdv_display_texture)
					1 (S.L.actia_visible_vorratsdruck1) (S.L.actia_visible_vorratsdruck2)

'		Main Symbols
					(L.L.bremse_p_tank01) (F.L.pressure_balken_vor1) trunc (S.L.actia_vorratsdruck1)
					(L.L.bremse_p_tank02) (F.L.pressure_balken_vor2) trunc (S.L.actia_vorratsdruck2)
					"X" (L.L.actia_vorratsdruck1) $* (S.$.actia_vorratsdruck1)
					"X" (L.L.actia_vorratsdruck2) $* (S.$.actia_vorratsdruck2)
					{endif}	
				{else}
					0 (S.L.actia_visible_vorratsdruck1) (S.L.actia_visible_vorratsdruck2)
				{endif}
			{else}
				0 (S.L.actia_visible_vorratsdruck1) (S.L.actia_visible_vorratsdruck2)
			{endif}
'	Status Mode
			(L.L.vdv_display_mode) 4 =
			{if}
				0 (S.L.vdv_visible_almex) (S.L.vdv_visible_almex_night) 
				0 (S.L.actia_visible)
				(L.L.vdv_display_changeover) (L.S.Timegap) + 6 min (S.L.vdv_display_changeover)

				(L.L.vdv_display_changeover) 4 >
				(L.L.vdv_display_changeover_clamped) 0 = &&
				{if}
					1 (S.L.vdv_display_mode)
				{endif}
				
				(L.L.vdv_display_changeover) 0.1 >
				{if}
					1 (S.L.actia_visible)
					"actia_display_menu2.png" (S.$.vdv_display_texture)

					(L.L.vdv_display_changeover) 0.3 >
					{if}

					"actia_display_menu2.png" (S.$.vdv_display_texture)
					1 (S.L.actia_visible_kuehlwasser) (S.L.actia_visible_getriebetemp) (S.L.actia_visible_oeldruck)

'		Main Symbols
					(L.L.engine_temperature) (F.L.engine_balken) trunc s0
					"X" l0 $* (S.$.actia_kuehlwasser)
					
					(L.L.engine_temperature) 0.9 * (F.L.engine_balken) trunc s0
					"X" l0 $* (S.$.actia_getriebetemp)
					
					(L.L.cockpit_oeldruck) 1.1 * (F.L.oeldruck_balken) trunc s0
					"X" l0 $* (S.$.actia_oeldruck)
					{endif}
				{else}
					0 (S.L.actia_visible_kuehlwasser) (S.L.actia_visible_getriebetemp) (S.L.actia_visible_oeldruck)
				{endif}
			{else}
				0 (S.L.actia_visible_kuehlwasser) (S.L.actia_visible_getriebetemp) (S.L.actia_visible_oeldruck)
			{endif}
						
'	Status Mode
			(L.L.vdv_display_mode) 5 =
			{if}
				0 (S.L.vdv_visible_almex) (S.L.vdv_visible_almex_night) 
				0 (S.L.actia_visible)
				(L.L.vdv_display_changeover) (L.S.Timegap) + 6 min (S.L.vdv_display_changeover)

				(L.L.vdv_display_changeover) 4 >
				(L.L.vdv_display_changeover_clamped) 0 = &&
				{if}
					1 (S.L.vdv_display_mode)
				{endif}
				
				(L.L.vdv_display_changeover) 0.1 >
				{if}
					1 (S.L.actia_visible)
					"actia_display_menu3.png" (S.$.vdv_display_texture)

					(L.L.vdv_display_changeover) 0.3 >
					{if}

					"actia_display_menu3.png" (S.$.vdv_display_texture)
					1 (S.L.actia_visible_consum_l100km) (S.L.actia_visible_consum_km_h) (S.L.actia_visible_consum_km) (S.L.actia_visible_consum_h)

'		Main Symbols
						(L.L.vdv_tank_start) 100 * (L.L.kmstand_start) 1000 * (L.L.m_zaehler_uebertrag_start) + 1000 / / $IntToStr (S.$.actia_l_hk)
						(L.L.kmstand_start) 1000 * (L.L.m_zaehler_uebertrag_start) + (L.L.zeitgeber_start) 3600 / / 1000 / $IntToStr (S.$.actia_durchschnittkmh)
						(L.L.kmstand_start) $IntToStr "." $+ (L.L.m_zaehler_uebertrag_start) "03" $IntToStrEnh 1 $SetLengthL $+ (S.$.actia_kilometer_gefahren)
						(L.L.zeitgeber_start) 3600 / s0 trunc s1 l1 "02" $IntToStrEnh ":" $+ l0 l1 - 60 * "02" $IntToStrEnh $+ (S.$.actia_stunden_gefahren)
					{endif}
				{else}
					0 (S.L.actia_visible_consum_l100km) (S.L.actia_visible_consum_km_h) (S.L.actia_visible_consum_km) (S.L.actia_visible_consum_h)
				{endif}
			{else}
				0 (S.L.actia_visible_consum_l100km) (S.L.actia_visible_consum_km_h) (S.L.actia_visible_consum_km) (S.L.actia_visible_consum_h)
			{endif}
			
'	Status Mode
			(L.L.vdv_display_mode) 6 =
			{if}
				0 (S.L.vdv_visible_almex) (S.L.vdv_visible_almex_night) 
				0 (S.L.actia_visible)
				(L.L.vdv_display_changeover) (L.S.Timegap) + 6 min (S.L.vdv_display_changeover)

				(L.L.vdv_display_changeover) 4 >
				(L.L.vdv_display_changeover_clamped) 0 = &&
				{if}
					1 (S.L.vdv_display_mode)
				{endif}
				
				(L.L.vdv_display_changeover) 0.1 >
				{if}
					1 (S.L.actia_visible)
					"actia_display_menu4.png" (S.$.vdv_display_texture)

					(L.L.vdv_display_changeover) 0.3 >
					{if}

					"actia_display_menu4.png" (S.$.vdv_display_texture)
					1 (S.L.actia_visible_brake_vr) (S.L.actia_visible_brake_vl) (S.L.actia_visible_brake_hr) (S.L.actia_visible_brake_hl)

'		Main Symbols

					(L.L.actia_brake_front_right) "03" $IntToStrEnh (S.$.actia_brake_front_right)
					(L.L.actia_brake_front_left) "03" $IntToStrEnh (S.$.actia_brake_front_left)
					(L.L.actia_brake_back_right) "03" $IntToStrEnh (S.$.actia_brake_back_right)
					(L.L.actia_brake_back_left) "03" $IntToStrEnh (S.$.actia_brake_back_left)
					{endif}
				{else}
					0 (S.L.actia_visible_brake_vr) (S.L.actia_visible_brake_vl) (S.L.actia_visible_brake_hr) (S.L.actia_visible_brake_hl)
				{endif}
			{else}
				0 (S.L.actia_visible_brake_vr) (S.L.actia_visible_brake_vl) (S.L.actia_visible_brake_hr) (S.L.actia_visible_brake_hl)
			{endif}

		{endif}
			
'	Indicator
				
			(L.L.elec_busbar_main)
			{if}

				(L.L.engine_timer_start) 4.4 <				
				(L.L.lights_abbl) ||
				{if}
					1
				{else}
					0
				{endif} (S.L.actia_indic_low_beam_visible)

				(L.L.engine_timer_start) 4.4 <				
				(L.L.lights_fern) ||
				{if}
					1
				{else}
					0
				{endif} (S.L.actia_indic_high_beam_visible)

				(L.L.engine_timer_start) 4.4 <				
				(L.L.lights_blinker_l) ||
				(L.L.lights_warnblinkgeber) ||
				{if}
					1
				{else}
					0
				{endif} (S.L.actia_indic_blinker_l_visible)
				
				(L.L.engine_timer_start) 4.4 <
				(L.L.lights_blinker_r) ||
				(L.L.lights_warnblinkgeber) ||
				{if}
					1
				{else}
					0
				{endif} (S.L.actia_indic_blinker_r_visible)
				
				(L.L.engine_timer_start) 4.4 <			
				(L.L.vdv_error_coolant_active) ||
				(L.L.vdv_error_EDC_active) ||
				(L.L.vdv_error_EBS_active) ||
				{if}
					1
				{else}
					0
				{endif} (S.L.actia_indic_errpior1_visible)
				
				(L.L.engine_timer_start) 4.4 <
				(L.L.vdv_error_door_active) ||
				(L.L.vdv_error_Diesel_active) ||
				(L.L.vdv_error_ECAS_active) ||
				(L.L.vdv_error_gearbox_active) ||
				{if}
					1
				{else}
					0
				{endif} (S.L.actia_indic_errpior2_visible)
				
				(L.L.engine_timer_start) 4.4 <
				(L.L.haltewunsch) ||
				(L.L.door_kinderwagenwunsch) ||
				{if}
					1
				{else}
					0
				{endif} (S.L.actia_indic_request_visible)

				(L.L.engine_timer_start) 4.4 <				
				(L.L.lights_nebelschw) ||
				{if}
					1
				{else}
					0
				{endif} (S.L.actia_indic_fog_lamps_visible)

				(L.L.engine_timer_start) 4.4 <				
				(L.L.vdv_error_EDC_active) ||
				{if}
					1
				{else}
					0
				{endif} (S.L.actia_indic_engine_visible)

				(L.L.engine_timer_start) 4.4 <				
				(L.L.vdv_error_pressure_active) ||
				{if}
					1
				{else}
					0
				{endif} (S.L.actia_indic_pneumatic_visible)

				(L.L.engine_timer_start) 4.4 <				
				(L.L.pandus_2_mode) ||
				{if}
					(L.L.actia_indic_ramp_timer) (L.S.Timegap) + 1 min (S.L.actia_indic_ramp_timer)
					1 =
					{if}
						0 (S.L.actia_indic_ramp_timer)
					{endif}
					
					(L.L.actia_indic_ramp_timer) 0.5 >
					{if}
					1 (S.L.actia_indic_request_ramp_visible)
					{else}
					0 (S.L.actia_indic_request_ramp_visible)
					{endif}
				{else}
					(L.L.door_kinderwagenwunsch)
					{if}
						1
					{else}
						0
					{endif} (S.L.actia_indic_request_ramp_visible)
				{endif}
								
				(L.L.engine_timer_start) 4.4 <				
				(L.L.vdv_error_EBS_active) ||
				{if}
					1
				{else}
					0
				{endif} (S.L.actia_indic_abs_visible)
				
				0 (S.L.actia_indic_obd_visible) (S.L.actia_indic_tacho_visible)
				
			{else}
				
				
				0 (S.L.actia_indic_low_beam_visible) (S.L.actia_indic_high_beam_visible) (S.L.actia_indic_blinker_l_visible) (S.L.actia_indic_blinker_r_visible) (S.L.actia_indic_errpior1_visible) (S.L.actia_indic_errpior2_visible)
				(S.L.actia_indic_request_visible) (S.L.actia_indic_fog_lamps_visible) (S.L.actia_indic_tacho_visible) (S.L.actia_indic_obd_visible) (S.L.actia_indic_engine_visible) (S.L.actia_indic_pneumatic_visible) (S.L.actia_indic_request_ramp_visible) (S.L.actia_indic_abs_visible)
			{endif}

'	Error System




'	Master Warn Red STOP!
	(L.L.vdv_error_pressure_active)
	(L.L.vdv_error_coolant_active) ||
	(L.L.vdv_error_gearbox_active) ||
	(L.L.vdv_error_ECAS_active) ||
	(L.L.vdv_error_EDC_active) ||
	{if}
		1 (S.L.vdv_display_masterwarn)
	{else}
		0 (S.L.vdv_display_masterwarn)
	{endif}



'	Master Warn Red STOP!
	(L.L.vdv_error_pressure_active)
	(L.L.vdv_error_coolant_active) ||
	(L.L.vdv_error_gearbox_active) ||
	(L.L.vdv_error_ECAS_active) ||
	(L.L.vdv_error_EDC_active) ||
	(L.L.vdv_error_nothahn_active) ||
	{if}
		1 (S.L.vdv_display_masterwarn)
	{else}
		0 (S.L.vdv_display_masterwarn)
	{endif}

'	Pressure Warn Yellow
	(L.L.bremse_p_tank04) 550000 <
	(L.L.elec_busbar_main) 0 > &&
	(L.L.vdv_display_startuptime) 16 > &&
	(L.L.vdv_display_masterwarn) ! &&
	{if}
		1 (S.L.vdv_error_pressure2_active)
		(L.L.Pressure2_Signal) 1 + (S.L.Pressure2_Signal)
		1 =
		{if}
'			(T.L.ev_stoermeldung)
			13 (S.L.Fehleranzahl)
		{endif}
	{else}
		0 (S.L.Pressure2_Signal) (S.L.vdv_error_pressure2_active)
	{endif}

'	EBS Warn Yellow
	(L.L.EBS_Error_dist) (L.L.velocity) 3600 / (L.S.Timegap) * + (S.L.EBS_Error_dist)
	(C.L.Fehlertoleranz) (L.L.wearlifespan) * >
	(L.L.elec_busbar_main) 0 > &&
	(L.L.vdv_display_startuptime) 5 > &&
	(L.L.vdv_display_masterwarn) ! &&
	{if}
		1 (S.L.vdv_error_EBS_active)
		(L.L.EBS_Signal) 1 + (S.L.EBS_Signal)
		1 =
		{if}
			(T.L.ev_stoermeldung)
			7 (S.L.Fehleranzahl)
		{endif}
	{else}
		0 (S.L.EBS_Signal) (S.L.vdv_error_EBS_active)
	{endif}

'	Gearstart Warn Yellow
	(L.L.antrieb_getr_gangwahl) 1 >
	(L.L.cp_taster_anlasser) &&
	(L.L.elec_busbar_main) 0 > &&
	(L.L.vdv_display_startuptime) 5 > &&
	(L.L.vdv_display_masterwarn) ! &&
	{if}
		1 (S.L.vdv_error_gearstart_active)
		(L.L.gearstart_Signal) 1 + (S.L.gearstart_Signal)
		1 =
		{if}
			(T.L.ev_stoermeldung)
			8 (S.L.Fehleranzahl)
		{endif}
	{else}
		0 (S.L.gearstart_Signal) (S.L.vdv_error_gearstart_active)
	{endif}

'	Door Warn Yellow
	(L.L.Door_Error_Count) (C.L.Tuerfehlertoleranz) (L.L.wearlifespan) * >
	(L.L.elec_busbar_main) 0 > &&
	(L.L.vdv_display_startuptime) 5 > &&
	(L.L.vdv_display_masterwarn) ! &&
	{if}
		1 (S.L.vdv_error_door_active)
		(L.L.door_Signal) 1 + (S.L.door_Signal)
		1 =
		{if}
			(T.L.ev_stoermeldung)
			9 (S.L.Fehleranzahl)
		{endif}
	{else}
		0 (S.L.door_Signal) (S.L.vdv_error_door_active)
	{endif}

'	Retarder Warn Yellow
	(L.L.Retarder_Error_dist) (L.L.velocity) 3600 / (L.S.Timegap) * + (S.L.Retarder_Error_dist)
	(C.L.Fehlertoleranz) (L.L.wearlifespan) * >
	(L.L.antrieb_temperature) 150 > ||
	(L.L.elec_busbar_main) 0 > &&
	(L.L.vdv_display_startuptime) 5 > &&
	(L.L.vdv_display_masterwarn) ! &&
	{if}
		1 (S.L.vdv_error_retarder_active)
		(L.L.retarder_Signal) 1 + (S.L.retarder_Signal)
		1 =
		{if}
			(T.L.ev_stoermeldung)
			10 (S.L.Fehleranzahl)
		{endif}
	{else}
		0 (S.L.retarder_Signal) (S.L.vdv_error_retarder_active)
	{endif}

'	Low Diesel Warn Yellow
	(L.L.engine_tank_content) 60 <
	(L.L.elec_busbar_main) 0 > &&
	(L.L.vdv_display_startuptime) 5 > &&
	(L.L.vdv_display_masterwarn) ! &&
	{if}
		1 (S.L.vdv_error_diesel_active)
		(L.L.diesel_Signal) 1 + (S.L.diesel_Signal)
		1 =
		{if}
			(T.L.ev_stoermeldung)
			11 (S.L.Fehleranzahl)
		{endif}
	{else}
		0 (S.L.diesel_Signal) (S.L.vdv_error_diesel_active)
	{endif}

'	Low Adblue Warn Yellow
	(L.L.engine_adblue_content) 60 <
	(L.L.elec_busbar_main) 0 > &&
	(L.L.vdv_display_startuptime) 5 > &&
	(L.L.vdv_display_masterwarn) ! &&
	{if}
		1 (S.L.vdv_error_adblue_active)
		(L.L.adblue_Signal) 1 + (S.L.adblue_Signal)
		1 =
		{if}
			(T.L.ev_stoermeldung)
			11 (S.L.Fehleranzahl)
		{endif}
	{else}
		0 (S.L.adblue_Signal) (S.L.vdv_error_adblue_active)
	{endif}
	
'	Battery Warn Yellow
	(L.L.Battery_Error_dist) (L.L.velocity) 3600 / (L.S.Timegap) * + (S.L.Battery_Error_dist)
	(C.L.Fehlertoleranz) (L.L.wearlifespan) * >
	(L.L.elec_busbar_main) 0 > &&
	(L.L.vdv_display_startuptime) 5 > &&
	(L.L.vdv_display_masterwarn) ! &&
	{if}
		1 (S.L.vdv_error_Battery_active)
		(L.L.Battery_Signal) 1 + (S.L.Battery_Signal)
		1 =
		{if}
			(T.L.ev_stoermeldung)
			12 (S.L.Fehleranzahl)
		{endif}
	{else}
		0 (S.L.Battery_Signal) (S.L.vdv_error_Battery_active)
	{endif}

'	Coolant Warn Red - not cancelable
	(L.L.engine_temperature) 106 >
	(L.L.elec_busbar_main) 0 > &&
	(L.L.vdv_display_startuptime) 5 > &&
	{if}
		1 (S.L.vdv_error_coolant_active)
		(L.L.coolant_Signal) 1 + (S.L.coolant_Signal)
		1 =
		{if}
			(T.L.ev_stoermeldung_rot)
			1 (S.L.Fehleranzahl)
		{endif}
	{else}
		(L.L.engine_temperature) 100 <
		{if}
			0 (S.L.coolant_Signal) (S.L.vdv_error_coolant_active)
		{endif}
	{endif}

'	Gearbox Warn Red - not cancelable
	(L.L.Gear_Error_dist) (L.L.velocity) 3600 / (L.S.Timegap) * + (S.L.Gear_Error_dist)
	(C.L.Fehlertoleranz) (L.L.wearlifespan) * > (S.L.antrieb_failure_general)
	(L.L.elec_busbar_main) 0 > &&
	(L.L.vdv_display_startuptime) 5 > &&
	{if}
		1 (S.L.vdv_error_gearbox_active)
		(L.L.gearbox_Signal) 1 + (S.L.gearbox_Signal)
		1 =
		{if}
			(T.L.ev_stoermeldung_rot)
			2 (S.L.Fehleranzahl)
		{endif}
	{else}
		0 (S.L.gearbox_Signal) (S.L.vdv_error_gearbox_active)
	{endif}

'	ECAS Warn Red - not cancelable
	(L.L.ECAS_Error_dist) (L.L.velocity) 3600 / (L.S.Timegap) * + (S.L.ECAS_Error_dist)
	(C.L.Fehlertoleranz) (L.L.wearlifespan) * >
	(L.L.elec_busbar_main) 0 > &&
	(L.L.vdv_display_startuptime) 5 > &&
	{if}
		1 (S.L.vdv_error_ecas_active)
		(L.L.ecas_Signal) 1 + (S.L.ecas_Signal)
		1 =
		{if}
			(T.L.ev_stoermeldung_rot)
			3 (S.L.Fehleranzahl)
		{endif}
	{else}
		0 (S.L.ecas_Signal) (S.L.vdv_error_ecas_active)
	{endif}

'	Pressure Warn Red - not cancelable
	(L.L.bremse_p_tank01) 600000 <
	(L.L.bremse_p_tank02) 600000 < ||
	(L.L.elec_busbar_main) 0 > &&
	(L.L.engine_n) 300 > &&
	(L.L.vdv_display_startuptime) 5 > &&
	{if}
		1 (S.L.vdv_error_pressure_active)
		(L.L.Pressure_Signal) 1 + (S.L.Pressure_Signal)
		1 =
		{if}
			(T.L.ev_stoermeldung_rot)
			4 (S.L.Fehleranzahl)
		{endif}
	{else}
		0 (S.L.Pressure_Signal) (S.L.vdv_error_pressure_active)
	{endif}

'	EDC Warn Red - not cancelable
	(L.L.EDC_Error_dist) (L.L.velocity) 3600 / (L.S.Timegap) * + (S.L.EDC_Error_dist)
	(C.L.Fehlertoleranz) (L.L.wearlifespan) * >
	(L.L.elec_busbar_main) 0 > &&
	(L.L.vdv_display_startuptime) 5 > &&
	{if}
		1 (S.L.vdv_error_edc_active)
		(L.L.edc_Signal) 1 + (S.L.edc_Signal)
		1 =
		{if}
			(T.L.ev_stoermeldung_rot)
			5 (S.L.Fehleranzahl)
		{endif}
	{else}
		0 (S.L.edc_Signal) (S.L.vdv_error_edc_active)
	{endif}

'	Nothahn Warn Red - not cancelable
	(L.L.door_01_nothahn_sw)
	(L.L.door_23_nothahn_sw) ||
	(L.L.door_45_nothahn_sw) ||
	(L.L.elec_busbar_main) 0 > &&
	(L.L.vdv_display_startuptime) 5 > &&
	{if}
		1 (S.L.vdv_error_nothahn_active)
		(L.L.nothahn_Signal) 1 + (S.L.nothahn_Signal)
		1 =
		{if}
			(T.L.ev_stoermeldung_rot)
			6 (S.L.Fehleranzahl)
		{endif}
	{else}
		0 (S.L.nothahn_Signal) (S.L.vdv_error_nothahn_active)
	{endif}

'	Door Clear
	(L.L.door_01_nothahn_sw)
	(L.L.Door_Error_Count) (C.L.Tuerfehlertoleranz) (L.L.wearlifespan) * > &&
	{if}
		(C.L.Tuerfehlertoleranz) (L.L.wearlifespan) * random (S.L.Door_Error_Count)
	{endif}

'	Possible Manual Error fixing

'	EDC Clear
	(L.L.vdv_error_edc_active)
	(L.L.elec_busbar_main) 0 = &&
	(L.L.engine_n) 0 = &&
	{if}
		(C.L.Fehlertoleranz) (L.L.wearlifespan) * random (S.L.EDC_Error_dist)
	{endif}

'	Door Clear
	(L.L.Door_Error_Count) (C.L.Tuerfehlertoleranz) (L.L.wearlifespan) * >
	(L.L.elec_busbar_main) 0 = &&
	{if}
		(C.L.Tuerfehlertoleranz) (L.L.wearlifespan) * random (S.L.Door_Error_Count)
	{endif}

'	Retarder Clear
	(L.L.vdv_error_retarder_active)
	(L.L.elec_busbar_main) 0 = &&
	(L.L.engine_n) 0 = &&
	{if}
		(C.L.Fehlertoleranz) (L.L.wearlifespan) * random (S.L.Retarder_Error_dist)
	{endif}
	
'Gerbox clear

	(L.L.vdv_error_gearbox_active)
	(L.L.elec_busbar_main) 0 = &&
	(L.L.engine_n) 0 = &&
	{if}
		(C.L.Fehlertoleranz) (L.L.wearlifespan) * random (S.L.Gear_Error_dist)
	{endif}
	
' ecas clear
	
	(L.L.vdv_error_ecas_active)
	(L.L.elec_busbar_main) 0 = &&
	(L.L.engine_n) 0 = &&
	{if}
		(C.L.Fehlertoleranz) (L.L.wearlifespan) * random (S.L.ECAS_Error_dist)
	{endif}
	
' ebs clear
	
	(L.L.vdv_error_EBS_active)
	(L.L.elec_busbar_main) 0 = &&
	(L.L.engine_n) 0 = &&
	{if}
		(C.L.Fehlertoleranz) (L.L.wearlifespan) * random (S.L.EBS_Error_dist)
	{endif}

'#####################################################################################


'	Kneeling signal

(L.L.vdv_error_ECAS_active) !
{if}	
	(L.L.doorTarget_0) 1 = (L.L.doorTarget_1) 1 = || (L.L.doorTarget_23) 1 = || (L.L.doorTarget_45) 1 = || (L.L.kneel_allowed) 1 = && (L.L.bremse_halte) 1 = &&
	(L.L.doorTarget_0) 1 = (L.L.doorTarget_1) 1 = || (L.L.doorTarget_23) 1 = || (L.L.doorTarget_45) 1 = || (L.L.kneel_auto_set) 1 = && (L.L.bremse_halte) 1 = && ||
	(L.L.elec_busbar_main) 0 > &&
	(L.L.bremse_p_tank01) 500000 > &&
	(L.L.bremse_p_tank02) 500000 > &&
	(L.L.bremse_p_tank03) 500000 > &&
	{if}
		(L.L.kneeling_blinkgeber) (L.S.Timegap) + 1 min (S.L.kneeling_blinkgeber)
		1 =
		{if}
			0 (S.L.kneeling_blinkgeber)
		{endif}
		(L.L.kneel_timer) (L.S.timegap) + 5 min (S.L.kneel_timer)
		(L.L.kneel_timer) 5 =
		(L.L.vdv_display_mode) 2 = &&
		(L.L.vdv_display_changeover) 0.5 > &&
		{if}
			0 (S.L.vdv_visible_kneel1)
			1 (S.L.vdv_visible_kneel2)
		{else}
			(L.L.kneeling_blinkgeber) 0.5 >
			(L.L.vdv_display_mode) 2 = &&
			(L.L.vdv_display_changeover) 0.5 > &&
			{if}
				1 (S.L.vdv_visible_kneel1)
				0 (S.L.vdv_visible_kneel2)
			{else}
				0 (S.L.vdv_visible_kneel1)
				0 (S.L.vdv_visible_kneel2)
			{endif}
		{endif}
	{endif}

	(L.L.doorTarget_0) 0 = (L.L.doorTarget_1) 0 = && (L.L.doorTarget_23) 0 = && (L.L.doorTarget_45) 0 = &&
	(L.L.kneel_allowed) 0 = (L.L.kneel_locked) 0 = && (L.L.kneel_auto_set) 0 = && ||
	(L.L.elec_busbar_main) 0 > &&
	(L.L.bremse_p_tank01) 500000 > &&
	(L.L.bremse_p_tank02) 500000 > &&
	(L.L.bremse_p_tank03) 500000 > &&
	{if}
		(L.L.doortimer23) (C.L.tuerverzoegerung) >=
		(L.L.doortimer45) (C.L.tuerverzoegerung) >= &&
		(L.L.kneel_allowed) 0 = (L.L.kneel_locked) 0 = && (L.L.kneel_auto_set) 0 = && ||
		{if}
			(L.L.kneeling_blinkgeber) (L.S.Timegap) + 1 min (S.L.kneeling_blinkgeber)
			1 =
			{if}
				0 (S.L.kneeling_blinkgeber)
			{endif}
			(L.L.kneel_timer) (L.S.timegap) 2 * - 0 max (S.L.kneel_timer)
			(L.L.kneel_timer) 0 =
			{if}
				0 (S.L.vdv_visible_kneel1)
				0 (S.L.vdv_visible_kneel2)
			{endif}
			(L.L.kneel_timer) 0 >
			{if}
				(L.L.kneeling_blinkgeber) 0.5 >
				(L.L.vdv_display_mode) 2 = &&
				{if}
					1 (S.L.vdv_visible_kneel1)
					0 (S.L.vdv_visible_kneel2)
				{else}
					0 (S.L.vdv_visible_kneel1)
					0 (S.L.vdv_visible_kneel2)
				{endif}
			{endif}
		{endif}
	{endif}
	(L.L.ecas_fill_front) (L.L.ecas_fill_mid) || (L.L.ecas_fill_back) || (L.L.ecas_rise_active) || (L.L.kneel_timer) 0 = && ||
	(L.L.vdv_display_mode) 2 = &&
	{if}
		1 (S.L.vdv_visible_kneel1)
	{endif}
{endif}

	{else}
		0 (S.L.vdv_display_startuptime) (S.L.vdv_display_changeover) (S.L.vdv_display_mode)
		0 (S.L.vdv_visible_p) (S.L.vdv_visible_stopbrake) (S.L.vdv_visible_door0) (S.L.vdv_visible_door1) (S.L.vdv_visible_door2) (S.L.vdv_visible_door3) (S.L.vdv_visible_kneel1) (S.L.vdv_visible_kneel2) (S.L.vdv_visible_kneel3) (S.L.vdv_visible_winglock) (S.L.vdv_visible_ramp2) (S.L.vdv_visible_request3) (S.L.vdv_visible_almex) (S.L.vdv_visible_almex_night) (S.L.vdv_visible_door2clearance)
		0 (S.L.vdv_visible_request) (S.L.vdv_visible_AC) (S.L.vdv_visible_heater) (S.L.vdv_visible_mirrorheat) (S.L.vdv_visible_asr) (S.L.vdv_visible_rooflight)
		0 (S.L.vdv_visible_press) (S.L.vdv_visible_temp) (S.L.vdv_visible_fuel) (S.L.vdv_visible_press2) (S.L.vdv_visible_error)
		"actia_alpha100.dds"
		0 (S.L.actia_indic_low_beam_visible) (S.L.actia_indic_high_beam_visible) (S.L.actia_indic_blinker_l_visible) (S.L.actia_indic_blinker_r_visible) (S.L.actia_indic_errpior1_visible) (S.L.actia_indic_errpior2_visible)
		(S.L.actia_indic_request_visible) (S.L.actia_indic_fog_lamps_visible) (S.L.actia_indic_tacho_visible) (S.L.actia_indic_obd_visible) (S.L.actia_indic_engine_visible) (S.L.actia_indic_pneumatic_visible) (S.L.actia_indic_request_ramp_visible) (S.L.actia_indic_abs_visible)
		0 (S.L.actia_visible_fuel) (S.L.actia_visible_adblue) (S.L.actia_gangR) (S.L.actia_gangN) (S.L.actia_gang1) (S.L.actia_gang2) (S.L.actia_gang3) (S.L.actia_gang4) (S.L.actia_uhr) (S.L.actia_Datum) (S.L.actia_aussentemp) (S.L.actia_visible_consum_l100km_dm)
		0 (S.L.actia_haltewunsch_visible) (S.L.actia_nebelschluss_visible) (S.L.actia_niveau_visible) (S.L.actia_adblue_visible) (S.L.actia_rollstuhl_visible) (S.L.actia_asr_visible) (S.L.actia_brakewarn_visible) (S.L.actia_retarder_visible)
		0 (S.L.actia_visible_vorratsdruck1) (S.L.actia_visible_vorratsdruck2) (S.L.actia_visible_kuehlwasser) (S.L.actia_visible_getriebetemp) (S.L.actia_visible_oeldruck) (S.L.actia_visible_consum_l100km) (S.L.actia_visible_consum_km_h) (S.L.actia_visible_consum_km) (S.L.actia_visible_consum_h)
		0 (S.L.actia_visible_brake_vr) (S.L.actia_visible_brake_vl) (S.L.actia_visible_brake_hr) (S.L.actia_visible_brake_hl)
	
	(L.L.elec_busbar_main) 0 =
	(L.L.actia_visible) || &&
	{if}
		1 (S.L.actia_visible) 
	(L.L.vdv_display_shutdown) (L.S.Timegap) + 3 min (S.L.vdv_display_shutdown)
	
		(L.L.bremse_feststell) 0.5 <
		{if}
			(L.L.actia_indic_brake_timer) (L.S.Timegap) + 1 min (S.L.actia_indic_brake_timer)
			1 =
			{if}
			0 (S.L.actia_indic_brake_timer)
			{endif}
					
			(L.L.actia_indic_brake_timer) 0.5 >
			{if}
			0 (S.L.actia_indic_parking_brake_visible)
			{else}
			0 (S.L.actia_indic_parking_brake_visible)
			{endif}
		{else}
			0 (S.L.actia_indic_parking_brake_visible)
		{endif}
	
			(L.L.bremse_feststell) 0.5 <
			{if}
			"actia_Display_init3.png" (S.$.vdv_display_texture)
			{else}
				(L.L.lights_stand) 1 =
				(L.L.lights_sw_blinker) 0 > ||
				(L.L.lights_sw_warnblinker) ||
				(L.L.cp_licht_unterdeck_sw) ||
				(L.L.cp_licht_oberdeck_sw) ||
				(L.L.cp_licht_untenrechts_sw) ||
				(L.L.engine_n) 300 > ||
				{if}
				"actia_Display_init1.png" (S.$.vdv_display_texture)
				{else}
				0 (S.L.actia_visible) (S.L.vdv_display_shutdown)
				0 (S.L.actia_indic_parking_brake_visible) (S.L.actia_indic_brake_timer)
				{endif}
			{endif}
	
		(L.L.vdv_display_shutdown) 3 =
		{if}
		0 (S.L.vdv_display_shutdown)
		0 (S.L.actia_visible)
		0 (S.L.actia_indic_parking_brake_visible) (S.L.actia_indic_brake_timer)
		{endif}
	{else}
	0 (S.L.vdv_display_shutdown)
	0 (S.L.actia_visible)
	{endif}
	
	
	{endif}


'##############################################################
'#######Появление индикаторов при определенных условиях########
'##############################################################

'Можно было вписать сюда туеву хучу условий экранов, но всё должно быть культурно, поэтому я разбил их по 4 разным файлам, чтобы было разобраться в чем пока потягиваешь пиво





'Тест
(L.L.engine_tank_content) $IntToStr (S.$.engine_tank_content1)

' Цифровые часы Автор Славок
 (L.S.Time) 3600 / trunc " 2" s0
 (L.S.Time) 60 / l0 60 * - s1 
 
 l0 10 <
 {if}
  "0" l0 $IntToStr $+
 {else}
  l0 $IntToStr
 {endif}
 
 l1 10 <
 {if}
  ":0" $+ l1 $IntToStr $+
 {else}
  ":" $+ l1 $IntToStr $+
 {endif}
 
 (S.$.vdo_panel_time)

	(L.L.Velocity) $IntToStr (S.$.vdo_panel_speed)
{end}

{macro:kippschaltersound}
	l0
	{if}
		(T.L.ev_VDV_on)
	{else}
		(T.L.ev_VDV_off)
	{endif}	
{end}

{macro:kippschaltersound_toggle}
	l0
	{if}
		(T.L.ev_VDV_toggle_on)
	{else}
		(T.L.ev_VDV_toggle_off)
	{endif}	
{end}
