Sign in to follow this  
Guest Karl R Pettersen

Turning Off Gauges/ Windows Questions

Recommended Posts

My questions:1. Do gauges in a FS "Window" other than the Main Window automatically open when the aircraft loads? Say, for example, I have a window called "Radio Stack". Will the gauges in Radio Stack open or become active even before I open the Radio Stack Window?2. For the sake of theory, is it possible to "shut down" or de-load a gauge and make it dissapear after it's already loaded? Let's say I have 5 gauges in my Radio Stack Window. Is it possible to assign a mouse click somewhere in the Window so that one of the gauges in the Radio Stack will totally shut down and no longer be accessed by FS?

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

As far as I know, here are the answers I can give you:1. Yes, all the gauges, even the ones that are in a separate window, are loaded when the panel is loaded. The gauges are loaded but they are not accessed until you popup the corresponding window. It means they don't consume CPU time. If you develop gauges in C, you can define a callback function that is called with a "service_id" parameter. When the gauge is loaded, the callback is called and the service_id has the value "PANEL_SERVICE_CONNECT_TO_WINDOW". It means that the gauge is loaded and ready to be used. When you popup the window, the callback is called with the value "PANEL_SERVICE_PRE_DRAW", which means the gauge is actually drawn. At this time, it takes CPU time for drawing.2. No. As soon as a gauge is loaded, it can't be unloaded unless you load another panel. It maybe possible to do this using the Windows SDK, because a gauge is a DLL, but I don't know if FS will be table in that case.Hope this helps...Eric

Share this post


Link to post
Share on other sites

Note that I only "program" in xml, not C gauges.1. Well, actually yes and no. I think they are "loaded and locked" by FS from the moment the aircraft is loaded. However, they may not be actually run until you open the window it is put on. I.e. "aotomatic code" might not start to run (or init) properly until the window/gauge has been put onto screen once. I have modified the cessna 182 panel so that I can fly it from vc only. When I load my (also modified) default flight, I start in spot view and enter the virtual cockpit from there. Now, unless I put one of the critical gauges into an invisible spot on the virtual cockpit, the gauge will not work properly. Even if the gauge is placed on the normal 2d panel.2. I don't believe so. You can assign a clickspot to a "reload_panels" event, in which the lock will be unlocked, which in turn allows you to write to the file while it is being edited. Saves a LOT of time btw. In order to "shut down" a gauge, you have to make it react properly on a user variable.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this