using Bro.Common.Helper;
|
using System.ComponentModel;
|
|
namespace Bro.Common.Model
|
{
|
public class VelocityParams : IComplexDisplay
|
{
|
[Category("速度参数")]
|
[Description("运行速度")]
|
[DisplayName("运行速度")]
|
public float Velocity { get; set; }
|
|
[Category("速度参数")]
|
[Description("加速度")]
|
[DisplayName("加速度")]
|
public float Acceleration { get; set; }
|
|
[Category("速度参数")]
|
[Description("减速度")]
|
[DisplayName("减速度")]
|
public float Deceleration { get; set; }
|
|
[Category("Jog速度参数")]
|
[Description("Jog速度")]
|
[DisplayName("Jog速度")]
|
public float JogVelocity { get; set; }
|
|
public bool Equals(VelocityParams dest)
|
{
|
return Velocity == dest.Velocity
|
&& Acceleration == dest.Acceleration
|
&& Deceleration == dest.Deceleration;
|
}
|
|
public bool IsValid()
|
{
|
return Velocity <= 0 || Acceleration <= 0 || Deceleration <= 0;
|
}
|
|
public string GetDisplayText()
|
{
|
return $"Vel:{Velocity.ToString("f2")},Acc:{Acceleration.ToString("f2")},Dec:{Deceleration.ToString("f2")}";
|
}
|
}
|
}
|