Exemplo n.º 1
0
        public ScrollManager()
        {
            overlayForm    = SharedFormsSingleton.Instance().overlayForm;;
            inputSimulator = SharedObjectsSingleton.Instance().inputSimulator;
            EventSingleton.Instance().updateTimer.Tick += updateTimer_Tick;

            scrollState = eScrollState.NOSCROLL;

            //Getting the images that will be used to
            upArrow = new Bitmap(Properties.Resources.Arrow);
            upArrow.MakeTransparent();
            downArrow = new Bitmap(Properties.Resources.Arrow);
            downArrow.MakeTransparent();
            downArrow.RotateFlip(RotateFlipType.RotateNoneFlipY);

            upArrowFocused = new Bitmap(Properties.Resources.ArrowFocused);
            upArrowFocused.MakeTransparent();
            downArrowFocused = new Bitmap(Properties.Resources.ArrowFocused);
            downArrowFocused.MakeTransparent();
            downArrowFocused.RotateFlip(RotateFlipType.RotateNoneFlipY);

            lastFixation = new Point(0, 0);

            setupHotspots();
        }
Exemplo n.º 2
0
 internal void close()
 {
     speechRecognizer.Dispose();
     EventSingleton.Instance().fixationEvent -= sharedData_fixationEvent;
     EventSingleton.Instance().systemHook.KeyDown -= sharedData_keyboardEvent;
     speechRecognizer.SpeechRecognized -= SpeechRecognised;
 }
Exemplo n.º 3
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     //on collision with antigen
     if (collision.gameObject.tag == "Antigen")
     {
         collision.gameObject.GetComponent <ItemPickup>().GetPickedUp();
         EventSingleton.AddAntigen();
     }
 }
Exemplo n.º 4
0
        public Hotspot(Rectangle hotspotRect, Action callback)
        {
            updateTimer       = EventSingleton.Instance().updateTimer;
            updateTimer.Tick += updateTimer_Tick;
            overlayForm       = SharedFormsSingleton.Instance().overlayForm;
            overlayForm.RegisterOverlay(this);

            this.hotspotRect = hotspotRect;
            this.callback    = callback;
        }
        public MainEngine()
        {
            commandList = CommandSingleton.Instance();

            controlState = new CommandState();

            SetupSpeechRecognition();


            EventSingleton.Instance().fixationEvent += sharedData_fixationEvent;
        }
Exemplo n.º 6
0
        public EventViewModel()
        {
            EventSingleton = EventSingleton.Instance;
            DateTime dt = System.DateTime.Now;

            _date = new DateTimeOffset(dt.Year, dt.Month, dt.Day, 0, 0, 0, 0, new TimeSpan());
            _time = new TimeSpan(dt.Hour, dt.Minute, dt.Second);

            EventHandler = new Handler.EventHandler(this);

            _createEventCommand = new RelayCommand(EventHandler.CreateEvent);
        }
Exemplo n.º 7
0
        public MainEngine(MainSystemTray form)
        {
            //Fetch the list of commands
            commandList = SettingsSingleton.Instance().Commands;
            // Create the speech recognition engine
            speechRecognizer = createSpeechRecogntionEngine(form);

            stateController = new StateController();

            //Register to the event that provides the fixations
            EventSingleton.Instance().fixationEvent += sharedData_fixationEvent;
            //Register to the event that fires when keyboard keys are pressed
            EventSingleton.Instance().systemHook.KeyDown += sharedData_keyboardEvent;
            speechRecognizer.SpeechRecognized += SpeechRecognised;
        }
Exemplo n.º 8
0
        public StateController()
        {
            //Creating the hotspots that will be used to change the states
            setupStateHotspots();

            //Setting the current state to command state
            currentState                  = stateHotspots[(int)eState.Command].GetState();
            selectedStateHotspot          = stateHotspots[(int)eState.Command];
            selectedStateHotspot.selected = true;

            //Registering state controller to be drawn to the overlay form
            SharedFormsSingleton.Instance().overlayForm.RegisterOverlay(this);

            //Setting up state controller to listen to the update timer tick
            EventSingleton.Instance().updateTimer.Tick += updateTimer_Tick;
        }
Exemplo n.º 9
0
        public OverlayForm()
        {
            InitializeComponent();

            TopLevel = true;
            TopMost  = true;

            //Setting form to fill the primary screen of the computer
            Top  = 0;
            Left = 0;

            Height = Screen.PrimaryScreen.Bounds.Height;
            Width  = Screen.PrimaryScreen.Bounds.Width;

            //Creating buffer for graphics
            buffer         = new Bitmap(Width, Height);
            bufferGraphics = Graphics.FromImage(buffer);

            //Getting reference to form graphics
            formGraphics = CreateGraphics();

            EventSingleton.Instance().drawTimer.Tick += drawTimer_Tick;
        }
Exemplo n.º 10
0
 public FixationDot()
 {
     currentFixationLocation = new Point(0, 0);
     EventSingleton.Instance().fixationEvent += fixationEvent;
 }
Exemplo n.º 11
0
 private void btnAddNewUser_Click(object sender, EventArgs e)
 {
     EventSingleton.Instance().eyex.LaunchProfileCreation();
 }
Exemplo n.º 12
0
 private void btnCalibrate_Click(object sender, EventArgs e)
 {
     EventSingleton.Instance().eyex.LaunchRecalibration();
 }
Exemplo n.º 13
0
 private void setDebugEyeState()
 {
     EventSingleton.Instance().setMouseFixationsStatus(chkbxDebugEyeTracking.Checked);
 }