DragonflightDesign
Resource contributor
- Messages
- 1,369
- Country

The fuel tank selectors are listed as enum with a data run of zero to twenty. I thought (incorrectly) that the enum for each selector would return a zero or one (off or on). Consequently, I declared the datatype as Int32 .
The structure is registered:-
It's being checked at 1Sec intervals (CLIENT_1SEC).
The return is garbage (I'm good at getting returns full of garbage
)
Although this is an external module written in vb.Net, I'm pretty sure that my foul-up is language-independant. Anyone any idea what I should be displaying the fuel selector enumeration as?
Thank you
Code:
p3d_simconnect.AddToDataDefinition(P3Data.DEFINE_FUEL_SELECTORS, "FUEL TANK SELECTOR", "enum", LockheedMartin.Prepar3D.SimConnect.SIMCONNECT_DATATYPE.INT32, 0, 26)
Code:
Structure Fuel_Selectors
Public off As Integer
Public all As Integer
Public left As Integer
Public right As Integer
Public left_aux As Integer
Public right_aux As Integer
Public center As Integer
Public center2 As Integer
Public center3 As Integer
Public external1 As Integer
Public external2 As Integer
Public right_tip As Integer
Public left_tip As Integer
Public crossfeed As Integer
Public crossfeedLeftToRight As Integer
Public crossfeedRightToLeft As Integer
Public both As Integer
Public external As Integer
Public isolate As Integer
Public left_main As Integer
Public right_main As Integer
End Structure
Code:
p3d_simconnect.RegisterDataDefineStruct(Of Fuel_Selectors)(P3Data.DEFINE_FUEL_SELECTORS)
Code:
Friend Sub p3d_simconnect_OnRecvSimobjectDataBytype(ByVal sender As SimConnect, ByVal data As SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE)
Select Case data.dwRequestID
Case P3Data.REQUEST_FUEL_SELECTORS
' Fuel selectors
Dim fuel_selector As Fuel_Selectors = CType(data.dwData(0), Fuel_Selectors)
' Data
frmMain.lvDisplay.Items.Add("Off")
frmMain.lvDisplay.Items(0).SubItems.Add(fuel_selector.off.ToString)
frmMain.lvDisplay.Items.Add("All")
frmMain.lvDisplay.Items(1).SubItems.Add(fuel_selector.all.ToString)
frmMain.lvDisplay.Items.Add("Left")
frmMain.lvDisplay.Items(2).SubItems.Add(fuel_selector.left.ToString)
{etc.}
Although this is an external module written in vb.Net, I'm pretty sure that my foul-up is language-independant. Anyone any idea what I should be displaying the fuel selector enumeration as?
Thank you



