[sim] Move WPILib C++ sim implementations out of line (#2598)

This makes the sim classes consistent with the rest of the WPILibC classes.
This commit is contained in:
Peter Johnson
2020-07-15 23:48:09 -07:00
committed by GitHub
parent b9feb81226
commit c2cc90b27d
49 changed files with 3068 additions and 1621 deletions

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -19,8 +19,8 @@ CommandTestBase::CommandTestBase() {
CommandScheduler CommandTestBase::GetScheduler() { return CommandScheduler(); }
void CommandTestBase::SetUp() {
HALSIM_SetDriverStationEnabled(true);
while (!HALSIM_GetDriverStationEnabled()) {
frc::sim::DriverStationSim::SetEnabled(true);
while (!frc::sim::DriverStationSim::GetEnabled()) {
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
}
@@ -30,8 +30,8 @@ void CommandTestBase::TearDown() {
}
void CommandTestBase::SetDSEnabled(bool enabled) {
HALSIM_SetDriverStationEnabled(enabled);
while (HALSIM_GetDriverStationEnabled() != static_cast<int>(enabled)) {
frc::sim::DriverStationSim::SetEnabled(enabled);
while (frc::sim::DriverStationSim::GetEnabled() != enabled) {
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
}