Jump to content
The simFlight Network Forums

aerostar17

Members
  • Posts

    16
  • Joined

  • Last visited

Posts posted by aerostar17

  1. How can I get this Function to work....


    function M500_HDG_set ()
            ipc.execPreset(P:AS1000_PFD_HEADING_SYNC, 0x7C50)
    end
     

     

    Well, all I'm trying to do is have the 'Heading Sync'  as a short button press in a file based on  'TripleUseButton.lua'   and relevant Presets assigned to  Long Press and Double press.....

     

    Thanks...

  2.  

    Whoopee...   thanks Pete,  using    ipc.get    and   .set   works a treat,  it's now all working...   can't figure how the   AB_AP_ALTSTEP    worked though as it is using    readLvar   and   writeLvar  ...

    20 hours ago, Pete Dowson said:

    Assuming they are the former type, or the board does handle them okay, then obviously you can use the same method as in Triple Use to decide on the interpretation of the button on/off changes based on how fast they arrive -- slow = signle, fast = 10's.

    Now I may try and figure out again how to use   TripleUse.lua   for the  Rotary Acceleration    and then I wouldn't need the button toggle which would free up another button option...   I'm pretty sure it's the standard rotaries I'm using.  Any pointers would be welcome

      do you use    Rotary Acceleration   and if so, what method do you use... ?

    I hope I'm not over stepping with my questions...   

    once again though , 

    Thank you Pete for your help...

    Ian

  3. Hi ,  Pete ...   I have replaced the   AB_HDGSTEP_set    with the     AB_AP_ALTSTEP    which is a working   LVar  as a test and now it toggles  and works good...   now the only thing is when I toggle the  HDG step  it also toggles the ALT step   as they are now sharing the same LVar...     I think  that means that I need to properly define the      AB_HDGSTEP_set       LVar as it's probably not being recognised,   I created it.   I thought by naming it and giving it a value outside the Function that would define it.     

    Can I ask how I should define the LVar        AB_HDGSTEP_set       so that it is recognised and usable   ?

    Thanks again, 

    Ian

  4. Apologies Pete for messing the Log was trying different things then editing my post... 

    I have stripped out the unnecessary parts and this is the part that's not toggling/switching...  I have posted the corresponding Log

    where it can be seen that on    button flag 4    it always stays at    ' AB_HDG_Step_10'

    I have also included the full  Lua file attached...   not very big.

     

    e3bbb65b29f00767f3896fa2a0df13f3.png

     

    9206489cbe7cce08adbe5dbaa4a13c87.png

     

    Here is the Lua file -              AB_Triple_HDG.lua

     

    Ian

  5. Thanks for replying, Pete.    I am using TripleUse.lua on this rotary which has a push button which I use for  Heading...

    1) Press longer = Managed Mode 

    2) Double Press = Set Mode

    and want  3) Single Press = Toggle Step 1 or 10 Degrees

    I can't think of a way to integrate with the FSUIPC controls as far as toggling with one button press... would I still need a Lua script?

    If not tied to TripleUse.lua then the button toggles would act additionally with button presses..    It's really the  Toggle part that's not working...  switching between the two steps. The HDG degrees do inc/dec if set independently in the script.

     

     

    PS-   Can the  (example)    Rotaries.lua     be adapted to work with a home made 'LeoBodnar 32 interface'  button box to enable Rotary acceleration as this would be the best option, maybe or if there is another rotary acceleration method then I wouldn't need the Press Toggle ... 

    Thanks,

    Ian

  6. After failing to be able to use acceleration on my Heading rotary , I have tried to make it toggle between 1 deg steps and 10 deg steps by pressing the button on the rotary.

    It's for the Aerosoft Airbus and there is a script for toggling the ALT but not the HDG.  Therefore I copied the ALT script and adjusted to toggle the HDG  but  can't get it to toggle.

    Here is the relevant section...  much obliged if someone can help...

    AB_HDGSTEP_set = 1

    function AB_HDG_Step_tog ()
             var = ipc.readLvar("AB_HDGSTEP_set")
        if var == 1 then
            AB_HDG_Step_1 ()
        else
            AB_HDG_Step_10 ()
        end
    end

    function AB_HDG_Step_1 ()
             LVarSet = ("AB_HDGSTEP_set")
             ipc.writeLvar(LVarSet, 0)
        Anim = ("AB_AP_HDG_Knob_Ani")
        ipc.writeLvar(Anim, 1)
        ipc.sleep(30)
        ipc.writeLvar(Anim, 0)
    end

    function AB_HDG_Step_10 ()
             LVarSet = ("AB_HDGSTEP_set")
             ipc.writeLvar(LVarSet, 1)
        Anim = ("AB_AP_HDG_Knob_Ani")
        ipc.writeLvar(Anim, -1)
        ipc.sleep(30)
        ipc.writeLvar(Anim, 0)
    end

    eb01db8b96357d10cd27f7116b416bf6.png

    ....and the log

    598dc7e21a4b75e47e56dce62fd04383.png

     

    The button animation doesn't toggle either (as an indication) but does work both ways in/out if set manually in the script.

      The full Lua  section ---         AB_Triple_HDG.lua

    Everything else works great...   press Twice for heading set mode  and press longer for heading managed mode

     

     

     

  7. Can the -  TripleUse.lua  -  script written by Pete Dowson be adapted to count (e.g.)  10 button presses within a given interval to give an option .

    In the script you can set interval time ...  and the script    'counts ?'   the button presses ,  can this be used with a rotary to count the clicks(presses),  when if 10 clicks within the given interval time it can then call a different function ?  

    This is another idea I've got to enable Rotary auto speed step that I posted about previously.

    Thanks for your thoughts and advice on this...

     

  8. Hi John, thanks very much for replying,  I have been trying to implement your code into the existing since you posted

    but after trying different ways I still haven't got it to run...  I'm a bit confused if this should run seperately and if your delta difference is 

    named delta or I rename it to AddVar,  and also with a few other things. I did manage to find and install the Socket.lua addon. 

     

    function AB_HDG_plus ()    
            AB_hdgtrk = ipc.readLvar("AB_AP_HDGTRK")
            AB_drift = ipc.readLvar("AB_AP_HDGTRK")
            if AB_hdgtrk == 0 then
            LVarSet = "AB_AP_HDG_Select"
        else
            LVarSet = "AB_AP_TRK_set"
            end
            LVarGet = ipc.readLvar(LVarSet)
            require ("socket")
            lastTime = 0;
               --ipc.log("Current degree is " .. currentdeg .. ", lastdegree is " .. lastdeg)
            --diffdeg = currentdeg - lastdeg        
            currentTime = socket.gettime()*1000
            ipc.log("Current time is " .. currentTime .. ", lasTime is " .. lastTime)
            difference = currentTime - lastTime
            if (difference > 200 and difference < 1000) then        
              AddVar = LVarGet + 10
        else
              AddVar = LVarGet + 1
              end
            if AddVar > 359 then
               AddVar = 0
               end
              ipc.log("Delta is " .. AddVar.. " (difference=" .. difference .. ")")
              lastTime = currentTime 
              end
            --DspHDG(AddVar)
            ipc.writeLvar(LVarSet, AddVar)

    event.flag(1, "AB_HDG_plus")

    Latest log of this ...

    ********* LUA: "AB_HDG_speed" Log [from FSUIPC version 5.151] *********
      9323640 System time = 12/06/2019 10:42:09, Simulator time = 11:43:13 (10:43Z)
      9323640 LUA: beginning "F:\P3Dv4\Modules\AB_HDG_speed.lua"
      9323640 LUA: F:\P3Dv4\Modules\AB_HDG_speed.lua:28
      9323640 LUA: Global: ipcPARAM = 0
      9323640 LUA: F:\P3Dv4\Modules\AB_HDG_speed.lua:1
      9323640 LUA: F:\P3Dv4\Modules\AB_HDG_speed.lua:30
      9323640 LUA: F:\P3Dv4\Modules\AB_HDG_speed.lua:32
      9323656 LUA: Waiting for an event in "F:\P3Dv4\Modules\AB_HDG_speed.lua"
     11448781 >>> Thread forced exit (ipc.exit or os.exit) <<<
     11448781 System time = 12/06/2019 11:17:34, Simulator time = 12:18:26 (11:18Z)
    ********* LUA execution terminated: Log Closed *********

    ********* LUA: "AB_HDG_speed" Log [from FSUIPC version 5.151] *********
     11475422 System time = 12/06/2019 11:18:00, Simulator time = 12:18:43 (11:18Z)
     11475422 LUA: beginning "F:\P3Dv4\Modules\AB_HDG_speed.lua"
     11475422 LUA: F:\P3Dv4\Modules\AB_HDG_speed.lua:27
     11475422 LUA: Global: ipcPARAM = 0
     11475422 LUA: F:\P3Dv4\Modules\AB_HDG_speed.lua:1
     11475422 LUA: F:\P3Dv4\Modules\AB_HDG_speed.lua:29
     11475422 LUA: F:\P3Dv4\Modules\AB_HDG_speed.lua:31
     11475422 LUA: Waiting for an event in "F:\P3Dv4\Modules\AB_HDG_speed.lua"

     

    ... a snap with the line numbers...

    bdd3118d70728fab1a3ae2a209487f8e.png

     

    Thanks again....

  9.  

    Trying to make the HDG rotary increase step from -    1 deg per click to 10 deg per click -    automatically when turning the rotary after a set  number of  deg's have occured in a given time.

    Here is a sample of the LUA   actions.lua    script from LINDA website for the Aerosoft Airbus A320 that I've been trying to alter with no success (I am not a programmer).

    Can anyone help please......

    This the original for HDG plus  ,  there is also one for HDG plusfast but you need to manually trigger which one to select

    _________________________________________________________

    function AB_HDG_plus ()
        AB_hdgtrk = ipc.readLvar("AB_AP_HDGTRK")
        AB_drift = round(ipc.readLvar("AB_AP_HDGTRK"))
        if AB_hdgtrk == 0 then
            LVarSet = "AB_AP_HDG_Select"
        else
            LVarSet = "AB_AP_TRK_set"
        end
        LVarGet = round(ipc.readLvar(LVarSet))
        AddVar = LVarGet + 1
        if AddVar > 359 then
            AddVar = 0
        end
        DspHDG(AddVar)
        ipc.writeLvar(LVarSet, AddVar)
    end

     

    Here is one of my inept attempts at altering it.....

    _______________________________________

    function AB_HDG_plus ()
        AB_hdgtrk = ipc.readLvar("AB_AP_HDGTRK")
        AB_drift = ipc.readLvar("AB_AP_HDGTRK")
        if AB_hdgtrk == 0 then
            LVarSet = "AB_AP_HDG_Select"
        else
            LVarSet = "AB_AP_TRK_set"
        end
        LVarGet = ipc.readLvar(LVarSet)
        if (LvarGet - val1) > 20 then
        AddVar = LVarGet + 10
        else
        AddVar = LVarGet + 1
        if AddVar > 359 then
            AddVar = 0
        end
        --DspHDG(AddVar)
        ipc.writeLvar(LVarSet, AddVar)
        end
        val1 = LVarGet
        sleep(200)
    end

    event.flag(1, "AB_HDG_plus")

    _________________________________

    My general idea is when the rotary turns,  a reading is taken of the HDG degrees at that time

    then   ie   200ms  later a reading is taken again and if the difference is over   ie  15 deg  it sets the rotary to step 10deg per click instead of 1deg step per click. As soon as the sample is less than 15deg diff then it steps back to 1deg per click.

    This should be easy for someone with a bit of LUA knowledge to do (I think)

    Thanks for any help

  10. Yes it is a bit bewildering for me tooo...  the reason for the set of flags at lines 17-25 is that on the box there are   '3'   buttons that must have only one of them active at a time - COM, NAV, FMS .

    so if I press the COM then the others must be clear etc  because these are 'sharing' the Dual Concentric Rotary. They are non latching momentary push buttons, so I've done the latching in the code and that's why the rotary pin inputs 8,9,10,11 are filtered by flags. When I press NAV it is active and if I press COM it is active etc immediately without double pushes etc. Also the middle PushButton on the Dual Concentric Rotary was intended to switch from NAVCOM1's to NAVCOM2's  Flag 3,23.  

     

    The extra flags further down for the G1000 buttons are required because I increased the number of buttons available on the BBI32 interface from 32 to 51 by doubling up on some buttons and assigning 2 inputs to 1 button press as an additional, seperate function...  but in so doing have to make some exclusion or inclusion flags.

    I'm going to try your method/controls for the frequencies again today...  wondering if my flags are getting in the way...  although the FMS navigation with the Rotary and flags works ok.  The 4 lines starting 105 with the 'Throttle4_set' move the blue rectangle for the COM/NAV windows focus and works well. The 8 lines further up starting line 11 are for the altitude rotary.

    I have no experience of coding really and this is the best I can come up with at the moment....  willing to learn how it should be done.

     

    cheers Donovan

    aero

     

  11. Hi Pete and Don, thanks for your replies and help.  

    Pete the F1 Mustang seems a bit more complicated than the default G1000 and I had to to create MACROS which worked for other items (wonderful utility Pete) though with this radios problem it didn't help me. I have posted a section of my primitive attempt to configure the buttons with the radios - J4B18 is NAV flag  J4B13  is COM flag and J4B15 is FMS flag.  I don't know if this is the way it should be done. I thought putting the J3B23 flag on the push of my Dual Rotary would set the rotary to inc/dec the com1/2 nav1/2 respectively but doesn't work with NAV/COM2's. 

    To Don thanks a lot for the information you posted , I didn't know about the INPUT.ini file in the Gauges folder either..... I was trying to do everything in FSUIPC as I don't know LUA, LINDA etc although I downloaded the SPADnext demo (a few days left) to see if that could help. With the INPUT.INI  I did try to assign some buttons but no joy, although with the different flags and events involved with the J2B23 and it's flag I'm not sure if there will be conflicts or how I'm going to write it in.

    I used the PFD_Com_Cursor=Joystick:2:Button:24   but also with trying some others no result.

    I thank both of you again and I will try some more tomorrow......

    ....feedback on the way I've written the code would be appreciated if you desire.

    Thanks

    aero

    e482a87a76170de6ace3ef0bd974a7a4.png

     

  12. Hi ,  been racking my little brain to find a way to switch between  - COM1 standby -  and  - COM2 standby -    ...   -  NAV1 standby -   and   - NAV2 Standby -    in a G1000 PFD (Flight1 Cessna Citation Mustang).

    I have made a little button/rotary box and have it all configured great except for this. 

    I am using FSUIPC to write the functions but cannot find a FSUIPC or SIMCONNECT Control number that does this function.....  does one exist ?

     

    Be great if someone could chip in with some advice on this...  

     

     please let me explain myself a bit more.  

    I am trying to get a switch to move focus from the COM1 Standby window to the COM2 Standby window and the NAV windows too...

    to enable me to input the COM2 and NAV2 frequencies THEN I can swap them from Standby to Active.

     

    Thanks for your help

    aero

     

    PS I can already swap between Standby and Active on the frequencies , those are not the ones I need

     

    20170331_144736.jpgim

    ag20170317_111455.jpgimag

    20170323_171941.jpgimage uploading site

     

    e image free hostingfree hostinge hosting

  13. I can't seem to be able to save Flight Plans for the  -  QW  Bae146...

     

    This is on a single FSX-SE install...

     

    I have looked at the config files for FSC but can't figure out how to allow the QualityWings flightplan to be sent to the Bae 146...

     

    Is there something I can alter , change to allow this ?

     

    Thanks for your help...

     

    Ian

     

    ----------------------------------------------------------------------------

    EDIT---             My Fault...  ALL OK  now !!!!!   Thanks.

    -----------------------------------------------------------------------------

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.