- Messages
- 10,163
- Country

Hey all,
I am making an Autopilot 'hidden gauge' manager. The old AP system on a Lear 24 was odd. You clicked 'ALT' button and the AP would hold ALT. No AP buttons for system on/off, just ALT, HDG, etc.
So I am making a hidden gauge that reads the L:vars and activates/runs the AP commands. (Sounds reasonable and saves me tons of code in the animated switches code in the modeldef.XML.
But I am having issues getting it to fire up. I thought I would show it here to see if anyone can figure out what I am doing wrong.
The system will have 5 triggers, such as ALT, HDG, etc.
If the L:var is active (1) then that system it represents (like ALT hold) should be on, as well as the AP system being powered up. If you turn off a command, the AP should turn off also unless one of the other commands for AP is active.
Draft;
Turn on HDG L:var
* turns on AP system
* turns on HDG Hold
Turn off HDG L:var
* checks to make sure no other AP systems are 'on'
-if on, leave AP system live or active
-els, if no other systems are left on, zero commands active, then AP
is turned off
For some reason the code isn't working. Is there a simple mis-use of code, or is this possible to run an AP manager off of L:var inputs? I would think it is.
Code so far;
Right now, I am just trying to get the ALT to work and I can go from there. I have tried putting the on/off commands in the same Element, but that didn't work, so I split them up, which didn't work either.
Bill
I am making an Autopilot 'hidden gauge' manager. The old AP system on a Lear 24 was odd. You clicked 'ALT' button and the AP would hold ALT. No AP buttons for system on/off, just ALT, HDG, etc.
So I am making a hidden gauge that reads the L:vars and activates/runs the AP commands. (Sounds reasonable and saves me tons of code in the animated switches code in the modeldef.XML.
But I am having issues getting it to fire up. I thought I would show it here to see if anyone can figure out what I am doing wrong.
The system will have 5 triggers, such as ALT, HDG, etc.
If the L:var is active (1) then that system it represents (like ALT hold) should be on, as well as the AP system being powered up. If you turn off a command, the AP should turn off also unless one of the other commands for AP is active.
Draft;
Turn on HDG L:var
* turns on AP system
* turns on HDG Hold
Turn off HDG L:var
* checks to make sure no other AP systems are 'on'
-if on, leave AP system live or active
-els, if no other systems are left on, zero commands active, then AP
is turned off
For some reason the code isn't working. Is there a simple mis-use of code, or is this possible to run an AP manager off of L:var inputs? I would think it is.
Code so far;
Code:
<Gauge Name="Autopilot_Manager" Version="1.1">
<Size X="5" Y="5" />
<Update Hidden="Yes">
<!-- 1 SECOND UPDATE -->
(P:Absolute time,seconds) 1 % 1 > !
if{
(* XML script goes in here *)
(L:LJ24B AUTOPILOT ALT SW, bool) 1 ==
(L:LJ24B AUTOPILOT HDG SW, bool) 1 ==
(L:LJ24B AUTOPILOT APP SW, bool) 1 ==
(L:LJ24B AUTOPILOT HDG SW, bool) 1 ==
(L:LJ24B AUTOPILOT NAV LOC SW, bool) 1 ==
or or or or
if{
1 (>K:AUTOPILOT_ON,bool)
}
els{
1 (>K:AUTOPILOT_OFF,bool)
}
}
<Element>
<Select>
<Value>
(L:LJ24B AUTOPILOT ALT SW, bool) 1 ==
if{
1 (K:AP_PANEL_ALTITUDE_HOLD,bool)
}
</Value>
</Select>
</Element>
<Element>
<Select>
<Value>
(L:LJ24B AUTOPILOT ALT SW, bool) 0 ==
if{
0 (K:AP_PANEL_ALTITUDE_HOLD,bool)
}
</Value>
</Select>
</Element>
</Gauge>
Right now, I am just trying to get the ALT to work and I can go from there. I have tried putting the on/off commands in the same Element, but that didn't work, so I split them up, which didn't work either.
Bill
Last edited:

