Merge branch 'feature/MuitiProcess' into DevelopBase

# Conflicts:
#	MECF.Framework.Common/Properties/Resources.Designer.cs
This commit is contained in:
SIC1016\caipeilun 2024-02-26 13:44:06 +08:00
commit 2374bbf5d3
1 changed files with 26 additions and 7 deletions

View File

@ -1,5 +1,6 @@
using Aitex.Core.RT.DataCenter;
using Aitex.Core.RT.Event;
using Aitex.Core.RT.Log;
using Aitex.Core.RT.OperationCenter;
using Aitex.Core.RT.SCCore;
using Aitex.Core.Util;
@ -48,7 +49,7 @@ namespace MECF.Framework.Common.MultiProcess.ProcessCenter
private readonly PeriodicJob _threadMonitor;
private bool _isConnected = true;
private bool _isConnected = false;
protected readonly R_TRIG _connectionTrig = new();
private bool _isPM1Installed = false;
@ -147,7 +148,7 @@ namespace MECF.Framework.Common.MultiProcess.ProcessCenter
public MultiProcessClient()
{
_threadMonitor = new PeriodicJob(10000, OnTimer, "MultiProcessHandleThread", true, true);
_threadMonitor = new PeriodicJob(10000, OnTimer, "MultiProcessHandleThread", false, true);
}
#endregion Constructors
@ -181,8 +182,30 @@ namespace MECF.Framework.Common.MultiProcess.ProcessCenter
OP.Subscribe("MultiProcessClient.UpdateChamberState", UpdateChamberState2);
#endregion
SC.RegisterValueChangedCallback("System.MultiProcessMode", (newValue) =>
{
bool workenable = false;
if (bool.TryParse(newValue.ToString(), out workenable))
{
if (workenable)
{
_threadMonitor.Start();
}
else
{
_threadMonitor.Stop();
}
}
});
}
/// <summary>
/// 实时发送本机腔体状态
/// </summary>
@ -282,11 +305,7 @@ namespace MECF.Framework.Common.MultiProcess.ProcessCenter
/// </summary>
private bool UpdateChamberState()
{
var workenable = SC.GetValue<bool>("System.MultiProcessMode");
if (workenable)
{
_isConnected = UpdateState();
}
_isConnected = UpdateState();
_connectionTrig.CLK = _isConnected;
if (_connectionTrig.Q)