| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | |
| | | /// </summary> |
| | | Button pvGeneration_MonthValuesButton; |
| | | /// <summary> |
| | | /// 光伏本年发电量数据按钮 |
| | | /// 光伏实时用电功率数据按钮 |
| | | /// </summary> |
| | | Button pvGeneration_YearValuesButton; |
| | | Button loadElec_ValuesButton; |
| | | /// <summary> |
| | | /// 光伏状态今日用电量数据按钮 |
| | | /// </summary> |
| | | Button loadElec_TodayTextButton; |
| | | /// <summary> |
| | | /// 光伏状态本月用电量数据按钮 |
| | | /// </summary> |
| | | Button loadElec_MonthValuesButton; |
| | | /// <summary> |
| | | /// 储能运行状态信息区域 |
| | | /// </summary> |
| | | FrameLayout esStatus_InfoView; |
| | | /// <summary> |
| | | /// 储能运行状态图标按钮 |
| | | /// </summary> |
| | | Button esRunStatus_Info_IconButton; |
| | | /// <summary> |
| | | /// 储能运行状态文本按钮 |
| | | /// </summary> |
| | | Button esRunStatus_Info_TextButton; |
| | | /// <summary> |
| | | /// 储能电池状态图标按钮 |
| | | /// </summary> |
| | | Button esRunStatus_BatteryIconButton; |
| | | /// <summary> |
| | | /// 储能电池状态百分比按钮 |
| | | /// </summary> |
| | | Button esRunStatus_BatteryValuesButton; |
| | | /// <summary> |
| | | /// 储能实时充电功率 |
| | | /// </summary> |
| | | Button esRunStatus_ChargeValuesButton; |
| | | /// <summary> |
| | | /// 储能实时放电功率 |
| | | /// </summary> |
| | | Button esRunStatus_DischargeValuesButton; |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | Button socialContribution_Info1_ValuesButton; |
| | | /// <summary> |
| | | /// </summary> |
| | | Button socialContribution_Info1_UintButton; |
| | | /// <summary> |
| | | /// </summary> |
| | | Button socialContribution_Info2_ValuesButton; |
| | | /// <summary> |
| | | /// </summary> |
| | | Button socialContribution_Info2_UintButton; |
| | | /// <summary> |
| | | /// </summary> |
| | | Button socialContribution_Info3_UintButton; |
| | | /// <summary> |
| | | /// </summary> |
| | | Button socialContribution_Info3_ValuesButton; |
| | | |
| | | |
| | | public InverterJinmaoPage() |
| | |
| | | |
| | | #if __IOS__ |
| | | pvGenerate_TodayValuesButton.TextAlignment = TextAlignment.TopLeft; |
| | | pvGenerate_TodayValuesButton.Width = pvGenerate_TodayValuesButton.GetTextWidth() + Application.GetRealWidth(4); |
| | | pvGenerate_TodayValuesButton.Width = pvGenerate_TodayValuesButton.GetTextWidth() + Application.GetRealWidth(6); |
| | | #else |
| | | pvGenerate_TodayValuesButton.TextAlignment = TextAlignment.BottomLeft; |
| | | pvGenerate_TodayValuesButton.Y = Application.GetRealWidth(37); |
| | |
| | | Y = Application.GetRealWidth(20), |
| | | Width = Application.GetRealWidth(151), |
| | | Height = Application.GetRealWidth(151), |
| | | BackgroundImagePath = "FunctionIcon/Acst/Inverter/PvBgRun.png" |
| | | }; |
| | | pvEleGenerationInfoView.AddChidren(powerGenerationView); |
| | | |
| | | var powerGenerationBg = new Button() |
| | | { |
| | | UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvBgRun.png" |
| | | }; |
| | | powerGenerationView.AddChidren(powerGenerationBg); |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | int index = 1; |
| | | while (index < 361) |
| | | { |
| | | if (function.GetAttrState(InverterJinmao_AttrEnum.pv_power.ToString()) == "0") |
| | | { |
| | | continue; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | powerGenerationBg.SetRotation(1f * index++); |
| | | }); |
| | | System.Threading.Thread.Sleep(50); |
| | | if (index == 361) |
| | | { |
| | | index = 1; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂UI控件旋转异常:{ex.Message}"); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | #endregion |
| | | |
| | | #region 光伏发电量 |
| | |
| | | #endregion |
| | | |
| | | #region 光伏本年发电量 |
| | | pvGeneration_YearValuesButton = new Button() |
| | | var pvGeneration_YearValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16 + 212), |
| | | Y = Application.GetRealWidth(191), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(24), |
| | | Text = function.GetAttrState(InverterJinmao_AttrEnum.pv_electricity.ToString()), |
| | | Text = "---", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 18, |
| | |
| | | Y = Application.GetRealWidth(220), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "累计发电量 (kw)", |
| | | Text = "本年发电量 (kw)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | | }; |
| | | pvEleGenerationInfoView.AddChidren(powerGeneration_YearTextButton); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var revertObj = new HttpServerRequest().GetSensorHistory("custom_year", |
| | | function.deviceId, InverterJinmao_AttrEnum.load_electricity.ToString(), DateTime.Now.Year.ToString()); |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EnvironmentalSensorHistor>>(revertObj.Data.ToString()); |
| | | double totalValues = 0.0; |
| | | double values = 0.0; |
| | | foreach (var data in revertData) |
| | | { |
| | | double.TryParse(data.fieldValue, out values); |
| | | totalValues += values; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | pvGeneration_YearValuesButton.Text = totalValues.ToString(); |
| | | while (true) |
| | | { |
| | | if (pvGeneration_YearValuesButton.Width < pvGeneration_YearValuesButton.GetTextWidth()) |
| | | { |
| | | pvGeneration_YearValuesButton.TextSize--; |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", "读取金茂本年发电量数据异常:" + ex.Message); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | contentView.AddChidren(new Button() |
| | |
| | | Y = Application.GetRealWidth(20), |
| | | Width = Application.GetRealWidth(151), |
| | | Height = Application.GetRealWidth(151), |
| | | BackgroundImagePath = "FunctionIcon/Acst/Inverter/PvBgDischarge.png" |
| | | }; |
| | | electricityUsageStatusView.AddChidren(powerUsageView); |
| | | |
| | | var powerUsage_ValuesButton = new Button() |
| | | var powerUsageBg = new Button() |
| | | { |
| | | UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvBgDischarge.png" |
| | | }; |
| | | powerUsageView.AddChidren(powerUsageBg); |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | int index = 1; |
| | | while (index < 361) |
| | | { |
| | | if (function.GetAttrState(InverterJinmao_AttrEnum.load_active_power.ToString()) == "0") |
| | | { |
| | | continue; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | powerUsageBg.SetRotation(1f * index++); |
| | | }); |
| | | System.Threading.Thread.Sleep(50); |
| | | if (index == 361) |
| | | { |
| | | index = 1; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂UI控件旋转异常2:{ex.Message}"); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | loadElec_ValuesButton = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(46), |
| | |
| | | TextSize = 24, |
| | | IsBold = true, |
| | | }; |
| | | powerUsageView.AddChidren(powerUsage_ValuesButton); |
| | | powerUsageView.AddChidren(loadElec_ValuesButton); |
| | | |
| | | var powerUsage_TextButton = new Button() |
| | | { |
| | |
| | | }; |
| | | electricityUsageStatusView.AddChidren(powerUsage_TodayValuesButton); |
| | | |
| | | var powerUsage_TodayTextButton = new Button() |
| | | loadElec_TodayTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(220), |
| | |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | | }; |
| | | electricityUsageStatusView.AddChidren(powerUsage_TodayTextButton); |
| | | electricityUsageStatusView.AddChidren(loadElec_TodayTextButton); |
| | | |
| | | |
| | | var powerUsage_MonthValuesButton = new Button() |
| | | loadElec_MonthValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16 + 105), |
| | | Y = Application.GetRealWidth(191), |
| | |
| | | TextSize = 18, |
| | | IsBold = true, |
| | | }; |
| | | electricityUsageStatusView.AddChidren(powerUsage_MonthValuesButton); |
| | | electricityUsageStatusView.AddChidren(loadElec_MonthValuesButton); |
| | | |
| | | var powerUsage_MonthTextButton = new Button() |
| | | { |
| | |
| | | }; |
| | | contentView.AddChidren(esStatusView); |
| | | |
| | | var esStatus_InfoView = new FrameLayout() |
| | | esStatus_InfoView = new FrameLayout() |
| | | { |
| | | X = 0 - Application.GetRealWidth(14), |
| | | Y = Application.GetRealWidth(12), |
| | |
| | | }; |
| | | esStatusView.AddChidren(esStatus_InfoView); |
| | | |
| | | var esRunStatus_Info_IconButton = new Button() |
| | | esRunStatus_Info_IconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 14), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | }; |
| | | esStatus_InfoView.AddChidren(esRunStatus_Info_IconButton); |
| | | |
| | | var esRunStatus_Info_TextButton = new Button() |
| | | esRunStatus_Info_TextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 14 + 4 + 12), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | |
| | | }; |
| | | esStatus_InfoView.AddChidren(esRunStatus_Info_TextButton); |
| | | |
| | | var esRunStatus_BatteryValuesButton = new Button() |
| | | esRunStatus_BatteryValuesButton = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(18), |
| | | Height = Application.GetRealWidth(17), |
| | |
| | | TextSize = 12, |
| | | TextColor = 0xFF00C22D, |
| | | }; |
| | | #if __IOS__ |
| | | esRunStatus_BatteryValuesButton.Width = esRunStatus_BatteryValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | esRunStatus_BatteryValuesButton.Width = esRunStatus_BatteryValuesButton.GetTextWidth(); |
| | | #endif |
| | | esRunStatus_BatteryValuesButton.X = Application.GetRealWidth(343 - 12) - esRunStatus_BatteryValuesButton.Width; |
| | | esStatusView.AddChidren(esRunStatus_BatteryValuesButton); |
| | | |
| | | var esRunStatus_BatteryIconButton = new Button() |
| | | esRunStatus_BatteryIconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 12 - 20) - esRunStatus_BatteryValuesButton.Width, |
| | | Y = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(20), |
| | | Height = Application.GetRealWidth(20), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconCharg.png", |
| | | SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconCharg100.png", |
| | | IsSelected = esRunStatus_BatteryValuesButton.Text == "100%" |
| | | }; |
| | | esStatusView.AddChidren(esRunStatus_BatteryIconButton); |
| | | |
| | |
| | | }; |
| | | esRunStatus_ValuesInfoView.AddChidren(esRunStatus_ChargeValuesView); |
| | | |
| | | var esRunStatus_ChargeValuesButton = new Button() |
| | | esRunStatus_ChargeValuesButton = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(32), |
| | |
| | | esRunStatus_ChargeValuesView.AddChidren(esRunStatus_ChargeTextButton); |
| | | #endregion |
| | | |
| | | #region 实时放电功率 |
| | | #region 实时用电功率 |
| | | var esRunStatus_DischargeValuesView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(132+13), |
| | |
| | | }; |
| | | esRunStatus_ValuesInfoView.AddChidren(esRunStatus_DischargeValuesView); |
| | | |
| | | var esRunStatus_DischargeValuesButton = new Button() |
| | | esRunStatus_DischargeValuesButton = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(32), |
| | |
| | | }; |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_IconButton); |
| | | |
| | | var socialContribution_Info1_ValuesButton = new Button() |
| | | socialContribution_Info1_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(68), |
| | |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_ValuesButton); |
| | | |
| | | var socialContribution_Info1_UintButton = new Button() |
| | | socialContribution_Info1_UintButton = new Button() |
| | | { |
| | | X = socialContribution_Info1_ValuesButton.Right - Application.GetRealWidth(4), |
| | | Y = Application.GetRealWidth(68), |
| | |
| | | }; |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_IconButton); |
| | | |
| | | var socialContribution_Info2_ValuesButton = new Button() |
| | | socialContribution_Info2_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(68), |
| | |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_ValuesButton); |
| | | |
| | | var socialContribution_Info2_UintButton = new Button() |
| | | socialContribution_Info2_UintButton = new Button() |
| | | { |
| | | X = socialContribution_Info2_ValuesButton.Right - Application.GetRealWidth(4), |
| | | Y = Application.GetRealWidth(68), |
| | |
| | | }; |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_IconButton); |
| | | |
| | | var socialContribution_Info3_ValuesButton = new Button() |
| | | socialContribution_Info3_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(68), |
| | |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_ValuesButton); |
| | | |
| | | var socialContribution_Info3_UintButton = new Button() |
| | | socialContribution_Info3_UintButton = new Button() |
| | | { |
| | | X = socialContribution_Info3_ValuesButton.Right - Application.GetRealWidth(4), |
| | | Y = Application.GetRealWidth(68), |
| | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | Control.Ins.SendReadCommand(function); |
| | | } |
| | | /// <summary> |
| | | /// 更新界面数据 |
| | |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | /// 更新今日发电量 |
| | | if (function.GetAttrState(InverterJinmao_AttrEnum.pv_electricity_today.ToString()) != temp.GetAttrState(InverterJinmao_AttrEnum.pv_electricity_today.ToString())) |
| | | { |
| | | upatePvGenerateTodayValues(); |
| | | } |
| | | /// 更新累计发电量 |
| | | if (function.GetAttrState(InverterJinmao_AttrEnum.pv_electricity.ToString()) != temp.GetAttrState(InverterJinmao_AttrEnum.pv_electricity.ToString())) |
| | | { |
| | | upatePvGenerateTotalValues(); |
| | | } |
| | | /// 更新今日用电量 |
| | | if (function.GetAttrState(InverterJinmao_AttrEnum.load_electricity_today.ToString()) != temp.GetAttrState(InverterJinmao_AttrEnum.load_electricity_today.ToString())) |
| | | { |
| | | upatePvLoadTodayValues(); |
| | | } |
| | | /// 更新累计用电量 |
| | | if (function.GetAttrState(InverterJinmao_AttrEnum.load_electricity.ToString()) != temp.GetAttrState(InverterJinmao_AttrEnum.load_electricity.ToString())) |
| | | { |
| | | upatePvLoadTotalValues(); |
| | | } |
| | | /// 更新光伏运行状态 |
| | | if (function.GetAttrState(InverterJinmao_AttrEnum.system_status.ToString()) != temp.GetAttrState(InverterJinmao_AttrEnum.system_status.ToString())) |
| | | { |
| | | upatePvRunStatus(); |
| | | } |
| | | /// 更新光伏发电功能 |
| | | if (function.GetAttrState(InverterJinmao_AttrEnum.pv_power.ToString()) != temp.GetAttrState(InverterJinmao_AttrEnum.pv_power.ToString())) |
| | | { |
| | | upatePvPower(); |
| | | } |
| | | /// 更新光伏发电功率 |
| | | updatePvPower(); |
| | | /// 更新光伏本月发电量 |
| | | if (function.GetAttrState(InverterJinmao_AttrEnum.pv_electricity_month.ToString()) != temp.GetAttrState(InverterJinmao_AttrEnum.pv_electricity_month.ToString())) |
| | | { |
| | | upatePvGenerateMonthValues(); |
| | | /// 更新光伏用电功率 |
| | | updateLoadElec(); |
| | | ///更新光伏状态本月用电量 |
| | | updateLoadElecMonthValues(); |
| | | //更新储能运行状态 |
| | | updateEsRunStates(); |
| | | //更新储能电池百分比 |
| | | updateEsBatterySoc(); |
| | | //更新储能实时充电状态 |
| | | updateEsCharge(); |
| | | //更新储能实时放电状态 |
| | | updateEsDischarge(); |
| | | updateSocialContribution1(); |
| | | updateSocialContribution2(); |
| | | updateSocialContribution3(); |
| | | } |
| | | /// 更新光伏本年发电量 |
| | | if (function.GetAttrState(InverterJinmao_AttrEnum.pv_electricity.ToString()) != temp.GetAttrState(InverterJinmao_AttrEnum.pv_electricity.ToString())) |
| | | catch (Exception ex) |
| | | { |
| | | upatePvGenerateYearValues(); |
| | | MainPage.Log("Error", $"金茂光伏更新异常:{ex.Message}"); |
| | | } |
| | | }); |
| | | } |
| | |
| | | pvGeneration_MonthValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.pv_electricity_month.ToString()); |
| | | } |
| | | /// <summary> |
| | | /// 更新光伏本年发电量 |
| | | /// </summary> |
| | | private void upatePvGenerateYearValues() |
| | | { |
| | | pvGeneration_YearValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.pv_electricity.ToString()); |
| | | } |
| | | /// <summary> |
| | | /// 更新累计发电量 |
| | | /// </summary> |
| | | private void upatePvGenerateTotalValues() |
| | |
| | | /// </summary> |
| | | private void upatePvLoadTodayValues() |
| | | { |
| | | pvLoad_TodayValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.load_electricity_today.ToString()); |
| | | pvLoad_TodayValuesButton.Text = loadElec_TodayTextButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.load_electricity_today.ToString()); |
| | | } |
| | | /// <summary> |
| | | /// 更新本月用电量 |
| | | /// </summary> |
| | | private void updateLoadElecMonthValues() |
| | | { |
| | | loadElec_MonthValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.load_electricity_month.ToString()); |
| | | } |
| | | /// <summary> |
| | | /// 更新累计用电量 |
| | |
| | | /// <summary> |
| | | /// 更新光伏发电功率 |
| | | /// </summary> |
| | | private void upatePvPower() |
| | | private void updatePvPower() |
| | | { |
| | | pvPower_ValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.pv_power.ToString()); |
| | | } |
| | | /// <summary> |
| | | /// 更新光伏用电功率 |
| | | /// </summary> |
| | | private void updateLoadElec() |
| | | { |
| | | loadElec_ValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.load_active_power.ToString()); |
| | | } |
| | | /// <summary> |
| | | /// 更新储能运行状态 |
| | | /// </summary> |
| | | private void updateEsRunStates() |
| | | { |
| | | switch (function.GetAttrState(InverterJinmao_AttrEnum.ess_status.ToString())) |
| | | { |
| | | case "charge": |
| | | esStatus_InfoView.BackgroundColor = 0x1500C22D; |
| | | esRunStatus_BatteryValuesButton.TextColor = 0xFF00C22D; |
| | | esRunStatus_Info_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/EsIconCharg.png"; |
| | | esRunStatus_Info_TextButton.Text = "充电"; |
| | | esRunStatus_BatteryIconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconCharg.png"; |
| | | esRunStatus_BatteryIconButton.SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconCharg100.png"; |
| | | break; |
| | | case "discharge": |
| | | esStatus_InfoView.BackgroundColor = 0x15FC9C04; |
| | | esRunStatus_BatteryValuesButton.TextColor = 0xFFFC9C04; |
| | | esRunStatus_Info_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/EsIconDischarge.png"; |
| | | esRunStatus_Info_TextButton.Text = "放电"; |
| | | esRunStatus_BatteryIconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconDischarg.png"; |
| | | esRunStatus_BatteryIconButton.SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconDischarg100.png"; |
| | | break; |
| | | case "shutdown": |
| | | esStatus_InfoView.BackgroundColor = 0x15798394; |
| | | esRunStatus_BatteryValuesButton.TextColor = 0xFF798394; |
| | | esRunStatus_Info_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/EsIconShutdown.png"; |
| | | esRunStatus_Info_TextButton.Text = "停机"; |
| | | esRunStatus_BatteryIconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconShutdown.png"; |
| | | esRunStatus_BatteryIconButton.SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconShutdown100.png"; |
| | | break; |
| | | case "fault": |
| | | esStatus_InfoView.BackgroundColor = 0x15FF4747; |
| | | esRunStatus_BatteryValuesButton.TextColor = 0xFFFF4747; |
| | | esRunStatus_Info_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/EsIconFault.png"; |
| | | esRunStatus_Info_TextButton.Text = "故障"; |
| | | esRunStatus_BatteryIconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconFault.png"; |
| | | esRunStatus_BatteryIconButton.SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconFault100.png"; |
| | | break; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 更新储能电池百分比状态 |
| | | /// </summary> |
| | | private void updateEsBatterySoc() |
| | | { |
| | | esRunStatus_BatteryValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.battery_soc.ToString()) + "%"; |
| | | if(esRunStatus_BatteryIconButton.Text == "100%") |
| | | { |
| | | esRunStatus_BatteryIconButton.IsSelected = true; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 更新储能实时充电状态 |
| | | /// </summary> |
| | | private void updateEsCharge() |
| | | { |
| | | esRunStatus_ChargeValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.ess_charge_power.ToString()); |
| | | } |
| | | /// <summary> |
| | | /// 更新储能实时放电状态 |
| | | /// </summary> |
| | | private void updateEsDischarge() |
| | | { |
| | | esRunStatus_DischargeValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.ess_discharg_power.ToString()); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新社会贡献1数据UI |
| | | /// </summary> |
| | | private void updateSocialContribution1() |
| | | { |
| | | socialContribution_Info1_ValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.coal.ToString()); |
| | | #if __IOS__ |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | if (socialContribution_Info1_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info1_ValuesButton.TextSize = socialContribution_Info1_ValuesButton.TextSize - 4; |
| | | } |
| | | |
| | | socialContribution_Info1_UintButton.X = socialContribution_Info1_ValuesButton.Right - Application.GetRealWidth(4); |
| | | } |
| | | /// <summary> |
| | | /// 更新社会贡2献数据UI |
| | | /// </summary> |
| | | private void updateSocialContribution2() |
| | | { |
| | | socialContribution_Info2_ValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.co2.ToString()); |
| | | #if __IOS__ |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | if (socialContribution_Info2_UintButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info2_UintButton.TextSize = socialContribution_Info2_UintButton.TextSize - 4; |
| | | } |
| | | |
| | | socialContribution_Info2_UintButton.X = socialContribution_Info2_ValuesButton.Right - Application.GetRealWidth(4); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 更新社会贡3献数据UI |
| | | /// </summary> |
| | | private void updateSocialContribution3() |
| | | { |
| | | |
| | | socialContribution_Info3_ValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.trees.ToString()); |
| | | #if __IOS__ |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | if (socialContribution_Info3_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info3_ValuesButton.TextSize = socialContribution_Info3_ValuesButton.TextSize - 4; |
| | | } |
| | | socialContribution_Info3_UintButton.X = socialContribution_Info3_ValuesButton.Right - Application.GetRealWidth(4); |
| | | } |
| | | } |
| | | } |
| | | |