From 177a7911bef4111d64ec0dfc6184eebb84fe23ed Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 31 七月 2023 00:47:04 +0800
Subject: [PATCH] 三相备份

---
 HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs |  304 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 285 insertions(+), 19 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs
index f0dfb5c..359e656 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs
@@ -15,19 +15,10 @@
         static AirSwitchP3EnergyPage bodyView;
 
         /// <summary>
-        /// 鎬诲姛鑰�-楗煎浘
-        /// </summary>
-        MyEchartsViewOn myEchartsView_Pie;
-        /// <summary>
         /// 鏇茬嚎鍥炬暟鎹畇tring
         /// </summary>
         EchartsOption_BrokenLine brokenLine;
 
-
-        /// <summary>
-        /// 鎻掓煡璇㈢殑鑳芥簮鍒楄〃
-        /// </summary>
-        List<Function> queryList = new List<Function>();
         /// <summary>
         /// 鏌ヨ鏉′欢
         /// hour銆亀eek銆乵onth
@@ -35,10 +26,6 @@
         string curQueryType = "hour";
 
 
-        /// <summary>
-        /// 鑳芥簮鍒楄〃鍖哄煙
-        /// </summary>
-        FrameLayout energyListView;
         /// <summary>
         /// 鍘嗗彶鏁版嵁鍥捐〃
         /// </summary>
@@ -69,6 +56,7 @@
                 Y = Application.GetRealHeight(64),
                 Height = Application.GetRealHeight(667-64),
                 BackgroundColor = 0xFFF5F7FA,
+                ScrollEnabled = false,
             };
             bodyView.AddChidren(contentView);
 
@@ -165,6 +153,12 @@
 
             btnShowHistroyData_Total.MouseUpEventHandler = (sender, e) =>
             {
+                if(curQueryType == "total")
+                {
+                    return;
+                }
+                curQueryType = "total";
+
                 (sender as Button).SelectedBackgroundColor = 0x1F5C62FE;
                 (sender as Button).BackgroundColor = 0x1F5C62FE;
                 (sender as Button).BorderColor = CSS_Color.MainColor;
@@ -188,11 +182,16 @@
                 btnShowHistroyData_Day.BorderColor = CSS_Color.PromptingColor1;
                 btnShowHistroyData_Day.BackgroundColor = 0x00000000;
                 btnShowHistroyData_Day.SelectedBackgroundColor = 0x00000000;
-            };
 
+               
+            };
 
             btnShowHistroyData_Day.MouseUpEventHandler = (sender, e) =>
             {
+                if(curQueryType == "hour")
+                {
+                    return;
+                }
                 (sender as Button).SelectedBackgroundColor = 0x1F5C62FE;
                 (sender as Button).BackgroundColor = 0x1F5C62FE;
                 (sender as Button).BorderColor = CSS_Color.MainColor;
@@ -216,10 +215,18 @@
                 btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1;
                 btnShowHistroyData_Total.BackgroundColor = 0x00000000;
                 btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000;
+
+                curQueryType = "hour";
+                brokenLine.YvalueText = "";
+                LoadMothed_GetHistoryData();
             };
 
             btnShowHistroyData_Month.MouseUpEventHandler = (sender, e) =>
             {
+                if(curQueryType == "month")
+                {
+                    return;
+                }
                 (sender as Button).SelectedBackgroundColor = 0x1F5C62FE;
                 (sender as Button).BackgroundColor = 0x1F5C62FE;
                 (sender as Button).BorderColor = CSS_Color.MainColor;
@@ -243,10 +250,19 @@
                 btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1;
                 btnShowHistroyData_Total.BackgroundColor = 0x00000000;
                 btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000;
+
+                curQueryType = "month";
+                brokenLine.YvalueText = "";
+                LoadMothed_GetHistoryData();
             };
 
             btnShowHistroyData_Year.MouseUpEventHandler = (sender, e) =>
             {
+                if(curQueryType == "year_month")
+                {
+                    return;
+                }
+
                 (sender as Button).SelectedBackgroundColor = 0x1F5C62FE;
                 (sender as Button).BackgroundColor = 0x1F5C62FE;
                 (sender as Button).BorderColor = CSS_Color.MainColor;
@@ -270,6 +286,11 @@
                 btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1;
                 btnShowHistroyData_Total.BackgroundColor = 0x00000000;
                 btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000;
+
+
+                curQueryType = "year_month";
+                brokenLine.YvalueText = "";
+                LoadMothed_GetHistoryData();
             };
 
             #endregion
@@ -284,6 +305,8 @@
                 Gravity = Gravity.CenterHorizontal,
                 Width = Application.GetRealWidth(343),
                 Height = Application.GetRealWidth(330),
+                Radius = (uint)Application.GetRealWidth(16),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
             };
             contentView.AddChidren(historyDataView);
 
@@ -294,9 +317,237 @@
             };
             historyDataView.AddChidren(myEchartsView_Line);
 
-            //EnergyRow(energy, energyListView, index);
+            var btnTip = new Button()
+            {
+                Y = Application.GetRealHeight(289),
+                Height = Application.GetRealHeight(41),
+                Width = Application.GetRealWidth(300),
+                TextAlignment = TextAlignment.Center,
+                Gravity = Gravity.CenterHorizontal,
+                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                TextColor = CSS_Color.FirstLevelTitleColor,
+                TextID = StringId.AirSwitchP3HistroyTip1,
+            };
+            historyDataView.AddChidren(btnTip);
 
             LoadMothed_GetHistoryData();
+
+            #region A
+            contentView.AddChidren(new Button()
+            {
+                Height = Application.GetRealHeight(12),
+            });
+
+            var viewa = new FrameLayout()
+            {
+                Gravity  = Gravity.CenterHorizontal,
+                Width = Application.GetRealWidth(343),
+                Height = Application.GetRealHeight(52),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+                Radius = (uint)Application.GetRealWidth(12),
+            };
+            contentView.AddChidren(viewa);
+
+            Button btnRighta = new Button()
+            {
+                X = Application.GetRealWidth(321),
+                Gravity = Gravity.CenterVertical,
+                Width = Application.GetMinRealAverage(16),
+                Height = Application.GetMinRealAverage(16),
+                UnSelectedImagePath = "Public/Right.png",
+            };
+            viewa.AddChidren(btnRighta);
+
+            Button btnTitlea = new Button()
+            {
+                X = Application.GetRealWidth(16),
+                TextAlignment = TextAlignment.CenterLeft,
+                TextSize = CSS_FontSize.TextFontSize,
+                TextColor= 0xFF000000,
+                Width = Application.GetRealWidth(300),
+                TextID = StringId.RealTimeElectricityConsumptionDataOfPhaseA
+            };
+            viewa.AddChidren(btnTitlea);
+            #endregion
+
+
+            #region B
+            contentView.AddChidren(new Button()
+            {
+                Height = Application.GetRealHeight(12),
+            });
+
+            var viewb = new FrameLayout()
+            {
+                Gravity  = Gravity.CenterHorizontal,
+                Width = Application.GetRealWidth(343),
+                Height = Application.GetRealHeight(52),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+                Radius = (uint)Application.GetRealWidth(12),
+            };
+            contentView.AddChidren(viewb);
+
+            Button btnRightb = new Button()
+            {
+                X = Application.GetRealWidth(321),
+                Gravity = Gravity.CenterVertical,
+                Width = Application.GetMinRealAverage(16),
+                Height = Application.GetMinRealAverage(16),
+                UnSelectedImagePath = "Public/Right.png",
+            };
+            viewb.AddChidren(btnRightb);
+
+            Button btnTitleb = new Button()
+            {
+                X = Application.GetRealWidth(16),
+                Width = Application.GetRealWidth(300),
+                TextAlignment = TextAlignment.CenterLeft,
+                TextSize = CSS_FontSize.TextFontSize,
+                TextColor = 0xFF000000,
+                TextID = StringId.RealTimeElectricityConsumptionDataOfPhaseB,
+            };
+            viewb.AddChidren(btnTitleb);
+            #endregion
+
+
+            #region C
+            contentView.AddChidren(new Button()
+            {
+                Height = Application.GetRealHeight(12),
+            });
+
+            var viewc = new FrameLayout()
+            {
+                Gravity  = Gravity.CenterHorizontal,
+                Width = Application.GetRealWidth(343),
+                Height = Application.GetRealHeight(52),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+                Radius = (uint)Application.GetRealWidth(12),
+            };
+            contentView.AddChidren(viewc);
+
+            Button btnRightc = new Button()
+            {
+                X = Application.GetRealWidth(321),
+                Gravity = Gravity.CenterVertical,
+                Width = Application.GetMinRealAverage(16),
+                Height = Application.GetMinRealAverage(16),
+                UnSelectedImagePath = "Public/Right.png",
+            };
+            viewc.AddChidren(btnRightc);
+
+            Button btnTitlec = new Button()
+            {
+                X = Application.GetRealWidth(16),
+                Width = Application.GetRealWidth(300),
+                TextAlignment = TextAlignment.CenterLeft,
+                TextSize = CSS_FontSize.TextFontSize,
+                TextColor = 0xFF000000,
+                TextID = StringId.RealTimeElectricityConsumptionDataOfPhaseC,
+            };
+            viewc.AddChidren(btnTitlec);
+            #endregion
+
+
+            btnTitlea.MouseUpEventHandler = (sender, e) => {
+                var skipView = new AirSwitchP3SubloopEnergyPage(device,FunctionAttributeKey.ElectricityA);
+                MainPage.BasePageView.AddChidren(skipView);
+                skipView.LoadPage();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+            btnTitlea.MouseUpEventHandler = (sender, e) => {
+                var skipView = new AirSwitchP3SubloopEnergyPage(device, FunctionAttributeKey.ElectricityB);
+                MainPage.BasePageView.AddChidren(skipView);
+                skipView.LoadPage();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+            btnTitlea.MouseUpEventHandler = (sender, e) => {
+                var skipView = new AirSwitchP3SubloopEnergyPage(device, FunctionAttributeKey.ElectricityC);
+                MainPage.BasePageView.AddChidren(skipView);
+                skipView.LoadPage();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+
+
+
+            #region 鎬荤敤鐢甸噺
+            var totalElectricityView = new FrameLayout()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Width = Application.GetRealWidth(343),
+                Height = Application.GetRealWidth(183),
+                Radius = (uint)Application.GetRealWidth(16),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+            };
+            //historyDataView.AddChidren(totalElectricityView);
+
+            var btnTotalElectricity = new Button()
+            {
+                Width = Application.GetRealWidth(300),
+                Height = Application.GetRealHeight(55),
+                X = Application.GetRealWidth(14),
+                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                TextColor = 0xFF030D1C,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextID = StringId.TotalPowerAndUnit,
+            };
+            totalElectricityView.AddChidren(btnTotalElectricity);
+
+            var btnTotalNumber = new Button()
+            {
+                Y = Application.GetRealHeight(27),
+                Gravity = Gravity.CenterHorizontal,
+                Height = Application.GetRealHeight(167),
+                TextSize = 49,
+                TextColor = 0xFF030D1C,
+                TextAlignment = TextAlignment.Center,
+                Text = device.GetAttrState(FunctionAttributeKey.TotalElectricity),
+            };
+            totalElectricityView.AddChidren(btnTotalNumber);
+
+            btnShowHistroyData_Day.MouseUpEventHandler += (sender, e) => {
+                totalElectricityView.RemoveFromParent();
+                historyDataView.AddChidren(myEchartsView_Line);
+                viewa.Visible = true;
+                viewb.Visible = true;
+                viewc.Visible = true;
+                btnTip.TextID = StringId.AirSwitchP3HistroyTip1;
+                historyDataView.Height = Application.GetRealHeight(330);
+            };
+            btnShowHistroyData_Month.MouseUpEventHandler += (sender, e) => {
+                totalElectricityView.RemoveFromParent();
+                historyDataView.AddChidren(myEchartsView_Line);
+                viewa.Visible = true;
+                viewb.Visible = true;
+                viewc.Visible = true;
+                btnTip.TextID = StringId.AirSwitchP3HistroyTip2;
+                historyDataView.Height = Application.GetRealHeight(330);
+            };
+            btnShowHistroyData_Year.MouseUpEventHandler += (sender, e) => {
+                totalElectricityView.RemoveFromParent();
+                historyDataView.AddChidren(myEchartsView_Line);
+                viewa.Visible = false;
+                viewb.Visible = false;
+                viewc.Visible = false;
+                btnTip.TextID = StringId.AirSwitchP3HistroyTip3;
+                historyDataView.Height = Application.GetRealHeight(330);
+            };
+            btnShowHistroyData_Total.MouseUpEventHandler += (sender, e) => {
+                myEchartsView_Line.RemoveFromParent();
+                historyDataView.AddChidren(totalElectricityView);
+                viewa.Visible = false;
+                viewb.Visible = false;
+                viewc.Visible = false;
+                historyDataView.Height = Application.GetRealHeight(184);
+            };
+
+
+
+
+
+            #endregion
+
+
 
         }
 
@@ -337,10 +588,25 @@
                                     "813","313","213","123",
                                     "113","213","183","133",
                                     "133","513","133","413",
+                                    "813","313","213","123",
+                                    "113","213","183","133",
+                                    "133","513","133","413",
                                 };
                                     brokenLine.InitXdataText(vs);
                                 revertData = new List<EnvironmentalSensorHistor>()
                                 {
+                                    new EnvironmentalSensorHistor{ fieldValue = "100"},
+                                    new EnvironmentalSensorHistor{ fieldValue = "200"},
+                                    new EnvironmentalSensorHistor{ fieldValue = "300"},
+                                    new EnvironmentalSensorHistor{ fieldValue = "400"},
+                                    new EnvironmentalSensorHistor{ fieldValue = "500"},
+                                    new EnvironmentalSensorHistor{ fieldValue = "400"},
+                                    new EnvironmentalSensorHistor{ fieldValue = "100"},
+                                    new EnvironmentalSensorHistor{ fieldValue = "200"},
+                                    new EnvironmentalSensorHistor{ fieldValue = "300"},
+                                    new EnvironmentalSensorHistor{ fieldValue = "400"},
+                                    new EnvironmentalSensorHistor{ fieldValue = "500"},
+                                    new EnvironmentalSensorHistor{ fieldValue = "400"},
                                     new EnvironmentalSensorHistor{ fieldValue = "100"},
                                     new EnvironmentalSensorHistor{ fieldValue = "200"},
                                     new EnvironmentalSensorHistor{ fieldValue = "300"},
@@ -358,7 +624,7 @@
                                 {
                                     device.attributes.Add(new FunctionAttributes() { key = "ydata" });
                                 }
-                                device.SetAttrState("ydata", brokenLine.InitYdataText(device.name, revertData, "#5C62FE") + ", ");
+                                device.SetAttrState("ydata", brokenLine.InitYdataText2(device.name, revertData, "#5C62FE", curQueryType == "year_month") + ", ");
 
 #endif
                             }
@@ -377,18 +643,18 @@
                                 {
                                     device.attributes.Add(new FunctionAttributes() { key = "ydata" });
                                 }
-                                device.SetAttrState("ydata", brokenLine.InitYdataText(device.name, revertData, "#5C62FE") + ", ");
+                                device.SetAttrState("ydata", brokenLine.InitYdataText2(device.name, revertData, "#5C62FE", curQueryType == "year_month") + ", ");
                             }
                         }
                     }
-                    brokenLine.yTitle = Language.StringByID(StringId.EnergyConsumption) + "(kW)";
+                    brokenLine.yTitle = Language.StringByID(StringId.Uint) + "(KW路h)";
                     brokenLine.xTitle = Language.StringByID(StringId.timeMode);
                     if (curQueryType != "hour")
                     {
                         brokenLine.xTitle = Language.StringByID(StringId.Date);
                     }
-                    var opString = brokenLine.InitOption(30);
 
+                    var opString = brokenLine.InitOption(50, curQueryType == "year_month");
                     Application.RunOnMainThread(() =>
                     {
                         myEchartsView_Line.ShowWithOption(opString);

--
Gitblit v1.8.0