This commit is contained in:
13118993771@163.com
2022-04-01 17:03:54 +08:00
commit 5e9d0f1e2d
1528 changed files with 1474439 additions and 0 deletions

24
Handlers/ErrorHandler.cs Normal file
View File

@@ -0,0 +1,24 @@
// ********************************************************************************
// 文件名字: ErrorHandler
// 文件描述: ErrorHandler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 ErrorHandler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System;
namespace Glorysoft.SECS.EQP.Handlers
{
public class ErrorHandler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
}
}
}

View File

@@ -0,0 +1,96 @@
#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 AlarmClearedHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "AlarmReport";
AlarmReportBody alarmReportBody = new AlarmReportBody();
alarmReportBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
alarmReportBody.alarmStatus = "0";
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("AlarmID"):
{
alarmReportBody.alarmCode = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
alarmReportBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("StateFlag"):
{
alarmReportBody.stateFlag = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("AlarmText"):
{
alarmReportBody.alarmText = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("AlarmCategory"):
{
alarmReportBody.alarmCategory = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = alarmReportBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,96 @@
#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 AlarmDetectedHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "AlarmReport";
AlarmReportBody alarmReportBody = new AlarmReportBody();
alarmReportBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
alarmReportBody.alarmStatus = "1";
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("AlarmID"):
{
alarmReportBody.alarmCode = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
alarmReportBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("StateFlag"):
{
alarmReportBody.stateFlag = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("AlarmText"):
{
alarmReportBody.alarmText = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("AlarmCategory"):
{
alarmReportBody.alarmCategory = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = alarmReportBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,90 @@
#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 ContainerPlaceHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "ContainerPlace";
ContainerPlaceBody containerPlaceBody = new ContainerPlaceBody();
containerPlaceBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("Clock"):
{
containerPlaceBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
containerPlaceBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PortID"):
{
containerPlaceBody.portId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("ContainerID"):
{
containerPlaceBody.containerId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = containerPlaceBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,90 @@
#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 ContainerRemoveHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "ContainerRemove";
ContainerPlaceBody containerPlaceBody = new ContainerPlaceBody();
containerPlaceBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("Clock"):
{
containerPlaceBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
containerPlaceBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PortID"):
{
containerPlaceBody.portId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("ContainerID"):
{
containerPlaceBody.containerId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = containerPlaceBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,87 @@
#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.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 ControlStateLocalHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "ControlStateChange";
ControlStateChangeBody controlStateChangeBody = new ControlStateChangeBody();
controlStateChangeBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("Clock"):
{
controlStateChangeBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("StateFlag"):
{
controlStateChangeBody.stateFlag = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("CurrentControlState"):
{
controlStateChangeBody.currentControlState = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PreviousControlState"):
{
controlStateChangeBody.previousControlState = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = controlStateChangeBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,87 @@
#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.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 ControlStateRemoteHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "ControlStateChange";
ControlStateChangeBody controlStateChangeBody = new ControlStateChangeBody();
controlStateChangeBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("Clock"):
{
controlStateChangeBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("StateFlag"):
{
controlStateChangeBody.stateFlag = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("CurrentControlState"):
{
controlStateChangeBody.currentControlState = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PreviousControlState"):
{
controlStateChangeBody.previousControlState = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = controlStateChangeBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,87 @@
#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.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 EquipmentStateChangeHandler : IEventHandler
{
public void Execute(SECSTransaction trans,EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "EquipmentStateChange";
EquipmentStateChangeBody equipmentStateChangeBody = new EquipmentStateChangeBody();
equipmentStateChangeBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("Clock"):
{
equipmentStateChangeBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("StateFlag"):
{
equipmentStateChangeBody.stateFlag = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("CurrentEquipmentState"):
{
equipmentStateChangeBody.currentEquipmentState = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PreviousEquipmentState"):
{
equipmentStateChangeBody.previousEquipmentState = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = equipmentStateChangeBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,211 @@
#region << >>
/*----------------------------------------------------------------
* 创建者Hupe
* 创建时间2021/10/27 16:08:09
* 版本V1.0.0
* 描述:
*
* ----------------------------------------------------------------
* 修改人:
* 时间:
* 修改说明:
*
* 版本V1.0.1
*----------------------------------------------------------------*/
#endregion << >>
using ARI.EAP.HOST.Common;
using ARI.EAP.HOST.Common.Entity;
using ARI.EAP.HOST.MQ;
using ARI.EAP.HOST.MQ.body;
using ARI.EAP.HOST.SRD;
using ARI.EAP.HOST.Utilities;
using Glorysoft.SECS.EQP;
using Glorysoft.SECS.EQP.Commands;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.IO;
namespace ARI.EAP.HOST.Handlers.EventHandlers
{
/// <summary>
/// MESRequestHandler 的摘要说明
/// 利用反射将事件名称和方法对应起来
/// </summary>
public class MESRequestHandler
{
public static void Execute(MQMessage mQMessage)
{
try
{
Header header = mQMessage.header;
JObject body = null;
if (mQMessage.body != null)
{
body = JObject.Parse(mQMessage.body.ToString());
}
Type type = typeof(MESRequestHandler);
MethodInfo method = type.GetMethod(header.messageName);
if (method == null) throw new Exception("method is null");
method.Invoke(null, new object[] { body });
ReturnBody returnbody = new ReturnBody(0);
mQMessage.body = returnbody;
mQMessage.header.from = "EAP";
mQMessage.header.to = "MES";
mQMessage.header.messageType = "Response";
Task.Run(() => MainForm.mq.EAPResponse(mQMessage));
}
catch (Exception e) {
LoggerService.SECSLogger.Error("MES Request 接口映射出错:" + e);
};
}
public static void Target_Update(JObject body = null)
{
string VSubstrateId = body["virtualId"].ToString();
string substrateId = body["substrateId"].ToString();
S2F49Item item = new S2F49Item();
item.DATAID = EquipmentStatus.commandCount++;
item.OBJSPEC = "";
item.RCMD = "NEW-SUBSTRATEID";
Param p1 = new Param();
p1.ParanName = "ToolName";
p1.ParanVal = Configuration.conf.connectSetting.name;
item.PARAMS.Add(p1);
Param p2 = new Param();
p2.ParanName = "STATIONID";
p2.ParanVal = "LSTA_1";
item.PARAMS.Add(p2);
Param p3 = new Param();
p3.ParanName = "VIRTUALSUBSTRATEID";
p3.ParanVal = VSubstrateId;
item.PARAMS.Add(p3);
Param p4 = new Param();
p4.ParanName = "SUBSTRATEID";
p4.ParanVal = substrateId;
item.PARAMS.Add(p4);
Command.S2F49Command(item);
}
public static void RequestChangeControlState(JObject body = null)
{
if (body["controlState"].ToString() == "4")
{
Global.MF.pushBotton("Local");
}
else if (body["controlState"].ToString() == "5")
{
Global.MF.pushBotton("Remote");
}
}
public static void RequestS1F3(JObject body = null)
{
Global.MF.pushBotton("S1F3Request");
}
public static void RequestS2F13(JObject body = null)
{
Global.MF.pushBotton("S2F13");
}
public static void RequestS7F19(JObject body = null)
{
Global.MF.pushBotton("S7F19");
}
public static void RequestS7F5(JObject body = null)
{
}
public static void RequestS5F5(JObject body = null)
{
Global.MF.pushBotton("S5F5");
}
public static void RequestS5F3(JObject body = null)
{
if (EquipmentStatus.S5F3 == "AlarmEnable" && body["enabledorDisabled"].ToString().Equals("0"))
{
Global.MF.pushBotton("S5F3");
}
else if(EquipmentStatus.S5F3 == "AlarmDisable" && body["enabledorDisabled"].ToString().Equals("1"))
{
Global.MF.pushBotton("S5F3");
}
}
public static void RequestChangeE10State(JObject body = null)
{
S2F49Item item = new S2F49Item();
item.DATAID = EquipmentStatus.commandCount++;
item.OBJSPEC = "";
item.RCMD = "EQSTATEUPDATE";
Param p1 = new Param();
p1.ParanName = "ToolName";
p1.ParanVal = Configuration.conf.connectSetting.name;
item.PARAMS.Add(p1);
Param p2 = new Param();
p2.ParanName = "NEWSTATE";
p2.ParanVal = body["e10State"].ToString();
item.PARAMS.Add(p2);
Command.S2F49Command(item);
}
public static void RequestSlotList(JObject body = null)
{
S2F49Item item = new S2F49Item();
item.DATAID = EquipmentStatus.commandCount++;
item.OBJSPEC = "";
item.RCMD = "Slotlist_Request";
Command.S2F49Command(item);
}
public static void RequestStart(JObject body = null)
{
Global.MF.pushBotton("Connect");
}
public static void RequestStop(JObject body = null)
{
if(SimulatorInfo.Instance.Context != null)
SimulatorInfo.Instance.Context.Close();
}
public static void UploadFile(JObject body = null)
{
long fileId = long.Parse(body["fileId"].ToString());
DownLoadFileParam downLoadFileParam = new DownLoadFileParam(fileId, Constants.eapName + ".xml", "1");
string param = SECSUtil.ObjectToGetParam(downLoadFileParam);
HttpWebResponse response = HttpUtils.sentGET(Configuration.conf.httpConfiguration.fileDownloadUrl, param);
if(response.StatusCode != HttpStatusCode.OK)
{
return;
}
using(Stream respnseStream = response.GetResponseStream())
{
using(Stream fileStream = new FileStream(Constants.configuerPath, FileMode.Create))
{
byte[] bArr = new byte[1024];
int size = respnseStream.Read(bArr, 0, (int)bArr.Length);
while (size > 0)
{
fileStream.Write(bArr, 0, size);
size = respnseStream.Read(bArr, 0, (int)bArr.Length);
}
fileStream.Close();
}
respnseStream.Close();
}
}
}
}

View File

@@ -0,0 +1,83 @@
#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.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 Machine_Data_1Handler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MachineData";
MachineDataBody machineDataBody = new MachineDataBody();
machineDataBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("Clock"):
{
machineDataBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("StateFlag"):
{
machineDataBody.stateFlag = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
trans.Primary.Root.Item(3).Item(2).Item(index).Name = name;
}
break;
default:
{
machineDataBody.machineData.Add($"{key}({name})", trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString());
}
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 = machineDataBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,75 @@
#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 MaintenanceEndHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaintenanceStart/End";
MaintenanceBody maintenanceBody = new MaintenanceBody();
maintenanceBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
maintenanceBody.maintenanceFlag = "1";
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("Clock"):
{
maintenanceBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = maintenanceBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,75 @@
#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 MaintenanceStartHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaintenanceStart/End";
MaintenanceBody maintenanceBody = new MaintenanceBody();
maintenanceBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
maintenanceBody.maintenanceFlag = "0";
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("Clock"):
{
maintenanceBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = maintenanceBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,130 @@
#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 MaterialReceivedForFILOBufferHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaterialReceivedForFILOBuffer";
MaterialReceivedForTransBody materialReceivedForTransBody = new MaterialReceivedForTransBody();
materialReceivedForTransBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
materialReceivedForTransBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
materialReceivedForTransBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
materialReceivedForTransBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
materialReceivedForTransBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target A"):
{
materialReceivedForTransBody.target_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target B"):
{
materialReceivedForTransBody.target_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target C"):
{
materialReceivedForTransBody.target_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target D"):
{
materialReceivedForTransBody.target_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute A"):
{
materialReceivedForTransBody.reroutet_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute B"):
{
materialReceivedForTransBody.reroutet_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute C"):
{
materialReceivedForTransBody.reroutet_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute D"):
{
materialReceivedForTransBody.reroutet_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = materialReceivedForTransBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,130 @@
#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 MaterialReceivedForIoPortHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaterialReceivedForIoPort";
MaterialReceivedForTransBody materialReceivedForTransBody = new MaterialReceivedForTransBody();
materialReceivedForTransBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
materialReceivedForTransBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
materialReceivedForTransBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
materialReceivedForTransBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
materialReceivedForTransBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target A"):
{
materialReceivedForTransBody.target_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target B"):
{
materialReceivedForTransBody.target_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target C"):
{
materialReceivedForTransBody.target_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target D"):
{
materialReceivedForTransBody.target_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute A"):
{
materialReceivedForTransBody.reroutet_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute B"):
{
materialReceivedForTransBody.reroutet_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute C"):
{
materialReceivedForTransBody.reroutet_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute D"):
{
materialReceivedForTransBody.reroutet_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = materialReceivedForTransBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,95 @@
#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 MaterialReceivedForLSTAHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "LSTA-MaterialReceived";
LSTAMaterialReceivedBody lSTAMaterialReceivedBody = new LSTAMaterialReceivedBody();
lSTAMaterialReceivedBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("VirtualSubstrateID"):
{
lSTAMaterialReceivedBody.virtualSubstrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
lSTAMaterialReceivedBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("StationID"):
{
lSTAMaterialReceivedBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PortID"):
{
lSTAMaterialReceivedBody.portId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
lSTAMaterialReceivedBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = lSTAMaterialReceivedBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,130 @@
#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 MaterialReceivedForTransHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaterialReceivedForTrans";
MaterialReceivedForTransBody materialReceivedForTransBody = new MaterialReceivedForTransBody();
materialReceivedForTransBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
materialReceivedForTransBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
materialReceivedForTransBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
materialReceivedForTransBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
materialReceivedForTransBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target A"):
{
materialReceivedForTransBody.target_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target B"):
{
materialReceivedForTransBody.target_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target C"):
{
materialReceivedForTransBody.target_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target D"):
{
materialReceivedForTransBody.target_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute A"):
{
materialReceivedForTransBody.reroutet_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute B"):
{
materialReceivedForTransBody.reroutet_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute C"):
{
materialReceivedForTransBody.reroutet_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute D"):
{
materialReceivedForTransBody.reroutet_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = materialReceivedForTransBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,130 @@
#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 MaterialRemovedForFILOBufferHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaterialRemovedForFILOBuffer";
MaterialRemovedBody materialRemovedBody = new MaterialRemovedBody();
materialRemovedBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
materialRemovedBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
materialRemovedBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
materialRemovedBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
materialRemovedBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target A"):
{
materialRemovedBody.target_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target B"):
{
materialRemovedBody.target_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target C"):
{
materialRemovedBody.target_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target D"):
{
materialRemovedBody.target_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute A"):
{
materialRemovedBody.reroutet_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute B"):
{
materialRemovedBody.reroutet_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute C"):
{
materialRemovedBody.reroutet_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute D"):
{
materialRemovedBody.reroutet_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = materialRemovedBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,130 @@
#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 MaterialRemovedForIoPortHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaterialRemovedForIoPort";
MaterialRemovedBody materialRemovedBody = new MaterialRemovedBody();
materialRemovedBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
materialRemovedBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
materialRemovedBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
materialRemovedBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
materialRemovedBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target A"):
{
materialRemovedBody.target_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target B"):
{
materialRemovedBody.target_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target C"):
{
materialRemovedBody.target_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target D"):
{
materialRemovedBody.target_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute A"):
{
materialRemovedBody.reroutet_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute B"):
{
materialRemovedBody.reroutet_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute C"):
{
materialRemovedBody.reroutet_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute D"):
{
materialRemovedBody.reroutet_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = materialRemovedBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,130 @@
#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 MaterialRemovedForLSTAHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "LSTA-MaterialRemoved";
MaterialRemovedBody materialRemovedBody = new MaterialRemovedBody();
materialRemovedBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
materialRemovedBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
materialRemovedBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
materialRemovedBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
materialRemovedBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target A"):
{
materialRemovedBody.target_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target B"):
{
materialRemovedBody.target_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target C"):
{
materialRemovedBody.target_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target D"):
{
materialRemovedBody.target_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute A"):
{
materialRemovedBody.reroutet_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute B"):
{
materialRemovedBody.reroutet_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute C"):
{
materialRemovedBody.reroutet_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute D"):
{
materialRemovedBody.reroutet_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = materialRemovedBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,130 @@
#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 MaterialRemovedForTransHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaterialRemovedForTrans";
MaterialRemovedBody materialRemovedBody = new MaterialRemovedBody();
materialRemovedBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
materialRemovedBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
materialRemovedBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
materialRemovedBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
materialRemovedBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target A"):
{
materialRemovedBody.target_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target B"):
{
materialRemovedBody.target_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target C"):
{
materialRemovedBody.target_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target D"):
{
materialRemovedBody.target_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute A"):
{
materialRemovedBody.reroutet_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute B"):
{
materialRemovedBody.reroutet_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute C"):
{
materialRemovedBody.reroutet_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute D"):
{
materialRemovedBody.reroutet_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = materialRemovedBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,145 @@
#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 MaterialRemovedFromContainerHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaterialRemovedFromContainer";
MaterialStoredToContainerBody materialStoredToContainerBody = new MaterialStoredToContainerBody();
materialStoredToContainerBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
materialStoredToContainerBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
materialStoredToContainerBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
materialStoredToContainerBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
materialStoredToContainerBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PortID"):
{
materialStoredToContainerBody.portId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("ContainerID"):
{
materialStoredToContainerBody.containerId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("SlotID"):
{
materialStoredToContainerBody.slotId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target A"):
{
materialStoredToContainerBody.target_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target B"):
{
materialStoredToContainerBody.target_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target C"):
{
materialStoredToContainerBody.target_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target D"):
{
materialStoredToContainerBody.target_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute A"):
{
materialStoredToContainerBody.reroutet_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute B"):
{
materialStoredToContainerBody.reroutet_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute C"):
{
materialStoredToContainerBody.reroutet_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute D"):
{
materialStoredToContainerBody.reroutet_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = materialStoredToContainerBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,145 @@
#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 MaterialStoredToContainerHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaterialStoredToContainer";
MaterialStoredToContainerBody materialStoredToContainerBody = new MaterialStoredToContainerBody();
materialStoredToContainerBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
materialStoredToContainerBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
materialStoredToContainerBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
materialStoredToContainerBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
materialStoredToContainerBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PortID"):
{
materialStoredToContainerBody.portId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("ContainerID"):
{
materialStoredToContainerBody.containerId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("SlotID"):
{
materialStoredToContainerBody.slotId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target A"):
{
materialStoredToContainerBody.target_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target B"):
{
materialStoredToContainerBody.target_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target C"):
{
materialStoredToContainerBody.target_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target D"):
{
materialStoredToContainerBody.target_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute A"):
{
materialStoredToContainerBody.reroutet_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute B"):
{
materialStoredToContainerBody.reroutet_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute C"):
{
materialStoredToContainerBody.reroutet_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute D"):
{
materialStoredToContainerBody.reroutet_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = materialStoredToContainerBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,99 @@
#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 MaterialStoredToPalletHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaterialStoredToPallet";
MaterialStoredToPalletBody materialStoredToPalletBody = new MaterialStoredToPalletBody();
materialStoredToPalletBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("Clock"):
{
materialStoredToPalletBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
materialStoredToPalletBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PortID"):
{
materialStoredToPalletBody.port = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PalletID"):
{
materialStoredToPalletBody.palletId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("SubstrateID"):
{
materialStoredToPalletBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
materialStoredToPalletBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = materialStoredToPalletBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,135 @@
#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 Material_HoldHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaterialHold";
MaterialHoldBody materialHoldBody = new MaterialHoldBody();
materialHoldBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
materialHoldBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
materialHoldBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
materialHoldBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("StateFlag"):
{
materialHoldBody.stateFlag = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
materialHoldBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target A"):
{
materialHoldBody.target_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target B"):
{
materialHoldBody.target_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target C"):
{
materialHoldBody.target_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target D"):
{
materialHoldBody.target_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute A"):
{
materialHoldBody.reroutet_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute B"):
{
materialHoldBody.reroutet_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute C"):
{
materialHoldBody.reroutet_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute D"):
{
materialHoldBody.reroutet_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = materialHoldBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,100 @@
#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 Material_ReceivedHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaterialReceived";
MaterialReceivedBody materialReceivedBody = new MaterialReceivedBody();
materialReceivedBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
materialReceivedBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
materialReceivedBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
materialReceivedBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("StateFlag"):
{
materialReceivedBody.stateFlag = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PPExecName"):
{
materialReceivedBody.ppExecName = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
materialReceivedBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = materialReceivedBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,135 @@
#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 Material_RemovedHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaterialRemoved";
MaterialRemovedBody materialRemovedBody = new MaterialRemovedBody();
materialRemovedBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
materialRemovedBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
materialRemovedBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
materialRemovedBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("StateFlag"):
{
materialRemovedBody.stateFlag = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
materialRemovedBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target A"):
{
materialRemovedBody.target_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target B"):
{
materialRemovedBody.target_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target C"):
{
materialRemovedBody.target_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target D"):
{
materialRemovedBody.target_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute A"):
{
materialRemovedBody.reroutet_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute B"):
{
materialRemovedBody.reroutet_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute C"):
{
materialRemovedBody.reroutet_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute D"):
{
materialRemovedBody.reroutet_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = materialRemovedBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,135 @@
#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 Material_ScrapHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "MaterialScrap";
MaterialScrapBody materialScrapBody = new MaterialScrapBody();
materialScrapBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
materialScrapBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
materialScrapBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
materialScrapBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("StateFlag"):
{
materialScrapBody.stateFlag = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
materialScrapBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target A"):
{
materialScrapBody.target_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target B"):
{
materialScrapBody.target_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target C"):
{
materialScrapBody.target_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Target D"):
{
materialScrapBody.target_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute A"):
{
materialScrapBody.reroutet_A = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute B"):
{
materialScrapBody.reroutet_B = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute C"):
{
materialScrapBody.reroutet_C = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Reroute D"):
{
materialScrapBody.reroutet_D = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = materialScrapBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,106 @@
#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 PalletCompletedHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "PalletCompleted";
PalletCompletedBody palletCompletedBody = new PalletCompletedBody();
palletCompletedBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("Clock"):
{
palletCompletedBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
palletCompletedBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PortID"):
{
palletCompletedBody.port = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PalletID"):
{
palletCompletedBody.palletId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Grade"):
{
palletCompletedBody.grade = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("ContainerSlotMap"):
{
for (int i = 1; i < trans.Primary.Root.Item(3).Item(2).Item(index).ItemCount + 1;i++)
{
ContainerSlotMap containerSlotMap = new ContainerSlotMap();
containerSlotMap.slotNo = trans.Primary.Root.Item(3).Item(2).Item(index).Item(i).Item(1).Value.ToString();
containerSlotMap.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Item(i).Item(2).Value.ToString();
containerSlotMap.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Item(i).Item(3).Value.ToString();
palletCompletedBody.containerSlotMap.Add(containerSlotMap);
}
}
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 = palletCompletedBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,89 @@
#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 PalletRemovedHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "PalletRemoved";
PalletRemovedBody palletRemovedBody = new PalletRemovedBody();
palletRemovedBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("Clock"):
{
palletRemovedBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("LocationID"):
{
palletRemovedBody.locationId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PortID"):
{
palletRemovedBody.port = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PalletID"):
{
palletRemovedBody.palletId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = palletRemovedBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,85 @@
#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 ProcessProgramChangeBodyHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "ProcessProgramChange";
ProcessProgramChangeBody processProgramChangeBody = new ProcessProgramChangeBody();
processProgramChangeBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("RecipeName"):
{
processProgramChangeBody.ppChangeName = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
processProgramChangeBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("RecipeChangeType"):
{
processProgramChangeBody.ppChangeStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = processProgramChangeBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,90 @@
#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 ProcessRecipeSelectedHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "ProcessRecipeSelected";
ProcessRecipeSelectedBody processRecipeSelectedBody = new ProcessRecipeSelectedBody();
processRecipeSelectedBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
processRecipeSelectedBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
processRecipeSelectedBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("StateFlag"):
{
processRecipeSelectedBody.stateFlag = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PPExecName"):
{
processRecipeSelectedBody.ppExecName = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = processRecipeSelectedBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,220 @@
#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.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 Process_FinishHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "ProcessFinished";
ProcessFinishBody processFinishBody = new ProcessFinishBody();
processFinishBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
processFinishBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
processFinishBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("StateFlag"):
{
processFinishBody.stateFlag = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
trans.Primary.Root.Item(3).Item(2).Item(index).Name = name;
}
break;
case ("PPExecName"):
{
processFinishBody.ppExecName = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("MaterialStatus"):
{
processFinishBody.materialStatus = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("CurrentEquipmentState"):
{
processFinishBody.currentEquipmentState = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PreviousEquipmentState"):
{
processFinishBody.previousEquipmentState = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
default:
{
formatCheck(key, trans.Primary.Root.Item(3).Item(2).Item(index));
processFinishBody.processData.Add($"{name}", trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString());
}
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 = processFinishBody;
Task.Run(() =>
{
MainForm.mq.EAPRequest(mQMessage);
MainForm.mq.EAPRequestToRTDB(mQMessage);
});
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
public void formatCheck(uint id,SECSItem item)
{
eSECS_FORMAT standardFormat = Configuration.conf.sRDConfiguration.GetSECS_FORMAT(id);
eSECS_FORMAT format = item.Format;
if (standardFormat != format)
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "FormatError";
FormatErrorBody formatErrorBody = new FormatErrorBody();
formatErrorBody.eventName = "ProcessFinished";
formatErrorBody.paramName = Configuration.conf.sRDConfiguration.tryGetSVOrDV(id);
formatErrorBody.paramValue = item.Value.ToString();
switch (format)
{
case eSECS_FORMAT.LIST:
formatErrorBody.paramFormat = "L";
break;
case eSECS_FORMAT.BOOLEAN:
formatErrorBody.paramFormat = "B";
break;
case eSECS_FORMAT.ASCII:
formatErrorBody.paramFormat = "A";
break;
case eSECS_FORMAT.I8:
formatErrorBody.paramFormat = "I8";
break;
case eSECS_FORMAT.I2:
formatErrorBody.paramFormat = "I2";
break;
case eSECS_FORMAT.I1:
formatErrorBody.paramFormat = "I1";
break;
case eSECS_FORMAT.I4:
formatErrorBody.paramFormat = "I4";
break;
case eSECS_FORMAT.U1:
formatErrorBody.paramFormat = "U1";
break;
case eSECS_FORMAT.U2:
formatErrorBody.paramFormat = "U2";
break;
case eSECS_FORMAT.U4:
formatErrorBody.paramFormat = "U4";
break;
case eSECS_FORMAT.U8:
formatErrorBody.paramFormat = "U8";
break;
case eSECS_FORMAT.F8:
formatErrorBody.paramFormat = "F8";
break;
case eSECS_FORMAT.F4:
formatErrorBody.paramFormat = "F4";
break;
default:
formatErrorBody.paramFormat = "A";
break;
}
switch(standardFormat)
{
case eSECS_FORMAT.LIST:
formatErrorBody.standardFormat = "L";
break;
case eSECS_FORMAT.BOOLEAN:
formatErrorBody.standardFormat = "B";
break;
case eSECS_FORMAT.ASCII:
formatErrorBody.standardFormat = "A";
break;
case eSECS_FORMAT.I8:
formatErrorBody.standardFormat = "I8";
break;
case eSECS_FORMAT.I2:
formatErrorBody.standardFormat = "I2";
break;
case eSECS_FORMAT.I1:
formatErrorBody.standardFormat = "I1";
break;
case eSECS_FORMAT.I4:
formatErrorBody.standardFormat = "I4";
break;
case eSECS_FORMAT.U1:
formatErrorBody.standardFormat = "U1";
break;
case eSECS_FORMAT.U2:
formatErrorBody.standardFormat = "U2";
break;
case eSECS_FORMAT.U4:
formatErrorBody.standardFormat = "U4";
break;
case eSECS_FORMAT.U8:
formatErrorBody.standardFormat = "U8";
break;
case eSECS_FORMAT.F8:
formatErrorBody.standardFormat = "F8";
break;
case eSECS_FORMAT.F4:
formatErrorBody.standardFormat = "F4";
break;
default:
formatErrorBody.standardFormat = "A";
break;
}
mQMessage.body = formatErrorBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
}
}
}

View File

@@ -0,0 +1,100 @@
#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 Process_StartHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "ProcessStarted";
ProcessStartedBody processStartedBody = new ProcessStartedBody();
processStartedBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("SubstrateID"):
{
processStartedBody.substrateId = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("Clock"):
{
processStartedBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("CurrentEquipmentState"):
{
processStartedBody.currentEquipmentState = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("StateFlag"):
{
processStartedBody.stateFlag = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PPExecName"):
{
processStartedBody.ppExecName = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PreviousEquipmentState"):
{
processStartedBody.previousEquipmentState = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = processStartedBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,94 @@
#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);
}
}
}
}

View File

@@ -0,0 +1,54 @@
#region << >>
/*----------------------------------------------------------------
* 创建者Hupe
* 创建时间2021/10/14 20:04:50
* 版本V1.0.0
* 描述:
*
* ----------------------------------------------------------------
* 修改人:
* 时间:
* 修改说明:
*
* 版本V1.0.1
*----------------------------------------------------------------*/
#endregion << >>
using ARI.EAP.HOST.Common;
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 SpoolingDeactivatedHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
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);
Scenario scenario = SimulatorInfo.Instance.Scenarios.Scenarios.FirstOrDefault(sc => sc.Name == "Init");
if (scenario.CurrentStep == 8)
{
scenario.ExecuteNextStep();
}
EquipmentStatus.SpoolingFlag = 0;
}
catch(Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,85 @@
#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 UserLoggedOffHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "UserLoginLogout";
UserLoggedOnBody userLoggedOnBody = new UserLoggedOnBody();
userLoggedOnBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
userLoggedOnBody.userLogFlag = "1";
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("Clock"):
{
userLoggedOnBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("UserName"):
{
userLoggedOnBody.currentUserName = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PreviousUserName"):
{
userLoggedOnBody.previousUserName = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = userLoggedOnBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,85 @@
#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 UserLoggedOnHandler : IEventHandler
{
public void Execute(SECSTransaction trans, EVENT even)
{
try
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "UserLoginLogout";
UserLoggedOnBody userLoggedOnBody = new UserLoggedOnBody();
userLoggedOnBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
userLoggedOnBody.userLogFlag = "0";
int index = 1;
foreach (var key in even.validVariables)
{
string name = Configuration.conf.sRDConfiguration.tryGetSVOrDV(key);
switch (name)
{
case ("Clock"):
{
userLoggedOnBody.eventTimestamp = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("UserName"):
{
userLoggedOnBody.currentUserName = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
break;
case ("PreviousUserName"):
{
userLoggedOnBody.previousUserName = trans.Primary.Root.Item(3).Item(2).Item(index).Value.ToString();
}
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 = userLoggedOnBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
catch (Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

View File

@@ -0,0 +1,37 @@
// ********************************************************************************
// 文件名字: HSMSConnectedHandler
// 文件描述: HSMSConnectedHandler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 HSMSConnectedHandler.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.SECSwell;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
namespace Glorysoft.SECS.EQP.Handlers
{
public class HSMSConnectedHandler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SimulatorInfo.Instance.IsConnected = true;
Global.MF.ConnectStatusSet(true);
Scenario scenario = SimulatorInfo.Instance.Scenarios.Scenarios.FirstOrDefault(sc => sc.Name == "Init");
scenario.CurrentStep = 0;
scenario.ExecuteNextStep();
}
}
}

View File

@@ -0,0 +1,29 @@
// ********************************************************************************
// 文件名字: HSMSDisconnectedHandler
// 文件描述: HSMSDisconnectedHandler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 HSMSDisconnectedHandler.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.SECSwell;
using System;
using System.Threading.Tasks;
namespace Glorysoft.SECS.EQP.Handlers
{
public class HSMSDisconnectedHandler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SimulatorInfo.Instance.IsConnected = false;
Global.MF.ConnectStatusSet(false);
}
}
}

35
Handlers/S1F13Handler.cs Normal file
View File

@@ -0,0 +1,35 @@
// ********************************************************************************
// 文件名字: S1F14Handler
// 文件描述: S1F14Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S1F14Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S1F13Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Secondary;
reply.Root.Item(1).Value = 0;
SimulatorInfo.Instance.Context?.ReplyMessage(trans);
//S1F14Item item = new S1F14Item();
//item.COMMACK = reply.Root.Item(1).Value.To<byte[]>().FirstOrDefault();
//item.MDLN = reply.Root.Item(2).Item(1).Value.ToString();
//item.SOFTREV = reply.Root.Item(2).Item(2).Value.ToString();
//var scenario = trans.Tag as Scenario;
//Thread.Sleep(500);
//scenario.ExecuteNextStep();
}
}
}

45
Handlers/S1F14Handler.cs Normal file
View File

@@ -0,0 +1,45 @@
// ********************************************************************************
// 文件名字: S1F14Handler
// 文件描述: S1F14Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S1F14Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
using System;
using ARI.EAP.HOST;
using System.Threading.Tasks;
using ARI.EAP.HOST.MQ;
using ARI.EAP.HOST.MQ.body;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S1F14Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Secondary;
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, trans.Description, "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "EstablishCommunication";
EstablishCommunication establishCommunication = new EstablishCommunication();
establishCommunication.eventTimestamp = System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fff");
mQMessage.body = establishCommunication;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
if (trans.Tag != null)
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}
}

36
Handlers/S1F16Handler.cs Normal file
View File

@@ -0,0 +1,36 @@
// ********************************************************************************
// 文件名字: S1F18Handler
// 文件描述: S1F18Handler
// 开发人员: Hupe
// 创建时间: 2021/4/19 15:38
//
// 更新历史:
// + 创建 S1F18Handler.cs 文件. by Hupe @2021/4/19 15:38
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
using System;
using ARI.EAP.HOST;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S1F16Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Secondary;
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, trans.Description, "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
if (trans.Tag != null)
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}
}

36
Handlers/S1F18Handler .cs Normal file
View File

@@ -0,0 +1,36 @@
// ********************************************************************************
// 文件名字: S1F18Handler
// 文件描述: S1F18Handler
// 开发人员: Hupe
// 创建时间: 2021/4/19 15:38
//
// 更新历史:
// + 创建 S1F18Handler.cs 文件. by Hupe @2021/4/19 15:38
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
using System;
using ARI.EAP.HOST;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S1F18Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Secondary;
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, trans.Description, "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
if (trans.Tag != null)
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}
}

26
Handlers/S1F1Handler.cs Normal file
View File

@@ -0,0 +1,26 @@
// ********************************************************************************
// 文件名字: S1F14Handler
// 文件描述: S1F14Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S1F14Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S1F1Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Secondary;
SimulatorInfo.Instance.Context?.ReplyMessage(trans);
}
}
}

32
Handlers/S1F2Handler.cs Normal file
View File

@@ -0,0 +1,32 @@
// ********************************************************************************
// 文件名字: S1F2Handler
// 文件描述: S1F2Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S1F2Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECSwell;
using System.Threading;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S1F2Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Secondary;
S1F2Item item = new S1F2Item();
item.MDLN = reply.Root.Item(1).Value.ToString();
item.SOFTREV = reply.Root.Item(2).Value.ToString();
var scenario = trans.Tag as Scenario;
scenario.CurrentStep++;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}

65
Handlers/S1F4Handler.cs Normal file
View File

@@ -0,0 +1,65 @@
// ********************************************************************************
// 文件名字: 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 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 S1F4Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "SVList";
SVListBody sVListBody = new SVListBody();
sVListBody.eventTimestamp = trans.Secondary.Root.Item(1).Value.ToString();
trans.Secondary.Root.Item(1).Name = nameof(sVListBody.eventTimestamp);
sVListBody.CommunicationState = trans.Secondary.Root.Item(2).Value.ToString();
trans.Secondary.Root.Item(2).Name = nameof(sVListBody.CommunicationState);
sVListBody.ControlState = trans.Secondary.Root.Item(3).Value.ToString();
trans.Secondary.Root.Item(3).Name = nameof(sVListBody.ControlState);
sVListBody.PreviousControlState = trans.Secondary.Root.Item(4).Value.ToString();
trans.Secondary.Root.Item(4).Name = nameof(sVListBody.PreviousControlState);
sVListBody.CurrentEquipmentState = trans.Secondary.Root.Item(5).Value.ToString();
trans.Secondary.Root.Item(5).Name = nameof(sVListBody.CurrentEquipmentState);
sVListBody.PreviousEquipmentState = trans.Secondary.Root.Item(6).Value.ToString();
trans.Secondary.Root.Item(6).Name = nameof(sVListBody.PreviousEquipmentState);
sVListBody.PPExecName = trans.Secondary.Root.Item(7).Value.ToString();
trans.Secondary.Root.Item(7).Name = nameof(sVListBody.PPExecName);
sVListBody.SpoolingState = trans.Secondary.Root.Item(8).Value.ToString();
trans.Secondary.Root.Item(8).Name = nameof(sVListBody.SpoolingState);
sVListBody.SpoolCountActual = trans.Secondary.Root.Item(9).Value.ToString();
trans.Secondary.Root.Item(9).Name = nameof(sVListBody.SpoolCountActual);
sVListBody.SpoolCountTotal = trans.Secondary.Root.Item(10).Value.ToString();
trans.Secondary.Root.Item(10).Name = nameof(sVListBody.SpoolCountTotal);
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, trans.Description, "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
mQMessage.body = sVListBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
if (trans.Tag != null)
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}
}

53
Handlers/S2F14Handler.cs Normal file
View File

@@ -0,0 +1,53 @@
// ********************************************************************************
// 文件名字: 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 Configuration.conf.sRDConfiguration.ecvs)
{
eCRequestBody.ECList.Add(ec.name, trans.Secondary.Root.Item(index).Value.ToString());
trans.Secondary.Root.Item(index).Name = ec.name;
index++;
}
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, trans.Description, "=" + trans.Secondary.SystemBytes.ToString());
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();
}
}
}
}

62
Handlers/S2F16Handler.cs Normal file
View File

@@ -0,0 +1,62 @@
// ********************************************************************************
// 文件名字: S2F16Handler
// 文件描述: S2F16Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S2F16Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
using System;
using ARI.EAP.HOST;
using Glorysoft.SECS.EQP.Commands;
using ARI.EAP.HOST.MQ.body;
using ARI.EAP.HOST.MQ;
using System.Threading.Tasks;
using ARI.EAP.HOST.Common;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S2F16Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, trans.Description, "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
SECSMessage reply = trans.Secondary;
S2F16Item item = new S2F16Item();
item.EAC = reply.Root.Value.To<byte[]>().FirstOrDefault();
if (trans.Tag != null)
{
if (trans.Tag.GetType() == typeof(ECChangeBody))
{
if(item.EAC == 00)
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "ECChange";
ECChangeBody eCChangeBody = trans.Tag as ECChangeBody;
eCChangeBody.spoolingFlag = EquipmentStatus.SpoolingFlag.ToString();
eCChangeBody.eventTimestamp = System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fff");
mQMessage.body = eCChangeBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
Command.S1F15Command();
Thread.Sleep(500);
Command.S1F17Command();
}
}
else
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}
}
}

36
Handlers/S2F24Handler.cs Normal file
View File

@@ -0,0 +1,36 @@
// ********************************************************************************
// 文件名字: S1F14Handler
// 文件描述: S1F14Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S1F14Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
using System;
using ARI.EAP.HOST;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S2F24Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, trans.Description, "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
if (trans.Tag != null)
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}
}

32
Handlers/S2F32Handler.cs Normal file
View File

@@ -0,0 +1,32 @@
// ********************************************************************************
// 文件名字: S2F32Handler
// 文件描述: S2F32Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S2F32Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S2F32Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Secondary;
S2F32Item item = new S2F32Item();
item.TIACK = reply.Root.Value.To<byte[]>().FirstOrDefault();
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}

45
Handlers/S2F34Handler.cs Normal file
View File

@@ -0,0 +1,45 @@
// ********************************************************************************
// 文件名字: S2F34Handler
// 文件描述: S2F34Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S2F34Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
using System;
using ARI.EAP.HOST;
using ARI.EAP.HOST.Common;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S2F34Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
var sc = trans.Tag as Scenario;
if(!EquipmentStatus.initStatus)
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, "Delete Report", "=" + trans.Secondary.SystemBytes.ToString());
else
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, "Define Report", "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
EquipmentStatus.initStatus = true;
SECSMessage reply = trans.Secondary;
S2F34Item item = new S2F34Item();
item.DRACK = reply.Root.Value.To<byte[]>().FirstOrDefault();
if (trans.Tag != null)
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}
}

45
Handlers/S2F36Handler.cs Normal file
View File

@@ -0,0 +1,45 @@
// ********************************************************************************
// 文件名字: S2F36Handler
// 文件描述: S2F36Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S2F36Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
using System;
using ARI.EAP.HOST;
using ARI.EAP.HOST.Common;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S2F36Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
var sc = trans.Tag as Scenario;
if (!EquipmentStatus.initStatus)
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, "Delete Link Report", "=" + trans.Secondary.SystemBytes.ToString());
else
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, "Define Link Report", "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
SECSMessage reply = trans.Secondary;
S2F36Item item = new S2F36Item();
item.LRACK = reply.Root.Value.To<byte[]>().FirstOrDefault();
if (trans.Tag != null)
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}
}

39
Handlers/S2F38Handler.cs Normal file
View File

@@ -0,0 +1,39 @@
// ********************************************************************************
// 文件名字: S2F38Handler
// 文件描述: S2F38Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S2F38Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
using System;
using ARI.EAP.HOST;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S2F38Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, trans.Description, "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
SECSMessage reply = trans.Secondary;
S2F38Item item = new S2F38Item();
item.ERACK = reply.Root.Value.To<byte[]>().FirstOrDefault();
if (trans.Tag != null)
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}
}

35
Handlers/S2F42Handler.cs Normal file
View File

@@ -0,0 +1,35 @@
// ********************************************************************************
// 文件名字: S2F42Handler
// 文件描述: S2F42Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S2F42Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S2F42Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Secondary;
S2F42Item item = new S2F42Item();
item.HCACK = reply.Root.Item(1).Value.To<byte[]>().FirstOrDefault();
//item.CPNAME = reply.Root.Item(2).Item(1).Item(1).Value.ToString();
//item.CPACK = reply.Root.Item(2).Item(1).Item(2).Value;
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}

36
Handlers/S2F44Handler.cs Normal file
View File

@@ -0,0 +1,36 @@
// ********************************************************************************
// 文件名字: S1F14Handler
// 文件描述: S1F14Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S1F14Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
using System;
using ARI.EAP.HOST;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S2F44Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, trans.Description, "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
if (trans.Tag != null)
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}
}

29
Handlers/S2F50Handler.cs Normal file
View File

@@ -0,0 +1,29 @@
// ********************************************************************************
// 文件名字: S2F50Handler
// 文件描述: S2F50Handler
// 开发人员: Hupe
// 创建时间: 2021/11/2 0:08
//
// 更新历史:
// + 创建 S2F50Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
using System;
using ARI.EAP.HOST;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S2F50Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, trans.Description, "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
}
}
}

36
Handlers/S5F1Handler.cs Normal file
View File

@@ -0,0 +1,36 @@
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System;
using System.Collections.Generic;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S5F1Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
try
{
SECSMessage primary = trans.Primary;
var trans5 = context.GetTransaction(5, 1, "S5F1");
trans5.Secondary = primary;
context.ReplyMessage(trans);
//EQPController.Current.SendS1f3Param(context.Name);
//var trans13 = context.GetTransaction(1, 3, "S1F3");
//var s1f3item = new S1F3Item() { SVIDs = new List<ushort> { 1, 2, 3 } };
//foreach (var k in s1f3item.SVIDs)
//{
// trans13.Primary.Root.Add(SECSUtil.CreateSECSItem("SVID", eSECS_FORMAT.U2, k));
//}
//context.SendMessage(trans13);
Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")}=>回复EQP S5F1[{context.Name}]并发送S1f3");
}
catch (Exception ex)
{
LoggerService.SECSLogger.Error(ex.Message);
}
}
}
}

65
Handlers/S5F4Handler.cs Normal file
View File

@@ -0,0 +1,65 @@
// ********************************************************************************
// 文件名字: S5F4Handler
// 文件描述: S5F4Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S5F4Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
using System;
using ARI.EAP.HOST;
using ARI.EAP.HOST.Common;
using ARI.EAP.HOST.MQ;
using ARI.EAP.HOST.MQ.body;
using System.Threading.Tasks;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S5F4Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Secondary;
S5F4Item item = new S5F4Item();
item.ACKC5 = reply.Root.Value.To<byte[]>().FirstOrDefault();
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "Disable/EnableAlarm";
S5F3Body s5F3Body = new S5F3Body();
s5F3Body.eventTimestamp = System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fff");
if (EquipmentStatus.S5F3 == "AlarmEnable" && item.ACKC5 == 0)
{
Global.MF.S5F3BottonUpdate(EquipmentStatus.S5F3);
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, "Alarm Disable", "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
s5F3Body.enableAlarmState = "0";
EquipmentStatus.S5F3 = "AlarmDisable";
}
else if(EquipmentStatus.S5F3 == "AlarmDisable" && item.ACKC5 == 0)
{
Global.MF.S5F3BottonUpdate(EquipmentStatus.S5F3);
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, "Alarm Enable", "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
s5F3Body.enableAlarmState = "1";
EquipmentStatus.S5F3 = "AlarmEnable";
}
if(item.ACKC5 == 0)
{
mQMessage.body = s5F3Body;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
if (trans.Tag != null)
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}
}

61
Handlers/S5F6Handler.cs Normal file
View File

@@ -0,0 +1,61 @@
// ********************************************************************************
// 文件名字: 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 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 S5F6Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "AlarmList";
AlarmListBody alarmListBody = new AlarmListBody();
int index = 0;
while (trans.Secondary.Root.ItemCount > index)
{
Alarm alarm = new Alarm();
byte[] b = (byte[])trans.Secondary.Root.Item(index + 1).Item(1).Value;
trans.Secondary.Root.Item(index + 1).Item(1).Name = nameof(alarm.ALCD);
alarm.ALCD = b[0].ToString();
alarm.ALID = trans.Secondary.Root.Item(index + 1).Item(2).Value.ToString();
trans.Secondary.Root.Item(index + 1).Item(2).Name = nameof(alarm.ALID);
alarm.ALTX = trans.Secondary.Root.Item(index + 1).Item(3).Value.ToString();
trans.Secondary.Root.Item(index + 1).Item(3).Name = nameof(alarm.ALTX);
alarmListBody.alarmList.Add(alarm);
index++;
}
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, trans.Description, "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
if (trans.Tag != null)
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
else
{
mQMessage.body = alarmListBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
}
}
}
}

51
Handlers/S6F11Handler.cs Normal file
View File

@@ -0,0 +1,51 @@
// ********************************************************************************
// 文件名字: S6F11Handler
// 文件描述: S6F11Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S6F11Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
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.Linq;
using System.Threading;
using ARI.EAP.HOST;
using ARI.EAP.HOST.MQ;
using ARI.EAP.HOST.MQ.body;
using ARI.EAP.HOST.Common;
using System.Threading.Tasks;
using ARI.EAP.HOST.SRD;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S6F11Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
try
{
SECSMessage primary = trans.Primary;
context.ReplyMessage(trans);
//int CEID = (int)primary.Root.Item(2).Value;
uint CEID = (uint)primary.Root.Item(2).Value;
var even = Configuration.conf.sRDConfiguration.findEvent(CEID);
string eventName = even.name;
var handlerName = $"{eventName}Handler";
if (EquipmentStatus.EventHandlers.ContainsKey(handlerName))
{
EquipmentStatus.EventHandlers[handlerName].Execute(trans, even);
}
}
catch(Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

46
Handlers/S6F1Handler.cs Normal file
View File

@@ -0,0 +1,46 @@
// ********************************************************************************
// 文件名字: S6F11Handler
// 文件描述: S6F11Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S6F11Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
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.Linq;
using System.Threading;
using ARI.EAP.HOST;
using ARI.EAP.HOST.MQ;
using ARI.EAP.HOST.MQ.body;
using ARI.EAP.HOST.Common;
using System.Threading.Tasks;
using ARI.EAP.HOST.SRD;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S6F1Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
try
{
SECSMessage primary = trans.Primary;
context.ReplyMessage(trans);
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Primary.Stream}F{trans.Primary.Function}", LoggerService.Receive, trans.Primary.Description, "=" + trans.Primary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Primary);
Global.MF.addlog(LoggerService.HtoE, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Send, trans.Secondary.Description, "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
}
catch(Exception e)
{
LoggerService.SECSLogger.Error(e);
}
}
}
}

47
Handlers/S6F24Handler.cs Normal file
View File

@@ -0,0 +1,47 @@
// ********************************************************************************
// 文件名字: S1F14Handler
// 文件描述: S1F14Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S1F14Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
using System;
using ARI.EAP.HOST;
using ARI.EAP.HOST.Common;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S6F24Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
Global.MF.addlog( LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, trans.Description, "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
S6F24Item item = new S6F24Item();
item.RSDA = trans.Secondary.Root.Value.To<byte[]>().FirstOrDefault();
if (item.RSDA.ToString() != "0")
{
if (trans.Tag != null)
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
else
{
EquipmentStatus.SpoolingFlag = 1;
}
}
}
}

33
Handlers/S7F18Handler.cs Normal file
View File

@@ -0,0 +1,33 @@
// ********************************************************************************
// 文件名字: S7F18Handler
// 文件描述: S7F18Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S7F18Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S7F18Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Secondary;
S7F18Item item = new S7F18Item();
item.ACKC7 = reply.Root.Value.To<byte[]>().FirstOrDefault();
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}

35
Handlers/S7F1Handler.cs Normal file
View File

@@ -0,0 +1,35 @@
// ********************************************************************************
// 文件名字: S1F14Handler
// 文件描述: S1F14Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S1F14Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S7F1Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Secondary;
//reply.Root.Item(1).Value = 0;
SimulatorInfo.Instance.Context?.ReplyMessage(trans);
//S1F14Item item = new S1F14Item();
//item.COMMACK = reply.Root.Item(1).Value.To<byte[]>().FirstOrDefault();
//item.MDLN = reply.Root.Item(2).Item(1).Value.ToString();
//item.SOFTREV = reply.Root.Item(2).Item(2).Value.ToString();
//var scenario = trans.Tag as Scenario;
//Thread.Sleep(500);
//scenario.ExecuteNextStep();
}
}
}

50
Handlers/S7F20Handler.cs Normal file
View File

@@ -0,0 +1,50 @@
// ********************************************************************************
// 文件名字: S7F18Handler
// 文件描述: S7F18Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S7F18Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using ARI.EAP.HOST;
using ARI.EAP.HOST.MQ;
using ARI.EAP.HOST.MQ.body;
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S7F20Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
Global.MF.addlog(LoggerService.EtoH, $"S{trans.Secondary.Stream}F{trans.Secondary.Function}", LoggerService.Receive, trans.Description, "=" + trans.Secondary.SystemBytes.ToString());
LoggerService.SECSLogger.Info(trans.Secondary);
SECSMessage reply = trans.Secondary;
MQMessage mQMessage = new MQMessage();
mQMessage.header.messageName = "RecipeListSend";
RecipeListSendBody recipeListSendBody = new RecipeListSendBody();
for (int i = 1; i < reply.Root.ItemCount + 1; i++)
{
recipeListSendBody.recipeList.Add(reply.Root.Item(i).Value.ToString());
}
mQMessage.body = recipeListSendBody;
Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
if (trans.Tag != null)
{
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}
}

33
Handlers/S7F2Handler.cs Normal file
View File

@@ -0,0 +1,33 @@
// ********************************************************************************
// 文件名字: S7F2Handler
// 文件描述: S7F2Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S7F2Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S7F2Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Secondary;
S7F2Item item = new S7F2Item();
item.PPGNT = reply.Root.Value.To<byte[]>().FirstOrDefault();
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}

41
Handlers/S7F3Handler.cs Normal file
View File

@@ -0,0 +1,41 @@
// ********************************************************************************
// 文件名字: 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 S7F3Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Primary;
S7F3Item item = new S7F3Item();
item.PPID = reply.Root.Item(1).Value.ToString();
item.PPBODY = (byte[])reply.Root.Item(2).Value;
//
//File.WriteAllBytes(item.PPID, item.PPBODY);
File.WriteAllBytes(context.LogPath + item.PPID, item.PPBODY);
//
//SimulatorInfo.Instance.WorkFLowFlag = "Y";
//
//var scenario = trans.Tag as Scenario;
//Thread.Sleep(500);
//scenario.ExecuteNextStep();
//SECSMessage reply = trans.Secondary;
//reply.Root.Item(1).Value = 0;
SimulatorInfo.Instance.Context?.ReplyMessage(trans);
}
}
}

33
Handlers/S7F4Handler.cs Normal file
View File

@@ -0,0 +1,33 @@
// ********************************************************************************
// 文件名字: S7F4Handler
// 文件描述: S7F4Handler
// 开发人员: Michael
// 创建时间: 2019/11/8 0:08
//
// 更新历史:
// + 创建 S7F4Handler.cs 文件. by Michael @2019/11/8 0:08
// ********************************************************************************
using Glorysoft.SECS.EQP.Common;
using Glorysoft.SECS.EQP.Message;
using Glorysoft.SECS.EQP.Utilities;
using Glorysoft.SECSwell;
using System.Linq;
using System.Threading;
namespace Glorysoft.SECS.EQP.Handlers
{
public class S7F4Handler : ISECSMessageHandler
{
public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
{
SECSMessage reply = trans.Secondary;
S7F4Item item = new S7F4Item();
item.ACKC7 = reply.Root.Value.To<byte[]>().FirstOrDefault();
var scenario = trans.Tag as Scenario;
Thread.Sleep(500);
scenario.ExecuteNextStep();
}
}
}

38
Handlers/S7F6Handler.cs Normal file
View File

@@ -0,0 +1,38 @@
// ********************************************************************************
// 文件名字: 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();
}
}
}