121 lines
4.1 KiB
C++
121 lines
4.1 KiB
C++
#include "settingUiInfo.h"
|
||
#include <QDebug>
|
||
#include "UiConfig.h"
|
||
|
||
|
||
int settingUiInfo::m_pageIndex = 0;
|
||
settingUiInfo::settingUiInfo(int pageIndex, QWidget *parent)
|
||
: SettingUiPage(QVector<SettingUiPage::SetOpn>{
|
||
SetOpn(tr("设备编码"), "FTxxxxxxxxxxxx"),
|
||
SetOpn(tr("软件版本"), "FG_B020_V100R001Bxxx"),
|
||
SetOpn(tr("硬件配置"), "HWxxxxxxxxxxxxxx"),
|
||
SetOpn(tr("MAC地址"), "xx:xx:xx:xx:xx"),
|
||
SetOpn(tr("设备IP"), "xxx.xxx.xxx.xxx"),
|
||
SetOpn(tr("屏下NFC ID"), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),
|
||
SetOpn(tr("拓展NFC ID"), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),
|
||
SetOpn(tr("总容量(GB)"), "xx"),
|
||
SetOpn(tr("可用容量(GB)"), "x"),
|
||
SetOpn(tr("注册人数"), "xxxxx"),
|
||
SetOpn(tr("未上传通行记录"), "xxxxxx")
|
||
}, parent)
|
||
{
|
||
m_pageIndex = pageIndex;
|
||
qDebug() << "settingUiInfo()";
|
||
}
|
||
|
||
settingUiInfo::~settingUiInfo()
|
||
{
|
||
qDebug() << "~settingUiInfo()";
|
||
}
|
||
|
||
void settingUiInfo::setBackstageUiinterface(BackstageInterfaceForUi* interface)
|
||
{
|
||
m_backstageIf = interface;
|
||
reset();
|
||
}
|
||
|
||
void settingUiInfo::reset()
|
||
{
|
||
if(nullptr == m_backstageIf){
|
||
return;
|
||
}
|
||
for(int i = 0; i < config.size(); i ++)
|
||
{
|
||
QListWidgetItem* pItem = m_listWidget->item(i);
|
||
myListWidget* wdt = dynamic_cast<myListWidget*>(m_listWidget->itemWidget(pItem));
|
||
if(wdt == nullptr){
|
||
return;
|
||
}
|
||
QString str;
|
||
const int iBufSize = 64;
|
||
char buf[iBufSize] = {'\0'};
|
||
switch(i)
|
||
{
|
||
case INFO_CHECK_DEV_ID:qDebug() << "INFO_CHECK_DEV_ID";
|
||
if(0 == m_backstageIf->getDeviceId(buf, iBufSize)){
|
||
str = QString(buf);
|
||
}
|
||
break;
|
||
case INFO_CHECK_SOFT_VERSION:qDebug() << "INFO_CHECK_SOFT_VERSION";
|
||
if(0 == m_backstageIf->getAppVersion(buf, iBufSize)){
|
||
str = QString(buf);
|
||
}
|
||
break;
|
||
case INFO_CHECK_HARD_VERSION:qDebug() << "INFO_CHECK_HARD_VERSION";
|
||
if(0 == m_backstageIf->getHardwareConfig(buf, iBufSize)){
|
||
str = QString(buf);
|
||
}
|
||
break;
|
||
case INFO_CHECK_MAC:qDebug() << "INFO_CHECK_MAC";
|
||
if(0 == m_backstageIf->getEthMac(buf, iBufSize)){
|
||
str = QString(buf);
|
||
}
|
||
break;
|
||
case INFO_CHECK_IP:qDebug() << "INFO_CHECK_IP";
|
||
{
|
||
int type = 0;
|
||
if(0 == m_backstageIf->getIP(buf, iBufSize, type)){
|
||
str = QString(buf);
|
||
}
|
||
}
|
||
break;
|
||
case INFO_UNDER_SCREEN_NFC_MODULE_ID:qDebug() << "INFO_UNDER_SCREEN_NFC_MODULE_ID";
|
||
str = QString::fromStdString(m_backstageIf->getUnderScreenNfcModuleId());
|
||
break;
|
||
|
||
case INFO_EXTEND_NFC_MODULE_ID:qDebug() << "INFO_EXTEND_NFC_MODULE_ID";
|
||
str = QString::fromStdString(m_backstageIf->getExtendNfcModuleId());
|
||
break;
|
||
case INFO_CHECK_SPACE_TOTAL:qDebug() << "INFO_CHECK_SPACE_TOTAL";
|
||
{
|
||
float free = 0;
|
||
int total = 0;
|
||
if(0 == m_backstageIf->getStorSpace(total, free)){
|
||
str = QString::number(total);
|
||
}
|
||
}
|
||
break;
|
||
case INFO_CHECK_SPACE_FREE:qDebug() << "INFO_CHECK_SPACE_FREE";
|
||
{
|
||
float free = 0;
|
||
int total = 0;
|
||
if(0 == m_backstageIf->getStorSpace(total, free)){
|
||
str.setNum(free, 'f', 1);
|
||
}
|
||
}
|
||
break;
|
||
case INFO_CHECK_PERSON_REG:qDebug() << "INFO_CHECK_PERSON_REG";
|
||
str = QString::number(m_backstageIf->getRegisterNum());
|
||
break;
|
||
case INFO_CHECK_NOT_UP_ACC_RED_QTY:qDebug() << "INFO_CHECK_NOT_UP_ACC_RED_QTY";
|
||
str = QString::number(m_backstageIf->getAccessRecordNotUpload());
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
wdt->updateLabel(str);
|
||
}
|
||
}
|
||
|
||
|