|
|
@@ -25,6 +25,9 @@ MainWindow::MainWindow(QWidget *parent)
|
|
|
HttpServer &httpServer = AppContext::instance().httpServer();
|
|
|
connect(&httpServer, &HttpServer::monitorConfigureUpdate, this, &MainWindow::onConfigureUpdate);
|
|
|
connect(&httpServer, &HttpServer::reloadCanvas, this, &MainWindow::onReloadCanvas);
|
|
|
+
|
|
|
+ DataFifo &dataFifo = AppContext::instance().dataFifo();
|
|
|
+ connect(&dataFifo, &DataFifo::updateScreen, this, &MainWindow::onUpdateScreen);
|
|
|
}
|
|
|
|
|
|
MainWindow::~MainWindow()
|
|
|
@@ -160,13 +163,15 @@ void MainWindow::onUpdateScreen(const QJsonObject &obj)
|
|
|
|
|
|
for(auto parameter : widgetParameters)
|
|
|
{
|
|
|
- QMetaObject::invokeMethod(
|
|
|
- pAbstractWidget,
|
|
|
- "setValue",
|
|
|
- Qt::AutoConnection,
|
|
|
- Q_ARG(QString, parameter),
|
|
|
- Q_ARG(QVariant, obj[parameter].toVariant()),
|
|
|
- Q_ARG(QString, Utils::timestamp()));
|
|
|
+ if(obj.contains(parameter)) {
|
|
|
+ QMetaObject::invokeMethod(
|
|
|
+ pAbstractWidget,
|
|
|
+ "setValue",
|
|
|
+ Qt::AutoConnection,
|
|
|
+ Q_ARG(QString, parameter),
|
|
|
+ Q_ARG(QVariant, obj[parameter].toVariant()),
|
|
|
+ Q_ARG(QString, Utils::timestamp()));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if(pCanvas == m_pStackedWidget->currentWidget()) {
|
|
|
@@ -177,7 +182,7 @@ void MainWindow::onUpdateScreen(const QJsonObject &obj)
|
|
|
}
|
|
|
|
|
|
qint64 duration = timer.elapsed(); // 获取经过的毫秒数
|
|
|
- LOG_DEBUG("update screen duration: {}ms", duration);
|
|
|
+ LOG_INFO("update screen duration: {}ms", duration);
|
|
|
}
|
|
|
|
|
|
void MainWindow::onPageSwitdh(int state)
|