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.
158 lines
6.4 KiB
158 lines
6.4 KiB
2 years ago
|
using System.Collections.Concurrent;
|
||
|
|
||
|
namespace JiLinApp.Docking.FenceAlarm;
|
||
|
|
||
|
public class UdpAlarmHost
|
||
|
{
|
||
|
public int DeviceId { get; set; }
|
||
|
|
||
|
public string Ip { get; set; }
|
||
|
|
||
|
public int Port { get; set; }
|
||
|
|
||
|
public int GroupId { get; set; }//分组号,报警主机可划入不同组
|
||
|
|
||
|
public int UserId { get; set; }//用户ID,指主机名称,有多台主机可以通过此名称区分
|
||
|
|
||
|
/// <summary>
|
||
|
/// 0x00: 撤防状态
|
||
|
/// 0x01: 外出布防(普通布防最常用)
|
||
|
/// 0x02: 即时布防(所有防区没有延时)
|
||
|
/// 0x04: 在家布防(留守布防有些防区可能是在旁路状态)
|
||
|
/// 0x08: 即时留守布防(有些防区可能旁路, 但是没有旁路防区没有延时)
|
||
|
/// 0x09: 部分防区布防部分防区撤防
|
||
|
/// </summary>
|
||
|
public int DefenceState { get; set; }//主机布撤状态
|
||
|
|
||
|
public string DefenceStateStr
|
||
|
{
|
||
|
get
|
||
|
{
|
||
|
return DefenceState switch
|
||
|
{
|
||
|
0x00 => "撤防状态",
|
||
|
0x01 => "外出布防",
|
||
|
0x02 => "即时布防",
|
||
|
0x04 => "在家布防",
|
||
|
0x08 => "即时留守布防",
|
||
|
0x09 => "部分防区布防",
|
||
|
_ => "未知状态号:" + DefenceState,
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 0x00:此设备处于常规工作状态,正常报警
|
||
|
/// 0x01:工作在设置模式,不会处理报警,用户这进行设置,设置完一般很快退出
|
||
|
/// 0x02:用户正在查询当前报警信息
|
||
|
/// 0x03:用户正在设置时钟
|
||
|
/// 0x04:工作在用户密码修改模式下
|
||
|
/// </summary>
|
||
|
public int WorkState { get; set; }//设备工作状态
|
||
|
|
||
|
public string WorkStateStr
|
||
|
{
|
||
|
get
|
||
|
{
|
||
|
return DefenceState switch
|
||
|
{
|
||
|
0x00 => "常规工作状态",
|
||
|
0x01 => "在设置模式",
|
||
|
0x02 => "用户正在查询报警",
|
||
|
0x03 => "用户正在设置时钟",
|
||
|
0x04 => "用户密码修改模式",
|
||
|
_ => "未知状态号:" + WorkState,
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public int CellState { get; set; }//电池状态 1=电池故障 0=电池正常
|
||
|
public int ElectricityState { get; set; }//交流状态 1=交流掉电 0=交流正常
|
||
|
public int FuseState { get; set; }//警保险丝状态 1=外接警号断了0=正常
|
||
|
public int SectorState { get; set; }//有线防区触发了 1=其中有线防区触发了 0=所有有线防区准备好
|
||
|
public int CellTestState { get; set; }//正在电池载能测试 1=主机正在进行电池载能测试 0=无(主机会降低电压到电池12V以下,来测试电池负载特性需要2分钟)
|
||
|
public int DeviceElectricityState { get; set; }//设备交流电状态1=交流掉电,目前电池供电0=正常 这是即时状态
|
||
|
public int SoundState { get; set; }//设备声音输出状态(=0关闭声音) =1 输出声音) 用于布防和报警延时
|
||
|
public int TestState { get; set; }//主机本地测试状态1=主机在本地测试(用于测试探测好坏是没有报警记录的)0=无
|
||
|
|
||
|
public int CriticalAlarmState { get; set; }//软防区紧急报警状态1=有紧急报警(用户通过手动按下主机自带装置报警) 0=无
|
||
|
public int FireAlarmState { get; set; }//软防区火警报警状态1=有火警报警(用户通过手动按下主机自带装置报警) 0=无
|
||
|
public int StealAlarmState { get; set; }//软防区盗警报警状态1=有盗警报警(用户通过手动按下主机自带装置报警) 0=无
|
||
|
public int DeviceFireAlarmState { get; set; }//设备中有火警报警状态 1=其中有火警防区触发了 0=无 整体状态
|
||
|
public int DeviceAlarmState { get; set; }//设备有报警发生 1=指设备有报警状态,任一一种0=无报警
|
||
|
public int DeviceBywayState { get; set; }//设备有旁路防区1=指设备某些防区有旁路了(这时软件可以要求上传具体旁路的防区) 2=无防区旁路
|
||
|
public int BusOfflineState { get; set; }//有总线防区掉线状态1=指某些总线防区掉线了0=无
|
||
|
public int NetOfflineState { get; set; }//有网络防区掉线状态1=指某些网络防区掉线了0=无
|
||
|
|
||
|
/// <summary>
|
||
|
/// 00: 通用设备兼容没有设置或未知设备
|
||
|
/// 01: EH508报警主机
|
||
|
/// 02: EH508NP网络模块
|
||
|
/// 03: NETLINKBOARD32路网络模块
|
||
|
/// 04: EH508NETCILENT网络终端
|
||
|
/// 05: EH8008路光纤主机
|
||
|
/// 06: EH508NP_UDP私有服务器网络模块
|
||
|
/// 07: EH508CILENT_UDP私有服务器接警终端
|
||
|
/// 08: EH508SEVER_UDP私有服务器主机
|
||
|
/// 09: EH508MAP_UDP私有服务器电子地图
|
||
|
/// 0A: EH508_UDP私有服务器用EH508主机
|
||
|
/// 0x32: H768_IP系列网络模块
|
||
|
/// 0x33: D238C_IP网络模块
|
||
|
/// 0x34: H778S+系列报警主机
|
||
|
/// 0x35: H778S系列报警主机
|
||
|
/// 0x36: N201N202网络模块
|
||
|
/// </summary>
|
||
|
public int DevideType { get; set; }//设备类型:区分不同的设备类型 增强可控,防止混乱,具体的设备类型见附加说明表格
|
||
|
|
||
|
public int SignalIntensity { get; set; }//31:信号最强,如果设备类型不是这种不需要显示 指主要带有GPRS模块设备跟据设备类型来的
|
||
|
|
||
|
//-------------------------------防区信息-----------------------------//
|
||
|
|
||
|
public int SectorTotal { get; set; }//分区总数量
|
||
|
|
||
|
public ConcurrentDictionary<int, SectorState> SectorDict { get; }
|
||
|
|
||
|
public bool SectorsEmpty
|
||
|
{
|
||
|
get
|
||
|
{
|
||
|
return SectorDict == null || SectorDict.IsEmpty;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public ReaderWriterLockSlim SectorsLock { get; } = new();
|
||
|
|
||
|
public int OnlineState { get; set; }//设备在线状态
|
||
|
|
||
|
public int KeepLive { get; set; }//设备在线状态
|
||
|
|
||
|
public UdpAlarmHost()
|
||
|
{
|
||
|
DeviceId = 0;
|
||
|
GroupId = 0;
|
||
|
UserId = 0;
|
||
|
DefenceState = 0;
|
||
|
WorkState = 0;
|
||
|
CellState = 0;
|
||
|
ElectricityState = 0;
|
||
|
FuseState = 0;
|
||
|
SectorState = 0;
|
||
|
CellTestState = 0;
|
||
|
DeviceElectricityState = 0;
|
||
|
SoundState = 0;
|
||
|
TestState = 0;
|
||
|
CriticalAlarmState = 0;
|
||
|
FireAlarmState = 0;
|
||
|
StealAlarmState = 0;
|
||
|
DeviceFireAlarmState = 0;
|
||
|
DeviceAlarmState = 0;
|
||
|
DeviceBywayState = 0;
|
||
|
BusOfflineState = 0;
|
||
|
NetOfflineState = 0;
|
||
|
DevideType = 0;
|
||
|
SignalIntensity = 0;
|
||
|
SectorTotal = 0;
|
||
|
OnlineState = 0;
|
||
|
SectorDict = new();
|
||
|
}
|
||
|
}
|