From b562a582ac3a288193e6e4f57c5eff8a344305a4 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期五, 27 九月 2024 13:52:17 +0800
Subject: [PATCH] Update AndroidManifest.xml
---
HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 54 insertions(+), 4 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs
index 0fce218..c7b7676 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs
@@ -1,8 +1,13 @@
锘縰sing System;
using System.Collections.Generic;
+using System.Net;
+using HDL_ON.Common;
using HDL_ON.DAL.Server;
+using HDL_ON.DriverLayer;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
+using Newtonsoft.Json;
+//using OpenTK;
using Shared;
namespace HDL_ON.UI
@@ -573,11 +578,52 @@
#endregion
- new System.Threading.Thread(() =>
+ if (Control.Ins.GatewayOnline_Local == true)
{
- DriverLayer.Control.Ins.SendReadCommand(device);
- })
- { IsBackground = true }.Start();
+ new System.Threading.Thread(() =>
+ {
+ Control.Ins.SendReadCommand(device);
+ })
+ { IsBackground = true }.Start();
+ }
+ else
+ {
+ if (Control.Ins.GatewayOnline_Cloud)
+ {
+ new System.Threading.Thread(() =>
+ {
+ try
+ {
+ var deviceResult = ApiUtlis.Ins.HttpRequest.GetDeviceInfo(device.deviceId);
+
+ if (deviceResult != null)
+ {
+ if (deviceResult.Code == StateCode.SUCCESS)
+ {
+ if (deviceResult.Data != null)
+ {
+ var packList = JsonConvert.DeserializeObject<List<Function>>(deviceResult.Data.ToString());
+ if (packList != null)
+ {
+ if (packList.Count > 0)
+ {
+ if (packList[0].isOnline())
+ {
+ Control.Ins.SendReadCommand(device);
+ }
+ }
+ }
+ }
+ }
+ }
+ }catch(Exception ex)
+ {
+
+ }
+ })
+ { IsBackground = true }.Start();
+ }
+ }
@@ -715,6 +761,10 @@
/// </summary>
public static void UpdataStatus(Function updataTemp)
{
+ if (!updataTemp.online)//璁惧涓嶅湪绾夸笉鏇存柊鐘舵��
+ {
+ return;
+ }
Application.RunOnMainThread(() =>
{
try
--
Gitblit v1.8.0