MCPcopy Create free account
hub / github.com/bdring/FluidNC / autoReportGCodeState

Method autoReportGCodeState

FluidNC/src/Channel.cpp:102–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102void Channel::autoReportGCodeState() {
103 // When moving, we suppress $G reports in which the only change is the motion mode
104 // (e.g. G0/G1/G2/G3 changes) because rapid-fire motion mode changes are fairly common.
105 // We would rather not issue a $G report after every GCode line.
106 // Similarly, F and S values can change rapidly, especially in laser programs.
107 // F and S values are also reported in ? status reports, so they will show up
108 // at the chosen periodic rate there.
109 if (motionState()) {
110 // Force the compare to succeed if the only change is the motion mode
111 _lastModal.motion = gc_state.modal.motion;
112 }
113 if (memcmp(&_lastModal, &gc_state.modal, sizeof(_lastModal)) || _lastTool != gc_state.selected_tool ||
114 (!motionState() && (_lastSpindleSpeed != gc_state.spindle_speed || _lastFeedRate != gc_state.feed_rate))) {
115 report_gcode_modes(*this);
116 memcpy(&_lastModal, &gc_state.modal, sizeof(_lastModal));
117 _lastTool = gc_state.selected_tool;
118 _lastSpindleSpeed = gc_state.spindle_speed;
119 _lastFeedRate = gc_state.feed_rate;
120 }
121}
122void Channel::autoReport() {
123 if (_reportInterval) {
124 const char* stateName = state_name();

Callers

nothing calls this directly

Calls 2

motionStateFunction · 0.85
report_gcode_modesFunction · 0.85

Tested by

no test coverage detected