I am porting the Tu-154B-2 from X-Plane, for which I write an engine that can simulate "directly rewritten to C" LUA scripts, and executed it as a QT application.
And at the moment I have:
-Completely rewritten Datarefs;
-The "core" of the engine itself, which executes the logic of the systems in separate threads;
-10 rewritten systems, including a time period counting system.
Now the most difficult part has come - data exchange via SimConnect.
Actually, I would like to know how to better ensure data exchange and work with SimConnect.
Now I have an idea that Time Logic is called only after updating the SimConnect survey, which can be set to a period in the form of sending data every frame, and in the same function immediately read the current time and period, but is this a good option, and how can it be written in code?
And current Time Logic:
SIM_TIME.total_running_time_sec - is what I want from Simulator.
And at the moment I have:
-Completely rewritten Datarefs;
-The "core" of the engine itself, which executes the logic of the systems in separate threads;
-10 rewritten systems, including a time period counting system.
Now the most difficult part has come - data exchange via SimConnect.
Actually, I would like to know how to better ensure data exchange and work with SimConnect.
Now I have an idea that Time Logic is called only after updating the SimConnect survey, which can be set to a period in the form of sending data every frame, and in the same function immediately read the current time and period, but is this a good option, and how can it be written in code?
And current Time Logic:
SIM_TIME.total_running_time_sec - is what I want from Simulator.