mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-09 17:54:59 +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.
Reference in New Issue
Block a user