Now you can download a copy of these docs so you can use them offline! Download now

Dashboard Class Reference

#include <Dashboard.h>

Inheritance diagram for Dashboard:
Collaboration diagram for Dashboard:

List of all members.

Public Types

enum  Type {
  kI8, kI16, kI32, kU8,
  kU16, kU32, kFloat, kDouble,
  kBoolean, kString, kOther
}
enum  ComplexType { kArray, kCluster }

Public Member Functions

 Dashboard (SEM_ID statusDataSemaphore)
virtual ~Dashboard ()
void AddI8 (INT8 value)
void AddI16 (INT16 value)
void AddI32 (INT32 value)
void AddU8 (UINT8 value)
void AddU16 (UINT16 value)
void AddU32 (UINT32 value)
void AddFloat (float value)
void AddDouble (double value)
void AddBoolean (bool value)
void AddString (char *value)
void AddString (char *value, INT32 length)
void AddArray ()
void FinalizeArray ()
void AddCluster ()
void FinalizeCluster ()
void Printf (const char *writeFmt,...)
INT32 Finalize ()
void GetStatusBuffer (char **userStatusData, INT32 *userStatusDataSize)
void Flush ()

Detailed Description

Pack data into the "user data" field that gets sent to the dashboard laptop via the driver station.

Definition at line 20 of file Dashboard.h.


Constructor & Destructor Documentation

Dashboard::Dashboard ( SEM_ID  statusDataSem  )  [explicit]

Dashboard contructor.

This is only called once when the DriverStation constructor is called.

Definition at line 20 of file Dashboard.cpp.

Dashboard::~Dashboard (  )  [virtual]

Dashboard destructor.

Called only when the DriverStation class is destroyed.

Definition at line 42 of file Dashboard.cpp.


Member Function Documentation

void Dashboard::AddArray (  ) 

Start an array in the packed dashboard data structure.

After calling AddArray(), call the appropriate Add method for each element of the array. Make sure you call the same add each time. An array must contain elements of the same type. You can use clusters inside of arrays to make each element of the array contain a structure of values. You can also nest arrays inside of other arrays. Every call to AddArray() must have a matching call to FinalizeArray().

Definition at line 195 of file Dashboard.cpp.

void Dashboard::AddBoolean ( bool  value  ) 

Pack a boolean into the dashboard data structure.

Parameters:
value Data to be packed into the structure.

Definition at line 154 of file Dashboard.cpp.

void Dashboard::AddCluster (  ) 

Start a cluster in the packed dashboard data structure.

After calling AddCluster(), call the appropriate Add method for each element of the cluster. You can use clusters inside of arrays to make each element of the array contain a structure of values. Every call to AddCluster() must have a matching call to FinalizeCluster().

Definition at line 235 of file Dashboard.cpp.

void Dashboard::AddDouble ( double  value  ) 

Pack a 64-bit floating point number into the dashboard data structure.

Parameters:
value Data to be packed into the structure.

Definition at line 142 of file Dashboard.cpp.

void Dashboard::AddFloat ( float  value  ) 

Pack a 32-bit floating point number into the dashboard data structure.

Parameters:
value Data to be packed into the structure.

Definition at line 130 of file Dashboard.cpp.

void Dashboard::AddI16 ( INT16  value  ) 

Pack a signed 16-bit int into the dashboard data structure.

Parameters:
value Data to be packed into the structure.

Definition at line 70 of file Dashboard.cpp.

void Dashboard::AddI32 ( INT32  value  ) 

Pack a signed 32-bit int into the dashboard data structure.

Parameters:
value Data to be packed into the structure.

Definition at line 82 of file Dashboard.cpp.

void Dashboard::AddI8 ( INT8  value  ) 

Pack a signed 8-bit int into the dashboard data structure.

Parameters:
value Data to be packed into the structure.

Definition at line 58 of file Dashboard.cpp.

void Dashboard::AddString ( char *  value  ) 

Pack a NULL-terminated string of 8-bit characters into the dashboard data structure.

Parameters:
value Data to be packed into the structure.

Definition at line 166 of file Dashboard.cpp.

void Dashboard::AddString ( char *  value,
INT32  length 
)

Pack a string of 8-bit characters of specified length into the dashboard data structure.

Parameters:
value Data to be packed into the structure.
length The number of bytes in the string to pack.

Definition at line 176 of file Dashboard.cpp.

void Dashboard::AddU16 ( UINT16  value  ) 

Pack an unsigned 16-bit int into the dashboard data structure.

Parameters:
value Data to be packed into the structure.

Definition at line 106 of file Dashboard.cpp.

void Dashboard::AddU32 ( UINT32  value  ) 

Pack an unsigned 32-bit int into the dashboard data structure.

Parameters:
value Data to be packed into the structure.

Definition at line 118 of file Dashboard.cpp.

void Dashboard::AddU8 ( UINT8  value  ) 

Pack an unsigned 8-bit int into the dashboard data structure.

Parameters:
value Data to be packed into the structure.

Definition at line 94 of file Dashboard.cpp.

INT32 Dashboard::Finalize (  ) 

Indicate that the packing is complete and commit the buffer to the DriverStation.

The packing of the dashboard packet is complete. If you are not using the packed dashboard data, you can call Finalize() to commit the Printf() buffer and the error string buffer. In effect, you are packing an empty structure. Prepares a packet to go to the dashboard...

Returns:
The total size of the data packed into the userData field of the status packet.

Definition at line 297 of file Dashboard.cpp.

void Dashboard::FinalizeArray (  ) 

Indicate the end of an array packed into the dashboard data structure.

After packing data into the array, call FinalizeArray(). Every call to AddArray() must have a matching call to FinalizeArray().

Definition at line 210 of file Dashboard.cpp.

void Dashboard::FinalizeCluster (  ) 

Indicate the end of a cluster packed into the dashboard data structure.

After packing data into the cluster, call FinalizeCluster(). Every call to AddCluster() must have a matching call to FinalizeCluster().

Definition at line 246 of file Dashboard.cpp.

void Dashboard::GetStatusBuffer ( char **  userStatusData,
INT32 *  userStatusDataSize 
) [virtual]

Called by the DriverStation class to retrieve buffers, sizes, etc. for writing to the NetworkCommunication task. This function is called while holding the m_statusDataSemaphore.

Implements DashboardBase.

Definition at line 323 of file Dashboard.cpp.

void Dashboard::Printf ( const char *  writeFmt,
  ... 
)

Print a string to the UserData text on the Dashboard.

This will add text to the buffer to send to the dashboard. You must call Finalize() periodically to actually send the buffer to the dashboard if you are not using the packed dashboard data.

Definition at line 263 of file Dashboard.cpp.


The documentation for this class was generated from the following files:

Generated on Thu Jan 12 2012 22:35:29 for WPILibC++ by doxygen 1.7.1