This commit is contained in:
HCL 2024-05-31 17:42:23 +08:00
parent 6458fe5c9e
commit 5dc0e99648
1 changed files with 95 additions and 18 deletions

View File

@ -15,6 +15,7 @@ using Aitex.Core.RT.Event;
using Aitex.Core.RT.SCCore;
using Aitex.Core.RT.Log;
using SciChart.Core.Extensions;
using MECF.Framework.Common.OperationCenter;
namespace MECF.Framework.Common.Gem
{
@ -192,6 +193,12 @@ namespace MECF.Framework.Common.Gem
_equipment.RegisterRemoteCommandHandler("START", OnReceivedRemoteCommand);
_equipment.RegisterRemoteCommandHandler("ABORT", OnReceivedRemoteCommand);
_equipment.RegisterRemoteCommandHandler("STOP", OnReceivedRemoteCommand);
_equipment.RegisterRemoteCommandHandler("ONLINE", OnReceivedRemoteCommand);
_equipment.RegisterRemoteCommandHandler("OFFLINE", OnReceivedRemoteCommand);
_equipment.RegisterRemoteCommandHandler("CREATETRAY", OnReceivedRemoteCommand);
_equipment.RegisterRemoteCommandHandler("DELETETRAY", OnReceivedRemoteCommand);
_equipment.RegisterRemoteCommandHandler("CREATEWAFER", OnReceivedRemoteCommand);
_equipment.RegisterRemoteCommandHandler("DELETEWAFER", OnReceivedRemoteCommand);
_equipment.EventTriggered += EventTriggered;
@ -665,25 +672,95 @@ namespace MECF.Framework.Common.Gem
}
break;
////ABORT指令没有附加参数
//case "ABORT":
//case "STOP":
// {
// if (RtStatus != "AutoRunning")
// {
// Kxware.Common.Log.Warn("GEM", $"Cannot perform 'ABORT' command. Equipment State is not in AutoRunning.");
// result = enumRemoteCommandAckCode.CannotPerformNow;
// }
// else
// {
// Kxware.Common.Log.Info("GEM", $"Received 'ABORT' command.");
// result = enumRemoteCommandAckCode.AcknowledgeCommandWillBePerformed;
//ABORT指令没有附加参数
case "ABORT":
case "STOP":
{
if (RtStatus != "AutoRunning")
{
Kxware.Common.Log.Warn("GEM", $"Cannot perform 'ABORT' command. Equipment State is not in AutoRunning.");
result = enumRemoteCommandAckCode.CannotPerformNow;
}
else
{
Kxware.Common.Log.Info("GEM", $"Received 'ABORT' command.");
result = enumRemoteCommandAckCode.AcknowledgeCommandWillBePerformed;
// //具体操作
// OP.DoOperation("System.Abort");
// }
// }
// break;
//具体操作
OP.DoOperation("System.Abort");
}
}
break;
//ONLINE指令附加参数(ModuleID)
case "ONLINE":
{
Kxware.Common.Log.Info("GEM", $"Received 'ONLINE' command.");
result = enumRemoteCommandAckCode.AcknowledgeCommandWillBePerformed;
string module = remoteCommandParameters.Find(p => p.CPNAME == "ModuleID").CPVAL.GetValueAsString();
OP.DoOperation($"{module}.SetOnline");
}
break;
//OFFLINE指令附加参数(ModuleID)
case "OFFLINE":
{
Kxware.Common.Log.Info("GEM", $"Received 'OFFLINE' command.");
result = enumRemoteCommandAckCode.AcknowledgeCommandWillBePerformed;
string module = remoteCommandParameters.Find(p => p.CPNAME == "ModuleID").CPVAL.GetValueAsString();
OP.DoOperation($"{module}.SetOffline");
}
break;
//CREATETRAY指令附加参数(ModuleID,SlotID)
case "CREATETRAY":
{
Kxware.Common.Log.Info("GEM", $"Received 'CREATETRAY' command.");
result = enumRemoteCommandAckCode.AcknowledgeCommandWillBePerformed;
string module = remoteCommandParameters.Find(p => p.CPNAME == "ModuleID").CPVAL.GetValueAsString();
int slot = remoteCommandParameters.Find(p => p.CPNAME == "SlotID").CPVAL.GetValueAsInt(0);
OP.DoOperation($"CreateTray",module,slot);
}
break;
//DELETETRAY指令附加参数(ModuleID)
case "DELETETRAY":
{
Kxware.Common.Log.Info("GEM", $"Received 'DELETETRAY' command.");
result = enumRemoteCommandAckCode.AcknowledgeCommandWillBePerformed;
string module = remoteCommandParameters.Find(p => p.CPNAME == "ModuleID").CPVAL.GetValueAsString();
int slot = remoteCommandParameters.Find(p => p.CPNAME == "SlotID").CPVAL.GetValueAsInt(0);
OP.DoOperation($"DeleteTray", module, slot);
}
break;
//CREATEWAFER指令附加参数(ModuleID)
case "CREATEWAFER":
{
Kxware.Common.Log.Info("GEM", $"Received 'CREATEWAFER' command.");
result = enumRemoteCommandAckCode.AcknowledgeCommandWillBePerformed;
string module = remoteCommandParameters.Find(p => p.CPNAME == "ModuleID").CPVAL.GetValueAsString();
int slot = remoteCommandParameters.Find(p => p.CPNAME == "SlotID").CPVAL.GetValueAsInt(0);
OP.DoOperation($"CreateWafer", module, slot);
}
break;
//DELETEWAFER指令附加参数(ModuleID)
case "DELETEWAFER":
{
Kxware.Common.Log.Info("GEM", $"Received 'DELETEWAFER' command.");
result = enumRemoteCommandAckCode.AcknowledgeCommandWillBePerformed;
string module = remoteCommandParameters.Find(p => p.CPNAME == "ModuleID").CPVAL.GetValueAsString();
int slot = remoteCommandParameters.Find(p => p.CPNAME == "SlotID").CPVAL.GetValueAsInt(0);
OP.DoOperation($"DeleteWafer", module, slot);
}
break;
default:
{