26 #include <qfiledialog.h>
27 #include <qinputdialog.h>
28 #include <qmessagebox.h>
29 #include <qscrollbar.h>
32 #include <igtlStringMessage.h>
33 #include <igtlBindMessage.h>
34 #include <igtlQuaternionTrackingDataMessage.h>
35 #include <igtlTrackingDataMessage.h>
38 #include <Poco/Path.h>
41 "org.mitk.views.igtldevicesourcemanagementwidget";
44 QWidget* parent, Qt::WindowFlags f)
45 : QWidget(parent, f), m_IsClient(false), m_MessageReceivedObserverTag(0), m_CommandReceivedObserverTag(0), m_LostConnectionObserverTag(0), m_NewConnectionObserverTag(0), m_StateModifiedObserverTag(0)
67 m_Controls =
new Ui::QmitkIGTLDeviceCommandWidgetControls;
81 connect(
m_Controls->butSendCommand, SIGNAL(clicked()),
84 SIGNAL(currentIndexChanged(
const QString &)),
108 this->
m_Controls->commandsComboBox->setEnabled(
false);
109 this->
m_Controls->butSendCommand->setEnabled(
false);
110 this->
m_Controls->fpsSpinBox->setEnabled(
false);
113 this->
m_Controls->commandsComboBox->setEnabled(
true);
114 this->
m_Controls->butSendCommand->setEnabled(
true);
115 this->
m_Controls->fpsSpinBox->setEnabled(
false);
118 if ( this->
m_IGTLDevice->GetNumberOfConnections() == 0 )
121 this->
m_Controls->butSendCommand->setEnabled(
false);
122 this->
m_Controls->fpsSpinBox->setEnabled(
false);
123 this->
m_Controls->commandsComboBox->setEnabled(
false);
127 this->
m_Controls->commandsComboBox->setEnabled(
true);
128 this->
m_Controls->butSendCommand->setEnabled(
true);
157 if(device.IsNotNull())
163 if ( dynamic_cast<mitk::IGTLClient*>(
173 typedef itk::SimpleMemberCommand< QmitkIGTLDeviceCommandWidget > CurCommandType;
187 connectionLostCommand->SetCallbackFunction(
190 mitk::LostConnectionEvent(), connectionLostCommand);
193 newConnectionCommand->SetCallbackFunction(
196 mitk::NewClientConnectionEvent(), newConnectionCommand);
199 stateModifiedCommand->SetCallbackFunction(
202 itk::ModifiedEvent(), stateModifiedCommand);
217 this->
m_Controls->commandsComboBox->setEnabled(
false);
218 this->
m_Controls->butSendCommand->setEnabled(
false);
219 this->
m_Controls->fpsSpinBox->setEnabled(
false);
231 SetResolution(this->
m_Controls->fpsSpinBox->value());
233 else if ( std::strcmp(
m_CurrentCommand->GetDeviceType(),
"STT_QTDATA" ) == 0 )
235 ((igtl::StartQuaternionTrackingDataMessage*)
m_CurrentCommand.GetPointer())->
236 SetResolution(this->
m_Controls->fpsSpinBox->value());
238 else if ( std::strcmp(
m_CurrentCommand->GetDeviceType(),
"STT_TDATA" ) == 0 )
241 SetResolution(this->
m_Controls->fpsSpinBox->value());
248 const QString & curCommand)
250 if ( curCommand.isEmpty() )
256 this->
m_CurrentCommand = msgFactory->CreateInstance( curCommand.toStdString());
258 this->
m_Controls->fpsSpinBox->setEnabled(curCommand.contains(
"STT_"));
282 std::list<std::string> commandsList_ =
283 msgFactory->GetAvailableMessageRequestTypes();
286 while ( commandsList_.size() )
290 QString::fromStdString(commandsList_.front()));
291 commandsList_.pop_front();
itk::SmartPointer< Self > Pointer
IGTLDeviceState
Type for state variable. The IGTLDevice is always in one of these states.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.