Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
Collapse
Just Flight Community Forum
  1. Home
  2. Just Flight
  3. MSFS Products
  4. Black Square Add-Ons
  5. Bonanza Professional
  6. Extra lvars for the Bonanza's KAS297B

Extra lvars for the Bonanza's KAS297B

Scheduled Pinned Locked Moved Bonanza Professional
3 Posts 2 Posters 68 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • JibletJ Offline
    JibletJ Offline
    Jiblet
    wrote last edited by
    #1

    Hi @Black-Square,

    You might remember me mucking about with the Starship and the DH and MDA vars, getting them exposed so I could show them on a Stream Deck from this thread

    Well you'll be thrilled to hear I've been fiddling again - this time with the Bonanza! 😆

    I've been building a Stream Deck profile for the aircraft using PilotsDeck, and following the same approach you kindly helped with on the Starship, I've made some small modifications to KAS297B.js that I'd love to see included in a future update, both to save others the effort, and more selfishly, so that my changes don't get overwritten!

    The KAS297B has several internal JavaScript properties that are invisible externally, so I've exposed some of them as L-Vars with the following additions:

    1. L:var_kas297b_ArmedVS (feet per minute)
      The "pending" vertical speed held in this.armedVerticalSpeed before ENG VS is pressed. Updated in each of the 100_INC, 100_DEC, 1000_INC, 1000_DEC knob cases, and also in the Update() loop where armedVerticalSpeed is synced from the AP var.

    2. L:var_kas297b_OptionalArming (0/1)
      Exposes this.optionalArmingMode. Updated in the ArmButton case (both true and false branches), and in the Update() loop where it's reset when VS hold becomes active.

    3. L:var_kas297b_ArmAnnun (0/1)
      Mirrors the ARM annunciator state. Set at the end of the ARM annunciator block in Update().

    4. L:var_kas297b_AltAlert (0/1)
      Mirrors the ALERT annunciator state. Set in both branches of the altitude alerting block in Update().

    5. L:var_kas297b_CaptAnnun (0/1)
      Mirrors the CAPT annunciator state. Set at the end of the capture annunciator block in Update().

    All changes are purely additive and don't change any existing logic. The L-Vars only update when the underlying values actually change, so the performance impact should be negligible - they're driven by the same conditionals that already drive the screen annunciators.

    I'd be happy to share the full modified file or a diff if that would make it easier.

    For reference, here's a summary of all the new L-Vars:

    L-Var Type Description
    L:var_kas297b_ArmedVS feet per minute Pending armed VS value before ENG VS is pressed. Matches what the unit displays on screen.
    L:var_kas297b_OptionalArming 0/1 Whether optional arming mode is active (ARM button pressed manually).
    L:var_kas297b_ArmAnnun 0/1 Mirrors the ARM annunciator on the unit display.
    L:var_kas297b_AltAlert 0/1 Mirrors the ALERT annunciator (aircraft within 280–1020ft of selected altitude).
    L:var_kas297b_CaptAnnun 0/1 Mirrors the CAPT annunciator.

    Thanks again for everything you do for the community - and for being so generous with your time helping users like me dig into the internals... probably a little too much!

    Here's an unfinished example of what it's all for, straight from the Stream Deck:
    482b2175-ff42-4bf7-98ae-120af8159d58-image.png

    And from the cockpit:
    e1540159-b2ea-42ee-904b-d95f18366af2-image.png

    Thanks!
    Jiblet

    1 Reply Last reply
    1
    • Black SquareB Offline
      Black SquareB Offline
      Black Square
      Black Square Developer
      wrote last edited by
      #2

      That's wonderful! I always enjoy seeing my users take things into their own hands to get exactly what they're looking for from my aircraft. Yes, please share the file, and I will take a look. I can't image why we shouldn't be able to include this in the base file, assuming you're willing to contribute. If you use something like pastebin, you can set an expiratory date of even just one day, and I should be able to get to this tomorrow. Thank you! I also appreciate the documentation you wrote here so I can see all your changes when I go through the file 🙂

      1 Reply Last reply
      1
      • JibletJ Offline
        JibletJ Offline
        Jiblet
        wrote last edited by
        #3

        Thanks so much for the positive response - I'd be absolutely delighted to contribute, and it would be great to see these changes make it into the base file! They should work in other KAS297B equipped planes too unless your code changes wildly between them.

        Here's the modified KAS297B.js on Pastebin: https://pastebin.com/N2zwz8ia

        I've not changed any formatting, so it should diff nicely. And all my additions are commented with //Jiblet:
        I've added a bit of explanation inline either for you, or for future me when I need to go back and see why I did what I did.

        I think its as performant as possible but I've not written a line of production code in about 15 years, so I make no promises that I haven't done something daft!

        I've spent some time this morning completing the Stream Deck version of the KAS297B, in case I needed any other vars exposed but it looks like we're good and I'm done with it, bar any minor formatting/position tweaks as I give it some testing:

        d2408272-307d-46b6-ac39-9f9b57c103b0-preview.webp

        14f8f57f-817d-481c-a652-f7b42268d79e-preview-1.webp

        It's a silly little thing but I'm quite please with it!
        The little extra grey dot is just to show if you're changing 100s or 1000s (using the upper/lower knob) as the Stream Deck only has single knobs, not dual.

        Thanks again! It's a great to be able to contribute something back, even if it's tiny!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users