示例#1
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);
            }
        }