GalilAxisData.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace MECF.Framework.Common.Device.Galil
  7. {
  8. public class GalilAxisData
  9. {
  10. public ushort Status { get; set; }
  11. public byte Switches { get; set; }
  12. public byte StopCode { get; set; }
  13. public int ReferencePosition { get; set; }
  14. public int MotorPosition { get; set;}
  15. public int PositionError { get; set; }
  16. public int AuxiliaryPosition { get; set; }
  17. public int Velocity { get; set; }
  18. public short Torque { get; set; }
  19. public short Res { get; set; }
  20. public bool IsSwitchOn { get; set; }
  21. public bool ForwardLimit { get; set; }
  22. public bool ReverseLimit { get; set; }
  23. /// <summary>
  24. /// 克隆
  25. /// </summary>
  26. /// <param name="data"></param>
  27. public GalilAxisData Clone()
  28. {
  29. GalilAxisData data=new GalilAxisData();
  30. data.Status= Status;
  31. data.Switches= Switches;
  32. data.StopCode= StopCode;
  33. data.ReferencePosition= ReferencePosition;
  34. data.MotorPosition= MotorPosition;
  35. data.PositionError= PositionError;
  36. data.AuxiliaryPosition= AuxiliaryPosition;
  37. data.Velocity= Velocity;
  38. data.Torque= Torque;
  39. data.Res= Res;
  40. data.IsSwitchOn= IsSwitchOn;
  41. data.ForwardLimit= ForwardLimit;
  42. data.ReverseLimit= ReverseLimit;
  43. return data;
  44. }
  45. /// <summary>
  46. /// 拷贝
  47. /// </summary>
  48. /// <param name="data"></param>
  49. public void Copy(GalilAxisData data)
  50. {
  51. Status = data.Status;
  52. Switches = data.Switches;
  53. StopCode = data.StopCode;
  54. ReferencePosition = data.ReferencePosition;
  55. MotorPosition = data.MotorPosition;
  56. PositionError = data.PositionError;
  57. AuxiliaryPosition = data.AuxiliaryPosition;
  58. Velocity = data.Velocity;
  59. Torque = data.Torque;
  60. Res = data.Res;
  61. IsSwitchOn= data.IsSwitchOn;
  62. ForwardLimit= data.ForwardLimit;
  63. ReverseLimit= data.ReverseLimit;
  64. }
  65. }
  66. }