mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
docs: update XML comments for Essentials Core
This commit is contained in:
parent
0764685c51
commit
f88bb13367
260 changed files with 7018 additions and 1318 deletions
|
|
@ -13,8 +13,14 @@ using PepperDash.Core;
|
|||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for status monitors
|
||||
/// </summary>
|
||||
public abstract class StatusMonitorBase : IStatusMonitor, IKeyName
|
||||
{
|
||||
/// <summary>
|
||||
/// Event fired when status changes
|
||||
/// </summary>
|
||||
public event EventHandler<MonitorStatusChangeEventArgs> StatusChange;
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -27,15 +33,24 @@ namespace PepperDash.Essentials.Core
|
|||
/// </summary>
|
||||
public string Name { get { return "Comm. monitor"; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Parent
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Gets or sets the Parent
|
||||
/// </summary>
|
||||
public IKeyed Parent { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Bool feedback for online status
|
||||
/// </summary>
|
||||
public BoolFeedback IsOnlineFeedback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the monitored device is online
|
||||
/// </summary>
|
||||
public bool IsOnline;
|
||||
|
||||
/// <summary>
|
||||
/// Current monitor status
|
||||
/// </summary>
|
||||
public MonitorStatus Status
|
||||
{
|
||||
get { return _Status; }
|
||||
|
|
@ -51,6 +66,9 @@ namespace PepperDash.Essentials.Core
|
|||
}
|
||||
MonitorStatus _Status;
|
||||
|
||||
/// <summary>
|
||||
/// Current status message
|
||||
/// </summary>
|
||||
public string Message
|
||||
{
|
||||
get { return _Message; }
|
||||
|
|
@ -69,6 +87,12 @@ namespace PepperDash.Essentials.Core
|
|||
CTimer WarningTimer;
|
||||
CTimer ErrorTimer;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="parent">parent device</param>
|
||||
/// <param name="warningTime">time in milliseconds before warning status</param>
|
||||
/// <param name="errorTime">time in milliseconds before error status</param>
|
||||
public StatusMonitorBase(IKeyed parent, long warningTime, long errorTime)
|
||||
{
|
||||
Parent = parent;
|
||||
|
|
@ -83,9 +107,20 @@ namespace PepperDash.Essentials.Core
|
|||
ErrorTime = errorTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts the monitor
|
||||
/// </summary>
|
||||
public abstract void Start();
|
||||
|
||||
/// <summary>
|
||||
/// Stops the monitor
|
||||
/// </summary>
|
||||
public abstract void Stop();
|
||||
|
||||
/// <summary>
|
||||
/// Fires the StatusChange event
|
||||
/// </summary>
|
||||
/// <param name="status">monitor status</param>
|
||||
protected void OnStatusChange(MonitorStatus status)
|
||||
{
|
||||
if (_Status == MonitorStatus.IsOk)
|
||||
|
|
@ -98,6 +133,11 @@ namespace PepperDash.Essentials.Core
|
|||
handler(this, new MonitorStatusChangeEventArgs(status));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fires the StatusChange event with message
|
||||
/// </summary>
|
||||
/// <param name="status">monitor status</param>
|
||||
/// <param name="message">status message</param>
|
||||
protected void OnStatusChange(MonitorStatus status, string message)
|
||||
{
|
||||
if (_Status == MonitorStatus.IsOk)
|
||||
|
|
@ -110,12 +150,18 @@ namespace PepperDash.Essentials.Core
|
|||
handler(this, new MonitorStatusChangeEventArgs(status, message));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts the error timers
|
||||
/// </summary>
|
||||
protected void StartErrorTimers()
|
||||
{
|
||||
if (WarningTimer == null) WarningTimer = new CTimer(o => { Status = MonitorStatus.InWarning; }, WarningTime);
|
||||
if (ErrorTimer == null) ErrorTimer = new CTimer(o => { Status = MonitorStatus.InError; }, ErrorTime);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops the error timers
|
||||
/// </summary>
|
||||
protected void StopErrorTimers()
|
||||
{
|
||||
if (WarningTimer != null) WarningTimer.Stop();
|
||||
|
|
@ -124,6 +170,9 @@ namespace PepperDash.Essentials.Core
|
|||
ErrorTimer = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the error timers
|
||||
/// </summary>
|
||||
protected void ResetErrorTimers()
|
||||
{
|
||||
if(WarningTimer != null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue