7 #ifndef __DASHBOARD_H__
8 #define __DASHBOARD_H__
10 #include "DashboardBase.h"
11 #include "NetworkCommunication/FRCComm.h"
23 explicit Dashboard(SEM_ID statusDataSemaphore);
26 enum Type {kI8, kI16, kI32, kU8, kU16, kU32, kFloat, kDouble, kBoolean, kString, kOther};
27 enum ComplexType {kArray, kCluster};
29 void AddI8(int8_t value);
30 void AddI16(int16_t value);
31 void AddI32(int32_t value);
32 void AddU8(uint8_t value);
33 void AddU16(uint16_t value);
34 void AddU32(uint32_t value);
39 void AddString(
char* value, int32_t length);
46 void Printf(
const char *writeFmt, ...);
49 void GetStatusBuffer(
char** userStatusData, int32_t* userStatusDataSize);
52 static const int32_t kMaxDashboardDataSize = USER_STATUS_DATA_SIZE -
sizeof(uint32_t) * 3 -
sizeof(uint8_t);
57 bool ValidateAdd(int32_t size);
58 void AddedElement(Type type);
61 char *m_userStatusData;
62 int32_t m_userStatusDataSize;
64 char *m_localPrintBuffer;
66 std::vector<Type> m_expectedArrayElementType;
67 std::vector<int32_t> m_arrayElementCount;
68 std::vector<int32_t*> m_arraySizePtr;
69 std::stack<ComplexType> m_complexTypeStack;
70 SEM_ID m_printSemaphore;
71 SEM_ID m_statusDataSemaphore;
virtual ~Dashboard()
Definition: Dashboard.cpp:43
void AddBoolean(bool value)
Definition: Dashboard.cpp:155
Definition: DashboardBase.h:13
void AddI16(int16_t value)
Definition: Dashboard.cpp:71
void AddU32(uint32_t value)
Definition: Dashboard.cpp:119
void GetStatusBuffer(char **userStatusData, int32_t *userStatusDataSize)
Definition: Dashboard.cpp:331
void AddCluster()
Definition: Dashboard.cpp:236
void AddArray()
Definition: Dashboard.cpp:196
void FinalizeArray()
Definition: Dashboard.cpp:211
void AddFloat(float value)
Definition: Dashboard.cpp:131
void AddDouble(double value)
Definition: Dashboard.cpp:143
void AddU16(uint16_t value)
Definition: Dashboard.cpp:107
void AddI8(int8_t value)
Definition: Dashboard.cpp:59
Dashboard(SEM_ID statusDataSemaphore)
Definition: Dashboard.cpp:21
void AddU8(uint8_t value)
Definition: Dashboard.cpp:95
Definition: Dashboard.h:20
void Printf(const char *writeFmt,...)
Definition: Dashboard.cpp:264
void AddI32(int32_t value)
Definition: Dashboard.cpp:83
void FinalizeCluster()
Definition: Dashboard.cpp:247
void AddString(char *value)
Definition: Dashboard.cpp:167
int32_t Finalize()
Definition: Dashboard.cpp:298