--**********************
--  EHSD
--  INS ALIGNMENT PAGE
--**********************

local mpcd_path = LockOn_Options.script_path.."MPCD/indicator/EHSD/"

dofile(LockOn_Options.script_path.."MPCD/indicator/MPCD_definitions.lua")
dofile(mpcd_path.."Global/EHSD_MAP_VIDEO.lua")
dofile(mpcd_path.."Global/EHSD_Compass_Rose.lua")
dofile(mpcd_path.."Global/EHSD_Menu.lua")
dofile(mpcd_path.."ALGN/EHSD_ALN_DATA.lua")

-- Navigation Arrows
local	ehsd_next_sp_arrow				= create_mpcd_textured_box( 180, 864, 198, 922)
		ehsd_next_sp_arrow.name			= "ehsd_next_sp_arrow"
		ehsd_next_sp_arrow.init_pos		= mpcd_btn_12_pos
		ehsd_next_sp_arrow.controllers	= {{"EHSD_PB12_Arrow"}}
Add_MPCD_VIDEO_Element(ehsd_next_sp_arrow)

local	ehsd_prev_sp_arrow				= create_mpcd_textured_box( 209, 864, 227, 924)
		ehsd_prev_sp_arrow.name			= "ehsd_prev_sp_arrow"
		ehsd_prev_sp_arrow.init_pos		= mpcd_btn_13_pos
		ehsd_prev_sp_arrow.controllers	= {{"EHSD_PB13_Arrow"}}
Add_MPCD_VIDEO_Element(ehsd_prev_sp_arrow)

local	ehsd_sp_number					= CreateElement "ceStringPoly"
		ehsd_sp_number.name				= "ehsd_sp_number"
		ehsd_sp_number.material			= mpcd_tpod_font
		ehsd_sp_number.init_pos			= { 0.95,  0.165, 0}
		ehsd_sp_number.alignment		= "RightCenter"
		ehsd_sp_number.formats			= {"%s"}
		ehsd_sp_number.stringdefs		= MPCD_large_font_size
		ehsd_sp_number.controllers		= {{"EHSD_PB12_PB13_Data"}}
Add_MPCD_VIDEO_Element(ehsd_sp_number)

-- SELECTED OPTIONS
local	gnd_shdg_sel				= create_mpcd_textured_box( 60, 4, 175, 50)
		gnd_shdg_sel.name			= "gnd_shdg_sel"
		gnd_shdg_sel.init_pos		= mpcd_btn_06_pos
		gnd_shdg_sel.controllers	= {{"EHSD_INS_ALIGN_SHDG_SEL"}}
Add_MPCD_VIDEO_Element(gnd_shdg_sel)

-- DATA
-- TACAN (RECEIVING)
local	tcn_bearing_deg				= CreateElement "ceStringPoly"
		tcn_bearing_deg.name		= "tcn_bearing_deg"
		tcn_bearing_deg.material	= mpcd_tpod_font
		tcn_bearing_deg.init_pos	= { -0.85,  0.80, 0}
		tcn_bearing_deg.alignment	= "LeftCenter"
		tcn_bearing_deg.formats		= {"%03d;"}
		tcn_bearing_deg.stringdefs	= MPCD_large_font_size
		tcn_bearing_deg.controllers	= {{"EHSD_NAV_Mode"}, {"nav_tcn_brg"}}
Add_MPCD_VIDEO_Element(tcn_bearing_deg)

local	tcn_range_nm				= CreateElement "ceStringPoly"
		tcn_range_nm.name			= "tcn_range_nm"
		tcn_range_nm.material		= mpcd_tpod_font
		tcn_range_nm.init_pos		= { -0.30,  0.80, 0}
		tcn_range_nm.alignment		= "RightCenter"
		tcn_range_nm.formats		= {"%1.1f"}
		tcn_range_nm.stringdefs		= MPCD_large_font_size
		tcn_range_nm.controllers	= {{"EHSD_NAV_Mode"}, {"nav_tcn_rng"}}
Add_MPCD_VIDEO_Element(tcn_range_nm)

local	tcn_time_to_go				= CreateElement "ceStringPoly"
		tcn_time_to_go.name			= "tcn_time_to_go"
		tcn_time_to_go.material		= mpcd_tpod_font
		tcn_time_to_go.init_pos		= { -0.60,  0.70, 0}
		tcn_time_to_go.alignment	= "CenterCenter"
		tcn_time_to_go.formats		= {"%d:%02d"}
		tcn_time_to_go.stringdefs	= MPCD_large_font_size
		tcn_time_to_go.controllers	= {{"EHSD_NAV_Mode"}, {"nav_tcn_ttg"}}
Add_MPCD_VIDEO_Element(tcn_time_to_go)

-- NAV Data Block
local	fp_wpt_brg_deg				= CreateElement "ceStringPoly"
		fp_wpt_brg_deg.name			= "fp_wpt_brg_deg"
		fp_wpt_brg_deg.material		= mpcd_tpod_font
		fp_wpt_brg_deg.init_pos		= { 0.30,  0.80, 0}
		fp_wpt_brg_deg.alignment	= "LeftCenter"
		fp_wpt_brg_deg.formats		= {"%03d;"}
		fp_wpt_brg_deg.stringdefs	= MPCD_large_font_size
		fp_wpt_brg_deg.controllers	= {{"nav_wpt_valid"}, {"nav_wpt_brg"}}
Add_MPCD_VIDEO_Element(fp_wpt_brg_deg)

local	fp_wpt_rng_nm				= CreateElement "ceStringPoly"
		fp_wpt_rng_nm.name			= "fp_wpt_rng_nm"
		fp_wpt_rng_nm.material		= mpcd_tpod_font
		fp_wpt_rng_nm.init_pos		= { 0.90,  0.80, 0}
		fp_wpt_rng_nm.alignment		= "RightCenter"
		fp_wpt_rng_nm.formats		= {"%1.1f"}
		fp_wpt_rng_nm.stringdefs	= MPCD_large_font_size
		fp_wpt_rng_nm.controllers	= {{"nav_wpt_valid"}, {"nav_wpt_rng"}}
Add_MPCD_VIDEO_Element(fp_wpt_rng_nm)

local	fp_wpt_ttg				= CreateElement "ceStringPoly"
		fp_wpt_ttg.name			= "fp_wpt_ttg"
		fp_wpt_ttg.material		= mpcd_tpod_font
		fp_wpt_ttg.init_pos		= { 0.60,  0.70, 0}
		fp_wpt_ttg.alignment	= "CenterCenter"
		fp_wpt_ttg.formats		= {"%d:%02d"}
		fp_wpt_ttg.stringdefs	= MPCD_large_font_size
		fp_wpt_ttg.controllers	= {{"nav_wpt_valid"}, {"nav_wpt_ttg"}}
Add_MPCD_VIDEO_Element(fp_wpt_ttg)

