From c50d42c1380b29821f04c712cc0ff8e20566a690 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 17 Jul 2020 20:58:39 +0100 Subject: [PATCH] Fix Nasal errors, fix payload dialog --- Nasal/MCDU/CLOSESTAIRPORT.nas | 12 ++++++------ Nasal/MCDU/LATREV.nas | 2 +- Nasal/Systems/payload.nas | 1 + gui/dialogs/refuel.nas | 7 ++++--- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Nasal/MCDU/CLOSESTAIRPORT.nas b/Nasal/MCDU/CLOSESTAIRPORT.nas index ddec61e9..fa72faba 100644 --- a/Nasal/MCDU/CLOSESTAIRPORT.nas +++ b/Nasal/MCDU/CLOSESTAIRPORT.nas @@ -112,13 +112,13 @@ var closestAirportPage = { } if (size(id) > 4) { mcdu_message(me.computer, "NOT ALLOWED"); + } elsif (airportinfo(id) == nil) { + mcdu_message(me.computer, "NOT IN DATA BASE"); + } else { + me.manAirport = airportinfo(id); + me.L5 = [id, nil, "grn"]; + me.R5 = ["----", nil, "grn"]; } - if (airportinfo(id) == nil) { - notInDataBase(me.computer); - } - me.manAirport = airportinfo(id); - me.L5 = [id, nil, "grn"]; - me.R5 = ["----", nil, "grn"]; canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); } }; diff --git a/Nasal/MCDU/LATREV.nas b/Nasal/MCDU/LATREV.nas index 0896a37a..ce81594a 100644 --- a/Nasal/MCDU/LATREV.nas +++ b/Nasal/MCDU/LATREV.nas @@ -132,7 +132,7 @@ var latRev = { var returny = fmgc.flightPlanController.scratchpad(mcdu_scratchpad.scratchpads[me.computer].scratchpad, me.index + 1, me.computer); if (returny == 0) { - notInDataBase(me.computer); + mcdu_message(me.computer, "NOT IN DATA BASE"); } elsif (returny == 1) { mcdu_message(me.computer, "NOT ALLOWED"); } else { diff --git a/Nasal/Systems/payload.nas b/Nasal/Systems/payload.nas index cd508129..7d0ec8ad 100644 --- a/Nasal/Systems/payload.nas +++ b/Nasal/Systems/payload.nas @@ -9,6 +9,7 @@ var fuelSvc = { Nodes: { requestLbs: props.globals.getNode("services/fuel-truck/request-lbs"), requestTotalLbs: props.globals.getNode("services/fuel-truck/request-total-lbs"), + requestFuelLbs: props.globals.initNode("services/fuel-truck/fuel-on-board-at-request", pts.Consumables.Fuel.totalFuelLbs.getValue(), "DOUBLE"), }, newRequest: func() { diff --git a/gui/dialogs/refuel.nas b/gui/dialogs/refuel.nas index 346be34f..0085ebc6 100644 --- a/gui/dialogs/refuel.nas +++ b/gui/dialogs/refuel.nas @@ -63,8 +63,6 @@ var refuelClass = { me._svg = me._root.createChild("group"); canvas.parsesvg(me._svg, "Aircraft/A320-family/gui/dialogs/refuel.svg"); - - amount.setValue(math.round((pts.Consumables.Fuel.totalFuelLbs.getValue() + systems.fuelSvc.Nodes.requestLbs.getValue()) / 1000, 0.1)); me._HI_LVL_L = me._svg.getElementById("HI-LVL-L"); me._HI_LVL_C = me._svg.getElementById("HI-LVL-C"); @@ -405,8 +403,8 @@ var refuelClass = { me._Mode_refuel.show(); me._Mode_off.hide(); me._Mode_defuel.hide(); + systems.fuelSvc.Nodes.requestFuelLbs.setValue(pts.Consumables.Fuel.totalFuelLbs.getValue()); systems.fuelSvc.refuel(); - } }); @@ -484,6 +482,9 @@ var refuelClass = { me._timerUp.stop(); }); + + amount.setValue(math.round((systems.fuelSvc.Nodes.requestFuelLbs.getValue() + systems.fuelSvc.Nodes.requestLbs.getValue()) / 1000, 0.1)); + me._timerf(); me._timer.start(); },