PlusLib
2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
|
This is an abstract superclass for commands in the OpenIGTLink network interface for Plus. More...
#include <src/PlusServer/Commands/vtkPlusCommand.h>
Public Member Functions | |
virtual vtkPlusCommand * | Clone ()=0 |
virtual PlusStatus | Execute ()=0 |
virtual int | GetClientId () |
virtual void | GetCommandNames (std::list< std::string > &cmdNames)=0 |
virtual std::string | GetDescription (const std::string &commandName)=0 |
virtual uint32_t | GetId () |
virtual bool | GetRespondWithCommandMessage () |
void | PopCommandResponses (PlusCommandResponseList &responses) |
virtual void | PrintSelf (ostream &os, vtkIndent indent) |
virtual PlusStatus | ReadConfiguration (vtkXMLDataElement *aConfig) |
virtual void | SetClientId (int) |
virtual void | SetCommandProcessor (vtkPlusCommandProcessor *processor) |
virtual void | SetId (uint32_t) |
void | SetMetaData (const igtl::MessageBase::MetaDataMap &metaData) |
virtual void | SetRespondWithCommandMessage (bool) |
vtkGetStdStringMacro (Name) | |
vtkGetStdStringMacro (DeviceName) | |
vtkSetStdStringMacro (Name) | |
vtkSetStdStringMacro (DeviceName) | |
virtual PlusStatus | WriteConfiguration (vtkXMLDataElement *aConfig) |
Static Public Member Functions | |
static PlusStatus | GenerateCommandDeviceName (const std::string &uid, std::string &outDeviceName) |
static std::string | GenerateReplyDeviceName (uint32_t uid) |
static std::string | GetPrefixFromCommandDeviceName (const std::string &deviceName) |
static std::string | GetUidFromCommandDeviceName (const std::string &deviceName) |
static bool | IsCommandDeviceName (const std::string &deviceName) |
static bool | IsReplyDeviceName (const std::string &deviceName, const std::string &uid=std::string("")) |
Static Public Attributes | |
static const std::string | DEVICE_NAME_COMMAND = "CMD" |
static const std::string | DEVICE_NAME_REPLY = "ACK" |
Protected Member Functions | |
virtual vtkPlusDataCollector * | GetDataCollector () |
virtual vtkIGSIOTransformRepository * | GetTransformRepository () |
void | QueueCommandResponse (PlusStatus status, const std::string &message, const std::string &error="", const igtl::MessageBase::MetaDataMap *metaData=nullptr) |
PlusStatus | ValidateName () |
vtkPlusCommand () | |
virtual | ~vtkPlusCommand () |
Protected Attributes | |
int | ClientId |
vtkPlusCommandProcessor * | CommandProcessor |
PlusCommandResponseList | CommandResponseQueue |
std::string | DeviceName |
uint32_t | Id |
igtl::MessageBase::MetaDataMap | MetaData |
std::string | Name |
bool | RespondWithCommandMessage |
This is an abstract superclass for commands in the OpenIGTLink network interface for Plus.
All commands have a unique string representation to enable sending commands as string messages. For e.g. through OpenIGTLink.
Definition at line 31 of file vtkPlusCommand.h.
|
protected |
Definition at line 19 of file vtkPlusCommand.cxx.
|
protectedvirtual |
Definition at line 28 of file vtkPlusCommand.cxx.
|
pure virtual |
Implemented in vtkPlusConoProbeLinkCommand, vtkPlusUSDigitalEncoderCommand, vtkPlusCapistranoCommand, vtkPlusGenericSerialCommand, vtkPlusGetFrameRateCommand, vtkPlusReconstructVolumeCommand, vtkPlusSendTextCommand, vtkPlusGetImageCommand, vtkPlusStartStopRecordingCommand, vtkPlusStealthLinkCommand, vtkPlusWinProbeCommand, vtkPlusAtracsysCommand, vtkPlusClariusCommand, vtkPlusGetUsParameterCommand, vtkPlusSaveConfigCommand, vtkPlusSetUsParameterCommand, vtkPlusUpdateTransformCommand, vtkPlusGetTransformCommand, vtkPlusRequestIdsCommand, vtkPlusGetPolydataCommand, vtkPlusVersionCommand, and vtkPlusAddRecordingDeviceCommand.
|
pure virtual |
Executes the command
resultString | Command result in a human-readable string |
Implemented in vtkPlusConoProbeLinkCommand, vtkPlusGetPolydataCommand, vtkPlusUSDigitalEncoderCommand, vtkPlusCapistranoCommand, vtkPlusGenericSerialCommand, vtkPlusGetFrameRateCommand, vtkPlusReconstructVolumeCommand, vtkPlusSendTextCommand, vtkPlusGetImageCommand, vtkPlusStartStopRecordingCommand, vtkPlusStealthLinkCommand, vtkPlusWinProbeCommand, vtkPlusAtracsysCommand, vtkPlusClariusCommand, vtkPlusGetUsParameterCommand, vtkPlusSaveConfigCommand, vtkPlusSetUsParameterCommand, vtkPlusUpdateTransformCommand, vtkPlusGetTransformCommand, vtkPlusRequestIdsCommand, vtkPlusVersionCommand, and vtkPlusAddRecordingDeviceCommand.
|
static |
LEGACY - for supporting receiving commands from OpenIGTLink v1/v2 clients
Generates a command device name from a specified unique identifier (UID). The device name is "CMD_uidvalue" (if the UID is empty then the funtion fails).
Definition at line 173 of file vtkPlusCommand.cxx.
|
static |
LEGACY - for supporting receiving commands from OpenIGTLink v1/v2 clients
Generates a command reply device name from a specified unique identifier (UID). The device name is "ACK_uidvalue" (if the UID is empty then the device name is "ACK").
Definition at line 165 of file vtkPlusCommand.cxx.
|
virtual |
|
pure virtual |
Returns the list of command names that this command can process
Implemented in vtkPlusConoProbeLinkCommand, vtkPlusUSDigitalEncoderCommand, vtkPlusCapistranoCommand, vtkPlusGenericSerialCommand, vtkPlusGetFrameRateCommand, vtkPlusReconstructVolumeCommand, vtkPlusSendTextCommand, vtkPlusStartStopRecordingCommand, vtkPlusStealthLinkCommand, vtkPlusWinProbeCommand, vtkPlusAtracsysCommand, vtkPlusClariusCommand, vtkPlusGetUsParameterCommand, vtkPlusSaveConfigCommand, vtkPlusSetUsParameterCommand, vtkPlusUpdateTransformCommand, vtkPlusGetTransformCommand, vtkPlusGetPolydataCommand, vtkPlusGetImageCommand, vtkPlusRequestIdsCommand, vtkPlusVersionCommand, and vtkPlusAddRecordingDeviceCommand.
|
protectedvirtual |
Convenience function for getting a pointer to the data collector
Definition at line 93 of file vtkPlusCommand.cxx.
|
pure virtual |
Gets the description for the specified command name. Command name is specified because a command object may be able to execute different commands.
commandName | Command name to provide the description for. If the pointer is NULL then all the supported commands shall be described. |
Implemented in vtkPlusConoProbeLinkCommand, vtkPlusUSDigitalEncoderCommand, vtkPlusCapistranoCommand, vtkPlusGenericSerialCommand, vtkPlusGetFrameRateCommand, vtkPlusReconstructVolumeCommand, vtkPlusSendTextCommand, vtkPlusStartStopRecordingCommand, vtkPlusStealthLinkCommand, vtkPlusWinProbeCommand, vtkPlusAtracsysCommand, vtkPlusClariusCommand, vtkPlusGetUsParameterCommand, vtkPlusSaveConfigCommand, vtkPlusSetUsParameterCommand, vtkPlusUpdateTransformCommand, vtkPlusGetTransformCommand, vtkPlusGetPolydataCommand, vtkPlusGetImageCommand, vtkPlusRequestIdsCommand, vtkPlusVersionCommand, and vtkPlusAddRecordingDeviceCommand.
|
virtual |
|
static |
Gets the prefix from a device name (e.g., device name is CMD_abc123, it returns CMD)
Definition at line 233 of file vtkPlusCommand.cxx.
|
virtual |
|
protectedvirtual |
Convenience function for getting a pointer to the transform repository
Definition at line 118 of file vtkPlusCommand.cxx.
|
static |
Gets the uid from a device name (e.g., device name is CMD_abc123, it returns abc123)
Definition at line 221 of file vtkPlusCommand.cxx.
|
static |
LEGACY - for supporting receiving commands from OpenIGTLink v1/v2 clients
Checks if a deviceName is a command. For example: CMD_13
Definition at line 185 of file vtkPlusCommand.cxx.
|
static |
LEGACY - for supporting receiving commands from OpenIGTLink v1/v2 clients
Checks if a deviceName is a reply to a command. For example: ACK_13 is a reply to CMD_13
Definition at line 197 of file vtkPlusCommand.cxx.
void vtkPlusCommand::PopCommandResponses | ( | PlusCommandResponseList & | responses | ) |
Get command responses from the device, append them to the provided list, and then remove them from the command. The ownership of the command responses are transferred to the caller, it is responsible for deleting them.
Definition at line 245 of file vtkPlusCommand.cxx.
|
virtual |
Reimplemented in vtkPlusConoProbeLinkCommand, vtkPlusUSDigitalEncoderCommand, vtkPlusCapistranoCommand, vtkPlusGenericSerialCommand, vtkPlusGetFrameRateCommand, vtkPlusReconstructVolumeCommand, vtkPlusSendTextCommand, vtkPlusGetImageCommand, vtkPlusStartStopRecordingCommand, vtkPlusStealthLinkCommand, vtkPlusWinProbeCommand, vtkPlusAtracsysCommand, vtkPlusClariusCommand, vtkPlusGetUsParameterCommand, vtkPlusSaveConfigCommand, vtkPlusSetUsParameterCommand, vtkPlusUpdateTransformCommand, vtkPlusGetTransformCommand, vtkPlusRequestIdsCommand, and vtkPlusGetPolydataCommand.
Definition at line 33 of file vtkPlusCommand.cxx.
|
protected |
Helper method to add a command response to the response queue
Definition at line 253 of file vtkPlusCommand.cxx.
|
virtual |
Read command parameters from XML
Reimplemented in vtkPlusRequestIdsCommand, vtkPlusConoProbeLinkCommand, vtkPlusUSDigitalEncoderCommand, vtkPlusCapistranoCommand, vtkPlusGenericSerialCommand, vtkPlusGetFrameRateCommand, vtkPlusReconstructVolumeCommand, vtkPlusSendTextCommand, vtkPlusStartStopRecordingCommand, vtkPlusStealthLinkCommand, vtkPlusWinProbeCommand, vtkPlusAtracsysCommand, vtkPlusClariusCommand, vtkPlusGetUsParameterCommand, vtkPlusSaveConfigCommand, vtkPlusSetUsParameterCommand, vtkPlusUpdateTransformCommand, vtkPlusGetTransformCommand, and vtkPlusGetPolydataCommand.
Definition at line 39 of file vtkPlusCommand.cxx.
|
virtual |
Set the id of the client that requested the command
|
virtual |
Set the command processor to get access to the data collection devices and other commands
Definition at line 81 of file vtkPlusCommand.cxx.
|
virtual |
void vtkPlusCommand::SetMetaData | ( | const igtl::MessageBase::MetaDataMap & | metaData | ) |
Definition at line 87 of file vtkPlusCommand.cxx.
|
virtual |
|
protected |
Check if the command name is in the list of command names
Definition at line 143 of file vtkPlusCommand.cxx.
vtkPlusCommand::vtkGetStdStringMacro | ( | Name | ) |
vtkPlusCommand::vtkGetStdStringMacro | ( | DeviceName | ) |
vtkPlusCommand::vtkSetStdStringMacro | ( | Name | ) |
vtkPlusCommand::vtkSetStdStringMacro | ( | DeviceName | ) |
|
virtual |
Write command parameters to XML
Reimplemented in vtkPlusRequestIdsCommand, vtkPlusConoProbeLinkCommand, vtkPlusUSDigitalEncoderCommand, vtkPlusCapistranoCommand, vtkPlusGenericSerialCommand, vtkPlusGetFrameRateCommand, vtkPlusReconstructVolumeCommand, vtkPlusSendTextCommand, vtkPlusStartStopRecordingCommand, vtkPlusStealthLinkCommand, vtkPlusWinProbeCommand, vtkPlusAtracsysCommand, vtkPlusClariusCommand, vtkPlusGetUsParameterCommand, vtkPlusSaveConfigCommand, vtkPlusSetUsParameterCommand, vtkPlusUpdateTransformCommand, vtkPlusGetTransformCommand, and vtkPlusGetPolydataCommand.
Definition at line 55 of file vtkPlusCommand.cxx.
|
protected |
Unique identifier of the Client that the response(s) will be sent to
Definition at line 150 of file vtkPlusCommand.h.
|
protected |
Definition at line 147 of file vtkPlusCommand.h.
|
protected |
Definition at line 173 of file vtkPlusCommand.h.
|
static |
Definition at line 34 of file vtkPlusCommand.h.
|
static |
Definition at line 35 of file vtkPlusCommand.h.
|
protected |
Device name of the received command. Reply device name is DeviceNameReply by default.
Definition at line 153 of file vtkPlusCommand.h.
|
protected |
Unique identifier of the command. It can be used to match commands and replies.
Definition at line 156 of file vtkPlusCommand.h.
|
protected |
Meta data passed in from the igtl message
Definition at line 170 of file vtkPlusCommand.h.
|
protected |
Name of the command. One command class may handle multiple commands, this Name member defines which of the supported command should be executed.
Definition at line 165 of file vtkPlusCommand.h.
|
protected |
Should we respond using igtl::StringMessage or igtl::CommandMessage
Definition at line 159 of file vtkPlusCommand.h.