You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 2 година
пре 1 година
пре 2 година
пре 1 година
пре 2 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // ********************************************************************************
  2. // 文件名字: S7F18Handler
  3. // 文件描述: S7F18Handler
  4. // 开发人员: Michael
  5. // 创建时间: 2019/11/8 0:08
  6. //
  7. // 更新历史:
  8. // + 创建 S7F18Handler.cs 文件. by Michael @2019/11/8 0:08
  9. // ********************************************************************************
  10. using ARI.EAP.HOST;
  11. using ARI.EAP.HOST.MQ;
  12. using ARI.EAP.HOST.MQ.body;
  13. using Glorysoft.SECS.EQP.Common;
  14. using Glorysoft.SECS.EQP.Message;
  15. using Glorysoft.SECS.EQP.Utilities;
  16. using Glorysoft.SECSwell;
  17. using System;
  18. using System.Linq;
  19. using System.Threading;
  20. using System.Threading.Tasks;
  21. namespace Glorysoft.SECS.EQP.Handlers
  22. {
  23. public class S7F20Handler : ISECSMessageHandler
  24. {
  25. public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
  26. {
  27. Global.MF.addlog(trans, LoggerService.Receive, trans.Secondary.Description, 1);
  28. LoggerService.SECSLogger.Info(trans.Secondary);
  29. SECSMessage reply = trans.Secondary;
  30. MQMessage mQMessage = new MQMessage();
  31. mQMessage.header.messageName = "RecipeListSend";
  32. RecipeListSendBody recipeListSendBody = new RecipeListSendBody();
  33. for (int i = 1; i < reply.Root.ItemCount + 1; i++)
  34. {
  35. recipeListSendBody.recipeList.Add(reply.Root.Item(i).Value.ToString());
  36. }
  37. mQMessage.body = recipeListSendBody;
  38. Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
  39. if (trans.Tag != null)
  40. {
  41. var scenario = trans.Tag as Scenario;
  42. Thread.Sleep(500);
  43. scenario.ExecuteNextStep();
  44. }
  45. }
  46. }
  47. }