예제 #1
0
        public void Count()
        {
            while (ShouldCount)
            {
                long beginTime = DateTime.Now.Ticks;
                try
                {
                    CurrentTime.Timer();
                    TimeLabel.Invoke(new Action(() => TimeLabel.Text = CurrentTime.ToString()));

                    Distance += (Speed / 3600);
                    DistanceLabel.Invoke(new Action(() => DistanceLabel.Text = $"{Distance:f2}"));

                    RPM = Speed * 2.8;
                    RpmLabel.Invoke(new Action(() => RpmLabel.Text = RPM.ToString()));

                    Pulse = 90 + (int)((Power / 6) * (Speed / 10));
                    PulseLabel.Invoke(new Action(() => PulseLabel.Text = Pulse.ToString()));


                    SpeedTrackbar.Invoke(new Action(() => SpeedTrackbar.Value = (int)Speed));
                    SpeedLabel.Invoke(new Action(() => SpeedLabel.Text        = Speed.ToString()));
                    PowerTrackbar.Invoke(new Action(() => PowerTrackbar.Value = (int)Power));
                    PowerLabel.Invoke(new Action(() => PowerLabel.Text        = Power.ToString()));
                }
                catch (Exception e)
                {
                }

                Wait1s(beginTime);
            }
        }
예제 #2
0
        public void Count()
        {
            while (ShouldCount)
            {
                try
                {
                    CurrentTime.Timer();
                    TimeLabel.Invoke(new Action(() => TimeLabel.Text = CurrentTime.ToString()));

                    Distance += (Speed / 3600);
                    DistanceLabel.Invoke(new Action(() => DistanceLabel.Text = $"{Distance:f2}"));

                    RPM = Speed * 2.8;
                    RpmLabel.Invoke(new Action(() => RpmLabel.Text = RPM.ToString()));

                    Pulse = 90 + (int)((Power / 6) * (Speed / 20));
                    PulseLabel.Invoke(new Action(() => PulseLabel.Text = Pulse.ToString()));


                    SpeedTrackbar.Invoke(new Action(() => SpeedTrackbar.Value = (int)Speed));
                    SpeedLabel.Invoke(new Action(() => SpeedLabel.Text        = Speed.ToString()));
                    PowerTrackbar.Invoke(new Action(() => PowerTrackbar.Value = (int)Power));
                    PowerLabel.Invoke(new Action(() => PowerLabel.Text        = Power.ToString()));
                }
                catch (Exception e)
                {
                }

                Thread.Sleep(1000);
            }
        }
예제 #3
0
 private void UpdateLabels(bool refresh = false)
 {
     if (_replayController.PlayListReplays.Count == 0)
     {
         return;
     }
     TimeBox.Text  = _replayController.CurrentTime.ToTimeString();
     timeBar.Value =
         (int)(Math.Min(_replayController.CurrentTime, _replayController.MaxTime) / _replayController.MaxTime * timeBar.Maximum);
     ShowCoordinates();
     SpeedLabel.Text = "Speed: " + _replayController.GetSpeed().ToString("F2");
     if (refresh)
     {
         TimeBox.Refresh();
         SpeedLabel.Refresh();
         CoordinateLabel.Refresh();
     }
 }