public void RunTrainSessionForm(DoctorApplication_Trainsessions session)
 {
     this.BeginInvoke(new MethodInvoker(delegate
     {
         session.Show();
     }));
 }
Beispiel #2
0
        //Handle historic data
        #region
        public void HandleHistoricData(dynamic jsonObject)
        {
            List <TrainSession> trainsessions = new List <TrainSession>();

            foreach (dynamic tSession in jsonObject.data)
            {
                int          age          = (int)tSession.age;
                string       sex          = (string)tSession.sex;
                double       vo2Max       = (double)tSession.vo2Max;
                double       avgPulse     = (double)tSession.avgPulse;
                double       weight       = (double)tSession.weight;
                TrainSession trainsession = new TrainSession();
                trainsession.age      = age;
                trainsession.sex      = sex;
                trainsession.vo2Max   = vo2Max;
                trainsession.avgPulse = avgPulse;
                trainsession.weight   = weight;
                foreach (dynamic EData in tSession.data)
                {
                    trainsession.AddData(new ErgometerData((int)EData.Pulse, (int)EData.RPM, (double)EData.Speed, (double)EData.Distance, (int)EData.Time, (int)EData.Energy, (int)EData.Actual_Power, (int)EData.Requested_Power));
                }
                trainsessions.Add(trainsession);
            }
            DoctorApplication_Trainsessions TrainsessionsForm = new DoctorApplication_Trainsessions();

            TrainsessionsForm.SetAllSessions(trainsessions);
            doctorApplication_Session.RunTrainSessionForm(TrainsessionsForm);
        }
        public void HandleHistoricData(dynamic jsonObject)
        {
            List <TrainSession> trainsessions = new List <TrainSession>();

            foreach (dynamic tSession in jsonObject.data)
            {
                TrainSession trainsession = new TrainSession();
                trainsession.BeginTime = (string)tSession.BeginTime;
                trainsession.EndTime   = (string)tSession.EndTime;
                System.Diagnostics.Debug.WriteLine((string)tSession.BeginTime + "   " + (string)tSession.EndTime);
                foreach (dynamic EData in tSession.data)
                {
                    trainsession.AddData(new ErgometerData((int)EData.Pulse, (int)EData.RPM, (double)EData.Speed, (double)EData.Distance, (int)EData.Time, (int)EData.Energy, (int)EData.Actual_Power, (int)EData.Requested_Power));
                }
                trainsessions.Add(trainsession);
            }
            DoctorApplication_Trainsessions TrainsessionsForm = new DoctorApplication_Trainsessions();

            TrainsessionsForm.SetAllSessions(trainsessions);
            doctorApplication_Session.RunTrainSessionForm(TrainsessionsForm);
        }