Пример #1
0
        public void Reset()
        {
            stopWatch.Reset();
            accelerationFilter.Reset();

            isTargetMaxReached = false;
            acceleration       = 0;
            speed        = 0;
            runCompleted = false;

            RunResult runResult = new RunResult(ResultMode.Brake);

            runResult.Load();
            speedTargetMax = runResult.GetSpeedTargetMax();
            speedTargets   = runResult.GetSpeedTargets();
            speedTargetMin = speedTargets[0] * 0.5f; // index 0 is lowest target

            accelerationProvider.SetDirection(true); // apply speed-up mode at sensor

            string targets = "";

            foreach (float f in speedTargets)
            {
                if (Settings.IsSpeedUnitKph())
                {
                    targets += Tools.ToKilometerPerHour(f);
                }
                else
                {
                    targets += Tools.ToMilesPerHour(f);
                }
                targets += "/";
            }

            targets = Tools.ReplaceLastOccurrence(targets, "/", "");
            status  = Localization.runModeWaitGreater + " " + targets + " " + Settings.GetSpeedUnit();
        }