No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

59 líneas
2.3 KiB

  1. // ********************************************************************************
  2. // 文件名字: S1F4Handler
  3. // 文件描述: S1F4Handler
  4. // 开发人员: Michael
  5. // 创建时间: 2019/11/8 0:08
  6. //
  7. // 更新历史:
  8. // + 创建 S1F4Handler.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.Collections.Generic;
  19. using System.Threading;
  20. using System.Threading.Tasks;
  21. namespace Glorysoft.SECS.EQP.Handlers
  22. {
  23. public class S5F6Handler : ISECSMessageHandler
  24. {
  25. public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
  26. {
  27. MQMessage mQMessage = new MQMessage();
  28. mQMessage.header.messageName = "AlarmList";
  29. AlarmListBody alarmListBody = new AlarmListBody();
  30. int index = 0;
  31. while (trans.Secondary.Root.ItemCount > index)
  32. {
  33. Alarm alarm = new Alarm();
  34. byte[] b = (byte[])trans.Secondary.Root.Item(index + 1).Item(1).Value;
  35. trans.Secondary.Root.Item(index + 1).Item(1).Name = nameof(alarm.ALCD);
  36. alarm.ALCD = b[0].ToString();
  37. alarm.ALID = trans.Secondary.Root.Item(index + 1).Item(2).Value.ToString();
  38. trans.Secondary.Root.Item(index + 1).Item(2).Name = nameof(alarm.ALID);
  39. alarm.ALTX = trans.Secondary.Root.Item(index + 1).Item(3).Value.ToString();
  40. trans.Secondary.Root.Item(index + 1).Item(3).Name = nameof(alarm.ALTX);
  41. alarmListBody.alarmList.Add(alarm);
  42. index++;
  43. }
  44. Global.MF.addlog(trans, LoggerService.Receive, "List Alarm Request", 1);
  45. LoggerService.SECSLogger.Info(trans.Secondary);
  46. mQMessage.body = alarmListBody;
  47. Task.Run(() => MainForm.mq.EAPRequest(mQMessage));
  48. if (trans.Tag != null)
  49. {
  50. var scenario = trans.Tag as Scenario;
  51. Thread.Sleep(500);
  52. scenario.ExecuteNextStep();
  53. }
  54. }
  55. }
  56. }