2017-03-29 10:18:37 +00:00
|
|
|
#include "analthread.h"
|
2017-03-31 22:43:12 +00:00
|
|
|
#include "qrcore.h"
|
2017-03-29 10:18:37 +00:00
|
|
|
#include <QDebug>
|
|
|
|
|
2017-03-31 22:43:12 +00:00
|
|
|
AnalThread::AnalThread(QWidget *parent) :
|
|
|
|
QThread(parent),
|
|
|
|
core(nullptr),
|
|
|
|
level(2)
|
2017-03-29 10:18:37 +00:00
|
|
|
{
|
2017-03-31 22:43:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AnalThread::~AnalThread()
|
|
|
|
{
|
|
|
|
if (isRunning()) {
|
|
|
|
quit();
|
|
|
|
wait();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void AnalThread::start(QRCore *core, int level)
|
|
|
|
{
|
|
|
|
this->core = core;
|
|
|
|
this->level = level;
|
|
|
|
|
|
|
|
QThread::start();
|
2017-03-29 10:18:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// run() will be called when a thread starts
|
|
|
|
void AnalThread::run()
|
|
|
|
{
|
|
|
|
//qDebug() << "Anal level: " << this->level;
|
2017-03-31 22:43:12 +00:00
|
|
|
core->analyze(this->level);
|
2017-03-29 10:18:37 +00:00
|
|
|
}
|