- Messages
- 14
- Country

Hello, me again.
I've been walking in circles past two days and nights trying to write working code for the AP HDG mode selector, McDonnel Douglas type. A spring loaded selector that select heading in degrees, select present aircraft heading hold mode by pushing it, or select previously dialed heading by pulling it.
Here is my code so far:
The idea is to select HDG hold by left click ( push button) and HDG select by right click (pull button ).
Then I introduced another pair of L vars, HDG hold should be ON if difference between selected and indicated heading is less then 10 degrees. Opposite for HDG select.
Then I defined (L:HDG hold, bool) to engage present heading hold, and (L:HDG sel, bool) to engage selected heading. The funny thing is that it works! But the gauge allows both modes to be engaged at the same time. What I want, and not just for this gauge, is the way to turn off one mode if other is engaged. And also to be able to select new airplane heading, but to engage new heading select after the button is pulled, regardless of previously engaged mode. Dial, then pull to engage. If you want new heading, first dial it, then pull (right click) selector to engage it. This is the quote from DC-10 manual, describing the HDG control knob:
I would ignore the Push to first detent part. Sound way to complicated.
I will then try to implement WheelUp and WheelDown into click kind, for dial heading.
Again, please point me into the right direction, if you, please! Thanks! There must be a way to do that, and more elegant one too, I am certain!
I've been walking in circles past two days and nights trying to write working code for the AP HDG mode selector, McDonnel Douglas type. A spring loaded selector that select heading in degrees, select present aircraft heading hold mode by pushing it, or select previously dialed heading by pulling it.
Here is my code so far:
Code:
<Element>
<Select>
<Value>(A:AUTOPILOT HEADING LOCK DIR, degrees) (A:PLANE HEADING DEGREES GYRO, degrees) - 10 <
(L:HDG hold mode engage, bool)
(>L:HDG hold, bool)
</Value>
</Select>
</Element>
<Element>
<Select>
<Value>(A:AUTOPILOT HEADING LOCK DIR, degrees) (A:PLANE HEADING DEGREES GYRO, degrees) - 10 >
(L:HDG select mode engage, bool)
(>L:HDG sel, bool)
</Value>
</Select>
</Element>
<Element>
<Select>
<Value>(L:HDG hold, bool) if{ (K:AP_HDG_HOLD) ! if{ (>K:AP_HDG_HOLD) } }</Value>
</Select>
</Element>
<Element>
<Select>
<Value>(L:HDG sel, bool) if{ (K:AP_PANEL_HEADING_ON) ! if{ (>K:AP_PANEL_HEADING_ON) } }</Value>
</Select>
</Element>
<Mouse>
<Area Left="0"
Top="0"
Width="20"
Height="20">
<Tooltip>Heading mode selector</Tooltip>
<Cursor Type="Hand"/>
<Click Kind="LeftSingle+RightSingle" Repeat="Yes">
(M:Event) 'LeftSingle' scmp 0 == if{ (L:HDG hold mode engage, bool) ! (>L:HDG hold mode engage, bool) }
(M:Event) 'RightSingle' scmp 0 == if{ (L:HDG select mode engage, bool) ! (>L:HDG select mode engage, bool) }</Click>
</Area>
</Mouse>
The idea is to select HDG hold by left click ( push button) and HDG select by right click (pull button ).
Then I introduced another pair of L vars, HDG hold should be ON if difference between selected and indicated heading is less then 10 degrees. Opposite for HDG select.
Then I defined (L:HDG hold, bool) to engage present heading hold, and (L:HDG sel, bool) to engage selected heading. The funny thing is that it works! But the gauge allows both modes to be engaged at the same time. What I want, and not just for this gauge, is the way to turn off one mode if other is engaged. And also to be able to select new airplane heading, but to engage new heading select after the button is pulled, regardless of previously engaged mode. Dial, then pull to engage. If you want new heading, first dial it, then pull (right click) selector to engage it. This is the quote from DC-10 manual, describing the HDG control knob:
HDG Control Knob
Knob has four functions. Normal,
spring-held position provides fine
adjustment of heading. Push to first
detent for fast heading select. Push
full in to engage AP and FD HDG
HOLD and to cancel all armed or
engaged lateral modes. Pull out to
engage HDG SEL mode. HDG knob
also positions heading bugs on HSI's
when HSI switch is in RAD position.
I would ignore the Push to first detent part. Sound way to complicated.
I will then try to implement WheelUp and WheelDown into click kind, for dial heading.
Again, please point me into the right direction, if you, please! Thanks! There must be a way to do that, and more elegant one too, I am certain!
Last edited:




& not tested.