private void SelectedVideoChanged() { VideoSelected = SelectedVideo != null; if (SelectedVideo == null) { DisplayText = ""; ShowVideo = false; return; } CurrentResult = Results[SelectedVideo.Model]; if (CurrentResult.VideoOutcome == SingleFileResult.Ok) { Video = ModelResolver.Resolve <IVideo>(); Video.SetVideo(SelectedVideo.VideoFileName); Maximum = Video.FrameCount - 1; Minimum = 0; m_SliderValue = -1; ShowVideo = true; m_GapDistance = CurrentResult.GapDistance; m_BinaryThreshold = CurrentResult.ThresholdValue; m_BinaryThreshold2 = CurrentResult.ThresholdValue2; AnalyseStart = CurrentResult.StartFrame; AnalyseEnd = CurrentResult.EndFrame; DistanceTravelled = CurrentResult.DistanceTravelled; CentroidDistanceTravelled = CurrentResult.CentroidDistanceTravelled; MotionTrack = CurrentResult.MotionTrack; CentroidMotionTrack = CurrentResult.CentroidMotionTrack; FrameRate = CurrentResult.FrameRate; Duration = CurrentResult.Duration; AvgVelocity = CurrentResult.AverageVelocity; AvgCentroidVelocity = CurrentResult.AverageCentroidVelocity; AvgAngularVelocity = CurrentResult.AverageAngularVelocity; MaxVelocity = CurrentResult.MaxSpeed; MaxCentroidVelocity = CurrentResult.MaxCentroidSpeed; MaxAngularVelocity = CurrentResult.MaxAngularVelocty; CentroidSize = CurrentResult.CentroidSize; List <BehaviourHolderViewModel> behaviours = new List <BehaviourHolderViewModel>(); Dictionary <IBoundaryBase, IBehaviourHolder[]> interactingBoundries = CurrentResult.InteractingBoundries; foreach (KeyValuePair <IBoundaryBase, IBehaviourHolder[]> kvp in interactingBoundries) { BoundaryBaseViewModel boundaryVm = BoundaryBaseViewModel.GetBoundaryFromModel(kvp.Key); IBehaviourHolder[] currentBehaviours = kvp.Value; behaviours.AddRange(currentBehaviours.Select(currentBehaviour => new BehaviourHolderViewModel(boundaryVm, currentBehaviour.Interaction, currentBehaviour.FrameNumber))); } var tempBehaviours = behaviours.OrderBy(x => x.FrameNumber); SelectedMouseBehaviours = new ObservableCollection <BehaviourHolderViewModel>(tempBehaviours); NotifyPropertyChanged("GapDistance"); NotifyPropertyChanged("BinaryThreshold"); NotifyPropertyChanged("BinaryThreshold2"); //if (SmoothMotion) //{ // SmoothMotionChanged(true); //} SliderValue = 0; SmoothMotion = CurrentResult.SmoothMotion; } else { DisplayText = CurrentResult.Message; ShowVideo = false; } }
public BehaviourHolderViewModel(BoundaryBaseViewModel boundary, InteractionBehaviour interaction, int frameNumber) { Boundary = boundary; Interaction = interaction; FrameNumber = frameNumber; }