예제 #1
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);
        }
예제 #2
0
        private void ShowTrainSessionButton_Click(object sender, EventArgs e)
        {
            dataGUI      dataGui = new dataGUI();
            TrainSession session = null;

            foreach (TrainSession s in AllSessions)
            {
                if (s.BeginTime == ShowComboBox.SelectedItem)
                {
                    session = s;
                }
            }
            if (session != null)
            {
                dataGui.SetTrainSession(session);
                RunDataGUI(dataGui);
            }
        }
        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);
        }
예제 #4
0
 public void SetTrainSession(TrainSession session)
 {
     this.session = session;
     SetChartData();
 }
 public void SetTrainSession(TrainSession session)
 {
     this.session = session;
     //System.Diagnostics.Debug.WriteLine(session.weight);
     SetChartData();
 }