RevtechMatch.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using Aitex.Core.RT.Log;
  2. using Aitex.Core.RT.SCCore;
  3. using MECF.Framework.Common.Communications;
  4. using MECF.Framework.Common.Device.Bases;
  5. using MECF.Framework.Common.Equipment;
  6. using System;
  7. using System.Collections;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Net;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using Venus_Core;
  14. namespace Venus_RT.Devices
  15. {
  16. static class RevtechMatchMessage
  17. {
  18. public const string EOF = "\n";
  19. public const string QUERY_STATE_INFORMATION = "MATCH:FETCH?";
  20. public const string SET_C1_POS = "MATCH:POS:C1";
  21. public const string SET_C2_POS = "MATCH:POS:C2";
  22. public const string SET_WORK_MODE = "MATCH:MODE";
  23. }
  24. public class RevtechMatch : RfMatchBase
  25. {
  26. private AsyncSocketDevice _socket;
  27. public RevtechMatch(ModuleName mod, string address) : base(mod.ToString(), VenusDevice.Match.ToString())
  28. {
  29. _socket = new AsyncSocketDevice(address);
  30. _socket.OnDataChanged += new AsyncSocketDevice.MessageHandler(OnDataChanged);
  31. SerachCommandList = new List<string>()
  32. {
  33. SkyPumpMessage.READ_DATA
  34. };
  35. sendDataChangedEvent += RevtechMatch_sendDataChangedEvent;
  36. baseStopwatch.Start();
  37. baseTimer.Enabled = true;
  38. }
  39. private void RevtechMatch_sendDataChangedEvent(string obj)
  40. {
  41. //var newstr = obj + "\r";
  42. //_serial?.Write(newstr);
  43. }
  44. public void OnDataChanged(byte[] rawMessage)
  45. {
  46. string data = System.Text.Encoding.Default.GetString(rawMessage);
  47. }
  48. public override void SetMatchPosition(float c1, float c2, out string reason)
  49. {
  50. reason = "";
  51. }
  52. }
  53. }