1
0
Fork 0

FMGC: remove properties for navDatabase

This commit is contained in:
Jonathan Redpath 2021-12-28 12:43:14 +00:00
parent 4cc86d0ab0
commit c0ae1c58f4
3 changed files with 26 additions and 31 deletions

View file

@ -81,9 +81,6 @@ var mcdu1_lgt = props.globals.getNode("/controls/lighting/DU/mcdu1", 1);
var mcdu2_lgt = props.globals.getNode("/controls/lighting/DU/mcdu2", 1);
var acType = props.globals.getNode("/MCDUC/type", 1);
var engType = props.globals.getNode("/MCDUC/eng", 1);
var database1 = props.globals.getNode("/FMGC/internal/navdatabase", 1);
var database2 = props.globals.getNode("/FMGC/internal/navdatabase2", 1);
var databaseCode = props.globals.getNode("/FMGC/internal/navdatabasecode", 1);
# INT-A
var ADIRSMCDUBTN = props.globals.getNode("/controls/adirs/mcducbtn", 1);
@ -2134,9 +2131,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();

View file

@ -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;
@ -918,18 +913,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);
@ -940,9 +933,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);
@ -1124,15 +1118,23 @@ 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

View file

@ -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);