Jump to content

Export.lua - LoGetMechInfo


Recommended Posts

You need to get the correct IDargument for the gears in each airplane. All of then are diferent, so you need to check for the airplane name aswell.

Usually you can get thsi information from the mainpanel_init.lua

 

For example, in mainpanel_init.lua of the KA50:

 

-- LGCP - Landing gear control panel

LGCP_Lamp_NoseGearUp					= CreateGauge()
LGCP_Lamp_NoseGearUp.arg_number			= 63
LGCP_Lamp_NoseGearUp.input				= {0.0, 1.0}
LGCP_Lamp_NoseGearUp.output				= {0.0, 1.0}
LGCP_Lamp_NoseGearUp.controller			= controllers.LGCP_Lamp_NoseGearUp

LGCP_Lamp_NoseGearDown					= CreateGauge()
LGCP_Lamp_NoseGearDown.arg_number		= 64
LGCP_Lamp_NoseGearDown.input			= {0.0, 1.0}
LGCP_Lamp_NoseGearDown.output			= {0.0, 1.0}
LGCP_Lamp_NoseGearDown.controller		= controllers.LGCP_Lamp_NoseGearDown

LGCP_Lamp_RightMainGearUp				= CreateGauge()
LGCP_Lamp_RightMainGearUp.arg_number	= 61
LGCP_Lamp_RightMainGearUp.input			= {0.0, 1.0}
LGCP_Lamp_RightMainGearUp.output		= {0.0, 1.0}
LGCP_Lamp_RightMainGearUp.controller	= controllers.LGCP_Lamp_RightMainGearUp

LGCP_Lamp_RightMainGearDown				= CreateGauge()
LGCP_Lamp_RightMainGearDown.arg_number	= 62
LGCP_Lamp_RightMainGearDown.input		= {0.0, 1.0}
LGCP_Lamp_RightMainGearDown.output		= {0.0, 1.0}
LGCP_Lamp_RightMainGearDown.controller	= controllers.LGCP_Lamp_RightMainGearDown

LGCP_Lamp_LeftMainGearUp				= CreateGauge()
LGCP_Lamp_LeftMainGearUp.arg_number		= 59
LGCP_Lamp_LeftMainGearUp.input			= {0.0, 1.0}
LGCP_Lamp_LeftMainGearUp.output			= {0.0, 1.0}
LGCP_Lamp_LeftMainGearUp.controller		= controllers.LGCP_Lamp_LeftMainGearUp

LGCP_Lamp_LeftMainGearDown				= CreateGauge()
LGCP_Lamp_LeftMainGearDown.arg_number	= 60
LGCP_Lamp_LeftMainGearDown.input		= {0.0, 1.0}
LGCP_Lamp_LeftMainGearDown.output		= {0.0, 1.0}
LGCP_Lamp_LeftMainGearDown.controller	= controllers.LGCP_Lamp_LeftMainGearDown

LGCP_gear_handle				= CreateGauge()
LGCP_gear_handle.arg_number		= 65
LGCP_gear_handle.input			= {0.0, 1.0}
LGCP_gear_handle.output			= {0.0, 1.0}
LGCP_gear_handle.controller		= controllers.LGCP_gear_handle

 

So you need to get the values from the argument numbers like this:

 

mainPanel = GetDevice(0)
Lamp_NoseGearUp = mainPanel:get_argument_value(63)
Lamp_NoseGearDown = mainPanel:get_argument_value(64)
Lamp_RightMainGearUp = mainPanel:get_argument_value(61)
Lamp_RightMainGearDown = mainPanel:get_argument_value(62)
Lamp_LeftMainGearUp = mainPanel:get_argument_value(59)
Lamp_LeftMainGearDown = mainPanel:get_argument_value(60)
gear_handle = mainPanel:get_argument_value(65)

 

 

Hope thats help.

Link to comment
Share on other sites

You need to get the correct IDargument for the gears in each airplane. All of then are diferent, so you need to check for the airplane name aswell.

Usually you can get thsi information from the mainpanel_init.lua

 

For example, in mainpanel_init.lua of the KA50:

 

-- LGCP - Landing gear control panel

LGCP_Lamp_NoseGearUp					= CreateGauge()
LGCP_Lamp_NoseGearUp.arg_number			= 63
LGCP_Lamp_NoseGearUp.input				= {0.0, 1.0}
LGCP_Lamp_NoseGearUp.output				= {0.0, 1.0}
LGCP_Lamp_NoseGearUp.controller			= controllers.LGCP_Lamp_NoseGearUp

LGCP_Lamp_NoseGearDown					= CreateGauge()
LGCP_Lamp_NoseGearDown.arg_number		= 64
LGCP_Lamp_NoseGearDown.input			= {0.0, 1.0}
LGCP_Lamp_NoseGearDown.output			= {0.0, 1.0}
LGCP_Lamp_NoseGearDown.controller		= controllers.LGCP_Lamp_NoseGearDown

LGCP_Lamp_RightMainGearUp				= CreateGauge()
LGCP_Lamp_RightMainGearUp.arg_number	= 61
LGCP_Lamp_RightMainGearUp.input			= {0.0, 1.0}
LGCP_Lamp_RightMainGearUp.output		= {0.0, 1.0}
LGCP_Lamp_RightMainGearUp.controller	= controllers.LGCP_Lamp_RightMainGearUp

LGCP_Lamp_RightMainGearDown				= CreateGauge()
LGCP_Lamp_RightMainGearDown.arg_number	= 62
LGCP_Lamp_RightMainGearDown.input		= {0.0, 1.0}
LGCP_Lamp_RightMainGearDown.output		= {0.0, 1.0}
LGCP_Lamp_RightMainGearDown.controller	= controllers.LGCP_Lamp_RightMainGearDown

LGCP_Lamp_LeftMainGearUp				= CreateGauge()
LGCP_Lamp_LeftMainGearUp.arg_number		= 59
LGCP_Lamp_LeftMainGearUp.input			= {0.0, 1.0}
LGCP_Lamp_LeftMainGearUp.output			= {0.0, 1.0}
LGCP_Lamp_LeftMainGearUp.controller		= controllers.LGCP_Lamp_LeftMainGearUp

LGCP_Lamp_LeftMainGearDown				= CreateGauge()
LGCP_Lamp_LeftMainGearDown.arg_number	= 60
LGCP_Lamp_LeftMainGearDown.input		= {0.0, 1.0}
LGCP_Lamp_LeftMainGearDown.output		= {0.0, 1.0}
LGCP_Lamp_LeftMainGearDown.controller	= controllers.LGCP_Lamp_LeftMainGearDown

LGCP_gear_handle				= CreateGauge()
LGCP_gear_handle.arg_number		= 65
LGCP_gear_handle.input			= {0.0, 1.0}
LGCP_gear_handle.output			= {0.0, 1.0}
LGCP_gear_handle.controller		= controllers.LGCP_gear_handle

 

So you need to get the values from the argument numbers like this:

 

mainPanel = GetDevice(0)
Lamp_NoseGearUp = mainPanel:get_argument_value(63)
Lamp_NoseGearDown = mainPanel:get_argument_value(64)
Lamp_RightMainGearUp = mainPanel:get_argument_value(61)
Lamp_RightMainGearDown = mainPanel:get_argument_value(62)
Lamp_LeftMainGearUp = mainPanel:get_argument_value(59)
Lamp_LeftMainGearDown = mainPanel:get_argument_value(60)
gear_handle = mainPanel:get_argument_value(65)

 

 

Hope thats help.

 

Thanks so much Capt Zeen. Perfect example! Was hoping the export master would see this :)


Edited by laertesson
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...