2017-03-29 10:18:37 +00:00
|
|
|
#include "analthread.h"
|
2017-07-02 11:11:02 +00:00
|
|
|
#include "iaitorcore.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()
|
|
|
|
{
|
2017-04-09 19:55:06 +00:00
|
|
|
if (isRunning())
|
|
|
|
{
|
2017-03-31 22:43:12 +00:00
|
|
|
quit();
|
|
|
|
wait();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-02 11:11:02 +00:00
|
|
|
void AnalThread::start(IaitoRCore *core, int level)
|
2017-03-31 22:43:12 +00:00
|
|
|
{
|
|
|
|
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
|
|
|
}
|