Emit LinuxCNC probe moves as probe events

This commit is contained in:
CNC Local
2026-05-22 04:59:09 +08:00
parent 8afbadc6d0
commit a0d78b74b2
8 changed files with 65 additions and 1 deletions

View File

@@ -156,6 +156,14 @@ void CanonEventSink::arc_feed(int line, const CncSimPose &end, const CncSimPose
position_ = end;
}
void CanonEventSink::straight_probe(int line, const CncSimPose &end) {
CncSimEvent event = base_event(CNC_SIM_EVENT_PROBE, line);
event.start = position_;
event.end = end;
emit(event);
position_ = end;
}
void CanonEventSink::dwell(double seconds, int line) {
CncSimEvent event = base_event(CNC_SIM_EVENT_DWELL, line);
event.dwell_seconds = seconds;

View File

@@ -27,6 +27,7 @@ public:
void straight_traverse(int line, const CncSimPose &end);
void straight_feed(int line, const CncSimPose &end);
void arc_feed(int line, const CncSimPose &end, const CncSimPose &center, int turns);
void straight_probe(int line, const CncSimPose &end);
void dwell(double seconds, int line);
void program_end(int line);
void emit_raw(CncSimEvent event);

View File

@@ -341,7 +341,7 @@ void STRAIGHT_PROBE(int lineno,
double u, double v, double w,
unsigned char) {
if (active_sink) {
active_sink->straight_feed(lineno, make_pose(x, y, z, a, b, c, u, v, w));
active_sink->straight_probe(event_line(lineno), make_pose(x, y, z, a, b, c, u, v, w));
}
}