Gauge Check? Autopilot Mode Selector

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.

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 (&gt;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 (&gt;L:CIII GUIDENCE SEL KNOB, enum)
                                  1 (&gt;L:XMLSND7,enum) }    
            (M:Event) 'RightSingle' scmp 0 ==
            (M:Event) 'WheelDown' scmp 0 == or
                if{ (L:CIII GUIDENCE SEL KNOB, enum) ++ 4 min (&gt;L:CIII GUIDENCE SEL KNOB, enum)
                                  1 (&gt;L:XMLSND7,enum) }    
        </CallbackCode>
    </MouseRect>
   </PartInfo>
Just a note, the knob works fine.
 
Last edited:
I spotted some holes already. Funny how you cant find your mistakes till you post it online, lol...

These are corrections to the bottom section that was one element. I split it into 3 elements.

Also, the above main 'selector knob' actions events, these use an Update section.

Code:
 <Element>
 <Select>
 <Value>
 (L:SV_Has_Initialized, bool) ! if{ 
      (A:ELECTRICAL MASTER BATTERY,bool) 1 ==
         if{
           2 (>L:CIII GUIDENCE SEL KNOB, enum) }
  </Value>
 </Select>
 </Element>

 <Element>
 <Select>
 <Value>
 (L:GUIDENCE SYSTEM INITIALIZE,bool) 0 ==
            if{ 1 (>L:GUIDENCE SYSTEM INITIALIZE,bool)
              50 (>L:LHC CIII PITCH ROCKER,enum) }
  </Value>
 </Select>
 </Element>

 <Element>
 <Select>
 <Value>
 (L:SV_Has_Initialized, bool) !
    if{ (A:ELECTRICAL MASTER BATTERY,bool) 1 ==
          if{ 1 (>L:SV_Has_Initialized, bool) } }
  </Value>
 </Select>
 </Element>
 
Just some quick observations..
1) All the "C:" .. Shouldn't they be "A:" ? Not dealing with P3D here so that may be something new.. ???
2) (C:AUTOPILOT NAV1 LOCK,bool) ! == .... The "! ==" is a logic operator with a logic comparator with nothing to compare. Not equal is "!=".... In this case I think you should just use "!" (NOT)
3) I believe your mixing up vars & commands in there.. (C:AP_HDG_HOLD_OFF,bool) is actually a command (>K:AP_HDG_HOLD_OFF)

Here's a rewrite, a different look but the logic seems the same. All corrections above included :

I see you posted while doing some doodling.... )))

XML:
</Update>
<!-- GLOBAL TO ALL BELOW  /////////////////////////////// -->
   (A:AUTOPILOT MASTER, bool) (L:GUIDENCE SYSTEM INITIALIZE,bool) and if{
 
<!-- HDG HOLD MODE /////////////////////////////// --> 
        (L:CIII GUIDENCE SEL KNOB, enum) 2 == if{
            (A:AUTOPILOT HEADING LOCK, bool) ! if{
                (>K:AP_PANEL_HEADING_ON)
            }
        } els{
            <!-- TURN OFF IN NOT IN MODE 0 -->
            (A:AUTOPILOT HEADING LOCK, bool) if{
                (>K:AP_PANEL_HEADING_OFF)
            }
        }
     
<!-- GPS & OMNI HOLD MODE (GPS SLAVE IS HANDLED LATER) /////////////////////////////// -->     
        (L:CIII GUIDENCE SEL KNOB, enum) 2 &lt; if{
            (A:AUTOPILOT NAV1 LOCK, bool) ! if{
                (>K:AP_NAV1_HOLD_ON)      
            }
        } els{
            <!-- TURN OFF MASTER NAV IN NOT IN MODE 0 OR 1 -->
            (A:AUTOPILOT NAV1 LOCK, bool) if{
                (>K:AP_NAV1_HOLD_OFF)
            }      
        }

<!-- GPS SLAVE HANDLING /////////////////////////////// -->     
        (L:CIII GUIDENCE SEL KNOB, enum) 0 == if{
            (A:GPS DRIVES NAV1, bool) ! if{
                (>K:TOGGLE_GPS_DRIVES_NAV1)
            }
        } els{
            <!-- TURN OFF GPS SLAVING IF NOT IN MODE 0 -->
            (A:GPS DRIVES NAV1, bool) if{
                (>K:TOGGLE_GPS_DRIVES_NAV1)
            }
        }      
     
<!-- LOC APPR MODE /////////////////////////////// -->     
        (L:CIII GUIDENCE SEL KNOB, enum) 3 == if{      
            (A:AUTOPILOT APPROACH HOLD, bool) ! if{
                (>K:AP_APR_HOLD_ON)
            }
        } els{
            <!-- TURN OFF APR HOLD IF NOT IN MODE 3 -->
            (A:AUTOPILOT APPROACH HOLD, bool) if{
                (>K:AP_APR_HOLD_OFF)
            }      
        }
     
<!-- LOC BACK COURSE MODE /////////////////////////////// -->
        (L:CIII GUIDENCE SEL KNOB, enum) 4 == if{      
            (A:AUTOPILOT BACKCOURSE HOLD, bool) ! if{
                (>K:AP_BC_HOLD_ON)
            }
        } els{
            <!-- TURN OFF BC HOLD IF NOT IN MODE 4 -->
            (A:AUTOPILOT BACKCOURSE HOLD, bool) if{
                (>K:AP_BC_HOLD_OFF)
            }      
        }
 
<!-- END GLOBAL AP MASTER / INITIALIZE  /////////////////////////////// --> 
    }
</Update>

<Element>
     <Select>
         <Value>
            (L:SV_Has_Initialized, bool) ! if{
                    <!-- (A:ELECTRICAL MASTER BATTERY,bool) if{ --> <!-- I BELIEVE THIS WILL CAUSE SOME BAD LOGIC -->
                    <!-- THE "SV_Has_Initialized" WILL HAPPEN BEFORE THE BATTERY MIGHT BE TURNED ON, IF THE BATTERY IS TURNED ON LATER NOTHING WILL HAPPEN -->
                    2 (>L:CIII GUIDENCE SEL KNOB, enum)
                        (L:GUIDENCE SYSTEM INITIALIZE,bool) ! if{
                            1 (>L:GUIDENCE SYSTEM INITIALIZE,bool)
                        }
                    <!-- } --> <!-- END.... I BELIEVE THIS WILL CAUSE SOME BAD LOGIC -->
                50 (>L:LHC CIII PITCH ROCKER,enum)
                1 (&gt;L:SV_Has_initialized, bool)
            }
          </Value>
     </Select>
</Element>
Roman
 
Last edited:
Roman,

Still a no go. Its like the system has no effect by the knob.

I am going to keep experimenting with it. Todays a new day. Fresh mind. New coffee....

I wondered yesterday afternoon about the science of having a knob switch as an activator. Basically, it should work. But I wondered about the trigger on this. The knob has animation points, and enums. The enums are considered points on the Key Frames, not the Key Frames per say. For instance, the knob at Key Frame 20 would be say enum 1. So if you say enum1, is the sim aware that the rotation value of the knob is actually KF position 20, not enum1 per say?
 
By the way, a thousand thanks for finding my issues on that. C: ??? Probably a coffee issue. All I can figure... :S

This is what I wound up with late at night after a day of wrestling with it.


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 (%((L:CIII GUIDENCE SEL KNOB,enum))%{case}%{:0}GPS Navigation)%{:1}Omni)%{:2}Heading)%{:3}Approach)%{:4}Back Course)%{End}</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 (&gt;L:CIII GUIDENCE SEL KNOB, enum)
                                  1 (&gt;L:XMLSND7,enum) }     
            (M:Event) 'RightSingle' scmp 0 ==
            (M:Event) 'WheelDown' scmp 0 == or
                if{ (L:CIII GUIDENCE SEL KNOB, enum) ++ 4 min (&gt;L:CIII GUIDENCE SEL KNOB, enum)
                                  1 (&gt;L:XMLSND7,enum) }     
        </CallbackCode>
    </MouseRect>
   </PartInfo>
 
Bill,
Your animation code looks good.. ;)
Just some info, no need to change anything at all.
Since the knob is limited to 0,1,2,3,4 and those values only, the keyframe code could be reduced.. Again, no need to change yours as is ))
XML:
     <Code>   
        (L:CIII GUIDENCE SEL KNOB, enum) 25 *
     </Code>
Also, I was confused a bit with your code. It seems some modes were swapped around.
With your animation code now showing the truth :wizard: I modified my test code above to reflect it.

Maybe a tip to help in testing:
Create a test 2D popup window with the "stock" Bendix King autopilot & a "plain" GPS switch.
You could then monitor the AP mode changes as they occur.

Roman
 
Maybe a tip to help in testing:
Create a test 2D popup window with the "stock" Bendix King autopilot & a "plain" GPS switch.
You could then monitor the AP mode changes as they occur.

Roman
BRILLIANT! Will do that. I was groaning about making a complete 'show' gauge that tells me what is going on. The Bendix will work perfect. Great idea.


By the way. I just tried the idea of using Key Frames in the Enums. Didnt work. For some reason, the knob isnt being read. Going to take a break from it and come back and see if I can spot the issue. This is what I have now.


(this is the entire thing)


Code:
<Update>

        <!-- AP VS "UP" TIMER -->
        (G:Var1) 0 != if{
            (G:Var1) -- 0 max (>G:Var1)
        }
        <!-- AP VS "DOWN" TIMER -->
        (G:Var2) 0 != if{
            (G:Var2) -- 0 max (>G:Var2)
        }

(L:SV_Has_Initialized, bool) ! if{
      (A:ELECTRICAL MASTER BATTERY,bool) 1 ==
         if{
           2 (>L:CIII GUIDENCE SEL KNOB, enum)
          50 (>L:LHC CIII PITCH ROCKER,enum) }

<!-- GLOBAL TO ALL BELOW  /////////////////////////////// -->
   (A:AUTOPILOT MASTER, bool) (L:GUIDENCE SYSTEM INITIALIZE,bool) and if{
 
<!-- HDG HOLD MODE /////////////////////////////// -->  
        (L:CIII GUIDENCE SEL KNOB, enum) 50 == if{
            (A:AUTOPILOT HEADING LOCK, bool) ! if{
                (>K:AP_PANEL_HEADING_ON)
            }
        } els{
            <!-- TURN OFF IN NOT IN MODE 2 -->
            (A:AUTOPILOT HEADING LOCK, bool) if{
                (>K:AP_PANEL_HEADING_OFF)
            }
        }

<!-- NAV IS GPS HOLD MODE AND NAV1 HOLD /////////////////////////////// -->      
        (L:CIII GUIDENCE SEL KNOB, enum) 0 == if{
            (A:AUTOPILOT NAV1 LOCK, bool) ! if{
                (>K:AP_NAV1_HOLD_ON)      
            }
        } els{
            <!-- TURN OFF MASTER NAV IN NOT IN MODE 1 OR 2 -->
            (A:AUTOPILOT NAV1 LOCK, bool) if{
                (>K:AP_NAV1_HOLD_OFF)
            }      
        }

<!-- GPS SLAVE HANDLING /////////////////////////////// -->      
        (L:CIII GUIDENCE SEL KNOB, enum) 25 == if{
            (A:GPS DRIVES NAV1, bool) ! if{
                (>K:TOGGLE_GPS_DRIVES_NAV1)
            }
        } els{
            <!-- TURN OFF GPS SLAVING IF NOT IN MODE 1 -->
            (A:GPS DRIVES NAV1, bool) if{
                (>K:TOGGLE_GPS_DRIVES_NAV1)
            }
        }      
     
<!-- LOC APPR MODE /////////////////////////////// -->      
        (L:CIII GUIDENCE SEL KNOB, enum) 75 == if{      
            (A:AUTOPILOT APPROACH HOLD, bool) ! if{
                (>K:AP_APR_HOLD_ON)
            }
        } els{
            <!-- TURN OFF APR HOLD IF NOT IN MODE 3 -->
            (A:AUTOPILOT APPROACH HOLD, bool) if{
                (>K:AP_APR_HOLD_OFF)
            }      
        }
     
<!-- LOC BACK COURSE MODE /////////////////////////////// -->
        (L:CIII GUIDENCE SEL KNOB, enum) 100 == if{      
            (A:AUTOPILOT BACKCOURSE HOLD, bool) ! if{
                (>K:AP_BC_HOLD_ON)
            }
        } els{
            <!-- TURN OFF BC HOLD IF NOT IN MODE 4 -->
            (A:AUTOPILOT BACKCOURSE HOLD, bool) if{
                (>K:AP_BC_HOLD_OFF)
            }      
        }
 
<!-- END GLOBAL AP MASTER / INITIALIZE  /////////////////////////////// -->  
    }
</Update>

<Element>
<Select>
<Value>
(L:SV_Has_Initialized, bool) !
    if{ (A:ELECTRICAL MASTER BATTERY,bool) 1 ==
          if{ 1 (>L:SV_Has_Initialized, bool) } }
  </Value>
</Select>
</Element>

Guidence Knob 'Mode' selector Enums and their KeyFrame positions:
0....0 KF
1....25 KF
2....50 KF
3....75 KF
4....100 KF
 
Bill,

Don't know what to say. (( :scratchch
You're mixing things up in VC coding which shouldn't be there & omitting things in the logic portion that should be there & in the logic portion, the initialization is broken.. ( SV_Has_Initialized is not the same as GUIDENCE SYSTEM INITIALIZE )
A proposition for you if willing.
If you send me the complete ( from <part> to </part> ) VC animation code for "all" the parts of the autopilot plus the HSI heading knob & HSI heading arrow I can get you a working autopilot that is 95% functional of the real one.
In FS9 I did a Century IIB which was heavily modified by an avionics shop (real life) that has almost all the functions of the Century III.
There needs to be some "background" logic using the stock FS autopilot functions but having a different purpose - think the "Roll Knob". That should be part of FS's heading hold while not really acting like the airplane's real heading hold. Yet you still need a real heading hold.
Another example is the pitch mode rocker. 1 option is: In the background it should be using the FS's ALT hold while not really using the airplane's real alt hold. Option 2 is not to use the alt hold but rather Attitude hold and adjust pitch through the pitch ref up/dn fs commands. (option 2 fits your autopilot better - I believe)
In order for it work properly, quite a bit of the logic should be in a 2D gauge while the VC portion just feeds the human interface to it & reads back any logic from the 2D for animations.

No offence, but I believe you are getting further away from the target while shooting in the dark.
In the meantime, thinking I will build a complete 2D version of the complete CIII AP system with a diagnostic display, while trying to use as much as possible of the animations/logic you already have. -Maybe that will help?

Roman
 
Ok. I dare not turn down this offer.



Rocker for Pitch Control...

I should probably remove the AP programming from it, make it only for its own basic animation. I was thinking of doing that last night and running AP entries through the invisible XML Autopilot manager.


Code:
<PartInfo>
        <Name>lhc_cIII_ap_pitch_rocker</Name>
      <Animation>
    <Parameter>
      <Code>(L:LHC CIII PITCH ROCKER,enum) 100 *</Code>
       <Lag>400</Lag>
    </Parameter>
      </Animation>
   <MouseRect>
    <Cursor>Hand</Cursor>
   <TooltipText>Vertical Speed Hold Selector (%((A:AUTOPILOT VERTICAL HOLD VAR, feet per minute))%!d! ft/min)</TooltipText>
           <MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown+LeftRelease+RightRelease</MouseFlags>
   <CallbackCode>
            (M:Event) 'LeftSingle' scmp 0 ==
            (M:Event) 'WheelDown' scmp 0 == or
                if{ 0 (>L:LHC CIII PITCH ROCKER,enum)
                                                            1 (&gt;L:XMLSND6,enum)
            0 (>G:Var2)
            (G:Var1) 0 == if{
                (A:VERTICAL SPEED, feet per minute) 100 + (>K:AP_VS_VAR_SET_ENGLISH) @Tmr(1)
            } els{
                (>K:AP_VS_VAR_INC) @Tmr(1)
            }         
        }
            (M:Event) 'RightSingle' scmp 0 ==
            (M:Event) 'WheelUp' scmp 0 ==  or
                if{ 100 (>L:LHC CIII PITCH ROCKER,enum)
                                                                1 (>L:XMLSND6,enum)
            0 (>G:Var1)
            (G:Var2) 0 == if{
                (A:VERTICAL SPEED, feet per minute) 100 - (>K:AP_VS_VAR_SET_ENGLISH) @Tmr(2)
            } els{
                (>K:AP_VS_VAR_DEC) @Tmr(2)
            }         
        }       
            (M:Event) 'RightRelease' scmp 0 ==
            (M:Event) 'LeftRelease' scmp 0 == or
                                                        if{ 50 (>L:LHC CIII PITCH ROCKER,enum)
                                                              1 (>L:XMLSND6,enum) }
   </CallbackCode>
   </MouseRect>
</PartInfo>
This is the Roll Knob, which is basically the Heading knob according to the manual. (I have the PDF of the Manual, by the way, I can send that over).
For some reason, its input was all messed up when using the stock knob_heading animation, so I created this.

Code:
   <PartInfo>
      <Name>lhc_cIII_ap_roll_dial</Name>
        <AnimLength>360</AnimLength>
          <Animation>
                 <Parameter>
                   <Sim>
                       <Variable>AUTOPILOT HEADING LOCK DIR</Variable>
              <Units>degrees</Units>
              <Scale>1</Scale>
              <MinValue>0</MinValue>
              <MaxValue>360</MaxValue>
                   </Sim>
                </Parameter>
          </Animation>
      <MouseRect>
         <Cursor>Hand</Cursor>
         <TooltipID>TOOLTIPTEXT_AUTOPILOT_HEADING_INDICATOR</TooltipID>
           <MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown</MouseFlags>
   <CallbackCode>
            (M:Event) 'LeftSingle' scmp 0 ==
                if{ (>K:HEADING_BUG_DEC,bool)
                                                              1 (&gt;L:XMLSND7,enum) }
            (M:Event) 'WheelDown' scmp 0 ==
                if{ (>K:HEADING_BUG_DEC,bool)
                                                              1 (&gt;L:XMLSND7,enum) }
            (M:Event) 'RightSingle' scmp 0 ==
                if{ (>K:HEADING_BUG_INC,bool)
                                                              1 (&gt;L:XMLSND7,enum) }
            (M:Event) 'WheelUp' scmp 0 ==
                if{ (>K:HEADING_BUG_INC,bool)
                                                              1 (&gt;L:XMLSND7,enum) }
   </CallbackCode>
      </MouseRect>
   </PartInfo>


This is the other problem child. :(

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 (%((L:CIII GUIDENCE SEL KNOB,enum))%{case}%{:0}Navigation Mode)%{:1}Omni GPS Mode)%{:2}Heading Active)%{:3}Approach Mode)%{:4}Back Course Mode)%{End}</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 (&gt;L:CIII GUIDENCE SEL KNOB, enum)
                                  1 (&gt;L:XMLSND7,enum) }     
            (M:Event) 'RightSingle' scmp 0 ==
            (M:Event) 'WheelDown' scmp 0 == or
                if{ (L:CIII GUIDENCE SEL KNOB, enum) ++ 4 min (&gt;L:CIII GUIDENCE SEL KNOB, enum)
                                  1 (&gt;L:XMLSND7,enum) }     
        </CallbackCode>
    </MouseRect>
   </PartInfo>

These are the rocker switches on the Century III main panel, plus (on the bottom) is the AP Master rocker.


Code:
    <PartInfo>
        <Name>lhc_cIII_ap_roll</Name>
      <Animation>
    <Parameter>
      <Code>(L:LHC SV AUTOPILOT ROLL,bool) 50 *</Code>
       <Lag>400</Lag>
    </Parameter>
      </Animation>
   <MouseRect>
    <Cursor>Hand</Cursor>
   <TooltipText>Autopilot Roll Control</TooltipText>
   <CallbackCode>
         (A:AUTOPILOT WING LEVELER,bool) 1 ==
         (A:AUTOPILOT MASTER,bool) 1 == and
               if{ (K>AP_WING_LEVELER,bool) }
              els{ 0 }
      1 (&gt;L:XMLSND4,enum)
   </CallbackCode>
   </MouseRect>
</PartInfo>

    <PartInfo>
        <Name>lhc_cIII_ap_hdg</Name>
        <AnimLength>50</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>AUTOPILOT HEADING LOCK</Variable>
                    <Units>bool</Units>
                    <Scale>50</Scale>
                </Sim>
                <Lag>400</Lag>
            </Parameter>
        </Animation>
        <MouseRect>
            <Cursor>Hand</Cursor>
            <TooltipText>Autopilot Heading Hold</TooltipText>   
   <CallbackCode>
               (&gt;K:AP_HDG_HOLD,bool)
               1 (&gt;L:XMLSND4,enum)
   </CallbackCode>
        </MouseRect>
    </PartInfo>


    <PartInfo>
        <Name>lhc_cIII_ap_alt</Name>
        <AnimLength>50</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>AUTOPILOT ALTITUDE LOCK</Variable>
                    <Units>bool</Units>
                    <Scale>50</Scale>
                </Sim>
                <Lag>400</Lag>
            </Parameter>
        </Animation>
        <MouseRect>
            <Cursor>Hand</Cursor>
            <TooltipText>Autopilot Altitude Hold</TooltipText>   
   <CallbackCode>
               (&gt;K:AP_ALT_HOLD,bool)
               1 (&gt;L:XMLSND4,enum)
   </CallbackCode>
        </MouseRect>
    </PartInfo>

    <PartInfo>
        <Name>lhc_cIII_ap_pitch</Name>
        <AnimLength>50</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>AUTOPILOT ATTITUDE HOLD</Variable>
                    <Units>bool</Units>
                    <Scale>50</Scale>
                </Sim>
                <Lag>400</Lag>
            </Parameter>
        </Animation>
        <MouseRect>
            <Cursor>Hand</Cursor>
   <TooltipText>Autopilot Pitch Hold</TooltipText>
   <CallbackCode>
               (&gt;K:AP_ATT_HOLD,bool)
               1 (&gt;L:XMLSND4,enum)
   </CallbackCode>
        </MouseRect>
    </PartInfo>

    <PartInfo>
        <Name>lhc_cIII_ap_master</Name>
        <AnimLength>50</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>AUTOPILOT MASTER</Variable>
                    <Units>bool</Units>
                    <Scale>50</Scale>
                </Sim>
                <Lag>400</Lag>
            </Parameter>
        </Animation>
        <MouseRect>
            <Cursor>Hand</Cursor>
            <TooltipText>Autopilot Master Switch</TooltipText>   
   <CallbackCode>
               (&gt;K:AP_MASTER,bool)
               1 (&gt;L:XMLSND6,enum)
   </CallbackCode>
        </MouseRect>
    </PartInfo>
While having nothing but bad luck on getting this going, I had a dream or little vision, that I should just use basic AP controls for the rockers and that it would go smoother for me, and it did. At first, I had issues with rockers not working right, and systems crossing when I would reboot (reload) the airplane, etc. Using basic AP code got me back on track. Thats why the rockers are very basic. It was kind of sophisticated before, but a mess... 50% or less functionality. :(
 
This is the Roll Knob, which is basically the Heading knob according to the manual. (I have the PDF of the Manual, by the way, I can send that over).
For some reason, its input was all messed up when using the stock knob_heading animation, so I created this.
I have the manual Thanks!
In reality the roll knob sets a banked turn and just keeps on going until the knob is centered. It doesn't go by heading nor references it.
Just a bank.. It can be done nicely in the sim but requires re-coding of the HSI heading knob & the HSI heading pointer. (Not really that bad)

Roman
 
Bill,

You have a separate Master switch? In my manual pressing the roll is also considered the master, it just powers up the roll servos & activates the roll knob, if centered does nothing.

Roman
 
Top