dc/Commands/Command.S2F49.cs
13118993771@163.com 5e9d0f1e2d EAP
2022-04-01 17:03:54 +08:00

44 lines
2.0 KiB
C#

// ********************************************************************************
// 文件名字: Command.S2F49
// 文件描述: Command.S2F49
// 开发人员: Hupe
// 创建时间: 2021/4/14 16:12
//
// 更新历史:
// + 创建 Command.S2F49.cs 文件. by Hupe @2021/4/14 16:12
// ********************************************************************************
using System;
using System.Collections.Generic;
using ARI.EAP.HOST;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
namespace Glorysoft.SECS.EQP.Commands
{
public static partial class Command
{
public static void S2F49Command(S2F49Item items, object tag = null)
{
if (SimulatorInfo.Instance.Context != null && SimulatorInfo.Instance.Context.IsConnected)
{
var trans = SimulatorInfo.Instance.Context.GetTransaction(2, 49, "S2F49");
trans.Primary.Root.Item(1).SetValue(eSECS_FORMAT.U4, items.DATAID);
trans.Primary.Root.Item(2).SetValue(eSECS_FORMAT.ASCII, items.OBJSPEC);
trans.Primary.Root.Item(3).SetValue(eSECS_FORMAT.ASCII, items.RCMD);
foreach (var item in items.PARAMS)
{
var param = SECSUtil.CreateSECSItem("", eSECS_FORMAT.LIST);
param.Add(SECSUtil.CreateSECSItem(nameof(item.ParanName), eSECS_FORMAT.ASCII, item.ParanName));
param.Add(SECSUtil.CreateSECSItem(nameof(item.ParanName), eSECS_FORMAT.ASCII, item.ParanVal));
trans.Primary.Root.Item(4).Add(param);
}
SimulatorInfo.Instance.Context.SendMessage(trans);
Global.MF.addlog(LoggerService.HtoE, $"S{trans.Primary.Stream}F{trans.Primary.Function}", LoggerService.Send, trans.Description, "=" + trans.Primary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Primary);
}
}
}
}