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 |  136 ++++++++++++++++++++++++++------------------
 1 files changed, 80 insertions(+), 56 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs
index c3d9e0b..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()
         {
@@ -202,7 +208,7 @@
                 TextColor = CSS_Color.MainBackgroundColor,
                 TextSize = 18,
                 IsBold = true,
-                FontName = "BEBAS",
+                FontName = fontName,
             };
             electricityGenerationView.AddChidren(pvGenerate_TodayValuesButton);
 
@@ -216,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,
@@ -235,7 +241,6 @@
                 TextColor = CSS_Color.MainBackgroundColor,
                 TextSize = 12,
                 TextAlignment = TextAlignment.CenterLeft,
-                //IsBold = true,
             };
             electricityGenerationView.AddChidren(pvGenerate_TotalValuesButton);
 
@@ -279,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,
@@ -296,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),
@@ -305,11 +310,11 @@
                 TextSize = 18,
                 TextAlignment = TextAlignment.TopRight,
                 IsBold = true,
-                FontName = "BEBAS",
+                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;
@@ -411,6 +416,7 @@
                 Y = Application.GetRealWidth(20),
                 Width = Application.GetRealWidth(151),
                 Height = Application.GetRealWidth(151),
+                BackgroundImagePath = "FunctionIcon/Acst/Inverter/PvBgRunBg.png"
             };
             pvEleGenerationInfoView.AddChidren(powerGenerationView);
 
@@ -465,7 +471,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 24,
                 IsBold = true,
-                FontName = "BEBAS",
+                FontName = fontName,
             };
             powerGenerationView.AddChidren(pvPower_ValuesButton);
 
@@ -495,7 +501,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
-                FontName = "BEBAS",
+                FontName = fontName,
             };
             pvEleGenerationInfoView.AddChidren(pvGeneration_TodayValuesButton);
 
@@ -525,7 +531,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
-                FontName = "BEBAS",
+                FontName = fontName,
             };
             pvEleGenerationInfoView.AddChidren(pvGeneration_MonthValuesButton);
 
@@ -550,12 +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 = "BEBAS",
+                FontName = fontName,
             };
             pvEleGenerationInfoView.AddChidren(pvGeneration_YearValuesButton);
 
@@ -646,6 +652,7 @@
                 Y = Application.GetRealWidth(20),
                 Width = Application.GetRealWidth(151),
                 Height = Application.GetRealWidth(151),
+                BackgroundImagePath = "FunctionIcon/Acst/Inverter/PvBgDischargeBg.png"
             };
             electricityUsageStatusView.AddChidren(powerUsageView);
 
@@ -696,7 +703,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 24,
                 IsBold = true,
-                FontName = "BEBAS",
+                FontName = fontName,
             };
             powerUsageView.AddChidren(loadElec_ValuesButton);
 
@@ -725,7 +732,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
-                FontName = "BEBAS",
+                FontName = fontName,
             };
             electricityUsageStatusView.AddChidren(powerUsage_TodayValuesButton);
 
@@ -753,7 +760,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
-                FontName = "BEBAS",
+                FontName = fontName,
             };
             electricityUsageStatusView.AddChidren(loadElec_MonthValuesButton);
 
@@ -782,7 +789,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
-                FontName = "BEBAS",
+                FontName = fontName,
             };
             electricityUsageStatusView.AddChidren(powerUsage_YearValuesButton);
 
@@ -821,7 +828,10 @@
                             Application.RunOnMainThread(() =>
                             {
                                 powerUsage_YearValuesButton.Text = totalValues.ToString();
-                                powerUsage_YearValuesButton.TextSize=12;
+                                if (powerUsage_YearValuesButton.Width < powerUsage_YearValuesButton.GetTextWidth())
+                                {
+                                    powerUsage_YearValuesButton.TextSize = 12;
+                                }
                                 //while (true)
                                 //{
                                 //    if (powerUsage_YearValuesButton.Width < powerUsage_YearValuesButton.GetTextWidth())
@@ -934,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),
@@ -946,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);
@@ -958,6 +968,7 @@
                 var esRunStatus_ChargeValuesView = new FrameLayout()
                 {
                     X = Application.GetRealWidth(15),
+                    Y = Application.GetRealWidth(6),
                     Width = Application.GetRealWidth(128),
                     Height = Application.GetRealWidth(128),
                 };
@@ -965,21 +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 = "BEBAS",
+                    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)",
@@ -993,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),
                 };
@@ -1007,7 +1019,7 @@
                     TextColor = CSS_Color.FirstLevelTitleColor,
                     TextSize = 24,
                     IsBold = true,
-                FontName = "BEBAS",
+                FontName = fontName,
                 };
                 esRunStatus_DischargeValuesView.AddChidren(esRunStatus_DischargeValuesButton);
 
@@ -1076,37 +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 = "BEBAS",
+                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()
             {
@@ -1146,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()),
@@ -1157,26 +1180,23 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextAlignment = TextAlignment.BottomLeft,
                 IsBold = true,
-                FontName = "BEBAS",
+                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()
             {
@@ -1216,37 +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 = "BEBAS",
+                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()
             {
@@ -1359,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