修正IoManager对象中重复创建OnTimer线程的问题。

This commit is contained in:
SL 2023-08-09 17:46:27 +08:00
parent 3e6f08c0f8
commit 3659369911
1 changed files with 3 additions and 2 deletions

View File

@ -50,7 +50,7 @@ namespace MECF.Framework.Common.IOCore
private Dictionary<string, List<NotifiableIoItem>> _ioItemList = new Dictionary<string, List<NotifiableIoItem>>();
private PeriodicJob _monitorThread;
public void Initialize(string interlockConfigFile)
{
string reason = string.Empty;
@ -58,7 +58,6 @@ namespace MECF.Framework.Common.IOCore
{
throw new Exception($"interlock define file found error: \r\n {reason}");
}
_monitorThread = new PeriodicJob(200, OnTimer, "IO Monitor Thread", isStartNow: true);
}
private bool OnTimer()
@ -113,6 +112,8 @@ namespace MECF.Framework.Common.IOCore
OP.Subscribe("System.SetAoValueWithPrivoder", InvokeSetAoWithPrivoder);
OP.Subscribe("System.SetAiBuffer", InvokeSetAiBuffer);
OP.Subscribe("System.SetDiBuffer", InvokeSetDiBuffer);
_monitorThread = new PeriodicJob(200, OnTimer, "IO Monitor Thread", isStartNow: true);
}
private bool InvokeSetDo(string arg1, object[] args)