Skip to content

Add "more" menu in LVGL interface#20940

Merged
thinkyhead merged 11 commits intoMarlinFirmware:bugfix-2.0.xfrom
Malderin:bugfix2.0_more_menu_lvgl
Feb 2, 2021
Merged

Add "more" menu in LVGL interface#20940
thinkyhead merged 11 commits intoMarlinFirmware:bugfix-2.0.xfrom
Malderin:bugfix2.0_more_menu_lvgl

Conversation

@Malderin
Copy link
Contributor

Description

Added "more" menu when using the interface from MKS LVGL (#define TFT_LVGL_UI in configuration.h). The menu is activated by the #define CUSTOM_USER_MENUS parameter in configuration_adv.h It is possible to add up to 7 custom commands.
Tested on MKS Robin nano v.2 with mks tft 35.

1
2

@rhapsodyv
Copy link
Member

Getting better :-)

You should not enable by default it, on the configuration_adv.

Test this branch too, to check if all the draw_more code are there

@Malderin
Copy link
Contributor Author

You should not enable by default it, on the configuration_adv.

done

@rhapsodyv
Copy link
Member

Congratulations! :-)

Scott may review the config you added and he may merge it soon.

@ETE-Design
Copy link
Contributor

ETE-Design commented Jan 31, 2021

How to define what icon's the different custom buttons use?
@rhapsodyv The way this change is made seems not the best way to do it cause it also change the LCD12864 Custom Menu with lineshift in title menus and also remove some "/n" in the G-Code so it will break if used on LCD12864 Right? Mabye it would be better to make a Custom Menu for LVGL and one for the rest of us using LCD12864?
Also why change "Heat Bed/Home/Level" G-Code to "Turn On Cooling" theese changes seems to only been made cause the user who wan't this merge find it nice to have on his machine...
Pls. Don't merge before the Custom Menu's have been split up in two sections Like:

#define CUSTOM_USER_MENUS
#define CUSTOM_USER_MENUS_LVGL

@rhapsodyv
Copy link
Member

The changes in the default config probably will be reverted by @thinkyhead.
There's no reason to change the default config.
And, even if so, no one should rely entire on the default values, because they aren't made for any specific printer in mind.

@Malderin
Copy link
Contributor Author

Malderin commented Jan 31, 2021

@rhapsodyv .
To resolve the conflict with other displays (eg LCD12864), configuration_adv.h can be changed as follows?

//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
  //#define CUSTOM_USER_MENU_TITLE "Custom Commands"
  #define USER_SCRIPT_DONE "M117 User Script Done"
  #define USER_SCRIPT_AUDIBLE_FEEDBACK
  //#define USER_SCRIPT_RETURN  // Return to status screen after a script

  #if ENABLED(TFT_LVGL_UI)
    #define USER_CMD_1_ENABLE
    #define USER_DESC_1 "Bed"
    #define USER_GCODE_1 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED)

    #define USER_CMD_2_ENABLE
    #define USER_DESC_2 "Preheat \n for " PREHEAT_1_LABEL
    #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)

    #define USER_CMD_3_ENABLE
    #define USER_DESC_3 "Preheat \n for " PREHEAT_2_LABEL
    #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)

    #define USER_CMD_4_ENABLE
    #define USER_DESC_4 "cooling"
    #define USER_GCODE_4 "M108\nM106 255"

    #define USER_CMD_5_ENABLE
    #define USER_DESC_5 "All home"
    #define USER_GCODE_5 "G28"
  #else
    #define USER_DESC_1 "Home & UBL Info"
    #define USER_GCODE_1 "G28\nG29W"

    #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL
    #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)

    #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL
    #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)

    #define USER_DESC_4 "Heat Bed/Home/Level"
    #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"

    #define USER_DESC_5 "Home & Info"
    #define USER_GCODE_5 "G28\nM503"
  #endif
#endif

@Malderin
Copy link
Contributor Author

How to define what icon's the different custom buttons use?

The icons are always the same, the first 4 are as in the screenshot above, the rest look the same as icon 5

@thinkyhead thinkyhead added Needs: Work More work is needed and removed S: Please Merge labels Jan 31, 2021
@X-Ryl669
Copy link
Contributor

I've made some change in the G-Code console in that does also reenable it : #20755

@rhapsodyv
Copy link
Member

I made the custom user menus code in a "marlin way", so I think it's ready to be reviewed and merged.

@X-Ryl669
Copy link
Contributor

X-Ryl669 commented Feb 1, 2021

Looks good to me. Thanks.

@Malderin
Copy link
Contributor Author

Malderin commented Feb 1, 2021

Looks good to me. Thanks.

This pr is no longer relevant. See 7c3121c

@X-Ryl669
Copy link
Contributor

X-Ryl669 commented Feb 1, 2021

What is the conflict you are referring to ?

@X-Ryl669
Copy link
Contributor

X-Ryl669 commented Feb 1, 2021

Thanks!

@Malderin
Copy link
Contributor Author

Malderin commented Feb 2, 2021

@rhapsodyv

  #if BUTTONS_EXIST(EN1, EN2, ENC)
    if (enc_ena) {
      lv_group_add_obj(g, buttonGCode);
      TERN_(USER_CMD_1_ENABLE, lv_group_add_obj(g, buttonCustom1));
      TERN_(USER_CMD_2_ENABLE, lv_group_add_obj(g, buttonCustom2));
      TERN_(USER_CMD_3_ENABLE, lv_group_add_obj(g, buttonCustom3));
      TERN_(USER_CMD_4_ENABLE, lv_group_add_obj(g, buttonCustom4));
      TERN_(USER_CMD_5_ENABLE, lv_group_add_obj(g, buttonCustom5));
      TERN_(USER_CMD_6_ENABLE, lv_group_add_obj(g, buttonCustom6));
      lv_group_add_obj(g, buttonBack);
    }
  #endif

In the draw_more.cpp file, USER_CMD_1_ENABLE (2, 3 ... 6) forgot to change to CUSTOM_USER_MENU_ITEM_1 (2, 3 ... 6)?

@thinkyhead thinkyhead merged commit 9025c63 into MarlinFirmware:bugfix-2.0.x Feb 2, 2021
Jyers pushed a commit to Jyers/Marlin that referenced this pull request Feb 3, 2021
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
susisstrolch pushed a commit to susisstrolch/Marlin that referenced this pull request Feb 16, 2021
… into bugfix-2.0.x

* 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin: (121 commits)
  [cron] Bump distribution date (2021-02-04)
  [cron] Bump distribution date (2021-02-03)
  Add "more" menu in LVGL interface (MarlinFirmware#20940)
  Evaluate ANY_SERIAL_IS in place
  Note (MarlinUI) limit on PREHEAT settings (MarlinFirmware#20966)
  Update a UBL comment (MarlinFirmware#20931)
  STM32 Shared Media - USB Mass Storage Device (MarlinFirmware#20956)
  Multi-language pertains to Color UI (MarlinFirmware#20972)
  Touch Calibration Screen auto-save option (MarlinFirmware#20971)
  Include ui_common for MARLIN_LOGO_FULL_SIZE (MarlinFirmware#20963)
  Fix host_response_handler compile (MarlinFirmware#20962)
  [cron] Bump distribution date (2021-02-02)
  LVGL UI G-code console (MarlinFirmware#20755)
  [cron] Bump distribution date (2021-02-01)
  Refresh screen on M22 (detach) (MarlinFirmware#20958)
  Fix AutoReporter implementation (MarlinFirmware#20959)
  Serial refactor followup (MarlinFirmware#20932)
  Init serial ports first (MarlinFirmware#20944)
  Remove extra G29 V newlines (MarlinFirmware#20955)
  [cron] Bump distribution date (2021-01-31)
  ...
kpishere pushed a commit to kpishere/Marlin that referenced this pull request Feb 19, 2021
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
zillarob pushed a commit to zillarob/Marlin that referenced this pull request Feb 25, 2021
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
zillarob pushed a commit to zillarob/Marlin that referenced this pull request Feb 25, 2021
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
zillarob pushed a commit to zillarob/Marlin that referenced this pull request Feb 26, 2021
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
zillarob pushed a commit to zillarob/Marlin that referenced this pull request Mar 11, 2021
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
W4tel-BiDi pushed a commit to W4tel-BiDi/Marlin that referenced this pull request Apr 5, 2021
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
thinkyhead added a commit that referenced this pull request Apr 30, 2021
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] CUSTOM_USER_MENUS for LVGL UI

5 participants