| | |
| | | } |
| | | else |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | pm.RefreshToken();//刷新Token |
| | | pm.GetHomePager();//刷新住宅信息 |
| | | pm.GetUserInfo();//刷新个人信息 |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | //new System.Threading.Thread(() => |
| | | //{ |
| | | // var pm = new DAL.Server.HttpServerRequest(); |
| | | // pm.RefreshToken();//刷新Token |
| | | // pm.GetHomePager();//刷新住宅信息 |
| | | // pm.GetUserInfo();//刷新个人信息 |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | Common.ApiUtlis.Ins.DownloadData(); |
| | | |
| | | GoUserPage(true); |
| | | } |
| | |
| | | MainPage.Log($"GoUserPage : {ex.Message}"); |
| | | }finally |
| | | { |
| | | ///初始化app数据 |
| | | InitializationData(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | ///初始化app数据 |
| | | InitializationData(); |
| | | }); |
| | | } |
| | | }).Start(); |
| | | } |
| | |
| | | /// </summary> |
| | | public static void InitializationData() |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | while (true) |
| | | { |
| | | if (Entity.DB_ResidenceData.Instance == null )//|| Entity.DB_ResidenceData.residenceData.HomeGateway == null) |
| | | { |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | //System.Threading.Thread.Sleep(2000); |
| | | #region 读取云端数据-- |
| | | //todo数据覆盖处理 |
| | | //读取云端房间、楼层数据 |
| | | Entity.SpatialInfo.CurrentSpatial.DownloadRoomList(); |
| | | //读取云端设备数据 |
| | | Entity.FunctionList.List.DownloadFunctionList(); |
| | | //读取云端场景数据 |
| | | Entity.FunctionList.List.DownloadSceneList(); |
| | | //读取逻辑列表 |
| | | UI.UI2.Intelligence.Automation.MainView.GetLogicList(); |
| | | #endregion |
| | | //new System.Threading.Thread(() => |
| | | //{ |
| | | // int count = 0; |
| | | // while (count< 10) |
| | | // { |
| | | // if (Entity.DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull() )//|| Entity.DB_ResidenceData.residenceData.HomeGateway == null) |
| | | // { |
| | | // System.Threading.Thread.Sleep(200); |
| | | // } |
| | | // else |
| | | // { |
| | | // break; |
| | | // } |
| | | // count++; |
| | | // } |
| | | // if(Entity.DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull()) |
| | | // { |
| | | // return; |
| | | // } |
| | | // //System.Threading.Thread.Sleep(2000); |
| | | // #region 读取云端数据-- |
| | | // //todo数据覆盖处理 |
| | | // //读取云端房间、楼层数据 |
| | | // Entity.SpatialInfo.CurrentSpatial.DownloadRoomList(); |
| | | // //读取云端设备数据 |
| | | // Entity.FunctionList.List.DownloadFunctionList(); |
| | | // //读取云端场景数据 |
| | | // Entity.FunctionList.List.DownloadSceneList(); |
| | | // //读取逻辑列表 |
| | | // UI.UI2.Intelligence.Automation.MainView.GetLogicList(); |
| | | // #endregion |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | |
| | | #region 读取本地数据 |
| | | //读取音乐信息 |