mqtt,将companyCode改为可配置

This commit is contained in:
luoliangyi 2024-02-22 17:08:23 +08:00
parent f7a9c3f104
commit a86af9df1c
1 changed files with 6 additions and 2 deletions

View File

@ -398,7 +398,9 @@ MainWindow::MainWindow(const QString& appLang, QWidget *parent)
HGSaneDeviceCustomInfo custemInfo;
#endif
m_devUser->GetDeviceCustomInfo(&custemInfo);
mqtt_publish_device_properties(custemInfo.ip, custemInfo.driverVer, custemInfo.type, "HG");
std::string companyCode = getCfgValue("mqtt", "companyCode", QString("HG")).toStdString();
mqtt_publish_device_properties(custemInfo.ip, custemInfo.driverVer, custemInfo.type, companyCode.c_str());
m_wndStatusBar->setDeviceStatusInfo(tr("Device %1 is open").arg(m_devUser->GetName()), false);
connect(m_devUser, SIGNAL(newImage(void*)), this, SLOT(on_newImage(void*)), Qt::DirectConnection);
@ -4962,7 +4964,9 @@ void MainWindow::on_act_selectDevice_triggered()
HGSaneDeviceCustomInfo custemInfo;
#endif
m_devUser->GetDeviceCustomInfo(&custemInfo);
mqtt_publish_device_properties(custemInfo.ip, custemInfo.driverVer, custemInfo.type, "HG");
std::string companyCode = getCfgValue("mqtt", "companyCode", QString("HG")).toStdString();
mqtt_publish_device_properties(custemInfo.ip, custemInfo.driverVer, custemInfo.type, companyCode.c_str());
m_devUser->Login();
m_wndStatusBar->setDeviceStatusInfo(tr("Device %1 is open").arg(m_devUser->GetName()), false);