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.
67 lines
1.8 KiB
67 lines
1.8 KiB
namespace JiLinApp.Docking.FenceAlarm;
|
|
|
|
public class SectorState
|
|
{
|
|
public int id { get; set; }//防区号
|
|
/*0:防区未使用
|
|
1:防区撤防
|
|
2:防区布防
|
|
3:防区旁路
|
|
4:防区报警
|
|
5:无线防区欠压
|
|
6:防区掉线(与主线总线脱离)
|
|
*/
|
|
public int state { get; set; }//防区状态
|
|
|
|
public string stateStr
|
|
{
|
|
get
|
|
{
|
|
switch (state)
|
|
{
|
|
case 0: return "防区未使用";
|
|
case 1: return "防区撤防";
|
|
case 2: return "防区布防";
|
|
case 3: return "防区旁路";
|
|
case 4: return "防区报警";
|
|
case 5: return "无线防区欠压";
|
|
case 6: return "防区掉线";
|
|
default: return "未知状态:" + state;
|
|
}
|
|
}
|
|
}
|
|
|
|
/*
|
|
0:普通防区,无特殊参数
|
|
1:张力防区需要单独查询因为这个防区显示张力线值每条线状态
|
|
2:脉冲围栏
|
|
3:振动光纤
|
|
4:泄漏电缆
|
|
5:网络或总线多子防区模块
|
|
*/
|
|
public int type { get; set; }//防区类型,特殊参数需单独查询
|
|
|
|
public string typeStr
|
|
{
|
|
get
|
|
{
|
|
switch (type)
|
|
{
|
|
case 0: return "普通防区";
|
|
case 1: return "张力防区";
|
|
case 2: return "脉冲围栏";
|
|
case 3: return "振动光纤";
|
|
case 4: return "泄漏电缆";
|
|
case 5: return "网络或总线多子防区模块";
|
|
default: return "未知类型:" + type;
|
|
}
|
|
}
|
|
}
|
|
|
|
public SectorState(int id, byte data)
|
|
{
|
|
this.id = id;
|
|
state = data & 0x0F;
|
|
type = data >> 4;
|
|
}
|
|
}
|