예제 #1
0
        private void activateActions()
        {
            // For Instructions
            //firstLineOfInstruction.Content = "- Move Mouse with your right hand!";
            //secondLineOfInstruction.Content = "- Click with your left arm (slowly rise it up then  down)!";
            //thirdLineOfInstruction.Content = "- If mouse shakes, Change position (slightly left or right)!";

            notificationsWindow notificationsWindow = new notificationsWindow();

            notificationsWindow.textBlockMessage.Text = "Control activated. Read instruction Please!";
            notificationsWindow.ShowDialog();

            // this timer to get out of a stuck if the detection stopped (indicated by no movement of cursor)
            mouseStuckTimer.Start();
            stuckMouseX = mouseX;
            stuckMouseY = mouseY;

            // this timer to click if the cursor stopped for sometime
            clickingTimer.Start();
            clickMouseX = mouseX;
            clickMouseY = mouseY;

            // since a control change happened under the specified time, then just restart the timer, waiting for next change
            programStuckTimer.Stop();
            programStuckTimer.Start();
        }
예제 #2
0
        private void deactivateActions()
        {
            justDeactivated  = true;
            skeletonId       = -1;
            skeletonSelected = false;
            kinectTimer.Start();


            // For Instructions
            //firstLineOfInstruction.Content = "- Stand in the box drawn on the ground to control!";
            //secondLineOfInstruction.Content = "- Only one user at a time!";
            //thirdLineOfInstruction.Content = "- If no response, Please inform server room!";


            notificationsWindow notificationsWindow = new notificationsWindow();

            notificationsWindow.textBlockMessage.Text = "Control De-Activated. Thanks for using!";

            //// if deactivation was due to going out of box and not some guy crossing
            //// then close all previous windows, set cursor on corner, and intilize the main window again
            //if (someoneCrossedInFrontOfUser == false)
            //{
            if (variables.previousCurrentWindow != null)
            {
                variables.previousCurrentWindow.Close();
            }
            if (variables.currentWindow != this)
            {
                variables.currentWindow.Close();
            }

            SetCursorPos(0, 0);
            this.InitializeComponent();
            setWindowVariables();
            //}

            notificationsWindow.ShowDialog();

            mouseStuckTimer.Stop();


            // since a control change happened under the specified time, then just restart the timer, waiting for next change
            programStuckTimer.Stop();
            programStuckTimer.Start();
        }