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

@@ -11,7 +11,7 @@ namespace PepperDash.Essentials.Bridges
public static void LinkToApi(this C2nRthsController device, BasicTriList triList, uint joinStart,
string joinMapKey)
{
var joinMap = new C2nRthsControllerJoinMap(joinStart);
var joinMap = new C2nRthsControllerJoinMap();
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
@@ -22,10 +22,12 @@ namespace PepperDash.Essentials.Bridges
Debug.Console(1, device, "Linking to Trilist '{0}'", triList.ID.ToString("X"));
triList.SetBoolSigAction(joinMap.TemperatureFormat, device.SetTemperatureFormat);
device.IsOnline.LinkInputSig(triList.BooleanInput[joinMap.IsOnline]);
device.TemperatureFeedback.LinkInputSig(triList.UShortInput[joinMap.Temperature]);
device.HumidityFeedback.LinkInputSig(triList.UShortInput[joinMap.Temperature]);
device.HumidityFeedback.LinkInputSig(triList.UShortInput[joinMap.Humidity]);
triList.StringInput[joinMap.Name].StringValue = device.Name;

View File

@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Bridges
public uint Humidity { get; set; }
public uint TemperatureFormat { get; set; }
public C2nRthsControllerJoinMap(uint joinStart)
public C2nRthsControllerJoinMap()
{
//digital
IsOnline = 1;
@@ -25,7 +25,7 @@ namespace PepperDash.Essentials.Bridges
//serial
Name = 1;
OffsetJoinNumbers(joinStart);
}
public override void OffsetJoinNumbers(uint joinStart)

View File

@@ -15,7 +15,7 @@ namespace PepperDash.Essentials.Bridges
public uint GreenControl { get; set; }
public uint BlueControl { get; set; }
public StatusSignControllerJoinMap(uint joinStart)
public StatusSignControllerJoinMap()
{
//digital
IsOnline = 1;
@@ -32,7 +32,6 @@ namespace PepperDash.Essentials.Bridges
Name = 1;
OffsetJoinNumbers(joinStart);
}
public override void OffsetJoinNumbers(uint joinStart)

View File

@@ -11,7 +11,7 @@ namespace PepperDash.Essentials.Bridges
public static void LinkToApi(this StatusSignController ssDevice, BasicTriList trilist, uint joinStart,
string joinMapKey)
{
var joinMap = new StatusSignControllerJoinMap(joinStart);
var joinMap = new StatusSignControllerJoinMap();
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
@@ -32,6 +32,7 @@ namespace PepperDash.Essentials.Bridges
trilist.StringInput[joinMap.Name].StringValue = ssDevice.Name;
ssDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
ssDevice.RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl]);
ssDevice.BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl]);
ssDevice.GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl]);

View File

@@ -32,21 +32,25 @@ namespace PepperDash.Essentials.Core
/// </summary>
public bool PreventRegistration { get; protected set; }
public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
: base(key, name)
{
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()));
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);
}
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
}
/// <summary>
/// Make sure that overriding classes call this!
@@ -66,6 +70,10 @@ namespace PepperDash.Essentials.Core
return false;
}
}
foreach (var f in Feedbacks)
{
f.FireUpdate();
}
Hardware.OnlineStatusChange += new OnlineStatusChangeEventHandler(Hardware_OnlineStatusChange);
CommunicationMonitor.Start();
@@ -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