/// <summary> /// This method calls summary calculator to calculate advanced metrics and presents them in text area /// </summary> public void Calculate_Advanced() { SummaryCalculator sv = new SummaryCalculator(heart, speed, speed_mile, cadence, altitude, power, powerbalance, timee); string FTP = sv.CalculateFTP(); string Np = sv.CalculateNP(); string If = sv.CalculateIF(); string Tss = sv.CalculateTSS(); String pb = sv.CalculatePB(); List <String> adv = new List <string> { FTP, Np, If, Tss, pb }; foreach (String val in adv) { txt_advancedMetrics.Text = txt_advancedMetrics.Text + val + Environment.NewLine; txt_advanced_Metrics1.Text = txt_advanced_Metrics1.Text + val + Environment.NewLine; } }
/// <summary> /// Fills the Summary details into the table for compariion /// </summary> public void SummaryFiller() { SummaryCalculator sv = new SummaryCalculator(heart, speed, speed_mile, cadence, altitude, power, powerbalance, timee); string[] stotalDistanceKm = sv.TotalDistance().Split('='); String totalDistanceKm = stotalDistanceKm[1]; string[] stotalMile = sv.TotalDistanceMile().Split('='); String totalMile = stotalMile[1]; string[] savgSpeed = sv.AverageSpeed().Split('='); String avgSpeed = savgSpeed[1]; string[] smaxSpeed = sv.MaxSpeed().Split('='); string maxSpeed = smaxSpeed[1]; string[] savgSpeedMile = sv.AverageSpeedMile().Split('='); string avgSpeedMile = savgSpeedMile[1]; string[] smaxSpeedMile = sv.MaxSpeedMile().Split('='); string maxSpeedMile = smaxSpeedMile[1]; string[] savgHeartRate = sv.AverageHeartRate().Split('='); string avgHeartRate = savgHeartRate[1]; string[] sminHeartRate = sv.MinHeartRate().Split('='); string minHeartRate = sminHeartRate[1]; string[] smaxHeartRate = sv.MaxHeartRate().Split('='); string maxHeartRate = smaxHeartRate[1]; string[] savgPower = sv.AveragePower().Split('='); string avgPower = savgPower[1]; string[] savgAlt = sv.AverageAltitude().Split('='); string avgAlt = savgAlt[1]; string[] smaxPower = sv.maxPower().Split('='); string maxPower = smaxPower[1]; string ftp = sv.CalculateFTP(); string[] norm1 = sv.CalculateNP().Split('='); string Np1 = norm1[1]; string[] sIF1 = sv.CalculateIF().Split('='); string IF1 = sIF1[1]; string[] sTss1 = sv.CalculateTSS().Split('='); string Tss1 = sTss1[1]; dataGridView3.Rows.Add(totalDistanceKm, avgSpeed, maxSpeed, avgHeartRate, maxHeartRate, minHeartRate, avgPower, maxPower, avgAlt, IF1, Tss1, Np1); SummaryCalculator sv1 = new SummaryCalculator(heart11, speed11, speed_mile11, cadence11, altitude11, power11, powerbalance11, timee1); string[] stotalDistanceKm1 = sv1.TotalDistance().Split('='); String totalDistanceKm1 = stotalDistanceKm[1]; string[] stotalMile1 = sv1.TotalDistanceMile().Split('='); String totalMile1 = stotalMile1[1]; string[] savgSpeed1 = sv1.AverageSpeed().Split('='); String avgSpeed1 = savgSpeed1[1]; string[] smaxSpeed1 = sv1.MaxSpeed().Split('='); string maxSpeed1 = smaxSpeed1[1]; string[] savgSpeedMile1 = sv1.AverageSpeedMile().Split('='); string avgSpeedMile1 = savgSpeedMile1[1]; string[] smaxSpeedMile1 = sv1.MaxSpeedMile().Split('='); string maxSpeedMile1 = smaxSpeedMile1[1]; string[] savgHeartRate1 = sv1.AverageHeartRate().Split('='); string avgHeartRate1 = savgHeartRate1[1]; string[] sminHeartRate1 = sv1.MinHeartRate().Split('='); string minHeartRate1 = sminHeartRate1[1]; string[] smaxHeartRate1 = sv1.MaxHeartRate().Split('='); string maxHeartRate1 = smaxHeartRate1[1]; string[] savgPower1 = sv1.AveragePower().Split('='); string avgPower1 = savgPower1[1]; string[] savgAlt1 = sv1.AverageAltitude().Split('='); string avgAlt1 = savgAlt1[1]; string[] smaxPower1 = sv1.maxPower().Split('='); string maxPower1 = smaxPower1[1]; string ftp1 = sv1.CalculateFTP(); string[] norm = sv1.CalculateNP().Split('='); Console.WriteLine(sv1.CalculateTSS()); string Np = norm[1]; string[] sIF = sv1.CalculateIF().Split('='); string IF = sIF[1]; string[] sTss = sv1.CalculateTSS().Split('='); string Tss = sTss[1]; dataGridView4.Rows.Add(totalDistanceKm1, avgSpeed1, maxSpeed1, avgHeartRate1, maxHeartRate1, minHeartRate1, avgPower1, maxPower1, avgAlt1, IF, Tss, Np); }