mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpilib] Remove LiveWindow (#7733)
This will be replaced by a different mechanism, but removing it eases the initial implementation burden of a new Telemetry/Sendable framework.
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
#include <frc/RobotBase.h>
|
||||
#include <frc/RobotState.h>
|
||||
#include <frc/TimedRobot.h>
|
||||
#include <frc/livewindow/LiveWindow.h>
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
#include <hal/HALBase.h>
|
||||
#include <networktables/IntegerArrayTopic.h>
|
||||
@@ -72,19 +71,11 @@ CommandScheduler::CommandScheduler()
|
||||
}) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_Command,
|
||||
HALUsageReporting::kCommand2_Scheduler);
|
||||
wpi::SendableRegistry::AddLW(this, "Scheduler");
|
||||
frc::LiveWindow::SetEnabledCallback([this] {
|
||||
this->Disable();
|
||||
this->CancelAll();
|
||||
});
|
||||
frc::LiveWindow::SetDisabledCallback([this] { this->Enable(); });
|
||||
wpi::SendableRegistry::Add(this, "Scheduler");
|
||||
}
|
||||
|
||||
CommandScheduler::~CommandScheduler() {
|
||||
wpi::SendableRegistry::Remove(this);
|
||||
frc::LiveWindow::SetEnabledCallback(nullptr);
|
||||
frc::LiveWindow::SetDisabledCallback(nullptr);
|
||||
|
||||
std::unique_ptr<Impl>().swap(m_impl);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
using namespace frc2;
|
||||
|
||||
SubsystemBase::SubsystemBase() {
|
||||
wpi::SendableRegistry::AddLW(this, GetTypeName(*this));
|
||||
wpi::SendableRegistry::Add(this, GetTypeName(*this));
|
||||
CommandScheduler::GetInstance().RegisterSubsystem({this});
|
||||
}
|
||||
|
||||
SubsystemBase::SubsystemBase(std::string_view name) {
|
||||
wpi::SendableRegistry::AddLW(this, name);
|
||||
wpi::SendableRegistry::Add(this, name);
|
||||
CommandScheduler::GetInstance().RegisterSubsystem({this});
|
||||
}
|
||||
|
||||
@@ -71,5 +71,5 @@ void SubsystemBase::SetSubsystem(std::string_view name) {
|
||||
}
|
||||
|
||||
void SubsystemBase::AddChild(std::string name, wpi::Sendable* child) {
|
||||
wpi::SendableRegistry::AddLW(child, GetSubsystem(), name);
|
||||
wpi::SendableRegistry::Add(child, GetSubsystem(), name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user