• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS20 RECIP ENG FUEL TANKS USED:1

Messages
30
Country
germany
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
 
Ok, found a solution. Need to go with the "obsolet" Key Events:
simconnect.MapClientEventToSimEvent(EVENTS.FUEL_SELECTOR_OFF, "FUEL_SELECTOR_OFF");
simconnect.MapClientEventToSimEvent(EVENTS.FUEL_SELECTOR_LEFT, "FUEL_SELECTOR_LEFT");
simconnect.MapClientEventToSimEvent(EVENTS.FUEL_SELECTOR_RIGHT, "FUEL_SELECTOR_RIGHT");
simconnect.MapClientEventToSimEvent(EVENTS.FUEL_SELECTOR_CENTER, "FUEL_SELECTOR_CENTER");

simconnect.TransmitClientEvent(0, EVENTS.FUEL_SELECTOR_OFF, 1, GROUP_PRIORITIES.SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY);
 
I believe you can also use the FUEL_SELECTOR_SET event and send the index of the desired tank.

FUEL_TANK_SELECTOR_OFF = 0
FUEL_TANK_SELECTOR_ALL = 1
FUEL_TANK_SELECTOR_LEFT = 2
FUEL_TANK_SELECTOR_RIGHT = 3
FUEL_TANK_SELECTOR_LEFT_AUX = 4
FUEL_TANK_SELECTOR_RIGHT_AUX = 5
FUEL_TANK_SELECTOR_CENTER = 6
FUEL_TANK_SELECTOR_CENTER2 = 7
FUEL_TANK_SELECTOR_CENTER3 = 8
FUEL_TANK_SELECTOR_EXTERNAL1 = 9
FUEL_TANK_SELECTOR_EXTERNAL2 = 10
FUEL_TANK_SELECTOR_RIGHT_TIP = 11
FUEL_TANK_SELECTOR_LEFT_TIP = 12
FUEL_TANK_SELECTOR_CROSSFEED = 13
FUEL_TANK_SELECTOR_CROSSFEED_L2R = 14
FUEL_TANK_SELECTOR_CROSSFEED_R2L = 15
FUEL_TANK_SELECTOR_BOTH = 16
FUEL_TANK_SELECTOR_EXTERNAL_ALL = 17
FUEL_TANK_SELECTOR_ISOLATE = 18
 
Back
Top