Add OPFS G-code staging and browser simulation checks
This commit is contained in:
@@ -60,6 +60,7 @@ const initialState = {
|
||||
status: "not-saved",
|
||||
path: null,
|
||||
storageMode: null,
|
||||
storageCapability: null,
|
||||
savedAt: null,
|
||||
restoredAt: null,
|
||||
lastError: null,
|
||||
@@ -70,6 +71,8 @@ const initialState = {
|
||||
profileId: null,
|
||||
fileCount: 0,
|
||||
opfsRoot: null,
|
||||
storageMode: null,
|
||||
storageCapability: null,
|
||||
savedAt: null,
|
||||
lastError: null,
|
||||
plan: null,
|
||||
@@ -632,6 +635,7 @@ export function createSimulationStore(seed = {}) {
|
||||
status: "saved",
|
||||
path: action.path,
|
||||
storageMode: action.storageMode || null,
|
||||
storageCapability: action.storageCapability || null,
|
||||
savedAt: action.savedAt,
|
||||
lastError: null,
|
||||
},
|
||||
@@ -661,6 +665,19 @@ export function createSimulationStore(seed = {}) {
|
||||
setState({
|
||||
...action.restoredState,
|
||||
profile: restoredProfile,
|
||||
linuxCncIniConfig: state.linuxCncIniConfig,
|
||||
iniConfigReadiness: state.iniConfigReadiness,
|
||||
kinematicsRuntime: state.kinematicsRuntime,
|
||||
kinematicsRuntimeReadiness: state.kinematicsRuntimeReadiness,
|
||||
kinematicsExecutionContext: state.kinematicsExecutionContext,
|
||||
interpreterRuntime: state.interpreterRuntime,
|
||||
interpreterRuntimeReadiness: state.interpreterRuntimeReadiness,
|
||||
taskHalRuntime: state.taskHalRuntime,
|
||||
taskHalRuntimeReadiness: state.taskHalRuntimeReadiness,
|
||||
taskHalStatus: state.taskHalStatus,
|
||||
taskHalSession: state.taskHalSession,
|
||||
machineFileStaging: state.machineFileStaging,
|
||||
machineFileExecution: state.machineFileExecution,
|
||||
linuxCncBoundaryAdapter: adapter,
|
||||
linuxCncBoundaryReadiness: createLinuxCncBoundaryReadiness(adapter),
|
||||
sessionPersistence: {
|
||||
@@ -668,6 +685,7 @@ export function createSimulationStore(seed = {}) {
|
||||
status: "restored",
|
||||
path: action.path,
|
||||
storageMode: action.storageMode || null,
|
||||
storageCapability: action.storageCapability || null,
|
||||
restoredAt: action.restoredAt,
|
||||
lastError: null,
|
||||
},
|
||||
@@ -704,6 +722,8 @@ export function createSimulationStore(seed = {}) {
|
||||
profileId: action.plan.profileId,
|
||||
fileCount: action.save.fileCount,
|
||||
opfsRoot: action.save.opfsRoot,
|
||||
storageMode: action.save.storageMode || null,
|
||||
storageCapability: action.save.storageCapability || null,
|
||||
savedAt: action.save.savedAt,
|
||||
lastError: null,
|
||||
plan: action.plan,
|
||||
@@ -1407,7 +1427,7 @@ export function createSimulationStore(seed = {}) {
|
||||
const sessionId = options.sessionId || state.sessionPersistence.sessionId;
|
||||
const filename = options.filename || state.sessionPersistence.filename;
|
||||
const payload = createFiveAxisSessionPayload(state);
|
||||
const { snapshot, path, storageMode } = await saveFiveAxisSessionSnapshot(sessionId, payload, {
|
||||
const { snapshot, path, storageMode, storageCapability } = await saveFiveAxisSessionSnapshot(sessionId, payload, {
|
||||
filename,
|
||||
storage: options.storage,
|
||||
storageMode: options.storageMode,
|
||||
@@ -1417,9 +1437,10 @@ export function createSimulationStore(seed = {}) {
|
||||
type: "SESSION_SAVE_COMPLETE",
|
||||
path,
|
||||
storageMode,
|
||||
storageCapability,
|
||||
savedAt: snapshot.createdAt,
|
||||
});
|
||||
return { snapshot, path, storageMode };
|
||||
return { snapshot, path, storageMode, storageCapability };
|
||||
} catch (error) {
|
||||
dispatch({ type: "SESSION_PERSISTENCE_FAILED", error: error.message });
|
||||
throw error;
|
||||
@@ -1431,7 +1452,7 @@ export function createSimulationStore(seed = {}) {
|
||||
try {
|
||||
const sessionId = options.sessionId || state.sessionPersistence.sessionId;
|
||||
const filename = options.filename || state.sessionPersistence.filename;
|
||||
const { snapshot, path, storageMode } = await loadFiveAxisSessionSnapshot(sessionId, {
|
||||
const { snapshot, path, storageMode, storageCapability } = await loadFiveAxisSessionSnapshot(sessionId, {
|
||||
filename,
|
||||
storage: options.storage,
|
||||
storageMode: options.storageMode,
|
||||
@@ -1441,10 +1462,11 @@ export function createSimulationStore(seed = {}) {
|
||||
restoredState: restoreFiveAxisSessionState(snapshot),
|
||||
path,
|
||||
storageMode,
|
||||
storageCapability,
|
||||
restoredAt: new Date().toISOString(),
|
||||
});
|
||||
await refreshAsyncKinematicsFrame({ operatorMessage: `5-axis session restored ${path}` });
|
||||
return { snapshot, path, storageMode };
|
||||
return { snapshot, path, storageMode, storageCapability };
|
||||
} catch (error) {
|
||||
dispatch({ type: "SESSION_PERSISTENCE_FAILED", error: error.message });
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user