dofile(LockOn_Options.script_path.."command_defs.lua")
dofile(LockOn_Options.script_path.."devices.lua")
dofile(LockOn_Options.script_path.."sounds.lua")

local gettext = require("i_18n")
_ = gettext.translate

cursor_mode = 
{ 
    CUMODE_CLICKABLE = 0,
    CUMODE_CLICKABLE_AND_CAMERA  = 1,
    CUMODE_CAMERA = 2,
};

clickable_mode_initial_status  = cursor_mode.CUMODE_CLICKABLE

direction                      = 1
cyclic_by_default              = true -- to cycle two-way thumblers or not by default

function default_button(hint_,device_,command_,arg_,arg_val_,arg_lim_)

	local   arg_val_ = arg_val_ or 1
	local   arg_lim_ = arg_lim_ or {0,1}

	return  {	
				class 				= {class_type.BTN},
				hint  				= hint_,
				device 				= device_,
				action 				= {command_},
				stop_action 		= {command_},
				arg 				= {arg_},
				arg_value			= {arg_val_}, 
				arg_lim 			= {arg_lim_},
				use_release_message = {true}
			}
end

function default_1_position_tumb(hint_, device_, command_, arg_, arg_val_, arg_lim_)
	local   arg_val_ = arg_val_ or 1
	local   arg_lim_ = arg_lim_ or {0,1}
	return  {	
				class 		= {class_type.TUMB},
				hint  		= hint_,
				device 		= device_,
				action 		= {command_},
				arg 	  	= {arg_},
				arg_value 	= {arg_val_}, 
				arg_lim   	= {arg_lim_},
				updatable 	= true, 
				use_OBB 	= true
			}
end

function default_2_position_tumb(hint_, device_, command_, arg_)
	return  {	
				class 		= {class_type.TUMB,class_type.TUMB},
				hint  		= hint_,
				device 		= device_,
				action 		= {command_,command_},
				arg 	  	= {arg_,arg_},
				arg_value 	= {1,-1}, 
				arg_lim   	= {{0,1},{0,1}},
				updatable 	= true, 
				use_OBB 	= true
			}
end

function tumb_cover(hint_, device_, command_, arg_)
	local element = default_2_position_tumb(hint_, device_, command_, arg_)
	element.sound = {{SOUND_COVER_CLOSE,SOUND_COVER_OPEN},{SOUND_COVER_CLOSE,SOUND_COVER_OPEN}}
	return element
end

function default_3_position_tumb(hint_,device_,command_,arg_,cycled_,inversed_, arg_value_, arg_limit_)
	local cycled = true
	local arg_limit = arg_limit_ or {-1,1}
	local arg_value = arg_value_ or 1
	
	if inversed_ then
		arg_value = -arg_value
	end
	
	if cycled_ ~= nil then
	   cycled = cycled_
	end
	return  {	
				class 		= {class_type.TUMB,class_type.TUMB},
				hint  		= hint_,
				device 		= device_,
				action 		= {command_,command_},
				arg 	  	= {arg_,arg_},
				arg_value 	= {-arg_value, arg_value},
				arg_lim   	= {arg_limit,arg_limit},
				updatable 	= true, 
				use_OBB 	= true,
				cycle       = cycled
			}
end

function default_axis(hint_,device_,command_,arg_, default_, gain_,updatable_,relative_)
	
	local default = default_ or 1
	local gain = gain_ or 0.1
	local updatable = updatable_ or false
	local relative  = relative_ or false
	
	return  {	
				class 		= {class_type.LEV},
				hint  		= hint_,
				device 		= device_,
				action 		= {command_},
				arg 	  	= {arg_},
				arg_value 	= {default}, 
				arg_lim   	= {{0,1}},
				updatable 	= updatable, 
				use_OBB 	= true,
				gain		= {gain},
				relative    = {relative}, 				
			}
end

function default_movable_axis(hint_,device_,command_,arg_, default_, gain_,updatable_,relative_)
	
	local default = default_ or 1
	local gain = gain_ or 0.1
	local updatable = updatable_ or false
	local relative  = relative_ or false
	
	return  {	
				class 		= {class_type.MOVABLE_LEV},
				hint  		= hint_,
				device 		= device_,
				action 		= {command_},
				arg 	  	= {arg_},
				arg_value 	= {default}, 
				arg_lim   	= {{0,1}},
				updatable 	= updatable, 
				use_OBB 	= true,
				gain		= {gain},
				relative    = {relative}, 				
			}
end

function default_axis_limited(hint_,device_,command_,arg_, default_, gain_,updatable_,relative_, arg_lim_)
	
	local relative = false
	local default = default_ or 0
	local updatable = updatable_ or false
	if relative_ ~= nil then
		relative = relative_
	end
	
	local arg_lim = arg_lim_ or {0.0,1.0}

	local gain = gain_ or 0.1
	return  {	
				class 		= {class_type.LEV},
				hint  		= hint_,
				device 		= device_,
				action 		= {command_},
				arg 	  	= {arg_},
				arg_value 	= {default}, 
				arg_lim   	= {arg_lim},
				updatable 	= updatable, 
				use_OBB 	= false,
				gain		= {gain},
				relative    = {relative},  
				cycle 		= false
			}
end


function multiposition_switch(hint_,device_,command_,arg_,count_,delta_,inversed_, min_)
    local min_   = min_ or 0
	local delta_ = delta_ or 0.5
	local inversed  = 1
	
	if	inversed_ then
		inversed = -1
	end
	
	return  {	
				class 		= {class_type.TUMB,class_type.TUMB},
				hint  		= hint_,
				device 		= device_,
				action 		= {command_,command_},
				arg 	  	= {arg_,arg_},
				arg_value 	= {-delta_ * inversed,delta_ * inversed}, 
				arg_lim   	= {{min_, min_ + delta_ * (count_ -1)},
							   {min_, min_ + delta_ * (count_ -1)}},
				updatable 	= true, 
				use_OBB 	= true
			}
end

function multiposition_switch_snd(hint_,device_,command_,arg_,count_,delta_,inversed_, min_)
    local element = multiposition_switch(hint_,device_,command_,arg_,count_,delta_,inversed_, min_)
	element.sound = {{SOUND_ROTARY_CW,SOUND_ROTARY_CCW},{SOUND_ROTARY_CW,SOUND_ROTARY_CCW}}
	return element
end

function multiposition_switch_limited(hint_,device_,command_,arg_,count_,delta_,inversed_,min_)
    local min_   = min_ or 0
	local delta_ = delta_ or 0.5
	
	local inversed = 1
	if	inversed_ then
		inversed = -1
	end
	
	return  {	
				class 		= {class_type.TUMB,class_type.TUMB},
				hint  		= hint_,
				device 		= device_,
				action 		= {command_,command_},
				arg 	  	= {arg_,arg_},
				arg_value 	= {-delta_ * inversed,delta_ * inversed}, 
				arg_lim   	= {{min_, min_ + delta_ * (count_ -1)},
							   {min_, min_ + delta_ * (count_ -1)}},
				updatable 	= true, 
				use_OBB 	= true,
				cycle     	= false, 
			}
end

function default_button_axis(hint_, device_,command_1, command_2, arg_1, arg_2, limit_1, limit_2)
	local limit_1_   = limit_1 or 1.0
	local limit_2_   = limit_2 or 1.0
return {
			class		=	{class_type.BTN, class_type.LEV},
			hint		=	hint_,
			device		=	device_,
			action		=	{command_1, command_2},
			stop_action =   {command_1, 0},
			arg			=	{arg_1, arg_2},
			arg_value	= 	{1, 0.0},
			arg_lim		= 	{{0, limit_1_}, {0,limit_2_}},
			gain = {0, 0.1},
			relative	= 	{false, false},
			updatable 	= 	true, 
			use_OBB 	= 	true,
			use_release_message = {true, false},
			cycle = false
	}
end

function default_animated_lever(hint_, device_, command_, arg_, animation_speed_,arg_lim_)
local arg_lim__ = arg_lim_ or {0.0,1.0}
return  {	
	class  = {class_type.TUMB, class_type.TUMB},
	hint   	= hint_, 
	device 	= device_,
	action 	= {command_, command_},
	arg 		= {arg_, arg_},
	arg_value 	= {1, 0},
	arg_lim 	= {arg_lim__, arg_lim__},
	updatable  = true, 
	gain 		= {0.1, 0.1},
	animated 	= {true, true},
	animation_speed = {animation_speed_, 0},
	cycle = true
}
end

function default_springloaded_tumb(hint_, device_, command1_, command2_, arg_)
	return  {	
				class 		= {class_type.BTN,class_type.TUMB},
				hint  		= hint_,
				device 		= device_,
				action 		= {command1_,command2_},
				stop_action = {command1_,command2_},
				arg 	  	= {arg_,arg_},
				arg_value 	= {-1,1}, 
				arg_lim   	= {{-1,0},{0,1}},
				updatable 	= true, 
				use_OBB 	= true,
				use_release_message = {true,true}
			}
end

function springloaded_3_pos_tumb(hint_, device_, command1_, command2_, arg_, val1_, val2_, val3_)
	local val1 = val1_ or -1.0
	local val2 = val2_ or 0.0
	local val3 = val3_ or 1.0
	return  {	
				class 		= {class_type.BTN,class_type.BTN},
				hint  		= hint_,
				device 		= device_,
				action 		= {command1_,command2_},
				stop_action = {command1_,command2_},
				arg 	  	= {arg_,arg_},
				arg_value 	= {val1,val3}, 
				arg_lim   	= {{val1,val2},{val2,val3}},
				updatable 	= true, 
				use_OBB 	= true,
				use_release_message = {true,true}
			}
end

function radio_wheel(hint_,device_,command1_,command2_,arg_)
	return  {
			 class  		 = {class_type.TUMB,class_type.TUMB}, 
			 hint   		 = hint_,
			 device 		 = device_,
			 action 		 = {command1_ ,command2_}, 
			 arg 			 = {arg_,arg_},
			 arg_value 		 = { -0.1, 0.1},
			 arg_lim   		 = {{0,0.9},{0,0.9}},
			 relative		 = {true,true},
			 animated        = {true,true},
			 animation_speed = {0.5, 0.5}
			}
end

function radio_wheel_arc(hint_,device_,command_,arg_,arg_value_,arg_lim_,speed_)
	return  {
			 class  		 = {class_type.TUMB,class_type.TUMB}, 
			 hint   		 = hint_,
			 device 		 = device_,
			 action 		 = {command_ ,command_}, 
			 arg 			 = {arg_,arg_},
			 arg_value 		 = arg_value_,
			 arg_lim   		 = {arg_lim_,arg_lim_},
			 relative		 = {false,false},
			 animated        = {true,true},
			 animation_speed = {speed_, speed_},
			 cycle 			 = false,
			 sound 			 = {{SOUND_ROTARY_1,SOUND_ROTARY_1},{SOUND_ROTARY_1,SOUND_ROTARY_1}}
			}
end


elements = {}

-----------------------------------------------------------------------------------------------
-- элементы управления кабины

-- Электросистема
elements["PTR-EEP-TMB-GEN1"]		= default_2_position_tumb(_("Generator 1 Switch, ON/OFF"), devices.ELEC_INTERFACE, device_commands.Button_15, 538)
elements["PTR-EEP-TMB-GEN2"]		= default_2_position_tumb(_("Generator 2 Switch, ON/OFF"), devices.ELEC_INTERFACE, device_commands.Button_16, 539)
elements["PTR-EEP-TMB-AER"]			= default_2_position_tumb(_("AC Ground Power Switch, ON/OFF"),devices.ELEC_INTERFACE, device_commands.Button_14, 540)
elements["PTR-EEP-TMB-PO"]			= default_3_position_tumb(_("115V Inverter Switch, MANUAL/OFF/AUTO"),devices.ELEC_INTERFACE, device_commands.Button_12, 541, false)
elements["PTR-EEP-TMB-PT"]			= default_3_position_tumb(_("36V Inverter Switch, MANUAL/OFF/AUTO"),devices.ELEC_INTERFACE, device_commands.Button_13, 542, false)
elements["PTR-EEP-LVR-MODE"]		= multiposition_switch_snd(_("AC Voltmeter Selector"), devices.ELEC_INTERFACE, device_commands.Button_17, 535, 11, 0.1)
elements["PTR-EEP-LVR-MODE"].cycle = false
elements["PTR-RSPE-LVR-FEEDMODE"]	= multiposition_switch_snd(_("DC Voltmeter Selector"), devices.ELEC_INTERFACE, device_commands.Button_8, 494, 8, 0.1)
elements["PTR-RSPE-LVR-FEEDMODE"].cycle = false
elements["PTR-RSPE-TMB-AKK1"]		= default_2_position_tumb(_("Battery 1 Switch, ON/OFF"), devices.ELEC_INTERFACE, device_commands.Button_3, 495)
elements["PTR-RSPE-TMB-AKK2"]		= default_2_position_tumb(_("Battery 2 Switch, ON/OFF"), devices.ELEC_INTERFACE, device_commands.Button_2, 496)
elements["PTR-RSPE-TMB-RESGEN"]		= default_2_position_tumb(_("Standby Generator Switch, ON/OFF"), devices.ELEC_INTERFACE, device_commands.Button_1, 497)
elements["PTR-RSPE-TMB-RECT1"]		= default_2_position_tumb(_("Rectifier 1 Switch, ON/OFF"), devices.ELEC_INTERFACE, device_commands.Button_7, 499)
elements["PTR-RSPE-TMB-RECT2"]		= default_2_position_tumb(_("Rectifier 2 Switch, ON/OFF"), devices.ELEC_INTERFACE, device_commands.Button_5, 500)
elements["PTR-RSPE-TMB-RECT3"]		= default_2_position_tumb(_("Rectifier 3 Switch, ON/OFF"), devices.ELEC_INTERFACE, device_commands.Button_6, 501)
elements["PTR-RSPE-TMB-AERF"]		= default_2_position_tumb(_("DC Ground Power Switch, ON/OFF"), devices.ELEC_INTERFACE, device_commands.Button_4, 502)
elements["PTR-RSPE-TMB-TESTEQU"]	= default_2_position_tumb(_("Equipment Test Switch, ON/OFF"), devices.ELEC_INTERFACE, device_commands.Button_9, 503)
elements["PTR-APP-CVR-CIRC"]		= tumb_cover(_("Net on Rectifier Switch Cover, OPEN/CLOSE"), devices.ELEC_INTERFACE, device_commands.Button_21, 147)
elements["PTR-APP-TMB-CIRC"]		= default_2_position_tumb(_("Net on Rectifier Switch, ON/OFF"), devices.ELEC_INTERFACE, device_commands.Button_19, 148)
elements["PTR-APP-TMB-TRNS"]		= default_3_position_tumb(_("36V Transformer Switch, MAIN/OFF/AUXILIARY"), devices.ELEC_INTERFACE, device_commands.Button_20, 149, false)
elements["PTR-RSPE-LVR-V"]			= default_axis_limited(_("Standby Generator Voltage Adjustment Rheostat"), devices.ELEC_INTERFACE, device_commands.Button_10, 498, 0.5, 0.1, false, false, {0, 1})
elements["PTR-EEP-LVR-ADJV1"]		= default_axis_limited(_("Generator 1 Voltage Adjustment Rheostat"), devices.ELEC_INTERFACE, device_commands.Button_11, 536, 0.5, 0.1, false, false, {0, 1})
elements["PTR-EEP-LVR-ADJV2"]		= default_axis_limited(_("Generator 2 Voltage Adjustment Rheostat"), devices.ELEC_INTERFACE, device_commands.Button_18, 537, 0.5, 0.1, false, false, {0, 1})

elements["PTR-RSPE-TMB-WRMAKK"]		= default_2_position_tumb(_("Battery Heating Switch, ON/OFF"), devices.ELEC_INTERFACE, cb_start_cmd + 75, 522)

-- Электросистема - АЗСы
-- AZS Left Panel Line 1
elements["PTR-LAZS-TMB-BV-ZSBR"]		= default_2_position_tumb(_("CB BW ESBR, ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd, 590)
elements["PTR-LAZS-TMB-BV-EXP"]			= default_2_position_tumb(_("CB Explode, ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 1, 591)
elements["PTR-LAZS-TMB-BV-DIR"]			= default_2_position_tumb(_("CB Control, ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 2, 592)
elements["PTR-LAZS-TMB-BV-EQU"]			= default_2_position_tumb(_("CB Equipment, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 3, 593)
elements["PTR-LAZS-TMB-RSGUV-FIRE"]		= default_2_position_tumb(_("CB RS/GUV Fire, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 4, 594)
elements["PTR-LAZS-TMB-RSGUV-SIGN"]		= default_2_position_tumb(_("CB RS/GUV Warning, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 5, 595)
elements["PTR-LAZS-TMB-RSGUV-WARM"]		= default_2_position_tumb(_("CB ESBR Heating, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 6, 596)
-- AZS Left Panel Line 2
elements["PTR-LAZS-TMB-311"]			= default_2_position_tumb(_("CB 311, ON/OFF"),							devices.ELEC_INTERFACE, cb_start_cmd + 7, 597)
elements["PTR-LAZS-TMB-GUOUT-800L"]		= default_2_position_tumb(_("CB GUV: Outer 800 Left, ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 8, 598)
elements["PTR-LAZS-TMB-GUOUT-800R"]		= default_2_position_tumb(_("CB GUV: Outer 800 Right, ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 9, 599)
elements["PTR-LAZS-TMB-GUOUTL-622L"]	= default_2_position_tumb(_("CB GUV: Inner Left 622 Left, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 10, 600)
elements["PTR-LAZS-TMB-GUOUTL-622R"]	= default_2_position_tumb(_("CB GUV: Inner Left 622 Right, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 11, 601)
elements["PTR-LAZS-TMB-GUOUTR-622L"]	= default_2_position_tumb(_("CB GUV: Inner Right 622 Left, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 12, 602)
elements["PTR-LAZS-TMB-GUOUTR-622R"]	= default_2_position_tumb(_("CB GUV: Inner Right 622 Right, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 13, 603)
-- AZS Left Panel Line 3
elements["PTR-LAZS-TMB-ES-800L"]		= default_2_position_tumb(_("CB Electric Launch 800 Left, ON/OFF"),				devices.ELEC_INTERFACE, cb_start_cmd + 14, 604)
elements["PTR-LAZS-TMB-ES-622R"]		= default_2_position_tumb(_("CB Electric Launch 800 Right, ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 15, 605)
elements["PTR-LAZS-TMB-PKT"]			= default_2_position_tumb(_("CB PKT, ON/OFF"),									devices.ELEC_INTERFACE, cb_start_cmd + 16, 606)
elements["PTR-LAZS-TMB-JETBOMB"]		= default_2_position_tumb(_("CB Emergency Jettison: Bombs and GUV, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 17, 607)
elements["PTR-LAZS-TMB-JETPWR"]			= default_2_position_tumb(_("CB Emergency Jettison: Power, ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 18, 608)
elements["PTR-LAZS-TMB-JETEXPL"]		= default_2_position_tumb(_("CB Emergency Jettison: Armed, ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 19, 609)
elements["PTR-LAZS-TMB-JETRCKT"]		= default_2_position_tumb(_("CB Signal Flare, ON/OFF"),							devices.ELEC_INTERFACE, cb_start_cmd + 20, 610)
-- AZS Right Panel Left Line 1
elements["PTR-RAZS-TMB-START-TRBON"]	= default_2_position_tumb(_("CB APU Start, ON/OFF"),					devices.ELEC_INTERFACE, cb_start_cmd + 21, 611)
elements["PTR-RAZS-TMB-START-TRBIGN"]	= default_2_position_tumb(_("CB APU Ignition, ON/OFF"),					devices.ELEC_INTERFACE, cb_start_cmd + 22, 612)
elements["PTR-RAZS-TMB-START-ENGON"]	= default_2_position_tumb(_("CB Engine Start, ON/OFF"),					devices.ELEC_INTERFACE, cb_start_cmd + 23, 613)
elements["PTR-RAZS-TMB-START-ENGIGN"]	= default_2_position_tumb(_("CB Engine Ignition, ON/OFF"),				devices.ELEC_INTERFACE, cb_start_cmd + 24, 614)
elements["PTR-RAZS-TMB-RPM"]			= default_2_position_tumb(_("CB RPM CONTROL, ON/OFF"),					devices.ELEC_INTERFACE, cb_start_cmd + 25, 615)
elements["PTR-NONAME"]					= default_2_position_tumb(_("CB NONAME, ON/OFF"),						devices.ELEC_INTERFACE, cb_start_cmd + 26, 616)
elements["PTR-SW-LOCKER-BASE"]			= default_2_position_tumb(_("CB Lock Opening Control Main, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 27, 617)
elements["PTR-SW-LOCKER-RES"]			= default_2_position_tumb(_("CB Lock Opening Control Reserve, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 28, 618)
elements["PTR-RAZS-TMB-TURN"]			= default_2_position_tumb(_("CB TURN INDICATOR, ON/OFF"),				devices.ELEC_INTERFACE, cb_start_cmd + 29, 619)
-- AZS Right Panel Left Line 2
elements["PTR-RAZS-TMB-TSCOCK-ON"]		= default_2_position_tumb(_("CB Fuel System: Bypass Valve, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 39, 629)
elements["PTR-RAZS-TMB-TSCOCK-L"]		= default_2_position_tumb(_("CB Fuel System: Left Valve, ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 40, 630)
elements["PTR-RAZS-TMB-TSCOCK-R"]		= default_2_position_tumb(_("CB Fuel System: Right Valve, ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 41, 631)
elements["PTR-RAZS-TMB-TSCOUNT"]		= default_2_position_tumb(_("CB Fuel System: Fuelmeter, ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 42, 632)
elements["PTR-RAZS-TMB-TSPMP-C"]		= default_2_position_tumb(_("CB Fuel System: Center Tank Pump, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 43, 633)
elements["PTR-RAZS-TMB-TSPMP-L"]		= default_2_position_tumb(_("CB Fuel System: Left Tank Pump, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 44, 634)
elements["PTR-RAZS-TMB-TSPMP-R"]		= default_2_position_tumb(_("CB Fuel System: Right Tank Pump, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 45, 635)
elements["PTR-RAZS-TMB-T819"]			= default_2_position_tumb(_("CB T-819, ON/OFF"),							devices.ELEC_INTERFACE, cb_start_cmd + 46, 636)
elements["PTR-RAZS-TMB-SPPU52"]			= default_2_position_tumb(_("CB SPUU-52, ON/OFF"),							devices.ELEC_INTERFACE, cb_start_cmd + 47, 637)
-- AZS Right Panel Left Line 3
elements["PTR-RAZS-TMB-HLGT-DIR-L"]		= default_2_position_tumb(_("CB Headlights: Left: Control, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 57, 647)
elements["PTR-RAZS-TMB-HLGT-ON-L"]		= default_2_position_tumb(_("CB Headlights: Left: Light, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 58, 648)
elements["PTR-RAZS-TMB-HLGT-DIR-R"]		= default_2_position_tumb(_("CB Headlights: Right: Control, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 59, 649)
elements["PTR-RAZS-TMB-HLGT-ON-R"]		= default_2_position_tumb(_("CB Headlights: Right: Light, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 60, 650)
elements["PTR-RAZS-TMB-ANO"]			= default_2_position_tumb(_("CB ANO, ON/OFF"),							devices.ELEC_INTERFACE, cb_start_cmd + 61, 651)
elements["PTR-RAZS-TMB-WNGLGT"]			= default_2_position_tumb(_("CB Wing Lights, ON/OFF"),					devices.ELEC_INTERFACE, cb_start_cmd + 62, 652)
elements["PTR-RAZS-TMB-LAMPTEST"]		= default_2_position_tumb(_("CB Check Lamps/Flasher, ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 63, 653)
elements["PTR-SW-LIGHT-PRF4-LEFT"]		= default_2_position_tumb(_("CB PRF-4 Light Left, ON/OFF"),				devices.ELEC_INTERFACE, cb_start_cmd + 64, 918)
elements["PTR-SW-LIGHT-PRF4-RIGHT"]		= default_2_position_tumb(_("CB PRF-4 Light Right, ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 65, 919)
-- AZS Right Panel Right Line 1
elements["PTR-RAZS-TMB-APMAIN"]			= default_2_position_tumb(_("CB Autopilot: Main, ON/OFF"),				devices.ELEC_INTERFACE, cb_start_cmd + 30, 620)
elements["PTR-RAZS-TMB-APFRICT"]		= default_2_position_tumb(_("CB Autopilot: Friction, ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 31, 621)
elements["PTR-RAZS-TMB-APELCT"]			= default_2_position_tumb(_("CB Autopilot: Electric Clutches, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 32, 622)
elements["PTR-RAZS-TMB-GSMAIN"]			= default_2_position_tumb(_("CB Hydraulics: Main, ON/OFF"),				devices.ELEC_INTERFACE, cb_start_cmd + 33, 623)
elements["PTR-RAZS-TMB-GSDBL"]			= default_2_position_tumb(_("CB Hydraulics: Auxiliary, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 34, 624)
elements["PTR-RAZS-TMB-RADSPU"]			= default_2_position_tumb(_("CB Radio: SPU (Intercom), ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 35, 625)
elements["PTR-RAZS-TMB-RADALT"]			= default_2_position_tumb(_("CB Radio: Altimeter, ON/OFF"),				devices.ELEC_INTERFACE, cb_start_cmd + 36, 626)
elements["PTR-RAZS-TMB-RADCOMM"]		= default_2_position_tumb(_("CB Radio: Command Radio Station (R-863), ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 37, 627)
elements["PTR-RAZS-TMB-RADRS"]			= default_2_position_tumb(_("CB Radio: 6201, ON/OFF"),					devices.ELEC_INTERFACE, cb_start_cmd + 38, 628)
-- AZS Right Panel Right Line 2
elements["PTR-RAZS-TMB-PPSSIGN"]		= default_2_position_tumb(_("CB Fire Protection System: Signalization, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 48, 638)
elements["PTR-RAZS-TMB-PPSQUE1-L"]		= default_2_position_tumb(_("CB Fire Protection System: 1 Queue Left, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 49, 639)
elements["PTR-RAZS-TMB-PPSQUE1-R"]		= default_2_position_tumb(_("CB Fire Protection System: 1 Queue Right, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 50, 640)
elements["PTR-RAZS-TMB-PPSQUE2-L"]		= default_2_position_tumb(_("CB Fire Protection System: 2 Queue Left, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 51, 641)
elements["PTR-RAZS-TMB-PPSQUE2-R"]		= default_2_position_tumb(_("CB Fire Protection System: 2 Queue Right, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 52, 642)
elements["PTR-RAZS-TMB-RADCMP-SV"]		= default_2_position_tumb(_("CB Radio: Radio Compass MW(ARC-9), ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 53, 643)
elements["PTR-RAZS-TMB-RADCMP-UKV"]		= default_2_position_tumb(_("CB Radio: Radio Compass VHF(ARC-UD), ON/OFF"),			devices.ELEC_INTERFACE, cb_start_cmd + 54, 644)
elements["PTR-RAZS-TMB-RADDISS"]		= default_2_position_tumb(_("CB Radio: Doppler Navigator, ON/OFF"),					devices.ELEC_INTERFACE, cb_start_cmd + 55, 645)
elements["PTR-RAZS-TMB-RADRNTG"]		= default_2_position_tumb(_("CB Radio: Radio Meter, ON/OFF"),						devices.ELEC_INTERFACE, cb_start_cmd + 56, 646)
-- AZS Right Panel Right Line 3
elements["PTR-RAZS-TMB-POSDIR"]			= default_2_position_tumb(_("CB Defrost System: Control, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 66, 656)
elements["PTR-RAZS-TMB-POSPZUENG-L"]	= default_2_position_tumb(_("CB Defrost System: Left Engine, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 67, 657)
elements["PTR-RAZS-TMB-POSPZUENG-R"]	= default_2_position_tumb(_("CB Defrost System: Right Engine, ON/OFF"),	devices.ELEC_INTERFACE, cb_start_cmd + 68, 658)
elements["PTR-RAZS-TMB-POSRIO3"]		= default_2_position_tumb(_("CB Defrost System: RIO-3, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 69, 659)
elements["PTR-RAZS-TMB-POSGLS"]			= default_2_position_tumb(_("CB Defrost System: Glass, ON/OFF"),		devices.ELEC_INTERFACE, cb_start_cmd + 70, 660)
elements["PTR-RAZS-TMB-WIPER-L"]		= default_2_position_tumb(_("CB Wiper Left, ON/OFF"),					devices.ELEC_INTERFACE, cb_start_cmd + 71, 661)
elements["PTR-RAZS-TMB-WIPER-R"]		= default_2_position_tumb(_("CB Wiper Right, ON/OFF"),					devices.ELEC_INTERFACE, cb_start_cmd + 72, 662)
elements["PTR-RAZS-TMB-L1800"]			= default_2_position_tumb(_("CB RIO-3, ON/OFF"),						devices.ELEC_INTERFACE, cb_start_cmd + 73, 663)
elements["PTR-RAZS-TMB-KO50"]			= default_2_position_tumb(_("CB Heater KO-50, ON/OFF"),					devices.ELEC_INTERFACE, cb_start_cmd + 74, 664)
--
elements["PTR-GRAZS-1"]		= default_button(_("CB Group 1 ON"),devices.ELEC_INTERFACE, device_commands.Button_22, 882)
elements["PTR-GRAZS-1"].sound = {{SOUND_NOSOUND,SOUND_CB_ON}}
elements["PTR-GRAZS-2"]		= default_button(_("CB Group 4 ON"),devices.ELEC_INTERFACE, device_commands.Button_25, 883)
elements["PTR-GRAZS-2"].sound = {{SOUND_NOSOUND,SOUND_CB_ON}}
elements["PTR-GRAZS-3"]		= default_button(_("CB Group 7 ON"),devices.ELEC_INTERFACE, device_commands.Button_28, 884)
elements["PTR-GRAZS-3"].sound = {{SOUND_NOSOUND,SOUND_CB_ON}}
elements["PTR-GRAZS-4"]		= default_button(_("CB Group 2 ON"),devices.ELEC_INTERFACE, device_commands.Button_23, 885)
elements["PTR-GRAZS-4"].sound = {{SOUND_NOSOUND,SOUND_CB_ON}}
elements["PTR-GRAZS-5"]		= default_button(_("CB Group 5 ON"),devices.ELEC_INTERFACE, device_commands.Button_26, 886)
elements["PTR-GRAZS-5"].sound = {{SOUND_NOSOUND,SOUND_CB_ON}}
elements["PTR-GRAZS-6"]		= default_button(_("CB Group 8 ON"),devices.ELEC_INTERFACE, device_commands.Button_29, 887)
elements["PTR-GRAZS-6"].sound = {{SOUND_NOSOUND,SOUND_CB_ON}}
elements["PTR-GRAZS-7"]		= default_button(_("CB Group 3 ON"),devices.ELEC_INTERFACE, device_commands.Button_24, 888)
elements["PTR-GRAZS-7"].sound = {{SOUND_NOSOUND,SOUND_CB_ON}}
elements["PTR-GRAZS-8"]		= default_button(_("CB Group 6 ON"),devices.ELEC_INTERFACE, device_commands.Button_27, 889)
elements["PTR-GRAZS-8"].sound = {{SOUND_NOSOUND,SOUND_CB_ON}}
elements["PTR-GRAZS-9"]		= default_button(_("CB Group 9 ON"),devices.ELEC_INTERFACE, device_commands.Button_30, 890)
elements["PTR-GRAZS-9"].sound = {{SOUND_NOSOUND,SOUND_CB_ON}}

--топливная система
elements["PTR-CPE-TMB-PUMP-RATE"]	= default_2_position_tumb(_("Feed Tank Pump Switch, ON/OFF"),		devices.FUELSYS_INTERFACE, device_commands.Button_6, 438)
elements["PTR-CPE-TMB-PUMPTNK-L"]	= default_2_position_tumb(_("Left Tank Pump Switch, ON/OFF"),		devices.FUELSYS_INTERFACE, device_commands.Button_3, 439)
elements["PTR-CPE-TMB-PUMPTNK-R"]	= default_2_position_tumb(_("Right Tank Pump Switch, ON/OFF"),		devices.FUELSYS_INTERFACE, device_commands.Button_5, 440)
elements["PTR-CPE-TMB-PUMP-L"]		= default_2_position_tumb(_("Left Shutoff Valve Switch, ON/OFF"),	devices.FUELSYS_INTERFACE, device_commands.Button_1, 427)
elements["PTR-CPE-TMB-PUMP-R"]		= default_2_position_tumb(_("Right Shutoff Valve Switch, ON/OFF"),	devices.FUELSYS_INTERFACE, device_commands.Button_2, 429)
elements["PTR-CPE-CVR-PUMP-L"]		= tumb_cover(_("Left Shutoff Valve Switch Cover, OPEN/CLOSE"),		devices.FUELSYS_INTERFACE, device_commands.Button_9, 426)
elements["PTR-CPE-CVR-PUMP-R"]		= tumb_cover(_("Right Shutoff Valve Switch Cover, OPEN/CLOSE"),		devices.FUELSYS_INTERFACE, device_commands.Button_10, 428)
elements["PTR-CPE-TMB-PUMP-RING"]	= default_2_position_tumb(_("Crossfeed Switch, ON/OFF"),			devices.FUELSYS_INTERFACE, device_commands.Button_4, 431)
elements["PTR-CPE-CVR-PUMP-RING"]	= tumb_cover(_("Crossfeed Switch Cover, OPEN/CLOSE"),				devices.FUELSYS_INTERFACE, device_commands.Button_11, 430)
elements["PTR-CPE-TMB-PUMP-PASS"]	= default_2_position_tumb(_("Bypass Switch, ON/OFF"),				devices.FUELSYS_INTERFACE, device_commands.Button_7, 433)
elements["PTR-CPE-CVR-PUMP-PASS"]	= tumb_cover(_("Bypass Switch Cover, OPEN/CLOSE"),					devices.FUELSYS_INTERFACE, device_commands.Button_12, 432)
elements["PTR-CPE-TMB-PUMP-CONTR"]	= default_3_position_tumb(_("Refueling Control Switch, REFUEL/OFF/CHECK"),	devices.FUELSYS_INTERFACE, device_commands.Button_14, 437, false, false, 0.5, {0,1})

--панель запуска двигателей
-- APU Launch Panel
elements["PTR-CPE-TMB-TURBOSTART-ST"]	= default_3_position_tumb(_("APU Start Mode Switch, START/COLD CRANKING/FALSE START"), devices.ENGINE_INTERFACE, device_commands.Button_12, 412, false)
elements["PTR-CPE-BTN-TURBOSTART-ON"]	= default_button(_("APU Start Button - Push to start APU"), devices.ENGINE_INTERFACE, device_commands.Button_26, 413)
elements["PTR-CPE-BTN-TURBOSTART-ON"].sound = {{SOUND_ENG_BTN_OFF,SOUND_ENG_BTN_ON}}
elements["PTR-CPE-BTN-TURBOSTART-OFF"]	= default_button(_("APU Stop Button - Push to stop APU"), devices.ENGINE_INTERFACE, device_commands.Button_7, 415)
elements["PTR-CPE-BTN-TURBOSTART-OFF"].sound = {{SOUND_ENG_BTN_OFF,SOUND_ENG_BTN_ON}}
-- Engines Launch Panel
elements["PTR-CPE-BTN-ENGSTART-ON"]		= default_button(_("Engine Start Button - Push to start engine"), devices.ENGINE_INTERFACE, device_commands.Button_5, 419)
elements["PTR-CPE-BTN-ENGSTART-ON"].sound = {{SOUND_ENG_BTN_OFF,SOUND_ENG_BTN_ON}}
elements["PTR-CPE-BTN-ENGSTART-OFF"]	= default_button(_("Abort Start Engine Button - Push to abort start"), devices.ENGINE_INTERFACE, device_commands.Button_6, 421)
elements["PTR-CPE-BTN-ENGSTART-OFF"].sound = {{SOUND_ENG_BTN_OFF,SOUND_ENG_BTN_ON}}
elements["PTR-CPE-TMB-ENGSTART-LFTRGT"]	= default_3_position_tumb(_("Engine Selector Switch, LEFT/OFF/RIGHT"), devices.ENGINE_INTERFACE, device_commands.Button_8, 422, false)
elements["PTR-CPE-TMB-ENGSTART-ROLL"]	= default_3_position_tumb(_("Engine Start Mode Switch, START/OFF/COLD CRANKING"), devices.ENGINE_INTERFACE, device_commands.Button_27, 423, false)
elements["PTR-CPE-TMB-ENGSTART-TEST"]	= springloaded_3_pos_tumb(_("Engine Ignition Check Switch, LEFT/OFF/RIGHT"), devices.ENGINE_INTERFACE, device_commands.Button_74, device_commands.Button_74, 425, -1, 0, 1)

--управление двигателем
elements["PTR-ENGSTOP-ARM-L"]	= default_2_position_tumb(_("Left Engine Stop Lever"), devices.ENGINE_INTERFACE, device_commands.Button_9, 204)
elements["PTR-ENGSTOP-ARM-L"].sound = {{SOUND_ENG_SOFF_ON,SOUND_ENG_SOFF_OFF},{SOUND_ENG_SOFF_ON,SOUND_ENG_SOFF_OFF}}
elements["PTR-ENGSTOP-ARM-R"]	= default_2_position_tumb(_("Right Engine Stop Lever"), devices.ENGINE_INTERFACE, device_commands.Button_10, 206)
elements["PTR-ENGSTOP-ARM-R"].sound = {{SOUND_ENG_SOFF_ON,SOUND_ENG_SOFF_OFF},{SOUND_ENG_SOFF_ON,SOUND_ENG_SOFF_OFF}}
elements["PTR-VINTBRAKE-ARM"]	= default_2_position_tumb(_("Rotor Brake Handle, UP/DOWN"), devices.ENGINE_INTERFACE, device_commands.Button_11, 208)
elements["PTR-VINTBRAKE-ARM"].sound = {{SOUND_ROT_BR_DOWN,SOUND_ROT_BR_UP},{SOUND_ROT_BR_DOWN,SOUND_ROT_BR_UP}}

elements["PTR-LSPE-BTN-CONTR-IV500"]	= default_button(_("Vibration Sensor Test Button - Push to test"), devices.ENGINE_INTERFACE, device_commands.Button_21, 310)
elements["PTR-LSPE-BTN-CONTR-GRND"]		= default_button(_("Cold Temperature Sensor Test Button - Push to test"), devices.ENGINE_INTERFACE, device_commands.Button_23, 311)
elements["PTR-LSPE-BTN-CONTR-AIR"]		= default_button(_("Hot Temperature Sensor Test Button - Push to test"), devices.ENGINE_INTERFACE, device_commands.Button_22, 312)
elements["PTR-LSPE-BTN-CONTR-RTL"]		= default_button(_("Left Engine Temperature Regulator Test Button - Push to test"), devices.ENGINE_INTERFACE, device_commands.Button_19, 313)
elements["PTR-LSPE-BTN-CONTR-RTR"]		= default_button(_("Right Engine Temperature Regulator Test Button - Push to test"), devices.ENGINE_INTERFACE, device_commands.Button_20, 314)

elements["PTR-STKSGR-TMB-RPM-LEFT"]		= springloaded_3_pos_tumb(_("Readjust Free Turbine RPM Switch, MORE/OFF/LESS"), devices.ENGINE_INTERFACE, device_commands.Button_63, device_commands.Button_63, 202, -1, 0, 1)
elements["PTR-STKSGR-TMB-RPM-LEFT"].updatable = true
elements["PTR-STKSGR-TMB-RPM-RIGHT"]	= springloaded_3_pos_tumb(_("Readjust Free Turbine RPM Switch, MORE/OFF/LESS"), devices.ENGINE_INTERFACE, device_commands.Button_64, device_commands.Button_64, 867, -1, 0, 1)
elements["PTR-STKSGR-TMB-RPM-RIGHT"].updatable = true

elements["PTR-STKSEC-ARM-L"]	= default_axis_limited(_("Left Engine Throttle"),	devices.ENGINE_INTERFACE, device_commands.Button_71, 0, 0.0, 0.2, true, true, {-1, 1})
elements["PTR-STKSEC-ARM-L"].use_OBB = true
elements["PTR-STKSEC-ARM-R"]	= default_axis_limited(_("Right Engine Throttle"),	devices.ENGINE_INTERFACE, device_commands.Button_72, 0, 0.0, 0.2, true, true, {-1, 1})
elements["PTR-STKSEC-ARM-R"].use_OBB = true

elements["PKT-TROTTLE_L"]	= {
			class		= {class_type.LEV, class_type.LEV},
			hint		= _("Collective (LMB press, hold and move) / Throttle (RMB press, hold and move)"),
			device		= devices.ENGINE_INTERFACE,
			action		= {device_commands.Button_69, device_commands.Button_67},
			stop_action = {device_commands.Button_69, device_commands.Button_67},
			arg			= {0, 0},
			arg_value	= {0.0, 0.0},
			arg_lim		= {{-1, 1}, {-1, 1}},
			gain		= {0.1, 0.1},
			relative	= {true, true},
			updatable 	= true, 
			use_OBB 	= true,
			use_release_message	= {false, false},
			cycle		= false
}
elements["PKT-TROTTLE_R"]	= {
			class		= {class_type.LEV, class_type.LEV},
			hint		= _("Collective (LMB press, hold and move) / Throttle (RMB press, hold and move)"),
			device		= devices.ENGINE_INTERFACE,
			action		= {device_commands.Button_70, device_commands.Button_68},
			stop_action = {device_commands.Button_70, device_commands.Button_68},
			arg			= {0, 0},
			arg_value	= {0.0, 0.0},
			arg_lim		= {{-1, 1}, {-1, 1}},
			gain		= {0.1, 0.1},
			relative	= {true, true},
			updatable 	= true, 
			use_OBB 	= true,
			use_release_message	= {false, false},
			cycle		= false
}

-- пульт ЭРД-3В
elements["PTR-APP-TMB-ERD-L"]	= default_2_position_tumb(_("Left Engine EEC Switch, ON/OFF"), devices.ENGINE_INTERFACE, device_commands.Button_1, 167)
elements["PTR-APP-TMB-ERD-R"]	= default_2_position_tumb(_("Right Engine EEC Switch, ON/OFF"), devices.ENGINE_INTERFACE, device_commands.Button_3, 173)
elements["PTR-APP-TMB-CHR-L"]	= default_2_position_tumb(_("Left Engine ER Switch, ON/OFF"), devices.ENGINE_INTERFACE, device_commands.Button_52, 168)
elements["PTR-APP-TMB-CHR-R"]	= default_2_position_tumb(_("Right Engine ER Switch, ON/OFF"), devices.ENGINE_INTERFACE, device_commands.Button_53, 172)
elements["PTR-APP-TMB-ST-L"]	= springloaded_3_pos_tumb(_("Left Engine FT Check Switch, ST1/WORK/ST2"), devices.ENGINE_INTERFACE, device_commands.Button_50, device_commands.Button_50, 169)
elements["PTR-APP-TMB-ST-R"]	= springloaded_3_pos_tumb(_("Right Engine FT Check Switch, ST1/WORK/ST2"), devices.ENGINE_INTERFACE, device_commands.Button_51, device_commands.Button_51, 171)
elements["PTR-APP-TMB-TKLR"]	= springloaded_3_pos_tumb(_("CT Check Switch, RIGHT/WORK/LEFT"), devices.ENGINE_INTERFACE, device_commands.Button_54, device_commands.Button_54, 170)

-- гидросистема
elements["PTR-CPE-TMB-HYDRO-MAIN"]	= default_2_position_tumb(_("Main Hydraulic Switch, ON/OFF"), devices.HYDRO_SYS_INTERFACE, device_commands.Button_1, 406)
elements["PTR-CPE-TMB-HYDRO-DBL"]	= default_2_position_tumb(_("Auxiliary Hydraulic Switch, ON/OFF"), devices.HYDRO_SYS_INTERFACE, device_commands.Button_2, 410)
elements["PTR-CPE-CVR-HYDRO-DBL"]	= tumb_cover(_("Auxiliary Hydraulic Switch Cover, OPEN/CLOSE"), devices.HYDRO_SYS_INTERFACE, device_commands.Button_6, 409)
elements["PTR-CPE-BTN-DBLOFF"]		= default_button(_("Auxiliary Hydraulic Shut Off Button - Push to shut off"), devices.HYDRO_SYS_INTERFACE, device_commands.Button_3, 411)

-- автопилот
elements["PTR-APP-BTN-DIRON"]	= default_button_axis(_("Autopilot Heading ON Button/Lamp Intensity Knob. Rotate mouse wheel to set lamp intensity"),		devices.AUTOPILOT, device_commands.Button_3, device_commands.Button_19, 134, 868, 1.0, 0.2)
elements["PTR-APP-BTN-DIROFF"]	= default_button_axis(_("Autopilot Heading OFF Button/Lamp Intensity Knob. Rotate mouse wheel to set lamp intensity"),		devices.AUTOPILOT, device_commands.Button_5, device_commands.Button_20, 135, 869, 1.0, 0.2)
elements["PTR-APP-BTN-KTON"]	= default_button_axis(_("Autopilot Pitch/Roll ON Button/Lamp Intensity Knob. Rotate mouse wheel to set lamp intensity"),	devices.AUTOPILOT, device_commands.Button_2, device_commands.Button_21, 138, 870, 1.0, 0.2)
elements["PTR-APP-BTN-ALTON"]	= default_button_axis(_("Autopilot Altitude ON Button/Lamp Intensity Knob. Rotate mouse wheel to set lamp intensity"),		devices.AUTOPILOT, device_commands.Button_1, device_commands.Button_22, 144, 871, 1.0, 0.2)
elements["PTR-APP-BTN-ALTOFF"]	= default_button_axis(_("Autopilot Altitude OFF Button/Lamp Intensity Knob. Rotate mouse wheel to set lamp intensity"),		devices.AUTOPILOT, device_commands.Button_4, device_commands.Button_23, 145, 872, 1.0, 0.2)
elements["PTR-APP-BTN-CONTR"]	= default_springloaded_tumb(_("Autopilot Altitude Channel Control (Right Button - UP; Left Button - Down)"), devices.AUTOPILOT, device_commands.Button_7, device_commands.Button_6, 146)
elements["PTR-APP-LVR-DIR"] 	= default_axis(_("Autopilot Heading Adjustment Knob"),	devices.AUTOPILOT, device_commands.Button_9, 136, 1, 0.1, false, true)
elements["PTR-APP-LVR-K"] 		= default_axis(_("Autopilot Roll Adjustment Knob"),		devices.AUTOPILOT, device_commands.Button_8, 140, 1, 0.1, false, true)
elements["PTR-APP-LVR-T"] 		= default_axis(_("Autopilot Pitch Adjustment Knob"),	devices.AUTOPILOT, device_commands.Button_10, 142, 1, 0.1, false, true)
elements["PTR-AUTOPILOT-OFF-L"]		= default_button(_("Autopilot Off Left Button"), devices.AUTOPILOT, device_commands.Button_29, 183)
elements["PTR-AUTOPILOT-OFF-L"].updatable = true
elements["PTR-AUTOPILOT-OFF-R"]		= default_button(_("Autopilot Off Right Button"), devices.AUTOPILOT, device_commands.Button_30, 226)
elements["PTR-AUTOPILOT-OFF-R"].updatable = true
elements["PTR-TRIMMER-ON-L"]		= default_button(_("Trimmer Left Button"), devices.AUTOPILOT, device_commands.Button_31, 184)
elements["PTR-TRIMMER-ON-L"].updatable = true
elements["PTR-TRIMMER-ON-R"]		= default_button(_("Trimmer Right Button"), devices.AUTOPILOT, device_commands.Button_32, 227)
elements["PTR-TRIMMER-ON-R"].updatable = true


-- радиовысотомер
elements["PTR-ALTR-LVR-TEST"] = {
			class = {class_type.BTN},
			hint = _("Radio Altimeter Test Button - Push to test"),
			device = devices.RADAR_ALTIMETER,
			action = {device_commands.Button_2},
			stop_action = {device_commands.Button_2},
			is_repeatable = {},
			arg = {32},
			arg_value = {1.0},
			arg_lim = {{0, 1}},
			use_release_message = {true}
}
elements["PTR-ALTR-LVR-SET"] = {
			class = {class_type.LEV},
			hint = _("Dangerous RALT Knob"),
			device = devices.RADAR_ALTIMETER,
			action = {device_commands.Button_1},
			arg = {29},
			arg_value = {0.1},
			arg_lim = {{0, 1}},
			relative = {true},
			gain = {0.1}
}
elements["PTR-ALTR-TMB-ONOFF"] 	= default_2_position_tumb(_("Radar Altimeter Power Switch, ON/OFF"), devices.RADAR_ALTIMETER, device_commands.Button_3, 35)

-- барометрический высотомер
elements["PTR-ALTB-LVR-SET"] 	= default_axis(_("Baro Pressure QFE Knob"), devices.BAR_ALTIMETER_L, device_commands.Button_1, 18, 1, 0.6, false, true)
elements["PTR-ALTB-LVR-SET-R"] 	= default_axis(_("Baro Pressure QFE Knob"), devices.BAR_ALTIMETER_R, device_commands.Button_1, 97, 1, 0.6, false, true)

-- Вариометр
elements["PTR-VARIO-LVR-SET-L"] 	= default_axis(_("Variometer Adjustment Knob"), devices.VARIOMETER_L, device_commands.Button_1, 17, 1, 0.1, false, true)
elements["PTR-VARIO-LVR-SET-R"] 	= default_axis(_("Variometer Adjustment Knob"), devices.VARIOMETER_R, device_commands.Button_1, 96, 1, 0.1, false, true)

-- HSI
elements["PTR-PNP-LVR-SET"]	  	= default_axis(_("HSI Course Set Knob"), devices.HSI_L, device_commands.Button_1, 26, 0.0, 0.3, false, true)
elements["PTR-ARKSV-ARKUKV"]	= default_2_position_tumb(_("HSI Radio Compass Selector Switch, ARC-9/ARC-UD"), devices.HSI_L, device_commands.Button_3, 858)
elements["PTR-PNP-LVR-SET-R"]	= default_axis(_("HSI Course Set Knob"),devices.HSI_R, device_commands.Button_1, 102, 0.0, 0.3, false, true)

--топливомер
elements["PTR-FUEL-LVR-MODE"]	= multiposition_switch_snd(_("Fuel Meter Switch, OFF/SUM/LEFT/RIGHT/FEED/ADDITIONAL"), devices.FUELSYS_INTERFACE, device_commands.Button_8, 61, 6, 0.1)
elements["PTR-FUEL-LVR-MODE"].cycle = true

--СУВ
elements["PTR-SAFE-WEAPON"]		  = default_2_position_tumb(_("Weapon Safe/Armed Switch, ON/OFF"), devices.WEAPON_SYS, device_commands.Button_27, 921)
elements["PTR-SAFE-WEAPON"].sound = {{SOUND_WEAP_ARM,SOUND_WEAP_ARM},{SOUND_WEAP_ARM,SOUND_WEAP_ARM}}

elements["PTR-ADDPBV-TMB-EMRGEXP"]		= default_2_position_tumb(_("Emergency Explode Switch, ON/OFF"), devices.WEAPON_SYS, device_commands.Button_7, 707)
elements["PTR-ADDPBV-CVR-EMRGEXP"]		= tumb_cover(_("Emergency Explode Switch Cover, OPEN/CLOSE"), devices.WEAPON_SYS, device_commands.Button_49, 706)
elements["PTR-ADDPBV-TMB-EMRGJET"]		= default_button(_("Emergency Bomb Release Switch, ON/OFF"), devices.WEAPON_SYS, device_commands.Button_32, 709)
elements["PTR-ADDPBV-CVR-EMRGJET"]		= tumb_cover(_("Emergency Bomb Release Switch Cover, OPEN/CLOSE"), devices.WEAPON_SYS, device_commands.Button_50, 708)
elements["PTR-ADDPBV-TMB-MAINOFF"]		= default_2_position_tumb(_("Main Bombs Switch, ON/OFF"), devices.WEAPON_SYS, device_commands.Button_2, 717)
elements["PTR-ADDPBV-BTN-LAMPTEST"]		= default_button(_("Lamps Check Button - Push to check"), devices.WEAPON_SYS, device_commands.Button_14, 718)
elements["PTR-ADDPBV-BTN-LAMPTEST"].sound = {{SOUND_CHECK_L_ON,SOUND_CHECK_L_OFF}}
elements["PTR-ADDPBV-LVR-MODE"]			= multiposition_switch_snd(_("Pod Variants Selector Switch"), devices.WEAPON_SYS, device_commands.Button_13, 719, 6, 0.1)
elements["PTR-ADDPBV-LVR-MODE"].cycle 	= false
elements["PTR-ADDPBV-TMB-WARM"]			= default_2_position_tumb(_("ESBR Heating Switch, ON/OFF"), devices.WEAPON_SYS, device_commands.Button_12, 720)

elements["PTR-ADDESBR-LVR-MODE"]		= multiposition_switch(_("ESBR Position Selector Switch"), devices.WEAPON_SYS, device_commands.Button_29, 730, 16, 0.0555)
elements["PTR-ADDESBR-LVR-ONOFF"]		= default_2_position_tumb(_("ESBR Switch, ON/OFF"), devices.WEAPON_SYS, device_commands.Button_28, 731)

elements["PTR-LAZS-TMB-EMRGEXP"]		= default_2_position_tumb(_("Emergency Explode Switch, ON/OFF"), devices.WEAPON_SYS, device_commands.Button_4, 570)
elements["PTR-LAZS-TMB-EMRGJET"]		= default_button(_("Emergency Release Switch"), devices.WEAPON_SYS, device_commands.Button_5, 572)
elements["PTR-LAZS-CVR-EMRGEXP"]		= tumb_cover(_("Emergency Explode Switch Cover, OPEN/CLOSE"), devices.WEAPON_SYS, device_commands.Button_51, 569)
elements["PTR-LAZS-CVR-EMRGJET"]		= tumb_cover(_("Emergency Release Switch Cover, OPEN/CLOSE"), devices.WEAPON_SYS, device_commands.Button_52, 571)

elements["PTR-LAZS-TMB-RSGUV"]			= default_2_position_tumb(_("RS/GUV Selector Switch, ON/OFF"), devices.WEAPON_SYS, device_commands.Button_30, 575)
elements["PTR-LAZS-BTN-LAMPTEST"]		= default_button(_("Lamps Check Button - Push to check"), devices.WEAPON_SYS, device_commands.Button_26, 576)
elements["PTR-LAZS-BTN-ENTER"]			= default_button(_("PUS Arming Button - Push to arm"), devices.WEAPON_SYS, device_commands.Button_31, 574)

elements["PTR-LPE-TMB-SHOOT1"]			= default_3_position_tumb(_("8/16/4 Switch"), devices.WEAPON_SYS, device_commands.Button_20, 342)
elements["PTR-LPE-TMB-SHOOT2"]			= default_3_position_tumb(_("1-2-5-6/AUTO/3-4 Switch"), devices.WEAPON_SYS, device_commands.Button_21, 343)
elements["PTR-LPE-TMB-RS"]				= default_3_position_tumb(_("UPK/PKT/RS Switch"), devices.WEAPON_SYS, device_commands.Button_22, 344)
elements["PTR-LPE-TMB-GUV"]				= default_3_position_tumb(_("CUTOFF Switch, ON/OFF"), devices.WEAPON_SYS, device_commands.Button_6, 345)
elements["PTR-LAZS-TMB-MAINOFF05"]		= default_2_position_tumb(_("800_or_624_622_800 Switch"), devices.WEAPON_SYS, device_commands.Button_41, 349)
elements["PTR-LAZS-CVR-EMRGEXP01"]		= tumb_cover(_("800 or 624_622_800 Switch Cover, OPEN/CLOSE"), devices.WEAPON_SYS, device_commands.Button_53, 348)
elements["PTR-LPE-TMB-VAR"]				= multiposition_switch(_("In800Out/800inOr624/622 Switch"), devices.WEAPON_SYS, device_commands.Button_42, 347, 4, 0.1)
elements["PTR-LPE-LVR-SHELL"]			= default_axis_limited(_("Burst Length Knob"), devices.WEAPON_SYS, device_commands.Button_43, 346, 0.0, 0.1, false, false, {0, 1})
elements["PTR-LPE-TMB-PYRO-L"]			= multiposition_switch(_("Left PYROCARTRIDGE Switch, I/II/III"), devices.WEAPON_SYS, device_commands.Button_44, 350, 4, 0.1)
elements["PTR-LPE-TMB-PYRO-R"]			= multiposition_switch(_("Right PYROCARTRIDGE Switch, I/II/III"), devices.WEAPON_SYS, device_commands.Button_45, 351, 4, 0.1)

elements["PTR-LAZS-TMB-MAINOFF"]		= default_2_position_tumb(_("Mine Arms Main Switch, ON/OFF"), devices.WEAPON_SYS, device_commands.Button_76, 573)
elements["PTR-RSPE-TMB-PKT"]			= default_2_position_tumb(_("PKT Selector Switch, FLIGHT ENGINEER/PILOT"), devices.WEAPON_SYS, device_commands.Button_77, 905)

elements["PTR-COVER-RS-L"]				= tumb_cover(_("Left Fire RS Button Cover, OPEN/CLOSE"), devices.WEAPON_SYS, device_commands.Button_84, 185)
elements["PTR-COVER-RS-R"]				= tumb_cover(_("Right Fire RS Button Cover, OPEN/CLOSE"), devices.WEAPON_SYS, device_commands.Button_85, 228)
elements["PTR-RS-L"]					= default_button(_("Left Fire RS Button"), devices.WEAPON_SYS, device_commands.Button_82, 186)
elements["PTR-RS-L"].updatable = true
elements["PTR-RS-R"]					= default_button(_("Right Fire RS Button"), devices.WEAPON_SYS, device_commands.Button_83, 229)
elements["PTR-RS-R"].updatable = true

elements["PTR-LPE-TMB-FKP"]				= default_2_position_tumb(_("Gun Camera Switch, ON/OFF"), devices.WEAPON_SYS, device_commands.Button_98, 352)

-- SAS
elements["PTR-RSPE-TMB-WINK"]			= default_2_position_tumb(_("Flasher Switch, ON/OFF"), devices.SYS_CONTROLLER, device_commands.Button_5, 523)
elements["PTR-RSPE-TMB-TAB"]			= default_2_position_tumb(_("Transparent Switch, DAY/NIGHT"), devices.SYS_CONTROLLER, device_commands.Button_6, 525)
elements["PTR-APP-TMB-TEST"]			= default_3_position_tumb(_("Check Switch, LAMPS/OFF/FLASHER"), devices.SYS_CONTROLLER, device_commands.Button_7, 150, false)

--SPUU-52
elements["PTR-LES-TMB-SPPU52"]			= default_2_position_tumb(_("SPUU-52 Power Switch, ON/OFF"), devices.SPUU_52, device_commands.Button_5, 332)
elements["PTR-APP-BTN-OFF"]				= default_2_position_tumb(_("SPUU-52 Control Engage Button"), devices.SPUU_52, device_commands.Button_1, 127)
elements["PTR-APP-TMB-RT"]				= default_springloaded_tumb(_("SPUU-52 Test Switch, P/OFF/t)"), devices.SPUU_52, device_commands.Button_3, device_commands.Button_4, 129)
elements["PTR-APP-LVR-ADJ"] 			= default_axis(_("SPUU-52 Adjustment Knob"), devices.SPUU_52, device_commands.Button_2, 128, 1, 0.05, false, true)

-- ППС
elements["PTR-CPE-BTN-QUE1-1"]			= default_button(_("Main Discharge Left Engine Button"), devices.FIRE_EXTING_INTERFACE, device_commands.Button_1, 389)
elements["PTR-CPE-BTN-QUE1-1"].sound = {{SOUND_ENG_BTN_OFF,SOUND_ENG_BTN_ON}}
elements["PTR-CPE-BTN-QUE1-2"]			= default_button(_("Main Discharge Right Engine Button"), devices.FIRE_EXTING_INTERFACE, device_commands.Button_2, 390)
elements["PTR-CPE-BTN-QUE1-2"].sound = {{SOUND_ENG_BTN_OFF,SOUND_ENG_BTN_ON}}
elements["PTR-CPE-BTN-QUE1-3"]			= default_button(_("Main Discharge KO-50 Button"), devices.FIRE_EXTING_INTERFACE, device_commands.Button_3, 391)
elements["PTR-CPE-BTN-QUE1-3"].sound = {{SOUND_ENG_BTN_OFF,SOUND_ENG_BTN_ON}}
elements["PTR-CPE-BTN-QUE1-4"]			= default_button(_("Main Discharge APU GEAR Button"), devices.FIRE_EXTING_INTERFACE, device_commands.Button_4, 392)
elements["PTR-CPE-BTN-QUE1-4"].sound = {{SOUND_ENG_BTN_OFF,SOUND_ENG_BTN_ON}}
elements["PTR-CPE-BTN-QUE2-1"]			= default_button(_("Alternate Discharge Left Engine Button"), devices.FIRE_EXTING_INTERFACE, device_commands.Button_5, 393)
elements["PTR-CPE-BTN-QUE2-1"].sound = {{SOUND_ENG_BTN_OFF,SOUND_ENG_BTN_ON}}
elements["PTR-CPE-BTN-QUE2-2"]			= default_button(_("Alternate Discharge Right Engine Button"), devices.FIRE_EXTING_INTERFACE, device_commands.Button_6, 394)
elements["PTR-CPE-BTN-QUE2-2"].sound = {{SOUND_ENG_BTN_OFF,SOUND_ENG_BTN_ON}}
elements["PTR-CPE-BTN-QUE2-3"]			= default_button(_("Alternate Discharge KO-50 Button"), devices.FIRE_EXTING_INTERFACE, device_commands.Button_7, 395)
elements["PTR-CPE-BTN-QUE2-3"].sound = {{SOUND_ENG_BTN_OFF,SOUND_ENG_BTN_ON}}
elements["PTR-CPE-BTN-QUE2-4"]			= default_button(_("Alternate Discharge APU GEAR Button"), devices.FIRE_EXTING_INTERFACE, device_commands.Button_8, 396)
elements["PTR-CPE-BTN-QUE2-4"].sound = {{SOUND_ENG_BTN_OFF,SOUND_ENG_BTN_ON}}
elements["PTR-CPE-BTN-FIRE-OFF"]		= default_button(_("Turn Off Fire Signal Button"), devices.FIRE_EXTING_INTERFACE, device_commands.Button_9, 397)
elements["PTR-CPE-BTN-FIRE-OFF"].sound = {{SOUND_ENG_BTN_OFF,SOUND_ENG_BTN_ON}}

elements["PTR-CPE-TMB-CONTR-FIRE"]		= default_2_position_tumb(_("Fire Detector Test Switch"), devices.FIRE_EXTING_INTERFACE, device_commands.Button_10, 399)
elements["PTR-CPE-TMB-CONTR-PYRO"]		= default_2_position_tumb(_("Squib Test Switch"), devices.FIRE_EXTING_INTERFACE, device_commands.Button_11, 400)
elements["PTR-CPE-LVR-CONTR-MODE"]		= multiposition_switch_snd(_("Check Fire Circuits Switch, OFF/CONTROL/1/2/3/4/5/6"), devices.FIRE_EXTING_INTERFACE, device_commands.Button_12, 401, 8, 0.1)
elements["PTR-CPE-LVR-CONTR-MODE"].cycle = false

-- ПОС
elements["PTR-LPE-TMB-MANAUT"]			= default_2_position_tumb(_("Defrost Mode Switch, AUTO/MANUAL"), devices.ENGINE_INTERFACE, device_commands.Button_30, 353)
elements["PTR-LPE-BTN-OVR"]				= default_button(_("Defrost OFF Button - Push to turn off"), devices.ENGINE_INTERFACE, device_commands.Button_31, 354)
elements["PTR-LPE-TMB-PZU-L"]			= default_2_position_tumb(_("Left Engine Heater Switch, ON/OFF"), devices.ENGINE_INTERFACE, device_commands.Button_32, 355)
elements["PTR-LPE-TMB-PZU-R"]			= default_2_position_tumb(_("Right Engine Heater Switch, MANUAL/AUTO"), devices.ENGINE_INTERFACE, device_commands.Button_33, 356)
elements["PTR-LPE-TMB-GLASS"]			= default_2_position_tumb(_("Glass Heater Switch, MANUAL/AUTO"), devices.ENGINE_INTERFACE, device_commands.Button_34, 357)
elements["PTR-LPE-TMB-RIO"]				= default_2_position_tumb(_("Ice Detector Heater Switch, MANUAL/AUTO"), devices.ENGINE_INTERFACE, device_commands.Button_35, 358)
elements["PTR-LPE-BTN-RIOCONTR"]		= default_button(_("Ice Detector Heater Test Button - Push to test"), devices.ENGINE_INTERFACE, device_commands.Button_36, 359)
elements["PTR-LPE-LVR-FEEDMODE"]		= multiposition_switch_snd(_("Defrost System Amperemeter Selector Switch"), devices.ENGINE_INTERFACE, device_commands.Button_37, 372, 10, 0.1)
elements["PTR-LPE-LVR-FEEDMODE"].cycle = false

elements["PTR-RSPE-TMB-WRMPVD-L"]		= default_2_position_tumb(_("Left Pitot Heater Switch, ON/OFF"), devices.ENGINE_INTERFACE, device_commands.Button_38, 519)
elements["PTR-RSPE-TMB-WRMPVD-R"]		= default_2_position_tumb(_("Right Pitot Heater Switch, ON/OFF"), devices.ENGINE_INTERFACE, device_commands.Button_39, 520)
elements["PTR-LES-BTN-CONTRPVD"]		= default_button(_("Left Pitot Heater Test Button - Push to test"), devices.ENGINE_INTERFACE, device_commands.Button_40, 339)
elements["PTR-LES-BTN-CONTRPVD01"]		= default_button(_("Right Pitot Heater Test Button - Push to test"), devices.ENGINE_INTERFACE, device_commands.Button_41, 482)

-- ДИСС-15
elements["PTR-RES-TMB-DISS"]			= default_2_position_tumb(_("Doppler Navigator Power Switch, ON/OFF"), devices.DISS_15, device_commands.Button_1, 483)
elements["PTR-DISS-BTN-OFF"]			= default_button(_("Turn Off Coordinates Calculator Button"), devices.DISS_15, device_commands.Button_2, 818)
elements["PTR-DISS-BTN-ON"]				= default_button(_("Turn On Coordinates Calculator Button"), devices.DISS_15, device_commands.Button_3, 819)
elements["PTR-DISS-BTN-MINUS"]			= default_button(_("Decrease Map Angle Button"), devices.DISS_15, device_commands.Button_4, 815)
elements["PTR-DISS-BTN-PLUS"]			= default_button(_("Increase Map Angle Button"), devices.DISS_15, device_commands.Button_5, 816)
elements["PTR-DISS-BTN-N"]				= default_button(_("Decrease Path KM Button"), devices.DISS_15, device_commands.Button_6, 809)
elements["PTR-DISS-BTN-V"]				= default_button(_("Increase Path KM Button"), devices.DISS_15, device_commands.Button_7, 810)
elements["PTR-DISS-BTN-TOLE"]			= default_button(_("Decrease Deviation KM Button"), devices.DISS_15, device_commands.Button_8, 803)
elements["PTR-DISS-BTN-TORI"]			= default_button(_("Increase Deviation KM Button"), devices.DISS_15, device_commands.Button_9, 804)
elements["PTR-IND-DISS-SELECTOR"]		= multiposition_switch_snd(_("Doppler Navigator Mode Switch"), devices.DISS_15, device_commands.Button_10, 826, 5, 0.1)
elements["PTR-IND-DISS-SELECTOR"].cycle = false
elements["PTR-DISS-SELECTOR-KR"]		= default_2_position_tumb(_("Test/Work Switch"), devices.DISS_15, device_commands.Button_11, 797)
elements["PTR-DISS-SELECTOR-SM"]		= default_2_position_tumb(_("Land/Sea Switch"), devices.DISS_15, device_commands.Button_12, 798)

--ADI
elements["PTR-RES-TMB-AG"]				= default_2_position_tumb(_("Right Attitude Indicator Power Switch, ON/OFF"), devices.AGB_3K_RIGHT, device_commands.Button_4, 487)
elements["PTR-LES-TMB-AG"]				= default_2_position_tumb(_("Left Attitude Indicator Power Switch, ON/OFF"), devices.AGB_3K_LEFT, device_commands.Button_4, 335)
elements["PTR-AGB-LVR-KNOB"]			= default_button(_("Left Attitude Indicator Cage Knob - Push to cage"), devices.AGB_3K_LEFT, device_commands.Button_2, 11)
elements["PTR-AGB-LVR-SET"]				= default_axis_limited(_("Left Attitude Indicator Zero Pitch Knob"), devices.AGB_3K_LEFT, device_commands.Button_3, 10, 0.0, 0.1, false, true, {0, 1})
elements["PTR-AGB-LVR-KNOB-R"]			= default_button(_("Right Attitude Indicator Cage Knob - Push to cage"), devices.AGB_3K_RIGHT, device_commands.Button_2, 90)
elements["PTR-AGB-LVR-SET-R"]			= default_axis_limited(_("Right Attitude Indicator Zero Pitch Knob"), devices.AGB_3K_RIGHT, device_commands.Button_3, 89, 0.0, 0.1, false, true, {0, 1})

elements["PTR-LES-TMB-VK53"]			= default_2_position_tumb(_("VK-53 Power Switch, ON/OFF"), devices.CORRECTION_INTERRUPT, device_commands.Button_1, 336)

-- ГМК
elements["PTR-RES-TMB-GMK"]				= default_2_position_tumb(_("GMC Power Switch, ON/OFF"), devices.GMK1A, device_commands.Button_1, 485)
elements["PTR-RPE-LVR-CRDNS"]			= default_2_position_tumb(_("GMC Hemisphere Selection Switch, NORTH/SOUTH"), devices.GMK1A, device_commands.Button_2, 470)
elements["PTR-RPE-LVR-CRDMK"]			= default_3_position_tumb(_("GMC Mode Switch, MC/DG/AC(N/F)"), devices.GMK1A, device_commands.Button_4, 472, false)
elements["PTR-RPE-LVR-CRDCONTR"]		= springloaded_3_pos_tumb(_("GMC Control Switch, 0/CONTROL/300"), devices.GMK1A, device_commands.Button_3, device_commands.Button_3, 476, -1.0, 0.0, 1.0)
elements["PTR-RPE-LVR-CRDZK"]			= springloaded_3_pos_tumb(_("GMC Course Setting Switch, CCW/OFF/CW)"), devices.GMK1A, device_commands.Button_5, device_commands.Button_5, 477, -1.0, 0.0, 1.0)
elements["PTR-RPE-LVR-CRDLAT"] 			= default_axis_limited(_("GMC Latitude Selection Knob"), devices.GMK1A, device_commands.Button_6, 474, 0.0, 0.01, false, false, {0.0, 0.728})

-------------------------------------------------------------
elements["PTR-RSPE-TMB-PZUENG-L"]		= default_2_position_tumb(_("Left Engine Dust Protection Switch, ON/OFF"), devices.ENGINE_INTERFACE, device_commands.Button_28, 517)
elements["PTR-RSPE-TMB-PZUENG-R"]		= default_2_position_tumb(_("Right Engine Dust Protection Switch, ON/OFF"), devices.ENGINE_INTERFACE, device_commands.Button_29, 518)

-- Nav Lights System
elements["PTR-RSPE-TMB-ANO"]			= default_3_position_tumb(_("ANO Switch, BRIGHT/OFF/DIM"), devices.NAVLIGHT_SYSTEM, device_commands.Button_12, 513, false)
elements["PTR-RSPE-TMB-LGTWING"]		= default_3_position_tumb(_("Formation Lights Switch, BRIGHT/OFF/DIM"), devices.NAVLIGHT_SYSTEM, device_commands.Button_13, 514, false)
elements["PTR-RSPE-TMB-LGTCONT"]		= default_2_position_tumb(_("Tip Lights Switch, ON/OFF"), devices.NAVLIGHT_SYSTEM, device_commands.Button_14, 515)
elements["PTR-RSPE-TMB-BEAC"]			= default_2_position_tumb(_("Strobe Light Switch, ON/OFF"), devices.NAVLIGHT_SYSTEM, device_commands.Button_15, 516)
elements["PTR-LSPE-TMB-AIR-CODE"]		= default_button(_("ANO Code Button"), devices.NAVLIGHT_SYSTEM, device_commands.Button_16, 322)
elements["PTR-LEFT-TAXI-L-SW"]			= default_2_position_tumb(_("Taxi Light Switch, ON/OFF"), devices.NAVLIGHT_SYSTEM, device_commands.Button_17, 836)
elements["PTR-LEFT-TAXI-L-POS-SW"]		= default_3_position_tumb(_("Left Landing Light Switch, LIGHT/OFF/RETRACT"), devices.NAVLIGHT_SYSTEM, device_commands.Button_18, 837, false)
elements["PTR-LEFT-TAXI-R-POS-SW"]		= default_3_position_tumb(_("Right Landing Light Switch, LIGHT/OFF/RETRACT"), devices.NAVLIGHT_SYSTEM, device_commands.Button_19, 838, false)

-- Lights System
elements["PTR-LES-TMB-PLF"]				= default_3_position_tumb(_("Left Ceiling Light Switch, RED/OFF/WHITE"), devices.LIGHT_SYSTEM, device_commands.Button_2, 333, false)
elements["PTR-RES-TMB-PLF"]				= default_3_position_tumb(_("Right Ceiling Light Switch, RED/OFF/WHITE"), devices.LIGHT_SYSTEM, device_commands.Button_3, 489, false)
elements["PTR-RES-TMB-LGT"]				= default_2_position_tumb(_("5.5V Lights Switch, ON/OFF"), devices.LIGHT_SYSTEM, device_commands.Button_4, 479)
elements["PTR-LSPE-LVR-REDGRP1"]		= default_axis_limited(_("Left Red Lights Brightness Group 1 Rheostat"), devices.LIGHT_SYSTEM, device_commands.Button_5, 280, 0.0, 0.2, true, false, {0.0, 1.0})
elements["PTR-LSPE-LVR-REDGRP2"]		= default_axis_limited(_("Left Red Lights Brightness Group 2 Rheostat"), devices.LIGHT_SYSTEM, device_commands.Button_6, 281, 0.0, 0.2, true, false, {0.0, 1.0})
elements["PTR-RSPE-LVR-REDGRP1"]		= default_axis_limited(_("Right Red Lights Brightness Group 1 Rheostat"), devices.LIGHT_SYSTEM, device_commands.Button_7, 491, 0.0, 0.2, true, false, {0.0, 1.0})
elements["PTR-RSPE-LVR-REDGRP2"]		= default_axis_limited(_("Right Red Lights Brightness Group 2 Rheostat"), devices.LIGHT_SYSTEM, device_commands.Button_8, 492, 0.0, 0.2, true, false, {0.0, 1.0})
elements["PTR-RSPE-LVR-REDGRP003"]		= default_axis_limited(_("Central Red Lights Brightness Group 1 Rheostat"), devices.LIGHT_SYSTEM, device_commands.Button_9, 894, 0.0, 0.2, true, false, {0.0, 1.0})
elements["PTR-RSPE-LVR-REDGRP004"]		= default_axis_limited(_("Central Red Lights Brightness Group 2 Rheostat"), devices.LIGHT_SYSTEM, device_commands.Button_10, 895, 0.0, 0.2, true, false, {0.0, 1.0})
elements["PTR-RSPE-LVR-REDGRP005"]		= default_axis_limited(_("5.5V Lights Brightness Rheostat"), devices.LIGHT_SYSTEM, device_commands.Button_11, 924, 0.0, 0.2, true, false, {0.0, 1.0})
elements["PTR-RSPE-TMB-DUTY"]			= default_2_position_tumb(_("Cargo Cabin Duty Lights Switch, ON/OFF"), devices.LIGHT_SYSTEM, device_commands.Button_22, 511)
elements["PTR-RSPE-TMB-ALL"]			= default_2_position_tumb(_("Cargo Cabin Common Lights Switch, ON/OFF"), devices.LIGHT_SYSTEM, device_commands.Button_23, 512)

-------------------------------------------------
-- RADIO EQUIPMENT

-- SPU - 7
--Left
elements["PTR-LAZS-LVR-ALL"]	= default_axis_limited(_("Common Volume Knob"), devices.SPU_7, device_commands.Button_1, 549, 0.0, 0.05, true, false)
elements["PTR-LAZS-LVR-AUDIT"]	= default_axis_limited(_("Listening Volume Knob"), devices.SPU_7, device_commands.Button_2, 548, 0.0, 0.05, true, false)
elements["PTR-LAZS-TMB-RADSPU"]	= default_2_position_tumb(_("Radio/ICS Switch"), devices.SPU_7, device_commands.Button_4, 553)
elements["PTR-LAZS-TMB-CIRC"]	= default_2_position_tumb(_("Network 1/2 Switch (N/F)"), devices.SPU_7, device_commands.Button_7, 551)
elements["PTR-LAZS-BTN-CB"] 	= default_button(_("Circular Call Button (N/F)"), devices.SPU_7, device_commands.Button_8, 552)
elements["PTR-LAZS-LVR-MODES"]  = multiposition_switch_snd(_("Radio Source Selector Switch, R-863/JADRO-1A/R-828/NF/ARC-9/ARC-UD"), devices.SPU_7, device_commands.Button_3, 550, 6, 0.1)
elements["PTR-LAZS-LVR-MODES"].cycle = false
elements["PTR-ARMS-L"]			= {	
	class 				= {class_type.BTN, class_type.BTN},
	hint  				= _("Left Trigger Button, RADIO(LMB)/ICS(RMB)"),
	device 				= devices.SPU_7,
	action 				= {device_commands.Button_23, device_commands.Button_23},
	stop_action 		= {device_commands.Button_23, device_commands.Button_23},
	arg 				= {182, 182},
	arg_value			= {1.0, 0.5}, 
	arg_lim 			= {{0.0, 1.0}, {0.0, 0.5}},
	updatable			= true,
	use_release_message = {true}
}

--Right
elements["PTR-RAZS-LVR-ALL002"]		= default_axis_limited(_("Common Volume Knob"), devices.SPU_7, device_commands.Button_9, 841, 0.0, 0.05, true, false)
elements["PTR-RAZS-LVR-AUDIT002"]	= default_axis_limited(_("Listening Volume Knob"), devices.SPU_7, device_commands.Button_10, 840, 0.0, 0.05, true, false)
elements["PTR-RAZS-TMB-RADSPU002"]	= default_2_position_tumb(_("Radio/ICS Switch"), devices.SPU_7, device_commands.Button_12, 845)
elements["PTR-RAZS-TMB-CIRC002"]	= default_2_position_tumb(_("Network 1/2 Switch (N/F)"), devices.SPU_7, device_commands.Button_13, 843)
elements["PTR-RAZS-BTN-CB002"] 		= default_button(_("Circular Call Button (N/F)"), devices.SPU_7, device_commands.Button_14, 846)
elements["PTR-RAZS-LVR-MODES002"]  	= multiposition_switch_snd(_("Radio Source Selector Switch, R-863/JADRO-1A/R-828/NF/ARC-9/ARC-UD"), devices.SPU_7, device_commands.Button_11, 842, 6, 0.1)
elements["PTR-RAZS-LVR-MODES002"].cycle = false
elements["PTR-ARMS-R"]			= {	
	class 				= {class_type.BTN, class_type.BTN},
	hint  				= _("Right Trigger Button, RADIO(LMB)/ICS(RMB)"),
	device 				= devices.SPU_7,
	action 				= {device_commands.Button_24, device_commands.Button_24},
	stop_action 		= {device_commands.Button_24, device_commands.Button_24},
	arg 				= {225, 225},
	arg_value			= {1.0, 0.5}, 
	arg_lim 			= {{0.0, 1.0}, {0.0, 0.5}},
	updatable			= true,
	use_release_message = {true}
}

--elements["RADIO/ICS-1-PTR"] 		= multiposition_switch(_("Radio/ICS") , devices.SPU_7, device_commands.Button_5, 194, 3, 0.5)
elements["PTR-RES-TMB-LARING"]		= default_2_position_tumb(_("Laryngophone Switch, ON/OFF"), devices.SPU_7, device_commands.Button_6, 480)

function radio_wheel_1(hint_,device_,command1_,arg_, arg_value_, arg_lim_, slave_)

	arg_value_ = arg_value_ or {-0.1, 0.1}
	slave_ = slave_ or {}
	arg_lim_ = arg_lim_ or {0,1}
	return  {
			 class  		 = {class_type.TUMB,class_type.TUMB}, 
			 hint   		 = hint_,
			 device 		 = device_,
			 action 		 = {command1_ ,command1_}, 
			 arg 			 = {arg_,arg_},
			 arg_value 		 = arg_value_,
			 arg_lim   		 = {arg_lim_,arg_lim_},
			 relative		 = {true,true},
			 animated        = {true,true},
			 animation_speed = {0.7, 0.7},
			 slave_animation = {{slave = slave_},{slave = slave_}},
			}
end

-- R-863
elements["PTR-LPE-TMB-COMAND"]	= default_2_position_tumb(_("R-863, Modulation Switch, FM/AM"), devices.R_863, device_commands.Button_1, 369)
elements["PTR-APP-TMB-NU"]		= default_2_position_tumb(_("R-863, Unit Switch, DIAL/MEMORY"), devices.R_863, device_commands.Button_2, 132)
elements["PTR-LPE-LVR-CHANNEL"]	= default_3_position_tumb(_("R-863, Radio Channel Selector Knob"), devices.R_863, device_commands.Button_3, 370, true, true, 0.05, {0.0,0.949768})
elements["PTR-LPE-LVR-CHANNEL"].sound = {{SOUND_ROTARY_1,SOUND_ROTARY_1},{SOUND_ROTARY_1,SOUND_ROTARY_1}}
elements["PTR-APP-TMB-PS"]		= default_2_position_tumb(_("R-863, Squelch Switch, ON/OFF"), devices.R_863, device_commands.Button_4, 155)
elements["PTR-APP-LVR-LEVEL"]	= default_axis_limited(_("R-863, Volume Knob"), devices.R_863, device_commands.Button_5, 156, 0.0, 0.05, true, false)
elements["PTR-APP-LVR-SEL1"]	= radio_wheel_1(_("R-863, 10MHz Rotary Knob"), devices.R_863, device_commands.Button_6, 163, {-0.1, 0.1},{0,1},{157,{0.0,0.23},0.1})
elements["PTR-APP-LVR-SEL2"]	= radio_wheel_1(_("R-863, 1MHz Rotary Knob"), devices.R_863, device_commands.Button_7, 164, {-0.1, 0.1},{0,1},{158,{0.0,1.0}})
elements["PTR-APP-LVR-SEL3"]	= radio_wheel_1(_("R-863, 100kHz Rotary Knob"), devices.R_863, device_commands.Button_8, 165, {-0.1, 0.1},{0,1},{159,{0.0,1.0}})
elements["PTR-APP-LVR-SEL4"]	= radio_wheel_1(_("R-863, 1kHz Rotary Knob"), devices.R_863, device_commands.Button_9, 166, {-0.1, 0.1},{0,1},{160,{0.0,1.0},2.5})
elements["PTR-APP-LVR-SEL1"].sound = {{SOUND_R863_UP,SOUND_R863_DOWN},{SOUND_R863_UP,SOUND_R863_DOWN}}
elements["PTR-APP-LVR-SEL2"].sound = {{SOUND_R863_UP,SOUND_R863_DOWN},{SOUND_R863_UP,SOUND_R863_DOWN}}
elements["PTR-APP-LVR-SEL3"].sound = {{SOUND_R863_UP,SOUND_R863_DOWN},{SOUND_R863_UP,SOUND_R863_DOWN}}
elements["PTR-APP-LVR-SEL4"].sound = {{SOUND_R863_UP,SOUND_R863_DOWN},{SOUND_R863_UP,SOUND_R863_DOWN}}
elements["PTR-APP-TMB-AP"]		= default_2_position_tumb(_("R-863, Emergency Receiver Switch, ON/OFF (N/F)"), devices.R_863, device_commands.Button_10, 153)
elements["PTR-APP-TMB-RK"]		= default_2_position_tumb(_("R-863, ARC Switch, ON/OFF (N/F)"), devices.R_863, device_commands.Button_11, 154)

-- R-828
elements["PTR-ADDSECPLT-LVR-CHNL"]		= default_3_position_tumb(_("R-828, Radio Channel Selector Knob"), devices.R_828, device_commands.Button_1, 735, true, true, 0.1, {0.0,0.9})
elements["PTR-ADDSECPLT-LVR-CHNL"].sound = {{SOUND_ROTARY_1,SOUND_ROTARY_1},{SOUND_ROTARY_1,SOUND_ROTARY_1}}
elements["PTR-ADDSECPLT-LVR-VOL"]		= default_axis_limited(_("R-828, Volume Knob"), devices.R_828, device_commands.Button_2, 737, 0.0, 0.05, true,false)
elements["PTR-ADDSECPLT-BTN-ASU"]		= default_button(_("R-828, Radio Tuner Button"), devices.R_828, device_commands.Button_3, 738)
elements["PTR-ADDSECPLT-TMB-PSH"]		= default_2_position_tumb(_("R-828, Squelch Switch, ON/OFF"), devices.R_828, device_commands.Button_4, 739)
elements["PTR-ADDSECPLT-TMB-P828"]		= default_2_position_tumb(_("R-828, Power Switch, ON/OFF"), devices.R_828, device_commands.Button_5, 756)
elements["PTR-ADDSECPLT-TMB-MODSEL"]	= default_2_position_tumb(_("R-828, Compass Switch, COMM/NAV"), devices.R_828, device_commands.Button_6, 757)

function radio_wheel_double(hint_,device_,command1_,command2_,arg1_, arg2_, arg_value_, slave1_, slave2_)

	arg_value_ = arg_value_ or {-0.1, 0.1, 0.1}
	slave1_ = slave1_ or {}
	slave2_ = slave2_ or {}
	
	return  {
			 class  		 = {class_type.TUMB,class_type.TUMB,class_type.LEV}, 
			 hint   		 = hint_,
			 device 		 = device_,
			 action 		 = {command1_ ,command1_,command2_}, 
			 arg 			 = {arg1_,arg1_,arg2_},
			 arg_value 		 = arg_value_,
			 arg_lim   		 = {{0,1},{0,1},{0,1}},
			 relative		 = {true,true,true},
			 animated        = {true,true,true},
			 animation_speed = {0.7, 0.7,0.7},
			 slave_animation = {{slave = slave1_},{slave = slave1_},{slave = slave2_}}
			}
end

-- Jadro-1A
elements["PTR-RES-TMB-RS"]			= default_2_position_tumb(_("Jadro 1A, Power Switch, ON/OFF"), devices.JADRO_1A, device_commands.Button_13, 484)

elements["PTR-ADDSECPLT-LVR-DIG12"]	= radio_wheel_1(_("Jadro 1A, Frequency Selector, 1MHz"),
	devices.JADRO_1A, device_commands.Button_2, 745, {-0.1, 0.1}, {0,1},{751,{0.0,1.0}, 1.0,slave = {750,{0.0,1.0},1.0,master_lim = {0.9,1.0}}})
elements["PTR-ADDSECPLT-LVR-DIG3"]	= radio_wheel_1(_("Jadro 1A, Frequency Selector, 100kHz"), 
	devices.JADRO_1A, device_commands.Button_3,746,{-0.1, 0.1}, {0,1},{752,{0.0,1.0}})
elements["PTR-ADDSECPLT-LVR-DIG4"]	= radio_wheel_1(_("Jadro 1A, Frequency Selector, 10kHz"), 
	devices.JADRO_1A, device_commands.Button_4,747,{-0.1, 0.1}, {0,1},{753,{0.0,1.0}})
elements["PTR-ADDSECPLT-LVR-DIG12"].sound = {{SOUND_JADRO_CW,SOUND_JADRO_CCW},{SOUND_JADRO_CW,SOUND_JADRO_CCW}}
elements["PTR-ADDSECPLT-LVR-DIG3"].sound = {{SOUND_JADRO_CW,SOUND_JADRO_CCW},{SOUND_JADRO_CW,SOUND_JADRO_CCW}}
elements["PTR-ADDSECPLT-LVR-DIG4"].sound = {{SOUND_JADRO_CW,SOUND_JADRO_CCW},{SOUND_JADRO_CW,SOUND_JADRO_CCW}}

elements["PTR-ADDSECPLT-LVR-DIG6"]	= radio_wheel_double(_("Jadro 1A, Frequency Selector, Left mouse - 1kHz/ Right mouse - 100Hz "), 
	devices.JADRO_1A, device_commands.Button_5, device_commands.Button_6,748,749,{-0.1, 0.1, 0.1}, {754,{0.0,1.0}}, {755,{0.0,1.0}})
elements["PTR-ADDSECPLT-LVR-DIG6"].sound = {{SOUND_JADRO_CW,SOUND_JADRO_CCW},{SOUND_JADRO_CW,SOUND_JADRO_CCW},{SOUND_JADRO_CW,SOUND_JADRO_CCW}}	
	
elements["PTR-ADDSECPLT-LVR-ONOFF"]	= multiposition_switch(_("Jadro 1A, Mode Switch, OFF/OM/AM") , devices.JADRO_1A, device_commands.Button_1, 744, 3, 0.5)
elements["PTR-ADDSECPLT-LVR-ONOFF"].sound = {{SOUND_JADRO_CW,SOUND_JADRO_CCW},{SOUND_JADRO_CW,SOUND_JADRO_CCW}}
elements["PTR-ADDSECPLT-LVR-ONOFF"].cycle = false

elements["PTR-ADDSECPLT-LVR-VOLUM"]	= default_axis_limited(_("Jadro 1A, Volume Knob"), devices.JADRO_1A, device_commands.Button_7, 743, 0.0, 0.05, true,false)
elements["PTR-ADDSECPLT-LVR-PSH"]	= multiposition_switch_limited(_("Jadro 1A, Squelch Switch"), devices.JADRO_1A, device_commands.Button_8, 741,2,0.7,false)
elements["PTR-ADDSECPLT-TMB-CONTR"]	= default_button(_("Jadro 1A, Control Button"), devices.JADRO_1A, device_commands.Button_9, 742)

-- RI-65
elements["PTR-LES-TMB-RK85"]		= default_2_position_tumb(_("RI-65 Power Switch, ON/OFF"), devices.VMS, device_commands.Button_6, 338)
elements["PTR-LSPE-BTN-RI65-OFF"]	= default_button(_("RI-65 OFF Button"), devices.VMS, device_commands.Button_5, 292)
elements["PTR-LSPE-BTN-RI65-RETRY"]	= default_button(_("RI-65 Repeat Button"), devices.VMS, device_commands.Button_3, 293)
elements["PTR-LSPE-BTN-RI65-TEST"]	= default_button(_("RI-65 Check Button"), devices.VMS, device_commands.Button_4, 294)
elements["PTR-LSPE-TMB-RI65-AMP"]	= default_2_position_tumb(_("RI-65 Amplifier Switch, ON/OFF"), devices.SPU_7, device_commands.Button_21, 295)

-- ARC-UD
elements["PTR-RPE-LVR-ARKMODE1"]	= multiposition_switch_snd(_("ARC-UD, Mode Switch, OFF/NARROW/WIDE/PULSE/RC"), devices.ARC_UD, device_commands.Button_1, 456, 5, 0.1)
elements["PTR-RPE-LVR-ARKMODE1"].cycle = false
elements["PTR-RPE-LVR-ARKMODE2"]	= multiposition_switch_snd(_("ARC-UD, Channel Selector Switch, 1/2/3/4/5/6"), devices.ARC_UD, device_commands.Button_4, 457, 6, 0.1)
elements["PTR-RPE-LVR-ARKMODE2"].cycle = false
elements["PTR-RPE-TMB-ARKSENS"]		= default_2_position_tumb(_("ARC-UD, Sensitivity Switch, MORE/LESS"), devices.ARC_UD, device_commands.Button_2, 453)
elements["PTR-RPE-TMB-ARKUKV"]		= default_2_position_tumb(_("ARC-UD, Wave Switch, MW/DW"), devices.ARC_UD, device_commands.Button_3, 454)
elements["PTR-RPE-BTN-CONTR"]		= default_button(_("ARC-UD, Control Button"), devices.ARC_UD, device_commands.Button_6, 672)
elements["PTR-RPE-BTN-ANTL"]		= default_button(_("ARC-UD, Left Antenna Button"), devices.ARC_UD, device_commands.Button_7, 673)
elements["PTR-RPE-BTN-ANTR"]		= default_button(_("ARC-UD, Right Antenna Button"), devices.ARC_UD, device_commands.Button_8, 674)
elements["PTR-RPE-LVR-ARKVOL"]		= default_axis_limited(_("ARC-UD, Volume Knob"), devices.ARC_UD, device_commands.Button_5, 455, 0.0, 0.05, true, false)
elements["PTR-RES-TMB-BLOCK"]		= default_2_position_tumb(_("ARC-UD, Lock Switch, LOCK/UNLOCK"), devices.ARC_UD, device_commands.Button_12, 481)

-- PKV Sight
elements["PTR-LAZS-LVR-AIMLGT"]	= default_axis_limited(_("Sight Brightness Knob"), devices.PKV, device_commands.Button_1, 589, 0.0, 0.2, false, false)
elements["PTR-PKV-ROTARY"]		= default_axis_limited(_("Sight Limb Knob"), devices.PKV, device_commands.Button_3, 855, 0.0, 0.1, false, false, {0, 0.807})
--elements["PTR-PKV-DOUBLE"]	= default_2_position_tumb(_("Sight Double"), devices.PKV, device_commands.Button_5, 0)
elements["PTR-PKV-DOUBLE"] = {	
			class 		= {class_type.TUMB, class_type.TUMB},
			hint  		= _("Sight Double"),
			device 		= devices.PKV,
			action 		= {device_commands.Button_5,device_commands.Button_5},
			arg 	  	= {856,856},
			arg_value 	= {1.0,-1.0}, 
			arg_lim   	= {{0,0.5},{0,0.5}},
			updatable 	= true, 
			use_OBB 	= true
}
elements["PTR-PKV-GLASS-FILTER"] = {
			class = {class_type.TUMB, class_type.TUMB},
			hint = _("PKV Filter"),
			device = devices.PKV,
			action = {device_commands.Button_6, device_commands.Button_6},
			arg = {903, 903},
			arg_value = {1.0, -1.0},
			arg_lim = {{0.0, 1.0}, {0.0, 1.0}},
			updatable = true,
			use_OBB = true
}
			
--------------------------------------------------------------------------------
-- CLOCK 
elements["PTR-WATCH-LVR-L"] = {
	class = {class_type.BTN, class_type.BTN, class_type.LEV},
	hint = _("Mech clock left lever"), 
	device = devices.CLOCK, 
	action = {device_commands.Button_1, device_commands.Button_2, device_commands.Button_3}, 
	stop_action = {device_commands.Button_1, device_commands.Button_2, 0},
	is_repeatable = {},
	arg = {57, 57, 58}, 
	arg_value = {1.0, -1.0, 1.0}, 
	arg_lim = {{0, 1}, {-1, 0}, {0, 1}}, 
	relative = {false,false,true}, 
	gain = {1.0, 1.0, 0.05}, 
	use_release_message = {true, true, false}, 
	use_OBB = true,
	sound = {{SOUND_CLOCK_SW14_OFF,SOUND_CLOCK_SW16},{SOUND_CLOCK_SW14_ON,SOUND_CLOCK_SW14_OFF}, {SOUND_CLOCK_SW15}}
}

elements["PTR-WATCH-LVR-R"] = {
	class = {class_type.BTN, class_type.LEV}, 
	hint = _("Mech clock right lever"), 
	device = devices.CLOCK, 
	action = {device_commands.Button_4, device_commands.Button_5}, 
	stop_action = {device_commands.Button_4, 0}, 
	is_repeatable = {}, 
	arg = {59, 60}, 
	arg_value = {1.0, 0.05}, 
	arg_lim = {{0, 1}, {-0.15, 0.15}},
	gain = {1.0, 1.2},
	use_release_message = {true, false}, 
	use_OBB = true,
	sound = {{SOUND_CLOCK_SW14_OFF,SOUND_CLOCK_SW14_ON},{SOUND_CLOCK_SW13_ON,SOUND_CLOCK_SW13_OFF}}
}

elements["PTR-RSPE-TMB-WRMWTCH"]		= default_2_position_tumb(_("Clock Heating Switch, ON/OFF"), devices.CLOCK, device_commands.Button_6, 521)

--
elements["PTR-STAT-PRESS"]	= multiposition_switch_limited(_("Static Pressure System Mode Selector, LEFT/COMMON/RIGHT"), devices.FM_PROXY, device_commands.Button_1, 839, 3, 0.1, true)

--------------------------------------------------------------------------------
-- UV-26 CMD Control Panel (УВ-26 - Устройство Выброса ЛТЦ)
elements["PTR-UV26-ONOFF"]		= default_2_position_tumb(_("CMD Power Switch, ON/OFF"), devices.UV_26, device_commands.Button_10, 910)
elements["PTR-UV26-BOARD"] 		= default_3_position_tumb(_("CMD Board Flares Dispensers Switch, LEFT/BOTH/RIGHT"), devices.UV_26, device_commands.Button_2, 859, false, false, 0.5, {0.0,1.0}) 
elements["PTR-UV26-PROG"]		= default_2_position_tumb(_("CMD Flares Amount Switch, COUNTER/PROGRAMMING"), devices.UV_26, device_commands.Button_3, 913)
elements["PTR-L45-BTN"]			= default_button(_("CMD Num of Sequences Button"), devices.UV_26, device_commands.Button_4, 914)
elements["PTR-L68-BTN"]			= default_button(_("CMD Dispense Interval Button"), devices.UV_26, device_commands.Button_6, 862) 
elements["PTR-L8-BTN"]			= default_button(_("CMD Num in Sequence Button"), devices.UV_26, device_commands.Button_5, 863)  
elements["PTR-START-BTN"]		= default_button(_("CMD Start Dispense Button"), devices.UV_26, device_commands.Button_7, 866)	
elements["PTR-LSPE-BTN-UV26-START"]		= default_button(_("Start/Stop Dispense Button"), devices.UV_26, device_commands.Button_13, 911)	
elements["PTR-RESET-PROG-BTN"]	= default_button(_("CMD Reset to Default Program Button"), devices.UV_26, device_commands.Button_8, 864)
elements["PTR-STOP-BTN"]		= default_button(_("CMD Stop Dispense Button"), devices.UV_26, device_commands.Button_9, 865)

--
local BlisterPosMax = 0.64
elements["PTR-BLISTER-LOCK-L"]	= default_2_position_tumb(_("Left Blister, OPEN/CLOSE"),devices.CPT_MECH, device_commands.Button_15, 215)
elements["PTR-BLISTER-LOCK-L"].arg_value	= {BlisterPosMax, -BlisterPosMax}
elements["PTR-BLISTER-LOCK-L"].arg_lim		= {{0.0, BlisterPosMax}, {0.0, BlisterPosMax}}
elements["PTR-BLISTER-LOCK-L"].cycle		= true
elements["PTR-BLISTER-LOCK-L"].sound		= {{SOUND_NOSOUND,SOUND_NOSOUND},{SOUND_NOSOUND,SOUND_NOSOUND}}
elements["PTR-BLISTER-LOCK-L"].updatable	= true
elements["PTR-BLISTER-LOCK-R"]	= default_2_position_tumb(_("Right Blister, OPEN/CLOSE"),devices.CPT_MECH, device_commands.Button_16, 216)
elements["PTR-BLISTER-LOCK-R"].arg_value	= {BlisterPosMax, -BlisterPosMax}
elements["PTR-BLISTER-LOCK-R"].arg_lim		= {{0.0, BlisterPosMax}, {0.0, BlisterPosMax}}
elements["PTR-BLISTER-LOCK-R"].cycle		= true
elements["PTR-BLISTER-LOCK-R"].sound		= {{SOUND_NOSOUND,SOUND_NOSOUND},{SOUND_NOSOUND,SOUND_NOSOUND}}
elements["PTR-BLISTER-LOCK-R"].updatable	= true

------------------------------------------------
elements["PTR-WHEELBRK-ARM"]	= default_button(_("Wheel Brakes Handle"), devices.CPT_MECH, device_commands.Button_17, 881)
elements["PTR-WHEELBRK-ARM"].sound = {{SOUND_NOSOUND,SOUND_NOSOUND},{SOUND_NOSOUND,SOUND_NOSOUND}}
elements["PTR-WHEELBRK-ARM"].use_OBB = false
elements["PTR-WHEELBRK-ARM"].updatable = true

elements["PTR-WHEELBRKFIX-ARM"]	= default_2_position_tumb(_("Parking Brake Handle"), devices.CPT_MECH, device_commands.Button_24, 930)
elements["PTR-WHEELBRKFIX-ARM"].sound = {{SOUND_NOSOUND,SOUND_NOSOUND},{SOUND_NOSOUND,SOUND_NOSOUND}}
elements["PTR-WHEELBRKFIX-ARM"].use_OBB = true
elements["PTR-WHEELBRKFIX-ARM"].updatable = true

elements["PTR-RSPE-TMB-WINK002"]	= default_button(_("Accelerometer Reset Button - Push to reset"), devices.CPT_MECH, device_commands.Button_6, 925)

elements["PTR-LES-TMB-VENT"]	= default_2_position_tumb(_("Left Fan Switch, ON/OFF"), devices.CPT_MECH, device_commands.Button_20, 334)
elements["PTR-RES-TMB-VENT"]	= default_2_position_tumb(_("Right Fan Switch, ON/OFF"), devices.CPT_MECH, device_commands.Button_21, 488)

elements["PTR-LES-TMB-GLSCLN-OFF"]		= default_1_position_tumb(_("Left Windscreen Wiper Control Switch, OFF"),		devices.CPT_MECH, device_commands.Button_25, 331, 0.0, {0.0, 0.0})
elements["PTR-LES-TMB-GLSCLN-START"]	= default_1_position_tumb(_("Left Windscreen Wiper Control Switch, START"),		devices.CPT_MECH, device_commands.Button_25, 331, 0.1, {0.1, 0.1})
elements["PTR-LES-TMB-GLSCLN-RESET"]	= default_button(_("Left Windscreen Wiper Control Switch, RESET"),				devices.CPT_MECH, device_commands.Button_25, 331, 0.2, {0.0, 0.2})
elements["PTR-LES-TMB-GLSCLN-HISPEED"]	= default_1_position_tumb(_("Left Windscreen Wiper Control Switch, SPEED 1"),	devices.CPT_MECH, device_commands.Button_25, 331, 0.3, {0.3, 0.3})
elements["PTR-LES-TMB-GLSCLN-LOWSPEED"]	= default_1_position_tumb(_("Left Windscreen Wiper Control Switch, SPEED 2"),	devices.CPT_MECH, device_commands.Button_25, 331, 0.4, {0.4, 0.4})

elements["PTR-RES-TMB-GLSCLN-OFF"]		= default_1_position_tumb(_("Right Windscreen Wiper Control Switch, OFF"),		devices.CPT_MECH, device_commands.Button_26, 478, 0.0, {0.0, 0.0})
elements["PTR-RES-TMB-GLSCLN-RESET"]	= default_1_position_tumb(_("Right Windscreen Wiper Control Switch, START"),	devices.CPT_MECH, device_commands.Button_26, 478, 0.1, {0.1, 0.1})
elements["PTR-RES-TMB-GLSCLN-START"]	= default_button(_("Right Windscreen Wiper Control Switch, RESET"),				devices.CPT_MECH, device_commands.Button_26, 478, 0.2, {0.0, 0.2})
elements["PTR-RES-TMB-GLSCLN-LOWSPEED"]	= default_1_position_tumb(_("Right Windscreen Wiper Control Switch, SPEED 1"),	devices.CPT_MECH, device_commands.Button_26, 478, 0.3, {0.3, 0.3})
elements["PTR-RES-TMB-GLSCLN-HISPEED"]	= default_1_position_tumb(_("Right Windscreen Wiper Control Switch, SPEED 2"),	devices.CPT_MECH, device_commands.Button_26, 478, 0.4, {0.4, 0.4})


-- ARC-9
elements["PTR-RPE-TMB-NEARFAR"]		= default_2_position_tumb(_("ARC-9, Dialer Switch, MAIN/BACKUP"), devices.ARC_9, device_commands.Button_11, 469)
elements["PTR-RPE-LVR-FRQVOLUME"]	= default_axis_limited(_("ARC-9, Volume Knob"), devices.ARC_9, device_commands.Button_1, 448, 1.0, -0.05, true, false)
elements["PTR-RPE-TMB-FRQTLG"]		= default_2_position_tumb(_("ARC-9, TLF/TLG Switch"), devices.ARC_9, device_commands.Button_2, 444)
elements["PTR-RPE-LVR-FRQMODE"] 	= multiposition_switch_snd(_("ARC-9, Mode Selector Switch, OFF/COMP/ANT/LOOP"), devices.ARC_9, device_commands.Button_3, 446, 4, 0.1)
elements["PTR-RPE-LVR-FRQMODE"].cycle = false
elements["PTR-RPE-TMB-FRQFRAME"]	= springloaded_3_pos_tumb(_("ARC-9, Loop Control Switch, LEFT/OFF/RIGHT"), devices.ARC_9, device_commands.Button_10, device_commands.Button_10, 447)
elements["PTR-RPE-LVR-FRQADJRES"]	= default_axis_limited(_("ARC-9, Backup Frequency Tune Knob"), devices.ARC_9, device_commands.Button_4, 449, 0.0, 0.05, true, false, {-0.2, 0.4})
elements["PTR-RPE-LVR-FRQRES-SEC"]	= radio_wheel_arc(_("ARC-9, Backup 100kHz Rotary Knob"), devices.ARC_9, device_commands.Button_5, 675, {-0.05,0.05},{0.0,0.55},0.5)
elements["PTR-RPE-LVR-FRQRES"]		= radio_wheel_arc(_("ARC-9, Backup 10kHz Rotary Knob"), devices.ARC_9, device_commands.Button_6, 450, {-0.1,0.1},{0.0,0.9},0.7)
elements["PTR-RPE-LVR-FRQADJMAIN"]	= default_axis_limited(_("ARC-9, Main Frequency Tune Knob"), devices.ARC_9, device_commands.Button_7, 451, 0.0,0.05,true,false,{-0.2,0.4})
elements["PTR-RPE-LVR-FRQMAIN-SEC"]	= radio_wheel_arc(_("ARC-9, Main 100kHz Rotary Knob"), devices.ARC_9, device_commands.Button_8, 678, {-0.05,0.05},{0.0,0.55},0.5)
elements["PTR-RPE-LVR-FRQMAIN"]		= radio_wheel_arc(_("ARC-9, Main 10kHz Rotary Knob"), devices.ARC_9, device_commands.Button_9, 452, {-0.1,0.1},{0.0,0.9},0.7)

-- External Cargo Equipment
elements["PTR-STKSG-CVR-TACTJET"]	= tumb_cover(_("Tactical Cargo Release Button Cover, OPEN/CLOSE"), devices.EXT_CARGO_EQUIPMENT, device_commands.Button_2, 199)
elements["PTR-STKSG-CVR-TACTJET"].updatable = true
elements["PTR-STKSG-BTN-TACTJET"]	= default_button(_("Tactical Cargo Release Button - Push to release"), devices.EXT_CARGO_EQUIPMENT, device_commands.Button_1, 200, 1, {0,1})
elements["PTR-STKSG-BTN-TACTJET"].updatable = true
elements["PTR-STKSG-CVR-EMRGJET"]	= tumb_cover(_("Emergency Cargo Release Button Cover, OPEN/CLOSE"), devices.EXT_CARGO_EQUIPMENT, device_commands.Button_4, 197)
elements["PTR-STKSG-CVR-EMRGJET"].updatable = true
elements["PTR-STKSG-BTN-EMRGJET"]	= default_button(_("Emergency Cargo Release Button - Push to release"), devices.EXT_CARGO_EQUIPMENT, device_commands.Button_3, 198, 1, {0,1})
elements["PTR-STKSG-BTN-EMRGJET"].updatable = true
elements["PTR-LSPE-TMB-BRK-OUT"]	= default_2_position_tumb(_("External Cargo Automatic Dropping, ON/OFF"), devices.EXT_CARGO_EQUIPMENT, device_commands.Button_5, 324)

-- Signal Flares
elements["PTR-LSPE-TMB-ALRMRKT1"]		= default_2_position_tumb(_("Signal Flares Cassette 1 Power Switch, ON/OFF"), devices.SIGNAL_FLARES, device_commands.Button_1, 282)
elements["PTR-LSPE-TMB-ALRMRKT2"]		= default_2_position_tumb(_("Signal Flares Cassette 2 Power Switch, ON/OFF"), devices.SIGNAL_FLARES, device_commands.Button_6, 283)
elements["PTR-LSPE-BTN-RCKT11"]			= default_2_position_tumb(_("Signal Flares Cassette 1 Launch Red Button"),		devices.SIGNAL_FLARES, device_commands.Button_3, 284)
elements["PTR-LSPE-BTN-RCKT11"].sound 	= {{SOUND_FLARES_ON,SOUND_FLARES_OFF},{SOUND_FLARES_ON,SOUND_FLARES_OFF}}
elements["PTR-LSPE-BTN-RCKT12"]			= default_2_position_tumb(_("Signal Flares Cassette 1 Launch Green Button"),	devices.SIGNAL_FLARES, device_commands.Button_2, 285)
elements["PTR-LSPE-BTN-RCKT12"].sound 	= {{SOUND_FLARES_ON,SOUND_FLARES_OFF},{SOUND_FLARES_ON,SOUND_FLARES_OFF}}
elements["PTR-LSPE-BTN-RCKT13"]			= default_2_position_tumb(_("Signal Flares Cassette 1 Launch Yellow Button"),	devices.SIGNAL_FLARES, device_commands.Button_5, 286)
elements["PTR-LSPE-BTN-RCKT13"].sound 	= {{SOUND_FLARES_ON,SOUND_FLARES_OFF},{SOUND_FLARES_ON,SOUND_FLARES_OFF}}
elements["PTR-LSPE-BTN-RCKT14"]			= default_2_position_tumb(_("Signal Flares Cassette 1 Launch White Button"),	devices.SIGNAL_FLARES, device_commands.Button_4, 287)
elements["PTR-LSPE-BTN-RCKT14"].sound	= {{SOUND_FLARES_ON,SOUND_FLARES_OFF},{SOUND_FLARES_ON,SOUND_FLARES_OFF}}
elements["PTR-LSPE-BTN-RCKT21"]			= default_2_position_tumb(_("Signal Flares Cassette 2 Launch Red Button"),		devices.SIGNAL_FLARES, device_commands.Button_8, 288)
elements["PTR-LSPE-BTN-RCKT21"].sound 	= {{SOUND_FLARES_ON,SOUND_FLARES_OFF},{SOUND_FLARES_ON,SOUND_FLARES_OFF}}
elements["PTR-LSPE-BTN-RCKT22"]			= default_2_position_tumb(_("Signal Flares Cassette 2 Launch Green Button"),	devices.SIGNAL_FLARES, device_commands.Button_7, 289)
elements["PTR-LSPE-BTN-RCKT22"].sound 	= {{SOUND_FLARES_ON,SOUND_FLARES_OFF},{SOUND_FLARES_ON,SOUND_FLARES_OFF}}
elements["PTR-LSPE-BTN-RCKT23"]			= default_2_position_tumb(_("Signal Flares Cassette 2 Launch Yellow Button"),	devices.SIGNAL_FLARES, device_commands.Button_10, 290)
elements["PTR-LSPE-BTN-RCKT23"].sound 	= {{SOUND_FLARES_ON,SOUND_FLARES_OFF},{SOUND_FLARES_ON,SOUND_FLARES_OFF}}
elements["PTR-LSPE-BTN-RCKT24"]			= default_2_position_tumb(_("Signal Flares Cassette 2 Launch White Button"),	devices.SIGNAL_FLARES, device_commands.Button_9, 291)
elements["PTR-LSPE-BTN-RCKT24"].sound 	= {{SOUND_FLARES_ON,SOUND_FLARES_OFF},{SOUND_FLARES_ON,SOUND_FLARES_OFF}}

-- KO-50 Heater
elements["PTR-RPE-BTN-KO50START"]	= default_button(_("KO-50 Heater Start Button - Push to start"), devices.HEATER_KO50, device_commands.Button_1, 464)
elements["PTR-RPE-TMB-KO50VENT"]	= default_2_position_tumb(_("KO-50 Fan Switch, ON/OFF"), devices.HEATER_KO50, device_commands.Button_2, 467)
elements["PTR-RPE-TMB-KO50MODE"]	= default_3_position_tumb(_("KO-50 Heater Mode Switch, MANUAL/OFF/AUTO"), devices.HEATER_KO50, device_commands.Button_3, 465, false)
elements["PTR-RPE-TMB-KO50FILL"]	= default_3_position_tumb(_("KO-50 Heater Regime Switch, FILLING/FULL/MEDIUM"), devices.HEATER_KO50, device_commands.Button_4, 466, false)
elements["PTR-RPE-LVR-KO50TMP"]		= default_axis_limited(_("KO-50 Target Temperature Knob"), devices.HEATER_KO50, device_commands.Button_5, 468, 0.25, 0.05, true, false, {0,1})

-- SARPP
elements["PTR-LSPE-TMB-CONTR-AUTMAN"]	= default_2_position_tumb(_("SARPP-12 Mode Switch, MANUAL/AUTO"),	devices.SARPP12DM, device_commands.Button_1, 315)

-- Recorder P-503B
elements["PTR-LSPE-TMB-REC"]	= default_2_position_tumb(_("Recorder P-503B Power Switch, ON/OFF"),	devices.RECORDER_P503B, device_commands.Button_1, 305)
elements["PTR-LSPE-LVR-LGTSEL"]	= default_axis_limited(_("Recorder P-503B Backlight Brightness Knob"),	devices.RECORDER_P503B, device_commands.Button_2, 308, 0.0, 0.1, false, false, {0, 0.8})

-- IFF
elements["PTR-LSPE-LVR-MODE"]			= multiposition_switch_limited(_("IFF Transponder Mode Selector Switch, AUTO/KD/+-15/KP"),	devices.IFF, device_commands.Button_1, 304, 4, 0.1, false, 0)
elements["PTR-LSPE-TMB-RADIO-WRK"]		= default_2_position_tumb(_("IFF Transponder Device Selector Switch, WORK/RESERVE"),		devices.IFF, device_commands.Button_2, 301)
elements["PTR-LSPE-TMB-RADIO-MODE12"]	= default_2_position_tumb(_("IFF Transponder Device Mode Switch, 1/2"),						devices.IFF, device_commands.Button_3, 300)
elements["PTR-LSPE-CVR-EMRG-ERASE"]		= tumb_cover(_("IFF Transponder Erase Button Cover, OPEN/CLOSE"),				devices.IFF, device_commands.Button_4, 296)
elements["PTR-LSPE-BTN-EMRG-ERASE"]		= default_button(_("IFF Transponder Erase Button - Push to erase"),							devices.IFF, device_commands.Button_5, 297)
elements["PTR-LSPE-CVR-EMRG-MAYDAY"]	= tumb_cover(_("IFF Transponder Disaster Switch Cover, OPEN/CLOSE"),			devices.IFF, device_commands.Button_6, 298)
elements["PTR-LSPE-TMB-EMRG-MAYDAY"]	= default_2_position_tumb(_("IFF Transponder Disaster Switch, ON/OFF"),						devices.IFF, device_commands.Button_7, 299)


-- jump descent siren
elements["PTR-LSPE-TMB-AIR-SIREN"]	= default_button(_("Alarm Bell Button - Push to turn on"), devices.MISC_SYSTEMS_INTERFACE, device_commands.Button_1, 323)


--
for i,o in pairs(elements) do
	if  o.class[1] == class_type.TUMB or 
	   (o.class[2]  and o.class[2] == class_type.TUMB) or
	   (o.class[3]  and o.class[3] == class_type.TUMB)  then
	   o.updatable = true
	   o.use_OBB   = true
	end
end