mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
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:
@@ -11,7 +11,7 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
public static void LinkToApi(this C2nRthsController device, BasicTriList triList, uint joinStart,
|
public static void LinkToApi(this C2nRthsController device, BasicTriList triList, uint joinStart,
|
||||||
string joinMapKey)
|
string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = new C2nRthsControllerJoinMap(joinStart);
|
var joinMap = new C2nRthsControllerJoinMap();
|
||||||
|
|
||||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
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"));
|
Debug.Console(1, device, "Linking to Trilist '{0}'", triList.ID.ToString("X"));
|
||||||
|
|
||||||
|
|
||||||
triList.SetBoolSigAction(joinMap.TemperatureFormat, device.SetTemperatureFormat);
|
triList.SetBoolSigAction(joinMap.TemperatureFormat, device.SetTemperatureFormat);
|
||||||
|
|
||||||
|
device.IsOnline.LinkInputSig(triList.BooleanInput[joinMap.IsOnline]);
|
||||||
device.TemperatureFeedback.LinkInputSig(triList.UShortInput[joinMap.Temperature]);
|
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;
|
triList.StringInput[joinMap.Name].StringValue = device.Name;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
public uint Humidity { get; set; }
|
public uint Humidity { get; set; }
|
||||||
public uint TemperatureFormat { get; set; }
|
public uint TemperatureFormat { get; set; }
|
||||||
|
|
||||||
public C2nRthsControllerJoinMap(uint joinStart)
|
public C2nRthsControllerJoinMap()
|
||||||
{
|
{
|
||||||
//digital
|
//digital
|
||||||
IsOnline = 1;
|
IsOnline = 1;
|
||||||
@@ -25,7 +25,7 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
//serial
|
//serial
|
||||||
Name = 1;
|
Name = 1;
|
||||||
|
|
||||||
OffsetJoinNumbers(joinStart);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OffsetJoinNumbers(uint joinStart)
|
public override void OffsetJoinNumbers(uint joinStart)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
public uint GreenControl { get; set; }
|
public uint GreenControl { get; set; }
|
||||||
public uint BlueControl { get; set; }
|
public uint BlueControl { get; set; }
|
||||||
|
|
||||||
public StatusSignControllerJoinMap(uint joinStart)
|
public StatusSignControllerJoinMap()
|
||||||
{
|
{
|
||||||
//digital
|
//digital
|
||||||
IsOnline = 1;
|
IsOnline = 1;
|
||||||
@@ -32,7 +32,6 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
Name = 1;
|
Name = 1;
|
||||||
|
|
||||||
|
|
||||||
OffsetJoinNumbers(joinStart);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OffsetJoinNumbers(uint joinStart)
|
public override void OffsetJoinNumbers(uint joinStart)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
public static void LinkToApi(this StatusSignController ssDevice, BasicTriList trilist, uint joinStart,
|
public static void LinkToApi(this StatusSignController ssDevice, BasicTriList trilist, uint joinStart,
|
||||||
string joinMapKey)
|
string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = new StatusSignControllerJoinMap(joinStart);
|
var joinMap = new StatusSignControllerJoinMap();
|
||||||
|
|
||||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
@@ -32,6 +32,7 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
|
|
||||||
trilist.StringInput[joinMap.Name].StringValue = ssDevice.Name;
|
trilist.StringInput[joinMap.Name].StringValue = ssDevice.Name;
|
||||||
|
|
||||||
|
ssDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
ssDevice.RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl]);
|
ssDevice.RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl]);
|
||||||
ssDevice.BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl]);
|
ssDevice.BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl]);
|
||||||
ssDevice.GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl]);
|
ssDevice.GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl]);
|
||||||
|
|||||||
@@ -32,21 +32,25 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool PreventRegistration { get; protected set; }
|
public bool PreventRegistration { get; protected set; }
|
||||||
|
|
||||||
public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
|
public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
Feedbacks = new FeedbackCollection<Feedback>();
|
Feedbacks = new FeedbackCollection<Feedback>();
|
||||||
|
|
||||||
Hardware = hardware;
|
Hardware = hardware;
|
||||||
IsOnline = new BoolFeedback("IsOnlineFeedback", () => Hardware.IsOnline);
|
IsOnline = new BoolFeedback("IsOnlineFeedback", () => Hardware.IsOnline);
|
||||||
IsRegistered = new BoolFeedback("IsRegistered", () => Hardware.Registered);
|
IsRegistered = new BoolFeedback("IsRegistered", () => Hardware.Registered);
|
||||||
IpConnectionsText = new StringFeedback("IpConnectionsText", () =>
|
IpConnectionsText = new StringFeedback("IpConnectionsText", () =>
|
||||||
string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray()));
|
{
|
||||||
|
if (Hardware.ConnectedIpList != null)
|
||||||
|
return string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray());
|
||||||
|
else
|
||||||
|
return string.Empty;
|
||||||
|
});
|
||||||
AddToFeedbackList(IsOnline, IsRegistered, IpConnectionsText);
|
AddToFeedbackList(IsOnline, IsRegistered, IpConnectionsText);
|
||||||
|
|
||||||
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
|
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Make sure that overriding classes call this!
|
/// Make sure that overriding classes call this!
|
||||||
@@ -66,6 +70,10 @@ namespace PepperDash.Essentials.Core
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
foreach (var f in Feedbacks)
|
||||||
|
{
|
||||||
|
f.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
Hardware.OnlineStatusChange += new OnlineStatusChangeEventHandler(Hardware_OnlineStatusChange);
|
Hardware.OnlineStatusChange += new OnlineStatusChangeEventHandler(Hardware_OnlineStatusChange);
|
||||||
CommunicationMonitor.Start();
|
CommunicationMonitor.Start();
|
||||||
@@ -105,14 +113,14 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.DeviceOnLine)
|
//if (args.DeviceOnLine)
|
||||||
{
|
//{
|
||||||
foreach (var feedback in Feedbacks)
|
foreach (var feedback in Feedbacks)
|
||||||
{
|
{
|
||||||
if (feedback != null)
|
if (feedback != null)
|
||||||
feedback.FireUpdate();
|
feedback.FireUpdate();
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IStatusMonitor Members
|
#region IStatusMonitor Members
|
||||||
|
|||||||
Reference in New Issue
Block a user