mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
esc-337, found errant timer resets on comm monitor and Sammy display
This commit is contained in:
@@ -235,12 +235,23 @@ namespace PepperDash.Essentials.Core
|
|||||||
public PropertyInfo PropInfo { get; private set; }
|
public PropertyInfo PropInfo { get; private set; }
|
||||||
public string Name { get { return PropInfo.Name; } }
|
public string Name { get { return PropInfo.Name; } }
|
||||||
public string Type { get { return PropInfo.PropertyType.Name; } }
|
public string Type { get { return PropInfo.PropertyType.Name; } }
|
||||||
public string Value { get {
|
public string Value { get
|
||||||
|
{
|
||||||
if (PropInfo.CanRead)
|
if (PropInfo.CanRead)
|
||||||
return PropInfo.GetValue(Parent, null).ToString();
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return PropInfo.GetValue(Parent, null).ToString();
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return "-";
|
return null;
|
||||||
} }
|
} }
|
||||||
|
|
||||||
public bool CanRead { get { return PropInfo.CanRead; } }
|
public bool CanRead { get { return PropInfo.CanRead; } }
|
||||||
public bool CanWrite { get { return PropInfo.CanWrite; } }
|
public bool CanWrite { get { return PropInfo.CanWrite; } }
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
void Client_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
void Client_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
||||||
{
|
{
|
||||||
Status = MonitorStatus.IsOk;
|
Status = MonitorStatus.IsOk;
|
||||||
StopErrorTimers();
|
ResetErrorTimers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Poll()
|
void Poll()
|
||||||
|
|||||||
@@ -102,17 +102,12 @@ namespace PepperDash.Essentials.Core
|
|||||||
ErrorTimer = null;
|
ErrorTimer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetErrorTimers()
|
protected void ResetErrorTimers()
|
||||||
{
|
{
|
||||||
if(WarningTimer != null)
|
if(WarningTimer != null)
|
||||||
WarningTimer.Reset(WarningTime, WarningTime);
|
WarningTimer.Reset(WarningTime, WarningTime);
|
||||||
if(ErrorTimer != null)
|
if(ErrorTimer != null)
|
||||||
ErrorTimer.Reset(ErrorTime, ErrorTime);
|
ErrorTimer.Reset(ErrorTime, ErrorTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PrintStatus()
|
|
||||||
{
|
|
||||||
CrestronConsole.PrintLine("Status={0}", Status);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
@@ -153,13 +153,13 @@ namespace PepperDash.Essentials.Devices.Displays
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
void Communication_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
void Communication_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Socket in: {0}", ComTextHelper.GetEscapedText(e.Bytes));
|
//Debug.Console(2, this, "Socket in: {0}", ComTextHelper.GetEscapedText(e.Bytes));
|
||||||
// This is probably not thread-safe buffering
|
// This is probably not thread-safe buffering
|
||||||
// Append the incoming bytes with whatever is in the buffer
|
// Append the incoming bytes with whatever is in the buffer
|
||||||
var newBytes = new byte[IncomingBuffer.Length + e.Bytes.Length];
|
var newBytes = new byte[IncomingBuffer.Length + e.Bytes.Length];
|
||||||
IncomingBuffer.CopyTo(newBytes, 0);
|
IncomingBuffer.CopyTo(newBytes, 0);
|
||||||
e.Bytes.CopyTo(newBytes, IncomingBuffer.Length);
|
e.Bytes.CopyTo(newBytes, IncomingBuffer.Length);
|
||||||
Debug.Console(2, this, "Buffer+new: {0}", ComTextHelper.GetEscapedText(newBytes));
|
//Debug.Console(2, this, "Buffer+new: {0}", ComTextHelper.GetEscapedText(newBytes));
|
||||||
|
|
||||||
// Need to find AA FF and have
|
// Need to find AA FF and have
|
||||||
for (int i = 0; i < newBytes.Length; i++)
|
for (int i = 0; i < newBytes.Length; i++)
|
||||||
@@ -180,7 +180,7 @@ namespace PepperDash.Essentials.Devices.Displays
|
|||||||
|
|
||||||
// Good length, grab the message
|
// Good length, grab the message
|
||||||
var message = newBytes.Skip(4).Take(msgLen).ToArray();
|
var message = newBytes.Skip(4).Take(msgLen).ToArray();
|
||||||
Debug.Console(0, this, "Parsing: {0}", ComTextHelper.GetEscapedText(message));
|
Debug.Console(0, this, "Parsing input: {0}", ComTextHelper.GetEscapedText(message));
|
||||||
|
|
||||||
// At this point, the ack/nak is the first byte
|
// At this point, the ack/nak is the first byte
|
||||||
if (message[0] == 0x41)
|
if (message[0] == 0x41)
|
||||||
@@ -292,7 +292,6 @@ namespace PepperDash.Essentials.Devices.Displays
|
|||||||
b[b.Length - 1] = (byte)checksum;
|
b[b.Length - 1] = (byte)checksum;
|
||||||
if(Debug.Level == 2) // This check is here to prevent following string format from building unnecessarily on level 0 or 1
|
if(Debug.Level == 2) // This check is here to prevent following string format from building unnecessarily on level 0 or 1
|
||||||
Debug.Console(2, this, "Sending:{0}", ComTextHelper.GetEscapedText(b));
|
Debug.Console(2, this, "Sending:{0}", ComTextHelper.GetEscapedText(b));
|
||||||
CommunicationMonitor.ResetErrorTimers(); // Helps prevent message collisions
|
|
||||||
Communication.SendBytes(b);
|
Communication.SendBytes(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -26,9 +26,9 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
{
|
{
|
||||||
public class EssentialsHuddleSpaceFusionSystemController : Device
|
public class EssentialsHuddleSpaceFusionSystemController : Device
|
||||||
{
|
{
|
||||||
public event EventHandler<ScheduleChangeEventArgs> ScheduleChange;
|
//public event EventHandler<ScheduleChangeEventArgs> ScheduleChange;
|
||||||
public event EventHandler<MeetingChangeEventArgs> MeetingEndWarning;
|
//public event EventHandler<MeetingChangeEventArgs> MeetingEndWarning;
|
||||||
public event EventHandler<MeetingChangeEventArgs> NextMeetingBeginWarning;
|
//public event EventHandler<MeetingChangeEventArgs> NextMeetingBeginWarning;
|
||||||
|
|
||||||
FusionRoom FusionRoom;
|
FusionRoom FusionRoom;
|
||||||
EssentialsHuddleSpaceRoom Room;
|
EssentialsHuddleSpaceRoom Room;
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user