From f12a70ac4639f6ea5de0b136d86cafd90af06eec Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 22 九月 2022 14:55:58 +0800 Subject: [PATCH] 光伏卡片数据显示 --- HDL_ON/Common/ApiUtlis.cs | 46 +++++++++++----------- HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 14 +++--- HDL_ON/Entity/FunctionList.cs | 19 +++++---- 3 files changed, 40 insertions(+), 39 deletions(-) diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs index 0b790f8..dba9d06 100644 --- a/HDL_ON/Common/ApiUtlis.cs +++ b/HDL_ON/Common/ApiUtlis.cs @@ -437,30 +437,30 @@ - //涓嬭浇鍏変紡鏁版嵁 - 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}"); - } + ////涓嬭浇鍏変紡鏁版嵁 + //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(); + //}) { IsBackground = true }.Start(); diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index c1b9c0c..398fb08 100644 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -126,16 +126,17 @@ /// <summary> /// 鍏変紡鍒楄〃 /// </summary> - public List<InverterInfo> InverterList + public List<Function> InverterList() { - get - { - return _inverterList; - } - set - { - _inverterList = value; - } + //get + //{ + // return _inverterList; + //} + //set + //{ + // _inverterList = value; + //} + return Functions.FindAll((obj) => obj.spk == SPK.Inverter); } #region 瀹剁數鍒楄〃 electricals /// <summary> diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs index 5b6cfd4..0df5996 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs @@ -1122,7 +1122,7 @@ //鍏変紡鏁版嵁 - if (FunctionList.List.InverterList.Count > 0 ) + if (FunctionList.List.InverterList().Count > 0 ) { FrameLayout inverterListView = new FrameLayout() { @@ -1170,26 +1170,26 @@ Button btnFunctionCount = new Button() { - X = Application.GetRealWidth(17) + Application.GetRealWidth(7 * FunctionList.List.InverterList.Count.ToString().Length), + X = Application.GetRealWidth(17) + Application.GetRealWidth(7 * FunctionList.List.InverterList().Count.ToString().Length), Y = btnName.Bottom, Width = Application.GetRealWidth(120), Height = Application.GetRealHeight(24), TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextAlignment = TextAlignment.CenterLeft, - Text = "/" + FunctionList.List.InverterList.Count, + Text = "/" + FunctionList.List.InverterList().Count, }; inverterListView.AddChidren(btnFunctionCount); Button btnOpenCount = new Button() { X = Application.GetRealWidth(16), Y = btnName.Bottom, - Width = Application.GetRealWidth(14 * FunctionList.List.InverterList.Count.ToString().Length), + Width = Application.GetRealWidth(14 * FunctionList.List.InverterList().Count.ToString().Length), Height = Application.GetRealHeight(24), TextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextAlignment = TextAlignment.CenterLeft, - Text = FunctionList.List.InverterList.Count.ToString(), + Text = FunctionList.List.InverterList().Count.ToString(), Tag = "inverter_onCount", BorderWidth = 0, }; @@ -1314,7 +1314,7 @@ } var function = new Function(); function.sid = data["sid"].ToString(); - var inObj = FunctionList.List.InverterList.Find((obj) => obj.sid == function.sid); + var inObj = FunctionList.List.InverterList().Find((obj) => obj.sid == function.sid); if (inObj == null) { return; @@ -1346,7 +1346,7 @@ Application.RunOnMainThread(() => { btnPowerTenerationToday.Text = Language.StringByID(StringId.PowerTenerationToday).Replace("----", info.totalElectricityPvToday); - btnWorkingMode.Text = Language.StringByID(StringId.WorkingMode).Replace("----", info.systemStatus); + btnWorkingMode.Text = Language.StringByID(StringId.WorkingMode).Replace("----", info.workMode); btnCurrentPowerGeneration.Text = Language.StringByID(StringId.CurrentPowerGeneration).Replace("----", info.powerPvNow); btnBatterySOC.Text = Language.StringByID(StringId.BatterySOC).Replace("--", info.batterySoc); }); -- Gitblit v1.8.0