增加通讯协议
This commit is contained in:
+13
-9
@@ -1,7 +1,7 @@
|
||||
#include "selfcheck.h"
|
||||
#include "titlebar.h"
|
||||
#include "ledindicator.h"
|
||||
#include "udpcommunication.h"
|
||||
#include "car.h"
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QGridLayout>
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <QPushButton>
|
||||
#include <QProgressBar>
|
||||
#include <QTimer>
|
||||
#include <QMessageBox>
|
||||
#include "confirmdialog.h"
|
||||
#include "global.h"
|
||||
|
||||
SelfCheckPage::SelfCheckPage(AppContext* ctx, QWidget* parent)
|
||||
@@ -29,7 +29,7 @@ SelfCheckPage::SelfCheckPage(AppContext* ctx, QWidget* parent)
|
||||
main->setSpacing(40);
|
||||
|
||||
// 两侧按钮统一样式:字号在此统一调整;按钮会拉伸填满整列(sideBtnH 为最小高度)
|
||||
const int sideBtnH = 200;
|
||||
const int sideBtnH = 130;
|
||||
const QString sideBtnStyle = "font-size:60px;";
|
||||
auto makeSideBtn = [&](const QString& text, const QString& variant, QWidget* parent) {
|
||||
QPushButton* b = button(text, variant, parent);
|
||||
@@ -127,8 +127,8 @@ SelfCheckPage::SelfCheckPage(AppContext* ctx, QWidget* parent)
|
||||
root->addLayout(main, 1);
|
||||
|
||||
// 连接通信信号
|
||||
connect(ctx->comm(), &UdpCommunication::selfCheckItem, this, &SelfCheckPage::onSelfCheckItem);
|
||||
connect(ctx->comm(), &UdpCommunication::selfCheckDone, this, &SelfCheckPage::onSelfCheckDone);
|
||||
connect(ctx->comm(), &CarCommunication::selfCheckItem, this, &SelfCheckPage::onSelfCheckItem);
|
||||
connect(ctx->comm(), &CarCommunication::selfCheckDone, this, &SelfCheckPage::onSelfCheckDone);
|
||||
}
|
||||
|
||||
void SelfCheckPage::showEvent(QShowEvent* ev)
|
||||
@@ -200,12 +200,15 @@ void SelfCheckPage::onSelfCheckDone(bool allOk)
|
||||
m_status->setStyleSheet(QString("color:%1;font-size:60px;font-weight:700;").arg(C::SUCCESS));
|
||||
m_job->setEnabled(true);
|
||||
m_job->setFocus(); // 自检完成后聚焦到“作业选择”
|
||||
// 自检完成后停留在本界面,不自动跳转(需进入作业选择请手动点击)
|
||||
// 【设计建议】自检完成 2s 后自动进入作业选择
|
||||
// 自检完成 2s 后自动进入系统首页面(原目标为作业选择页)
|
||||
// QTimer::singleShot(2000, this, [this]() {
|
||||
// if (m_done && isVisible())
|
||||
// emit navigate(PageJob);
|
||||
// });
|
||||
QTimer::singleShot(2000, this, [this]() {
|
||||
if (m_done && isVisible())
|
||||
emit navigate(PageHome);
|
||||
});
|
||||
} else {
|
||||
m_status->setText("无法完成自检 请检查设备");
|
||||
m_status->setStyleSheet(QString("color:%1;font-size:60px;font-weight:700;").arg(C::DANGER));
|
||||
@@ -218,7 +221,8 @@ void SelfCheckPage::onSelfCheckDone(bool allOk)
|
||||
|
||||
void SelfCheckPage::onIgnoreFault()
|
||||
{
|
||||
emit navigate(PageJob);
|
||||
// emit navigate(PageJob); // 原:直接进作业选择页
|
||||
emit navigate(PageHome); // 忽略故障后进入系统首页面
|
||||
}
|
||||
|
||||
void SelfCheckPage::onJobSelect()
|
||||
@@ -228,7 +232,7 @@ void SelfCheckPage::onJobSelect()
|
||||
|
||||
void SelfCheckPage::onHelp()
|
||||
{
|
||||
QMessageBox::information(this, "操作说明",
|
||||
ConfirmDialog::message(this, "操作说明",
|
||||
"系统自检将依次检测:通信系统、底盘通信、机械臂通信、洗消通信、"
|
||||
"传感器信号、清水液位及电动球阀 D1/D2 的开启与关闭。\n"
|
||||
"全部正常后方可进入作业选择界面。");
|
||||
|
||||
Reference in New Issue
Block a user