mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
Simplify Sendable interface (#1864)
This removes the name and subsystem from individual objects, and instead puts this data into a new singleton class, SendableRegistry. Much of LiveWindow has been refactored into SendableRegistry. In C++, a new CRTP helper class, SendableHelper, has been added to provide move and destruction functionality. Shims for GetName, SetName, GetSubsystem, and SetSubsystem have been added to Command and Subsystem (both old and new), and also to SendableHelper to prevent code breakage. This deprecates SendableBase in preparation for future removal.
This commit is contained in:
@@ -13,10 +13,13 @@
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include "frc/MotorSafety.h"
|
||||
#include "frc/smartdashboard/SendableBase.h"
|
||||
#include "frc/smartdashboard/Sendable.h"
|
||||
#include "frc/smartdashboard/SendableHelper.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
class SendableBuilder;
|
||||
|
||||
/**
|
||||
* Class implements the PWM generation in the FPGA.
|
||||
*
|
||||
@@ -34,7 +37,7 @@ namespace frc {
|
||||
* - 1 = minimum pulse width (currently .5ms)
|
||||
* - 0 = disabled (i.e. PWM output is held low)
|
||||
*/
|
||||
class PWM : public MotorSafety, public SendableBase {
|
||||
class PWM : public MotorSafety, public Sendable, public SendableHelper<PWM> {
|
||||
public:
|
||||
/**
|
||||
* Represents the amount to multiply the minimum servo-pulse pwm period by.
|
||||
|
||||
Reference in New Issue
Block a user