From 9b76aa77b9c5bf8ccb373cb30e3dca85d224175e Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期五, 25 十月 2024 11:36:49 +0800
Subject: [PATCH] 金茂UI走查,字体更换

---
 HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs |  168 ++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 108 insertions(+), 60 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs
index c4da2d5..b3212d9 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs
@@ -120,6 +120,12 @@
         /// </summary>
         Button socialContribution_Info3_ValuesButton;
 
+#if __ANDROID__
+        private string fontName = "BEBAS.ttf";
+#else
+        private string fontName = "BEBAS";
+#endif
+
 
         public InverterJinmaoPage()
         {
@@ -143,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);
 
@@ -202,6 +208,7 @@
                 TextColor = CSS_Color.MainBackgroundColor,
                 TextSize = 18,
                 IsBold = true,
+                FontName = fontName,
             };
             electricityGenerationView.AddChidren(pvGenerate_TodayValuesButton);
 
@@ -215,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,
@@ -234,7 +241,6 @@
                 TextColor = CSS_Color.MainBackgroundColor,
                 TextSize = 12,
                 TextAlignment = TextAlignment.CenterLeft,
-                //IsBold = true,
             };
             electricityGenerationView.AddChidren(pvGenerate_TotalValuesButton);
 
@@ -278,7 +284,7 @@
 
             loadEle_TodayUintButton = new Button()
             {
-                Y = Application.GetRealWidth(43),
+                Y = Application.GetRealWidth(45),
                 Height = Application.GetRealWidth(17),
                 Text = "kwh",
                 TextColor = CSS_Color.MainBackgroundColor,
@@ -295,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),
@@ -304,10 +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 - 12) - loadEle_TodayUintButton.Width;
+            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;
@@ -409,6 +416,7 @@
                 Y = Application.GetRealWidth(20),
                 Width = Application.GetRealWidth(151),
                 Height = Application.GetRealWidth(151),
+                BackgroundImagePath = "FunctionIcon/Acst/Inverter/PvBgRunBg.png"
             };
             pvEleGenerationInfoView.AddChidren(powerGenerationView);
 
@@ -463,6 +471,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 24,
                 IsBold = true,
+                FontName = fontName,
             };
             powerGenerationView.AddChidren(pvPower_ValuesButton);
 
@@ -492,6 +501,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
+                FontName = fontName,
             };
             pvEleGenerationInfoView.AddChidren(pvGeneration_TodayValuesButton);
 
@@ -521,6 +531,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
+                FontName = fontName,
             };
             pvEleGenerationInfoView.AddChidren(pvGeneration_MonthValuesButton);
 
@@ -545,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);
 
@@ -586,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;
+                                //    }
+                                //}
                             });
                         }
                     }
@@ -636,6 +652,7 @@
                 Y = Application.GetRealWidth(20),
                 Width = Application.GetRealWidth(151),
                 Height = Application.GetRealWidth(151),
+                BackgroundImagePath = "FunctionIcon/Acst/Inverter/PvBgDischargeBg.png"
             };
             electricityUsageStatusView.AddChidren(powerUsageView);
 
@@ -686,6 +703,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 24,
                 IsBold = true,
+                FontName = fontName,
             };
             powerUsageView.AddChidren(loadElec_ValuesButton);
 
@@ -714,6 +732,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
+                FontName = fontName,
             };
             electricityUsageStatusView.AddChidren(powerUsage_TodayValuesButton);
 
@@ -741,6 +760,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
+                FontName = fontName,
             };
             electricityUsageStatusView.AddChidren(loadElec_MonthValuesButton);
 
@@ -769,6 +789,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
+                FontName = fontName,
             };
             electricityUsageStatusView.AddChidren(powerUsage_YearValuesButton);
 
@@ -807,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;
+                                //    }
+                                //}
                             });
                         }
                     }
@@ -915,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),
@@ -927,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);
@@ -939,6 +968,7 @@
                 var esRunStatus_ChargeValuesView = new FrameLayout()
                 {
                     X = Application.GetRealWidth(15),
+                    Y = Application.GetRealWidth(6),
                     Width = Application.GetRealWidth(128),
                     Height = Application.GetRealWidth(128),
                 };
@@ -946,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)",
@@ -973,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),
                 };
@@ -987,6 +1019,7 @@
                     TextColor = CSS_Color.FirstLevelTitleColor,
                     TextSize = 24,
                     IsBold = true,
+                FontName = fontName,
                 };
                 esRunStatus_DischargeValuesView.AddChidren(esRunStatus_DischargeValuesButton);
 
@@ -1031,7 +1064,7 @@
             {
                 Gravity = Gravity.CenterHorizontal,
                 Width = Application.GetRealWidth(343),
-                Height = Application.GetRealHeight(142),
+                Height = Application.GetRealWidth(142),//142
                 ScrollEnabled = false,
             };
             contentView.AddChidren(socialContributionView);
@@ -1055,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()
             {
@@ -1124,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()),
@@ -1135,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()
             {
@@ -1193,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()
             {
@@ -1335,7 +1383,7 @@
 
 #if __IOS__
             pvLoad_TodayValuesButton.Y = Application.GetRealWidth(34);
-            pvLoad_TodayValuesButton.X = Application.GetRealWidth(81 - 12) - loadEle_TodayUintButton.Width;
+            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;

--
Gitblit v1.8.0