| | |
| | | { |
| | | public SecurityAlarm() |
| | | { |
| | | pushConfigs.Add(new SecurityPushConfig() |
| | | { |
| | | pushMethod = "APP", |
| | | pushTarget = new List<string>() { UserInfo.Current.ID } |
| | | }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 安防延时 |
| | | /// </summary> |
| | | public string delay; |
| | | public string delay ="0"; |
| | | /// <summary> |
| | | /// 状态 |
| | | /// 布防:enable |
| | |
| | | var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); |
| | | FileUtlis.Files.WriteFileByBytes(savePath, ssd); |
| | | } |
| | | /// <summary> |
| | | /// 刷新本地数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public SecurityAlarm RefeshData() |
| | | { |
| | | var dataBytes = FileUtlis.Files.ReadFile(savePath); |
| | | var dataString = System.Text.Encoding.UTF8.GetString(dataBytes); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityAlarm>(dataString); |
| | | return temp; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 保存安防信息 |
| | |
| | | public string SaveInfo() |
| | | { |
| | | HttpServerRequest hsr = new HttpServerRequest(); |
| | | this.noticeConfig.enable = true; |
| | | this.noticeConfig.noticeContent = Language.StringByID(StringId.SecurityAlarmTipString).Replace("{0}", name); |
| | | if (string.IsNullOrEmpty(this.noticeConfig.noticeContent)) |
| | | { |
| | | this.noticeConfig.noticeContent = Language.StringByID(StringId.SecurityAlarmTipString).Replace("{0}", name); |
| | | } |
| | | if (this.noticeConfig.enable) |
| | | { |
| | | if (this.pushConfigs.Count == 0) |
| | | { |
| | | pushConfigs.Add(new SecurityPushConfig() |
| | | { |
| | | pushMethod = "APP", |
| | | pushTarget = new List<string>() { UserInfo.Current.ID } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(sid)) |
| | | { |
| | | NewSid(); |
| | |
| | | public List<SecurityInputCondition> condition = new List<SecurityInputCondition>(); |
| | | |
| | | /// <summary> |
| | | /// 判断条件 |
| | | /// </summary> |
| | | public string comparator = "="; |
| | | |
| | | /// <summary> |
| | | /// 加入输入条件 |
| | | /// 本地判断使用 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public bool addCondition = false; |
| | | //[Newtonsoft.Json.JsonIgnore] |
| | | //public bool addCondition = false; |
| | | |
| | | /// <summary> |
| | | /// 判断条件 |
| | | /// </summary> |
| | | public string comparator = "="; |
| | | |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | Function _function = null; |
| | |
| | | /// </summary> |
| | | public List<SecurityOutputStatus> status = new List<SecurityOutputStatus>(); |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加入输入条件 |
| | | /// 本地判断使用 |
| | | /// </summary> |
| | | //[Newtonsoft.Json.JsonIgnore] |
| | | //public bool addCondition = false; |
| | | |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public bool addCondition = false; |
| | | public string name = ""; |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public string RoomName = ""; |
| | | |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | Function _function = null; |
| | |
| | | } |
| | | }else if(target_type == "1") |
| | | { |
| | | |
| | | text = Language.StringByID(StringId.Open); |
| | | } |
| | | |
| | | return text; |
| | |
| | | /// <summary> |
| | | /// 是否开启通知 |
| | | /// </summary> |
| | | public bool enable; |
| | | public bool enable = true; |
| | | /// <summary> |
| | | /// 通知内容 |
| | | /// </summary> |