bool DeltaCalibrationStrategy::handleGcode(Gcode *gcode)
{
    if( gcode->has_g) {
        // G code processing
        if( gcode->g == 32 ) { // auto calibration for delta, Z bed mapping for cartesian
            // first wait for an empty queue i.e. no moves left
            THEKERNEL->conveyor->wait_for_idle();

            // turn off any compensation transform as it will be invalidated anyway by this
            THEROBOT->compensationTransform= nullptr;

            if(!gcode->has_letter('R')) {
                if(!calibrate_delta_endstops(gcode)) {
                    gcode->stream->printf("Calibration failed to complete, check the initial probe height and/or initial_height settings\n");
                    return true;
                }
            }
            if(!gcode->has_letter('E')) {
                if(!calibrate_delta_radius(gcode)) {
                    gcode->stream->printf("Calibration failed to complete, check the initial probe height and/or initial_height settings\n");
                    return true;
                }
            }
            gcode->stream->printf("Calibration complete, save settings with M500\n");
            return true;

        }else if (gcode->g == 29) {
            // probe the 7 points
            if(!probe_delta_points(gcode)) {
                gcode->stream->printf("Calibration failed to complete, check the initial probe height and/or initial_height settings\n");
            }
            return true;
        }

    } else if(gcode->has_m) {
        // handle mcodes
    }

    return false;
}
bool DeltaCalibrationStrategy::handleGcode(Gcode *gcode)
{
    if( gcode->has_g) {
        // G code processing
        if( gcode->g == 32 ) { // auto calibration for delta, Z bed mapping for cartesian
            // first wait for an empty queue i.e. no moves left
            THEKERNEL->conveyor->wait_for_empty_queue();

            if(!gcode->has_letter('R')) {
                if(!calibrate_delta_endstops(gcode)) {
                    gcode->stream->printf("Calibration failed to complete, probe not triggered\n");
                    return true;
                }
            }
            if(!gcode->has_letter('E')) {
                if(!calibrate_delta_radius(gcode)) {
                    gcode->stream->printf("Calibration failed to complete, probe not triggered\n");
                    return true;
                }
            }
            gcode->stream->printf("Calibration complete, save settings with M500\n");
            return true;

        }else if (gcode->g == 29) {
            // probe the 7 points
            if(!probe_delta_points(gcode)) {
                gcode->stream->printf("Calibration failed to complete, probe not triggered\n");
            }
            return true;
        }

    } else if(gcode->has_m) {
        // handle mcodes
    }

    return false;
}