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.

Command.S2F35.cs 2.8 KiB

2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // ********************************************************************************
  2. // 文件名字: Command.S2F35
  3. // 文件描述: Command.S2F35
  4. // 开发人员: Michael
  5. // 创建时间: 2019/11/8 0:08
  6. //
  7. // 更新历史:
  8. // + 创建 Command.S2F35.cs 文件. by Michael @2019/11/8 0:08
  9. // ********************************************************************************
  10. using ARI.EAP.HOST;
  11. using ARI.EAP.HOST.Common;
  12. using ARI.EAP.HOST.SRD;
  13. using Glorysoft.SECS.EQP.Message;
  14. using Glorysoft.SECS.EQP.Utilities;
  15. using Glorysoft.SECSwell;
  16. using System;
  17. using System.Collections.Generic;
  18. namespace Glorysoft.SECS.EQP.Commands
  19. {
  20. public partial class Command
  21. {
  22. public static void S2F35Command(S2F35Item items, object tag = null)
  23. {
  24. if (SimulatorInfo.Instance.Context != null && SimulatorInfo.Instance.Context.IsConnected)
  25. {
  26. var trans = SimulatorInfo.Instance.Context.GetTransaction(2, 35, "S2F35");
  27. trans.Primary.Root.Item(1).SetValue(eSECS_FORMAT.U4, items.DATAID);
  28. var sc = tag as Scenario;
  29. if (!EquipmentStatus.initStatus)
  30. {
  31. foreach (var item in items.Events)
  32. {
  33. var evt = SECSUtil.CreateSECSItem("", eSECS_FORMAT.LIST);
  34. evt.Add(SECSUtil.CreateSECSItem(nameof(item.CEID), eSECS_FORMAT.U4, item.CEID));
  35. evt.Add(SECSUtil.CreateSECSItem("", eSECS_FORMAT.LIST));
  36. foreach (var rptid in item.RPTIDs)
  37. {
  38. evt.Item(2).Add(SECSUtil.CreateSECSItem("RPTID", eSECS_FORMAT.U4, rptid));
  39. }
  40. trans.Primary.Root.Item(2).Add(evt);
  41. }
  42. }
  43. else
  44. {
  45. foreach(var even in Configurations.conf.sRDConfiguration.events)
  46. {
  47. var evt = SECSUtil.CreateSECSItem(even.name, eSECS_FORMAT.LIST);
  48. evt.Add(SECSUtil.CreateSECSItem("CEID", eSECS_FORMAT.U4, even.ceid));
  49. evt.Add(SECSUtil.CreateSECSItem("", eSECS_FORMAT.LIST));
  50. evt.Item(2).Add(SECSUtil.CreateSECSItem("RPTID", eSECS_FORMAT.U4, even.reportid));
  51. trans.Primary.Root.Item(2).Add(evt);
  52. }
  53. }
  54. trans.Tag = tag;
  55. SimulatorInfo.Instance.Context.SendMessage(trans);
  56. if (!EquipmentStatus.initStatus)
  57. Global.MF.addlog(trans, LoggerService.Send, "Delete Link Report", 0);
  58. else
  59. Global.MF.addlog(trans, LoggerService.Send, "Define Link Report", 0);
  60. LoggerService.SECSLogger.Info(trans.Primary);
  61. }
  62. }
  63. }
  64. }