opencv_mv/QMainPro/QMacVisual/manualThread.cpp

51 lines
743 B
C++
Raw Normal View History

2023-05-22 09:27:46 +00:00
#include "manualThread.h"
#include <QThread>
#include "datavar.h"
manualThread::manualThread(QObject *parent) : QObject(parent)
{
isStop = false;
isPause = false;
}
void manualThread::funThread_A()
{
while (true)
{
try
{
if (isStop == true)
{
break;
}
if (isPause == true)
{
QThread::msleep(10);
}
else
{
//<2F><>ֹ<EFBFBD>߳<EFBFBD>ռ<EFBFBD>ô<EFBFBD><C3B4><EFBFBD>CPU<50><55><EFBFBD><EFBFBD>
QThread::msleep(1);
if (dataVar::runFinish_A == true)
{
dataVar::runFinish_A = false;
dataVar::fProItemTab->slot_CyclePro();
}
}
}
catch(...){}
}
}
//ֹͣ<CDA3>̱߳<DFB3>־
void manualThread::setStopFlag(bool flag)
{
isStop = flag;
}
//<2F><>ͣ<EFBFBD>̱߳<DFB3>־
void manualThread::setPauseFlag(bool flag)
{
isPause = flag;
}