dc/Commands/Command.S2F35.cs

67 regels
2.8 KiB
C#

2022-04-01 17:03:54 +08:00
// ********************************************************************************
// 文件名字: Command.S2F35
// 文件描述: Command.S2F35
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 Command.S2F35.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using ARI.EAP.HOST;
using ARI.EAP.HOST.Common;
using ARI.EAP.HOST.SRD;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System;
using System.Collections.Generic;
namespace Glorysoft.SECS.EQP.Commands
{
public partial class Command
{
public static void S2F35Command(S2F35Item items, object tag = null)
{
if (SimulatorInfo.Instance.Context != null && SimulatorInfo.Instance.Context.IsConnected)
{
var trans = SimulatorInfo.Instance.Context.GetTransaction(2, 35, "S2F35");
trans.Primary.Root.Item(1).SetValue(eSECS_FORMAT.U4, items.DATAID);
var sc = tag as Scenario;
if (!EquipmentStatus.initStatus)
{
foreach (var item in items.Events)
{
var evt = SECSUtil.CreateSECSItem("", eSECS_FORMAT.LIST);
evt.Add(SECSUtil.CreateSECSItem(nameof(item.CEID), eSECS_FORMAT.U4, item.CEID));
evt.Add(SECSUtil.CreateSECSItem("", eSECS_FORMAT.LIST));
foreach (var rptid in item.RPTIDs)
{
evt.Item(2).Add(SECSUtil.CreateSECSItem("RPTID", eSECS_FORMAT.U4, rptid));
}
trans.Primary.Root.Item(2).Add(evt);
}
}
else
{
2022-12-16 13:01:24 +08:00
foreach(var even in Configurations.conf.sRDConfiguration.events)
2022-04-01 17:03:54 +08:00
{
var evt = SECSUtil.CreateSECSItem(even.name, eSECS_FORMAT.LIST);
evt.Add(SECSUtil.CreateSECSItem("CEID", eSECS_FORMAT.U4, even.ceid));
evt.Add(SECSUtil.CreateSECSItem("", eSECS_FORMAT.LIST));
evt.Item(2).Add(SECSUtil.CreateSECSItem("RPTID", eSECS_FORMAT.U4, even.reportid));
trans.Primary.Root.Item(2).Add(evt);
}
}
trans.Tag = tag;
SimulatorInfo.Instance.Context.SendMessage(trans);
if (!EquipmentStatus.initStatus)
2022-12-16 13:01:24 +08:00
Global.MF.addlog(trans, LoggerService.Send, "Delete Link Report", 0);
2022-04-01 17:03:54 +08:00
else
2022-12-16 13:01:24 +08:00
Global.MF.addlog(trans, LoggerService.Send, "Define Link Report", 0);
2022-04-01 17:03:54 +08:00
LoggerService.SECSLogger.Info(trans.Primary);
}
}
}
}