35 #include <boost/bind.hpp>
36 #include <ctkPluginContext.h>
49 mPluginContext(context),
52 this->initServiceListener();
55 void AcquisitionServiceProxy::initServiceListener()
59 boost::bind(&AcquisitionServiceProxy::onServiceAdded,
this, _1),
61 boost::bind(&AcquisitionServiceProxy::onServiceRemoved,
this, _1)
63 mServiceListener->open();
65 void AcquisitionServiceProxy::onServiceAdded(AcquisitionService* service)
67 mAcquisitionService.reset(service, null_deleter());
79 if(mAcquisitionService->isNull())
80 reportWarning(
"AcquisitionServiceProxy::onServiceAdded mAcquisitionService->isNull()");
87 void AcquisitionServiceProxy::onServiceRemoved(AcquisitionService *service)
108 return mAcquisitionService->isNull();
113 return mAcquisitionService->getLatestSession();
118 return mAcquisitionService->getSessions();
123 return mAcquisitionService->isReady(context);
128 return mAcquisitionService->getInfoText(context);
133 return mAcquisitionService->getState();
138 mAcquisitionService->startRecord(context, category, session);
143 mAcquisitionService->stopRecord();
148 mAcquisitionService->cancelRecord();
153 mAcquisitionService->startPostProcessing();
158 mAcquisitionService->stopPostProcessing();
163 return mAcquisitionService->getNumberOfSavingThreads();
Acqusition services abstract interface.
void acquisitionStopped()
virtual RecordSessionPtr getLatestSession()
virtual void stopPostProcessing()
virtual void stopRecord()
void saveDataCompleted(QString mhdFilename)
emitted when data has been saved to file
virtual void cancelRecord()
virtual void startRecord(TYPES context, QString category, RecordSessionPtr session)
virtual QString getInfoText(TYPES context) const
virtual STATE getState() const
boost::shared_ptr< class RecordSession > RecordSessionPtr
void reportWarning(QString msg)
virtual bool isReady(TYPES context) const
virtual int getNumberOfSavingThreads() const
static AcquisitionServicePtr getNullObject()
Helper class for listening to services being added, modified and removed.
virtual void startPostProcessing()
AcquisitionServiceProxy(ctkPluginContext *context)
void usReadinessChanged()
void recordedSessionsChanged()
void acquisitionDataReady()
emitted when data is acquired and sent to the reconstruction module
virtual std::vector< RecordSessionPtr > getSessions()