using System;
|
using System.Collections.Generic;
|
using System.Configuration;
|
using System.Linq;
|
using System.Text;
|
using System.Threading;
|
|
namespace HDLMonitorService.Entity
|
{
|
public class ServiceInfo
|
{
|
public string ServiceName { get; set; }
|
|
public string Address { get; set; }
|
|
public string PublicAddress { get; set; }
|
|
public DateTime LastHeartTime { get; set; }
|
|
public DateTime LastRegisterTime { get; set; }
|
|
public int ErrorCount { get; set; } = 0;
|
|
public int AlarmCount { get; set; } = 0;
|
|
public bool IsOnline
|
{
|
get
|
{
|
return (DateTime.Now - this.LastHeartTime).TotalSeconds < int.Parse(ConfigurationManager.AppSettings["LoopSeconds"].ToString()) * int.Parse(ConfigurationManager.AppSettings["LoopErrorCount"].ToString()) * int.Parse(ConfigurationManager.AppSettings["LoopAlarmCount"].ToString());
|
}
|
}
|
}
|
}
|