Guard browser OPFS custom session filename constants
This commit is contained in:
@@ -9395,27 +9395,30 @@
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
const browserIniFileTextPaths = await saveMachineTextFiles("browser-ini-file-session", {
|
||||
const iniFileMachineId = "browser-ini-file-session";
|
||||
const iniFileParameterFilename = "browser-custom.var";
|
||||
const iniFileToolTableFilename = "browser-custom-tool.tbl";
|
||||
const browserIniFileTextPaths = await saveMachineTextFiles(iniFileMachineId, {
|
||||
ini: [
|
||||
"[EMC]",
|
||||
"MACHINE = browser-ini-file-session",
|
||||
`MACHINE = ${iniFileMachineId}`,
|
||||
"",
|
||||
"[RS274NGC]",
|
||||
"PARAMETER_FILE = browser-custom.var",
|
||||
`PARAMETER_FILE = ${iniFileParameterFilename}`,
|
||||
"",
|
||||
"[EMCIO]",
|
||||
"TOOL_TABLE = browser-custom-tool.tbl",
|
||||
`TOOL_TABLE = ${iniFileToolTableFilename}`,
|
||||
"",
|
||||
].join("\n"),
|
||||
});
|
||||
assertMachineTextStorePaths(
|
||||
"opfs_save_ini_named_machine_text_files_staging",
|
||||
browserIniFileTextPaths,
|
||||
"browser-ini-file-session",
|
||||
iniFileMachineId,
|
||||
);
|
||||
await writeOpfsMachineFile(
|
||||
"browser-ini-file-session",
|
||||
"browser-custom.var",
|
||||
iniFileMachineId,
|
||||
iniFileParameterFilename,
|
||||
[
|
||||
"5161 31.25",
|
||||
"5162 62.5",
|
||||
@@ -9426,28 +9429,28 @@
|
||||
].join("\n"),
|
||||
);
|
||||
await writeOpfsMachineFile(
|
||||
"browser-ini-file-session",
|
||||
"browser-custom-tool.tbl",
|
||||
iniFileMachineId,
|
||||
iniFileToolTableFilename,
|
||||
"T8 P8 Z4.5 D0.5 ;browser custom tool\n",
|
||||
);
|
||||
const loadedIniFileSession = await loadMachineSessionFromOpfs(
|
||||
interp,
|
||||
"browser-ini-file-session",
|
||||
iniFileMachineId,
|
||||
{
|
||||
iniSdk: ini,
|
||||
iniWasmPath: "/work/browser-ini-file-session.ini",
|
||||
parameterWasmPath: opfsCustomSessionWasmPath("browser-custom.var"),
|
||||
toolTableWasmPath: opfsCustomSessionWasmPath("browser-custom-tool.tbl"),
|
||||
parameterWasmPath: opfsCustomSessionWasmPath(iniFileParameterFilename),
|
||||
toolTableWasmPath: opfsCustomSessionWasmPath(iniFileToolTableFilename),
|
||||
},
|
||||
);
|
||||
assertOpfsSessionStaging(
|
||||
"opfs_load_ini_named_session_staging",
|
||||
loadedIniFileSession,
|
||||
"browser-ini-file-session",
|
||||
iniFileMachineId,
|
||||
opfsCustomSessionPaths(
|
||||
"browser-ini-file-session",
|
||||
"browser-custom.var",
|
||||
"browser-custom-tool.tbl",
|
||||
iniFileMachineId,
|
||||
iniFileParameterFilename,
|
||||
iniFileToolTableFilename,
|
||||
"/work/browser-ini-file-session.ini",
|
||||
),
|
||||
);
|
||||
@@ -9464,7 +9467,7 @@
|
||||
);
|
||||
const savedIniNamedParameters = await saveMachineParametersToOpfs(
|
||||
interp,
|
||||
"browser-ini-file-session",
|
||||
iniFileMachineId,
|
||||
{
|
||||
5161: 33.75,
|
||||
5162: 67.5,
|
||||
@@ -9480,9 +9483,9 @@
|
||||
assertOpfsSavedParameterStaging(
|
||||
"opfs_save_ini_named_parameters_staging",
|
||||
savedIniNamedParameters,
|
||||
"browser-ini-file-session",
|
||||
"browser-custom.var",
|
||||
opfsCustomSessionWasmPath("browser-custom.var"),
|
||||
iniFileMachineId,
|
||||
iniFileParameterFilename,
|
||||
opfsCustomSessionWasmPath(iniFileParameterFilename),
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"opfs_save_ini_named_parameter_file",
|
||||
@@ -9529,7 +9532,7 @@
|
||||
);
|
||||
const savedIniNamedToolTable = await saveMachineToolTableToOpfs(
|
||||
interp,
|
||||
"browser-ini-file-session",
|
||||
iniFileMachineId,
|
||||
{
|
||||
opfsPath: loadedIniFileSession.toolTable.opfsPath,
|
||||
wasmPath: loadedIniFileSession.toolTable.wasmPath,
|
||||
@@ -9538,9 +9541,9 @@
|
||||
assertOpfsSavedToolTableStaging(
|
||||
"opfs_save_ini_named_tool_table_staging",
|
||||
savedIniNamedToolTable,
|
||||
"browser-ini-file-session",
|
||||
"browser-custom-tool.tbl",
|
||||
opfsCustomSessionWasmPath("browser-custom-tool.tbl"),
|
||||
iniFileMachineId,
|
||||
iniFileToolTableFilename,
|
||||
opfsCustomSessionWasmPath(iniFileToolTableFilename),
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"opfs_save_ini_named_tool_table",
|
||||
@@ -9563,10 +9566,13 @@
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
const browserIniOverrideTextPaths = await saveMachineTextFiles("browser-ini-override-session", {
|
||||
const iniOverrideMachineId = "browser-ini-override-session";
|
||||
const explicitParameterFilename = "browser-explicit.var";
|
||||
const explicitToolTableFilename = "browser-explicit-tool.tbl";
|
||||
const browserIniOverrideTextPaths = await saveMachineTextFiles(iniOverrideMachineId, {
|
||||
ini: [
|
||||
"[EMC]",
|
||||
"MACHINE = browser-ini-override-session",
|
||||
`MACHINE = ${iniOverrideMachineId}`,
|
||||
"",
|
||||
"[RS274NGC]",
|
||||
"PARAMETER_FILE = browser-ignored.var",
|
||||
@@ -9579,11 +9585,11 @@
|
||||
assertMachineTextStorePaths(
|
||||
"opfs_save_ini_override_machine_text_files_staging",
|
||||
browserIniOverrideTextPaths,
|
||||
"browser-ini-override-session",
|
||||
iniOverrideMachineId,
|
||||
);
|
||||
await writeOpfsMachineFile(
|
||||
"browser-ini-override-session",
|
||||
"browser-explicit.var",
|
||||
iniOverrideMachineId,
|
||||
explicitParameterFilename,
|
||||
[
|
||||
"5161 41.25",
|
||||
"5162 82.5",
|
||||
@@ -9594,30 +9600,30 @@
|
||||
].join("\n"),
|
||||
);
|
||||
await writeOpfsMachineFile(
|
||||
"browser-ini-override-session",
|
||||
"browser-explicit-tool.tbl",
|
||||
iniOverrideMachineId,
|
||||
explicitToolTableFilename,
|
||||
"T9 P9 Z5.5 D0.625 ;browser explicit tool\n",
|
||||
);
|
||||
const loadedIniOverrideSession = await loadMachineSessionFromOpfs(
|
||||
interp,
|
||||
"browser-ini-override-session",
|
||||
iniOverrideMachineId,
|
||||
{
|
||||
iniSdk: ini,
|
||||
iniWasmPath: "/work/browser-ini-override-session.ini",
|
||||
parameterFilename: "browser-explicit.var",
|
||||
parameterWasmPath: opfsCustomSessionWasmPath("browser-explicit.var"),
|
||||
toolTableFilename: "browser-explicit-tool.tbl",
|
||||
toolTableWasmPath: opfsCustomSessionWasmPath("browser-explicit-tool.tbl"),
|
||||
parameterFilename: explicitParameterFilename,
|
||||
parameterWasmPath: opfsCustomSessionWasmPath(explicitParameterFilename),
|
||||
toolTableFilename: explicitToolTableFilename,
|
||||
toolTableWasmPath: opfsCustomSessionWasmPath(explicitToolTableFilename),
|
||||
},
|
||||
);
|
||||
assertOpfsSessionStaging(
|
||||
"opfs_load_explicit_session_staging",
|
||||
loadedIniOverrideSession,
|
||||
"browser-ini-override-session",
|
||||
iniOverrideMachineId,
|
||||
opfsCustomSessionPaths(
|
||||
"browser-ini-override-session",
|
||||
"browser-explicit.var",
|
||||
"browser-explicit-tool.tbl",
|
||||
iniOverrideMachineId,
|
||||
explicitParameterFilename,
|
||||
explicitToolTableFilename,
|
||||
"/work/browser-ini-override-session.ini",
|
||||
),
|
||||
);
|
||||
@@ -9646,7 +9652,7 @@
|
||||
);
|
||||
const savedExplicitParameters = await saveMachineParametersToOpfs(
|
||||
interp,
|
||||
"browser-ini-override-session",
|
||||
iniOverrideMachineId,
|
||||
{
|
||||
5161: 51.25,
|
||||
5162: 102.5,
|
||||
@@ -9662,9 +9668,9 @@
|
||||
assertOpfsSavedParameterStaging(
|
||||
"opfs_save_explicit_parameters_staging",
|
||||
savedExplicitParameters,
|
||||
"browser-ini-override-session",
|
||||
"browser-explicit.var",
|
||||
opfsCustomSessionWasmPath("browser-explicit.var"),
|
||||
iniOverrideMachineId,
|
||||
explicitParameterFilename,
|
||||
opfsCustomSessionWasmPath(explicitParameterFilename),
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"opfs_save_explicit_parameter_file",
|
||||
@@ -9699,7 +9705,7 @@
|
||||
);
|
||||
const savedExplicitToolTable = await saveMachineToolTableToOpfs(
|
||||
interp,
|
||||
"browser-ini-override-session",
|
||||
iniOverrideMachineId,
|
||||
{
|
||||
opfsPath: loadedIniOverrideSession.toolTable.opfsPath,
|
||||
wasmPath: loadedIniOverrideSession.toolTable.wasmPath,
|
||||
@@ -9708,9 +9714,9 @@
|
||||
assertOpfsSavedToolTableStaging(
|
||||
"opfs_save_explicit_tool_table_staging",
|
||||
savedExplicitToolTable,
|
||||
"browser-ini-override-session",
|
||||
"browser-explicit-tool.tbl",
|
||||
opfsCustomSessionWasmPath("browser-explicit-tool.tbl"),
|
||||
iniOverrideMachineId,
|
||||
explicitToolTableFilename,
|
||||
opfsCustomSessionWasmPath(explicitToolTableFilename),
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"opfs_save_explicit_tool_table",
|
||||
|
||||
Reference in New Issue
Block a user