暂时使用在Camera类计算上次发送信号的时间以限制帧率,目前将使用两个窗口各5fps测试一晚上。
This commit is contained in:
@@ -34,6 +34,7 @@ camera::camera(cameraModule cameraModulePtrIn, backEndController* backEndControl
|
||||
cameraModulePtr = cameraModulePtrIn;
|
||||
cameraName = cameraModulePtr.key;
|
||||
index = indexIn;
|
||||
lastUpdateTime.start();
|
||||
this->start();
|
||||
}
|
||||
void camera::run()
|
||||
@@ -50,13 +51,17 @@ void camera::run()
|
||||
{
|
||||
imgQueue.enqueue(img);
|
||||
//emit _backEndController->sendPixmapImageWidgetByIndex(cvMatToQPixMap(img), imgWidgetOri, index);
|
||||
QPixmap pixmap;
|
||||
cvMatToQPixMap(img, pixmap);
|
||||
showImgPack* pack = new showImgPack();
|
||||
pack->img = pixmap;
|
||||
pack->type = imgWidgetOri;
|
||||
pack->index = index;
|
||||
emit S1(pack);
|
||||
if (lastUpdateTime.elapsed() > 200)
|
||||
{
|
||||
lastUpdateTime.start(); // 记录本次更新时间
|
||||
QPixmap pixmap;
|
||||
cvMatToQPixMap(img, pixmap);
|
||||
showImgPack* pack = new showImgPack();
|
||||
pack->img = pixmap;
|
||||
pack->type = imgWidgetOri;
|
||||
pack->index = index;
|
||||
emit S1(pack);
|
||||
}
|
||||
}
|
||||
|
||||
//防止过大
|
||||
|
||||
@@ -10,12 +10,13 @@
|
||||
#include <qthread.h>
|
||||
#include <qdebug.h>
|
||||
#include <globalStruct.h>
|
||||
|
||||
#include <qdatetime.h>
|
||||
class backEndController;
|
||||
class camera : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QTime lastUpdateTime;
|
||||
QString cameraName;
|
||||
camera(cameraModule cameraModulePtrIn, backEndController* backEndControllerIn, int indexIn);
|
||||
~camera()
|
||||
|
||||
@@ -65,6 +65,7 @@ private:
|
||||
|
||||
void topBarInit();
|
||||
void leftBarInit();
|
||||
|
||||
public slots:
|
||||
void minimizeWindow()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user