Catherine,

Not quite the answer you seek, but following to Sids comments. My advice is
keep any thing you want generic to your setup away from aircraft model nasal
if possible.

If it helps,

I used xml for controlling "some" auto pilot functions via Joy stick control
to avoid fooling around in nasal. I have attached the xml file for you as
info.

Some notes that should be in the file:

The file is based on commands given to execute button presses in the 737
autopilot panel xml file.

The trigger on button 0  is used as a shift function so the top hat left to
right moves the heading, then shifted moves the course.

Likewise un-shifted one of the buttons selects heading mode and shifted
selects vor mode.

I ran it inconjuction with the older 2d AP panel in the 2005 era 737-300
model, I am not sure about the new 3d panels.

However its not panel dependent, it drives the autopilot setting and lock
properties directly. and runs ok againt the current v4.5 737 series
autopilot xml implementation or the basic generic FG autopilot on the
current FG git version.

I "think" it would run ok against any model, but would not promise it as i
only use the 737 implementations. As far as I recall there are no funnies in
it unique to my sim setup.


Harry







On Sat, Apr 9, 2011 at 12:10 PM, syd adams <adams....@gmail.com> wrote:

> Maybe you already looked into this , but to me it would make more
> sense to bind the joystick buttons to activate the <enable> properties
> in the actual autopilot.xml files rather than modifying the author's
> specialized scripts.Or write a generic nasal file to handle the
> variety of different enabling methods ? The autopilot xml file does
> the real work , but enabling a mode can be set with pretty much any
> property or condition the author decides on ,so that could be a large
> chore.Most extra nasal code was written for a reason , mainly to make
> the autopilot behave like the real  one , so modifying that might be
> tricky.Just my thoughts, if you,ve already discovered all that , i
> apologize for the noise.
> Cheers
>
> On Fri, Apr 8, 2011 at 10:40 PM, Catherine James
> <catherine.ja...@att.net> wrote:
> >
> > Recently, I've been spending a good bit of time attempting to program all
> of my most-used aircraft so that I can engage and disengage the autopilot
> through the joystick.  I've been able to get this to work on the Seneca II
> with a short nasal script in Nasal/SenecaII.nasal that sets the
> /autopilot/CENTURYIII/controls and /autopilot/CENTURYIII/locks properties
> appropriately.  Silly me, I though it would be a simple matter to port the
> working code over to the Comanche PA-24-250 (w/ CIII autopilot).
> >
> > Unfortunately, the structure of the nasal scripts of the PA24 bears very
> little resemblance to that of the Seneca II.  Although the relevant
> autopilot properties are the same for both planes, the flow of control is
> not.  For example, turning on the autopilot roll axis control with the plane
> on the ground is harmless in the Seneca, but will cause a nasal crash in the
> (stock, unmodified) Comanche, and turning the autopilot off again will not
> recover.  (The ailerons will be locked permanently at 0 until you restart.)
>  The routine that crashes is action-sim.nas, a file that doesn't even exist
> in the Seneca. It contains an update_actions() script that is looped
> repeatedly, updating positions of control surfaces, etc.  With the autopilot
> on, the script attempts to get the appropriate aileron position from the
> autopilot, but it returns null and then cause a setValue() error when it
> blindly tries to set the actual aileron position to that null.  The same
> thing
> >  happens if I turn on the autopilot in flight by using the joystick to
> change the /autopilot/CENTURYIII/controls properties through a script.
> >
> > Is there a general file and scripting structure that it is recommended to
> follow for implementing aircraft?  It's very challenging to learn to
> understand and modify aircraft implementations when the general arrangement
> of files is so different from one to the next.
> >
> >
> >
> ------------------------------------------------------------------------------
> > Xperia(TM) PLAY
> > It's a major breakthrough. An authentic gaming
> > smartphone on the nation's most reliable network.
> > And it wants your games.
> > http://p.sf.net/sfu/verizon-sfdev
> > _______________________________________________
> > Flightgear-devel mailing list
> > Flightgear-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/flightgear-devel
> >
>
>
> ------------------------------------------------------------------------------
> Xperia(TM) PLAY
> It's a major breakthrough. An authentic gaming
> smartphone on the nation's most reliable network.
> And it wants your games.
> http://p.sf.net/sfu/verizon-sfdev
> _______________________________________________
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>



-- 
Regards Harry
<?xml version="1.0" ?>

<!--
************************************************************************
* Bindings for Logitech Extreme Digital 3D Pro joystick.
*
*
* Axis 0: ailerons
* Axis 1: elevator
* Axis 2 (twist): rudder
* Axis 3 (slider): throttle
* Axes 4 and 5 (hat): view direction
*
* Buttons according to the numbers printed on the joystick:
* Button 1: all brakes
* Button 4: flap down
* Button 6: flap up
* Button 5: elevator trim up
* Button 3: elevator trim down
* Button 11: left brake only
* Button 12: right brake only
************************************************************************
$Id: extreme-3d-pro.xml,v 1.9 2006/03/01 18:17:26 mfranz Exp $
-->

<PropertyList>

 <name>Logitech Logitech Extreme 3D</name>
 <name>default</name>



 <axis n="0">
  <desc>Aileron</desc>
  <binding>
   <command>property-scale</command>
   <property>/controls/flight/aileron</property>
   <squared type="bool">true</squared>
  </binding>
 </axis>

 <axis n="1">
  <desc>Elevator</desc>
  <binding>
   <command>property-scale</command>
   <property>/controls/flight/elevator</property>
   <factor type="double">-1.0</factor>
   <squared type="bool">true</squared>
  </binding>
 </axis>


 <axis>
  <desc>Nose_Wheel</desc>
  <number>
   <unix>2</unix>
   <windows>3</windows>
   <mac>2</mac>
  </number>
  <dead-band type="double">0.02</dead-band>



 <binding>
   <command>property-scale</command> 
<!-- <property>/controls/gear/steering</property> -->
 <property>/controls/hardware/adjusters/nose-steer-cmd</property>
  </binding>
 </axis>

 <axis>
  <desc>HAT_left_right</desc>
  <number>
   <unix>4</unix>
   <windows>6</windows>
   <mac>4</mac>
  </number>
  <low>
   <repeatable>true</repeatable>
   <binding>
                <condition>
                    <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">false</value>
                   </equals>
                 </condition>
    <command>property-adjust</command>
    <property>/autopilot/settings/heading-bug-deg</property>
       <step>-0.1</step>
       <min>0</min>
       <max>360</max>
       <wrap>true</wrap>
   </binding>


   <binding>
                <condition>
                    <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">true</value>
                   </equals>
                 </condition>
    <command>property-adjust</command>
         <property>/instrumentation/nav[0]/radials/selected-deg</property>
       <step>-0.1</step>
       <min>0</min>
       <max>360</max>
       <wrap>true</wrap>
   </binding>


  </low>
  <high>
   <repeatable>true</repeatable>
   <binding>
                 <condition>
                    <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">false</value>
                   </equals>
                 </condition>
    <command>property-adjust</command>
    <property>/autopilot/settings/heading-bug-deg</property>
       <step>0.1</step>
       <min>0</min>
       <max>360</max>
       <wrap>true</wrap>
   </binding>



   <binding>
                <condition>
                    <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">true</value>
                   </equals>
                 </condition>
    <command>property-adjust</command>
         <property>/instrumentation/nav[0]/radials/selected-deg</property>
       <step>0.1</step>
       <min>0</min>
       <max>360</max>
       <wrap>true</wrap>
   </binding>




  </high>
 </axis>







 <axis>
  <desc>Hat_up_down</desc>
  <number>
   <unix>5</unix>
   <windows>7</windows>
   <mac>5</mac>
  </number>
  <low>
   <repeatable>true</repeatable>
   <binding>

                 <condition>
                    <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">false</value>
                   </equals>
                 </condition>
    <command>property-adjust</command>
    <property>/autopilot/settings/target-altitude-ft</property>
    <step type="double">10.0</step>
       <min>100</min>
       <max>50000</max>
  </binding>
   <binding>

                 <condition>
                    <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">true</value>
                   </equals>
                 </condition>
    <command>property-adjust</command>
    <property>/autopilot/settings/vert-speed-fpm</property>
    <step type="double">100.0</step>
       <min>-10000</min>
       <max>10000</max>
  </binding>
  </low>
  <high>
   <repeatable>true</repeatable>
   <binding>
                 <condition>
                    <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">false</value>
                   </equals>
                 </condition>
    <command>property-adjust</command>
    <property>/autopilot/settings/target-altitude-ft</property>
    <step type="double">-10.0</step>
       <min>100</min>
       <max>50000</max>
   </binding>

   <binding>
                 <condition>
                    <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">true</value>
                   </equals>
                 </condition>
    <command>property-adjust</command>
    <property>/autopilot/settings/vert-speed-fpm</property>
    <step type="double">-100.0</step>
       <min>-10000</min>
       <max>10000</max>
  </binding>
  </high>
 </axis>

 <button n="0">
  <desc>Triger</desc>
   <binding>
   <command>property-assign</command>
   <property>/controls/autoflight/autopilot/shift</property>
   <value type="bool">true</value>
  </binding>
  <mod-up>
   <binding>
   <command>property-assign</command>
   <property>/controls/autoflight/autopilot/shift</property>
   <value type="bool">false</value>
   </binding>
  </mod-up>
 </button>
<!--

 <button n="0">
        <desc>DISENGAGE</desc>

          <binding>
          <command>property-assign</command>
          <property>/controls/autoflight/autopilot/engage</property>
          <value type="bool">false</value>
                <step>1</step>
                <min>0</min>
                <max>6</max>
                <wrap>false</wrap>
          </binding>

          <binding>
          <command>property-assign</command>
          <property>/autopilot/locks/heading</property>
          <value type="string">off</value>
          </binding>


          <binding>
          <command>property-assign</command>
          <property>/autopilot/locks/altitude</property>
          <value type="string">off</value>
          </binding>

          <binding>
          <command>property-assign</command>
           <property>/controls/autoflight/autopilot/alt-hld</property>
                   <value>0</value>
          </binding>

          <binding>
          <command>property-assign</command>
           <property>/controls/autoflight/autopilot/hdg-sel</property>
                   <value type="bool">false</value>
          </binding>

         <binding>
          <command>property-assign</command>
           <property>/controls/autoflight/autopilot/app</property>
                   <value type="bool">false</value>
          </binding>

          <binding>
          <command>property-assign</command>
           <property>/controls/autoflight/autopilot/vor</property>
                   <value type="bool">false</value>
          </binding>
 </button>

-->

 <button n="2">
  <desc>Autopilot_engage</desc>
  <repeatable type="bool">false</repeatable>
    <binding>
    <command>property-toggle</command>
    <property>/controls/autoflight/autopilot/engage</property>
    </binding>

          <binding>
          <condition>
                <equals>
                         <property>/controls/autoflight/autopilot/engage</property>
                             <value type="bool">true</value>
                </equals>
          </condition>
          <command>property-assign</command>
          <property>/controls/autoflight/autopilot/shift</property>
          <value type="bool">false</value>
          </binding>


          <binding>
           <condition>
                <equals>
                         <property>/controls/autoflight/autopilot/engage</property>
                             <value type="bool">true</value>
                </equals>
          </condition>
          <command>property-assign</command>
          <property>/autopilot/locks/altitude</property>
          <value type="string">off</value>
          </binding>

          <binding>
           <condition>
                <equals>
                         <property>/controls/autoflight/autopilot/engage</property>
                             <value type="bool">true</value>
                </equals>
        </condition>
          <command>property-assign</command>
          <property>/autopilot/locks/vert-speed</property>
          <value type="string">off</value>
          </binding>

          <binding>
           <condition>
                <equals>
                         <property>/controls/autoflight/autopilot/engage</property>
                             <value type="bool">true</value>
                </equals>
        </condition>
          <command>property-assign</command>
          <property>/autopilot/locks/heading</property>
          <value type="string">off</value>
          </binding>




          <binding>
           <condition>
                <equals>
                         <property>/controls/autoflight/autopilot/engage</property>
                             <value type="bool">true</value>
                </equals>
        </condition>
          <command>property-assign</command>
          <property>/controls/autoflight/autothrottle-engage</property>
          <value type="bool">false</value>
          </binding>


          <binding>
           <condition>
                <equals>
                         <property>/controls/autoflight/autopilot/engage</property>
                             <value type="bool">true</value>
                </equals>
        </condition>
          <command>property-assign</command>
          <property>/autopilot/locks/speed</property>
          <value type="string">off</value>
          </binding>


<!-- added for off funtion -->

          <binding>
           <condition>
                <equals>
                         <property>/controls/autoflight/autopilot/engage</property>
                             <value type="bool">false</value>
                </equals>
          </condition>
          <command>property-assign</command>
           <property>/controls/autoflight/autopilot/hdg-sel</property>
                   <value type="bool">false</value>
          </binding>

         <binding>
           <condition>
                <equals>
                         <property>/controls/autoflight/autopilot/engage</property>
                             <value type="bool">false</value>
                </equals>
        </condition>
          <command>property-assign</command>
           <property>/controls/autoflight/autopilot/app</property>
                   <value type="bool">false</value>
          </binding>

          <binding>
           <condition>
                <equals>
                         <property>/controls/autoflight/autopilot/engage</property>
                             <value type="bool">false</value>
                </equals>
        </condition>
          <command>property-assign</command>
           <property>/controls/autoflight/autopilot/vor</property>
                   <value type="bool">false</value>
          </binding>

        <binding>
               <condition>
                    <equals>
                    <property>/controls/autoflight/autopilot/engage</property>
                    <value type="bool">false</value>
                   </equals>

                </condition>
          <command>property-assign</command>
          <property>/autopilot/locks/heading</property>
          <value type="string">false</value>
          </binding>



          <binding>
           <condition>
                <equals>
                         <property>/controls/autoflight/autopilot/engage</property>
                             <value type="bool">false</value>
                </equals>
        </condition>
          <command>property-assign</command>
          <property>/controls/autoflight/autothrottle-engage</property>
          <value type="bool">false</value>
          </binding>


          <binding>
           <condition>
                <equals>
                         <property>/controls/autoflight/autopilot/engage</property>
                             <value type="bool">false</value>
                </equals>
        </condition>
          <command>property-assign</command>
          <property>/autopilot/locks/speed</property>
          <value type="string">off</value>
          </binding>




          <binding>
           <condition>
                <equals>
                         <property>/controls/autoflight/autopilot/engage</property>
                             <value type="bool">false</value>
                </equals>
        </condition>
          <command>property-assign</command>
          <property>/controls/autoflight/autothrottle-engage</property>
          <value type="bool">false</value>
          </binding>


          <binding>
           <condition>
                <equals>
                         <property>/controls/autoflight/autopilot/engage</property>
                             <value type="bool">false</value>
                </equals>
        </condition>
          <command>property-assign</command>
          <property>/autopilot/locks/speed</property>
          <value type="string">off</value>
          </binding>




 </button>

<!-- un shifted HDG_HLD -->

  <button n="3">
  <desc>HDG_HLD</desc>
  <repeatable type="bool">false</repeatable>
        <binding>
               <condition>
                 <and>
                    <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">false</value>
                   </equals>

                    <equals>
                    <property>/controls/autoflight/autopilot/engage</property>
                     <value type="bool">true</value>
                   </equals>
                    <equals>
                     <property>/controls/autoflight/autopilot/app</property>
                     <value type="bool">false</value>>
                   </equals>
                 </and>
                </condition>
          <command>property-assign</command>
          <property>/autopilot/locks/heading</property>
          <value type="string">HDG-SEL</value>
          </binding>

          <binding>
          <condition>
                 <and>

                    <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">false</value>
                   </equals>

                    <equals>
                    <property>/autopilot/locks/heading</property>
                      <value type="string">HDG-SEL</value>
                   </equals>
                 </and>
          </condition>
           <command>property-assign</command>
           <property>/controls/autoflight/autopilot/hdg-sel</property>
            <value type="bool">true</value>
       </binding>

        <binding>
          <condition>
                 <and>

                    <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">false</value>
                   </equals>

                    <equals>
                    <property>/autopilot/locks/heading</property>
                      <value type="string">HDG-SEL</value>
                   </equals>
                 </and>
          </condition>
           <command>property-assign</command>
           <property>/controls/autoflight/autopilot/vor</property>
            <value type="bool">false</value>
         </binding>
<!--start hdg shifted -->
 <!--  shifted VOR-LOC -->
     <binding>
               <condition>
                 <and>
                    <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">true</value>
                   </equals>

                    <equals>
                    <property>/controls/autoflight/autopilot/engage</property>
                     <value type="bool">true</value>
                   </equals>
                    <equals>
                    <property>/controls/autoflight/autopilot/app</property>
                    <value type="bool">false</value>>
                    </equals>
               </and>
          </condition>
          <command>property-assign</command>
          <property>/autopilot/locks/heading</property>
           <value type="string">VOR-LOC</value>
          </binding>


       <binding>
               <condition>
                  <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">true</value>
                  </equals>
               </condition>
       <command>property-assign</command>
       <property>/controls/autoflight/autopilot/hdg-sel</property>
       <value type="bool">false</value>
       </binding>

         <binding>
               <condition>
                 <and>
                   <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">true</value>
                  </equals>
                   
		   <equals>
                    <property>/controls/autoflight/autopilot/engage</property>
                     <value type="bool">true</value>
                   </equals>
                    <equals>
                     <property>/controls/autoflight/autopilot/app</property>
          <value type="bool">false</value>>
                   </equals>
               </and>
          </condition>
          <command>property-assign</command>
          <property>/controls/autoflight/autopilot/vor</property>
            <value type="bool">true</value>
          </binding>
 
<!--
</binding>
-->
 </button>

<!-- un shifted ALT-HLD -->

 <button n="4">
  <desc>ALT-HLD</desc>
  <repeatable type="bool">false</repeatable>
       <binding>
         <condition>
              <and>
                <equals>
                 <property>/controls/autoflight/autopilot/engage</property>
                   <value type="bool">true</value>
                </equals>
                <equals>
                  <property>/autopilot/locks/altitude</property>
                   <value type="string">off</value>
                </equals>
             </and>
         </condition>
         <command>property-assign</command>
         <property>/autopilot/locks/altitude</property>
         <value type="string">ALT-ACQ</value>
         </binding>
         <binding>
         <condition>
                <equals>
                   <property>/autopilot/locks/altitude</property>
                    <value type="string">ALT-ACQ</value>
                </equals>
         </condition>
         <command>property-assign</command>
          <property>/controls/autoflight/autopilot/alt-hld</property>
          <value>1</value>
          </binding>

 </button>



 <button n="1">
  <desc>APP</desc>
  <repeatable type="bool">false</repeatable>
       <binding>
        <condition>
       <equals>
       <property>/controls/autoflight/autopilot/engage</property>
       <value type="bool">true</value>
       </equals>
       </condition>
       <command>property-assign</command>
       <property>/autopilot/locks/altitude</property>
       <value type="string">G/S</value>
       </binding>

       <binding>
       <condition>
       <equals>
       <property>/controls/autoflight/autopilot/engage</property>
       <value type="bool">true</value>
       </equals>
       </condition>
       <command>property-assign</command>
       <property>/autopilot/locks/heading</property>
       <value type="string">VOR-LOC</value>
       </binding>

       <binding>
        <condition>
       <equals>
        <property>/autopilot/locks/altitude</property>
       <value type="string">G/S</value>
       </equals>
       </condition>
       <command>property-assign</command>
      <property>/controls/autoflight/autopilot/app</property>
       <value type="bool">true</value>
       </binding>
       <binding>
       <condition>
       <equals>
        <property>/autopilot/locks/altitude</property>
       <value type="string">G/S</value>
       </equals>
       </condition>
       <command>property-assign</command>
      <property>/controls/autoflight/autopilot/vor</property>
       <value type="bool">false</value>
       </binding>

       <binding>
       <condition>
       <equals>
        <property>/autopilot/locks/altitude</property>
       <value type="string">G/S</value>
       </equals>
       </condition>
       <command>property-assign</command>
      <property>/controls/autoflight/autopilot/alt-hld</property>
       <value>0</value>
       </binding>

       <binding>
       <condition>
       <equals>
        <property>/autopilot/locks/altitude</property>
       <value type="string">G/S</value>
       </equals>
       </condition>
       <command>property-assign</command>
      <property>/controls/autoflight/autopilot/hdg-sel</property>
       <value type="bool">false</value>
       </binding>

 </button>


 <button n="5">
  <desc>SPEED</desc>
  <repeatable type="bool">false</repeatable>
  
        
       <binding>
               <condition>                
                    <equals>
                    <property>/controls/autoflight/autopilot/engage</property>
                     <value type="bool">true</value>
                   </equals>                  
          </condition>
          <command>property-assign</command>
          <property>/autopilot/locks/speed</property>
           <value type="string">THR</value>
          </binding>

          <binding>
          <condition>                
                    <equals>
                    <property>/controls/autoflight/autopilot/engage</property>
                     <value type="bool">true</value>
                   </equals>                  
          </condition>
           <command>property-assign</command>
           <property>/controls/autoflight/autothrottle-engage</property>
          <value type="string">true</value>                   
          </binding>      
  
 </button>



<!--
 <button n="6">
  <desc>VOR-LOC</desc>
  <repeatable type="bool">false</repeatable>
  



     <binding>
               <condition>
                 <and>
                    <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">true</value>
                   </equals>

                    <equals>
                    <property>/controls/autoflight/autopilot/engage</property>
                     <value type="bool">true</value>
                   </equals>
                    <equals>
                    <property>/controls/autoflight/autopilot/app</property>
                    <value type="bool">false</value>>
                    </equals>
               </and>
          </condition>
          <command>property-assign</command>
          <property>/autopilot/locks/heading</property>
           <value type="string">VOR-LOC</value>
          </binding>


       <binding>
               <condition>
                  <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">true</value>
                  </equals>
               </condition>
       <command>property-assign</command>
       <property>/controls/autoflight/autopilot/hdg-sel</property>
       <value type="bool">false</value>
       </binding>







         <binding>
               <condition>
                 <and>
                   <equals>
                    <property>/controls/autoflight/autopilot/shift</property>
                     <value type="bool">true</value>
                  </equals>
                   
		   <equals>
                    <property>/controls/autoflight/autopilot/engage</property>
                     <value type="bool">true</value>
                   </equals>
                    <equals>
                     <property>/controls/autoflight/autopilot/app</property>
          <value type="bool">false</value>>
                   </equals>
               </and>
          </condition>
          <command>property-assign</command>
          <property>/controls/autoflight/autopilot/vor</property>
            <value type="bool">true</value>
          </binding>




 </button>
-->


 </PropertyList>


------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to