Thanks Manuel - good to see you still plugging away with FSX development - I found the solution to my problem.
One thing I did discover is that although XML gauges are loaded in the order they appear in the panel.cfg, they then execute in parallel, i.e. you can't assume the init sequence of one gauge has completed before another gauge is loaded. It was a race-condition between the init sections that caused me a problem - I actually have gauges that communicate via shared variables.
All my gauges are XML, and some are >1000 lines. The gauges on the 2D panel and 3D panel could be made effectively different gauges by renaming all my L:variables, but that would mean maintaining two sets of gauges. My first choice would be dump the 2D panel but in the case of a particular project the agreement is to include a 2D panel (flight sim is awash with pilots wanting to keep FS2004 or keep the 2D panel - I can understand why MSoft wanted to start again...).
My gauges typically have an 'init' section:
Code:
(L:B21_variometer_init, bool) ! if{
... initialise some vars
1 (>L:B21_variometer_init, bool)
}
i.e. this section of code only runs once when the gauge is loaded because the update to the init bool causes the code to be skipped after the first iteration.
I actually have another gauge hidden on the panel that contains a variety of config variables (like sink rate at certain speeds to calibrate a variometer), so that when the gauges are ported to another aircraft I edit the config gauge, not all the gauges that depend on those values.
So I had to make sure the config had completed *before* running the init of the dependent gauge, so the correct values were included. The fix was to modify the dependent gauge init section:
Code:
(L:B21_variometer_init, bool) ! if{
(L:B21_config_init, bool) ! if{ quit } // i.e. check init has completed of other gauge
... now initialise vars in this gauge knowing config code has completed
1 (>L:B21_variometer_init, bool)
}
thanks... B21