推进 INI 面板 run readiness workflow helper
This commit is contained in:
@@ -4,6 +4,7 @@ export function createIniPanelStateSummary({
|
||||
machineFiles = null,
|
||||
sessionSnapshot = null,
|
||||
sessionLoad = null,
|
||||
runReadiness = null,
|
||||
run = null,
|
||||
fiveaxisRemap = null,
|
||||
} = {}) {
|
||||
@@ -17,6 +18,7 @@ export function createIniPanelStateSummary({
|
||||
machineFiles,
|
||||
sessionSnapshot,
|
||||
sessionLoad,
|
||||
runReadiness,
|
||||
run,
|
||||
fiveaxisRemap: fiveaxisRemap ?? null,
|
||||
};
|
||||
@@ -28,6 +30,7 @@ export function createMachineSessionStateSnapshot({
|
||||
machineFiles = null,
|
||||
sessionSnapshot = null,
|
||||
sessionLoad = null,
|
||||
runReadiness = null,
|
||||
selectedProgram = null,
|
||||
run = null,
|
||||
fields = {},
|
||||
@@ -42,6 +45,7 @@ export function createMachineSessionStateSnapshot({
|
||||
machineFiles,
|
||||
sessionSnapshot,
|
||||
sessionLoad,
|
||||
runReadiness,
|
||||
run,
|
||||
fiveaxisRemap,
|
||||
}),
|
||||
@@ -69,6 +73,7 @@ export function createMachineSessionStateReport(state = {}) {
|
||||
const fields = state.fields ?? {};
|
||||
const sessionSnapshot = state.sessionSnapshot ?? {};
|
||||
const sessionLoad = state.sessionLoad ?? {};
|
||||
const runReadiness = state.runReadiness ?? {};
|
||||
const selectedProgram = state.selectedProgram ?? {};
|
||||
const run = state.run ?? {};
|
||||
return {
|
||||
@@ -95,6 +100,17 @@ export function createMachineSessionStateReport(state = {}) {
|
||||
opfsPath: selectedProgram.opfsPath ?? run.programOpfsPath ?? fields.runOpfsPath ?? null,
|
||||
wasmPath: selectedProgram.wasmPath ?? run.programWasmPath ?? fields.runWasmPath ?? null,
|
||||
},
|
||||
runReadiness: {
|
||||
phase: runReadiness.phase ?? null,
|
||||
canRun: Boolean(runReadiness.canRun),
|
||||
missing: Array.isArray(runReadiness.missing) ? runReadiness.missing : [],
|
||||
buttonEnabled: Boolean(runReadiness.runButton?.enabled),
|
||||
buttonReason: runReadiness.runButton?.reason ?? null,
|
||||
programSource: runReadiness.program?.source ?? null,
|
||||
programOpfsPath: runReadiness.program?.opfsPath ?? null,
|
||||
programWasmPath: runReadiness.program?.wasmPath ?? null,
|
||||
iniWasmPath: runReadiness.loadedSession?.iniWasmPath ?? null,
|
||||
},
|
||||
run: {
|
||||
status: run.runStatus ?? fields.runStatus ?? null,
|
||||
canonicalEventCount: run.canonicalEventCount ?? 0,
|
||||
@@ -123,6 +139,7 @@ export function createMachineSessionWorkflowStatus(state = {}) {
|
||||
const report = createMachineSessionStateReport(state);
|
||||
return {
|
||||
readiness: report.readiness,
|
||||
runReadiness: report.runReadiness,
|
||||
lastAction: report.status.lastAction,
|
||||
error: report.status.error,
|
||||
session: report.session,
|
||||
@@ -145,6 +162,7 @@ export function createMachineSessionControlView(bundle = {}) {
|
||||
const report = bundle.report ?? {};
|
||||
const workflowStatus = bundle.workflowStatus ?? {};
|
||||
const session = workflowStatus.session ?? report.session ?? {};
|
||||
const runReadiness = workflowStatus.runReadiness ?? report.runReadiness ?? {};
|
||||
const run = workflowStatus.run ?? report.run ?? {};
|
||||
return {
|
||||
status: {
|
||||
@@ -176,6 +194,8 @@ export function createMachineSessionControlView(bundle = {}) {
|
||||
id: "run",
|
||||
title: "Run",
|
||||
rows: [
|
||||
{ label: "Ready", value: runReadiness.phase ?? null },
|
||||
{ label: "Button", value: runReadiness.buttonEnabled ? "enabled" : "disabled" },
|
||||
{ label: "Status", value: run.status ?? null },
|
||||
{ label: "Canonical events", value: run.canonicalEventCount ?? 0 },
|
||||
{ label: "Motion snapshots", value: run.motionSnapshotCount ?? 0 },
|
||||
|
||||
Reference in New Issue
Block a user