Jump to content
Sign in to follow this  
Guest Maltish

K:TOGGLE_GPS_DRIVES_NAV1

Recommended Posts

Guest Maltish

Wonder if anyone has the Gospel on his one ?I Am finding that The K Event (>K:TOGGLE_GPS_DRIVES_NAV1) will ONLY WORK via a Click event ???I'm trying to toggle this command via an <UPDATE> but FSX just doesnt seem to see it ... This is very frustrating as the same Update has the Event (>K:AP_NAV1_HOLD_ON) that works Perfectly :( Code attached for reference (translation- "Code attached in case I made a Major foo pah in the syntax"

(L:NavMode, enum) 0 == (A:GPS DRIVES NAV1, bool) && if{ (>K:TOGGLE_GPS_DRIVES_NAV1) }(L:NavMode, enum) 0 == (A:AUTOPILOT NAV1 LOCK, bool) && if{ (>K:AP_NAV1_HOLD_OFF) }(L:NavMode, enum) 1 == (A:GPS DRIVES NAV1, bool) && if{ (>K:TOGGLE_GPS_DRIVES_NAV1) }(L:NavMode, enum) 1 == (A:AUTOPILOT NAV1 LOCK, bool) ! && if{ (>K:AP_NAV1_HOLD_ON)  }(L:NavMode, enum) 2 == (A:GPS DRIVES NAV1, bool) ! && if{ (>K:TOGGLE_GPS_DRIVES_NAV1) }(L:NavMode, enum) 2 == (A:GPS DRIVES NAV1, bool) && if{ (>K:AP_NAV1_HOLD_ON) }

Anything ?

Share this post


Link to post
Share on other sites

Hi,Not sure, fs9, may be you just need also nav1 hold to drive the plane with the gps; i do.Jan

Share this post


Link to post
Share on other sites
Guest Maltish

Possibly so .. but I would like to be able to turn the darned thing on and off :) To clarify, Its actually part of an Autopilot gauge build.. Where I have to use and display both TRK mode and NAV Modecheers

Hi,Not sure, fs9, may be you just need also nav1 hold to drive the plane with the gps; i do.Jan

Share this post


Link to post
Share on other sites

Hi,Try(L:NavMode, enum) 1 == (A:GPS DRIVES NAV1,bool) ! and if{ (>K:TOGGLE_GPS_DRIVES_NAV1) } (L:NavMode, enum) 1 == (A:AUTOPILOT NAV1 LOCK,bool) ! and if{ (>K:AP_NAV1_HOLD_ON) } May be the ! ?? What do you try to achieve in the different modes?Is Navmode an click?In that case you can put the other commands in that click.Jan

Share this post


Link to post
Share on other sites
Guest Maltish

Thanks,Simply trying to achieve NAV TRK and HDG Buttons on the Dynon AP74Whereby - IF TRK Is selected then NAV is ON and GPS is ON and conversley - if NAV is selected then NAV is ON but GPS is OFFHDG button is not an issue

Hi,Try(L:NavMode, enum) 1 == (A:GPS DRIVES NAV1,bool) ! and if{ (>K:TOGGLE_GPS_DRIVES_NAV1) } (L:NavMode, enum) 1 == (A:AUTOPILOT NAV1 LOCK,bool) ! and if{ (>K:AP_NAV1_HOLD_ON) } May be the ! ?? What do you try to achieve in the different modes?Jan

Share this post


Link to post
Share on other sites

In FS the two modes are mutually exclusive. You cannot have both NAV and GPS active at the same time.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Ok,I should program the AP pushbuttons like this, not tested:Bit of Heading mode added.TRK Mode(L:TRK,enum) and (L:NAV,enum) could drive the bitmaps of the switches.TRK Mode(L:TRK,enum) 0 == if{ 1 (>L:TRK,enum) 0 (>L:NAV,enum) (>K:AP_HDG_HOLD_OFF) (>K:AP_NAV1_HOLD_ON) (A:GPS DRIVES NAV1,bool) ! if{ (>K:TOGGLE_GPS_DRIVES_NAV1) } } els{ 0 (>L:TRK,enum) (A:GPS DRIVES NAV1,bool) if{ (>K:TOGGLE_GPS_DRIVES_NAV1) (>K:AP_NAV1_HOLD_OFF) } } NAV Mode(L:NAV,enum) 0 == if{ 1 (>L:NAV,enum) 0 (>L:TRK,enum) (>K:AP_HDG_HOLD_OFF) (A:GPS DRIVES NAV1,bool) if{ (>K:TOGGLE_GPS_DRIVES_NAV1) } (>K:AP_NAV1_HOLD_ON) } els{ 0 (>L:NAV,enum) (>K:AP_NAV1_HOLD_OFF) } You don't need the update, more code efficient.Hope it helps,Jan

Share this post


Link to post
Share on other sites
Guest Maltish

Sorry But I beg to differ :(Maybe in the "real word" your statement is correct but in FSX, The modes are NAV1 + GPSor NAV1 with GPS off So, in effect when following GPS, then both GPS AND NAV are indeed activeUnless I have missed some fundemental something somwehere ??Hence the problem, however it doesnt explain why the K Event cant be sent via code (as opposed to a mouse click)

In FS the two modes are mutually exclusive. You cannot have both NAV and GPS active at the same time.
I think you missed the point of my forst post ;) I had the logic all worked out quite niceley, however I have found that the K EVENT (>K:TOGGLE_GPS_DRIVES_NAV1) does not work at all In a mouse click Keyevent TOGGLE_GPS_DRIVES_NAV1 works just Fine but NOT as above in a code section or update :( If I could getthat working then I could get my Logic working LOL Thanks for the code though, always good to have another view of the solution
Ok,I should program the AP pushbuttons like this, not tested:Bit of Heading mode added.TRK Mode(L:TRK,enum) and (L:NAV,enum) could drive the bitmaps of the switches.TRK Mode(L:TRK,enum) 0 == if{ 1 (>L:TRK,enum) 0 (>L:NAV,enum) (>K:AP_HDG_HOLD_OFF) (>K:AP_NAV1_HOLD_ON) (A:GPS DRIVES NAV1,bool) ! if{ (>K:TOGGLE_GPS_DRIVES_NAV1) } } els{ 0 (>L:TRK,enum) (A:GPS DRIVES NAV1,bool) if{ (>K:TOGGLE_GPS_DRIVES_NAV1) (>K:AP_NAV1_HOLD_OFF) } } NAV Mode(L:NAV,enum) 0 == if{ 1 (>L:NAV,enum) 0 (>L:TRK,enum) (>K:AP_HDG_HOLD_OFF) (A:GPS DRIVES NAV1,bool) if{ (>K:TOGGLE_GPS_DRIVES_NAV1) } (>K:AP_NAV1_HOLD_ON) } els{ 0 (>L:NAV,enum) (>K:AP_NAV1_HOLD_OFF) } You don't need the update, more code efficient.Hope it helps,Jan

Share this post


Link to post
Share on other sites

OK - if you want to keep the <Update> type setup ... There was an error in line 4, 1 too many spaces preceding the } . Probably halted all subsequent stuff. Here's another way to write this.

(L:NavMode, enum) 0 == (A:GPS DRIVES NAV1, bool) && if{ (>K:TOGGLE_GPS_DRIVES_NAV1) }(L:NavMode, enum) 0 == (A:AUTOPILOT NAV1 LOCK, bool) && if{ (>K:AP_NAV1_HOLD_OFF) }(L:NavMode, enum) 0 > (A:AUTOPILOT NAV1 LOCK, bool) ! && if{ (>K:AP_NAV1_HOLD_ON) }(L:NavMode, enum) 1 == (A:GPS DRIVES NAV1, bool) && if{ (>K:TOGGLE_GPS_DRIVES_NAV1) }(L:NavMode, enum) 2 == (A:GPS DRIVES NAV1, bool) ! && if{ (>K:TOGGLE_GPS_DRIVES_NAV1) }

Roman


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

 

Share this post


Link to post
Share on other sites
Guest Maltish

ALL OK NOW FOLKS !!!Many thanks to all contributors, especially JanWith a few small edits to Jans suggested code It's all working fine now .. Just as advertised :) please feel free to reuse the code below (With Jans permission too of course !)

TRK Mode ------------------------------------------------(L:TRK,enum) 0 == if{ 1 (>L:TRK,enum) 0 (>L:NAV,enum) 0 (>L:HDG,enum) (A:GPS DRIVES NAV1,bool) ! if{ (>K:TOGGLE_GPS_DRIVES_NAV1) } (>K:AP_NAV1_HOLD_ON) (>K:AP_HDG_HOLD_OFF) } els{ 0 (>L:TRK,enum) (A:GPS DRIVES NAV1,bool) if{ (>K:TOGGLE_GPS_DRIVES_NAV1) (>K:AP_NAV1_HOLD_OFF) } } NAV Mode -------------------------------------------------(L:NAV,enum) 0 == if{ 1 (>L:NAV,enum) 0 (>L:TRK,enum) 0 (>L:HDG,enum) (A:GPS DRIVES NAV1,bool) if{ (>K:TOGGLE_GPS_DRIVES_NAV1) } (>K:AP_NAV1_HOLD_ON) (>K:AP_HDG_HOLD_OFF) } els{ 0 (>L:NAV,enum) (>K:AP_NAV1_HOLD_OFF) } HDG Mode -------------------------------------------------(L:HDG,enum) 0 == if{1 (>L:HDG,enum) 0 (>L:NAV,enum) 0 (>L:TRK,enum) (>K:AP_HDG_HOLD_ON) (>K:AP_NAV1_HOLD_OFF) } els{ 0 (>L:HDG,enum) (>K:AP_HDG_HOLD_OFF) } ALT MODE -------------------------------------------------(L:ALT,enum) 0 == if{1 (>L:ALT,enum) (>K:AP_ALT_HOLD_ON) } els{ 0 (>L:ALT,enum) (>K:AP_ALT_HOLD_OFF) } 

Now only ONE Horizontal AP mode is allowed at any one time, and the (L:NAV) (L:HDG) & (L:TRK) vars are used for display purposes selecting ANY Horizontal Mode toggles off the rest and deselects GPS where required. Again MANY Thanks to Jan for his code, and everyone else for the help here

Share this post


Link to post
Share on other sites
Sorry But I beg to differ :(Maybe in the "real word" your statement is correct but in FSX, The modes are NAV1 + GPSor NAV1 with GPS off So, in effect when following GPS, then both GPS AND NAV are indeed activeUnless I have missed some fundemental something somwehere ??
I see that you've got what you wanted to work, working...Just for the sake of clarification though, you did in fact misinterpret my answer.Since the key_event (>K:TOGGLE_GPS_DRIVES_NAV1) is effectively nothing more than a "switch" that couples the signal from Nav1, Nav2, or GPS to the autopilot, when I said "active" I meant it in that sense.While you can display all three lateral modes simultaneously, you can only have one of them "active" at any given time... :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest Maltish

Appreciated ;)Thanks for the help and clarification, I knew what I meant to say, as I'm sure you did LOL

I see that you've got what you wanted to work, working...Just for the sake of clarification though, you did in fact misinterpret my answer.Since the key_event (>K:TOGGLE_GPS_DRIVES_NAV1) is effectively nothing more than a "switch" that couples the signal from Nav1, Nav2, or GPS to the autopilot, when I said "active" I meant it in that sense.While you can display all three lateral modes simultaneously, you can only have one of them "active" at any given time... :(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...