2017-07-29 19:35:38 +00:00
# A3XX Lower ECAM Canvas
# Joshua Davidson (it0uchpods)
2017-11-16 19:29:08 +00:00
##############################################
# Copyright (c) Joshua Davidson (it0uchpods) #
##############################################
2017-07-29 19:35:38 +00:00
var lowerECAM_apu = nil;
2018-04-12 16:54:25 +00:00
var lowerECAM_bleed = nil;
var lowerECAM_cond = nil;
2018-09-13 17:40:17 +00:00
var lowerECAM_crz = nil;
2018-04-12 16:54:25 +00:00
var lowerECAM_door = nil;
var lowerECAM_elec = nil;
2017-07-29 19:35:38 +00:00
var lowerECAM_eng = nil;
2017-08-01 14:02:13 +00:00
var lowerECAM_fctl = nil;
2018-04-12 16:54:25 +00:00
var lowerECAM_fuel = nil;
var lowerECAM_hyd = nil;
var lowerECAM_press = nil;
2018-04-13 17:21:18 +00:00
var lowerECAM_status = nil;
2017-10-05 16:22:36 +00:00
var lowerECAM_wheel = nil;
2017-11-20 22:03:07 +00:00
var lowerECAM_test = nil;
2017-07-29 19:35:38 +00:00
var lowerECAM_display = nil;
2018-04-12 16:54:25 +00:00
var page = "fctl";
2017-08-12 17:49:41 +00:00
var oat = getprop("/environment/temperature-degc");
2017-10-05 15:37:39 +00:00
var blue_psi = 0;
var green_psi = 0;
var yellow_psi = 0;
2017-10-10 13:01:12 +00:00
var autobrakemode = 0;
2017-10-18 16:41:12 +00:00
var nosegear = 0;
var leftgear = 0;
var rightgear = 0;
2017-10-21 19:50:02 +00:00
var leftdoor = 0;
var rightdoor = 0;
var nosedoor = 0;
var gearlvr = 0;
var askidsw = 0;
var brakemode = 0;
var accum = 0;
2017-11-20 22:03:07 +00:00
var elapsedtime = 0;
2018-04-12 16:54:25 +00:00
var tr1_v = 0;
var tr1_a = 0;
var tr2_v = 0;
var tr2_a = 0;
2018-09-23 15:02:47 +00:00
# Create Nodes:
var apu_load = props.globals.initNode("/systems/electrical/extra/apu-load", 0);
var apu_volts = props.globals.initNode("/systems/electrical/extra/apu-volts", 0);
var apu_hz = props.globals.initNode("/systems/electrical/extra/apu-hz", 0);
var bleedapu = props.globals.initNode("/systems/pneumatic/bleedapu", 0);
var oil_psi_actual1 = props.globals.initNode("/engines/engine[0]/oil-psi-actual", 0);
var oil_psi_actual2 = props.globals.initNode("/engines/engine[1]/oil-psi-actual", 0);
var door_left = props.globals.initNode("/ECAM/Lower/door-left", 0);
var door_right = props.globals.initNode("/ECAM/Lower/door-right", 0);
var door_nose_left = props.globals.initNode("/ECAM/Lower/door-nose-left", 0);
var door_nose_right = props.globals.initNode("/ECAM/Lower/door-nose-right", 0);
var apu_n = props.globals.initNode("/ECAM/Lower/APU-N", 0);
var apu_egt = props.globals.initNode("/ECAM/Lower/APU-EGT", 0);
var oil_qt1 = props.globals.initNode("/ECAM/Lower/Oil-QT[0]", 0);
var oil_qt2 = props.globals.initNode("/ECAM/Lower/Oil-QT[1]", 0);
var oil_psi1 = props.globals.initNode("/ECAM/Lower/Oil-PSI[0]", 0);
var oil_psi2 = props.globals.initNode("/ECAM/Lower/Oil-PSI[1]", 0);
var aileron_ind_left = props.globals.initNode("/ECAM/Lower/aileron-ind-left", 0);
var aileron_ind_right = props.globals.initNode("/ECAM/Lower/aileron-ind-right", 0);
var elevator_ind_left = props.globals.initNode("/ECAM/Lower/elevator-ind-left", 0);
var elevator_ind_right = props.globals.initNode("/ECAM/Lower/elevator-ind-right", 0);
var elevator_trim_deg = props.globals.initNode("/ECAM/Lower/elevator-trim-deg", 0);
var final_deg = props.globals.initNode("/fdm/jsbsim/hydraulics/rudder/final-deg", 0);
var temperature_degc = props.globals.initNode("/environment/temperature-degc", 0);
var gw = props.globals.initNode("/FMGC/internal/gw", 0);
var du4_test = props.globals.initNode("/instrumentation/du/du4-test", 0);
var du4_test_time = props.globals.initNode("/instrumentation/du/du4-test-time", 0);
var du4_test_amount = props.globals.initNode("/instrumentation/du/du4-test-amount", 0);
# Fetch Nodes
2018-09-24 10:41:09 +00:00
var elapsed_sec = props.globals.getNode("/sim/time/elapsed-sec", 1);
var ac2 = props.globals.getNode("/systems/electrical/bus/ac2", 1);
var autoconfig_running = props.globals.getNode("/systems/acconfig/autoconfig-running", 1);
var ac1_src = props.globals.getNode("/systems/electrical/ac1-src", 1);
var ac2_src = props.globals.getNode("/systems/electrical/ac2-src", 1);
var lighting_du4 = props.globals.getNode("/controls/lighting/DU/du4", 1);
var ecam_page = props.globals.getNode("/ECAM/Lower/page", 1);
var hour = props.globals.getNode("/sim/time/utc/hour", 1);
var minute = props.globals.getNode("/sim/time/utc/minute", 1);
var apu_flap = props.globals.getNode("/systems/apu/flap", 1);
var apu_rpm = props.globals.getNode("/systems/apu/rpm", 1);
var tank3_content_lbs = props.globals.getNode("/fdm/jsbsim/propulsion/tank[2]/contents-lbs", 1);
var apu_master = props.globals.getNode("/controls/APU/master", 1);
var gen_apu = props.globals.getNode("/controls/electrical/switches/gen-apu", 1);
var ir2_knob = props.globals.getNode("/controls/adirs/ir[1]/knob", 1);
var switch_bleedapu = props.globals.getNode("/controls/pneumatic/switches/bleedapu", 1);
var pneumatic_xbleed_state = props.globals.getNode("/systems/pneumatic/xbleed-state", 1);
var xbleed = props.globals.getNode("/systems/pneumatic/xbleed", 1);
var hp_valve1_state = props.globals.getNode("/systems/pneumatic/hp-valve-1-state", 1);
var hp_valve2_state = props.globals.getNode("/systems/pneumatic/hp-valve-2-state", 1);
var hp_valve1 = props.globals.getNode("/systems/pneumatic/hp-valve-1", 1);
var hp_valve2 = props.globals.getNode("/systems/pneumatic/hp-valve-2", 1);
var eng_valve1_state = props.globals.getNode("/systems/pneumatic/eng-valve-1-state", 1);
var eng_valve2_state = props.globals.getNode("/systems/pneumatic/eng-valve-2-state", 1);
var eng_valve1 = props.globals.getNode("/systems/pneumatic/eng-valve-1", 1);
var eng_valve2 = props.globals.getNode("/systems/pneumatic/eng-valve-2", 1);
var precooler1_psi = props.globals.getNode("/systems/pneumatic/precooler-1-psi", 1);
var precooler2_psi = props.globals.getNode("/systems/pneumatic/precooler-2-psi", 1);
var precooler1_temp = props.globals.getNode("/systems/pneumatic/precooler-1-temp", 1);
var precooler2_temp = props.globals.getNode("/systems/pneumatic/precooler-2-temp", 1);
var precooler1_ovht = props.globals.getNode("/systems/pneumatic/precooler-1-ovht", 1);
var precooler2_ovht = props.globals.getNode("/systems/pneumatic/precooler-2-ovht", 1);
var gs_kt = props.globals.getNode("/velocities/groundspeed-kt", 1);
var switch_wing_aice = props.globals.getNode("/controls/switches/wing", 1);
var deice_wing = props.globals.getNode("/controls/deice/wing", 1);
var eng1_n2_actual = props.globals.getNode("/engines/engine[0]/n2-actual", 1);
var eng2_n2_actual = props.globals.getNode("/engines/engine[1]/n2-actual", 1);
var pack1_out_temp = props.globals.getNode("/systems/pressurization/pack-1-out-temp", 1);
var pack2_out_temp = props.globals.getNode("/systems/pressurization/pack-2-out-temp", 1);
var pack1_comp_out_temp = props.globals.getNode("/systems/pressurization/pack-1-comp-out-temp", 1);
var pack2_comp_out_temp = props.globals.getNode("/systems/pressurization/pack-2-comp-out-temp", 1);
var pack1_bypass = props.globals.getNode("/systems/pressurization/pack-1-bypass", 1);
var pack2_bypass = props.globals.getNode("/systems/pressurization/pack-2-bypass", 1);
var pack1_flow = props.globals.getNode("/systems/pressurization/pack-1-flow", 1);
var pack2_flow = props.globals.getNode("/systems/pressurization/pack-2-flow", 1);
var pack1_valve = props.globals.getNode("/systems/pressurization/pack-1-valve", 1);
var pack2_valve = props.globals.getNode("/systems/pressurization/pack-2-valve", 1);
var switch_pack1 = props.globals.getNode("/controls/pneumatic/switches/pack1", 1);
var switch_pack2 = props.globals.getNode("/controls/pneumatic/switches/pack2", 1);
var oil_qt1_actual = props.globals.getNode("/engines/engine[0]/oil-qt-actual", 1);
var oil_qt2_actual = props.globals.getNode("/engines/engine[1]/oil-qt-actual", 1);
var doorL1_pos = props.globals.getNode("sim/model/door-positions/doorl1/position-norm", 1);
var doorR1_pos = props.globals.getNode("sim/model/door-positions/doorr1/position-norm", 1);
var doorL4_pos = props.globals.getNode("sim/model/door-positions/doorl4/position-norm", 1);
var doorR4_pos = props.globals.getNode("sim/model/door-positions/doorr4/position-norm", 1);
var cargobulk_pos = props.globals.getNode("/sim/model/door-positions/cargobulk/position-norm", 1);
var cargofwd_pos = props.globals.getNode("/sim/model/door-positions/cargofwd/position-norm", 1);
var cargoaft_pos = props.globals.getNode("/sim/model/door-positions/cargoaft/position-norm", 1);
var switch_bat1 = props.globals.getNode("/controls/electrical/switches/battery1", 1);
var switch_bat2 = props.globals.getNode("/controls/electrical/switches/battery2", 1);
var bat1_amps = props.globals.getNode("/systems/electrical/battery1-amps", 1);
var bat2_amps = props.globals.getNode("/systems/electrical/battery2-amps", 1);
var bat1_volts = props.globals.getNode("/systems/electrical/battery1-volts", 1);
var bat2_volts = props.globals.getNode("/systems/electrical/battery2-volts", 1);
var bat1_fault = props.globals.getNode("/systems/electrical/batt1-fault", 1);
var bat2_fault = props.globals.getNode("/systems/electrical/batt2-fault", 1);
var tr1_volts = props.globals.getNode("/systems/electrical/extra/tr1-volts", 1);
var tr2_volts = props.globals.getNode("/systems/electrical/extra/tr2-volts", 1);
var tr1_amps = props.globals.getNode("/systems/electrical/extra/tr1-amps", 1);
var tr2_amps = props.globals.getNode("/systems/electrical/extra/tr2-amps", 1);
var dc1 = props.globals.getNode("/systems/electrical/bus/dc1", 1);
var dc2 = props.globals.getNode("/systems/electrical/bus/dc2", 1);
var dc_ess = props.globals.getNode("/systems/electrical/bus/dc-ess", 1);
var switch_emer_gen = props.globals.getNode("/controls/electrical/switches/emer-gen", 1);
var switch_gen1 = props.globals.getNode("/controls/electrical/switches/gen1", 1);
var switch_gen2 = props.globals.getNode("/controls/electrical/switches/gen2", 1);
var eng1_running = props.globals.getNode("/engines/engine[0]/running", 1);
var eng2_running = props.globals.getNode("/engines/engine[1]/running", 1);
var gen1_load = props.globals.getNode("/systems/electrical/extra/gen1-load", 1);
var gen2_load = props.globals.getNode("/systems/electrical/extra/gen2-load", 1);
var gen1_volts = props.globals.getNode("/systems/electrical/extra/gen1-volts", 1);
var gen2_volts = props.globals.getNode("/systems/electrical/extra/gen2-volts", 1);
var gen1_hz = props.globals.getNode("/systems/electrical/bus/gen1-hz", 1);
var gen2_hz = props.globals.getNode("/systems/electrical/bus/gen2-hz", 1);
var switch_cart = props.globals.getNode("/controls/switches/cart", 1);
var ext_volts = props.globals.getNode("/systems/electrical/extra/ext-volts", 1);
var ext_hz = props.globals.getNode("/systems/electrical/extra/ext-hz", 1);
var galleyshed = props.globals.getNode("/systems/electrical/extra/galleyshed", 1);
var switch_galley = props.globals.getNode("/controls/electrical/switches/galley", 1);
var dcbat = props.globals.getNode("/systems/electrical/bus/dcbat", 1);
var ac_ess = props.globals.getNode("/systems/electrical/bus/ac-ess", 1);
var ac1 = props.globals.getNode("/systems/electrical/bus/ac1", 1);
var ac2 = props.globals.getNode("/systems/electrical/bus/ac2", 1);
var switch_ac_ess_feed = props.globals.getNode("/controls/electrical/switches/ac-ess-feed", 1);
var tr1_fault = props.globals.getNode("/systems/electrical/tr1-fault", 1);
var tr2_fault = props.globals.getNode("/systems/electrical/tr2-fault", 1);
var total_psi = props.globals.getNode("/systems/pneumatic/total-psi", 1);
var b_psi = props.globals.getNode("/systems/hydraulic/blue-psi", 1);
var g_psi = props.globals.getNode("/systems/hydraulic/green-psi", 1);
var y_psi = props.globals.getNode("/systems/hydraulic/yellow-psi", 1);
var spoiler_L1 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l1/final-deg", 1);
var spoiler_L2 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l2/final-deg", 1);
var spoiler_L3 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l3/final-deg", 1);
var spoiler_L4 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l4/final-deg", 1);
var spoiler_L5 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l5/final-deg", 1);
var spoiler_R1 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r1/final-deg", 1);
var spoiler_R2 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r2/final-deg", 1);
var spoiler_R3 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r3/final-deg", 1);
var spoiler_R4 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r4/final-deg", 1);
var spoiler_R5 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r5/final-deg", 1);
var spoiler_L1_fail = props.globals.getNode("/systems/failures/spoiler-l1", 1);
var spoiler_L2_fail = props.globals.getNode("/systems/failures/spoiler-l2", 1);
var spoiler_L3_fail = props.globals.getNode("/systems/failures/spoiler-l3", 1);
var spoiler_L4_fail = props.globals.getNode("/systems/failures/spoiler-l4", 1);
var spoiler_L5_fail = props.globals.getNode("/systems/failures/spoiler-l5", 1);
var spoiler_R1_fail = props.globals.getNode("/systems/failures/spoiler-r1", 1);
var spoiler_R2_fail = props.globals.getNode("/systems/failures/spoiler-r2", 1);
var spoiler_R3_fail = props.globals.getNode("/systems/failures/spoiler-r3", 1);
var spoiler_R4_fail = props.globals.getNode("/systems/failures/spoiler-r4", 1);
var spoiler_R5_fail = props.globals.getNode("/systems/failures/spoiler-r5", 1);
var elac1 = props.globals.getNode("/systems/fctl/elac1", 1);
var elac2 = props.globals.getNode("/systems/fctl/elac2", 1);
var sec1 = props.globals.getNode("/systems/fctl/sec1", 1);
var sec2 = props.globals.getNode("/systems/fctl/sec2", 1);
var sec3 = props.globals.getNode("/systems/fctl/sec3", 1);
var elac1_fail = props.globals.getNode("/systems/failures/elac1", 1);
var elac2_fail = props.globals.getNode("/systems/failures/elac2", 1);
var sec1_fail = props.globals.getNode("/systems/failures/sec1", 1);
var sec2_fail = props.globals.getNode("/systems/failures/sec2", 1);
var sec3_fail = props.globals.getNode("/systems/failures/sec3", 1);
var eng1_n1 = props.globals.getNode("engines/engine[0]/n1-actual", 1);
var eng2_n1 = props.globals.getNode("engines/engine[1]/n1-actual", 1);
var total_fuel_lbs = props.globals.getNode("/consumables/fuel/total-fuel-lbs", 1);
var fadec1 = props.globals.getNode("/systems/fadec/powered1", 1);
var fadec2 = props.globals.getNode("/systems/fadec/powered2", 1);
var fuel_flow1 = props.globals.getNode("/engines/engine[0]/fuel-flow_actual", 1);
var fuel_flow2 = props.globals.getNode("/engines/engine[1]/fuel-flow_actual", 1);
var cutoff_switch1 = props.globals.getNode("/controls/engines/engine[0]/cutoff-switch", 1);
var cutoff_switch2 = props.globals.getNode("/controls/engines/engine[1]/cutoff-switch", 1);
var fuel_xfeed = props.globals.getNode("/controls/fuel/x-feed", 1);
var tank0pump1 = props.globals.getNode("controls/fuel/tank0pump1", 1);
var tank0pump2 = props.globals.getNode("controls/fuel/tank0pump2", 1);
var tank1pump1 = props.globals.getNode("controls/fuel/tank1pump1", 1);
var tank1pump2 = props.globals.getNode("controls/fuel/tank1pump2", 1);
var tank2pump1 = props.globals.getNode("controls/fuel/tank2pump1", 1);
var tank2pump2 = props.globals.getNode("controls/fuel/tank2pump2", 1);
var ptu = props.globals.getNode("/controls/hydraulic/ptu", 1);
var ptu_fault = props.globals.getNode("/systems/hydraulic/ptu-fault", 1);
var ptu_active = props.globals.getNode("/systems/hydraulic/ptu-active", 1);
var ptu_supplies = props.globals.getNode("/systems/hydraulic/ptu-supplies", 1);
var eng1_pump = props.globals.getNode("/controls/hydraulic/eng1-pump", 1);
var eng2_pump = props.globals.getNode("/controls/hydraulic/eng2-pump", 1);
var elec_pump_blue = props.globals.getNode("/controls/hydraulic/elec-pump-blue", 1);
var elec_pump_yellow = props.globals.getNode("/controls/hydraulic/elec-pump-yellow", 1);
var y_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/yellow-resv-lo-air-press", 1);
var b_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/blue-resv-lo-air-press", 1);
var g_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/green-resv-lo-air-press", 1);
var elec_pump_y_ovht = props.globals.getNode("/systems/hydraulic/elec-pump-yellow-ovht", 1);
var elec_pump_b_ovht = props.globals.getNode("/systems/hydraulic/elec-pump-blue-ovht", 1);
var rat_deployed = props.globals.getNode("/controls/hydraulic/rat-deployed", 1);
var y_resv_ovht = props.globals.getNode("/systems/hydraulic/yellow-resv-ovht", 1);
var b_resv_ovht = props.globals.getNode("/systems/hydraulic/blue-resv-ovht", 1);
var g_resv_ovht = props.globals.getNode("/systems/hydraulic/green-resv-ovht", 1);
var y_fire_valve = props.globals.getNode("/systems/hydraulic/yellow-fire-valve", 1);
var g_fire_valve = props.globals.getNode("/systems/hydraulic/green-fire-valve", 1);
var autobreak_mode = props.globals.getNode("/controls/autobrake/mode", 1);
var gear1_pos = props.globals.getNode("gear/gear[0]/position-norm", 1);
var gear2_pos = props.globals.getNode("gear/gear[1]/position-norm", 1);
var gear3_pos = props.globals.getNode("gear/gear[2]/position-norm", 1);
var gear_door_L = props.globals.getNode("/systems/hydraulic/gear/door-left", 1);
var gear_door_R = props.globals.getNode("/systems/hydraulic/gear/door-right", 1);
var gear_door_N = props.globals.getNode("/systems/hydraulic/gear/door-nose", 1);
var gear_down = props.globals.getNode("/controls/gear/gear-down", 1);
var askid = props.globals.getNode("/systems/hydraulic/brakes/askidnwssw", 1);
var brk_mode = props.globals.getNode("/systems/hydraulic/brakes/mode", 1);
var accu_press = props.globals.getNode("/systems/hydraulic/brakes/accumulator-pressure-psi", 1);
var press_vs_norm = props.globals.getNode("/systems/pressurization/vs-norm", 1);
var cabinalt = props.globals.getNode("/systems/pressurization/cabinalt-norm", 1);
var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1);
2017-07-29 19:35:38 +00:00
var canvas_lowerECAM_base = {
init: func(canvas_group, file) {
var font_mapper = func(family, weight) {
return "LiberationFonts/LiberationSans-Regular.ttf";
};
2017-11-20 22:03:07 +00:00
canvas.parsesvg(canvas_group, file, {"font-mapper": font_mapper});
2017-07-29 19:35:38 +00:00
var svg_keys = me.getKeys();
foreach(var key; svg_keys) {
me[key] = canvas_group.getElementById(key);
}
me.page = canvas_group;
return me;
},
getKeys: func() {
return [];
},
update: func() {
2018-09-23 15:02:47 +00:00
elapsedtime = elapsed_sec.getValue();
if (ac2.getValue() >= 110) {
2018-09-23 22:30:04 +00:00
if (gear0_wow.getValue() == 1) {
if (autoconfig_running.getValue() != 1 and du4_test.getValue() != 1) {
du4_test.setValue(1);
du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du4_test_time.setValue(elapsedtime);
} else if (autoconfig_running.getValue() == 1 and du4_test.getValue() != 1) {
du4_test.setValue(1);
du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du4_test_time.setValue(elapsedtime - 30);
2018-09-24 10:41:09 +00:00
}
2018-09-23 15:41:32 +00:00
} else {
2018-09-23 15:02:47 +00:00
du4_test.setValue(1);
2018-09-23 22:30:04 +00:00
du4_test_amount.setValue(0);
du4_test_time.setValue(-100);
2017-11-20 22:03:07 +00:00
}
2018-09-23 15:02:47 +00:00
} else if (ac1_src.getValue() == "XX" or ac2_src.getValue() == "XX") {
du4_test.setValue(0);
2017-11-20 22:03:07 +00:00
}
2018-11-07 22:20:58 +00:00
if (ac2.getValue() >= 110 and lighting_du4.getValue() > 0.01) {
2018-09-23 15:02:47 +00:00
if (du4_test_time.getValue() + du4_test_amount.getValue() >= elapsedtime) {
2017-07-30 04:41:20 +00:00
lowerECAM_apu.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_crz.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_door.page.hide();
lowerECAM_elec.page.hide();
2017-07-30 04:41:20 +00:00
lowerECAM_eng.page.hide();
2017-08-01 14:02:13 +00:00
lowerECAM_fctl.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_fuel.page.hide();
lowerECAM_press.page.hide();
2018-04-13 17:21:18 +00:00
lowerECAM_status.page.hide();
2017-10-05 16:22:36 +00:00
lowerECAM_wheel.page.hide();
2017-11-20 22:03:07 +00:00
lowerECAM_test.page.show();
2017-12-31 14:33:53 +00:00
lowerECAM_test.update();
2017-11-20 22:03:07 +00:00
} else {
lowerECAM_test.page.hide();
2018-09-23 15:02:47 +00:00
page = ecam_page.getValue();
2017-11-20 22:03:07 +00:00
if (page == "apu") {
lowerECAM_apu.page.show();
2018-04-12 16:54:25 +00:00
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_crz.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_door.page.hide();
lowerECAM_elec.page.hide();
2017-11-20 22:03:07 +00:00
lowerECAM_eng.page.hide();
lowerECAM_fctl.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_fuel.page.hide();
lowerECAM_press.page.hide();
2018-04-13 17:21:18 +00:00
lowerECAM_status.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_hyd.page.hide();
2017-11-20 22:03:07 +00:00
lowerECAM_wheel.page.hide();
lowerECAM_apu.update();
2018-04-12 16:54:25 +00:00
} else if (page == "bleed") {
lowerECAM_apu.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_bleed.page.show();
2018-04-12 16:54:25 +00:00
lowerECAM_cond.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_crz.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_door.page.hide();
lowerECAM_elec.page.hide();
lowerECAM_eng.page.hide();
lowerECAM_fctl.page.hide();
lowerECAM_fuel.page.hide();
lowerECAM_press.page.hide();
2018-04-13 17:21:18 +00:00
lowerECAM_status.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_hyd.page.hide();
lowerECAM_wheel.page.hide();
lowerECAM_bleed.update();
} else if (page == "cond") {
lowerECAM_apu.page.hide();
lowerECAM_bleed.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_cond.page.show();
lowerECAM_crz.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_door.page.hide();
lowerECAM_elec.page.hide();
lowerECAM_eng.page.hide();
lowerECAM_fctl.page.hide();
lowerECAM_fuel.page.hide();
lowerECAM_press.page.hide();
2018-04-13 17:21:18 +00:00
lowerECAM_status.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_hyd.page.hide();
lowerECAM_wheel.page.hide();
lowerECAM_cond.update();
2018-09-13 17:40:17 +00:00
} else if (page == "crz") {
lowerECAM_apu.page.hide();
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();
lowerECAM_crz.page.show();
lowerECAM_door.page.hide();
lowerECAM_elec.page.hide();
lowerECAM_eng.page.hide();
lowerECAM_fctl.page.hide();
lowerECAM_fuel.page.hide();
lowerECAM_press.page.hide();
lowerECAM_status.page.hide();
lowerECAM_hyd.page.hide();
lowerECAM_wheel.page.hide();
lowerECAM_crz.update();
2018-04-12 16:54:25 +00:00
} else if (page == "door") {
lowerECAM_apu.page.hide();
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_crz.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_door.page.show();
lowerECAM_elec.page.hide();
lowerECAM_eng.page.hide();
lowerECAM_fctl.page.hide();
lowerECAM_fuel.page.hide();
lowerECAM_press.page.hide();
2018-04-13 17:21:18 +00:00
lowerECAM_status.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_hyd.page.hide();
lowerECAM_wheel.page.hide();
lowerECAM_door.update();
} else if (page == "elec") {
lowerECAM_apu.page.hide();
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_crz.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_door.page.hide();
lowerECAM_elec.page.show();
lowerECAM_eng.page.hide();
lowerECAM_fctl.page.hide();
lowerECAM_fuel.page.hide();
lowerECAM_press.page.hide();
2018-04-13 17:21:18 +00:00
lowerECAM_status.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_hyd.page.hide();
lowerECAM_wheel.page.hide();
lowerECAM_elec.update();
2017-11-20 22:03:07 +00:00
} else if (page == "eng") {
lowerECAM_apu.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_crz.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_door.page.hide();
lowerECAM_elec.page.hide();
2017-11-20 22:03:07 +00:00
lowerECAM_eng.page.show();
lowerECAM_fctl.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_fuel.page.hide();
lowerECAM_press.page.hide();
2018-04-13 17:21:18 +00:00
lowerECAM_status.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_hyd.page.hide();
2017-11-20 22:03:07 +00:00
lowerECAM_wheel.page.hide();
lowerECAM_eng.update();
} else if (page == "fctl") {
lowerECAM_apu.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_crz.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_door.page.hide();
lowerECAM_elec.page.hide();
2017-11-20 22:03:07 +00:00
lowerECAM_eng.page.hide();
lowerECAM_fctl.page.show();
2018-04-12 16:54:25 +00:00
lowerECAM_fuel.page.hide();
lowerECAM_press.page.hide();
2018-04-13 17:21:18 +00:00
lowerECAM_status.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_hyd.page.hide();
2017-11-20 22:03:07 +00:00
lowerECAM_wheel.page.hide();
lowerECAM_fctl.update();
2018-04-12 16:54:25 +00:00
} else if (page == "fuel") {
2017-11-20 22:03:07 +00:00
lowerECAM_apu.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_crz.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_door.page.hide();
lowerECAM_elec.page.hide();
2017-11-20 22:03:07 +00:00
lowerECAM_eng.page.hide();
lowerECAM_fctl.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_fuel.page.show();
2018-04-12 16:54:25 +00:00
lowerECAM_press.page.hide();
2018-04-13 17:21:18 +00:00
lowerECAM_status.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_hyd.page.hide();
lowerECAM_wheel.page.hide();
lowerECAM_fuel.update();
} else if (page == "press") {
lowerECAM_apu.page.hide();
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_crz.page.hide();
2017-11-20 22:03:07 +00:00
lowerECAM_door.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_elec.page.hide();
lowerECAM_eng.page.hide();
lowerECAM_fctl.page.hide();
lowerECAM_fuel.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_press.page.show();
2018-04-13 17:21:18 +00:00
lowerECAM_status.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_hyd.page.hide();
lowerECAM_wheel.page.hide();
lowerECAM_press.update();
2018-04-13 17:21:18 +00:00
} else if (page == "sts") {
lowerECAM_apu.page.hide();
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_crz.page.hide();
2018-04-13 17:21:18 +00:00
lowerECAM_door.page.hide();
lowerECAM_elec.page.hide();
lowerECAM_eng.page.hide();
lowerECAM_fctl.page.hide();
lowerECAM_fuel.page.hide();
lowerECAM_press.page.hide();
lowerECAM_status.page.show();
lowerECAM_hyd.page.hide();
lowerECAM_wheel.page.hide();
lowerECAM_status.update();
2018-04-12 16:54:25 +00:00
} else if (page == "hyd") {
2017-11-20 22:03:07 +00:00
lowerECAM_apu.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_crz.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_door.page.hide();
lowerECAM_elec.page.hide();
2017-11-20 22:03:07 +00:00
lowerECAM_eng.page.hide();
lowerECAM_fctl.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_fuel.page.hide();
lowerECAM_press.page.hide();
2018-04-13 17:21:18 +00:00
lowerECAM_status.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_hyd.page.show();
2017-11-20 22:03:07 +00:00
lowerECAM_wheel.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_hyd.update();
} else if (page == "wheel") {
lowerECAM_apu.page.hide();
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_crz.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_door.page.hide();
lowerECAM_elec.page.hide();
lowerECAM_eng.page.hide();
lowerECAM_fctl.page.hide();
lowerECAM_fuel.page.hide();
lowerECAM_press.page.hide();
2018-04-13 17:21:18 +00:00
lowerECAM_status.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_hyd.page.hide();
lowerECAM_wheel.page.show();
lowerECAM_wheel.update();
2017-11-20 22:03:07 +00:00
} else {
lowerECAM_apu.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_crz.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_door.page.hide();
lowerECAM_elec.page.hide();
2017-11-20 22:03:07 +00:00
lowerECAM_eng.page.hide();
lowerECAM_fctl.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_fuel.page.hide();
lowerECAM_press.page.hide();
2018-04-13 17:21:18 +00:00
lowerECAM_status.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_hyd.page.hide();
2017-11-20 22:03:07 +00:00
lowerECAM_wheel.page.hide();
}
2017-07-30 04:41:20 +00:00
}
} else {
2017-11-20 22:03:07 +00:00
lowerECAM_test.page.hide();
2017-07-30 04:41:20 +00:00
lowerECAM_apu.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();
2018-09-13 17:40:17 +00:00
lowerECAM_crz.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_door.page.hide();
lowerECAM_elec.page.hide();
2017-07-30 04:41:20 +00:00
lowerECAM_eng.page.hide();
2017-08-06 03:07:21 +00:00
lowerECAM_fctl.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_fuel.page.hide();
lowerECAM_press.page.hide();
2018-04-13 17:21:18 +00:00
lowerECAM_status.page.hide();
2018-04-12 16:54:25 +00:00
lowerECAM_hyd.page.hide();
2017-10-05 16:22:36 +00:00
lowerECAM_wheel.page.hide();
2017-07-30 04:41:20 +00:00
}
2017-07-29 19:35:38 +00:00
},
updateBottomStatus: func() {
2018-09-23 15:02:47 +00:00
me["TAT"].setText(sprintf("%2.0f", temperature_degc.getValue()));
me["SAT"].setText(sprintf("%2.0f", temperature_degc.getValue()));
me["GW"].setText(sprintf("%s", math.round(gw.getValue())));
me["UTCh"].setText(sprintf("%02d", hour.getValue()));
me["UTCm"].setText(sprintf("%02d", minute.getValue()));
2017-07-29 19:35:38 +00:00
},
};
var canvas_lowerECAM_apu = {
new: func(canvas_group, file) {
2017-10-19 04:05:42 +00:00
var m = {parents: [canvas_lowerECAM_apu, canvas_lowerECAM_base]};
2017-07-29 19:35:38 +00:00
m.init(canvas_group, file);
return m;
},
getKeys: func() {
2018-04-05 21:21:48 +00:00
return ["TAT","SAT","GW","UTCh","UTCm","APUN-needle","APUEGT-needle","APUN","APUEGT","APUAvail","APUFlapOpen","APUBleedValve","APUBleedOnline","APUGenOnline","APUGentext","APUGenLoad","APUGenbox","APUGenVolt","APUGenHz","APUBleedPSI","APUfuelLO",
"text3724","text3728","text3732"];
2017-07-29 19:35:38 +00:00
},
update: func() {
2018-09-23 15:02:47 +00:00
oat = temperature_degc.getValue();
2018-09-23 23:32:14 +00:00
2017-07-29 19:35:38 +00:00
# Avail and Flap Open
2018-09-23 15:02:47 +00:00
if (apu_flap.getValue() == 1) {
2017-07-29 19:35:38 +00:00
me["APUFlapOpen"].show();
} else {
me["APUFlapOpen"].hide();
}
2018-09-23 15:02:47 +00:00
if (apu_rpm.getValue() > 94.9) {
2017-07-29 19:35:38 +00:00
me["APUAvail"].show();
} else {
me["APUAvail"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (tank3_content_lbs.getValue() < 100) {
2017-08-12 17:49:41 +00:00
me["APUfuelLO"].show();
} else {
me["APUfuelLO"].hide();
}
2018-09-23 23:32:14 +00:00
2017-07-29 19:35:38 +00:00
# APU Gen
2018-09-23 15:02:47 +00:00
if (apu_volts.getValue() > 110) {
2017-11-05 22:16:56 +00:00
me["APUGenVolt"].setColor(0.0509,0.7529,0.2941);
2017-07-29 19:35:38 +00:00
} else {
2017-10-18 21:39:52 +00:00
me["APUGenVolt"].setColor(0.7333,0.3803,0);
2017-07-29 19:35:38 +00:00
}
2018-09-23 15:02:47 +00:00
if (apu_hz.getValue() > 380) {
2017-11-05 22:16:56 +00:00
me["APUGenHz"].setColor(0.0509,0.7529,0.2941);
2017-07-29 19:35:38 +00:00
} else {
2017-10-18 21:39:52 +00:00
me["APUGenHz"].setColor(0.7333,0.3803,0);
2017-07-29 19:35:38 +00:00
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (apu_master.getValue() == 1 or apu_rpm.getValue() >= 94.9) {
2017-08-12 17:49:41 +00:00
me["APUGenbox"].show();
me["APUGenHz"].show();
me["APUGenVolt"].show();
me["APUGenLoad"].show();
me["text3724"].show();
me["text3728"].show();
me["text3732"].show();
} else {
me["APUGenbox"].hide();
me["APUGenHz"].hide();
me["APUGenVolt"].hide();
me["APUGenLoad"].hide();
me["text3724"].hide();
me["text3728"].hide();
me["text3732"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if ((apu_rpm.getValue() > 94.9) and (gen_apu.getValue() == 1)) {
2017-08-12 17:49:41 +00:00
me["APUGenOnline"].show();
} else {
me["APUGenOnline"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if ((apu_master.getValue() == 0) or ((apu_master.getValue() == 1) and (gen_apu.getValue() == 1) and (apu_rpm.getValue() > 94.9))) {
2017-10-18 21:39:52 +00:00
me["APUGentext"].setColor(0.8078,0.8039,0.8078);
2018-09-23 15:02:47 +00:00
} else if ((apu_master.getValue() == 1) and (gen_apu.getValue() == 0) and (apu_rpm.getValue() < 94.9)) {
2017-10-18 21:39:52 +00:00
me["APUGentext"].setColor(0.7333,0.3803,0);
2017-08-12 17:49:41 +00:00
}
2017-07-29 19:35:38 +00:00
2018-09-23 15:02:47 +00:00
me["APUGenLoad"].setText(sprintf("%s", math.round(apu_load.getValue())));
me["APUGenVolt"].setText(sprintf("%s", math.round(apu_volts.getValue())));
me["APUGenHz"].setText(sprintf("%s", math.round(apu_hz.getValue())));
2017-07-29 19:35:38 +00:00
# APU Bleed
2018-09-23 15:02:47 +00:00
if (ir2_knob.getValue() != 0 and (apu_master.getValue() == 1 or bleedapu.getValue() > 0)) {
2017-11-05 22:16:56 +00:00
me["APUBleedPSI"].setColor(0.0509,0.7529,0.2941);
2018-09-23 15:02:47 +00:00
me["APUBleedPSI"].setText(sprintf("%s", math.round(bleedapu.getValue())));
2017-07-29 19:35:38 +00:00
} else {
2017-10-18 21:39:52 +00:00
me["APUBleedPSI"].setColor(0.7333,0.3803,0);
2017-07-29 19:35:38 +00:00
me["APUBleedPSI"].setText(sprintf("%s", "XX"));
}
2018-09-23 15:02:47 +00:00
if (switch_bleedapu.getValue() == 1) {
2017-10-30 19:40:48 +00:00
me["APUBleedValve"].setRotation(90 * D2R);
2017-07-29 19:35:38 +00:00
me["APUBleedOnline"].show();
} else {
me["APUBleedValve"].setRotation(0);
me["APUBleedOnline"].hide();
}
# APU N and EGT
2018-09-23 15:02:47 +00:00
if (apu_master.getValue() == 1) {
2017-11-05 22:16:56 +00:00
me["APUN"].setColor(0.0509,0.7529,0.2941);
2018-09-23 15:02:47 +00:00
me["APUN"].setText(sprintf("%s", math.round(apu_rpm.getValue())));
2017-11-05 22:16:56 +00:00
me["APUEGT"].setColor(0.0509,0.7529,0.2941);
2018-09-23 15:02:47 +00:00
me["APUEGT"].setText(sprintf("%s", math.round(apu_egt.getValue())));
} else if (apu_rpm.getValue() >= 1) {
2017-11-05 22:16:56 +00:00
me["APUN"].setColor(0.0509,0.7529,0.2941);
2018-09-23 15:02:47 +00:00
me["APUN"].setText(sprintf("%s", math.round(apu_rpm.getValue())));
2017-11-05 22:16:56 +00:00
me["APUEGT"].setColor(0.0509,0.7529,0.2941);
2018-09-23 15:02:47 +00:00
me["APUEGT"].setText(sprintf("%s", math.round(apu_egt.getValue())));
2017-08-12 17:49:41 +00:00
} else {
2017-10-18 21:39:52 +00:00
me["APUN"].setColor(0.7333,0.3803,0);
2017-08-12 17:49:41 +00:00
me["APUN"].setText(sprintf("%s", "XX"));
2017-10-18 21:39:52 +00:00
me["APUEGT"].setColor(0.7333,0.3803,0);
2017-08-12 17:49:41 +00:00
me["APUEGT"].setText(sprintf("%s", "XX"));
}
2018-09-23 15:02:47 +00:00
me["APUN-needle"].setRotation((apu_n.getValue() + 90) * D2R);
me["APUEGT-needle"].setRotation((apu_egt.getValue() + 90) * D2R);
2017-07-29 19:35:38 +00:00
me.updateBottomStatus();
},
};
2018-04-12 16:54:25 +00:00
var canvas_lowerECAM_bleed = {
new: func(canvas_group, file) {
var m = {parents: [canvas_lowerECAM_bleed, canvas_lowerECAM_base]};
m.init(canvas_group, file);
2018-09-23 23:32:14 +00:00
2018-04-12 16:54:25 +00:00
return m;
},
getKeys: func() {
2018-04-19 21:36:36 +00:00
return ["TAT","SAT","GW","UTCh","UTCm", "BLEED-XFEED", "BLEED-Ram-Air", "BLEED-APU", "BLEED-HP-Valve-1",
"BLEED-ENG-1", "BLEED-HP-Valve-2", "BLEED-ENG-2", "BLEED-Precooler-1-Inlet-Press", "BLEED-Precooler-1-Outlet-Temp",
"BLEED-Precooler-2-Inlet-Press", "BLEED-Precooler-2-Outlet-Temp", "BLEED-ENG-1-label", "BLEED-ENG-2-label",
"BLEED-GND", "BLEED-Pack-1-Flow-Valve", "BLEED-Pack-2-Flow-Valve", "BLEED-Pack-1-Out-Temp",
"BLEED-Pack-1-Comp-Out-Temp", "BLEED-Pack-1-Packflow-needel", "BLEED-Pack-1-Bypass-needel", "BLEED-Pack-2-Out-Temp",
"BLEED-Pack-2-Bypass-needel", "BLEED-Pack-2-Comp-Out-Temp", "BLEED-Pack-2-Packflow-needel", "BLEED-Anti-Ice-Left",
"BLEED-Anti-Ice-Right", "BLEED-HP-2-connection", "BLEED-HP-1-connection", "BLEED-ANTI-ICE-ARROW-LEFT", "BLEED-ANTI-ICE-ARROW-RIGHT"];
2018-04-12 16:54:25 +00:00
},
update: func() {
2018-04-19 21:36:36 +00:00
# X BLEED
2018-09-23 15:02:47 +00:00
if (pneumatic_xbleed_state.getValue() == "transit") {
2018-04-19 21:36:36 +00:00
me["BLEED-XFEED"].setColor(0.7333,0.3803,0);
me["BLEED-XFEED"].setRotation(45 * D2R);
} else {
2018-09-23 15:02:47 +00:00
if (pneumatic_xbleed_state.getValue() == "open") {
2018-04-19 21:36:36 +00:00
var xbleed_state = 1;
} else {
var xbleed_state = 0;
}
if (xbleed_state == 1) {
me["BLEED-XFEED"].setRotation(0);
} else {
me["BLEED-XFEED"].setRotation(90 * D2R);
}
2018-09-23 15:02:47 +00:00
if (xbleed_state == xbleed.getValue()) {
2018-04-19 21:36:36 +00:00
me["BLEED-XFEED"].setColor(0.0509,0.7529,0.2941);
} else {
me["BLEED-XFEED"].setColor(0.7333,0.3803,0);
}
}
# HP valve 1
2018-09-23 15:02:47 +00:00
var hp_valve_state = hp_valve1_state.getValue();
2018-04-19 21:36:36 +00:00
if (hp_valve_state == 1) {
me["BLEED-HP-Valve-1"].setRotation(90 * D2R);
} else {
me["BLEED-HP-Valve-1"].setRotation(0);
}
2018-09-23 15:02:47 +00:00
if (hp_valve_state == hp_valve1.getValue()) {
2018-04-19 21:36:36 +00:00
me["BLEED-HP-Valve-1"].setColor(0.0509,0.7529,0.2941);
} else {
me["BLEED-HP-Valve-1"].setColor(0.7333,0.3803,0);
}
# HP valve 2
2018-09-23 15:02:47 +00:00
var hp_valve_state = hp_valve2_state.getValue();
2018-04-19 21:36:36 +00:00
if (hp_valve_state == 1) {
me["BLEED-HP-Valve-2"].setRotation(90 * D2R);
} else {
me["BLEED-HP-Valve-2"].setRotation(0);
}
2018-09-23 15:02:47 +00:00
if (hp_valve_state == hp_valve2.getValue()) {
2018-04-19 21:36:36 +00:00
me["BLEED-HP-Valve-2"].setColor(0.0509,0.7529,0.2941);
} else {
me["BLEED-HP-Valve-2"].setColor(0.7333,0.3803,0);
}
# ENG BLEED valve 1
2018-09-23 15:02:47 +00:00
var eng_valve_state = eng_valve1_state.getValue();
2018-04-19 21:36:36 +00:00
if (eng_valve_state == 1) {
me["BLEED-ENG-1"].setRotation(90 * D2R);
} else {
me["BLEED-ENG-1"].setRotation(0);
}
2018-09-23 15:02:47 +00:00
if (eng_valve_state == eng_valve1.getValue()) {
2018-04-19 21:36:36 +00:00
me["BLEED-ENG-1"].setColor(0.0509,0.7529,0.2941);
} else {
me["BLEED-ENG-1"].setColor(0.7333,0.3803,0);
}
# ENG BLEED valve 2
2018-09-23 15:02:47 +00:00
var eng_valve_state = eng_valve2_state.getValue();
2018-04-19 21:36:36 +00:00
if (eng_valve_state == 1) {
me["BLEED-ENG-2"].setRotation(90 * D2R);
} else {
me["BLEED-ENG-2"].setRotation(0);
}
2018-09-23 15:02:47 +00:00
if (eng_valve_state == eng_valve2.getValue()) {
2018-04-19 21:36:36 +00:00
me["BLEED-ENG-2"].setColor(0.0509,0.7529,0.2941);
} else {
me["BLEED-ENG-2"].setColor(0.7333,0.3803,0);
}
# Precooler inlet 1
2018-09-23 15:02:47 +00:00
var precooler_psi = precooler1_psi.getValue();
2018-04-19 21:36:36 +00:00
me["BLEED-Precooler-1-Inlet-Press"].setText(sprintf("%s", math.round(precooler_psi)));
if (precooler_psi < 4 or precooler_psi > 57) {
me["BLEED-Precooler-1-Inlet-Press"].setColor(0.7333,0.3803,0);
} else {
me["BLEED-Precooler-1-Inlet-Press"].setColor(0.0509,0.7529,0.2941);
}
# Precooler inlet 2
2018-09-23 15:02:47 +00:00
var precooler_psi = precooler2_psi.getValue();
2018-04-19 21:36:36 +00:00
me["BLEED-Precooler-2-Inlet-Press"].setText(sprintf("%s", math.round(precooler_psi)));
if (precooler_psi < 4 or precooler_psi > 57) {
me["BLEED-Precooler-2-Inlet-Press"].setColor(0.7333,0.3803,0);
} else {
me["BLEED-Precooler-2-Inlet-Press"].setColor(0.0509,0.7529,0.2941);
}
# Precooler outlet 1
2018-09-23 15:02:47 +00:00
var precooler_temp = precooler1_temp.getValue();
2018-04-19 21:36:36 +00:00
me["BLEED-Precooler-1-Outlet-Temp"].setText(sprintf("%s", math.round(precooler_temp)));
2018-09-23 15:02:47 +00:00
if (precooler_temp < 150 or precooler1_ovht.getValue()) {
2018-04-19 21:36:36 +00:00
me["BLEED-Precooler-1-Outlet-Temp"].setColor(0.7333,0.3803,0);
} else {
me["BLEED-Precooler-1-Outlet-Temp"].setColor(0.0509,0.7529,0.2941);
}
# Precooler outlet 2
2018-09-23 15:02:47 +00:00
var precooler_temp = precooler2_temp.getValue();
2018-04-19 21:36:36 +00:00
me["BLEED-Precooler-2-Outlet-Temp"].setText(sprintf("%s", math.round(precooler_temp)));
2018-09-23 15:02:47 +00:00
if (precooler_temp < 150 or precooler2_ovht.getValue() == 1) {
2018-04-19 21:36:36 +00:00
me["BLEED-Precooler-2-Outlet-Temp"].setColor(0.7333,0.3803,0);
} else {
me["BLEED-Precooler-2-Outlet-Temp"].setColor(0.0509,0.7529,0.2941);
}
# GND air
2018-09-23 15:02:47 +00:00
if (gs_kt.getValue() < 1) {
2018-04-19 21:36:36 +00:00
me["BLEED-GND"].show();
} else {
me["BLEED-GND"].hide();
}
# WING ANTI ICE
2018-09-23 15:02:47 +00:00
if (switch_wing_aice.getValue() == 1) {
2018-04-19 21:36:36 +00:00
me["BLEED-Anti-Ice-Left"].show();
me["BLEED-Anti-Ice-Right"].show();
# TODO when seperated valves for left and right wing are implemented, do the following `if` and `else` clause for each wing.
2018-09-23 15:02:47 +00:00
if (deice_wing.getValue()) {
2018-04-19 21:36:36 +00:00
me["BLEED-ANTI-ICE-ARROW-LEFT"].show();
me["BLEED-ANTI-ICE-ARROW-RIGHT"].show();
2018-09-23 15:02:47 +00:00
if (total_psi.getValue() < 4 or total_psi.getValue() > 57) {
2018-04-19 21:36:36 +00:00
me["BLEED-ANTI-ICE-ARROW-LEFT"].setColor(0.7333,0.3803,0);
me["BLEED-ANTI-ICE-ARROW-RIGHT"].setColor(0.7333,0.3803,0);
} else {
me["BLEED-ANTI-ICE-ARROW-LEFT"].setColor(0.0509,0.7529,0.2941);
me["BLEED-ANTI-ICE-ARROW-RIGHT"].setColor(0.0509,0.7529,0.2941);
}
} else {
me["BLEED-ANTI-ICE-ARROW-LEFT"].hide();
me["BLEED-ANTI-ICE-ARROW-RIGHT"].hide();
}
} else {
me["BLEED-Anti-Ice-Left"].hide();
me["BLEED-Anti-Ice-Right"].hide();
}
# ENG 1 label
2018-09-23 15:02:47 +00:00
if (eng1_n2_actual.getValue() >= 59) {
2018-04-19 21:36:36 +00:00
me["BLEED-ENG-1-label"].setColor(0.8078,0.8039,0.8078);
} else {
me["BLEED-ENG-1-label"].setColor(0.7333,0.3803,0);
}
# ENG 2 label
2018-09-23 15:02:47 +00:00
if (eng2_n2_actual.getValue() >= 59) {
2018-04-19 21:36:36 +00:00
me["BLEED-ENG-2-label"].setColor(0.8078,0.8039,0.8078);
} else {
me["BLEED-ENG-2-label"].setColor(0.7333,0.3803,0);
}
# PACK 1 -----------------------------------------
2018-09-23 15:02:47 +00:00
me["BLEED-Pack-1-Out-Temp"].setText(sprintf("%s", pack1_out_temp.getValue()));
me["BLEED-Pack-1-Comp-Out-Temp"].setText(sprintf("%s", pack1_comp_out_temp.getValue()));
2018-04-19 21:36:36 +00:00
2018-09-23 15:02:47 +00:00
if (pack1_out_temp.getValue() > 90) {
2018-04-19 21:36:36 +00:00
me["BLEED-Pack-1-Out-Temp"].setColor(0.7333,0.3803,0);
} else {
me["BLEED-Pack-1-Out-Temp"].setColor(0.0509,0.7529,0.2941);
}
2018-09-23 15:02:47 +00:00
var bypass_pos = pack1_bypass.getValue() - 50; # `-50` cause the middel position from where we move the needel is at 50
2018-04-19 21:36:36 +00:00
bypass_pos = bypass_pos * D2R;
me["BLEED-Pack-1-Bypass-needel"].setRotation(bypass_pos);
2018-09-23 15:02:47 +00:00
if (pack1_comp_out_temp.getValue() > 230) {
2018-04-19 21:36:36 +00:00
me["BLEED-Pack-1-Comp-Out-Temp"].setColor(0.7333,0.3803,0);
} else {
me["BLEED-Pack-1-Comp-Out-Temp"].setColor(0.0509,0.7529,0.2941);
}
2018-09-23 15:02:47 +00:00
var flow_pos = pack1_flow.getValue() - 50; # `-50` cause the middel position from where we move the needel is at 50
2018-04-19 21:36:36 +00:00
flow_pos = flow_pos * D2R;
me["BLEED-Pack-1-Packflow-needel"].setRotation(flow_pos);
2018-09-23 15:02:47 +00:00
if (pack1_valve.getValue() == 0) {
2018-04-19 21:36:36 +00:00
me["BLEED-Pack-1-Packflow-needel"].setColor(0.7333,0.3803,0);
} else {
me["BLEED-Pack-1-Packflow-needel"].setColor(0.0509,0.7529,0.2941);
}
2018-09-23 15:02:47 +00:00
if (pack1_valve.getValue() == 1) {
2018-04-19 21:36:36 +00:00
me["BLEED-Pack-1-Flow-Valve"].setRotation(0);
} else {
me["BLEED-Pack-1-Flow-Valve"].setRotation(90 * D2R);
}
2018-09-23 15:02:47 +00:00
var pack_state = pack1_valve.getValue();
2018-04-19 21:36:36 +00:00
if (pack_state == 1) {
me["BLEED-Pack-1-Flow-Valve"].setRotation(0);
} else {
me["BLEED-Pack-2-Flow-Valve"].setRotation(90 * D2R);
}
2018-09-23 15:02:47 +00:00
if (pack_state == switch_pack1.getValue()) {
2018-04-19 21:36:36 +00:00
me["BLEED-Pack-1-Flow-Valve"].setColor(0.0509,0.7529,0.2941);
} else {
me["BLEED-Pack-1-Flow-Valve"].setColor(0.7333,0.3803,0);
}
# PACK 2 -----------------------------------------
2018-09-23 15:02:47 +00:00
me["BLEED-Pack-2-Out-Temp"].setText(sprintf("%s", pack2_out_temp.getValue()));
me["BLEED-Pack-2-Comp-Out-Temp"].setText(sprintf("%s", pack2_comp_out_temp.getValue()));
2018-04-19 21:36:36 +00:00
2018-09-23 15:02:47 +00:00
if (pack2_out_temp.getValue() > 90) {
2018-04-19 21:36:36 +00:00
me["BLEED-Pack-2-Out-Temp"].setColor(0.7333,0.3803,0);
} else {
me["BLEED-Pack-2-Out-Temp"].setColor(0.0509,0.7529,0.2941);
}
2018-09-23 15:02:47 +00:00
var bypass_pos = pack2_bypass.getValue() - 50; # `-50` cause the middel position from where we move the needel is at 50
2018-04-19 21:36:36 +00:00
bypass_pos = bypass_pos * D2R;
me["BLEED-Pack-2-Bypass-needel"].setRotation(bypass_pos);
2018-09-23 15:02:47 +00:00
if (pack2_comp_out_temp.getValue() > 230) {
2018-04-19 21:36:36 +00:00
me["BLEED-Pack-2-Comp-Out-Temp"].setColor(0.7333,0.3803,0);
} else {
me["BLEED-Pack-2-Comp-Out-Temp"].setColor(0.0509,0.7529,0.2941);
}
2018-09-23 15:02:47 +00:00
var flow_pos = pack2_flow.getValue() - 50; # `-50` cause the middel position from where we move the needel is at 50
2018-04-19 21:36:36 +00:00
flow_pos = flow_pos * D2R;
me["BLEED-Pack-2-Packflow-needel"].setRotation(flow_pos);
2018-09-23 15:02:47 +00:00
if (pack2_valve.getValue() == 0) {
2018-04-19 21:36:36 +00:00
me["BLEED-Pack-2-Packflow-needel"].setColor(0.7333,0.3803,0);
} else {
me["BLEED-Pack-2-Packflow-needel"].setColor(0.0509,0.7529,0.2941);
}
2018-09-23 15:02:47 +00:00
var pack_state = pack2_valve.getValue();
2018-04-19 21:36:36 +00:00
if (pack_state == 1) {
me["BLEED-Pack-2-Flow-Valve"].setRotation(0);
} else {
me["BLEED-Pack-2-Flow-Valve"].setRotation(90 * D2R);
}
2018-09-23 15:02:47 +00:00
if (pack_state == switch_pack2.getValue()) {
2018-04-19 21:36:36 +00:00
me["BLEED-Pack-2-Flow-Valve"].setColor(0.0509,0.7529,0.2941);
} else {
me["BLEED-Pack-2-Flow-Valve"].setColor(0.7333,0.3803,0);
}
2018-04-12 16:54:25 +00:00
me.updateBottomStatus();
},
};
var canvas_lowerECAM_cond = {
new: func(canvas_group, file) {
var m = {parents: [canvas_lowerECAM_cond, canvas_lowerECAM_base]};
m.init(canvas_group, file);
2018-09-13 17:40:17 +00:00
2018-04-12 16:54:25 +00:00
return m;
},
getKeys: func() {
return ["TAT","SAT","GW","UTCh","UTCm"];
},
update: func() {
2018-09-13 17:40:17 +00:00
me.updateBottomStatus();
},
};
var canvas_lowerECAM_crz = {
new: func(canvas_group, file) {
var m = {parents: [canvas_lowerECAM_crz, canvas_lowerECAM_base]};
m.init(canvas_group, file);
return m;
},
getKeys: func() {
2018-09-20 14:13:10 +00:00
return ["TAT","SAT","GW","UTCh","UTCm","Oil1","Oil2","FUsed1","FUsed2","FUsed","VIB1N1","VIB1N2","VIB2N1","VIB2N2","deltaPSI","LDGELEV-AUTO","LDGELEV","CABVS","CABALT","VS-Arrow-UP","VS-Arrow-DN","CKPT-TEMP","FWD-TEMP","AFT-TEMP"];
2018-09-20 18:16:17 +00:00
},
update: func() {
2018-09-20 14:13:10 +00:00
2018-09-29 10:51:58 +00:00
me["Oil1"].setText(sprintf("%2.1f", oil_qt1_actual.getValue()));
me["Oil2"].setText(sprintf("%2.1f", oil_qt2_actual.getValue()));
2018-09-13 17:40:17 +00:00
2018-04-12 16:54:25 +00:00
me.updateBottomStatus();
},
};
2017-11-15 01:18:08 +00:00
var canvas_lowerECAM_door = {
new: func(canvas_group, file) {
var m = {parents: [canvas_lowerECAM_door, canvas_lowerECAM_base]};
m.init(canvas_group, file);
return m;
},
getKeys: func() {
2018-04-05 21:21:48 +00:00
return["TAT","SAT","GW","UTCh","UTCm","Bulk","BulkLine","BulkLbl","Exit1L","Exit1R","Cabin1Left","Cabin1LeftLbl","Cabin1LeftLine","Cabin1LeftSlide","Cabin1Right","Cabin1RightLbl","Cabin1RightLine","Cabin1RightSlide","Cabin2Left","Cabin2LeftLbl",
"Cabin2LeftLine","Cabin2LeftSlide","Cabin2Right","Cabin2RightLbl","Cabin2RightLine","Cabin2RightSlide","Cabin3Left","Cabin3LeftLbl","Cabin3LeftLine","Cabin3LeftSlide","Cabin3Right","Cabin3RightLbl","Cabin3RightLine","Cabin3RightSlide","AvionicsLine1",
"AvionicsLbl1","AvionicsLine2","AvionicsLbl2","Cargo1Line","Cargo1Lbl","Cargo1Door","Cargo2Line","Cargo2Lbl","Cargo2Door","ExitLSlide","ExitLLine","ExitLLbl","ExitRSlide","ExitRLine","ExitRLbl","Cabin4Left","Cabin4LeftLbl","Cabin4LeftLine",
2018-04-12 16:54:25 +00:00
"Cabin4LeftSlide","Cabin4Right","Cabin4RightLbl","Cabin4RightLine","Cabin4RightSlide","DOOROXY-REGUL-LO-PR"];
2017-11-15 01:18:08 +00:00
},
update: func() {
# If you make AirBerlin or Allegiant livery add below
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (doorL1_pos.getValue() > 0) {
2017-11-15 01:18:08 +00:00
me["Cabin1Left"].show();
me["Cabin1Left"].setColor(0.7333,0.3803,0);
me["Cabin1Left"].setColorFill(0.7333,0.3803,0);
me["Cabin1LeftLbl"].show();
me["Cabin1LeftLine"].show();
} else {
me["Cabin1Left"].setColor(0.0509,0.7529,0.2941);
me["Cabin1Left"].setColorFill(0,0,0);
me["Cabin1LeftLbl"].hide();
me["Cabin1LeftLine"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (doorR1_pos.getValue() > 0) {
2017-11-15 01:18:08 +00:00
me["Cabin1Right"].show();
me["Cabin1Right"].setColor(0.7333,0.3803,0);
me["Cabin1Right"].setColorFill(0.7333,0.3803,0);
me["Cabin1RightLbl"].show();
me["Cabin1RightLine"].show();
} else {
me["Cabin1Right"].setColor(0.0509,0.7529,0.2941);
me["Cabin1Right"].setColorFill(0,0,0);
me["Cabin1RightLbl"].hide();
me["Cabin1RightLine"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (doorL4_pos.getValue() > 0) {
2017-11-15 01:18:08 +00:00
me["Cabin4Left"].show();
me["Cabin4Left"].setColor(0.7333,0.3803,0);
me["Cabin4Left"].setColorFill(0.7333,0.3803,0);
me["Cabin4LeftLbl"].show();
me["Cabin4LeftLine"].show();
} else {
me["Cabin4Left"].setColor(0.0509,0.7529,0.2941);
me["Cabin4Left"].setColorFill(0,0,0);
me["Cabin4LeftLbl"].hide();
me["Cabin4LeftLine"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (doorR4_pos.getValue() > 0) {
2017-11-15 01:18:08 +00:00
me["Cabin4Right"].show();
me["Cabin4Right"].setColor(0.7333,0.3803,0);
me["Cabin4Right"].setColorFill(0.7333,0.3803,0);
me["Cabin4RightLbl"].show();
me["Cabin4RightLine"].show();
} else {
me["Cabin4Right"].setColor(0.0509,0.7529,0.2941);
me["Cabin4Right"].setColorFill(0,0,0);
me["Cabin4RightLbl"].hide();
me["Cabin4RightLine"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (cargobulk_pos.getValue() > 0) {
2017-11-15 01:18:08 +00:00
me["Bulk"].setColor(0.7333,0.3803,0);
me["Bulk"].setColorFill(0.7333,0.3803,0);
me["BulkLbl"].show();
me["BulkLine"].show();
} else {
me["Bulk"].setColor(0.0509,0.7529,0.2941);
me["Bulk"].setColorFill(0,0,0);
me["BulkLbl"].hide();
me["BulkLine"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (cargofwd_pos.getValue() > 0) {
2017-11-15 01:18:08 +00:00
me["Cargo1Door"].setColor(0.7333,0.3803,0);
me["Cargo1Door"].setColorFill(0.7333,0.3803,0);
me["Cargo1Lbl"].show();
me["Cargo1Line"].show();
} else {
me["Cargo1Door"].setColor(0.0509,0.7529,0.2941);
me["Cargo1Door"].setColorFill(0,0,0);
me["Cargo1Lbl"].hide();
me["Cargo1Line"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (cargoaft_pos.getValue() > 0) {
2017-11-15 01:18:08 +00:00
me["Cargo2Door"].setColor(0.7333,0.3803,0);
me["Cargo2Door"].setColorFill(0.7333,0.3803,0);
me["Cargo2Lbl"].show();
me["Cargo2Line"].show();
} else {
me["Cargo2Door"].setColor(0.0509,0.7529,0.2941);
me["Cargo2Door"].setColorFill(0,0,0);
me["Cargo2Lbl"].hide();
me["Cargo2Line"].hide();
}
2018-09-23 23:32:14 +00:00
2017-11-15 01:18:08 +00:00
me["Cabin1LeftSlide"].hide();
me["Cabin1RightSlide"].hide();
me["Cabin2LeftSlide"].hide();
me["Cabin2RightSlide"].hide();
me["Cabin3LeftSlide"].hide();
me["Cabin3RightSlide"].hide();
me["Cabin4LeftSlide"].hide();
me["Cabin4RightSlide"].hide();
2018-09-23 23:32:14 +00:00
2018-04-12 16:54:25 +00:00
me["DOOROXY-REGUL-LO-PR"].hide();
2017-11-15 01:18:08 +00:00
me["AvionicsLine1"].hide();
me["AvionicsLine2"].hide();
me["AvionicsLbl1"].hide();
me["AvionicsLbl2"].hide();
me["ExitLSlide"].hide();
2018-09-23 23:32:14 +00:00
me["ExitLLine"].hide();
2017-11-15 01:18:08 +00:00
me["ExitLLbl"].hide();
me["ExitRSlide"].hide();
me["ExitRLine"].hide();
me["ExitRLbl"].hide();
me["Cabin1LeftSlide"].hide();
me["Cabin1RightSlide"].hide();
me["Cabin4LeftSlide"].hide();
me["Cabin4RightSlide"].hide();
2017-11-15 15:16:03 +00:00
me["Cabin2Left"].hide();
me["Cabin2LeftLine"].hide();
me["Cabin2LeftLbl"].hide();
me["Cabin2Right"].hide();
me["Cabin2RightLine"].hide();
me["Cabin2RightLbl"].hide();
me["Cabin3Left"].hide();
me["Cabin3LeftLine"].hide();
me["Cabin3LeftLbl"].hide();
me["Cabin3Right"].hide();
me["Cabin3RightLine"].hide();
me["Cabin3RightLbl"].hide();
2018-09-23 23:32:14 +00:00
2018-04-12 16:54:25 +00:00
me.updateBottomStatus();
},
};
var canvas_lowerECAM_elec = {
new: func(canvas_group, file) {
var m = {parents: [canvas_lowerECAM_elec, canvas_lowerECAM_base]};
m.init(canvas_group, file);
return m;
},
getKeys: func() {
2018-04-12 23:31:34 +00:00
return ["TAT","SAT","GW","UTCh","UTCm","BAT1-label","Bat1Volt","Bat1Ampere","BAT2-label","Bat2Volt","Bat2Ampere","BAT1-charge","BAT1-discharge","BAT2-charge","BAT2-discharge","ELEC-Line-DC1-DCBAT","ELEC-Line-DC1-DCESS","ELEC-Line-DC2-DCBAT",
2018-08-24 16:23:59 +00:00
"ELEC-Line-DC1-DCESS_DCBAT","ELEC-Line-DC2-DCESS_DCBAT","ELEC-Line-TR1-DC1","ELEC-Line-TR2-DC2","Shed-label","ELEC-Line-ESSTR-DCESS","TR1-label","TR1Volt","TR1Ampere","TR2-label","TR2Volt","TR2Ampere","EMERGEN-group","EmergenVolt","EmergenHz",
2018-04-12 23:31:34 +00:00
"ELEC-Line-Emergen-ESSTR","EMERGEN-Label-off","EMERGEN-out","ELEC-Line-ACESS-TRESS","ELEC-Line-AC1-TR1","ELEC-Line-AC2-TR2","ELEC-Line-AC1-ACESS","ELEC-Line-AC2-ACESS","ACESS-SHED","ACESS","AC1-in","AC2-in","ELEC-Line-GEN1-AC1","ELEC-Line-GEN2-AC2",
"ELEC-Line-APU-AC1","ELEC-Line-APU-EXT","ELEC-Line-EXT-AC2","APU-out","EXT-out","EXTPWR-group","ExtVolt","ExtHz","APU-content","APU-border","APUGentext","APUGenLoad","APUGenVolt","APUGenHz","APUGEN-off","GEN1-label","Gen1Load","Gen1Volt","Gen1Hz",
"GEN2-label","Gen2Load","GEN2-off","Gen2Volt","Gen2Hz","ELEC-IDG-1-label","ELEC-IDG-1-Temp","IDG1-LOPR","IDG1-DISC","IDG1-RISE-Value","IDG1-RISE-label","GalleyShed","ELEC-IDG-2-Temp","ELEC-IDG-2-label","IDG2-RISE-label","IDG2-RISE-Value","IDG2-LOPR",
"IDG2-DISC","ESSTR-group","ESSTR-Volt","ESSTR-Ampere","BAT1-content","BAT2-content","BAT1-OFF","BAT2-OFF","GEN1-content","GEN2-content","GEN-1-num-label","GEN-2-num-label","GEN1-off","GEN2-off","GEN1-num-label","GEN2-num-label","EXTPWR-label",
2018-08-24 16:23:59 +00:00
"ELEC-ACESS-SHED-label","ELEC-DCBAT-label","ELEC-DCESS-label","ELEC-DC2-label","ELEC-DC1-label","ELEC-AC1-label","ELEC-AC2-label","ELEC-ACESS-label","ELEC-Line-ESSTR-DCESS-off","ELEC-Line-Emergen-ESSTR-off"];
2018-04-12 16:54:25 +00:00
},
update: func() {
# BAT1
2018-09-23 15:02:47 +00:00
if (switch_bat1.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["BAT1-OFF"].show();
me["BAT1-content"].hide();
me["BAT1-discharge"].hide();
me["BAT1-charge"].hide();
} else {
me["BAT1-OFF"].hide();
me["BAT1-content"].show();
2018-09-23 15:02:47 +00:00
me["Bat1Ampere"].setText(sprintf("%s", math.round(bat1_amps.getValue())));
me["Bat1Volt"].setText(sprintf("%s", math.round(bat1_volts.getValue())));
2018-04-12 16:54:25 +00:00
2018-09-23 15:02:47 +00:00
if (bat1_volts.getValue() >= 25) {
2018-04-12 16:54:25 +00:00
me["Bat1Volt"].setColor(0.0509,0.7529,0.2941);
} else {
me["Bat1Volt"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (bat1_amps.getValue() > 5) {
2018-04-12 16:54:25 +00:00
me["Bat1Ampere"].setColor(0.7333,0.3803,0);
} else {
me["Bat1Ampere"].setColor(0.0509,0.7529,0.2941);
}
# TODO add correct charge/dischare behaviour
# this is only temporary
me["BAT1-discharge"].hide();
me["BAT1-charge"].hide();
}
2018-09-23 15:02:47 +00:00
if (bat1_fault.getValue() == 1 or bat1_volts.getValue() < 25 or bat1_amps.getValue() > 5) {
2018-04-12 16:54:25 +00:00
me["BAT1-label"].setColor(0.7333,0.3803,0);
} else {
me["BAT1-label"].setColor(0.8078,0.8039,0.8078);
}
# BAT2
2018-09-23 15:02:47 +00:00
if (switch_bat2.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["BAT2-OFF"].show();
me["BAT2-content"].hide();
me["BAT2-discharge"].hide();
me["BAT2-charge"].hide();
} else {
me["BAT2-OFF"].hide();
me["BAT2-content"].show();
2018-09-23 15:02:47 +00:00
me["Bat2Ampere"].setText(sprintf("%s", math.round(bat2_amps.getValue())));
me["Bat2Volt"].setText(sprintf("%s", math.round(bat2_volts.getValue())));
2018-04-12 16:54:25 +00:00
2018-09-23 15:02:47 +00:00
if (bat2_volts.getValue() >= 25) {
2018-04-12 16:54:25 +00:00
me["Bat2Volt"].setColor(0.0509,0.7529,0.2941);
} else {
me["Bat2Volt"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (bat2_amps.getValue() > 5) {
2018-04-12 16:54:25 +00:00
me["Bat2Ampere"].setColor(0.7333,0.3803,0);
} else {
me["Bat2Ampere"].setColor(0.0509,0.7529,0.2941);
}
# TODO add correct charge/dischare behaviour
# this is only temporary
me["BAT2-discharge"].hide();
me["BAT2-charge"].hide();
}
2018-09-23 15:02:47 +00:00
if (bat2_fault.getValue() == 1 or bat2_volts.getValue() < 25 or bat2_amps.getValue() > 5) {
2018-04-12 16:54:25 +00:00
me["BAT2-label"].setColor(0.7333,0.3803,0);
} else {
me["BAT2-label"].setColor(0.8078,0.8039,0.8078);
}
# TR1
# is only powered when ac1 has power
2018-09-23 15:02:47 +00:00
tr1_v = tr1_volts.getValue();
2018-09-24 10:41:09 +00:00
tr1_a = tr1_amps.getValue();
2018-04-12 16:54:25 +00:00
me["TR1Volt"].setText(sprintf("%s", math.round(tr1_v)));
me["TR1Ampere"].setText(sprintf("%s", math.round(tr1_a)));
if (tr1_v < 25 or tr1_v > 31 or tr1_a <= 5) {
me["TR1-label"].setColor(0.7333,0.3803,0);
} else {
me["TR1-label"].setColor(0.8078,0.8039,0.8078);
}
if (tr1_v < 25 or tr1_v > 31) {
me["TR1Volt"].setColor(0.7333,0.3803,0);
} else {
me["TR1Volt"].setColor(0.0509,0.7529,0.2941);
}
if (tr1_a <= 5) {
me["TR1Ampere"].setColor(0.7333,0.3803,0);
} else {
me["TR1Ampere"].setColor(0.0509,0.7529,0.2941);
}
# TR2
# is only powered when ac2 has power
2018-09-23 15:02:47 +00:00
tr2_v = tr2_volts.getValue();
tr2_a = tr2_amps.getValue();
2018-04-12 16:54:25 +00:00
me["TR2Volt"].setText(sprintf("%s", math.round(tr2_v)));
me["TR2Ampere"].setText(sprintf("%s", math.round(tr2_a)));
if (tr2_v < 25 or tr2_v > 31 or tr2_a <= 5) {
me["TR2-label"].setColor(0.7333,0.3803,0);
} else {
me["TR2-label"].setColor(0.8078,0.8039,0.8078);
}
if (tr2_v < 25 or tr2_v > 31) {
me["TR2Volt"].setColor(0.7333,0.3803,0);
} else {
me["TR2Volt"].setColor(0.0509,0.7529,0.2941);
}
if (tr2_a <= 5) {
me["TR2Ampere"].setColor(0.7333,0.3803,0);
} else {
me["TR2Ampere"].setColor(0.0509,0.7529,0.2941);
}
# ESS TR
# TODO add amber title on under A.
# TODO add correct A
2018-09-23 15:02:47 +00:00
if (dc1.getValue() < 25) {
2018-04-12 16:54:25 +00:00
me["ESSTR-group"].show();
2018-09-23 15:02:47 +00:00
me["ESSTR-Volt"].setText(sprintf("%s", math.round(dc_essgetValue())));
2018-04-12 16:54:25 +00:00
2018-09-23 15:02:47 +00:00
if (dc_ess.getValue() < 25 or dc_ess.getValue() > 31) {
2018-04-12 16:54:25 +00:00
me["ESSTR-Volt"].setColor(0.7333,0.3803,0);
} else {
me["ESSTR-Volt"].setColor(0.0509,0.7529,0.2941);
}
} else {
me["ESSTR-group"].hide();
}
# EMER GEN
# TODO add values and amber on over/under load
# TODO changes the prop to the one which indicates the use of the emergen and not of the man depoly
2018-09-23 15:02:47 +00:00
if (switch_emer_gen.getValue() == 0) {
2018-08-24 16:23:59 +00:00
me["EMERGEN-group"].hide();
me["ELEC-Line-Emergen-ESSTR"].hide();
2018-09-28 21:00:56 +00:00
me["ELEC-Line-Emergen-ESSTR-off"].show();
2018-04-12 16:54:25 +00:00
me["EMERGEN-Label-off"].show();
} else {
2018-08-24 16:23:59 +00:00
me["EMERGEN-group"].show();
me["ELEC-Line-Emergen-ESSTR"].show();
2018-09-28 21:00:56 +00:00
me["ELEC-Line-Emergen-ESSTR-off"].hide();
2018-04-12 16:54:25 +00:00
me["EMERGEN-Label-off"].hide();
}
# GEN1
2018-09-23 15:02:47 +00:00
if (switch_gen1.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["GEN1-content"].hide();
me["GEN1-off"].show();
me["GEN1-label"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (eng1_running.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["GEN1-num-label"].setColor(0.7333,0.3803,0);
} else {
me["GEN1-num-label"].setColor(0.8078,0.8039,0.8078);
}
} else {
me["GEN1-content"].show();
me["GEN1-off"].hide();
2018-09-23 15:02:47 +00:00
me["Gen1Load"].setText(sprintf("%s", math.round(gen1_load.getValue())));
me["Gen1Volt"].setText(sprintf("%s", math.round(gen1_volts.getValue())));
2018-04-12 16:54:25 +00:00
2018-09-23 15:02:47 +00:00
if (gen1_hz.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["Gen1Hz"].setText(sprintf("XX"));
} else {
2018-09-23 15:02:47 +00:00
me["Gen1Hz"].setText(sprintf("%s", math.round(gen1_hz.getValue())));
2018-04-12 16:54:25 +00:00
}
2018-09-23 15:02:47 +00:00
if (eng1_running.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["GEN1-num-label"].setColor(0.7333,0.3803,0);
} else {
me["GEN1-num-label"].setColor(0.8078,0.8039,0.8078);
}
2018-09-23 15:02:47 +00:00
if (gen1_volts.getValue() > 120 or gen1_volts.getValue() < 110 or gen1_hz.getValue() > 410 or gen1_hz.getValue() < 390 or gen1_load.getValue() > 100) {
2018-04-12 16:54:25 +00:00
me["GEN1-label"].setColor(0.7333,0.3803,0);
} else {
me["GEN1-label"].setColor(0.8078,0.8039,0.8078);
}
2018-09-23 15:02:47 +00:00
if (gen1_load.getValue() > 100) {
2018-04-12 16:54:25 +00:00
me["Gen1Load"].setColor(0.7333,0.3803,0);
} else {
me["Gen1Load"].setColor(0.0509,0.7529,0.2941);
}
2018-09-23 15:02:47 +00:00
if (gen1_volts.getValue() > 120 or gen1_volts.getValue() < 110) {
2018-04-12 16:54:25 +00:00
me["Gen1Volt"].setColor(0.7333,0.3803,0);
} else {
me["Gen1Volt"].setColor(0.0509,0.7529,0.2941);
}
2018-09-23 15:02:47 +00:00
if (gen1_hz.getValue() > 410 or gen1_hz.getValue() < 390) {
2018-04-12 16:54:25 +00:00
me["Gen1Hz"].setColor(0.7333,0.3803,0);
} else {
me["Gen1Hz"].setColor(0.0509,0.7529,0.2941);
}
}
# GEN2
2018-09-23 15:02:47 +00:00
if (switch_gen2.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["GEN2-content"].hide();
me["GEN2-off"].show();
me["GEN2-label"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (engr2_running.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["GEN2-num-label"].setColor(0.7333,0.3803,0);
} else {
me["GEN2-num-label"].setColor(0.8078,0.8039,0.8078);
}
} else {
me["GEN2-content"].show();
me["GEN2-off"].hide();
2018-09-23 15:02:47 +00:00
me["Gen2Load"].setText(sprintf("%s", math.round(gen2_load.getValue())));
me["Gen2Volt"].setText(sprintf("%s", math.round(gen2_volts.getValue())));
if (gen2_hz.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["Gen2Hz"].setText(sprintf("XX"));
} else {
2018-09-23 15:02:47 +00:00
me["Gen2Hz"].setText(sprintf("%s", math.round(gen2_hz.getValue())));
2018-04-12 16:54:25 +00:00
}
2018-09-23 15:02:47 +00:00
if (eng2_running.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["GEN2-num-label"].setColor(0.7333,0.3803,0);
} else {
me["GEN2-num-label"].setColor(0.8078,0.8039,0.8078);
}
2018-09-23 15:02:47 +00:00
if (gen2_volts.getValue() > 120 or gen2_volts.getValue() < 110 or gen2_hz.getValue() > 410 or gen2_hz.getValue() < 390 or gen2_load.getValue() > 100) {
2018-04-12 16:54:25 +00:00
me["GEN2-label"].setColor(0.7333,0.3803,0);
} else {
me["GEN2-label"].setColor(0.8078,0.8039,0.8078);
}
2018-09-23 15:02:47 +00:00
if (gen1_load.getValue() > 100) {
2018-04-12 16:54:25 +00:00
me["Gen1Load"].setColor(0.7333,0.3803,0);
} else {
me["Gen1Load"].setColor(0.0509,0.7529,0.2941);
}
2018-09-23 15:02:47 +00:00
if (gen2_volts.getValue() > 120 or gen2_volts.getValue() < 110) {
2018-04-12 16:54:25 +00:00
me["Gen2Volt"].setColor(0.7333,0.3803,0);
} else {
me["Gen2Volt"].setColor(0.0509,0.7529,0.2941);
}
2018-09-23 15:02:47 +00:00
if (gen2_hz.getValue() > 410 or gen2_hz.getValue() < 390) {
2018-04-12 16:54:25 +00:00
me["Gen2Hz"].setColor(0.7333,0.3803,0);
} else {
me["Gen2Hz"].setColor(0.0509,0.7529,0.2941);
}
}
# APU
2018-09-23 15:02:47 +00:00
if (apu_master.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["APU-content"].hide();
me["APUGEN-off"].hide();
me["APU-border"].hide();
me["APUGentext"].setColor(0.8078,0.8039,0.8078);
} else {
me["APU-border"].show();
2018-09-23 15:02:47 +00:00
if (gen_apu.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["APU-content"].hide();
me["APUGEN-off"].show();
me["APUGentext"].setColor(0.7333,0.3803,0);
} else {
me["APU-content"].show();
me["APUGEN-off"].hide();
2018-09-23 15:02:47 +00:00
me["APUGenLoad"].setText(sprintf("%s", math.round(apu_load.getValue())));
me["APUGenVolt"].setText(sprintf("%s", math.round(apu_volts.getValue())));
2018-04-12 16:54:25 +00:00
2018-09-23 15:02:47 +00:00
if (apu_hz.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["APUGenHz"].setText(sprintf("XX"));
} else {
2018-09-23 15:02:47 +00:00
me["APUGenHz"].setText(sprintf("%s", math.round(apu_hz.getValue())));
2018-04-12 16:54:25 +00:00
}
2018-09-23 15:02:47 +00:00
if (apu_volts.getValue() > 120 or apu_volts.getValue() < 110 or apu_hz.getValue() > 410 or apu_hz.getValue() < 390 or apu_load.getValue() > 100) {
2018-04-12 16:54:25 +00:00
me["APUGentext"].setColor(0.7333,0.3803,0);
} else {
me["APUGentext"].setColor(0.8078,0.8039,0.8078);
}
2018-09-23 15:02:47 +00:00
if(apu_load.getValue() > 100) {
2018-04-12 16:54:25 +00:00
me["APUGenLoad"].setColor(0.7333,0.3803,0);
} else {
me["APUGenLoad"].setColor(0.0509,0.7529,0.2941);
}
2018-09-23 15:02:47 +00:00
if (apu_volts.getValue() > 120 or apu_volts.getValue() < 110) {
2018-04-12 16:54:25 +00:00
me["APUGenVolt"].setColor(0.7333,0.3803,0);
} else {
me["APUGenVolt"].setColor(0.0509,0.7529,0.2941);
}
2018-09-23 15:02:47 +00:00
if (apu_hz.getValue() > 410 or apu_hz.getValue() < 390) {
2018-04-12 16:54:25 +00:00
me["APUGenHz"].setColor(0.7333,0.3803,0);
} else {
me["APUGenHz"].setColor(0.0509,0.7529,0.2941);
}
}
}
# EXT PWR
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (switch_cart.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["EXTPWR-group"].hide();
} else {
me["EXTPWR-group"].show();
2018-09-23 15:02:47 +00:00
me["ExtVolt"].setText(sprintf("%s", math.round(ext_volts.getValue())));
me["ExtHz"].setText(sprintf("%s", math.round(ext_hz.getValue())));
2018-04-12 16:54:25 +00:00
2018-09-23 15:02:47 +00:00
if (ext_hz.getValue() > 410 or ext_hz.getValue() < 390 or ext_volts.getValue() > 120 or ext_volts.getValue() < 110) {
2018-04-12 16:54:25 +00:00
me["EXTPWR-label"].setColor(0.7333,0.3803,0);
} else {
me["EXTPWR-label"].setColor(0.0509,0.7529,0.2941);
}
2018-09-23 15:02:47 +00:00
if (ext_hz.getValue() > 410 or ext_hz.getValue() < 390) {
2018-04-12 16:54:25 +00:00
me["ExtHz"].setColor(0.7333,0.3803,0);
} else {
me["ExtHz"].setColor(0.0509,0.7529,0.2941);
}
2018-09-23 15:02:47 +00:00
if (ext_volts.getValue() > 120 or ext_volts.getValue() < 110) {
2018-04-12 16:54:25 +00:00
me["ExtVolt"].setColor(0.7333,0.3803,0);
} else {
me["ExtVolt"].setColor(0.0509,0.7529,0.2941);
}
}
# TODO add IDG warnings and rise part
2018-09-23 15:02:47 +00:00
if (galleyshed.getValue() == 1 or (switch_galley.getValue() == 0)) {
2018-04-12 16:54:25 +00:00
me["GalleyShed"].show();
} else {
me["GalleyShed"].hide();
}
# Bus indicators
2018-09-23 15:02:47 +00:00
if (dcbat.getValue() > 25) {
2018-04-12 16:54:25 +00:00
me["ELEC-DCBAT-label"].setColor(0.0509,0.7529,0.2941);
} else {
me["ELEC-DCBAT-label"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (dc1.getValue() > 25) {
2018-04-12 16:54:25 +00:00
me["ELEC-DC1-label"].setColor(0.0509,0.7529,0.2941);
} else {
me["ELEC-DC1-label"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (dc2.getValue() > 25) {
2018-04-12 16:54:25 +00:00
me["ELEC-DC2-label"].setColor(0.0509,0.7529,0.2941);
} else {
me["ELEC-DC2-label"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (dc_ess.getValue() > 25) {
2018-04-12 16:54:25 +00:00
me["ELEC-DCESS-label"].setColor(0.0509,0.7529,0.2941);
} else {
me["ELEC-DCESS-label"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (ac_ess.getValue() > 110) {
2018-04-12 16:54:25 +00:00
me["ELEC-ACESS-label"].setColor(0.0509,0.7529,0.2941);
} else {
me["ELEC-ACESS-label"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (ac_ess.getValue() > 110) {
2018-04-12 16:54:25 +00:00
me["ACESS-SHED"].hide();
} else {
me["ACESS-SHED"].show();
}
2018-09-23 15:02:47 +00:00
if (ac1.getValue() > 110) {
2018-04-12 16:54:25 +00:00
me["ELEC-AC1-label"].setColor(0.0509,0.7529,0.2941);
} else {
me["ELEC-AC1-label"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (ac2.getValue() > 110) {
2018-04-12 16:54:25 +00:00
me["ELEC-AC2-label"].setColor(0.0509,0.7529,0.2941);
} else {
me["ELEC-AC2-label"].setColor(0.7333,0.3803,0);
}
# Managment of the connecting lines between the components
2018-09-23 15:02:47 +00:00
if (ac1_src.getValue() == "APU" or ac2_src.getValue() == "APU") {
2018-04-12 16:54:25 +00:00
me["APU-out"].show();
} else {
me["APU-out"].hide();
}
2018-09-23 15:02:47 +00:00
if (ac1_src.getValue() == "EXT" or ac2_src.getValue() == "EXT") {
2018-04-12 16:54:25 +00:00
me["EXT-out"].show();
} else {
me["EXT-out"].hide();
}
2018-09-23 15:02:47 +00:00
if (gen1_volts.getValue() >= 110) {
2018-04-12 16:54:25 +00:00
me["ELEC-Line-GEN1-AC1"].show();
} else {
me["ELEC-Line-GEN1-AC1"].hide();
}
2018-09-23 15:02:47 +00:00
if (gen2_volts.getValue() >= 110) {
2018-04-12 16:54:25 +00:00
me["ELEC-Line-GEN2-AC2"].show();
} else {
me["ELEC-Line-GEN2-AC2"].hide();
}
2018-09-23 15:02:47 +00:00
if (ac1.getValue() >= 110) {
2018-04-12 16:54:25 +00:00
me["AC1-in"].show();
} else {
2018-09-23 22:51:59 +00:00
me["AC1-in"].hide();
2018-04-12 16:54:25 +00:00
}
2018-09-23 15:02:47 +00:00
if (ac2.getValue() >= 110) {
2018-04-12 16:54:25 +00:00
me["AC2-in"].show();
} else {
2018-09-23 22:51:59 +00:00
me["AC2-in"].hide();
2018-04-12 16:54:25 +00:00
}
2018-09-23 15:02:47 +00:00
if (ac1_src.getValue() == "APU" or ac1_src.getValue() == "EXT" or ac1_src.getValue() == "XTIE" or ac2_src.getValue() == "XTIE") {
2018-04-12 16:54:25 +00:00
me["ELEC-Line-APU-AC1"].show();
} else {
me["ELEC-Line-APU-AC1"].hide();
}
2018-09-23 15:02:47 +00:00
if (ac1_src.getValue() == "EXT" or ac2_src.getValue() == "APU" or ac1_src.getValue() == "XTIE" or ac2_src.getValue() == "XTIE") {
2018-04-12 16:54:25 +00:00
me["ELEC-Line-APU-EXT"].show();
} else {
me["ELEC-Line-APU-EXT"].hide();
}
2018-09-23 15:02:47 +00:00
if (ac2_src.getValue() == "APU" or ac2_src.getValue() == "EXT" or ac1_src.getValue() == "XTIE" or ac2_src.getValue() == "XTIE") {
2018-04-12 16:54:25 +00:00
me["ELEC-Line-EXT-AC2"].show();
} else {
me["ELEC-Line-EXT-AC2"].hide();
}
2018-09-23 15:02:47 +00:00
if (switch_ac_ess_feed.getValue() == 1) {
2018-04-12 16:54:25 +00:00
me["ELEC-Line-AC1-ACESS"].hide();
me["ELEC-Line-AC2-ACESS"].show();
} else {
me["ELEC-Line-AC1-ACESS"].show();
me["ELEC-Line-AC2-ACESS"].hide();
}
2018-09-23 15:02:47 +00:00
if (tr1_fault.getValue() != 1) {
if (ac1.getValue() < 110) {
2018-04-12 16:54:25 +00:00
me["ELEC-Line-AC1-TR1"].setColorFill(0.7333,0.3803,0);
} else {
me["ELEC-Line-AC1-TR1"].setColorFill(0.0509,0.7529,0.2941);
}
me["ELEC-Line-AC1-TR1"].show();
me["ELEC-Line-TR1-DC1"].show();
} else {
me["ELEC-Line-AC1-TR1"].hide();
me["ELEC-Line-TR1-DC1"].hide();
}
2018-09-23 15:02:47 +00:00
if (tr2_fault.getValue() != 1) {
if (ac2.getValue() < 110) {
2018-04-12 16:54:25 +00:00
me["ELEC-Line-AC2-TR2"].setColorFill(0.7333,0.3803,0);
} else {
me["ELEC-Line-AC2-TR2"].setColorFill(0.0509,0.7529,0.2941);
}
me["ELEC-Line-AC2-TR2"].show();
me["ELEC-Line-TR2-DC2"].show();
} else {
me["ELEC-Line-AC2-TR2"].hide();
me["ELEC-Line-TR2-DC2"].hide();
}
2018-09-23 15:02:47 +00:00
if (ac1.getValue() < 110) {
2018-04-12 16:54:25 +00:00
me["ELEC-Line-DC1-DCESS"].hide();
} else {
me["ELEC-Line-DC1-DCESS"].show();
}
2018-09-23 15:02:47 +00:00
if (dc1.getValue() < 25) {
2018-04-12 16:54:25 +00:00
me["ELEC-Line-DC1-DCESS_DCBAT"].hide();
me["ELEC-Line-DC1-DCBAT"].hide();
} else {
me["ELEC-Line-DC1-DCESS_DCBAT"].show();
me["ELEC-Line-DC1-DCBAT"].show();
}
2018-09-23 15:02:47 +00:00
if (dc2.getValue() < 25 or dc1.getValue() >= 25 and ac1.getValue() >= 110) {
2018-04-12 16:54:25 +00:00
me["ELEC-Line-DC2-DCESS_DCBAT"].hide();
me["ELEC-Line-DC2-DCBAT"].hide();
} else {
me["ELEC-Line-DC2-DCESS_DCBAT"].show();
me["ELEC-Line-DC2-DCBAT"].show();
}
2018-09-24 10:41:09 +00:00
if (switch_emer_gen.getValue() == 1 and (ac1.getValue() < 110 and switch_ac_ess_feed.getValue() == 0 or ac2.getValue() < 110 and switch_ac_ess_feed.getValue() == 1)) {
2018-04-12 16:54:25 +00:00
me["EMERGEN-out"].show();
} else {
me["EMERGEN-out"].hide();
}
# TODO add connections from/to ESS TR
# hide not yet implemented items
me["IDG1-LOPR"].hide();
me["IDG2-LOPR"].hide();
me["IDG1-DISC"].hide();
me["IDG2-DISC"].hide();
me["Shed-label"].hide();
2018-08-24 16:23:59 +00:00
me["ELEC-Line-ESSTR-DCESS"].hide();
2018-04-12 16:54:25 +00:00
me["ELEC-Line-ACESS-TRESS"].hide();
me["IDG2-RISE-label"].hide();
me["IDG2-RISE-Value"].hide();
me["IDG1-RISE-label"].hide();
me["IDG1-RISE-Value"].hide();
2017-11-15 01:18:08 +00:00
me.updateBottomStatus();
},
};
2017-07-29 19:35:38 +00:00
var canvas_lowerECAM_eng = {
new: func(canvas_group, file) {
2017-10-19 04:05:42 +00:00
var m = {parents: [canvas_lowerECAM_eng, canvas_lowerECAM_base]};
2017-07-29 19:35:38 +00:00
m.init(canvas_group, file);
2018-09-23 23:32:14 +00:00
2017-07-29 19:35:38 +00:00
return m;
},
getKeys: func() {
2018-04-05 21:21:48 +00:00
return ["TAT","SAT","GW","UTCh","UTCm","OilQT1-needle","OilQT2-needle","OilQT1","OilQT2","OilQT1-decimal","OilQT2-decimal","OilPSI1-needle","OilPSI2-needle","OilPSI1","OilPSI2"];
2017-07-29 19:35:38 +00:00
},
update: func() {
# Oil Quantity
2018-09-23 15:02:47 +00:00
me["OilQT1"].setText(sprintf("%s", int(oil_qt1_actual.getValue())));
me["OilQT2"].setText(sprintf("%s", int(oil_qt2_actual.getValue())));
me["OilQT1-decimal"].setText(sprintf("%s", int(10*math.mod(oil_qt1_actual.getValue(),1))));
me["OilQT2-decimal"].setText(sprintf("%s", int(10*math.mod(oil_qt2_actual.getValue(),1))));
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
me["OilQT1-needle"].setRotation((oil_qt1.getValue() + 90) * D2R);
me["OilQT2-needle"].setRotation((oil_qt2.getValue() + 90) * D2R);
2018-09-23 23:32:14 +00:00
2017-07-29 19:35:38 +00:00
# Oil Pressure
2018-09-23 15:02:47 +00:00
if (oil_psi_actual1.getValue() >= 20) {
2017-11-05 22:16:56 +00:00
me["OilPSI1"].setColor(0.0509,0.7529,0.2941);
2018-01-10 16:56:53 +00:00
me["OilPSI1-needle"].setColor(0.0509,0.7529,0.2941);
2017-07-29 19:35:38 +00:00
} else {
me["OilPSI1"].setColor(1,0,0);
2018-01-10 16:56:53 +00:00
me["OilPSI1-needle"].setColor(1,0,0);
2017-07-29 19:35:38 +00:00
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (oil_psi_actual2.getValue() >= 20) {
2017-11-05 22:16:56 +00:00
me["OilPSI2"].setColor(0.0509,0.7529,0.2941);
2018-01-10 16:56:53 +00:00
me["OilPSI2-needle"].setColor(0.0509,0.7529,0.2941);
2017-07-29 19:35:38 +00:00
} else {
me["OilPSI2"].setColor(1,0,0);
2018-01-10 16:56:53 +00:00
me["OilPSI2-needle"].setColor(1,0,0);
2017-07-29 19:35:38 +00:00
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
me["OilPSI1"].setText(sprintf("%s", math.round(oil_psi_actual1.getValue())));
me["OilPSI2"].setText(sprintf("%s", math.round(oil_psi_actual2.getValue())));
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
me["OilPSI1-needle"].setRotation((oil_psi1.getValue() + 90) * D2R);
me["OilPSI2-needle"].setRotation((oil_psi2.getValue() + 90) * D2R);
2018-09-23 23:32:14 +00:00
2017-07-29 19:35:38 +00:00
me.updateBottomStatus();
},
};
2017-08-01 14:02:13 +00:00
var canvas_lowerECAM_fctl = {
2017-08-03 17:11:45 +00:00
new: func(canvas_group, file) {
2017-10-19 04:05:42 +00:00
var m = {parents: [canvas_lowerECAM_fctl, canvas_lowerECAM_base]};
2017-08-03 17:11:45 +00:00
m.init(canvas_group, file);
return m;
2017-08-01 14:02:13 +00:00
},
getKeys: func() {
2018-04-05 21:21:48 +00:00
return["TAT","SAT","GW","UTCh","UTCm","ailL","ailR","elevL","elevR","PTcc","PT","PTupdn","elac1","elac2","sec1","sec2","sec3","ailLblue","ailRblue","elevLblue","elevRblue","rudderblue","ailLgreen","ailRgreen","elevLgreen","ruddergreen","PTgreen",
"elevRyellow","rudderyellow","PTyellow","rudder","spdbrkblue","spdbrkgreen","spdbrkyellow","spoiler1Rex","spoiler1Rrt","spoiler2Rex","spoiler2Rrt","spoiler3Rex","spoiler3Rrt","spoiler4Rex","spoiler4Rrt","spoiler5Rex","spoiler5Rrt","spoiler1Lex",
"spoiler1Lrt","spoiler2Lex","spoiler2Lrt","spoiler3Lex","spoiler3Lrt","spoiler4Lex","spoiler4Lrt","spoiler5Lex","spoiler5Lrt","spoiler1Rf","spoiler2Rf","spoiler3Rf","spoiler4Rf","spoiler5Rf","spoiler1Lf","spoiler2Lf","spoiler3Lf","spoiler4Lf",
"spoiler5Lf","ailLscale","ailRscale","path4249","path4249-3","path4249-3-6-7","path4249-3-6-7-5","path4249-3-6"];
2017-08-01 14:02:13 +00:00
},
update: func() {
2018-09-23 15:02:47 +00:00
blue_psi = b_psi.getValue();
green_psi = g_psi.getValue();
yellow_psi = y_psi.getValue();
2018-09-23 23:32:14 +00:00
2017-08-03 17:11:45 +00:00
# Pitch Trim
2018-09-23 15:02:47 +00:00
me["PT"].setText(sprintf("%2.1f", math.round(elevator_trim_deg.getValue(), 0.1)));
2017-08-03 17:11:45 +00:00
2018-09-23 15:02:47 +00:00
if (math.round(elevator_trim_deg.getValue(), 0.1) >= 0) {
2017-08-01 14:02:13 +00:00
me["PTupdn"].setText(sprintf("UP"));
2018-09-23 15:02:47 +00:00
} else if (math.round(elevator_trim_deg.getValue(), 0.1) < 0) {
2017-08-01 14:02:13 +00:00
me["PTupdn"].setText(sprintf("DN"));
}
2017-08-03 17:11:45 +00:00
if (green_psi < 1500 and yellow_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["PT"].setColor(0.7333,0.3803,0);
me["PTupdn"].setColor(0.7333,0.3803,0);
me["PTcc"].setColor(0.7333,0.3803,0);
2017-08-03 17:11:45 +00:00
} else {
2017-11-05 22:16:56 +00:00
me["PT"].setColor(0.0509,0.7529,0.2941);
me["PTupdn"].setColor(0.0509,0.7529,0.2941);
me["PTcc"].setColor(0.0509,0.7529,0.2941);
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2017-08-03 17:11:45 +00:00
# Ailerons
2018-09-23 15:02:47 +00:00
me["ailL"].setTranslation(0, aileron_ind_left.getValue() * 100);
me["ailR"].setTranslation(0, aileron_ind_right.getValue() * (-100));
2018-09-23 23:32:14 +00:00
2017-08-03 17:11:45 +00:00
if (blue_psi < 1500 and green_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["ailL"].setColor(0.7333,0.3803,0);
me["ailR"].setColor(0.7333,0.3803,0);
2017-08-03 17:11:45 +00:00
} else {
2017-11-05 22:16:56 +00:00
me["ailL"].setColor(0.0509,0.7529,0.2941);
me["ailR"].setColor(0.0509,0.7529,0.2941);
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2017-08-03 17:11:45 +00:00
# Elevators
2018-09-23 15:02:47 +00:00
me["elevL"].setTranslation(0, elevator_ind_left.getValue() * 100);
me["elevR"].setTranslation(0, elevator_ind_right.getValue() * 100);
2017-08-03 17:11:45 +00:00
if (blue_psi < 1500 and green_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["elevL"].setColor(0.7333,0.3803,0);
2017-08-03 17:11:45 +00:00
} else {
2017-11-05 22:16:56 +00:00
me["elevL"].setColor(0.0509,0.7529,0.2941);
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2017-08-03 17:11:45 +00:00
if (blue_psi < 1500 and yellow_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["elevR"].setColor(0.7333,0.3803,0);
2017-08-03 17:11:45 +00:00
} else {
2017-11-05 22:16:56 +00:00
me["elevR"].setColor(0.0509,0.7529,0.2941);
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2017-08-03 17:11:45 +00:00
# Rudder
2018-09-23 15:02:47 +00:00
me["rudder"].setRotation(final_deg.getValue() * -0.024);
2017-08-03 17:11:45 +00:00
if (blue_psi < 1500 and yellow_psi < 1500 and green_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["rudder"].setColor(0.7333,0.3803,0);
2017-08-03 17:11:45 +00:00
} else {
2017-11-05 22:16:56 +00:00
me["rudder"].setColor(0.0509,0.7529,0.2941);
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2017-08-03 17:11:45 +00:00
# Spoilers
2018-09-23 15:02:47 +00:00
if (spoiler_L1.getValue() < 1.5) {
2017-08-01 14:02:13 +00:00
me["spoiler1Lex"].hide();
me["spoiler1Lrt"].show();
2017-08-03 17:11:45 +00:00
} else {
2017-08-01 14:02:13 +00:00
me["spoiler1Lrt"].hide();
me["spoiler1Lex"].show();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L2.getValue() < 1.5) {
2017-08-01 14:02:13 +00:00
me["spoiler2Lex"].hide();
me["spoiler2Lrt"].show();
2017-08-03 17:11:45 +00:00
} else {
2017-08-01 14:02:13 +00:00
me["spoiler2Lrt"].hide();
me["spoiler2Lex"].show();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L3.getValue() < 1.5) {
2017-08-01 14:02:13 +00:00
me["spoiler3Lex"].hide();
me["spoiler3Lrt"].show();
2017-08-03 17:11:45 +00:00
} else {
2017-08-01 14:02:13 +00:00
me["spoiler3Lrt"].hide();
me["spoiler3Lex"].show();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L4.getValue() < 1.5) {
2017-08-01 14:02:13 +00:00
me["spoiler4Lex"].hide();
me["spoiler4Lrt"].show();
2017-08-03 17:11:45 +00:00
} else {
2017-08-01 14:02:13 +00:00
me["spoiler4Lrt"].hide();
me["spoiler4Lex"].show();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L5.getValue() < 1.5) {
2017-08-01 14:02:13 +00:00
me["spoiler5Lex"].hide();
me["spoiler5Lrt"].show();
2017-08-03 17:11:45 +00:00
} else {
2017-08-01 14:02:13 +00:00
me["spoiler5Lrt"].hide();
me["spoiler5Lex"].show();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R1.getValue() < 1.5) {
2017-08-03 17:11:45 +00:00
me["spoiler1Rex"].hide();
me["spoiler1Rrt"].show();
} else {
me["spoiler1Rrt"].hide();
me["spoiler1Rex"].show();
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R2.getValue() < 1.5) {
2017-08-03 17:11:45 +00:00
me["spoiler2Rex"].hide();
me["spoiler2Rrt"].show();
} else {
me["spoiler2Rrt"].hide();
me["spoiler2Rex"].show();
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R3.getValue() < 1.5) {
2017-08-03 17:11:45 +00:00
me["spoiler3Rex"].hide();
me["spoiler3Rrt"].show();
} else {
me["spoiler3Rrt"].hide();
me["spoiler3Rex"].show();
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R4.getValue() < 1.5) {
2017-08-03 17:11:45 +00:00
me["spoiler4Rex"].hide();
me["spoiler4Rrt"].show();
} else {
me["spoiler4Rrt"].hide();
me["spoiler4Rex"].show();
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R5.getValue() < 1.5) {
2017-08-03 17:11:45 +00:00
me["spoiler5Rex"].hide();
me["spoiler5Rrt"].show();
} else {
me["spoiler5Rrt"].hide();
me["spoiler5Rex"].show();
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2017-08-03 17:11:45 +00:00
# Spoiler Fail
2018-09-23 15:02:47 +00:00
if (spoiler_L1_fail.getValue() or green_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler1Lex"].setColor(0.7333,0.3803,0);
me["spoiler1Lrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_L1.getValue() < 1.5) {
2017-08-01 14:02:13 +00:00
me["spoiler1Lf"].show();
2017-08-03 17:11:45 +00:00
} else {
2017-08-01 14:02:13 +00:00
me["spoiler1Lf"].hide();
}
2017-08-03 17:11:45 +00:00
} else {
2017-11-05 22:16:56 +00:00
me["spoiler1Lex"].setColor(0.0509,0.7529,0.2941);
me["spoiler1Lrt"].setColor(0.0509,0.7529,0.2941);
2017-08-01 14:02:13 +00:00
me["spoiler1Lf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L2_fail.getValue() or yellow_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler2Lex"].setColor(0.7333,0.3803,0);
me["spoiler2Lrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_L2.getValue() < 1.5) {
2017-08-01 14:02:13 +00:00
me["spoiler2Lf"].show();
2017-08-03 17:11:45 +00:00
} else {
2017-08-01 14:02:13 +00:00
me["spoiler2Lf"].hide();
}
2017-08-03 17:11:45 +00:00
} else {
2017-11-05 22:16:56 +00:00
me["spoiler2Lex"].setColor(0.0509,0.7529,0.2941);
me["spoiler2Lrt"].setColor(0.0509,0.7529,0.2941);
2017-08-01 14:02:13 +00:00
me["spoiler2Lf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L3_fail.getValue() or blue_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler3Lex"].setColor(0.7333,0.3803,0);
me["spoiler3Lrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_L3.getValue() < 1.5) {
2017-08-01 14:02:13 +00:00
me["spoiler3Lf"].show();
2017-08-03 17:11:45 +00:00
} else {
2017-08-01 14:02:13 +00:00
me["spoiler3Lf"].hide();
}
2017-08-03 17:11:45 +00:00
} else {
2017-11-05 22:16:56 +00:00
me["spoiler3Lex"].setColor(0.0509,0.7529,0.2941);
me["spoiler3Lrt"].setColor(0.0509,0.7529,0.2941);
2017-08-01 14:02:13 +00:00
me["spoiler3Lf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L4_fail.getValue() or yellow_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler4Lex"].setColor(0.7333,0.3803,0);
me["spoiler4Lrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_L4.getValue() < 1.5) {
2017-08-01 14:02:13 +00:00
me["spoiler4Lf"].show();
2017-08-03 17:11:45 +00:00
} else {
2017-08-01 14:02:13 +00:00
me["spoiler4Lf"].hide();
}
2017-08-03 17:11:45 +00:00
} else {
2017-11-05 22:16:56 +00:00
me["spoiler4Lex"].setColor(0.0509,0.7529,0.2941);
me["spoiler4Lrt"].setColor(0.0509,0.7529,0.2941);
2017-08-01 14:02:13 +00:00
me["spoiler4Lf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L5_fail.getValue() or green_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler5Lex"].setColor(0.7333,0.3803,0);
me["spoiler5Lrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_L5.getValue() < 1.5) {
2017-08-01 14:02:13 +00:00
me["spoiler5Lf"].show();
2017-08-03 17:11:45 +00:00
} else {
2017-08-01 14:02:13 +00:00
me["spoiler5Lf"].hide();
}
2017-08-03 17:11:45 +00:00
} else {
2017-11-05 22:16:56 +00:00
me["spoiler5Lex"].setColor(0.0509,0.7529,0.2941);
me["spoiler5Lrt"].setColor(0.0509,0.7529,0.2941);
2017-08-01 14:02:13 +00:00
me["spoiler5Lf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R1_fail.getValue() or green_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler1Rex"].setColor(0.7333,0.3803,0);
me["spoiler1Rrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_R1.getValue() < 1.5) {
2017-08-03 17:11:45 +00:00
me["spoiler1Rf"].show();
} else {
me["spoiler1Rf"].hide();
}
} else {
2017-11-05 22:16:56 +00:00
me["spoiler1Rex"].setColor(0.0509,0.7529,0.2941);
me["spoiler1Rrt"].setColor(0.0509,0.7529,0.2941);
2017-08-03 17:11:45 +00:00
me["spoiler1Rf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R2_fail.getValue() or yellow_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler2Rex"].setColor(0.7333,0.3803,0);
me["spoiler2Rrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_R2.getValue() < 1.5) {
2017-08-03 17:11:45 +00:00
me["spoiler2Rf"].show();
} else {
me["spoiler2Rf"].hide();
}
} else {
2017-11-05 22:16:56 +00:00
me["spoiler2Rex"].setColor(0.0509,0.7529,0.2941);
me["spoiler2Rrt"].setColor(0.0509,0.7529,0.2941);
2017-08-03 17:11:45 +00:00
me["spoiler2Rf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R3_fail.getValue() or blue_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler3Rex"].setColor(0.7333,0.3803,0);
me["spoiler3Rrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_R3.getValue() < 1.5) {
2017-08-03 17:11:45 +00:00
me["spoiler3Rf"].show();
} else {
me["spoiler3Rf"].hide();
}
} else {
2017-11-05 22:16:56 +00:00
me["spoiler3Rex"].setColor(0.0509,0.7529,0.2941);
me["spoiler3Rrt"].setColor(0.0509,0.7529,0.2941);
2017-08-03 17:11:45 +00:00
me["spoiler3Rf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R4_fail.getValue() or yellow_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler4Rex"].setColor(0.7333,0.3803,0);
me["spoiler4Rrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_R4.getValue() < 1.5) {
2017-08-03 17:11:45 +00:00
me["spoiler4Rf"].show();
} else {
me["spoiler4Rf"].hide();
}
} else {
2017-11-05 22:16:56 +00:00
me["spoiler4Rex"].setColor(0.0509,0.7529,0.2941);
me["spoiler4Rrt"].setColor(0.0509,0.7529,0.2941);
2017-08-03 17:11:45 +00:00
me["spoiler4Rf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R5_fail.getValue() or green_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler5Rex"].setColor(0.7333,0.3803,0);
me["spoiler5Rrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_R5.getValue() < 1.5) {
2017-08-03 17:11:45 +00:00
me["spoiler5Rf"].show();
} else {
me["spoiler5Rf"].hide();
}
} else {
2017-11-05 22:16:56 +00:00
me["spoiler5Rex"].setColor(0.0509,0.7529,0.2941);
me["spoiler5Rrt"].setColor(0.0509,0.7529,0.2941);
2017-08-03 17:11:45 +00:00
me["spoiler5Rf"].hide();
}
2018-09-23 23:32:14 +00:00
# Flight Computers
2018-09-23 15:02:47 +00:00
if (elac1.getValue()) {
2017-11-05 22:16:56 +00:00
me["elac1"].setColor(0.0509,0.7529,0.2941);
me["path4249"].setColor(0.0509,0.7529,0.2941);
2018-09-23 15:02:47 +00:00
} else if ((elac1.getValue() == 0) or (elac1_fail.getValue() == 1)) {
2017-10-18 21:39:52 +00:00
me["elac1"].setColor(0.7333,0.3803,0);
me["path4249"].setColor(0.7333,0.3803,0);
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (elac2.getValue()) {
2017-11-05 22:16:56 +00:00
me["elac2"].setColor(0.0509,0.7529,0.2941);
me["path4249-3"].setColor(0.0509,0.7529,0.2941);
2018-09-23 15:02:47 +00:00
} else if ((elac2.getValue() == 0) or (elac2_fail.getValue() == 1)) {
2017-10-18 21:39:52 +00:00
me["elac2"].setColor(0.7333,0.3803,0);
me["path4249-3"].setColor(0.7333,0.3803,0);
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (sec1.getValue()) {
2017-11-05 22:16:56 +00:00
me["sec1"].setColor(0.0509,0.7529,0.2941);
me["path4249-3-6-7"].setColor(0.0509,0.7529,0.2941);
2018-09-23 15:02:47 +00:00
} else if ((sec1.getValue() == 0) or (sec1_fail.getValue() == 1)) {
2017-10-18 21:39:52 +00:00
me["sec1"].setColor(0.7333,0.3803,0);
me["path4249-3-6-7"].setColor(0.7333,0.3803,0);
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (sec2.getValue()) {
2017-11-05 22:16:56 +00:00
me["sec2"].setColor(0.0509,0.7529,0.2941);
me["path4249-3-6-7-5"].setColor(0.0509,0.7529,0.2941);
2018-09-23 15:02:47 +00:00
} else if ((sec2.getValue() == 0) or (sec2_fail.getValue() == 1)) {
2017-10-18 21:39:52 +00:00
me["sec2"].setColor(0.7333,0.3803,0);
me["path4249-3-6-7-5"].setColor(0.7333,0.3803,0);
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (sec3.getValue()) {
2017-11-05 22:16:56 +00:00
me["sec3"].setColor(0.0509,0.7529,0.2941);
me["path4249-3-6"].setColor(0.0509,0.7529,0.2941);
2018-09-23 15:02:47 +00:00
} else if ((sec3.getValue() == 0) or (sec3_fail.getValue() == 1)) {
2017-10-18 21:39:52 +00:00
me["sec3"].setColor(0.7333,0.3803,0);
me["path4249-3-6"].setColor(0.7333,0.3803,0);
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2017-08-03 17:11:45 +00:00
# Hydraulic Indicators
2018-09-23 15:02:47 +00:00
if (blue_psi >= 1500) {
2017-11-05 22:16:56 +00:00
me["ailLblue"].setColor(0.0509,0.7529,0.2941);
me["ailRblue"].setColor(0.0509,0.7529,0.2941);
me["elevLblue"].setColor(0.0509,0.7529,0.2941);
me["elevRblue"].setColor(0.0509,0.7529,0.2941);
me["rudderblue"].setColor(0.0509,0.7529,0.2941);
me["spdbrkblue"].setColor(0.0509,0.7529,0.2941);
2017-08-03 17:11:45 +00:00
} else {
2017-10-18 21:39:52 +00:00
me["ailLblue"].setColor(0.7333,0.3803,0);
me["ailRblue"].setColor(0.7333,0.3803,0);
me["elevLblue"].setColor(0.7333,0.3803,0);
me["elevRblue"].setColor(0.7333,0.3803,0);
me["rudderblue"].setColor(0.7333,0.3803,0);
me["spdbrkblue"].setColor(0.7333,0.3803,0);
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (green_psi >= 1500) {
2017-11-05 22:16:56 +00:00
me["ailLgreen"].setColor(0.0509,0.7529,0.2941);
me["ailRgreen"].setColor(0.0509,0.7529,0.2941);
me["elevLgreen"].setColor(0.0509,0.7529,0.2941);
me["ruddergreen"].setColor(0.0509,0.7529,0.2941);
me["PTgreen"].setColor(0.0509,0.7529,0.2941);
me["spdbrkgreen"].setColor(0.0509,0.7529,0.2941);
2017-08-03 17:11:45 +00:00
} else {
2017-10-18 21:39:52 +00:00
me["ailLgreen"].setColor(0.7333,0.3803,0);
me["ailRgreen"].setColor(0.7333,0.3803,0);
me["elevLgreen"].setColor(0.7333,0.3803,0);
me["ruddergreen"].setColor(0.7333,0.3803,0);
me["PTgreen"].setColor(0.7333,0.3803,0);
me["spdbrkgreen"].setColor(0.7333,0.3803,0);
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (yellow_psi >= 1500) {
2017-11-05 22:16:56 +00:00
me["elevRyellow"].setColor(0.0509,0.7529,0.2941);
me["rudderyellow"].setColor(0.0509,0.7529,0.2941);
me["PTyellow"].setColor(0.0509,0.7529,0.2941);
me["spdbrkyellow"].setColor(0.0509,0.7529,0.2941);
2017-08-03 17:11:45 +00:00
} else {
2017-10-18 21:39:52 +00:00
me["elevRyellow"].setColor(0.7333,0.3803,0);
me["rudderyellow"].setColor(0.7333,0.3803,0);
me["PTyellow"].setColor(0.7333,0.3803,0);
me["spdbrkyellow"].setColor(0.7333,0.3803,0);
2017-08-01 14:02:13 +00:00
}
2018-09-23 23:32:14 +00:00
2017-08-01 14:02:13 +00:00
me.updateBottomStatus();
},
};
2018-04-12 16:54:25 +00:00
var canvas_lowerECAM_fuel = {
new: func(canvas_group, file) {
var m = {parents: [canvas_lowerECAM_fuel, canvas_lowerECAM_base]};
m.init(canvas_group, file);
return m;
},
getKeys: func() {
return["TAT","SAT","GW","UTCh","UTCm","FUEL-Pump-Left-1","FUEL-Pump-Left-2","FUEL-Pump-Center-1","FUEL-Pump-Center-2","FUEL-Pump-Right-1","FUEL-Pump-Right-2","FUEL-Left-blocked","FUEL-Right-blocked","FUEL-Center-blocked","FUEL-Left-Tranfser",
"FUEL-Right-Tranfse","FUEL-Left-Outer-Inacc","FUEL-Left-Inner-Inacc","FUEL-Center-Inacc","FUEL-Right-Inner-Inacc","FUEL-Right-Outer-Inacc","FUEL-Left-Outer-quantity","FUEL-Left-Inner-quantity","FUEL-Center-quantity","FUEL-Right-Inner-quantity",
"FUEL-Right-Outer-quantity","FUEL-On-Board","FUEL-Flow-per-min","FUEL-APU-arrow","FUEL-APU-label","FUEL-used-1","FUEL-used-both","FUEL-used-2","FUEL-ENG-Master-1","FUEL-ENG-Master-2","FUEL-XFEED","FUEL-XFEED-pipes","FUEL-Left-Outer-temp",
"FUEL-Left-Inner-temp","FUEL-Right-Inner-temp","FUEL-Right-Outer-temp","FUEL-Pump-Left-1-Closed","FUEL-Pump-Left-1-Open","FUEL-Pump-Left-2-Closed","FUEL-Pump-Left-2-Open","FUEL-Pump-Center-1-Open","FUEL-Pump-Center-1-Closed","FUEL-Pump-Center-2-Closed",
"FUEL-Pump-Center-2-Open","FUEL-Pump-Right-1-Closed","FUEL-Pump-Right-1-Open","FUEL-Pump-Right-2-Closed","FUEL-Pump-Right-2-Open","FUEL-ENG-1-label","FUEL-ENG-2-label","FUEL-ENG-1-pipe","FUEL-ENG-2-pipe","FUEL-Right-Tranfser","ENG1idFFlow","ENG2idFFlow"];
},
update: func() {
2018-09-23 23:32:14 +00:00
2018-04-12 16:54:25 +00:00
# if (getprop("engines/engine[0]/n1-actual") < getprop("/controls/engines/idle-limit")) {
2018-09-23 15:02:47 +00:00
if (eng1_n1.getValue() < 19.7) {
2018-04-12 16:54:25 +00:00
me["ENG1idFFlow"].setColor(0.7333,0.3803,0);
} else {
me["ENG1idFFlow"].setColor(0.8078,0.8039,0.8078);
}
2018-09-23 23:32:14 +00:00
2018-04-12 16:54:25 +00:00
# if (getprop("engines/engine[1]/n1-actual") < getprop("/controls/engines/idle-limit")) {
2018-09-23 15:02:47 +00:00
if (eng2_n1.getValue() < 19.7) {
2018-04-12 16:54:25 +00:00
me["ENG2idFFlow"].setColor(0.7333,0.3803,0);
} else {
me["ENG2idFFlow"].setColor(0.8078,0.8039,0.8078);
}
2018-09-23 23:32:14 +00:00
2018-04-12 16:54:25 +00:00
# TODO add FOB half-boxed amber if some fuel is blocked
2018-09-23 15:02:47 +00:00
me["FUEL-On-Board"].setText(sprintf("%s", math.round(total_fuel_lbs.getValue(), 10)));
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (fadec1.getValue() == 1 and fadec2.getValue() == 1) {
2018-04-12 16:54:25 +00:00
me["FUEL-Flow-per-min"].setColor(0.0509,0.7529,0.2941);
2018-09-23 15:02:47 +00:00
me["FUEL-Flow-per-min"].setText(sprintf("%s", math.round((fuel_flow1.getValue() + fuel_flow2.getValue()) / 60, 1)));
2018-04-12 16:54:25 +00:00
} else {
me["FUEL-Flow-per-min"].setColor(0.7333,0.3803,0);
me["FUEL-Flow-per-min"].setText("XX");
}
2018-09-23 23:32:14 +00:00
2018-04-12 16:54:25 +00:00
# this is now bound to the ENG master switch
# TODO use the valve prop and add amber if diffrence between eng master and valve
# TODO add transition state
# TODO fix amber/green at the same time when closed
2018-09-23 15:02:47 +00:00
if (cutoff_switch1.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["FUEL-ENG-Master-1"].setRotation(0);
me["FUEL-ENG-Master-1"].setColor(0.0509,0.7529,0.2941);
me["FUEL-ENG-1-pipe"].setColor(0.0509,0.7529,0.2941);
} else {
me["FUEL-ENG-Master-1"].setRotation(90 * D2R);
me["FUEL-ENG-Master-1"].setColor(0.7333,0.3803,0);
me["FUEL-ENG-1-pipe"].setColor(0.7333,0.3803,0);
}
# this is now bound to the ENG master switch
# TODO use the valve prop and add amber if diffrence between eng master and valve
# TODO add transition state
# TODO fix amber/green at the same time when closed
2018-09-24 10:41:09 +00:00
if (cutoff_switch2.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["FUEL-ENG-Master-2"].setRotation(0);
me["FUEL-ENG-Master-2"].setColor(0.0509,0.7529,0.2941);
me["FUEL-ENG-2-pipe"].setColor(0.0509,0.7529,0.2941);
} else {
me["FUEL-ENG-Master-2"].setRotation(90 * D2R);
me["FUEL-ENG-Master-2"].setColor(0.7333,0.3803,0);
me["FUEL-ENG-2-pipe"].setColor(0.7333,0.3803,0);
}
# this is now bound to the XFEED switch
# TODO use the valve prop
# TODO add amber when disagree between switch and btn
# TODO add transition state
2018-09-23 15:02:47 +00:00
if (fuel_xfeed.getValue() == 1) {
2018-04-12 16:54:25 +00:00
me["FUEL-XFEED"].setRotation(0);
me["FUEL-XFEED-pipes"].show();
} else {
me["FUEL-XFEED"].setRotation(90 * D2R);
me["FUEL-XFEED-pipes"].hide();
}
# TODO add LO indication
# TODO fix amber/green at the same time when closed
2018-09-23 15:02:47 +00:00
if (tank0pump1.getValue() == 1) {
2018-04-12 16:54:25 +00:00
me["FUEL-Pump-Left-1-Open"].show();
me["FUEL-Pump-Left-1-Closed"].hide();
me["FUEL-Pump-Left-1"].setColor(0.0509,0.7529,0.2941);
} else {
me["FUEL-Pump-Left-1-Open"].hide();
me["FUEL-Pump-Left-1-Closed"].show();
2018-09-23 23:32:14 +00:00
me["FUEL-Pump-Left-1"].setColor(0.7333,0.3803,0);
2018-04-12 16:54:25 +00:00
}
# TODO add LO indication
# TODO fix amber/green at the same time when closed
2018-09-23 15:02:47 +00:00
if (tank0pump2.getValue() == 1) {
2018-04-12 16:54:25 +00:00
me["FUEL-Pump-Left-2-Open"].show();
me["FUEL-Pump-Left-2-Closed"].hide();
me["FUEL-Pump-Left-2"].setColor(0.0509,0.7529,0.2941);
} else {
me["FUEL-Pump-Left-2-Open"].hide();
me["FUEL-Pump-Left-2-Closed"].show();
me["FUEL-Pump-Left-2"].setColor(0.7333,0.3803,0);
}
# TODO fix amber/green at the same time when closed
# TODO add functionality to match FCOM 1.28.20 "Amber: Transfer valve is open, whereas commanded closed in automatic or manual mode"
2018-09-23 15:02:47 +00:00
if (tank1pump1.getValue() == 1) {
2018-04-12 16:54:25 +00:00
me["FUEL-Pump-Center-1-Open"].show();
me["FUEL-Pump-Center-1-Closed"].hide();
me["FUEL-Pump-Center-1"].setColor(0.0509,0.7529,0.2941);
} else {
me["FUEL-Pump-Center-1-Open"].hide();
me["FUEL-Pump-Center-1-Closed"].show();
me["FUEL-Pump-Center-1"].setColor(0.7333,0.3803,0);
}
# TODO add LO indication
# TODO fix amber/green at the same time when closed
2018-09-23 15:02:47 +00:00
if (tank1pump2.getValue() == 1) {
2018-04-12 16:54:25 +00:00
me["FUEL-Pump-Center-2-Open"].show();
me["FUEL-Pump-Center-2-Closed"].hide();
me["FUEL-Pump-Center-2"].setColor(0.0509,0.7529,0.2941);
} else {
me["FUEL-Pump-Center-2-Open"].hide();
me["FUEL-Pump-Center-2-Closed"].show();
me["FUEL-Pump-Center-2"].setColor(0.7333,0.3803,0);
}
# TODO add LO indication
# TODO fix amber/green at the same time when closed
2018-09-23 15:02:47 +00:00
if (tank2pump1.getValue() == 1) {
2018-04-12 16:54:25 +00:00
me["FUEL-Pump-Right-1-Open"].show();
me["FUEL-Pump-Right-1-Closed"].hide();
me["FUEL-Pump-Right-1"].setColor(0.0509,0.7529,0.2941);
} else {
me["FUEL-Pump-Right-1-Open"].hide();
me["FUEL-Pump-Right-1-Closed"].show();
me["FUEL-Pump-Right-1"].setColor(0.7333,0.3803,0);
}
# TODO add LO indication
# TODO fix amber/green at the same time when closed
2018-09-23 15:02:47 +00:00
if (tank2pump2.getValue() == 1) {
2018-04-12 16:54:25 +00:00
me["FUEL-Pump-Right-2-Open"].show();
me["FUEL-Pump-Right-2-Closed"].hide();
me["FUEL-Pump-Right-2"].setColor(0.0509,0.7529,0.2941);
} else {
me["FUEL-Pump-Right-2-Open"].hide();
me["FUEL-Pump-Right-2-Closed"].show();
me["FUEL-Pump-Right-2"].setColor(0.7333,0.3803,0);
}
# Hide not yet implemented features
# TODO add them
me["FUEL-Left-blocked"].hide();
me["FUEL-Right-blocked"].hide();
me["FUEL-Center-blocked"].hide();
me["FUEL-Left-Outer-Inacc"].hide();
me["FUEL-Left-Inner-Inacc"].hide();
me["FUEL-Right-Outer-Inacc"].hide();
me["FUEL-Right-Inner-Inacc"].hide();
me["FUEL-Center-Inacc"].hide();
me["FUEL-Left-Tranfser"].hide();
me["FUEL-Right-Tranfser"].hide();
me["FUEL-Left-Outer-temp"].hide();
me["FUEL-Left-Inner-temp"].hide();
me["FUEL-Right-Outer-temp"].hide();
me["FUEL-Right-Inner-temp"].hide();
2018-09-23 23:32:14 +00:00
2018-04-12 16:54:25 +00:00
me.updateBottomStatus();
},
};
var canvas_lowerECAM_press = {
new: func(canvas_group, file) {
var m = {parents: [canvas_lowerECAM_press, canvas_lowerECAM_base]};
m.init(canvas_group, file);
2018-09-23 23:32:14 +00:00
2018-04-12 16:54:25 +00:00
return m;
},
getKeys: func() {
2018-04-21 10:42:14 +00:00
return ["TAT","SAT","GW","UTCh","UTCm", "PRESS-Cab-VS", "PRESS-Cab-VS-neg", "PRESS-Cab-Alt"];
2018-04-12 16:54:25 +00:00
},
update: func() {
2018-09-23 15:02:47 +00:00
me["PRESS-Cab-VS"].setText(sprintf("%4.0f", press_vs_norm.getValue()));
me["PRESS-Cab-Alt"].setText(sprintf("%4.0f", cabinalt.getValue()));
2018-09-23 23:32:14 +00:00
2018-04-12 16:54:25 +00:00
me.updateBottomStatus();
},
};
2018-04-13 17:21:18 +00:00
var canvas_lowerECAM_status = {
new: func(canvas_group, file) {
var m = {parents: [canvas_lowerECAM_status, canvas_lowerECAM_base]};
m.init(canvas_group, file);
2018-09-23 23:32:14 +00:00
2018-04-13 17:21:18 +00:00
return m;
},
getKeys: func() {
return ["TAT","SAT","GW","UTCh","UTCm"];
},
update: func() {
2018-09-23 23:32:14 +00:00
2018-04-13 17:21:18 +00:00
me.updateBottomStatus();
},
};
2018-04-12 16:54:25 +00:00
var canvas_lowerECAM_hyd = {
new: func(canvas_group, file) {
var m = {parents: [canvas_lowerECAM_hyd, canvas_lowerECAM_base]};
m.init(canvas_group, file);
2018-09-23 23:32:14 +00:00
2018-04-12 16:54:25 +00:00
return m;
},
getKeys: func() {
return ["TAT","SAT","GW","UTCh","UTCm","Green-Indicator","Blue-Indicator","Yellow-Indicator","Press-Green","Press-Blue","Press-Yellow","Green-Line","Blue-Line","Yellow-Line","PTU-Supply-Line","PTU-supply-yellow","PTU-supply-green","PTU-connection",
"PTU-Auto-or-off","RAT-label","RAT-stowed","RAT-not-stowed","ELEC-Yellow-off","ELEC-Yellow-on","ELEC-Yellow-label","ELEC-OVTH-Yellow","ELEC-Blue-label","ELEC-OVHT-Blue","ELEC-OVHT-Yellow","Pump-Green-label","Pump-Yellow-label","Pump-Green",
2018-04-21 09:23:23 +00:00
"Pump-LOPR-Green","Pump-Green-off","Pump-Green-on","Pump-Yellow","Pump-LOPR-Yellow","Pump-Yellow-off","Pump-Yellow-on","Pump-Blue", "Pump-Blue-off","Pump-Blue-on","Fire-Valve-Green","Fire-Valve-Yellow","LO-AIR-PRESS-Green",
2018-04-12 16:54:25 +00:00
"LO-AIR-PRESS-Yellow","LO-AIR-PRESS-Blue","OVHT-Green","OVHT-Blue","OVHT-Yellow","Quantity-Indicator-Green","Quantity-Indicator-Blue","Quantity-Indicator-Yellow","Green-label","Blue-label","Yellow-label"];
},
update: func() {
2018-09-23 15:02:47 +00:00
blue_psi = b_psi.getValue();
green_psi = g_psi.getValue();
yellow_psi = y_psi.getValue();
2018-04-12 16:54:25 +00:00
me["Press-Green"].setText(sprintf("%s", green_psi));
me["Press-Blue"].setText(sprintf("%s", blue_psi));
me["Press-Yellow"].setText(sprintf("%s", yellow_psi));
if (blue_psi >= 1500) {
me["Blue-Line"].setColor(0.0509,0.7529,0.2941);
me["Blue-Line"].setColorFill(0.0509,0.7529,0.2941);
me["Blue-Indicator"].setColor(0.0509,0.7529,0.2941);
me["Press-Blue"].setColor(0.0509,0.7529,0.2941);
me["Blue-label"].setColor(0.8078,0.8039,0.8078);
} else {
me["Blue-Line"].setColor(0.7333,0.3803,0);
me["Blue-Line"].setColorFill(0.7333,0.3803,0);
me["Blue-Indicator"].setColor(0.7333,0.3803,0);
me["Press-Blue"].setColor(0.7333,0.3803,0);
me["Blue-label"].setColor(0.7333,0.3803,0);
}
if (yellow_psi >= 1500) {
me["Yellow-Line"].setColor(0.0509,0.7529,0.2941);
me["Yellow-Line"].setColorFill(0.0509,0.7529,0.2941);
me["Yellow-Indicator"].setColor(0.0509,0.7529,0.2941);
me["Press-Yellow"].setColor(0.0509,0.7529,0.2941);
me["Yellow-label"].setColor(0.8078,0.8039,0.8078);
} else {
me["Yellow-Line"].setColor(0.7333,0.3803,0);
me["Yellow-Line"].setColorFill(0.7333,0.3803,0);
me["Yellow-Indicator"].setColor(0.7333,0.3803,0);
me["Press-Yellow"].setColor(0.7333,0.3803,0);
me["Yellow-label"].setColor(0.7333,0.3803,0);
}
if (green_psi >= 1500) {
me["Green-Line"].setColor(0.0509,0.7529,0.2941);
me["Green-Line"].setColorFill(0.0509,0.7529,0.2941);
me["Green-Indicator"].setColor(0.0509,0.7529,0.2941);
me["Press-Green"].setColor(0.0509,0.7529,0.2941);
me["Green-label"].setColor(0.8078,0.8039,0.8078);
} else {
me["Green-Line"].setColor(0.7333,0.3803,0);
me["Green-Line"].setColorFill(0.7333,0.3803,0);
me["Green-Indicator"].setColor(0.7333,0.3803,0);
me["Press-Green"].setColor(0.7333,0.3803,0);
me["Green-label"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (ptu.getValue() == 1 and ptu_fault.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["PTU-connection"].setColor(0.0509,0.7529,0.2941);
2018-04-13 20:49:03 +00:00
2018-09-24 10:41:09 +00:00
if (ptu_active.getValue() == 1) {
2018-09-23 15:02:47 +00:00
if (ptu_supplies.getValue() == "yellow") {
2018-04-13 20:49:03 +00:00
me["PTU-Supply-Line"].show();
me["PTU-supply-yellow"].show();
me["PTU-supply-green"].hide();
me["PTU-Auto-or-off"].hide();
2018-09-23 15:02:47 +00:00
} else {
2018-04-13 20:49:03 +00:00
me["PTU-Supply-Line"].show();
me["PTU-supply-yellow"].hide();
me["PTU-supply-green"].show();
me["PTU-Auto-or-off"].hide();
}
} else {
me["PTU-Auto-or-off"].setColor(0.0509,0.7529,0.2941);
me["PTU-Supply-Line"].hide();
me["PTU-supply-yellow"].hide();
me["PTU-supply-green"].hide();
me["PTU-Auto-or-off"].show();
}
2018-04-12 16:54:25 +00:00
} else {
me["PTU-connection"].setColor(0.7333,0.3803,0);
me["PTU-Auto-or-off"].setColor(0.7333,0.3803,0);
2018-04-13 20:49:03 +00:00
me["PTU-Supply-Line"].hide();
me["PTU-supply-yellow"].hide();
me["PTU-supply-green"].hide();
me["PTU-Auto-or-off"].show();
2018-04-12 16:54:25 +00:00
}
2018-09-23 15:02:47 +00:00
if (eng1_n2.getValue() >= 59) {
2018-04-12 16:54:25 +00:00
me["Pump-Green-label"].setColor(0.8078,0.8039,0.8078);
} else {
me["Pump-Green-label"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (eng2_n2.getValue() >= 59) {
2018-04-12 16:54:25 +00:00
me["Pump-Yellow-label"].setColor(0.8078,0.8039,0.8078);
} else {
me["Pump-Yellow-label"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (eng1_pump.getValue() == 1) {
2018-04-12 16:54:25 +00:00
me["Pump-Green-off"].hide();
2018-04-21 09:23:23 +00:00
if (green_psi >= 1500) {
2018-04-12 16:54:25 +00:00
me["Pump-Green-on"].show();
me["Pump-LOPR-Green"].hide();
me["Pump-Green"].setColor(0.0509,0.7529,0.2941);
me["Pump-Green"].setColorFill(0.0509,0.7529,0.2941);
} else {
me["Pump-Green-on"].hide();
me["Pump-LOPR-Green"].show();
me["Pump-Green"].setColor(0.7333,0.3803,0);
me["Pump-Green"].setColorFill(0.7333,0.3803,0);
}
} else {
me["Pump-Green-off"].show();
me["Pump-Green-on"].hide();
me["Pump-LOPR-Green"].hide();
me["Pump-Green"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (eng2_pump.getValue() == 1) {
2018-04-12 16:54:25 +00:00
me["Pump-Yellow-off"].hide();
if (yellow_psi >= 1500) {
me["Pump-Yellow-on"].show();
me["Pump-LOPR-Yellow"].hide();
2018-04-21 09:23:23 +00:00
me["Pump-Yellow"].setColorFill(0.0509,0.7529,0.2941);
2018-04-12 16:54:25 +00:00
me["Pump-Yellow"].setColor(0.0509,0.7529,0.2941);
} else {
me["Pump-Yellow-on"].hide();
me["Pump-LOPR-Yellow"].show();
2018-04-21 09:23:23 +00:00
me["Pump-Yellow"].setColorFill(0.7333,0.3803,0);
2018-04-12 16:54:25 +00:00
me["Pump-Yellow"].setColor(0.7333,0.3803,0);
}
} else {
me["Pump-Yellow-off"].show();
me["Pump-Yellow-on"].hide();
me["Pump-LOPR-Yellow"].hide();
2018-04-21 09:23:23 +00:00
me["Pump-Yellow"].setColorFill(0.7333,0.3803,0);
2018-04-12 16:54:25 +00:00
me["Pump-Yellow"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (elec_pump_blue.getValue() == 1) {
2018-04-12 16:54:25 +00:00
me["Pump-Blue-off"].hide();
if (blue_psi >= 1500) {
me["Pump-Blue-on"].show();
2018-04-21 09:23:23 +00:00
me["Pump-Blue-off"].hide();
me["Pump-Blue"].setColorFill(0.0509,0.7529,0.2941);
2018-04-12 16:54:25 +00:00
me["Pump-Blue"].setColor(0.0509,0.7529,0.2941);
} else {
2018-04-21 09:23:23 +00:00
me["Pump-Blue-off"].show();
2018-04-12 16:54:25 +00:00
me["Pump-Blue-on"].hide();
2018-04-21 09:23:23 +00:00
me["Pump-Blue"].setColorFill(0.7333,0.3803,0);
2018-04-12 16:54:25 +00:00
me["Pump-Blue"].setColor(0.7333,0.3803,0);
}
} else {
me["Pump-Blue-off"].show();
me["Pump-Blue-on"].hide();
2018-04-21 09:23:23 +00:00
me["Pump-Blue"].setColorFill(0.7333,0.3803,0);
2018-04-12 16:54:25 +00:00
me["Pump-Blue"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (elec_pump_yellow.getValue() == 0) {
2018-04-12 16:54:25 +00:00
me["ELEC-Yellow-on"].hide();
me["ELEC-Yellow-off"].show();
} else {
me["ELEC-Yellow-on"].show();
me["ELEC-Yellow-off"].hide();
2018-09-23 15:02:47 +00:00
if (yellow_psi >= 1500) {
2018-04-13 20:49:03 +00:00
me["ELEC-Yellow-on"].setColor(0.0509,0.7529,0.2941);
} else {
me["ELEC-Yellow-on"].setColor(0.7333,0.3803,0);
}
}
2018-09-23 15:02:47 +00:00
if (y_resv_lo_air_press.getValue() == 1) {
2018-04-13 20:49:03 +00:00
me["LO-AIR-PRESS-Yellow"].show();
} else {
me["LO-AIR-PRESS-Yellow"].hide();
}
2018-09-23 15:02:47 +00:00
if (b_resv_lo_air_press.getValue() == 1) {
2018-04-13 20:49:03 +00:00
me["LO-AIR-PRESS-Blue"].show();
} else {
me["LO-AIR-PRESS-Blue"].hide();
}
2018-09-23 15:02:47 +00:00
if (g_resv_lo_air_press.getValue() == 1) {
2018-04-13 20:49:03 +00:00
me["LO-AIR-PRESS-Green"].show();
} else {
me["LO-AIR-PRESS-Green"].hide();
}
2018-09-23 15:02:47 +00:00
if (elec_pump_y_ovht.getValue() == 1) {
2018-04-13 20:49:03 +00:00
me["ELEC-OVHT-Yellow"].show();
} else {
me["ELEC-OVHT-Yellow"].hide();
}
2018-09-23 15:02:47 +00:00
if (elec_pump_b_ovht.getValue() == 1) {
2018-04-13 20:49:03 +00:00
me["ELEC-OVHT-Blue"].show();
} else {
me["ELEC-OVHT-Blue"].hide();
}
2018-09-23 15:02:47 +00:00
if (rat_deployed.getValue() == 1) {
2018-04-13 20:49:03 +00:00
me["RAT-stowed"].hide();
me["RAT-not-stowed"].show();
} else {
me["RAT-stowed"].show();
me["RAT-not-stowed"].hide();
}
2018-09-23 15:02:47 +00:00
if (y_resv_ovht.getValue() == 1) {
2018-04-13 20:49:03 +00:00
me["OVHT-Yellow"].show();
} else {
me["OVHT-Yellow"].hide();
}
2018-09-23 15:02:47 +00:00
if (b_resv_ovht.getValue() == 1) {
2018-04-13 20:49:03 +00:00
me["OVHT-Green"].show();
} else {
me["OVHT-Green"].hide();
}
2018-09-23 15:02:47 +00:00
if (g_resv_ovht.getValue() == 1) {
2018-04-13 20:49:03 +00:00
me["OVHT-Blue"].show();
} else {
me["OVHT-Blue"].hide();
2018-04-12 16:54:25 +00:00
}
2018-09-23 15:02:47 +00:00
if (ac1.getValue() > 110) {
2018-04-13 20:49:03 +00:00
me["ELEC-Blue-label"].setColor(0.8078,0.8039,0.8078);
} else {
me["ELEC-Blue-label"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (ac2.getValue() > 110) {
2018-04-13 20:49:03 +00:00
me["ELEC-Yellow-label"].setColor(0.8078,0.8039,0.8078);
} else {
me["ELEC-Yellow-label"].setColor(0.7333,0.3803,0);
}
2018-09-23 15:02:47 +00:00
if (y_fire_valve.getValue() == 1) {
2018-04-13 20:49:03 +00:00
me["Fire-Valve-Yellow"].setColor(0.7333,0.3803,0);
2018-09-23 22:51:59 +00:00
me["Fire-Valve-Yellow"].setRotation(90 * D2R);
2018-04-13 20:49:03 +00:00
} else {
me["Fire-Valve-Yellow"].setColor(0.0509,0.7529,0.2941);
2018-09-23 22:51:59 +00:00
me["Fire-Valve-Yellow"].setRotation(0);
2018-04-13 20:49:03 +00:00
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (g_fire_valve.getValue() == 1) {
2018-04-13 20:49:03 +00:00
me["Fire-Valve-Green"].setColor(0.7333,0.3803,0);
2018-09-23 22:51:59 +00:00
me["Fire-Valve-Green"].setRotation(90 * D2R);
2018-04-13 20:49:03 +00:00
} else {
me["Fire-Valve-Green"].setColor(0.0509,0.7529,0.2941);
2018-09-23 22:51:59 +00:00
me["Fire-Valve-Green"].setRotation(0);
2018-04-13 20:49:03 +00:00
}
2018-09-23 23:32:14 +00:00
2018-04-12 16:54:25 +00:00
me.updateBottomStatus();
},
};
2017-10-05 16:22:36 +00:00
var canvas_lowerECAM_wheel = {
new: func(canvas_group, file) {
2017-10-19 04:05:42 +00:00
var m = {parents: [canvas_lowerECAM_wheel, canvas_lowerECAM_base]};
2017-10-05 16:22:36 +00:00
m.init(canvas_group, file);
2018-09-23 23:32:14 +00:00
2017-10-05 16:22:36 +00:00
return m;
},
getKeys: func() {
2018-04-05 21:21:48 +00:00
return ["TAT","SAT","GW","UTCh","UTCm","lgctltext","NORMbrk","NWStext","leftdoor","rightdoor","nosegeardoorL","nosegeardoorR","autobrk","autobrkind","NWS","NWSrect","normbrk-rect","altnbrk","normbrkhyd","spoiler1Rex","spoiler1Rrt","spoiler2Rex",
"spoiler2Rrt","spoiler3Rex","spoiler3Rrt","spoiler4Rex","spoiler4Rrt","spoiler5Rex","spoiler5Rrt","spoiler1Lex","spoiler1Lrt","spoiler2Lex","spoiler2Lrt","spoiler3Lex","spoiler3Lrt","spoiler4Lex","spoiler4Lrt","spoiler5Lex","spoiler5Lrt","spoiler1Rf",
"spoiler2Rf","spoiler3Rf","spoiler4Rf","spoiler5Rf","spoiler1Lf","spoiler2Lf","spoiler3Lf","spoiler4Lf","spoiler5Lf","ALTNbrk","altnbrkhyd","altnbrk-rect","antiskidtext","brakearrow","accupress_text","accuonlyarrow","accuonly","braketemp1","normbrkhyd",
"braketemp2","braketemp3","braketemp4","leftuplock","noseuplock","rightuplock","Triangle-Left1","Triangle-Left2","Triangle-Nose1","Triangle-Nose2","Triangle-Right1","Triangle-Right2","BSCUrect1","BSCUrect2","BSCU1","BSCU2"];
2017-10-05 16:22:36 +00:00
},
update: func() {
2018-09-23 15:02:47 +00:00
blue_psi = b_psi.getValue();
green_psi = g_psi.getValue();
yellow_psi = y_psi.getValue();
autobrakemode = autobreak_mode.getValue();
nosegear = gear1_pos.getValue();
leftgear = gear2_pos.getValue();
rightgear = gear3_pos.getValue();
leftdoor = gear_door_L.getValue();
rightdoor = gear_door_R.getValue();
nosedoor = gear_door_N.getValue();
gearlvr = gear_down.getValue();
askidsw = askid.getValue();
brakemode = brk_mode.getValue();
accum = accu_press.getValue();
2018-09-23 23:32:14 +00:00
2017-10-21 19:50:02 +00:00
# L/G CTL
if ((leftgear == 0 or nosegear == 0 or rightgear == 0 and gearlvr == 0) or (leftgear == 1 or nosegear == 1 or rightgear == 1 and gearlvr == 1)) {
me["lgctltext"].hide();
} else {
me["lgctltext"].show();
}
2018-09-23 23:32:14 +00:00
2017-10-21 19:50:02 +00:00
# NWS / Antiskid / Brakes
if (askidsw and yellow_psi >= 1500) {
me["NWStext"].hide();
me["NWS"].hide();
me["NWSrect"].hide();
me["antiskidtext"].hide();
me["BSCUrect1"].hide();
me["BSCUrect2"].hide();
me["BSCU1"].hide();
me["BSCU2"].hide();
} else if (!askidsw and yellow_psi >= 1500) {
me["NWStext"].show();
me["NWS"].show();
2017-11-05 22:16:56 +00:00
me["NWS"].setColor(0.0509,0.7529,0.2941);
2017-10-21 19:50:02 +00:00
me["NWSrect"].show();
me["antiskidtext"].show();
me["antiskidtext"].setColor(0.7333,0.3803,0);
me["BSCUrect1"].show();
me["BSCUrect2"].show();
me["BSCU1"].show();
me["BSCU2"].show();
} else {
me["NWStext"].show();
me["NWS"].show();
me["NWS"].setColor(0.7333,0.3803,0);
me["NWSrect"].show();
me["antiskidtext"].show();
me["antiskidtext"].setColor(0.7333,0.3803,0);
me["BSCUrect1"].show();
me["BSCUrect2"].show();
me["BSCU1"].show();
me["BSCU2"].show();
}
2018-09-23 23:32:14 +00:00
2017-10-21 19:50:02 +00:00
if (green_psi >= 1500 and brakemode == 1) {
me["NORMbrk"].hide();
me["normbrk-rect"].hide();
me["normbrkhyd"].hide();
} else if (green_psi >= 1500 and askidsw) {
me["NORMbrk"].show();
me["normbrk-rect"].show();
me["NORMbrk"].setColor(0.7333,0.3803,0);
2017-11-05 22:16:56 +00:00
me["normbrkhyd"].setColor(0.0509,0.7529,0.2941);
2017-10-21 19:50:02 +00:00
} else if (green_psi < 1500 or !askidsw) {
me["NORMbrk"].show();
me["normbrk-rect"].show();
me["NORMbrk"].setColor(0.7333,0.3803,0);
me["normbrkhyd"].setColor(0.7333,0.3803,0);
2017-10-24 20:59:42 +00:00
}
2018-09-23 23:32:14 +00:00
2017-10-21 19:50:02 +00:00
if (brakemode != 2) {
me["ALTNbrk"].hide();
me["altnbrk-rect"].hide();
me["altnbrkhyd"].hide();
} else if (yellow_psi >= 1500) {
me["ALTNbrk"].show();
me["altnbrk-rect"].show();
2017-11-05 22:16:56 +00:00
me["altnbrkhyd"].setColor(0.0509,0.7529,0.2941);
2017-10-21 19:50:02 +00:00
} else {
me["ALTNbrk"].show();
me["altnbrk-rect"].show();
me["altnbrkhyd"].setColor(0.7333,0.3803,0);
}
2018-09-23 23:32:14 +00:00
2017-10-21 19:50:02 +00:00
if (brakemode == 2 and accum < 200 and yellow_psi < 1500) {
me["accupress_text"].show();
me["brakearrow"].hide();
2017-10-24 17:10:50 +00:00
me["accupress_text"].setColor(0.7333,0.3803,0);
2017-10-21 19:50:02 +00:00
} else if (brakemode == 2 and accum > 200 and yellow_psi >= 1500){
me["accupress_text"].show();
me["brakearrow"].show();
2017-11-05 22:16:56 +00:00
me["accupress_text"].setColor(0.0509,0.7529,0.2941);
2017-10-21 19:50:02 +00:00
} else if (brakemode == 2 and accum > 200 and yellow_psi < 1500) {
me["accuonlyarrow"].show();
me["accuonly"].show();
me["brakearrow"].hide();
me["accupress_text"].hide();
} else {
me["accuonlyarrow"].hide();
me["accuonly"].hide();
2017-10-24 17:10:50 +00:00
me["brakearrow"].hide();
me["accupress_text"].hide();
2017-10-21 19:50:02 +00:00
}
2018-09-23 23:32:14 +00:00
2017-10-20 14:15:56 +00:00
# Gear Doors
2018-09-23 15:02:47 +00:00
me["leftdoor"].setRotation(door_left.getValue() * D2R);
me["rightdoor"].setRotation(door_right.getValue() * D2R);
me["nosegeardoorL"].setRotation(door_nose_left.getValue() * D2R);
me["nosegeardoorR"].setRotation(door_nose_right.getValue() * D2R);
2018-09-23 23:32:14 +00:00
2017-10-20 15:44:52 +00:00
if (nosedoor == 0) {
2017-11-05 22:16:56 +00:00
me["nosegeardoorL"].setColorFill(0.0509,0.7529,0.2941);
me["nosegeardoorR"].setColorFill(0.0509,0.7529,0.2941);
2017-10-20 15:44:52 +00:00
} else {
me["nosegeardoorL"].setColorFill(0.7333,0.3803,0);
me["nosegeardoorR"].setColorFill(0.7333,0.3803,0);
}
2018-09-23 23:32:14 +00:00
2017-10-20 15:44:52 +00:00
if (leftdoor == 0) {
2017-11-05 22:16:56 +00:00
me["leftdoor"].setColorFill(0.0509,0.7529,0.2941);
2017-10-20 15:44:52 +00:00
} else {
me["leftdoor"].setColorFill(0.7333,0.3803,0);
}
2018-09-23 23:32:14 +00:00
2017-10-20 15:44:52 +00:00
if (rightdoor == 0) {
2017-11-05 22:16:56 +00:00
me["rightdoor"].setColorFill(0.0509,0.7529,0.2941);
2017-10-20 15:44:52 +00:00
} else {
me["rightdoor"].setColorFill(0.7333,0.3803,0);
}
2018-09-23 23:32:14 +00:00
2017-10-18 16:41:12 +00:00
# Triangles
2017-10-20 14:33:12 +00:00
if (leftgear < 0.2 or leftgear > 0.8) {
2017-10-18 23:04:45 +00:00
me["Triangle-Left1"].hide();
me["Triangle-Left2"].hide();
} else {
me["Triangle-Left1"].show();
me["Triangle-Left2"].show();
2017-10-18 16:41:12 +00:00
}
2018-09-23 23:32:14 +00:00
2017-10-18 16:41:12 +00:00
if (leftgear == 1) {
2017-11-05 22:16:56 +00:00
me["Triangle-Left1"].setColor(0.0509,0.7529,0.2941);
me["Triangle-Left2"].setColor(0.0509,0.7529,0.2941);
2017-10-18 23:04:45 +00:00
} else {
me["Triangle-Left1"].setColor(1,0,0);
me["Triangle-Left2"].setColor(1,0,0);
}
2018-09-23 23:32:14 +00:00
2017-10-20 14:33:12 +00:00
if (nosegear < 0.2 or nosegear > 0.8) {
2017-10-18 23:04:45 +00:00
me["Triangle-Nose1"].hide();
me["Triangle-Nose2"].hide();
} else {
me["Triangle-Nose1"].show();
me["Triangle-Nose2"].show();
2017-10-18 16:41:12 +00:00
}
2018-09-23 23:32:14 +00:00
2017-10-18 16:41:12 +00:00
if (nosegear == 1) {
2017-11-05 22:16:56 +00:00
me["Triangle-Nose1"].setColor(0.0509,0.7529,0.2941);
me["Triangle-Nose2"].setColor(0.0509,0.7529,0.2941);
2017-10-18 23:04:45 +00:00
} else {
me["Triangle-Nose1"].setColor(1,0,0);
me["Triangle-Nose2"].setColor(1,0,0);
}
2018-09-23 23:32:14 +00:00
2017-10-20 14:33:12 +00:00
if (rightgear < 0.2 or rightgear > 0.8) {
2017-10-18 23:04:45 +00:00
me["Triangle-Right1"].hide();
me["Triangle-Right2"].hide();
} else {
me["Triangle-Right1"].show();
me["Triangle-Right2"].show();
2017-10-18 16:41:12 +00:00
}
2018-09-23 23:32:14 +00:00
2017-10-18 16:41:12 +00:00
if (rightgear == 1) {
2017-11-05 22:16:56 +00:00
me["Triangle-Right1"].setColor(0.0509,0.7529,0.2941);
me["Triangle-Right2"].setColor(0.0509,0.7529,0.2941);
2017-10-18 16:41:12 +00:00
} else {
2017-10-18 23:04:45 +00:00
me["Triangle-Right1"].setColor(1,0,0);
me["Triangle-Right2"].setColor(1,0,0);
2017-10-18 16:41:12 +00:00
}
2018-09-23 23:32:14 +00:00
2017-10-10 13:01:12 +00:00
# Autobrake
if (autobrakemode == 0) {
me["autobrkind"].hide();
} elsif (autobrakemode == 1) {
me["autobrkind"].show();
me["autobrkind"].setText(sprintf("%s", "LO"));
} elsif (autobrakemode == 2) {
me["autobrkind"].show();
me["autobrkind"].setText(sprintf("%s", "MED"));
} elsif (autobrakemode == 3) {
me["autobrkind"].show();
me["autobrkind"].setText(sprintf("%s", "MAX"));
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (autobrakemode != 0) {
2017-10-10 13:01:12 +00:00
me["autobrk"].show();
2018-09-23 15:02:47 +00:00
} elsif (autobrakemode == 0) {
2017-10-10 13:01:12 +00:00
me["autobrk"].hide();
}
2018-09-23 23:32:14 +00:00
2017-10-05 16:22:36 +00:00
# Spoilers
2018-09-23 15:02:47 +00:00
if (spoiler_L1.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler1Lex"].hide();
me["spoiler1Lrt"].show();
} else {
me["spoiler1Lrt"].hide();
me["spoiler1Lex"].show();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L2.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler2Lex"].hide();
me["spoiler2Lrt"].show();
} else {
me["spoiler2Lrt"].hide();
me["spoiler2Lex"].show();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L3.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler3Lex"].hide();
me["spoiler3Lrt"].show();
} else {
me["spoiler3Lrt"].hide();
me["spoiler3Lex"].show();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L4.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler4Lex"].hide();
me["spoiler4Lrt"].show();
} else {
me["spoiler4Lrt"].hide();
me["spoiler4Lex"].show();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L5.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler5Lex"].hide();
me["spoiler5Lrt"].show();
} else {
me["spoiler5Lrt"].hide();
me["spoiler5Lex"].show();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R1.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler1Rex"].hide();
me["spoiler1Rrt"].show();
} else {
me["spoiler1Rrt"].hide();
me["spoiler1Rex"].show();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R2.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler2Rex"].hide();
me["spoiler2Rrt"].show();
} else {
me["spoiler2Rrt"].hide();
me["spoiler2Rex"].show();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R3.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler3Rex"].hide();
me["spoiler3Rrt"].show();
} else {
me["spoiler3Rrt"].hide();
me["spoiler3Rex"].show();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R4.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler4Rex"].hide();
me["spoiler4Rrt"].show();
} else {
me["spoiler4Rrt"].hide();
me["spoiler4Rex"].show();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R5.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler5Rex"].hide();
me["spoiler5Rrt"].show();
} else {
me["spoiler5Rrt"].hide();
me["spoiler5Rex"].show();
}
2018-09-23 23:32:14 +00:00
2017-10-05 16:22:36 +00:00
# Spoiler Fail
2018-09-23 15:02:47 +00:00
if (spoiler_L1_fail.getValue() or green_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler1Lex"].setColor(0.7333,0.3803,0);
me["spoiler1Lrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_L1.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler1Lf"].show();
} else {
me["spoiler1Lf"].hide();
}
} else {
2017-11-05 22:16:56 +00:00
me["spoiler1Lex"].setColor(0.0509,0.7529,0.2941);
me["spoiler1Lrt"].setColor(0.0509,0.7529,0.2941);
2017-10-05 16:22:36 +00:00
me["spoiler1Lf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L2_fail.getValue() or yellow_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler2Lex"].setColor(0.7333,0.3803,0);
me["spoiler2Lrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_L2.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler2Lf"].show();
} else {
me["spoiler2Lf"].hide();
}
} else {
2017-11-05 22:16:56 +00:00
me["spoiler2Lex"].setColor(0.0509,0.7529,0.2941);
me["spoiler2Lrt"].setColor(0.0509,0.7529,0.2941);
2017-10-05 16:22:36 +00:00
me["spoiler2Lf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L3_fail.getValue() or blue_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler3Lex"].setColor(0.7333,0.3803,0);
me["spoiler3Lrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_L3.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler3Lf"].show();
} else {
me["spoiler3Lf"].hide();
}
2017-11-06 22:16:42 +00:00
} else {
2017-11-05 22:16:56 +00:00
me["spoiler3Lex"].setColor(0.0509,0.7529,0.2941);
me["spoiler3Lrt"].setColor(0.0509,0.7529,0.2941);
2017-10-05 16:22:36 +00:00
me["spoiler3Lf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L4_fail.getValue() or yellow_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler4Lex"].setColor(0.7333,0.3803,0);
me["spoiler4Lrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_L4.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler4Lf"].show();
} else {
me["spoiler4Lf"].hide();
}
} else {
2017-11-05 22:16:56 +00:00
me["spoiler4Lex"].setColor(0.0509,0.7529,0.2941);
me["spoiler4Lrt"].setColor(0.0509,0.7529,0.2941);
2017-10-05 16:22:36 +00:00
me["spoiler4Lf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_L5_fail.getValue() or green_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler5Lex"].setColor(0.7333,0.3803,0);
me["spoiler5Lrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_L5.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler5Lf"].show();
} else {
me["spoiler5Lf"].hide();
}
} else {
2017-11-05 22:16:56 +00:00
me["spoiler5Lex"].setColor(0.0509,0.7529,0.2941);
me["spoiler5Lrt"].setColor(0.0509,0.7529,0.2941);
2017-10-05 16:22:36 +00:00
me["spoiler5Lf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R1_fail.getValue() or green_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler1Rex"].setColor(0.7333,0.3803,0);
me["spoiler1Rrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_R1.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler1Rf"].show();
} else {
me["spoiler1Rf"].hide();
}
} else {
2017-11-05 22:16:56 +00:00
me["spoiler1Rex"].setColor(0.0509,0.7529,0.2941);
me["spoiler1Rrt"].setColor(0.0509,0.7529,0.2941);
2017-10-05 16:22:36 +00:00
me["spoiler1Rf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R2_fail.getValue() or yellow_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler2Rex"].setColor(0.7333,0.3803,0);
me["spoiler2Rrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_R2.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler2Rf"].show();
} else {
me["spoiler2Rf"].hide();
}
} else {
2017-11-05 22:16:56 +00:00
me["spoiler2Rex"].setColor(0.0509,0.7529,0.2941);
me["spoiler2Rrt"].setColor(0.0509,0.7529,0.2941);
2017-10-05 16:22:36 +00:00
me["spoiler2Rf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R3_fail.getValue() or blue_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler3Rex"].setColor(0.7333,0.3803,0);
me["spoiler3Rrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_R3.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler3Rf"].show();
} else {
me["spoiler3Rf"].hide();
}
} else {
2017-11-05 22:16:56 +00:00
me["spoiler3Rex"].setColor(0.0509,0.7529,0.2941);
me["spoiler3Rrt"].setColor(0.0509,0.7529,0.2941);
2017-10-05 16:22:36 +00:00
me["spoiler3Rf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R4_fail.getValue() or yellow_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler4Rex"].setColor(0.7333,0.3803,0);
me["spoiler4Rrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_R4.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler4Rf"].show();
} else {
me["spoiler4Rf"].hide();
}
} else {
2017-11-05 22:16:56 +00:00
me["spoiler4Rex"].setColor(0.0509,0.7529,0.2941);
me["spoiler4Rrt"].setColor(0.0509,0.7529,0.2941);
2017-10-05 16:22:36 +00:00
me["spoiler4Rf"].hide();
}
2018-09-23 23:32:14 +00:00
2018-09-23 15:02:47 +00:00
if (spoiler_R5_fail.getValue() or green_psi < 1500) {
2017-10-18 21:39:52 +00:00
me["spoiler5Rex"].setColor(0.7333,0.3803,0);
me["spoiler5Rrt"].setColor(0.7333,0.3803,0);
2018-09-23 15:02:47 +00:00
if (spoiler_R5.getValue() < 1.5) {
2017-10-05 16:22:36 +00:00
me["spoiler5Rf"].show();
} else {
me["spoiler5Rf"].hide();
}
} else {
2017-11-05 22:16:56 +00:00
me["spoiler5Rex"].setColor(0.0509,0.7529,0.2941);
me["spoiler5Rrt"].setColor(0.0509,0.7529,0.2941);
2017-10-05 16:22:36 +00:00
me["spoiler5Rf"].hide();
}
2018-09-23 23:32:14 +00:00
2017-10-17 00:38:22 +00:00
# Hide not yet implemented stuff
2017-10-17 01:03:27 +00:00
me["braketemp1"].hide();
me["braketemp2"].hide();
me["braketemp3"].hide();
me["braketemp4"].hide();
2017-10-20 14:15:56 +00:00
me["leftuplock"].hide();
me["noseuplock"].hide();
me["rightuplock"].hide();
2017-10-21 19:50:02 +00:00
2017-10-05 16:22:36 +00:00
me.updateBottomStatus();
},
};
2017-11-20 22:03:07 +00:00
var canvas_lowerECAM_test = {
init: func(canvas_group, file) {
var font_mapper = func(family, weight) {
return "LiberationFonts/LiberationSans-Regular.ttf";
};
canvas.parsesvg(canvas_group, file, {"font-mapper": font_mapper});
2018-09-23 23:32:14 +00:00
2017-12-31 14:33:53 +00:00
var svg_keys = me.getKeys();
foreach(var key; svg_keys) {
me[key] = canvas_group.getElementById(key);
}
2017-11-20 22:03:07 +00:00
me.page = canvas_group;
return me;
},
new: func(canvas_group, file) {
var m = {parents: [canvas_lowerECAM_test]};
m.init(canvas_group, file);
return m;
},
2017-12-31 14:33:53 +00:00
getKeys: func() {
return ["Test_white","Test_text"];
},
update: func() {
2018-09-23 15:02:47 +00:00
if (du4_test_time.getValue() + 1 >= elapsedtime) {
2017-12-31 14:33:53 +00:00
me["Test_white"].show();
me["Test_text"].hide();
} else {
me["Test_white"].hide();
me["Test_text"].show();
}
},
2017-11-20 22:03:07 +00:00
};
2017-07-29 19:35:38 +00:00
setlistener("sim/signals/fdm-initialized", func {
lowerECAM_display = canvas.new({
"name": "lowerECAM",
"size": [1024, 1024],
"view": [1024, 1024],
"mipmapping": 1
});
lowerECAM_display.addPlacement({"node": "lecam.screen"});
var groupApu = lowerECAM_display.createGroup();
2018-04-12 16:54:25 +00:00
var groupBleed = lowerECAM_display.createGroup();
var groupCond = lowerECAM_display.createGroup();
2018-09-13 17:40:17 +00:00
var groupCrz = lowerECAM_display.createGroup();
2018-04-05 21:21:48 +00:00
var groupDoor = lowerECAM_display.createGroup();
2018-04-12 16:54:25 +00:00
var groupElec = lowerECAM_display.createGroup();
2017-07-29 19:35:38 +00:00
var groupEng = lowerECAM_display.createGroup();
2017-08-03 17:11:45 +00:00
var groupFctl = lowerECAM_display.createGroup();
2018-04-12 16:54:25 +00:00
var groupFuel = lowerECAM_display.createGroup();
var groupPress = lowerECAM_display.createGroup();
2018-04-13 17:21:18 +00:00
var groupStatus = lowerECAM_display.createGroup();
2018-04-12 16:54:25 +00:00
var groupHyd = lowerECAM_display.createGroup();
2017-10-05 16:22:36 +00:00
var groupWheel = lowerECAM_display.createGroup();
2017-11-20 22:03:07 +00:00
var group_test = lowerECAM_display.createGroup();
2017-07-29 19:35:38 +00:00
2017-09-17 17:11:35 +00:00
lowerECAM_apu = canvas_lowerECAM_apu.new(groupApu, "Aircraft/IDG-A32X/Models/Instruments/Lower-ECAM/res/apu.svg");
2018-04-12 16:54:25 +00:00
lowerECAM_bleed = canvas_lowerECAM_bleed.new(groupBleed, "Aircraft/IDG-A32X/Models/Instruments/Lower-ECAM/res/bleed.svg");
lowerECAM_cond = canvas_lowerECAM_cond.new(groupCond, "Aircraft/IDG-A32X/Models/Instruments/Lower-ECAM/res/cond.svg");
2018-09-13 17:40:17 +00:00
lowerECAM_crz = canvas_lowerECAM_crz.new(groupCrz, "Aircraft/IDG-A32X/Models/Instruments/Lower-ECAM/res/crz.svg");
2018-04-05 21:21:48 +00:00
lowerECAM_door = canvas_lowerECAM_door.new(groupDoor, "Aircraft/IDG-A32X/Models/Instruments/Lower-ECAM/res/door.svg");
2018-04-12 16:54:25 +00:00
lowerECAM_elec = canvas_lowerECAM_elec.new(groupElec, "Aircraft/IDG-A32X/Models/Instruments/Lower-ECAM/res/elec.svg");
lowerECAM_eng = canvas_lowerECAM_eng.new(groupEng, "Aircraft/IDG-A32X/Models/Instruments/Lower-ECAM/res/eng.svg");
2017-09-17 17:11:35 +00:00
lowerECAM_fctl = canvas_lowerECAM_fctl.new(groupFctl, "Aircraft/IDG-A32X/Models/Instruments/Lower-ECAM/res/fctl.svg");
2018-04-12 16:54:25 +00:00
lowerECAM_fuel = canvas_lowerECAM_fuel.new(groupFuel, "Aircraft/IDG-A32X/Models/Instruments/Lower-ECAM/res/fuel.svg");
lowerECAM_press = canvas_lowerECAM_press.new(groupPress, "Aircraft/IDG-A32X/Models/Instruments/Lower-ECAM/res/press.svg");
2018-04-13 17:21:18 +00:00
lowerECAM_status = canvas_lowerECAM_status.new(groupStatus, "Aircraft/IDG-A32X/Models/Instruments/Lower-ECAM/res/status.svg");
2018-04-12 16:54:25 +00:00
lowerECAM_hyd = canvas_lowerECAM_hyd.new(groupHyd, "Aircraft/IDG-A32X/Models/Instruments/Lower-ECAM/res/hyd.svg");
2017-10-05 16:22:36 +00:00
lowerECAM_wheel = canvas_lowerECAM_wheel.new(groupWheel, "Aircraft/IDG-A32X/Models/Instruments/Lower-ECAM/res/wheel.svg");
2017-11-20 22:03:07 +00:00
lowerECAM_test = canvas_lowerECAM_test.new(group_test, "Aircraft/IDG-A32X/Models/Instruments/Common/res/du-test.svg");
2018-09-23 23:32:14 +00:00
2017-09-24 14:11:49 +00:00
lowerECAM_update.start();
});
2017-07-29 19:35:38 +00:00
2017-09-24 14:11:49 +00:00
var lowerECAM_update = maketimer(0.05, func {
2017-07-30 04:41:20 +00:00
canvas_lowerECAM_base.update();
2017-07-29 19:35:38 +00:00
});
var showLowerECAM = func {
var dlg = canvas.Window.new([512, 512], "dialog").set("resize", 1);
dlg.setCanvas(lowerECAM_display);
}