using Bro.Common.Helper; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Bro.Common.Model { public class VelocityParams:IComplexDisplay { [Category("速度参数")] [Description("运行速度")] public float Velocity { get; set; } [Category("速度参数")] [Description("加速度")] public float Acceleration { get; set; } [Category("速度参数")] [Description("减速度")] public float Deceleration { get; set; } [Category("Jog速度参数")] [Description("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")}"; } } }