Misc changes from struct refactor (#15289)

This commit is contained in:
Scott Lahteine
2019-09-17 18:16:28 -05:00
committed by GitHub
parent c7acd5c45b
commit c353eaa146
33 changed files with 97 additions and 110 deletions

View File

@ -714,7 +714,7 @@ G29_TYPE GcodeSuite::G29() {
ui.status_printf_P(0, PSTR(MSG_PROBING_MESH " %i/%i"), int(pt_index), int(GRID_MAX_POINTS));
#endif
measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level);
measured_z = faux ? 0.001 * random(-100, 101) : probe_at_point(xProbe, yProbe, raise_after, verbose_level);
if (isnan(measured_z)) {
set_bed_leveling_enabled(abl_should_enable);
@ -759,7 +759,7 @@ G29_TYPE GcodeSuite::G29() {
// Retain the last probe position
xProbe = points[i].x;
yProbe = points[i].y;
measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level);
measured_z = faux ? 0.001 * random(-100, 101) : probe_at_point(xProbe, yProbe, raise_after, verbose_level);
if (isnan(measured_z)) {
set_bed_leveling_enabled(abl_should_enable);
break;

View File

@ -29,7 +29,7 @@
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
#include "../../gcode.h"
#include "../../../feature/bedlevel/abl/abl.h"
#include "../../../feature/bedlevel/bedlevel.h"
#if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extensible_ui/ui_api.h"

View File

@ -29,7 +29,7 @@
#if ENABLED(AUTO_BED_LEVELING_UBL)
#include "../../gcode.h"
#include "../../../feature/bedlevel/ubl/ubl.h"
#include "../../../feature/bedlevel/bedlevel.h"
void GcodeSuite::G29() { ubl.G29(); }

View File

@ -190,7 +190,7 @@ static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool
*/
static float calibration_probe(const float &nx, const float &ny, const bool stow) {
#if HAS_BED_PROBE
return probe_pt(nx, ny, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, false);
return probe_at_point(nx, ny, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, false);
#else
UNUSED(stow);
return lcd_probe_pt(nx, ny);

View File

@ -162,7 +162,7 @@ void GcodeSuite::G34() {
if (iteration == 0 || izstepper > 0) do_blocking_move_to_z(z_probe);
// Probe a Z height for each stepper.
const float z_probed_height = probe_pt(z_auto_align_xpos[zstepper], z_auto_align_ypos[zstepper], raise_after, 0, true);
const float z_probed_height = probe_at_point(z_auto_align_xpos[zstepper], z_auto_align_ypos[zstepper], raise_after, 0, true);
if (isnan(z_probed_height)) {
SERIAL_ECHOLNPGM("Probing failed.");
err_break = true;

View File

@ -116,7 +116,7 @@ void GcodeSuite::M48() {
float mean = 0.0, sigma = 0.0, min = 99999.9, max = -99999.9, sample_set[n_samples];
// Move to the first point, deploy, and probe
const float t = probe_pt(X_probe_location, Y_probe_location, raise_after, verbose_level);
const float t = probe_at_point(X_probe_location, Y_probe_location, raise_after, verbose_level);
bool probing_good = !isnan(t);
if (probing_good) {
@ -190,7 +190,7 @@ void GcodeSuite::M48() {
} // n_legs
// Probe a single point
sample_set[n] = probe_pt(X_probe_location, Y_probe_location, raise_after, 0);
sample_set[n] = probe_at_point(X_probe_location, Y_probe_location, raise_after, 0);
// Break the loop if the probe fails
probing_good = !isnan(sample_set[n]);

View File

@ -34,6 +34,14 @@
#include "../libs/hex_print_routines.h"
#endif
#if ENABLED(TEMPERATURE_UNITS_SUPPORT)
typedef enum : uint8_t { TEMPUNIT_C, TEMPUNIT_K, TEMPUNIT_F } TempUnit;
#endif
#if ENABLED(INCH_MODE_SUPPORT)
typedef enum : uint8_t { LINEARUNIT_MM, LINEARUNIT_INCH } LinearUnit;
#endif
/**
* GCode parser
*
@ -254,7 +262,6 @@ public:
// Units modes: Inches, Fahrenheit, Kelvin
#if ENABLED(INCH_MODE_SUPPORT)
static inline float mm_to_linear_unit(const float mm) { return mm / linear_unit_factor; }
static inline float mm_to_volumetric_unit(const float mm) { return mm / (volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); }
@ -298,7 +305,7 @@ public:
#if ENABLED(TEMPERATURE_UNITS_SUPPORT)
static inline void set_input_temp_units(TempUnit units) { input_temp_units = units; }
static inline void set_input_temp_units(const TempUnit units) { input_temp_units = units; }
#if HAS_LCD_MENU && DISABLED(DISABLE_M503)

View File

@ -52,7 +52,7 @@ void GcodeSuite::G30() {
setup_for_endstop_or_probe_move();
const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;
const float measured_z = probe_pt(xpos, ypos, raise_after, 1);
const float measured_z = probe_at_point(xpos, ypos, raise_after, 1);
if (!isnan(measured_z))
SERIAL_ECHOLNPAIR("Bed X: ", FIXFLOAT(xpos), " Y: ", FIXFLOAT(ypos), " Z: ", FIXFLOAT(measured_z));