Hi,
Maybe the description below is of some help to people that create XML gauges.
In many of my gauges, I need to initialise certain aircraft functions to a defined value.
The simplest way is to issue events at the first gauge schedule; however, in many cases FSX simply ignores such events then.
My environment: Windows7-64bit (No SSD), FSX-Accelleration (but the same problem occurs with e.g. FS9 on WindowsXP).
For the test, I use a saved flight and want to set PropPitch to an initial value (20 percent).
An XML gauge in the panel.cfg includes the following code:
Meaning that the PropPitch event is given once, at the first schedule of the gauge.
The problem: FSX ignores this event in many cases, depending on how you load, Windows cache, etc.....
In fact, the code above ONLY works (on my PC), when I load the saved flight, let it stabilize, and then reload the aircraft.
Some examples to get it working (exact values are specific for my PC and this particular flight).
- After a rebooted PC, start FSX the first time and load the flight the first time: the value "0" in the code example needs to be at least "140" (140 / 18.2 = 7.6 sec after gauge load) for FSX to see/execute the event.
- When starting FSX again, and loading the flight the first time, the value needs to be at least "45".
- When the flight is loaded, and I reload the flight, the value needs to be at least "35".
So the "deaf time for events" strongly depends on how/when you load, cache, probably PC-performance, where the gauge is defined in the panel.cfg, etc .....
I don't know if this is specific for events given in XML code, or if it also applies to gauges programmed in C/C++/C# ..... But I'm curious to know....
(Please, let's not start another pro/con XML programming debate here .. LoL)
The solution I use in my XML gauges that rely on proper aircraft-initialisation:
- After gauge load, give a specific event at every gauge schedule.
- Await the functional initialisation, until the result of the event is actually reflected in the corresponding XML variable.
As a generic solution, I use an initialisation gauge with the SeatBelt function:
Just as example, but this has never failed me; meaning that I'm sure that FSX is ready to receive/execute events at the shortest possible time depending on how the aircraft/flight is loaded ..
Hope this helps other designers ....
Best regards, Rob
Maybe the description below is of some help to people that create XML gauges.
In many of my gauges, I need to initialise certain aircraft functions to a defined value.
The simplest way is to issue events at the first gauge schedule; however, in many cases FSX simply ignores such events then.
My environment: Windows7-64bit (No SSD), FSX-Accelleration (but the same problem occurs with e.g. FS9 on WindowsXP).
For the test, I use a saved flight and want to set PropPitch to an initial value (20 percent).
An XML gauge in the panel.cfg includes the following code:
Code:
<Update Hidden="Yes">
(L:VertInit,number) d ++ (>L:VertInit,number) 0 ==
if{ 0.20 16384 * (>K:PROP_PITCH_SET) }
</Update>
Meaning that the PropPitch event is given once, at the first schedule of the gauge.
The problem: FSX ignores this event in many cases, depending on how you load, Windows cache, etc.....
In fact, the code above ONLY works (on my PC), when I load the saved flight, let it stabilize, and then reload the aircraft.
Some examples to get it working (exact values are specific for my PC and this particular flight).
- After a rebooted PC, start FSX the first time and load the flight the first time: the value "0" in the code example needs to be at least "140" (140 / 18.2 = 7.6 sec after gauge load) for FSX to see/execute the event.
- When starting FSX again, and loading the flight the first time, the value needs to be at least "45".
- When the flight is loaded, and I reload the flight, the value needs to be at least "35".
So the "deaf time for events" strongly depends on how/when you load, cache, probably PC-performance, where the gauge is defined in the panel.cfg, etc .....
I don't know if this is specific for events given in XML code, or if it also applies to gauges programmed in C/C++/C# ..... But I'm curious to know....
(Please, let's not start another pro/con XML programming debate here .. LoL)
The solution I use in my XML gauges that rely on proper aircraft-initialisation:
- After gauge load, give a specific event at every gauge schedule.
- Await the functional initialisation, until the result of the event is actually reflected in the corresponding XML variable.
As a generic solution, I use an initialisation gauge with the SeatBelt function:
Code:
<Update Frequency="2"/>
<Element>
<Select>
<Value>
(L:RCB_FSX_INIT,bool) !
if{
(>K:CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE)
(A:CABIN SEATBELTS ALERT SWITCH,bool)
if{ 1 (>L:RCB_FSX_INIT,bool) }
}
</Value>
</Select>
</Element>
Hope this helps other designers ....
Best regards, Rob


