public WhiskerAngularVelocityViewModel(AnalyserViewModel parent) : base(parent, "Whisker Angular Velocity") { Model = ModelResolver.Resolve <IWhiskerAngularVelocity>(); Model.LoadData(parent.Frames.Values.Select(x => x.Model).ToArray()); CreateFrames(); MethodControl = new WhiskerAngularVelocityView() { DataContext = this, }; ObservableCollection <AngleTypeBase> angleOptions = new ObservableCollection <AngleTypeBase>(); IWhisker nosePoint = Parent.CurrentFrame.Whiskers.Select(x => x.Model).FirstOrDefault(x => x.WhiskerId == -1); IWhisker orientationPoint = Parent.CurrentFrame.Whiskers.Select(x => x.Model).FirstOrDefault(x => x.WhiskerId == 0); if (nosePoint != null && orientationPoint != null) { angleOptions.Add(new CenterLineViewModel()); } angleOptions.Add(new VerticalViewModel()); angleOptions.Add(new HorizontalViewModel()); AngleOptions = angleOptions; SelectedAngleOption = AngleOptions.First(); Initialise(); }
private void CreateFrames() { ObservableCollection <SingleWhiskerFrequencyViewModel> whiskers = new ObservableCollection <SingleWhiskerFrequencyViewModel>(); foreach (ISingleWhiskerFrequency frequency in Model.Whiskers) { SingleWhiskerFrequencyViewModel frequencyViewModel = new SingleWhiskerFrequencyViewModel(frequency); //frequencyViewModel.EnabledChanged += PropagateWhiskerEnabledNotification; whiskers.Add(frequencyViewModel); } Whiskers = whiskers; SelectedWhisker = Whiskers.First(); ObservableCollection <WhiskersEnabledViewModel> displayWhiskers = new ObservableCollection <WhiskersEnabledViewModel>(); foreach (SingleWhiskerFrequencyViewModel whisker in Whiskers) { WhiskersEnabledViewModel displayWhisker = new WhiskersEnabledViewModel(this, whisker); displayWhiskers.Add(displayWhisker); } ObservableCollection <AngleTypeBase> angleOptions = new ObservableCollection <AngleTypeBase>(); IWhisker nosePoint = Parent.CurrentFrame.Whiskers.Select(x => x.Model).FirstOrDefault(x => x.WhiskerId == -1); IWhisker orientationPoint = Parent.CurrentFrame.Whiskers.Select(x => x.Model).FirstOrDefault(x => x.WhiskerId == 0); if (nosePoint != null && orientationPoint != null) { angleOptions.Add(new CenterLineViewModel()); } angleOptions.Add(new VerticalViewModel()); angleOptions.Add(new HorizontalViewModel()); AngleOptions = angleOptions; SelectedAngleOption = AngleOptions.First(); DisplayWhiskers = displayWhiskers; CreateGraphData(); }
public AnalyseEverythingViewModel(AnalyserViewModel parent) : base(parent, "Analyse Everything") { ObservableCollection <AnalyseEverythingBaseViewModel> analysisMethods = new ObservableCollection <AnalyseEverythingBaseViewModel>(); foreach (MethodBase method in parent.AnalysisMethods) { if (method is NoseDisplacementViewModel || method is WhiskerFrequencyViewModel || method is WhiskerMeanOffsetViewModel || method is WhiskerAmplitudeViewModel || method is WhiskerProtractionRetractionViewModel) { analysisMethods.Add(new AnalyseEverythingBaseViewModel(this, method)); } } AnalysisMethods = analysisMethods; ItemsToAnalyse = new ObservableCollection <AnalyseEverythingBaseViewModel>(); MethodControl = new AnalyseEverythingView() { DataContext = this, }; ShowFrameSlider = false; ObservableCollection <AngleTypeBase> angleOptions = new ObservableCollection <AngleTypeBase>(); angleOptions.Add(new CenterLineViewModel()); angleOptions.Add(new VerticalViewModel()); angleOptions.Add(new HorizontalViewModel()); AngleOptions = angleOptions; SelectedAngleOption = AngleOptions.First(); ObservableCollection <FrequencyTypeBaseViewModel> frequencyTypes = new ObservableCollection <FrequencyTypeBaseViewModel>(); frequencyTypes.Add(new AutocorrelogramViewModel()); frequencyTypes.Add(new DiscreteFourierTransformViewModel()); FrequencyTypes = frequencyTypes; SelectedFrequencyType = FrequencyTypes.First(); Initialise(); }
private void CreateFrames() { ObservableCollection <SingleWhiskerProtractionRetractionViewModel> whiskers = new ObservableCollection <SingleWhiskerProtractionRetractionViewModel>(); foreach (ISingleWhiskerProtractionRetraction whisker in Model.Whiskers) { SingleWhiskerProtractionRetractionViewModel meanOffsetViewModel = new SingleWhiskerProtractionRetractionViewModel(whisker); whiskers.Add(meanOffsetViewModel); } Whiskers = whiskers; ObservableCollection <WhiskersEnabledViewModel> displayWhiskers = new ObservableCollection <WhiskersEnabledViewModel>(); foreach (SingleWhiskerProtractionRetractionViewModel whisker in Whiskers) { WhiskersEnabledViewModel displayWhisker = new WhiskersEnabledViewModel(this, whisker); displayWhiskers.Add(displayWhisker); } ObservableCollection <AngleTypeBase> angleOptions = new ObservableCollection <AngleTypeBase>(); IWhisker nosePoint = Parent.CurrentFrame.Whiskers.Select(x => x.Model).FirstOrDefault(x => x.WhiskerId == -1); IWhisker orientationPoint = Parent.CurrentFrame.Whiskers.Select(x => x.Model).FirstOrDefault(x => x.WhiskerId == 0); if (nosePoint != null && orientationPoint != null) { angleOptions.Add(new CenterLineViewModel()); } angleOptions.Add(new VerticalViewModel()); angleOptions.Add(new HorizontalViewModel()); AngleOptions = angleOptions; SelectedAngleOption = AngleOptions.First(); DisplayWhiskers = displayWhiskers; }