void QmitkIGTLStreamingManagementWidget::SelectSourceAndAdaptGUI()
{
   //get the current selection and call SourceSelected which will call AdaptGUI
   mitk::IGTLMessageSource::Pointer curSelSrc =
      m_Controls->messageSourceSelectionWidget->GetSelectedIGTLMessageSource();
   SourceSelected(curSelSrc);
}
예제 #2
0
/*
Called to display a dialog box to select the Twain source to use.
This can be overridden if a list of all sources is available
to the application. These sources can be enumerated by Twain.
it is not yet supportted by CTwain.
*/
BOOL CTwain::SelectSource()
{
	memset(&m_Source,0,sizeof(m_Source));
	if(!SourceSelected())
	{
		SelectDefaultSource();
	}
	if(CallTwainProc(&m_AppId,NULL,DG_CONTROL,DAT_IDENTITY,MSG_USERSELECT,&m_Source))
	{
		m_bSourceSelected = TRUE;
	}
	return m_bSourceSelected;
}
예제 #3
0
void QmitkOpenIGTLinkManager::CreateQtPartControl( QWidget *parent )
{
  // create GUI widgets from the Qt Designer's .ui file
  m_Controls.setupUi( parent );

  // create GUI widgets from the Qt Designer's .ui file
//  connect( (QObject*)(m_Controls.m_SourceManagerWidget),
//           SIGNAL(NewSourceAdded(mitk::IGTLDeviceSource::Pointer, std::string)),
//           this,
//           SLOT(NewSourceByWidget(mitk::IGTLDeviceSource::Pointer,std::string)) );
  connect( (QObject*)(m_Controls.m_SourceListWidget),
           SIGNAL(IGTLDeviceSourceSelected(mitk::IGTLDeviceSource::Pointer)),
           this,
           SLOT(SourceSelected(mitk::IGTLDeviceSource::Pointer)) );
}
예제 #4
0
/*
Opens a Data Source supplied as the input parameter
*/
BOOL CTwain::OpenSource(TW_IDENTITY *pSource)
{
	if(pSource) 
	{
		m_Source = *pSource;
	}
	if(DSMOpen())
	{
		if(!SourceSelected())
		{
			SelectDefaultSource();
		}
		m_bDSOpen = CallTwainProc(&m_AppId,NULL,DG_CONTROL,DAT_IDENTITY,MSG_OPENDS,(TW_MEMREF)&m_Source);
	}
	return DSOpen();
}
void QmitkIGTLStreamingManagementWidget::CreateConnections()
{
  if (m_Controls)
  {
    connect( (QObject*)(m_Controls->messageSourceSelectionWidget),
             SIGNAL(IGTLMessageSourceSelected(mitk::IGTLMessageSource::Pointer)),
             this,
             SLOT(SourceSelected(mitk::IGTLMessageSource::Pointer)) );
    connect( m_Controls->startStreamPushButton, SIGNAL(clicked()),
             this, SLOT(OnStartStreaming()));
    connect( m_Controls->stopStreamPushButton, SIGNAL(clicked()),
             this, SLOT(OnStopStreaming()));
  }
  //this is used for thread seperation, otherwise the worker thread would change the ui elements
  //which would cause an exception
  connect(this, SIGNAL(AdaptGUIToStateSignal()), this, SLOT(AdaptGUIToState()));
  connect(this, SIGNAL(SelectSourceAndAdaptGUISignal()), this, SLOT(SelectSourceAndAdaptGUI()));
}