94 lines
4.5 KiB
C#
94 lines
4.5 KiB
C#
#region << 版 本 注 释 >>
|
||
/*----------------------------------------------------------------
|
||
* 创建者:Hupe
|
||
* 创建时间:2021/10/14 20:04:50
|
||
* 版本:V1.0.0
|
||
* 描述:
|
||
*
|
||
* ----------------------------------------------------------------
|
||
* 修改人:
|
||
* 时间:
|
||
* 修改说明:
|
||
*
|
||
* 版本:V1.0.1
|
||
*----------------------------------------------------------------*/
|
||
#endregion << 版 本 注 释 >>
|
||
|
||
using ARI.EAP.HOST.Common;
|
||
using ARI.EAP.HOST.MQ;
|
||
using ARI.EAP.HOST.MQ.body;
|
||
using ARI.EAP.HOST.SRD;
|
||
using Glorysoft.SECS.EQP;
|
||
using Glorysoft.SECS.EQP.Common;
|
||
using Glorysoft.SECS.EQP.Utilities;
|
||
using Glorysoft.SECSwell;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
|
||
|
||
namespace ARI.EAP.HOST.Handlers.EventHandlers
|
||
{
|
||
|
||
public class SlotlistHandler : IEventHandler
|
||
{
|
||
public void Execute(SECSTransaction trans, EVENT even)
|
||
{
|
||
try
|
||
{
|
||
MQMessage mQMessage = new MQMessage();
|
||
mQMessage.header.messageName = "SlotList";
|
||
SlotListBody slotListBody = new SlotListBody();
|
||
slotListBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
|
||
int index = 1;
|
||
foreach (var key in even.validVariables)
|
||
{
|
||
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
|
||
switch (name)
|
||
{
|
||
case ("Clock"):
|
||
{
|
||
slotListBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
|
||
}
|
||
break;
|
||
case ("SlotList"):
|
||
{
|
||
for (int i = 1; i < trans.Primary.Root.Item(3).Item(2).Item(index).ItemCount + 1;i++)
|
||
{
|
||
SlotList slot = new SlotList();
|
||
slot.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Item(i).Item(1).Value.ToString();
|
||
slot.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Item(i).Item(2).Value.ToString();
|
||
slot.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Item(i).Item(3).Value.ToString();
|
||
slot.target_A = trans.Primary.Root.Item(3).Item(2).Item(index).Item(i).Item(4).Value.ToString();
|
||
slot.target_B = trans.Primary.Root.Item(3).Item(2).Item(index).Item(i).Item(5).Value.ToString();
|
||
slot.target_C = trans.Primary.Root.Item(3).Item(2).Item(index).Item(i).Item(6).Value.ToString();
|
||
slot.target_D = trans.Primary.Root.Item(3).Item(2).Item(index).Item(i).Item(7).Value.ToString();
|
||
slot.reroute_A = trans.Primary.Root.Item(3).Item(2).Item(index).Item(i).Item(8).Value.ToString();
|
||
slot.reroute_B = trans.Primary.Root.Item(3).Item(2).Item(index).Item(i).Item(9).Value.ToString();
|
||
slot.reroute_C = trans.Primary.Root.Item(3).Item(2).Item(index).Item(i).Item(10).Value.ToString();
|
||
slot.reroute_D = trans.Primary.Root.Item(3).Item(2).Item(index).Item(i).Item(11).Value.ToString();
|
||
slotListBody.slotList.Add(slot);
|
||
}
|
||
}
|
||
break;
|
||
}
|
||
trans.Primary.Root.Item(3).Item(2).Item(index).Name = name;
|
||
index++;
|
||
}
|
||
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Primary.Stream}F{trans.Primary.Function}", LoggerService.Receive, even.name, "=" + trans.Primary.SystemBytes.ToString());
|
||
LoggerService.SECSLogger.Info(trans.Primary);
|
||
Global.MF.addlog(LoggerService.HtoE, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Send, even.name, "=" + trans.Secondary.SystemBytes.ToString());
|
||
LoggerService.SECSLogger.Info(trans.Secondary);
|
||
|
||
mQMessage.body = slotListBody;
|
||
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
|
||
}
|
||
catch (Exception e)
|
||
{
|
||
LoggerService.SECSLogger.Error(e);
|
||
}
|
||
}
|
||
}
|
||
} |