My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
gcp::antenna::control::ServoCommand Class Reference

Public Types

enum  Request {
  INVALID, GET_AZEL, GET_PRIOR_LOC, GET_PPS_TICK,
  SEND_POS, BEGIN_PPS_LOOP, BEGIN_TRACK_LOOP, LOAD_LOOP_PARAMS,
  STOP_ALL, CAL_ENCODERS, CLEAR_OFFSETS, POSITION_OFFSET,
  VELOCITY_OFFSET, POSITION_ERRORS, SET_ENCODERS, QUERY_STATUS,
  AZ_BRAKE_ON, AZ_BRAKE_OFF, EL_BRAKE_ON, EL_BRAKE_OFF,
  SET_AZ_TORQUE, SET_EL_TORQUE, QUERY_VERSION, SET_AZ_TORQUES,
  READ_AZ_ENCODERS, NUMBER_ERRORS, START_AMP_COMMS, ENABLE_AZ_AMP1,
  ENABLE_AZ_AMP2, ENABLE_EL_AMP, DISABLE_AZ_AMP1, DISABLE_AZ_AMP2,
  DISABLE_EL_AMP, STATUS_AZ_AMP1, STATUS_AZ_AMP2, STATUS_EL_AMP,
  ALIVE_AZ_AMP1, ALIVE_AZ_AMP2, ALIVE_EL_AMP, ACTUAL_CURR_AZ1,
  ACTUAL_CURR_AZ2, ACTUAL_CURR_EL, COMMAND_CURR_AZ1, COMMAND_CURR_AZ2,
  COMMAND_CURR_EL
}
 

Public Member Functions

void constructMap ()
 
 ServoCommand ()
 
 ~ServoCommand ()
 
void packCommand (Request req)
 
void packCommand (Request req, std::vector< float > &values)
 
void checkOneOutput ()
 
void checkTwoOutputs ()
 
void checkManyOutputs ()
 
void interpretStatusResponse (const char *response)
 
void packStartAmpComms ()
 
void packEnableElAmp ()
 
void packDisableElAmp ()
 
void packEnableAzAmp1 ()
 
void packDisableAzAmp1 ()
 
void interpretResponse ()
 
bool simpleValidityCheck ()
 
size_t responseLength ()
 
size_t size ()
 

Public Attributes

std::map< Request, std::string > commandMap_
 
unsigned char request_
 
std::string messageToSend_
 
std::string expectedResponse_
 
char responseReceived_ [SERVO_DATA_MAX_LEN]
 
unsigned short cmdSize_
 
bool expectsResponse_
 
unsigned short responseLength_
 
unsigned char readData_ [SERVO_DATA_MAX_LEN]
 
unsigned char tmpBuffer_ [SERVO_DATA_MAX_LEN]
 
bool responseValid_
 
bool responseValueValid_
 
bool ppsPresent_
 
float responseValue_ [MAX_RESPONSE_SAMPLES]
 

Friends

class ServoComms
 

Member Enumeration Documentation

Enumerate supported commands

Constructor & Destructor Documentation

ServoCommand::ServoCommand ( )

Constructor.

....................................................................... Constructor initializes request type to invalid and constructs the command map.

ServoCommand::~ServoCommand ( )

Destructor.

....................................................................... Constructor initializes request type to invalid.

Member Function Documentation

void ServoCommand::checkManyOutputs ( )

Check if box output is valid when many return values.

....................................................................... Check if box output is valid, and what its value is.

void ServoCommand::checkOneOutput ( )

Check if box output is valid when one return value.

....................................................................... Check if box output is valid, and what its value is.

void ServoCommand::checkTwoOutputs ( )

Check if box output is valid when two return values.

....................................................................... Check if box output is valid, and what its value is.

void ServoCommand::constructMap ( )

Construct the map

....................................................................... Construct our map from enums to strings to issue.

void ServoCommand::interpretResponse ( )

Interpret what we get back

....................................................................... Interpret Command to see if something valid happened.

void ServoCommand::interpretStatusResponse ( const char *  response)

Interpret our awful status response

....................................................................... Interpret our awful status response

void ServoCommand::packCommand ( Request  req)

General Pack Command

....................................................................... pack all our commands

void ServoCommand::packDisableAzAmp1 ( )

Disable the Az Amplifier 1

....................................................................... disable the azimuth first amplifier

void ServoCommand::packDisableElAmp ( )

Disable the El Amplifier

....................................................................... disable the elevation amplifier

void ServoCommand::packEnableAzAmp1 ( )

Enable the Az Amplifier 1

....................................................................... enable the azimuth first amplifier

void ServoCommand::packEnableElAmp ( )

Enable the El Amplifier

....................................................................... enable the elevation amplifier

void ServoCommand::packStartAmpComms ( )

Start Amplifier Communications

....................................................................... begin communications with the amplifier

size_t ServoCommand::responseLength ( )

Return the number of bytes read.

....................................................................... Return the response length.

bool ServoCommand::simpleValidityCheck ( )

Simple check that two strings match.

....................................................................... Simple Check if two strings match

size_t ServoCommand::size ( )

The size of the command to send.

....................................................................... Return our size as a size_t suitable for passing to write(2) or read(2).

Member Data Documentation

unsigned short gcp::antenna::control::ServoCommand::cmdSize_

The size of the command to send.

std::map<Request, std::string> gcp::antenna::control::ServoCommand::commandMap_

Command map

std::string gcp::antenna::control::ServoCommand::expectedResponse_

Expected Response

bool gcp::antenna::control::ServoCommand::expectsResponse_

True if we are expecting a response to a command

std::string gcp::antenna::control::ServoCommand::messageToSend_

Command to be issued

bool gcp::antenna::control::ServoCommand::ppsPresent_

Whether 1 PPS is present

unsigned char gcp::antenna::control::ServoCommand::readData_[SERVO_DATA_MAX_LEN]

A buffer into which we can read data returned by the pmac.

unsigned char gcp::antenna::control::ServoCommand::request_

Index pertaining to all request types.

unsigned short gcp::antenna::control::ServoCommand::responseLength_

If we are expecting a response, how many bytes should be received?

char gcp::antenna::control::ServoCommand::responseReceived_[SERVO_DATA_MAX_LEN]

Response Received

bool gcp::antenna::control::ServoCommand::responseValid_

Whether the response is valid

float gcp::antenna::control::ServoCommand::responseValue_[MAX_RESPONSE_SAMPLES]

Value of the response

bool gcp::antenna::control::ServoCommand::responseValueValid_

Whether the response value is valid

unsigned char gcp::antenna::control::ServoCommand::tmpBuffer_[SERVO_DATA_MAX_LEN]

A pointer to this buffer may be handed back via calls to unsigned int* readRegResponse(), above


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