You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
2.6 KiB
105 lines
2.6 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Module.FireCtrl.ModBusTcp
|
|
{
|
|
/// <summary>
|
|
/// 消防设备管理类
|
|
/// </summary>
|
|
public class FireEqmManager
|
|
{
|
|
/// <summary>
|
|
/// 消防通讯连接线程
|
|
/// </summary>
|
|
public void FireNetConnectThread()
|
|
{
|
|
Thread fireConnectThread = new Thread(FireNetConnectFunc);
|
|
fireConnectThread.IsBackground = true;
|
|
fireConnectThread.Start();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 消防通讯连接
|
|
/// </summary>
|
|
private void FireNetConnectFunc()
|
|
{
|
|
CmnFireBaseInfo.FRC01.F_EqmCode = "F001";
|
|
|
|
if (!CmnFireBaseInfo.FRC01.F_NetConnected)
|
|
{
|
|
CmnFireBaseInfo.FRC01.Connect();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 消防通讯重连线程
|
|
/// </summary>
|
|
public void FireNetReConnectThread()
|
|
{
|
|
Thread fireConnectThread = new Thread(FireNetReConnectFunc);
|
|
fireConnectThread.IsBackground = true;
|
|
fireConnectThread.Start();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 消防通讯重新连接
|
|
/// </summary>
|
|
private void FireNetReConnectFunc()
|
|
{
|
|
CmnFireBaseInfo.FRC01.DisConnect();
|
|
Thread.Sleep(5 * 1000);
|
|
CmnFireBaseInfo.FRC01.Connect();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 消防系统状态
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public MFireStatusValue GetFireStatusValue()
|
|
{
|
|
return CmnFireBaseInfo.FRC01.F_FireStatusValue;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 故障信息值
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public List<MFaultInformation> GetFireFaultInfo()
|
|
{
|
|
return CmnFireBaseInfo.FRC01.F_FaultInformations;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 传感器信息值
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public List<MSensorInformation> GetSensorInfo()
|
|
{
|
|
return CmnFireBaseInfo.FRC01.F_SensorInformations;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 分区信息值
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public MPartitionValue GetPartitionVal()
|
|
{
|
|
return CmnFireBaseInfo.FRC01.F_Partition;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 消防灭火器状态
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public MFireExtinguisher GetFireExtinguisher()
|
|
{
|
|
return CmnFireBaseInfo.FRC01.F_FireExtinguisher;
|
|
}
|
|
|
|
}
|
|
}
|