7 #include "PlusConfigure.h" 16 static const std::string SEND_TEXT_CMD =
"SendText";
21 : ResponseExpected(true)
24 this->SetName(SEND_TEXT_CMD);
35 this->SetName(SEND_TEXT_CMD);
42 cmdNames.push_back(SEND_TEXT_CMD);
49 if (commandName.empty() || igsioCommon::IsEqualInsensitive(commandName, SEND_TEXT_CMD))
51 desc += SEND_TEXT_CMD;
52 desc +=
": Send text data to the device.";
60 return this->DeviceId;
66 this->DeviceId = deviceId;
84 return this->ResponseText;
90 this->ResponseText = responseText;
97 os << indent <<
"Text: " << this->Text;
107 XML_READ_STRING_ATTRIBUTE_OPTIONAL(DeviceId, aConfig);
108 XML_READ_STRING_ATTRIBUTE_OPTIONAL(Text, aConfig);
119 XML_WRITE_STRING_ATTRIBUTE_IF_NOT_EMPTY(DeviceId, aConfig);
120 XML_WRITE_STRING_ATTRIBUTE_IF_NOT_EMPTY(Text, aConfig);
127 LOG_DEBUG(
"vtkPlusSendTextCommand::Execute: " << (!this->
Name.empty() ? this->
Name :
"(undefined)")
128 <<
", device: " << (this->DeviceId.empty() ?
"(undefined)" : this->DeviceId)
129 <<
", text: " << (this->Text.empty() ?
"(undefined)" : this->Text));
132 if (dataCollector == NULL)
139 if (this->DeviceId.empty())
148 + (this->DeviceId.empty() ?
"(undefined)" : this->DeviceId) + std::string(
" is not found."));
153 std::string textToSend;
154 std::string response;
164 +
" to device " + (this->DeviceId.empty() ?
"(undefined)" : this->DeviceId));
virtual void PrintSelf(ostream &os, vtkIndent indent)
Abstract interface for tracker and video devices.
virtual ~vtkPlusSendTextCommand()
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *aConfig)
PlusStatus GetDevice(vtkPlusDevice *&aDevice, const std::string &aDeviceId) const
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *aConfig)
virtual std::string GetDescription(const std::string &commandName)
virtual void SetText(const std::string &text)
virtual std::string GetText() const
virtual PlusStatus Execute()
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *aConfig)
This command send text to a device and optionally return with a response textThis command is used for...
PhidgetLCD_Font int int const char * text
Manages devices that record image or positional data.
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *aConfig)
void QueueCommandResponse(PlusStatus status, const std::string &message, const std::string &error="", const igtl::MessageBase::MetaDataMap *metaData=nullptr)
virtual std::string GetDeviceId() const
virtual vtkPlusDataCollector * GetDataCollector()
virtual std::string GetResponseText() const
vtkStandardNewMacro(vtkPlusSendTextCommand)
virtual void GetCommandNames(std::list< std::string > &cmdNames)
virtual bool GetResponseExpected()
virtual void SetDeviceId(const std::string &deviceId)
virtual PlusStatus SendText(const std::string &textToSend, std::string *textReceived=NULL)
virtual void SetResponseText(const std::string &responseText)