mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21: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:
@@ -18,7 +18,6 @@ import edu.wpi.first.wpilibj.RobotState;
|
||||
import edu.wpi.first.wpilibj.TimedRobot;
|
||||
import edu.wpi.first.wpilibj.Watchdog;
|
||||
import edu.wpi.first.wpilibj.event.EventLoop;
|
||||
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
|
||||
import edu.wpi.first.wpilibj2.command.Command.InterruptionBehavior;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
@@ -101,13 +100,7 @@ public final class CommandScheduler implements Sendable, AutoCloseable {
|
||||
|
||||
CommandScheduler() {
|
||||
HAL.report(tResourceType.kResourceType_Command, tInstances.kCommand2_Scheduler);
|
||||
SendableRegistry.addLW(this, "Scheduler");
|
||||
LiveWindow.setEnabledListener(
|
||||
() -> {
|
||||
disable();
|
||||
cancelAll();
|
||||
});
|
||||
LiveWindow.setDisabledListener(this::enable);
|
||||
SendableRegistry.add(this, "Scheduler");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -123,8 +116,6 @@ public final class CommandScheduler implements Sendable, AutoCloseable {
|
||||
@Override
|
||||
public void close() {
|
||||
SendableRegistry.remove(this);
|
||||
LiveWindow.setEnabledListener(null);
|
||||
LiveWindow.setDisabledListener(null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,7 +20,7 @@ public abstract class SubsystemBase implements Subsystem, Sendable {
|
||||
public SubsystemBase() {
|
||||
String name = this.getClass().getSimpleName();
|
||||
name = name.substring(name.lastIndexOf('.') + 1);
|
||||
SendableRegistry.addLW(this, name, name);
|
||||
SendableRegistry.add(this, name, name);
|
||||
CommandScheduler.getInstance().registerSubsystem(this);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public abstract class SubsystemBase implements Subsystem, Sendable {
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public SubsystemBase(String name) {
|
||||
SendableRegistry.addLW(this, name, name);
|
||||
SendableRegistry.add(this, name, name);
|
||||
CommandScheduler.getInstance().registerSubsystem(this);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public abstract class SubsystemBase implements Subsystem, Sendable {
|
||||
* @param child sendable
|
||||
*/
|
||||
public void addChild(String name, Sendable child) {
|
||||
SendableRegistry.addLW(child, getSubsystem(), name);
|
||||
SendableRegistry.add(child, getSubsystem(), name);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user