Ejemplo n.º 1
0
        private void connection_test_button_Click(object sender, EventArgs e)
        {
            AlertGUI temp5 = new AlertGUI();

            temp5.setMessage("Attempting to connect to server....", "");
            temp5.Show();

            try
            {
                PDA_GUI.ServerConnection conn = new PDA_GUI.ServerConnection();
                conn.connect();

                temp5.Close();
                temp5.Dispose();

                conn.disconnect();
                AlertGUI temp3 = new AlertGUI();
                temp3.setMessage("Server Connected Successfully!", "");
                temp3.Show();
            }
            catch
            {
                AlertGUI temp2 = new AlertGUI();
                temp2.setMessage("Could not find server");


                //temp2.ShowDialog();
                temp2.Show();

                temp5.Close();
                temp5.Dispose();
            }
        }
Ejemplo n.º 2
0
        public bool ConnectionStuff()
        {
            try
            {
                PDA_GUI.ServerConnection conn = new PDA_GUI.ServerConnection();
                conn.connect();

                Server_Connection.DailyTask[] dts = conn.getTasks();
                DailyTaskID = dts[0].idDailyTask;
                todaysTask  = new WalkingTask(((Server_Connection.WalkingTask)dts[0]).steps);
                conn.disconnect();
            }
            catch
            {
                todaysTask = new WalkingTask(500);

                //   temp2.ShowDialog();
                current_task = todaysTask.display();

                tasksDialog.setStuff(this);
                this.myWiiData        = new WiiRemoteData();
                myWiiRemoteConnection = new WiiRemoteConnection();

                wiimoteCon = myWiiRemoteConnection.connect();

                this.myWiiData.processData(myWiiRemoteConnection);
                this.TodaysStats = new Queue <Stats>();

                return(false);
            }

            current_task = todaysTask.display();

            tasksDialog.setStuff(this);
            this.myWiiData        = new WiiRemoteData();
            myWiiRemoteConnection = new WiiRemoteConnection();

            wiimoteCon = myWiiRemoteConnection.connect();

            this.myWiiData.processData(myWiiRemoteConnection);
            this.TodaysStats = new Queue <Stats>();
            return(true);
        }
Ejemplo n.º 3
0
        public bool ConnectionStuff()
        {
            try
            {
                PDA_GUI.ServerConnection conn = new PDA_GUI.ServerConnection();
                conn.connect();

                Server_Connection.DailyTask[] dts = conn.getTasks();
                DailyTaskID = dts[0].idDailyTask;
                todaysTask = new WalkingTask(((Server_Connection.WalkingTask)dts[0]).steps);
                conn.disconnect();
            }
            catch
            {
                todaysTask = new WalkingTask(500);

             //   temp2.ShowDialog();
                current_task = todaysTask.display();

                tasksDialog.setStuff(this);
                this.myWiiData = new WiiRemoteData();
                myWiiRemoteConnection = new WiiRemoteConnection();

                wiimoteCon = myWiiRemoteConnection.connect();

                this.myWiiData.processData(myWiiRemoteConnection);
                this.TodaysStats = new Queue<Stats>();

                return false;
            }

            current_task = todaysTask.display();

            tasksDialog.setStuff(this);
            this.myWiiData = new WiiRemoteData();
            myWiiRemoteConnection = new WiiRemoteConnection();

            wiimoteCon= myWiiRemoteConnection.connect();

            this.myWiiData.processData(myWiiRemoteConnection);
            this.TodaysStats = new Queue<Stats>();
            return true;
        }
        private void connection_test_button_Click(object sender, EventArgs e)
        {
            AlertGUI temp5 = new AlertGUI();
            temp5.setMessage("Attempting to connect to server....", "");
            temp5.Show();

            try
            {
                PDA_GUI.ServerConnection conn = new PDA_GUI.ServerConnection();
                conn.connect();

                temp5.Close();
                temp5.Dispose();

                conn.disconnect();
                AlertGUI temp3 = new AlertGUI();
                temp3.setMessage("Server Connected Successfully!", "");
                temp3.Show();

            }
            catch
            {
                AlertGUI temp2 = new AlertGUI();
                temp2.setMessage("Could not find server");

                //temp2.ShowDialog();
                temp2.Show();

                temp5.Close();
                temp5.Dispose();

            }
        }