2017-03-29 10:18:37 +00:00
|
|
|
#include <QDebug>
|
2017-09-25 12:55:41 +00:00
|
|
|
#include "cutter.h"
|
|
|
|
#include "analthread.h"
|
2017-03-29 10:18:37 +00:00
|
|
|
|
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-09-25 12:55:41 +00:00
|
|
|
void AnalThread::start(CutterCore *core, int level, QList<QString> advanced)
|
2017-03-31 22:43:12 +00:00
|
|
|
{
|
|
|
|
this->core = core;
|
|
|
|
this->level = level;
|
2017-07-24 11:05:28 +00:00
|
|
|
this->advanced = advanced;
|
2017-03-31 22:43:12 +00:00
|
|
|
|
|
|
|
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-07-24 11:05:28 +00:00
|
|
|
core->analyze(this->level, this->advanced);
|
2017-03-29 10:18:37 +00:00
|
|
|
}
|