Bon alors ça devrait fonctionner comme indiqué.
Tiens moi au courant!
Jacques
JacquesZ a écrit:Bon alors ça devrait fonctionner comme indiqué.
Tiens moi au courant!
Jacques
jacquesvde a écrit:Bonjour Jacques,
Je vais piquer tes codes du Bendix K285 Annunciator,
pour faire ceci, (l'image est brouillon elle va être refaite)
j’aurais aussi besoin de quelques variable, si Christian veut bien me dire les quel employer pour les afficheur, c'est juste en lecture, quoi que la plupart indique déjà les fontion dans le Bendix K285 Annunciator, HDG, ALT, AP, Bon en faite il n'y a que IAS et B/C que j'aurai besoin comme L:vars quoi que je ne sais pas c'est quoi comme information ?
Jacques
dx = {70,120,210,300,390,60,130,220,300,390,60,120,160,230,300,365}
dy = {30,30,30,30,30,70,70,70,70,70,110,110,110,110,110,110}
dw = {80,80,80,80,80,80,80,80,80,80,100,40,70,70,70,100}
dh = {30,30,30,30,30,30,30,30,30,30,60,40,50,50,50,50}
for i = 1, 16 do
visible(img_mask[3], armgs == 1 or armhnav == 1 or armbc == 1)
img_add_fullscreen("background_2.png")
click_sound = sound_add("click.wav")
--****************************************************************
--***********************************************************
--AP Switch
function power(avionics,battery,generator)
if avionics <= 10 --and (battery <= 10 or generator ==false )
then
fsx_event("AUTOPILOT_OFF")
visible(ap_light_on,false)
visible(hdg_light_on,false)
visible(nav_light_on,false)
visible(apr_light_on,false)
visible(bc_light_on,false)
visible(alt_light_on,false)
end
end
function SwitchAPPressedCallback(position)
sound_play(click_sound)
new_position = math.abs(position-1)
switch_set_state(AP_switch_id,new_position)
--xpl_dataref_write("","INT",new_position)
if new_position == 1 then
fsx_event("AUTOPILOT_ON", new_position)
else
fsx_event("AUTOPILOT_OFF", new_position)
end
end
AP_switch_id = switch_add("btn_off.png","btn_on2.png",190,329,116,73,SwitchAPPressedCallback)
function new_AP_switch_pos(sw_on)
switch_set_state(AP_switch_id,sw_on)
visible(ap_light_on,sw_on)
end
ap_light_on=img_add("on.png",190,329,116,73)
fsx_variable_subscribe("AUTOPILOT MASTER", "Bool", new_AP_switch_pos)
fsx_variable_subscribe("ELECTRICAL AVIONICS BUS VOLTAGE", "Volts",
"ELECTRICAL BATTERY BUS VOLTAGE", "Volts",
"GENERAL ENG GENERATOR SWITCH:1", "BOOL",power)
--***********************************************************
--HDG Switch
function SwitchHDGPressedCallback(position)
sound_play(click_sound)
new_position= math.abs(position-1)
switch_set_state(HDG_switch_id,new_position)
--xpl_dataref_write("","INT",new_position)
if new_position == 1 then
fsx_event("AP_HDG_HOLD_ON", new_position)
else
fsx_event("AP_HDG_HOLD_OFF", new_position)
end
end
HDG_switch_id = switch_add("btn_off.png","btn_on2.png",92,121,100,75,SwitchHDGPressedCallback)
function new_HDG_switch_pos(sw_on)
switch_set_state(HDG_switch_id,sw_on)
visible(hdg_light_on,sw_on)
end
hdg_light_on=img_add("on.png",92,121,116,73)
fsx_variable_subscribe("AUTOPILOT HEADING LOCK", "Bool", new_HDG_switch_pos)
--xpl_dataref_subscribe("",new_HDG_switch_pos)
--***********************************************************
--NAV Switch
function SwitchNAVPressedCallback(position)
sound_play(click_sound)
new_position= math.abs(position-1)
switch_set_state(NAV_switch_id,new_position)
--xpl_dataref_write("","INT",new_position)
if new_position == 1 then
fsx_event("AP_NAV1_HOLD_ON", new_position)
else
fsx_event("AP_NAV1_HOLD_OFF", new_position)
end
end
NAV_switch_id = switch_add("btn_off.png","btn_on2.png",302,213,100,75,SwitchNAVPressedCallback)
function new_NAV_switch_pos(sw_on)
sound_play(click_sound)
switch_set_state(NAV_switch_id,sw_on)
visible(nav_light_on,sw_on)
end
nav_light_on=img_add("on.png",302,213,116,73)
fsx_variable_subscribe("AUTOPILOT NAV1 LOCK", "Bool", new_NAV_switch_pos)
--xpl_dataref_subscribe("",new_NAV_switch_pos)
--***********************************************************
--APR Switch
function SwitchAPRPressedCallback(position)
sound_play(click_sound)
new_position= math.abs(position-1)
switch_set_state(APR_switch_id,new_position)
--xpl_dataref_write("","INT",new_position)
if new_position == 1 then
fsx_event("AP_APR_HOLD_ON", new_position)
else
fsx_event("AP_APR_HOLD_OFF", new_position)
end
end
APR_switch_id = switch_add("btn_off.png","btn_on2.png",196,213,100,75,SwitchAPRPressedCallback)
function new_APR_switch_pos(sw_on)
--print (sw_on)
switch_set_state(APR_switch_id,sw_on)
visible(apr_light_on,sw_on)
--end
end
apr_light_on=img_add("on.png",196,213,116,73)
fsx_variable_subscribe("AUTOPILOT APPROACH HOLD", "Bool", new_APR_switch_pos)
--xpl_dataref_subscribe("",new_APR_switch_pos)
--***********************************************************
--BC Switch
function SwitchREVPressedCallback(position)
sound_play(click_sound)
new_position= math.abs(position-1)
switch_set_state(REV_switch_id,new_position)
--xpl_dataref_write("","INT",new_position)
if new_position == 1 then
fsx_event("AP_BC_HOLD_ON", new_position)
else
fsx_event("AP_BC_HOLD_OFF", new_position)
end
end
REV_switch_id = switch_add("btn_off.png","btn_on2.png",92,213,100,75,SwitchREVPressedCallback)
function new_REV_switch_pos(sw_on)
switch_set_state(REV_switch_id,sw_on)
visible(bc_light_on,sw_on)
end
bc_light_on=img_add("on.png",92,213,116,73)
fsx_variable_subscribe("AUTOPILOT BACKCOURSE HOLD", "Bool", new_REV_switch_pos)
--xpl_dataref_subscribe("",new_REV_switch_pos)
--***********************************************************
--ALT Switch
function SwitchALTPressedCallback(position)
sound_play(click_sound)
new_position= math.abs(position-1)
switch_set_state(ALT_switch_id,new_position)
--xpl_dataref_write("","INT",new_position)
if new_position == 1 then
fsx_event("AP_ALT_HOLD_ON", new_position)
else
fsx_event("AP_ALT_HOLD_OFF", new_position)
end
end
ALT_switch_id = switch_add("btn_off.png","btn_on2.png",302,121,100,75,SwitchALTPressedCallback)
function new_ALT_switch_pos(sw_on)
switch_set_state(ALT_switch_id,sw_on)
visible(alt_light_on,sw_on)
end
alt_light_on=img_add("on.png",302,121,116,73)
fsx_variable_subscribe("AUTOPILOT ALTITUDE LOCK", "Bool", new_ALT_switch_pos)
--xpl_dataref_subscribe("",new_ALT_switch_pos)
jacquesvde a écrit:Merci les gars,
C'est juste pour la lecture du pilote automatique puisque je n’utilise pas les commande touche presse virtuel. les commande du pilote automatique sont faite via un pilote automatique externe avec bouton physique et encodeur. donc pour le réalisme c'est juste pour afficher quand les options du pilote automatique sont actif.
pour resumer c'est juste des voyant qui s'alume quand j'active mon pilote automatique en principe c'est des image qui une est transparent et un deuxième qui est en surbrillance fonctionnant en On Off.
Très bonne idée Alain
Jacques
si Christian veut bien me dire les quel employer pour les afficheur,
Retourner vers LUA, Linda, Macros & gauges Air Manager
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 10 invités