mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Add deprecated shims for LiveWindowSendable and NamedSendable. (#834)
This will help prevent old code from breaking (not all cases, but should help).
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2017 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. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.wpilibj;
|
||||
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
|
||||
|
||||
/**
|
||||
* The interface for sendable objects that gives the sendable a default name in the Smart
|
||||
* Dashboard.
|
||||
* @deprecated Use Sendable directly instead
|
||||
*/
|
||||
@Deprecated
|
||||
public interface NamedSendable extends Sendable {
|
||||
|
||||
/**
|
||||
* The name of the subtable.
|
||||
*
|
||||
* @return the name of the subtable of SmartDashboard that the Sendable object will use.
|
||||
*/
|
||||
String getName();
|
||||
|
||||
@Override
|
||||
default void setName(String name) {
|
||||
}
|
||||
|
||||
@Override
|
||||
default String getSubsystem() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
default void setSubsystem(String subsystem) {
|
||||
}
|
||||
|
||||
@Override
|
||||
default void initSendable(SendableBuilder builder) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2008-2017 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. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.wpilibj.livewindow;
|
||||
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
|
||||
import edu.wpi.first.wpilibj.Sendable;
|
||||
|
||||
/**
|
||||
* Live Window Sendable is a special type of object sendable to the live window.
|
||||
* @deprecated Use Sendable directly instead
|
||||
*/
|
||||
@Deprecated
|
||||
public interface LiveWindowSendable extends Sendable {
|
||||
/**
|
||||
* Update the table for this sendable object with the latest values.
|
||||
*/
|
||||
void updateTable();
|
||||
|
||||
/**
|
||||
* Start having this sendable object automatically respond to value changes reflect the value on
|
||||
* the table.
|
||||
*/
|
||||
void startLiveWindowMode();
|
||||
|
||||
/**
|
||||
* Stop having this sendable object automatically respond to value changes.
|
||||
*/
|
||||
void stopLiveWindowMode();
|
||||
|
||||
@Override
|
||||
default String getName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
default void setName(String name) {
|
||||
}
|
||||
|
||||
@Override
|
||||
default String getSubsystem() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
default void setSubsystem(String subsystem) {
|
||||
}
|
||||
|
||||
@Override
|
||||
default void initSendable(SendableBuilder builder) {
|
||||
builder.setUpdateTable(this::updateTable);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user