Skip to content

Commit

Permalink
Editable / saved settings
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Oct 14, 2022
1 parent 1235b95 commit fcf7a95
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
#define W_BED_SIZE W_MAX_LENGTH
#endif

// Require 0,0 bed center for Delta and SCARA
// Require 0,0 bed center for Delta, SCARA, and Polargraph
#if IS_KINEMATIC
#define BED_CENTER_AT_0_0
#endif
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/lcd/language/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,12 @@ namespace Language_en {
LSTR MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *");
LSTR MSG_FILAMENT_UNLOAD = _UxGT("Unload mm");
LSTR MSG_FILAMENT_LOAD = _UxGT("Load mm");
LSTR MSG_SEGMENTS_PER_SECOND = _UxGT("Segments/Sec");
LSTR MSG_DRAW_MIN_X = _UxGT("Draw Min X");
LSTR MSG_DRAW_MAX_X = _UxGT("Draw Max X");
LSTR MSG_DRAW_MIN_Y = _UxGT("Draw Min Y");
LSTR MSG_DRAW_MAX_Y = _UxGT("Draw Max Y");
LSTR MSG_MAX_BELT_LEN = _UxGT("Max Belt Len");
LSTR MSG_ADVANCE_K = _UxGT("Advance K");
LSTR MSG_ADVANCE_K_E = _UxGT("Advance K *");
LSTR MSG_CONTRAST = _UxGT("LCD Contrast");
Expand Down
14 changes: 11 additions & 3 deletions Marlin/src/lcd/menu/menu_advanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,10 +632,18 @@ void menu_advanced_settings() {

#if DISABLED(SLIM_LCD_MENUS)

#if ENABLED(POLARGRAPH)
// M665 - Polargraph Settings
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

#if HAS_M206_COMMAND
//
// Set Home Offsets
//
// M428 - Set Home Offsets
ACTION_ITEM(MSG_SET_HOME_OFFSETS, []{ queue.inject(F("M428")); ui.return_to_status(); });
#endif

Expand Down
34 changes: 29 additions & 5 deletions Marlin/src/module/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ typedef struct SettingsDataStruct {
// HAS_BED_PROBE
//

xyz_pos_t probe_offset;
xyz_pos_t probe_offset; // M851 X Y Z

//
// ABL_PLANAR
Expand Down Expand Up @@ -330,7 +330,11 @@ typedef struct SettingsDataStruct {
delta_diagonal_rod; // M665 L
abc_float_t delta_tower_angle_trim, // M665 X Y Z
delta_diagonal_rod_trim; // M665 A B C
#elif ENABLED(POLARGRAPH)
xy_pos_t draw_area_min, draw_area_max; // M665 L R T B
float polargraph_max_belt_len; // M665 H
#endif

#endif

//
Expand Down Expand Up @@ -468,7 +472,7 @@ typedef struct SettingsDataStruct {
//
// SKEW_CORRECTION
//
skew_factor_t planner_skew_factor; // M852 I J K planner.skew_factor
skew_factor_t planner_skew_factor; // M852 I J K

//
// ADVANCED_PAUSE_FEATURE
Expand Down Expand Up @@ -1001,6 +1005,11 @@ void MarlinSettings::postprocess() {
EEPROM_WRITE(delta_diagonal_rod); // 1 float
EEPROM_WRITE(delta_tower_angle_trim); // 3 floats
EEPROM_WRITE(delta_diagonal_rod_trim); // 3 floats
#elif ENABLED(POLARGRAPH)
_FIELD_TEST(draw_area_min);
EEPROM_WRITE(draw_area_min); // 2 floats
EEPROM_WRITE(draw_area_max); // 2 floats
EEPROM_WRITE(polargraph_max_belt_len); // 1 float
#endif
}
#endif
Expand Down Expand Up @@ -1435,6 +1444,14 @@ void MarlinSettings::postprocess() {
_FIELD_TEST(planner_skew_factor);
EEPROM_WRITE(planner.skew_factor);

//
// POLARGRAPH
//
#if ENABLED(POLARGRAPH)
_FIELD_TEST(polargraph_max_belt_len);
EEPROM_WRITE(polargraph_max_belt_len);
#endif

//
// Advanced Pause filament load & unload lengths
//
Expand Down Expand Up @@ -1936,6 +1953,11 @@ void MarlinSettings::postprocess() {
EEPROM_READ(delta_diagonal_rod); // 1 float
EEPROM_READ(delta_tower_angle_trim); // 3 floats
EEPROM_READ(delta_diagonal_rod_trim); // 3 floats
#elif ENABLED(POLARGRAPH)
_FIELD_TEST(draw_area_min);
EEPROM_READ(draw_area_min); // 2 floats
EEPROM_READ(draw_area_max); // 2 floats
EEPROM_READ(polargraph_max_belt_len); // 1 float
#endif
}
#endif
Expand Down Expand Up @@ -2996,6 +3018,10 @@ void MarlinSettings::reset() {
delta_diagonal_rod = DELTA_DIAGONAL_ROD;
delta_tower_angle_trim = dta;
delta_diagonal_rod_trim = ddr;
#elif ENABLED(POLARGRAPH)
draw_area_min.set(X_MIN_POS, Y_MIN_POS);
draw_area_max.set(X_MAX_POS, Y_MAX_POS);
polargraph_max_belt_len = POLARGRAPH_MAX_BELT_LEN;
#endif
#endif

Expand Down Expand Up @@ -3492,9 +3518,7 @@ void MarlinSettings::reset() {
//
// LCD Preheat Settings
//
#if HAS_PREHEAT
gcode.M145_report(forReplay);
#endif
TERN_(HAS_PREHEAT, gcode.M145_report(forReplay));

//
// PID
Expand Down

0 comments on commit fcf7a95

Please sign in to comment.