size = { 2048, 2048 }

fixedPanelWidth = 2048
fixedPanelHeight = 2048

local ALL_SWITCHES_OFF = false

-- Electrical commands
createCommand("cl300/electrical/bat_left", "Battery Left switch")
createCommand("cl300/electrical/bat_right", "Battery Right switch")
createCommand("cl300/electrical/bat_both", "Battery Both switch")


-- Engine control commands
createCommand("cl300/engines/run_left", "Engine Run Left switch")
createCommand("cl300/engines/run_right", "Engine Run Right switch")
createCommand("cl300/engines/run_both", "Engine Run Both switch")

-- Lights commands

createCommand("cl300/lights/landing_left", "Left Landing Light switch")
createCommand("cl300/lights/landing_right", "Right Landing Light switch")
createCommand("cl300/lights/taxi", "Taxi Lights switch")
createCommand("cl300/lights/emergency_lights", "Emergency Lights switch")
createCommand("cl300/lights/wing_insp_lights", "Wing Inspection Lights switch")
createCommand("cl300/lights/nav_logo_lights", "NAV/Logo Lights switch")
createCommand("cl300/lights/bcn_strb_lights", "Beacon/Strobe Lights switch")
createCommand("cl300/lights/smoke_belt_lights", "No Smoking Lights switch")
createCommand("cl300/lights/cabin_lights", "Passenger Cabin Lights switch")

-- Animation commands
createCommand("cl300/anim/main_door", "Main Door animation")
createCommand("cl300/anim/bagage_door", "Bagage Door animation")
createCommand("cl300/anim/emer_door", "Emergency Door animation")
createCommand("cl300/anim/toilet_door", "Toilet Door animation")
createCommand("cl300/anim/inside_bagage_door", "Inside Bagage Door animation")
createCommand("cl300/anim/window_blinds", "Window Blinds animation")
createCommand("cl300/anim/tables", "Tables animation")

--[=[
--fms
createProp("cl300/fms/nav1mkr", "int", 0);
createProp("cl300/fms/nav2mkr", "int", 0);
createProp("cl300/fms/nav1aut", "int", 0);
createProp("cl300/fms/nav2aut", "int", 0);
createProp("cl300/fms/com1sql", "int", 0);
createProp("cl300/fms/com2sql", "int", 0);
createProp("cl300/fms/atcmod", "int", 1);
createProp("cl300/fms/alt_rep", "int", 0);
createProp("cl300/fms/scratch_has_coords", "int", 0);

-- CDU lines
createGlobalPropertys("cl300/fms/keyb_input", 25, "");
createGlobalPropertys("cl300/fms/line1", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line1a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line1b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line2", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line2a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line2b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line3", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line3a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line3b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line4", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line4a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line4b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line5", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line5a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line5b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line6", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line6a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line6b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line7", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line7a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line7b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line8", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line8a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line8b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line9", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line9a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line9b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line10", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line10a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line10b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line11", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line11a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line11b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line12", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line12a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line12b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line12c", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line13", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line13a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line13b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line14", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line14a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line14b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line15", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line15a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line15b", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line16", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line16a", 50, "1||1|1|1");
createGlobalPropertys("cl300/fms/line16b", 50, "1||1|1|1");


-- CDU commands
createCommand("cl300/fms/save_prst", "SAVE Preset List button")
createCommand("cl300/fms/save_pwpts", "SAVE Pilot Wayponts List button")

createCommand("cl300/fms/but_left_1", "CDU 1st left button")
createCommand("cl300/fms/but_left_2", "CDU 2nd left button")
createCommand("cl300/fms/but_left_3", "CDU 3rd left button")
createCommand("cl300/fms/but_left_4", "CDU 4th left button")
createCommand("cl300/fms/but_left_5", "CDU 5th left button")
createCommand("cl300/fms/but_left_6", "CDU 6th left button")

createCommand("cl300/fms/but_right_1", "CDU 1st right button")
createCommand("cl300/fms/but_right_2", "CDU 2nd right button")
createCommand("cl300/fms/but_right_3", "CDU 3rd right button")
createCommand("cl300/fms/but_right_4", "CDU 4th right button")
createCommand("cl300/fms/but_right_5", "CDU 5th right button")
createCommand("cl300/fms/but_right_6", "CDU 6th right button")

createCommand("cl300/fms/but_msg", "CDU MSG button")
createCommand("cl300/fms/but_dir", "CDU DIR button")
createCommand("cl300/fms/but_flpn", "CDU FLPN button")
createCommand("cl300/fms/but_legs", "CDU LEGS button")
createCommand("cl300/fms/but_dep_apr", "CDU DEP APR button")
createCommand("cl300/fms/but_perf", "CDU PERF button")
createCommand("cl300/fms/but_dspl_menu", "CDU DSPL MENU button")
createCommand("cl300/fms/but_mfd_adv", "CDU MFD ADV button")
createCommand("cl300/fms/but_mfd_data", "CDU MFD DATA button")
createCommand("cl300/fms/but_prev", "CDU PREV button")
createCommand("cl300/fms/but_next", "CDU NEXT button")
createCommand("cl300/fms/but_exec", "CDU EXEC button")

createCommand("cl300/fms/but_idx", "CDU IDX button")
createCommand("cl300/fms/but_tune", "CDU TUNE button")
createCommand("cl300/fms/but_clr", "CDU CLR button")
createCommand("cl300/fms/but_clr2", "CDU CLR/DEL button")
createCommand("cl300/fms/but_brt", "CDU BRT button")
createCommand("cl300/fms/but_dim", "CDU DIM button")

createCommand("cl300/fms/but_a", "CDU A button")
createCommand("cl300/fms/but_b", "CDU A button")
createCommand("cl300/fms/but_c", "CDU A button")
createCommand("cl300/fms/but_d", "CDU A button")
createCommand("cl300/fms/but_e", "CDU A button")
createCommand("cl300/fms/but_f", "CDU A button")
createCommand("cl300/fms/but_g", "CDU A button")
createCommand("cl300/fms/but_h", "CDU A button")
createCommand("cl300/fms/but_i", "CDU A button")
createCommand("cl300/fms/but_j", "CDU A button")
createCommand("cl300/fms/but_k", "CDU A button")
createCommand("cl300/fms/but_l", "CDU A button")
createCommand("cl300/fms/but_m", "CDU A button")
createCommand("cl300/fms/but_n", "CDU A button")
createCommand("cl300/fms/but_o", "CDU A button")
createCommand("cl300/fms/but_p", "CDU A button")
createCommand("cl300/fms/but_q", "CDU A button")
createCommand("cl300/fms/but_r", "CDU A button")
createCommand("cl300/fms/but_s", "CDU A button")
createCommand("cl300/fms/but_t", "CDU A button")
createCommand("cl300/fms/but_u", "CDU A button")
createCommand("cl300/fms/but_v", "CDU A button")
createCommand("cl300/fms/but_w", "CDU A button")
createCommand("cl300/fms/but_x", "CDU A button")
createCommand("cl300/fms/but_y", "CDU A button")
createCommand("cl300/fms/but_z", "CDU A button")
createCommand("cl300/fms/but_sp", "CDU SP button")
createCommand("cl300/fms/but_slash", "CDU / button")

createCommand("cl300/fms/but_1", "CDU 1 button")
createCommand("cl300/fms/but_2", "CDU 2 button")
createCommand("cl300/fms/but_3", "CDU 3 button")
createCommand("cl300/fms/but_4", "CDU 4 button")
createCommand("cl300/fms/but_5", "CDU 5 button")
createCommand("cl300/fms/but_6", "CDU 6 button")
createCommand("cl300/fms/but_7", "CDU 7 button")
createCommand("cl300/fms/but_8", "CDU 8 button")
createCommand("cl300/fms/but_9", "CDU 9 button")
createCommand("cl300/fms/but_0", "CDU 0 button")

createCommand("cl300/fms/but_point", "CDU . button")
createCommand("cl300/fms/but_pl_min", "CDU +/- button")




-- temporary commands

createCommand("cl300/fms/update_cdu", "CDU Graphics Update button")
createCommand("cl300/fms/cdu_prev", "CDU Prev button")
createCommand("cl300/fms/cdu_next", "CDU Next button")
createCommand("cl300/fms/clear_scratchpad", "CDU Clear button")
createCommand("cl300/fms/set_com1", "Set com1 on CDU")
createCommand("cl300/fms/set_com2", "Set com2 on CDU")
createCommand("cl300/fms/set_nav1", "Set nav1 on CDU")
createCommand("cl300/fms/set_nav2", "Set nav2 on CDU")
createCommand("cl300/fms/set_dme1", "Set dme1 on CDU")
createCommand("cl300/fms/set_dme2", "Set dme2 on CDU")

-- end of temp comm
createProp("cl300/fms/dme1_hold", "int", 0);
createProp("cl300/fms/dme2_hold", "int", 0);

createProp("cl300/fms/subpage", "int", 0);

createProp("cl300/keyb_in_use", "int", 0);
--]=]

--datarefs for reflection animations
createProp("cl300/l_engn_rev_rat", "float", 0);
createProp("cl300/r_engn_rev_rat", "float", 0);
createProp("cl300/ailer_l", "float", 0);
createProp("cl300/ailer_r", "float", 0);
createProp("cl300/flapref_l", "float", 0);
createProp("cl300/flapref_r", "float", 0);
createProp("cl300/lg_gear_0", "float", 0);
createProp("cl300/lg_gear_1", "float", 0);
createProp("cl300/lg_gear_2", "float", 0);




defineProperty("flight_time", globalPropertyf("sim/time/total_flight_time_sec"))

createProp("cl300/gpu_state", "int",2);      -- JackZero: New DataRef: 0 = gpu not connectable, 1 = gpu can connect, 2 = gpu connected
createProp("cl300/gpu_mode",  "int",0);      -- JackZero: New DataRef: 0 = auto, 1 = manual
createProp("cl300/prflt_cam_pos", "int", 1); -- JackZero: New Dataref for the preflight camera position (in order to control preflight via external plugins)
createProp("cl300/prflt_cam_vis", "int", 0); -- JackZero: New Dataref for the preflight position states (green bubbles) as a bitmap

createProp("cl300/prflt_cam_lock", "int", 1);

--createProp("cl300/toe_autobrakes", "int", 1);

createProp("cl300/mmenu_athide", "int", 1);

createProp("cl300/master_vol", "int", 1);

createProp("cl300/crc_butt", "int", 0);

createProp("cl300/stall_warn_test", "int", 0);

createProp("cl300/voice_rec_test_lt", "int", 0);
createProp("cl300/voice_rec_test", "int", 0);

createProp("cl300/rudlim_test", "int", 0);
createProp("cl300/taws_test_aur", "float", 0);
createProp("cl300/fire_test_aur", "float", 0);
createProp("cl300/ice_test", "int", 0);
createProp("cl300/probs_test", "int", 0);
createProp("cl300/annun2_aur", "float", 0);
createProp("cl300/annun1_aur", "float", 0);

createProp("cl300/poweron_p", "int", 0);

createProp("cl300/cklst_pages", "int", 0);
createProp("cl300/sound_vol", "int", 1800);
createProp("cl300/sound_mute", "int", 0);
createProp("cl300/ext_sound_vol", "float", 0.2458914667367);
createProp("cl300/ext_sound_mute", "int", 1);

createProp("cl300/popup_mfd", "int", 1);
createProp("cl300/hide_pilots", "int", 0);


createProp("cl300/opt_p", "int", 0);
createProp("cl300/inst_p", "int", 0);
createProp("cl300/mfd_pan_cas", "int", 0);
createProp("cl300/mfd_pan", "int", 0);

-- JackZero: Create datarefs for cas messages and checklist:
for i = 1,25 do
	createGlobalPropertys("cl300/cas_line_"..i.."_text", 22, "")
	createGlobalPropertyi("cl300/cas_line_"..i.."_color", 0)
end
for i = 1,17 do
	createGlobalPropertys("cl300/cklst_line_"..i.."_text", 95, "")
	createGlobalPropertyi("cl300/cklst_line_"..i.."_color", 0)
end
createGlobalPropertys("cl300/cklst_line_title_text", 95, "")
-- JackZero: End

createProp("cl300/chkl_panel_s", "int", 0);
createProp("cl300/ext_pr_panel_s", "int", 0);
createProp("cl300/cam_panel_s", "int", 0);
createProp("cl300/anim_panel_s", "int", 0);

createProp("cl300/eicas_3d_p", "int", 0);

createProp("cl300/lan_gear_warn", "int",0);
createProp("cl300/config_warn", "int", 0);
createProp("cl300/cabalt_warn", "int", 0);
createProp("cl300/red_cas",     "int", 0);
createProp("cl300/yellow_cas", "int", 0);
createProp("cl300/has_cas",    "int", 0); -- JackZero: new dataref
createProp("cl300/gear_warn", "int",0);
createProp("cl300/flaps_warn", "int",0);
createProp("cl300/terr_warn", "int",0);
createProp("cl300/gear_warn_w", "int",0);


createProp("cl300/refspds_v1", "int", 116);
createProp("cl300/refspds_vr", "int", 120);
createProp("cl300/refspds_v2", "int", 127);
createProp("cl300/refspds_vt", "int", 170);
createProp("cl300/refspds_vga", "int", 123);
createProp("cl300/refspds_vref", "int", 117);
createProp("cl300/refspds", "int", 1);
createProp("cl300/refspds_hide", "int", 0);

createProp("cl300/mast_warn", "float",0);
createProp("cl300/mast_caut", "float",0);

createProp("cl300/hstab_l", "float",0);
createProp("cl300/hstab_r", "float",0);

createProp("cl300/airdat1_fault", "int",0);
createProp("cl300/airdat2_fault", "int",0);

createProp("cl300/spoil_inb_l", "float",0);
createProp("cl300/spoil_inb_r", "float",0);
createProp("cl300/sbrk_inb_l", "float",0);
createProp("cl300/sbrk_inb_r", "float",0);
createProp("cl300/spoil_outb_l", "float",0);
createProp("cl300/spoil_outb_r", "float",0);
createProp("cl300/sbrk_outb_l", "float",0);
createProp("cl300/sbrk_outb_r", "float",0);

createProp("cl300/test_data_1", "float",0);
createProp("cl300/test_data_2", "float",0);
createProp("cl300/test_data_3", "float",0);
createProp("cl300/test_data_4", "float",0);
createProp("cl300/test_data_5", "float",0);



createProp("cl300/temp_cabin", "float",0)
createProp("cl300/glass_ice_cockpit", "float",0)
createProp("cl300/glass_ice_cockpit2", "float",0)

createProp("cl300/anim_crs_dial", "int",0);

createProp("cl300/autop_vvi_dial", "int",0);
createProp("cl300/autop_crs_dial", "int",0);
createProp("cl300/autop_hdg_dial", "int",0);
createProp("cl300/autop_spd_dial", "int",0);
createProp("cl300/autop_alt_dial", "int",0);

createProp("cl300/clock_timer_h", "int",0);

createProp("cl300/autop_brgsrc", "int", -1);
createProp("cl300/autop_yd_h", "int",0);
createProp("cl300/autop_xfr_h", "int",0);
createProp("cl300/autop_ap_h", "int",0);
createProp("cl300/autop_alt_h", "int",0);
createProp("cl300/autop_vnav_h", "int",0);
createProp("cl300/autop_vs_h", "int",0);
createProp("cl300/autop_flc_h", "int",0);
createProp("cl300/autop_bc_h", "int",0);
createProp("cl300/autop_appr_h", "int",0);
createProp("cl300/autop_hdg_h", "int",0);
createProp("cl300/autop_nav_h", "int",0);
createProp("cl300/autop_fdir_h", "int",0);
createProp("cl300/half_bank_h", "int",0);

createProp("cl300/stbi_cage_h", "int",0)

createProp("cl300/s_master_gain", "float", 1800);

createProp("cl300/clock_gps", "int",0);
createProp("cl300/clock_flt", "int",0);
createProp("cl300/clock_mode", "int",0);
createProp("cl300/clock_flt_time_s", "int",0);

createProp("cl300/fgp_s_hdg", "int",0);

createProp("cl300/mfd_checkl_r", "int",0);
createProp("cl300/mfd_hydr_r", "int",0);
createProp("cl300/mfd_fuel_r", "int",0);
createProp("cl300/mfd_flt_ctr_r", "int",0);
createProp("cl300/mfd_electr_r", "int",0);
createProp("cl300/mfd_ecs_r", "int",0);
createProp("cl300/mfd_antice_r", "int",0);
createProp("cl300/mfd_sumry_r", "int",0);
createProp("cl300/mfd_frmt_r", "int",0);

createProp("cl300/mfd_checkl_l", "int",0);
createProp("cl300/mfd_hydr_l", "int",0);
createProp("cl300/mfd_fuel_l", "int",0);
createProp("cl300/mfd_flt_ctr_l", "int",0);
createProp("cl300/mfd_electr_l", "int",0);
createProp("cl300/mfd_ecs_l", "int",0);
createProp("cl300/mfd_antice_l", "int",0);
createProp("cl300/mfd_sumry_l", "int",0);
createProp("cl300/mfd_frmt_l", "int",1);

createProp("cl300/aud_vol_1_l", "float",1);
createProp("cl300/aud_vol_2_l", "float",1);
createProp("cl300/aud_vol_3_l", "float",1);
createProp("cl300/aud_vol_4_l", "float",1);
createProp("cl300/aud_vol_5_l", "float",1);
createProp("cl300/aud_vol_6_l", "float",1);
createProp("cl300/aud_vol_7_l", "float",1);
createProp("cl300/aud_vol_8_l", "float",1);
createProp("cl300/aud_vol_9_l", "float",1);
createProp("cl300/aud_vol_10_l", "float",1);
createProp("cl300/aud_vol_11_l", "float",1);
createProp("cl300/aud_vol_12_l", "float",1);
createProp("cl300/aud_vol_13_l", "float",1);
createProp("cl300/aud_vol_14_l", "float",1);
createProp("cl300/aud_vol_15_l", "float",1);
createProp("cl300/aud_vol_16_l", "float",1);
createProp("cl300/aud_vol_17_l", "float",1);

createProp("cl300/aud_vol_1_r", "float",1);
createProp("cl300/aud_vol_2_r", "float",1);
createProp("cl300/aud_vol_3_r", "float",1);
createProp("cl300/aud_vol_4_r", "float",1);
createProp("cl300/aud_vol_5_r", "float",1);
createProp("cl300/aud_vol_6_r", "float",1);
createProp("cl300/aud_vol_7_r", "float",1);
createProp("cl300/aud_vol_8_r", "float",1);
createProp("cl300/aud_vol_9_r", "float",1);
createProp("cl300/aud_vol_10_r", "float",1);
createProp("cl300/aud_vol_11_r", "float",1);
createProp("cl300/aud_vol_12_r", "float",1);
createProp("cl300/aud_vol_13_r", "float",1);
createProp("cl300/aud_vol_14_r", "float",1);
createProp("cl300/aud_vol_15_r", "float",1);
createProp("cl300/aud_vol_16_r", "float",1);
createProp("cl300/aud_vol_17_r", "float",1);





createProp("cl300/s_l", "int",0);
createProp("cl300/s_r", "int",0);

createProp("cl300/mfdpan_lr_sw", "int",0);

createProp("cl300/lg_man", "int",0);
createProp("cl300/pitch_d_1", "int",0);
createProp("cl300/pitch_d_2", "int",0);

createProp("cl300/aud_pa_r_h", "int",0);
createProp("cl300/aud_pa_r", "float",0);
createProp("cl300/aud_cab_r_h", "int",0);
createProp("cl300/aud_cab_r", "float",0);
createProp("cl300/aud_hf2_r_h", "int",0);
createProp("cl300/aud_hf2_r", "float",0);
createProp("cl300/aud_hf1_r_h", "int",0);
createProp("cl300/aud_hf1_r", "float",0);
createProp("cl300/aud_com3_r_h", "int",0);
createProp("cl300/aud_com3_r", "float",0);
createProp("cl300/aud_com2_r_h", "int",0);
createProp("cl300/aud_com2_r", "float",0);
createProp("cl300/aud_com1_r_h", "int",0);
createProp("cl300/aud_com1_r", "float",0);

createProp("cl300/aud_pa_l_h", "int",0);
createProp("cl300/aud_pa_l", "float",0);
createProp("cl300/aud_cab_l_h", "int",0);
createProp("cl300/aud_cab_l", "float",0);
createProp("cl300/aud_hf2_l_h", "int",0);
createProp("cl300/aud_hf2_l", "float",0);
createProp("cl300/aud_hf1_l_h", "int",0);
createProp("cl300/aud_hf1_l", "float",0);
createProp("cl300/aud_com3_l_h", "int",0);
createProp("cl300/aud_com3_l", "float",0);
createProp("cl300/aud_com2_l_h", "int",0);
createProp("cl300/aud_com2_l", "float",0);
createProp("cl300/aud_com1_l_h", "int",1);
createProp("cl300/aud_com1_l", "float",0);

createProp("cl300/aud_o2m_r_sw", "int",0);
createProp("cl300/aud_emer_r_sw", "int",0);
createProp("cl300/aud_voice_r_sw", "int",2);
createProp("cl300/comps_slew_r_sw", "int",0);
createProp("cl300/rudd_ped_r_sw", "int",0);
createProp("cl300/pedals_fwd_bwd_r", "float",0);

createProp("cl300/comps_head_r_h", "int",0);
createProp("cl300/comps_head_r", "float",0);

createProp("cl300/aud_o2m_l_sw", "int",0);
createProp("cl300/aud_emer_l_sw", "int",0);
createProp("cl300/aud_voice_l_sw", "int",2);
createProp("cl300/comps_slew_l_sw", "int",0);
createProp("cl300/rudd_ped_l_sw", "int",0);
createProp("cl300/pedals_fwd_bwd_l", "float",0);

createProp("cl300/comps_head_l_h", "int",0);
createProp("cl300/comps_head_l", "float",0);


createProp("cl300/elt_h", "int",0);
createProp("cl300/elt", "float",0);


createProp("cl300/dcu_b_cov", "int",0);
createProp("cl300/dcu_b_h", "int",1);
createProp("cl300/dcu_b", "float",0);
createProp("cl300/dcu_a_cov", "int",0);
createProp("cl300/dcu_a_h", "int",1);
createProp("cl300/dcu_a", "float",0);

createProp("cl300/cab_ac_cov", "int",0);
createProp("cl300/cab_ac_h", "int", 1);
createProp("cl300/cab_ac", "float",0);
createProp("cl300/cab_dc_cov", "int",0);
createProp("cl300/cab_dc_h", "int", 1);
createProp("cl300/cab_dc", "float",0);

createProp("cl300/oxigen_ox", "int", (not ALL_SWITCHES_OFF) and 1 or 0); -- JackZero: Cold & dark default position can be altered from AUTO to OFF
createProp("cl300/oxigen_terap_cov", "int",0);
createProp("cl300/oxigen_terap_h", "int",0);
createProp("cl300/oxigen_terap", "float",0);

createProp("cl300/fire_engn_r_cov", "int",0);
createProp("cl300/fire_engn_r_h", "int",0);
createProp("cl300/fire_engn_r", "float",0);
createProp("cl300/fire_engn_l_cov", "int",0);
createProp("cl300/fire_engn_l_h", "int",0);
createProp("cl300/fire_engn_l", "float",0);
createProp("cl300/fire_apu_cov", "int",0);
createProp("cl300/fire_apu_h", "int",0);
createProp("cl300/fire_apu", "float",0);
createProp("cl300/fire_ext_2_cov", "int",0);
createProp("cl300/fire_ext_2_h", "int",0);
createProp("cl300/fire_ext_2", "float",0);
createProp("cl300/fire_ext_1_cov", "int",0);
createProp("cl300/fire_ext_1_h", "int",0);
createProp("cl300/fire_ext_1", "float",0);
createProp("cl300/fire_autoapr_cov", "int",0);
createProp("cl300/fire_autoapr_h", "int", 1);
createProp("cl300/fire_autoapr", "float",0);

createProp("cl300/test_rot", "int",0);
createProp("cl300/test_push", "int",0);

createProp("cl300/trim_pusher_cov", "int", 0);
createProp("cl300/trim_pusher_h", "int", 1);
createProp("cl300/trim_pusher", "float",0);
createProp("cl300/trim_stab", "int",0);
createProp("cl300/trim_rud", "float",0);

createProp("cl300/outbrks_low", "int",0);
createProp("cl300/brks_low", "int",0);

createProp("cl300/hydr_altn_flp_cov", "int",0);
createProp("cl300/hydr_altn_flp_h", "int",0);
createProp("cl300/hydr_altn_flp", "float",0);
createProp("cl300/hydr_l_sov_cov", "int",0);
createProp("cl300/hydr_l_sov_h", "int",1);
createProp("cl300/hydr_l_sov", "float",0);
createProp("cl300/hydr_r_sov_cov", "int",0);
createProp("cl300/hydr_r_sov_h", "int", 1);
createProp("cl300/hydr_r_sov", "float",0);

createProp("cl300/hd_l_engn_state", "int",0); -- JackZero: New Datarefs
createProp("cl300/hd_r_engn_state", "int",0); -- JackZero: New Datarefs
createProp("cl300/hd_l_pump_state", "int",0); -- JackZero: New Datarefs
createProp("cl300/hd_r_pump_state", "int",0); -- JackZero: New Datarefs
createProp("cl300/hd_aux_state",    "int",0); -- JackZero: New Datarefs
createProp("cl300/hd_ptu_state",    "int",0); -- JackZero: New Datarefs

createProp("cl300/electr_ess_p_status", "int",0);
createProp("cl300/electr_apugen_h", "int",0);
createProp("cl300/electr_apugen", "float",0);
createProp("cl300/electr_gen_r_h", "int",0);
createProp("cl300/electr_gen_r", "float",0);
createProp("cl300/electr_gen_l_h", "int",0);
createProp("cl300/electr_gen_l", "float",0);
createProp("cl300/electr_stbi_h", "int",0);
createProp("cl300/electr_stbi", "float",0);
createProp("cl300/electr_extp_h", "int",0);
createProp("cl300/electr_extp", "float",0);
createProp("cl300/electr_extp_avail", "float",0);
createProp("cl300/electr_apugen_l", "int",0);
createProp("cl300/electr_apugen_r", "int",0);

createProp("cl300/gen_amps_l",    "float",0); -- JackZero: New Datarefs
createProp("cl300/gen_amps_r",    "float",0); -- JackZero: New Datarefs
createProp("cl300/gen_amps_apu",  "float",0); -- JackZero: New Datarefs
createProp("cl300/gen_volts_l",   "float",0); -- JackZero: New Datarefs
createProp("cl300/gen_volts_r",   "float",0); -- JackZero: New Datarefs
createProp("cl300/gen_volts_apu", "float",0); -- JackZero: New Datarefs
createProp("cl300/gpu_volts",     "float",0); -- JackZero: New Datarefs

createProp("cl300/antice_wings_xbleed_valve", "int",0);
createProp("cl300/antice_wngsource_r", "int",1);
createProp("cl300/antice_wshld_r_h", "int",0);
createProp("cl300/antice_wshld_r", "float",0);
createProp("cl300/antice_wshld_l_h", "int",0);
createProp("cl300/antice_wshld_l", "float",0);
createProp("cl300/antice_engn_r_h", "int",0);
createProp("cl300/antice_engn_r", "float",0);
createProp("cl300/antice_engn_l_h", "int",0);
createProp("cl300/antice_engn_l", "float",0);
createProp("cl300/antice_probe_r_h", "int",0);
createProp("cl300/antice_probe_r", "float",0);
createProp("cl300/antice_probe_l_h", "int",0);
createProp("cl300/antice_probe_l", "float",0);
createProp("cl300/antice_wing_h", "int",0);
createProp("cl300/antice_wing", "float",0);
createProp("cl300/antice_psi_l", "float",0); -- JackZero: New Datarefs
createProp("cl300/antice_psi_r", "float",0); -- JackZero: New Datarefs


createProp("cl300/pressure_lndg_alt_1", "int",0);
createProp("cl300/pressure_lndg_alt_2", "float",-0.799); -- JackZero: Change default from 5000ft to 1000ft

createProp("cl300/pressure_man_h", "int",0);
createProp("cl300/pressure_man", "float",0);
createProp("cl300/pressure_ditch_cov", "int",0);
createProp("cl300/pressure_ditch_h", "int",0);
createProp("cl300/pressure_ditch", "float",0);
createProp("cl300/pressure_emer_depr_cov", "int",0);
createProp("cl300/pressure_emer_depr_h", "int",0);
createProp("cl300/pressure_emer_depr", "float",0);
createProp("cl300/pressure_manrate", "float",0);


createProp("cl300/aircond_tempr_cock_ddial", "float",0);
createProp("cl300/aircond_tempr_cock_c",     "float", 0);  -- JackZero: New dataref
createProp("cl300/aircond_tempr_cock_duct",  "float", 0);  -- JackZero: New dataref
createProp("cl300/aircond_tempr_cab_ddial", "float",0);
createProp("cl300/aircond_tempr_cab_duct",  "float", 0);  -- JackZero: New dataref
createProp("cl300/aircond_tempr_cab_c",     "float", 0);  -- JackZero: New dataref
createProp("cl300/aircond_cockpit_temp", "float",0);
createProp("cl300/aircond_cabin_temp", "float",0);
createProp("cl300/aircond_ramair_h", "int",0);
createProp("cl300/aircond_ramair_cov", "int",0);
createProp("cl300/aircond_ramair", "float",0);
createProp("cl300/aircond_man_temp_h", "int",0);
createProp("cl300/aircond_man_temp", "float",0);
createProp("cl300/aircond_airsource", "int", 0);
createProp("cl300/aircond_has_trim", "int", 0);     -- JackZero: New dataref
createProp("cl300/aircond_has_pack", "int", 0);     -- JackZero: New dataref


createProp("cl300/taws_ter", "float",0);
createProp("cl300/taws_flp", "float",0);
createProp("cl300/taws_gs", "float",0);
createProp("cl300/taws_ter_h", "int", 1);
createProp("cl300/taws_flp_h", "int", 1);
createProp("cl300/taws_gs_h", "int", 1);
createProp("cl300/taws_ter_cov", "int",0);
createProp("cl300/taws_flp_cov", "int",0);
createProp("cl300/taws_gs_cov", "int",0);

createProp("cl300/nws_h", "int",0);
createProp("cl300/nws", "float",0);

createProp("cl300/fuel_pump_r_astate", "int", 0);
createProp("cl300/fuel_pump_l_astate", "int", 0);
createProp("cl300/fuel_imbalanced", "int",0);
createProp("cl300/fuel_used", "float",0); -- JackZero: New dataref
createProp("cl300/fuel_balanced", "int",0);
createProp("cl300/fuel_xflow_up_h", "int",0);
createProp("cl300/fuel_xflow_dn_h", "int",0);
createProp("cl300/fuel_xflow_up", "float",0);
createProp("cl300/fuel_xflow_dn", "float",0);
createProp("cl300/fuel_xpump_r", "int", (not ALL_SWITCHES_OFF) and 1 or 0); -- JackZero: Cold & dark default position can be altered from AUTO to OFF
createProp("cl300/fuel_xpump_l", "int", (not ALL_SWITCHES_OFF) and 1 or 0); -- JackZero: Cold & dark default position can be altered from AUTO to OFF

createProp("cl300/rev_air_dat", "int", 1);
createProp("cl300/rev_att_hd", "int", 1);
createProp("cl300/rev_tune", "int", 2);
createProp("cl300/rev_pan_l", "int", 1);
createProp("cl300/rev_pan_r", "int", 1);

createProp("cl300/bleed_status", "int", 0);
createProp("cl300/bleed_xbleed_h", "int", 0);
createProp("cl300/bleed_xbleed", "float",0);
createProp("cl300/bleed_en_l_h", "int",0);
createProp("cl300/bleed_en_l", "float",0);
createProp("cl300/bleed_en_r_h", "int",0);
createProp("cl300/bleed_en_r", "float",0);
createProp("cl300/bleed_apu_h", "int", 0);
createProp("cl300/bleed_apu", "float",0);
createProp("cl300/bleed_psi_l", "float", 0); -- JackZero: New dataref
createProp("cl300/bleed_psl_r", "float", 0); -- JackZero: New dataref

createProp("cl300/engn_mach_status", "int",0);
createProp("cl300/engn_mach_h", "int",0);
createProp("cl300/engn_mach", "float",0);
createProp("cl300/engn_ign_h", "int",0);
createProp("cl300/engn_ign", "float",0);
createProp("cl300/en_starter_l", "int",1);
createProp("cl300/en_starter_r", "int",1);
createProp("cl300/en_but_run_l", "int",0);
createProp("cl300/en_but_run_r", "int",0);

createProp("cl300/carets", "int",0);
createProp("cl300/TO_n1", "float",0);
createProp("cl300/TO_n1_l", "float",0); -- JackZero: New Dataref
createProp("cl300/TO_n1_r", "float",0); -- JackZero: New Dataref
createProp("cl300/CLB_n1", "float",0);

createProp("cl300/oil_temp_left_smooth", "float",0);  -- JackZero: New Dataref for external access
createProp("cl300/oil_temp_right_smooth", "float",0); -- JackZero: New Dataref for external access

createProp("cl300/ISA_t", "float",0);

createProp("cl300/ISA_t", "float",0);

createProp("cl300/ISA_t", "float",0);

createProp("cl300/fadec_coeff1", "float",0);
createProp("cl300/fadec_coeff2", "float",0);

createProp("cl300/dcp_radar", "int", 1);
createProp("cl300/dcp_refs", "int", -1);
createProp("cl300/dcp_refs_menu", "int", 0);
createProp("cl300/dcp_dmeh", "int", 1);
createProp("cl300/dcp_1_2", "int", 1);
createProp("cl300/dcp_navsrc", "int", -1);
createProp("cl300/dcp_tilt", "int",0);
createProp("cl300/dcp_range", "int",0);
createProp("cl300/dcp_data_mode", "int",0);
createProp("cl300/dcp_tune1_rot", "int",0);
createProp("cl300/dcp_tune2_rot", "int",0);
createProp("cl300/dcp_menu1_rot", "int",0);
createProp("cl300/dcp_menu2_rot", "int",0);

createProp("cl300/baro_pref", "int",0);
createProp("cl300/com_pref", "int",1); -- JackZero: Use 8kHz spacing
createProp("cl300/alt_pref", "int",0); -- JackZero: Show metric alt

createCommand("cl300/DCP/dcp_refs_button", "DCP Refs button")


createProp("cl300/mfd_sel_state_h", "int",0);
createProp("cl300/mfd_sel_state", "int",0);
createProp("cl300/mfd_sel_column", "int",0); -- JackZero: New dataref to store selected radio column

createProp("cl300/ground_sp_h", "int", (not ALL_SWITCHES_OFF) and 1 or 0); -- JackZero: Cold & dark default position can be altered from AUTO to OFF
createProp("cl300/sbrk_h", "float",0);
createProp("cl300/ground_spoil_h", "float",0);
createProp("cl300/flight_spoil_cov", "float",0);
createProp("cl300/flight_spoil_h", "float",0);
createProp("cl300/flight_spoil", "float",0);


createProp("cl300/steer_handle", "float",0);

createProp("cl300/thr_anm1", "float",0);
createProp("cl300/thr_anm2", "float",0);
createProp("cl300/gust_lock", "int",1);
createProp("cl300/gust_lock_anm", "float", 1);

createProp("cl300/avion_lit1", "int",0);
createProp("cl300/avion_lit2", "int",0);
createProp("cl300/avion_lit3", "int",0);

createProp("cl300/right_bat", "float",0);
createProp("cl300/left_bat", "float",0);
createProp("cl300/right_bat_h", "int",0);
createProp("cl300/left_bat_h", "int",0);

createProp("cl300/bus_tie_h", "float",1);
createProp("cl300/bus_tie", "float",0);

createProp("cl300/l_hpump_h", "int", 0);
createProp("cl300/r_hpump_h", "int", 0);
createProp("cl300/aux_hpump_h", "int", 0);
createProp("cl300/ptu_h", "int", 0);

createProp("cl300/rembf1", "int",0);
createProp("cl300/rembf2", "int",0);
createProp("cl300/rembf3", "int",0);
createProp("cl300/rembf4", "int",0);
createProp("cl300/rembf5", "int",0);
createProp("cl300/rembf6", "int",0);
createProp("cl300/rembf7", "int",0);
createProp("cl300/rembf8", "int",0);
createProp("cl300/rembf9", "int",0);
createProp("cl300/rembf10", "int",0);
createProp("cl300/rembf11", "int",0);
createProp("cl300/rembf12", "int",0);
createProp("cl300/rembf13", "int",0);
createProp("cl300/rembf14", "int",0);

createProp("cl300/menu_type", "int",0);
createProp("cl300/cam_type", "int",0);

createProp("cl300/rain_back", "float",0);
createProp("cl300/rain_scr1", "float",0);
createProp("cl300/rain_scr2", "float",0);
createProp("cl300/rain_scr3", "float",0);
createProp("cl300/rain_scr4", "float",0);
createProp("cl300/rain_drop1", "float",0);
createProp("cl300/rain_move1", "float",0);
createProp("cl300/rain_move2", "float",0);

createProp("cl300/customslider4", "int",0);
createProp("cl300/customslider4_r", "float",0);

createProp("cl300/customslider3", "int",0);
createProp("cl300/customslider3_r", "float",0);

createProp("cl300/customslider2", "int",0);
createProp("cl300/customslider2_r", "float",0);

createProp("cl300/customslider1", "int",0);
createProp("cl300/customslider1_r", "float",0);

createProp("cl300/cablight_h", "float",0);
createProp("cl300/cablight", "float",0);
createProp("cl300/entrlight_h", "float",0);
createProp("cl300/entrlight", "float",0);
createProp("cl300/emeright_h", "float",0);
createProp("cl300/emeright", "float",0);
createProp("cl300/landlight1", "float",0);
createProp("cl300/landlight2", "float",0);
createProp("cl300/landlight1_h", "float",0);
createProp("cl300/landlight2_h", "float",0);
createProp("cl300/xap_taxilight_h", "float",0);
createProp("cl300/xap_taxilight", "float",0);
createProp("cl300/xap_taxilight2", "float",0);
createProp("cl300/strobe_h", "float",0);
createProp("cl300/nav_h", "float",0);
createProp("cl300/logo", "float",0);

createProp("cl300/beac_brt", "float",0);

createProp("cl300/wing_insp_h", "float",0);
createProp("cl300/wing_insp", "float",0);
createProp("cl300/wing_insp_b", "float",0);

createProp("cl300/salon_lt_lvl", "float",0);
createProp("cl300/stair_lt_lvl", "float",0);
createProp("cl300/salon_lt_lvl_full", "float",0);

createProp("cl300/cockavl", "float",0);
createProp("cl300/cockavl_p", "float",0);
createProp("cl300/cockavl_m", "float",0);
createProp("cl300/cockavr", "float",0);
createProp("cl300/cockavr_p", "float",0);
createProp("cl300/cockavr_m", "float",0);
createProp("cl300/stby_ins_lt", "float",0);
createProp("cl300/stby_ins_dim_brt", "int",0);


createProp("cl300/dome_h", "float",0);
createProp("cl300/dome", "float",0);

createProp("cl300/crewlit_h", "float",0);
createProp("cl300/crewlit", "float",0);

createProp("cl300/crewlit2_h", "float",0);
createProp("cl300/crewlit2", "float",0);

createProp("cl300/annun_h", "float",0);
createProp("cl300/annun", "float",0);

createProp("cl300/cbp_h", "float",1);
createProp("cl300/cbp", "float",0);

createProp("cl300/cmfd_h", "float",1);
createProp("cl300/cmfd", "float",0);

createProp("cl300/cpfd_h", "float",1);
createProp("cl300/cpfd", "float",0);

createProp("cl300/dome_h", "float",0);
createProp("cl300/dome", "float",0);

createProp("cl300/gshldr_h", "float",1);
createProp("cl300/gshldr", "float",0);



createProp("cl300/ppfd_h", "float",1);
createProp("cl300/ppfd", "float",0);

createProp("cl300/pmfd_h", "float",1);
createProp("cl300/pmfd", "float");

createProp("cl300/annun_h", "float",0);
createProp("cl300/annun", "float",0);

createProp("cl300/pedestal_h", "float",1);
createProp("cl300/pedestal", "float",0);

createProp("cl300/gshldl_h", "float",1);
createProp("cl300/gshldl", "float",0);


createProp("cl300/fms_selector", "int",0);


local xhsi_plugin = findPluginBySignature("xhsi.plugin")
createProp("cl300/use_xhsi", "int", (xhsi_plugin > -1 and isPluginEnabled(xhsi_plugin)) and 1 or 0); -- JackZero: Enable custom logics if XHSI is used (e.g. extended range & refs menu)


createProp("cl300/sunscreen10", "float",0);
createProp("cl300/sunscreen20", "float",0);
createProp("cl300/sunscreen11", "float",0);
createProp("cl300/sunscreen21", "float",0);


createProp("cl300/master_vol", "float",1);

createProp("cl300/belt", "int",0);
createProp("cl300/smoke", "int",0);
createProp("cl300/smokebelts_h", "int",0);


createProp("cl300/disp_music_r", "float",0);

createProp("cl300/music", "int",0);

createProp("cl300/towforce", "float",0);

createProp("cl300/jalousie1", "float",0);
createProp("cl300/jalousie2", "float",0);
createProp("cl300/jalousie3", "float",0);
createProp("cl300/jalousie4", "float",0);
createProp("cl300/jalousie5", "float",0);
createProp("cl300/jalousie6", "float",0);

createProp("cl300/jalousie7", "float",0);
createProp("cl300/jalousie8", "float",0);
createProp("cl300/jalousie9", "float",0);
createProp("cl300/jalousie10", "float",0);
createProp("cl300/jalousie11", "float",0);
createProp("cl300/jalousie12", "float",0);

createProp("cl300/table1", "float",0);
createProp("cl300/table2", "float",0);
createProp("cl300/table3", "float",0);
createProp("cl300/table4", "float",0);

createProp("cl300/p_cush", "float",0);

createProp("cl300/cdu_pages", "int",0);
createProp("cl300/index_pages", "int",0);
createProp("cl300/posinit_pages", "int",0);
createProp("cl300/vordmeuse", "int",0);
createProp("frame_time", "float", 0); -- time since last frame

createProp("cl300/wave_limit_n", "int",0); -- wave limit value
createProp("cl300/avionics_night_light", "float",0); -- avionics night light
createProp("cl300/trans_light", "float",0); -- transponder light ratio
createProp("cl300/aud_panel_pw_ind", "float",0); --audio panel power light

-- audio panel lights
createProp("cl300/aud_panel_pw", "int",0);
createProp("cl300/aud_panel_pw_lit", "int",0);
createProp("cl300/aud_com1_pw", "int",0);
createProp("cl300/aud_com2_pw", "int",0);
createProp("cl300/aud_nav1_pw", "int",0);
createProp("cl300/aud_nav2_pw", "int",0);
createProp("cl300/aud_dme_pw", "int",0);
createProp("cl300/aud_mkr_pw", "int",0);
createProp("cl300/aud_adf_pw", "int",0);


-- comnav lights
createProp("cl300/comnav1_pw", "int",0);
createProp("cl300/comnav2_pw", "int",0);

-- DME power
createProp("cl300/dme_pw_lit", "int",0);

-- ADF1 power
createProp("cl300/adf1_pw_lit", "int",0);

-- transponder lights
createProp("cl300/trans_pw_lit", "int",0);

-- fuel gage
createProp("cl300/fuel_q_selector", "int",0);
createProp("cl300/fuel_reset_used", "int",0);
createProp("cl300/fuel_used", "float",0);


-- gps lights
createProp("cl300/gps_pw", "int",0);
createProp("cl300/gps_pw_lit", "int",0);
createProp("cl300/gps_apt", "int",0);
createProp("cl300/gps_vor", "int",0);
createProp("cl300/gps_ndb", "int",0);
createProp("cl300/gps_int", "int",0);

createProp("cl300/disp", "float",0);
createProp("cl300/disp2", "float",0);
createProp("cl300/disp3", "float",0);
createProp("cl300/disp4", "float",0);

createProp("cl300/post_effect", "int",0);
createProp("cl300/post_effect_trans", "float",0);
createProp("cl300/position_saving", "int",0);

createProp("cl300/emer_door_lit", "float",0);

--Start patch for MFD commands
createCommand("cl300/mfd_lr_left", "MFD control panel move l/r switch to left")   -- JackZero: Added
createCommand("cl300/mfd_lr_right", "MFD control panel move l/r switch to right") -- JackZero: Added
createCommand("cl300/mfd_lr_toggle", "MFD control panel toggle l/r switch")       -- JackZero: Added
createCommand("cl300/mfd_cklst", "MFD control panel cklst button")
createCommand("cl300/mfd_sumry", "MFD control panel sumry button")
createCommand("cl300/mfd_aice", "MFD control panel aice button")
createCommand("cl300/mfd_ecs", "MFD control panel ecs button")
createCommand("cl300/mfd_elec", "MFD control panel elec Ice button")
createCommand("cl300/mfd_flt", "MFD control panel flt button")
createCommand("cl300/mfd_fuel", "MFD control panel fuel button")
createCommand("cl300/mfd_hyd", "MFD control panel hyd button")
createCommand("cl300/mfd_tfc", "MFD control panel tfc button")
createCommand("cl300/mfd_frmt", "MFD control panel frmt button")
createCommand("cl300/mfd_trwx", "MFD control panel trwx button")
createCommand("cl300/mfd_cas", "MFD control panel cas button")
--End patch for MFD commands

createCommand("cl300/chklist_enter", "MFD control panel Enter button")
createCommand("cl300/chklist_skip", "MFD control panel Skip button")
createCommand("cl300/chklist_jright", "MFD control panel Joy Right button")
createCommand("cl300/chklist_jleft", "MFD control panel Joy Left button")

-- JackZero: New datarefs and commands for flightplan access:
createProp("cl300/flgtplan_show_entry", "int", 1); -- flight plan entry shown on PFD (plan mode)
createCommand("cl300/flgtplan_show_next", "show next flightplan entry on PFD (plan mode)")
createCommand("cl300/flgtplan_show_prev", "show previous flightplan entry on PFD (plan mode)")
-- JackZero: End

-- JackZero: Additional datarefs
createProp("cl300/engine_state_l", "int", 0) -- similar to carets but per engine and with reverse
createProp("cl300/engine_state_r", "int", 0)
createProp("cl300/engine_state_rpm_l", "int", 0) -- rpm > 1000, gustlock off, reversers < 0.1 ?
createProp("cl300/engine_state_rpm_r", "int", 0)
-- JackZero: End

-- JackZero: Cold & dark default position can be altered from N1 to OFF
if ALL_SWITCHES_OFF then
    defineProperty("jet_sync_mode", globalPropertyi("sim/cockpit2/switches/jet_sync_mode"))
    set(jet_sync_mode, 0)
end
-- JackZero: End

createProp("maxF", "float", 110);
createProp("minF", "float", 75);
createProp("maxB", "float", 375);
createProp("minB", "float", 75);
createProp("volume", "float", 100);
createProp("volumeX", "float", 1);



defineProperty("draw_fft_water", globalPropertyi("sim/private/controls/reno/draw_fft_water"))


defineProperty("closeImage", loadImage("close.png"))  -- close image
defineProperty("window_height",globalPropertyi("sim/graphics/view/window_height"))
defineProperty("window_width",globalPropertyi("sim/graphics/view/window_width"))

defineProperty("sunglases", globalPropertyi("sim/cockpit/electrical/sunglasses_on"))
defineProperty("slider9", globalPropertyf("sim/flightmodel2/misc/custom_slider_ratio[8]"))
defineProperty("customslider1", globalPropertyi("cl300/customslider1"))

defineProperty("override_throttles", globalPropertyi("sim/operation/override/override_throttles"))
defineProperty("override_cs", globalPropertyi("sim/operation/override/override_control_surfaces"))
defineProperty("override_fc", globalPropertyi("sim/operation/override/override_flightcontrol"))
defineProperty("override_gearbrake", globalPropertyf("sim/operation/override/override_gearbrake"))
defineProperty("override_toe_brakes", globalPropertyf("sim/operation/override/override_toe_brakes"))
defineProperty("parking_brake_ratio", globalPropertyf("sim/cockpit2/controls/parking_brake_ratio"))

defineProperty("TOGA_pitch_deg", globalPropertyf("sim/cockpit2/autopilot/TOGA_pitch_deg"))

local default_toga = get(TOGA_pitch_deg)
set(TOGA_pitch_deg, 16)

set(draw_fft_water, 0)


local coef = get(window_height) / 768
--if coef > 1 then coef = 1 end

--set(override_toe_brakes,1)
set(parking_brake_ratio,1)

function onAvionicsDone()
set(override_throttles, 0)
set(sunglases,0)
set(override_cs, 0)
set(override_fc, 0)
set(override_gearbrake, 0)
set(override_toe_brakes,0)
set(TOGA_pitch_deg, default_toga)
set(draw_fft_water, 1)
end

-- 1-button subpanel for mainmenu



blankpan = subpanel {

    position = { 0 , get(window_height) - 157.5*coef , 24*coef, 75*coef };

    noBackground = true;
    noClose = true;
	noResize = true;
    movable = false;
	noVisible = true;
    clickable = true;
    components = {
		 blankpan {
         position = { 0, 0, 24*coef, 75*coef },

         };
	};
}

-- main menu

mainmenu = subpanel {

    position = { 0 , get(window_height) - 382*coef , 200*coef, 265*coef };

    noBackground = true;
    noClose = true;
	noResize = true;
    movable = false;
	noVisible = true;
    clickable = true;
    components = {
		 mainmenu {
         position = { 0, 0, 300*coef, 300*coef },

         };
	};
}--]=]


-- preflight panel

preflightmenu = subpanel {
    position = { 10*coef , 10*coef , 300*coef, 336*coef };
    noBackground = true;
    noClose = true;
	noResize = true;
    movable = true;
	noVisible = true;
    clickable = true;
    components = {
		 preflight {
         position = { 0, 0, 300*coef, 336*coef },

         };
	};
}

-- cameras panel
camerasmenu = subpanel {
    position = { 540*coef , 128*coef , 157*coef, 209*coef };
    noBackground = true;
    noClose = true;
	noResize = true;
    movable = true;
	noVisible = true;
    clickable = true;
    components = {
		 cameras {
         position = { 0, 0, 157*coef, 209*coef },

         };
	};
}--]=]

-- add swithes panel
--[=[switches_menu = subpanel {
    position = { (get(window_width)) - 150 , get(window_height) - 150 , 128, 128 };
    noBackground = true;
    noClose = true;
    movable = true;
    clickable = true;
    noResize = false;
    components = {
		 switches_panel {
         position = { 0, 0, 128, 128 },

         };
	};
}--]=]



--[=[fms_3d = subpanel {
    position = { (get(window_width)) - 286*coef , 346*coef , 276, 307 };
    noBackground = true;
    noClose = true;
    movable = true;
    clickable = true;
    noResize = false;
    components = {
		 fms_3d {
         position = { 0, 0, 276, 307 },

         };
	};
}--]=]


anim_menu = subpanel {
    position = {  (get(window_width)) - 310*coef, 10*coef , 268*coef, 165*coef };
    noBackground = true;
    noClose = true;
	noResize = true;
    movable = true;
	noVisible = true;
    clickable = true;
    components = {
		 anim_menu {
         position = { 0, 0, 268*coef, 165*coef },

         };
	};
}


cheklist_3d = subpanel {
    position = { 220*coef , get(window_height) - 263*coef , 419*coef, 243*coef };
    noBackground = true;
    noClose = true;
	noResize = false;
    movable = true;
	noVisible = true;
    clickable = true;
    components = {
		 cheklist_3d {
         position = { 0, 0, 419*coef, 243*coef },

         };
	};
}

mfd_panel = subpanel {
    position = { 164*coef , 185*coef , 318*coef, 167*coef };
    noBackground = true;
    noClose = true;
	noResize = false;
    movable = true;
	noVisible = true;
    clickable = true;
    components = {
		 mfd_panel {
         position = { 0, 0, 318*coef, 167*coef },

         };
	};
}

instrum_p = subpanel {
    position = {  (get(window_width)) - 200*coef , get(window_height) - 60*coef , 188*coef, 45*coef };
    noBackground = true;
    noClose = true;
	noResize = true;
    movable = true;
	noVisible = true;
    clickable = true;
    components = {
		 instrum_p {
         position = { 0, 0, 188*coef, 45*coef },

         };
	};

}

-- options panel--[=[
opts_p = subpanel {
    position = { 440*coef , 10*coef , 251*coef, 300*coef };
    noBackground = true;
    noClose = true;
	noResize = true;
    movable = true;
	noVisible = true;
    clickable = true;
    components = {
		 opts_p {
         position = { 0, 0, 251*coef, 300*coef },

         };
	};
}--]=]

eicas_3d = subpanel {
    position = { 10, 10, 144*coef, 288*coef };
    noBackground = true;
    noClose = true;
    movable = true;
    clickable = true;
    noResize = false;
    components = {
		 eicas_3d {
         position = { 0, 0, 144*coef, 288*coef },

         };
	};
}

infopanel = subpanel {
    position = { 140*coef , 650*coef, 10*coef, 10*coef };
    noBackground = true;
    noClose = true;
    movable = false;
    clickable = false;
    noResize = true;

    components = {
		 infopanel {
         position = { 0, 0, 10*coef, 10*coef },
         };
	};
}

components = {
-- aircraft logic
	aircraft_logic {},
	time_logic{},
	--]=]
   save_settings {}, -- JackZero: Added: Save several settings regardless of position saving
   save_position {},
-- position saving function
	mfd {
	position = {670, 1153, 670, 895}
	},
   sounds{},
	engine_sound{},
	engine_sound2{},
	apu_sound{},
	fms_clickzones {
	position = {0, 0, 462, 512}
	},--]=]
	pfd {
	position = {0, 1153, 670, 895}
	},--]=]
	--[=[cprefl {
	position = {1402, 1186, 575, 353}
	},--]=]

	eicas {
	position = {1150, 1646, 200, 400}
	},
	checklist {
	position = {1350, 1638, 698, 405}
	},
	misc_clickz {
	position = {0, 0, 2048, 2048}
	},
-- logic of panels
 panel_logic {
--	panel_2 = switches_menu,
	--panel_20 = fms_3d,
	panel_22 = blankpan,
	panel_21 = mainmenu,
    panel_3 = camerasmenu,
	panel_4 = preflightmenu,
	panel_5 = eicas_3d,
	panel_6 = anim_menu,
	panel_7 = cheklist_3d,
	panel_8 = mfd_panel,
	panel_9 = instrum_p,
	panel_11 = opts_p,
	panel_12 = infopanel,

 },--]=]
	fmc_proxy {}, -- JackZero: custom fmc proxy
	xhsi_proxy {}, -- JackZero: custom xhsi proxy
}




