Files
Mapo-IOB-WIN/IOB-WIN-NEXT/IobPing.cs
T
2021-10-13 11:48:59 +02:00

46 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
public class IobPing : IobGeneric
{
#region Protected Fields
protected int PoweroffTimeoutSec = 100;
/// <summary>
/// Veto controllo status x log...
/// </summary>
protected DateTime vetoCheckStatus = DateTime.Now;
#endregion Protected Fields
#region Public Constructors
/// <summary>
/// Estende l'init della classe base
/// <param name="caller"></param>
/// <param name="IOBConf"></param>
public IobPing(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
{
lgInfo("NEW IobPing (WatchDog)");
// init datetime counters
DateTime adesso = DateTime.Now;
lastPzCountSend = adesso;
lastWarnODL = adesso;
vetoCheckStatus = adesso;
var POWEROFF_TIMEOUT_SEC = getOptPar("POWEROFF_TIMEOUT_SEC");
if (!string.IsNullOrEmpty(POWEROFF_TIMEOUT_SEC))
{
int.TryParse(POWEROFF_TIMEOUT_SEC, out PoweroffTimeoutSec);
}
lgInfo($"L'adapter effettuerà PING di controllo all'indirizzo {IOBConf.cncIpAddr} per forzare stato poweroff dopo {PoweroffTimeoutSec} sec");
}
#endregion Public Constructors
}
}