Example #1
0
void dCacheMainWindow::init()
{
	/**
	 * Initialization of the QThread that handles dCache operations (Check, Listing and Copy)
	 * Connection of the different signals of the Thread to GUI slots
	 * emit the configuration of the directories to the QThread
	 */
	m_tools = new dCacheTools();
	connect(this, SIGNAL(Configure_dCacheTool(QString, QString, QString, int, bool)), m_tools, SLOT(Configure(QString, QString, QString, int, bool)));
	connect(m_tools, SIGNAL(log(QString,QString)), m_logger, SLOT(Log(QString,QString)));
	//Direct Connection to receive the signal before the end of the QThread
	connect(m_tools, SIGNAL(finished()), this, SLOT(ThreadStopped()), Qt::DirectConnection);
	connect(m_tools, SIGNAL(started()), this, SLOT(ThreadRunning()), Qt::DirectConnection);

	emit Configure_dCacheTool(InputDir, BaseDir, OutputDir, type, isSingleFile);
}
Example #2
0
void FrameProcessor::Report(MessageLevel level, const QString & message)
{
	emit reportSignal(level, message.toStdString().c_str());
}

FrameProcessor::FrameProcessor()
{
	// connects
	connect(&_worker, SIGNAL(workerReportSignal(MessageLevel, const QString &)), this, SLOT(Report(MessageLevel, const QString &)));

	_worker.moveToThread(&_thread);

	connect(this, SIGNAL(inputChangedSignal(QString)), &_worker, SLOT(OpenSlot(QString)));
	connect(&_thread, SIGNAL(started()), &_worker, SLOT(Process()));
	connect(&_thread, SIGNAL(finished()), this, SLOT(ThreadStopped()));
	connect(this, SIGNAL(cleanupSignal()), &_worker, SLOT(Cleanup()));
	connect(&_thread, SIGNAL(finished()), &_worker, SLOT(deleteLater()));
	connect(&_thread, SIGNAL(finished()), &_worker, SLOT(Terminate()));
	connect(&_worker, SIGNAL(imageProcessed(cv::Mat, double)), this, SLOT( ImageReported( cv::Mat,double )));
}

void FrameProcessor::ImageReported(cv::Mat image, double seconds)
{
	_images.push(image);
	if (!_timer.isActive())
		_timer.start(seconds, this);
}

FrameProcessor::~FrameProcessor()
{