RobotInfo.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. namespace TeamAAS_VP.Models
  10. {
  11. /// <summary>
  12. /// 机器人参数
  13. /// </summary>
  14. public class RobotInfo : BindableBase
  15. {
  16. private Guid _Id;
  17. public Guid Id
  18. {
  19. get { return _Id; }
  20. set { SetProperty(ref _Id, value); }
  21. }
  22. private string _RobotName;
  23. /// <summary>
  24. /// 机器人名称
  25. /// </summary>
  26. public string RobotName
  27. {
  28. get { return _RobotName; }
  29. set { SetProperty(ref _RobotName, value); }
  30. }
  31. private RobotBrand _RobotBrand = RobotBrand.Default;
  32. /// <summary>
  33. /// 机器人品牌
  34. /// </summary>
  35. public RobotBrand RobotBrand
  36. {
  37. get { return _RobotBrand; }
  38. set { SetProperty(ref _RobotBrand, value); }
  39. }
  40. private TCPConnectType _ConnectType = TCPConnectType.Client;
  41. /// <summary>
  42. /// 通讯方式
  43. /// </summary>
  44. public TCPConnectType ConnectType
  45. {
  46. get { return _ConnectType; }
  47. set { SetProperty(ref _ConnectType, value); }
  48. }
  49. private string _IP = "192.168.0.1";
  50. /// <summary>
  51. /// IP地址
  52. /// </summary>
  53. public string IP
  54. {
  55. get { return _IP; }
  56. set { SetProperty(ref _IP, value); }
  57. }
  58. private int _Port = 3600;
  59. /// <summary>
  60. /// 端口号
  61. /// </summary>
  62. public int Port
  63. {
  64. get { return _Port; }
  65. set { SetProperty(ref _Port, value); }
  66. }
  67. private Terminator _Terminator = Terminator.CRLF;
  68. /// <summary>
  69. /// 结束符
  70. /// </summary>
  71. public Terminator Terminator
  72. {
  73. get { return _Terminator; }
  74. set { SetProperty(ref _Terminator, value); }
  75. }
  76. private DataEncoding _DataEncoding=DataEncoding.Default;
  77. /// <summary>
  78. /// 数据编码格式
  79. /// </summary>
  80. public DataEncoding DataEncoding
  81. {
  82. get { return _DataEncoding; }
  83. set { SetProperty(ref _DataEncoding, value); }
  84. }
  85. private Guid _PLC;
  86. public Guid PLC
  87. {
  88. get { return _PLC; }
  89. set { SetProperty(ref _PLC, value); }
  90. }
  91. private PlcRobotParameter _PlcRobotParameter=new PlcRobotParameter();
  92. public PlcRobotParameter PlcRobotParameter
  93. {
  94. get { return _PlcRobotParameter; }
  95. set { SetProperty(ref _PlcRobotParameter, value); }
  96. }
  97. public RobotInfo Clone()
  98. {
  99. return JsonConvert.DeserializeObject<RobotInfo>(JsonConvert.SerializeObject(this)); ;
  100. }
  101. }
  102. }