Move CameraServer and WPILib headers into their own folder

The old headers were moved into folders because doing so avoids polluting
the system include directories.

Folder names were also normalized to lowercase.
This commit is contained in:
Tyler Veness
2018-07-20 00:03:45 -07:00
committed by Peter Johnson
parent 31ced30c1e
commit d89b7dd412
728 changed files with 1876 additions and 1851 deletions

View File

@@ -0,0 +1,213 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2012-2018 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 <memory>
#include <wpi/Twine.h>
#include <wpi/deprecated.h>
#include "frc/smartdashboard/Sendable.h"
namespace frc {
/**
* The LiveWindow class is the public interface for putting sensors and
* actuators on the LiveWindow.
*/
class LiveWindow {
public:
LiveWindow(const LiveWindow&) = delete;
LiveWindow& operator=(const LiveWindow&) = delete;
/**
* Get an instance of the LiveWindow main class.
*
* This is a singleton to guarantee that there is only a single instance
* regardless of how many times GetInstance is called.
*/
static LiveWindow* GetInstance();
WPI_DEPRECATED("no longer required")
void Run();
/**
* Add a Sensor associated with the subsystem and call it by the given name.
*
* @param subsystem The subsystem this component is part of.
* @param name The name of this component.
* @param component A Sendable component that represents a sensor.
*/
WPI_DEPRECATED("use Sendable::SetName() instead")
void AddSensor(const wpi::Twine& subsystem, const wpi::Twine& name,
Sendable* component);
/**
* Add a Sensor associated with the subsystem and call it by the given name.
*
* @param subsystem The subsystem this component is part of.
* @param name The name of this component.
* @param component A Sendable component that represents a sensor.
*/
WPI_DEPRECATED("use Sendable::SetName() instead")
void AddSensor(const wpi::Twine& subsystem, const wpi::Twine& name,
Sendable& component);
/**
* Add a Sensor associated with the subsystem and call it by the given name.
*
* @param subsystem The subsystem this component is part of.
* @param name The name of this component.
* @param component A Sendable component that represents a sensor.
*/
WPI_DEPRECATED("use Sendable::SetName() instead")
void AddSensor(const wpi::Twine& subsystem, const wpi::Twine& name,
std::shared_ptr<Sendable> component);
/**
* Add an Actuator associated with the subsystem and call it by the given
* name.
*
* @param subsystem The subsystem this component is part of.
* @param name The name of this component.
* @param component A Sendable component that represents a actuator.
*/
WPI_DEPRECATED("use Sendable::SetName() instead")
void AddActuator(const wpi::Twine& subsystem, const wpi::Twine& name,
Sendable* component);
/**
* Add an Actuator associated with the subsystem and call it by the given
* name.
*
* @param subsystem The subsystem this component is part of.
* @param name The name of this component.
* @param component A Sendable component that represents a actuator.
*/
WPI_DEPRECATED("use Sendable::SetName() instead")
void AddActuator(const wpi::Twine& subsystem, const wpi::Twine& name,
Sendable& component);
/**
* Add an Actuator associated with the subsystem and call it by the given
* name.
*
* @param subsystem The subsystem this component is part of.
* @param name The name of this component.
* @param component A Sendable component that represents a actuator.
*/
WPI_DEPRECATED("use Sendable::SetName() instead")
void AddActuator(const wpi::Twine& subsystem, const wpi::Twine& name,
std::shared_ptr<Sendable> component);
/**
* Meant for internal use in other WPILib classes.
*
* @deprecated Use SendableBase::SetName() instead.
*/
WPI_DEPRECATED("use SensorUtil::SetName() instead")
void AddSensor(const wpi::Twine& type, int channel, Sendable* component);
/**
* Meant for internal use in other WPILib classes.
*
* @deprecated Use SendableBase::SetName() instead.
*/
WPI_DEPRECATED("use SensorUtil::SetName() instead")
void AddActuator(const wpi::Twine& type, int channel, Sendable* component);
/**
* Meant for internal use in other WPILib classes.
*
* @deprecated Use SendableBase::SetName() instead.
*/
WPI_DEPRECATED("use SensorUtil::SetName() instead")
void AddActuator(const wpi::Twine& type, int module, int channel,
Sendable* component);
/**
* Add a component to the LiveWindow.
*
* @param sendable component to add
*/
void Add(std::shared_ptr<Sendable> component);
/**
* Add a component to the LiveWindow.
*
* @param sendable component to add
*/
void Add(Sendable* component);
/**
* Add a child component to a component.
*
* @param parent parent component
* @param child child component
*/
void AddChild(Sendable* parent, std::shared_ptr<Sendable> component);
/**
* Add a child component to a component.
*
* @param parent parent component
* @param child child component
*/
void AddChild(Sendable* parent, void* component);
/**
* Remove the component from the LiveWindow.
*
* @param sendable component to remove
*/
void Remove(Sendable* component);
/**
* Enable telemetry for a single component.
*
* @param sendable component
*/
void EnableTelemetry(Sendable* component);
/**
* Disable telemetry for a single component.
*
* @param sendable component
*/
void DisableTelemetry(Sendable* component);
/**
* Disable ALL telemetry.
*/
void DisableAllTelemetry();
bool IsEnabled() const;
/**
* Change the enabled status of LiveWindow.
*
* If it changes to enabled, start livewindow running otherwise stop it
*/
void SetEnabled(bool enabled);
/**
* Tell all the sensors to update (send) their values.
*
* Actuators are handled through callbacks on their value changing from the
* SmartDashboard widgets.
*/
void UpdateValues();
private:
LiveWindow();
struct Impl;
std::unique_ptr<Impl> m_impl;
};
} // namespace frc

View File

@@ -0,0 +1,48 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2012-2018 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 <wpi/deprecated.h>
#include "frc/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 wpi::Twine& name) override;
std::string GetSubsystem() const override;
void SetSubsystem(const wpi::Twine& subsystem) override;
void InitSendable(SendableBuilder& builder) override;
};
} // namespace frc