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

View file

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

View file

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