odwdinc / Python-SimConnect

Python interface for MSFS2020 SimConnect.dll
GNU Affero General Public License v3.0
270 stars 107 forks source link

Fix Flag Enums for SimConnect interface #101

Closed Koseng closed 2 years ago

Koseng commented 3 years ago

When using RequestClientData or SetClientData, the Flag Enums do not work. If an Enum is specified in an interface like RequestClientData, Python expects an Int. The current flags deliver DWORDs.

Another problem is, that the Flags are supposed to be used as Bit-Flags. They are supposed to be logically combined. This is not possible with the standard Enum. The following usage needs to be possible:

myFlag = SIMCONNECT_CLIENT_DATA_REQUEST_FLAG.SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED | SIMCONNECT_CLIENT_DATA_REQUEST_FLAG.SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_TAGGED

The PR changes the Flag-Enums to the IntFlag-Enum-Type. Like that everything works.