ActionParamsExtModel.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. using Prism.Mvvm;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Collections.ObjectModel;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using Team.FFFeederService;
  9. using Team.FFFeederService.Models;
  10. namespace TeamAAS_VP.Models
  11. {
  12. public class ActionParamsExtModel:BindableBase
  13. {
  14. public int ActionIndex { get; set; }
  15. private int _AmplitudeMax;
  16. public int AmplitudeMax
  17. {
  18. get { return _AmplitudeMax; }
  19. set { SetProperty(ref _AmplitudeMax, value); }
  20. }
  21. private int _AmplitudeMin;
  22. public int AmplitudeMin
  23. {
  24. get { return _AmplitudeMin; }
  25. set { SetProperty(ref _AmplitudeMin, value); }
  26. }
  27. private int _FrequencyMax;
  28. public int FrequencyMax
  29. {
  30. get { return _FrequencyMax; }
  31. set { SetProperty(ref _FrequencyMax, value); }
  32. }
  33. private int _FrequencyMin;
  34. public int FrequencyMin
  35. {
  36. get { return _FrequencyMin; }
  37. set { SetProperty(ref _FrequencyMin, value); }
  38. }
  39. private int _Duration;
  40. /// <summary>
  41. /// 持续时长(单位:毫秒)
  42. /// </summary>
  43. public int Duration
  44. {
  45. get { return _Duration; }
  46. set { SetProperty(ref _Duration, value); }
  47. }
  48. public ActionParamsExtModel()
  49. {
  50. }
  51. public ActionParamsExtModel(int actionindex)
  52. {
  53. ActionIndex= actionindex;
  54. }
  55. public ActionParamsExtModel Copy()
  56. {
  57. ActionParamsExtModel newAction = new ActionParamsExtModel();
  58. newAction.ActionIndex = this.ActionIndex;
  59. newAction.AmplitudeMax = this.AmplitudeMax;
  60. newAction.AmplitudeMin = this.AmplitudeMin;
  61. newAction.FrequencyMax = this.FrequencyMax;
  62. newAction.FrequencyMin = this.FrequencyMin;
  63. newAction.Duration = this.Duration;
  64. return newAction;
  65. }
  66. }
  67. public class FeederFrequencyModel : BindableBase
  68. {
  69. private bool _FeederDirectionInverse;
  70. public bool FeederDirectionInverse
  71. {
  72. get { return _FeederDirectionInverse; }
  73. set { SetProperty(ref _FeederDirectionInverse, value); }
  74. }
  75. private ObservableCollection<ActionParamsExtModel> _FeederFindFrequency=new ObservableCollection<ActionParamsExtModel>();
  76. /// <summary>
  77. /// Feeder自动寻频配置文件
  78. /// </summary>
  79. public ObservableCollection<ActionParamsExtModel> FeederFindFrequency
  80. {
  81. get { return _FeederFindFrequency; }
  82. set { SetProperty(ref _FeederFindFrequency, value); }
  83. }
  84. public FeederFrequencyModel()
  85. {
  86. }
  87. public FeederFrequencyModel(int actionCount)
  88. {
  89. FeederFindFrequency.Clear();
  90. for (int i = 0; i < actionCount; i++)
  91. {
  92. FeederFindFrequency.Add(new ActionParamsExtModel(i));
  93. }
  94. }
  95. public FeederFrequencyModel Copy()
  96. {
  97. FeederFrequencyModel newModel = new FeederFrequencyModel();
  98. newModel.FeederDirectionInverse = this.FeederDirectionInverse;
  99. newModel.FeederFindFrequency.Clear();
  100. foreach (var action in this.FeederFindFrequency)
  101. {
  102. newModel.FeederFindFrequency.Add(action.Copy());
  103. }
  104. return newModel;
  105. }
  106. }
  107. }