From dbc23459fdf4e8b74a5f955fbb9fc631b4babc70 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 17 三月 2021 11:56:16 +0800
Subject: [PATCH] Merge branch 'temp-wxr' into WJC
---
HDL_ON/Entity/FunctionList.cs | 23 +++++++++++++++++++----
1 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index 7239051..0d05bdb 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -201,7 +201,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 +218,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