blob: fe6c6fab55df760b278d630618aa365c1b477238 [file] [log] [blame]
jerrymf1579332013-02-07 01:56:28 +00001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2011. 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 $(WIND_BASE)/WPILib. */
5/*----------------------------------------------------------------------------*/
6
7#ifndef __SMART_DASHBOARD_H__
8#define __SMART_DASHBOARD_H__
9
10#include "SensorBase.h"
11#include <map>
12#include <string>
13#include "SmartDashboard/Sendable.h"
14#include "SmartDashboard/NamedSendable.h"
15#include "tables/ITable.h"
16
17
18class SmartDashboard : public SensorBase
19{
20public:
21 static void init();
22
23 static void PutData(std::string key, Sendable *data);
24 static void PutData(NamedSendable *value);
25 //static Sendable* GetData(std::string keyName);
26
27 static void PutBoolean(std::string keyName, bool value);
28 static bool GetBoolean(std::string keyName);
29
30 static void PutNumber(std::string keyName, double value);
31 static double GetNumber(std::string keyName);
32
33 static void PutString(std::string keyName, std::string value);
34 static int GetString(std::string keyName, char *value, unsigned int valueLen);
35 static std::string GetString(std::string keyName);
36
37 static void PutValue(std::string keyName, ComplexData& value);
38 static void RetrieveValue(std::string keyName, ComplexData& value);
39private:
40 SmartDashboard();
41 virtual ~SmartDashboard();
42 DISALLOW_COPY_AND_ASSIGN(SmartDashboard);
43
44 /** The {@link NetworkTable} used by {@link SmartDashboard} */
45 static ITable* m_table;
46
47 /**
48 * A map linking tables in the SmartDashboard to the {@link SmartDashboardData} objects
49 * they came from.
50 */
51 static std::map<ITable *, Sendable *> m_tablesToData;
52};
53
54#endif
55