Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Auto-coordination gauge

Featured Replies

Hi All, I tried cobbling together a gauge which would temporarily switch to auto-coordination when the autopilot heading hold is on. This actually works:<Gauge Name="Autopilot Hdg AutoCoord" Version="1.0"> <Element> <Select> <Value>(A:Autopilot heading lock, bool) 0 == ; if{ (>K:AUTOCOORD_OFF) } </Value> </Select> </Element> <Element> <Select> <Value>(A:Autopilot heading lock, bool) 1 == ; if{ (>K:AUTOCOORD_ON) } </Value> </Select> </Element> </Gauge>//---------------------------------------------------------------------------------- I'm betting though, there's a more efficient way of scripting it. Any ideas welcome. Thanks for your consideration.

Hi,Try:<Gauge><Update>(A:Autopilot heading lock, bool) ! if{ (>K:AUTOCOORD_OFF) } els{ (>K:AUTOCOORD_ON) } </Update></Gauge>Jan

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Author

Thanks a bunch Jan! I'm now running:<Gauge Name="Autopilot Hdg AutoCoord" Version="1.0"><Update>(A:Autopilot heading lock, bool) ! if{ (>K:AUTOCOORD_OFF) } els{ (>K:AUTOCOORD_ON) } </Update></Gauge>//-----------------------------//Works perfectly! Wow, this simple addition really improves the realism of the autopilot heading hold. You gotta love this xml stuff!

The gauge may work , but you are going to run into the "constant firing" condition which isn't good. Maybe try ---

<Gauge Name="Autopilot Hdg AutoCoord" Version="1.0"><Update>(A:Autopilot heading lock, bool)  (A:Auto Coordination, bool) ! & if{ (>K:AUTOCOORD_ON) } (A:Autopilot heading lock, bool) ! (A:Auto Coordination, bool)  & if{ (>K:AUTOCOORD_OFF) } </Update></Gauge>

Roman

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

  • Author

Thanks very much Roman! Tried your code and it works great.

hi,tested, no firing, it is not a togglejan

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Author

Thanks for testing Jan, I couldn't see how your code could produce 'constant firing' but I'm not very knowledgeable. Just curious, is there a utility which will show if a script is in the 'constant firing' mode?

I may be wrong here, but it is my understanding that if a pre-condition isn't checked the command will fire 18 times a second instead of just once when needed causing for instance the Shift-E 1,2,3,4 dilemma. Where after hitting shift-E the autocoord will fire in the mean time taking away the listening mode for the next keypress (1,2,3,4)IE -- Hdg is on.. (A:Autopilot heading lock, bool) ! if{ (>K:AUTOCOORD_OFF) } els{ (>K:AUTOCOORD_ON) } fired AUTOCOORD_ON(A:Autopilot heading lock, bool) ! if{ (>K:AUTOCOORD_OFF) } els{ (>K:AUTOCOORD_ON) } fired AUTOCOORD_ON(A:Autopilot heading lock, bool) ! if{ (>K:AUTOCOORD_OFF) } els{ (>K:AUTOCOORD_ON) } fired AUTOCOORD_ON(A:Autopilot heading lock, bool) ! if{ (>K:AUTOCOORD_OFF) } els{ (>K:AUTOCOORD_ON) } fired AUTOCOORD_ON(A:Autopilot heading lock, bool) ! if{ (>K:AUTOCOORD_OFF) } els{ (>K:AUTOCOORD_ON) } fired AUTOCOORD_ON(A:Autopilot heading lock, bool) ! if{ (>K:AUTOCOORD_OFF) } els{ (>K:AUTOCOORD_ON) } fired AUTOCOORD_ON6 commands in just 1/3 second.Where as A:Autopilot heading lock, bool) (A:Auto Coordination, bool) ! & if{ (>K:AUTOCOORD_ON) } fired AUTOCOORD_ON only if it was off. Just once.Just my understanding of the deal -- Of course both codes do work :-)Roman

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

  • Moderator
hi,tested, no firing, it is not a togglejan
It doesn't need to be a toggle. Any time a key_event is sent more than once it triggers a "race condition."Roman's explanation is dead-on accurate.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Hi,Roman is off course right, but the strange thing is that testing with Doug's Event Logger showed no firing????Jan

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • 4 weeks later...

I'm happy that it works for you in XML, but it still doesn't work for me in C++ and I don't know why :( To set autocoordination on/off, I first tried this:

send_key_event(KEY_AUTOCOORD_SET, (UINT32)status);

It didn't work so I tried:

if (status)	execute_calculator_code("(>K:AUTOCOORD_ON)", NULL, NULL, NULL);else	execute_calculator_code("(>K:AUTOCOORD_OFF)", NULL, NULL, NULL);

It didn't work either...Do you have any idea?Thanks,Eric

I found the solution by myself :( The key events KEY_AUTOCOORD_OFF, KEY_AUTOCOORD_ON and KEY_AUTOCOORD_SET do not work, but it appears that KEY_AUTOCOORD_TOGGLE works !!I don't know why they implemented key events that are inoperative... or maybe I missed something.Eric

  • Moderator

Eric, I've run across some truly odd key_event behaviors myself lately.For example, trying to use the key_events to control an XML GPS has some real challenges.The key_event for color terrain toggles the flightplan submenu.The key_evenr for flightplan submenu toggles the color terrain... :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author

As an update, I'm using Roman's code (post #4) as a stand-alone for heading-hold and also inserted the code into an AUTOPILOT NAV1 LOCK gauge which also works flawlessly. Thanks again guys - this is really an improvement! Bud

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.