Пример #1
0
        public MainPresenter(EVideoType type = EVideoType.Original)
        {
            VideoDisplayModel       = new VideoDisplayModel();
            _orgVideoController     = VideoController.Instance;
            _sdController           = ScoreboardDetectorController_Test.Instance;
            _sdController.Source    = _orgVideoController;
            _sdController.Finished += OnSDC_FinishedEventHandler;

            _fileHelper = new VideoFileHelper();

            SwitchVideo(type);
        }
Пример #2
0
        public void SwitchVideo(EVideoType type)
        {
            switch (type)
            {
            case EVideoType.BoardDetect:
                _sdController.Stop();
                _sdController.Grabbed -= OnGrabbed;
                break;

            default:
                //case EVideoType.Original:
                _orgVideoController.Grabbed -= OnGrabbed;
                break;
            }

            switch (type)
            {
            case EVideoType.BoardDetect:
                _sdController.Grabbed       -= OnGrabbed;
                _sdController.Grabbed       += OnGrabbed;
                VideoDisplayModel.Controller = _sdController;
                break;

            default:
                //case EVideoType.Original:
                _orgVideoController.Grabbed -= OnGrabbed;
                _orgVideoController.Grabbed += OnGrabbed;
                VideoDisplayModel.Controller = _orgVideoController;
                break;
            }

            if (ImageChanged != null)
            {
                ImageChanged(this, EventArgs.Empty);
            }
        }