代码拉取完成,页面将自动刷新
#include "faceidtimeout.h"
#include "ui_faceidtimeout.h"
FaceIdTimeout::FaceIdTimeout(QWidget *parent) :
QWidget(parent),
ui(new Ui::FaceIdTimeout)
{
ui->setupUi(this);
hide();
m_DelayTimer = new QTimer;
m_DelayTimer->setInterval(10 * 60 *1000);
m_DecTimer = new QTimer;
m_DecTimer->setInterval(1000);
m_SoftTimer = new QTimer;
//SetSoftwareTimer(DataDictionary::GetInstance()->GetMisData(MIS_FACEID_TIMEOUT).toInt());
m_Cnt = 300;
connect(m_DecTimer,SIGNAL(timeout()),\
this,SLOT(UpdateCnt()));
connect(m_DelayTimer,SIGNAL(timeout()),\
this,SLOT(show()));
connect(m_SoftTimer,SIGNAL(timeout()),\
this,SLOT(SoftTimeout()));
connect(DataDictionary::GetInstance(),SIGNAL(MisDataChange(MisDataIndex_t)),\
this,SLOT(MisDataChange(MisDataIndex_t)));
}
FaceIdTimeout::~FaceIdTimeout()
{
delete ui;
}
void FaceIdTimeout::showEvent(QShowEvent *event)
{
m_Cnt = 300;
ShowDecCnt();
m_DecTimer->start();
m_DelayTimer->stop();
}
void FaceIdTimeout::hideEvent(QHideEvent *event)
{
m_DecTimer->stop();
}
void FaceIdTimeout::on_StartDecButton_clicked()
{
DataDictionary::GetInstance()->SetMisData(MIS_FACEID_START,1);
DataDictionary::GetInstance()->SetMisData(MIS_FACEID_STA,0);
}
void FaceIdTimeout::UpdateCnt()
{
m_Cnt--;
if(m_Cnt == 0)
{
hide();
DataDictionary::GetInstance()->SetMisData(MIS_FACEID_QUITE,1);
}
ShowDecCnt();
}
void FaceIdTimeout::ShowDecCnt()
{
ui->Cnt->setText(QString().number(m_Cnt));
}
void FaceIdTimeout::on_DelayButton_clicked()
{
m_DelayTimer->start();
hide();
}
void FaceIdTimeout::MisDataChange(MisDataIndex_t Index)
{
switch (Index) {
case MIS_FACEID_STA:
case MIS_FACEID_TIMEOUT:
hide();
m_DelayTimer->stop();
if(DataDictionary::GetInstance()->GetMisData(MIS_FACEID_STA).toUInt() == 1)
{
SetSoftwareTimer(DataDictionary::GetInstance()->GetMisData(MIS_FACEID_TIMEOUT).toInt());
}
else if(DataDictionary::GetInstance()->GetMisData(MIS_FACEID_STA).toUInt() == 0){
SetSoftwareTimer(0);
}
break;
case MIS_BLKBOX_FACEID_INFO:
if(DataDictionary::GetInstance()->GetMisData(Index).toUInt() == 2){
m_DelayTimer->stop();
SoftTimeout();
}
break;
// SetSoftwareTimer(DataDictionary::GetInstance()->GetMisData(MIS_FACEID_TIMEOUT).toInt());
// break;
default:
break;
}
}
void FaceIdTimeout::SoftTimeout()
{
if(m_DelayTimer->isActive())
{
return ;
}
else
{
m_SoftTimer->stop();
this->show();
}
}
void FaceIdTimeout::SetSoftwareTimer(int32_t T)
{
m_SoftTimer->stop();
if(T > 0)
{
m_SoftTimer->setInterval(T * 1000);
m_SoftTimer->start();
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。