1
0
Fork 0

FG1000 and MFD handle non-MFD Emesary notifications

Previously the FG1000 and MFD assumed that all notifications received
via Emesary had a Device_Id field.  This is true for
notifications.PFDEventNotification.DefaultType but not for other
messages - e.g. those generated by the AN SPN 46  system on the
carrier.

The effect of this was that when Nimitz was loaded, the FG1000 stopped
working with various errors.

This fix checks the notification type before the Device_Id.
This commit is contained in:
Stuart Buchanan 2020-03-12 17:25:34 +00:00
parent 556c19e1ee
commit 76cfa2c077
2 changed files with 4 additions and 4 deletions
Aircraft/Instruments-3d/FG1000/Nasal
Nasal/canvas

View file

@ -112,8 +112,8 @@ RegisterWithEmesary : func()
var controller = me; var controller = me;
me._recipient.Receive = func(notification) me._recipient.Receive = func(notification)
{ {
if (notification.Device_Id == pfd_obj.device_id if (notification.NotificationType == notifications.PFDEventNotification.DefaultType and
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) { notification.Device_Id == pfd_obj.device_id) {
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
and notification.EventParameter != nil) and notification.EventParameter != nil)
{ {

View file

@ -219,8 +219,8 @@ var PFD_Device =
var pfd_obj = me; var pfd_obj = me;
me.Recipient.Receive = func(notification) me.Recipient.Receive = func(notification)
{ {
if (notification.Device_Id == pfd_obj.device_id if (notification.NotificationType == notifications.PFDEventNotification.DefaultType and
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) { notification.Device_Id == pfd_obj.device_id) {
if (notification.Event_Id == notifications.PFDEventNotification.SoftKeyPushed if (notification.Event_Id == notifications.PFDEventNotification.SoftKeyPushed
and notification.EventParameter != nil) and notification.EventParameter != nil)
{ {