From 66c72ee19b9e3543537621b8dd25685c9b5c03c4 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 02 八月 2022 14:05:30 +0800
Subject: [PATCH] RGB色盘优化,第三方平台对接功能

---
 HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs
index 9455d9a..495e602 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs
@@ -174,20 +174,28 @@
             echartsView.AddChidren(myEchartsView_Pie);
 
             Dictionary<string, string> list = new Dictionary<string, string>();
+
+            int count = 0;
             foreach(var ene in energyList)
             {
+                if (count > 10)
+                {
+                    break;
+                }
                 double tt = 0;
                 double.TryParse(ene.GetAttrState(FunctionAttributeKey.TotalElectricity), out tt);
                 tt *= 100;//涔樹互100锛屽皬浜�1鏃犳硶鍔犺浇echart
                 tt = Math.Round(tt, 2);
-                if (list.ContainsKey(ene.name))
+                string key = ene.name;
+                if (list.ContainsKey(key))
                 {
-                    list.Add(ene.name + "1", tt.ToString());
+                    list.Add(ene.name + DateTime.Now.ToLongTimeString(), tt.ToString());
                 }
                 else
                 {
                     list.Add(ene.name, tt.ToString());
                 }
+                count++;
             }
             myEchartsView_Pie.ShowWithOption(new EchartsOption_Pie().InitDateJson(list));
 
@@ -219,6 +227,10 @@
             int index = 0;
             foreach (var energy in energyList)
             {
+                if (index > 10)
+                {
+                    break;
+                }
                 EnergyRow(energy, energyListView, index);
                 index++;
                 new System.Threading.Thread(() =>
@@ -562,8 +574,14 @@
             double totalValue = 0;
             double realtimeValue = 0;
             Dictionary<string, string> list = new Dictionary<string, string>();//楗煎浘鏁版嵁
+            int count = 0;
             foreach (var ene in bodyView.energyList)
             {
+                if (count > 10)
+                {
+                    break;
+                }
+                count++;
                 double power = 0.00;
                 double.TryParse(ene.GetAttrState(FunctionAttributeKey.TotalElectricity), out power);
                 power = Math.Round(power, 2);

--
Gitblit v1.8.0