Recording flights: aircraft variables - or events (example: flap position)?

Hello,

The idea is clear, but how did you implement that? In your code I see that you seem to send the entire AircraftPosition record, in Connector.cs:

    public void Set(AircraftPositionSetStruct position)
    {
        simconnect.SetDataOnSimObject(DEFINITIONS.AircraftPositionSet, 0, SIMCONNECT_DATA_SET_FLAG.DEFAULT, position);
    }

(Just like I do currently, for that matter). I also noticed that you seem to - somehow - dynamically create (“generate”, e.g. in your ModelGenerator.cs) your request record (in ConnectorGenerator.cs), based on your annotated Structs.cs (annotated with the “SimConnectVariableAttribute”).

What I do not yet understand is wheter you have some logic to include/exclude simulation variables that have changed or not (“nullified”), and if so, whether you then dynamically register each combination of variables to be sent with SimConnect - but I just noticed that this would not work, as the number of combinations, given n variables, would be, uh n! (“n factorial”)? I don’t think you can even register that many request data structures with SimConnect.

So how exactly do you “prevent sending nullified variables”? Or are you even saying that the SimConnect client library itself “compresses” the outgoing request, by not sending NULL values?

I do understand how you send events, you only send them if the value has actually changed (or “different from the expected value”), in your TriggerEvents (generated in ConnectorGenerators.cs).

By the way I already noticed your announcement and project earlier. In fact, I made a reference to your project from mine already :wink:

GitHub - till213/SkyDolly: Sky Dolly connects with Flight Simulator 2020 and records the flight path and basic instruments for replay.

Under “Related Projects”. And I already… uh… copied one of your ideas, namely to “freeze” the latitute, longitude and altitude values during playback (because I noticed the same “micro-movements”, the simulation trying to “fight” my requested position values etc., especially when setting low sample/replay rates).

On the other hand you may want to have a look at my SkyMath.h (https://github.com/till213/SkyDolly/blob/main/src/Kernel/src/SkyMath.h) source, specifically with regards to “modulo 180|360” calculations related to interpolation. I actually tested your application quickly and noticed that during airplay your aircraft does a quick “visual glitch” whenever a 180 / 360 degree boundary is “crossed” (so e.g. heading from 359 to 0 - of course that is just a 1 degree difference, and not 359 degrees).

And I no Hermite cubic interpolation, not just linear (as I remember you do in your code). So feel free to “copy back” :wink:

Cheers