Esempio n. 1
0
        public Server_Connection.DailyTask [] getTasks()
        {
            string configFilePath           = "C:\\ActivityMonitor\\ActivityMonitor.cfg";
            string activityMonitorDirectory = "C:\\ActivityMonitor";

            Server_Connection.User me = new Server_Connection.User();

            StreamReader readConfigFile = new StreamReader(configFilePath);

            string lastKnownTasks = killBrackets(readConfigFile.ReadLine());
            string patientName    = killBrackets(readConfigFile.ReadLine());

            string hostname  = killBrackets(readConfigFile.ReadLine());
            string username  = killBrackets(readConfigFile.ReadLine());
            string password  = killBrackets(readConfigFile.ReadLine());
            string startTime = killBrackets(readConfigFile.ReadLine());
            string endTime   = killBrackets(readConfigFile.ReadLine());
            string date      = killBrackets(readConfigFile.ReadLine());

            me.Username = username;
            me.Password = password;
            // me.Username = "******";
            //me.Password = "******";
            return(server_conn.GetTasks(me));
        }
Esempio n. 2
0
        public void sendStats()
        {
            Server_Connection.User me = new Server_Connection.User();
            // me.Username = "******";
            //me.Password = "******";



            string       configFilePath           = "C:\\ActivityMonitor\\ActivityMonitor.cfg";
            string       activityMonitorDirectory = "C:\\ActivityMonitor";
            StreamReader readConfigFile           = new StreamReader(configFilePath);

            string lastKnownTasks = killBrackets(readConfigFile.ReadLine());
            string patientName    = killBrackets(readConfigFile.ReadLine());

            string hostname  = killBrackets(readConfigFile.ReadLine());
            string username  = killBrackets(readConfigFile.ReadLine());
            string password  = killBrackets(readConfigFile.ReadLine());
            string startTime = killBrackets(readConfigFile.ReadLine());
            string endTime   = killBrackets(readConfigFile.ReadLine());
            string date      = killBrackets(readConfigFile.ReadLine());

            me.Username = username;
            me.Password = password;



            Queue <Stats> Todays = BadIdea.GetStats();

            //loop as long as there are still stats

            Todays.Enqueue(new WalkingStats(4000, (long)2, (long)3));

            while (Todays.Count > 0)
            {
                Server_Connection.WalkingStats mystats = new Server_Connection.WalkingStats();
                Stats Frog = Todays.Dequeue();

                mystats.idDailyTask  = BadIdea.DailyTaskID;
                mystats.idStatistics = 0;

                mystats.StartDateTime = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
                mystats.StartDateTime = mystats.StartDateTime.AddMilliseconds(Frog.start_time);

                mystats.EndDateTime = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
                mystats.EndDateTime = mystats.StartDateTime.AddMilliseconds(Frog.end_time);

                mystats.StatsClass = "WalkingStats";
                mystats.steps      = Frog.getStats();
                server_conn.UploadStats(me, mystats);
            }
        }
        public void sendStats()
        {
            Server_Connection.User me = new Server_Connection.User();
               // me.Username = "******";
            //me.Password = "******";

            string configFilePath = "C:\\ActivityMonitor\\ActivityMonitor.cfg";
            string activityMonitorDirectory = "C:\\ActivityMonitor";
            StreamReader readConfigFile = new StreamReader(configFilePath);

            string lastKnownTasks = killBrackets(readConfigFile.ReadLine());
            string patientName = killBrackets(readConfigFile.ReadLine());

            string hostname = killBrackets(readConfigFile.ReadLine());
            string username = killBrackets(readConfigFile.ReadLine());
            string password = killBrackets(readConfigFile.ReadLine());
            string startTime = killBrackets(readConfigFile.ReadLine());
            string endTime = killBrackets(readConfigFile.ReadLine());
            string date = killBrackets(readConfigFile.ReadLine());
            me.Username = username;
            me.Password = password;

            Queue<Stats> Todays = BadIdea.GetStats();
            //loop as long as there are still stats

            Todays.Enqueue(new WalkingStats(4000,(long)2, (long)3));

            while(Todays.Count>0)
            {

                Server_Connection.WalkingStats  mystats = new Server_Connection.WalkingStats();
                Stats Frog= Todays.Dequeue();

                mystats.idDailyTask = BadIdea.DailyTaskID;
                mystats.idStatistics=0;

                mystats.StartDateTime = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
                mystats.StartDateTime = mystats.StartDateTime.AddMilliseconds(Frog.start_time);

                mystats.EndDateTime = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
                mystats.EndDateTime = mystats.StartDateTime.AddMilliseconds(Frog.end_time);

                mystats.StatsClass="WalkingStats";
                mystats.steps=Frog.getStats();
                server_conn.UploadStats(me, mystats);
            }
        }
        public Server_Connection.DailyTask[] getTasks()
        {
            string configFilePath = "C:\\ActivityMonitor\\ActivityMonitor.cfg";
            string activityMonitorDirectory = "C:\\ActivityMonitor";

            Server_Connection.User me = new Server_Connection.User();

            StreamReader readConfigFile = new StreamReader(configFilePath);

            string lastKnownTasks = killBrackets(readConfigFile.ReadLine());
            string patientName = killBrackets(readConfigFile.ReadLine());

            string hostname = killBrackets(readConfigFile.ReadLine());
            string username = killBrackets(readConfigFile.ReadLine());
            string password = killBrackets(readConfigFile.ReadLine());
            string startTime = killBrackets(readConfigFile.ReadLine());
            string endTime = killBrackets(readConfigFile.ReadLine());
            string date = killBrackets(readConfigFile.ReadLine());
            me.Username = username;
            me.Password = password;
               // me.Username = "******";
            //me.Password = "******";
            return server_conn.GetTasks(me);
        }
 /// <remarks/>
 public void GetTasksAsync(User me, object userState) {
     if ((this.GetTasksOperationCompleted == null)) {
         this.GetTasksOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetTasksOperationCompleted);
     }
     this.InvokeAsync("GetTasks", new object[] {
                 me}, this.GetTasksOperationCompleted, userState);
 }
 /// <remarks/>
 public void GetTasksAsync(User me) {
     this.GetTasksAsync(me, null);
 }
 public DailyTask[] GetTasks(User me) {
     object[] results = this.Invoke("GetTasks", new object[] {
                 me});
     return ((DailyTask[])(results[0]));
 }
 /// <remarks/>
 public void UploadStatsAsync(User me, Stats stats, object userState) {
     if ((this.UploadStatsOperationCompleted == null)) {
         this.UploadStatsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUploadStatsOperationCompleted);
     }
     this.InvokeAsync("UploadStats", new object[] {
                 me,
                 stats}, this.UploadStatsOperationCompleted, userState);
 }
 /// <remarks/>
 public void UploadStatsAsync(User me, Stats stats) {
     this.UploadStatsAsync(me, stats, null);
 }
 public void UploadStats(User me, Stats stats) {
     this.Invoke("UploadStats", new object[] {
                 me,
                 stats});
 }