按规划持续工作
结论:扩展 5axis native remap 执行验证,使用 vendored LinuxCNC demo 文件 xyzac_switchkins_test_1.ngc 和 xyzac_switchkins_test_3.ngc 走 open/read/execute 文件路径,并确认 remap 同步边界与 _hal[motion.switchkins-type] 最终状态。
This commit is contained in:
@@ -213,7 +213,7 @@ The validation fails if:
|
|||||||
| `linuxcnc_interp_init_harness` | Validates vendored LinuxCNC `Interp::init()` emits canonical initialization boundaries, reads metric/inch machine units, and synchronizes current/selected tool slots through standalone status adapters. |
|
| `linuxcnc_interp_init_harness` | Validates vendored LinuxCNC `Interp::init()` emits canonical initialization boundaries, reads metric/inch machine units, and synchronizes current/selected tool slots through standalone status adapters. |
|
||||||
| `linuxcnc_indexer_harness` | Validates vendored LinuxCNC single-axis rotary indexer dispatch emits lock/unlock and motion boundaries through the standalone event sink. |
|
| `linuxcnc_indexer_harness` | Validates vendored LinuxCNC single-axis rotary indexer dispatch emits lock/unlock and motion boundaries through the standalone event sink. |
|
||||||
| `linuxcnc_remap_hal_sync_harness` | Validates vendored LinuxCNC `M68`/`M66` execution can drive the standalone HAL adapter boundary used by 5-axis switchkins remap files, including `_hal[motion.switchkins-type]` readback. |
|
| `linuxcnc_remap_hal_sync_harness` | Validates vendored LinuxCNC `M68`/`M66` execution can drive the standalone HAL adapter boundary used by 5-axis switchkins remap files, including `_hal[motion.switchkins-type]` readback. |
|
||||||
| `linuxcnc_5axis_remap_execute_harness` | Validates vendored LinuxCNC `REMAP` parsing plus NGC remap execution for the 5-axis `M429 -> M428 -> M430 -> M429` switchkins path in the `xyzac-trt` and `xyzbc-trt` sample machines. |
|
| `linuxcnc_5axis_remap_execute_harness` | Validates vendored LinuxCNC `REMAP` parsing plus NGC remap execution for the 5-axis `M429 -> M428 -> M430 -> M429` switchkins path in the `xyzac-trt` and `xyzbc-trt` sample machines, then runs vendored `xyzac_switchkins_test_1.ngc` and `xyzac_switchkins_test_3.ngc` through the LinuxCNC file `open/read/execute` path. |
|
||||||
| `linuxcnc_tp_api_probe` | Validates vendored LinuxCNC trajectory planner calls for linear, arc, and queued motion paths. |
|
| `linuxcnc_tp_api_probe` | Validates vendored LinuxCNC trajectory planner calls for linear, arc, and queued motion paths. |
|
||||||
| `linuxcnc_kinematics_probe` | Validates vendored LinuxCNC `trivkins.c` plus `kins_util.c` initialize and perform identity forward/inverse mapping through the standalone HAL/RTAPI boundary. |
|
| `linuxcnc_kinematics_probe` | Validates vendored LinuxCNC `trivkins.c` plus `kins_util.c` initialize and perform identity forward/inverse mapping through the standalone HAL/RTAPI boundary. |
|
||||||
| `linuxcnc_5axis_kinematics_probe` | Validates vendored LinuxCNC `5axiskins.c` through `switchkins.c`, including 5-axis forward/inverse round-trip behavior and switching to identity kinematics. |
|
| `linuxcnc_5axis_kinematics_probe` | Validates vendored LinuxCNC `5axiskins.c` through `switchkins.c`, including 5-axis forward/inverse round-trip behavior and switching to identity kinematics. |
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ struct MachineCase {
|
|||||||
const char *ini_rel;
|
const char *ini_rel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct DemoCase {
|
||||||
|
const char *label;
|
||||||
|
const char *rel;
|
||||||
|
double expected_switchkins;
|
||||||
|
};
|
||||||
|
|
||||||
std::filesystem::path vendor_path(const std::string &rel)
|
std::filesystem::path vendor_path(const std::string &rel)
|
||||||
{
|
{
|
||||||
return std::filesystem::path(LINUXCNC_VENDOR_DIR) / rel;
|
return std::filesystem::path(LINUXCNC_VENDOR_DIR) / rel;
|
||||||
@@ -145,6 +151,84 @@ bool execute_step(Interp &interp, const std::string &label, const char *command,
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool execute_demo_file(const MachineCase &machine, const DemoCase &demo)
|
||||||
|
{
|
||||||
|
Interp interp;
|
||||||
|
initialize_interp(interp);
|
||||||
|
|
||||||
|
const std::string label = std::string(machine.label) + "_" + demo.label;
|
||||||
|
bool ok = parse_machine_remaps(interp, machine);
|
||||||
|
|
||||||
|
const auto file_path = vendor_path(demo.rel);
|
||||||
|
const int open_rc = interp.open(file_path.c_str());
|
||||||
|
std::cout << label << "_file_open=" << open_rc << "\n";
|
||||||
|
if (open_rc != INTERP_OK) {
|
||||||
|
print_bool(label + "_linuxcnc_demo_file_execute", false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int read_count = 0;
|
||||||
|
int execute_count = 0;
|
||||||
|
int finish_count = 0;
|
||||||
|
int final_rc = INTERP_OK;
|
||||||
|
bool reached_exit = false;
|
||||||
|
|
||||||
|
while (read_count < 512 && execute_count < 512) {
|
||||||
|
const int read_rc = interp.read();
|
||||||
|
if (read_rc == INTERP_ENDFILE) {
|
||||||
|
std::cout << label << "_file_read_eof=" << read_rc << "\n";
|
||||||
|
final_rc = read_rc;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
++read_count;
|
||||||
|
std::cout << label << "_file_read_" << read_count << "=" << read_rc << "\n";
|
||||||
|
if ((read_rc != INTERP_OK) && (read_rc != INTERP_EXECUTE_FINISH)) {
|
||||||
|
final_rc = read_rc;
|
||||||
|
ok = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
int execute_rc = interp.execute();
|
||||||
|
++execute_count;
|
||||||
|
std::cout << label << "_file_execute_" << execute_count << "=" << execute_rc << "\n";
|
||||||
|
final_rc = execute_rc;
|
||||||
|
if (execute_rc == INTERP_EXECUTE_FINISH) {
|
||||||
|
++finish_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((execute_rc != INTERP_OK) && (execute_rc != INTERP_EXIT)) {
|
||||||
|
if (execute_rc != INTERP_EXECUTE_FINISH) {
|
||||||
|
ok = false;
|
||||||
|
final_rc = execute_rc;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (execute_rc == INTERP_EXIT) {
|
||||||
|
reached_exit = true;
|
||||||
|
final_rc = execute_rc;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << label << "_file_read_count=" << read_count << "\n";
|
||||||
|
std::cout << label << "_file_execute_count=" << execute_count << "\n";
|
||||||
|
std::cout << label << "_file_finish_count=" << finish_count << "\n";
|
||||||
|
std::cout << label << "_file_final_rc=" << final_rc << "\n";
|
||||||
|
print_bool(label + "_file_reached_exit", reached_exit);
|
||||||
|
|
||||||
|
ok &= reached_exit;
|
||||||
|
ok &= read_count > 0;
|
||||||
|
ok &= execute_count > 0;
|
||||||
|
ok &= read_count < 512;
|
||||||
|
ok &= execute_count < 512;
|
||||||
|
ok &= read_hal_named(interp, label, "_hal[motion.switchkins-type]",
|
||||||
|
demo.expected_switchkins);
|
||||||
|
|
||||||
|
print_bool(label + "_linuxcnc_demo_file_execute", ok);
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
bool check_machine(const MachineCase &machine)
|
bool check_machine(const MachineCase &machine)
|
||||||
{
|
{
|
||||||
Interp interp;
|
Interp interp;
|
||||||
@@ -181,6 +265,25 @@ int main()
|
|||||||
ok &= check_machine(machine);
|
ok &= check_machine(machine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const DemoCase demos[] = {
|
||||||
|
{
|
||||||
|
"xyzac_switchkins_test_1",
|
||||||
|
"configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/"
|
||||||
|
"xyzac_switchkins_test_1.ngc",
|
||||||
|
0.0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"xyzac_switchkins_test_3",
|
||||||
|
"configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/"
|
||||||
|
"xyzac_switchkins_test_3.ngc",
|
||||||
|
0.0,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
for (const auto &demo : demos) {
|
||||||
|
ok &= execute_demo_file(cases[0], demo);
|
||||||
|
}
|
||||||
|
|
||||||
print_bool("fiveaxis_linuxcnc_remap_execute_path", ok);
|
print_bool("fiveaxis_linuxcnc_remap_execute_path", ok);
|
||||||
return ok ? 0 : 1;
|
return ok ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -302,6 +302,22 @@ grep -Fq "xyzbc_trt_M428_execute_1=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
|||||||
grep -Fq "xyzbc_trt_M430_execute_0=2" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
grep -Fq "xyzbc_trt_M430_execute_0=2" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
grep -Fq "xyzbc_trt_M430_execute_1=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
grep -Fq "xyzbc_trt_M430_execute_1=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
grep -Fq "xyzbc_trt_linuxcnc_remap_execute_path=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
grep -Fq "xyzbc_trt_linuxcnc_remap_execute_path=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_1_file_open=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_1_file_read_count=248" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_1_file_execute_count=248" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_1_file_finish_count=9" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_1_file_final_rc=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_1_file_reached_exit=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_1__hal[motion.switchkins-type]: rc=0 found=1 value=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_1_linuxcnc_demo_file_execute=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_3_file_open=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_3_file_read_count=86" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_3_file_execute_count=86" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_3_file_finish_count=3" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_3_file_final_rc=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_3_file_reached_exit=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_3__hal[motion.switchkins-type]: rc=0 found=1 value=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
grep -Fq "xyzac_trt_xyzac_switchkins_test_3_linuxcnc_demo_file_execute=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
grep -Fq "fiveaxis_linuxcnc_remap_execute_path=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
grep -Fq "fiveaxis_linuxcnc_remap_execute_path=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||||
|
|
||||||
NAMEDPARAM_STDOUT="$BUILD_DIR/linuxcnc_namedparam_harness.run.stdout.log"
|
NAMEDPARAM_STDOUT="$BUILD_DIR/linuxcnc_namedparam_harness.run.stdout.log"
|
||||||
|
|||||||
Reference in New Issue
Block a user