Ejemplo n.º 1
0
        public void Reset()
        {
            stopWatch.Reset();
            accelerationFilter.Reset();

            isTargetReached = false;
            acceleration    = 0;
            speed           = 0;
            runCompleted    = false;

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

            RunResult runResult = new RunResult(ResultMode.ZeroToZero);

            runResult.Load();
            speedTarget    = runResult.GetSpeedTargetMax();
            speedTargetMin = speedTarget * 0.5f;

            status = Localization.runModeWaitGreater;
            if (Settings.IsSpeedUnitKph())
            {
                status += " " + Tools.ToKilometerPerHour(speedTarget) + " " + Settings.GetSpeedUnit();
            }
            else
            {
                status += " " + Tools.ToMilesPerHour(speedTarget) + " " + Settings.GetSpeedUnit();
            }
        }
Ejemplo n.º 2
0
        public void Reset()
        {
            status = Localization.runModeWait;

            stopWatch.Reset();
            accelerationFilter.Reset();

            timeSplit       = "0.00s";
            acceleration    = 0;
            speed           = 0;
            speedTargetLast = 0;

            RunResult runResult = new RunResult(ResultMode.Speed);

            runResult.Load();
            speedTargetMax = runResult.GetSpeedTargetMax();
            speedTargets   = runResult.GetSpeedTargets();

            accelerationProvider.SetDirection(true);
        }
Ejemplo n.º 3
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();
        }