From 7083d7dd627f2094827f7088e5646b0309b02d2d Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期三, 17 三月 2021 14:38:31 +0800 Subject: [PATCH] 2.优化调整第三方设备列表接口 --- HDL_ON/Entity/FunctionList.cs | 29 +++++++++++++++++++++++++---- 1 files changed, 25 insertions(+), 4 deletions(-) diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index 7239051..655ebd5 100644 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -34,6 +34,12 @@ /// 鍔熻兘鍒楄〃 /// </summary> public List<Function> Functions = new List<Function>(); + /// <summary> + /// 璁惧spk鍒楄〃 + /// </summary> + public List<string> DeviceSpk = new List<string>() { + SPK.IrModule + }; /// <summary> /// 绌鸿皟鍒楄〃 @@ -201,7 +207,11 @@ /// 鍔犺浇鍔熻兘鍒楄〃 /// </summary> /// <param name="filePath"></param> - public void IniFunctionList(string filePath) + /// <param name="checkRepeat"> + /// <para>鑰冭檻鍒版�ц兘闂杩藉姞姝ゅ彉閲�,鏄惁妫�娴嬮噸澶�,鍙function鏈夋晥</para> + /// <para>true:褰撻噸澶嶅瓨鍦ㄦ椂,鏇挎崲鎺�</para> + /// <para>false:鐩存帴鏃犳潯浠舵坊鍔�</para></param> + public void IniFunctionList(string filePath, bool checkRepeat = false) { // todo 澧炲姞璁惧锛屽鍔犲姛鑳借繘鍔熻兘鍒楄〃 if (filePath.StartsWith("FunctionData_")) @@ -214,10 +224,21 @@ FileUtlis.Files.DeleteFile(filePath); return; } - - + if (checkRepeat == true) + { + //妫�娴嬮噸澶� + for (int i = 0; i < Functions.Count; i++) + { + if (Functions[i].deviceId == tempFunction.deviceId) + { + //鍏堢Щ闄ゆ帀鍐嶅姞 + Functions.RemoveAt(i); + Functions.Add(tempFunction); + return; + } + } + } Functions.Add(tempFunction); - } if (filePath.StartsWith("SceneData_")) { -- Gitblit v1.8.0