defineProperty("use_xhsi", globalPropertyi("cl300/use_xhsi"))

-- CL300 datarefs to be synced to old names
createProp("sim/custom/xap/poweron_p", 		"int", 0);
createProp("sim/custom/xap/refspds_v1", 	"int", 0);
createProp("sim/custom/xap/refspds_vr", 	"int", 0);
createProp("sim/custom/xap/refspds_v2", 	"int", 0);
createProp("sim/custom/xap/refspds_vt", 	"int", 0);
createProp("sim/custom/xap/refspds_vga", 	"int", 0);
createProp("sim/custom/xap/refspds_vref", 	"int", 0);
createProp("sim/custom/xap/refspds", 		"int", 0);
createProp("sim/custom/xap/carets", 		"int", 0);
createProp("sim/custom/xap/mast_warn",		"float", 0);
createProp("sim/custom/xap/mast_caut", 		"float", 0);
createProp("sim/custom/xap/TO_n1", "		float", 0);
createProp("sim/custom/xap/CLB_n1", 		"float", 0);

defineProperty("proxy_poweron_p", 		globalPropertyi("sim/custom/xap/poweron_p"))
defineProperty("proxy_refspds_v1", 		globalPropertyi("sim/custom/xap/refspds_v1"))
defineProperty("proxy_refspds_vr", 		globalPropertyi("sim/custom/xap/refspds_vr"))
defineProperty("proxy_refspds_v2", 		globalPropertyi("sim/custom/xap/refspds_v2"))
defineProperty("proxy_refspds_vt", 		globalPropertyi("sim/custom/xap/refspds_vt"))
defineProperty("proxy_refspds_vga", 	globalPropertyi("sim/custom/xap/refspds_vga"))
defineProperty("proxy_refspds_vref", 	globalPropertyi("sim/custom/xap/refspds_vref"))
defineProperty("proxy_refspds", 		globalPropertyi("sim/custom/xap/refspds"))
defineProperty("proxy_carets", 			globalPropertyi("sim/custom/xap/carets"))
defineProperty("proxy_mast_warn", 		globalPropertyf("sim/custom/xap/mast_warn"))
defineProperty("proxy_mast_caut", 		globalPropertyf("sim/custom/xap/mast_caut"))
defineProperty("proxy_TO_n1", 			globalPropertyf("sim/custom/xap/TO_n1"))
defineProperty("proxy_CLB_n1", 			globalPropertyf("sim/custom/xap/CLB_n1"))

defineProperty("base_poweron_p", 		globalPropertyi("cl300/poweron_p"))
defineProperty("base_refspds_v1", 		globalPropertyi("cl300/refspds_v1"))
defineProperty("base_refspds_vr", 		globalPropertyi("cl300/refspds_vr"))
defineProperty("base_refspds_v2", 		globalPropertyi("cl300/refspds_v2"))
defineProperty("base_refspds_vt", 		globalPropertyi("cl300/refspds_vt"))
defineProperty("base_refspds_vga", 		globalPropertyi("cl300/refspds_vga"))
defineProperty("base_refspds_vref", 	globalPropertyi("cl300/refspds_vref"))
defineProperty("base_refspds", 			globalPropertyi("cl300/refspds"))
defineProperty("base_carets", 			globalPropertyi("cl300/carets"))
defineProperty("base_mast_warn", 		globalPropertyf("cl300/mast_warn"))
defineProperty("base_mast_caut", 		globalPropertyf("cl300/mast_caut"))
defineProperty("base_TO_n1", 			globalPropertyf("cl300/TO_n1"))
defineProperty("base_CLB_n1", 			globalPropertyf("cl300/CLB_n1"))

-- XHSI datarefs for copilot ND (PFD map) to be linked to pilots ND (PFD map):
defineProperty("cp_map_range", 	globalPropertyi("xhsi/nd_copilot/map_range"))
defineProperty("cp_map_zoomin", globalPropertyi("xhsi/nd_copilot/map_zoomin"))
defineProperty("cp_arpt", 		globalPropertyi("xhsi/nd_copilot/arpt"))
defineProperty("cp_wpt", 		globalPropertyi("xhsi/nd_copilot/wpt"))
defineProperty("cp_vor", 		globalPropertyi("xhsi/nd_copilot/vor"))
defineProperty("cp_ndb", 		globalPropertyi("xhsi/nd_copilot/ndb"))
defineProperty("cp_pos", 		globalPropertyi("xhsi/nd_copilot/pos"))
defineProperty("cp_data", 		globalPropertyi("xhsi/nd_copilot/data"))
defineProperty("cp_tfc", 		globalPropertyi("xhsi/nd_copilot/tfc"))
defineProperty("cp_radio1",		globalPropertyi("xhsi/nd_copilot/radio1"))
defineProperty("cp_radio2",		globalPropertyi("xhsi/nd_copilot/radio2"))
defineProperty("cp_navsrc",		globalPropertyi("xhsi/nd_copilot/nav_source"))

defineProperty("p_map_range", 	globalPropertyi("sim/cockpit2/EFIS/map_range"))
defineProperty("p_map_zoomin",	globalPropertyi("xhsi/nd_pilot/map_zoomin"))
defineProperty("p_arpt", 		globalPropertyi("sim/cockpit/switches/EFIS_shows_airports"))
defineProperty("p_wpt", 		globalPropertyi("sim/cockpit/switches/EFIS_shows_waypoints"))
defineProperty("p_vor", 		globalPropertyi("sim/cockpit/switches/EFIS_shows_VORs"))
defineProperty("p_ndb", 		globalPropertyi("sim/cockpit/switches/EFIS_shows_NDBs"))
defineProperty("p_pos", 		globalPropertyi("xhsi/nd_pilot/pos"))
defineProperty("p_data", 		globalPropertyi("xhsi/nd_pilot/data"))
defineProperty("p_tfc", 		globalPropertyi("sim/cockpit2/EFIS/EFIS_tcas_on"))
defineProperty("p_radio1",		globalPropertyi("sim/cockpit2/EFIS/EFIS_1_selection_pilot"))
defineProperty("p_radio2",		globalPropertyi("sim/cockpit2/EFIS/EFIS_2_selection_pilot"))
defineProperty("p_navsrc",		globalPropertyi("sim/cockpit2/radios/actuators/HSI_source_select_pilot"))
				
				
function update() 
	if get(use_xhsi) > 0 then
		set(proxy_poweron_p,    get(base_poweron_p))
		set(proxy_refspds_v1,	get(base_refspds_v1))
		set(proxy_refspds_vr,	get(base_refspds_vr))
		set(proxy_refspds_v2,	get(base_refspds_v2))
		set(proxy_refspds_vt,   get(base_refspds_vt))
		set(proxy_refspds_vga,  get(base_refspds_vga))
		set(proxy_refspds_vref, get(base_refspds_vref))
		set(proxy_refspds,      get(base_refspds))
		set(proxy_carets,       get(base_carets))
		set(proxy_mast_warn,    get(base_mast_warn))
		set(proxy_mast_caut,    get(base_mast_caut))
		set(proxy_TO_n1,        get(base_TO_n1))
		set(proxy_CLB_n1,       get(base_CLB_n1))
		set(cp_navsrc,          get(p_navsrc))
		set(cp_map_range,       get(p_map_range ))
		set(cp_map_zoomin,      get(p_map_zoomin))
		set(cp_radio1,          get(p_radio1))
		set(cp_radio2,          get(p_radio2))
		set(cp_arpt,            get(p_arpt))
		set(cp_wpt,             get(p_wpt))
		set(cp_vor,             get(p_vor))
		set(cp_ndb,             get(p_ndb))
		set(cp_pos,             get(p_pos))
		set(cp_data,            get(p_data))
		set(cp_tfc,             get(p_tfc))
	end
end