mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Split the two command implementations into separate libraries (#2012)
This will allow us at the user code side to determine to include old commands, new commands or both.
This commit is contained in:
committed by
Peter Johnson
parent
2ad15cae19
commit
509819d83f
@@ -12,7 +12,7 @@
|
||||
#include <networktables/NetworkTableInstance.h>
|
||||
#include <wpi/mutex.h>
|
||||
|
||||
#include "frc/commands/Scheduler.h"
|
||||
#include "frc/smartdashboard/Sendable.h"
|
||||
#include "frc/smartdashboard/SendableBuilderImpl.h"
|
||||
#include "frc/smartdashboard/SendableRegistry.h"
|
||||
|
||||
@@ -99,19 +99,15 @@ bool LiveWindow::IsEnabled() const {
|
||||
void LiveWindow::SetEnabled(bool enabled) {
|
||||
std::scoped_lock lock(m_impl->mutex);
|
||||
if (m_impl->liveWindowEnabled == enabled) return;
|
||||
Scheduler* scheduler = Scheduler::GetInstance();
|
||||
m_impl->startLiveWindow = enabled;
|
||||
m_impl->liveWindowEnabled = enabled;
|
||||
// Force table generation now to make sure everything is defined
|
||||
UpdateValuesUnsafe();
|
||||
if (enabled) {
|
||||
scheduler->SetEnabled(false);
|
||||
scheduler->RemoveAll();
|
||||
} else {
|
||||
m_impl->registry.ForeachLiveWindow(m_impl->dataHandle, [&](auto& cbdata) {
|
||||
cbdata.builder.StopLiveWindowMode();
|
||||
});
|
||||
scheduler->SetEnabled(true);
|
||||
}
|
||||
m_impl->enabledEntry.SetBoolean(enabled);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user