1
0
Fork 0

Merge branch 'dev' into 3D

This commit is contained in:
legoboyvdlp R 2020-06-27 23:28:03 +01:00
commit 61b6ec6534
9 changed files with 2352 additions and 2325 deletions

View file

@ -294,8 +294,8 @@ var canvas_MCDU_base = {
"Simple_R6","Simple_R1S","Simple_R2S","Simple_R3S","Simple_R4S","Simple_R5S","Simple_R6S","Simple_R1_Arrow","Simple_R2_Arrow","Simple_R3_Arrow", "Simple_R6","Simple_R1S","Simple_R2S","Simple_R3S","Simple_R4S","Simple_R5S","Simple_R6S","Simple_R1_Arrow","Simple_R2_Arrow","Simple_R3_Arrow",
"Simple_R4_Arrow","Simple_R5_Arrow","Simple_R6_Arrow","Simple_C1","Simple_C2","Simple_C3","Simple_C3B","Simple_C4","Simple_C4B","Simple_C5","Simple_C6","Simple_C1S", "Simple_R4_Arrow","Simple_R5_Arrow","Simple_R6_Arrow","Simple_C1","Simple_C2","Simple_C3","Simple_C3B","Simple_C4","Simple_C4B","Simple_C5","Simple_C6","Simple_C1S",
"Simple_C2S","Simple_C3S","Simple_C4S","Simple_C5S","Simple_C6S","INITA","INITA_CoRoute","INITA_FltNbr","INITA_CostIndex","INITA_CruiseFLTemp", "Simple_C2S","Simple_C3S","Simple_C4S","Simple_C5S","Simple_C6S","INITA","INITA_CoRoute","INITA_FltNbr","INITA_CostIndex","INITA_CruiseFLTemp",
"INITA_FromTo","INITA_InitRequest","INITA_AlignIRS","INITB","INITB_ZFWCG","INITB_ZFW","INITB_ZFW_S","INITB_Block","FUELPRED","FUELPRED_ZFW", "INITA_FromTo","INITA_InitRequest","INITA_AlignIRS","INITB","INITB_ZFWCG","INITB_ZFW","INITB_ZFWCG_S","INITB_Block","FUELPRED","FUELPRED_ZFW",
"FUELPRED_ZFWCG","FUELPRED_ZFW_S","PROG","PROG_UPDATE","PERFTO","PERFTO_V1","PERFTO_VR","PERFTO_V2","PERFTO_FE","PERFTO_SE","PERFTO_OE","PERFAPPR", "FUELPRED_ZFWCG","FUELPRED_ZFWCG_S","PROG","PROG_UPDATE","PERFTO","PERFTO_V1","PERFTO_VR","PERFTO_V2","PERFTO_FE","PERFTO_SE","PERFTO_OE","PERFAPPR",
"PERFAPPR_FE","PERFAPPR_SE","PERFAPPR_OE","PERFAPPR_LDG_3","PERFAPPR_LDG_F","PERFGA","PERFGA_FE","PERFGA_SE","PERFGA_OE","FPLN","FPLN_From", "PERFAPPR_FE","PERFAPPR_SE","PERFAPPR_OE","PERFAPPR_LDG_3","PERFAPPR_LDG_F","PERFGA","PERFGA_FE","PERFGA_SE","PERFGA_OE","FPLN","FPLN_From",
"FPLN_TMPY_group","FPLN_FROM","FPLN_Callsign","departureTMPY", "arrowsDepArr","arrow1L","arrow2L","arrow3L","arrow4L","arrow5L","arrow1R","arrow2R", "FPLN_TMPY_group","FPLN_FROM","FPLN_Callsign","departureTMPY", "arrowsDepArr","arrow1L","arrow2L","arrow3L","arrow4L","arrow5L","arrow1R","arrow2R",
"arrow3R","arrow4R","arrow5R","DIRTO_TMPY_group","IRSINIT","IRSINIT_1","IRSINIT_2","IRSINIT_star"]; "arrow3R","arrow4R","arrow5R","DIRTO_TMPY_group","IRSINIT","IRSINIT_1","IRSINIT_2","IRSINIT_star"];
@ -1483,7 +1483,7 @@ var canvas_MCDU_base = {
me.fontRightS(default, default, default, default, default, default); me.fontRightS(default, default, default, default, default, default);
me.fontSizeLeft(small, small, small, small, small, small); me.fontSizeLeft(small, small, small, small, small, small);
me.fontSizeCenter(small, small, small, small, small, small); me.fontSizeCenter(normal, small, small, small, small, small);
me.fontSizeRight(normal, normal, normal, small, small, small); me.fontSizeRight(normal, normal, normal, small, small, small);
me["Simple_C4B"].setFontSize(small); me["Simple_C4B"].setFontSize(small);
@ -1754,28 +1754,30 @@ var canvas_MCDU_base = {
} }
} }
me["Simple_R1S"].setText("ZFWCG/ ZFW"); me["Simple_R1S"].setText("ZFW/ZFWCG");
me["Simple_R1"].setText(sprintf("%3.1f", zfw.getValue())); me["Simple_R1"].setText(sprintf("%3.1f", zfwcg.getValue()));
me["INITB_ZFWCG"].hide();
me["INITB_ZFWCG_S"].show();
me["Simple_R1"].show();
if (zfwcgSet.getValue() == 1) { if (zfwcgSet.getValue() == 1) {
me["Simple_C1"].setFontSize(normal); me["Simple_R1"].setFontSize(normal);
me["Simple_C1"].setText(" " ~ sprintf("%3.1f", zfwcg.getValue()));
me["INITB_ZFWCG"].hide();
} else { } else {
me["Simple_C1"].setFontSize(small); me["Simple_R1"].setFontSize(small);
me["Simple_C1"].setText(" " ~ sprintf("%3.1f", zfwcg.getValue()));
me["INITB_ZFWCG"].hide();
} }
if (zfwSet.getValue() == 1) { if (zfwSet.getValue() == 1) {
if (zfw.getValue() < 100) {
me["Simple_C1"].setText(" " ~ sprintf("%3.1f", zfw.getValue()));
} else {
me["Simple_C1"].setText(" " ~ sprintf("%3.1f", zfw.getValue()));
}
me["Simple_C1"].show();
me["INITB_ZFW"].hide(); me["INITB_ZFW"].hide();
me["INITB_ZFW_S"].show();
me["Simple_R1"].show();
} else { } else {
me["Simple_C1"].hide();
me["INITB_ZFW"].show(); me["INITB_ZFW"].show();
me["INITB_ZFW_S"].hide();
me["Simple_R1"].hide();
} }
if (taxi_fuel_set.getValue() == 1) { if (taxi_fuel_set.getValue() == 1) {
me["Simple_L1"].setFontSize(normal); me["Simple_L1"].setFontSize(normal);
} else { } else {
@ -1860,7 +1862,7 @@ var canvas_MCDU_base = {
me.fontRightS(default, default, default, default, default, default); me.fontRightS(default, default, default, default, default, default);
me.fontSizeLeft(normal, normal, small, small, small, small); me.fontSizeLeft(normal, normal, small, small, small, small);
me.fontSizeCenter(small, small, small, small, small, small); me.fontSizeCenter(small, small, normal, small, small, small);
me.fontSizeRight(normal, normal, normal, small, small, small); me.fontSizeRight(normal, normal, normal, small, small, small);
me["Simple_C3B"].setFontSize(small); me["Simple_C3B"].setFontSize(small);
@ -2026,26 +2028,28 @@ var canvas_MCDU_base = {
me.colorRight("ack", "ack", "blu", "grn", "grn", "grn"); me.colorRight("ack", "ack", "blu", "grn", "grn", "grn");
} }
me["Simple_R3S"].setText("ZFWCG/ZFW"); me["Simple_R3S"].setText("ZFW/ZFWCG");
me["Simple_R3"].setText(sprintf("%3.1f", zfw.getValue())); me["Simple_R3"].setText(sprintf("%3.1f", zfwcg.getValue()));
me["Simple_R3"].show();
me["FUELPRED_ZFWCG"].hide();
me["FUELPRED_ZFWCG_S"].show();
if (zfwcgSet.getValue() == 1) { if (zfwcgSet.getValue() == 1) {
me["Simple_C3"].setFontSize(normal); me["Simple_R3"].setFontSize(normal);
me["Simple_C3"].setText(" " ~ sprintf("%3.1f", zfwcg.getValue()));
me["FUELPRED_ZFWCG"].hide();
} else { } else {
me["Simple_C3"].setFontSize(small); me["Simple_R3"].setFontSize(small);
me["Simple_C3"].setText(" " ~ sprintf("%3.1f", zfwcg.getValue()));
me["FUELPRED_ZFWCG"].hide();
} }
if (zfwSet.getValue() == 1) { if (zfwSet.getValue() == 1) {
if (zfw.getValue() < 100) {
me["Simple_C3"].setText(" " ~ sprintf("%3.1f", zfw.getValue()));
} else {
me["Simple_C3"].setText(" " ~ sprintf("%3.1f", zfw.getValue()));
}
me["Simple_C3"].show();
me["FUELPRED_ZFW"].hide(); me["FUELPRED_ZFW"].hide();
me["FUELPRED_ZFW_S"].show();
me["Simple_R3"].show();
} else { } else {
me["Simple_C3"].hide();
me["FUELPRED_ZFW"].show(); me["FUELPRED_ZFW"].show();
me["FUELPRED_ZFW_S"].hide();
me["Simple_R3"].hide();
} }
if (rte_rsv_set.getValue() == 1) { if (rte_rsv_set.getValue() == 1) {

File diff suppressed because it is too large Load diff

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 143 KiB

View file

@ -368,8 +368,8 @@ var flightPlanController = {
# use createWP here as createWPFrom doesn't accept waypoints # use createWP here as createWPFrom doesn't accept waypoints
# createWPFrom worked before... but be sure! # createWPFrom worked before... but be sure!
me.flightplans[plan].insertWP(createWP(waypointGhost, waypointGhost.wp_name), 2); me.flightplans[plan].insertWP(createWP(waypointGhost, waypointGhost.id), 2);
fmgc.windController.insertWind(plan, 2, 0, waypointGhost.wp_name); fmgc.windController.insertWind(plan, 2, 0, waypointGhost.id);
me.addDiscontinuity(3, plan); me.addDiscontinuity(3, plan);
} else { } else {
# we want to delete the intermediate waypoints up to but not including the waypoint. Leave index 0, we delete it later. # we want to delete the intermediate waypoints up to but not including the waypoint. Leave index 0, we delete it later.

View file

@ -170,7 +170,7 @@ var MessageController = {
TypeIMessage.new("LIST OF 20 IN USE"),TypeIMessage.new("PILOT ELEMENT RETAINED"),TypeIMessage.new("NOT ALLOWED"), TypeIMessage.new("LIST OF 20 IN USE"),TypeIMessage.new("PILOT ELEMENT RETAINED"),TypeIMessage.new("NOT ALLOWED"),
TypeIMessage.new("NOT IN DATA BASE"),TypeIMessage.new("ONLY SPD ENTRY ALLOWED"),TypeIMessage.new("REVISION IN PROGRESS"), TypeIMessage.new("NOT IN DATA BASE"),TypeIMessage.new("ONLY SPD ENTRY ALLOWED"),TypeIMessage.new("REVISION IN PROGRESS"),
TypeIMessage.new("TMPY F-PLN EXISTS", 1),TypeIMessage.new("SELECT DESIRED SYSTEM"),TypeIMessage.new("SELECT HDG/TRK FIRST"), TypeIMessage.new("TMPY F-PLN EXISTS", 1),TypeIMessage.new("SELECT DESIRED SYSTEM"),TypeIMessage.new("SELECT HDG/TRK FIRST"),
TypeIMessage.new("USING COST INDEX N", 1),TypeIMessage.new("WAIT FOR SYSTEM RESPONSE"), TypeIMessage.new("USING COST INDEX N", 1),TypeIMessage.new("WAIT FOR SYSTEM RESPONSE"),TypeIMessage.new("RWY/LS MISMATCH"),
]), ]),
typeIIMessages: std.Vector.new([ typeIIMessages: std.Vector.new([
TypeIIMessage.new("LAT DISCONT AHEAD", "amb", 0),TypeIIMessage.new("MORE DRAG"),TypeIIMessage.new("RWY/LS MISMATCH", "amb", 0),TypeIIMessage.new("STEP DELETED"), TypeIIMessage.new("LAT DISCONT AHEAD", "amb", 0),TypeIIMessage.new("MORE DRAG"),TypeIIMessage.new("RWY/LS MISMATCH", "amb", 0),TypeIIMessage.new("STEP DELETED"),

View file

@ -254,6 +254,7 @@ var dirTo = {
dirToFlag = 0; dirToFlag = 0;
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0); fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0);
me.L1 = [" [ ]", " WAYPOINT", "blu"]; me.L1 = [" [ ]", " WAYPOINT", "blu"];
me.fontMatrix = [[1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0]];
me.R1 = ["---- --- ", "UTC DIST ", "wht"]; me.R1 = ["---- --- ", "UTC DIST ", "wht"];
} else { } else {
mcdu_message(me.computer, "NOT ALLOWED"); mcdu_message(me.computer, "NOT ALLOWED");
@ -264,6 +265,7 @@ var dirTo = {
dirToFlag = 0; dirToFlag = 0;
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1); fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1);
me.L1 = [" [ ]", " WAYPOINT", "blu"]; me.L1 = [" [ ]", " WAYPOINT", "blu"];
me.fontMatrix = [[1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0]];
me.R1 = ["---- --- ", "UTC DIST ", "wht"]; me.R1 = ["---- --- ", "UTC DIST ", "wht"];
setprop("MCDU[" ~ me.computer ~ "]/page", "F-PLNA"); # todo - remember horizontal srcoll of f-plna? setprop("MCDU[" ~ me.computer ~ "]/page", "F-PLNA"); # todo - remember horizontal srcoll of f-plna?
} else { } else {

View file

@ -148,14 +148,9 @@ var fuelPredInput = func(key, i) {
if (scratchpad == "CLR") { if (scratchpad == "CLR") {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "NOT ALLOWED");
} else { } else {
if (!getprop("/FMGC/internal/cost-index-set")) { var zfw_min = 80.6; #make based on performance
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index")); var zfw_max = 134.5; #61,000 kg, make based on performance
setprop("/FMGC/internal/cost-index-set", 1); if (size(scratchpad) == 0) {
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index"));
}
var tfs = size(scratchpad);
if (tfs == 0) {
var zfw = getprop("/fdm/jsbsim/inertia/weight-lbs") - getprop("/consumables/fuel/total-fuel-lbs"); var zfw = getprop("/fdm/jsbsim/inertia/weight-lbs") - getprop("/consumables/fuel/total-fuel-lbs");
setprop("/FMGC/internal/zfw", sprintf("%3.1f", math.round(zfw / 1000, 0.1))); setprop("/FMGC/internal/zfw", sprintf("%3.1f", math.round(zfw / 1000, 0.1)));
setprop("/FMGC/internal/zfw-set", 1); setprop("/FMGC/internal/zfw-set", 1);
@ -167,26 +162,45 @@ var fuelPredInput = func(key, i) {
setprop("/FMGC/internal/block-calculating", 0); setprop("/FMGC/internal/block-calculating", 0);
setprop("/FMGC/internal/block-confirmed", 1); setprop("/FMGC/internal/block-confirmed", 1);
} }
} else if (tfs >= 2 and tfs <= 11 and find("/", scratchpad) != -1) { mcdu_scratchpad.scratchpads[i].empty();
} else if (find("/", scratchpad) != -1) {
var zfwi = split("/", scratchpad); var zfwi = split("/", scratchpad);
var zfwcg = num(zfwi[0]); var zfw = num(zfwi[0]);
var zfw = num(zfwi[1]); var zfwcg = num(zfwi[1]);
var zfwcgs = size(zfwi[0]); var zfws = size(zfwi[0]);
var zfws = size(zfwi[1]); var zfwcgs = size(zfwi[1]);
if (zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) { if (zfw != nil and zfws > 0 and zfws <= 5 and size(split(".", zfwi[0])[1]) <= 1 and zfwcg != nil and zfwcgs > 0 and zfwcgs <= 4 and size(split(".", zfwi[1])[1]) <= 1) {
setprop("/FMGC/internal/zfwcg", zfwcg); if (zfw >= zfw_min and zfw <= zfw_max and zfwcg >= 8.0 and zfwcg <= 45.0) {
setprop("/FMGC/internal/zfwcg-set", 1); setprop("/FMGC/internal/zfw", zfw);
if (getprop("/FMGC/internal/block-set") != 1) { setprop("/FMGC/internal/zfw-set", 1);
setprop("/FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000)); setprop("/FMGC/internal/zfwcg", zfwcg);
setprop("/FMGC/internal/block-set", 1); setprop("/FMGC/internal/zfwcg-set", 1);
setprop("/FMGC/internal/fuel-request-set", 1); if (getprop("/FMGC/internal/block-set") != 1) {
setprop("/FMGC/internal/fuel-calculating", 1); setprop("/FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
setprop("/FMGC/internal/block-calculating", 0); setprop("/FMGC/internal/block-set", 1);
setprop("/FMGC/internal/block-confirmed", 1); setprop("/FMGC/internal/fuel-request-set", 1);
setprop("/FMGC/internal/fuel-calculating", 1);
setprop("/FMGC/internal/block-calculating", 0);
setprop("/FMGC/internal/block-confirmed", 1);
}
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "ENTRY OUT OF RANGE");
} }
} else if (zfws == 0 and zfwcg != nil and zfwcgs > 0 and zfwcgs <= 4 and size(split(".", zfwi[1])[1]) <= 1) {
if (zfwcg >= 8.0 and zfwcg <= 45.0) {
setprop("/FMGC/internal/zfwcg", zfwcg);
setprop("/FMGC/internal/zfwcg-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "ENTRY OUT OF RANGE");
}
} else {
mcdu_message(i, "NOT ALLOWED");
} }
if (zfw != nil and zfws >= 1 and zfws <= 5 and zfw > 0 and zfw <= 999.9) { } else if (num(scratchpad) != nil and size(scratchpad) > 0 and size(scratchpad) <= 5 and size(split(".", scratchpad)[1]) <= 1) {
setprop("/FMGC/internal/zfw", zfw); if (scratchpad >= zfw_min and scratchpad <= zfw_max) {
setprop("/FMGC/internal/zfw", scratchpad);
setprop("/FMGC/internal/zfw-set", 1); setprop("/FMGC/internal/zfw-set", 1);
if (getprop("/FMGC/internal/block-set") != 1) { if (getprop("/FMGC/internal/block-set") != 1) {
setprop("/FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000)); setprop("/FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
@ -196,35 +210,19 @@ var fuelPredInput = func(key, i) {
setprop("/FMGC/internal/block-calculating", 0); setprop("/FMGC/internal/block-calculating", 0);
setprop("/FMGC/internal/block-confirmed", 1); setprop("/FMGC/internal/block-confirmed", 1);
} }
if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 1);
}
}
if ((zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) or (zfw != nil and zfws >= 1 and zfws <= 5 and zfw > 0 and zfw <= 999.9)) {
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
} else { } else {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "ENTRY OUT OF RANGE");
}
} else if (tfs >= 1 and tfs <= 5) {
var zfwcg = size(scratchpad);
if (num(scratchpad) != nil and zfwcg >= 1 and zfwcg <= 5 and scratchpad > 0 and scratchpad <= 99.9) {
setprop("/FMGC/internal/zfwcg", scratchpad);
setprop("/FMGC/internal/zfwcg-set", 1);
if (getprop("/FMGC/internal/block-set") != 1) {
setprop("/FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
setprop("/FMGC/internal/block-set", 1);
setprop("/FMGC/internal/fuel-request-set", 1);
setprop("/FMGC/internal/fuel-calculating", 1);
setprop("/FMGC/internal/block-calculating", 0);
setprop("/FMGC/internal/block-confirmed", 1);
}
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
} }
} else { } else {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "NOT ALLOWED");
} }
if (!getprop("/FMGC/internal/cost-index-set") and getprop("/FMGC/internal/tofrom-set")) {
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index"));
setprop("/FMGC/internal/cost-index-set", 1);
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index"));
}
} }
} else if (key == "R4") { } else if (key == "R4") {
if (scratchpad == "CLR") { if (scratchpad == "CLR") {

View file

@ -20,9 +20,12 @@ var initInputB = func(key, i) {
if (num(scratchpad) != nil and scratchpad >= 0.0 and scratchpad <= 9.9) { if (num(scratchpad) != nil and scratchpad >= 0.0 and scratchpad <= 9.9) {
setprop("/FMGC/internal/taxi-fuel", scratchpad); setprop("/FMGC/internal/taxi-fuel", scratchpad);
setprop("/FMGC/internal/taxi-fuel-set", 1); setprop("/FMGC/internal/taxi-fuel-set", 1);
setprop("/FMGC/internal/fuel-calculating", 1); if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 1);
} else if (getprop("/FMGC/internal/fuel-request-set")) {
setprop("/FMGC/internal/block-calculating", 1);
}
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
fmgc.updateFuel();
} else { } else {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "NOT ALLOWED");
} }
@ -148,14 +151,14 @@ var initInputB = func(key, i) {
if (scratchpad == "CLR") { if (scratchpad == "CLR") {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "NOT ALLOWED");
} else { } else {
if (!getprop("/FMGC/internal/cost-index-set")) { if (!getprop("/FMGC/internal/cost-index-set") and getprop("/FMGC/internal/tofrom-set")) {
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index")); mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index"));
setprop("/FMGC/internal/cost-index-set", 1); setprop("/FMGC/internal/cost-index-set", 1);
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index")); setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index"));
} }
var zfw_min = 80.6; #make based on performance
var tfs = size(scratchpad); var zfw_max = 134.5; #61,000 kg, make based on performance
if (tfs == 0) { if (size(scratchpad) == 0) {
var zfw = getprop("/fdm/jsbsim/inertia/weight-lbs") - getprop("/consumables/fuel/total-fuel-lbs"); var zfw = getprop("/fdm/jsbsim/inertia/weight-lbs") - getprop("/consumables/fuel/total-fuel-lbs");
setprop("/FMGC/internal/zfw", sprintf("%3.1f", math.round(zfw / 1000, 0.1))); setprop("/FMGC/internal/zfw", sprintf("%3.1f", math.round(zfw / 1000, 0.1)));
setprop("/FMGC/internal/zfw-set", 1); setprop("/FMGC/internal/zfw-set", 1);
@ -171,18 +174,49 @@ var initInputB = func(key, i) {
} else if (getprop("/FMGC/internal/fuel-request-set")) { } else if (getprop("/FMGC/internal/fuel-request-set")) {
setprop("/FMGC/internal/block-calculating", 1); setprop("/FMGC/internal/block-calculating", 1);
} }
} else if (tfs >= 2 and tfs <= 11 and find("/", scratchpad) != -1) { mcdu_scratchpad.scratchpads[i].empty();
} else if (find("/", scratchpad) != -1) {
var zfwi = split("/", scratchpad); var zfwi = split("/", scratchpad);
var zfwcg = num(zfwi[0]); var zfw = num(zfwi[0]);
var zfw = num(zfwi[1]); var zfwcg = num(zfwi[1]);
var zfwcgs = size(zfwi[0]); var zfws = size(zfwi[0]);
var zfws = size(zfwi[1]); var zfwcgs = size(zfwi[1]);
if (zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) { if (zfw != nil and zfws > 0 and zfws <= 5 and size(split(".", zfwi[0])[1]) <= 1 and zfwcg != nil and zfwcgs > 0 and zfwcgs <= 4 and size(split(".", zfwi[1])[1]) <= 1) {
setprop("/FMGC/internal/zfwcg", zfwi[0]); if (zfw >= zfw_min and zfw <= zfw_max and zfwcg >= 8.0 and zfwcg <= 45.0) {
setprop("/FMGC/internal/zfwcg-set", 1); setprop("/FMGC/internal/zfw", zfw);
setprop("/FMGC/internal/zfw-set", 1);
setprop("/FMGC/internal/zfwcg", zfwcg);
setprop("/FMGC/internal/zfwcg-set", 1);
if (!getprop("/FMGC/internal/block-confirmed") and getprop("/FMGC/internal/block-set")) {
setprop("/FMGC/internal/tow", num(getprop("/FMGC/internal/zfw") + getprop("/FMGC/internal/block") - getprop("/FMGC/internal/taxi-fuel")));
setprop("/FMGC/internal/tow-set", 1);
setprop("/FMGC/internal/fuel-request-set", 1);
setprop("/FMGC/internal/fuel-calculating", 1);
setprop("/FMGC/internal/block-calculating", 0);
setprop("/FMGC/internal/block-confirmed", 1);
} else if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 1);
} else if (getprop("/FMGC/internal/fuel-request-set")) {
setprop("/FMGC/internal/block-calculating", 1);
}
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "ENTRY OUT OF RANGE");
}
} else if (zfws == 0 and zfwcg != nil and zfwcgs > 0 and zfwcgs <= 4 and size(split(".", zfwi[1])[1]) <= 1) {
if (zfwcg >= 8.0 and zfwcg <= 45.0) {
setprop("/FMGC/internal/zfwcg", zfwcg);
setprop("/FMGC/internal/zfwcg-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "ENTRY OUT OF RANGE");
}
} else {
mcdu_message(i, "NOT ALLOWED");
} }
if (zfw != nil and zfws >= 1 and zfws <= 5 and zfw > 0 and zfw <= 999.9) { } else if (num(scratchpad) != nil and size(scratchpad) > 0 and size(scratchpad) <= 5 and size(split(".", scratchpad)[1]) <= 1) {
setprop("/FMGC/internal/zfw", zfwi[1]); if (scratchpad >= zfw_min and scratchpad <= zfw_max) {
setprop("/FMGC/internal/zfw", scratchpad);
setprop("/FMGC/internal/zfw-set", 1); setprop("/FMGC/internal/zfw-set", 1);
if (!getprop("/FMGC/internal/block-confirmed") and getprop("/FMGC/internal/block-set")) { if (!getprop("/FMGC/internal/block-confirmed") and getprop("/FMGC/internal/block-set")) {
setprop("/FMGC/internal/tow", num(getprop("/FMGC/internal/zfw") + getprop("/FMGC/internal/block") - getprop("/FMGC/internal/taxi-fuel"))); setprop("/FMGC/internal/tow", num(getprop("/FMGC/internal/zfw") + getprop("/FMGC/internal/block") - getprop("/FMGC/internal/taxi-fuel")));
@ -196,20 +230,9 @@ var initInputB = func(key, i) {
} else if (getprop("/FMGC/internal/fuel-request-set")) { } else if (getprop("/FMGC/internal/fuel-request-set")) {
setprop("/FMGC/internal/block-calculating", 1); setprop("/FMGC/internal/block-calculating", 1);
} }
}
if ((zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) or (zfw != nil and zfws >= 1 and zfws <= 5 and zfw > 0 and zfw <= 999.9)) {
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
} else { } else {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "ENTRY OUT OF RANGE");
}
} else if (tfs >= 1 and tfs <= 5) {
var zfwcg = size(scratchpad);
if (num(scratchpad) != nil and zfwcg >= 1 and zfwcg <= 5 and scratchpad > 0 and scratchpad <= 99.9) {
setprop("/FMGC/internal/zfwcg", scratchpad);
setprop("/FMGC/internal/zfwcg-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
} }
} else { } else {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "NOT ALLOWED");

View file

@ -88,7 +88,7 @@ var MCDU_reset = func(i) {
# INT-B # INT-B
setprop("/FMGC/internal/zfw", 0); setprop("/FMGC/internal/zfw", 0);
setprop("/FMGC/internal/zfw-set", 0); setprop("/FMGC/internal/zfw-set", 0);
setprop("/FMGC/internal/zfwcg", 55.1); setprop("/FMGC/internal/zfwcg", 25.0);
setprop("/FMGC/internal/zfwcg-set", 0); setprop("/FMGC/internal/zfwcg-set", 0);
setprop("/FMGC/internal/block", 0.0); setprop("/FMGC/internal/block", 0.0);
setprop("/FMGC/internal/block-set", 0); setprop("/FMGC/internal/block-set", 0);
@ -168,7 +168,7 @@ var MCDU_reset = func(i) {
setprop("/FMGC/internal/dest-mag", -1); setprop("/FMGC/internal/dest-mag", -1);
setprop("/FMGC/internal/dest-wind", -1); setprop("/FMGC/internal/dest-wind", -1);
# setprop("/FMGC/internal/dest-mag-grnd", -1); # setprop("/FMGC/internal/dest-mag-grnd", -1);
# setprop("/FMGC/internal/dest-wind-grnd", -1); # setprop("/FMGC/internal/dest-wind-grnd", -1);
setprop("/FMGC/internal/vapp-speed-set", 0); setprop("/FMGC/internal/vapp-speed-set", 0);
setprop("/FMGC/internal/final", ""); setprop("/FMGC/internal/final", "");
setprop("/FMGC/internal/baro", 99999); setprop("/FMGC/internal/baro", 99999);

View file

@ -68,7 +68,7 @@ var radnavInput = func(key, i) {
setprop("/FMGC/internal/ils1freq-set", 1); setprop("/FMGC/internal/ils1freq-set", 1);
mcdu_scratchpad.scratchpads[i].empty(); mcdu_scratchpad.scratchpads[i].empty();
if (num(getprop("/FMGC/internal/ils1freq-calculated")) != 0 and num(getprop("/FMGC/internal/ils1freq-calculated")) != num(getprop("instrumentation/nav[0]/frequencies/selected-mhz"))) { if (num(getprop("/FMGC/internal/ils1freq-calculated")) != 0 and num(getprop("/FMGC/internal/ils1freq-calculated")) != num(getprop("instrumentation/nav[0]/frequencies/selected-mhz"))) {
genericMessage(i, "RWY/LS MISMATCH", "amb"); mcdu_message(i, "RWY/LS MISMATCH");
} }
} else { } else {
mcdu_message(i, "NOT ALLOWED"); mcdu_message(i, "NOT ALLOWED");