CommandParameter.cs 824 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace StageController
  7. {
  8. /// <summary>
  9. /// 5.1 电脑发送设置X, Y, Z电机参数指令
  10. /// </summary>
  11. public class CommandParameter : CommandBase
  12. {
  13. public char AxisSelect
  14. {
  15. get { return _command[0]; }
  16. set { _command[0] = value; }
  17. }
  18. public char LockOrFree
  19. {
  20. set { _command[3] = value; }
  21. }
  22. char[] _command = "x+-SN000000Y100".ToCharArray();
  23. public override string Make()
  24. {
  25. return "@" + new string(_command) + "!";
  26. }
  27. public override bool Parse(string response)
  28. {
  29. return response == _command.ToString();
  30. }
  31. }
  32. }