JLChen
2021-10-15 df3906c03db154e8622b7caeaa3bf93b67c6d40a
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) + " ";
                        }