diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 05497689..243ffb48 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -733,7 +733,11 @@ var canvas_MCDU_base = { var p = logs[i].state; if (p == 4) p = 3; # RETURN-IN me[rowsC[p]].setText(logs[i].time); - me[rowsR[p]].setText(sprintf("%3.1f ",logs[i].fob)); + if (acconfig_weight_kgs.getValue() == 1) { + me[rowsR[p]].setText(sprintf("%3.1f ",logs[i].fob * LBS2KGS)); + } else { + me[rowsR[p]].setText(sprintf("%3.1f ",logs[i].fob)); + } } } var logpage = mcdu.FlightLogDatabase.getPage(logid); @@ -797,7 +801,11 @@ var canvas_MCDU_base = { me["Simple_R3S"].setText(sprintf("%-10s",(doorL4_pos.getValue() > 0.1) ? "OPEN" : "CLOSED")); me["Simple_R3"].setText(sprintf("%-10s",(doorR4_pos.getValue() > 0.1) ? "OPEN" : "CLOSED")); me["Simple_R4S"].setText(sprintf("%-10s",sprintf("%03.3f",pts.Velocities.groundspeedKt.getValue()))); - me["Simple_R4"].setText(sprintf("%-10s",sprintf("%03.1f",fmgc.FMGCInternal.fob))); + if (acconfig_weight_kgs.getValue() == 1) { + me["Simple_R4"].setText(sprintf("%-10s",sprintf("%03.1f",fmgc.FMGCInternal.fob * LBS2KGS))); + } else { + me["Simple_R4"].setText(sprintf("%-10s",sprintf("%03.1f",fmgc.FMGCInternal.fob))); + } } else if (page == "AOCCONFIG") { if (!pageSwitch[i].getBoolValue()) { me.defaultHideWithCenter(); diff --git a/Models/Instruments/ND/canvas/framework/navdisplay.nas b/Models/Instruments/ND/canvas/framework/navdisplay.nas index 1202618b..e078df25 100644 --- a/Models/Instruments/ND/canvas/framework/navdisplay.nas +++ b/Models/Instruments/ND/canvas/framework/navdisplay.nas @@ -637,11 +637,9 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec me.symbols.dmeRDist.setText(""); } - # Hide heading bug 10 secs after change + # Hide heading bug 45 secs after change var vhdg_bug = getprop("/it-autoflight/input/hdg") or 0; - var hdg_bug_active = getprop("/it-autoflight/custom/show-hdg"); - if (hdg_bug_active == nil) - hdg_bug_active = 1; + var hdg_bug_active = getprop("/it-autoflight/custom/show-hdg") or 1; if((me.in_mode("toggle_display_mode", ["MAP"]) and me.get_switch("toggle_display_type") == "CRT") or (me.get_switch("toggle_track_heading") and me.get_switch("toggle_display_type") == "LCD")) diff --git a/Models/Instruments/ND/canvas/map/WPT-airbus.symbol b/Models/Instruments/ND/canvas/map/WPT-airbus.symbol index 7d00e465..8320f312 100644 --- a/Models/Instruments/ND/canvas/map/WPT-airbus.symbol +++ b/Models/Instruments/ND/canvas/map/WPT-airbus.symbol @@ -79,6 +79,15 @@ var init = func { } var draw = func{ + if (me.model.wp.hidden == 1 or me.model.name == "(DECEL)" or me.model.name == "(T/C)" or me.model.name == "(T/D)" or me.model.name == "(LIM)") { + me.wp_sym.hide(); + me.text_wps.hide(); + if (me.text_alt != nil) { + me.text_alt.hide(); + } + return; + } + var wp_group = me.element; var alt = me.model.alt; var i = me.model.idx; diff --git a/Models/Instruments/ND/canvas/style.nas b/Models/Instruments/ND/canvas/style.nas index 3c708480..d45a1f17 100644 --- a/Models/Instruments/ND/canvas/style.nas +++ b/Models/Instruments/ND/canvas/style.nas @@ -60,7 +60,7 @@ canvas.NDStyles["Airbus"] = { lat_ctrl: "/it-autoflight/output/lat", managed_val: 1, ver_ctrl: "/it-autoflight/output/vert", - spd_ctrl: "/flight-management/control/spd-ctrl", + spd_ctrl: "/it-autoflight/input/spd-managed", current_wp: "/FMGC/flightplan[2]/current-wp", ap1: "/it-autoflight/output/ap1", ap2: "/it-autoflight/output/ap2", @@ -595,18 +595,18 @@ canvas.NDStyles["Airbus"] = { isMapStructure: 1, update_on: ["toggle_display_mode","toggle_range"], predicate: func(nd, layer) { - var visible = nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]) and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting)); + var visible = nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]) and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting)) and getprop("/instrumentation/nd/symbols/decel/show"); layer.group.setVisible( visible ); if (visible) { layer.update(); } }, options: { - # Overridable options: - # decel_node: node containing latitude-deg and longitude-deg used to mark the deceleration point - # managed_speed_node: boolean property indicating that the aircraft is flying in managed speed mode + decel_node: "/instrumentation/nd/symbols/decel", listen: [ "fplan_active", + "current_wp", + "wp_count", "spd_ctrl", "ver_ctrl", "athr" @@ -746,14 +746,15 @@ canvas.NDStyles["Airbus"] = { }, }, { - id: "taOnly", # the SVG ID - impl: { # implementation hash - init: func(nd, symbol), # for updateCenter stuff, called during initialization in the ctor - predicate: func(nd) getprop("/instrumentation/tcas/inputs/mode") == 2, # the condition - is_true: func(nd) nd.symbols.taOnly.show(), # if true, run this - is_false: func(nd) nd.symbols.taOnly.hide(), # if false, run this - }, # end of taOnly behavior/callbacks - }, # end of taOnly + # TODO: taOnly doesn"t need to use getprop polling in update(), use a listener instead! + id: "taOnly", + impl: { + init: func(nd, symbol), + predicate: func(nd) getprop("/instrumentation/tcas/inputs/mode") == 2, + is_true: func(nd) nd.symbols.taOnly.show(), + is_false: func(nd) nd.symbols.taOnly.hide(), + }, + }, { id: "tas", impl: { @@ -761,7 +762,6 @@ canvas.NDStyles["Airbus"] = { predicate: func(nd) getprop("/instrumentation/airspeed-indicator/true-speed-kt") >= 60, is_true: func(nd) { nd.symbols.tas.setText(sprintf("%3.0f",getprop("/instrumentation/airspeed-indicator/true-speed-kt"))); - nd.symbols.tas.show(); }, is_false: func(nd){ nd.symbols.tas.setText("---"); @@ -1324,7 +1324,7 @@ canvas.NDStyles["Airbus"] = { id:"curTrkPtr", impl: { init: func(nd,symbol), - predicate: func(nd) (nd.in_mode("toggle_display_mode", ["APP","VOR","MAP"]) and !nd.get_switch("toggle_centered") + predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and !nd.get_switch("toggle_centered") and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting)) and abs(nd.aircraft_source.get_trk_mag() - nd.aircraft_source.get_hdg_mag()) <= 42), is_true: func(nd) { @@ -1368,7 +1368,7 @@ canvas.NDStyles["Airbus"] = { impl: { init: func(nd,symbol), predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and - nd.get_switch("toggle_centered") and (nd.change_phase != 1) and + nd.get_switch("toggle_centered") and (nd.change_phase != 1) and getprop(nd.options.defaults.lat_ctrl) == 0 and abs(nd.aircraft_source.get_trk_mag() - nd.aircraft_source.get_hdg_mag()) <= 42 and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting))), is_true: func(nd) { @@ -1531,6 +1531,8 @@ canvas.NDStyles["Airbus"] = { predicate: func(nd) (getprop("/instrumentation/airspeed-indicator/true-speed-kt") >= 100), is_true: func(nd) { var windDir = pts.Instrumentation.PFD.windDirection.getValue() or 0; + if(nd.get_switch("toggle_true_north")) + windDir = windDir + getprop("/environment/magnetic-variation-deg"); nd.symbols.wind.setText(sprintf("%03.0f / %02.0f",windDir,pts.Instrumentation.PFD.windSpeed.getValue() or 0)); }, is_false: func(nd) { @@ -1545,7 +1547,18 @@ canvas.NDStyles["Airbus"] = { predicate: func(nd) (!(nd.in_mode("toggle_display_mode", ["PLAN"]) and (nd.get_switch("toggle_display_type") == "LCD")) and (pts.Instrumentation.PFD.windSpeed.getValue() or 0) >= 2 and getprop("/instrumentation/airspeed-indicator/true-speed-kt") >= 100), is_true: func(nd) { nd.symbols.windArrow.show(); - var windArrowRot = (pts.Instrumentation.PFD.windDirection.getValue() or 0) - nd.aircraft_source.get_hdg_tru(); + var windArrowRot = pts.Instrumentation.PFD.windDirection.getValue() or 0; + if(nd.in_mode("toggle_display_mode", ["MAP","PLAN"])) { + if(nd.get_switch("toggle_true_north")) + windArrowRot = windArrowRot - nd.aircraft_source.get_trk_tru(); + else + windArrowRot = windArrowRot - nd.aircraft_source.get_trk_mag(); + } else { + if(nd.get_switch("toggle_true_north")) + windArrowRot = windArrowRot - nd.aircraft_source.get_hdg_tru(); + else + windArrowRot = windArrowRot - nd.aircraft_source.get_hdg_mag(); + } nd.symbols.windArrow.setRotation(windArrowRot*D2R); }, is_false: func(nd) nd.symbols.windArrow.hide(), diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index 3b7e7239..5a4726de 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -713,7 +713,7 @@ var canvas_pfd = { me.tgt_kts = notification.targetKts; if (notification.managedSpd) { - if (notification.decel) { + if (fmgc.FMGCInternal.decel) { me.tgt_ias = fmgc.FMGCInternal.vappSpeedSet ? fmgc.FMGCInternal.vapp_appr : fmgc.FMGCInternal.vapp; me.tgt_kts = fmgc.FMGCInternal.vappSpeedSet ? fmgc.FMGCInternal.vapp_appr : fmgc.FMGCInternal.vapp; } else if (fmgc.FMGCInternal.phase == 6) { @@ -2055,7 +2055,6 @@ var input = { detent2: "/fdm/jsbsim/fadec/control-2/detent", decision: "/instrumentation/mk-viii/inputs/arinc429/decision-height", - decel: "/FMGC/internal/decel", radio: "/FMGC/internal/radio", baro: "/FMGC/internal/baro", diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index c2e453fd..aedb8bef 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -24,10 +24,7 @@ var altitude = 0; var flap = 0; var flaps = 0; var ktsmach = 0; -var kts_sel = 0; -var mach_sel = 0; var srsSPD = 0; -var decel = 0; var mng_alt_spd = 0; var mng_alt_mach = 0; var altsel = 0; @@ -72,6 +69,9 @@ var FMGCinit = func { } var FMGCInternal = { + # phase logic + phase: 0, + decel: 0, minspeed: 0, maxspeed: 0, clbSpdLim: 250, @@ -255,7 +255,6 @@ var postInit = func() { var FMGCNodes = { costIndex: props.globals.initNode("/FMGC/internal/cost-index", 0, "DOUBLE"), - decel: props.globals.initNode("/FMGC/internal/decel", 0, "BOOL"), clean: props.globals.getNode("/FMGC/internal/clean"), flap2: props.globals.getNode("/FMGC/internal/flap-2"), flap3: props.globals.getNode("/FMGC/internal/flap-3"), @@ -322,9 +321,15 @@ var updateARPT = func { } } -var updateArptLatLon = func { +var apt = nil; +var dms = nil; +var degrees = nil; +var minutes = nil; +var sign = nil; +var updateArptLatLon = func() { #ref lat - dms = getprop("/FMGC/flightplan[2]/wp[0]/lat"); + apt = airportinfo(FMGCInternal.depApt); + dms = apt.lat; degrees = int(dms); minutes = sprintf("%.1f",abs((dms - degrees) * 60)); sign = degrees >= 0 ? "N" : "S"; @@ -332,7 +337,7 @@ var updateArptLatLon = func { setprop("/FMGC/internal/align-ref-lat-minutes", minutes); setprop("/FMGC/internal/align-ref-lat-sign", sign); #ref long - dms = getprop("/FMGC/flightplan[2]/wp[0]/lon"); + dms = apt.lon; degrees = int(dms); minutes = sprintf("%.1f",abs((dms - degrees) * 60)); sign = degrees >= 0 ? "E" : "W"; @@ -631,7 +636,7 @@ var masterFMGC = maketimer(0.2, func { } } } elsif (FMGCInternal.phase == 4) { - if (FMGCNodes.decel.getValue()) { + if (FMGCInternal.decel) { newphase = 5; } } elsif (FMGCInternal.phase == 5) { @@ -648,9 +653,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 (Modes.PFD.FMA.rollMode == "NAV" or Modes.PFD.FMA.rollMode == "LOC" or Modes.PFD.FMA.rollMode == "LOC*") and pts.Position.gearAglFt.getValue() < 9500) { #todo decel pseudo waypoint - FMGCNodes.decel.setValue(1); - } elsif (FMGCNodes.decel.getValue() and (FMGCInternal.phase == 0 or FMGCInternal.phase == 6)) { - FMGCNodes.decel.setValue(0); + FMGCInternal.decel = 1; + } elsif (FMGCInternal.decel and (FMGCInternal.phase == 0 or FMGCInternal.phase == 6)) { + FMGCInternal.decel = 0; } tempOverspeed = systems.ADIRS.overspeedVFE.getValue(); @@ -933,7 +938,6 @@ var ManagedSPD = maketimer(0.25, func { if (FMGCInternal.crzSet and FMGCInternal.costIndexSet) { if (Custom.Input.spdManaged.getBoolValue()) { altitude = pts.Instrumentation.Altimeter.indicatedFt.getValue(); - decel = FMGCNodes.decel.getValue(); ktsmach = Input.ktsMach.getValue(); srsSPD = srsSpeedNode.getValue(); @@ -953,12 +957,12 @@ var ManagedSPD = maketimer(0.25, func { } 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); + FMGCInternal.mngSpdCmd = FMGCInternal.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) { + if (FMGCInternal.decel) { FMGCInternal.mngKtsMach = 0; FMGCInternal.mngSpdCmd = FMGCInternal.minspeed; } else { @@ -968,7 +972,7 @@ var ManagedSPD = maketimer(0.25, func { } 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); + FMGCInternal.mngSpdCmd = FMGCInternal.decel ? FMGCInternal.minspeed : math.clamp(FMGCInternal.desSpdLim, FMGCInternal.clean, 999); } # Clamp to minspeed, maxspeed diff --git a/Nasal/MCDU/F-PLN.nas b/Nasal/MCDU/F-PLN.nas index caad448d..296b8d11 100644 --- a/Nasal/MCDU/F-PLN.nas +++ b/Nasal/MCDU/F-PLN.nas @@ -290,6 +290,31 @@ var staticText = { }, }; +var pseudoItem = { + new: func(computer, text) { + var pI = {parents:[pseudoItem]}; + pI.computer = computer; + pI.text = text; + pI.colour = colour; + return pI; + }, + updateLeftText: func() { + return [me.text, nil, me.colour]; + }, + updateCenterText: func() { + return ["----", nil, "wht"]; + }, + updateRightText: func() { + return ["---/------", " --NM ", "wht"]; + }, + pushButtonLeft: func() { + mcdu_message(me.computer, "NOT ALLOWED"); + }, + pushButtonRight: func() { + mcdu_message(me.computer, "NOT ALLOWED"); + }, +}; + var fplnPage = { # this one is only created once, and then updated - remember this L1: [nil, nil, "ack"], # content, title, colour L2: [nil, nil, "ack"], @@ -346,6 +371,8 @@ var fplnPage = { # this one is only created once, and then updated - remember th return "----END OF ALTN F-PLN---"; } else if (type == "noAltnFpln") { return "------NO ALTN F-PLN-----"; + } else if (type == "decel") { + return "(DECEL)"; } else if (type == "empty") { return ""; } @@ -510,6 +537,12 @@ var fplnPage = { # this one is only created once, and then updated - remember th } else { if (size(me.outputList) >= index and !mcdu_scratchpad.scratchpads[me.computer].showTypeIMsg and !mcdu_scratchpad.scratchpads[me.computer].showTypeIIMsg) { if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) > 0) { + if (mcdu_scratchpad.scratchpads[me.computer].scratchpad == "CLR") { + if (me.outputList[index - 1 + me.scroll].wp.wp_name == "(DECEL)") { + mcdu_message(me.computer, "NOT ALLOWED"); + return; + } + } var returny = fmgc.flightPlanController.scratchpad(mcdu_scratchpad.scratchpads[me.computer].scratchpad, (index - 1 + me.scroll), me.computer); if (returny == 3) { mcdu_message(me.computer, "DIR TO IN PROGRESS"); diff --git a/Nasal/MCDU/FLIGHTLOG.nas b/Nasal/MCDU/FLIGHTLOG.nas index 1c82d556..415fbc73 100644 --- a/Nasal/MCDU/FLIGHTLOG.nas +++ b/Nasal/MCDU/FLIGHTLOG.nas @@ -5,7 +5,11 @@ var OOOIReport = { new: func(state,time=0,fob="") { var report = {parents:[OOOIReport]}; report.state = state; - report.fob = (fob != "") ? fob : fmgc.FMGCInternal.fob; + if (acconfig_weight_kgs.getValue() == 1) { + report.fob = (fob != "") ? fob : fmgc.FMGCInternal.fob * LBS2KGS; + } else { + report.fob = (fob != "") ? fob : fmgc.FMGCInternal.fob; + } if (time != 0) { report.time = formatSecToHHMM(time); report.elapsed = time; @@ -195,4 +199,4 @@ var engine_one_chk_OOOI = setlistener("/engines/engine[0]/state", func { removelistener(engine_one_chk_OOOI); waitingOOOIChange.start(); } -},0,0); \ No newline at end of file +},0,0); diff --git a/Nasal/MCDU/INITA.nas b/Nasal/MCDU/INITA.nas index a8f89971..b1360af9 100644 --- a/Nasal/MCDU/INITA.nas +++ b/Nasal/MCDU/INITA.nas @@ -3,6 +3,29 @@ # Copyright (c) 2022 Josh Davidson (Octal450) # Copyright (c) 2020 Matthew Maring (mattmaring) +var resetFlightplan = func(i) { + fmgc.FMGCInternal.depApt = ""; + fmgc.FMGCInternal.arrApt = ""; + fmgc.FMGCInternal.toFromSet = 0; + fmgc.FMGCNodes.toFromSet.setValue(0); + fmgc.windController.resetDesWinds(); + setprop("/FMGC/internal/align-ref-lat", 0); + setprop("/FMGC/internal/align-ref-long", 0); + setprop("/FMGC/internal/align-ref-lat-edit", 0); + setprop("/FMGC/internal/align-ref-long-edit", 0); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); + fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); + } + fmgc.flightPlanController.reset(2); + fmgc.flightPlanController.init(); + Simbrief.SimbriefParser.inhibit = 0; + fmgc.updateARPT(); + mcdu_scratchpad.scratchpads[i].empty(); +} + var initInputA = func(key, i) { var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; if (key == "L1") { #clear coRoute if set @@ -220,26 +243,7 @@ var initInputA = func(key, i) { mcdu_message(i, "NOT ALLOWED"); } else if (scratchpad == "CLR") { - fmgc.FMGCInternal.depApt = ""; - fmgc.FMGCInternal.arrApt = ""; - fmgc.FMGCInternal.toFromSet = 0; - fmgc.FMGCNodes.toFromSet.setValue(0); - fmgc.windController.resetDesWinds(); - setprop("/FMGC/internal/align-ref-lat", 0); - setprop("/FMGC/internal/align-ref-long", 0); - setprop("/FMGC/internal/align-ref-lat-edit", 0); - setprop("/FMGC/internal/align-ref-long-edit", 0); - if (fmgc.FMGCInternal.blockConfirmed) { - fmgc.FMGCInternal.fuelCalculating = 0; - fmgc.fuelCalculating.setValue(0); - fmgc.FMGCInternal.fuelCalculating = 1; - fmgc.fuelCalculating.setValue(1); - } - fmgc.flightPlanController.reset(2); - fmgc.flightPlanController.init(); - Simbrief.SimbriefParser.inhibit = 0; - fmgc.updateARPT(); - mcdu_scratchpad.scratchpads[i].empty(); + resetFlightplan(i); #} else if (scratchpad == "") { #fmgc.FMGCInternal.altSelected = 0; #setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION"); @@ -251,18 +255,15 @@ var initInputA = func(key, i) { var froms = size(fromto[0]); var tos = size(fromto[1]); if (froms == 4 and tos == 4) { - #route - if (fmgc.FMGCInternal.toFromSet == 1 and fmgc.FMGCInternal.arrApt != fromto[1]) { - fmgc.windController.resetDesWinds(); - } + resetFlightplan(i); fmgc.FMGCInternal.depApt = fromto[0]; fmgc.FMGCInternal.arrApt = fromto[1]; atsu.ATISInstances[0].newStation(fromto[0]); atsu.ATISInstances[1].newStation(fromto[1]); fmgc.FMGCInternal.toFromSet = 1; fmgc.FMGCNodes.toFromSet.setValue(1); - #scratchpad mcdu_scratchpad.scratchpads[i].empty(); + fmgc.flightPlanController.updateAirports(fromto[0], fromto[1], 2); fmgc.FMGCInternal.altSelected = 0; fmgc.updateARPT(); diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index a5765c89..8f546edd 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -153,7 +153,6 @@ var MCDU_reset = func(i) { fmgc.FMGCInternal.vrset = 0; fmgc.FMGCInternal.v2 = 0; fmgc.FMGCInternal.v2set = 0; - setprop("/FMGC/internal/accel-agl-ft", 1500); #eventually set to 1500 above runway setprop("/MCDUC/thracc-set", 0); setprop("/FMGC/internal/to-flap", 0); @@ -1566,6 +1565,8 @@ var button = func(btn, i, event = "") { } else { # up with buttonCLRDown[i]>4 buttonCLRDown[i] = 0; } + } else if (btn == "LONGCLR") { + mcdu_scratchpad.scratchpads[i].empty(); } else if (btn == "DOT") { mcdu_scratchpad.scratchpads[i].addChar("."); } else if (btn == "PLUSMINUS") { diff --git a/Nasal/MCDU/PERFCLB.nas b/Nasal/MCDU/PERFCLB.nas index ee8d6536..ee45ead1 100644 --- a/Nasal/MCDU/PERFCLB.nas +++ b/Nasal/MCDU/PERFCLB.nas @@ -38,7 +38,7 @@ var perfCLBInput = func(key, i) { if (getprop("/FMGC/internal/activate-twice") == 0) { setprop("/FMGC/internal/activate-twice", 1); fmgc.FMGCInternal.phase = 5; - setprop("/FMGC/internal/decel", 1); + fmgc.FMGCInternal.decel = 1; setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR"); } else { mcdu_message(i, "NOT ALLOWED"); diff --git a/Nasal/MCDU/PERFCRZ.nas b/Nasal/MCDU/PERFCRZ.nas index 5622cbb0..87d041e7 100644 --- a/Nasal/MCDU/PERFCRZ.nas +++ b/Nasal/MCDU/PERFCRZ.nas @@ -32,7 +32,7 @@ var perfCRZInput = func(key, i) { if (getprop("/FMGC/internal/activate-twice") == 0) { setprop("/FMGC/internal/activate-twice", 1); fmgc.FMGCInternal.phase = 5; - setprop("/FMGC/internal/decel", 1); + fmgc.FMGCInternal.decel = 1; setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR"); } else { mcdu_message(i, "NOT ALLOWED"); diff --git a/Nasal/MCDU/PERFDES.nas b/Nasal/MCDU/PERFDES.nas index 608850d2..def27ef8 100644 --- a/Nasal/MCDU/PERFDES.nas +++ b/Nasal/MCDU/PERFDES.nas @@ -32,7 +32,7 @@ var perfDESInput = func(key, i) { if (getprop("/FMGC/internal/activate-twice") == 0) { setprop("/FMGC/internal/activate-twice", 1); fmgc.FMGCInternal.phase = 5; - setprop("/FMGC/internal/decel", 1); + fmgc.FMGCInternal.decel = 1; setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR"); } else { mcdu_message(i, "NOT ALLOWED"); diff --git a/Nasal/MCDU/PROG.nas b/Nasal/MCDU/PROG.nas index df91a0cd..ec393405 100644 --- a/Nasal/MCDU/PROG.nas +++ b/Nasal/MCDU/PROG.nas @@ -52,7 +52,7 @@ var progCLBInput = func(key, i) { systems.PNEU.pressMode.setValue("CR"); setprop("/FMGC/internal/activate-once", 0); setprop("/FMGC/internal/activate-twice", 0); - setprop("/FMGC/internal/decel", 0); + fmgc.FMGCInternal.decel = 0; } mcdu_scratchpad.scratchpads[i].empty(); } else if (int(scratchpad) != nil) { @@ -66,7 +66,7 @@ var progCLBInput = func(key, i) { systems.PNEU.pressMode.setValue("CR"); setprop("/FMGC/internal/activate-once", 0); setprop("/FMGC/internal/activate-twice", 0); - setprop("/FMGC/internal/decel", 0); + fmgc.FMGCInternal.decel = 0; } } else { mcdu_message(i, "NOT ALLOWED"); @@ -88,7 +88,7 @@ var progCRZInput = func(key, i) { systems.PNEU.pressMode.setValue("CR"); setprop("/FMGC/internal/activate-once", 0); setprop("/FMGC/internal/activate-twice", 0); - setprop("/FMGC/internal/decel", 0); + fmgc.FMGCInternal.decel = 0; } mcdu_scratchpad.scratchpads[i].empty(); } else if (int(scratchpad) != nil) { @@ -102,7 +102,7 @@ var progCRZInput = func(key, i) { systems.PNEU.pressMode.setValue("CR"); setprop("/FMGC/internal/activate-once", 0); setprop("/FMGC/internal/activate-twice", 0); - setprop("/FMGC/internal/decel", 0); + fmgc.FMGCInternal.decel = 0; } } else { mcdu_message(i, "NOT ALLOWED"); @@ -124,7 +124,7 @@ var progDESInput = func(key, i) { systems.PNEU.pressMode.setValue("CR"); setprop("/FMGC/internal/activate-once", 0); setprop("/FMGC/internal/activate-twice", 0); - setprop("/FMGC/internal/decel", 0); + fmgc.FMGCInternal.decel = 0; } mcdu_scratchpad.scratchpads[i].empty(); } else if (int(scratchpad) != nil) { @@ -138,7 +138,7 @@ var progDESInput = func(key, i) { systems.PNEU.pressMode.setValue("CR"); setprop("/FMGC/internal/activate-once", 0); setprop("/FMGC/internal/activate-twice", 0); - setprop("/FMGC/internal/decel", 0); + fmgc.FMGCInternal.decel = 0; } } else { mcdu_message(i, "NOT ALLOWED"); diff --git a/WebPanel/WebPanel1/img/icon-192.png b/WebPanel/WebPanel1/img/icon-192.png new file mode 100644 index 00000000..a4e0d381 Binary files /dev/null and b/WebPanel/WebPanel1/img/icon-192.png differ diff --git a/WebPanel/WebPanel1/screenshot.jpg b/WebPanel/WebPanel1/img/screenshot.jpg similarity index 100% rename from WebPanel/WebPanel1/screenshot.jpg rename to WebPanel/WebPanel1/img/screenshot.jpg diff --git a/WebPanel/WebPanel1/index.html b/WebPanel/WebPanel1/index.html index cc4b1fdd..15fb7eca 100644 --- a/WebPanel/WebPanel1/index.html +++ b/WebPanel/WebPanel1/index.html @@ -1,6 +1,5 @@ -