dc/Common/S1F1HeartBit.cs
13118993771@163.com eb23e102b4 大更新
2022-12-16 13:01:24 +08:00

50 linhas
1.4 KiB
C#

This file contains ambiguous Unicode characters

Este arquivo contém caracteres Unicode que podem ser confundidos com outros caracteres. Se você acha que isso é intencional, pode ignorar esse aviso com segurança. Use o botão Escapar para revelá-los invisible_runes_line=`Esta linha tem caracteres unicode invisíveis

using Glorysoft.SECS.EQP.Commands;
using Glorysoft.SECS.EQP.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
namespace ARI.EAP.HOST.Common
{
public class S1F1HeartBit
{
public Timer timer1;
public Timer timer2;
public S1F1HeartBit()
{
timer1 = new Timer(60000);
timer1.Elapsed += new ElapsedEventHandler(Method);
timer1.AutoReset = true;
timer1.Enabled = true;
timer2 = new Timer(30000);
timer2.Elapsed += new ElapsedEventHandler(Method1);
timer2.AutoReset = false;
timer2.Enabled = false;
}
public void Method(object source, ElapsedEventArgs e)
{
if (EquipmentStatus.S1F1FuntionStatus)
{
if (EquipmentStatus.EqConnectState.Equals(ConnectState.connected))
{
Command.S1F1Command(null);
timer2.Stop();
timer2.Start();
}
}
}
public void Method1(object source, ElapsedEventArgs e)
{
LoggerService.SYSLogger.Debug("未收到S1F2回复判断设备与EAP已断连开始重连...");
EquipmentStatus.EqConnectState = ConnectState.connecting;
Global.MF.pushBotton("Connect");
}
}
}