Esempio n. 1
0
        public void OnFreeTick_Timer(object sender, EventArgs e)
        {
            double TimeSecond = FTPTimer.ElapsedMilliseconds / 1000.0;

            if (TimeSecond < 20 * 60 && !giveupFlag)
            {
                labelFtpStatus.Text = "Measuring";
                labelTimer.Text     = TimeSecond.ToString();
                labelVoltage.Text   = CycleRoutine.ToRoundDown((double.Parse(Voltage) / 1000.0), 7).ToString();
                try
                {
                    FTPSum  += double.Parse(textBoxWatt.Text);
                    SumCount = SumCount + 1.0;
                }
                catch (Exception)
                {
                    return;
                }
                labelFTP.Text = CycleRoutine.ToRoundDown(((FTPSum / SumCount) * 0.95), 2).ToString();
            }
            else
            {
                labelFtpStatus.Text = "Confirmed";
            }
        }
Esempio n. 2
0
 public void ShowCycleData(CycleDatas cData)
 {
     if (cData.Cadence != null && cData.Speed != null && cData.Watt != null && cData.Timer != null)
     {
         textBoxCadence.Text = CycleRoutine.ToRoundDown(double.Parse(cData.Cadence), 1).ToString();
         textBoxWatt.Text    = CycleRoutine.ToRoundDown(double.Parse(cData.Watt) / 2.25, 1).ToString();
     }
 }
Esempio n. 3
0
        public void OnTabataTick_Timer(object sender, EventArgs e)
        {
            double TimeSecond = TabataTimer.ElapsedMilliseconds / 1000.0;

            if (IntervalCounter > 7)
            {
                IntervalCounter     = 0;
                labelFtpStatus.Text = "Completed";

                TabataTimer.Stop();
            }
            if (TimeSecond < 20 + IntervalCounter * 30 && !giveupFlag)
            {
                if (BeepFlag)
                {
                    System.Media.SystemSounds.Beep.Play();
                    BeepFlag = !BeepFlag;
                }
                labelFtpStatus.Text = "Full Power";
                labelTimer.Text     = TimeSecond.ToString();
                labelVoltage.Text   = CycleRoutine.ToRoundDown((double.Parse(Voltage) / 1000.0), 7).ToString();
                try
                {
                    FTPSum  += double.Parse(textBoxWatt.Text);
                    SumCount = SumCount + 1.0;
                }
                catch (Exception)
                {
                    return;
                }
                labelFTP.Text = CycleRoutine.ToRoundDown(((FTPSum / SumCount) * 0.95), 2).ToString();
            }
            else if (TimeSecond < 30 + IntervalCounter * 30 && !giveupFlag)
            {
                if (!BeepFlag)
                {
                    System.Media.SystemSounds.Beep.Play();
                    BeepFlag = !BeepFlag;
                }
                labelFtpStatus.Text = "Rest";
                labelTimer.Text     = TimeSecond.ToString();
                labelVoltage.Text   = CycleRoutine.ToRoundDown((double.Parse(Voltage) / 1000.0), 7).ToString();
                try
                {
                    FTPSum  += double.Parse(textBoxWatt.Text);
                    SumCount = SumCount + 1.0;
                }
                catch (Exception)
                {
                    return;
                }
                labelFTP.Text = CycleRoutine.ToRoundDown(((FTPSum / SumCount) * 0.95), 2).ToString();
            }
            else
            {
                IntervalCounter++;
            }
        }