private void CreateSelectionProgressSubscription(SelectionModes mode)
        {
            Log.DebugFormat("Creating subscription to {0} SelectionTriggerSource for progress info.", SelectionMode);

            ITriggerSource selectionTriggerSource = null;

            switch (mode)
            {
                case SelectionModes.Key:
                    selectionTriggerSource = keySelectionTriggerSource;
                    break;

                case SelectionModes.Point:
                    selectionTriggerSource = pointSelectionTriggerSource;
                    break;
            }

            if (selectionTriggerSource != null)
            {
                selectionProgressSubscription = selectionTriggerSource.Sequence
                    .Where(ts => ts.Progress != null)
                    .DistinctUntilChanged()
                    .ObserveOnDispatcher()
                    .Subscribe(ts =>
                    {
                        PublishSelectionProgress(new Tuple<PointAndKeyValue?, double>(ts.PointAndKeyValue, ts.Progress.Value));
                    });
            }
        }
        private void CreateSelectionProgressSubscription(SelectionModes mode)
        {
            Log.DebugFormat("Creating subscription to {0} SelectionTriggerSource for progress info.", SelectionMode);

            ITriggerSource selectionTriggerSource = null;

            switch (mode)
            {
            case SelectionModes.Key:
                selectionTriggerSource = keySelectionTriggerSource;
                break;

            case SelectionModes.Point:
                selectionTriggerSource = pointSelectionTriggerSource;
                break;
            }

            if (selectionTriggerSource != null)
            {
                selectionProgressSubscription = selectionTriggerSource.Sequence
                                                .Where(ts => ts.Progress != null)
                                                .DistinctUntilChanged()
                                                .ObserveOnDispatcher()
                                                .Subscribe(ts =>
                {
                    PublishSelectionProgress(new Tuple <PointAndKeyValue?, double>(ts.PointAndKeyValue, ts.Progress.Value));
                });
            }
        }
        public InputService(
            IKeyStateService keyStateService,
            IDictionaryService dictionaryService,
            IAudioService audioService,
            ICapturingStateManager capturingStateManager,
            IPointSource pointSource,
            ITriggerSource keySelectionTriggerSource,
            ITriggerSource pointSelectionTriggerSource)
        {
            this.keyStateService             = keyStateService;
            this.dictionaryService           = dictionaryService;
            this.audioService                = audioService;
            this.capturingStateManager       = capturingStateManager;
            this.pointSource                 = pointSource;
            this.keySelectionTriggerSource   = keySelectionTriggerSource;
            this.pointSelectionTriggerSource = pointSelectionTriggerSource;

            //Fixation key triggers also need the enabled state info
            var fixationTrigger = keySelectionTriggerSource as IFixationTriggerSource;

            if (fixationTrigger != null)
            {
                fixationTrigger.KeyEnabledStates = keyStateService.KeyEnabledStates;
            }
        }
Esempio n. 4
0
        private void CreateSelectionSubscriptions(SelectionModes mode)
        {
            Log.DebugFormat("Creating subscription to {0} SelectionTriggerSource for selections & results.", SelectionMode);

            switch (mode)
            {
            case SelectionModes.Key:
                selectionTriggerSource = keySelectionTriggerSource;
                break;

            case SelectionModes.Point:
                selectionTriggerSource = pointSelectionTriggerSource;
                break;
            }

            if (eyeGestureTriggerSource != null)
            {
                eyeGestureTriggerSubscription = eyeGestureTriggerSource.Sequence
                                                .ObserveOnDispatcher()
                                                .Subscribe(ProcessSelectionTrigger);
            }

            if (selectionTriggerSource != null)
            {
                selectionTriggerSubscription = selectionTriggerSource.Sequence
                                               .ObserveOnDispatcher()
                                               .Subscribe(ProcessSelectionTrigger);
            }
        }
Esempio n. 5
0
        public InputService(
            IKeyStateService keyStateService,
            IDictionaryService dictionaryService,
            IAudioService audioService,
            ICapturingStateManager capturingStateManager,
            IPointSource pointSource,
            ITriggerSource eyeGestureTriggerSource,
            ITriggerSource keySelectionTriggerSource,
            ITriggerSource pointSelectionTriggerSource)
        {
            this.keyStateService             = keyStateService;
            this.dictionaryService           = dictionaryService;
            this.audioService                = audioService;
            this.capturingStateManager       = capturingStateManager;
            this.pointSource                 = pointSource;
            this.eyeGestureTriggerSource     = eyeGestureTriggerSource;
            this.keySelectionTriggerSource   = keySelectionTriggerSource;
            this.pointSelectionTriggerSource = pointSelectionTriggerSource;

            //Fixation key triggers also need the enabled state info and override times
            if (keySelectionTriggerSource is IFixationTriggerSource fixationTrigger)
            {
                fixationTrigger.KeyEnabledStates = keyStateService.KeyEnabledStates;
                OverrideTimesByKey = fixationTrigger.OverrideTimesByKey;
            }
        }
Esempio n. 6
0
 public InputService(
     IPointSource pointSource,
     ITriggerSource keySelectionTriggerSource)
 {
     this.pointSource = pointSource;
     this.keySelectionTriggerSource = keySelectionTriggerSource;
 }
Esempio n. 7
0
        public InputService(
            IKeyStateService keyStateService,
            IDictionaryService dictionaryService,
            IAudioService audioService,
            ICapturingStateManager capturingStateManager,
            IPointSource pointSource,
            ITriggerSource keySelectionTriggerSource,
            ITriggerSource pointSelectionTriggerSource)
        {
            this.keyStateService = keyStateService;
            this.dictionaryService = dictionaryService;
            this.audioService = audioService;
            this.capturingStateManager = capturingStateManager;
            this.pointSource = pointSource;
            this.keySelectionTriggerSource = keySelectionTriggerSource;
            this.pointSelectionTriggerSource = pointSelectionTriggerSource;

            //Fixation key triggers also need the enabled state info
            var fixationTrigger = keySelectionTriggerSource as IFixationTriggerSource;
            if (fixationTrigger != null)
            {
                fixationTrigger.KeyEnabledStates = keyStateService.KeyEnabledStates;
            }
        }
        private void CreateSelectionSubscriptions(SelectionModes mode)
        {
            Log.DebugFormat("Creating subscription to {0} SelectionTriggerSource for selections & results.", SelectionMode);

            switch (mode)
            {
                case SelectionModes.Key:
                    selectionTriggerSource = keySelectionTriggerSource;
                    break;

                case SelectionModes.Point:
                    selectionTriggerSource = pointSelectionTriggerSource;
                    break;
            }

            if (selectionTriggerSource != null)
            {
                selectionTriggerSubscription = selectionTriggerSource.Sequence
                    .ObserveOnDispatcher()
                    .Subscribe(ProcessSelectionTrigger);
            }
        }