using Newtonsoft.Json;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TeamAAS.Robot.Enums;
using TeamAAS.Robot.Models.PLC;
using TeamAAS.Communication.Enums;
namespace TeamAAS.Robot.Models
{
///
/// 机器人参数
///
public class RobotInfo : TeamAAS.BindableBase
{
private Guid _Id;
[Browsable(false)]
public Guid Id
{
get { return _Id; }
set { SetProperty(ref _Id, value); }
}
private int _RobotNo;
[Category("基本"), DisplayName("编号")]
public int RobotNo
{
get { return _RobotNo; }
set { SetProperty(ref _RobotNo, value); }
}
private string _RobotName;
[Category("基本"), DisplayName("名称")]
public string RobotName
{
get { return _RobotName; }
set { SetProperty(ref _RobotName, value); }
}
private RobotBrand _RobotBrand = RobotBrand.Default;
[Category("只读信息"), DisplayName("品牌"), ReadOnly(true)]
public RobotBrand RobotBrand
{
get { return _RobotBrand; }
set { SetProperty(ref _RobotBrand, value); }
}
private TCPConnectType _ConnectType = TCPConnectType.Client;
[Category("通讯"), DisplayName("连接方式")]
public TCPConnectType ConnectType
{
get { return _ConnectType; }
set { SetProperty(ref _ConnectType, value); }
}
private string _IP = "192.168.0.1";
[Category("通讯"), DisplayName("IP地址")]
public string IP
{
get { return _IP; }
set { SetProperty(ref _IP, value); }
}
private int _Port = 3600;
[Category("通讯"), DisplayName("端口")]
public int Port
{
get { return _Port; }
set { SetProperty(ref _Port, value); }
}
private Terminator _Terminator = Terminator.CRLF;
[Category("通讯"), DisplayName("结束符")]
public Terminator Terminator
{
get { return _Terminator; }
set { SetProperty(ref _Terminator, value); }
}
private DataEncoding _DataEncoding = DataEncoding.Default;
[Category("通讯"), DisplayName("编码格式")]
public DataEncoding DataEncoding
{
get { return _DataEncoding; }
set { SetProperty(ref _DataEncoding, value); }
}
private double _StepDistance = 1.0;
[Category("运动"), DisplayName("步进距离")]
public double StepDistance
{
get { return _StepDistance; }
set { SetProperty(ref _StepDistance, value); }
}
private Guid _PLC;
[Browsable(false)]
public Guid PLC
{
get { return _PLC; }
set { SetProperty(ref _PLC, value); }
}
private PlcRobotParameter _PlcRobotParameter = new PlcRobotParameter();
[Browsable(false)]
public PlcRobotParameter PlcRobotParameter
{
get { return _PlcRobotParameter; }
set { SetProperty(ref _PlcRobotParameter, value); }
}
public RobotInfo Clone()
{
return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(this));
}
}
}