I'm trying to get a handle on the manner in which the panel system for FS2004 calls C gauge code routines and was wondering if anyone could expand on the following:
#define PANEL_SERVICE_PRE_QUERY 0
#define PANEL_SERVICE_POST_QUERY 1
#define PANEL_SERVICE_PRE_INSTALL 2 // extra_data = resource_handle
#define PANEL_SERVICE_POST_INSTALL 3 // extra_data = resource_handle
#define PANEL_SERVICE_PRE_INITIALIZE 4
#define PANEL_SERVICE_POST_INITIALIZE 5
#define PANEL_SERVICE_PRE_UPDATE 6
#define PANEL_SERVICE_POST_UPDATE 7
#define PANEL_SERVICE_PRE_GENERATE 8 // extra_data = phase
#define PANEL_SERVICE_POST_GENERATE 9 // extra_data = phase
#define PANEL_SERVICE_PRE_DRAW 10
#define PANEL_SERVICE_POST_DRAW 11
#define PANEL_SERVICE_PRE_KILL 12
#define PANEL_SERVICE_POST_KILL 13
#define PANEL_SERVICE_CONNECT_TO_WINDOW 14 // extra_data = PANEL_WND
#define PANEL_SERVICE_DISCONNECT 15 // extra_data = PANEL_WND
#define PANEL_SERVICE_PANEL_OPEN 16
#define PANEL_SERVICE_PANEL_CLOSE 17
Getting a handle on the program flow for C gauge code is essential for me in order to be able to optimise my code. I just need confirmation on exactly when sections of C code are called when using these values in a switch statements. The MS SDK is, as usual, quite useless in this matter. For instance I assumed that the PANEL_SERVICE_PRE_INITIALIZE code was generated once for when a gauge is loaded when an aircraft is selected. Now I hear that it's also generated when you simply switch to and from 2D and 3D virtual views! Is this right? If so the INITIALIZE naming convention is quite counter-intuitive :)
I'm amazed anyone ever discovers how these defines work in the context of the FS2004 panel system seeing as it's part of a hidden system you don't have much control over, coupled with the fact the official SDK is so pitifully documented. For those who have figured these things out, could you share any tips on how you disocvered the inner workings of these service_id values and when they are generated?
I guess I could create a simple gauge that printed text alerts on the screen for each case section that was called, that way you know under what conditions the code sections were processed? I was thinking of doing this but if anyone has already deduced the 'inner workings' of these things already, it would save me a lot of time and potential headaches. Any guidance will be greatly appreciated :)
Grassy arse amigos.


Reply With Quote


Bookmarks