Altimeter setting 1 and 2 hardware rotary encoder U/S

Discuss suspected bugs with other users and Sim Innovations Staff

Moderators: russ, Ralph

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

Re: Altimeter setting 1 and 2 hardware rotary encoder U/S

#11 Post by SimPassion »

Ok, thanks, just checked at the moment it works in X-Plane 11 with the C172 you mentioned not working !?! The Kollsman window value change and the altimeter needles adjust accordingly
[EDIT] Also checked working correctly with the JustFlight C152. I don't have any other aircraft addon installed from the mentioned not working list

As we see below, from the hardware "Generic Altimeter dial" script, the barometer up and down is used to increase and decrease the value in the Kollsman window, it could occurs some aircraft designer don't used the proper available standard dataref from X-Plane which are "sim/cockpit/misc/barometer_setting" or "sim/cockpit2/gauges/actuators/barometer_setting_in_hg_pilot" and "sim/cockpit2/gauges/actuators/barometer_setting_in_hg_copilot"

Code: Select all

side_user_prop = user_prop_add_enum("Position", "Pilot,Co-Pilot", "Pilot", "Choose the altimeter position for X-Plane.")
encoder_type_prop = user_prop_add_enum("Encoder type", "TYPE_1_DETENT_PER_PULSE,TYPE_2_DETENT_PER_PULSE,TYPE_4_DETENT_PER_PULSE", "TYPE_2_DETENT_PER_PULSE", "What type of encoder do you have, type 2 is most common.")

function altimeter_dial_callback(direction)

    if direction == 1 then
        if user_prop_get(side_user_prop) == "Pilot" then
            xpl_command("sim/instruments/barometer_down")
        else
            xpl_command("sim/instruments/barometer_copilot_down")
        end
        fsx_event("KOHLSMAN_DEC")
        fs2020_event("KOHLSMAN_DEC")
    else
        if user_prop_get(side_user_prop) == "Pilot" then
            xpl_command("sim/instruments/barometer_up")
        else
            xpl_command("sim/instruments/barometer_copilot_up")
        end
        fsx_event("KOHLSMAN_INC")
        fs2020_event("KOHLSMAN_INC")
    end

end

hw_dial_add("Altimeter dial", user_prop_get(encoder_type_prop), 3, altimeter_dial_callback)

hw_button_add("Reset pressure", function()
    xpl_command("sim/instruments/barometer_2992")
    fsx_event("BAROMETRIC")
    fs2020_event("BAROMETRIC")
end)

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

Re: Altimeter setting 1 and 2 hardware rotary encoder U/S

#12 Post by Ralph »

The script looks fine, so it'll have to be in X-Plane.

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Altimeter setting 1 and 2 hardware rotary encoder U/S

#13 Post by Sling »

Not all of those aircraft you listed are default as you stated. As a result it’s possible that as Gilles said not all the addon aircraft devs use the default events/vars. This can be dealt with in the AM script if all the alternatives are known.

AlyMac
Posts: 32
Joined: Mon Apr 05, 2021 3:12 pm

Re: Altimeter setting 1 and 2 hardware rotary encoder U/S

#14 Post by AlyMac »

Mnay thanks gentlemen - Ill have to try again.
Q for Simpassion - where is the script you posted located? and if you can tell me where the file is - can I open this with notepad ?

SimPassion
Posts: 5336
Joined: Thu Jul 27, 2017 12:22 am

Re: Altimeter setting 1 and 2 hardware rotary encoder U/S

#15 Post by SimPassion »

AlyMac wrote: Fri Nov 25, 2022 9:18 pm Mnay thanks gentlemen - Ill have to try again.
Q for Simpassion - where is the script you posted located? and if you can tell me where the file is - can I open this with notepad ?
From there and if we click on Script button with ".lua" extension already bind to favorite script/text editor, it will open it

image.png

AlyMac
Posts: 32
Joined: Mon Apr 05, 2021 3:12 pm

Re: Altimeter setting 1 and 2 hardware rotary encoder U/S

#16 Post by AlyMac »

thanks again.

Post Reply