From cd8cdf7eb281af3b7a5f2b61bd21f1aa0adf7524 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期一, 17 十月 2022 11:51:29 +0800
Subject: [PATCH] 2022年10月17日11:51:16

---
 HDL_ON/Entity/FunctionList.cs |   41 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index 55d26a3..cf3f154 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -24,7 +24,11 @@
                     var filePathList = FileUtlis.Files.ReadFiles();
                     foreach (var filePath in filePathList)
                     {
-                        _FunctionList.IniFunctionList(filePath);
+                        try
+                        {
+                            _FunctionList.IniFunctionList(filePath);
+                        }
+                        catch { }
                     }
                     #endregion
                 }
@@ -98,6 +102,21 @@
             return Functions.FindAll((obj) => spkList.Contains(obj.spk));
         }
 
+        List<InverterInfo> _inverterList = new List<InverterInfo>();
+        /// <summary>
+        /// 鍏変紡鍒楄〃
+        /// </summary>
+        public List<InverterInfo> InverterList
+        {
+            get
+            {
+                return _inverterList;
+            }
+            set
+            {
+                _inverterList = value;
+            }
+        }
         #region 瀹剁數鍒楄〃 electricals
         /// <summary>
         /// 瀹剁數鍒楄〃
@@ -459,12 +478,26 @@
 
                     if(DriverLayer.Control.Ins.GatewayOnline_Local)
                     {
+
+                        //List<Function> functions = GetDeviceFunctionList(SPK.BrandType.Hdl);
+                        //var sss = functions.OrderBy((obj) => obj.collect);
+
+                        List<Function> readList = new List<Function>();
                         foreach (var function in GetDeviceFunctionList(SPK.BrandType.Hdl))
                         {
+                            readList.Add(function);
                             MainPage.Log($"璇诲彇鍔熻兘鐘舵�侊細{function.name} : {function.sid} ");
-                            Control.Ins.SendReadCommand(function);
+                            if (readList.Count > 9)
+                            {
+                                Control.Ins.SendReadCommand(readList);
+                                readList.Clear();
+                            }
                         }
-                        if(DB_ResidenceData.Instance.GatewayType == 1)
+                        if (readList.Count > 0)
+                        {
+                            Control.Ins.SendReadCommand(readList);
+                        }
+                        if (DB_ResidenceData.Instance.GatewayType == 1)
                         {
                             Dictionary<string, string> pairs = new Dictionary<string, string>();
                             string sendId = Control.Ins.msg_id.ToString();
@@ -481,6 +514,8 @@
                         var page = new List<string>();
                         int count = 0;
 
+                        //List<Function> functions = GetDeviceFunctionList(SPK.BrandType.Hdl);
+                        //var sss = functions.OrderBy((obj) => obj.collect);
                         foreach (var function in GetDeviceFunctionList(SPK.BrandType.Hdl))
                         {
                             page.Add(function.deviceId);

--
Gitblit v1.8.0