RPoint.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. using Newtonsoft.Json;
  2. using Prism.Mvvm;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Collections.ObjectModel;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using TeamAAS_VP.Enums;
  10. namespace TeamAAS_VP.Models
  11. {
  12. /// <summary>
  13. /// 机器人点位
  14. /// </summary>
  15. public class RPoint : BindableBase
  16. {
  17. private int _Number;
  18. /// <summary>
  19. /// 点编号
  20. /// </summary>
  21. public int Number
  22. {
  23. get { return _Number; }
  24. set { SetProperty(ref _Number, value); }
  25. }
  26. private string _Description;
  27. /// <summary>
  28. /// 描述
  29. /// </summary>
  30. public string Description
  31. {
  32. get { return _Description; }
  33. set { SetProperty(ref _Description, value); }
  34. }
  35. private float _X;
  36. public float X
  37. {
  38. get { return _X; }
  39. set { SetProperty(ref _X, value); }
  40. }
  41. private float _Y;
  42. public float Y
  43. {
  44. get { return _Y; }
  45. set { SetProperty(ref _Y, value); }
  46. }
  47. private float _Z;
  48. public float Z
  49. {
  50. get { return _Z; }
  51. set { SetProperty(ref _Z, value); }
  52. }
  53. private float _U;
  54. public float U
  55. {
  56. get { return _U; }
  57. set { SetProperty(ref _U, value); }
  58. }
  59. private float _V;
  60. public float V
  61. {
  62. get { return _V; }
  63. set { SetProperty(ref _V, value); }
  64. }
  65. private float _W;
  66. public float W
  67. {
  68. get { return _W; }
  69. set { SetProperty(ref _W, value); }
  70. }
  71. private RobotHand _Hand;
  72. public RobotHand Hand
  73. {
  74. get { return _Hand; }
  75. set { SetProperty(ref _Hand, value); }
  76. }
  77. private int _Local;
  78. public int Local
  79. {
  80. get { return _Local; }
  81. set { SetProperty(ref _Local, value); }
  82. }
  83. private int _Tool;
  84. public int Tool
  85. {
  86. get { return _Tool; }
  87. set { SetProperty(ref _Tool, value); }
  88. }
  89. public override bool Equals(object obj)
  90. {
  91. if (obj !=null && obj is RPoint && ((RPoint)obj).X==this.X && ((RPoint)obj).Y == this.Y && ((RPoint)obj).Z == this.Z && ((RPoint)obj).U == this.U && ((RPoint)obj).V == this.V && ((RPoint)obj).W == this.W && ((RPoint)obj).Local == this.Local)
  92. {
  93. return true;
  94. }
  95. else { return false; }
  96. }
  97. public override int GetHashCode()
  98. {
  99. return base.GetHashCode();
  100. }
  101. public override string ToString()
  102. {
  103. return base.ToString();
  104. }
  105. public RPoint Clone()
  106. {
  107. return JsonConvert.DeserializeObject<RPoint>(JsonConvert.SerializeObject(this)); ;
  108. }
  109. }
  110. }