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

Function execute_line

FluidNC/src/ProcessSettings.cpp:1224–1253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1222}
1223
1224Error execute_line(const char* line, Channel& channel, AuthenticationLevel auth_level) {
1225 // Empty or comment line. For syncing purposes.
1226 if (line[0] == 0) {
1227 return Error::Ok;
1228 }
1229 // Skip leading whitespace
1230 while (isspace(*line)) {
1231 ++line;
1232 }
1233 // User '$' or WebUI '[ESPxxx]' command
1234 if (line[0] == '$' || line[0] == '[') {
1235 if (gc_state.skip_blocks) {
1236 return Error::Ok;
1237 }
1238
1239 return settings_execute_line(line, channel, auth_level);
1240 }
1241 // Everything else is gcode. Block if in alarm or jog mode.
1242 if (state_is(State::Alarm) || state_is(State::ConfigAlarm) || state_is(State::Jog)) {
1243 return Error::SystemGcLock;
1244 }
1245 Error result = gc_execute_line(line);
1246 if (result != Error::Ok && result != Error::Reset) {
1247 log_error_to(channel, "Bad GCode: " << line);
1248 if (Job::active()) {
1249 send_alarm(ExecAlarm::GCodeError);
1250 }
1251 }
1252 return result;
1253}

Callers 1

protocol_main_loopFunction · 0.85

Calls 4

settings_execute_lineFunction · 0.85
gc_execute_lineFunction · 0.85
send_alarmFunction · 0.85
state_isFunction · 0.70

Tested by

no test coverage detected