wxr
2022-09-30 88a66f8374d63fbe9403258a9faa0fdcacf96571
HDL_ON/Common/ApiUtlis.cs
@@ -43,6 +43,15 @@
            }
        }
        /// <summary>
        /// 读取设备功能数据完成
        /// </summary>
        bool complateDevice = false;
        /// <summary>
        /// 读取场景数据完成
        /// </summary>
        bool complateScene = false;
        /// <summary>
        /// 校验网关是否在线
        /// </summary>
        public bool GatewayOnlineVerification()
@@ -152,7 +161,13 @@
                    {
                        MainPage.Log($"读取房间数据失败:Code:{roomResult.Code}; msg:{roomResult.message}");
                    }
                    //===================设备=======================
                    new System.Threading.Thread(() =>
                    {
                        try
                        {
                            complateDevice = false;
                    var deviceResult = Ins.HttpRequest.GetDeviceList("30","1");
                    if (deviceResult.Code == StateCode.SUCCESS)
                    {
@@ -177,9 +192,14 @@
                                    deviceList.list.AddRange(deviceList2.list);
                                }
                            }
                        }catch(Exception ex)
                                }
                                catch (Exception ex)
                        {
                                }
                                finally
                                {
                                    complateDevice = true;
                        }
                        string delFile = "";
@@ -218,8 +238,23 @@
                    {
                        MainPage.Log($"读取云端设备数据失败:Code:{deviceResult.Code};  Msg:{deviceResult.message}");
                    }
                        }catch (Exception ex)
                        {
                            MainPage.Log($"============设备============{ex.Message}");
                        }
                        finally
                        {
                            complateDevice = true;
                        }
                    })
                    { IsBackground = true }.Start();
                    //===================场景==========================
                    new System.Threading.Thread(() =>
                    {
                        try
                        {
                            complateScene = true;
                    var pack = Ins.HttpRequest.GetSceneList();
                    if (pack.Code == StateCode.SUCCESS)
                    {
@@ -271,6 +306,16 @@
                    {
                        MainPage.Log($"读取云端场景数据失败:Code:{pack.Code}; Msg:{pack.message}");
                    }
                        }catch(Exception ex)
                        {
                            MainPage.Log($"===场景==={ex.Message}");
                        }
                        finally
                        {
                            complateScene = true;
                        }
                    })
                    { IsBackground = true }.Start();
                    //===================读取逻辑列表==========================
                    UI.UI2.Intelligence.Automation.MainView.GetLogicList();
@@ -400,10 +445,6 @@
                        }
                        System.Threading.Thread.Sleep(100);
                    }
                    if (!DownloadDataComplete)
                    {
                        //downloadDataThread.Abort();
                    }
                    DownloadDataComplete = true;
                    Application.RunOnMainThread(() =>
                    {
@@ -413,9 +454,6 @@
                            waitPage = null;
                        }
                    });
                    //初始化数据
                    //SpatialInfo.CurrentSpatial.Clear();
                }
                catch { }
                finally