diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/Constants.nas b/Aircraft/Instruments-3d/FG1000/Nasal/Constants.nas index bcf9869c0..3e93ea50f 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/Constants.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/Constants.nas @@ -151,7 +151,9 @@ var FASCIA = { # GDU 1045 Autopilot keys YD : 46, - + # Useability helpers to avoid having to use the FMS knobs to spell airport IDs etc. + KEY_INPUT : 47, + STRING_INPUT: 48, }; var SURFACE_TYPES = { diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericADCPublisher.nas b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericADCPublisher.nas index 3aab36d2a..d17f63526 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericADCPublisher.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericADCPublisher.nas @@ -32,12 +32,12 @@ var GenericADCPublisher = # Update frequency can be controlled by a property. var frequency = getprop("/instrumentation/FG1000/adc-update-frequency"); - if (frequency == nil) frequency = 0.1; + if (frequency == nil) frequency = 10; var obj = { parents : [ GenericADCPublisher, - PeriodicPropertyPublisher.new(notifications.PFDEventNotification.ADCData, frequency) + PeriodicPropertyPublisher.new(notifications.PFDEventNotification.ADCData, 1.0/frequency) ], }; diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericEISPublisher.nas b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericEISPublisher.nas index 29ede71d3..d2b4bd257 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericEISPublisher.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericEISPublisher.nas @@ -18,11 +18,11 @@ var GenericEISPublisher = { - new : func (frequency=0.25) { + new : func (period=0.25) { var obj = { parents : [ GenericEISPublisher, - PeriodicPropertyPublisher.new(notifications.PFDEventNotification.EngineData, frequency) + PeriodicPropertyPublisher.new(notifications.PFDEventNotification.EngineData, period) ], }; diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericFMSPublisher.nas b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericFMSPublisher.nas index 3ec137bbc..b88e2dacd 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericFMSPublisher.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericFMSPublisher.nas @@ -19,7 +19,7 @@ var GenericFMSPublisher = { - new : func (frequency=0.5) { + new : func (period=0.5) { var obj = { parents : [ GenericFMSPublisher, @@ -34,7 +34,7 @@ var GenericFMSPublisher = # # 2) a periodic publisher which triggers every 0.5s to update data values. obj._triggeredPublisher = TriggeredPropertyPublisher.new(notifications.PFDEventNotification.FMSData); - obj._periodicPublisher = PeriodicPropertyPublisher.new(notifications.PFDEventNotification.FMSData, frequency); + obj._periodicPublisher = PeriodicPropertyPublisher.new(notifications.PFDEventNotification.FMSData, period); obj._triggeredPublisher.addPropMap("FMSHeadingBug", "/autopilot/settings/heading-bug-deg"); obj._triggeredPublisher.addPropMap("FMSSelectedAlt", "/autopilot/settings/target-alt-ft"); diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericFuelPublisher.nas b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericFuelPublisher.nas index b275bd1c1..ba82e96b1 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericFuelPublisher.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericFuelPublisher.nas @@ -18,15 +18,15 @@ var GenericFuelPublisher = { - new : func (frequency=1.0) { + new : func (period=1.0) { var obj = { parents : [ GenericFuelPublisher, - PeriodicPropertyPublisher.new(notifications.PFDEventNotification.FuelData, frequency) + PeriodicPropertyPublisher.new(notifications.PFDEventNotification.FuelData, period) ], }; - obj.deltaT = frequency; + obj.deltaT = period; # Hack to handle most aircraft not having proper engine hours diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericNavComPublisher.nas b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericNavComPublisher.nas index 4c02e15c0..3c2025070 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericNavComPublisher.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericNavComPublisher.nas @@ -22,7 +22,7 @@ # var GenericNavComPublisher = { - new : func (frequency=0.5) { + new : func (period=0.5) { var obj = { parents : [ GenericNavComPublisher, @@ -37,7 +37,7 @@ var GenericNavComPublisher = # 2) a periodic publisher which triggers every 0.5s to update data values. obj._triggeredPublisher = TriggeredPropertyPublisher.new(notifications.PFDEventNotification.NavComData); - obj._periodicPublisher = PeriodicPropertyPublisher.new(notifications.PFDEventNotification.NavComData, frequency); + obj._periodicPublisher = PeriodicPropertyPublisher.new(notifications.PFDEventNotification.NavComData, period); # Hack to handle cases where there is no selected Com or NAV frequency if (getprop("/instrumentation/com-selected") == nil) setprop("/instrumentation/com-selected", 1); diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/PropertyPublisher.nas b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/PropertyPublisher.nas index 4056c4afd..64e6d4502 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/PropertyPublisher.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/PropertyPublisher.nas @@ -45,11 +45,11 @@ var PropMap = { var PeriodicPropertyPublisher = { - new : func (notification, frequency=0.25) { + new : func (notification, period=0.25) { var obj = { parents : [ PeriodicPropertyPublisher ], _notification : notification, - _frequency : frequency, + _period : period, _propmaps : [], }; @@ -80,7 +80,7 @@ var PeriodicPropertyPublisher = }, start : func() { - me._timer = maketimer(me._frequency, me, me.publish); + me._timer = maketimer(me._period, me, me.publish); me._timer.start(); }, stop : func() { @@ -91,11 +91,11 @@ var PeriodicPropertyPublisher = var TriggeredPropertyPublisher = { - new : func (notification, frequency=5) { + new : func (notification, period=5) { var obj = { parents : [ TriggeredPropertyPublisher ], _notification : notification, - _frequency : frequency, + _period : period, _propmaps : {}, _listeners : [], _timer: nil, @@ -153,7 +153,7 @@ var TriggeredPropertyPublisher = append(me._listeners, listener); } - me._timer = maketimer(me._frequency, me, me.publishAll); + me._timer = maketimer(me._period, me, me.publishAll); me._timer.start(); }, diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPageController.nas b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPageController.nas index 9fa5d6adb..97d3f1d1a 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPageController.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPageController.nas @@ -101,6 +101,9 @@ handleEnter : func (value) { return emesary.Transmitter.ReceiptStatus_NotProcess handleAltOuter : func (value) { return me.page.mfd.SurroundController.handleAltOuter(value); }, handleAltInner : func (value) { return me.page.mfd.SurroundController.handleAltInner(value); }, +handleKeyInput : func (value) { return emesary.Transmitter.ReceiptStatus_NotProcessed; }, +handleStringInput : func (value) { print("Not handling " ~ value); return emesary.Transmitter.ReceiptStatus_NotProcessed; }, + RegisterWithEmesary : func() { if (me._recipient == nil){ @@ -164,6 +167,9 @@ RegisterWithEmesary : func() if (id == fg1000.FASCIA.ALT_OUTER) return controller.handleAltOuter(value); if (id == fg1000.FASCIA.ALT_INNER) return controller.handleAltInner(value); + if (id == fg1000.FASCIA.KEY_INPUT) return controller.handleKeyInput(value); + if (id == fg1000.FASCIA.STRING_INPUT) return controller.handleStringInput(value); + # Autopilot controls - ignore for now as like to be handled elsewhere #if (id == fg1000.FASCIA.AP ) return controller.handle(value); #if (id == fg1000.FASCIA.HDG) return controller.handle(value); diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/AirportInfo/AirportInfoController.nas b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/AirportInfo/AirportInfoController.nas index f6d72aa83..03468dc6f 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/AirportInfo/AirportInfoController.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/AirportInfo/AirportInfoController.nas @@ -200,6 +200,15 @@ var AirportInfoController = } }, + handleStringInput : func(value) { + me.selectAirport(); + me.page.airportEntry.clearElement(); + me.page.airportEntry.setValue(value); + me.setAirport(value); + me.page.resetCRSR(); + return emesary.Transmitter.ReceiptStatus_Finished; + }, + # Reset controller if required when the page is displayed or hidden ondisplay : func() { me.RegisterWithEmesary(); diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/DirectTo/DirectToController.nas b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/DirectTo/DirectToController.nas index c51ce42c8..29a9312ea 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/DirectTo/DirectToController.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/DirectTo/DirectToController.nas @@ -303,6 +303,24 @@ var DirectToController = return emesary.Transmitter.ReceiptStatus_Finished; }, + handleStringInput : func(value) { + if (! me.dto_displayed) return emesary.Transmitter.ReceiptStatus_NotProcessed; + if (me._waypointSubmenuVisible) return emesary.Transmitter.ReceiptStatus_NotProcessed; + + if (me._cursorElements[me._selectedElement].isEditable()) { + # Cancel any editing + me._cursorElements[me._selectedElement].clearElement(); + + # Set the new value + me._cursorElements[me._selectedElement].setValue(value); + + # Also cause any enter-handling + me.handleEnter(1); + } + + return emesary.Transmitter.ReceiptStatus_Finished; + }, + # Reset controller if required when the page is displayed or hidden # Note that we explicitly do NOT RegisterWithEmesary/DeRegisterWithEmesary! # This page should RegisterWithEmesary at start of day instead. diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/IntersectionInfo/IntersectionInfoController.nas b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/IntersectionInfo/IntersectionInfoController.nas index 5b28840e4..fe3de2bad 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/IntersectionInfo/IntersectionInfoController.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/IntersectionInfo/IntersectionInfoController.nas @@ -125,9 +125,18 @@ var IntersectionInfoController = me._page.update(navdata, vordata); }, + handleStringInput : func(value) { + me._page.dataEntry.clearElement(); + me._page.dataEntry.setValue(value); + me.getIntersection(value); + me._page.dataEntry.unhighlightElement(); + return emesary.Transmitter.ReceiptStatus_Finished; + }, + # Reset controller if required when the page is displayed or hidden ondisplay : func() { me.RegisterWithEmesary(); + if (me._page.dataEntry.getValue() != "") me.getIntersection(me._page.dataEntry.getValue()); }, offdisplay : func() { me.DeRegisterWithEmesary(); diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/NDBInfo/NDBInfoController.nas b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/NDBInfo/NDBInfoController.nas index e1ba334cd..a8699f575 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/NDBInfo/NDBInfoController.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/NDBInfo/NDBInfoController.nas @@ -127,9 +127,18 @@ var NDBInfoController = me._page.update(navdata, aptdata); }, + handleStringInput : func(value) { + me._page.dataEntry.clearElement(); + me._page.dataEntry.setValue(value); + me.getNDB(value); + me._page.dataEntry.unhighlightElement(); + return emesary.Transmitter.ReceiptStatus_Finished; + }, + # Reset controller if required when the page is displayed or hidden ondisplay : func() { me.RegisterWithEmesary(); + if (me._page.dataEntry.getValue() != "") me.getNDB(me._page.dataEntry.getValue()); }, offdisplay : func() { me.DeRegisterWithEmesary(); diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/VORInfo/VORInfoController.nas b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/VORInfo/VORInfoController.nas index e23a620d4..3ee89b674 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/VORInfo/VORInfoController.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/VORInfo/VORInfoController.nas @@ -124,9 +124,18 @@ var VORInfoController = me._page.update(navdata, aptdata); }, + handleStringInput : func(value) { + me._page.dataEntry.clearElement(); + me._page.dataEntry.setValue(value); + me.getVOR(value); + me._page.dataEntry.unhighlightElement(); + return emesary.Transmitter.ReceiptStatus_Finished; + }, + # Reset controller if required when the page is displayed or hidden ondisplay : func() { me.RegisterWithEmesary(); + if (me._page.dataEntry.getValue() != "") me.getVOR(me._page.dataEntry.getValue()); }, offdisplay : func() { me.DeRegisterWithEmesary(); diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/WaypointEntry/WaypointEntryController.nas b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/WaypointEntry/WaypointEntryController.nas index 1414d8562..9fe6351a5 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/WaypointEntry/WaypointEntryController.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/WaypointEntry/WaypointEntryController.nas @@ -226,7 +226,7 @@ var WaypointEntryController = me.page.WaypointSubmenuGroup.setVisible(0); me._waypointSubmenuVisible = 0; } else if (me.page.IDEntry.isInEdit()) { - # If we're editing an element, complete the data entry, the load it. + # If we're editing an element, complete the data entry, then load it. me.page.IDEntry.enterElement(); me.loadDestination(me.page.IDEntry.getValue()); } else { @@ -259,6 +259,14 @@ var WaypointEntryController = return emesary.Transmitter.ReceiptStatus_Finished; }, + handleStringInput : func(value) { + if (! me._wpentry_displayed) return emesary.Transmitter.ReceiptStatus_NotProcessed; + me.page.IDEntry.clearElement(); + me.page.IDEntry.setValue(value); + me.loadDestination(me.page.IDEntry.getValue()); + return emesary.Transmitter.ReceiptStatus_Finished; + }, + # Reset controller if required when the page is displayed or hidden # Note that we explicitly do NOT RegisterWithEmesary/DeRegisterWithEmesary! # This page should RegisterWithEmesary at start of day instead. diff --git a/Input/Keyboard/multikey.xml b/Input/Keyboard/multikey.xml index f75ad2aee..b0563f913 100644 --- a/Input/Keyboard/multikey.xml +++ b/Input/Keyboard/multikey.xml @@ -501,7 +501,7 @@ property-toggle /sim/rendering/wireframe - +