| | |
| | | }; |
| | | functionView.AddChidren(btnName); |
| | | |
| | | if (item != ShowFunction.FreshAir && functionCount != 0) |
| | | if (functionCount != 0) |
| | | { |
| | | Button btnFunctionCount = new Button() |
| | | { |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = "/" + functionCount, |
| | | }; |
| | | functionView.AddChidren(btnFunctionCount); |
| | | |
| | | Button btnOpenCount = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnName.Bottom, |
| | | Width = Application.GetRealWidth(14 * functionCount.ToString().Length), |
| | | Height = Application.GetRealHeight(24), |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = functionOnCount.ToString(), |
| | | Tag = item + "_onCount", |
| | | BorderWidth = 0, |
| | | }; |
| | | functionView.AddChidren(btnOpenCount); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | var skipView = new FunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(functionPageTitleId); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | index++; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | void refreshInverterInfo(Button btnPowerTenerationToday, Button btnWorkingMode, Button btnCurrentPowerGeneration) |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var http = new HttpServerRequest(); |
| | | var pack = http.GetInverterStatisticsInfo(); |
| | | if (pack != null) |
| | | { |
| | | if(pack.Data == null) |
| | | { |
| | | return; |
| | | } |
| | | var info = JsonConvert.DeserializeObject<StatisticsInfo>(pack.Data?.ToString()); |
| | | if (info == null) |
| | | { |
| | | return; |
| | | } |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnPowerTenerationToday.Text = info.totalElectricityPvToday + "kW·h";// Language.StringByID(StringId.PowerTenerationToday).Replace("----", info.totalElectricityPvToday); |
| | | string workModeString = ""; |
| | | if (Language.CurrentLanguage == "Chinese") { |
| | | switch (info.workMode) |
| | | { |
| | | case "self_use": |
| | | workModeString = "自发自用"; |
| | | break; |
| | | case "peak_load_shifting": |
| | | workModeString = "削峰填谷"; |
| | | break; |
| | | case "battery_priority": |
| | | workModeString = "电池优先"; |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | switch (info.workMode) |
| | | { |
| | | case "self_use": |
| | | workModeString = "Self Consume"; |
| | | break; |
| | | case "peak_load_shifting": |
| | | workModeString = "Peak Shift"; |
| | | break; |
| | | case "battery_priority": |
| | | workModeString = "Battery Priority"; |
| | | break; |
| | | } |
| | | } |
| | | btnWorkingMode.Text = workModeString;// Language.StringByID(StringId.WorkingMode).Replace("----", workModeString); |
| | | btnCurrentPowerGeneration.Text = info.powerPvNow + "w";// Language.StringByID(StringId.CurrentPowerGeneration).Replace("----", info.powerPvNow); |
| | | //btnBatterySOC.Text = Language.StringByID(StringId.BatterySOC).Replace("--", info.batterySoc); |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"获取家庭光伏统计数据异常:{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | #region 切换楼层 |
| | | /// <summary> |