using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Team.FFFeederService;
using Team.FFFeederService.Models;
namespace TeamAAS_VP.Models
{
public class ActionParamsExtModel:BindableBase
{
public int ActionIndex { get; set; }
private int _AmplitudeMax;
public int AmplitudeMax
{
get { return _AmplitudeMax; }
set { SetProperty(ref _AmplitudeMax, value); }
}
private int _AmplitudeMin;
public int AmplitudeMin
{
get { return _AmplitudeMin; }
set { SetProperty(ref _AmplitudeMin, value); }
}
private int _FrequencyMax;
public int FrequencyMax
{
get { return _FrequencyMax; }
set { SetProperty(ref _FrequencyMax, value); }
}
private int _FrequencyMin;
public int FrequencyMin
{
get { return _FrequencyMin; }
set { SetProperty(ref _FrequencyMin, value); }
}
private int _Duration;
///
/// 持续时长(单位:毫秒)
///
public int Duration
{
get { return _Duration; }
set { SetProperty(ref _Duration, value); }
}
public ActionParamsExtModel()
{
}
public ActionParamsExtModel(int actionindex)
{
ActionIndex= actionindex;
}
public ActionParamsExtModel Copy()
{
ActionParamsExtModel newAction = new ActionParamsExtModel();
newAction.ActionIndex = this.ActionIndex;
newAction.AmplitudeMax = this.AmplitudeMax;
newAction.AmplitudeMin = this.AmplitudeMin;
newAction.FrequencyMax = this.FrequencyMax;
newAction.FrequencyMin = this.FrequencyMin;
newAction.Duration = this.Duration;
return newAction;
}
}
public class FeederFrequencyModel : BindableBase
{
private bool _FeederDirectionInverse;
public bool FeederDirectionInverse
{
get { return _FeederDirectionInverse; }
set { SetProperty(ref _FeederDirectionInverse, value); }
}
private ObservableCollection _FeederFindFrequency=new ObservableCollection();
///
/// Feeder自动寻频配置文件
///
public ObservableCollection FeederFindFrequency
{
get { return _FeederFindFrequency; }
set { SetProperty(ref _FeederFindFrequency, value); }
}
public FeederFrequencyModel()
{
}
public FeederFrequencyModel(int actionCount)
{
FeederFindFrequency.Clear();
for (int i = 0; i < actionCount; i++)
{
FeederFindFrequency.Add(new ActionParamsExtModel(i));
}
}
public FeederFrequencyModel Copy()
{
FeederFrequencyModel newModel = new FeederFrequencyModel();
newModel.FeederDirectionInverse = this.FeederDirectionInverse;
newModel.FeederFindFrequency.Clear();
foreach (var action in this.FeederFindFrequency)
{
newModel.FeederFindFrequency.Add(action.Copy());
}
return newModel;
}
}
}