dc/Handlers/S7F6Handler.cs

38 lines
1.3 KiB
C#
Raw Normal View History

2022-04-01 17:03:54 +08:00
// ********************************************************************************
// 文件名字: S7F6Handler
// 文件描述: S7F6Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S7F6Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECSwell;
using System.IO;
using System.Threading;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S7F6Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Secondary;
S7F6Item item = new S7F6Item();
item.PPID = reply.Root.Item(1).Value.ToString();
item.PPBODY = (byte[])reply.Root.Item(2).Value;
//
//string.Format(context.LogPath);
File.WriteAllBytes(context.LogPath+item.PPID, item.PPBODY);
//
SimulatorInfo.Instance.WorkFLowFlag = "Y";
//
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}