Merge branch 'dev' into pneumatics
This commit is contained in:
commit
6951c78e77
21 changed files with 2490 additions and 2445 deletions
6
.github/ISSUE_TEMPLATE/bug_report.md
vendored
6
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
@ -23,9 +23,9 @@ A clear and concise description of what you expected to happen.
|
|||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
** System (please complete the following information):**
|
||||
- OS:
|
||||
- FlightGear version:
|
||||
**System (please complete the following information):**
|
||||
- OS:
|
||||
- FlightGear version:
|
||||
|
||||
|
||||
**Additional context**
|
||||
|
|
|
@ -972,9 +972,7 @@
|
|||
|
||||
<services n="0">
|
||||
<chocks n="0">
|
||||
<nose type="bool">0</nose>
|
||||
<left type="bool">0</left>
|
||||
<right type="bool">0</right>
|
||||
<enable type="bool">0</enable>
|
||||
</chocks>
|
||||
<fuel-truck>
|
||||
<connect type="bool">0</connect>
|
||||
|
|
|
@ -485,7 +485,7 @@ var taxi_b = func {
|
|||
if (pts.Instrumentation.Altimeter.std.getBoolValue()) {
|
||||
libraries.toggleSTD();
|
||||
}
|
||||
setprop("/instrumentation/altimeter[0]/setting-inhg", getprop("/environment/pressure-sea-level-inhg"));
|
||||
setprop("/instrumentation/altimeter[0]/setting-inhg", getprop("/environment/metar[0]/pressure-inhg") or 29.92);
|
||||
settimer(taxi_c, 2);
|
||||
}
|
||||
var taxi_c = func {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<pitch-deg type="float">0.0</pitch-deg>
|
||||
<min-turn-radius-m type="float">15</min-turn-radius-m>
|
||||
<stopping-distance-m type="float">5.0</stopping-distance-m>
|
||||
<chocks alias="/services/chocks/nose"/>
|
||||
<chocks alias="/services/chocks/enable"/>
|
||||
<available type="int">1</available>
|
||||
<enabled type="int"/>
|
||||
<connected type="bool">false</connected>
|
||||
|
|
|
@ -57,18 +57,9 @@
|
|||
<property>/gear/gear[2]/wow</property>
|
||||
</and>
|
||||
</enable>
|
||||
<property>/services/chocks/nose</property>
|
||||
<property>/services/chocks/enable</property>
|
||||
<binding>
|
||||
<command>property-toggle</command>
|
||||
<property>/services/chocks/left</property>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>property-toggle</command>
|
||||
<property>/services/chocks/right</property>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>property-toggle</command>
|
||||
<property>/services/chocks/nose</property>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<live>true</live>
|
||||
</checkbox>
|
||||
|
@ -136,9 +127,7 @@
|
|||
<and>
|
||||
<or>
|
||||
<property>/controls/gear/brake-parking</property>
|
||||
<property>/services/chocks/nose</property>
|
||||
<property>/services/chocks/left</property>
|
||||
<property>/services/chocks/right</property>
|
||||
<property>/services/chocks/enable</property>
|
||||
</or>
|
||||
<less-than>
|
||||
<property>/velocities/groundspeed-kt</property>
|
||||
|
@ -164,9 +153,7 @@
|
|||
<and>
|
||||
<or>
|
||||
<property>/controls/gear/brake-parking</property>
|
||||
<property>/services/chocks/nose</property>
|
||||
<property>/services/chocks/left</property>
|
||||
<property>/services/chocks/right</property>
|
||||
<property>/services/chocks/enable</property>
|
||||
</or>
|
||||
<less-than>
|
||||
<property>/velocities/groundspeed-kt</property>
|
||||
|
@ -192,9 +179,7 @@
|
|||
<and>
|
||||
<or>
|
||||
<property>/controls/gear/brake-parking</property>
|
||||
<property>/services/chocks/nose</property>
|
||||
<property>/services/chocks/left</property>
|
||||
<property>/services/chocks/right</property>
|
||||
<property>/services/chocks/enable</property>
|
||||
</or>
|
||||
<less-than>
|
||||
<property>/velocities/groundspeed-kt</property>
|
||||
|
|
|
@ -132,7 +132,7 @@
|
|||
<path>Aircraft/A320-family/Models/Services/Chocks/chock_nose.ac</path>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>services/chocks/nose</property>
|
||||
<property>services/chocks/enable</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
|
@ -147,7 +147,7 @@
|
|||
<path>Aircraft/A320-family/Models/Services/Chocks/chock_left.ac</path>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>services/chocks/left</property>
|
||||
<property>services/chocks/enable</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
|
@ -163,7 +163,7 @@
|
|||
<path>Aircraft/A320-family/Models/Services/Chocks/chock_right.ac</path>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>services/chocks/right</property>
|
||||
<property>services/chocks/enable</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
|
|
|
@ -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_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",
|
||||
"INITA_FromTo","INITA_InitRequest","INITA_AlignIRS","INITB","INITB_ZFWCG","INITB_ZFW","INITB_ZFW_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",
|
||||
"INITA_FromTo","INITA_InitRequest","INITA_AlignIRS","INITB","INITB_ZFWCG","INITB_ZFW","INITB_ZFWCG_S","INITB_Block","FUELPRED","FUELPRED_ZFW",
|
||||
"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",
|
||||
"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"];
|
||||
|
@ -1483,7 +1483,7 @@ var canvas_MCDU_base = {
|
|||
me.fontRightS(default, default, default, default, default, default);
|
||||
|
||||
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["Simple_C4B"].setFontSize(small);
|
||||
|
||||
|
@ -1754,28 +1754,30 @@ var canvas_MCDU_base = {
|
|||
}
|
||||
}
|
||||
|
||||
me["Simple_R1S"].setText("ZFWCG/ ZFW");
|
||||
me["Simple_R1"].setText(sprintf("%3.1f", zfw.getValue()));
|
||||
me["Simple_R1S"].setText("ZFW/ZFWCG");
|
||||
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) {
|
||||
me["Simple_C1"].setFontSize(normal);
|
||||
me["Simple_C1"].setText(" " ~ sprintf("%3.1f", zfwcg.getValue()));
|
||||
me["INITB_ZFWCG"].hide();
|
||||
me["Simple_R1"].setFontSize(normal);
|
||||
} else {
|
||||
me["Simple_C1"].setFontSize(small);
|
||||
me["Simple_C1"].setText(" " ~ sprintf("%3.1f", zfwcg.getValue()));
|
||||
me["INITB_ZFWCG"].hide();
|
||||
me["Simple_R1"].setFontSize(small);
|
||||
}
|
||||
|
||||
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_S"].show();
|
||||
me["Simple_R1"].show();
|
||||
} else {
|
||||
me["Simple_C1"].hide();
|
||||
me["INITB_ZFW"].show();
|
||||
me["INITB_ZFW_S"].hide();
|
||||
me["Simple_R1"].hide();
|
||||
}
|
||||
|
||||
|
||||
if (taxi_fuel_set.getValue() == 1) {
|
||||
me["Simple_L1"].setFontSize(normal);
|
||||
} else {
|
||||
|
@ -1860,7 +1862,7 @@ var canvas_MCDU_base = {
|
|||
me.fontRightS(default, default, default, default, default, default);
|
||||
|
||||
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["Simple_C3B"].setFontSize(small);
|
||||
|
||||
|
@ -2026,26 +2028,28 @@ var canvas_MCDU_base = {
|
|||
me.colorRight("ack", "ack", "blu", "grn", "grn", "grn");
|
||||
}
|
||||
|
||||
me["Simple_R3S"].setText("ZFWCG/ZFW");
|
||||
me["Simple_R3"].setText(sprintf("%3.1f", zfw.getValue()));
|
||||
me["Simple_R3S"].setText("ZFW/ZFWCG");
|
||||
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) {
|
||||
me["Simple_C3"].setFontSize(normal);
|
||||
me["Simple_C3"].setText(" " ~ sprintf("%3.1f", zfwcg.getValue()));
|
||||
me["FUELPRED_ZFWCG"].hide();
|
||||
me["Simple_R3"].setFontSize(normal);
|
||||
} else {
|
||||
me["Simple_C3"].setFontSize(small);
|
||||
me["Simple_C3"].setText(" " ~ sprintf("%3.1f", zfwcg.getValue()));
|
||||
me["FUELPRED_ZFWCG"].hide();
|
||||
me["Simple_R3"].setFontSize(small);
|
||||
}
|
||||
|
||||
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_S"].show();
|
||||
me["Simple_R3"].show();
|
||||
} else {
|
||||
me["Simple_C3"].hide();
|
||||
me["FUELPRED_ZFW"].show();
|
||||
me["FUELPRED_ZFW_S"].hide();
|
||||
me["Simple_R3"].hide();
|
||||
}
|
||||
|
||||
if (rte_rsv_set.getValue() == 1) {
|
||||
|
@ -3768,6 +3772,7 @@ var canvas_MCDU_base = {
|
|||
me["ArrowRight"].show();
|
||||
me["arrowsDepArr"].show();
|
||||
me["Simple_L1_Arrow"].hide();
|
||||
me["Simple_L2_Arrow"].hide();
|
||||
me["Simple_L3_Arrow"].hide();
|
||||
me["Simple_L4_Arrow"].hide();
|
||||
me["Simple_L5_Arrow"].hide();
|
||||
|
@ -3778,7 +3783,8 @@ var canvas_MCDU_base = {
|
|||
me["Simple_R4_Arrow"].hide();
|
||||
me["Simple_R5_Arrow"].hide();
|
||||
me["Simple_R6_Arrow"].hide();
|
||||
|
||||
me["arrow2L"].hide();
|
||||
me["arrow2R"].hide();
|
||||
me["Simple_L0S"].hide();
|
||||
me["Simple_C3B"].hide();
|
||||
me["Simple_C4B"].hide();
|
||||
|
|
File diff suppressed because it is too large
Load diff
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 143 KiB |
|
@ -106,8 +106,6 @@ var flightPlanController = {
|
|||
print(err[0]);
|
||||
print("Load failed.");
|
||||
}
|
||||
# try to fix fgfp
|
||||
me.flightplans[3].destination = airportinfo(getprop("/FMGC/internal/arr-arpt"));
|
||||
me.destroyTemporaryFlightPlan(3, 1);
|
||||
},
|
||||
|
||||
|
@ -117,34 +115,36 @@ var flightPlanController = {
|
|||
me.resetFlightplan(2);
|
||||
me.flightplans[2] = me.flightplans[n].clone();
|
||||
|
||||
if (mcdu.isNoSid[n] == 1) {
|
||||
mcdu.isNoSid[2] = 1;
|
||||
} else {
|
||||
mcdu.isNoSid[2] = 0;
|
||||
}
|
||||
|
||||
if (mcdu.isNoStar[n] == 1) {
|
||||
mcdu.isNoStar[2] = 1;
|
||||
} else {
|
||||
mcdu.isNoStar[2] = 0;
|
||||
}
|
||||
|
||||
if (mcdu.isNoVia[n] == 1) {
|
||||
mcdu.isNoVia[2] = 1;
|
||||
} else {
|
||||
mcdu.isNoVia[2] = 0;
|
||||
}
|
||||
|
||||
if (mcdu.isNoTransDep[n] == 1) {
|
||||
mcdu.isNoTransDep[2] = 1;
|
||||
} else {
|
||||
mcdu.isNoTransDep[2] = 0;
|
||||
}
|
||||
|
||||
if (mcdu.isNoTransArr[n] == 1) {
|
||||
mcdu.isNoTransArr[2] = 1;
|
||||
} else {
|
||||
mcdu.isNoTransArr[2] = 0;
|
||||
if (n != 3) {
|
||||
if (mcdu.isNoSid[n] == 1) {
|
||||
mcdu.isNoSid[2] = 1;
|
||||
} else {
|
||||
mcdu.isNoSid[2] = 0;
|
||||
}
|
||||
|
||||
if (mcdu.isNoStar[n] == 1) {
|
||||
mcdu.isNoStar[2] = 1;
|
||||
} else {
|
||||
mcdu.isNoStar[2] = 0;
|
||||
}
|
||||
|
||||
if (mcdu.isNoVia[n] == 1) {
|
||||
mcdu.isNoVia[2] = 1;
|
||||
} else {
|
||||
mcdu.isNoVia[2] = 0;
|
||||
}
|
||||
|
||||
if (mcdu.isNoTransDep[n] == 1) {
|
||||
mcdu.isNoTransDep[2] = 1;
|
||||
} else {
|
||||
mcdu.isNoTransDep[2] = 0;
|
||||
}
|
||||
|
||||
if (mcdu.isNoTransArr[n] == 1) {
|
||||
mcdu.isNoTransArr[2] = 1;
|
||||
} else {
|
||||
mcdu.isNoTransArr[2] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
me.flightPlanChanged(2);
|
||||
|
@ -168,10 +168,10 @@ var flightPlanController = {
|
|||
me.destroyTemporaryFlightPlan(0, 0);
|
||||
me.destroyTemporaryFlightPlan(1, 0);
|
||||
me.currentToWptIndex.setValue(0);
|
||||
me.arrivalIndex = [0, 0, 0]; # reset arrival index calculations
|
||||
}
|
||||
|
||||
me.addDiscontinuity(1, plan);
|
||||
#debug.dump(me.flightplans[2]);
|
||||
# reset mcdu if it exists
|
||||
if (canvas_mcdu.myFpln[0] != nil) { canvas_mcdu.myFpln[0].scroll = 0; }
|
||||
if (canvas_mcdu.myFpln[1] != nil) { canvas_mcdu.myFpln[1].scroll = 0; }
|
||||
|
@ -368,8 +368,8 @@ var flightPlanController = {
|
|||
|
||||
# use createWP here as createWPFrom doesn't accept waypoints
|
||||
# createWPFrom worked before... but be sure!
|
||||
me.flightplans[plan].insertWP(createWP(waypointGhost, waypointGhost.wp_name), 2);
|
||||
fmgc.windController.insertWind(plan, 2, 0, waypointGhost.wp_name);
|
||||
me.flightplans[plan].insertWP(createWP(waypointGhost, waypointGhost.id), 2);
|
||||
fmgc.windController.insertWind(plan, 2, 0, waypointGhost.id);
|
||||
me.addDiscontinuity(3, plan);
|
||||
} else {
|
||||
# we want to delete the intermediate waypoints up to but not including the waypoint. Leave index 0, we delete it later.
|
||||
|
@ -824,6 +824,12 @@ var flightPlanController = {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (me.flightplans[2].getWP(me.arrivalIndex[2]) == nil or me.flightplans[2].getWP(1) == nil) {
|
||||
me.arrivalDist = 9999;
|
||||
print(me.arrivalIndex[2]);
|
||||
}
|
||||
|
||||
me.arrivalDist = me.flightplans[2].getWP(me.arrivalIndex[2]).distance_along_route - me.flightplans[2].getWP(1).leg_distance + me._arrivalDist;
|
||||
me.updateMCDUDriver(n);
|
||||
},
|
||||
|
|
|
@ -170,7 +170,7 @@ var MessageController = {
|
|||
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("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([
|
||||
TypeIIMessage.new("LAT DISCONT AHEAD", "amb", 0),TypeIIMessage.new("MORE DRAG"),TypeIIMessage.new("RWY/LS MISMATCH", "amb", 0),TypeIIMessage.new("STEP DELETED"),
|
||||
|
|
|
@ -268,7 +268,7 @@ var systemsLoop = maketimer(0.1, func {
|
|||
systems.APUController.loop();
|
||||
systems.HFLoop();
|
||||
|
||||
if ((getprop("/controls/pneumatics/switches/groundair") or getprop("/controls/electrical/ground-cart")) and ((getprop("/velocities/groundspeed-kt") > 2) or (getprop("/controls/gear/brake-parking") == 0 and getprop("/services/chocks/nose") == 0 and getprop("/services/chocks/left") == 0 and getprop("/services/chocks/right") == 0))) {
|
||||
if ((getprop("/controls/pneumatics/switches/groundair") or getprop("/controls/electrical/ground-cart")) and ((getprop("/velocities/groundspeed-kt") > 2) or (getprop("/controls/gear/brake-parking") == 0 and getprop("/services/chocks/enable") == 0))) {
|
||||
setprop("/controls/electrical/ground-cart", 0);
|
||||
setprop("/controls/pneumatics/switches/groundair", 0);
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ var arrivalPage = {
|
|||
if (fmgc.flightPlanController.flightplans[2].approach != nil) {
|
||||
me.selectedApproach = fmgc.flightPlanController.flightplans[2].approach;
|
||||
|
||||
if (getprop("/sim/version/flightgear") == "2020.2.0") {
|
||||
if (getprop("/sim/version/flightgear") == "2020.2.0" or getprop("/sim/version/flightgear") == "2020.2.1" or getprop("/sim/version/flightgear") == "2020.3.0") {
|
||||
if (fmgc.flightPlanController.flightplans[2].approach_trans != nil) {
|
||||
me.selectedVIA = fmgc.flightPlanController.flightplans[2].approach_trans;
|
||||
} elsif (isNoVia[2] == 1) {
|
||||
|
@ -98,7 +98,7 @@ var arrivalPage = {
|
|||
} else {
|
||||
if (fmgc.flightPlanController.flightplans[me.computer].approach != nil) {
|
||||
me.selectedApproach = fmgc.flightPlanController.flightplans[me.computer].approach;
|
||||
if (getprop("/sim/version/flightgear") == "2020.2.0") {
|
||||
if (getprop("/sim/version/flightgear") == "2020.2.0" or getprop("/sim/version/flightgear") == "2020.2.1" or getprop("/sim/version/flightgear") == "2020.3.0") {
|
||||
if (fmgc.flightPlanController.flightplans[me.computer].approach_trans != nil) {
|
||||
me.selectedVIA = fmgc.flightPlanController.flightplans[me.computer].approach_trans;
|
||||
} elsif (isNoVia[me.computer] == 1) {
|
||||
|
@ -107,7 +107,7 @@ var arrivalPage = {
|
|||
}
|
||||
} elsif (fmgc.flightPlanController.flightplans[2].approach != nil) {
|
||||
me.selectedApproach = fmgc.flightPlanController.flightplans[2].approach;
|
||||
if (getprop("/sim/version/flightgear") == "2020.2.0") {
|
||||
if (getprop("/sim/version/flightgear") == "2020.2.0" or getprop("/sim/version/flightgear") == "2020.2.1" or getprop("/sim/version/flightgear") == "2020.3.0") {
|
||||
if (fmgc.flightPlanController.flightplans[2].approach_trans != nil) {
|
||||
me.selectedVIA = fmgc.flightPlanController.flightplans[2].approach_trans;
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ var arrivalPage = {
|
|||
},
|
||||
|
||||
updateActiveVIAs: func() {
|
||||
if (getprop("/sim/version/flightgear") != "2020.2.0") { return; }
|
||||
if (getprop("/sim/version/flightgear") != "2020.2.0" and getprop("/sim/version/flightgear") != "2020.2.1" and getprop("/sim/version/flightgear") != "2020.3.0") { return; }
|
||||
|
||||
if (me.selectedVIA == "NO VIA") {
|
||||
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||
|
@ -503,7 +503,7 @@ var arrivalPage = {
|
|||
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||
},
|
||||
updateVIAs: func() {
|
||||
if (getprop("/sim/version/flightgear") != "2020.2.0") { return; }
|
||||
if (getprop("/sim/version/flightgear") != "2020.2.0" and getprop("/sim/version/flightgear") != "2020.2.1" and getprop("/sim/version/flightgear") != "2020.3.0") { return; }
|
||||
if (me.selectedApproach == nil or me.activePage != 2) {
|
||||
me.clearVias();
|
||||
return;
|
||||
|
@ -746,7 +746,7 @@ var arrivalPage = {
|
|||
},
|
||||
arrPushbuttonLeft: func(index) {
|
||||
if (index == 2 and me.activePage == 1 and me.selectedApproach != nil) {
|
||||
if (getprop("/sim/version/flightgear") != "2020.2.0") { return; }
|
||||
if (getprop("/sim/version/flightgear") != "2020.2.0" and getprop("/sim/version/flightgear") != "2020.2.1" and getprop("/sim/version/flightgear") != "2020.3.0") { return; }
|
||||
me.oldPage = me.activePage;
|
||||
me.activePage = 2;
|
||||
me.updatePage();
|
||||
|
|
|
@ -167,7 +167,7 @@ var dirTo = {
|
|||
# fix
|
||||
var fix = findFixesByID(text);
|
||||
if (size(fix) == 0) {
|
||||
notInDataBase(me.computer);
|
||||
mcdu_message(me.computer, "NOT IN DATA BASE");
|
||||
}
|
||||
|
||||
if (size(fix) == 1 or override) {
|
||||
|
@ -189,7 +189,7 @@ var dirTo = {
|
|||
# airport
|
||||
var airport = findAirportsByICAO(text);
|
||||
if (size(airport) == 0) {
|
||||
notInDataBase(me.computer);
|
||||
mcdu_message(me.computer, "NOT IN DATA BASE");
|
||||
}
|
||||
|
||||
if (size(airport) == 1 or override) {
|
||||
|
@ -211,7 +211,7 @@ var dirTo = {
|
|||
# navaid
|
||||
var navaid = findNavaidsByID(text);
|
||||
if (size(navaid) == 0) {
|
||||
notInDataBase(me.computer);
|
||||
mcdu_message(me.computer, "NOT IN DATA BASE");
|
||||
}
|
||||
|
||||
if (size(navaid) == 1 or override) {
|
||||
|
@ -254,6 +254,7 @@ var dirTo = {
|
|||
dirToFlag = 0;
|
||||
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0);
|
||||
me.L1 = [" [ ]", " WAYPOINT", "blu"];
|
||||
me.fontMatrix = [[1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0]];
|
||||
me.R1 = ["---- --- ", "UTC DIST ", "wht"];
|
||||
} else {
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
|
@ -264,6 +265,7 @@ var dirTo = {
|
|||
dirToFlag = 0;
|
||||
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1);
|
||||
me.L1 = [" [ ]", " WAYPOINT", "blu"];
|
||||
me.fontMatrix = [[1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0]];
|
||||
me.R1 = ["---- --- ", "UTC DIST ", "wht"];
|
||||
setprop("MCDU[" ~ me.computer ~ "]/page", "F-PLNA"); # todo - remember horizontal srcoll of f-plna?
|
||||
} else {
|
||||
|
|
|
@ -156,33 +156,73 @@ var fplnItem = {
|
|||
setprop("MCDU[" ~ me.computer ~ "]/page", "LATREV");
|
||||
},
|
||||
pushButtonRight: func() {
|
||||
if (canvas_mcdu.myVertRev[me.computer] != nil) {
|
||||
canvas_mcdu.myVertRev[me.computer].del();
|
||||
}
|
||||
canvas_mcdu.myVertRev[me.computer] = nil;
|
||||
|
||||
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||
if (me.index == fmgc.flightPlanController.arrivalIndex[me.computer]) {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(1, left(me.wp.wp_name, 4), me.index, me.computer, me.wp, me.plan);
|
||||
} elsif (left(me.wp.wp_name, 4) == fmgc.flightPlanController.flightplans[me.computer].departure.id) {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(0, left(me.wp.wp_name, 4), me.index, me.computer, me.wp, me.plan);
|
||||
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1)) {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(3, me.wp.wp_name, me.index, me.computer, me.wp, me.plan);
|
||||
if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) == 0) {
|
||||
if (canvas_mcdu.myVertRev[me.computer] != nil) {
|
||||
canvas_mcdu.myVertRev[me.computer].del();
|
||||
}
|
||||
canvas_mcdu.myVertRev[me.computer] = nil;
|
||||
|
||||
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||
if (me.index == fmgc.flightPlanController.arrivalIndex[me.computer]) {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(1, left(me.wp.wp_name, 4), me.index, me.computer, me.wp, me.plan);
|
||||
} if (left(me.wp.wp_name, 4) == fmgc.flightPlanController.flightplans[me.computer].departure.id) {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(0, left(me.wp.wp_name, 4), me.index, me.computer, me.wp, me.plan);
|
||||
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1)) {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(3, me.wp.wp_name, me.index, me.computer, me.wp, me.plan);
|
||||
} else {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(2, me.wp.wp_name, me.index, me.computer, me.wp, me.plan);
|
||||
}
|
||||
} else {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(2, me.wp.wp_name, me.index, me.computer, me.wp, me.plan);
|
||||
if (me.index == fmgc.flightPlanController.arrivalIndex[2]) {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(1, left(me.wp.wp_name, 4), me.index, me.computer, me.wp, me.plan);
|
||||
} elsif (left(me.wp.wp_name, 4) == fmgc.flightPlanController.flightplans[2].departure.id) {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(0, left(me.wp.wp_name, 4), me.index, me.computer, me.wp, me.plan);
|
||||
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1)) {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(3, me.wp.wp_name, me.index, me.computer, me.wp, me.plan);
|
||||
} else {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(2, me.wp.wp_name, me.index, me.computer, me.wp, me.plan);
|
||||
}
|
||||
}
|
||||
setprop("MCDU[" ~ me.computer ~ "]/page", "VERTREV");
|
||||
} elsif (me.index != 0) { # todo - only apply to climb, descent, or missed waypoints
|
||||
var scratchpadStore = mcdu_scratchpad.scratchpads[me.computer].scratchpad;
|
||||
|
||||
if (scratchpadStore == "CLR") {
|
||||
me.wp.setSpeed("delete");
|
||||
me.wp.setAltitude("delete");
|
||||
mcdu_scratchpad.scratchpads[me.computer].empty();
|
||||
} elsif (find("/", scratchpadStore) != -1) {
|
||||
var scratchpadSplit = split("/", scratchpadStore);
|
||||
|
||||
if (size(scratchpadSplit[0]) == 0) {
|
||||
if (num(scratchpadSplit[1]) != nil and (size(scratchpadSplit[1]) == 4 or size(scratchpadSplit[1]) == 5) and scratchpadSplit[1] >= 0 and scratchpadSplit[1] <= 39000) {
|
||||
me.wp.setAltitude(math.round(scratchpadSplit[1], 10), "at");
|
||||
mcdu_scratchpad.scratchpads[me.computer].empty();
|
||||
} else {
|
||||
mcdu_message(me.computer, "FORMAT ERROR");
|
||||
}
|
||||
} else {
|
||||
if (num(scratchpadSplit[0]) != nil and size(scratchpadSplit[0]) == 3 and scratchpadSplit[0] >= 100 and scratchpadSplit[0] <= 350 and
|
||||
num(scratchpadSplit[1]) != nil and (size(scratchpadSplit[1]) == 4 or size(scratchpadSplit[1]) == 5) and scratchpadSplit[1] >= 0 and scratchpadSplit[1] <= 39000) {
|
||||
me.wp.setSpeed(scratchpadSplit[0], "at");
|
||||
me.wp.setAltitude(math.round(scratchpadSplit[1], 10), "at");
|
||||
mcdu_scratchpad.scratchpads[me.computer].empty();
|
||||
} elsif (num(scratchpadSplit[0]) != nil and size(scratchpadSplit[0]) == 3 and scratchpadSplit[0] >= 100 and scratchpadSplit[0] <= 350 and size(scratchpadSplit[1]) == 0) {
|
||||
me.wp.setSpeed(scratchpadSplit[0], "at");
|
||||
mcdu_scratchpad.scratchpads[me.computer].empty();
|
||||
} else {
|
||||
mcdu_message(me.computer, "FORMAT ERROR");
|
||||
}
|
||||
}
|
||||
} elsif (num(scratchpadStore) != nil and size(scratchpadStore) == 3 and scratchpadStore >= 100 and scratchpadStore <= 350) {
|
||||
me.wp.setSpeed(scratchpadStore, "at");
|
||||
mcdu_scratchpad.scratchpads[me.computer].empty();
|
||||
} else {
|
||||
mcdu_message(me.computer, "FORMAT ERROR");
|
||||
}
|
||||
} else {
|
||||
if (me.index == fmgc.flightPlanController.arrivalIndex[2]) {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(1, left(me.wp.wp_name, 4), me.index, me.computer, me.wp, me.plan);
|
||||
} elsif (left(me.wp.wp_name, 4) == fmgc.flightPlanController.flightplans[2].departure.id) {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(0, left(me.wp.wp_name, 4), me.index, me.computer, me.wp, me.plan);
|
||||
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1)) {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(3, me.wp.wp_name, me.index, me.computer, me.wp, me.plan);
|
||||
} else {
|
||||
canvas_mcdu.myVertRev[me.computer] = vertRev.new(2, me.wp.wp_name, me.index, me.computer, me.wp, me.plan);
|
||||
}
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
setprop("MCDU[" ~ me.computer ~ "]/page", "VERTREV");
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -446,11 +486,7 @@ var fplnPage = { # this one is only created once, and then updated - remember th
|
|||
}
|
||||
} else {
|
||||
if (size(me.outputList) >= index) {
|
||||
if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) > 0) {
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
} else {
|
||||
me.outputList[index - 1].pushButtonRight();
|
||||
}
|
||||
me.outputList[index - 1].pushButtonRight();
|
||||
} else {
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
|
|
|
@ -148,14 +148,9 @@ var fuelPredInput = func(key, i) {
|
|||
if (scratchpad == "CLR") {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
} else {
|
||||
if (!getprop("/FMGC/internal/cost-index-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"));
|
||||
}
|
||||
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 0) {
|
||||
var zfw_min = 80.6; #make based on performance
|
||||
var zfw_max = 134.5; #61,000 kg, make based on performance
|
||||
if (size(scratchpad) == 0) {
|
||||
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-set", 1);
|
||||
|
@ -167,26 +162,45 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("/FMGC/internal/block-calculating", 0);
|
||||
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 zfwcg = num(zfwi[0]);
|
||||
var zfw = num(zfwi[1]);
|
||||
var zfwcgs = size(zfwi[0]);
|
||||
var zfws = size(zfwi[1]);
|
||||
if (zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) {
|
||||
setprop("/FMGC/internal/zfwcg", zfwcg);
|
||||
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);
|
||||
var zfw = num(zfwi[0]);
|
||||
var zfwcg = num(zfwi[1]);
|
||||
var zfws = size(zfwi[0]);
|
||||
var zfwcgs = size(zfwi[1]);
|
||||
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) {
|
||||
if (zfw >= zfw_min and zfw <= zfw_max and zfwcg >= 8.0 and zfwcg <= 45.0) {
|
||||
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-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, "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) {
|
||||
setprop("/FMGC/internal/zfw", zfw);
|
||||
} else if (num(scratchpad) != nil and size(scratchpad) > 0 and size(scratchpad) <= 5 and size(split(".", scratchpad)[1]) <= 1) {
|
||||
if (scratchpad >= zfw_min and scratchpad <= zfw_max) {
|
||||
setprop("/FMGC/internal/zfw", scratchpad);
|
||||
setprop("/FMGC/internal/zfw-set", 1);
|
||||
if (getprop("/FMGC/internal/block-set") != 1) {
|
||||
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-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();
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} 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");
|
||||
mcdu_message(i, "ENTRY OUT OF RANGE");
|
||||
}
|
||||
} else {
|
||||
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") or 0);
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index") or 0);
|
||||
}
|
||||
}
|
||||
} else if (key == "R4") {
|
||||
if (scratchpad == "CLR") {
|
||||
|
|
|
@ -20,9 +20,12 @@ var initInputB = func(key, i) {
|
|||
if (num(scratchpad) != nil and scratchpad >= 0.0 and scratchpad <= 9.9) {
|
||||
setprop("/FMGC/internal/taxi-fuel", scratchpad);
|
||||
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();
|
||||
fmgc.updateFuel();
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
|
@ -148,14 +151,9 @@ var initInputB = func(key, i) {
|
|||
if (scratchpad == "CLR") {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
} else {
|
||||
if (!getprop("/FMGC/internal/cost-index-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"));
|
||||
}
|
||||
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 0) {
|
||||
var zfw_min = 80.6; #make based on performance
|
||||
var zfw_max = 134.5; #61,000 kg, make based on performance
|
||||
if (size(scratchpad) == 0) {
|
||||
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-set", 1);
|
||||
|
@ -171,18 +169,49 @@ var initInputB = func(key, i) {
|
|||
} else if (getprop("/FMGC/internal/fuel-request-set")) {
|
||||
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 zfwcg = num(zfwi[0]);
|
||||
var zfw = num(zfwi[1]);
|
||||
var zfwcgs = size(zfwi[0]);
|
||||
var zfws = size(zfwi[1]);
|
||||
if (zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) {
|
||||
setprop("/FMGC/internal/zfwcg", zfwi[0]);
|
||||
setprop("/FMGC/internal/zfwcg-set", 1);
|
||||
var zfw = num(zfwi[0]);
|
||||
var zfwcg = num(zfwi[1]);
|
||||
var zfws = size(zfwi[0]);
|
||||
var zfwcgs = size(zfwi[1]);
|
||||
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) {
|
||||
if (zfw >= zfw_min and zfw <= zfw_max and zfwcg >= 8.0 and zfwcg <= 45.0) {
|
||||
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) {
|
||||
setprop("/FMGC/internal/zfw", zfwi[1]);
|
||||
} else if (num(scratchpad) != nil and size(scratchpad) > 0 and size(scratchpad) <= 5 and size(split(".", scratchpad)[1]) <= 1) {
|
||||
if (scratchpad >= zfw_min and scratchpad <= zfw_max) {
|
||||
setprop("/FMGC/internal/zfw", scratchpad);
|
||||
setprop("/FMGC/internal/zfw-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")));
|
||||
|
@ -196,24 +225,19 @@ var initInputB = func(key, i) {
|
|||
} else if (getprop("/FMGC/internal/fuel-request-set")) {
|
||||
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();
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} 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");
|
||||
mcdu_message(i, "ENTRY OUT OF RANGE");
|
||||
}
|
||||
} else {
|
||||
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") or 0);
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index") or 0);
|
||||
}
|
||||
}
|
||||
} else if (key == "R2" and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
|
|
|
@ -59,7 +59,6 @@ var MCDU_reset = func(i) {
|
|||
setprop("/FMGC/internal/alt-set", 0);
|
||||
setprop("/FMGC/internal/cost-index", "0");
|
||||
setprop("/FMGC/internal/cost-index-set", 0);
|
||||
setprop("/FMGC/internal/last-cost-index", 0);
|
||||
setprop("/FMGC/internal/cruise-ft", 10000);
|
||||
setprop("/FMGC/internal/cruise-fl", 100);
|
||||
setprop("/FMGC/internal/cruise-lvl-set", 0);
|
||||
|
@ -88,7 +87,7 @@ var MCDU_reset = func(i) {
|
|||
# INT-B
|
||||
setprop("/FMGC/internal/zfw", 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/block", 0.0);
|
||||
setprop("/FMGC/internal/block-set", 0);
|
||||
|
@ -168,7 +167,7 @@ var MCDU_reset = func(i) {
|
|||
setprop("/FMGC/internal/dest-mag", -1);
|
||||
setprop("/FMGC/internal/dest-wind", -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/final", "");
|
||||
setprop("/FMGC/internal/baro", 99999);
|
||||
|
|
|
@ -68,7 +68,7 @@ var radnavInput = func(key, i) {
|
|||
setprop("/FMGC/internal/ils1freq-set", 1);
|
||||
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"))) {
|
||||
genericMessage(i, "RWY/LS MISMATCH", "amb");
|
||||
mcdu_message(i, "RWY/LS MISMATCH");
|
||||
}
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
|
|
|
@ -169,7 +169,7 @@ var BrakeSystem =
|
|||
var V2_R = V1 - me.BrakeDecel * dt * RBrakeLevel;
|
||||
|
||||
LThermalEnergy += (Mass * getprop("gear/gear[1]/compression-norm") * (math.pow(V1, 2) - math.pow(V2_L, 2)) / 2);
|
||||
if (getprop("services/chocks/left")) {
|
||||
if (getprop("services/chocks/enable")) {
|
||||
if (!getprop("controls/gear/brake-parking")) {
|
||||
# cooling effect: reduce thermal energy by (LnCoolFactor) * dt
|
||||
LThermalEnergy = LThermalEnergy * math.exp(LnCoolFactor * dt);
|
||||
|
@ -202,7 +202,7 @@ var BrakeSystem =
|
|||
};
|
||||
|
||||
RThermalEnergy += (Mass * getprop("gear/gear[2]/compression-norm") * (math.pow(V1, 2) - math.pow(V2_R, 2)) / 2);
|
||||
if (getprop("services/chocks/right")) {
|
||||
if (getprop("services/chocks/enable")) {
|
||||
if (!getprop("controls/gear/brake-parking")) {
|
||||
# cooling effect: reduce thermal energy by (RnCoolFactor) * dt
|
||||
RThermalEnergy = RThermalEnergy * math.exp(RnCoolFactor * dt);
|
||||
|
|
|
@ -20,9 +20,7 @@ var ground_services = {
|
|||
|
||||
# Set them all to 0 if the aircraft is not stationary
|
||||
if (getprop("velocities/groundspeed-kt") >= 2) {
|
||||
setprop("services/chocks/nose", 0);
|
||||
setprop("services/chocks/left", 0);
|
||||
setprop("services/chocks/right", 0);
|
||||
setprop("services/chocks/enable", 0);
|
||||
setprop("services/fuel-truck/enable", 0);
|
||||
setprop("services/deicing_truck/enable", 0);
|
||||
setprop("services/catering/enable", 0);
|
||||
|
|
|
@ -930,16 +930,10 @@
|
|||
<c1>20</c1>
|
||||
</lag_filter>
|
||||
|
||||
<pure_gain name="/services/chocks/nose-half">
|
||||
<input>/services/chocks/nose</input>
|
||||
<gain>0.5</gain>
|
||||
</pure_gain>
|
||||
|
||||
<summer name="fcs/left-brake-summer">
|
||||
<input>/controls/gear/brake-left</input>
|
||||
<input>/controls/gear/brake-parking</input>
|
||||
<input>/services/chocks/nose-half</input>
|
||||
<input>/services/chocks/left</input>
|
||||
<input>/services/chocks/enable</input>
|
||||
<clipto>
|
||||
<min>0</min>
|
||||
<max>1</max>
|
||||
|
@ -957,8 +951,7 @@
|
|||
<summer name="fcs/right-brake-summer">
|
||||
<input>/controls/gear/brake-right</input>
|
||||
<input>/controls/gear/brake-parking</input>
|
||||
<input>/services/chocks/nose-half</input>
|
||||
<input>/services/chocks/right</input>
|
||||
<input>/services/chocks/enable</input>
|
||||
<clipto>
|
||||
<min>0</min>
|
||||
<max>1</max>
|
||||
|
|
Loading…
Reference in a new issue