wei
2020-12-23 e0b8a7e79691d6187e4ea01a5cdd1f8802f8b00c
HDL_ON/UI/MainPage.cs
@@ -109,14 +109,15 @@
                    }
                    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);
                    }
@@ -226,8 +227,11 @@
                    MainPage.Log($"GoUserPage : {ex.Message}");
                }finally
                {
                    ///初始化app数据
                    InitializationData();
                    Application.RunOnMainThread(() =>
                    {
                        ///初始化app数据
                        InitializationData();
                    });
                }
            }).Start();
        }
@@ -237,34 +241,40 @@
        /// </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 读取本地数据
            //读取音乐信息