wxr
2024-10-25 9b76aa77b9c5bf8ccb373cb30e3dca85d224175e
HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs
@@ -29,6 +29,10 @@
        /// </summary>
        Button pvLoad_TodayValuesButton;
        /// <summary>
        /// 今日用电量单位按钮
        /// </summary>
        Button loadEle_TodayUintButton;
        /// <summary>
        /// 累计用电量数据按钮
        /// </summary>
        Button pvLoad_TotalValuesButton;
@@ -116,6 +120,12 @@
        /// </summary>
        Button socialContribution_Info3_ValuesButton;
#if __ANDROID__
        private string fontName = "BEBAS.ttf";
#else
        private string fontName = "BEBAS";
#endif
        public InverterJinmaoPage()
        {
@@ -139,7 +149,7 @@
            var contentView = new VerticalScrolViewLayout()
            {
                Y = Application.GetRealHeight(74),
                Height = Application.GetRealHeight(Application.DesignHeight - 74),
                Height = Application.GetRealHeight(Application.DesignHeight)- Application.GetRealHeight(74),
            };
            bodyView.AddChidren(contentView);
@@ -198,6 +208,7 @@
                TextColor = CSS_Color.MainBackgroundColor,
                TextSize = 18,
                IsBold = true,
                FontName = fontName,
            };
            electricityGenerationView.AddChidren(pvGenerate_TodayValuesButton);
@@ -211,7 +222,7 @@
#endif
            pvGenerate_todayUintButton = new Button()
            {
                Y = Application.GetRealWidth(43),
                Y = Application.GetRealWidth(44),
                Height = Application.GetRealWidth(17),
                Text = "kwh",
                TextColor = CSS_Color.MainBackgroundColor,
@@ -230,7 +241,6 @@
                TextColor = CSS_Color.MainBackgroundColor,
                TextSize = 12,
                TextAlignment = TextAlignment.CenterLeft,
                //IsBold = true,
            };
            electricityGenerationView.AddChidren(pvGenerate_TotalValuesButton);
@@ -272,9 +282,9 @@
            loadEleView.AddChidren(loadEle_TodayTextButton);
            var loadEle_TodayUintButton = new Button()
            loadEle_TodayUintButton = new Button()
            {
                Y = Application.GetRealWidth(43),
                Y = Application.GetRealWidth(45),
                Height = Application.GetRealWidth(17),
                Text = "kwh",
                TextColor = CSS_Color.MainBackgroundColor,
@@ -291,7 +301,7 @@
            pvLoad_TodayValuesButton = new Button()
            {
                X = Application.GetRealWidth(81 - 12) - loadEle_TodayUintButton.Width,
                X = Application.GetRealWidth(81 - 8) - loadEle_TodayUintButton.Width,
                Y = Application.GetRealWidth(34),
                Height = Application.GetRealWidth(53),
                Width = Application.GetRealWidth(100),
@@ -300,8 +310,11 @@
                TextSize = 18,
                TextAlignment = TextAlignment.TopRight,
                IsBold = true,
                FontName = fontName,
            };
#if __IOS__
            pvLoad_TodayValuesButton.Y = Application.GetRealWidth(34);
            pvLoad_TodayValuesButton.X = Application.GetRealWidth(81 - 8) - loadEle_TodayUintButton.Width;
#else
            pvLoad_TodayValuesButton.Y = Application.GetRealWidth(37);
            pvLoad_TodayValuesButton.X = Application.GetRealWidth(81 - 16) - loadEle_TodayUintButton.Width;
@@ -403,6 +416,7 @@
                Y = Application.GetRealWidth(20),
                Width = Application.GetRealWidth(151),
                Height = Application.GetRealWidth(151),
                BackgroundImagePath = "FunctionIcon/Acst/Inverter/PvBgRunBg.png"
            };
            pvEleGenerationInfoView.AddChidren(powerGenerationView);
@@ -457,6 +471,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 24,
                IsBold = true,
                FontName = fontName,
            };
            powerGenerationView.AddChidren(pvPower_ValuesButton);
@@ -486,6 +501,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 18,
                IsBold = true,
                FontName = fontName,
            };
            pvEleGenerationInfoView.AddChidren(pvGeneration_TodayValuesButton);
@@ -515,6 +531,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 18,
                IsBold = true,
                FontName = fontName,
            };
            pvEleGenerationInfoView.AddChidren(pvGeneration_MonthValuesButton);
@@ -539,11 +556,12 @@
                Y = Application.GetRealWidth(191),
                Width = Application.GetRealWidth(100),
                Height = Application.GetRealWidth(24),
                Text = "---",
                Text = "--",
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 18,
                IsBold = true,
                FontName = fontName,
            };
            pvEleGenerationInfoView.AddChidren(pvGeneration_YearValuesButton);
@@ -580,17 +598,21 @@
                            Application.RunOnMainThread(() =>
                            {
                                pvGeneration_YearValuesButton.Text = totalValues.ToString();
                                while (true)
                                if (pvGeneration_YearValuesButton.Width < pvGeneration_YearValuesButton.GetTextWidth())
                                {
                                    if (pvGeneration_YearValuesButton.Width < pvGeneration_YearValuesButton.GetTextWidth())
                                    {
                                        pvGeneration_YearValuesButton.TextSize--;
                                    }
                                    else
                                    {
                                        break;
                                    }
                                    pvGeneration_YearValuesButton.TextSize = 12;
                                }
                                //while (true)
                                //{
                                //    if (pvGeneration_YearValuesButton.Width < pvGeneration_YearValuesButton.GetTextWidth())
                                //    {
                                //        pvGeneration_YearValuesButton.TextSize=12;
                                //    }
                                //    else
                                //    {
                                //        break;
                                //    }
                                //}
                            });
                        }
                    }
@@ -630,6 +652,7 @@
                Y = Application.GetRealWidth(20),
                Width = Application.GetRealWidth(151),
                Height = Application.GetRealWidth(151),
                BackgroundImagePath = "FunctionIcon/Acst/Inverter/PvBgDischargeBg.png"
            };
            electricityUsageStatusView.AddChidren(powerUsageView);
@@ -680,6 +703,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 24,
                IsBold = true,
                FontName = fontName,
            };
            powerUsageView.AddChidren(loadElec_ValuesButton);
@@ -708,6 +732,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 18,
                IsBold = true,
                FontName = fontName,
            };
            electricityUsageStatusView.AddChidren(powerUsage_TodayValuesButton);
@@ -735,6 +760,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 18,
                IsBold = true,
                FontName = fontName,
            };
            electricityUsageStatusView.AddChidren(loadElec_MonthValuesButton);
@@ -763,6 +789,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 18,
                IsBold = true,
                FontName = fontName,
            };
            electricityUsageStatusView.AddChidren(powerUsage_YearValuesButton);
@@ -801,17 +828,25 @@
                            Application.RunOnMainThread(() =>
                            {
                                powerUsage_YearValuesButton.Text = totalValues.ToString();
                                while (true)
                                if (powerUsage_YearValuesButton.Width < powerUsage_YearValuesButton.GetTextWidth())
                                {
                                    if (powerUsage_YearValuesButton.Width < powerUsage_YearValuesButton.GetTextWidth())
                                    {
                                        powerUsage_YearValuesButton.TextSize--;
                                    }
                                    else
                                    {
                                        break;
                                    }
                                    powerUsage_YearValuesButton.TextSize = 12;
                                }
                                //while (true)
                                //{
                                //    if (powerUsage_YearValuesButton.Width < powerUsage_YearValuesButton.GetTextWidth())
                                //    {
                                //        powerUsage_YearValuesButton.TextSize-=1;
                                //        if (powerUsage_YearValuesButton.TextSize <= 10)
                                //        {
                                //            break;
                                //        }
                                //    }
                                //    else
                                //    {
                                //        break;
                                //    }
                                //}
                            });
                        }
                    }
@@ -909,7 +944,7 @@
                esRunStatus_BatteryIconButton = new Button()
                {
                    X = Application.GetRealWidth(343 - 12 - 20) - esRunStatus_BatteryValuesButton.Width,
                    X = Application.GetRealWidth(343 - 12 - 18) - esRunStatus_BatteryValuesButton.Width,
                    Y = Application.GetRealWidth(16),
                    Width = Application.GetRealWidth(20),
                    Height = Application.GetRealWidth(20),
@@ -921,10 +956,10 @@
                var esRunStatus_ValuesInfoView = new FrameLayout()
                {
                    Width = Application.GetRealWidth(282),
                    Height = Application.GetRealWidth(153),
                    Width = Application.GetRealWidth(564/2),
                    Height = Application.GetRealWidth(306/2),
                    Gravity = Gravity.CenterHorizontal,
                    Y = Application.GetRealWidth(40),
                    Y = Application.GetRealWidth(40-7),
                    BackgroundImagePath = "FunctionIcon/Acst/Inverter/EnergyStorageStatusBg.png",
                };
                esStatusView.AddChidren(esRunStatus_ValuesInfoView);
@@ -933,6 +968,7 @@
                var esRunStatus_ChargeValuesView = new FrameLayout()
                {
                    X = Application.GetRealWidth(15),
                    Y = Application.GetRealWidth(6),
                    Width = Application.GetRealWidth(128),
                    Height = Application.GetRealWidth(128),
                };
@@ -940,20 +976,21 @@
                esRunStatus_ChargeValuesButton = new Button()
                {
                    Y = Application.GetRealWidth(36),
                    Y = Application.GetRealWidth(39),
                    Height = Application.GetRealWidth(32),
                    TextAlignment = TextAlignment.Center,
                    Text = function.GetAttrState(InverterJinmao_AttrEnum.ess_charge_power.ToString()),
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = 24,
                    IsBold = true,
                    FontName = fontName,
                };
                esRunStatus_ChargeValuesView.AddChidren(esRunStatus_ChargeValuesButton);
                var esRunStatus_ChargeTextButton = new Button()
                {
                    X = Application.GetRealWidth(1),
                    Y = Application.GetRealWidth(76),
                    Y = Application.GetRealWidth(78),
                    Height = Application.GetRealWidth(17),
                    TextAlignment = TextAlignment.Center,
                    Text = "实时充电功率(kw)",
@@ -967,6 +1004,7 @@
                var esRunStatus_DischargeValuesView = new FrameLayout()
                {
                    X = Application.GetRealWidth(132 + 13),
                    Y = Application.GetRealWidth(6),
                    Width = Application.GetRealWidth(128),
                    Height = Application.GetRealWidth(128),
                };
@@ -981,6 +1019,7 @@
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = 24,
                    IsBold = true,
                FontName = fontName,
                };
                esRunStatus_DischargeValuesView.AddChidren(esRunStatus_DischargeValuesButton);
@@ -990,7 +1029,7 @@
                    Y = Application.GetRealWidth(76),
                    Height = Application.GetRealWidth(17),
                    TextAlignment = TextAlignment.Center,
                    Text = "实时放电功率(kwh)",
                    Text = "实时放电功率(kw)",
                    TextColor = CSS_Color.TextualColor,
                    TextSize = 12,
                };
@@ -1025,7 +1064,7 @@
            {
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(142),
                Height = Application.GetRealWidth(142),//142
                ScrollEnabled = false,
            };
            contentView.AddChidren(socialContributionView);
@@ -1049,36 +1088,41 @@
            };
            socialContribution_InfoView_1.AddChidren(socialContribution_Info1_IconButton);
            var socialContribution_Info1_ValuesView = new FrameLayout()
            {
                Y = Application.GetRealWidth(68),
                Height = Application.GetRealWidth(25),
            };
            socialContribution_InfoView_1.AddChidren(socialContribution_Info1_ValuesView);
            socialContribution_Info1_ValuesButton = new Button()
            {
                X = Application.GetRealWidth(12),
                Y = Application.GetRealWidth(68),
                //Y = Application.GetRealWidth(68),
                Width = Application.GetRealWidth(36),
                Height = Application.GetRealWidth(25),
                //Height = Application.GetRealWidth(25),
                Text = function.GetAttrState(InverterJinmao_AttrEnum.coal.ToString()),
                TextSize = 18,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.BottomLeft,
                IsBold = true,
                FontName = fontName,
            };
            socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth() + Application.GetRealWidth(8);
            socialContribution_InfoView_1.AddChidren(socialContribution_Info1_ValuesButton);
            socialContribution_Info1_ValuesView.AddChidren(socialContribution_Info1_ValuesButton);
            socialContribution_Info1_UintButton = new Button()
            {
                X = socialContribution_Info1_ValuesButton.Right - Application.GetRealWidth(4),
                Y = Application.GetRealWidth(68),
                //Y = Application.GetRealWidth(68),
                Width = Application.GetRealWidth(50),
                Height = Application.GetRealWidth(23),
                //Height = Application.GetRealWidth(23),
                Text = "吨",
                TextSize = 12,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.BottomLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
            };
#if __IOS__
            socialContribution_Info1_UintButton.Y = Application.GetRealWidth(66);
#endif
            socialContribution_InfoView_1.AddChidren(socialContribution_Info1_UintButton);
            socialContribution_Info1_ValuesView.AddChidren(socialContribution_Info1_UintButton);
            var socialContribution_Info1_TipButton = new Button()
            {
@@ -1118,10 +1162,17 @@
            };
            socialContribution_InfoView_2.AddChidren(socialContribution_Info2_IconButton);
            var socialContribution_Info2_ValuesView = new FrameLayout()
            {
                Y = Application.GetRealWidth(68),
                Height = Application.GetRealWidth(25),
            };
            socialContribution_InfoView_2.AddChidren(socialContribution_Info2_ValuesView);
            socialContribution_Info2_ValuesButton = new Button()
            {
                X = Application.GetRealWidth(12),
                Y = Application.GetRealWidth(68),
                //Y = Application.GetRealWidth(68),
                Width = Application.GetRealWidth(36),
                Height = Application.GetRealWidth(25),
                Text = function.GetAttrState(InverterJinmao_AttrEnum.co2.ToString()),
@@ -1129,25 +1180,23 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.BottomLeft,
                IsBold = true,
                FontName = fontName,
            };
            socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth() + Application.GetRealWidth(8);
            socialContribution_InfoView_2.AddChidren(socialContribution_Info2_ValuesButton);
            socialContribution_Info2_ValuesView.AddChidren(socialContribution_Info2_ValuesButton);
            socialContribution_Info2_UintButton = new Button()
            {
                X = socialContribution_Info2_ValuesButton.Right - Application.GetRealWidth(4),
                Y = Application.GetRealWidth(68),
                //Y = Application.GetRealWidth(68),
                Width = Application.GetRealWidth(50),
                Height = Application.GetRealWidth(23),
                //Height = Application.GetRealWidth(23),
                Text = "吨",
                TextSize = 12,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.BottomLeft,
            };
#if __IOS__
            socialContribution_Info2_UintButton.Y = Application.GetRealWidth(66);
#endif
            socialContribution_InfoView_2.AddChidren(socialContribution_Info2_UintButton);
            socialContribution_Info2_ValuesView.AddChidren(socialContribution_Info2_UintButton);
            var socialContribution_Info2_TipButton = new Button()
            {
@@ -1187,36 +1236,41 @@
            };
            socialContribution_InfoView_3.AddChidren(socialContribution_Info3_IconButton);
            var socialContribution_Info3_ValuesView = new FrameLayout()
            {
                Y = Application.GetRealWidth(68),
                Height = Application.GetRealWidth(25),
            };
            socialContribution_InfoView_3.AddChidren(socialContribution_Info3_ValuesView);
            socialContribution_Info3_ValuesButton = new Button()
            {
                X = Application.GetRealWidth(12),
                Y = Application.GetRealWidth(68),
                //Y = Application.GetRealWidth(68),
                Width = Application.GetRealWidth(36),
                Height = Application.GetRealWidth(25),
                //Height = Application.GetRealWidth(25),
                Text = function.GetAttrState(InverterJinmao_AttrEnum.trees.ToString()),
                TextSize = 18,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.BottomLeft,
                IsBold = true,
                FontName = fontName,
            };
            socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth() + Application.GetRealWidth(8);
            socialContribution_InfoView_3.AddChidren(socialContribution_Info3_ValuesButton);
            socialContribution_Info3_ValuesView.AddChidren(socialContribution_Info3_ValuesButton);
            socialContribution_Info3_UintButton = new Button()
            {
                X = socialContribution_Info3_ValuesButton.Right - Application.GetRealWidth(4),
                Y = Application.GetRealWidth(68),
                //Y = Application.GetRealWidth(68),
                Width = Application.GetRealWidth(50),
                Height = Application.GetRealWidth(23),
                //Height = Application.GetRealWidth(23),
                Text = "棵",
                TextSize = 12,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.BottomLeft,
            };
            #if __IOS__
            socialContribution_Info3_UintButton.Y = Application.GetRealWidth(66);
            #endif
            socialContribution_InfoView_3.AddChidren(socialContribution_Info3_UintButton);
            socialContribution_Info3_ValuesView.AddChidren(socialContribution_Info3_UintButton);
            var socialContribution_Info3_TipButton = new Button()
            {
@@ -1295,6 +1349,15 @@
        private void upatePvGenerateTodayValues()
        {
            pvGenerate_TodayValuesButton.Text = pvGeneration_TodayValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.pv_electricity_today.ToString());
#if __IOS__
            pvGenerate_TodayValuesButton.TextAlignment = TextAlignment.TopLeft;
            pvGenerate_TodayValuesButton.Width = pvGenerate_TodayValuesButton.GetTextWidth() + Application.GetRealWidth(8);
#else
            pvGenerate_TodayValuesButton.TextAlignment = TextAlignment.BottomLeft;
            pvGenerate_TodayValuesButton.Y = Application.GetRealWidth(37);
            pvGenerate_TodayValuesButton.Width = pvGenerate_TodayValuesButton.GetTextWidth() + Application.GetRealWidth(4);
#endif
            pvGenerate_todayUintButton.X = pvGenerate_TodayValuesButton.Right;
        }
        /// <summary>
@@ -1317,6 +1380,14 @@
        private void upatePvLoadTodayValues()
        {
            pvLoad_TodayValuesButton.Text = powerUsage_TodayValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.load_electricity_today.ToString());
#if __IOS__
            pvLoad_TodayValuesButton.Y = Application.GetRealWidth(34);
            pvLoad_TodayValuesButton.X = Application.GetRealWidth(81 - 8) - loadEle_TodayUintButton.Width;
#else
            pvLoad_TodayValuesButton.Y = Application.GetRealWidth(37);
            pvLoad_TodayValuesButton.X = Application.GetRealWidth(81 - 16) - loadEle_TodayUintButton.Width;
#endif
        }
        /// <summary>
        /// 更新本月用电量