using System; namespace OnlineUserPool.Model { public class MsgModel : ReceiveModel { private int _RouteId = 0; public int RouteId { get { return _RouteId; } set { SetProperty(ref _RouteId, value); } } private int _MemberId = 0; public int MemberId { get => _MemberId; set => SetProperty(ref _MemberId, value); } public double[] Point { get; set; } private bool _IsCompleted; public bool IsCompleted { get => _IsCompleted; set => SetProperty(ref _IsCompleted, value); } private bool _exit; public bool Exit { get => _exit; set => SetProperty(ref _exit, value); } private double _Speed = 0; public double Speed { get => _Speed; set => SetProperty(ref _Speed, value); } private double _HeartRate = 0; public double HeartRate { get => _HeartRate; set => SetProperty(ref _HeartRate, value); } private double _Power = 0; public double Power { get => _Power; set => SetProperty(ref _Power, value); } private double _Cadence = 0; public double Cadence { get => _Cadence; set => SetProperty(ref _Cadence, value); } private int _TotalTicks = 0; public int TotalTicks { get => _TotalTicks; set => SetProperty(ref _TotalTicks, value); } ///// ///// 需要展示的属性 ///// //public string Prop { get; set; } private double _PreDistance = 0; public double PreDistance { get => _PreDistance; set => SetProperty(ref _PreDistance, value); } private double _EndDistance = 0; public double EndDistance { get => _EndDistance; set => SetProperty(ref _EndDistance, value); } //public bool IsVirtual { get; set; } //public double Power { get; set; } //public double Weight { get; set; } /// /// 功率体重比 /// private double _WeightKg = 0; public double WeightKg { get => _WeightKg; set => SetProperty(ref _WeightKg, value); } private int _CompetitionId = 0; public int CompetitionId { get => _CompetitionId; set => SetProperty(ref _CompetitionId, value); } private bool _Saved ; public bool Saved { get => _Saved; set => SetProperty(ref _Saved, value); } //public bool ShowVirtual { get; set; } private int _FrameRate = 0; public int FrameRate { get => _FrameRate; set => SetProperty(ref _FrameRate, value); } private int _RoomId = 0; public int RoomId { get => _RoomId; set => SetProperty(ref _RoomId, value); } public DateTime? StartTime { get; set; } private string _Request; public string Request { get => _Request; set => SetProperty(ref _Request, value); } private string _Model; public string Model { get => _Model; set => SetProperty(ref _Model, value); } public string ToString(int v) { if (v == 2) { return $"{ RouteId },{ MemberId },{ string.Join(":", Point) },{ Convert.ToInt32(IsCompleted) },{ Speed },{ PreDistance },{ EndDistance },{ WeightKg },{ CompetitionId },{ Convert.ToInt32(Saved)},{ Power} ,{ HeartRate},{ Cadence},{ TotalTicks},{ FrameRate},{RoomId},{StartTime}"; } return $"{ RouteId },{ MemberId },{ string.Join(":", Point) },{ Convert.ToInt32(IsCompleted) },{ Speed },{ PreDistance },{ EndDistance },{ WeightKg },{ CompetitionId },{ Convert.ToInt32(Saved)}"; } public void Update(MsgModel model) { this.CompetitionId = model.CompetitionId; this.EndDistance = model.EndDistance; this.HeartRate = model.HeartRate; this.IsCompleted = model.IsCompleted; this.MemberId = model.MemberId; this.Point = model.Point; this.PreDistance = model.PreDistance; this.RouteId = model.RouteId; this.Speed = model.Speed; this.WeightKg = model.WeightKg; this.Saved = model.Saved; this.HeartRate = model.HeartRate; this.Cadence = model.Cadence; this.TotalTicks = model.TotalTicks; this.FrameRate = model.FrameRate; this.RoomId = model.RoomId; this.StartTime = model.StartTime; this.Request = model.Request; this.Power = model.Power; this.Exit = model.Exit; this.Model = model.Model; } } }