dc/Handlers/S2F14Handler.cs
13118993771@163.com 562bd7a7b8 新版
2023-02-23 11:33:23 +08:00

56 lines
1.9 KiB
C#

// ********************************************************************************
// 文件名字: S1F4Handler
// 文件描述: S1F4Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S1F4Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using ARI.EAP.HOST;
using ARI.EAP.HOST.MQ;
using ARI.EAP.HOST.MQ.body;
using ARI.EAP.HOST.SRD;
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S2F14Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "ECRequest";
ECRequestBody eCRequestBody = new ECRequestBody();
int index = 1;
foreach(var ec in Configurations.conf.sRDConfiguration.ecvs)
{
if (trans.Secondary.Root.Item(index).Value != null)
{
eCRequestBody.ECList.Add(ec.name, trans.Secondary.Root.Item(index).Value.ToString());
}
trans.Secondary.Root.Item(index).Name = ec.name;
index++;
}
Global.MF.addlog(trans, LoggerService.Receive, "Equipment Constant Request", 1);
LoggerService.SECSLogger.Info(trans.Secondary);
mQMessage.body = eCRequestBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
if (trans.Tag != null)
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}
}