- Messages
- 30
- Country

Possibly somebody can help me here.
I am trying to change the choosen tank through the simconnect interface:
Here just some snipets to show the way I try to do it (not complete to run, just for the principle):
[Flags]
public enum Tanks
{
None = 0,
Center1 = 1,
Center2 = 2,
Center3 = 4,
LeftMain = 8,
LeftAux = 16,
LeftTip = 32,
RightMain = 64,
RightAux = 128,
RightTip = 256,
External1 = 512,
External2 = 1024
}
....
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
public struct structSetTankSelector
{
public Tanks RECIP_ENG_FUEL_TANKS_USED_1;
};
....
sc.AddToDataDefinition(eCockpitId.structSetTankSelector, "RECIP ENG FUEL TANKS USED:1", "mask", SIMCONNECT_DATATYPE.INT32, 0.0F, 0);
sc.RegisterDataDefineStruct<structSetFuelData>(eCockpitId.structSetTankSelector);
...
The call:
structSetTankSelector sts = new structSetTankSelector();
sts.RECIP_ENG_FUEL_TANKS_USED_1 = Tanks.LeftMain;
sc.SetDataOnSimObject(eCockpitId.structSetTankSelector, SimConnect.SIMCONNECT_OBJECT_ID_USER, Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATA_SET_FLAG.DEFAULT, sts);
Now what happens is, one frame the choosen tank gets selected. After that it switch back to the original value;.
This I could confirm with different values. Also I tried the standard Extra (by the look the tank selector is visually not changing) and my own plane which does not have currently a visual tank selector in the 3d model.
My guess is, that RECIP ENG FUEL TANKS USED is the actually valid fuel source, instead of the tank selector itselve. This would explain the behavior.
Problem: Other values possibly solving my problem are readonly.
Do you know how I can influence the tank selector?
Regards,
Micha
I am trying to change the choosen tank through the simconnect interface:
Here just some snipets to show the way I try to do it (not complete to run, just for the principle):
[Flags]
public enum Tanks
{
None = 0,
Center1 = 1,
Center2 = 2,
Center3 = 4,
LeftMain = 8,
LeftAux = 16,
LeftTip = 32,
RightMain = 64,
RightAux = 128,
RightTip = 256,
External1 = 512,
External2 = 1024
}
....
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
public struct structSetTankSelector
{
public Tanks RECIP_ENG_FUEL_TANKS_USED_1;
};
....
sc.AddToDataDefinition(eCockpitId.structSetTankSelector, "RECIP ENG FUEL TANKS USED:1", "mask", SIMCONNECT_DATATYPE.INT32, 0.0F, 0);
sc.RegisterDataDefineStruct<structSetFuelData>(eCockpitId.structSetTankSelector);
...
The call:
structSetTankSelector sts = new structSetTankSelector();
sts.RECIP_ENG_FUEL_TANKS_USED_1 = Tanks.LeftMain;
sc.SetDataOnSimObject(eCockpitId.structSetTankSelector, SimConnect.SIMCONNECT_OBJECT_ID_USER, Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATA_SET_FLAG.DEFAULT, sts);
Now what happens is, one frame the choosen tank gets selected. After that it switch back to the original value;.
This I could confirm with different values. Also I tried the standard Extra (by the look the tank selector is visually not changing) and my own plane which does not have currently a visual tank selector in the 3d model.
My guess is, that RECIP ENG FUEL TANKS USED is the actually valid fuel source, instead of the tank selector itselve. This would explain the behavior.
Problem: Other values possibly solving my problem are readonly.
Do you know how I can influence the tank selector?
Regards,
Micha
