CMake Changes

This is the changes made by Patrick Plenefisch converting the native
code to use CMake and the CMake Maven Plugin, as opposed to the
native Maven plugin. This is to allow for compatibility with newer
versions of the GCC toolchain. All the cpp sources were moved from
maven style directories to cpp style directories for CMake.

Change-Id: I67f5e3608948f37c83b0990d232105a3784f8593
This commit is contained in:
Brad Miller
2014-03-24 16:13:08 -04:00
parent 33134bef1d
commit 69d9ad70ab
804 changed files with 586 additions and 9377 deletions

View File

@@ -0,0 +1,67 @@
#ifndef _LIVE_WINDOW_H
#define _LIVE_WINDOW_H
#include "LiveWindow/LiveWindowSendable.h"
#include "tables/ITable.h"
#include "Commands/Scheduler.h"
#include <vector>
#include <map>
struct LiveWindowComponent
{
std::string subsystem;
std::string name;
bool isSensor;
LiveWindowComponent()
{}//WTF?
LiveWindowComponent(std::string subsystem, std::string name, bool isSensor)
{
this->subsystem = subsystem;
this->name = name;
this->isSensor = isSensor;
}
};
/**
* The LiveWindow class is the public interface for putting sensors and actuators
* on the LiveWindow.
*
* @author Brad Miller
*/
class LiveWindow {
public:
static LiveWindow * GetInstance();
void Run();
void AddSensor(const char *subsystem, const char *name, LiveWindowSendable *component);
void AddActuator(const char *subsystem, const char *name, LiveWindowSendable *component);
void AddSensor(std::string type, int module, int channel, LiveWindowSendable *component);
void AddActuator(std::string type, int module, int channel, LiveWindowSendable *component);
bool IsEnabled() { return m_enabled; }
void SetEnabled(bool enabled);
protected:
LiveWindow();
virtual ~LiveWindow();
private:
void UpdateValues();
void Initialize();
void InitializeLiveWindowComponents();
std::vector<LiveWindowSendable *> m_sensors;
std::map<LiveWindowSendable *, LiveWindowComponent> m_components;
static LiveWindow *m_instance;
ITable *m_liveWindowTable;
ITable *m_statusTable;
Scheduler *m_scheduler;
bool m_enabled;
bool m_firstTime;
};
#endif

View File

@@ -0,0 +1,40 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) Patrick Plenefisch 2012. 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 $(WIND_BASE)/WPILib. */
/*----------------------------------------------------------------------------*/
#ifndef LIVEWINDOWSENDABLE_H_
#define LIVEWINDOWSENDABLE_H_
#include "SmartDashboard/Sendable.h"
/**
* Live Window Sendable is a special type of object sendable to the live window.
*
* @author Patrick Plenefisch
*/
class 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;
};
#endif /* LIVEWINDOWSENDABLE_H_ */

View File

@@ -0,0 +1,12 @@
#ifndef _LIVE_WINDOW_STATUS_LISTENER_H
#define _LIVE_WINDOW_STATUS_LISTENER_H
#include "tables/ITable.h"
#include "tables/ITableListener.h"
class LiveWindowStatusListener : public ITableListener {
public:
virtual void ValueChanged(ITable* source, const std::string& key, EntryValue value, bool isNew);
};
#endif