Fix XYZBC tool execution TCP path

This commit is contained in:
mes123456
2026-07-03 07:50:26 -04:00
parent ffdaa21d8b
commit 6631833c93
6 changed files with 1879 additions and 100 deletions

View File

@@ -216,8 +216,37 @@ store.dispatch({
sourceRel: "configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/xyzbc_switchkins.ngc",
});
assert.equal(store.getState().toolRuntimeState.activeToolNumber, 0);
assert.equal(store.getState().programAxisPreviewPath.source, "web-axis-source-execution-expanded-ngcgui-subroutines");
assert.equal(store.getState().programAxisPreviewPath.semanticBoundary, "linuxcnc_xyzbc_switchkins_ngc_execution_expanded_by_source_subroutines");
assert.equal(store.getState().programAxisPreviewPath.gcodeExecutionProcess.executionStepCount, 128);
assert.equal(store.getState().programAxisPreviewPath.gcodeExecutionProcess.summary.motionStepCount, 29);
assert.equal(store.getState().programAxisPreviewPath.gcodeExecutionProcess.summary.parameterAssignmentStepCount, 41);
assert.equal(store.getState().programAxisPreviewPath.samples[0].tool.id, 2);
assert.equal(store.getState().programAxisPreviewPath.samples[0].tool.diameter, 8);
assert.equal(store.getState().programAxisPreviewPath.samples[0].sourceFile, "xyzbc_switchkins_sub.ngc");
assert.equal(store.getState().programAxisPreviewPath.samples[0].statement.includes("g53 g0"), true);
store.dispatch({ type: "RUN_READY" });
store.dispatch({ type: "RUN" });
const liveRunState = store.getState();
assert.equal(liveRunState.programUiExecution.source, "programAxisPreviewPath.samples");
assert.equal(liveRunState.programUiExecution.samplePeriodMs, 50);
assert.equal(liveRunState.programUiExecution.executedSampleCount, liveRunState.programExecutionSampleIndex + 1);
assert.equal(liveRunState.programUiExecution.sourceFile, liveRunState.programRuntimeFeedback.sourceFile);
assert.equal(liveRunState.programUiExecution.line, liveRunState.programRuntimeFeedback.line);
assert.equal(liveRunState.programUiExecution.gcodeStepIndex === null, false);
assert.equal(liveRunState.programUiExecution.semanticBoundary, "ui_updates_from_real_expanded_linuxcnc_gcode_sample_stream");
assert.deepEqual(liveRunState.toolAxisVector, {
x: liveRunState.programUiExecution.toolAxis.i,
y: liveRunState.programUiExecution.toolAxis.j,
z: liveRunState.programUiExecution.toolAxis.k,
});
assert.deepEqual(liveRunState.programRuntimeFeedback.tcp, liveRunState.programUiExecution.tcp);
assert.notDeepEqual(liveRunState.programRuntimeFeedback.tcp, liveRunState.programRuntimeFeedback.axisPose);
assert.equal(liveRunState.linuxCncProcessMonitor.path.uiExecution.sourceFile, liveRunState.programUiExecution.sourceFile);
assert.equal(liveRunState.linuxCncProcessMonitor.path.activeGcode, liveRunState.programUiExecution.statement);
assert.equal(store.getState().linuxCncProcessMonitor.toolChange.activeToolNumber, 2);
assert.equal(store.getState().linuxCncProcessMonitor.toolChange.diameter, 8);
assert.equal(store.getState().linuxCncProcessMonitor.sourceReferences.task, "linuxcnc/src/emc/task/emctaskmain.cc");
const toolOffsetDb = applyToolCommandSequence(store.getState().toolDbSimulation, [
{ code: "T", toolNumber: 2 },
{ code: "M6" },
@@ -306,9 +335,13 @@ buttonStore.dispatch({ type: "TOGGLE_POWER" });
assert.equal(buttonStore.getState().machine.powerOn, true);
buttonStore.dispatch({ type: "HOME" });
assert.equal(buttonStore.getState().machine.allHomed, true);
assert.equal(buttonStore.getState().linuxCncProcessMonitor.axes.joint.x, 43);
assert.equal(buttonStore.getState().linuxCncProcessMonitor.axes.joint.y, -32.15);
assert.equal(buttonStore.getState().linuxCncProcessMonitor.axes.joint.z, -11.306);
buttonStore.dispatch({ type: "SET_MODE", mode: "mdi" });
buttonStore.dispatch({ type: "RUN_MDI", command: "M428" });
assert.equal(buttonStore.getState().kinsType, "tcp-xyzbc");
assert.equal(buttonStore.getState().linuxCncProcessMonitor.axes.rtcpState, "on");
buttonStore.dispatch({ type: "RUN_MDI", command: "M429" });
assert.equal(buttonStore.getState().kinsType, "identity");
buttonStore.dispatch({ type: "RUN_MDI", command: "M430" });
@@ -321,10 +354,14 @@ assert.equal(buttonStore.getState().axisPose.c, cBeforeJog + 1);
const feedBefore = buttonStore.getState().feed.feedOverride;
buttonStore.dispatch({ type: "ADJUST_OVERRIDE", target: "feed", delta: 10 });
assert.equal(buttonStore.getState().feed.feedOverride, feedBefore + 10);
assert.equal(buttonStore.getState().linuxCncProcessMonitor.feed.feedOverridePercent, feedBefore + 10);
buttonStore.dispatch({ type: "SET_SPINDLE_DIRECTION", direction: "forward" });
assert.equal(buttonStore.getState().spindle.direction, "forward");
assert.equal(buttonStore.getState().linuxCncProcessMonitor.spindle.enabled, true);
assert.equal(buttonStore.getState().linuxCncProcessMonitor.spindle.actualRpm, 1600);
buttonStore.dispatch({ type: "TOGGLE_COOLANT", kind: "flood" });
assert.equal(buttonStore.getState().coolant.flood, true);
assert.equal(buttonStore.getState().linuxCncProcessMonitor.coolant.flood, true);
buttonStore.dispatch({ type: "SET_BLOCK_DELETE", enabled: true });
assert.equal(buttonStore.getState().gmoccapyGui.optionalBlocks, true);
buttonStore.dispatch({ type: "SET_OPTIONAL_STOP", enabled: true });