'##############
'IBIS Script
'##############

'Interior display monitor

'(c) 2019 KAJOTT3D

'Script Version: 1.0
'Omsi release: 1.0

'----------------------
'	Frame
'----------------------
{macro:interior_display_monitor_frame}

	(L.L.interior_display) 2 =
	(L.L.elec_busbar_main) &&
	{if}
' ekrany male

		(L.L.wysw_stop_ar) trunc 1 =
		(L.L.haltewunschlampe_all) &&
		{if}
			4 (S.L.monitor_ekrany_male_timer)
			1 (S.L.monitor_ekrany_male)
		{endif}
			
		(L.L.Velocity) 1 <
		(L.L.door_0) 0.2 > &&
		(L.L.door_1) 0.2 > ||
		(L.L.door_2) 0.2 > ||
		(L.L.door_3) 0.2 > ||
		(L.L.door_4) 0.2 > ||
		(L.L.door_5) 0.2 > ||
		(L.L.door_6) 0.2 > ||
		(L.L.door_7) 0.2 > ||
		{if}
			0 (S.L.monitor_ekrany_male_timer)
			4 (S.L.monitor_ekrany_male)
			
			"Przystanek:" 26 $SetLengthL "@" $+
			(M.V.GetTTBusstopIndex) (L.$.IBIS_busstop_name) 24 $SetLengthR $+ "@" $+ (S.$.interior_display_monitor_przystanek_i_imieniny)
		{else}	
			(L.L.monitor_nast_przyst_antirepeat) !
			{if}
				0 (S.L.monitor_ekrany_male_timer)
				4 (S.L.monitor_ekrany_male)
				1 (S.L.monitor_nast_przyst_antirepeat)
				1 (S.L.monitor_nast_przyst)
			{endif}
			
			
			(L.L.monitor_ekrany_male_timer) 8 <
			{if}
				(L.L.monitor_ekrany_male_timer) (L.S.Timegap) + (S.L.monitor_ekrany_male_timer)
			{else}
				0 (S.L.monitor_ekrany_male_timer) 
				0 (S.L.monitor_nast_przyst)
			
				(L.L.monitor_ekrany_male) 4 <
				{if}
					(L.L.monitor_ekrany_male) 1 + (S.L.monitor_ekrany_male)
				{else}
					2 (S.L.monitor_ekrany_male)
				{endif}
			{endif}
			
			(L.L.monitor_nast_przyst) 1 =
			{if}
				"Nastepny przystanek:" 27 $SetLengthL "@" $+
				(M.V.GetTTBusstopIndex) (L.$.IBIS_busstop_name) 24 $SetLengthR $+ "@" $+ (S.$.interior_display_monitor_przystanek_i_imieniny)
			{else}
				"Imieniny:      " (L.$.Imieniny_1) $+ 29 $SetLengthL "@" $+
				(L.$.Imieniny_2) 24 $SetLengthR $+ "@" $+ (S.$.interior_display_monitor_przystanek_i_imieniny)
			{endif}
		{endif}
		
' ekrany reklamowe duze

		(L.L.monitor_ekrany_duze_timer) 10 <
		{if}
			(L.L.monitor_ekrany_duze_timer) (L.S.Timegap) + (S.L.monitor_ekrany_duze_timer)
		{else}
			0 (S.L.monitor_ekrany_duze_timer)
			
			(L.L.monitor_ekrany_duze) 5 <
			{if}
				(L.L.monitor_ekrany_duze) 1 + (S.L.monitor_ekrany_duze)
			{else}
				1 (S.L.monitor_ekrany_duze)
			{endif}
			
		{endif}
		
' napisy
 
		"Kierunek:" 20 $SetLengthL "@" $+
		(L.$.IBIS_terminus_name) 18 $SetLengthR $+ "@" $+
		(L.$.Matrix_Nr) $+ (S.$.interior_display_monitor_kierunek)
		
		
		(L.$.nazwa_dnia_tygodnia) 19 $SetLengthL "@" $+
		(L.S.Day) $IntToStr "." $+ (L.S.Month) $IntToStr $+ "." $+ (L.S.Year) $IntToStr $+ 21 $SetLengthR $+ "@" $+ 		
		(L.S.Time) 3600 / s0 trunc s1 "02" $IntToStrEnh $+ ":" $+
		l0 l1 - 60 * s2 trunc s3 "02" $IntToStrEnh $+ (S.$.interior_display_monitor_data)

	{else}
		0 (S.L.monitor_ekrany_duze_timer) (S.L.monitor_ekrany_duze)
	{endif}
	
{end}