From b54d209c93b3b44f6389a61e4bdb18ad2c469501 Mon Sep 17 00:00:00 2001
From: DELL <1525436766@qq.com>
Date: 星期六, 15 六月 2024 10:54:50 +0800
Subject: [PATCH] 新增告警以及告警参数

---
 Device_Simulator_DTS_Tester/src/com/dev/simpower/dev/Power_AlmState.java |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/Device_Simulator_DTS_Tester/src/com/dev/simpower/dev/Power_AlmState.java b/Device_Simulator_DTS_Tester/src/com/dev/simpower/dev/Power_AlmState.java
index 69571a6..7ba7faa 100644
--- a/Device_Simulator_DTS_Tester/src/com/dev/simpower/dev/Power_AlmState.java
+++ b/Device_Simulator_DTS_Tester/src/com/dev/simpower/dev/Power_AlmState.java
@@ -14,7 +14,7 @@
  */
 public class Power_AlmState {
 	
-	public static final int REG_Count   = 76;		//寄存器数量
+	public static final int REG_Count   = 95;		//寄存器数量
 	
 	public int ac_powerdown;				//1500	交流停电告警	0-无告警,1-停电告警
 	public int access_open;					//1501	门禁开启告警	0-无告警,1-门禁开启
@@ -30,6 +30,10 @@
 	public int dcoutputcurr_high;			//1574	直流输出电流大告警	0-无告警,1-直流输出电流大
 	public int devtemp_high;				//1575	设备温度高告警	0-无告警,1-设备温度高
 
+	public int acligh_alm;					//1576	交流防雷器告警	0-无告警,1-防雷器异常
+	public int mon_temp_alm[] = new int[16]; //41577~415921~4节(最多4*4)告警,0-无告警,1-超过上限告警,2-低于下限告警
+	public int envir_temp_alm;				//41593	 环境温度
+	public int envir_humid_alm;				//41594    环境湿度
 	public boolean putByteBuffer(ByteBuffer bbf_rx) {
 		
 		if(bbf_rx.limit() < REG_Count*2) {
@@ -56,6 +60,12 @@
 		this.dcoutputcurr_high = FBS9100_ComBase.changeShortToInt(bbf_rx.getShort());			//1574	直流输出电流大告警	0-无告警,1-直流输出电流大
 		this.devtemp_high = FBS9100_ComBase.changeShortToInt(bbf_rx.getShort());				//1575	设备温度高告警	0-无告警,1-设备温度高
 		
+		this.acligh_alm = FBS9100_ComBase.changeShortToInt(bbf_rx.getShort());					//1576	交流防雷器告警	0-无告警,1-防雷器异常
+		for (int i = 0; i < mon_temp_alm.length; i++) {
+			this.mon_temp_alm[i] = FBS9100_ComBase.changeShortToInt(bbf_rx.getShort()); 		//41577~415921~4节(最多4*4)告警,0-无告警,1-超过上限告警,2-低于下限告警
+		}		
+		this.envir_temp_alm = FBS9100_ComBase.changeShortToInt(bbf_rx.getShort());				//41593	 环境温度
+		this.envir_humid_alm = FBS9100_ComBase.changeShortToInt(bbf_rx.getShort());				//41594    环境湿度
 		//System.out.println(this);
 		return true;
 	}
@@ -82,6 +92,13 @@
 		alm_state.add(dcoutputcurr_high==0?"无告警":"直流输出电流大");
 		alm_state.add(devtemp_high==0?"无告警":"设备温度高");
 		
+		alm_state.add(acligh_alm==0?"无告警":"防雷器异常");
+		for(int k = 0;k<mon_temp_alm.length;k++) {
+			int temp_alm = mon_temp_alm[k];
+			alm_state.add(temp_alm==0?"无告警":temp_alm==1?"上限告警":temp_alm==2?"下限告警":"其他-"+temp_alm);
+		}
+		alm_state.add(envir_temp_alm==0?"无告警":envir_temp_alm==1?"上限告警":envir_temp_alm==2?"下限告警":"其他-" + envir_temp_alm);
+		alm_state.add(envir_humid_alm==0?"无告警":envir_humid_alm==1?"上限告警":envir_humid_alm==2?"下限告警":"其他-" + envir_humid_alm);
 		return alm_state;
 	}
 

--
Gitblit v1.9.1