推进 INI 面板 machine session state report helper
This commit is contained in:
@@ -63,3 +63,48 @@ export function createMachineSessionStateSnapshot({
|
||||
error: error ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
export function createMachineSessionStateReport(state = {}) {
|
||||
const badges = state.badges ?? {};
|
||||
const fields = state.fields ?? {};
|
||||
const sessionSnapshot = state.sessionSnapshot ?? {};
|
||||
const sessionLoad = state.sessionLoad ?? {};
|
||||
const selectedProgram = state.selectedProgram ?? {};
|
||||
const run = state.run ?? {};
|
||||
return {
|
||||
readiness: {
|
||||
ini: badges.ini ?? null,
|
||||
interp: badges.interp ?? null,
|
||||
opfs: badges.opfs ?? null,
|
||||
},
|
||||
session: {
|
||||
snapshotLabel: sessionSnapshot.snapshotLabel ?? fields.sessionSnapshot ?? null,
|
||||
workflow: sessionSnapshot.workflow ?? fields.runWorkflow ?? null,
|
||||
ini: fields.sessionIni ?? sessionSnapshot.iniOpfsPath ?? sessionLoad.iniWasmPath ?? null,
|
||||
parameters: fields.sessionParameters ?? sessionSnapshot.parameterOpfsPath ?? sessionLoad.parameterWasmPath ?? null,
|
||||
toolTable: fields.sessionToolTable ?? sessionSnapshot.toolTableOpfsPath ?? sessionLoad.toolTableWasmPath ?? null,
|
||||
gcode: fields.sessionGcode ?? sessionSnapshot.gcodeOpfsPath ?? null,
|
||||
},
|
||||
loaded: {
|
||||
iniWasmPath: sessionLoad.iniWasmPath ?? null,
|
||||
parameterWasmPath: sessionLoad.parameterWasmPath ?? null,
|
||||
toolTableWasmPath: sessionLoad.toolTableWasmPath ?? null,
|
||||
},
|
||||
program: {
|
||||
source: selectedProgram.source ?? run.programSource ?? fields.runSource ?? null,
|
||||
opfsPath: selectedProgram.opfsPath ?? run.programOpfsPath ?? fields.runOpfsPath ?? null,
|
||||
wasmPath: selectedProgram.wasmPath ?? run.programWasmPath ?? fields.runWasmPath ?? null,
|
||||
},
|
||||
run: {
|
||||
status: run.runStatus ?? fields.runStatus ?? null,
|
||||
canonicalEventCount: run.canonicalEventCount ?? 0,
|
||||
motionSnapshotCount: run.motionSnapshotCount ?? 0,
|
||||
iniWasmPath: run.iniWasmPath ?? null,
|
||||
},
|
||||
status: {
|
||||
lastAction: state.lastAction ?? null,
|
||||
error: state.error ?? null,
|
||||
fiveaxisRemap: state.fiveaxisRemap ?? null,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user