- Messages
- 1 879
- Réactions
- 269
- Points
- 304
Bon, un peu brut de force. Il y a probablement plus court.
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.
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.