Skip to content

Commit

Permalink
Corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
chrbcd committed Mar 3, 2024
1 parent 8779eda commit 9329d2c
Show file tree
Hide file tree
Showing 10 changed files with 217 additions and 101 deletions.
114 changes: 57 additions & 57 deletions Marlin/Configuration.h

Large diffs are not rendered by default.

56 changes: 30 additions & 26 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@
* Multiple extruders can be assigned to the same pin in which case
* the fan will turn on when any selected extruder is above the threshold.
*/
#define E0_AUTO_FAN_PIN -1
#define E0_AUTO_FAN_PIN FAN1_PIN
#define E1_AUTO_FAN_PIN -1
#define E2_AUTO_FAN_PIN -1
#define E3_AUTO_FAN_PIN -1
Expand Down Expand Up @@ -1200,8 +1200,8 @@
* X<1> Set the given parameters only for the X axis.
* Y<1> Set the given parameters only for the Y axis.
*/
//#define INPUT_SHAPING_X
//#define INPUT_SHAPING_Y
#define INPUT_SHAPING_X
#define INPUT_SHAPING_Y
#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y)
#if ENABLED(INPUT_SHAPING_X)
#define SHAPING_FREQ_X 40 // (Hz) The default dominant resonant frequency on the X axis.
Expand Down Expand Up @@ -1493,7 +1493,7 @@
#endif

#if HAS_BED_PROBE && ANY(HAS_MARLINUI_MENU, HAS_TFT_LVGL_UI)
//#define PROBE_OFFSET_WIZARD // Add a Probe Z Offset calibration option to the LCD menu
#define PROBE_OFFSET_WIZARD // Add a Probe Z Offset calibration option to the LCD menu
#if ENABLED(PROBE_OFFSET_WIZARD)
/**
* Enable to init the Probe Z-Offset when starting the Wizard.
Expand Down Expand Up @@ -1743,7 +1743,7 @@
* an option on the LCD screen to continue the print from the last-known
* point in the file.
*/
//#define POWER_LOSS_RECOVERY
#define POWER_LOSS_RECOVERY
#if ENABLED(POWER_LOSS_RECOVERY)
#define PLR_ENABLED_DEFAULT false // Power-Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
//#define PLR_BED_THRESHOLD BED_MAXTEMP // (°C) Skip user confirmation at or above this bed temperature (0 to disable)
Expand Down Expand Up @@ -1815,7 +1815,7 @@
// LCD's font must contain the characters. Check your selected LCD language.
//#define UTF_FILENAME_SUPPORT

//#define LONG_FILENAME_HOST_SUPPORT // Get the long filename of a file/folder with 'M33 <dosname>' and list long filenames with 'M20 L'
#define LONG_FILENAME_HOST_SUPPORT // Get the long filename of a file/folder with 'M33 <dosname>' and list long filenames with 'M20 L'
//#define LONG_FILENAME_WRITE_SUPPORT // Create / delete files with long filenames via M28, M30, and Binary Transfer Protocol
//#define M20_TIMESTAMP_SUPPORT // Include timestamps by adding the 'T' flag to M20 commands

Expand Down Expand Up @@ -1851,7 +1851,7 @@
*
* [1] On AVR an interrupt-capable pin is best for UHS3 compatibility.
*/
//#define USB_FLASH_DRIVE_SUPPORT
#define USB_FLASH_DRIVE_SUPPORT
#if ENABLED(USB_FLASH_DRIVE_SUPPORT)
/**
* USB Host Shield Library
Expand All @@ -1866,12 +1866,12 @@
//#define USE_UHS2_USB
//#define USE_UHS3_USB

#define DISABLE_DUE_SD_MMC // Disable USB Host access to USB Drive to prevent hangs on block access for DUE platform
//#define DISABLE_DUE_SD_MMC // Disable USB Host access to USB Drive to prevent hangs on block access for DUE platform

/**
* Native USB Host supported by some boards (USB OTG)
*/
//#define USE_OTG_USB_HOST
#define USE_OTG_USB_HOST

#if DISABLED(USE_OTG_USB_HOST)
#define USB_CS_PIN SDSS
Expand Down Expand Up @@ -1904,11 +1904,11 @@
//#define CONFIGURATION_EMBEDDING

// Add an optimized binary file transfer mode, initiated with 'M28 B1'
//#define BINARY_FILE_TRANSFER
#define BINARY_FILE_TRANSFER

#if ENABLED(BINARY_FILE_TRANSFER)
// Include extra facilities (e.g., 'M20 F') supporting firmware upload via BINARY_FILE_TRANSFER
//#define CUSTOM_FIRMWARE_UPLOAD
#define CUSTOM_FIRMWARE_UPLOAD
#endif

/**
Expand All @@ -1929,7 +1929,7 @@
* Multiple volume support - EXPERIMENTAL.
* Adds 'M21 Pm' / 'M21 S' / 'M21 U' to mount SD Card / USB Drive.
*/
//#define MULTI_VOLUME
#define MULTI_VOLUME
#if ENABLED(MULTI_VOLUME)
#define VOLUME_SD_ONBOARD
#define VOLUME_USB_FLASH_DRIVE
Expand Down Expand Up @@ -2266,7 +2266,7 @@
*
* Warning: Does not respect endstops!
*/
//#define BABYSTEPPING
#define BABYSTEPPING
#if ENABLED(BABYSTEPPING)
//#define EP_BABYSTEPPING // M293/M294 babystepping with EMERGENCY_PARSER support
//#define BABYSTEP_WITHOUT_HOMING
Expand All @@ -2287,9 +2287,9 @@
#endif
#endif

//#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28
#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28

//#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
//#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets
//#define BABYSTEP_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
Expand Down Expand Up @@ -4003,32 +4003,36 @@
// @section custom main menu

// Custom Menu: Main Menu
//#define CUSTOM_MENU_MAIN
#define CUSTOM_MENU_MAIN
#if ENABLED(CUSTOM_MENU_MAIN)
//#define CUSTOM_MENU_MAIN_TITLE "Custom Commands"
#define CUSTOM_MENU_MAIN_SCRIPT_DONE "M117 User Script Done"
#define CUSTOM_MENU_MAIN_SCRIPT_AUDIBLE_FEEDBACK
//#define CUSTOM_MENU_MAIN_SCRIPT_RETURN // Return to status screen after a script
#define CUSTOM_MENU_MAIN_ONLY_IDLE // Only show custom menu when the machine is idle

#define MAIN_MENU_ITEM_1_DESC "Home & UBL Info"
#define MAIN_MENU_ITEM_1_GCODE "G28\nG29 W"
#define MAIN_MENU_ITEM_1_DESC ""
#define MAIN_MENU_ITEM_1_GCODE "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
//#define MAIN_MENU_ITEM_1_CONFIRM // Show a confirmation dialog before this action

#define MAIN_MENU_ITEM_2_DESC "Preheat for " PREHEAT_1_LABEL
#define MAIN_MENU_ITEM_2_GCODE "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define MAIN_MENU_ITEM_2_DESC ""
#define MAIN_MENU_ITEM_2_GCODE "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
//#define MAIN_MENU_ITEM_2_CONFIRM

//#define MAIN_MENU_ITEM_3_DESC "Preheat for " PREHEAT_2_LABEL
//#define MAIN_MENU_ITEM_3_GCODE "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define MAIN_MENU_ITEM_3_DESC "Arrêt"
#define MAIN_MENU_ITEM_3_GCODE "M104 S0; M140 S0"
//#define MAIN_MENU_ITEM_3_CONFIRM

//#define MAIN_MENU_ITEM_4_DESC "Heat Bed/Home/Level"
//#define MAIN_MENU_ITEM_4_GCODE "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
#define MAIN_MENU_ITEM_4_DESC "Offset 0"
#define MAIN_MENU_ITEM_4_GCODE "G28;G0 X150 Y150;G0 Z0;"
//#define MAIN_MENU_ITEM_4_CONFIRM

//#define MAIN_MENU_ITEM_5_DESC "Home & Info"
//#define MAIN_MENU_ITEM_5_GCODE "G28\nM503"
#define MAIN_MENU_ITEM_5_DESC "Offset +"
#define MAIN_MENU_ITEM_5_GCODE "M290 Z+0.025"
//#define MAIN_MENU_ITEM_5_CONFIRM

#define MAIN_MENU_ITEM_6_DESC "Offset -"
#define MAIN_MENU_ITEM_6_GCODE "M290 Z+0.025"
//#define MAIN_MENU_ITEM_5_CONFIRM
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void lv_draw_auto_level_offset_settings() {
dtostrf(TERN0(HAS_PROBE_XY_OFFSET, probe.offset.y), 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.Yoffset, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_OFFSET_Y, 1, public_buf_l);

dtostrf(TERN0(HAS_PROBE_XY_OFFSET, probe.offset.z), 1, 1, public_buf_l);
dtostrf(TERN0(HAS_PROBE_XY_OFFSET, probe.offset.z), 1, 3, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.Zoffset, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_OFFSET_Z, 2, public_buf_l);

lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_OFFSET_RETURN, true);
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,9 @@ void filament_dialog_handle() {
uiCfg.filament_loading_time_flg = true;
uiCfg.filament_loading_time_cnt = 0;
#if HAS_TOOLCHANGE
sprintf_P(public_buf_m, PSTR("T%d\nG91\nG1 E%d F%d\nG90"), uiCfg.extruderIndex, gCfgItems.filamentchange_load_length, gCfgItems.filamentchange_load_speed);
sprintf_P(public_buf_m, PSTR("T%d\nG91\nG1 E%d F%d\nG90"), uiCfg.extruderIndex, chr_filament_change_load_length, gCfgItems.filamentchange_load_speed);
#else
sprintf_P(public_buf_m, PSTR("G91\nG1 E%d F%d\nG90"), gCfgItems.filamentchange_load_length, gCfgItems.filamentchange_load_speed);
sprintf_P(public_buf_m, PSTR("G91\nG1 E%d F%d\nG90"), chr_filament_change_load_length, gCfgItems.filamentchange_load_speed);
#endif
queue.inject(public_buf_m);
}
Expand All @@ -492,9 +492,9 @@ void filament_dialog_handle() {
uiCfg.filament_unloading_time_flg = true;
uiCfg.filament_unloading_time_cnt = 0;
#if HAS_TOOLCHANGE
sprintf_P(public_buf_m, PSTR("T%d\nG91\nG1 E-%d F%d\nG90"), uiCfg.extruderIndex, gCfgItems.filamentchange_unload_length, gCfgItems.filamentchange_unload_speed);
sprintf_P(public_buf_m, PSTR("T%d\nG91\nG1 E-%d F%d\nG90"), uiCfg.extruderIndex, chr_filament_change_unload_length, gCfgItems.filamentchange_unload_speed);
#else
sprintf_P(public_buf_m, PSTR("G91\nG1 E-%d F%d\nG90"), gCfgItems.filamentchange_unload_length, gCfgItems.filamentchange_unload_speed);
sprintf_P(public_buf_m, PSTR("G91\nG1 E-%d F%d\nG90"), chr_filament_change_unload_length, gCfgItems.filamentchange_unload_speed);
#endif
queue.inject(public_buf_m);
}
Expand Down
86 changes: 85 additions & 1 deletion Marlin/src/lcd/extui/mks_ui/draw_filament_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,21 @@ static lv_obj_t *scr;
static lv_obj_t *buttonType;
static lv_obj_t *labelType;
static lv_obj_t *tempText1;
//CB
static int chr_fil_load = 0;
static int chr_fil_unload = 0;
static lv_obj_t *buttonFilamenLengthLoad;
static lv_obj_t *labelFilamenLengthLoad;
static lv_obj_t *buttonFilamenLengthUnload;
static lv_obj_t *labelFilamenLengthUnload;

enum {
ID_FILAMNT_IN = 1,
ID_FILAMNT_OUT,
ID_FILAMNT_TYPE,
ID_FILAMNT_RETURN
ID_FILAMNT_RETURN,
ID_FILAMNT_LENGTH_LOAD,
ID_FILAMNT_LENGTH_UNLOAD
};

static void event_handler(lv_obj_t *obj, lv_event_t event) {
Expand Down Expand Up @@ -103,6 +112,23 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {

goto_previous_ui();
break;
case ID_FILAMNT_LENGTH_LOAD:
switch (chr_fil_load){
case 0: chr_filament_change_load_length = 100; chr_fil_load = 1; break;
case 1: chr_filament_change_load_length = 400; chr_fil_load = 2; break;
case 2: chr_filament_change_load_length = gCfgItems.filamentchange_load_length; chr_fil_load = 0; break;
}
disp_filament_length_load();
break;
case ID_FILAMNT_LENGTH_UNLOAD:
switch (chr_fil_unload){
case 0: chr_filament_change_unload_length = 100; chr_fil_unload = 1; break;
case 1: chr_filament_change_unload_length = 400; chr_fil_unload = 2; break;
case 2: chr_filament_change_unload_length = gCfgItems.filamentchange_unload_length; chr_fil_unload = 0; break;
}
disp_filament_length_unload();
break;

}
}

Expand All @@ -125,12 +151,70 @@ void lv_draw_filament_change() {
labelType = lv_label_create_empty(buttonType);

disp_filament_type();
//CB
buttonFilamenLengthLoad = lv_imgbtn_create (scr, "F:/bmp_step5_mm.bin",INTERVAL_V + BTN_X_PIXEL , BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_FILAMNT_LENGTH_LOAD);
labelFilamenLengthLoad = lv_label_create_empty(buttonFilamenLengthLoad);
#if HAS_ROTARY_ENCODER
if (gCfgItems.encoder_enable)
lv_group_add_obj(g, buttonFilamenLengthLoad);
#endif
disp_filament_length_load();
buttonFilamenLengthUnload = lv_imgbtn_create (scr, "F:/bmp_step5_mm.bin",INTERVAL_V + BTN_X_PIXEL * 2 , BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_FILAMNT_LENGTH_UNLOAD);
labelFilamenLengthUnload = lv_label_create_empty(buttonFilamenLengthUnload);
#if HAS_ROTARY_ENCODER
if (gCfgItems.encoder_enable)
lv_group_add_obj(g, buttonFilamenLengthUnload);
#endif
disp_filament_length_unload();


tempText1 = lv_label_create_empty(scr);
lv_obj_set_style(tempText1, &tft_style_label_rel);
disp_filament_temp();
//CB 090124 pour eviter bug remplacement imge de in par l'image extruder apres chargement de filament
lv_imgbtn_set_src_both(buttonIn, "F:/bmp_in.bin");
}

void disp_filament_length_load(){
char buf1[15] = {0};
switch (chr_fil_load){
case 0: //lv_imgbtn_set_src_both(buttonFilamenLengthLoad, "F:/bmp_step5_mm.bin");
sprintf(buf1,"Ins %d mm", chr_filament_change_load_length);//gCfgItems.filamentchange_load_length);
lv_label_set_text(labelFilamenLengthLoad, buf1);
lv_obj_align(labelFilamenLengthLoad, buttonFilamenLengthLoad, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
break;
case 1: //lv_imgbtn_set_src_both(buttonFilamenLengthLoad, "F:/bmp_step1_mm.bin");
sprintf(buf1,"Ins %d mm", chr_filament_change_load_length); //100
lv_label_set_text(labelFilamenLengthLoad, buf1);
lv_obj_align(labelFilamenLengthLoad, buttonFilamenLengthLoad, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
break;
case 2: //lv_imgbtn_set_src_both(buttonFilamenLengthLoad, "F:/bmp_step10_mm.bin");
sprintf(buf1,"Ins %d mm", chr_filament_change_load_length);//400
lv_label_set_text(labelFilamenLengthLoad, buf1);
lv_obj_align(labelFilamenLengthLoad, buttonFilamenLengthLoad, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
break;
}
}
void disp_filament_length_unload(){
char buf1[15] = {0};
switch (chr_fil_unload){
case 0: //lv_imgbtn_set_src_both(buttonFilamenLengthUnload, "F:/bmp_step5_mm.bin");
sprintf(buf1,"Ejec %d mm", chr_filament_change_unload_length);//gCfgItems.filamentchange_load_length);
lv_label_set_text(labelFilamenLengthUnload, buf1);
lv_obj_align(labelFilamenLengthUnload, buttonFilamenLengthUnload, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
break;
case 1: //lv_imgbtn_set_src_both(buttonFilamenLengthUnload, "F:/bmp_step1_mm.bin");
sprintf(buf1,"Ejec %d mm", chr_filament_change_unload_length); //100
lv_label_set_text(labelFilamenLengthUnload, buf1);
lv_obj_align(labelFilamenLengthUnload, buttonFilamenLengthUnload, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
break;
case 2: //lv_imgbtn_set_src_both(buttonFilamenLengthUnload, "F:/bmp_step10_mm.bin");
sprintf(buf1,"Ejec %d mm", chr_filament_change_unload_length);//400
lv_label_set_text(labelFilamenLengthUnload, buf1);
lv_obj_align(labelFilamenLengthUnload, buttonFilamenLengthUnload, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
break;
}
}
void disp_filament_type() {
if (uiCfg.extruderIndex == 1) {
lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru2.bin");
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/lcd/extui/mks_ui/draw_filament_change.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ void lv_draw_filament_change();
void lv_clear_filament_change();
void disp_filament_type();
void disp_filament_temp();
//CB
void disp_filament_length_load();
void disp_filament_length_unload();

#ifdef __cplusplus
} /* C-declarations for C++ */
Expand Down
7 changes: 7 additions & 0 deletions Marlin/src/lcd/extui/mks_ui/draw_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ DISP_STATE last_disp_state;
PRINT_TIME print_time;
num_key_value_state value;
keyboard_value_state keyboard_value;
//CB
int chr_filament_change_load_length;
int chr_filament_change_unload_length;

uint32_t To_pre_view;
bool gcode_preview_over, flash_preview_begin, default_preview_flg;
Expand Down Expand Up @@ -203,6 +206,10 @@ void ui_cfg_init() {
uiCfg.filament_unloading_time_flg = false;
uiCfg.filament_unloading_time_cnt = 0;

//CB
chr_filament_change_load_length = gCfgItems.filamentchange_load_length;
chr_filament_change_unload_length = gCfgItems.filamentchange_unload_length;

#if ENABLED(MKS_WIFI_MODULE)
memset(&wifiPara, 0, sizeof(wifiPara));
memset(&ipPara, 0, sizeof(ipPara));
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/lcd/extui/mks_ui/draw_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,10 @@ typedef enum {
} keyboard_value_state;
extern keyboard_value_state keyboard_value;

//CB
extern int chr_filament_change_load_length;
extern int chr_filament_change_unload_length;

extern CFG_ITMES gCfgItems;
extern UI_CFG uiCfg;
extern DISP_STATE disp_state;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/mks_ui/tft_Language_fr.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define TOOL_TEXT_FR "Prêt"
#define PREHEAT_TEXT_FR "Préchauffe"
#define MOVE_TEXT_FR "Déplace"
#define HOME_TEXT_FR "Acceuil"
#define HOME_TEXT_FR "Accueil"
#define PRINT_TEXT_FR "Impression"
#define EXTRUDE_TEXT_FR "Extruder"
#define LEVELING_TEXT_FR "Leveling"
Expand Down
Loading

0 comments on commit 9329d2c

Please sign in to comment.