J'ai regardé la vidéo dont tu parlais, il y a bien une platine et un switch EFIS POWER sur le Pedestal.
Donc j’ai couplé l'allumage de l’EADI à l'avionics Master ET au battery Master pour l'instant, si tu arrives en SIOC a créer une LVar spécifique pour le switch EFIS power que je puisse exploiter (Air Manager ne gère pas les offsets FSUIPC), ce sera encore mieux.
Sur cette platine, il y a visiblement deux autres boutons:
un switch COMPOSITE/NORMAL (pas trop d'idée de sa fonction) et un autre qui je pense est la luminosité BRT(?) (ça je peux gérer éventuellement, via une Lvar). La aussi sans doc...
Peut être celle d’Aeroworx dans un premier temps?
Si tu me l’envoyer par MP, Bernard?
Sinon, voici les avancées du jour:
-1: Séquence de démarrage reprise pour être plus proche de la réalité, écran noir, puis affichage complet dans un délai d'environ 15 secondes. Je ne connais pas quels flags rouges sont affichés en plus, mais il y en a.
-2: Middle et Inner Markers
J'ai regardé le code pour l'affichage des markers, je n'y avais pas touché jusque là:
- pour l'IM, il manquait l'image du symbole IM, et le code d'affichage de l'IM n'était pas complet, donc forcément, ca ne risquait pas de fonctionner.
- pour le MM, erreur dans le code original, il affichait l'OM au lieu de MM. C'est corrigé.
3-Egalement dans les annonciateurs "faciles", j'ai rajouté les modes AP et Yaw damper.
Voici le nouveau code, qui remplace l'ancien, et l'image du symbole IM en blanc à ajouter dans le dossier resources comme d'hab.
- Code: Tout sélectionner
---------------------------------------------
-- Collins Rockwell EFIS 84 EADI --
-- Version 1.35 11/2017 JZ FSX translation in progress
---------------------------------------------
-- CUSTOMIZATION SECTION
---------------------------------------------
start_duration=15000 -- durée en millisecondes de la séquence de démarrage
start_duration1=200 -- durée en millisecondes de la séquence de démarrage
start_duration2=200 -- durée en millisecondes de la séquence de démarrage
start_duration3=200 -- durée en millisecondes de la séquence de démarrage
start_duration4=100 -- durée en millisecondes de la séquence de démarrage
---------------------------------------------
-- Load and display images --
---------------------------------------------
img_horizon1 = img_add("Horizon1.png", 0, 0, 1200, 1800)
img_horizon = img_add("Horizon.png", 0, 0, 600, 900)
img_pitchAtt = img_add("Pitch_Attitude.png", 0, 0, 600, 900)
--img_hViewport = img_add("viewport.png", -150, -150, 900, 900)
img_skypoint = img_add_fullscreen("Skypointer.png")
img_rollAtt = img_add_fullscreen("Roll_Attitude.png")
img_GSvertpath = img_add("GSvertpath.png", 0, 0, 600, 900)
img_glidepath = img_add("Glidepath.png", 0, -150, 600, 900)
img_om = img_add_fullscreen("OM.png")
img_mm = img_add_fullscreen("MM.png")
img_im = img_add_fullscreen("IM.png")
txt_dh = txt_add(" ", "-fx-font-family: arial; -fx-font-size:25px; -fx-fill: yellow; -fx-font-weight:normal; -fx-text-alignment: LEFT;", 180, 235, 200, 200)
--visible(txt_radio_minima, false)
visible(txt_dh, false)
blink = true
txt_active_lateral = txt_add(" ", "-fx-font-family: arial; -fx-font-size:17px; -fx-fill: lightgreen; -fx-font-weight:normal; -fx-text-alignment: RIGHT;", 65, 65, 200, 200)
txt_active_vertical = txt_add(" ", "-fx-font-family: arial; -fx-font-size:17px; -fx-fill: lightgreen; -fx-font-weight:bold; -fx-text-alignment: LEFT;", 330, 65, 200, 200)
txt_second_arm_vertical = txt_add(" ", "-fx-font-family: arial; -fx-font-size:17px; -fx-fill: white; -fx-font-weight:normal; -fx-text-alignment: LEFT;", 450, 80, 200, 200)
txt_autopilot = txt_add(" ", "-fx-font-family: arial; -fx-font-size:24px; -fx-fill: cyan; -fx-font-weight:bold; -fx-text-alignment: LEFT;", 85, 145, 200, 200)
txt_yawdamper = txt_add(" ", "-fx-font-family: arial; -fx-font-size:24px; -fx-fill: cyan; -fx-font-weight:bold; -fx-text-alignment: LEFT;", 85, 165, 200, 200)
img_off10=img_add_fullscreen("panel_black10.png")
img_off20=img_add_fullscreen("panel_black20.png")
img_off30=img_add_fullscreen("panel_black30.png")
img_off50=img_add_fullscreen("panel_black50.png")
img_off70=img_add_fullscreen("panel_black70.png")
img_off90=img_add_fullscreen("panel_black.png")
txt_add("DH", "-fx-font-size:20px; -fx-font-family:Arial; -fx-fill: cyan; -fx-font-weight:bold; -fx-text-alignment:left;", 425, 500, 150, 100)
txt_radio_height = txt_add(" ", "-fx-font-family: arial; -fx-font-size:35px; -fx-fill: lightgreen; -fx-font-weight:bold; -fx-text-alignment: LEFT;", 470, 460, 200, 200)--458, 470, 200, 200)
txt_radio_minima = txt_add("200 ", "-fx-font-family: arial; -fx-font-size:20px; -fx-fill: cyan; -fx-font-weight:bold; -fx-text-alignment: LEFT;", 460, 500, 200, 200)
img_cdi = img_add("CDI.png", 0, -150, 600, 900)
img_LLZhorpath = img_add("LLZhorpath.png", 0, -150, 600, 900)
img_fltDir = img_add_fullscreen("Director.png")
img_add_fullscreen("Aircraft_Bars.png")
img_pitch_up = img_add_fullscreen("Pitch_Up.png")
img_pitch_down = img_add_fullscreen("Pitch_Down.png")
img_off=img_add_fullscreen("panel_black.png")
img_add_fullscreen("CRT_border.png")
---------------
-- Functions --
---------------
function new_attitude(roll, pitch, dRoll, dPitch, dMode)
-- Roll outer ring and background
-- roll = var_cap(roll, -90, 90)
-- Roll horizon
img_rotate(img_horizon1 , roll * -1)
img_rotate(img_horizon , roll * -1)
img_rotate(img_pitchAtt, roll * -1)
--img_rotate(img_hViewport, roll * -1)
img_rotate(img_skypoint, roll * -1)
-- Move horizon pitch
pitch = var_cap(pitch, -90, 90)
radial = math.rad(roll * -1)
x = -(math.sin(radial) * pitch * 5) --3
y = (math.cos(radial) * pitch * 5)
img_move(img_horizon1, -300, y-600, nil, nil)
img_move(img_horizon, x, y-150, nil, nil)
img_move(img_pitchAtt, x, y-150, nil, nil)
viewport_rect(img_pitchAtt, 200, 225, 200, 150)
--img_move(img_hViewport, x-150, y-150, nil, nil)
-- Pull up//Pitch down arrows
img_rotate(img_pitch_down, roll * -1)
img_rotate(img_pitch_up, roll * -1)
if pitch >= 30 then
visible(img_pitch_down, true)
else
visible(img_pitch_down, false)
end
if pitch <= -20 then
visible(img_pitch_up, true)
else
visible(img_pitch_up, false)
end
-- Move director
dPitch = var_cap(dPitch, -90, 90)
dRadial = math.rad(dRoll * -1)
dX = (math.sin(dRadial) * (dPitch - pitch) * 5)
dY = (math.cos(dRadial) * (pitch - dPitch) * 5)
img_rotate(img_fltDir, (dRoll * 1) - roll)
img_move(img_fltDir, nil, dY, nil, nil)
-- Director Mode
if dMode == 0 then
visible(img_fltDir, false)
else
visible(img_fltDir, true)
end
end
function new_attitude_fsx(roll, pitch,FDRoll,FDPitch,FDmode)
fd_mode=fif(FDmode,1,0)
new_attitude(roll * -57, pitch * -37,FDRoll,FDPitch,fd_mode)
end
function new_marker_beacons(outer_marker, middle_marker, inner_marker)
visible(img_om, false)
visible(img_mm, false)
visible(img_im,false)
if outer_marker == 1 then
visible(img_om, true)
visible(img_mm, false)
visible(img_im, false)
else
visible(img_om, false)
end
if middle_marker == 1 then
visible(img_om, false)
visible(img_mm, true)
visible(img_im, false)
else
visible(img_mm, false)
end
if inner_marker == 1 then
visible(img_om, false)
visible(img_mm, false)
visible(img_im, true)
else
visible(img_im, false)
end
end
function new_marker_beacons_fsx(om, mm, im)
outer_marker=fif(om,1,0)
middle_marker=fif(mm,1,0)
inner_marker=fif(im,1,0)
new_marker_beacons(outer_marker, middle_marker, inner_marker)
end
function timer_blink()
blink = not blink
end
timer = timer_start(0, 100, timer_blink)
function new_radio_height(radalt, radio_minima)
txt_set(txt_radio_minima, radio_minima)
--DH annunciation
if (radalt>0 and (radalt - radio_minima) <= 0) then
txt_set(txt_dh, "DH")
visible(txt_dh, true)
else
visible(txt_dh, false)
end
if ((radalt - radio_minima) <= 50) then
visible(txt_radio_height, blink)
radalt = var_round(radalt,-1)
end
if (radalt>0 and (radalt - radio_minima) > 50 and (radalt - radio_minima) < 2500) then
visible(txt_radio_minima, true)
radalt = var_round(radalt,-2)
end
if radalt > 2500 then
visible(txt_radio_height, false)
else
visible(txt_radio_height, true)
end
txt_set(txt_radio_height, radalt)
end
function new_radio_height_fsx(radalt, radio_minima)
new_radio_height(radalt, radio_minima)
end
function lateral_mode(hsi_mode, hdg_mode, nav_mode, fd_mode, yd_mode)
--visible(txt_active_lateral, false)
if hdg_mode == 0 and nav_mode == 0 then
visible(txt_active_lateral, false)
end
if hdg_mode == 2 then
txt_set(txt_active_lateral, "HDG")
visible(txt_active_lateral, true)
end
if nav_mode == 2 and hsi_mode == 0 then
txt_set(txt_active_lateral, "NAV1")
visible(txt_active_lateral, true)
end
if nav_mode == 2 and hsi_mode == 1 then
txt_set(txt_active_lateral, "NAV2")
visible(txt_active_lateral, true)
end
if nav_mode == 2 and hsi_mode == 2 then
txt_set(txt_active_lateral, "GPS")
visible(txt_active_lateral, true)
end
if fd_mode == 0 then
visible(txt_active_vertical, false)
end
if fd_mode == 0 or 1 then
visible(txt_autopilot, false)
end
if fd_mode == 2 then
txt_set(txt_autopilot, "AP")
visible(txt_autopilot, true)
end
if yd_mode == 0 then
visible(txt_yawdamper, false)
end
if yd_mode == 1 then
txt_set(txt_yawdamper, "YD")
visible(txt_yawdamper, true)
end
end
function lateral_mode_fsx(fd_mode,yd_mode)
yd_mode=fif(yd_mode,1,0)
fd_mode=fif(fd_mode,2,0)
hsi_mode=0
hdg_mode=0
nav_mode=0
lateral_mode(hsi_mode, hdg_mode, nav_mode, fd_mode, yd_mode)
end
function vertical_mode(gs_mode, alt_mode, vs_mode, ias_mode, ga_mode, pitch_mode)
if gs_mode and alt_mode and vs_mode and ias_mode and ga_mode and pitch_mode == 0 then
visible(txt_active_vertical, false)
end
if alt_mode == 1 then
txt_set(txt_second_arm_vertical, "ALT ARM")
visible(txt_second_arm_vertical, true)
else
visible(txt_second_arm_vertical, false)
end
if gs_mode == 2 then
txt_set(txt_active_vertical, "GS")
visible(txt_active_vertical, true)
elseif alt_mode == 2 then
txt_set(txt_active_vertical, "ALT")
visible(txt_active_vertical, true)
elseif vs_mode == 2 then
txt_set(txt_active_vertical, "VS")
visible(txt_active_vertical, true)
elseif ias_mode == 2 then
txt_set(txt_active_vertical, "IAS")
visible(txt_active_vertical, true)
elseif ga_mode == 2 then
txt_set(txt_active_vertical, "GA")
visible(txt_active_vertical, true)
elseif pitch_mode == 2 then
txt_set(txt_active_vertical, "PTCH")
visible(txt_active_vertical, true)
else
visible(txt_active_vertical, false)
end
end
function vertHorPath(gFlag, glideFlagMove, vFlag, cdiFlagMove)
if gFlag == 1 then
img_visible(img_GSvertpath, true)
gY = (glideFlagMove * 28) - 150
img_move(img_GSvertpath, nil, gY, nil, nil)
end
if gFlag == 0 then
img_visible(img_GSvertpath, false)
end
if vFlag == 1 then
img_visible(img_LLZhorpath, true)
gX = cdiFlagMove * 51--41
img_move(img_LLZhorpath, gX, nil, nil, nil)
else
img_visible(img_LLZhorpath, false)
end
end
function vertHorPath_fsx(has_glide, vertical, has_nav, horizontal)
glideslopeFlag = fif(has_glide, 1, 0) --from FSX boolean to integer (Xplane style)
locFlag=fif(has_nav,1,0)
verticaldev = 4 / 119 * vertical -- GS range from -119 to + 119 in FSX
horizontaldev = 4 / 127 * horizontal -- CDI range from -127 to + 127 in FSX
-- print(glideslopeFlag)
-- print(verticaldev)
-- print(locFlag)
-- print(horizontaldev)
vertHorPath(glideslopeFlag,verticaldev,locFlag,horizontaldev)
end
--ILS
-- gbl_station_is_ils = nav_has_signal and nav_has_localizer
-- if gbl_station_is_ils then
-- visible(img_CDI, true)
-- visible(img_LLZhorpath, true)
-- visible(img_GSvertpath, true)
-- if gbl_nav_has_glideslope then
-- visible(img_GSvertpath, true)
-- visible(img_Glidepath, true)
-- else
-- visible(img_GSvertpath, false)
-- visible(img_Glidepath, false
-- end
-- else -- station is a VOR
-- visible(img_CDI, false)
-- visible(img_LLZhorpath, false)
-- visible(img_GSvertpath, false)
-- visible(img_Glidepath, false)
-- if gbl_station_is_ils then
-- localizer = localizer * 70/127 + localizer_zero -- localizer
-- move(img_localizer,localizer,nil,nil,nil)
-- if gbl_nav_has_glideslope then -- glideslope
-- glideslope = glideslope *70/119 + glideslope_zero
-- move(img_glideslope,nil,glideslope,nil,nil)
-- move(txt_glideslope,nil,glideslope + 2,nil,nil)
-- end
--end
function timer_callback5()
visible(img_off10,false)
visible(img_off20,false)
visible(img_off30,false)
visible(img_off50,false)
visible(img_off70,false)
visible(img_off,false)
end
function timer_callback4()
visible(img_off10,true)
visible(img_off20,false)
timer5=timer_start(start_duration4,nil,timer_callback5)
end
function timer_callback3()
visible(img_off20,true)
visible(img_off30,false)
timer4=timer_start(start_duration3,nil,timer_callback4)
end
function timer_callback2()
visible(img_off30,true)
visible(img_off50,false)
timer3=timer_start(start_duration2,nil,timer_callback3)
end
function timer_callback1()
visible(img_off50,true)
visible(img_off70,false)
visible(img_off90,false)
timer2=timer_start(start_duration1,nil,timer_callback2)
end
function start()
visible(img_off90,false)
visible(img_off70,true)
timer1=timer_start(start_duration,nil,timer_callback1)
end
function startup(master_battery,avionics_master)
timer_stop(timer0)
timer_stop(timer1)
timer_stop(timer2)
timer_stop(timer3)
timer_stop(timer4)
timer_stop(timer5)
if master_battery==false or avionics_master==false then
visible(img_off,true)
else
visible(img_off,false)
visible(img_off90,true)
timer0=timer_start(start_duration,nil,start)
end
end
-------------------
-- Bus subscribe --
-------------------
xpl_dataref_subscribe("sim/cockpit2/gauges/indicators/roll_AHARS_deg_pilot", "FLOAT",
"sim/cockpit2/gauges/indicators/pitch_AHARS_deg_pilot", "FLOAT",
"sim/cockpit2/autopilot/flight_director_roll_deg", "FLOAT",
"sim/cockpit2/autopilot/flight_director_pitch_deg", "FLOAT",
"sim/cockpit2/autopilot/flight_director_mode", "INT", new_attitude)
fsx_variable_subscribe("ATTITUDE INDICATOR BANK DEGREES", "Radians",
"ATTITUDE INDICATOR PITCH DEGREES", "Radians",
"AUTOPILOT FLIGHT DIRECTOR BANK","Radians",
"AUTOPILOT FLIGHT DIRECTOR PITCH","Radians",
"AUTOPILOT FLIGHT DIRECTOR ACTIVE","Boolean",new_attitude_fsx)
xpl_dataref_subscribe("sim/cockpit2/radios/indicators/outer_marker_lit", "INT",
"sim/cockpit2/radios/indicators/middle_marker_lit", "INT",
"sim/cockpit2/radios/indicators/inner_marker_lit", "INT", new_marker_beacons)
fsx_variable_subscribe("OUTER MARKER","Boolean",
"MIDDLE MARKER","Boolean",
"INNER MARKER","Boolean",new_marker_beacons_fsx)
xpl_dataref_subscribe("sim/cockpit2/gauges/indicators/radio_altimeter_height_ft_pilot", "FLOAT",
"sim/cockpit/misc/radio_altimeter_minimum", "FLOAT", new_radio_height)
fsx_variable_subscribe("RADIO HEIGHT", "FEET",
"DECISION HEIGHT", "FEET", new_radio_height_fsx)
xpl_dataref_subscribe("sim/cockpit2/radios/actuators/HSI_source_select_pilot", "INT", -- 0 = nav1, 1 = nav2, 2 = GNSS
"sim/cockpit2/autopilot/heading_status", "INT", -- Autopilot Heading Status. 0=off,1=armed,2=captured
"sim/cockpit2/autopilot/nav_status", "INT", -- Autopilot Nav status
"sim/cockpit/autopilot/autopilot_mode", "INT", -- The autopilot master mode (off=0, flight director=1, on=2)
"sim/cockpit/switches/yaw_damper_on", "INT",
lateral_mode)
fsx_variable_subscribe("AUTOPILOT MASTER", "Boolean",
"AUTOPILOT YAW DAMPER", "Boolean", lateral_mode_fsx)
xpl_dataref_subscribe("sim/cockpit2/autopilot/glideslope_status", "INT",
"sim/cockpit2/autopilot/altitude_hold_status", "INT",
"sim/cockpit2/autopilot/vvi_status", "INT",
"sim/cockpit2/autopilot/speed_status", "INT",
"sim/cockpit2/autopilot/TOGA_status", "INT",
"sim/cockpit2/autopilot/pitch_status", "INT",
vertical_mode)
xpl_dataref_subscribe("sim/cockpit/radios/indicators/hsi_display_vertical_pilot", "INT",
--"sim/cockpit2/radios/indicators/hsi_flag_glideslope_pilot", "INT",
"sim/cockpit2/radios/indicators/hsi_vdef_dots_pilot", "FLOAT",
"sim/cockpit2/radios/indicators/hsi_display_horizontal_pilot", "INT",
"sim/cockpit2/radios/indicators/hsi_hdef_dots_pilot", "FLOAT",
vertHorPath)
fsx_variable_subscribe("HSI GSI NEEDLE VALID", "Boolean",
"NAV GSI:1", "Number",
"HSI CDI NEEDLE VALID", "Boolean",
"NAV CDI:1", "Number", vertHorPath_fsx)
--"NAV HAS NAV:1", "Boolean",
fsx_variable_subscribe(
"ELECTRICAL MASTER BATTERY","Boolean",
"AVIONICS MASTER SWITCH", "Boolean",
startup)
Jacques