Thranda Kodiak Master Switch Panel - Help!!

Peer support for Air Manager desktop users

Moderators: russ, Ralph

Post Reply
Message
Author
dameng
Posts: 13
Joined: Tue Apr 12, 2022 2:03 am

Thranda Kodiak Master Switch Panel - Help!!

#1 Post by dameng »

Hello,
I'm very new to this Air Manager & programming. I'm able to copy,paste, edit for known switches to work, like the Master aka Battery Switch.

ref: Thranda Quest Kodiak 100 aircraft. works good in Xplane.

My problem, is that Thranda did not write a couple needed commands: AvnBus, & AuxBus. He did write some datarefs for those two switches. just no commands. and there are NOT any overlapping commands in Xplane either. I've scrolled thru the list in the DataRef Tool Editor.

so, i'm sure he's got some built in method for activating those switches, but I can figure it out.

If anyone has an operable solution would you please educate me, or share?
and better yet, if anyone has already made a panel for the Thranda Quest Kodiak aircraft, would you mind sharing your panel?

thank you in advance,
Dave

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Thranda Kodiak Master Switch Panel - Help!!

#2 Post by Ralph »

Why not write the datarefs in that case?

dameng
Posts: 13
Joined: Tue Apr 12, 2022 2:03 am

Re: Thranda Kodiak Master Switch Panel - Help!!

#3 Post by dameng »

is there a good example I can copy?

thanks
Dave

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Thranda Kodiak Master Switch Panel - Help!!

#4 Post by Ralph »

Writing of datarefs doesn't happen that often. The wiki has an example: https://siminnovations.com/wiki/index.p ... aref_write
I believe that the Cessna 172 clock and EGT also write a datarefs, but I'm not absolutely sure.

dameng
Posts: 13
Joined: Tue Apr 12, 2022 2:03 am

Re: Thranda Kodiak Master Switch Panel - Help!!

#5 Post by dameng »

Thanks for pointing me in the right direction. i'll give it a try,

Cheers!
Dave

dameng
Posts: 13
Joined: Tue Apr 12, 2022 2:03 am

Re: Thranda Kodiak Master Switch Panel - Help!!

#6 Post by dameng »

Ralph,
again, thanks for the direction. I found a decent example and modified for my use, tested, and it works!

here is the code i used for writing to the dataref:
  • -- Aux Bus
    --thranda/electrical/AuxiliaryBus

    function set_auxbus(position)
    position = math.abs( position - 1)
    xpl_dataref_write("thranda/electrical/AuxiliaryBus","INT", position)
    end

    auxbus_sw = switch_add( "SwitchWh_off.png" , "SwitchWh_on.png", 165,64,58,125, set_auxbus)

    function auxbus_change(axb)
    switch_set_position(auxbus_sw, axb)
    end

    xpl_dataref_subscribe("thranda/electrical/AuxiliaryBus","INT", auxbus_change)
hopefully this helps anyone else.
Cheers
Dave

wrschultz
Posts: 40
Joined: Wed Jan 01, 2020 6:06 pm
Location: KLNS Pennsylvania

Re: Thranda Kodiak Master Switch Panel - Help!!

#7 Post by wrschultz »

Dave, were you able to make headway on the Kodiak master switch panel Lua scripting. I am looking at the Kodiak now and have the Simstrumentation panel that includes the Lua code for MS2020 simulator but not the Xplane. I have a rudimentary understanding of the Lua script. I am able to pick out the dataref or commands to use but struggle to integrate into the script. Any nudge to get me going on one of the switches is welcome. Bill

Post Reply