Paul Domingue
Resource contributor
- Messages
- 1,532
- Country

Is it possible to set the default startup of a gauge on aircraft load so it will reflect what the visual portion of the gauge is showing? I have two 3d gauges with custom code that while working properly default to uncoded settings on aircraft load. The gauges in question are the magneto switch and the fuel valve and both have 75 frames and 4 positions.
Examples;
Fuel valve frame 0 is set to tank 7
frame 25 tank 6
frame 50 tank 8
frame 75 tank 0
On aircraft load the gauge is pointing to 0, tank 7 but the sim is using tank 1 (All). I have to cycle the valve once for it to work correctly.
Similarly the magneto switch starts frame 0 = BOTH then LEFT, RIGHT and OFF. If I save a flight with the mag switch turned off, then on saved flight load the switch will be in the BOTH position but retain the OFF setting from the saved flight. It also needs cycling to return to its proper function.
What's the work around? How do I tell the sim what the correct setting is for these gauges on load and what frame they should start with?
Examples;
Fuel valve frame 0 is set to tank 7
frame 25 tank 6
frame 50 tank 8
frame 75 tank 0
On aircraft load the gauge is pointing to 0, tank 7 but the sim is using tank 1 (All). I have to cycle the valve once for it to work correctly.
Similarly the magneto switch starts frame 0 = BOTH then LEFT, RIGHT and OFF. If I save a flight with the mag switch turned off, then on saved flight load the switch will be in the BOTH position but retain the OFF setting from the saved flight. It also needs cycling to return to its proper function.
What's the work around? How do I tell the sim what the correct setting is for these gauges on load and what frame they should start with?
Code:
<PartInfo>
<Name>j2f-5_switch_mag</Name>
<!-- CCW - BOTH - LEFT - RIGHT - OFF -->
<AnimLength>75</AnimLength>
<Animation>
<Parameter>
<Code>
(L:SelectMagneto, enum)
</Code>
<Lag>100</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Magneto Switch</TooltipText>
<MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown</MouseFlags>
<CallbackCode>
(M:Event) 'RightSingle' scmp 0 ==
(M:Event) 'WheelDown' scmp 0 == or
if{ (L:SelectMagneto, enum) 25 + (>L:SelectMagneto, enum) }
(M:Event) 'LeftSingle' scmp 0 ==
(M:Event) 'WheelUp' scmp 0 == or
if{ (L:SelectMagneto, enum) 25 - (>L:SelectMagneto, enum) }
(L:SelectMagneto, enum) 75 > if{ 75 (>L:SelectMagneto, enum) }
(L:SelectMagneto, enum) 0 < if{ 0 (>L:SelectMagneto, enum) }
(L:SelectMagneto,enum) 0 == if{ (>K:MAGNETO1_BOTH) }
(L:SelectMagneto,enum) 25 == if{ (>K:MAGNETO1_OFF) and (>K:MAGNETO1_LEFT) }
(L:SelectMagneto,enum) 50 == if{ (>K:MAGNETO1_OFF) and (>K:MAGNETO1_RIGHT) }
(L:SelectMagneto,enum) 75 == if{ (>K:MAGNETO1_OFF) }
</CallbackCode>
</MouseRect>
</PartInfo>




