DataRefs.txt uipcxdatos.txt XPUIPCOffsets.txt

Bon, un peu brut de force. Il y a probablement plus court.

Code:
function hasbit(x, p)
  return x % (p + p) >= p
end

function mcpv3_leds()

    if hasbit(autopilot_status,256) then
        mcpv3DR_led_app = 1
    else
        mcpv3DR_led_app = 0
    end

    if hasbit(autopilot_status,32) then
        mcpv3DR_led_althld = 1
    else
        mcpv3DR_led_althld = 0
    end

    if hasbit(autopilot_status,16) then
        mcpv3DR_led_vs     = 1
    else
        mcpv3DR_led_vs     = 0
    end

    if hasbit(autopilot_status,131072) then
        mcpv3DR_led_cmda   = 1
    else
        mcpv3DR_led_cmda   = 0
    end

    if hasbit(autopilot_status,262144) then
        mcpv3DR_led_cmdb   = 1
    else
        mcpv3DR_led_cmdb   = 0
    end

    if hasbit(autopilot_status,1) then
        mcpv3DR_led_at     = 1
    else
        mcpv3DR_led_at     = 0
    end

    if hasbit(autopilot_status,2) then
        mcpv3DR_led_vnav   = 1
    else
        mcpv3DR_led_vnav   = 0
    end

    if hasbit(autopilot_status,4) then
        mcpv3DR_led_lvlchg = 1
    else
        mcpv3DR_led_lvlchg = 0
    end

    if hasbit(autopilot_status,2) then
        mcpv3DR_led_hdgsel = 1
    else
        mcpv3DR_led_hdgsel = 0
    end

    if hasbit(autopilot_status,64) then
        mcpv3DR_led_lnav   = 1
    else
        mcpv3DR_led_lnav   = 0
    end
    
    if hasbit(autopilot_status,0) then
        mcpv3DR_led_vorloc = 1
    else
        mcpv3DR_led_vorloc = 0
    end

end

Pas encore au point, le MCP du RJ étant sensiblement différent d'un 737, je patouille. En tous les cas, ça avance même si cela promet d'être long.
 
@Playrec : OK, c'est vrai que c'est beaucoup mieux comme cela, je ne le ferai plus ... :(

@Avro : C'est quoi ce code ?

Tu peux faire la même chose avec la fonction SIOC TESTBIT
 
Le MCP progresse. Il me manque les boutons A/T, F/D 1 et 2, SPEED, DISENGAGE et les leds CMD. Bref, ce sujet est quasi résolu. Merci à vous 3 pour l'aide.
 
Retour
Haut