| | |
| | | if (mainGateway == null) |
| | | { |
| | | return 3000; |
| | | }else if (mainGateway.IsVirtual) |
| | | } |
| | | else if (mainGateway.IsVirtual) |
| | | { |
| | | return 6000; |
| | | } |
| | |
| | | return 3000; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | ErrorResponData errResponData; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class ErrorResponData |
| | | { |
| | | /// <summary> |
| | | /// Error参数含义 |
| | | ///<para>1:网关无法解析命令数据。</para> |
| | | ///<para>2:协调器正在升级或备份/恢复数据 |
| | | ///<para>3:操作设备/组/场景不存在</para> |
| | | ///<para>4:其他错误</para> |
| | | ///<para>5:数据传输错误(在某次客户端向网关发送数据的过程中,网关在合理时间范围内接收客户端数据不完整导致该错误发生。如客户端向网关一次发送100个字节的数据,但网关等待接收了一秒只接收了80个字节。发生该错误,网关将主动关闭客户端连接)</para> |
| | | /// </summary> |
| | | public int Error; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | d = new AdminLoginResponAllData { }; |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/AdminLogin_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | if (tempData == null) |
| | | { |
| | |
| | | /// 管理员密码登陆返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class AdminLoginResponAllData |
| | | public class AdminLoginResponAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 返回结果Result |
| | | /// <para>0:登陆成功</para> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/ChangeAdminPassword_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | if (result == 0) |
| | | { |
| | | security.changeAdminPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ChangeAdminPasswordResponseData>(jobject["Data"].ToString()); |
| | | if (security.changeAdminPasswordResponseData != null) |
| | | var changeAdminPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ChangeAdminPasswordResponseData>(jobject["Data"].ToString()); |
| | | if (changeAdminPasswordResponseData != null) |
| | | { |
| | | d = new ChangeAdminPasswordResponseAllData { changeAdminPasswordResponseData = security.changeAdminPasswordResponseData }; |
| | | d = new ChangeAdminPasswordResponseAllData { changeAdminPasswordResponseData = changeAdminPasswordResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | } |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/ChangeAdminPassword_Actions 启动" + System.DateTime.Now.ToString()); |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | { "Cluster_ID", 0 }, |
| | | { "Command", 4023} |
| | |
| | | /// 修改管理员密码返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class ChangeAdminPasswordResponseAllData |
| | | public class ChangeAdminPasswordResponseAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 修改管理员密码返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/CatDelayTime_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.catDelayTimeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CatDelayTimeResponseData>(jobject["Data"].ToString()); |
| | | if (security.catDelayTimeResponseData == null) |
| | | var catDelayTimeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CatDelayTimeResponseData>(jobject["Data"].ToString()); |
| | | if (catDelayTimeResponseData == null) |
| | | { |
| | | d = new CatDelayTimeResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | d = new CatDelayTimeResponseAllData { catDelayTimeResponseData = security.catDelayTimeResponseData }; |
| | | d = new CatDelayTimeResponseAllData { catDelayTimeResponseData = catDelayTimeResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | } |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/CatDelayTime_Actions 启动" + System.DateTime.Now.ToString()); |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | { "Cluster_ID", 0 }, |
| | | { "Command", 4019} |
| | |
| | | /// 查看延时时间返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class CatDelayTimeResponseAllData |
| | | public class CatDelayTimeResponseAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 查看延时时间返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | d = new SetDelayTimeResponseAllData { }; |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/SetDelayTime_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.setDelayTimeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetDelayTimeResponseData>(jobject["Data"].ToString()); |
| | | if (security.setDelayTimeResponseData == null) |
| | | var setDelayTimeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetDelayTimeResponseData>(jobject["Data"].ToString()); |
| | | if (setDelayTimeResponseData == null) |
| | | { |
| | | d = new SetDelayTimeResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | d = new SetDelayTimeResponseAllData { setDelayTimeResponseData = security.setDelayTimeResponseData }; |
| | | d = new SetDelayTimeResponseAllData { setDelayTimeResponseData = setDelayTimeResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | } |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/SetDelayTime_Actions 启动" + System.DateTime.Now.ToString()); |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | { "Cluster_ID", 0 }, |
| | | { "Command", 4020} |
| | |
| | | }; |
| | | jObject.Add("Data", data); |
| | | mainGateway.Send("Security/SetDelayTime", jObject.ToString()); |
| | | }catch { } |
| | | } |
| | | catch { } |
| | | var dateTime = DateTime.Now; |
| | | while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) |
| | | { |
| | |
| | | /// 设置延时时间返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class SetDelayTimeResponseAllData |
| | | public class SetDelayTimeResponseAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 设置延时时间返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | d = new CatUserPasswordResponseAllData { }; |
| | | |
| | | if (temp == null) |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/CatUserPassword_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.catUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CatUserPasswordResponseData>(jobject["Data"].ToString()); |
| | | if (security.catUserPasswordResponseData == null) |
| | | var catUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CatUserPasswordResponseData>(jobject["Data"].ToString()); |
| | | if (catUserPasswordResponseData == null) |
| | | { |
| | | d = new CatUserPasswordResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | d = new CatUserPasswordResponseAllData { catUserPasswordResponseData = security.catUserPasswordResponseData }; |
| | | d = new CatUserPasswordResponseAllData { catUserPasswordResponseData = catUserPasswordResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | } |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/CatUserPassword_Actions 启动" + System.DateTime.Now.ToString()); |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | { "Cluster_ID", 0 }, |
| | | { "Command", 4024} |
| | |
| | | jObject.Add("Data", data); |
| | | mainGateway.Send("Security/CatUserPassword", jObject.ToString()); |
| | | } |
| | | catch { |
| | | catch |
| | | { |
| | | } |
| | | var dateTime = DateTime.Now; |
| | | while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) |
| | |
| | | /// 查看用户密码和胁迫密码返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class CatUserPasswordResponseAllData |
| | | public class CatUserPasswordResponseAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 查看用户密码和胁迫密码返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | d = new SetUserPasswordResponseAllData { }; |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/SetUserPassword_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | if (result == 0) |
| | | { |
| | | security.setUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetUserPasswordResponseData>(jobject["Data"].ToString()); |
| | | if (security.setUserPasswordResponseData != null) |
| | | var setUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetUserPasswordResponseData>(jobject["Data"].ToString()); |
| | | if (setUserPasswordResponseData != null) |
| | | { |
| | | d = new SetUserPasswordResponseAllData { setUserPasswordResponseData = security.setUserPasswordResponseData }; |
| | | d = new SetUserPasswordResponseAllData { setUserPasswordResponseData = setUserPasswordResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | |
| | | } |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/SetUserPassword_Actions 启动" + System.DateTime.Now.ToString()); |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | { "Cluster_ID", 0 }, |
| | | { "Command", 4025} |
| | |
| | | jObject.Add("Data", data); |
| | | mainGateway.Send("Security/SetUserPassword", jObject.ToString()); |
| | | } |
| | | catch{ |
| | | catch |
| | | { |
| | | } |
| | | var dateTime = DateTime.Now; |
| | | while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | d = new SetUserPasswordResponseAllData { }; |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/AddPassWordTips_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | if (result == 0) |
| | | { |
| | | security.setUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetUserPasswordResponseData>(jobject["Data"].ToString()); |
| | | if (security.setUserPasswordResponseData != null) |
| | | var setUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetUserPasswordResponseData>(jobject["Data"].ToString()); |
| | | if (setUserPasswordResponseData != null) |
| | | { |
| | | d = new SetUserPasswordResponseAllData { setUserPasswordResponseData = security.setUserPasswordResponseData }; |
| | | d = new SetUserPasswordResponseAllData { setUserPasswordResponseData = setUserPasswordResponseData }; |
| | | } |
| | | } |
| | | else |
| | |
| | | /// 新增或重设用户密码返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class SetUserPasswordResponseAllData |
| | | public class SetUserPasswordResponseAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 修改管理员密码返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | } |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | d = new DelUserPasswordResponseAllData { }; |
| | | |
| | | if (temp == null) |
| | |
| | | } |
| | | if (topic == gatewayID + "/" + "Security/DelUserPassword_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.delUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelUserPasswordResponseData>(jobject["Data"].ToString()); |
| | | if (security.delUserPasswordResponseData != null) |
| | | var delUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelUserPasswordResponseData>(jobject["Data"].ToString()); |
| | | if (delUserPasswordResponseData != null) |
| | | { |
| | | d = new DelUserPasswordResponseAllData { delUserPasswordResponseData = security.delUserPasswordResponseData }; |
| | | d = new DelUserPasswordResponseAllData { delUserPasswordResponseData = delUserPasswordResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | |
| | | } |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/DelUserPassword_Actions 启动" + System.DateTime.Now.ToString()); |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | { "Cluster_ID", 0 }, |
| | | { "Command", 4026} |
| | |
| | | /// 删除用户密码返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class DelUserPasswordResponseAllData |
| | | public class DelUserPasswordResponseAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 删除用户密码返回的数据 |
| | | /// </summary> |
| | |
| | | // if (topic == gatewayID + "/" + "Error_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; |
| | | // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | // if (temp == null) |
| | | // { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | d = new AddDeviceToZoneResponseAllData { }; |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/AddEqToZone_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | |
| | | if (result == 0) |
| | | { |
| | | security.addDeviceToZoneResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddDeviceToZoneResponseData>(jobject["Data"].ToString()); |
| | | if(security.addDeviceToZoneResponseData!=null){ |
| | | d = new AddDeviceToZoneResponseAllData { addDeviceToPartResponseData = security.addDeviceToZoneResponseData }; |
| | | var addDeviceToZoneResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddDeviceToZoneResponseData>(jobject["Data"].ToString()); |
| | | if (addDeviceToZoneResponseData != null) |
| | | { |
| | | d = new AddDeviceToZoneResponseAllData { addDeviceToPartResponseData = addDeviceToZoneResponseData }; |
| | | } |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine($"Security/AddEqToZone_Actions启动_{System.DateTime.Now.ToString()}"); |
| | | try{ |
| | | try |
| | | { |
| | | if (addDeviceToZoneData != null) |
| | | { |
| | | var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4003 } }; |
| | |
| | | mainGateway.Send(("Security/AddEqToZone_Actions 启动"), jObject.ToString()); |
| | | } |
| | | } |
| | | catch { |
| | | catch |
| | | { |
| | | } |
| | | |
| | | var dateTime = DateTime.Now; |
| | |
| | | /// 设备加入防区的返回数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class AddDeviceToZoneResponseAllData |
| | | public class AddDeviceToZoneResponseAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 设备加入防区的返回数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | d = new AddNewModeResponseAllData { }; |
| | | if (temp == null) |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/AddNewMode_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | |
| | | if (result == 0) |
| | | { |
| | | security.addNewModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddNewModeResponseData>(jobject["Data"].ToString()); |
| | | if (security.addNewModeResponseData != null) |
| | | var addNewModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddNewModeResponseData>(jobject["Data"].ToString()); |
| | | if (addNewModeResponseData != null) |
| | | { |
| | | d = new AddNewModeResponseAllData { addNewModeResponseData = security.addNewModeResponseData }; |
| | | d = new AddNewModeResponseAllData { addNewModeResponseData = addNewModeResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{ topic}"); |
| | | } |
| | | } |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/AddNewMode_Actions 启动" + System.DateTime.Now.ToString()); |
| | | try{ |
| | | try |
| | | { |
| | | if (addNewModeData != null) |
| | | { |
| | | var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4004 } }; |
| | |
| | | /// 新建或修改布防模式返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class AddNewModeResponseAllData |
| | | public class AddNewModeResponseAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | ///新建或修改布防模式返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | d = new ZoneJoinModeResponseAllData { }; |
| | | if (temp == null) |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/ZoneJoinMode_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | var modeId = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["ModeId"].ToString()); |
| | | if (result == 0) |
| | | { |
| | | security.zoneJoinModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZoneJoinModeResponseData>(jobject["Data"].ToString()); |
| | | if (security.zoneJoinModeResponseData != null) |
| | | var zoneJoinModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZoneJoinModeResponseData>(jobject["Data"].ToString()); |
| | | if (zoneJoinModeResponseData != null) |
| | | { |
| | | d = new ZoneJoinModeResponseAllData { zoneJoinModeResponseData = security.zoneJoinModeResponseData }; |
| | | d = new ZoneJoinModeResponseAllData { zoneJoinModeResponseData = zoneJoinModeResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{ topic}"); |
| | | } |
| | | } |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/ZoneJoinMode_Actions 启动" + System.DateTime.Now.ToString()); |
| | | try{ |
| | | try |
| | | { |
| | | if (zoneJoinModeData != null) |
| | | { |
| | | var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4005 } }; |
| | |
| | | /// 防区加入布防模式返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class ZoneJoinModeResponseAllData |
| | | public class ZoneJoinModeResponseAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | ///防区加入布防模式返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | d = new RemoveZoneFromModeResponseAllData { }; |
| | | if (temp == null) |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/RemoveZoneFromMode_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | var modeId = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["ModeId"].ToString()); |
| | | |
| | | if (result == 0) |
| | | { |
| | | security.removeZoneFromModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveZoneFromModeResponseData>(jobject["Data"].ToString()); |
| | | if (security.removeZoneFromModeResponseData != null) |
| | | var removeZoneFromModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveZoneFromModeResponseData>(jobject["Data"].ToString()); |
| | | if (removeZoneFromModeResponseData != null) |
| | | { |
| | | d = new RemoveZoneFromModeResponseAllData { removeZoneFromModeResponseData = security.removeZoneFromModeResponseData }; |
| | | d = new RemoveZoneFromModeResponseAllData { removeZoneFromModeResponseData = removeZoneFromModeResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{ topic}"); |
| | | } |
| | | } |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/RemoveZoneFromMode_Actions 启动" + System.DateTime.Now.ToString()); |
| | | try{ |
| | | try |
| | | { |
| | | if (removeZoneFromModeData != null) |
| | | { |
| | | var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4006 } }; |
| | |
| | | /// 从布防模式中移除防区返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class RemoveZoneFromModeResponseAllData |
| | | public class RemoveZoneFromModeResponseAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | ///从布防模式中移除防区返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | d = new AddModeActonResponAllData { }; |
| | | if (temp == null) |
| | |
| | | if (topic == gatewayID + "/" + "Security/AddModeActon_Respon") |
| | | { |
| | | dateTime = DateTime.Now; |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | var modeId = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["ModeId"].ToString()); |
| | | var actionType = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["ActionType"].ToString()); |
| | | |
| | | if (result == 0) |
| | | { |
| | | security.addModeActonResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddModeActonResponData>(jobject["Data"].ToString()); |
| | | if (security.addModeActonResponData != null) |
| | | var addModeActonResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddModeActonResponData>(jobject["Data"].ToString()); |
| | | if (addModeActonResponData != null) |
| | | { |
| | | d = new AddModeActonResponAllData { addModeActonResponData = security.addModeActonResponData }; |
| | | d = new AddModeActonResponAllData { addModeActonResponData = addModeActonResponData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | } |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/AddModeActon_Actions 启动" + System.DateTime.Now.ToString()); |
| | | try{ |
| | | try |
| | | { |
| | | if (addModeActonData != null) |
| | | { |
| | | var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4007 } }; |
| | |
| | | /// 安防模式触发动作添加的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class AddModeActonResponAllData |
| | | public class AddModeActonResponAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 安防模式触发动作添加的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | d = new RemoveActionFromModeAllData {}; |
| | | if (temp == null) |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/RemoveActonFromMode_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | if (result == 0) |
| | | { |
| | | security.removeActonFromModeResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveActionFromModeResponData>(jobject["Data"].ToString()); |
| | | if (security.removeActonFromModeResponData != null) |
| | | var removeActonFromModeResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveActionFromModeResponData>(jobject["Data"].ToString()); |
| | | if (removeActonFromModeResponData != null) |
| | | { |
| | | d = new RemoveActionFromModeAllData { removeActonFromModeResponData = security.removeActonFromModeResponData }; |
| | | d = new RemoveActionFromModeAllData { removeActonFromModeResponData = removeActonFromModeResponData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | } |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/RemoveActonFromMode_Actions 启动" + System.DateTime.Now.ToString()); |
| | | try{ |
| | | try |
| | | { |
| | | if (removeActonFromModeData != null) |
| | | { |
| | | var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4008 } }; |
| | |
| | | mainGateway.Send(("Security/RemoveActonFromMode"), jObject.ToString()); |
| | | } |
| | | } |
| | | catch{ |
| | | catch |
| | | { |
| | | |
| | | } |
| | | |
| | |
| | | /// 将动作从布防模式中移除的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class RemoveActionFromModeAllData |
| | | public class RemoveActionFromModeAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 将动作从布防模式中移除的回复数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/GetModeList_Repon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.getModeListData = Newtonsoft.Json.JsonConvert.DeserializeObject<GetModeListData>(jobject["Data"].ToString()); |
| | | if (security.getModeListData == null) |
| | | var getModeListData = Newtonsoft.Json.JsonConvert.DeserializeObject<GetModeListData>(jobject["Data"].ToString()); |
| | | if (getModeListData == null) |
| | | { |
| | | d = new GetModeListAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | d = new GetModeListAllData { getModeListData = security.getModeListData }; |
| | | d = new GetModeListAllData { getModeListData = getModeListData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | } |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/GetModeList_Actions 启动" + System.DateTime.Now.ToString()); |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | { "Cluster_ID", 0 }, |
| | | { "Command", 4009 } |
| | | }; |
| | | mainGateway.Send("Security/GetModeList", jObject.ToString()); |
| | | |
| | | }catch{ } |
| | | } |
| | | catch { } |
| | | |
| | | var dateTime = DateTime.Now; |
| | | while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) |
| | |
| | | /// 获取布防模式列表返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class GetModeListAllData |
| | | public class GetModeListAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 获取布防模式列表返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | } |
| | | if (topic == gatewayID + "/" + "Security/GetModeInfoById_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | if (result == 0) |
| | | { |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/GetModeInfoById_Actions 启动" + System.DateTime.Now.ToString()); |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | { "Cluster_ID", 0 }, |
| | | { "Command", 4010 } |
| | |
| | | /// 通过布防模式ID查看模式信息的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class GetModeInfoByIdResponAllData |
| | | public class GetModeInfoByIdResponAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 通过布防模式ID查看模式信息返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/GetModeUsing_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | if (result == 0) |
| | | { |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/GetModeUsing_Actions 启动" + System.DateTime.Now.ToString()); |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | { "Cluster_ID", 0 }, |
| | | { "Command", 4011} |
| | |
| | | /// 查看当前正在使用的布防模式返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class GetModeUsingResponseAllData |
| | | public class GetModeUsingResponseAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 查看当前正在使用的布防模式返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | } |
| | | if (topic == gatewayID + "/" + "Security/EnableMode_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | var modeId = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["ModeId"].ToString()); |
| | | security.enableModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<EnableModeResponseData>(jobject["Data"].ToString()); |
| | | if (security.enableModeResponseData == null) |
| | | var enableModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<EnableModeResponseData>(jobject["Data"].ToString()); |
| | | if (enableModeResponseData == null) |
| | | { |
| | | d = new EnableModeResponAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | d = new EnableModeResponAllData { enableModeResponseData = security.enableModeResponseData }; |
| | | d = new EnableModeResponAllData { enableModeResponseData = enableModeResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | } |
| | |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/EnableMode_Actions 启动" + System.DateTime.Now.ToString()); |
| | | |
| | | try{ |
| | | try |
| | | { |
| | | if (enableModeData != null) |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | |
| | | /// 布防返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class EnableModeResponAllData |
| | | public class EnableModeResponAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 布防返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/WithdrawMode_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.withdrawModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<WithdrawModeResponseData>(jobject["Data"].ToString()); |
| | | if (security.withdrawModeResponseData == null) |
| | | var withdrawModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<WithdrawModeResponseData>(jobject["Data"].ToString()); |
| | | if (withdrawModeResponseData == null) |
| | | { |
| | | d = new WithdrawModeResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | d = new WithdrawModeResponseAllData { withdrawModeResponseData = security.withdrawModeResponseData }; |
| | | d = new WithdrawModeResponseAllData { withdrawModeResponseData = withdrawModeResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | } |
| | |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/WithdrawMode_Actions 启动" + System.DateTime.Now.ToString()); |
| | | |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | { "Cluster_ID", 0 }, |
| | | { "Command", 4013} |
| | |
| | | /// 撤防返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class WithdrawModeResponseAllData |
| | | public class WithdrawModeResponseAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 撤防返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | d = new RemoveModeResponseAllData { }; |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/RemoveMode_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.removeModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveModeResponseData>(jobject["Data"].ToString()); |
| | | if (security.removeModeResponseData == null) |
| | | var removeModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveModeResponseData>(jobject["Data"].ToString()); |
| | | if (removeModeResponseData == null) |
| | | { |
| | | d = new RemoveModeResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | d = new RemoveModeResponseAllData { removeModeResponseData = security.removeModeResponseData }; |
| | | d = new RemoveModeResponseAllData { removeModeResponseData = removeModeResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | } |
| | |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/RemoveMode_Actions 启动" + System.DateTime.Now.ToString()); |
| | | |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | { "Cluster_ID", 0 }, |
| | | { "Command", 4014} |
| | |
| | | /// 删除布防模式返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class RemoveModeResponseAllData |
| | | public class RemoveModeResponseAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 删除布防模式返回的数据 |
| | | /// </summary> |
| | |
| | | } |
| | | #endregion |
| | | |
| | | //#region 删除防区. |
| | | /////<summary > |
| | | ///// 删除防区.(仅用于主网关接口). |
| | | ///// </summary> |
| | | //public static async System.Threading.Tasks.Task<RemoveZoneResponseAllData> RemoveZoneAsync(int zoneId) |
| | | //{ |
| | | // return await System.Threading.Tasks.Task.Run(async () => |
| | | // { |
| | | // var d = new RemoveZoneResponseAllData { }; |
| | | // if (ZbGateway.MainGateWay == null) |
| | | // { |
| | | // d.errorMessageBase = "当前没有主网关"; |
| | | // return d; |
| | | // } |
| | | |
| | | // Action<string, string> action = (topic, message) => |
| | | // { |
| | | // var gatewayID = topic.Split('/')[0]; |
| | | // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); |
| | | |
| | | // if (topic == gatewayID + "/" + "Error_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; |
| | | // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | // if (temp == null) |
| | | // { |
| | | // d.errorMessageBase = "网关错误回复,且数据是空"; |
| | | // } |
| | | // else |
| | | // { |
| | | // d.errorResponData = temp; |
| | | // d.errorMessageBase = ErrorMess(temp.Error); |
| | | // } |
| | | // } |
| | | |
| | | // if (topic == gatewayID + "/" + "Security/RemoveZone_Respon") |
| | | // { |
| | | // var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = ZbGateway.MainGateWay.CurrentGateWayId }; |
| | | // var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | // if (result == 0) |
| | | // { |
| | | // security.removeZoneResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveZoneResponseData>(jobject["Data"].ToString()); |
| | | // if (security.removeZoneResponseData != null) |
| | | // { |
| | | // d.removeZoneResponseData = security.removeZoneResponseData; |
| | | // System.Console.WriteLine($"收到通知后的主题_{topic}"); |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // var r = new RemoveZoneResponseData(); |
| | | // r.Result = result; |
| | | // d.removeZoneResponseData = r; |
| | | // System.Console.WriteLine($"收到通知后的主题_{topic}"); |
| | | // } |
| | | // } |
| | | // }; |
| | | // ZbGateway.MainGateWay.Actions += action; |
| | | // System.Console.WriteLine("Security/RemoveZone_Actions 启动" + System.DateTime.Now.ToString()); |
| | | |
| | | // var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | // { "Cluster_ID", 0 }, |
| | | // { "Command", 4015} |
| | | // }; |
| | | // var data = new JObject |
| | | // { |
| | | // { "ZoneId", zoneId} |
| | | // }; |
| | | // jObject.Add("Data", data); |
| | | // ZbGateway.MainGateWay?.Send("Security/RemoveZone", jObject.ToString()); |
| | | |
| | | // var dateTime = DateTime.Now; |
| | | // while ((DateTime.Now - dateTime).TotalMilliseconds < 1000) |
| | | // { |
| | | // await System.Threading.Tasks.Task.Delay(10); |
| | | // if (d.removeZoneResponseData != null) |
| | | // { |
| | | // break; |
| | | // } |
| | | // } |
| | | // if ((DateTime.Now - dateTime).TotalMilliseconds > 10000) |
| | | // { |
| | | // d.errorMessageBase = " 回复超时,请重新操作"; |
| | | // } |
| | | // ZbGateway.MainGateWay.Actions -= action; |
| | | // System.Console.WriteLine("Security/RemoveZone_Actions 退出" + System.DateTime.Now.ToString()); |
| | | |
| | | // return d; |
| | | // }); |
| | | //} |
| | | |
| | | ///// <summary> |
| | | ///// 删除防区,网关反馈信息 |
| | | ///// </summary> |
| | | //public RemoveZoneResponseAllData removeZoneResponseAllData; |
| | | ///// <summary> |
| | | ///// 删除防区,网关反馈信息 |
| | | ///// </summary> |
| | | //[System.Serializable] |
| | | //public class RemoveZoneResponseAllData |
| | | //{ |
| | | // /// <summary> |
| | | // /// 错误信息 |
| | | // /// </summary> |
| | | // public string errorMessageBase; |
| | | // /// <summary> |
| | | // /// 网关信息错误反馈 |
| | | // /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | // /// </summary> |
| | | // public ErrorResponData errorResponData; |
| | | // /// <summary> |
| | | // /// 删除防区返回的数据 |
| | | // /// </summary> |
| | | // public RemoveZoneResponseData removeZoneResponseData; |
| | | |
| | | //} |
| | | |
| | | |
| | | ///// <summary> |
| | | ///// 删除防区返回的数据 |
| | | ///// </summary> |
| | | //public RemoveZoneResponseData removeZoneResponseData; |
| | | ///// <summary> |
| | | ///// 删除防区返回的数据 |
| | | ///// </summary> |
| | | //[System.Serializable] |
| | | //public class RemoveZoneResponseData |
| | | //{ |
| | | // /// <summary> |
| | | // /// 0:删除成功。 |
| | | // ///<para>1:失败,防区不存在。</para> |
| | | // /// </summary> |
| | | // public int Result = 999; |
| | | |
| | | // /// <summary> |
| | | // /// 防区id |
| | | // /// </summary> |
| | | // public int ZoneId; |
| | | // /// <summary> |
| | | // /// 防区名称,当Result=0时存在。 |
| | | // /// </summary> |
| | | // public string ZoneName; |
| | | //} |
| | | //#endregion |
| | | |
| | | #region *14将设备从防区中移除. |
| | | /// <summary> |
| | | /// *将设备从防区中移除(需要管理员权限). |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | d = new RemoveDeviceToZoneAllData { }; |
| | | if (temp == null) |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/RemoveEqToZone_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | if (result == 0) |
| | | { |
| | | security.removeDeviceToZoneResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveDeviceToZoneResponseData>(jobject["Data"].ToString()); |
| | | if (security.removeDeviceToZoneResponseData != null) |
| | | var removeDeviceToZoneResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveDeviceToZoneResponseData>(jobject["Data"].ToString()); |
| | | if (removeDeviceToZoneResponseData != null) |
| | | { |
| | | d = new RemoveDeviceToZoneAllData { removeDeviceToZoneResponseData = security.removeDeviceToZoneResponseData }; |
| | | d = new RemoveDeviceToZoneAllData { removeDeviceToZoneResponseData = removeDeviceToZoneResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | } |
| | |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine($"Security/RemoveEqToZone_Actions启动_{System.DateTime.Now.ToString()}"); |
| | | |
| | | try{ |
| | | try |
| | | { |
| | | if (removeEqToZoneData != null) |
| | | { |
| | | var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4016 } }; |
| | |
| | | /// 将设备从防区中移除的返回数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class RemoveDeviceToZoneAllData |
| | | public class RemoveDeviceToZoneAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 将设备从防区中移除的返回数据 |
| | | /// </summary> |
| | |
| | | // if (topic == gatewayID + "/" + "Error_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; |
| | | // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | // if (temp == null) |
| | | // { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | } |
| | | if (topic == gatewayID + "/" + "Security/GetZoneDeviceListById_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | if (result == 0) |
| | | { |
| | | security.getZoneDeviceListByIdResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<GetZoneDeviceListByIdResponData>(jobject["Data"].ToString()); |
| | | if (security.getZoneDeviceListByIdResponData != null) |
| | | var getZoneDeviceListByIdResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<GetZoneDeviceListByIdResponData>(jobject["Data"].ToString()); |
| | | if (getZoneDeviceListByIdResponData != null) |
| | | { |
| | | d = new GetZoneDeviceListByIdResponAllData { getZoneDeviceListByIdResponData = security.getZoneDeviceListByIdResponData }; |
| | | d = new GetZoneDeviceListByIdResponAllData { getZoneDeviceListByIdResponData = getZoneDeviceListByIdResponData }; |
| | | } |
| | | System.Console.WriteLine($"UI已收到通知的主题_{topic}"); |
| | | } |
| | |
| | | /// 通过布防模式ID查看模式信息的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class GetZoneDeviceListByIdResponAllData |
| | | public class GetZoneDeviceListByIdResponAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 通过布防模式ID查看模式信息返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | d = new ActionTestResponseAllData { }; |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/ActionTest_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.actionTestResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ActionTestResponseData>(jobject["Data"].ToString()); |
| | | if (security.actionTestResponseData != null) |
| | | var actionTestResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ActionTestResponseData>(jobject["Data"].ToString()); |
| | | if (actionTestResponseData != null) |
| | | { |
| | | d = new ActionTestResponseAllData { actionTestResponseData = security.actionTestResponseData }; |
| | | d = new ActionTestResponseAllData { actionTestResponseData = actionTestResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | |
| | | } |
| | |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine("Security/ActionTest_Actions 启动" + System.DateTime.Now.ToString()); |
| | | |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | { "Cluster_ID", 0 }, |
| | | { "Command", 4027} |
| | |
| | | /// 执行安防模式动作返回的数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class ActionTestResponseAllData |
| | | public class ActionTestResponseAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 执行安防模式动作返回的数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | d = new EqByPassAllData { }; |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/EqByPass_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | if (result == 0) |
| | | { |
| | | security.eqByPassResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<EqByPassResponseData>(jobject["Data"].ToString()); |
| | | if (security.eqByPassResponseData != null) |
| | | var eqByPassResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<EqByPassResponseData>(jobject["Data"].ToString()); |
| | | if (eqByPassResponseData != null) |
| | | { |
| | | d = new EqByPassAllData { eqByPassResponseData = security.eqByPassResponseData }; |
| | | d = new EqByPassAllData { eqByPassResponseData = eqByPassResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | } |
| | |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine($"Security/EqByPass_Actions启动_{System.DateTime.Now.ToString()}"); |
| | | |
| | | try{ |
| | | try |
| | | { |
| | | if (eqByPassData != null) |
| | | { |
| | | var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4029 } }; |
| | |
| | | /// 对防区安防设备进行旁路或撤销旁路的返回数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class EqByPassAllData |
| | | public class EqByPassAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 对防区安防设备进行旁路或撤销旁路的返回数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | d = new AddZoneActionAllData { }; |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/AddZoneAction_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.addZoneActionResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddZoneActionResponseData>(jobject["Data"].ToString()); |
| | | if (security.addZoneActionResponseData != null) |
| | | var addZoneActionResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddZoneActionResponseData>(jobject["Data"].ToString()); |
| | | if (addZoneActionResponseData != null) |
| | | { |
| | | d = new AddZoneActionAllData { addZoneActionResponseData = security.addZoneActionResponseData }; |
| | | d = new AddZoneActionAllData { addZoneActionResponseData = addZoneActionResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | }else{ |
| | | } |
| | | else |
| | | { |
| | | d = new AddZoneActionAllData { errorMessageBase = "网关回复数据是空" }; |
| | | } |
| | | } |
| | |
| | | jObject.Add("Data", data); |
| | | mainGateway.Send(("Security/AddZoneAction"), jObject.ToString()); |
| | | } |
| | | }catch{} |
| | | } |
| | | catch { } |
| | | var dateTime = DateTime.Now; |
| | | while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) |
| | | { |
| | |
| | | /// 添加防区报警目标的返回数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class AddZoneActionAllData |
| | | public class AddZoneActionAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 添加防区报警目标的返回数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | d = new DelZoneActionResposeAllData { }; |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/DelZoneAction_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.delZoneActionResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelZoneActionResponseData>(jobject["Data"].ToString()); |
| | | if (security.delZoneActionResponseData != null) |
| | | var delZoneActionResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelZoneActionResponseData>(jobject["Data"].ToString()); |
| | | if (delZoneActionResponseData != null) |
| | | { |
| | | d = new DelZoneActionResposeAllData { delZoneActionResponseData = security.delZoneActionResponseData }; |
| | | d = new DelZoneActionResposeAllData { delZoneActionResponseData = delZoneActionResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | else |
| | |
| | | jObject.Add("Data", data); |
| | | mainGateway.Send(("Security/DelZoneAction"), jObject.ToString()); |
| | | } |
| | | }catch{} |
| | | } |
| | | catch { } |
| | | |
| | | var dateTime = DateTime.Now; |
| | | while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) |
| | |
| | | /// 删除防区报警目标的返回数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class DelZoneActionResposeAllData |
| | | public class DelZoneActionResposeAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 删除防区报警目标的返回数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateWay.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/CatZoneAction_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateWay.CurrentGateWayId }; |
| | | security.catZoneActionResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CatZoneActionResponseData>(jobject["Data"].ToString()); |
| | | if (security.catZoneActionResponseData != null) |
| | | var catZoneActionResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CatZoneActionResponseData>(jobject["Data"].ToString()); |
| | | if (catZoneActionResponseData != null) |
| | | { |
| | | d = new CatZoneActionResposeAllData { catZoneActionResponseData = security.catZoneActionResponseData }; |
| | | d = new CatZoneActionResposeAllData { catZoneActionResponseData = catZoneActionResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | else |
| | |
| | | }; |
| | | mainGateWay.Actions += action; |
| | | System.Console.WriteLine($"Security/CatZoneAction_Actions启动_{System.DateTime.Now.ToString()}"); |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | { "Cluster_ID", 0 }, |
| | | { "Command", 4032 } |
| | |
| | | /// 查看防区报警目标的返回数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class CatZoneActionResposeAllData |
| | | public class CatZoneActionResposeAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 查看防区报警目标的返回数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | d = new SetCoercePhoneNumberAllResponseData { }; |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/AddZoneAction_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.setCoercePhoneNumberResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetCoercePhoneNumberResponseData>(jobject["Data"].ToString()); |
| | | if (security.setCoercePhoneNumberResponseData != null) |
| | | var setCoercePhoneNumberResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetCoercePhoneNumberResponseData>(jobject["Data"].ToString()); |
| | | if (setCoercePhoneNumberResponseData != null) |
| | | { |
| | | d = new SetCoercePhoneNumberAllResponseData { setCoercePhoneNumberResponseData = security.setCoercePhoneNumberResponseData }; |
| | | d = new SetCoercePhoneNumberAllResponseData { setCoercePhoneNumberResponseData = setCoercePhoneNumberResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | else |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine($"Security/AddZoneAction(设置胁迫状态下的电话号码)_Actions启动_{System.DateTime.Now.ToString()}"); |
| | | try{ |
| | | try |
| | | { |
| | | if (setCoercePhoneNumberData != null) |
| | | { |
| | | var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4030 } }; |
| | |
| | | /// 设置胁迫状态下被通知的联系号码的返回数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class SetCoercePhoneNumberAllResponseData |
| | | public class SetCoercePhoneNumberAllResponseData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 设置胁迫状态下被通知的联系号码的返回数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/Error_Respon") |
| | | { |
| | | var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | d = new DelCoercePhoneNumberAllResponseData { }; |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/DelZoneAction_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.delCoercePhoneNumberResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelCoercePhoneNumberResponseData>(jobject["Data"].ToString()); |
| | | if (security.delCoercePhoneNumberResponseData != null) |
| | | var delCoercePhoneNumberResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelCoercePhoneNumberResponseData>(jobject["Data"].ToString()); |
| | | if (delCoercePhoneNumberResponseData != null) |
| | | { |
| | | d = new DelCoercePhoneNumberAllResponseData { delCoercePhoneNumberResponseData = security.delCoercePhoneNumberResponseData }; |
| | | d = new DelCoercePhoneNumberAllResponseData { delCoercePhoneNumberResponseData = delCoercePhoneNumberResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | else |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine($"Security/AddZoneAction(删除胁迫状态下的电话号码)_Actions启动_{System.DateTime.Now.ToString()}"); |
| | | try{ |
| | | try |
| | | { |
| | | if (delCoercePhoneNumberData != null) |
| | | { |
| | | var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4031 } }; |
| | |
| | | /// 删除胁迫状态下被通知的联系号码的返回数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class DelCoercePhoneNumberAllResponseData |
| | | public class DelCoercePhoneNumberAllResponseData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 删除胁迫状态下被通知的联系号码的返回数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/CatZoneAction_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.checkCoercePhoneNumberResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CheckCoercePhoneNumberResponseData>(jobject["Data"].ToString()); |
| | | if (security.checkCoercePhoneNumberResponseData != null) |
| | | var checkCoercePhoneNumberResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CheckCoercePhoneNumberResponseData>(jobject["Data"].ToString()); |
| | | if (checkCoercePhoneNumberResponseData != null) |
| | | { |
| | | d = new CheckCoercePhoneNumberAllResponseData { checkCoercePhoneNumberResponseData = security.checkCoercePhoneNumberResponseData }; |
| | | d = new CheckCoercePhoneNumberAllResponseData { checkCoercePhoneNumberResponseData = checkCoercePhoneNumberResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | else |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine($"Security/CatZoneAction(查看胁迫状态下的电话号码)_Actions启动_{System.DateTime.Now.ToString()}"); |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4032 } }; |
| | | var actionsList = new JArray { }; |
| | | var data = new JObject |
| | |
| | | /// 查看胁迫状态下被通知的联系号码的返回数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class CheckCoercePhoneNumberAllResponseData |
| | | public class CheckCoercePhoneNumberAllResponseData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 查看胁迫状态下被通知的联系号码的返回数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/DisablePushMessage_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.disablePushMessageResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DisablePushMessageResponseData>(jobject["Data"].ToString()); |
| | | if (security.disablePushMessageResponseData != null) |
| | | var disablePushMessageResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DisablePushMessageResponseData>(jobject["Data"].ToString()); |
| | | if (disablePushMessageResponseData != null) |
| | | { |
| | | d = new DisablePushMessageResposeAllData { disablePushMessageResponseData = security.disablePushMessageResponseData }; |
| | | d = new DisablePushMessageResposeAllData { disablePushMessageResponseData = disablePushMessageResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | else |
| | |
| | | }; |
| | | mainGateway.Actions += action; |
| | | System.Console.WriteLine($"Security/DisablePushMessage_Actions启动_{System.DateTime.Now.ToString()}"); |
| | | try{ |
| | | try |
| | | { |
| | | var jObject = new Newtonsoft.Json.Linq.JObject() { |
| | | { "Cluster_ID", 0 }, |
| | | { "Command", 4034 } |
| | |
| | | /// 查看防区报警目标的返回数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class DisablePushMessageResposeAllData |
| | | public class DisablePushMessageResposeAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 查看防区报警目标的返回数据 |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Security/AdminLogOut_Respon") |
| | | { |
| | | var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; |
| | | security.adminLogOutResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AdminLogOutResponseData>(jobject["Data"].ToString()); |
| | | if (security.adminLogOutResponseData != null) |
| | | var adminLogOutResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AdminLogOutResponseData>(jobject["Data"].ToString()); |
| | | if (adminLogOutResponseData != null) |
| | | { |
| | | d = new AdminLogOutResposeAllData {adminLogOutResponseData = security.adminLogOutResponseData }; |
| | | d = new AdminLogOutResposeAllData { adminLogOutResponseData = adminLogOutResponseData }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | else |
| | |
| | | /// 退出管理员登陆的返回数据,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class AdminLogOutResposeAllData |
| | | public class AdminLogOutResposeAllData : CommonDevice.ErrorResponCommon |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 退出管理员登陆的返回数据 |
| | | /// </summary> |