Skip to content

Commit

Permalink
Never uses draw_area_size
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Oct 16, 2022
1 parent 5a60853 commit 1b3dd24
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 17 deletions.
1 change: 0 additions & 1 deletion Marlin/src/gcode/calibrate/M665.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@
if (parser.seenval('T')) draw_area_max.y = parser.value_linear_units();
if (parser.seenval('B')) draw_area_min.y = parser.value_linear_units();
if (parser.seenval('H')) polargraph_max_belt_len = parser.value_linear_units();
refresh_polargraph_size();
}

void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/lcd/menu/menu_advanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,12 +635,12 @@ void menu_advanced_settings() {
#if ENABLED(POLARGRAPH)
// M665 - Polargraph Settings
if (!is_busy) {
EDIT_ITEM_FAST(float4, MSG_SEGMENTS_PER_SECOND, &segments_per_second, 100, 9999); // M665 S
EDIT_ITEM_FAST(float51sign, MSG_DRAW_MIN_X, &draw_area_min.x, X_MIN_POS, draw_area_max.x - 10, refresh_polargraph_size); // M665 L
EDIT_ITEM_FAST(float51sign, MSG_DRAW_MAX_X, &draw_area_max.x, draw_area_min.x + 10, X_MAX_POS, refresh_polargraph_size); // M665 R
EDIT_ITEM_FAST(float51sign, MSG_DRAW_MIN_Y, &draw_area_min.y, Y_MIN_POS, draw_area_max.y - 10, refresh_polargraph_size); // M665 T
EDIT_ITEM_FAST(float51sign, MSG_DRAW_MAX_Y, &draw_area_max.y, draw_area_min.y + 10, Y_MAX_POS, refresh_polargraph_size); // M665 B
EDIT_ITEM_FAST(float51sign, MSG_MAX_BELT_LEN, &polargraph_max_belt_len, 500, 2000); // M665 H
EDIT_ITEM_FAST(float4, MSG_SEGMENTS_PER_SECOND, &segments_per_second, 100, 9999); // M665 S
EDIT_ITEM_FAST(float51sign, MSG_DRAW_MIN_X, &draw_area_min.x, X_MIN_POS, draw_area_max.x - 10); // M665 L
EDIT_ITEM_FAST(float51sign, MSG_DRAW_MAX_X, &draw_area_max.x, draw_area_min.x + 10, X_MAX_POS); // M665 R
EDIT_ITEM_FAST(float51sign, MSG_DRAW_MIN_Y, &draw_area_min.y, Y_MIN_POS, draw_area_max.y - 10); // M665 T
EDIT_ITEM_FAST(float51sign, MSG_DRAW_MAX_Y, &draw_area_max.y, draw_area_min.y + 10, Y_MAX_POS); // M665 B
EDIT_ITEM_FAST(float51sign, MSG_MAX_BELT_LEN, &polargraph_max_belt_len, 500, 2000); // M665 H
}
#endif

Expand Down
6 changes: 0 additions & 6 deletions Marlin/src/module/polargraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,10 @@
// Initialized by settings.load()
float segments_per_second, polargraph_max_belt_len;
xy_pos_t draw_area_min, draw_area_max;
xy_float_t draw_area_size;

void inverse_kinematics(const xyz_pos_t &raw) {
const float x1 = raw.x - draw_area_min.x, x2 = draw_area_max.x - raw.x, y = raw.y - draw_area_max.y;
delta.set(HYPOT(x1, y), HYPOT(x2, y), raw.z);
}

void refresh_polargraph_size();
draw_area_size.x = draw_area_max.x - draw_area_min.x;
draw_area_size.y = draw_area_max.y - draw_area_min.y;
}

#endif // POLARGRAPH
2 changes: 0 additions & 2 deletions Marlin/src/module/polargraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@

extern float segments_per_second;
extern xy_pos_t draw_area_min, draw_area_max;
extern xy_float_t draw_area_size;
extern float polargraph_max_belt_len;

void inverse_kinematics(const xyz_pos_t &raw);
void refresh_polargraph_size();
2 changes: 0 additions & 2 deletions Marlin/src/module/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,6 @@ void MarlinSettings::postprocess() {
// planner position so the stepper counts will be set correctly.
TERN_(DELTA, recalc_delta_settings());

TERN_(POLARGRAPH, refresh_polargraph_size());

TERN_(PIDTEMP, thermalManager.updatePID());

#if DISABLED(NO_VOLUMETRICS)
Expand Down

0 comments on commit 1b3dd24

Please sign in to comment.