| | |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 读取设备功能数据完成 |
| | | /// </summary> |
| | | bool complateDevice = false; |
| | | /// <summary> |
| | | /// 读取场景数据完成 |
| | | /// </summary> |
| | | bool complateScene = false; |
| | | |
| | | /// <summary> |
| | | /// 校验网关是否在线 |
| | | /// </summary> |
| | | public bool GatewayOnlineVerification() |
| | |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | |
| | | string code = StateCode.SUCCESS; |
| | | |
| | | Inverter.Ins.H5Page = null;//重置光伏页面 |
| | | |
| | | var downloadDataThread = new System.Threading.Thread(() => |
| | | { |
| | |
| | | { |
| | | 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) |
| | | { |
| | |
| | | deviceList.list.AddRange(deviceList2.list); |
| | | } |
| | | } |
| | | }catch(Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | finally |
| | | { |
| | | complateDevice = true; |
| | | } |
| | | |
| | | string delFile = ""; |
| | |
| | | { |
| | | 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) |
| | | { |
| | |
| | | { |
| | | 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(); |
| | | UI.UI2.Intelligence.Automation.MainView.GetLogicList(true); |
| | | |
| | | //===================读取可视对讲数据========================== |
| | | //判断是否有可视对讲数据,有则显示可视对讲icon |
| | |
| | | |
| | | //======================安防==================== |
| | | GetSecurityList(); |
| | | //======================注册推送==================== |
| | | httpRequest.RegisteredPush(); |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | while (endTime > DateTime.Now) |
| | | { |
| | | if (DownloadDataComplete) |
| | | if (DownloadDataComplete && complateDevice && complateScene) |
| | | { |
| | | break; |
| | | } |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | | if (!DownloadDataComplete) |
| | | { |
| | | //downloadDataThread.Abort(); |
| | | } |
| | | DownloadDataComplete = true; |
| | | Application.RunOnMainThread(() => |
| | |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | //初始化数据 |
| | | //SpatialInfo.CurrentSpatial.Clear(); |
| | | |
| | | } |
| | | catch { } |
| | | finally |
| | |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | |
| | | |
| | | |
| | | ////下载光伏数据 |
| | | //new System.Threading.Thread(() => { |
| | | // try |
| | | // {//00 |
| | | // HttpServerRequest http = new HttpServerRequest(); |
| | | // var packData = http.GetInverterList(); |
| | | // if (packData != null) |
| | | // { |
| | | // if (packData.Code == StateCode.SUCCESS) |
| | | // { |
| | | // var inverterList = JsonConvert.DeserializeObject<List<InverterInfo>>(packData.Data.ToString()); |
| | | // if (inverterList!= null) |
| | | // { |
| | | // FunctionList.List.InverterList = inverterList; |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // MainPage.Log($"读取光伏数据异常:{ex.Message}"); |
| | | // } |
| | | |
| | | //}) { IsBackground = true }.Start(); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |