| | |
| | | } |
| | | set |
| | | { |
| | | if (_GatewayOnline_Cloud != value) |
| | | try |
| | | { |
| | | _GatewayOnline_Cloud = value; |
| | | if (GatewayOnline_Local) |
| | | if (_GatewayOnline_Cloud != value) |
| | | { |
| | | return; |
| | | } |
| | | if (value) |
| | | { |
| | | if (DB_ResidenceData.Instance.HomeGateway == null) |
| | | _GatewayOnline_Cloud = value; |
| | | if (GatewayOnline_Local) |
| | | { |
| | | return; |
| | | } |
| | | if (!DB_ResidenceData.Instance.HomeGateway.gatewayStatus)//远程情况下,网关未链接服务器不能修改主页网关状态 |
| | | if (value) |
| | | { |
| | | if (DB_ResidenceData.Instance.HomeGateway == null) |
| | | { |
| | | return; |
| | | } |
| | | if (!DB_ResidenceData.Instance.HomeGateway.gatewayStatus)//远程情况下,网关未链接服务器不能修改主页网关状态 |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(3000); |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | pm.GetGatewayInfo(); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | return; |
| | | } |
| | | //修改主页连接状态 |
| | | HomePage.LoadEvent_CheckLinkStatus(); |
| | | MainPage.Log($"网关云端在线,刷新设备状态"); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(3000); |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | pm.GetGatewayInfo(); |
| | | System.Threading.Thread.Sleep(1000); |
| | | FunctionList.List.ReadAllFunctionStatus(); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | return; |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.AboveNormal }.Start(); |
| | | } |
| | | //修改主页连接状态 |
| | | HomePage.LoadEvent_CheckLinkStatus(); |
| | | MainPage.Log($"网关云端在线,刷新设备状态"); |
| | | new System.Threading.Thread(() => |
| | | else |
| | | { |
| | | System.Threading.Thread.Sleep(1000); |
| | | FunctionList.List.ReadAllFunctionStatus(); |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.AboveNormal }.Start(); |
| | | //修改主页连接状态 |
| | | HomePage.LoadEvent_CheckLinkStatus(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //修改主页连接状态 |
| | | HomePage.LoadEvent_CheckLinkStatus(); |
| | | } |
| | | }catch(Exception ex) |
| | | { |
| | | MainPage.Log($"Set GatewayCloudOnline Error:{ex.Message}"); |
| | | } |
| | | } |
| | | } |