Wire LinuxCNC tool table for cutter comp
This commit is contained in:
@@ -107,6 +107,10 @@ int main() {
|
||||
bool saw_cutter_right_first = false;
|
||||
bool saw_cutter_right_second = false;
|
||||
bool saw_cutter_right_off_move = false;
|
||||
bool saw_explicit_cutter_left_first = false;
|
||||
bool saw_explicit_cutter_left_second = false;
|
||||
bool saw_explicit_cutter_right_first = false;
|
||||
bool saw_explicit_cutter_right_second = false;
|
||||
for (const auto &event : events) {
|
||||
saw_tool = saw_tool || event.type == CNC_SIM_EVENT_TOOL_CHANGE;
|
||||
saw_rapid = saw_rapid || event.type == CNC_SIM_EVENT_RAPID;
|
||||
@@ -356,6 +360,16 @@ int main() {
|
||||
"G21 G90 G17\n"
|
||||
"G0 X0 Y0 Z0\n"
|
||||
"F100\n"
|
||||
"G41 D1\n"
|
||||
"G1 X20 Y0\n"
|
||||
"G1 X20 Y20\n"
|
||||
"G40\n"
|
||||
"G1 X0 Y0\n"
|
||||
"G42 D1\n"
|
||||
"G1 X20 Y0\n"
|
||||
"G1 X20 Y-20\n"
|
||||
"G40\n"
|
||||
"G1 X0 Y0\n"
|
||||
"G41.1 D6\n"
|
||||
"G1 X20 Y0\n"
|
||||
"G1 X20 Y20\n"
|
||||
@@ -399,13 +413,37 @@ int main() {
|
||||
event.line == 13 &&
|
||||
near(event.end.x, 0.0) &&
|
||||
near(event.end.y, 0.0));
|
||||
saw_explicit_cutter_left_first = saw_explicit_cutter_left_first ||
|
||||
(event.type == CNC_SIM_EVENT_LINEAR_FEED &&
|
||||
event.line == 16 &&
|
||||
near(event.end.x, 17.0) &&
|
||||
near(event.end.y, 3.0));
|
||||
saw_explicit_cutter_left_second = saw_explicit_cutter_left_second ||
|
||||
(event.type == CNC_SIM_EVENT_LINEAR_FEED &&
|
||||
event.line == 17 &&
|
||||
near(event.end.x, 17.0) &&
|
||||
near(event.end.y, 20.0));
|
||||
saw_explicit_cutter_right_first = saw_explicit_cutter_right_first ||
|
||||
(event.type == CNC_SIM_EVENT_LINEAR_FEED &&
|
||||
event.line == 21 &&
|
||||
near(event.end.x, 17.0) &&
|
||||
near(event.end.y, -3.0));
|
||||
saw_explicit_cutter_right_second = saw_explicit_cutter_right_second ||
|
||||
(event.type == CNC_SIM_EVENT_LINEAR_FEED &&
|
||||
event.line == 22 &&
|
||||
near(event.end.x, 17.0) &&
|
||||
near(event.end.y, -20.0));
|
||||
}
|
||||
ok &= expect(saw_cutter_left_first, "expected LinuxCNC G41.1 compensated lead-in motion");
|
||||
ok &= expect(saw_cutter_left_second, "expected LinuxCNC G41.1 compensated side motion");
|
||||
ok &= expect(saw_cutter_left_first, "expected LinuxCNC G41 D1 compensated lead-in motion");
|
||||
ok &= expect(saw_cutter_left_second, "expected LinuxCNC G41 D1 compensated side motion");
|
||||
ok &= expect(saw_cutter_left_off_move, "expected LinuxCNC G40 move after left compensation");
|
||||
ok &= expect(saw_cutter_right_first, "expected LinuxCNC G42.1 compensated lead-in motion");
|
||||
ok &= expect(saw_cutter_right_second, "expected LinuxCNC G42.1 compensated side motion");
|
||||
ok &= expect(saw_cutter_right_first, "expected LinuxCNC G42 D1 compensated lead-in motion");
|
||||
ok &= expect(saw_cutter_right_second, "expected LinuxCNC G42 D1 compensated side motion");
|
||||
ok &= expect(saw_cutter_right_off_move, "expected LinuxCNC G40 move after right compensation");
|
||||
ok &= expect(saw_explicit_cutter_left_first, "expected LinuxCNC G41.1 D6 compensated lead-in motion");
|
||||
ok &= expect(saw_explicit_cutter_left_second, "expected LinuxCNC G41.1 D6 compensated side motion");
|
||||
ok &= expect(saw_explicit_cutter_right_first, "expected LinuxCNC G42.1 D6 compensated lead-in motion");
|
||||
ok &= expect(saw_explicit_cutter_right_second, "expected LinuxCNC G42.1 D6 compensated side motion");
|
||||
|
||||
const char comment_program[] =
|
||||
"G21 G90 G17\n"
|
||||
|
||||
Reference in New Issue
Block a user