|
@@ -297,7 +297,7 @@ int CoreAlarmGateway(void)
|
|
|
|
|
|
//判断继电器数据,有报警跳过后续判断
|
|
|
result = RelayAlarm(gateway_mac,"0F0000000001",original_relay,conn);
|
|
|
- if(result==0) continue;
|
|
|
+ if(result==0 || result==2) continue;
|
|
|
|
|
|
//判断更新的数据是否在指令下发的2minute内
|
|
|
if(row[15])
|
|
@@ -389,7 +389,7 @@ int CoreAlarmGateway(void)
|
|
|
}
|
|
|
|
|
|
//判断继电器拉闸状态有电流
|
|
|
- if(current_on_off==0 && current_electric>100)
|
|
|
+ if(current_on_off==0 && current_electric>150)
|
|
|
{
|
|
|
debug("网关:%s,继电器拉闸状态有电流 \n",device_name);
|
|
|
int ret=ElectricAlarm(gateway_mac,"0F0000000001",device_name,device_name,1103,"继电器拉闸状态有电流",conn);
|
|
@@ -397,7 +397,7 @@ int CoreAlarmGateway(void)
|
|
|
}
|
|
|
|
|
|
//判断继电器合闸状态无电流
|
|
|
- if(current_on_off==1 && current_electric<100)
|
|
|
+ if(current_on_off==1 && current_electric<150)
|
|
|
{
|
|
|
debug("网关:%s,继电器合闸状态无电流 \n",device_name);
|
|
|
int ret=ElectricAlarm(gateway_mac,"0F0000000001",device_name,device_name,1104,"继电器合闸状态无电流",conn);
|
|
@@ -535,7 +535,7 @@ int CoreAlarmNode(void)
|
|
|
|
|
|
//判断继电器数据
|
|
|
result = RelayAlarm(gateway_mac,device_mac,original_relay,conn2);
|
|
|
- if(result==0) continue;
|
|
|
+ if(result==0 || result==2) continue;
|
|
|
|
|
|
//判断更新的数据是否在指令下发的2minute内
|
|
|
if(row[16])
|
|
@@ -629,7 +629,7 @@ int CoreAlarmNode(void)
|
|
|
}
|
|
|
|
|
|
//判断继电器拉闸状态有电流
|
|
|
- if(current_on_off==0 && current_electric>100)
|
|
|
+ if(current_on_off==0 && current_electric>150)
|
|
|
{
|
|
|
debug("网关:%s,节点:%s,继电器拉闸状态有电流 \n",gateway_name,node_name);
|
|
|
int ret=ElectricAlarm(gateway_mac,device_mac,gateway_name,node_name,1103,"继电器拉闸状态有电流",conn2);
|
|
@@ -637,7 +637,7 @@ int CoreAlarmNode(void)
|
|
|
}
|
|
|
|
|
|
//判断继电器合闸状态无电流
|
|
|
- if(current_on_off==1 && current_electric<100)
|
|
|
+ if(current_on_off==1 && current_electric<150)
|
|
|
{
|
|
|
debug("网关:%s,节点:%s,继电器合闸状态无电流 \n",gateway_name,node_name);
|
|
|
int ret=ElectricAlarm(gateway_mac,device_mac,gateway_name,node_name,1104,"继电器合闸状态无电流",conn2);
|
|
@@ -776,9 +776,9 @@ int ElectricAlarm(char* mac,char* subMac,char* gatewayName,char* nodeName,int al
|
|
|
else//没有查询到记录
|
|
|
{
|
|
|
debug("没有记录 querySql:%s",querySql);
|
|
|
- sprintf(insertSql,"insert into dev_fault(device_mac,device_mac_node,fault_details,relay_code,fault_state,fault_time)values('%s','%s','%s',%d,1,now())",
|
|
|
+ sprintf(insertSql,"insert into dev_fault(device_mac,device_mac_node,fault_details,relay_code,fault_state,fault_time,fault_count)values('%s','%s','%s',%d,3,now(),1)",
|
|
|
mac,subMac,strAlarm,alarmCode);
|
|
|
- log("触发告警(插入): %s\n",strAlarm);
|
|
|
+ log("触发告警(插入,暂不报警): %s\n",strAlarm);
|
|
|
excuteSql(_db,insertSql);
|
|
|
}
|
|
|
mysql_free_result(res);
|
|
@@ -1286,7 +1286,7 @@ int RelayAlarm(char* mac,char* subMac,int relayCode,MYSQL* _db)
|
|
|
{
|
|
|
//debug("res && queryRow>0 querySql:%s",querySql);
|
|
|
mysql_free_result(res);
|
|
|
- return 1;
|
|
|
+ return 2;
|
|
|
}
|
|
|
mysql_free_result(res);
|
|
|
|