RobotInfo.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. using Newtonsoft.Json;
  2. using Prism.Mvvm;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using TeamAAS.Robot.Enums;
  10. using TeamAAS.Robot.Models.PLC;
  11. using TeamAAS.Communication.Enums;
  12. namespace TeamAAS.Robot.Models
  13. {
  14. /// <summary>
  15. /// 机器人参数
  16. /// </summary>
  17. public class RobotInfo : TeamAAS.BindableBase
  18. {
  19. private Guid _Id;
  20. [Browsable(false)]
  21. public Guid Id
  22. {
  23. get { return _Id; }
  24. set { SetProperty(ref _Id, value); }
  25. }
  26. private int _RobotNo;
  27. [Category("基本"), DisplayName("编号")]
  28. public int RobotNo
  29. {
  30. get { return _RobotNo; }
  31. set { SetProperty(ref _RobotNo, value); }
  32. }
  33. private string _RobotName;
  34. [Category("基本"), DisplayName("名称")]
  35. public string RobotName
  36. {
  37. get { return _RobotName; }
  38. set { SetProperty(ref _RobotName, value); }
  39. }
  40. private RobotBrand _RobotBrand = RobotBrand.Default;
  41. [Category("只读信息"), DisplayName("品牌"), ReadOnly(true)]
  42. public RobotBrand RobotBrand
  43. {
  44. get { return _RobotBrand; }
  45. set { SetProperty(ref _RobotBrand, value); }
  46. }
  47. private TCPConnectType _ConnectType = TCPConnectType.Client;
  48. [Category("通讯"), DisplayName("连接方式")]
  49. public TCPConnectType ConnectType
  50. {
  51. get { return _ConnectType; }
  52. set { SetProperty(ref _ConnectType, value); }
  53. }
  54. private string _IP = "192.168.0.1";
  55. [Category("通讯"), DisplayName("IP地址")]
  56. public string IP
  57. {
  58. get { return _IP; }
  59. set { SetProperty(ref _IP, value); }
  60. }
  61. private int _Port = 3600;
  62. [Category("通讯"), DisplayName("端口")]
  63. public int Port
  64. {
  65. get { return _Port; }
  66. set { SetProperty(ref _Port, value); }
  67. }
  68. private Terminator _Terminator = Terminator.CRLF;
  69. [Category("通讯"), DisplayName("结束符")]
  70. public Terminator Terminator
  71. {
  72. get { return _Terminator; }
  73. set { SetProperty(ref _Terminator, value); }
  74. }
  75. private DataEncoding _DataEncoding = DataEncoding.Default;
  76. [Category("通讯"), DisplayName("编码格式")]
  77. public DataEncoding DataEncoding
  78. {
  79. get { return _DataEncoding; }
  80. set { SetProperty(ref _DataEncoding, value); }
  81. }
  82. private double _StepDistance = 1.0;
  83. [Category("运动"), DisplayName("步进距离")]
  84. public double StepDistance
  85. {
  86. get { return _StepDistance; }
  87. set { SetProperty(ref _StepDistance, value); }
  88. }
  89. private Guid _PLC;
  90. [Browsable(false)]
  91. public Guid PLC
  92. {
  93. get { return _PLC; }
  94. set { SetProperty(ref _PLC, value); }
  95. }
  96. private PlcRobotParameter _PlcRobotParameter = new PlcRobotParameter();
  97. [Browsable(false)]
  98. public PlcRobotParameter PlcRobotParameter
  99. {
  100. get { return _PlcRobotParameter; }
  101. set { SetProperty(ref _PlcRobotParameter, value); }
  102. }
  103. public RobotInfo Clone()
  104. {
  105. return JsonConvert.DeserializeObject<RobotInfo>(JsonConvert.SerializeObject(this));
  106. }
  107. }
  108. }