WPILibC++  2019.1.1-beta-4-15-g8ac4b11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
SimpleWidget.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 <networktables/NetworkTableEntry.h>
14 #include <wpi/Twine.h>
15 
16 #include "frc/shuffleboard/ShuffleboardWidget.h"
17 
18 namespace frc {
19 
20 class ShuffleboardContainer;
21 
26 class SimpleWidget final : public ShuffleboardWidget<SimpleWidget> {
27  public:
28  SimpleWidget(ShuffleboardContainer& parent, const wpi::Twine& title);
29 
34 
35  void BuildInto(std::shared_ptr<nt::NetworkTable> parentTable,
36  std::shared_ptr<nt::NetworkTable> metaTable) override;
37 
38  private:
39  nt::NetworkTableEntry m_entry;
40 
41  void ForceGenerate();
42 };
43 
44 } // namespace frc
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
nt::NetworkTableEntry GetEntry()
Gets the NetworkTable entry that contains the data for this widget.
A Shuffleboard widget that handles a single data point such as a number or string.
Definition: SimpleWidget.h:26
NetworkTables Entry.
Definition: NetworkTableEntry.h:38
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:79
Common interface for objects that can contain shuffleboard components.
Definition: ShuffleboardContainer.h:34
void BuildInto(std::shared_ptr< nt::NetworkTable > parentTable, std::shared_ptr< nt::NetworkTable > metaTable) override
Builds the entries for this value.
Abstract superclass for widgets.
Definition: ShuffleboardWidget.h:26