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.

38 líneas
1.3 KiB

  1. // ********************************************************************************
  2. // 文件名字: S7F6Handler
  3. // 文件描述: S7F6Handler
  4. // 开发人员: Michael
  5. // 创建时间: 2019/11/8 0:08
  6. //
  7. // 更新历史:
  8. // + 创建 S7F6Handler.cs 文件. by Michael @2019/11/8 0:08
  9. // ********************************************************************************
  10. using Glorysoft.SECS.EQP.Common;
  11. using Glorysoft.SECS.EQP.Message;
  12. using Glorysoft.SECSwell;
  13. using System.IO;
  14. using System.Threading;
  15. namespace Glorysoft.SECS.EQP.Handlers
  16. {
  17. public class S7F6Handler : ISECSMessageHandler
  18. {
  19. public void Execute(SECSContext context, SECSTransaction trans, SECSErrors err, string errmsg)
  20. {
  21. SECSMessage reply = trans.Secondary;
  22. S7F6Item item = new S7F6Item();
  23. item.PPID = reply.Root.Item(1).Value.ToString();
  24. item.PPBODY = (byte[])reply.Root.Item(2).Value;
  25. //
  26. //string.Format(context.LogPath);
  27. File.WriteAllBytes(context.LogPath+item.PPID, item.PPBODY);
  28. //
  29. SimulatorInfo.Instance.WorkFLowFlag = "Y";
  30. //
  31. var scenario = trans.Tag as Scenario;
  32. Thread.Sleep(500);
  33. scenario.ExecuteNextStep();
  34. }
  35. }
  36. }