I want to know the latest way to get the active flight plan on the G1000 loaded in sim.
I have tried the following code but it only gives me what was configured before loading the flight and doesn’t reflect any changes made after (via the avionics):
this.listener_atc = RegisterViewListener("JS_LISTENER_FLIGHTPLAN");
Coherent.call('LOAD_CURRENT_ATC_FLIGHTPLAN');
Coherent.call("GET_FLIGHTPLAN").then((flightplan_data) => {
callback(flightplan_data);
});
I have also tried this. It doesn’t give me what’s in the avionics either:
this.listener_generic = RegisterViewListener("JS_LISTENER_FLIGHT_PLAN");
this.listener_generic.on("UpdateFlightPlan", (flightplan_data) => {
callback(flightplan_data);
});
this.listener_generic.trigger("REQUEST_FLIGHT_PLAN");
Thank you!
Keven