RobotInfo.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. using Newtonsoft.Json;
  2. using Prism.Mvvm;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using TeamAAS_VP.Enums;
  9. using TeamAAS_VP.Models.PLC;
  10. namespace TeamAAS_VP.Models
  11. {
  12. /// <summary>
  13. /// 机器人参数
  14. /// </summary>
  15. public class RobotInfo : BindableBase
  16. {
  17. private Guid _Id;
  18. public Guid Id
  19. {
  20. get { return _Id; }
  21. set { SetProperty(ref _Id, value); }
  22. }
  23. private int _RobotNo;
  24. /// <summary>
  25. /// 机器人编号
  26. /// </summary>
  27. public int RobotNo
  28. {
  29. get { return _RobotNo; }
  30. set { SetProperty(ref _RobotNo, value); }
  31. }
  32. private string _RobotName;
  33. /// <summary>
  34. /// 机器人名称
  35. /// </summary>
  36. public string RobotName
  37. {
  38. get { return _RobotName; }
  39. set { SetProperty(ref _RobotName, value); }
  40. }
  41. private RobotBrand _RobotBrand = RobotBrand.Default;
  42. /// <summary>
  43. /// 机器人品牌
  44. /// </summary>
  45. public RobotBrand RobotBrand
  46. {
  47. get { return _RobotBrand; }
  48. set { SetProperty(ref _RobotBrand, value); }
  49. }
  50. private TCPConnectType _ConnectType = TCPConnectType.Client;
  51. /// <summary>
  52. /// 通讯方式
  53. /// </summary>
  54. public TCPConnectType ConnectType
  55. {
  56. get { return _ConnectType; }
  57. set { SetProperty(ref _ConnectType, value); }
  58. }
  59. private string _IP = "192.168.0.1";
  60. /// <summary>
  61. /// IP地址
  62. /// </summary>
  63. public string IP
  64. {
  65. get { return _IP; }
  66. set { SetProperty(ref _IP, value); }
  67. }
  68. private int _Port = 3600;
  69. /// <summary>
  70. /// 端口号
  71. /// </summary>
  72. public int Port
  73. {
  74. get { return _Port; }
  75. set { SetProperty(ref _Port, value); }
  76. }
  77. private Terminator _Terminator = Terminator.CRLF;
  78. /// <summary>
  79. /// 结束符
  80. /// </summary>
  81. public Terminator Terminator
  82. {
  83. get { return _Terminator; }
  84. set { SetProperty(ref _Terminator, value); }
  85. }
  86. private DataEncoding _DataEncoding=DataEncoding.Default;
  87. /// <summary>
  88. /// 数据编码格式
  89. /// </summary>
  90. public DataEncoding DataEncoding
  91. {
  92. get { return _DataEncoding; }
  93. set { SetProperty(ref _DataEncoding, value); }
  94. }
  95. private double _StepDistance=1.0;
  96. /// <summary>
  97. /// 步进距离
  98. /// </summary>
  99. public double StepDistance
  100. {
  101. get { return _StepDistance; }
  102. set { SetProperty(ref _StepDistance, value); }
  103. }
  104. private double _SafeZ;
  105. /// <summary>
  106. /// Z轴的安全高度
  107. /// </summary>
  108. public double SafeZ
  109. {
  110. get { return _SafeZ; }
  111. set { SetProperty(ref _SafeZ, value); }
  112. }
  113. private Guid _PLC;
  114. /// <summary>
  115. /// 对应的PLC
  116. /// </summary>
  117. public Guid PLC
  118. {
  119. get { return _PLC; }
  120. set { SetProperty(ref _PLC, value); }
  121. }
  122. private PlcRobotParameter _PlcRobotParameter=new PlcRobotParameter();
  123. public PlcRobotParameter PlcRobotParameter
  124. {
  125. get { return _PlcRobotParameter; }
  126. set { SetProperty(ref _PlcRobotParameter, value); }
  127. }
  128. public RobotInfo Clone()
  129. {
  130. return JsonConvert.DeserializeObject<RobotInfo>(JsonConvert.SerializeObject(this)); ;
  131. }
  132. }
  133. }