Detecting a change in the Flight Plan.

WebSimConnect

Resource contributor
#1
Is there a clean way to detect that the flight plan was modified ? Currently I read FPL in the XML with specified frequency and transfer it to C++ code then I compare with the previous entries. This solution looks a bit weird to me, so is there a batter way to detect the FPL change ?
 
#2
Hi Marcin,

I imagine that I'm not going to think of anything you haven't already considered, but nothing comes to mind such as an existing variable that says a flight plan was changed, or how many changes were made. So, like you, I think you have to come up with a way to compare the current FP to a previous state. If you need to know only if it was changed, but not what changes were made, I'd probably start by looking at FlightPlanWaypointDistanceRemaining at FlightPlanWaypointIndex=0. That gives the FP total flight distance. Store that number at the beginning and whenever it changes, the FP has changed. Could a FP change without affecting total distance? Conceivably, but not likely.

To be more thorough, I guess you could also take a look at FlightPlanFlightPlanType to see if a change was made from VFR to IFR which would not change total distance. For your purposes, this may not be relevant, however.

By the way, I presume that you're not talking about approach changes ... just flight plan changes.

Bob
 

WebSimConnect

Resource contributor
#3
Thanks Bob. I will look at your suggestions. You are the master of GPS module :)

By the way, I presume that you're not talking about approach changes ... just flight plan changes.
no, this I have using simconnect with GPS APPROACH APPROACH ID and GPS APPROACH AIRPORT ID.

The good thing about them is that simconnect triggers events whenever they change. Something I miss for Flight Plan.

Marcin
 

ollyau

Resource contributor
#4
Does SimConnect_SubscribeToSystemEvent with the FlightPlanActivated (or FlightPlanDeactivated) event name do what you want? You'll only get a filename, but at least you don't need to have a periodic request?
 

WebSimConnect

Resource contributor
#5
Does SimConnect_SubscribeToSystemEvent with the FlightPlanActivated (or FlightPlanDeactivated) event name do what you want? You'll only get a filename, but at least you don't need to have a periodic request?
I am not sure if it gets triggered when FPL is modified through XML gauge and Map variables. I'll try that, thanks for a hint.
 
#6
Marcin, I am looking at your work and it looks amazing. I have a thought about using it to try an project rain on the vc windscreen in fsx. I would love to hear your thoughts on this and if it has been tried before.
Regards, TJ
 
#8
I have seen it but I don't think that was quite what I am aiming for. I am going to try and use your technology for FSX. My question is do you think I can project a video with an alpha channel onto a plane therefore rendering anything in the video in black completely transparent?
Regards, TJ
 

WebSimConnect

Resource contributor
#9
rendering on texture ( I guess this is what you want to achieve) I did only for P3D V2+. For FSX I only use gauges rendering.

Also, note a performance issue. If you want to play video on 1024x1024 texture it will be a FPS killer. That's why TDFi I guess did it by applying shader on the transparent texture representing windscreen ... and as far as I am concerned this can be done only for P3D.

anyway, in FSX you can apply video with alpha channel (not black pixels) on gauges inside VC, on P3D you can apply video on VC or plane textures or on textures in the outside world, as in my "Church" example.
 
#10
Ok sir thank you for taking the time to reply, I will have a bit of a play around and if anything good comes of it, I will let you know. Thank you for developing such revolutionary technology, it opens up many avenues for developers to pursue.
Kind regards,
TJ
 
Top