feat: integrate NFC infrared peripherals and orchestration
This commit is contained in:
+24
-5
@@ -7013,6 +7013,8 @@ function renderExecution(result) {
|
||||
}
|
||||
const reportSucceeded = report.spec.status === "succeeded";
|
||||
const partiallySucceeded = result.status === "partially_succeeded";
|
||||
const peripheralRoute = String(result.orchestration_route || "")
|
||||
.startsWith("nfc_peripheral");
|
||||
summary.className = `execution-summary ${reportSucceeded ? "succeeded" : partiallySucceeded ? "partial" : "failed"}`;
|
||||
const presetSave = Boolean(result.preset_config);
|
||||
const modeSave = Boolean(result.mode_profile);
|
||||
@@ -7056,6 +7058,9 @@ function renderExecution(result) {
|
||||
if (result.deferred_requests?.length) {
|
||||
executionDetail += ";未接入域请求已保留为 deferred request";
|
||||
}
|
||||
if (peripheralRoute && operationResults[0]?.message) {
|
||||
executionDetail = result.sequence_summary || operationResults[0].message;
|
||||
}
|
||||
if (!reportSucceeded && !partiallySucceeded) {
|
||||
const failure = report.spec.results.find((item) => item.status === "failed");
|
||||
const failureTelemetry = failure?.telemetry || {};
|
||||
@@ -7078,7 +7083,8 @@ function renderExecution(result) {
|
||||
: failure?.message || "真实台架未返回满足目标的物理反馈。";
|
||||
}
|
||||
const executionTitle = reportSucceeded
|
||||
? modeSave ? "长期模式已保存"
|
||||
? peripheralRoute ? (mqttPublishedUnconfirmed ? "外设指令已发布" : "外设动作已执行")
|
||||
: modeSave ? "长期模式已保存"
|
||||
: presetSave ? "姿态预设已保存"
|
||||
: simulatedHil ? "模拟台架执行成功"
|
||||
: physical
|
||||
@@ -7091,8 +7097,12 @@ function renderExecution(result) {
|
||||
: partiallySucceeded ? "circle-alert" : "circle-x";
|
||||
summary.innerHTML = `<i data-lucide="${executionIcon}"></i><div><strong>${executionTitle}</strong><span>${executionDetail}</span></div>`;
|
||||
$("#resultNavMeta").textContent = reportSucceeded
|
||||
? mqttPublishedUnconfirmed
|
||||
? `${mqttSubmittedOperations.length} 项已提交 · MQTT`
|
||||
? peripheralRoute
|
||||
? result.sequence
|
||||
? `${result.peripheral?.name || "第三方外设"} · ${result.sequence.action_count} 项动作 / ${result.sequence.total_delay_ms / 1000} 秒`
|
||||
: `${result.peripheral?.name || "第三方外设"} · IR SLOT ${result.peripheral?.slot ?? "--"}`
|
||||
: mqttPublishedUnconfirmed
|
||||
? `${mqttSubmittedOperations.length} 项已提交 · MQTT`
|
||||
: `${report.spec.results.length} 项完成 · ${simulatedHil ? "SIM-HIL" : physical ? "HIL" : "DRY-RUN"}`
|
||||
: partiallySucceeded ? `${succeededOperations.length} 项成功 / ${failedOperations.length} 项失败 · 查看明细`
|
||||
: "执行失败 · 查看回读";
|
||||
@@ -7281,8 +7291,13 @@ function renderResult(result) {
|
||||
climate: "空调",
|
||||
roof: "天幕",
|
||||
ambient_light: "氛围灯",
|
||||
self_extension: "第三方外设",
|
||||
};
|
||||
$("#resultTitle").textContent = partiallySucceeded
|
||||
const peripheralRoute = String(result.orchestration_route || "")
|
||||
.startsWith("nfc_peripheral");
|
||||
$("#resultTitle").textContent = peripheralRoute && executionSucceeded
|
||||
? `${result.peripheral?.name || "第三方外设"} · ${result.peripheral?.action || "动作已执行"}`
|
||||
: partiallySucceeded
|
||||
? `${domains.length} 域场景部分完成`
|
||||
: executionSucceeded
|
||||
? result.mode_profile
|
||||
@@ -7563,7 +7578,9 @@ async function submitRequest(event) {
|
||||
}
|
||||
renderResult(payload);
|
||||
completedResult = payload;
|
||||
if (state.executionMode === "hardware") {
|
||||
const peripheralRoute = String(payload.orchestration_route || "")
|
||||
.startsWith("nfc_peripheral");
|
||||
if (state.executionMode === "hardware" && !peripheralRoute) {
|
||||
await synchronizePhysicalSeatState();
|
||||
}
|
||||
const completed = ["succeeded", "partially_succeeded"].includes(payload.status);
|
||||
@@ -7575,6 +7592,8 @@ async function submitRequest(event) {
|
||||
showToast(supplementWarning || (completed
|
||||
? (payload.mode_profile
|
||||
? `${payload.mode_profile.name}已创建并添加到功能模式`
|
||||
: peripheralRoute
|
||||
? `${payload.peripheral?.name || "第三方外设"} · ${payload.peripheral?.action || "动作"}指令已发送`
|
||||
: payload.status === "partially_succeeded"
|
||||
? "已执行可用设备;部分设备未完成,详见执行结果"
|
||||
: simulated
|
||||
|
||||
Reference in New Issue
Block a user