From 8cb812123113ba2ec8730cccb98017ab36b7c304 Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Sun, 17 Feb 2019 21:35:32 +0000 Subject: [PATCH] FG1000: FLC, NAV GPS Autopilot modes --- .../FG1000/GFC700-AP-off-FSM.xml | 11 + .../FG1000/GFC700-lateral-FSM.xml | 177 ++++++++ .../FG1000/GFC700-vertical-FSM.xml | 135 ++++-- Aircraft/Instruments-3d/FG1000/GFC700.xml | 119 ++++- .../FG1000/MFDPages/SurroundPFD.svg | 421 +++++++++--------- .../Nasal/Interfaces/GFC700Interface.nas | 25 +- .../PFDInstrumentsController.nas | 11 + .../Nasal/MFDPages/Surround/Surround.nas | 3 + 8 files changed, 650 insertions(+), 252 deletions(-) diff --git a/Aircraft/Instruments-3d/FG1000/GFC700-AP-off-FSM.xml b/Aircraft/Instruments-3d/FG1000/GFC700-AP-off-FSM.xml index 3fe0988a3..eaf4c414b 100644 --- a/Aircraft/Instruments-3d/FG1000/GFC700-AP-off-FSM.xml +++ b/Aircraft/Instruments-3d/FG1000/GFC700-AP-off-FSM.xml @@ -57,4 +57,15 @@ to Flight Director mode, by simply setting the passive-mode flag. + + + ON-OFF + ON + OFF + false + + /autopilot/AP-mode-buttonGA + + + diff --git a/Aircraft/Instruments-3d/FG1000/GFC700-lateral-FSM.xml b/Aircraft/Instruments-3d/FG1000/GFC700-lateral-FSM.xml index 6e82344c8..af0041709 100644 --- a/Aircraft/Instruments-3d/FG1000/GFC700-lateral-FSM.xml +++ b/Aircraft/Instruments-3d/FG1000/GFC700-lateral-FSM.xml @@ -156,6 +156,155 @@ + + + NAV-SRC + + + property-assign + /autopilot/lateral-mode-button + + + + + + NAV-GPS + NAV-SRC + GPS-ARM + + + /autopilot/settings/nav-mode-source + GPS + + + + + + NAV-LOC + NAV-SRC + LOC-ARM + + + + /autopilot/settings/nav-mode-source + NAV1 + + + /autopilot/settings/nav-mode-source + NAV2 + + + + + + + GPS-ARM + + + property-assign + /autopilot/annunciator/lateral-mode-armed + GPS + + + + + GPS-ARM - GPS + GPS-ARM + GPS + + + + /instrumentation/gps/wp/wp[1]/course-error-nm + 0.5 + + + /instrumentation/gps/wp/wp[1]/course-error-nm + -0.5 + + + + + + + LOC-ARM + + property-assign + /instrumentation/nav[0]/slaved-to-gps + 0 + + + property-assign + /autopilot/annunciator/lateral-mode-armed + LOC + + + + + VOR-ARM + + property-assign + /instrumentation/nav[0]/slaved-to-gps + 0 + + + property-assign + /autopilot/annunciator/lateral-mode-armed + VOR + + + + + GPS + + property-assign + /autopilot/annunciator/lateral-mode + GPS + + + property-assign + /autopilot/annunciator/lateral-mode-armed + + + + property-assign + /instrumentation/nav[0]/slaved-to-gps + 1 + + + property-assign + /autopilot/locks/heading + nav-hold + + + + + LOC + + property-assign + /autopilot/annunciator/lateral-mode + LOC + + + property-assign + /autopilot/annunciator/lateral-mode-armed + + + + + + VOR + + property-assign + /autopilot/annunciator/lateral-mode + VOR + + + property-assign + /autopilot/annunciator/lateral-mode-armed + + + + OFF-ROL @@ -265,4 +414,32 @@ + + + To NAV + NAV-SRC + true + + + /autopilot/lateral-mode-buttonNAV + /autopilot/locks/headingnav-hold + + + + + + From NAV + GPS-ARM + VOR-ARM + LOC-ARM + GPS + VOR + LOC + ROL + true + + /autopilot/lateral-mode-buttonNAV + + + diff --git a/Aircraft/Instruments-3d/FG1000/GFC700-vertical-FSM.xml b/Aircraft/Instruments-3d/FG1000/GFC700-vertical-FSM.xml index e23eb7f03..9dfeb38c7 100644 --- a/Aircraft/Instruments-3d/FG1000/GFC700-vertical-FSM.xml +++ b/Aircraft/Instruments-3d/FG1000/GFC700-vertical-FSM.xml @@ -56,6 +56,11 @@ /autopilot/locks/altitude pitch-hold + + property-assign + /autopilot/locks/speed + + property-assign /autopilot/annunciator/vertical-mode @@ -87,6 +92,11 @@ /autopilot/locks/altitude pitch-hold + + property-assign + /autopilot/locks/speed + + property-assign /autopilot/annunciator/vertical-mode @@ -126,6 +136,11 @@ /autopilot/locks/altitude vertical-speed-hold + + property-assign + /autopilot/locks/speed + + property-assign /autopilot/annunciator/vertical-mode @@ -201,6 +216,11 @@ /autopilot/locks/altitude altitude-hold2 + + property-assign + /autopilot/locks/speed + + property-assign @@ -215,6 +235,7 @@ PIT GA VS + FLC ALTS-ARM @@ -267,6 +288,11 @@ /autopilot/locks/altitude altitude-hold2 + + property-assign + /autopilot/locks/speed + + property-assign @@ -285,6 +311,46 @@ FLC + + property-assign + /autopilot/annunciator/vertical-mode + FLC + + + property-assign + /autopilot/annunciator/vertical-mode-armed + + + + property-assign + /autopilot/settings/target-speed-kt + /autopilot/internal/filtered-airspeed + + + nasal + + + + property-assign + /autopilot/locks/altitude + + + + property-assign + /autopilot/locks/speed + speed-with-pitch-trim + + + + property-assign + /autopilot/vertical-mode-button + + + @@ -306,25 +372,6 @@ - - - VS-PIT - VS - PIT - - /autopilot/vertical-mode-buttonVS - - - - - GA-PIT - GA - PIT - - /autopilot/vertical-mode-buttonGA - - - - GA @@ -386,14 +433,34 @@ + + + FLC-ON + FLC + true + + + /autopilot/vertical-mode-buttonFLC + /autopilot/locks/speedspeed-with-pitch-trim + + + + + + + VS-OFF VS + ALTS-ARM PIT true - /autopilot/vertical-mode-buttonVS + + /autopilot/vertical-mode-buttonVS + /autopilot/locks/altitudevertical-speed-hold + @@ -408,7 +475,7 @@ - + VNV-OFF VNV @@ -430,14 +497,28 @@ - + FLC-OFF FLC + ALTS-ARM PIT true - /autopilot/vertical-mode-buttonFLC + + /autopilot/vertical-mode-buttonFLC + /autopilot/locks/speedspeed-with-pitch-trim + + + + + + + GA-OFF + GA + PIT + + /autopilot/vertical-mode-buttonGA diff --git a/Aircraft/Instruments-3d/FG1000/GFC700.xml b/Aircraft/Instruments-3d/FG1000/GFC700.xml index b266e77e4..a89dff50c 100644 --- a/Aircraft/Instruments-3d/FG1000/GFC700.xml +++ b/Aircraft/Instruments-3d/FG1000/GFC700.xml @@ -88,6 +88,44 @@ 1.0 + + nav2 heading error computer/normalizer + false + gain + + /instrumentation/nav[1]/radials/target-auto-hdg-deg + + /orientation/heading-deg + -1.0 + + + /autopilot/internal/nav2-heading-error-deg + + -180 + 180 + + 1.0 + + + + nav2 selected course error computer/normalizer + false + gain + + /instrumentation/nav[1]/radials/selected-deg + + /orientation/heading-magnetic-deg + -1.0 + + + /autopilot/internal/nav2-course-error + + -180 + 180 + + 1.0 + + vertical speed fpm computer false @@ -169,6 +207,19 @@ 22.0 + + limited-airspeed + false + gain + + /instrumentation/airspeed-indicator/indicated-speed-kt + + 1.0 + /autopilot/internal/filtered-airspeed + 80.0 + 140.0 + + ALTS-delta false @@ -234,7 +285,7 @@ /autopilot/locks/heading - nav1-hold + nav-hold @@ -343,11 +394,28 @@ - Nav1 Hold Stage 1 + Nav1/GPS Hold Stage 1 false - /autopilot/locks/heading - nav1-hold + + + + /autopilot/locks/heading + nav-hold + + + + /autopilot/settings/nav-mode-source + NAV1 + + + + /autopilot/settings/nav-mode-source + GPS + + + + /autopilot/internal/nav1-heading-error-deg @@ -356,7 +424,7 @@ 0.0 - /autopilot/internal/target-roll-deg + /autopilot/settings/target-roll-deg -1.0 @@ -371,6 +439,47 @@ + + Nav2 Hold Stage 1 + false + + + + + /autopilot/locks/heading + nav-hold + + + /autopilot/settings/nav-mode-source + NAV2 + + + + + + /autopilot/internal/nav2-heading-error-deg + + + 0.0 + + + /autopilot/settings/target-roll-deg + + + -1.0 + 1.0 + 0.1 + 0.0 + + 10.0 + 0.00001 + -20.0 + 20.0 + + + + + diff --git a/Aircraft/Instruments-3d/FG1000/MFDPages/SurroundPFD.svg b/Aircraft/Instruments-3d/FG1000/MFDPages/SurroundPFD.svg index cba4956ad..fdf50f4a9 100644 --- a/Aircraft/Instruments-3d/FG1000/MFDPages/SurroundPFD.svg +++ b/Aircraft/Instruments-3d/FG1000/MFDPages/SurroundPFD.svg @@ -14,7 +14,7 @@ viewBox="0 0 1024 768" version="1.1" id="SVGRoot" - inkscape:version="0.91 r13725" + inkscape:version="0.92.3 (2405546, 2018-03-11)" sodipodi:docname="SurroundPFD.svg"> 123.456 123.45 123.45 123.45 123.45 XXX DIS + style="font-size:21.33333397px;line-height:1.25;fill:#ffffff">DIS BRG + style="font-size:21.33333397px;line-height:1.25;fill:#ffffff">BRG 0 + y="22.002344" + style="font-size:21.33333397px;line-height:1.25">0 FROM + y="21.782091" + style="font-size:21.33333397px;line-height:1.25">FROM TO + y="21.782091" + style="font-size:21.33333397px;line-height:1.25">TO 0 + sodipodi:role="line" + style="font-size:21.33333397px;line-height:1.25">0 D + sodipodi:role="line" + style="font-size:21.33333397px;line-height:1.25">D ARM + id="tspan7801" + x="269.76041" + y="47.697918" + style="font-size:21.33374977px;line-height:1.25">ARM ACT + id="tspan7803" + x="344.76041" + y="47.697918" + style="font-size:21.33374977px;line-height:1.25">ACT AP + id="tspan7838" + x="404.32443" + y="48" + style="font-size:21.33374977px;line-height:1.25">AP ACT + id="tspan7873" + x="497.86313" + y="48.000004" + style="font-size:21.33374977px;line-height:1.25">ACT ARM + x="649.67999" + y="48" + style="font-size:21.33374977px;line-height:1.25">ARM 5000ft + x="559.2533" + y="48.000008" + style="font-size:21.33374977px;line-height:1.25">5000ft AIRPORT INFORMATION + y="653.33002" + style="font-size:15px;line-height:1.25">AIRPORT INFORMATION INTERSECTION INFORMATION + sodipodi:role="line" + style="font-size:15px;line-height:1.25">INTERSECTION INFORMATION NDB INFORMATION + y="685.5918" + style="font-size:15px;line-height:1.25">NDB INFORMATION VOR INFORMATION + sodipodi:role="line" + style="font-size:15px;line-height:1.25">VOR INFORMATION USER WPT INFORMATION + y="717.85352" + style="font-size:15px;line-height:1.25">USER WPT INFORMATION NAVIGATION MAP + sodipodi:role="line" + style="font-size:15px;line-height:1.25">NAVIGATION MAP TRAFFIC MAP + y="669.46088" + style="font-size:15px;line-height:1.25">TRAFFIC MAP STORMSCOPE + sodipodi:role="line" + style="font-size:15px;line-height:1.25">STORMSCOPE WEATHER DATA LINK + y="701.72266" + style="font-size:15px;line-height:1.25">WEATHER DATA LINK TAWS-B + sodipodi:role="line" + style="font-size:15px;line-height:1.25">TAWS-B NEAREST NDB + y="653.33002" + style="font-size:15px;line-height:1.25">NEAREST NDB NEAREST VOR + sodipodi:role="line" + style="font-size:15px;line-height:1.25">NEAREST VOR NEAREST USER WAYPOINTS + y="685.5918" + style="font-size:15px;line-height:1.25">NEAREST USER WAYPOINTS NEAREST FREQUENCIES + id="tspan5289" + style="font-size:15px;line-height:1.25">NEAREST FREQUENCIES NEAREST AIRSPACES + y="717.85352" + style="font-size:15px;line-height:1.25">NEAREST AIRSPACES NEAREST AIRPORTSNEAREST AIRPORTS + id="tspan5343" + style="font-size:15px;line-height:1.25">  NEAREST INTERSECTIONS + y="637.28754" + style="font-size:15px;line-height:1.25">NEAREST INTERSECTIONS ACTIVE FLIGHT PLANACTIVE FLIGHT PLAN + y="704.43018" + style="font-size:15px;line-height:1.25">  FLIGHT PLAN CATALOG + sodipodi:role="line" + style="font-size:15px;line-height:1.25">FLIGHT PLAN CATALOG STORED FLIGHT PLAN + y="717.94196" + style="font-size:15px;line-height:1.25">STORED FLIGHT PLAN TRIP PLANNINGTRIP PLANNING + id="tspan5209" + style="font-size:15px;line-height:1.25">  UTILITY + y="669.46088" + style="font-size:15px;line-height:1.25">UTILITY GPS STATUS + sodipodi:role="line" + style="font-size:15px;line-height:1.25">GPS STATUS XM RADIO + y="701.72266" + style="font-size:15px;line-height:1.25">XM RADIO SYSTEM STATUS + sodipodi:role="line" + style="font-size:15px;line-height:1.25">SYSTEM STATUS CHECKLIST + sodipodi:role="line" + style="font-size:15px;line-height:1.25">CHECKLIST MAP + y="738.17676" + style="font-size:17.5px;line-height:2.75999904">MAP WPT + sodipodi:role="line" + style="font-size:17.5px;line-height:2.75999904">WPT AUX + y="738.17676" + style="font-size:17.5px;line-height:2.75999904">AUX FPL + sodipodi:role="line" + style="font-size:17.5px;line-height:2.75999904">FPL LST + y="738.17676" + style="font-size:17.5px;line-height:2.75999904">LST NRST + sodipodi:role="line" + style="font-size:17.5px;line-height:2.75999904">NRST diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GFC700Interface.nas b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GFC700Interface.nas index 0d730badf..887d03312 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GFC700Interface.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GFC700Interface.nas @@ -69,12 +69,24 @@ handleNoseUpDown : func(value) { } if (vertical_mode == "FLC") { - me._speed_setting.setValue(me._speed_setting.getValue() + (value * 1)); + # Note that the button is NOSE UP / NOSE DN, so pressing NOSE DN _increases_ + # speed, while NOSE UP _decreases_ speed. So the speed setting is reversed + # in comparison with setting direct pitch. + me._speed_setting.setValue(me._speed_setting.getValue() - (value * 1)); + setprop("/autopilot/annunciator/vertical-mode-target", + sprintf("%i kt", me._speed_setting.getValue()) + ); } return emesary.Transmitter.ReceiptStatus_Finished; }, +setAPNavSource : func(src) { + setprop("/autopilot/settings/nav-mode-source", src); + # Also need to do something to trigger a NAV change if we're in NAV mode already. + return emesary.Transmitter.ReceiptStatus_Finished; +}, + RegisterWithEmesary : func() { if (me._recipient == nil){ @@ -107,6 +119,17 @@ RegisterWithEmesary : func() if (id == fg1000.FASCIA.NOSE_UP) return controller.handleNoseUpDown(1); if (id == fg1000.FASCIA.NOSE_DOWN) return controller.handleNoseUpDown(-1); } + + if (notification.NotificationType == notifications.PFDEventNotification.DefaultType and + notification.Event_Id == notifications.PFDEventNotification.FMSData and + notification.EventParameter != nil) + { + foreach(var key; keys(notification.EventParameter)) { + var val = notification.EventParameter[key]; + if (key == "AutopilotNAVSource") return controller.setAPNavSource(val); + } + } + return emesary.Transmitter.ReceiptStatus_NotProcessed; }; } diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/PFDInstruments/PFDInstrumentsController.nas b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/PFDInstruments/PFDInstrumentsController.nas index ba0d165e0..fec9fcd3e 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/PFDInstruments/PFDInstrumentsController.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/PFDInstruments/PFDInstrumentsController.nas @@ -179,6 +179,17 @@ var PFDInstrumentsController = me._CDISource = math.mod(me._CDISource + 1, size(PFDInstrumentsController.CDI_SOURCE)); var src = PFDInstrumentsController.CDI_SOURCE[me._CDISource]; + # Indicate the change for CDI source to the autopilot + var data = {}; + data["AutopilotNAVSource"] = src; + var notification = notifications.PFDEventNotification.new( + "MFD", + me._page.mfd.getDeviceID(), + notifications.PFDEventNotification.FMSData, + data); + + me.transmitter.NotifyAll(notification); + # If we're changing to NAV1 or NAV2, we also change the selected NAV. if ((src == "NAV1") or (src == "NAV2")) { var data = {}; diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/Surround/Surround.nas b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/Surround/Surround.nas index d345bafaa..a14e24100 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/Surround/Surround.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/Surround/Surround.nas @@ -111,6 +111,8 @@ var Surround = obj.addTextElements(["HeaderAPLateralArmed", "HeaderAPLateralActive", "HeaderAPVerticalArmed", "HeaderAPVerticalActive", "HeaderAPVerticalReference"]); obj._apStatus = PFD.TextElement.new(obj.pageName, svg, "HeaderAPStatus", "", AP_STATUS_STYLE); obj._apStatusTimer = nil; + obj._apHeadingModeTimer = nil; + obj._apAltitudeModeTimer = nil; obj._dto = PFD.HighlightElement.new(obj.pageName, svg, "HeaderDTO", "DTO"); obj._leg = PFD.HighlightElement.new(obj.pageName, svg, "HeaderActiveLeg", "Leg"); } else { @@ -263,6 +265,7 @@ var Surround = me._dto.setVisible(1); } else { me._dto.setVisible(0); + me.setTextElement("HeaderFrom", data["FMSPreviousLegID"]); } } }