using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Module.FireCtrl.ModBusTcp { /// /// 消防设备管理类 /// public class FireEqmManager { /// /// 消防通讯连接线程 /// public void FireNetConnectThread() { Thread fireConnectThread = new Thread(FireNetConnectFunc); fireConnectThread.IsBackground = true; fireConnectThread.Start(); } /// /// 消防通讯连接 /// private void FireNetConnectFunc() { CmnFireBaseInfo.FRC01.F_EqmCode = "F001"; if (!CmnFireBaseInfo.FRC01.F_NetConnected) { CmnFireBaseInfo.FRC01.Connect(); } } /// /// 消防通讯重连线程 /// public void FireNetReConnectThread() { Thread fireConnectThread = new Thread(FireNetReConnectFunc); fireConnectThread.IsBackground = true; fireConnectThread.Start(); } /// /// 消防通讯重新连接 /// private void FireNetReConnectFunc() { CmnFireBaseInfo.FRC01.DisConnect(); Thread.Sleep(5 * 1000); CmnFireBaseInfo.FRC01.Connect(); } /// /// 消防系统状态 /// /// public MFireStatusValue GetFireStatusValue() { return CmnFireBaseInfo.FRC01.F_FireStatusValue; } /// /// 故障信息值 /// /// public List GetFireFaultInfo() { return CmnFireBaseInfo.FRC01.F_FaultInformations; } /// /// 传感器信息值 /// /// public List GetSensorInfo() { return CmnFireBaseInfo.FRC01.F_SensorInformations; } /// /// 分区信息值 /// /// public MPartitionValue GetPartitionVal() { return CmnFireBaseInfo.FRC01.F_Partition; } /// /// 消防灭火器状态 /// /// public MFireExtinguisher GetFireExtinguisher() { return CmnFireBaseInfo.FRC01.F_FireExtinguisher; } } }