Public Types | Public Member Functions | Private Attributes | Static Private Attributes
RobonetDataElement Class Reference

#include <RobonetDataElement.h>

Inheritance diagram for RobonetDataElement:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ElementStyle {
  Normal = 0, MotCom = 1, Temperature = 2, BrakePwm = 3,
  FixedPointMilli = 4, UnsignedFixedPointMilli = 5, FixedPointCenti = 6, UnsignedFixedPointCenti = 7,
  PowConTemperature = 8, PowConCurrentMany = 9, PowConVoltageMany = 10
}
typedef std::pair< std::string,
std::string > 
OffsetPair
 A std::pair of offsets stored as std::string's.
typedef std::pair< uint16_t,
uint16_t > 
RawPair
enum  TrimValues { MotComMax = 255, MotComMin = -255, TemperatureMin = 0, BrakePwmMax = 4096 }

Public Member Functions

std::string getChannel ()
 Get the channel that the value will be read from (or written to).
std::string getGroup ()
 Get the data group with which the value will be transferred.
std::string getNode ()
 Get the node that the value will be read from (or written to).
OffsetPair getOffsetPair ()
 Get the offset pair storing the offsets at which the value will be read from (or written to).
RawPair getRawPair ()
 Get the raw pair storing ...
ElementSize getRawSize ()
const RawPair pull ()
 Used by the DataClient to pull 16-bit raw values out, based on current DataElement::value .
void push (RawPair rawPair)
 Used by the DataClient to push new 16-bit raw values in, and modify the current DataElement::value .
 RobonetDataElement (const std::string &type, DataElement::ReadWrite readWrite, const std::string &channel, const std::string &node, OffsetPair offsetPair, const std::string &group, ElementStyle mangleOption=Normal, std::shared_ptr< SMT::Resource > resource=NULL)
 The specific constructor for the RobonetDataElement class.
void setChannel (const std::string &channel)
 Set the channel that the value will be read from (or written to).
void setGroup (const std::string &group)
 Set the data group with which the value will be transferred.
void setNode (const std::string &node)
 Set the node that the value will be read from (or written to).
void setOffsetPair (OffsetPair offsetPair)
 Set the offset pair storing the offsets at which the value will be read from (or written to).
template<typename T >
void setValue (const T v)
 Set the value held by the DataElement in the specified data type.
std::string toString ()
 Convert the RobonetDataElement into a string representation.
template<typename T >
uint16_t TrimBrakePwm (const T t)
template<typename T >
int16_t TrimMotCom (const T t)
template<typename T >
float TrimTemperature (const T t)
virtual ~RobonetDataElement ()
 The destructor for the RobonetDataElement class.

Private Attributes

BitWizard< uint16_t > bitWizard16
std::string channel
 The name of the channel that the value will be read from (or written to). For example: "LL".
std::string group
 The data group that this element will be transferred with. For example: "Command".
std::string node
 The name of the node that the value will be read from (or written to). For example: "J1".
OffsetPair offsetPair
 The offset pair storing the offsets at which the value will be read from (or written to). For example: RobonetDataElement::OffsetPair("APS1L","APS1H").
RawPair rawPair
ElementStyle style

Static Private Attributes

static const
BitMinion::BitIndexEnumType 
BRAKEPWM_CERTIFICATE_INDEX = BitMinion::BIT_FOURTEEN_INDEX
static const
BitMinion::BitCountMaskEnumType 
BRAKEPWM_CERTIFICATE_SIZE = BitMinion::TWO_BIT_MASK
static const uint16_t BRAKEPWM_CERTIFICATE_VALUE = 0x3
static const
BitMinion::BitIndexEnumType 
MOTCOM_CERTIFICATE_INDEX = BitMinion::BIT_NINE_INDEX
static const
BitMinion::BitCountMaskEnumType 
MOTCOM_CERTIFICATE_SIZE = BitMinion::THREE_BIT_MASK
static const uint16_t MOTCOM_CERTIFICATE_VALUE = 0x7
static const
BitMinion::BitIndexEnumType 
MOTCOM_SIGN_BIT_INDEX = BitMinion::BIT_EIGHT_INDEX

Detailed Description

Todo:
Figure out how to get doxygen to include all classes' private members

Definition at line 76 of file RobonetDataElement.h.


Member Typedef Documentation

typedef std::pair<std::string, std::string> RobonetDataElement::OffsetPair

A std::pair of offsets stored as std::string's.

Each offset represents a name of a memory offset token, like "APS1H".

See also:
TokenMap

Definition at line 84 of file RobonetDataElement.h.

typedef std::pair<uint16_t, uint16_t> RobonetDataElement::RawPair
Todo:
The RobonetDataElement::RawPair typedef needs a description

Definition at line 88 of file RobonetDataElement.h.


Member Enumeration Documentation

Enumerator:
Normal 
MotCom 
Temperature 
BrakePwm 
FixedPointMilli 
UnsignedFixedPointMilli 
FixedPointCenti 
UnsignedFixedPointCenti 
PowConTemperature 
PowConCurrentMany 
PowConVoltageMany 

Definition at line 90 of file RobonetDataElement.h.

Enumerator:
MotComMax 
MotComMin 
TemperatureMin 
BrakePwmMax 

Definition at line 111 of file RobonetDataElement.h.


Constructor & Destructor Documentation

RobonetDataElement::RobonetDataElement ( const std::string &  type,
DataElement::ReadWrite  readWrite,
const std::string &  channel,
const std::string &  node,
OffsetPair  offsetPair,
const std::string &  group,
ElementStyle  mangleOption = Normal,
std::shared_ptr< SMT::Resource >  resource = NULL 
)

The specific constructor for the RobonetDataElement class.

Parameters:
typeA string containing the data type of the value. For example: "uint32_t" or other types specified in DataElement::ValueType
readWriteWhether the DataElement should be read from (or written to) hardware. For example: DataElement::Read
channelA string containing the name of the channel that the value will be read from (or written to). For example: "LL".
nodeA string containing the name of the node that the value will be read from (or written to). For example: "J1".
offsetPairThe offset pair storing the offsets at which the value will be read from (or written to). For example: RobonetDataElement::OffsetPair("APS1L","APS1H").
groupA string containing the data group with which the value will be transferred. For example: "Command".
mangleOptionA value of type ElementStyle defining any special features of this element, like Normal, MotCom, Temperature, or BrakePwm
Exceptions:
std::invalid_argumentIf any of channel, node, offsetPair.first, or group are empty
std::invalid_argumentIf the RobonetDataElement size is DataElement::ThirtyTwoBit and offsetPair.second is empty

RobonetDataElement::rawPair is initialized to (0,0)

Note:
There is no default constructor for the RobonetDataElement class.

Definition at line 71 of file RobonetDataElement.cpp.

The destructor for the RobonetDataElement class.

Definition at line 183 of file RobonetDataElement.cpp.


Member Function Documentation

Get the channel that the value will be read from (or written to).

Returns:
string The channel that the value will be read from (or written to).

Definition at line 293 of file RobonetDataElement.cpp.

Get the data group with which the value will be transferred.

Returns:
std::string The data group with which the value will be transferred.

Definition at line 320 of file RobonetDataElement.cpp.

std::string RobonetDataElement::getNode ( )

Get the node that the value will be read from (or written to).

Returns:
string The node that the value will be read from (or written to).

Definition at line 302 of file RobonetDataElement.cpp.

Get the offset pair storing the offsets at which the value will be read from (or written to).

Returns:
RobonetDataElement::OffsetPair The offset pair storing the offsets at which the value will be read from (or written to).

Definition at line 311 of file RobonetDataElement.cpp.

Get the raw pair storing ...

Todo:
RobonetDataElement::getRawPair needs a description

Definition at line 328 of file RobonetDataElement.cpp.

Definition at line 187 of file RobonetDataElement.cpp.

Used by the DataClient to pull 16-bit raw values out, based on current DataElement::value .

Returns:
const RobonetDataElement::RawPair The pair of 16-bit raw values.

Uses the DataMangler class to separate the raw values.

MotCom is a 9-bit signed integer with a 3-bit certificate.

Get sign bit of user-supplied signed value.

Get absolute value of user-supplied signed value.

Make sure top eight bits are clear.

Set sign bit in MotCom value in ninth bit (bit eight).

Apply MotCom certificate.

Temperature is a 16-bit unsigned integer, representing the number of half-degrees Celcius

BrakePWM is an unsigned integer with a max value of 4096 with a 2-bit certificate.

Apply BrakePWM certificate.

FixedPointMilli is a 16-bit fixed point number where the decimal place is assumed third from the right (123456.789)

UnsignedFixedPointMilli is an unsigned 16-bit fixed point number where the decimal place is assumed third from the right (123456.789)

FixedPointCenti is a 16-bit fixed point number where the decimal place is assumed second from the right (1234567.89)

UnsignedFixedPointCenti is an unsigned 16-bit fixed point number where the decimal place is assumed second from the right (1234567.89)

PowConTemperature is a 16-bit float, representing temperature in degrees Celcius

Make sure top four bits are clear.

PowConCurrentMany is a 16-bit float, representing current in amps

Make sure top four bits are clear.

PowConVoltageMany is a 16-bit float, representing voltage in volts

Make sure top four bits are clear.

Definition at line 374 of file RobonetDataElement.cpp.

void RobonetDataElement::push ( RawPair  rawPair)

Used by the DataClient to push new 16-bit raw values in, and modify the current DataElement::value .

Parameters:
rawPairThe pair of 16-bit raw values.
Exceptions:
PushToWriteElementExceptionIf user tries to push() raw values into a 'Writable' RobonetDataElement.

Uses the DataMangler class to combine the raw values.

MotCom is a 9-bit signed integer with a 3-bit certificate.

Get raw value.

Remove MotCom certificate

Get sign bit of raw value;

Make sure top eight bits are clear.

Set positive or negative value.

Temperature is a 16-bit unsigned integer, representing the number of half-degrees Celcius

BrakePWM is an unsigned integer with a max value of 4096 with a 2-bit certificate.

Remove BrakePWM certificate.

FixedPointMilli is a 16-bit fixed point number where the decimal place is assumed third from the right (123456.789)

UnsignedFixedPointMilli is an unsigned 16-bit fixed point number where the decimal place is assumed third from the right (123456.789)

FixedPointCenti is a 16-bit fixed point number where the decimal place is assumed second from the right (1234567.89)

UnsignedFixedPointCenti is an unsigned 16-bit fixed point number where the decimal place is assumed second from the right (1234567.89)

PowConTemperature is a 16-bit float, representing temperature in degrees Celcius

PowConCurrentMany is a 16-bit float, representing current in amps

PowConVoltageMany is a 16-bit float, representing voltage in volts

Definition at line 551 of file RobonetDataElement.cpp.

void RobonetDataElement::setChannel ( const std::string &  channel)

Set the channel that the value will be read from (or written to).

Parameters:
channelThe channel that the value will be read from (or written to). For example: "LL".

Definition at line 209 of file RobonetDataElement.cpp.

void RobonetDataElement::setGroup ( const std::string &  group)

Set the data group with which the value will be transferred.

Parameters:
groupThe group with which the value will be transferred. For example: "Command".

Definition at line 273 of file RobonetDataElement.cpp.

void RobonetDataElement::setNode ( const std::string &  node)

Set the node that the value will be read from (or written to).

Parameters:
nodeThe node that the value will be read from (or written to). For example: "J1".

Definition at line 228 of file RobonetDataElement.cpp.

Set the offset pair storing the offsets at which the value will be read from (or written to).

Parameters:
offsetPairThe offset pair storing the offsets at which the value will be read from (or written to). For example: RobonetDataElement::OffsetPair("APS1L","APS1H").

Definition at line 247 of file RobonetDataElement.cpp.

template<typename T >
void RobonetDataElement::setValue ( const T  v)

Set the value held by the DataElement in the specified data type.

Parameters:
vThe value to be held by the DataElement in the specified data type.

When you set the value, is doesn't matter what the previous type was, this method will overwrite the type as well as the value.

Reimplemented from DataElement.

Definition at line 205 of file RobonetDataElement.h.

std::string RobonetDataElement::toString ( ) [virtual]

Convert the RobonetDataElement into a string representation.

Returns:
std::string representing the RobonetDataElement.

Reimplemented from DataElement.

Definition at line 337 of file RobonetDataElement.cpp.

template<typename T >
uint16_t RobonetDataElement::TrimBrakePwm ( const T  t) [inline]

Definition at line 150 of file RobonetDataElement.h.

template<typename T >
int16_t RobonetDataElement::TrimMotCom ( const T  t) [inline]

Definition at line 120 of file RobonetDataElement.h.

template<typename T >
float RobonetDataElement::TrimTemperature ( const T  t) [inline]

Definition at line 137 of file RobonetDataElement.h.


Member Data Documentation

Definition at line 188 of file RobonetDataElement.h.

Definition at line 194 of file RobonetDataElement.h.

Definition at line 195 of file RobonetDataElement.h.

const uint16_t RobonetDataElement::BRAKEPWM_CERTIFICATE_VALUE = 0x3 [static, private]

Definition at line 196 of file RobonetDataElement.h.

std::string RobonetDataElement::channel [private]

The name of the channel that the value will be read from (or written to). For example: "LL".

Definition at line 182 of file RobonetDataElement.h.

std::string RobonetDataElement::group [private]

The data group that this element will be transferred with. For example: "Command".

Definition at line 184 of file RobonetDataElement.h.

Definition at line 191 of file RobonetDataElement.h.

Definition at line 192 of file RobonetDataElement.h.

const uint16_t RobonetDataElement::MOTCOM_CERTIFICATE_VALUE = 0x7 [static, private]

Definition at line 193 of file RobonetDataElement.h.

Definition at line 190 of file RobonetDataElement.h.

std::string RobonetDataElement::node [private]

The name of the node that the value will be read from (or written to). For example: "J1".

Definition at line 183 of file RobonetDataElement.h.

The offset pair storing the offsets at which the value will be read from (or written to). For example: RobonetDataElement::OffsetPair("APS1L","APS1H").

Definition at line 185 of file RobonetDataElement.h.

Todo:
The private member RobonetDataElement::rawPair needs a description

Definition at line 186 of file RobonetDataElement.h.

Definition at line 187 of file RobonetDataElement.h.


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


robot_instance
Author(s):
autogenerated on Sat Jun 8 2019 20:43:12