October 13, 20196 yr I had a home made MCP with Rotary encoder as 2 button for flight, But with most LINDA module I've used (QW787\AS320), to set a HDG say some 100 away is painful. In real aircraft, the MCP knobs will auto accelerate, allow much quicker setting when you rotate the knob fast, While PMDG did that inside their portion(I conncted PMDG with FSUIPC control so no LINDA invoved), they are tuned as real aircraft use a 36click pre loop encoder, while mine only had 20clicks per loop, so it's still need some fine tune. Meanwhile, the FS/P3D's own "acceleration" could stuck you in interval 10 forever, or just jump to 10 way too fast even when using with mousewheel. I really didn't know much about lua, is there someone could came up a genius code that could detect the speed of rotation and make the interval change accordingly, with parameters to fine tune with? Thanks!
October 13, 20196 yr Unfortunately, LINDA is not designed to work with rotary encoders as it needs discrete button-like actions (press/release) that can be detected by FSUIPC and passed to LINDA. The VRi MCP panels actually output a slow (+ or -) or fast (++ or --) signal that allows the _inc/_dec or _incfast/decfast functions to be actioned directly. If you are detecting clicks/presses when the knob is rotated there may be a way of determining a single or multiple click to increase the rate of rotation. You would need to determine within the queue handler (in events.lua) whether you have a single click within a cycle or whether there are more than one click in the cycle and call the _inc or _incfast functions. I hope this helps. Andrew Gransden Scotland, UK LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew
July 23, 20205 yr Sorry this is late but here is what I programmed in the PMDG module for rotary speed. This is my heading rotary: This is also assuming your rotary encoder is set up as a button press for increase and a button press for decrease. Added Variables: ////////////////////////////////////////////// local hdg_inc = 0 local hdg_dec = 0 functions: ////////////////////////////////////// function HDG_INC() HDG_INC_TIME = ipc.elapsedtime() if mcp_hdg_mode == 1 then if (HDG_INC_TIME - hdg_inc) < 175 then local i for i = 1, 4 do ipc.control(PMDGBaseVar+390, PMDG_inc) end else ipc.control(PMDGBaseVar+390, PMDG_inc) end else NGX_AP_BANK_inc() end NGX_AP_HDG_show() hdg_inc = HDG_INC_TIME end function HDG_DEC() HDG_DEC_TIME = ipc.elapsedtime() if mcp_hdg_mode == 1 then if (HDG_DEC_TIME - hdg_dec) < 175 then local i for i = 1, 4 do ipc.control(PMDGBaseVar+390, PMDG_dec) end else ipc.control(PMDGBaseVar+390, PMDG_dec) end else NGX_AP_BANK_dec() end NGX_AP_HDG_show() hdg_dec = HDG_DEC_TIME end Hope this sends you in right direction, Chris Edited July 23, 20205 yr by Swamech
July 26, 20205 yr Author On 7/23/2020 at 12:42 PM, Swamech said: Sorry this is late but here is what I programmed in the PMDG module for rotary speed. This is my heading rotary: This is also assuming your rotary encoder is set up as a button press for increase and a button press for decrease. /////////////////////// Hope this sends you in right direction, Chris So basicly the magic is " ipc.elapsedtime() ", am I right? Thanks for the help
July 27, 20205 yr On 7/25/2020 at 8:50 PM, C2615 said: So basicly the magic is " ipc.elapsedtime() ", am I right? Thanks for the help Yes, you rotary speed has to compare the turning speed to something. You can adjust that of course by adjusting the 175 in the line if (HDG_INC_TIME - hdg_inc) < 175 then And no problem!
Archived
This topic is now archived and is closed to further replies.