-- ****************
--   COMM Display
-- ****************
dofile(LockOn_Options.script_path.."MPCD/indicator/MPCD_definitions.lua")
dofile(LockOn_Options.script_path.."MPCD/indicator/MENU/MPCD_BG.lua")

-- MAIN MENU
local	mpcd_mm_btn_02				= CreateElement "ceStringPoly"
		mpcd_mm_btn_02.name			= "mpcd_mm_btn_02"
		mpcd_mm_btn_02.material		= mpcd_tpod_font
		mpcd_mm_btn_02.init_pos		= mpcd_btn_02_pos
		mpcd_mm_btn_02.alignment	= "CenterCenter"
		mpcd_mm_btn_02.value		= "S\nT\nA\nT"
		mpcd_mm_btn_02.stringdefs	= MPCD_default_font_size
Add_MPCD_Element(mpcd_mm_btn_02)

local	comm_btn_05				= create_mpcd_textured_box( 180, 864, 198, 922)
		comm_btn_05.name		= "comm_btn_05"
		comm_btn_05.init_pos	= mpcd_btn_05_pos
Add_MPCD_Element(comm_btn_05)

local	btn_left_menu				= CreateElement "ceStringPoly"
		btn_left_menu.name			= "btn_left_menu"
		btn_left_menu.material		= mpcd_tpod_font
		btn_left_menu.init_pos		= {-0.95,  0.49, 0}
		btn_left_menu.alignment		= "LeftCenter"
		btn_left_menu.value			= "LINE"
		btn_left_menu.stringdefs	= MPCD_default_font_size
Add_MPCD_Element(btn_left_menu)

local	comm_btn_04				= create_mpcd_textured_box( 209, 864, 227, 924)
		comm_btn_04.name		= "comm_btn_04"
		comm_btn_04.init_pos	= mpcd_btn_04_pos
Add_MPCD_Element(comm_btn_04)

local	mpcd_mm_btn_06				= CreateElement "ceStringPoly"
		mpcd_mm_btn_06.name			= "mpcd_mm_btn_06a"
		mpcd_mm_btn_06.material		= mpcd_tpod_font
		mpcd_mm_btn_06.init_pos		= mpcd_btn_06_pos
		mpcd_mm_btn_06.alignment	= "CenterCenter"
		mpcd_mm_btn_06.value		= "SCAN"
		mpcd_mm_btn_06.stringdefs	= MPCD_default_font_size
Add_MPCD_Element(mpcd_mm_btn_06)

local	mpcd_mm_btn_07				= CreateElement "ceStringPoly"
		mpcd_mm_btn_07.name			= "mpcd_mm_btn_07a"
		mpcd_mm_btn_07.material		= mpcd_tpod_font
		mpcd_mm_btn_07.init_pos		= mpcd_btn_07_pos
		mpcd_mm_btn_07.alignment	= "CenterCenter"
		mpcd_mm_btn_07.value		= "FF"
		mpcd_mm_btn_07.stringdefs	= MPCD_default_font_size
Add_MPCD_Element(mpcd_mm_btn_07)

local	mpcd_mm_btn_08				= CreateElement "ceStringPoly"
		mpcd_mm_btn_08.name			= "mpcd_mm_btn_08"
		mpcd_mm_btn_08.material		= mpcd_tpod_font
		mpcd_mm_btn_08.init_pos		= mpcd_btn_08_pos
		mpcd_mm_btn_08.alignment	= "CenterCenter"
		mpcd_mm_btn_08.value		= "AJ"
		mpcd_mm_btn_08.stringdefs	= MPCD_default_font_size
Add_MPCD_Element(mpcd_mm_btn_08)

local	mpcd_mm_btn_09				= CreateElement "ceStringPoly"
		mpcd_mm_btn_09.name			= "mpcd_mm_btn_09"
		mpcd_mm_btn_09.material		= mpcd_tpod_font
		mpcd_mm_btn_09.init_pos		= mpcd_btn_09_pos
		mpcd_mm_btn_09.alignment	= "CenterCenter"
		mpcd_mm_btn_09.value		= "MX"
		mpcd_mm_btn_09.stringdefs	= MPCD_default_font_size
Add_MPCD_Element(mpcd_mm_btn_09)

local	comm_btn_11				= create_mpcd_textured_box( 180, 864, 198, 922)
		comm_btn_11.name		= "comm_btn_11"
		comm_btn_11.init_pos	= mpcd_btn_11_pos
Add_MPCD_Element(comm_btn_11)

local	btn_right_menu				= CreateElement "ceStringPoly"
		btn_right_menu.name			= "btn_right_menu"
		btn_right_menu.material		= mpcd_tpod_font
		btn_right_menu.init_pos		= {0.95,  0.49, 0}
		btn_right_menu.alignment	= "RightCenter"
		btn_right_menu.value		= "PG"
		btn_right_menu.stringdefs	= MPCD_default_font_size
Add_MPCD_Element(btn_right_menu)

local	comm_btn_12				= create_mpcd_textured_box( 209, 864, 227, 924)
		comm_btn_12.name		= "comm_btn_12"
		comm_btn_12.init_pos	= mpcd_btn_12_pos
Add_MPCD_Element(comm_btn_12)

local	mpcd_mm_btn_14				= CreateElement "ceStringPoly"
		mpcd_mm_btn_14.name			= "mpcd_mm_btn_14"
		mpcd_mm_btn_14.material		= mpcd_tpod_font
		mpcd_mm_btn_14.init_pos		= mpcd_btn_14_pos
		mpcd_mm_btn_14.alignment	= "CenterCenter"
		mpcd_mm_btn_14.value		= "H\nQ"
		mpcd_mm_btn_14.stringdefs	= MPCD_default_font_size
Add_MPCD_Element(mpcd_mm_btn_14)

local	mpcd_mm_btn_17				= CreateElement "ceStringPoly"
		mpcd_mm_btn_17.name			= "mpcd_mm_btn_17"
		mpcd_mm_btn_17.material		= mpcd_tpod_font
		mpcd_mm_btn_17.init_pos		= mpcd_btn_17_pos
		mpcd_mm_btn_17.alignment	= "CenterCenter"
		mpcd_mm_btn_17.value		= "COMM2"
		mpcd_mm_btn_17.stringdefs	= MPCD_default_font_size
Add_MPCD_Element(mpcd_mm_btn_17)

local	mpcd_mm_btn_18				= CreateElement "ceStringPoly"
		mpcd_mm_btn_18.name			= "mpcd_mm_btn_18"
		mpcd_mm_btn_18.material		= mpcd_tpod_font
		mpcd_mm_btn_18.init_pos		= mpcd_btn_18_pos
		mpcd_mm_btn_18.alignment	= "CenterCenter"
		mpcd_mm_btn_18.value		= "MENU"
		mpcd_mm_btn_18.stringdefs	= MPCD_default_font_size
Add_MPCD_Element(mpcd_mm_btn_18)

local	mpcd_mm_btn_20				= CreateElement "ceStringPoly"
		mpcd_mm_btn_20.name			= "mpcd_mm_btn_20"
		mpcd_mm_btn_20.material		= mpcd_tpod_font
		mpcd_mm_btn_20.init_pos		= mpcd_btn_20_pos
		mpcd_mm_btn_20.alignment	= "CenterCenter"
		mpcd_mm_btn_20.value		= "COMM1"
		mpcd_mm_btn_20.stringdefs	= MPCD_default_font_size
Add_MPCD_Element(mpcd_mm_btn_20)

-- BOXED SELECTION
local	com1_page_sel				= create_mpcd_textured_box( 60, 4, 175, 50)
		com1_page_sel.name			= "com1_page_sel"
		com1_page_sel.init_pos		= mpcd_btn_20_pos
		com1_page_sel.controllers	= {{"COM1_Selected"}}
Add_MPCD_VIDEO_Element(com1_page_sel)

local	com2_page_sel				= create_mpcd_textured_box( 60, 4, 175, 50)
		com2_page_sel.name			= "com2_page_sel"
		com2_page_sel.init_pos		= mpcd_btn_17_pos
		com2_page_sel.controllers	= {{"COM2_Selected"}}
Add_MPCD_VIDEO_Element(com2_page_sel)

-- Display - TOP
local	LBL_TOP_COL1				= CreateElement "ceStringPoly"
		LBL_TOP_COL1.name			= "LBL_TOP_COL1"
		LBL_TOP_COL1.material		= mpcd_tpod_font
		LBL_TOP_COL1.init_pos		= {-0.75, 0.80, 0.0}
		LBL_TOP_COL1.alignment		= "LeftCenter"
		LBL_TOP_COL1.value			= "CH"
		LBL_TOP_COL1.stringdefs		= MPCD_data1_font_size
Add_MPCD_Element(LBL_TOP_COL1)

local	LBL_TOP_COL2				= CreateElement "ceStringPoly"
		LBL_TOP_COL2.name			= "LBL_TOP_COL2"
		LBL_TOP_COL2.material		= mpcd_tpod_font
		LBL_TOP_COL2.init_pos		= {-0.60, 0.80, 0.0}
		LBL_TOP_COL2.alignment		= "LeftCenter"
		LBL_TOP_COL2.value			= "FREQ/MOD"
		LBL_TOP_COL2.stringdefs		= MPCD_data1_font_size
Add_MPCD_Element(LBL_TOP_COL2)

local	LBL_TOP_COL3				= CreateElement "ceStringPoly"
		LBL_TOP_COL3.name			= "LBL_TOP_COL3"
		LBL_TOP_COL3.material		= mpcd_tpod_font
		LBL_TOP_COL3.init_pos		= {-0.23, 0.80, 0.0}
		LBL_TOP_COL3.alignment		= "LeftCenter"
		LBL_TOP_COL3.value			= "COLOR"
		LBL_TOP_COL3.stringdefs		= MPCD_data1_font_size
Add_MPCD_Element(LBL_TOP_COL3)

local	LBL_TOP_COL4				= CreateElement "ceStringPoly"
		LBL_TOP_COL4.name			= "LBL_TOP_COL4"
		LBL_TOP_COL4.material		= mpcd_tpod_font
		LBL_TOP_COL4.init_pos		= {0.02, 0.80, 0.0}
		LBL_TOP_COL4.alignment		= "LeftCenter"
		LBL_TOP_COL4.value			= "CIPH"
		LBL_TOP_COL4.stringdefs		= MPCD_data1_font_size
Add_MPCD_Element(LBL_TOP_COL4)

local	LBL_TOP_COL5				= CreateElement "ceStringPoly"
		LBL_TOP_COL5.name			= "LBL_TOP_COL5"
		LBL_TOP_COL5.material		= mpcd_tpod_font
		LBL_TOP_COL5.init_pos		= {0.20, 0.80, 0.0}
		LBL_TOP_COL5.alignment		= "LeftCenter"
		LBL_TOP_COL5.value			= "AGENCY"
		LBL_TOP_COL5.stringdefs		= MPCD_data1_font_size
Add_MPCD_Element(LBL_TOP_COL5)

local	LBL_TOP_COL6				= CreateElement "ceStringPoly"
		LBL_TOP_COL6.name			= "LBL_TOP_COL6"
		LBL_TOP_COL6.material		= mpcd_tpod_font
		LBL_TOP_COL6.init_pos		= {0.47, 0.80, 0.0}
		LBL_TOP_COL6.alignment		= "LeftCenter"
		LBL_TOP_COL6.value			= "CALL"
		LBL_TOP_COL6.stringdefs		= MPCD_data1_font_size
Add_MPCD_Element(LBL_TOP_COL6)


-- Display - BOTTOM
local	LBL_BTM_DEG					= CreateElement "ceStringPoly"
		LBL_BTM_DEG.name			= "LBL_BTM_DEG"
		LBL_BTM_DEG.material		= mpcd_tpod_font
		LBL_BTM_DEG.init_pos		= {-0.65, -0.70, 0}
		LBL_BTM_DEG.alignment		= "CenterCenter"
		LBL_BTM_DEG.value			= "DEGRADE"
		LBL_BTM_DEG.stringdefs		= MPCD_data1_font_size
Add_MPCD_Element(LBL_BTM_DEG)

local	LBL_BTM_DEG_VAL				= CreateElement "ceStringPoly"
		LBL_BTM_DEG_VAL.name		= "LBL_BTM_DEG_VAL"
		LBL_BTM_DEG_VAL.material	= mpcd_tpod_font
		LBL_BTM_DEG_VAL.init_pos	= {0.33, -0.70, 0}
		LBL_BTM_DEG_VAL.alignment	= "CenterCenter"
		LBL_BTM_DEG_VAL.value		= "OFF"
		LBL_BTM_DEG_VAL.stringdefs	= MPCD_data1_font_size
Add_MPCD_Element(LBL_BTM_DEG_VAL)

local	LBL_BTM_TIME				= CreateElement "ceStringPoly"
		LBL_BTM_TIME.name			= "LBL_BTM_TIME"
		LBL_BTM_TIME.material		= mpcd_tpod_font
		LBL_BTM_TIME.init_pos		= {-0.65, -0.80, 0}
		LBL_BTM_TIME.alignment		= "CenterCenter"
		LBL_BTM_TIME.value			= "TIME VALID"
		LBL_BTM_TIME.stringdefs		= MPCD_data1_font_size
Add_MPCD_Element(LBL_BTM_TIME)

local	LBL_BTM_TIME_VAL			= CreateElement "ceStringPoly"
		LBL_BTM_TIME_VAL.name		= "LBL_BTM_TIME_VAL"
		LBL_BTM_TIME_VAL.material	= mpcd_tpod_font
		LBL_BTM_TIME_VAL.init_pos	= {0.33, -0.80, 0}
		LBL_BTM_TIME_VAL.alignment	= "CenterCenter"
		LBL_BTM_TIME_VAL.value		= "NO TIME"
		LBL_BTM_TIME_VAL.stringdefs	= MPCD_data1_font_size
Add_MPCD_Element(LBL_BTM_TIME_VAL)

-- DISPLAY Data
local line = 0.83

for i = 1, 10 do
	line = line - 0.13;

	local	FREQ_CHANNEL_NO				= CreateElement "ceStringPoly"
			FREQ_CHANNEL_NO.name		= "FREQ_CHANNEL_NO_" .. string.format("%02d", i)
			FREQ_CHANNEL_NO.material	= mpcd_tpod_font
			FREQ_CHANNEL_NO.init_pos	= {-0.65, line, 0}
			FREQ_CHANNEL_NO.alignment	= "RightCenter"
			FREQ_CHANNEL_NO.formats		= {"%d"}
			FREQ_CHANNEL_NO.stringdefs	= MPCD_data1_font_size
			FREQ_CHANNEL_NO.controllers	= {{"COM_ChannelID", i}}
	Add_MPCD_Element(FREQ_CHANNEL_NO)
	
	local	FREQ_CHANNEL_FR				= CreateElement "ceStringPoly"
			FREQ_CHANNEL_FR.name		= "FREQ_CHANNEL_FR_" .. string.format("%02d", i)
			FREQ_CHANNEL_FR.material	= mpcd_tpod_font
			FREQ_CHANNEL_FR.init_pos	= {-0.60, line, 0}
			FREQ_CHANNEL_FR.alignment	= "LeftCenter"
			FREQ_CHANNEL_FR.formats		= {"%03d.%03d%s"}
			FREQ_CHANNEL_FR.stringdefs	= MPCD_data1_font_size
			FREQ_CHANNEL_FR.controllers	= {{"COM_ChannelFreq", i}}
	Add_MPCD_Element(FREQ_CHANNEL_FR)
	
	local	FREQ_CHANNEL_CLR			= CreateElement "ceStringPoly"
			FREQ_CHANNEL_CLR.name		= "FREQ_CHANNEL_CLR_" .. string.format("%02d", i)
			FREQ_CHANNEL_CLR.material	= mpcd_tpod_font
			FREQ_CHANNEL_CLR.init_pos	= {-0.23, line, 0}
			FREQ_CHANNEL_CLR.alignment	= "LeftCenter"
			FREQ_CHANNEL_CLR.formats	= {"%s"}
			FREQ_CHANNEL_CLR.stringdefs	= MPCD_data1_font_size
			FREQ_CHANNEL_CLR.controllers	= {{"COM_ChannelColor", i}}
	Add_MPCD_Element(FREQ_CHANNEL_CLR)
	
	local	FREQ_CHANNEL_CPH			= CreateElement "ceStringPoly"
			FREQ_CHANNEL_CPH.name		= "FREQ_CHANNEL_CPH_" .. string.format("%02d", i)
			FREQ_CHANNEL_CPH.material	= mpcd_tpod_font
			FREQ_CHANNEL_CPH.init_pos	= {0.02, line, 0}
			FREQ_CHANNEL_CPH.alignment	= "LeftCenter"
			FREQ_CHANNEL_CPH.formats	= {"%s"}
			FREQ_CHANNEL_CPH.stringdefs	= MPCD_data1_font_size
			FREQ_CHANNEL_CPH.controllers	= {{"COM_ChannelCipher", i}}
	Add_MPCD_Element(FREQ_CHANNEL_CPH)
	
	local	FREQ_CHANNEL_ACY			= CreateElement "ceStringPoly"
			FREQ_CHANNEL_ACY.name		= "FREQ_CHANNEL_ACY_" .. string.format("%02d", i)
			FREQ_CHANNEL_ACY.material	= mpcd_tpod_font
			FREQ_CHANNEL_ACY.init_pos	= {0.20, line, 0}
			FREQ_CHANNEL_ACY.alignment	= "LeftCenter"
			FREQ_CHANNEL_ACY.formats	= {"%s"}
			FREQ_CHANNEL_ACY.stringdefs	= MPCD_data1_font_size
			FREQ_CHANNEL_ACY.controllers	= {{"COM_ChannelAgency", i}}
	Add_MPCD_Element(FREQ_CHANNEL_ACY)
	
	local	FREQ_CHANNEL_CLL			= CreateElement "ceStringPoly"
			FREQ_CHANNEL_CLL.name		= "FREQ_CHANNEL_CLL_" .. string.format("%02d", i)
			FREQ_CHANNEL_CLL.material	= mpcd_tpod_font
			FREQ_CHANNEL_CLL.init_pos	= {0.47, line, 0}
			FREQ_CHANNEL_CLL.alignment	= "LeftCenter"
			FREQ_CHANNEL_CLL.formats	= {"%s"}
			FREQ_CHANNEL_CLL.stringdefs	= MPCD_data1_font_size
			FREQ_CHANNEL_CLL.controllers	= {{"COM_ChannelCallSign", i}}
	Add_MPCD_Element(FREQ_CHANNEL_CLL)
	
end

