Fixes odd error where dm event comes in with input xx name even though input xx doesn't exist on the dmps

This commit is contained in:
Alex Johnson
2021-09-17 15:05:59 -04:00
parent 9c22c4cb5f
commit 3d543dfd09

View File

@@ -723,8 +723,8 @@ namespace PepperDash.Essentials.DM
void Dmps_DMInputChange(Switch device, DMInputEventArgs args) void Dmps_DMInputChange(Switch device, DMInputEventArgs args)
{ {
//Debug.Console(2, this, "DMSwitch:{0} Input:{1} Event:{2}'", this.Name, args.Number, args.EventId.ToString()); try
{
switch (args.EventId) switch (args.EventId)
{ {
case (DMInputEventIds.OnlineFeedbackEventId): case (DMInputEventIds.OnlineFeedbackEventId):
@@ -742,11 +742,19 @@ namespace PepperDash.Essentials.DM
case (DMInputEventIds.InputNameEventId): case (DMInputEventIds.InputNameEventId):
{ {
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number); Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
if(InputNameFeedbacks.ContainsKey(args.Number))
{
InputNameFeedbacks[args.Number].FireUpdate(); InputNameFeedbacks[args.Number].FireUpdate();
}
break; break;
} }
} }
} }
catch (Exception e)
{
Debug.Console(0, Debug.ErrorLogLevel.Notice, "DMSwitch Input Change:{0} Input:{1} Event:{2}\rException: {3}", this.Name, args.Number, args.EventId.ToString(), e.ToString());
}
}
void Dmps_DMOutputChange(Switch device, DMOutputEventArgs args) void Dmps_DMOutputChange(Switch device, DMOutputEventArgs args)
{ {
Debug.Console(2, this, "DMOutputChange Output: {0} EventId: {1}", args.Number, args.EventId.ToString()); Debug.Console(2, this, "DMOutputChange Output: {0} EventId: {1}", args.Number, args.EventId.ToString());