| | |
| | | /// </summary> |
| | | public bool DownloadDataComplete = false; |
| | | |
| | | /// <summary> |
| | | /// token是否有效 |
| | | /// </summary> |
| | | public bool tokenInvalid = false; |
| | | |
| | | public bool hadInternet = true; |
| | | /// <summary> |
| | | /// 下载数据 |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"{this.GetType()}:加载缓存房间数据异常:{ex.Message}"); |
| | | MainPage.Log("Error",$"{this.GetType()}:加载缓存房间数据异常:{ex.StackTrace}"); |
| | | } |
| | | |
| | | try |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"{this.GetType()}:加载缓存设备数据异常:{ex.Message}"); |
| | | MainPage.Log("Error", $"{this.GetType()}:加载缓存设备数据异常:{ex.StackTrace}"); |
| | | } |
| | | |
| | | |
| | | return; |
| | | } |
| | | else |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"Error:下载数据1:{ex.Message}"); |
| | | MainPage.Log("Error", $"下载数据1:{ex.StackTrace}"); |
| | | DownloadDataComplete = true; |
| | | return; |
| | | } |
| | |
| | | MainPage.Log($"进入读取云端数据线程"); |
| | | //===================刷新Token======================= |
| | | code = Ins.HttpRequest.RefreshToken(); |
| | | |
| | | if (code != StateCode.SUCCESS) |
| | | { |
| | | if (waitPage != null) |
| | |
| | | { |
| | | var ssd = System.Text.Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(revData.list)); |
| | | FileUtlis.Files.WriteFileByBytes("SpatialInfoData", ssd); |
| | | }catch(Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"{this.GetType()}:保存房间信息异常:{ex.Message}"); |
| | | MainPage.Log("Error", $"{this.GetType()}:保存房间信息异常:{ex.StackTrace}"); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | |
| | | --i; |
| | | }catch(Exception ex) |
| | | { |
| | | MainPage.Log($"ios 全视通异常 : {ex.Message}"); |
| | | MainPage.Log("Error", $"ios 全视通异常 : {ex.StackTrace}"); |
| | | } |
| | | |
| | | #else |
| | |
| | | { |
| | | MainPage.Log($"读取云端设备数据失败:Code:{deviceResult.Code}; Msg:{deviceResult.message}"); |
| | | } |
| | | }catch (Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"============设备============{ex.Message}"); |
| | | MainPage.Log("Error", $"============设备============{ex.StackTrace}"); |
| | | } |
| | | finally |
| | | { |
| | | complateDevice = true; |
| | | MainPage.Log($"============设备============完成" + FunctionList.List.Functions.Count); |
| | | } |
| | | |
| | | |
| | | //======================群控==================== |
| | | if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"读取组控列表失败:{ex.Message}"); |
| | | MainPage.Log("Error", $"读取组控列表失败:{ex.StackTrace}"); |
| | | } |
| | | } |
| | | else |
| | |
| | | { |
| | | MainPage.Log($"读取云端场景数据失败:Code:{pack.Code}; Msg:{pack.message}"); |
| | | } |
| | | }catch(Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"===场景==={ex.Message}"); |
| | | MainPage.Log("Error", $"===场景==={ex.StackTrace}"); |
| | | } |
| | | finally |
| | | { |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"数据初始化失败:{ex.Message}"); |
| | | MainPage.Log("Error", $"数据初始化失败:{ex.StackTrace}"); |
| | | } |
| | | finally |
| | | { |
| | |
| | | try |
| | | { |
| | | FunctionList.List.Read3tyFunctionStatus(); |
| | | }catch(Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("读取第三方设备状态失败:"+ex.Message); |
| | | MainPage.Log("Error", "读取第三方设备状态失败:" + ex.StackTrace); |
| | | } |
| | | } |
| | | }); |
| | |
| | | { |
| | | if (DB_ResidenceData.Instance.CurrentRegion != null) |
| | | { |
| | | try |
| | | { |
| | | #region 读取本地数据 |
| | | //搜索网关 |
| | | DriverLayer.Control.Ins.SearchLoaclGateway(); |
| | | //重新连接mqtt |
| | | DAL.Mqtt.MqttClient.DisConnectRemote("刷新数据,重连mqtt",false); |
| | | #endregion |
| | | |
| | | } |
| | | catch (Exception ex){ |
| | | MainPage.Log("Error", $"读取本地数据异常:{ex.StackTrace}"); |
| | | } |
| | | } |
| | | } |
| | | }) |
| | |
| | | |
| | | } |
| | | } |
| | | |