Skip to content

Commit

Permalink
🐛 Fix SHAPING_MENU X frequency edit (MarlinFirmware#27499)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp authored and bsdnomad committed Nov 24, 2024
1 parent 77b5b97 commit 9a9fcc8
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
8 changes: 4 additions & 4 deletions Marlin/src/lcd/language/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,10 @@ namespace LanguageNarrow_en {
LSTR MSG_A_RETRACT = _UxGT("Retract Accel");
LSTR MSG_A_TRAVEL = _UxGT("Travel Accel");
LSTR MSG_INPUT_SHAPING = _UxGT("Input Shaping");
LSTR MSG_SHAPING_ENABLE = _UxGT("Enable @ shaping");
LSTR MSG_SHAPING_DISABLE = _UxGT("Disable @ shaping");
LSTR MSG_SHAPING_FREQ = _UxGT("@ frequency");
LSTR MSG_SHAPING_ZETA = _UxGT("@ damping");
LSTR MSG_SHAPING_ENABLE_N = _UxGT("Enable @ shaping");
LSTR MSG_SHAPING_DISABLE_N = _UxGT("Disable @ shaping");
LSTR MSG_SHAPING_FREQ_N = _UxGT("@ frequency");
LSTR MSG_SHAPING_ZETA_N = _UxGT("@ damping");
LSTR MSG_SHAPING_A_FREQ = STR_A _UxGT(" frequency"); // ProUI
LSTR MSG_SHAPING_B_FREQ = STR_B _UxGT(" frequency"); // ProUI
LSTR MSG_SHAPING_C_FREQ = STR_C _UxGT(" frequency"); // ProUI
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/language/language_it.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,10 @@ namespace LanguageNarrow_it {
LSTR MSG_A_RETRACT = _UxGT("A-Ritrazione");
LSTR MSG_A_TRAVEL = _UxGT("A-Spostamento");
LSTR MSG_INPUT_SHAPING = _UxGT("Input shaping");
LSTR MSG_SHAPING_ENABLE = _UxGT("Abilita shaping @");
LSTR MSG_SHAPING_DISABLE = _UxGT("Disabil. shaping @");
LSTR MSG_SHAPING_FREQ = _UxGT("Frequenza @");
LSTR MSG_SHAPING_ZETA = _UxGT("Smorzamento @");
LSTR MSG_SHAPING_ENABLE_N = _UxGT("Abilita shaping @");
LSTR MSG_SHAPING_DISABLE_N = _UxGT("Disabil. shaping @");
LSTR MSG_SHAPING_FREQ_N = _UxGT("Frequenza @");
LSTR MSG_SHAPING_ZETA_N = _UxGT("Smorzamento @");
LSTR MSG_SHAPING_A_FREQ = _UxGT("Frequenza ") STR_A; // ProUI
LSTR MSG_SHAPING_B_FREQ = _UxGT("Frequenza ") STR_B; // ProUI
LSTR MSG_SHAPING_C_FREQ = _UxGT("Frequenza ") STR_C; // ProUI
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/language/language_ru.h
Original file line number Diff line number Diff line change
Expand Up @@ -721,10 +721,10 @@ namespace LanguageNarrow_ru {
LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN = _UxGT("Коэфф.кулера");
LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Коэфф.кулер *");
LSTR MSG_INPUT_SHAPING = _UxGT("Input Shaping");
LSTR MSG_SHAPING_ENABLE = _UxGT("Включить шейпинг @");
LSTR MSG_SHAPING_DISABLE = _UxGT("Выключить шейпинг @");
LSTR MSG_SHAPING_FREQ = _UxGT("@ частота");
LSTR MSG_SHAPING_ZETA = _UxGT("@ подавление");
LSTR MSG_SHAPING_ENABLE_N = _UxGT("Включить шейпинг @");
LSTR MSG_SHAPING_DISABLE_N = _UxGT("Выключить шейпинг @");
LSTR MSG_SHAPING_FREQ_N = _UxGT("@ частота");
LSTR MSG_SHAPING_ZETA_N = _UxGT("@ подавление");
LSTR MSG_FILAMENT_EN = _UxGT("Филамент *");
LSTR MSG_SEGMENTS_PER_SECOND = _UxGT("Сегментов/сек");
LSTR MSG_DRAW_MIN_X = _UxGT("Рисовать мин X");
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/language/language_sk.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,10 @@ namespace LanguageNarrow_sk {
LSTR MSG_A_RETRACT = _UxGT("A-retrakt");
LSTR MSG_A_TRAVEL = _UxGT("A-prejazd");
LSTR MSG_INPUT_SHAPING = _UxGT("Tvarov. vstupu");
LSTR MSG_SHAPING_ENABLE = _UxGT("Povol. tvarov. @");
LSTR MSG_SHAPING_DISABLE = _UxGT("Zakáz. tvarov. @");
LSTR MSG_SHAPING_FREQ = _UxGT("Frekvencia @");
LSTR MSG_SHAPING_ZETA = _UxGT("Tlmenie @");
LSTR MSG_SHAPING_ENABLE_N = _UxGT("Povol. tvarov. @");
LSTR MSG_SHAPING_DISABLE_N = _UxGT("Zakáz. tvarov. @");
LSTR MSG_SHAPING_FREQ_N = _UxGT("Frekvencia @");
LSTR MSG_SHAPING_ZETA_N = _UxGT("Tlmenie @");
LSTR MSG_XY_FREQUENCY_LIMIT = _UxGT("Max. frekvencia");
LSTR MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Min. posun");
LSTR MSG_STEPS_PER_MM = _UxGT("Kroky/mm");
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/language/language_tr.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,10 @@ namespace LanguageNarrow_tr {
LSTR MSG_A_RETRACT = _UxGT("G.Çekme Hızı");
LSTR MSG_A_TRAVEL = _UxGT("Gezinme Hızı");
LSTR MSG_INPUT_SHAPING = _UxGT("Input Shaping");
LSTR MSG_SHAPING_ENABLE = _UxGT("@ Biçimlemeyi Aç");
LSTR MSG_SHAPING_DISABLE = _UxGT("@ Biçimlemeyi Kapat");
LSTR MSG_SHAPING_FREQ = _UxGT("@ frekans");
LSTR MSG_SHAPING_ZETA = _UxGT("@ sönümleme");
LSTR MSG_SHAPING_ENABLE_N = _UxGT("@ Biçimlemeyi Aç");
LSTR MSG_SHAPING_DISABLE_N = _UxGT("@ Biçimlemeyi Kapat");
LSTR MSG_SHAPING_FREQ_N = _UxGT("@ frekans");
LSTR MSG_SHAPING_ZETA_N = _UxGT("@ sönümleme");
LSTR MSG_SHAPING_A_FREQ = STR_A _UxGT(" frekansı"); // ProUI
LSTR MSG_SHAPING_B_FREQ = STR_B _UxGT(" frekansı"); // ProUI
LSTR MSG_SHAPING_C_FREQ = STR_C _UxGT(" frekansı"); // ProUI
Expand Down
28 changes: 14 additions & 14 deletions Marlin/src/lcd/menu/menu_advanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,20 +559,20 @@ void menu_backlash();
BACK_ITEM(MSG_ADVANCED_SETTINGS);

// M593 F Frequency and D Damping ratio
#define SHAPING_MENU_FOR_AXIS(AXIS) \
editable.decimal = stepper.get_shaping_frequency(AXIS); \
if (editable.decimal) { \
ACTION_ITEM_N(AXIS, MSG_SHAPING_DISABLE, []{ stepper.set_shaping_frequency(AXIS, 0.0f); ui.refresh(); }); \
EDIT_ITEM_FAST_N(float41, AXIS, MSG_SHAPING_FREQ, &editable.decimal, min_frequency, 200.0f, []{ stepper.set_shaping_frequency(AXIS, editable.decimal); }); \
editable.decimal = stepper.get_shaping_damping_ratio(AXIS); \
EDIT_ITEM_FAST_N(float42_52, AXIS, MSG_SHAPING_ZETA, &editable.decimal, 0.0f, 1.0f, []{ stepper.set_shaping_damping_ratio(AXIS, editable.decimal); }); \
} \
else \
ACTION_ITEM_N(AXIS, MSG_SHAPING_ENABLE, []{ stepper.set_shaping_frequency(AXIS, (SHAPING_FREQ_X) ?: (SHAPING_MIN_FREQ)); ui.refresh(); });

TERN_(INPUT_SHAPING_X, SHAPING_MENU_FOR_AXIS(X_AXIS))
TERN_(INPUT_SHAPING_Y, SHAPING_MENU_FOR_AXIS(Y_AXIS))
TERN_(INPUT_SHAPING_Z, SHAPING_MENU_FOR_AXIS(Z_AXIS))
#define SHAPING_MENU_FOR_AXIS(A) \
editable.decimal = stepper.get_shaping_frequency(_AXIS(A)); \
if (editable.decimal) { \
ACTION_ITEM_N(_AXIS(A), MSG_SHAPING_DISABLE_N, []{ stepper.set_shaping_frequency(_AXIS(A), 0.0f); ui.refresh(); }); \
EDIT_ITEM_FAST_N(float41, _AXIS(A), MSG_SHAPING_FREQ_N, &editable.decimal, min_frequency, 200.0f, []{ stepper.set_shaping_frequency(_AXIS(A), editable.decimal); }); \
editable.decimal = stepper.get_shaping_damping_ratio(_AXIS(A)); \
EDIT_ITEM_FAST_N(float42_52, _AXIS(A), MSG_SHAPING_ZETA_N, &editable.decimal, 0.0f, 1.0f, []{ stepper.set_shaping_damping_ratio(_AXIS(A), editable.decimal); }); \
} \
else \
ACTION_ITEM_N(_AXIS(A), MSG_SHAPING_ENABLE_N, []{ stepper.set_shaping_frequency(_AXIS(A), (SHAPING_FREQ_##A) ?: (SHAPING_MIN_FREQ)); ui.refresh(); });

TERN_(INPUT_SHAPING_X, SHAPING_MENU_FOR_AXIS(X))
TERN_(INPUT_SHAPING_Y, SHAPING_MENU_FOR_AXIS(Y))
TERN_(INPUT_SHAPING_Z, SHAPING_MENU_FOR_AXIS(Z))

END_MENU();
}
Expand Down

0 comments on commit 9a9fcc8

Please sign in to comment.