WPILibC++  2020.3.2
LiveWindow.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2012-2020 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 <functional>
11 #include <memory>
12 
13 namespace frc {
14 
15 class Sendable;
16 
21 class LiveWindow {
22  public:
23  LiveWindow(const LiveWindow&) = delete;
24  LiveWindow& operator=(const LiveWindow&) = delete;
25 
26  std::function<void()> enabled;
27  std::function<void()> disabled;
28 
35  static LiveWindow* GetInstance();
36 
42  void EnableTelemetry(Sendable* component);
43 
49  void DisableTelemetry(Sendable* component);
50 
54  void DisableAllTelemetry();
55 
56  bool IsEnabled() const;
57 
63  void SetEnabled(bool enabled);
64 
71  void UpdateValues();
72 
73  private:
74  LiveWindow();
75 
76  struct Impl;
77  std::unique_ptr<Impl> m_impl;
78 
82  void UpdateValuesUnsafe();
83 };
84 
85 } // namespace frc
frc::LiveWindow::DisableTelemetry
void DisableTelemetry(Sendable *component)
Disable telemetry for a single component.
frc::LiveWindow::DisableAllTelemetry
void DisableAllTelemetry()
Disable ALL telemetry.
frc::LiveWindow::GetInstance
static LiveWindow * GetInstance()
Get an instance of the LiveWindow main class.
frc::LiveWindow
The LiveWindow class is the public interface for putting sensors and actuators on the LiveWindow.
Definition: LiveWindow.h:21
frc::LiveWindow::SetEnabled
void SetEnabled(bool enabled)
Change the enabled status of LiveWindow.
frc::Sendable
Interface for Sendable objects.
Definition: Sendable.h:17
frc::LiveWindow::UpdateValues
void UpdateValues()
Tell all the sensors to update (send) their values.
frc
A class that enforces constraints on the differential drive kinematics.
Definition: SPIAccelerometerSim.h:16
frc::LiveWindow::EnableTelemetry
void EnableTelemetry(Sendable *component)
Enable telemetry for a single component.