| | |
| | | { |
| | | public class InverterJinmaoPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | static InverterJinmaoPage bodyView; |
| | | Function function; |
| | | /// <summary> |
| | | /// 今日发电量数据按钮 |
| | |
| | | /// <summary> |
| | | /// 光伏运行状态图标按钮 |
| | | /// </summary> |
| | | Button pvRunStatus_IconButtonp; |
| | | Button pvRunStatus_IconButton; |
| | | /// <summary> |
| | | /// 光伏运行状态文本按钮 |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// 光伏状态今日用电量数据按钮 |
| | | /// </summary> |
| | | Button loadElec_TodayTextButton; |
| | | Button powerUsage_TodayValuesButton; |
| | | /// <summary> |
| | | /// 光伏状态本月用电量数据按钮 |
| | | /// </summary> |
| | |
| | | |
| | | #if __IOS__ |
| | | pvGenerate_TodayValuesButton.TextAlignment = TextAlignment.TopLeft; |
| | | pvGenerate_TodayValuesButton.Width = pvGenerate_TodayValuesButton.GetTextWidth() + Application.GetRealWidth(6); |
| | | pvGenerate_TodayValuesButton.Width = pvGenerate_TodayValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | pvGenerate_TodayValuesButton.TextAlignment = TextAlignment.BottomLeft; |
| | | pvGenerate_TodayValuesButton.Y = Application.GetRealWidth(37); |
| | |
| | | { |
| | | Y = Application.GetRealWidth(43), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "kw", |
| | | Text = "kwh", |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = 12, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | pvGenerate_todayUintButton.X = pvGenerate_TodayValuesButton.Right; |
| | | pvGenerate_todayUintButton.X = pvGenerate_TodayValuesButton.Right - Application.GetRealWidth(2); |
| | | electricityGenerationView.AddChidren(pvGenerate_todayUintButton); |
| | | |
| | | pvGenerate_TotalValuesButton = new Button() |
| | |
| | | { |
| | | Y = Application.GetRealWidth(43), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "kw", |
| | | Text = "kwh", |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = 12, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | |
| | | }; |
| | | pvEleGenerationInfoView.AddChidren(pvRunStatusInfoView); |
| | | |
| | | pvRunStatus_IconButtonp = new Button() |
| | | pvRunStatus_IconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 14), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | Height = Application.GetRealWidth(12), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvIconRun.png", |
| | | }; |
| | | pvRunStatusInfoView.AddChidren(pvRunStatus_IconButtonp); |
| | | pvRunStatusInfoView.AddChidren(pvRunStatus_IconButton); |
| | | |
| | | pvRunStatus_TextButton = new Button() |
| | | { |
| | |
| | | try |
| | | { |
| | | int index = 1; |
| | | float pvPower = 0.00f; |
| | | while (index < 361) |
| | | { |
| | | if (function.GetAttrState(InverterJinmao_AttrEnum.pv_power.ToString()) == "0") |
| | | float.TryParse(function.GetAttrState(InverterJinmao_AttrEnum.pv_power.ToString()), out pvPower); |
| | | if (pvPower > 0.00f) |
| | | { |
| | | continue; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | powerGenerationBg.SetRotation(1f * index++); |
| | |
| | | if (index == 361) |
| | | { |
| | | index = 1; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | Y = Application.GetRealWidth(78), |
| | | //Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(25), |
| | | Text = "实时发电功率 (kwh)", |
| | | Text = "实时发电功率 (kw)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | |
| | | Y = Application.GetRealWidth(220), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "今日发电量 (kw)", |
| | | Text = "今日发电量 (kwh)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | |
| | | Y = Application.GetRealWidth(220), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "本月发电量 (kw)", |
| | | Text = "本月发电量 (kwh)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | |
| | | Y = Application.GetRealWidth(220), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "本年发电量 (kw)", |
| | | Text = "本年发电量 (kwh)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | |
| | | try |
| | | { |
| | | var revertObj = new HttpServerRequest().GetSensorHistory("custom_year", |
| | | function.deviceId, InverterJinmao_AttrEnum.load_electricity.ToString(), DateTime.Now.Year.ToString()); |
| | | function.deviceId, InverterJinmao_AttrEnum.pv_electricity.ToString(), DateTime.Now.Year.ToString()); |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | |
| | | try |
| | | { |
| | | int index = 1; |
| | | float loadPower = 0.00f; |
| | | while (index < 361) |
| | | { |
| | | if (function.GetAttrState(InverterJinmao_AttrEnum.load_active_power.ToString()) == "0") |
| | | float.TryParse(function.GetAttrState(InverterJinmao_AttrEnum.load_active_power.ToString()), out loadPower); |
| | | if (loadPower > 0.00f) |
| | | { |
| | | continue; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | powerUsageBg.SetRotation(1f * index++); |
| | |
| | | if (index == 361) |
| | | { |
| | | index = 1; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | Y = Application.GetRealWidth(78), |
| | | //Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(25), |
| | | Text = "实时用电功率 (kwh)", |
| | | Text = "实时用电功率 (kw)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | |
| | | powerUsageView.AddChidren(powerUsage_TextButton); |
| | | |
| | | |
| | | var powerUsage_TodayValuesButton = new Button() |
| | | powerUsage_TodayValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(191), |
| | |
| | | }; |
| | | electricityUsageStatusView.AddChidren(powerUsage_TodayValuesButton); |
| | | |
| | | loadElec_TodayTextButton = new Button() |
| | | var loadElec_TodayTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(220), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "今日用电量 (kw)", |
| | | Text = "今日用电量 (kwh)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | |
| | | Y = Application.GetRealWidth(220), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "本月用电量 (kw)", |
| | | Text = "本月用电量 (kwh)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | |
| | | Y = Application.GetRealWidth(220), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "本年用电量 (kw)", |
| | | Text = "本年用电量 (kwh)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | | }; |
| | | electricityUsageStatusView.AddChidren(powerUsage_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(() => |
| | | { |
| | | powerUsage_YearValuesButton.Text = totalValues.ToString(); |
| | | while (true) |
| | | { |
| | | if (powerUsage_YearValuesButton.Width < powerUsage_YearValuesButton.GetTextWidth()) |
| | | { |
| | | powerUsage_YearValuesButton.TextSize--; |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", "读取金茂本年发电量数据异常:" + ex.Message); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #endregion |
| | | |
| | | if (function.attributes.Find((obj) => obj.key == InverterJinmao_AttrEnum.ess_status.ToString()) != null) |
| | | { |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealWidth(8) |
| | |
| | | Y = Application.GetRealWidth(76), |
| | | Height = Application.GetRealWidth(17), |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = "实时充电功率(kwh)", |
| | | Text = "实时充电功率(kw)", |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | | }; |
| | |
| | | esRunStatus_DischargeValuesView.AddChidren(esRunStatus_DischargeTextButton); |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | contentView.AddChidren(new Button() |
| | | { |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info1_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_UintButton); |
| | | |
| | | var socialContribution_Info1_TipButton = new Button() |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info2_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_UintButton); |
| | | |
| | | var socialContribution_Info2_TipButton = new Button() |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info3_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_UintButton); |
| | | |
| | | var socialContribution_Info3_TipButton = new Button() |
| | |
| | | /// 更新界面数据 |
| | | /// </summary> |
| | | /// <param name="temp"></param> |
| | | public void UpdateStatus(Function temp) |
| | | public static void UpdateStatus(Function temp) |
| | | { |
| | | if (bodyView == null) |
| | | { |
| | |
| | | try |
| | | { |
| | | /// 更新今日发电量 |
| | | upatePvGenerateTodayValues(); |
| | | bodyView.upatePvGenerateTodayValues(); |
| | | /// 更新累计发电量 |
| | | upatePvGenerateTotalValues(); |
| | | bodyView.upatePvGenerateTotalValues(); |
| | | /// 更新今日用电量 |
| | | upatePvLoadTodayValues(); |
| | | bodyView.upatePvLoadTodayValues(); |
| | | /// 更新累计用电量 |
| | | upatePvLoadTotalValues(); |
| | | bodyView.upatePvLoadTotalValues(); |
| | | /// 更新光伏运行状态 |
| | | upatePvRunStatus(); |
| | | bodyView.upatePvRunStatus(); |
| | | /// 更新光伏发电功率 |
| | | updatePvPower(); |
| | | bodyView.updatePvPower(); |
| | | /// 更新光伏本月发电量 |
| | | upatePvGenerateMonthValues(); |
| | | bodyView.upatePvGenerateMonthValues(); |
| | | /// 更新光伏用电功率 |
| | | updateLoadElec(); |
| | | bodyView.updateLoadElec(); |
| | | ///更新光伏状态本月用电量 |
| | | updateLoadElecMonthValues(); |
| | | bodyView.updateLoadElecMonthValues(); |
| | | //更新储能运行状态 |
| | | updateEsRunStates(); |
| | | bodyView.updateEsRunStates(); |
| | | //更新储能电池百分比 |
| | | updateEsBatterySoc(); |
| | | bodyView.updateEsBatterySoc(); |
| | | //更新储能实时充电状态 |
| | | updateEsCharge(); |
| | | bodyView.updateEsCharge(); |
| | | //更新储能实时放电状态 |
| | | updateEsDischarge(); |
| | | updateSocialContribution1(); |
| | | updateSocialContribution2(); |
| | | updateSocialContribution3(); |
| | | bodyView.updateEsDischarge(); |
| | | bodyView.updateSocialContribution1(); |
| | | bodyView.updateSocialContribution2(); |
| | | bodyView.updateSocialContribution3(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂光伏更新异常:{ex.Message}"); |
| | | MainPage.Log("Error", $"金茂光伏更新异常:{ex.StackTrace}"); |
| | | } |
| | | }); |
| | | } |
| | |
| | | /// </summary> |
| | | private void upatePvGenerateTotalValues() |
| | | { |
| | | pvGenerate_TodayValuesButton.Text = "累计发电量:" + function.GetAttrState(InverterJinmao_AttrEnum.pv_electricity.ToString()); |
| | | pvGenerate_TotalValuesButton.Text = "累计发电量:" + function.GetAttrState(InverterJinmao_AttrEnum.pv_electricity.ToString()); |
| | | } |
| | | /// <summary> |
| | | /// 更新今日用电量 |
| | | /// </summary> |
| | | private void upatePvLoadTodayValues() |
| | | { |
| | | pvLoad_TodayValuesButton.Text = loadElec_TodayTextButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.load_electricity_today.ToString()); |
| | | pvLoad_TodayValuesButton.Text = powerUsage_TodayValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.load_electricity_today.ToString()); |
| | | } |
| | | /// <summary> |
| | | /// 更新本月用电量 |
| | |
| | | { |
| | | case "run": |
| | | pvRunStatusInfoView.BackgroundColor = 0x154484F4; |
| | | pvRunStatus_IconButtonp.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvIconRun.png"; |
| | | pvRunStatus_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvIconRun.png"; |
| | | pvRunStatus_TextButton.Text = "运行"; |
| | | pvRunStatus_TextButton.TextColor = 0xFF4484F4; |
| | | break; |
| | | case "fault": |
| | | pvRunStatusInfoView.BackgroundColor = 0x15FF4747; |
| | | pvRunStatus_IconButtonp.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvIconFault.png"; |
| | | pvRunStatus_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvIconFault.png"; |
| | | pvRunStatus_TextButton.Text = "故障"; |
| | | pvRunStatus_TextButton.TextColor = 0xFFFF4747; |
| | | break; |
| | | case "standby": |
| | | pvRunStatusInfoView.BackgroundColor = 0x15798394; |
| | | pvRunStatus_IconButtonp.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvIconStandby.png"; |
| | | pvRunStatus_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvIconStandby.png"; |
| | | pvRunStatus_TextButton.Text = "待机"; |
| | | pvRunStatus_TextButton.TextColor = 0xFF798394; |
| | | break; |
| | |
| | | /// </summary> |
| | | private void updateEsRunStates() |
| | | { |
| | | if (function.attributes.Find((obj) => obj.key == InverterJinmao_AttrEnum.ess_status.ToString()) != null) |
| | | { |
| | | switch (function.GetAttrState(InverterJinmao_AttrEnum.ess_status.ToString())) |
| | | { |
| | | case "charge": |
| | | esStatus_InfoView.BackgroundColor = 0x1500C22D; |
| | | esRunStatus_BatteryValuesButton.TextColor = 0xFF00C22D; |
| | | esRunStatus_Info_TextButton.TextColor = 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"; |
| | |
| | | break; |
| | | case "discharge": |
| | | esStatus_InfoView.BackgroundColor = 0x15FC9C04; |
| | | esRunStatus_BatteryValuesButton.TextColor = 0xFFFC9C04; |
| | | esRunStatus_Info_TextButton.TextColor = 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"; |
| | |
| | | break; |
| | | case "shutdown": |
| | | esStatus_InfoView.BackgroundColor = 0x15798394; |
| | | esRunStatus_BatteryValuesButton.TextColor = 0xFF798394; |
| | | esRunStatus_Info_TextButton.TextColor = 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"; |
| | |
| | | break; |
| | | case "fault": |
| | | esStatus_InfoView.BackgroundColor = 0x15FF4747; |
| | | esRunStatus_BatteryValuesButton.TextColor = 0xFFFF4747; |
| | | esRunStatus_Info_TextButton.TextColor = 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"; |
| | |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 更新储能电池百分比状态 |
| | | /// </summary> |
| | | private void updateEsBatterySoc() |
| | | { |
| | | if (function.attributes.Find((obj) => obj.key == InverterJinmao_AttrEnum.ess_status.ToString()) != null) |
| | | { |
| | | esRunStatus_BatteryValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.battery_soc.ToString()) + "%"; |
| | | if(esRunStatus_BatteryIconButton.Text == "100%") |
| | |
| | | esRunStatus_BatteryIconButton.IsSelected = true; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 更新储能实时充电状态 |
| | | /// </summary> |
| | | private void updateEsCharge() |
| | | { |
| | | if (function.attributes.Find((obj) => obj.key == InverterJinmao_AttrEnum.ess_status.ToString()) != null) |
| | | { |
| | | esRunStatus_ChargeValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.ess_charge_power.ToString()); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 更新储能实时放电状态 |
| | | /// </summary> |
| | | private void updateEsDischarge() |
| | | { |
| | | if (function.attributes.Find((obj) => obj.key == InverterJinmao_AttrEnum.ess_status.ToString()) != null) |
| | | { |
| | | 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_ValuesButton.TextSize = 14; |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth(); |
| | | socialContribution_Info1_UintButton.Height = Application.GetRealWidth(25); |
| | | } |
| | | |
| | | #if __IOS__ |
| | | socialContribution_Info1_ValuesButton.Width += Application.GetRealWidth(6); |
| | | socialContribution_Info1_UintButton.X = socialContribution_Info1_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | socialContribution_Info1_UintButton.X = socialContribution_Info1_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |
| | | } |
| | | /// <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.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.co2.ToString()); |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | if (socialContribution_Info2_UintButton.Width > Application.GetRealWidth(61)) |
| | | if (socialContribution_Info2_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info2_UintButton.TextSize = socialContribution_Info2_UintButton.TextSize - 4; |
| | | socialContribution_Info2_ValuesButton.TextSize = 14; |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | } |
| | | |
| | | #if __IOS__ |
| | | socialContribution_Info2_ValuesButton.Width += Application.GetRealWidth(6); |
| | | socialContribution_Info2_UintButton.X = socialContribution_Info2_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | socialContribution_Info2_UintButton.X = socialContribution_Info2_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |
| | | |
| | | } |
| | | /// <summary> |
| | |
| | | /// </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.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.trees.ToString()); |
| | | 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_ValuesButton.TextSize = 14; |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | | socialContribution_Info3_UintButton.Height = Application.GetRealWidth(25); |
| | | } |
| | | #if __IOS__ |
| | | socialContribution_Info3_ValuesButton.Width += Application.GetRealWidth(6); |
| | | socialContribution_Info3_UintButton.X = socialContribution_Info3_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | socialContribution_Info3_UintButton.X = socialContribution_Info3_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |
| | | } |
| | | } |
| | | } |