Add OPFS G-code staging and browser simulation checks

This commit is contained in:
2026-06-22 10:56:21 +08:00
parent 8321055934
commit 61e2fe8441
19 changed files with 1869 additions and 35 deletions

View File

@@ -200,13 +200,14 @@ function runPlannerTiming(tpRuntime, motion) {
return null;
}
try {
const sampleStride = motion.length > 1000 ? Math.ceil(motion.length / 90) : 10;
return tpRuntime.sdk.runCanonicalMotionTiming({
motion,
options: {
cycleTime: 0.001,
queueSize: 32,
maxCycles: 2000000,
sampleStride: 10,
sampleStride,
maxVelocity: 35,
maxAcceleration: 500,
maxJerk: 1000,
@@ -334,6 +335,9 @@ export function prepareLinuxCncProgramForRuntime(programText) {
const switchkinsEvents = [];
const runtimeLines = String(programText).split(/\r?\n/).map((line, index) => {
const lineNumber = index + 1;
if (String(line).trim() === "%") {
return "(linuxcnc program delimiter)";
}
const events = readSwitchkinsEventsFromLine(line, lineNumber);
if (events.length === 0) return line;
switchkinsEvents.push(...events);