Files
allwpilib/wpilibc/src/main/native/cpp/simulation/SimHooks.cpp
Tyler Veness 181723e573 Replace .to<double>() and .template to<double>() with .value() (#3667)
It's a less verbose way to do the same thing.
2021-10-25 08:58:12 -07:00

52 lines
1.0 KiB
C++

// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include "frc/simulation/SimHooks.h"
#include <hal/simulation/MockHooks.h>
namespace frc::sim {
void SetRuntimeType(HAL_RuntimeType type) {
HALSIM_SetRuntimeType(type);
}
void WaitForProgramStart() {
HALSIM_WaitForProgramStart();
}
void SetProgramStarted() {
HALSIM_SetProgramStarted();
}
bool GetProgramStarted() {
return HALSIM_GetProgramStarted();
}
void RestartTiming() {
HALSIM_RestartTiming();
}
void PauseTiming() {
HALSIM_PauseTiming();
}
void ResumeTiming() {
HALSIM_ResumeTiming();
}
bool IsTimingPaused() {
return HALSIM_IsTimingPaused();
}
void StepTiming(units::second_t delta) {
HALSIM_StepTiming(static_cast<uint64_t>(delta.value() * 1e6));
}
void StepTimingAsync(units::second_t delta) {
HALSIM_StepTimingAsync(static_cast<uint64_t>(delta.value() * 1e6));
}
} // namespace frc::sim