diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 9fbf8f23..38e2becd 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -1473,7 +1473,39 @@ - knob + slider + CockpitDoorSwitch + CockpitDoorSwitch.mark + controls/doors/doorc-switch + vertical + + + property-adjust + controls/doors/doorc-switch + -1 + -1 + 1 + 0 + + + + + property-assign + controls/doors/doorc-switch + 0 + + + + + set-tooltip + doorc-switch-lock + + + + + + + rotate CockpitDoorSwitch CockpitDoorSwitch.mark controls/doors/doorc-switch @@ -1485,38 +1517,6 @@ CockpitDoorSwitch.axis - - - property-cycle - controls/doors/doorc-switch - -1 - 0 - 1 - false - - - nasal - - - - - - property-assign - controls/doors/doorc-switch - 0 - - - nasal - - - - - - set-tooltip - doorc-switch-lock - - - diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index d8592314..d22aff78 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -5392,6 +5392,12 @@ var canvas_MCDU_base = { me.colorRight(myVertRev[i].R1[2],myVertRev[i].R2[2],myVertRev[i].R3[2],myVertRev[i].R4[2],myVertRev[i].R5[2],myVertRev[i].R6[2]); } + + if (myVertRev[i] != nil and (myVertRev[i].type == 1 and fmgc.FMGCInternal.desSpdLimSet) or (myVertRev[i].type != 1 and fmgc.FMGCInternal.clbSpdLimSet)) { + me["Simple_L2"].setFontSize(normal); + } else { + me["Simple_L2"].setFontSize(small); + } pageSwitch[i].setBoolValue(1); } } else if (page == "DEPARTURE") { diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index 8e36d621..7fb5c12b 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -648,8 +648,6 @@ var canvas_pfd = { obj.AI_fpv_rot = obj["FPV"].createTransform(); obj.page = obj.group; - # temporarily hidden - obj["ASI_buss"].hide(); obj["ASI_index_middle"].hide(); # end temporary hide @@ -664,7 +662,7 @@ var canvas_pfd = { "ALT_digit_DN","ALT_digit_UP_metric","ALT_error","ALT_neg","ALT_group","ALT_group2","ALT_frame","VS_pointer","VS_box","VS_digit","VS_error","VS_group","QNH","QNH_setting","QNH_std","QNH_box","LOC_pointer","LOC_scale","GS_scale","GS_pointer","CRS_pointer", "HDG_target","HDG_scale","HDG_one","HDG_two","HDG_three","HDG_four","HDG_five","HDG_six","HDG_seven","HDG_digit_L","HDG_digit_R","HDG_error","HDG_group","HDG_frame","TRK_pointer","machError","ilsError","ils_code","ils_freq","dme_dist","dme_dist_legend", "ILS_HDG_R","ILS_HDG_L","ILS_right","ILS_left","outerMarker","middleMarker","innerMarker","v1_group","v1_text","vr_speed","F_target","S_target","FS_targets","flap_max","clean_speed","ground","ground_ref","FPV","spdLimError","vsFMArate","tailstrikeInd", - "Metric_box","Metric_letter","Metric_cur_alt","ASI_buss","ASI_index_middle"]; + "Metric_box","Metric_letter","Metric_cur_alt","ASI_buss","ASI_buss_ref","ASI_buss_ref_blue","ASI_index_middle"]; }, getKeysTest: func() { return ["Test_white","Test_text"]; @@ -674,6 +672,7 @@ var canvas_pfd = { }, aoa: 0, showMetricAlt: 0, + ASItrendIsShown: 0, update: func(notification) { me.updatePower(notification); @@ -755,6 +754,9 @@ var canvas_pfd = { if (dmc.DMController.DMCs[me.number].outputs[0] != nil) { me.ind_spd = dmc.DMController.DMCs[me.number].outputs[0].getValue(); me["ASI_error"].hide(); + me["ASI_buss"].hide(); + me["ASI_buss_ref"].hide(); + me["ASI_buss_ref_blue"].hide(); me["ASI_frame"].setColor(1,1,1); me["ASI_group"].show(); me["VLS_min"].hide(); @@ -1097,17 +1099,23 @@ var canvas_pfd = { me["ASI_trend_up"].setTranslation(0, math.clamp(me.ASItrend, 0, 50) * -6.6); me["ASI_trend_down"].setTranslation(0, math.clamp(me.ASItrend, -50, 0) * -6.6); - if (me.ASItrend >= 2) { - me["ASI_trend_up"].show(); - me["ASI_trend_down"].hide(); - } else if (me.ASItrend <= -2) { - me["ASI_trend_down"].show(); - me["ASI_trend_up"].hide(); + if (notification.fac1 or notification.fac2) { + if (me.ASItrend >= 2 or (me.ASItrendIsShown and me.ASItrend >= 1)) { + me["ASI_trend_up"].show(); + me["ASI_trend_down"].hide(); + me.ASItrendIsShown = 1; + } else if (me.ASItrend <= -2 or (me.ASItrendIsShown and me.ASItrend <= -1)) { + me["ASI_trend_up"].hide(); + me["ASI_trend_down"].show(); + me.ASItrendIsShown = 1; + } else { + me["ASI_trend_up"].hide(); + me["ASI_trend_down"].hide(); + } } else { me["ASI_trend_up"].hide(); me["ASI_trend_down"].hide(); } - if (-notification.agl >= -565 and -notification.agl <= 565) { me["ground_ref"].show(); @@ -1116,7 +1124,19 @@ var canvas_pfd = { } } else { me["ASI_group"].hide(); - me["ASI_error"].show(); + if (!systems.ADIRS.Operating.adr[0].getValue() and !systems.ADIRS.Operating.adr[1].getValue() and !systems.ADIRS.Operating.adr[2].getValue()) { + me["ASI_buss"].show(); + me["ASI_buss_ref"].show(); + me["ASI_buss_ref_blue"].show(); + me["ASI_buss"].setTranslation(0, notification.bussTranslate); + me["ASI_buss_ref_blue"].setTranslation(0, notification.bussTranslate); + me["ASI_error"].hide(); + } else { + me["ASI_buss"].hide(); + me["ASI_buss_ref"].hide(); + me["ASI_buss_ref_blue"].hide(); + me["ASI_error"].show(); + } me["ASI_frame"].setColor(1,0,0); me["clean_speed"].hide(); me["S_target"].hide(); @@ -2032,6 +2052,8 @@ var input = { decel: "/FMGC/internal/decel", radio: "/FMGC/internal/radio", baro: "/FMGC/internal/baro", + + bussTranslate: "/instrumentation/pfd/buss/translate", }; foreach (var name; keys(input)) { diff --git a/Models/Instruments/PFD/res/pfd.svg b/Models/Instruments/PFD/res/pfd.svg index 563ec4d6..04207315 100644 --- a/Models/Instruments/PFD/res/pfd.svg +++ b/Models/Instruments/PFD/res/pfd.svg @@ -1,19 +1,19 @@ + width="1024pt" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> @@ -39,14 +39,14 @@ showguides="true" inkscape:current-layer="svg2" inkscape:window-maximized="1" - inkscape:window-y="-8" - inkscape:window-x="1592" - inkscape:cy="732.64766" - inkscape:cx="-141.75866" - inkscape:zoom="1.4142136" + inkscape:window-y="-11" + inkscape:window-x="-11" + inkscape:cy="676.96634" + inkscape:cx="183.00807" + inkscape:zoom="11.313709" showgrid="false" id="namedview371" - inkscape:window-height="1030" + inkscape:window-height="986" inkscape:window-width="1920" inkscape:pageshadow="2" inkscape:pageopacity="1" @@ -55,7 +55,9 @@ objecttolerance="20" borderopacity="1" bordercolor="#666666" - pagecolor="#000000"> + pagecolor="#000000" + inkscape:pagecheckerboard="0" + inkscape:document-units="pt"> + style="opacity:1;fill:#368acd;fill-opacity:1;stroke:none;stroke-width:2.58922;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.20011;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.20025;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;stroke:#ff0000;stroke-width:5.7;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:none;stroke:#ff0000;stroke-width:6.6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:none;stroke:#ff0000;stroke-width:7.425;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:none;fill-opacity:1;stroke:#0dc04b;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#0dc04b;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#0dc04b;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#0dc04b;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="opacity:1;fill:#368acd;fill-opacity:1;stroke:none;stroke-width:2.58922;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.73024;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:4.30556;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:8.10006;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#c9cc15;stroke-width:3.99994;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> @@ -1032,9 +1034,9 @@ inkscape:connector-curvature="0" id="path3932" d="m 340.35189,239.5184 5.62182,14.20878" - style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19994998;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#0dc04b;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#0dc04b;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> 0000 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:45px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#0dc04b;fill-opacity:1;stroke-width:0.657577">0000 + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> 00 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:48.8348px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;text-anchor:end;fill:#0dc04b;fill-opacity:1;stroke-width:0.75">00 + id="ASI_group" + style="display:inline"> - - - - - FAST - - SLOW - . + + + + + + FAST + + SLOW + + + + + + id="ASI_error" + style="display:inline"> MM + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#bb6100;fill-opacity:1;stroke-width:0.75">MM OM + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#179ab7;fill-opacity:1;stroke-width:0.75">OM 402000806040200080 NE-800 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.9995px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke-width:0.657577">-800 11070 M + style="font-size:38.3994px;line-height:1.25;fill:#179ab7;fill-opacity:1;stroke-width:0.75">M 480) { - final_time = 480; - } + final_time = math.clamp(final_time, 0, 480); + if (num(final_time) >= 60) { final_min = int(math.mod(final_time, 60)); final_hour = int((final_time - final_min) / 60); @@ -356,11 +360,8 @@ var updateFuel = func { } zfw = 1000 * FMGCInternal.zfw; final_fuel = final_time * 2.0 * ((zfw*zfw*-2e-10) + (zfw*0.0003) + 2.8903); # x2 for 2 engines - if (final_fuel < 0) { - final_fuel = 0; - } elsif (final_fuel > 80000) { - final_fuel = 80000; - } + final_fuel = math.clamp(final_fuel, 0, 80000); + FMGCInternal.finalFuel = final_fuel / 1000; } @@ -372,11 +373,8 @@ var updateFuel = func { alt_fuel = 1000 * num(FMGCInternal.altFuel); zfw = 1000 * FMGCInternal.zfw; alt_time = alt_fuel / (2.0 * ((zfw*zfw*-2e-10) + (zfw*0.0003) + 2.8903)); # x2 for 2 engines - if (alt_time < 0) { - alt_time = 0; - } elsif (alt_time > 480) { - alt_time = 480; - } + alt_time = math.clamp(alt_time, 0, 480); + if (num(alt_time) >= 60) { alt_min = int(math.mod(alt_time, 60)); alt_hour = int((alt_time - alt_min) / 60); @@ -413,21 +411,14 @@ var updateFuel = func { #trip_fuel = 4.003e+02 + (dist * -5.399e+01) + (dist * dist * -7.322e-02) + (dist * dist * dist * 1.091e-05) + (dist * dist * dist * dist * 2.962e-10) + (dist * dist * dist * dist * dist * -1.178e-13) + (dist * dist * dist * dist * dist * dist * 6.322e-18) + (crz * 5.387e+01) + (dist * crz * 1.583e+00) + (dist * dist * crz * 7.695e-04) + (dist * dist * dist * crz * -1.057e-07) + (dist * dist * dist * dist * crz * 1.138e-12) + (dist * dist * dist * dist * dist * crz * 1.736e-16) + (crz * crz * -1.171e+00) + (dist * crz * crz * -1.219e-02) + (dist * dist * crz * crz * -2.879e-06) + (dist * dist * dist * crz * crz * 3.115e-10) + (dist * dist * dist * dist * crz * crz * -4.093e-15) + (crz * crz * crz * 9.160e-03) + (dist * crz * crz * crz * 4.311e-05) + (dist * dist * crz * crz * crz * 4.532e-09) + (dist * dist * dist * crz * crz * crz * -2.879e-13) + (crz * crz * crz * crz * -3.338e-05) + (dist * crz * crz * crz * crz * -7.340e-08) + (dist * dist * crz * crz * crz * crz * -2.494e-12) + (crz * crz * crz * crz * crz * 5.849e-08) + (dist * crz * crz * crz * crz * crz * 4.898e-11) + (crz * crz * crz * crz * crz * crz * -3.999e-11); trip_fuel = 4.018e+02 + (dist*3.575e+01) + (dist*dist*-4.260e-02) + (dist*dist*dist*-1.446e-05) + (dist*dist*dist*dist*4.101e-09) + (dist*dist*dist*dist*dist*-6.753e-13) + (dist*dist*dist*dist*dist*dist*5.074e-17) + (crz*-2.573e+01) + (dist*crz*-1.583e-01) + (dist*dist*crz*8.147e-04) + (dist*dist*dist*crz*4.485e-08) + (dist*dist*dist*dist*crz*-7.656e-12) + (dist*dist*dist*dist*dist*crz*4.503e-16) + (crz*crz*4.427e-01) + (dist*crz*crz*-1.137e-03) + (dist*dist*crz*crz*-4.409e-06) + (dist*dist*dist*crz*crz*-3.345e-11) + (dist*dist*dist*dist*crz*crz*4.985e-15) + (crz*crz*crz*-2.471e-03) + (dist*crz*crz*crz*1.223e-05) + (dist*dist*crz*crz*crz*9.660e-09) + (dist*dist*dist*crz*crz*crz*-2.127e-14) + (crz*crz*crz*crz*5.714e-06) + (dist*crz*crz*crz*crz*-3.546e-08) + (dist*dist*crz*crz*crz*crz*-7.536e-12) + (crz*crz*crz*crz*crz*-4.061e-09) + (dist*crz*crz*crz*crz*crz*3.355e-11) + (crz*crz*crz*crz*crz*crz*-1.451e-12); - if (trip_fuel < 400) { - trip_fuel = 400; - } elsif (trip_fuel > 80000) { - trip_fuel = 80000; - } + trip_fuel = math.clamp(trip_fuel, 400, 80000); # cruize temp correction trip_fuel = trip_fuel + (0.033 * (temp - 15 + (2 * crz / 10)) * flightPlanController.arrivalDist); trip_time = 9.095e-02 + (dist*-3.968e-02) + (dist*dist*4.302e-04) + (dist*dist*dist*2.005e-07) + (dist*dist*dist*dist*-6.876e-11) + (dist*dist*dist*dist*dist*1.432e-14) + (dist*dist*dist*dist*dist*dist*-1.177e-18) + (crz*7.348e-01) + (dist*crz*3.310e-03) + (dist*dist*crz*-8.700e-06) + (dist*dist*dist*crz*-4.214e-10) + (dist*dist*dist*dist*crz*5.652e-14) + (dist*dist*dist*dist*dist*crz*-6.379e-18) + (crz*crz*-1.449e-02) + (dist*crz*crz*-7.508e-06) + (dist*dist*crz*crz*4.529e-08) + (dist*dist*dist*crz*crz*3.699e-13) + (dist*dist*dist*dist*crz*crz*8.466e-18) + (crz*crz*crz*1.108e-04) + (dist*crz*crz*crz*-4.126e-08) + (dist*dist*crz*crz*crz*-9.645e-11) + (dist*dist*dist*crz*crz*crz*-1.544e-16) + (crz*crz*crz*crz*-4.123e-07) + (dist*crz*crz*crz*crz*1.831e-10) + (dist*dist*crz*crz*crz*crz*7.438e-14) + (crz*crz*crz*crz*crz*7.546e-10) + (dist*crz*crz*crz*crz*crz*-1.921e-13) + (crz*crz*crz*crz*crz*crz*-5.453e-13); - if (trip_time < 10) { - trip_time = 10; - } elsif (trip_time > 480) { - trip_time = 480; - } + trip_time = math.clamp(trip_time, 10, 480); + # if (low air conditioning) { # trip_fuel = trip_fuel * 0.995; #} @@ -440,11 +431,7 @@ var updateFuel = func { zfw = FMGCInternal.zfw; landing_weight_correction = 9.951e+00 + (dist*-2.064e+00) + (dist*dist*2.030e-03) + (dist*dist*dist*8.179e-08) + (dist*dist*dist*dist*-3.941e-11) + (dist*dist*dist*dist*dist*2.443e-15) + (crz*2.771e+00) + (dist*crz*3.067e-02) + (dist*dist*crz*-1.861e-05) + (dist*dist*dist*crz*2.516e-10) + (dist*dist*dist*dist*crz*5.452e-14) + (crz*crz*-4.483e-02) + (dist*crz*crz*-1.645e-04) + (dist*dist*crz*crz*5.212e-08) + (dist*dist*dist*crz*crz*-8.721e-13) + (crz*crz*crz*2.609e-04) + (dist*crz*crz*crz*3.898e-07) + (dist*dist*crz*crz*crz*-4.617e-11) + (crz*crz*crz*crz*-6.488e-07) + (dist*crz*crz*crz*crz*-3.390e-10) + (crz*crz*crz*crz*crz*5.835e-10); trip_fuel = trip_fuel + (landing_weight_correction * (FMGCInternal.lw * 1000 - 121254.24421) / 2204.622622); - if (trip_fuel < 400) { - trip_fuel = 400; - } elsif (trip_fuel > 80000) { - trip_fuel = 80000; - } + trip_fuel = math.clamp(trip_fuel, 400, 80000); FMGCInternal.tripFuel = trip_fuel / 1000; if (num(trip_time) >= 60) { @@ -498,11 +485,8 @@ var updateFuel = func { FMGCInternal.extraFuel = extra_fuel / 1000; lw = 1000 * FMGCInternal.lw; extra_time = extra_fuel / (2.0 * ((lw*lw*-2e-10) + (lw*0.0003) + 2.8903)); # x2 for 2 engines - if (extra_time < 0) { - extra_time = 0; - } elsif (extra_time > 480) { - extra_time = 480; - } + extra_time = math.clamp(extra_time, 0, 480); + if (num(extra_time) >= 60) { extra_min = int(math.mod(extra_time, 60)); extra_hour = int((extra_time - extra_min) / 60); @@ -627,7 +611,7 @@ var masterFMGC = maketimer(0.2, func { } } } elsif (FMGCInternal.phase == 4) { - if (getprop("/FMGC/internal/decel")) { + if (FMGCNodes.decel.getValue()) { newphase = 5; } } elsif (FMGCInternal.phase == 5) { @@ -644,9 +628,9 @@ var masterFMGC = maketimer(0.2, func { if (flightPlanController.num[2].getValue() > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and flightPlanController.arrivalDist <= 15 and (modelat == "NAV" or modelat == "LOC" or modelat == "LOC*") and pts.Position.gearAglFt.getValue() < 9500) { #todo decel pseudo waypoint - setprop("/FMGC/internal/decel", 1); - } elsif (getprop("/FMGC/internal/decel") == 1 and (FMGCInternal.phase == 0 or FMGCInternal.phase == 6)) { - setprop("/FMGC/internal/decel", 0); + FMGCNodes.decel.setValue(1); + } elsif (FMGCNodes.decel.getValue() and (FMGCInternal.phase == 0 or FMGCInternal.phase == 6)) { + FMGCNodes.decel.setValue(0); } tempOverspeed = systems.ADIRS.overspeedVFE.getValue(); @@ -950,8 +934,8 @@ var updateAirportRadios = func { }; -setlistener(FMGCNodes.phase, updateAirportRadios,0,0); -setlistener(flightPlanController.changed, updateAirportRadios,0,0); +setlistener(FMGCNodes.phase, updateAirportRadios, 0, 0); +setlistener(flightPlanController.changed, updateAirportRadios, 0, 0); var reset_FMGC = func { FMGCInternal.phase = 0; @@ -1002,110 +986,76 @@ var reset_FMGC = func { ################# # Managed Speed # ################# +var srsSpeedNode = props.globals.getNode("/it-autoflight/settings/togaspd", 1); +var ktToMach = func(val) { return val * FMGCNodes.ktsToMachFactor.getValue(); } +var machToKt = func(val) { return val * FMGCNodes.machToKtsFactor.getValue(); } + var ManagedSPD = maketimer(0.25, func { if (FMGCInternal.crzSet and FMGCInternal.costIndexSet) { if (Custom.Input.spdManaged.getBoolValue()) { altitude = pts.Instrumentation.Altimeter.indicatedFt.getValue(); - mode = Modes.PFD.FMA.pitchMode.getValue(); - ias = pts.Instrumentation.AirspeedIndicator.indicatedSpdKt.getValue(); - mach = pts.Instrumentation.AirspeedIndicator.indicatedMach.getValue(); + decel = FMGCNodes.decel.getValue(); ktsmach = Input.ktsMach.getValue(); - kts_sel = Input.kts.getValue(); - mach_sel = Input.mach.getValue(); - srsSPD = getprop("/it-autoflight/settings/togaspd"); - phase = FMGCInternal.phase; # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done - flap = pts.Controls.Flight.flapsPos.getValue(); - decel = getprop("/FMGC/internal/decel"); + mode = Modes.PFD.FMA.pitchMode.getValue(); + srsSPD = srsSpeedNode.getValue(); mng_alt_spd = math.round(FMGCNodes.mngSpdAlt.getValue(), 1); mng_alt_mach = math.round(FMGCNodes.mngMachAlt.getValue(), 0.001); - if (mach > mng_alt_mach and (FMGCInternal.phase == 2 or FMGCInternal.phase == 3)) { + # Phase: 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done + if (pts.Instrumentation.AirspeedIndicator.indicatedMach.getValue() > mng_alt_mach and (FMGCInternal.phase == 2 or FMGCInternal.phase == 3)) { FMGCInternal.machSwitchover = 1; - } elsif (ias > mng_alt_spd and (FMGCInternal.phase == 4 or FMGCInternal.phase == 5)) { + } elsif (pts.Instrumentation.AirspeedIndicator.indicatedSpdKt.getValue() > mng_alt_spd and (FMGCInternal.phase == 4 or FMGCInternal.phase == 5)) { FMGCInternal.machSwitchover = 0; } if ((mode == " " or mode == "SRS") and (FMGCInternal.phase == 0 or FMGCInternal.phase == 1)) { - if (FMGCInternal.mngKtsMach) { + FMGCInternal.mngKtsMach = 0; + FMGCInternal.mngSpdCmd = srsSPD; + } elsif ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude <= FMGCInternal.clbSpdLimAlt) { + # Speed is maximum of greendot / climb speed limit + FMGCInternal.mngKtsMach = 0; + FMGCInternal.mngSpdCmd = decel ? FMGCInternal.minspeed : math.clamp(FMGCInternal.clbSpdLim, FMGCInternal.clean, 999); + } elsif ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude > (FMGCInternal.clbSpdLimAlt + 20)) { + FMGCInternal.mngKtsMach = FMGCInternal.machSwitchover ? 1 : 0; + FMGCInternal.mngSpdCmd = FMGCInternal.machSwitchover ? mng_alt_mach : mng_alt_spd; + } elsif ((FMGCInternal.phase >= 4 and FMGCInternal.phase <= 6) and altitude > (FMGCInternal.desSpdLimAlt + 20)) { + if (decel) { FMGCInternal.mngKtsMach = 0; - } - if (FMGCInternal.mngSpdCmd != srsSPD) { - FMGCInternal.mngSpdCmd = srsSPD; - } - } elsif ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude <= 10050) { - if (FMGCInternal.mngKtsMach) { - FMGCInternal.mngKtsMach = 0; - } - if (FMGCInternal.mngSpdCmd != 250 and !decel) { - FMGCInternal.mngSpdCmd = 250; - } elsif (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { - FMGCInternal.mngSpdCmd = FMGCInternal.minspeed; - } - } elsif ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude > 10070 and !FMGCInternal.machSwitchover) { - if (FMGCInternal.mngKtsMach) { - FMGCInternal.mngKtsMach = 0; - } - if (FMGCInternal.mngSpdCmd != mng_alt_spd) { - FMGCInternal.mngSpdCmd = mng_alt_spd; - } - } elsif ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude > 10070 and FMGCInternal.machSwitchover) { - if (!FMGCInternal.mngKtsMach) { - FMGCInternal.mngKtsMach = 1; - } - if (FMGCInternal.mngSpdCmd != mng_alt_mach) { - FMGCInternal.mngSpdCmd = mng_alt_mach; - } - } elsif (FMGCInternal.phase == 4 and altitude > 11000 and !FMGCInternal.machSwitchover) { - if (FMGCInternal.mngKtsMach) { - FMGCInternal.mngKtsMach = 0; - } - if (FMGCInternal.mngSpdCmd != mng_alt_spd) { - FMGCInternal.mngSpdCmd = mng_alt_spd; - } - } elsif (FMGCInternal.phase == 4 and altitude > 11000 and FMGCInternal.machSwitchover) { - if (!FMGCInternal.mngKtsMach) { - FMGCInternal.mngKtsMach = 1; - } - if (FMGCInternal.mngSpdCmd != mng_alt_mach) { - FMGCInternal.mngSpdCmd = mng_alt_mach; - } - } elsif ((FMGCInternal.phase == 4 or FMGCInternal.phase == 5 or FMGCInternal.phase == 6) and altitude > 11000 and !FMGCInternal.machSwitchover) { - if (FMGCInternal.mngKtsMach) { - FMGCInternal.mngKtsMach = 0; - } - if (FMGCInternal.mngSpdCmd != mng_alt_spd and !decel) { - FMGCInternal.mngSpdCmd = mng_alt_spd; - } elsif (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { - FMGCInternal.mngSpdCmd = FMGCInternal.minspeed; - } - } elsif ((FMGCInternal.phase == 4 or FMGCInternal.phase == 5 or FMGCInternal.phase == 6) and altitude <= 10980) { - if (FMGCInternal.mngKtsMach) { - FMGCInternal.mngKtsMach = 0; - } - if (FMGCInternal.mngSpdCmd != 250 and !decel) { - FMGCInternal.mngSpdCmd = 250; - } elsif (FMGCInternal.mngSpdCmd != FMGCInternal.minspeed and decel) { FMGCInternal.mngSpdCmd = FMGCInternal.minspeed; + } else { + FMGCInternal.mngKtsMach = FMGCInternal.machSwitchover ? 1 : 0; + FMGCInternal.mngSpdCmd = FMGCInternal.machSwitchover ? mng_alt_mach : mng_alt_spd; } + } elsif ((FMGCInternal.phase >= 4 and FMGCInternal.phase <= 6) and altitude <= FMGCInternal.desSpdLimAlt) { + FMGCInternal.mngKtsMach = 0; + # Speed is maximum of greendot / descent speed limit + FMGCInternal.mngSpdCmd = decel ? FMGCInternal.minspeed : math.clamp(FMGCInternal.desSpdLim, FMGCInternal.clean, 999); } - if (FMGCInternal.mngSpdCmd > FMGCInternal.maxspeed - 5) { - FMGCInternal.mngSpd = (FMGCInternal.maxspeed - 5); + # Clamp to minspeed, maxspeed + if (FMGCInternal.phase >= 2) { + if (!FMGCInternal.mngKtsMach) { + FMGCInternal.mngSpd = math.clamp(FMGCInternal.mngSpdCmd, FMGCInternal.minspeed, FMGCInternal.maxspeed); + } else { + FMGCInternal.mngSpd = math.clamp(FMGCInternal.mngSpdCmd, ktToMach(FMGCInternal.minspeed), ktToMach(FMGCInternal.maxspeed)); + } } else { FMGCInternal.mngSpd = FMGCInternal.mngSpdCmd; } + # Update value of ktsMach if (ktsmach and !FMGCInternal.mngKtsMach) { Input.ktsMach.setValue(0); } elsif (!ktsmach and FMGCInternal.mngKtsMach) { Input.ktsMach.setValue(1); } - if (kts_sel != FMGCInternal.mngSpd and !ktsmach) { + # Set target speed + if (Input.kts.getValue() != FMGCInternal.mngSpd and !ktsmach) { Input.kts.setValue(FMGCInternal.mngSpd); - } elsif (mach_sel != FMGCInternal.mngSpd and ktsmach) { + } elsif (Input.mach.getValue() != FMGCInternal.mngSpd and ktsmach) { Input.mach.setValue(FMGCInternal.mngSpd); } } else { diff --git a/Nasal/Libraries/libraries.nas b/Nasal/Libraries/libraries.nas index f1ca6d04..304cc9a1 100644 --- a/Nasal/Libraries/libraries.nas +++ b/Nasal/Libraries/libraries.nas @@ -100,6 +100,7 @@ var triggerDoor = func(door, doorName, doorDesc) { }; setlistener("/controls/doors/doorc-switch",func(a){ + setprop("sim/sounde/switch1", 1); if (systems.ELEC.Bus.dc1.getValue() > 25 or systems.ELEC.Bus.dc2.getValue() > 25) { var pos = a.getValue(); var current = getprop("/sim/model/door-positions/doorc/lock-status"); @@ -111,11 +112,11 @@ setlistener("/controls/doors/doorc-switch",func(a){ else if (pos == -1 and current == 1) { ## UNLOCK settimer( func { if (a.getValue() == pos) setprop("/sim/model/door-positions/doorc/lock-status",0); - },0.2); + },0.3); } #setprop("/sim/model/door-positions/doorc/lock-status",-9); ## FAULT } -}); +},0,0); ########### # Systems # diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index e618ed67..6b2f2230 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -15,7 +15,7 @@ var MCDU_init = func(i) { var MCDU_reset = func(i) { setprop("/MCDU[" ~ i ~ "]/active", 0); setprop("/MCDU[" ~ i ~ "]/atsu-active", 0); - setprop("it-autoflight/settings/togaspd", 157); #aka v2 clone + setprop("/it-autoflight/settings/togaspd", 157); #aka v2 clone setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", "STATUS"); setprop("/MCDU[" ~ i ~ "]/last-atsu-page", "ATSUDLINK"); setprop("/MCDU[" ~ i ~ "]/active-system",""); @@ -500,6 +500,8 @@ var lskbutton = func(btn, i) { mcdu_scratchpad.scratchpads[i].empty(); } } + } else if (page == "VERTREV") { + canvas_mcdu.myVertRev[i].pushButtonLeft(2); } else if (page == "MCDUTEXT") { atsu.freeTexts[i].selection = 1; atsu.freeTexts[i].changed = 1; diff --git a/Nasal/MCDU/VERTREV.nas b/Nasal/MCDU/VERTREV.nas index 000ec6d3..6cd6df08 100644 --- a/Nasal/MCDU/VERTREV.nas +++ b/Nasal/MCDU/VERTREV.nas @@ -1,4 +1,5 @@ var scratchpadStore = nil; +var scratchpadSplit = nil; var vertRev = { title: [nil, nil, nil], @@ -77,7 +78,7 @@ var vertRev = { me.title = ["VERT REV", " AT ", "PPOS"]; me.L1 = ["", " EFOB ---.-", "wht"]; me.R1 = ["", "EXTRA ---.- ", "wht"]; - me.L2 = ["250/10000", " CLB SPD LIM", "mag"]; + me.L2 = [fmgc.FMGCInternal.clbSpdLim ~ "/" ~ fmgc.FMGCInternal.clbSpdLimAlt, " CLB SPD LIM", "mag"]; me.L4 = [" CONSTANT MACH", nil, "wht"]; me.L5 = [" WIND DATA", nil, "wht"]; me.L6 = [" RETURN", nil, "wht"]; @@ -90,7 +91,7 @@ var vertRev = { me.fontMatrix = [[0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0]]; me.L1 = ["", " EFOB ---.-", "wht"]; me.R1 = ["", "EXTRA ---.- ", "wht"]; - me.L2 = ["250/10000", " CLB SPD LIM", "mag"]; + me.L2 = [fmgc.FMGCInternal.clbSpdLim ~ "/" ~ fmgc.FMGCInternal.clbSpdLimAlt, " CLB SPD LIM", "mag"]; me.speed = me.getSpd(); if (me.speed[0] == nil) { me.L3 = [" [ ]", " SPD CSTR", "blu"]; @@ -130,7 +131,7 @@ var vertRev = { } me.L1 = ["", " EFOB ---.-", "wht"]; me.R1 = ["", "EXTRA ---.- ", "wht"]; - me.L2 = ["250/10000", " CLB SPD LIM", "mag"]; + me.L2 = [fmgc.FMGCInternal.clbSpdLim ~ "/" ~ fmgc.FMGCInternal.clbSpdLimAlt, " CLB SPD LIM", "mag"]; me.L4 = [" CONSTANT MACH", nil, "wht"]; me.L5 = [" WIND DATA", nil, "wht"]; me.L6 = [" RETURN", nil, "wht"]; @@ -146,7 +147,7 @@ var vertRev = { } me.L1 = ["", " EFOB ---.-", "wht"]; me.R1 = ["", "EXTRA ---.- ", "wht"]; - me.L2 = ["250/10000", " DES SPD LIM", "mag"]; + me.L2 = [fmgc.FMGCInternal.desSpdLim ~ "/" ~ fmgc.FMGCInternal.desSpdLimAlt, " DES SPD LIM", "mag"]; me.L4 = [" CONSTANT MACH", nil, "wht"]; me.L5 = [" WIND DATA", nil, "wht"]; me.L6 = [" RETURN", nil, "wht"]; @@ -180,7 +181,65 @@ var vertRev = { }, pushButtonLeft: func(index) { scratchpadStore = mcdu_scratchpad.scratchpads[me.computer].scratchpad; - if (index == 3 and me.type == 2) { + if (index == 2) { + if (scratchpadStore == "CLR") { + if (me.type == 1) { + fmgc.FMGCInternal.desSpdLim = 250; + fmgc.FMGCInternal.desSpdLimAlt = 10000; + fmgc.FMGCInternal.desSpdLimSet = 0; + } else { + fmgc.FMGCInternal.clbSpdLim = 250; + fmgc.FMGCInternal.clbSpdLimAlt = 10000; + fmgc.FMGCInternal.clbSpdLimSet = 0; + } + mcdu_scratchpad.scratchpads[me.computer].empty(); + me._setupPageWithData(); + canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); + } elsif (find("/", scratchpadStore) != -1) { + scratchpadSplit = split("/", scratchpadStore); + if (size(scratchpadSplit[0]) == 3 and num(scratchpadSplit[0]) != nil and size(scratchpadSplit[1]) >= 3 and size(scratchpadSplit[1]) <= 5 and num(scratchpadSplit[1]) != nil) { + if (scratchpadSplit[0] >= 100 and scratchpadSplit[0] <= 340 and scratchpadSplit[1] >= 100 and scratchpadSplit[1] <= 39000) { + if (me.type == 1) { + fmgc.FMGCInternal.desSpdLim = scratchpadSplit[0]; + fmgc.FMGCInternal.desSpdLimSet = 1; + if (size(scratchpadSplit[1]) != 0) { + fmgc.FMGCInternal.desSpdLimAlt = scratchpadSplit[1]; + } + } else { + fmgc.FMGCInternal.clbSpdLim = scratchpadSplit[0]; + fmgc.FMGCInternal.clbSpdLimSet = 1; + if (size(scratchpadSplit[1]) != 0) { + fmgc.FMGCInternal.clbSpdLimAlt = scratchpadSplit[1]; + } + } + mcdu_scratchpad.scratchpads[me.computer].empty(); + me._setupPageWithData(); + canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); + } else { + mcdu_message(me.computer, "ENTRY OUT OF RANGE"); + } + } else { + mcdu_message(me.computer, "FORMAT ERROR"); + } + } elsif (num(scratchpadStore) != nil and size(scratchpadStore) == 3) { + if (scratchpadStore >= 100 and scratchpadStore <= 340) { + if (me.type == 1) { + fmgc.FMGCInternal.desSpdLim = scratchpadStore; + fmgc.FMGCInternal.desSpdLimSet = 1; + } else { + fmgc.FMGCInternal.clbSpdLim = scratchpadStore; + fmgc.FMGCInternal.clbSpdLimSet = 1; + } + mcdu_scratchpad.scratchpads[me.computer].empty(); + me._setupPageWithData(); + canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); + } else { + mcdu_message(me.computer, "ENTRY OUT OF RANGE"); + } + } else { + mcdu_message(me.computer, "FORMAT ERROR"); + } + } elsif (index == 3 and me.type == 2) { if (scratchpadStore == "CLR") { me.wp.setSpeed("delete"); mcdu_scratchpad.scratchpads[me.computer].empty(); diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index 9ab6b592..8b1590d2 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -2380,6 +2380,14 @@ /it-fbw/law eq 0 fcs/slat-pos-deg lt 15 + + aero/alpha-deg-corrected ge 13.5 + + /systems/navigation/aligned-1 eq 1 + /systems/navigation/aligned-2 eq 1 + /systems/navigation/aligned-3 eq 1 + + /systems/navigation/adr/output/aoa-1 ge 13.5 /systems/navigation/adr/operating-1 eq 1 @@ -2397,23 +2405,41 @@ /it-fbw/law eq 0 fcs/slat-pos-deg ge 15 - - /systems/navigation/adr/output/aoa-1 ge 22 - /systems/navigation/adr/operating-1 eq 1 - - - /systems/navigation/adr/output/aoa-2 ge 22 - /systems/navigation/adr/operating-2 eq 1 - - - /systems/navigation/adr/output/aoa-3 ge 22 - /systems/navigation/adr/operating-3 eq 1 + + + aero/alpha-deg-corrected ge 22 + + /systems/navigation/aligned-1 eq 1 + /systems/navigation/aligned-2 eq 1 + /systems/navigation/aligned-3 eq 1 + + + + /systems/navigation/adr/output/aoa-1 ge 22 + /systems/navigation/adr/operating-1 eq 1 + + + /systems/navigation/adr/output/aoa-2 ge 22 + /systems/navigation/adr/operating-2 eq 1 + + + /systems/navigation/adr/output/aoa-3 ge 22 + /systems/navigation/adr/operating-3 eq 1 + /it-fbw/law ne 0 fcs/slat-pos-deg lt 15 + + aero/alpha-deg-corrected ge 8 + + /systems/navigation/aligned-1 eq 1 + /systems/navigation/aligned-2 eq 1 + /systems/navigation/aligned-3 eq 1 + + /systems/navigation/adr/output/aoa-1 ge 8 /systems/navigation/adr/operating-1 eq 1 @@ -2431,17 +2457,27 @@ /it-fbw/law ne 0 fcs/slat-pos-deg ge 15 - - /systems/navigation/adr/output/aoa-1 ge 14 - /systems/navigation/adr/operating-1 eq 1 - - - /systems/navigation/adr/output/aoa-2 ge 14 - /systems/navigation/adr/operating-2 eq 1 - - - /systems/navigation/adr/output/aoa-3 ge 14 - /systems/navigation/adr/operating-3 eq 1 + + + aero/alpha-deg-corrected ge 14 + + /systems/navigation/aligned-1 eq 1 + /systems/navigation/aligned-2 eq 1 + /systems/navigation/aligned-3 eq 1 + + + + /systems/navigation/adr/output/aoa-1 ge 14 + /systems/navigation/adr/operating-1 eq 1 + + + /systems/navigation/adr/output/aoa-2 ge 14 + /systems/navigation/adr/operating-2 eq 1 + + + /systems/navigation/adr/output/aoa-3 ge 14 + /systems/navigation/adr/operating-3 eq 1 + diff --git a/Systems/a320-misc.xml b/Systems/a320-misc.xml index d191a512..d011f01b 100644 --- a/Systems/a320-misc.xml +++ b/Systems/a320-misc.xml @@ -452,4 +452,62 @@ + + + + + + + + /fdm/jsbsim/fcs/slat-pos-deg + 15 + + + aero/alpha-deg-corrected + + -1.5 136.409 + 0.0 53.447 + 3.0 0 + 6.5 -53.447 + 8.0 -136.409 + +
+ + aero/alpha-deg-corrected + + -1.5 136.409 + 0.0 53.447 + 3.0 0 + 12.5 -53.447 + 14.0 -136.409 + +
+ + + + + + + + + + + + /instrumentation/airspeed-indicator/indicated-mach + /instrumentation/airspeed-indicator/indicated-speed-kt + + + + + + + + /instrumentation/airspeed-indicator/indicated-mach + /instrumentation/airspeed-indicator/indicated-speed-kt + + + + + +