| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using HDL_ON.DAL.Mqtt; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI; |
| | |
| | | HomePage.LoadEvent_CheckLinkStatus(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MainPage.Log($"状态一致,不更新数据(本地)"); |
| | | } |
| | | } |
| | | } |
| | | bool _GatewayOnline_Cloud = false; |
| | |
| | | MainPage.Log($"网关云端在线,刷新设备状态"); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(1000); |
| | | int count = 20; |
| | | while (true) |
| | | { |
| | | System.Threading.Thread.Sleep(500); |
| | | if (MqttClient.isSubscribeSuccess || count<1) |
| | | { |
| | | break; |
| | | } |
| | | count--; |
| | | } |
| | | FunctionList.List.ReadAllFunctionStatus(); |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.AboveNormal }.Start(); |
| | |
| | | //修改主页连接状态 |
| | | HomePage.LoadEvent_CheckLinkStatus(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MainPage.Log($"状态一致,不更新数据(云端)"); |
| | | } |
| | | }catch(Exception ex) |
| | | { |
| | |
| | | } |
| | | else if (MainPage.InternetStatus == 2) |
| | | { |
| | | DAL.Mqtt.MqttClient.InitState(); |
| | | OpenUdp(DB_ResidenceData.Instance.GatewayType == 0 ? 6000 : 8585); |
| | | //重置搜索网关标志 |
| | | IsSearchLocalGatewaySuccessful = false; |
| | |
| | | System.Threading.Thread.Sleep(500); |
| | | } |
| | | |
| | | DAL.Mqtt.MqttClient.InitState(); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |