--******************
--  EHSD
--  DATA MODE 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)

-- Top Left Data Block
local	global_latitude					= CreateElement "ceStringPoly"
		global_latitude.name			= "global_latitude"
		global_latitude.material		= mpcd_tpod_font
		global_latitude.init_pos		= { -0.85,  0.87, 0}
		global_latitude.alignment		= "LeftCenter"
		global_latitude.formats			= {"%s"}
		global_latitude.stringdefs		= MPCD_data1_font_size
		global_latitude.controllers		= {{"EHSD_Data_Block_01"}}
Add_MPCD_VIDEO_Element(global_latitude)

local	global_longitude				= CreateElement "ceStringPoly"
		global_longitude.name			= "global_longitude"
		global_longitude.material		= mpcd_tpod_font
		global_longitude.init_pos		= { -0.85,  0.80, 0}
		global_longitude.alignment		= "LeftCenter"
		global_longitude.formats		= {"%s"}
		global_longitude.stringdefs		= MPCD_data1_font_size
		global_longitude.controllers	= {{"EHSD_Data_Block_02"}}
Add_MPCD_VIDEO_Element(global_longitude)

local	global_datum					= CreateElement "ceStringPoly"
		global_datum.name				= "global_datum"
		global_datum.material			= mpcd_tpod_font
		global_datum.init_pos			= { -0.85,  0.73, 0}
		global_datum.alignment			= "LeftCenter"
		global_datum.formats			= {"%s"}
		global_datum.stringdefs			= MPCD_data1_font_size
		global_datum.controllers		= {{"EHSD_Data_Block_03"}}
Add_MPCD_VIDEO_Element(global_datum)

local	global_sel_sensor				= CreateElement "ceStringPoly"
		global_sel_sensor.name			= "global_sel_sensor"
		global_sel_sensor.material		= mpcd_tpod_font
		global_sel_sensor.init_pos		= { -0.85,  0.66, 0}
		global_sel_sensor.alignment		= "LeftCenter"
		global_sel_sensor.formats		= {"%s"}
		global_sel_sensor.stringdefs	= MPCD_data1_font_size
		global_sel_sensor.controllers	= {{"EHSD_Data_Block_04"}}
Add_MPCD_VIDEO_Element(global_sel_sensor)

-- Top Right Data Block
local	global_elevation				= CreateElement "ceStringPoly"
		global_elevation.name			= "global_elevation"
		global_elevation.material		= mpcd_tpod_font
		global_elevation.init_pos		= { 0.28,  0.87, 0}
		global_elevation.alignment		= "LeftCenter"
		global_elevation.formats		= {"%s"}
		global_elevation.stringdefs		= MPCD_data1_font_size
		global_elevation.controllers	= {{"EHSD_Data_Block_05"}}
Add_MPCD_VIDEO_Element(global_elevation)

local	global_data_block				= CreateElement "ceStringPoly"
		global_data_block.name			= "global_data_block_06"
		global_data_block.material		= mpcd_tpod_font
		global_data_block.init_pos		= { 0.28,  0.80, 0}
		global_data_block.alignment		= "LeftCenter"
		global_data_block.formats		= {"%s"}
		global_data_block.stringdefs	= MPCD_data1_font_size
		global_data_block.controllers	= {{"EHSD_Data_Block_06"}}
Add_MPCD_VIDEO_Element(global_data_block)

local	global_data_block				= CreateElement "ceStringPoly"
		global_data_block.name			= "global_data_block_07"
		global_data_block.material		= mpcd_tpod_font
		global_data_block.init_pos		= { 0.45,  0.73, 0}
		global_data_block.alignment		= "LeftCenter"
		global_data_block.formats		= {"%s"}
		global_data_block.stringdefs	= MPCD_data1_font_size
		global_data_block.controllers	= {{"EHSD_Data_Block_07"}}
Add_MPCD_VIDEO_Element(global_data_block)

local	global_data_block				= CreateElement "ceStringPoly"
		global_data_block.name			= "global_data_block_08"
		global_data_block.material		= mpcd_tpod_font
		global_data_block.init_pos		= { 0.45,  0.66, 0}
		global_data_block.alignment		= "LeftCenter"
		global_data_block.formats		= {"%s"}
		global_data_block.stringdefs	= MPCD_data1_font_size
		global_data_block.controllers	= {{"EHSD_Data_Block_08"}}
Add_MPCD_VIDEO_Element(global_data_block)

local	global_data_block				= CreateElement "ceStringPoly"
		global_data_block.name			= "global_data_block_09"
		global_data_block.material		= mpcd_tpod_font
		global_data_block.init_pos		= { 0.57,  0.59, 0}
		global_data_block.alignment		= "LeftCenter"
		global_data_block.formats		= {"%s"}
		global_data_block.stringdefs	= MPCD_data1_font_size
		global_data_block.controllers	= {{"EHSD_Data_Block_09"}}
Add_MPCD_VIDEO_Element(global_data_block)

-- Bottom Left Data Block
local	global_data_block				= CreateElement "ceStringPoly"
		global_data_block.name			= "global_data_block_10"
		global_data_block.material		= mpcd_tpod_font
		global_data_block.init_pos		= { -0.85,  -0.73, 0}
		global_data_block.alignment		= "LeftCenter"
		global_data_block.formats		= {"%s"}
		global_data_block.stringdefs	= MPCD_data1_font_size
		global_data_block.controllers	= {{"EHSD_Data_Block_10"}}
Add_MPCD_VIDEO_Element(global_data_block)

local	global_data_block				= CreateElement "ceStringPoly"
		global_data_block.name			= "global_data_block_11"
		global_data_block.material		= mpcd_tpod_font
		global_data_block.init_pos		= { -0.85,  -0.80, 0}
		global_data_block.alignment		= "LeftCenter"
		global_data_block.formats		= {"%s"}
		global_data_block.stringdefs	= MPCD_data1_font_size
		global_data_block.controllers	= {{"EHSD_Data_Block_11"}}
Add_MPCD_VIDEO_Element(global_data_block)

-- Bottom Right Data Block
local	global_data_block				= CreateElement "ceStringPoly"
		global_data_block.name			= "global_data_block_12"
		global_data_block.material		= mpcd_tpod_font
		global_data_block.init_pos		= { 0.38,  -0.73, 0}
		global_data_block.alignment		= "LeftCenter"
		global_data_block.formats		= {"%s"}
		global_data_block.stringdefs	= MPCD_data1_font_size
		global_data_block.controllers	= {{"EHSD_Data_Block_12"}}
Add_MPCD_VIDEO_Element(global_data_block)

local	global_data_block				= CreateElement "ceStringPoly"
		global_data_block.name			= "global_data_block_13"
		global_data_block.material		= mpcd_tpod_font
		global_data_block.init_pos		= { 0.25,  -0.80, 0}
		global_data_block.alignment		= "LeftCenter"
		global_data_block.formats		= {"%s"}
		global_data_block.stringdefs	= MPCD_data1_font_size
		global_data_block.controllers	= {{"EHSD_Data_Block_13"}}
Add_MPCD_VIDEO_Element(global_data_block)

-- DISPLAY
-- WAYPOINT MODE
local	nav_wpt_symbol					= create_mpcd_textured_box( 110, 888, 150, 928, nil, nil, 2)
		nav_wpt_symbol.name				= "nav_wpt_symbol"
		nav_wpt_symbol.init_pos			= {0, 0, 0}
		nav_wpt_symbol.controllers		= {{"EHSD_DATA_WPT_POS"}}
Add_MPCD_VIDEO_Element(nav_wpt_symbol)

local	nav_wpt_os_symbol				= create_mpcd_textured_box( 109, 829, 149, 869, nil, nil, 2)
		nav_wpt_os_symbol.name			= "nav_wpt_os_symbol"
		nav_wpt_os_symbol.init_pos		= {0, 0, 0}
		nav_wpt_os_symbol.controllers	= {{"EHSD_DATA_WOS_POS"}}
Add_MPCD_VIDEO_Element(nav_wpt_os_symbol)

-- TACAN MODE
local	tcn_loc_symbol					= create_mpcd_textured_box( 41, 964, 79, 997, nil, nil, 3)
		tcn_loc_symbol.name				= "tcn_loc_symbol"
		tcn_loc_symbol.init_pos			= {0, 0, 0}
		tcn_loc_symbol.controllers		= {{"EHSD_DATA_TCN_POS"}}
Add_MPCD_VIDEO_Element(tcn_loc_symbol)

local	tcn_os_loc_symbol				= create_mpcd_textured_box( 41, 964, 79, 997, nil, nil, 3)
		tcn_os_loc_symbol.name			= "tcn_loc_symbol"
		tcn_os_loc_symbol.init_pos		= {0, 0, 0}
		tcn_os_loc_symbol.controllers	= {{"EHSD_DATA_TOS_POS"}}
Add_MPCD_VIDEO_Element(tcn_os_loc_symbol)

-- OTHER SYMBOLS/DATA
local	aircraft_symbol				= create_mpcd_textured_box( 177, 931, 233, 1007, nil, 957)
		aircraft_symbol.name		= "aircraft_symbol"
		aircraft_symbol.init_pos	= {0, 0, 0}
		aircraft_symbol.controllers	= {{"EHSD_DATA_AC_POS", 0.5 * GetScale()}}
Add_MPCD_VIDEO_Element(aircraft_symbol)

local	zoom_scl_label				= CreateElement "ceStringPoly"
		zoom_scl_label.name			= "zoom_scl_label"
		zoom_scl_label.material		= mpcd_tpod_font
		zoom_scl_label.init_pos		= { -0.75,  -0.56, 0}
		zoom_scl_label.alignment	= "CenterCenter"
		zoom_scl_label.value		= "SCL"
		zoom_scl_label.stringdefs	= MPCD_large_font_size
Add_MPCD_VIDEO_Element(zoom_scl_label)

local	zoom_scl_value				= CreateElement "ceStringPoly"
		zoom_scl_value.name			= "zoom_scl_value"
		zoom_scl_value.material		= mpcd_tpod_font
		zoom_scl_value.init_pos		= { -0.75,  -0.66, 0}
		zoom_scl_value.alignment	= "CenterCenter"
		zoom_scl_value.formats		= {"%d"}
		zoom_scl_value.controllers	= {{"ehsd_scale_value"}}
		zoom_scl_value.stringdefs	= MPCD_large_font_size
Add_MPCD_VIDEO_Element(zoom_scl_value)

local	zoom_enabled				= CreateElement "ceStringPoly"
		zoom_enabled.name			= "zoom_enabled"
		zoom_enabled.material		= mpcd_tpod_font
		zoom_enabled.init_pos		= { -0.60,  -0.61, 0}
		zoom_enabled.alignment		= "LeftCenter"
		zoom_enabled.value			= "Z"
		zoom_enabled.stringdefs		= MPCD_data2_font_size
		zoom_enabled.controllers	= {{"ehsd_zoom_enabled"}}
Add_MPCD_VIDEO_Element(zoom_enabled)
