|
@@ -183,27 +183,42 @@ public:
|
|
|
: QDialog(parent)
|
|
: QDialog(parent)
|
|
|
{
|
|
{
|
|
|
setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
|
|
setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
|
|
|
- setAttribute(Qt::WA_TranslucentBackground); // 圆角外留白要透出底下的界面
|
|
|
|
|
|
|
+#ifndef Q_OS_LINUX
|
|
|
|
|
+ setAttribute(Qt::WA_TranslucentBackground); // 圆角外留白要透出底下的界面(Windows DWM 始终合成)
|
|
|
|
|
+#endif
|
|
|
setWindowTitle(title.isEmpty() ? (ok ? QStringLiteral("设置成功") : QStringLiteral("设置失败"))
|
|
setWindowTitle(title.isEmpty() ? (ok ? QStringLiteral("设置成功") : QStringLiteral("设置失败"))
|
|
|
: title);
|
|
: title);
|
|
|
setFixedWidth(detail.isEmpty() ? 360 : 420);
|
|
setFixedWidth(detail.isEmpty() ? 360 : 420);
|
|
|
|
|
|
|
|
QVBoxLayout *outer = new QVBoxLayout(this);
|
|
QVBoxLayout *outer = new QVBoxLayout(this);
|
|
|
|
|
+#ifdef Q_OS_LINUX
|
|
|
|
|
+ outer->setContentsMargins(0, 0, 0, 0); // Linux VNC/Xvfb 无窗口合成器时 WA_TranslucentBackground 会发黑
|
|
|
|
|
+#else
|
|
|
outer->setContentsMargins(24, 24, 24, 24); // 给阴影留出绘制空间
|
|
outer->setContentsMargins(24, 24, 24, 24); // 给阴影留出绘制空间
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
QFrame *card = new QFrame(this);
|
|
QFrame *card = new QFrame(this);
|
|
|
card->setObjectName(QStringLiteral("toastCard"));
|
|
card->setObjectName(QStringLiteral("toastCard"));
|
|
|
|
|
+#ifdef Q_OS_LINUX
|
|
|
|
|
+ card->setStyleSheet(QStringLiteral(
|
|
|
|
|
+ "QFrame#toastCard { background: #ffffff; border: 1px solid #b9cae0; border-radius: 0px; }"
|
|
|
|
|
+ "QLabel#toastTitle { color: #20323f; font-size: 19px; font-weight: 600; }"
|
|
|
|
|
+ "QLabel#toastDetail { color: #5b7183; font-size: 15px; }"));
|
|
|
|
|
+#else
|
|
|
card->setStyleSheet(QStringLiteral(
|
|
card->setStyleSheet(QStringLiteral(
|
|
|
"QFrame#toastCard { background: #ffffff; border: 1px solid #d3dde9; border-radius: 10px; }"
|
|
"QFrame#toastCard { background: #ffffff; border: 1px solid #d3dde9; border-radius: 10px; }"
|
|
|
"QLabel#toastTitle { color: #20323f; font-size: 19px; font-weight: 600; }"
|
|
"QLabel#toastTitle { color: #20323f; font-size: 19px; font-weight: 600; }"
|
|
|
"QLabel#toastDetail { color: #5b7183; font-size: 15px; }"));
|
|
"QLabel#toastDetail { color: #5b7183; font-size: 15px; }"));
|
|
|
|
|
+#endif
|
|
|
outer->addWidget(card);
|
|
outer->addWidget(card);
|
|
|
|
|
|
|
|
|
|
+#ifndef Q_OS_LINUX
|
|
|
QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(card);
|
|
QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(card);
|
|
|
shadow->setBlurRadius(32);
|
|
shadow->setBlurRadius(32);
|
|
|
shadow->setOffset(0, 8);
|
|
shadow->setOffset(0, 8);
|
|
|
shadow->setColor(QColor(31, 56, 82, 95));
|
|
shadow->setColor(QColor(31, 56, 82, 95));
|
|
|
card->setGraphicsEffect(shadow);
|
|
card->setGraphicsEffect(shadow);
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
QVBoxLayout *body = new QVBoxLayout(card);
|
|
QVBoxLayout *body = new QVBoxLayout(card);
|
|
|
body->setContentsMargins(24, 22, 24, 18);
|
|
body->setContentsMargins(24, 22, 24, 18);
|
|
@@ -432,24 +447,42 @@ MainWindow::MainWindow(QWidget *parent)
|
|
|
connect(m_backend, &BackendLink::stateArrived, this, [this](int station, const QJsonObject &st) {
|
|
connect(m_backend, &BackendLink::stateArrived, this, [this](int station, const QJsonObject &st) {
|
|
|
m_store->applyBackendState(station, st);
|
|
m_store->applyBackendState(station, st);
|
|
|
|
|
|
|
|
- // 按钮状态只由本地点击决定,不从后端同步:开屏一律「开始测试」,
|
|
|
|
|
- // 点了才变「重新开始」并下发 StartTest(运行过程中允许再次点击直接重跑)。
|
|
|
|
|
- // 现场口径:后端收到 StartTest 会立刻复位主机重跑本轮,界面不需要替它判断能不能跑。
|
|
|
|
|
- // 万一后端真的拒了,startTestReplied 会把按钮退回「开始测试」并写明原因。
|
|
|
|
|
- // 下面这段只负责把跑完的工位复位——且必须分清是「本轮跑完」还是「还没起跑的旧 idle」。
|
|
|
|
|
const QString runState = st.value(QStringLiteral("run_state")).toString();
|
|
const QString runState = st.value(QStringLiteral("run_state")).toString();
|
|
|
|
|
+ const QString bootId = st.value(QStringLiteral("boot_id")).toString();
|
|
|
|
|
+ const QString phase = st.value(QStringLiteral("phase")).toString();
|
|
|
|
|
+ const qint64 startedMs = m_store->station(station).backendStartedMs;
|
|
|
|
|
+ if (m_awaitingNewStart[station]) {
|
|
|
|
|
+ const bool earlyStage = (phase == QLatin1String("boot")
|
|
|
|
|
+ || phase == QLatin1String("uip")
|
|
|
|
|
+ || phase == QLatin1String("uip1")
|
|
|
|
|
+ || phase == QLatin1String("training")
|
|
|
|
|
+ || phase == QLatin1String("powered_off"));
|
|
|
|
|
+ const bool bootChanged = (!bootId.isEmpty() && bootId != m_waitOldBootId[station]);
|
|
|
|
|
+ const bool startChanged = (startedMs > 0 && startedMs != m_waitOldStartedMs[station]);
|
|
|
|
|
+ const bool graceElapsed = (!m_clickTimer[station].isValid()
|
|
|
|
|
+ || m_clickTimer[station].elapsed() > 5000);
|
|
|
|
|
+ if (bootChanged || startChanged || earlyStage || graceElapsed) {
|
|
|
|
|
+ m_awaitingNewStart[station] = false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ m_overview->setStartRunning(station, m_startClicked[station] || m_backendRunning[station]);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const bool running = (runState == QStringLiteral("starting")
|
|
const bool running = (runState == QStringLiteral("starting")
|
|
|
|| runState == QStringLiteral("running")
|
|
|| runState == QStringLiteral("running")
|
|
|
|| runState == QStringLiteral("waiting_input"));
|
|
|| runState == QStringLiteral("waiting_input"));
|
|
|
|
|
|
|
|
- // 后端运行态:见到 starting/running/waiting_input 就记住,completed/failed 才清。
|
|
|
|
|
- // 这样网页端 / 其他客户端发起的测试,本机也显示「执行中」;
|
|
|
|
|
|
|
+ // 后端运行态:见到 starting/running/waiting_input 就记住,终态(completed/failed/stopped/interrupted/aborted/error/timeout/blocked)才清。
|
|
|
|
|
+ // 这样网页端 / 其他客户端发起的测试或重开软件时,本机按钮也能正确同步为运行态;
|
|
|
// 主机复位过程中短暂回到 idle 也不会让按钮闪回「开始测试」。
|
|
// 主机复位过程中短暂回到 idle 也不会让按钮闪回「开始测试」。
|
|
|
- // 手册 9.2:run_state 新增 blocked(阶段 FAIL 后的换条停机挂起),
|
|
|
|
|
- // 同样算本轮终态,要停表 / 复位按钮,但队列由 finishCurrentTask 决定是否中止。
|
|
|
|
|
const bool terminal = (runState == QStringLiteral("completed")
|
|
const bool terminal = (runState == QStringLiteral("completed")
|
|
|
|| runState == QStringLiteral("failed")
|
|
|| runState == QStringLiteral("failed")
|
|
|
|| runState == QStringLiteral("interrupted")
|
|
|| runState == QStringLiteral("interrupted")
|
|
|
|
|
+ || runState == QStringLiteral("stopped")
|
|
|
|
|
+ || runState == QStringLiteral("aborted")
|
|
|
|
|
+ || runState == QStringLiteral("error")
|
|
|
|
|
+ || runState == QStringLiteral("timeout")
|
|
|
|| runState == QStringLiteral("blocked"));
|
|
|| runState == QStringLiteral("blocked"));
|
|
|
if (running) {
|
|
if (running) {
|
|
|
if (!m_backendRunning[station]) {
|
|
if (!m_backendRunning[station]) {
|
|
@@ -518,8 +551,32 @@ MainWindow::MainWindow(QWidget *parent)
|
|
|
.arg(taskName).arg(targetTemp));
|
|
.arg(taskName).arg(targetTemp));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (terminal && !waitingInitialRun)
|
|
|
|
|
|
|
+ const StationData stNow = m_store->station(station);
|
|
|
|
|
+ const bool hostPhaseActive =
|
|
|
|
|
+ (stNow.phase == QLatin1String("boot")
|
|
|
|
|
+ || stNow.phase == QLatin1String("booting")
|
|
|
|
|
+ || stNow.phase == QLatin1String("uip")
|
|
|
|
|
+ || stNow.phase == QLatin1String("uip1")
|
|
|
|
|
+ || stNow.phase == QLatin1String("uip2")
|
|
|
|
|
+ || stNow.phase == QLatin1String("training")
|
|
|
|
|
+ || stNow.phase == QLatin1String("rmt")
|
|
|
|
|
+ || stNow.phase == QLatin1String("amt")
|
|
|
|
|
+ || stNow.phase == QLatin1String("post")
|
|
|
|
|
+ || stNow.phase == QLatin1String("uefi")
|
|
|
|
|
+ || stNow.phase == QLatin1String("mt"));
|
|
|
|
|
+ const bool hostStillActive =
|
|
|
|
|
+ hostPhaseActive
|
|
|
|
|
+ && (stNow.connection == QLatin1String("online") || stNow.consoleOnline == 1)
|
|
|
|
|
+ && st.value(QStringLiteral("power")).toString() != QLatin1String("off");
|
|
|
|
|
+ const bool restartClick = m_backend->lastStartWasRestart(station);
|
|
|
|
|
+ const bool idleSettled = !restartClick || m_clickTimer[station].elapsed() > 60000;
|
|
|
|
|
+
|
|
|
|
|
+ if ((terminal
|
|
|
|
|
+ || (runState == QLatin1String("idle") && !hostStillActive
|
|
|
|
|
+ && (!m_startClicked[station] || idleSettled)))
|
|
|
|
|
+ && !waitingInitialRun) {
|
|
|
m_backendRunning[station] = false;
|
|
m_backendRunning[station] = false;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 终态冻结已由后端 ended_unix_ms / elapsed_ms 权威控制,前端不再私自停表或重置。
|
|
// 终态冻结已由后端 ended_unix_ms / elapsed_ms 权威控制,前端不再私自停表或重置。
|
|
|
|
|
|
|
@@ -531,16 +588,18 @@ MainWindow::MainWindow(QWidget *parent)
|
|
|
//
|
|
//
|
|
|
// 「跑着的时候点重新开始」还有一层坑:主机复位过程中后端会短暂回到 idle,
|
|
// 「跑着的时候点重新开始」还有一层坑:主机复位过程中后端会短暂回到 idle,
|
|
|
// 那并不代表本轮结束。所以这种情况下的 idle 要等一分钟再认,
|
|
// 那并不代表本轮结束。所以这种情况下的 idle 要等一分钟再认,
|
|
|
- // 否则按钮会在新一轮刚开始时闪回「开始测试」,用户以为没起来又点一次。
|
|
|
|
|
- const bool restartClick = m_backend->lastStartWasRestart(station);
|
|
|
|
|
- const bool idleSettled = !restartClick || m_clickTimer[station].elapsed() > 60000;
|
|
|
|
|
|
|
+ // 且当主机在线并仍处于测试阶段(boot/training/amt/mt 等)时,禁止将 idle 误判为测试结束。
|
|
|
bool finished = (!waitingInitialRun
|
|
bool finished = (!waitingInitialRun
|
|
|
&& (runState == QStringLiteral("completed")
|
|
&& (runState == QStringLiteral("completed")
|
|
|
|| runState == QStringLiteral("failed")
|
|
|| runState == QStringLiteral("failed")
|
|
|
|| runState == QStringLiteral("interrupted")
|
|
|| runState == QStringLiteral("interrupted")
|
|
|
|
|
+ || runState == QStringLiteral("stopped")
|
|
|
|
|
+ || runState == QStringLiteral("aborted")
|
|
|
|
|
+ || runState == QStringLiteral("error")
|
|
|
|
|
+ || runState == QStringLiteral("timeout")
|
|
|
|| runState == QStringLiteral("blocked")))
|
|
|| runState == QStringLiteral("blocked")))
|
|
|
|| (runState == QStringLiteral("idle") && m_sawRunning[station]
|
|
|| (runState == QStringLiteral("idle") && m_sawRunning[station]
|
|
|
- && idleSettled);
|
|
|
|
|
|
|
+ && idleSettled && !hostStillActive);
|
|
|
// 多任务队列还没跑完(后面还有任务在等着发):按钮保持「执行中」,不要复位
|
|
// 多任务队列还没跑完(后面还有任务在等着发):按钮保持「执行中」,不要复位
|
|
|
if (m_taskIndex[station] >= 0 && m_taskIndex[station] < m_taskQueue[station].size())
|
|
if (m_taskIndex[station] >= 0 && m_taskIndex[station] < m_taskQueue[station].size())
|
|
|
finished = false;
|
|
finished = false;
|
|
@@ -572,10 +631,8 @@ MainWindow::MainWindow(QWidget *parent)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 按钮只由「本机点过开始测试」决定:每次打开软件一律显示「开始测试」,
|
|
|
|
|
- // 不继承后端推来的上一轮运行态(开屏不能残留上次的「执行中」)。
|
|
|
|
|
- // 后端在跑、网页端发起的测试都不改本机按钮,现场口径由本地点击驱动。
|
|
|
|
|
- m_overview->setStartRunning(station, m_startClicked[station]);
|
|
|
|
|
|
|
+ // 按钮状态同步本地点击与后端实际运行态:重开软件、网页端启动或后端停机都能一致反映。
|
|
|
|
|
+ m_overview->setStartRunning(station, m_startClicked[station] || m_backendRunning[station]);
|
|
|
});
|
|
});
|
|
|
// StartTest 被后端拒掉 / 命令失败:立刻把「执行中」退回「开始测试」并写明原因。
|
|
// StartTest 被后端拒掉 / 命令失败:立刻把「执行中」退回「开始测试」并写明原因。
|
|
|
// 少了这一步,按钮只能等 20 s 兜底才复位,现场看起来就是「点了没反应、
|
|
// 少了这一步,按钮只能等 20 s 兜底才复位,现场看起来就是「点了没反应、
|
|
@@ -612,7 +669,11 @@ MainWindow::MainWindow(QWidget *parent)
|
|
|
return;
|
|
return;
|
|
|
const bool terminalTask = (taskStatus == QStringLiteral("completed")
|
|
const bool terminalTask = (taskStatus == QStringLiteral("completed")
|
|
|
|| taskStatus == QStringLiteral("failed")
|
|
|| taskStatus == QStringLiteral("failed")
|
|
|
- || taskStatus == QStringLiteral("interrupted"));
|
|
|
|
|
|
|
+ || taskStatus == QStringLiteral("interrupted")
|
|
|
|
|
+ || taskStatus == QStringLiteral("stopped")
|
|
|
|
|
+ || taskStatus == QStringLiteral("aborted")
|
|
|
|
|
+ || taskStatus == QStringLiteral("error")
|
|
|
|
|
+ || taskStatus == QStringLiteral("timeout"));
|
|
|
if (complete && terminalTask) {
|
|
if (complete && terminalTask) {
|
|
|
// completed 命令回执可能先于 task_complete(其中才带 verdict / stage_completions)。
|
|
// completed 命令回执可能先于 task_complete(其中才带 verdict / stage_completions)。
|
|
|
// 若当前还没有任何 verdict,先等权威事件;旧后端没有该事件时仍由 state 终态兜底。
|
|
// 若当前还没有任何 verdict,先等权威事件;旧后端没有该事件时仍由 state 终态兜底。
|
|
@@ -644,6 +705,33 @@ MainWindow::MainWindow(QWidget *parent)
|
|
|
if (m_overview)
|
|
if (m_overview)
|
|
|
m_overview->setBackendOnline(connected);
|
|
m_overview->setBackendOnline(connected);
|
|
|
});
|
|
});
|
|
|
|
|
+ connect(m_backend, &BackendLink::serverRestarted, this, [this]() {
|
|
|
|
|
+ for (int i = 0; i < m_store->count(); ++i) {
|
|
|
|
|
+ if (m_nextTaskTimer[i] && m_nextTaskTimer[i]->isActive())
|
|
|
|
|
+ m_nextTaskTimer[i]->stop();
|
|
|
|
|
+ const bool wasActive = m_startClicked[i] || m_backendRunning[i];
|
|
|
|
|
+ m_startClicked[i] = false;
|
|
|
|
|
+ m_sawRunning[i] = false;
|
|
|
|
|
+ m_backendRunning[i] = false;
|
|
|
|
|
+ m_endCmdSent[i] = false;
|
|
|
|
|
+ m_endSignalReceived[i] = false;
|
|
|
|
|
+ m_terminalSince[i].invalidate();
|
|
|
|
|
+ m_taskCompleteVerdict[i].clear();
|
|
|
|
|
+ m_tempSent[i] = false;
|
|
|
|
|
+ m_awaitingNewStart[i] = false;
|
|
|
|
|
+ m_taskAdvanceGuard[i] = false;
|
|
|
|
|
+ if (m_taskIndex[i] >= 0) {
|
|
|
|
|
+ m_taskFailed[i] = m_taskIndex[i];
|
|
|
|
|
+ m_store->setTaskProgress(i, m_taskIndex[i], -1, m_taskFailed[i]);
|
|
|
|
|
+ m_taskIndex[i] = -1;
|
|
|
|
|
+ m_taskQueue[i] = QJsonArray();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (m_overview)
|
|
|
|
|
+ m_overview->setStartRunning(i, false);
|
|
|
|
|
+ if (wasActive)
|
|
|
|
|
+ m_store->appendLog(i, QStringLiteral("[qt] 后端实例已重启,本机运行态与任务队列已复位"));
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
setupDetail();
|
|
setupDetail();
|
|
|
setupCom();
|
|
setupCom();
|
|
@@ -787,6 +875,9 @@ void MainWindow::startTest(int index)
|
|
|
|
|
|
|
|
// 新一轮点击「开始测试」时先清显示为 00:00:00,等待后端下发新起点 started_unix_ms / elapsed_ms。
|
|
// 新一轮点击「开始测试」时先清显示为 00:00:00,等待后端下发新起点 started_unix_ms / elapsed_ms。
|
|
|
m_store->resetBackendTiming(index);
|
|
m_store->resetBackendTiming(index);
|
|
|
|
|
+ m_waitOldBootId[index] = m_store->station(index).bootId;
|
|
|
|
|
+ m_waitOldStartedMs[index] = m_store->station(index).backendStartedMs;
|
|
|
|
|
+ m_awaitingNewStart[index] = true;
|
|
|
m_backendRunning[index] = false; // 本次 StartTest 是新一轮,等待后端重新进入运行态
|
|
m_backendRunning[index] = false; // 本次 StartTest 是新一轮,等待后端重新进入运行态
|
|
|
m_endCmdSent[index] = false;
|
|
m_endCmdSent[index] = false;
|
|
|
m_endSignalReceived[index] = false;
|
|
m_endSignalReceived[index] = false;
|
|
@@ -905,7 +996,11 @@ bool MainWindow::backendRoundFailed(int station, const QString &stateOrStatus) c
|
|
|
if (station < 0 || station >= m_store->count())
|
|
if (station < 0 || station >= m_store->count())
|
|
|
return false;
|
|
return false;
|
|
|
if (stateOrStatus == QStringLiteral("failed")
|
|
if (stateOrStatus == QStringLiteral("failed")
|
|
|
- || stateOrStatus == QStringLiteral("interrupted"))
|
|
|
|
|
|
|
+ || stateOrStatus == QStringLiteral("interrupted")
|
|
|
|
|
+ || stateOrStatus == QStringLiteral("stopped")
|
|
|
|
|
+ || stateOrStatus == QStringLiteral("aborted")
|
|
|
|
|
+ || stateOrStatus == QStringLiteral("error")
|
|
|
|
|
+ || stateOrStatus == QStringLiteral("timeout"))
|
|
|
return true;
|
|
return true;
|
|
|
// 0.8.1.19:training / rmt / amt / mt 任一阶段 FAIL 时,后端可能把本轮
|
|
// 0.8.1.19:training / rmt / amt / mt 任一阶段 FAIL 时,后端可能把本轮
|
|
|
// task_status 报成 completed(阶段完整跑完、但结论是 fail)。这种情况同样
|
|
// task_status 报成 completed(阶段完整跑完、但结论是 fail)。这种情况同样
|
|
@@ -1059,6 +1154,9 @@ void MainWindow::startNextTask(int station)
|
|
|
// 多任务同一批次延续后端总计时,不清空计时显示,也不重算 started_unix_ms;只清本任务日志与异常记录
|
|
// 多任务同一批次延续后端总计时,不清空计时显示,也不重算 started_unix_ms;只清本任务日志与异常记录
|
|
|
m_store->clearLogs(station);
|
|
m_store->clearLogs(station);
|
|
|
m_store->clearAlarms(station);
|
|
m_store->clearAlarms(station);
|
|
|
|
|
+ m_waitOldBootId[station] = m_store->station(station).bootId;
|
|
|
|
|
+ m_waitOldStartedMs[station] = m_store->station(station).backendStartedMs;
|
|
|
|
|
+ m_awaitingNewStart[station] = true;
|
|
|
m_backendRunning[station] = false; // 新任务开始,重新识别运行态切换
|
|
m_backendRunning[station] = false; // 新任务开始,重新识别运行态切换
|
|
|
m_tempSent[station] = false;
|
|
m_tempSent[station] = false;
|
|
|
m_endCmdSent[station] = false;
|
|
m_endCmdSent[station] = false;
|
|
@@ -1313,6 +1411,9 @@ void MainWindow::showCreateTask()
|
|
|
if (!m_backend->isConnected())
|
|
if (!m_backend->isConnected())
|
|
|
return false;
|
|
return false;
|
|
|
const StationData &d = m_store->station(station);
|
|
const StationData &d = m_store->station(station);
|
|
|
|
|
+ if (d.connection == QLatin1String("online")
|
|
|
|
|
+ && d.phase == QLatin1String("powered_off"))
|
|
|
|
|
+ return true;
|
|
|
if (d.consoleOnline == 0)
|
|
if (d.consoleOnline == 0)
|
|
|
return false;
|
|
return false;
|
|
|
if (d.consoleOnline == 1)
|
|
if (d.consoleOnline == 1)
|
|
@@ -1392,13 +1493,20 @@ void MainWindow::setupCom()
|
|
|
connect(m_com, &ComManager::ctRawArrived, this, [this](int index, const QByteArray &raw) {
|
|
connect(m_com, &ComManager::ctRawArrived, this, [this](int index, const QByteArray &raw) {
|
|
|
m_store->applyCtTemperatures(index, raw);
|
|
m_store->applyCtTemperatures(index, raw);
|
|
|
});
|
|
});
|
|
|
- // 24 通道内存条温度已改为从后端 state 推送的 channels[i].temperature_c 获取
|
|
|
|
|
- // (见 StationStore::applyBackendState),本地 MCU 串口 0x82 的 24 路温度不再写进 UI。
|
|
|
|
|
- // MCU 温控框架与高温罩目标温度下发(setTargetTemp / targetTempSent / targetTempReplied)全部保留。
|
|
|
|
|
- // 如需回退到 MCU 串口来源:取消下面这段注释即可恢复连接。
|
|
|
|
|
- // connect(m_com, &ComManager::channelRawArrived, this, [this](int index, const QByteArray &raw) {
|
|
|
|
|
- // m_store->applyChannelTemperatures(index, raw);
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+ // 24 路内存条温度双源接入:有后端 channels[i].temperature_c 时按后端精确浮点和在位状态显示,
|
|
|
|
|
+ // 后端未上送有效值且 MCU 0x82 有新鲜有效字节(3 秒内 != 0xFF)时自动补位(并支持 DDR5_DEBUG_TEMP 排查)。
|
|
|
|
|
+ connect(m_com, &ComManager::channelRawArrived, this, [this](int index, const QByteArray &raw) {
|
|
|
|
|
+ m_store->applyChannelTemperatures(index, raw);
|
|
|
|
|
+ if (qEnvironmentVariableIsSet("DDR5_DEBUG_TEMP")) {
|
|
|
|
|
+ QStringList vals;
|
|
|
|
|
+ vals.reserve(raw.size());
|
|
|
|
|
+ for (int i = 0; i < raw.size(); ++i) {
|
|
|
|
|
+ const quint8 b = static_cast<quint8>(raw.at(i));
|
|
|
|
|
+ vals << (b == 0xFF ? QStringLiteral("--") : QString::number(b));
|
|
|
|
|
+ }
|
|
|
|
|
+ qInfo().noquote() << "[temp]" << index << vals.join(QLatin1Char(' '));
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
// 目标温度下发:帧发没发出去、设备收没收,都写进该工位的日志,现场能直接看到
|
|
// 目标温度下发:帧发没发出去、设备收没收,都写进该工位的日志,现场能直接看到
|
|
|
connect(m_com, &ComManager::targetTempSent, this, [this](int index, int celsius, bool ok) {
|
|
connect(m_com, &ComManager::targetTempSent, this, [this](int index, int celsius, bool ok) {
|