public class Telemetry
extends RobocolParsableBase
| Modifier and Type | Field and Description |
|---|---|
static int |
cbKeyMax |
static int |
cbTagMax |
static int |
cbValueMax |
static int |
cCountMax |
static java.lang.String |
DEFAULT_TAG |
| Constructor and Description |
|---|
Telemetry() |
Telemetry(byte[] byteArray) |
| Modifier and Type | Method and Description |
|---|---|
void |
addData(java.lang.String key,
double msg)
Add a data point
|
void |
addData(java.lang.String key,
float msg)
Add a data point
|
void |
addData(java.lang.String key,
java.lang.Object msg)
Add a data point
|
void |
addData(java.lang.String key,
java.lang.String msg)
Add a data point
|
void |
clearData()
Clear all messages
|
void |
fromByteArray(byte[] byteArray) |
java.util.Map<java.lang.String,java.lang.Float> |
getDataNumbers() |
java.util.Map<java.lang.String,java.lang.String> |
getDataStrings()
Get a reference to the map of messages
|
MsgType |
getRobocolMsgType() |
java.lang.String |
getTag()
Get the optional tag value
|
long |
getTimestamp()
Timestamp this message was sent.
|
boolean |
hasData()
Return true if this telemetry object has data added to it
|
boolean |
isSorted()
Returns whether this telemetry should be sorted by keys on the driver station or not.
|
void |
setSorted(boolean isSorted)
Sets whether the telemetry should be sorted by its keys on the driver station or not.
|
void |
setTag(java.lang.String tag)
Set the optional tag value.
|
byte[] |
toByteArray() |
public static final java.lang.String DEFAULT_TAG
public static final int cbTagMax
public static final int cCountMax
public static final int cbKeyMax
public static final int cbValueMax
public Telemetry()
public Telemetry(byte[] byteArray)
throws RobotCoreException
RobotCoreExceptionpublic long getTimestamp()
public boolean isSorted()
setSorted(boolean)public void setSorted(boolean isSorted)
isSorted - whether the telemetry is to be sorted on the driver stationisSorted()public void setTag(java.lang.String tag)
Setting this to an empty string is equal to setting this to the default value.
tag - tag this telemetry dataDEFAULT_TAGpublic java.lang.String getTag()
public void addData(java.lang.String key,
java.lang.String msg)
All messages will be assumed to be in UTF-8.
key - message keymsg - messagepublic void addData(java.lang.String key,
java.lang.Object msg)
Calls toString() on the given object.
key - message keymsg - message objectpublic void addData(java.lang.String key,
float msg)
Msg will be down cast to a float.
key - message keymsg - messagepublic void addData(java.lang.String key,
double msg)
msg will automatically be downcast to a float.
key - message keymsg - messagepublic java.util.Map<java.lang.String,java.lang.String> getDataStrings()
public java.util.Map<java.lang.String,java.lang.Float> getDataNumbers()
public boolean hasData()
public void clearData()
Clear all messages, reset the timestamp to 0
public MsgType getRobocolMsgType()
public byte[] toByteArray()
throws RobotCoreException
RobotCoreExceptionpublic void fromByteArray(byte[] byteArray)
throws RobotCoreException
RobotCoreException