mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-01 22:04:52 +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 string Name { get { return PropInfo.Name; } }
|
||||
public string Type { get { return PropInfo.PropertyType.Name; } }
|
||||
public string Value { get {
|
||||
public string Value { get
|
||||
{
|
||||
if (PropInfo.CanRead)
|
||||
return PropInfo.GetValue(Parent, null).ToString();
|
||||
{
|
||||
try
|
||||
{
|
||||
return PropInfo.GetValue(Parent, null).ToString();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
return "-";
|
||||
return null;
|
||||
} }
|
||||
|
||||
public bool CanRead { get { return PropInfo.CanRead; } }
|
||||
public bool CanWrite { get { return PropInfo.CanWrite; } }
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace PepperDash.Essentials.Core
|
||||
void Client_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
||||
{
|
||||
Status = MonitorStatus.IsOk;
|
||||
StopErrorTimers();
|
||||
ResetErrorTimers();
|
||||
}
|
||||
|
||||
void Poll()
|
||||
|
||||
@@ -102,17 +102,12 @@ namespace PepperDash.Essentials.Core
|
||||
ErrorTimer = null;
|
||||
}
|
||||
|
||||
public void ResetErrorTimers()
|
||||
protected void ResetErrorTimers()
|
||||
{
|
||||
if(WarningTimer != null)
|
||||
WarningTimer.Reset(WarningTime, WarningTime);
|
||||
if(ErrorTimer != null)
|
||||
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>
|
||||
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
|
||||
// Append the incoming bytes with whatever is in the buffer
|
||||
var newBytes = new byte[IncomingBuffer.Length + e.Bytes.Length];
|
||||
IncomingBuffer.CopyTo(newBytes, 0);
|
||||
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
|
||||
for (int i = 0; i < newBytes.Length; i++)
|
||||
@@ -180,7 +180,7 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||
|
||||
// Good length, grab the message
|
||||
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
|
||||
if (message[0] == 0x41)
|
||||
@@ -292,7 +292,6 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||
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
|
||||
Debug.Console(2, this, "Sending:{0}", ComTextHelper.GetEscapedText(b));
|
||||
CommunicationMonitor.ResetErrorTimers(); // Helps prevent message collisions
|
||||
Communication.SendBytes(b);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -26,9 +26,9 @@ namespace PepperDash.Essentials.Fusion
|
||||
{
|
||||
public class EssentialsHuddleSpaceFusionSystemController : Device
|
||||
{
|
||||
public event EventHandler<ScheduleChangeEventArgs> ScheduleChange;
|
||||
public event EventHandler<MeetingChangeEventArgs> MeetingEndWarning;
|
||||
public event EventHandler<MeetingChangeEventArgs> NextMeetingBeginWarning;
|
||||
//public event EventHandler<ScheduleChangeEventArgs> ScheduleChange;
|
||||
//public event EventHandler<MeetingChangeEventArgs> MeetingEndWarning;
|
||||
//public event EventHandler<MeetingChangeEventArgs> NextMeetingBeginWarning;
|
||||
|
||||
FusionRoom FusionRoom;
|
||||
EssentialsHuddleSpaceRoom Room;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user