| | |
| | | |
| | | namespace HDL_ON.Entity |
| | | { |
| | | |
| | | public class SecurityCenter |
| | | { |
| | | static SecurityCenter _securityCenter; |
| | | |
| | | public static SecurityCenter Ins |
| | | { |
| | | get |
| | | { |
| | | if (_securityCenter == null) |
| | | { |
| | | _securityCenter = new SecurityCenter(); |
| | | } |
| | | return _securityCenter; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 布防中 |
| | | /// </summary> |
| | | public bool InDefense |
| | | { |
| | | get |
| | | { |
| | | foreach (var temp in FunctionList.List.securities) |
| | | { |
| | | if (temp.status == "enable") |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 报警中 |
| | | /// </summary> |
| | | public bool InAlarm |
| | | { |
| | | get |
| | | { |
| | | foreach (var temp in FunctionList.List.securities) |
| | | { |
| | | if (temp.alarm) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | SecurityAlarm _inDefenseMode; |
| | | /// <summary> |
| | | /// 当前布防模式 |
| | | /// </summary> |
| | | public SecurityAlarm InDefenseMode |
| | | { |
| | | get |
| | | { |
| | | if (_inDefenseMode == null) |
| | | { |
| | | foreach (var temp in FunctionList.List.securities) |
| | | { |
| | | if (temp.status == "enable") |
| | | { |
| | | _inDefenseMode = temp; |
| | | return _inDefenseMode; |
| | | } |
| | | } |
| | | } |
| | | return _inDefenseMode; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public class SecurityAlarm |
| | | { |
| | | public SecurityAlarm() |
| | |
| | | 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) + " "; |
| | | } |
| | |
| | | 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) + " "; |
| | | } |
| | |
| | | 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) + " "; |
| | | } |