Board index FlightGear Support Flying

aircraft state when "position aircraft in the air"  Topic is solved

Controlling your aircraft, using the autopilot etc.

aircraft state when "position aircraft in the air"

Postby think nice things » Sun May 05, 2019 8:57 am

Hi,

I'm practising airport approaches repeatedly.
After landing, I use "position aircraft in the air" from the menu to set the aircraft back to a position about 2 nm away from the airport.
After landing, I've the flaps fully extended.
"position aircraft in the air" set the flaps to 0° which is _not_ what I'd like.

1. is it possible to keep the flaps untouched if I use "position aircraft in the air" (just leave the flaps where they're after landing)?
2. is it possible to assing the "position aircraft in the air" to a keyboard shortcut even bypassing the dialog where the position is set?
think nice things
 
Posts: 6
Joined: Sun Apr 21, 2019 7:15 am

Re: aircraft state when "position aircraft in the air"

Postby Thorsten » Sun May 05, 2019 9:18 am

There is no standard behavior, it all depends on the aircraft, whether it supports state overlay, how that is configured etc.

So pretty much anything is possible, but it might require adding to the aircraft / coding some extra.
Thorsten
 
Posts: 10986
Joined: Mon Nov 02, 2009 8:33 am

Re: aircraft state when "position aircraft in the air"

Postby think nice things » Sun May 05, 2019 12:16 pm

Thorsten,

thanks - where would I start to look for the C172P if I'd like to have the flaps untouched while "position aircraft in the air"?
think nice things
 
Posts: 6
Joined: Sun Apr 21, 2019 7:15 am

Re: aircraft state when "position aircraft in the air"

Postby Thorsten » Sun May 05, 2019 12:32 pm

You'd talk to the C-172p development team, stating your needs - there's plenty of customization and cutting-edge effort in that plane, so I wouldn't want to mess with that without help.
Thorsten
 
Posts: 10986
Joined: Mon Nov 02, 2009 8:33 am

Re: aircraft state when "position aircraft in the air"

Postby Alant » Sun May 05, 2019 12:45 pm

To do this you need to have a custom version of fgdata/gui/dialogs/location-in-air.xml. This in turn needs to be bound to the location-in air button. Below is an extract from one that I have in my own aircraft project which does exactly what you are asking.
Perhaps you could ask the C172 developers to add similar code to their aircraft.
Code: Select all
      <text>
         <label>Aircraft settings</label>
      </text>
      <layout>table</layout>

      <text>
         <row>1</row><col>0</col>
         <label>Flaps:</label>
      </text>

      <combo>
         <row>1</row><col>1</col>      
         <halign>left</halign>
         <x>10</x>
         <y>50</y>
         <width>200</width>
         <height>25</height>
         <property>sim/presets/flaps_deg</property>
         <value>0</value>
         <value>20</value>
         <value>35</value>
         <value>50</value>
         <binding>
            <command>dialog-apply</command>
         </binding>
         <binding>
            <command>nasal</command>
            <script>
               setprop("/sim/presets/flaps",getprop("/sim/presets/flaps_deg")/50.0);
            </script>
         </binding>         
      </combo>

      <text>
         <row>1</row><col>4</col>
         <label>Airbrakes:0</label>
      </text>
      <slider>
         <row>1</row><col>5</col>
         <width>200</width>
         <property>sim/presets/airbrakes</property>
         <min>0</min>
         <max>1</max>
         <step>0.2</step>
      </slider>
      <text>
         <row>1</row><col>6</col>
         <label>50</label>
      </text>
      <checkbox>
         <row>2</row><col>0</col>
         <label>Engines Running:</label>
         <property>sim/presets/engines_running</property>
         <live>true</live>
         <binding>
            <command>dialog-apply</command>
         </binding>    
      </checkbox>

      <checkbox>
         <row>2</row><col>1</col>
         <label>Brake Chute Arm:</label>
         <property>sim/presets/brake_chute</property>
         <live>true</live>
         <binding>
            <command>dialog-apply</command>
         </binding>    
      </checkbox>

      <checkbox>
         <row>3</row><col>0</col>
         <label>Gear Down</label>
         <property>sim/presets/gear_down</property>
         <enable><condition>
               <greater-than>
                  <property>sim/presets/altitude-ft</property>
                  <value type="double">0.5</value>
               </greater-than>
            </condition>
         </enable>
         <live>true</live>
         <binding>
            <command>dialog-apply</command>
         </binding>    
      </checkbox>

      <checkbox>
         <row>3</row><col>1</col>
         <label>Park Brake</label>
         <property>sim/presets/park_brake</property>
         <enable><condition>
               <greater-than>
                  <property>sim/presets/altitude-ft</property>
                  <value type="double">0.5</value>
               </greater-than>
            </condition>
         </enable>
         <live>true</live>
         <binding>
            <command>dialog-apply</command>
         </binding>    
      </checkbox>
Alant
 
Posts: 912
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: aircraft state when "position aircraft in the air"  

Postby wlbragg » Sun May 05, 2019 4:51 pm

After checking the "position aircraft in the air" feature to see if it was using the state settings, which it is, if you want to edit the portion that adjusts the flaps and feel comfortable editing a few lines of code, here is how...

In c172p/Nasal/state-manager.nas starting at about line 75 depending on your version.

Code: Select all
        if (distance_nm > 5) {
            setprop("/controls/engines/current-engine/throttle", 0.85);
            setprop("/controls/flight/flaps", .33);
        } else if (distance_nm > 1) {
            setprop("/controls/engines/current-engine/throttle", 0.80);
            setprop("/controls/flight/flaps", .66);
        } else {
            setprop("/controls/engines/current-engine/throttle", 0.75);
            setprop("/controls/flight/flaps", 1);
        }


In this case you can comment out the line that adjusts the flaps when distance to airport is greater than 1 NM (that will reset to no flaps) or change it to 1 for full flaps,
The above is made to look like this.

No flaps adjustment I think will default to 0 flaps.
Code: Select all
        } else if (distance_nm > 1) {
            setprop("/controls/engines/current-engine/throttle", 0.80);
            #setprop("/controls/flight/flaps", .66);
        } else {


or for full flaps
Code: Select all
        } else if (distance_nm > 1) {
            setprop("/controls/engines/current-engine/throttle", 0.80);
            setprop("/controls/flight/flaps", 1);
        } else {
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4891
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: aircraft state when "position aircraft in the air"

Postby think nice things » Sun May 05, 2019 9:44 pm

wow thanks, that helped.

If I comment the line which is setting the flaps out, flaps are set to 0°.
So flaps seem to be set to zero somewhere else.
Nevertheless I can now modify in c172p/Nasal/state-manager.nas to which value the flaps are set _after_ they've been set to zero.

thanks again!
think nice things
 
Posts: 6
Joined: Sun Apr 21, 2019 7:15 am


Return to Flying

Who is online

Users browsing this forum: No registered users and 4 guests