Example #1
0
        private void new_timer_Tick(object sender, EventArgs e)
        {
            if (mainMenuPointer.goodConnection == false)
            {
                AlertGUI temp2 = new AlertGUI();
                temp2.setMessage("Connection to server lost: Setting default task");

                temp2.Show();
                temp2.BringToFront();

                mainMenuPointer.goodConnection = true;
            }
            if (mainMenuPointer.wiimoteCon == false)
            {
                AlertGUI temp = new AlertGUI();
                temp.setMessage("Wiimote not connected");
                temp.Show();
                temp.BringToFront();
                mainMenuPointer.wiimoteCon = true;
            }

            mainMenuPointer.ProcessSteps();
            this.Refresh();
            this.steps_value.Text = mainMenuPointer.getSteps().ToString();
            this.Refresh();

            if (mainMenuPointer.isON)
            {
                this.Show();
            }

            dis_counter++;
            seconds++;

            stepsMin();//calculates and sets the steps per minuite field

            this.distance_value.Text = (mainMenuPointer.getSteps() * .003).ToString() + " mi";


            if (seconds == 60)
            {
                seconds = 0;
                sec     = "00";
                minutes++;
            }

            if (seconds < 10)
            {
                sec = "0" + seconds.ToString();
            }


            if (seconds >= 10)
            {
                sec = seconds.ToString();
            }

            if (minutes == 60)
            {
                minutes = 0;
                min     = "00";
                hours++;
            }

            if (minutes < 10)
            {
                min = "0" + minutes.ToString();
            }

            if (minutes >= 10)
            {
                min = minutes.ToString();
            }

            if (hours < 10)
            {
                hr = "0" + hours.ToString();
            }

            if (hours >= 10)
            {
                hr = hours.ToString();
            }


            this.time_walking_value.Text = hr + ":" + min + ":" + sec;
        }