Critical Link MityCam SoC Firmware
1.0
Critical Link MityCam SoC Firmware
|
#include <CommandInterface.h>
Public Member Functions | |
tcCommandInterface (const char *ifacename, tcSensorBoard *apSensor, tcIOChannel *apChannel) | |
virtual | ~tcCommandInterface () |
Destructor. More... | |
void | initializeCommandHandlers () |
virtual void | getInput (std::string *apStringOutput)=0 |
virtual std::string | parseInput (std::string &arStringOutput)=0 |
virtual void | respond (std::string ahResponse)=0 |
virtual void | finish (std::string &arOriginalBuffer)=0 |
virtual void * | run () |
virtual void | addTEC (tcPIDControl *apPID) |
tcAbstractHandler * | getChain (void) |
tcAbstractHandler * | getHandler (std::string name) |
Public Member Functions inherited from tcThread | |
tcThread () | |
virtual | ~tcThread () |
void | join () |
virtual void | start () |
virtual void | stop () |
Static Public Member Functions | |
static std::string | registerName (uint32_t anReg) |
Protected Member Functions | |
void | Report (const char *fmt,...) |
This method routes text to stderr. More... | |
void | ReportError (const char *fmt,...) |
Protected Member Functions inherited from tcThread | |
void | setPriority (int anRelativePriority) |
Protected Attributes | |
std::string | m_ifacename |
tcSensorBoard * | mpSensor |
tcIOChannel * | mpChannel |
Protected Attributes inherited from tcThread | |
bool | mbKillThread |
Static Protected Attributes | |
static tcAbstractHandler * | gpChainHead = NULL |
static tcAbstractHandler * | gpChainTail = NULL |
static std::map< std::string, tcAbstractHandler * > | mcStringMap |
static tcMutex | chain_initializer = tcMutex() |
Additional Inherited Members | |
Static Public Attributes inherited from tcThread | |
static const int | HIGHEST_PRIORITY = -2 |
static const int | HIGH_PRIORITY = -1 |
static const int | NORMAL_PRIORITY = 0 |
static const int | LOW_PRIORITY = 1 |
static const int | LOWEST_PRIORITY = 2 |
tcCommandInterface::tcCommandInterface | ( | const char * | ifacename, |
tcSensorBoard * | apSensor, | ||
tcIOChannel * | apChannel | ||
) |
tcGigEIOHandler Constructor
[in] | ifacename | Human readable interface name used for debugging only. |
[in] | apSensor | Pointer to the sensor board object. |
[in] | apChannel | Pointer to the IO channel object. |
|
virtual |
Destructor.
|
virtual |
When a TEC cooler is present to control, call this function to add control into the chain.
Function is virtual because some interfaces (like MityViewer) don't use the chain and would like to have more direct control over the result.
apPID | - pointer to the PID controller object |
Reimplemented in SocCamera::tcMityViewerInterface.
|
pure virtual |
Perform cleanup tasks. (eg: reboot, signal thread to die, etc).
arOriginalBuffer | - the original buffer that was gotten |
Implemented in SocCamera::tcU3VisionInterface, SocCamera::tcCameraLinkSerial, SocCamera::tcConsoleInterface, SocCamera::tcNamedPipeInterface, SocCamera::tcMityViewerInterface, and SocCamera::tcGigEInterface.
|
inline |
|
inline |
|
pure virtual |
Gets the input from whatever means it has to and stores it in the std::string pointed to by the parameter.
apStringOutput | - pointer to the location to store the input |
Implemented in SocCamera::tcU3VisionInterface, SocCamera::tcCameraLinkSerial, SocCamera::tcConsoleInterface, SocCamera::tcNamedPipeInterface, SocCamera::tcMityViewerInterface, and SocCamera::tcGigEInterface.
void SocCamera::tcCommandInterface::initializeCommandHandlers | ( | ) |
|
pure virtual |
Process the input string and call whatever functions are appropriate. Returns a value which will be passed to respond().
arStringOutput | - the input string to process. |
Implemented in SocCamera::tcU3VisionInterface, SocCamera::tcCameraLinkSerial, SocCamera::tcConsoleInterface, SocCamera::tcNamedPipeInterface, SocCamera::tcMityViewerInterface, and SocCamera::tcGigEInterface.
|
static |
Get the name of the register at address anReg
address | of register |
|
protected |
This method routes text to stderr.
|
protected |
Report Error Function This method routes error text to stderr
|
pure virtual |
Send the <ACK>, <NACK> or whatever other response.
ahResponse | - the string to output back over the source |
Implemented in SocCamera::tcGigEInterface, SocCamera::tcU3VisionInterface, SocCamera::tcCameraLinkSerial, SocCamera::tcConsoleInterface, SocCamera::tcNamedPipeInterface, and SocCamera::tcMityViewerInterface.
|
virtual |
run() should spin getting input from getInput() and sends it to parseInput() for processing. This fully abstracts threading.
Implements tcThread.
Reimplemented in SocCamera::tcU3VisionInterface, SocCamera::tcGigEInterface, and SocCamera::tcMityViewerInterface.
|
staticprotected |
The command handler chain belonging to all interfaces.
|
staticprotected |
|
protected |
|
staticprotected |
Maps strings to handlers; this makes O(log n) execution on commands instead of O(n) compared to using mpChain directly.
|
protected |
The IOChannel that this command interface controls.
|
protected |
The sensor being controlled.