WPILibC++  2020.3.2-60-g3011ebe
ComplexWidget.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2018 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include <memory>
11 
12 #include <networktables/NetworkTable.h>
13 #include <wpi/Twine.h>
14 
15 #include "frc/shuffleboard/ShuffleboardWidget.h"
16 #include "frc/smartdashboard/SendableBuilder.h"
17 #include "frc/smartdashboard/SendableBuilderImpl.h"
18 
19 namespace frc {
20 
21 class Sendable;
22 class ShuffleboardContainer;
23 
28 class ComplexWidget final : public ShuffleboardWidget<ComplexWidget> {
29  public:
30  ComplexWidget(ShuffleboardContainer& parent, const wpi::Twine& title,
31  Sendable& sendable);
32 
33  void EnableIfActuator() override;
34 
35  void DisableIfActuator() override;
36 
37  void BuildInto(std::shared_ptr<nt::NetworkTable> parentTable,
38  std::shared_ptr<nt::NetworkTable> metaTable) override;
39 
40  private:
41  Sendable& m_sendable;
42  SendableBuilderImpl m_builder;
43  bool m_builderInit = false;
44 };
45 
46 } // namespace frc
frc::SendableBuilderImpl
Definition: SendableBuilderImpl.h:27
frc::ComplexWidget
A Shuffleboard widget that handles a Sendable object such as a speed controller or sensor.
Definition: ComplexWidget.h:28
frc::ComplexWidget::DisableIfActuator
void DisableIfActuator() override
Disables user control of this widget in the Shuffleboard application.
frc::ComplexWidget::BuildInto
void BuildInto(std::shared_ptr< nt::NetworkTable > parentTable, std::shared_ptr< nt::NetworkTable > metaTable) override
Builds the entries for this value.
frc::ShuffleboardContainer
Common interface for objects that can contain shuffleboard components.
Definition: ShuffleboardContainer.h:44
frc::ComplexWidget::EnableIfActuator
void EnableIfActuator() override
Enables user control of this widget in the Shuffleboard application.
frc::Sendable
Interface for Sendable objects.
Definition: Sendable.h:17
frc
A class that enforces constraints on the differential drive kinematics.
Definition: PDPSim.h:16
frc::ShuffleboardWidget
Abstract superclass for widgets.
Definition: ShuffleboardWidget.h:32
wpi::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:85