- Messages
- 10,088
- Country
Does anyone see a problem with this code?
I have a knob in the VC coded with an L:Var animation. This gauge code below is a simple, hidden XML gauge that would manage the Autopilot system per the position (state);
* Knob Selection
* System (Knob) Initialize
* Autopilot Master 'on'
It doesnt appear to be working in the sim. Just thought I would ask if someone sees a hole in the code.
This is the knob part itself. The code is from the ModelDef;
Just a note, the knob works fine.
I have a knob in the VC coded with an L:Var animation. This gauge code below is a simple, hidden XML gauge that would manage the Autopilot system per the position (state);
* Knob Selection
* System (Knob) Initialize
* Autopilot Master 'on'
It doesnt appear to be working in the sim. Just thought I would ask if someone sees a hole in the code.
Code:
<!-- HDG HOLD MODE -->
(C:AUTOPILOT MASTER,bool) 1 ==
if{
(C:AP_HDG_HOLD_OFF,bool) 1 ==
if{
(L:CIII GUIDENCE SEL KNOB, enum) 0 ==
(L:GUIDENCE SYSTEM INITIALIZE,bool) 1 == and
if{
(>K:AP_PANEL_HEADING_ON)
} } }
<!-- OMNI GPS HOLD MODE /////////////////////////////// -->
(C:AUTOPILOT MASTER,bool) 1 ==
if{
(C:AUTOPILOT NAV1 LOCK,bool) ! ==
if{
(L:CIII GUIDENCE SEL KNOB, enum) 1 ==
(L:GUIDENCE SYSTEM INITIALIZE,bool) 1 == and
if{
(>K:GPS DRIVES NAV1)
} } }
<!-- NAV1 HOLD MODE /////////////////////////////// -->
(C:AUTOPILOT MASTER,bool) 1 ==
if{
(C:AUTOPILOT NAV1 LOCK,bool) ! ==
if{
(L:CIII GUIDENCE SEL KNOB, enum) 2 ==
(L:GUIDENCE SYSTEM INITIALIZE,bool) 1 == and
if{
(>K:AP_NAV1_HOLD_ON)
} } }
<!-- LOC APPR MODE /////////////////////////////// -->
(C:AUTOPILOT MASTER,bool) 1 ==
if{
(C:AUTOPILOT APPROACH HOLD,bool) ! ==
if{
(L:CIII GUIDENCE SEL KNOB, enum) 3 ==
(L:GUIDENCE SYSTEM INITIALIZE,bool) 1 == and
if{
(>K:AP_APR_HOLD)
} } }
<!-- LOC BACK COURSE MODE /////////////////////////////// -->
(C:AUTOPILOT MASTER,bool) 1 ==
if{
(C:AUTOPILOT APPROACH HOLD,bool) ! ==
if{
(L:CIII GUIDENCE SEL KNOB, enum) 4 ==
(L:GUIDENCE SYSTEM INITIALIZE,bool) 1 == and
if{
(>K:AP_BC_HOLD)
} } }
</Update>
<Element>
<Select>
<Value>
(L:SV_Has_Initialized, bool) ! if{
(A:ELECTRICAL MASTER BATTERY,bool) 1 ==
if{
2 (>L:CIII GUIDENCE SEL KNOB, enum)
(L:GUIDENCE SYSTEM INITIALIZE,bool) 0 ==
if{ 1 (>L:GUIDENCE SYSTEM INITIALIZE,bool) }
50 (>L:LHC CIII PITCH ROCKER,enum)
1 (>L:SV_Has_initialized, bool)
}
</Value>
</Select>
</Element>
This is the knob part itself. The code is from the ModelDef;
Code:
<PartInfo>
<Name>lhc_cIII_ap_guidence_knob</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code> (L:CIII GUIDENCE SEL KNOB, enum) 0 == if{ 0 }
(L:CIII GUIDENCE SEL KNOB, enum) 1 == if{ 25 }
(L:CIII GUIDENCE SEL KNOB, enum) 2 == if{ 50 }
(L:CIII GUIDENCE SEL KNOB, enum) 3 == if{ 75 }
(L:CIII GUIDENCE SEL KNOB, enum) 4 == if{ 100 }
</Code>
<Lag>400</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Guidence Mode Selector</TooltipText>
<MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 ==
(M:Event) 'WheelUp' scmp 0 == or
if{ (L:CIII GUIDENCE SEL KNOB, enum) -- 0 max (>L:CIII GUIDENCE SEL KNOB, enum)
1 (>L:XMLSND7,enum) }
(M:Event) 'RightSingle' scmp 0 ==
(M:Event) 'WheelDown' scmp 0 == or
if{ (L:CIII GUIDENCE SEL KNOB, enum) ++ 4 min (>L:CIII GUIDENCE SEL KNOB, enum)
1 (>L:XMLSND7,enum) }
</CallbackCode>
</MouseRect>
</PartInfo>
Just a note, the knob works fine.
Last edited: