mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user