mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +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,48 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2012-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. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <support/deprecated.h>
|
||||
|
||||
#include "SmartDashboard/Sendable.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
/**
|
||||
* Live Window Sendable is a special type of object sendable to the live window.
|
||||
* @deprecated Use Sendable directly instead
|
||||
*/
|
||||
class WPI_DEPRECATED("use Sendable directly instead") LiveWindowSendable
|
||||
: public Sendable {
|
||||
public:
|
||||
/**
|
||||
* Update the table for this sendable object with the latest values.
|
||||
*/
|
||||
virtual void UpdateTable() = 0;
|
||||
|
||||
/**
|
||||
* Start having this sendable object automatically respond to value changes
|
||||
* reflect the value on the table.
|
||||
*/
|
||||
virtual void StartLiveWindowMode() = 0;
|
||||
|
||||
/**
|
||||
* Stop having this sendable object automatically respond to value changes.
|
||||
*/
|
||||
virtual void StopLiveWindowMode() = 0;
|
||||
|
||||
std::string GetName() const override;
|
||||
void SetName(const llvm::Twine& name) override;
|
||||
std::string GetSubsystem() const override;
|
||||
void SetSubsystem(const llvm::Twine& subsystem) override;
|
||||
void InitSendable(SendableBuilder& builder) override;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
@@ -0,0 +1,32 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2012-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. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <support/deprecated.h>
|
||||
|
||||
#include "SmartDashboard/Sendable.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
/**
|
||||
* The interface for sendable objects that gives the sendable a default name in
|
||||
* the Smart Dashboard.
|
||||
* @deprecated Use Sendable directly instead
|
||||
*/
|
||||
class WPI_DEPRECATED("use Sendable directly instead") NamedSendable
|
||||
: public Sendable {
|
||||
public:
|
||||
void SetName(const llvm::Twine& name) override;
|
||||
std::string GetSubsystem() const override;
|
||||
void SetSubsystem(const llvm::Twine& subsystem) override;
|
||||
void InitSendable(SendableBuilder& builder) override;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
Reference in New Issue
Block a user