MSFS Bell 407 Collective GRIP revival

Working on a instrument project or just finished a project? Show it to others!

Moderators: russ, Ralph

Post Reply
Message
Author
SimPassion
Posts: 5336
Joined: Thu Jul 27, 2017 12:22 am

MSFS Bell 407 Collective GRIP revival

#1 Post by SimPassion »

Hi

just had a try following @coxo2436 great find : https://forums.flightsimulator.com/t/be ... 554987/728
... and yes, it works nicely !!!

Quick and dirty, the best will be on your side ! Enjoy flying the Bell 407 in MSFS :)

image.png

Code: Select all

--====================================================================================
--								CHECK PURPOSE
--====================================================================================

-- GENERIC	Universal Dial enjxp_SimPassion

-- enjxp_SimPassion 12/21/2022	MSFS Bell 407 CollectiveGrip handling following @coxo2436 finding : https://forums.flightsimulator.com/t/bell-407/554987/728
-- enjxp_SimPassion 01/28/2020	Bitmaps naming Standardization
-- enjxp_SimPassion 08/15/2019

-- HARDWARE PROPERTIES

up_detperpulse_str = user_prop_add_enum("DETENT PER PULSE TYPE", "TYPE_1_DETENT_PER_PULSE,TYPE_2_DETENT_PER_PULSE,TYPE_4_DETENT_PER_PULSE", "TYPE_1_DETENT_PER_PULSE", "You can choose one of these three choices")
detperpulse_str = user_prop_get(up_detperpulse_str)

up_accel_num = user_prop_add_integer("Acceleration", 1, 10, 1, "(Optional) The multiplier is the maximum number of callbacks of one dial tick when this dial is being rotated at maximum speed.")
accel_num = user_prop_get(up_accel_num)

up_debounce_ms = user_prop_add_integer("Debounce time", 1, 200, 4, "(Optional) Select different debounce time in milliseconds. Default is 4 ms.")
debounce_ms = user_prop_get(up_debounce_ms)

-- USER SIM PROPERTIES

img_add_fullscreen("black_bg.png")

txt_style0 = "font:roboto_bold.ttf; size:20px; color: #00FF00; halign: center;"
txt_dref_read	= txt_add("", txt_style0, 0, 0, 100, 26)

img_add("dial.png", 0, 0, 100, 100)
local img_dial = "dial_mark.png"

local cur_value = 0

function dial_callback(dir)

	val_write = cur_value + dir
	val_write = var_cap(val_write,-10,100)
	fs2020_variable_write("L:CollectiveGrip","Percent",val_write)
end

dial_id = dial_add(img_dial, 0, 0, 100, 100, 1, dial_callback)

function val_read(value)
	cur_value = value
	print(cur_value)
end

fs2020_variable_subscribe("L:CollectiveGrip","Percent",val_read)

hw_dial_dref = hw_dial_add("DIAL",detperpulse_str,accel_num,debounce_ms,dial_callback)

Post Reply