May 5, 201016 yr 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.
May 5, 201016 yr 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..."
May 5, 201016 yr 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!
May 5, 201016 yr 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 FS RTWR SHRS F-111 JoinFS Little Navmap
May 5, 201016 yr hi,tested, no firing, it is not a togglejan Jan "Beatus ille qui procul negotiis..."
May 5, 201016 yr 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?
May 6, 201016 yr 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 FS RTWR SHRS F-111 JoinFS Little Navmap
May 6, 201016 yr Moderator hi,tested, no firing, it is not a togglejanIt 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
May 6, 201016 yr 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..."
May 31, 201016 yr 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 My Web Site
May 31, 201016 yr 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 My Web Site
May 31, 201016 yr 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
May 31, 201016 yr 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