From 5adce22c68e725717c6439daa17b9e7ca3060f21 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 31 Oct 2020 21:47:46 +0000 Subject: [PATCH] Fix potential bug in QRH, fix bug in simbrief parser --- Nasal/FMGC/SimbriefParser.nas | 6 +++++- Nasal/QRH/QRH.nas | 6 +++--- Nasal/Systems/Comm/Notification.nas | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Nasal/FMGC/SimbriefParser.nas b/Nasal/FMGC/SimbriefParser.nas index f5f1cfe1..792df12e 100644 --- a/Nasal/FMGC/SimbriefParser.nas +++ b/Nasal/FMGC/SimbriefParser.nas @@ -80,8 +80,11 @@ var SimbriefParser = { if (departures != nil and size(departures) != 0 and destinations != nil and size(destinations) != 0) { fmgc.flightPlanController.flightplans[3].departure = departures[0]; fmgc.flightPlanController.flightplans[3].destination = destinations[0]; - fmgc.FMGCInternal.arrApt = destinationID; fmgc.FMGCInternal.depApt = departureID; + fmgc.FMGCInternal.arrApt = destinationID; + + atsu.ATISInstances[0].newStation(departureID); + atsu.ATISInstances[1].newStation(destinationID); fmgc.FMGCInternal.toFromSet = 1; fmgc.FMGCNodes.toFromSet.setValue(1); @@ -107,6 +110,7 @@ var SimbriefParser = { var alternates = findAirportsByICAO(alternateID); if (alternates != nil and size(alternates) != 0) { fmgc.FMGCInternal.altAirport = alternateID; + atsu.ATISInstances[2].newStation(alternateID); fmgc.FMGCInternal.altAirportSet = 1; } diff --git a/Nasal/QRH/QRH.nas b/Nasal/QRH/QRH.nas index 73fc21df..93a41692 100644 --- a/Nasal/QRH/QRH.nas +++ b/Nasal/QRH/QRH.nas @@ -37,7 +37,7 @@ var createCanvasQRH = func() { qrhCanvas.setLayout(myHBox); QRH = canvas.gui.widgets.Label.new(root, canvas.style, {} ) - .setImage("Aircraft/A320-family/Models/FlightDeck/QRH/" ~ QRHpageNo.getValue() ~ ".jpeg") + .setImage(resolvepath("Aircraft/A320-family/Models/FlightDeck/QRH/" ~ QRHpageNo.getValue() ~ ".jpeg")) .move(0,-25) .setSize(400,625); myHBox.addItem(QRH); @@ -78,11 +78,11 @@ var createCanvasQRH = func() { }); buttonPrev.listen("clicked", func { prevPage(); - QRH.setImage("Aircraft/A320-family/Models/FlightDeck/QRH/" ~ QRHpageNo.getValue() ~ ".jpeg"); + QRH.setImage(resolvepath("Aircraft/A320-family/Models/FlightDeck/QRH/" ~ QRHpageNo.getValue() ~ ".jpeg")); }); buttonNext.listen("clicked", func { nextPage(); - QRH.setImage("Aircraft/A320-family/Models/FlightDeck/QRH/" ~ QRHpageNo.getValue() ~ ".jpeg"); + QRH.setImage(resolvepath("Aircraft/A320-family/Models/FlightDeck/QRH/" ~ QRHpageNo.getValue() ~ ".jpeg")); }); diff --git a/Nasal/Systems/Comm/Notification.nas b/Nasal/Systems/Comm/Notification.nas index 339c6d74..c87f6305 100644 --- a/Nasal/Systems/Comm/Notification.nas +++ b/Nasal/Systems/Comm/Notification.nas @@ -330,7 +330,7 @@ var ATIS = { }, processATIS: func(r, i) { var raw = r.response; - if (r.response == "FBW_ERROR: D-ATIS not available at this airport") { + if (r.response == "FBW_ERROR: D-ATIS not available at this airport" or find("atis not avail",r.response) != -1) { me.received = 0; me.sent = 0; mcdu.mcdu_message(i,"NO D-ATIS AVAILABLE");