dofile(LockOn_Options.script_path.."config.lua")



-- mount textures collections related to the cockpit module and avionics 
--mount_vfs_texture_archives(LockOn_Options.script_path.."../Textures/P-51D-CPT-TEXTURES") -- TODO remove
mount_vfs_texture_archives(LockOn_Options.script_path .. "../Textures/Cockpit_Bf-109K-4_Textures")
mount_vfs_model_path(LockOn_Options.script_path .. "../Shape")
mount_vfs_texture_archives("Bazar/Textures/AvionicsCommon")



dofile(LockOn_Options.script_path.."devices.lua")
dofile(LockOn_Options.script_path.."materials.lua")
dofile(LockOn_Options.common_script_path.."tools.lua")


UseDBGInfo = false
-- items in <...> are optional
--
-- MainPanel = {"NAME_OF_CLASS",
--              "INIT_SCRIPT_FILE",
--              <{devices.LINKED_DEVICE1, devices.LINKED_DEVICE2, ...},>
--             }
MainPanel = {"Bf109K4::ccMainPanel", 
            LockOn_Options.script_path .. "mainpanel_init.lua",
			{{"RemoteCompass", devices.REMOTE_COMPASS},
			 {"Art_Horizon",devices.ARTIFICIAL_HORIZON},			 
			 {"pilot_sight", devices.PILOT_SIGHT},			 
			 {"VHF_Radio", devices.VHF_RADIO},
			},
            LockOn_Options.script_path .. "main_panel_commands.lua"}


-- Avionics devices initialization example
-- items in <...> are optional
--
-- creators[DEVICE_ID] = {"NAME_OF_CONTROLLER_CLASS",
--                        <"CONTROLLER_SCRIPT_FILE",>
--                        <{devices.LINKED_DEVICE1, devices.LINKED_DEVICE2, ...},>
--                        <"INPUT_COMMANDS_SCRIPT_FILE",>
--                        <{{"NAME_OF_INDICATOR_CLASS", "INDICATOR_SCRIPT_FILE"}, ...}>
--                       }
creators = {}
creators[devices.FUSEBOX]           = {"Bf109K4::avFuseBox"}
creators[devices.OXYGEN]            = {"Bf109K4::avOxygenApparatus", LockOn_Options.script_path .. "oxygen_device.lua"}
creators[devices.WEAPONS_CONTROLS]  = {"Bf109K4::avWeaponControl"}
creators[devices.CONTROLS]          = {"Bf109K4::avControls"}
creators[devices.ENGINE_CONTROLS]   = {"Bf109K4::avEngineControls"}
creators[devices.ALTIMETER]	= {
	"avSimpleAltimeter",
	LockOn_Options.script_path.."Altimetr_Fl_22322/Altimeter.lua",
	{{"FM_Proxy",devices.FM_PROXY }},
}
creators[devices.REMOTE_COMPASS] = {
	"Bf109K4::avRemoteCompass_KT_f8",
	LockOn_Options.script_path.."RemoteCompass_KT_f8/compass_param.lua",
	{}
}
creators[devices.FM_PROXY] = {"Bf109K4::avFMProxy_Bf109","",{}}
creators[devices.CONTROL_SYSTEM] = {
	"Bf109K4::avControlSystemInterface_Bf109K4",
	LockOn_Options.script_path .. "test_device.lua",
	{{"FM_proxy",devices.FM_PROXY}},
	""
}
creators[devices.ARTIFICIAL_HORIZON] = {
	"Bf109K4::avArtificialHorizon_Fl_22415",
	LockOn_Options.script_path.."ArtificialHorizont_Fl_22415/horizon_param.lua",
	{}
}
creators[devices.PILOT_SIGHT]	= {
	"Bf109K4::avGunsight",
	LockOn_Options.script_path.."Gunsight_REVI_16B/device/Sight_param.lua",
	{},
}
creators[devices.VHF_RADIO] = 
	{"Bf109K4::avFuG16ZY_Bf109K4",
	LockOn_Options.script_path.."FuG16ZY/Radio.lua",
	LockOn_Options.script_path.."FuG16ZY/Radio_commands.lua"
}
creators[devices.INTERCOM] = {
	"cockpit::dcswwii::avIntercom", 
	LockOn_Options.script_path.."Intercom.lua",
	{{"VHF_Radio",		devices.VHF_RADIO}}
}

if LockOn_Options.flight.easy_radar then                                            						   
creators[devices.ARCADE] =          {"Bf109K4::avArcadeRadar_Bf109K4",
									LockOn_Options.script_path.."ARCADE/arcade.lua",
									{{"weapon_system",devices.WEAPONS_CONTROLS},
									 {"REVI_16B"			 ,devices.PILOT_SIGHT}},
									}							   
end

-- Indicators
indicators = {}
indicators[#indicators + 1] = {"Bf109K4::ccREVI_16B_Gunsight",  
	LockOn_Options.script_path.."Gunsight_REVI_16B/Indicator/PilotSight_init.lua",
	devices.PILOT_SIGHT,
	{{"PNT-HUD-CENTER","PNT-HUD-DOWN","PNT-HUD-RIGHT"}}
}

indicators[#indicators + 1] = {
	"Bf109K4::ccControlsIndicator_Bf109",
	LockOn_Options.script_path.."ControlsIndicator/ControlsIndicator.lua",
	devices.CONTROL_SYSTEM  --devices.ALTIMETER   --devices.CONTROLS
}


creators[devices.MACROS]    =  {"avLuaDevice",
                                LockOn_Options.common_script_path.."Macro_handler.lua",
                                {},
                                "",
                                }

---------------------------------------------
dofile(LockOn_Options.common_script_path.."KNEEBOARD/declare_kneeboard_device.lua")
---------------------------------------------
dofile(LockOn_Options.common_script_path.."PADLOCK/PADLOCK_declare.lua")
---------------------------------------------	

if LockOn_Options.flight.easy_radar then                                            
	indicators[#indicators + 1] = {"Bf109K4::ccArcadeRadar_Bf109K4"   ,LockOn_Options.script_path.."ARCADE/arcade_indicator.lua",devices.ARCADE}
end
