25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

S6F11Handler.cs 1.7 KiB

2 년 전
1 년 전
2 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // ********************************************************************************
  2. // 文件名字: S6F11Handler
  3. // 文件描述: S6F11Handler
  4. // 开发人员: Michael
  5. // 创建时间: 2019/11/8 0:08
  6. //
  7. // 更新历史:
  8. // + 创建 S6F11Handler.cs 文件. by Michael @2019/11/8 0:08
  9. // ********************************************************************************
  10. using Glorysoft.SECS.EQP.Common;
  11. using Glorysoft.SECS.EQP.Message;
  12. using Glorysoft.SECS.EQP.Utilities;
  13. using Glorysoft.SECSwell;
  14. using System;
  15. using System.Collections.Generic;
  16. using System.Linq;
  17. using System.Threading;
  18. using ARI.EAP.HOST;
  19. using ARI.EAP.HOST.MQ;
  20. using ARI.EAP.HOST.MQ.body;
  21. using ARI.EAP.HOST.Common;
  22. using System.Threading.Tasks;
  23. using ARI.EAP.HOST.SRD;
  24. namespace Glorysoft.SECS.EQP.Handlers
  25. {
  26. public class S6F11Handler : ISECSMessageHandler
  27. {
  28. public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
  29. {
  30. try
  31. {
  32. SECSMessage primary = trans.Primary;
  33. context.ReplyMessage(trans);
  34. //int CEID = (int)primary.Root.Item(2).Value;
  35. uint CEID = (uint)primary.Root.Item(2).Value;
  36. var even = Configurations.conf.sRDConfiguration.findEvent(CEID);
  37. string eventName = even.name;
  38. var handlerName = $"{eventName}Handler";
  39. if (EquipmentStatus.EventHandlers.ContainsKey(handlerName))
  40. {
  41. EquipmentStatus.EventHandlers[handlerName].Execute(trans, even);
  42. }
  43. }
  44. catch(Exception e)
  45. {
  46. LoggerService.SECSLogger.Error(e);
  47. }
  48. }
  49. }
  50. }