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

50 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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");
}
}
}