albar965 / littlenavmap

Little Navmap is a free flight planner, navigation tool, moving map, airport search and airport information system for Flight Simulator X, Microsoft Flight Simulator 2020, Prepar3D and X-Plane.
https://albar965.github.io/littlenavmap.html
GNU General Public License v3.0
1.29k stars 164 forks source link

Flight plan transfer to flight simulator and back #35

Closed albar965 closed 6 months ago

albar965 commented 8 years ago

Once the flight plan changes in Navmap automatically copy it to FSX computer and call SimConnect_FlightPlanLoad.

If a flight plan changes in the simulator load it: SimConnect_SubscribeToSystemEvent with FlightPlanActivated parameter.

Check if this is also doable for X-Plane.

daheise commented 3 years ago

I notice this feature is from 2016 - given the release of MSFS2020, is it safe to assume support for it is planned, and not just FSX?

albar965 commented 3 years ago

This even more important for MSFS but needs some time. Probably have to change the communication protocol.

Kebas53 commented 3 years ago

Would like this option very much for MSFS2020. 1 vote for me

daheise commented 3 years ago

So, I'm trying some naive stuff using Python-SimConnect with MSFS2020 1.9.5.0 that might save you some troubleshooting down the line. Here is my naive code:

sm = SimConnect()
print(sm.load_flight_plan("path to .pln"))
sleep(5)
sm.exit()
quit()

I'm testing with the MSFS2020 Cessna 172 G1000.

I have found a few interesting things.

  1. If I load up a plane with no flight plan, and run this code, everything populates into the G1000 and everything is happy.
  2. If I load a flight plan, and then attempt to load a new flight plan over the top, the CDI/PFD updates accordingly, but not the FPL in the G1000. The old waypoints remain, but none are shown as active.

In situation (2) if I delete the flight plan, I can load up a new one but the same issue persists - no waypoints displayed, no active leg.

Now, if I reload the aircraft (using developer mode), whatever the last plan I called with sm.load_flight_plan appears correctly. However, this comes with other MSFS oddities like the avionics brightness being nonadjustable (at least on the C172 G1000) [This was a mod issue].

albar965 commented 3 years ago

@daheise Plenty thanks for the research. I looks like MSFS needs more time to get this stable. 😞 Quite annoying there is no way to change the flight plan without restart.

daheise commented 3 years ago

There's an issue on the MSFS forums here that can be voted on: https://forums.flightsimulator.com/t/better-support-for-simconnect-flightplanload/307388

albar965 commented 3 years ago

Thanks. Voted. Will watch this.

albar965 commented 6 months ago

Closing since new #1112 is a duplicate.