瀏覽代碼

增加是否报警判断
在dev_status表中新增alarm_enable字段
AND t1.alarm_enable=1

cuci 1 年之前
父節點
當前提交
78b76fefac
共有 2 個文件被更改,包括 6 次插入4 次删除
  1. 5 3
      core/core.c
  2. 1 1
      lib/decode.c

+ 5 - 3
core/core.c

@@ -219,7 +219,8 @@ int CoreAlarmGateway()
                 "AND t1.current_online=1 "
                 "AND t1.original_relay IS NOT NULL "
                 "AND t1.current_electric IS NOT NULL "
-                "AND t1.electric_update_flag=1 ");
+                "AND t1.electric_update_flag=1 "
+                "AND t1.alarm_enable=1 ");
   excuteSql(conn,query);
   res = mysql_store_result(conn);
   if (NULL == res)
@@ -415,7 +416,7 @@ int CoreAlarmGateway()
 }
 
 /******************************************************************
- *	Function Name:	core_alarm_gateway
+ *	Function Name:	CoreAlarmNode
  *	Arguments:
  *	Return Value:	void
  *	Date: 			2023-12-8
@@ -449,7 +450,8 @@ int CoreAlarmNode()
                 "AND t1.current_online=1 "
                 "AND t1.original_relay IS NOT NULL "
                 "AND t1.current_electric IS NOT NULL "
-                "AND t1.electric_update_flag=1 ");
+                "AND t1.electric_update_flag=1 "
+                "AND t1.alarm_enable=1 ");
   excuteSql(conn2,query);
   res = mysql_store_result(conn2);
   if (NULL == res)

+ 1 - 1
lib/decode.c

@@ -62,7 +62,7 @@ void AlarmGateway(void)
 		}
 	}
 
-	log("AlarmGateway thread be closed!\n");
+	log("AlarmGateway thread be closed!---------------------------------------------------------------------------------\n");
 	exit(0);
 }