From b8c9d61850c5876631275335243c1d207ee01b33 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 29 十月 2021 09:53:57 +0800
Subject: [PATCH] 2021-10-29 1.用虚拟机重新生成萤石和乐橙dll库。2.乐橙更新新SDK,适配单元机呼叫问题。
---
HDL_ON/Entity/Function/SecurityAlarm.cs | 47 +++++++++++++++++++----------------------------
1 files changed, 19 insertions(+), 28 deletions(-)
diff --git a/HDL_ON/Entity/Function/SecurityAlarm.cs b/HDL_ON/Entity/Function/SecurityAlarm.cs
index 1ebe9f8..68cc8d8 100644
--- a/HDL_ON/Entity/Function/SecurityAlarm.cs
+++ b/HDL_ON/Entity/Function/SecurityAlarm.cs
@@ -7,17 +7,17 @@
namespace HDL_ON.Entity
{
- public class SecurityCenter
+ public class SecurityCenter111111
{
- static SecurityCenter _securityCenter;
+ static SecurityCenter111111 _securityCenter;
- public static SecurityCenter Ins
+ public static SecurityCenter111111 Ins
{
get
{
if (_securityCenter == null)
{
- _securityCenter = new SecurityCenter();
+ _securityCenter = new SecurityCenter111111();
}
return _securityCenter;
}
@@ -30,14 +30,11 @@
{
get
{
- foreach (var temp in FunctionList.List.securities)
+ lock (FunctionList.List.securities)
{
- if (temp.status == "enable")
- {
- return true;
- }
+ var temp = FunctionList.List.securities.Find((obj) => obj.status == "enable");
+ return temp == null ? false : true;
}
- return false;
}
}
@@ -48,14 +45,11 @@
{
get
{
- foreach (var temp in FunctionList.List.securities)
+ lock (FunctionList.List.securities)
{
- if (temp.alarm)
- {
- return true;
- }
+ var temp = FunctionList.List.securities.Find((obj) => obj.alarm == true);
+ return temp == null ? false : true;
}
- return false;
}
}
@@ -69,13 +63,10 @@
{
if (_inDefenseMode == null)
{
- foreach (var temp in FunctionList.List.securities)
+ lock (FunctionList.List.securities)
{
- if (temp.status == "enable")
- {
- _inDefenseMode = temp;
- return _inDefenseMode;
- }
+ var temp = FunctionList.List.securities.Find((obj) => obj.status == "enable");
+ return temp;
}
}
return _inDefenseMode;
@@ -436,11 +427,11 @@
case SPK.SensorSmoke:
foreach (var con in condition)
{
- if (con.value == "true")
+ if (con.value == "true" || con.value == "alarm")
{
text += Language.StringByID(StringId.InAlarm) + " ";
}
- else if (con.value == "false")
+ else if (con.value == "false" || con.value == "normal")
{
text += Language.StringByID(StringId.Normal) + " ";
}
@@ -462,11 +453,11 @@
case SPK.SensorWater:
foreach (var con in condition)
{
- if (con.value == "true")
+ if (con.value == "true" || con.value == "alarm")
{
text += Language.StringByID(StringId.WaterLeakage) + " ";
}
- else if (con.value == "false")
+ else if (con.value == "false" || con.value == "normal")
{
text += Language.StringByID(StringId.Normal) + " ";
}
@@ -475,11 +466,11 @@
case SPK.SensorDoorWindow:
foreach (var con in condition)
{
- if (con.value == "true")
+ if (con.value == "true" || con.value == "open")
{
text += Language.StringByID(StringId.Open) + " ";
}
- else if (con.value == "false")
+ else if (con.value == "false" || con.value == "close")
{
text += Language.StringByID(StringId.Close) + " ";
}
--
Gitblit v1.8.0