Guard browser OPFS custom session INI seed
This commit is contained in:
@@ -4600,6 +4600,20 @@
|
||||
return `T${toolNo} P${pocketNo} Z${zOffset} D${diameter} ${comment}\n`;
|
||||
}
|
||||
|
||||
function opfsCustomSessionIniText(machineId, parameterFilename, toolTableFilename) {
|
||||
return [
|
||||
"[EMC]",
|
||||
`MACHINE = ${machineId}`,
|
||||
"",
|
||||
"[RS274NGC]",
|
||||
`PARAMETER_FILE = ${parameterFilename}`,
|
||||
"",
|
||||
"[EMCIO]",
|
||||
`TOOL_TABLE = ${toolTableFilename}`,
|
||||
"",
|
||||
].join("\n");
|
||||
}
|
||||
|
||||
async function verifyOpfsSavedText(label, loadActualText, expectedLines) {
|
||||
verifyExpectedOutput(label, await loadActualText(), expectedLines.join("\n"));
|
||||
}
|
||||
@@ -9502,17 +9516,11 @@
|
||||
const iniFileParameterWasmPath = opfsCustomSessionWasmPath(iniFileParameterFilename);
|
||||
const iniFileToolTableWasmPath = opfsCustomSessionWasmPath(iniFileToolTableFilename);
|
||||
const browserIniFileTextPaths = await saveMachineTextFiles(iniFileMachineId, {
|
||||
ini: [
|
||||
"[EMC]",
|
||||
`MACHINE = ${iniFileMachineId}`,
|
||||
"",
|
||||
"[RS274NGC]",
|
||||
`PARAMETER_FILE = ${iniFileParameterFilename}`,
|
||||
"",
|
||||
"[EMCIO]",
|
||||
`TOOL_TABLE = ${iniFileToolTableFilename}`,
|
||||
"",
|
||||
].join("\n"),
|
||||
ini: opfsCustomSessionIniText(
|
||||
iniFileMachineId,
|
||||
iniFileParameterFilename,
|
||||
iniFileToolTableFilename,
|
||||
),
|
||||
});
|
||||
assertMachineTextStorePaths(
|
||||
"opfs_save_ini_named_machine_text_files_staging",
|
||||
@@ -9636,17 +9644,11 @@
|
||||
const explicitParameterWasmPath = opfsCustomSessionWasmPath(explicitParameterFilename);
|
||||
const explicitToolTableWasmPath = opfsCustomSessionWasmPath(explicitToolTableFilename);
|
||||
const browserIniOverrideTextPaths = await saveMachineTextFiles(iniOverrideMachineId, {
|
||||
ini: [
|
||||
"[EMC]",
|
||||
`MACHINE = ${iniOverrideMachineId}`,
|
||||
"",
|
||||
"[RS274NGC]",
|
||||
"PARAMETER_FILE = browser-ignored.var",
|
||||
"",
|
||||
"[EMCIO]",
|
||||
"TOOL_TABLE = browser-ignored-tool.tbl",
|
||||
"",
|
||||
].join("\n"),
|
||||
ini: opfsCustomSessionIniText(
|
||||
iniOverrideMachineId,
|
||||
"browser-ignored.var",
|
||||
"browser-ignored-tool.tbl",
|
||||
),
|
||||
});
|
||||
assertMachineTextStorePaths(
|
||||
"opfs_save_ini_override_machine_text_files_staging",
|
||||
|
||||
Reference in New Issue
Block a user