paxadv = createGlobalPropertyf("ksgy/L410/spec/paxadv")
xpdr1 = createGlobalPropertyf("ksgy/L410/spec/xpdr1")
radar = createGlobalPropertyf("ksgy/L410/spec/radar")
xpdr2 = createGlobalPropertyf("ksgy/L410/spec/xpdr2")
fdr = createGlobalPropertyf("ksgy/L410/spec/fdr")
ra = createGlobalPropertyf("ksgy/L410/spec/ra")
dme = createGlobalPropertyf("ksgy/L410/spec/dme")
ams = createGlobalPropertyf("ksgy/L410/spec/ams")
panel_c1 = createGlobalPropertyf("ksgy/L410/lights/panel_c1")
cockpit = createGlobalPropertyf("ksgy/L410/lights/cockpit")
passenger1 = createGlobalPropertyf("ksgy/L410/lights/passenger1")
passenger2 = createGlobalPropertyf("ksgy/L410/lights/passenger2")
panel_c2 = createGlobalPropertyf("ksgy/L410/lights/panel_c2")
panel_stby = createGlobalPropertyf("ksgy/L410/lights/panel_stby")
xfeed = createGlobalPropertyf("ksgy/L410/fuel/xfeed")
isol_valve1 = createGlobalPropertyf("ksgy/L410/engines/isol_valve1")
isol_valve2 = createGlobalPropertyf("ksgy/L410/engines/isol_valve2")
prop_feather2 = createGlobalPropertyf("ksgy/L410/engines/prop_feather2")
prop_feather1 = createGlobalPropertyf("ksgy/L410/engines/prop_feather1")
light2 = createGlobalPropertyf("ksgy/L410/cb/light2")
light1 = createGlobalPropertyf("ksgy/L410/cb/light1")
deice_pilot = createGlobalPropertyf("ksgy/L410/cb/deice_pilot")
deice_copilot = createGlobalPropertyf("ksgy/L410/cb/deice_copilot")
sep_vane_right = createGlobalPropertyf("ksgy/L410/cb/sep_vane_right")
sep_vane_left = createGlobalPropertyf("ksgy/L410/cb/sep_vane_left")
wind_right = createGlobalPropertyf("ksgy/L410/cb/wind_right")
recorder = createGlobalPropertyf("ksgy/L410/cb/recorder")
battemp = createGlobalPropertyf("ksgy/L410/cb/battemp")
wind_left = createGlobalPropertyf("ksgy/L410/cb/wind_left")
water = createGlobalPropertyf("ksgy/L410/cb/water")
bag = createGlobalPropertyf("ksgy/L410/cb/bag")
spoilers = createGlobalPropertyf("ksgy/L410/cb/spoilers")
warn_electro = createGlobalPropertyf("ksgy/L410/cb/warn_electro")
warn_airframe = createGlobalPropertyf("ksgy/L410/cb/warn_airframe")
warn_left_engine = createGlobalPropertyf("ksgy/L410/cb/warn_left_engine")
warn_right_engine = createGlobalPropertyf("ksgy/L410/cb/warn_right_engine")
engn_fire = createGlobalPropertyf("ksgy/L410/cb/engn_fire")
gear = createGlobalPropertyf("ksgy/L410/cb/gear")
trimtabs = createGlobalPropertyf("ksgy/L410/cb/trimtabs")
flaps = createGlobalPropertyf("ksgy/L410/cb/flaps")
--light_taxilanding_switch = createGlobalPropertyf("ksgy/L410/light_taxilanding_switch")
gyro1 = createGlobalPropertyf("ksgy/L410/avionics/gyro1")
gyro2 = createGlobalPropertyf("ksgy/L410/avionics/gyro2")
mrk = createGlobalPropertyf("ksgy/L410/avionics/mrk")
adf2 = createGlobalPropertyf("ksgy/L410/avionics/adf2")
adf1 = createGlobalPropertyf("ksgy/L410/avionics/adf1")
nav2 = createGlobalPropertyf("ksgy/L410/avionics/nav2")
intercom = createGlobalPropertyf("ksgy/L410/avionics/intercom")
vhf2 = createGlobalPropertyf("ksgy/L410/avionics/vhf2")
isol_valve2_cover = createGlobalPropertyf("ksgy/L410/engines/isol_valve2_cover")
isol_valve1_cover = createGlobalPropertyf("ksgy/L410/engines/isol_valve1_cover")
separator_vane_left = createGlobalPropertyf("ksgy/L410/antiice/separator_vane_left")
separator_vane_right = createGlobalPropertyf("ksgy/L410/antiice/separator_vane_right")

fuel_pump_l = globalProperty("sim/cockpit2/fuel/fuel_tank_pump_on[0]")
fuel_pump_r = globalProperty("sim/cockpit2/fuel/fuel_tank_pump_on[1]")
ielu_l = globalProperty("sim/cockpit2/engine/actuators/fadec_on[0]")
ielu_r = globalProperty("sim/cockpit2/engine/actuators/fadec_on[1]")
ice_detect = globalProperty("sim/cockpit2/ice/ice_detect_on")

startup_running = globalProperty("sim/operation/prefs/startup_running")

set(light2, 1)
set(light1, 1)
-- set(deice_pilot, 0)
-- set(deice_copilot, 0)
set(sep_vane_right, 1)
set(sep_vane_left, 1)
set(wind_right, 1)
set(recorder, 1)
set(battemp, 1)
set(wind_left, 1)
set(water, 1)
set(bag, 1)
set(spoilers, 1)
set(warn_electro, 1)
set(warn_airframe, 1)
set(warn_left_engine, 1)
set(warn_right_engine, 1)
set(engn_fire, 1)
set(gear, 1)
set(trimtabs, 1)
set(flaps, 1)
set(separator_vane_left, 0)
set(separator_vane_right, 0)

if startup_running == 1 then
	logInfo("Starting with engines running")
	set(deice_pilot, 0)
	set(deice_copilot, 0)
	set(ice_detect, 1)
	set(ielu_l, 1)
	set(ielu_r, 1)
	set(fuel_pump_l, 1)
	set(fuel_pump_r, 1)
else
	logInfo("Starting cold and dark")
	set(fuel_pump_l, 0)
	set(fuel_pump_r, 0)
	set(ielu_l, 0)
	set(ielu_r, 0)
	set(deice_pilot, 1)
    set(deice_copilot, 1)
	set(ice_detect, 0)
end


function update()
	if get(isol_valve1_cover) < 0.5 then
		if get(isol_valve1) ~= 0 then
			set(isol_valve1, 0)
		end
	end

	if get(isol_valve2_cover) < 0.5 then
		if get(isol_valve2) ~= 0 then
			set(isol_valve2, 0)
		end
	end
end
