ECS-1258 : Fixed Issue related to improper bridging of c2nrths and statusSign. ECS-1248 : FIxed issues related to duplucate joins on GLSODTCCN ECS-1252 : Fixed Missing Feedbacks in c2nrths and StatusSign

This commit is contained in:
Trevor Payne
2020-02-11 18:49:43 -06:00
parent d2b8d38000
commit 48cc8ec33f
6 changed files with 314 additions and 304 deletions

View File

@@ -30,23 +30,27 @@ namespace PepperDash.Essentials.Core
/// Used by implementing classes to prevent registration with Crestron TLDM. For
/// devices like RMCs and TXs attached to a chassis.
/// </summary>
public bool PreventRegistration { get; protected set; }
public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
: base(key, name)
{
Feedbacks = new FeedbackCollection<Feedback>();
Hardware = hardware;
IsOnline = new BoolFeedback("IsOnlineFeedback", () => Hardware.IsOnline);
IsRegistered = new BoolFeedback("IsRegistered", () => Hardware.Registered);
IpConnectionsText = new StringFeedback("IpConnectionsText", () =>
string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray()));
AddToFeedbackList(IsOnline, IsRegistered, IpConnectionsText);
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
}
public bool PreventRegistration { get; protected set; }
public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
: base(key, name)
{
Feedbacks = new FeedbackCollection<Feedback>();
Hardware = hardware;
IsOnline = new BoolFeedback("IsOnlineFeedback", () => Hardware.IsOnline);
IsRegistered = new BoolFeedback("IsRegistered", () => Hardware.Registered);
IpConnectionsText = new StringFeedback("IpConnectionsText", () =>
{
if (Hardware.ConnectedIpList != null)
return string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray());
else
return string.Empty;
});
AddToFeedbackList(IsOnline, IsRegistered, IpConnectionsText);
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
}
/// <summary>
/// Make sure that overriding classes call this!
@@ -65,7 +69,11 @@ namespace PepperDash.Essentials.Core
//Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
return false;
}
}
}
foreach (var f in Feedbacks)
{
f.FireUpdate();
}
Hardware.OnlineStatusChange += new OnlineStatusChangeEventHandler(Hardware_OnlineStatusChange);
CommunicationMonitor.Start();
@@ -97,7 +105,7 @@ namespace PepperDash.Essentials.Core
{
if (!Feedbacks.Contains(f))
{
Feedbacks.Add(f);
Feedbacks.Add(f);
}
}
}
@@ -105,14 +113,14 @@ namespace PepperDash.Essentials.Core
void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{
if (args.DeviceOnLine)
{
//if (args.DeviceOnLine)
//{
foreach (var feedback in Feedbacks)
{
if (feedback != null)
feedback.FireUpdate();
}
}
//}
}
#region IStatusMonitor Members