diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index c2b8d476..7c95987d 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -484,14 +484,6 @@ - - select - engine_fault_1 - - systems/unused/unused-ped - - - select engine_fire_1 @@ -512,15 +504,7 @@ 1.0 - - - select - engine_fault_2 - - systems/unused/unused-ped - - - + select engine_fire_2 @@ -1005,13 +989,14 @@ + + + - + + select - abs_low_on - abs_med_on - abs_max_on alt-text alt-text-test ap1_led @@ -1019,9 +1004,9 @@ appr_led arpt_led arpt_led.001 - a-thr_led atc-code atc-test + a-thr_led audio_att_led audio_att_sgn audio_call_hf2_led @@ -1033,19 +1018,169 @@ audio_hf2_led audio_mech_led audio_mech_sgn + audio_pa_led audio_voice_led audio_vhf1_led audio_vhf2_led audio_vhf3_led - autoland_light_on - brk_fan_on - brk_hot_on - cstr_led cstr_led.001 + exped_led + fcu_screen + fd1_led + fd2_led + fpa-text + hdg-text + hdg-text-test + ils_led + ils2_led + loc_led + mach-text + ndb_led + ndb_led.001 + qnh-hpa + qnh-inhg + qnh-std + qnh-test + radio_adf_led + radio_am_led + radio_bfo_led + radio_hf1_led + radio_hf2_led + radio_ls_led + radio_nav_led + radio_opt_led + radio_vhf1_led + radio_vhf2_led + radio_vhf3_led + radio_vor_led + spd-text + spd-text-test + vord_led + vord_led.001 + vs-text + vs-text-last-2-digits + vs-text-test + wpt_led + wpt_led.001 + prio_capt.arrow + prio_capt.capt + prio_fo.arrow + prio_fo_fo + + + + systems/electrical/bus/ac-si-bus + 110 + + + systems/electrical/bus/ac-ess-shed + 110 + + + + + + + + select + autoland_light_on + master_caution_on + master_warning_on + + + + systems/electrical/bus/ac-si-bus + 110 + + + systems/electrical/bus/ac-ess-shed + 110 + + + /systems/electrical/bus/ac-2 + 110 + + + + + + + + select + engine_fire_1 + engine_fire_2 + gear_lever_down_arrow + lgear_down + lgear_unlk + ngear_down + ngear_unlk + rgear_down + rgear_unlk + + + + systems/electrical/bus/ac-si-bus + 110 + + + systems/electrical/bus/ac-ess-shed + 110 + + + + + + + + + select + brk_fan_on + brk_hot_on + CockpitDoorFault + CockpitDoorOpen + engine_fault_1 + engine_fault_2 + prio_fo.arrow + prio_fo_fo + + + /systems/electrical/bus/ac-2 + 110 + + + + + + + + select + abs_low_on + abs_med_on + abs_max_on dec_low_on dec_med_on dec_max_on + prio_capt.arrow + prio_capt.arrow.001 + prio_capt.capt + prio_capt.capt.001 + radio_sel_led + terr_on_nd_on_l + terr_on_nd_on_r + + + /systems/electrical/bus/ac-1 + 110 + + + + + + + select ecam_apu_led ecam_bleed_led ecam_cond_led @@ -1062,70 +1197,6 @@ ecam_press_led ecam_sts_led ecam_wheel_led - exped_led - fcu_screen - fd1_led - fd2_led - fpa-text - hdg-text - hdg-text-test - ils_led - ils2_led - lgear_down - lgear_unlk - loc_led - mach-text - master_caution_on - master_warning_on - ndb_led - ndb_led.001 - ngear_down - ngear_unlk - qnh-hpa - qnh-inhg - qnh-std - qnh-test - radio_adf_led - radio_am_led - radio_bfo_led - radio_hf1_led - radio_hf2_led - radio_ls_led - radio_nav_led - radio_opt_led - radio_sel_led - radio_vhf1_led - radio_vhf2_led - radio_vhf3_led - radio_vor_led - rgear_down - rgear_unlk - spd-text - spd-text-test - terr_on_nd_label - terr_on_nd_on_l - terr_on_nd_on_r - vord_led - vord_led.001 - vs-text - vs-text-last-2-digits - vs-text-test - wpt_led - wpt_led.001 - prio_capt.arrow - prio_capt.capt - prio_fo.arrow - prio_fo_fo - - - systems/electrical/bus/dc-ess - 25 - - - - - - select rudder-trim-letter rudder-trim @@ -1153,7 +1224,6 @@ select - atc-test audio_att_sgn audio_call_hf2_led audio_call_hf1_led @@ -6070,28 +6140,16 @@ select gear_lever_down_arrow - - - - systems/electrical/bus/ac-ess - 110 - - - systems/electrical/bus/ac-2 - 110 - - - - - controls/switches/annun-test - 1 - - - ECAM/warnings/landing-gear-warning-light - 1 - - - + + + controls/switches/annun-test + 1 + + + ECAM/warnings/landing-gear-warning-light + 1 + + @@ -6099,28 +6157,16 @@ material gear_lever_down_arrow - - - - systems/electrical/bus/ac-ess - 110 - - - systems/electrical/bus/ac-2 - 110 - - - - - controls/switches/annun-test - 1 - - - ECAM/warnings/landing-gear-warning-light - 1 - - - + + + controls/switches/annun-test + 1 + + + ECAM/warnings/landing-gear-warning-light + 1 + + 1.00 diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index a3e42ac2..a6662d67 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -2456,9 +2456,9 @@ var canvas_MCDU_base = { } me["Simple_L1"].setText(sprintf("%s", engType.getValue())); - me["Simple_L2"].setText(sprintf("%s", " " ~ database1.getValue())); - me["Simple_L3"].setText(sprintf("%s", " " ~ database2.getValue())); - me["Simple_R2"].setText(sprintf("%s", databaseCode.getValue() ~ " ")); + me["Simple_L2"].setText(" " ~ fmgc.navDataBase.currentDate); + me["Simple_L3"].setText(" " ~ fmgc.navDataBase.standbyDate); + me["Simple_R2"].setText(fmgc.navDataBase.currentCode); if (fmgc.WaypointDatabase.getCount() >= 1) { me["Simple_R4"].show(); diff --git a/Models/Instruments/OHpanel/OHpanel.xml b/Models/Instruments/OHpanel/OHpanel.xml index c93cd57e..33ae4154 100644 --- a/Models/Instruments/OHpanel/OHpanel.xml +++ b/Models/Instruments/OHpanel/OHpanel.xml @@ -8,57 +8,70 @@ - + + select - ACPack1Btn1F - ACPack1Btn2O - ACPack2Btn1F - ACPack2Btn2O - ADR1Btn1F - ADR1Btn2O - ADR2Btn1F - ADR2Btn2O - ADR3Btn1F - ADR3Btn2O - BatteryBtn11F - BatteryBtn21F - BusTieBtn2O - DitchBtn2O - EmerExtLtBtn2O - Eng1AntiIceBtn1F - Eng1AntiIceBtn2O - Eng2AntiIceBtn1F - Eng2AntiIceBtn2O - ExtPwrBtn2O - IR1Btn1F - IR1Btn2O - IR2Btn1F - IR2Btn2O - IR3Btn1F - IR3Btn2O + AftCargoIsoBtn1F + AftCargoIsoBtn2O + APUBleedBtn1F + APUBleedBtn2O + BlueElecPump1F + BlueElecPump2O + CargoHotAirBtn1F + CargoHotAirBtn2O + CrewOxyBtn2O + ExtPwrBtn1A + GalleyPwrBtn1F + GalleyPwrBtn2O + Gen1LineBtn1S + Gen1LineBtn2O + FuelXfeedBtn1O + FuelXfeedBtn2O + LFuelTank1Btn1F + LFuelTank1Btn2O + PassOxyInd1S RamAirBtn2O + RFuelTank1Btn1F + RFuelTank1Btn2O WingAntiIceBtn1F WingAntiIceBtn2O - VentBlowBtn1F - systems/electrical/bus/ac-ess - 5 + systems/electrical/bus/ac-ess-shed + 110 + select + ACPack1Btn1F + ACPack1Btn2O + APUFireAgtBtn1S + APUFireAgtBtn2D APUGenBtn1F APUGenBtn2O APUMasterBtn1F APUMasterBtn2O APUStartBtn1A APUStartBtn2O - APUFireAgtBtn1S - APUFireAgtBtn2D + BatteryBtn11F + BatteryBtn21F + BatteryBtn12O + BatteryBtn22O + BusTieBtn2O + CabinPressModeBtn1F + CabinPressModeBtn2M + DitchBtn2O + ELAC1Btn1F + ELAC1Btn2O + EmerCallBtn1C + EmerCallBtn2O + EmerExtLtBtn2O Eng1FireAgt1Btn1S Eng1FireAgt1Btn2D Eng2FireAgt1Btn1S @@ -67,71 +80,100 @@ Eng1FireAgt2Btn2D Eng2FireAgt2Btn1S Eng2FireAgt2Btn2D - ELAC1Btn1F - ELAC1Btn2O - FAC1Btn1F - FAC1Btn2O - Gen1Btn1F - Gen1Btn2O - Gen2Btn1F - Gen2Btn2O - SEC1Btn1F - SEC1Btn2O - - - - systems/electrical/bus/ac-si-bus - 5 - - - systems/electrical/bus/ac-ess - 5 - - - - - - - select - ACESSFeedBtn1F - ACESSFeedBtn2A - AftCargoIsoBtn1F - AftCargoIsoBtn2O - AftCargoSmkBtn1S - AftCargoSmkBtn2D - BlueElecPump1F - BlueElecPump2O - CabinPressModeBtn1F - CabinPressModeBtn2M - CabinFansBtn2O - CargoHotAirBtn1F - CargoHotAirBtn2O - CFuelTank1Btn1F - CFuelTank1Btn2O - CFuelTank2Btn1F - CFuelTank2Btn2O - CrewOxyBtn2O - ELAC2Btn1F - ELAC2Btn2O - EmerCallBtn1C - EmerCallBtn2O - EmerGenInd1F Eng1ManStartBtn2O Eng2ManStartBtn2O EvacCommandBtn1E EvacCommandBtn2O + FAC1Btn1F + FAC1Btn2O + Gen1Btn2O + Gen2Btn2O + IDG1Btn1F + IDG2Btn1F + SEC1Btn1F + SEC1Btn2O + VentBlowBtn1F + VentBlowBtn2O + VentExtractBtn1F + VentExtractBtn2O + + + + systems/electrical/bus/ac-si-bus + 110 + + + systems/electrical/bus/ac-ess-shed + 110 + + + + + + + + select + ACESSFeedBtn1F + ACESSFeedBtn2A + ACPack2Btn1F + ACPack2Btn2O + CFuelTank1Btn1F + CFuelTank1Btn2O + ELAC2Btn1F + ELAC2Btn2O + Eng2AntiIceBtn1F + Eng2AntiIceBtn2O + Eng2BleedBtn1F + Eng2BleedBtn2O FAC2Btn1F FAC2Btn2O + LFuelTank2Btn1F + LFuelTank2Btn2O + PrbWinHeatBtn2O + PTU1F + PTU2O + RFuelTank2Btn1F + RFuelTank2Btn2O + SEC2Btn1F + SEC2Btn2O + SEC3Btn1F + SEC3Btn2O + YellowElecPump1F + YellowElecPump2O + YellowEngPump1F + YellowEngPump2O + + + /systems/electrical/bus/ac-2 + 110 + + + + + + + select + ADR1Btn1F + ADR1Btn2O + ADR2Btn1F + ADR2Btn2O + ADR3Btn1F + ADR3Btn2O + AftCargoSmkBtn1S + AftCargoSmkBtn2D + CabinFansBtn2O + CFuelTank2Btn1F + CFuelTank2Btn2O + EmerGenInd1F + Eng1AntiIceBtn1F + Eng1AntiIceBtn2O + Eng1BleedBtn1F + Eng1BleedBtn2O + ExtPwrBtn2O FuelModeBtn1F FuelModeBtn2O - FuelXfeedBtn1O - FuelXfeedBtn2O FwdCargoSmkBtn1S FwdCargoSmkBtn2D - GalleyPwrBtn1F - GalleyPwrBtn2O - Gen1LineBtn1S - Gen1LineBtn2O GPWSBtn1F GPWSBtn2O GPWSFlpBtn2O @@ -143,60 +185,18 @@ GreenEngPump2O HotAirBtn1F HotAirBtn2O - IDG1Btn1F - IDG2Btn1F - LFuelTank1Btn1F - LFuelTank1Btn2O - LFuelTank2Btn1F - LFuelTank2Btn2O - PassOxyInd1S - PrbWinHeatBtn2O - PTU1F - PTU2O - RamAirBtn2O + IR1Btn1F + IR1Btn2O + IR2Btn1F + IR2Btn2O + IR3Btn1F + IR3Btn2O RcdrGndCtlBtn2O - RFuelTank1Btn1F - RFuelTank1Btn2O - RFuelTank2Btn1F - RFuelTank2Btn2O - SEC2Btn1F - SEC2Btn2O - SEC3Btn1F - SEC3Btn2O - VentBlowBtn2O - VentExtractBtn1F - VentExtractBtn2O - YellowElecPump1F - YellowElecPump2O - YellowEngPump1F - YellowEngPump2O - - systems/electrical/bus/dc-ess - 25 - - - - - - select - Eng1BleedBtn1F - Eng1BleedBtn2O - Eng2BleedBtn1F - Eng2BleedBtn2O - APUBleedBtn1F - APUBleedBtn2O - - - - systems/electrical/bus/dc-2 - 25 - - - systems/electrical/bus/dc-ess-shed - 25 - - + + /systems/electrical/bus/ac-1 + 110 + @@ -3048,22 +3048,16 @@ select BatteryBtn12O - - - - controls/electrical/switches/bat-1 - 0 - - - controls/switches/annun-test - 1 - - - - systems/electrical/bus/dc-bat - 25 - - + + + controls/electrical/switches/bat-1 + 0 + + + controls/switches/annun-test + 1 + + @@ -3115,22 +3109,16 @@ select BatteryBtn22O - - - - controls/electrical/switches/bat-2 - 0 - - - controls/switches/annun-test - 1 - - - - systems/electrical/bus/dc-bat - 25 - - + + + controls/electrical/switches/bat-2 + 0 + + + controls/switches/annun-test + 1 + + @@ -3276,16 +3264,19 @@ select Gen1Btn1F - - - systems/electrical/light/gen-1-fault - 1 - - - controls/switches/annun-test - 1 - - + + + + systems/electrical/light/gen-1-fault + 1 + + + controls/switches/annun-test + 1 + + + /systems/electrical/sources/idg-1/gcu-1-powered + @@ -3520,18 +3511,10 @@ controls/electrical/switches/ground-cart 1 - - - controls/switches/annun-test - 1 - - - - systems/electrical/bus/ac-ess - 110 - - - + + controls/switches/annun-test + 1 + @@ -3586,16 +3569,19 @@ select Gen2Btn1F - - - systems/electrical/light/gen-2-fault - 1 - - - controls/switches/annun-test - 1 - - + + + + systems/electrical/light/gen-2-fault + 1 + + + controls/switches/annun-test + 1 + + + /systems/electrical/sources/idg-2/gcu-2-powered + @@ -6662,10 +6648,28 @@ material Eng1FireBtn - - systems/fire/engine1/warning-active - controls/switches/annun-test - + + + systems/fire/engine1/warning-active + controls/switches/annun-test + + + + + systems/electrical/bus/ac-si-bus + 110 + + + systems/electrical/bus/ac-ess-shed + 110 + + + + /systems/electrical/bus/ac-1 + 110 + + + 1.0 @@ -7009,10 +7013,28 @@ material APUFireBtn - - systems/fire/apu/warning-active - controls/switches/annun-test - + + + systems/fire/apu/warning-active + controls/switches/annun-test + + + + + systems/electrical/bus/ac-si-bus + 110 + + + systems/electrical/bus/ac-ess-shed + 110 + + + + /systems/electrical/bus/ac-1 + 110 + + + 1.0 @@ -7162,10 +7184,28 @@ material Eng2FireBtn - - systems/fire/engine2/warning-active - controls/switches/annun-test - + + + systems/fire/engine2/warning-active + controls/switches/annun-test + + + + + systems/electrical/bus/ac-si-bus + 110 + + + systems/electrical/bus/ac-ess-shed + 110 + + + + /systems/electrical/bus/ac-1 + 110 + + + 1.0 diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 8713738a..cfaf45b1 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -3564,13 +3564,13 @@ var messages_right_memo = func { wing_aice.active = 0; } - if (systems.PNEU.Switch.apu.getValue() == 1 and pts.APU.rpm.getValue() >= 95) { + if (systems.PNEU.Switch.apu.getValue() == 1 and systems.PNEU.Valves.apu.getValue() != 0 and systems.APUController.APU != nil and systems.APUController.APU.signals.available.getBoolValue()) { apu_bleed.active = 1; } else { apu_bleed.active = 0; } - if (apu_bleed.active == 0 and pts.APU.rpm.getValue() >= 95) { + if (apu_bleed.active == 0 and systems.APUController.APU != nil and systems.APUController.APU.signals.available.getBoolValue()) { apu_avail.active = 1; } else { apu_avail.active = 0; diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 3ee91787..270f6bac 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -4,11 +4,6 @@ ################## # Init Functions # ################## - -var database1 = 0; -var database2 = 0; -var code1 = 0; -var code2 = 0; var gear0 = 0; var state1 = 0; var state2 = 0; @@ -71,14 +66,13 @@ var FMGCinit = func { FMGCInternal.mngSpdCmd = 157; FMGCInternal.mngKtsMach = 0; FMGCInternal.machSwitchover = 0; - setprop("/FMGC/internal/loc-source", "NAV0"); setprop("/FMGC/internal/optalt", 0); - setprop("/FMGC/internal/landing-time", -99); + FMGCInternal.landingTime = -99; + FMGCInternal.blockFuelTime = -99; + FMGCInternal.fuelPredTime = -99; FMGCAlignTime[0].setValue(-99); FMGCAlignTime[1].setValue(-99); FMGCAlignTime[2].setValue(-99); - setprop("/FMGC/internal/block-fuel-time", -99); - setprop("/FMGC/internal/fuel-pred-time", -99); masterFMGC.start(); radios.start(); } @@ -220,6 +214,10 @@ var FMGCInternal = { mngSpd: 0, mngSpdCmd: 0, + landingTime: -99, + blockFuelTime: -99, + fuelPredTime: -99, + # RADNAV ADF1: { freqSet: 0, @@ -913,18 +911,16 @@ var masterFMGC = maketimer(0.2, func { ############################ #handle radios, runways, v1/vr/v2 ############################ -var airportRadiosPhase = nil; var updateAirportRadios = func { - - airportRadiosPhase = FMGCInternal.phase; - departure_rwy = fmgc.flightPlanController.flightplans[2].departure_runway; destination_rwy = fmgc.flightPlanController.flightplans[2].destination_runway; - if (airportRadiosPhase >= 2 and destination_rwy != nil) { + + if (FMGCInternal.phase >= 2 and destination_rwy != nil) { var airport = airportinfo(FMGCInternal.arrApt); setprop("/FMGC/internal/ldg-elev", airport.elevation * M2FT); # eventually should be runway elevation - magnetic_hdg = geo.normdeg(destination_rwy.heading - getprop("/environment/magnetic-variation-deg")); + magnetic_hdg = geo.normdeg(destination_rwy.heading - pts.Environment.magVar.getValue()); runway_ils = destination_rwy.ils_frequency_mhz; + if (runway_ils != nil and !fmgc.FMGCInternal.ILS.freqSet and !fmgc.FMGCInternal.ILS.crsSet) { fmgc.FMGCInternal.ILS.freqCalculated = runway_ils; pts.Instrumentation.Nav.Frequencies.selectedMhz[0].setValue(runway_ils); @@ -935,9 +931,10 @@ var updateAirportRadios = func { } elsif (!fmgc.FMGCInternal.ILS.crsSet) { pts.Instrumentation.Nav.Radials.selectedDeg[0].setValue(magnetic_hdg); } - } elsif (airportRadiosPhase <= 1 and departure_rwy != nil) { - magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("/environment/magnetic-variation-deg")); + } elsif (FMGCInternal.phase <= 1 and departure_rwy != nil) { + magnetic_hdg = geo.normdeg(departure_rwy.heading - pts.Environment.magVar.getValue()); runway_ils = departure_rwy.ils_frequency_mhz; + if (runway_ils != nil and !fmgc.FMGCInternal.ILS.freqSet and !fmgc.FMGCInternal.ILS.crsSet) { fmgc.FMGCInternal.ILS.freqCalculated = runway_ils; pts.Instrumentation.Nav.Frequencies.selectedMhz[0].setValue(runway_ils); @@ -1119,27 +1116,35 @@ var ManagedSPD = maketimer(0.25, func { } }); +# Nav Database +var navDataBase = { + currentCode: "AB20170101", + currentDate: "01JAN-28JAN", + standbyCode: "AB20170102", + standbyDate: "29JAN-26FEB", +}; + +var tempStoreCode = nil; +var tempStoreDate = nil; var switchDatabase = func { - database1 = getprop("/FMGC/internal/navdatabase"); - database2 = getprop("/FMGC/internal/navdatabase2"); - code1 = getprop("/FMGC/internal/navdatabasecode"); - code2 = getprop("/FMGC/internal/navdatabasecode2"); - setprop("/FMGC/internal/navdatabase", database2); - setprop("/FMGC/internal/navdatabase2", database1); - setprop("/FMGC/internal/navdatabasecode", code2); - setprop("/FMGC/internal/navdatabasecode2", code1); + tempStoreCode = navDataBase.currentCode; + tempStoreDate = navDataBase.currentDate; + navDataBase.currentCode = navDataBase.standbyCode; + navDataBase.currentDate = navDataBase.standbyDate; + navDataBase.standbyCode = tempStoreCode; + navDataBase.standbyDate = tempStoreDate; } # Landing to phase 7 -setlistener("/gear/gear[1]/wow", func() { - if (getprop("/gear/gear[1]/wow") == 0 and timer30secLanding.isRunning) { +setlistener("/gear/gear[1]/wow", func(val) { + if (val.getValue() == 0 and timer30secLanding.isRunning) { timer30secLanding.stop(); - setprop("/FMGC/internal/landing-time", -99); + FMGCInternal.landingTime = -99; } - if (pts.Gear.wow[1].getValue() and getprop("/FMGC/internal/landing-time") == -99) { + if (val.getValue() and FMGCInternal.landingTime == -99) { timer30secLanding.start(); - setprop("/FMGC/internal/landing-time", pts.Sim.Time.elapsedSec.getValue()); + FMGCInternal.landingTime = pts.Sim.Time.elapsedSec.getValue(); } }, 0, 0); @@ -1182,34 +1187,34 @@ setlistener("/systems/navigation/adr/operating-3", func() { # Calculate Block Fuel setlistener("/FMGC/internal/block-calculating", func() { if (timer3blockFuel.isRunning) { - setprop("/FMGC/internal/block-fuel-time", -99); + FMGCInternal.blockFuelTime = -99; timer3blockFuel.start(); - setprop("/FMGC/internal/block-fuel-time", pts.Sim.Time.elapsedSec.getValue()); + FMGCInternal.blockFuelTime = pts.Sim.Time.elapsedSec.getValue(); } - if (getprop("/FMGC/internal/block-fuel-time") == -99) { + if (FMGCInternal.blockFuelTime == -99) { timer3blockFuel.start(); - setprop("/FMGC/internal/block-fuel-time", pts.Sim.Time.elapsedSec.getValue()); + FMGCInternal.blockFuelTime = pts.Sim.Time.elapsedSec.getValue(); } }, 0, 0); # Calculate Fuel Prediction setlistener("/FMGC/internal/fuel-calculating", func() { if (timer5fuelPred.isRunning) { - setprop("/FMGC/internal/fuel-pred-time", -99); + FMGCInternal.fuelPredTime = -99; timer5fuelPred.start(); - setprop("/FMGC/internal/fuel-pred-time", pts.Sim.Time.elapsedSec.getValue()); + FMGCInternal.fuelPredTime = pts.Sim.Time.elapsedSec.getValue(); } - if (getprop("/FMGC/internal/fuel-pred-time") == -99) { + if (FMGCInternal.fuelPredTime == -99) { timer5fuelPred.start(); - setprop("/FMGC/internal/fuel-pred-time", pts.Sim.Time.elapsedSec.getValue()); + FMGCInternal.fuelPredTime = pts.Sim.Time.elapsedSec.getValue(); } }, 0, 0); # Maketimers var timer30secLanding = maketimer(1, func() { - if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/landing-time") + 30) { + if (pts.Sim.Time.elapsedSec.getValue() > FMGCInternal.landingTime + 30) { FMGCInternal.phase = 7; if (FMGCInternal.costIndexSet) { @@ -1217,7 +1222,7 @@ var timer30secLanding = maketimer(1, func() { } else { setprop("/FMGC/internal/last-cost-index", 0); } - setprop("/FMGC/internal/landing-time", -99); + FMGCInternal.landingTime = -99; timer30secLanding.stop(); } }); @@ -1247,21 +1252,21 @@ var timer48gpsAlign3 = maketimer(1, func() { }); var timer3blockFuel = maketimer(1, func() { - if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/block-fuel-time") + 3) { + if (pts.Sim.Time.elapsedSec.getValue() > FMGCInternal.blockFuelTime + 3) { #updateFuel(); fmgc.FMGCInternal.blockCalculating = 0; fmgc.blockCalculating.setValue(0); - setprop("/FMGC/internal/block-fuel-time", -99); + FMGCInternal.blockFuelTime = -99; timer3blockFuel.stop(); } }); var timer5fuelPred = maketimer(1, func() { - if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/fuel-pred-time") + 5) { + if (pts.Sim.Time.elapsedSec.getValue() > FMGCInternal.fuelPredTime + 5) { #updateFuel(); fmgc.FMGCInternal.fuelCalculating = 0; fmgc.fuelCalculating.setValue(0); - setprop("/FMGC/internal/fuel-pred-time", -99); + FMGCInternal.fuelPredTime = -99; timer5fuelPred.stop(); } }); diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index c1e8fd8d..a13ed750 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -25,10 +25,6 @@ var MCDU_reset = func(i) { setprop("/FMGC/keyboard-right", 0); #ACCONFIG - setprop("/FMGC/internal/navdatabase", "01JAN-28JAN"); - setprop("/FMGC/internal/navdatabase2", "29JAN-26FEB"); - setprop("/FMGC/internal/navdatabasecode", "AB20170101"); - setprop("/FMGC/internal/navdatabasecode2", "AB20170102"); setprop("/FMGC/print/mcdu/page1/L1auto", 0); setprop("/FMGC/print/mcdu/page1/L2auto", 0); setprop("/FMGC/print/mcdu/page1/L3auto", 0); diff --git a/Nasal/Systems/APU.nas b/Nasal/Systems/APU.nas index 0ec3635c..919c9cf6 100644 --- a/Nasal/Systems/APU.nas +++ b/Nasal/Systems/APU.nas @@ -273,24 +273,6 @@ var APU = { me.autoStop(); } - if (systems.ELEC.Bus.dcBat.getValue() < 25) { - if (!me._powerLost) { - me._powerLost = 1; - settimer(func() { - if (me._powerLost) { - if (me.GenericControls.starter.getValue()) { - me.GenericControls.starter.setValue(0); - } - if (me.state != 0) { - me.autoStop(); - } - } - }, 0.2); - } - } else { - me._powerLost = 0; - } - if (systems.ELEC.EmerElec.getValue() == 1 and (systems.ELEC.EmerElec45.getValue() != 1 and systems.ELEC.Source.EmerGen.voltsRelay.getValue() < 110)) { me.inhibitEMERELEC = 1; } else { @@ -316,6 +298,19 @@ var APUController = { } }; +setlistener("/systems/apu/shutdown-power-loss", func(val) { + if (APUController.APU != nil) { + if (val.getBoolValue()) { + if (APUController.APU.GenericControls.starter.getValue()) { + APUController.APU.GenericControls.starter.setValue(0); + } + if (APUController.APU.state != 0) { + APUController.APU.autoStop(); + } + } + } +}, 0, 0); + var _masterTime = 0; setlistener("/controls/apu/master", func() { if (APUController.APU != nil) { diff --git a/Systems/a320-apu.xml b/Systems/a320-apu.xml index f7f10382..dcb4c054 100644 --- a/Systems/a320-apu.xml +++ b/Systems/a320-apu.xml @@ -8,52 +8,52 @@ - + - - - - - /controls/pneumatics/switches/apu - 1 - - 252 - 0 - - - - - - - - - - /systems/electrical/relay/apu-glc/output - 110 - - 132 - 0 - - - - - - - - - /systems/apu/electrical-load-kw - /systems/apu/bleed-load-kw - - 400 - - - - - - /systems/apu/apu-load-cmd - 0.01 - - + + + + + /controls/pneumatics/switches/apu + 1 + + 252 + 0 + + + + + + + + + + /systems/electrical/relay/apu-glc/output + 110 + + 132 + 0 + + + + + + + + + /systems/apu/electrical-load-kw + /systems/apu/bleed-load-kw + + 400 + + + + + + /systems/apu/apu-load-cmd + 0.01 + + /engines/engine[2]/n1 1 @@ -61,60 +61,60 @@ - - - /systems/apu/apu-load - 50 - - - - - /engines/engine[2]/n1 - 0.5 - - - /systems/apu/dn-dt - 0 - - - - /engines/engine[2]/n1 - - 5.0 20.0 - 8.0 45.0 - 10.0 120.0 - 12.0 225.0 - 18.0 430.0 - 25.0 500.0 - 27.0 560.0 - 30.0 720.0 - 35.0 785.0 - 40.0 800.0 - 45.0 795.0 - 50.0 785.0 - 60.0 755.0 - 75.0 645.0 - 90.0 520.0 - 100.0 415.0 - -
- - /engines/engine[2]/n1 - - 2.0 200.0 - 8.0 220.0 - 12.0 225.0 - 18.0 240.0 - 30.0 250.0 - 50.0 265.0 - 60.0 295.0 - 75.0 380.0 - 90.0 410.0 - 100.0 415.0 - -
-
-
+ + + /systems/apu/apu-load + 50 + + + + + /engines/engine[2]/n1 + 0.5 + + + /systems/apu/dn-dt + 0 + + + + /engines/engine[2]/n1 + + 5.0 20.0 + 8.0 45.0 + 10.0 120.0 + 12.0 225.0 + 18.0 430.0 + 25.0 500.0 + 27.0 560.0 + 30.0 720.0 + 35.0 785.0 + 40.0 800.0 + 45.0 795.0 + 50.0 785.0 + 60.0 755.0 + 75.0 645.0 + 90.0 520.0 + 100.0 415.0 + +
+ + /engines/engine[2]/n1 + + 2.0 200.0 + 8.0 220.0 + 12.0 225.0 + 18.0 240.0 + 30.0 250.0 + 50.0 265.0 + 60.0 295.0 + 75.0 380.0 + 90.0 410.0 + 100.0 415.0 + +
+
+
@@ -138,31 +138,31 @@ - - + + - - - 1.0 - - /systems/apu/apu-load - 0.3 - - - - /systems/apu/oil/oil-pressure-psi - - 0 0 - 25 135 - 35 105 - 55 85 - -
- - /engines/engine[2]/n1 - 100 - -
+ + + 1.0 + + /systems/apu/apu-load + 0.3 + + + + /systems/apu/oil/oil-pressure-psi + + 0 0 + 25 135 + 35 105 + 55 85 + +
+ + /engines/engine[2]/n1 + 100 + +
@@ -171,10 +171,10 @@ /systems/apu/oil/level-l - - /engines/engine[2]/n1 - 100 - + + /engines/engine[2]/n1 + 100 + /systems/apu/oil/allow-oil-consumption -0.00000131437 simulation/channel-dt @@ -183,6 +183,27 @@ /systems/apu/oil/level-l
+ + + + + /systems/electrical/bus/dc-bat lt 25 + + + + + /systems/apu/shutdown-power-loss-cmd + 5 + 100 + + + + + + /systems/apu/shutdown-power-loss-timer eq 1 + + +
diff --git a/Systems/a320-electrical.xml b/Systems/a320-electrical.xml index 9f837d12..7b939241 100644 --- a/Systems/a320-electrical.xml +++ b/Systems/a320-electrical.xml @@ -2153,7 +2153,7 @@ - + /systems/electrical/bus/ac-1 lt 110 @@ -2163,20 +2163,33 @@ /systems/electrical/relay/ext-epc/contact-pos eq 0 /controls/electrical/switches/gen-1 eq 0 - /systems/failures/electrical/gen-1 eq 1 + /ECAM/warnings/logic/gen-1-inop eq 1 /controls/electrical/switches/gen-2 eq 0 - /systems/failures/electrical/gen-2 eq 1 + /ECAM/warnings/logic/gen-2-inop eq 1 /controls/electrical/switches/apu eq 0 - /systems/failures/electrical/apu eq 1 - /engines/engine[2]/n1 lt 94.9 + /ECAM/warnings/logic/apu-gen-fault eq 1 + /systems/apu/available eq 0 + + /systems/electrical/some-electric-thingie/emer-elec-config-cmd + 5 + 100 + + + + + + /systems/electrical/some-electric-thingie/emer-elec-config-timer eq 1 + + + diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index bda7bca8..bda930f8 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -2833,7 +2833,7 @@ - + /engines/engine[0]/n2-actual lt 59.4 @@ -2841,8 +2841,8 @@ - - /ECAM/warnings/logic/eng/dual-failure-5-sec-input + + /ECAM/warnings/logic/eng/dual-failure-2-sec-input 0.5 100 @@ -2870,7 +2870,7 @@ /controls/engines/engine[0]/cutoff-switch eq 1 /controls/engines/engine[1]/cutoff-switch eq 1 - /ECAM/warnings/logic/eng/dual-failure-5-sec eq 1 + /ECAM/warnings/logic/eng/dual-failure-2-sec eq 1 diff --git a/Systems/a320-lights-proprules.xml b/Systems/a320-lights-proprules.xml index e87ddb14..5b7c323e 100644 --- a/Systems/a320-lights-proprules.xml +++ b/Systems/a320-lights-proprules.xml @@ -53,12 +53,4 @@ /controls/lighting/overhead-panel-norm-digital - - - gain - 1.0 - /controls/lighting/annunciator-lights-tied - /controls/lighting/annunciator-lights - - diff --git a/Systems/a320-lights.xml b/Systems/a320-lights.xml index 5047ecfa..dc56d911 100644 --- a/Systems/a320-lights.xml +++ b/Systems/a320-lights.xml @@ -71,37 +71,29 @@ - /systems/electrical/bus/ac-1 gt 25 + /systems/electrical/bus/ac-1 gt 110 - - /systems/electrical/bus/ac-1 gt 25 + + /systems/electrical/bus/ac-si-bus ge 110 + /systems/electrical/bus/ac-ess-shed ge 110 - /systems/electrical/bus/ac-1 gt 25 + /systems/electrical/bus/ac-1 gt 110 - /systems/electrical/bus/ac-1 gt 25 - - - - - - /systems/electrical/bus/ac-1 gt 110 - /systems/electrical/bus/ac-2 gt 110 - /systems/electrical/bus/dc-2 gt 25