예제 #1
0
        public void ConnectionStuff()
        {
            try
            {
                Laptop_GUI.ServerConnection conn = new Laptop_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
            {
                AlertGUI temp2 = new AlertGUI();
                temp2.setMessage("Connection to server lost: Setting default task");
                Cursor.Current = Cursors.WaitCursor;

                temp2.ShowDialog();
                Cursor.Current = Cursors.Arrow;
                todaysTask = new WalkingTask(500);
            }

            current_task = todaysTask.display();

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

            myWiiRemoteConnection.connect();

            this.myWiiData.processData(myWiiRemoteConnection);
            this.TodaysStats = new Queue<Stats>();
        }
예제 #2
0
        public void ConnectionStuff()
        {
            try
            {
                Laptop_GUI.ServerConnection conn = new Laptop_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
            {
                AlertGUI temp2 = new AlertGUI();
                temp2.setMessage("Connection to server lost: Setting default task");
                Cursor.Current = Cursors.WaitCursor;

                temp2.ShowDialog();
                Cursor.Current = Cursors.Arrow;
                todaysTask     = new WalkingTask(500);
            }

            current_task = todaysTask.display();

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

            myWiiRemoteConnection.connect();

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