| | |
| | | using 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 |
| | |
| | | BackgroundColor = 0x1F5C62FE, |
| | | BorderColor = CSS_Color.MainColor, |
| | | BorderWidth = 2, |
| | | Radius = 1, |
| | | }; |
| | | showDataTypeView.AddChidren(btnShowHistroyData_Day); |
| | | btnShowHistroyData_Day.SetCornerWithSameRadius((uint)Application.GetRealHeight(6), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft); |
| | |
| | | IsSelected = false, |
| | | BorderWidth = 1, |
| | | BorderColor = CSS_Color.PromptingColor1, |
| | | Radius = 1, |
| | | }; |
| | | showDataTypeView.AddChidren(btnShowHistroyData_Month); |
| | | btnShowHistroyData_Month.BorderWidth = 1; |
| | | btnShowHistroyData_Month.BorderColor = CSS_Color.PromptingColor1; |
| | | |
| | | var btnShowHistroyData_Year = new Button() |
| | | { |
| | |
| | | IsSelected = false, |
| | | BorderWidth = 1, |
| | | BorderColor = CSS_Color.PromptingColor1, |
| | | Radius = 1, |
| | | }; |
| | | showDataTypeView.AddChidren(btnShowHistroyData_Year); |
| | | btnShowHistroyData_Year.BorderWidth = 1; |
| | | btnShowHistroyData_Year.BorderColor = CSS_Color.PromptingColor1; |
| | | |
| | | var btnShowHistroyData_Total = new Button() |
| | | { |
| | |
| | | IsSelected = false, |
| | | BorderWidth = 1, |
| | | BorderColor = CSS_Color.PromptingColor1, |
| | | Radius = 1, |
| | | }; |
| | | showDataTypeView.AddChidren(btnShowHistroyData_Total); |
| | | btnShowHistroyData_Total.SetCornerWithSameRadius((uint)Application.GetRealHeight(6), HDLUtils.RectCornerBottomRight | HDLUtils.RectCornerTopRight); |
| | |
| | | btnShowHistroyData_Day.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Day.SelectedBackgroundColor = 0x00000000; |
| | | |
| | | #if __IOS__ |
| | | btnShowHistroyData_Day.SetCornerWithSameRadius((uint)Application.GetRealHeight(6), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft); |
| | | btnShowHistroyData_Total.SetCornerWithSameRadius((uint)Application.GetRealHeight(6), HDLUtils.RectCornerBottomRight | HDLUtils.RectCornerTopRight); |
| | | #endif |
| | | |
| | | }; |
| | | |
| | |
| | | btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Total.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000; |
| | | #if __IOS__ |
| | | btnShowHistroyData_Day.SetCornerWithSameRadius((uint)Application.GetRealHeight(6), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft); |
| | | btnShowHistroyData_Total.SetCornerWithSameRadius((uint)Application.GetRealHeight(6), HDLUtils.RectCornerBottomRight | HDLUtils.RectCornerTopRight); |
| | | #endif |
| | | |
| | | curQueryType = "hour"; |
| | | brokenLine.YvalueText = ""; |
| | |
| | | btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Total.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000; |
| | | #if __IOS__ |
| | | btnShowHistroyData_Day.SetCornerWithSameRadius((uint)Application.GetRealHeight(6), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft); |
| | | btnShowHistroyData_Total.SetCornerWithSameRadius((uint)Application.GetRealHeight(6), HDLUtils.RectCornerBottomRight | HDLUtils.RectCornerTopRight); |
| | | #endif |
| | | |
| | | curQueryType = "month"; |
| | | brokenLine.YvalueText = ""; |
| | |
| | | btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Total.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000; |
| | | #if __IOS__ |
| | | btnShowHistroyData_Day.SetCornerWithSameRadius((uint)Application.GetRealHeight(6), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft); |
| | | btnShowHistroyData_Total.SetCornerWithSameRadius((uint)Application.GetRealHeight(6), HDLUtils.RectCornerBottomRight | HDLUtils.RectCornerTopRight); |
| | | #endif |
| | | |
| | | |
| | | curQueryType = "year_month"; |
| | |
| | | #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(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | public static void UpdataStatus(Function updataTemp) |
| | | { |
| | | if (!updataTemp.online)//设备不在线不更新状态 |
| | | { |
| | | return; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |