|
|
|
@ -34,10 +34,11 @@
|
|
|
|
|
|
|
|
|
|
#include <SPI.h>
|
|
|
|
|
|
|
|
|
|
#include "../../../../MarlinCore.h"
|
|
|
|
|
#include "../../../../MarlinCore.h" // for marlin_state
|
|
|
|
|
#include "../../../../sd/cardreader.h"
|
|
|
|
|
#include "../../../../module/motion.h"
|
|
|
|
|
#include "../../../../module/planner.h"
|
|
|
|
|
#include "../../../../inc/MarlinConfig.h"
|
|
|
|
|
|
|
|
|
|
#if ENABLED(POWER_LOSS_RECOVERY)
|
|
|
|
|
#include "../../../../feature/powerloss.h"
|
|
|
|
@ -57,15 +58,13 @@ num_key_value_state value;
|
|
|
|
|
keyboard_value_state keyboard_value;
|
|
|
|
|
|
|
|
|
|
uint32_t To_pre_view;
|
|
|
|
|
uint8_t gcode_preview_over;
|
|
|
|
|
uint8_t flash_preview_begin;
|
|
|
|
|
uint8_t default_preview_flg;
|
|
|
|
|
bool gcode_preview_over, flash_preview_begin, default_preview_flg;
|
|
|
|
|
uint32_t size = 809;
|
|
|
|
|
uint16_t row;
|
|
|
|
|
uint8_t temperature_change_frequency;
|
|
|
|
|
uint8_t printing_rate_update_flag;
|
|
|
|
|
|
|
|
|
|
extern uint8_t once_flag;
|
|
|
|
|
extern bool once_flag;
|
|
|
|
|
extern uint8_t sel_id;
|
|
|
|
|
extern uint8_t public_buf[512];
|
|
|
|
|
extern uint8_t bmp_public_buf[17 * 1024];
|
|
|
|
@ -116,10 +115,10 @@ void gCfgItems_init() {
|
|
|
|
|
gCfgItems.language = LANG_PORTUGUESE;
|
|
|
|
|
#endif
|
|
|
|
|
gCfgItems.leveling_mode = 0;
|
|
|
|
|
gCfgItems.from_flash_pic = 0;
|
|
|
|
|
gCfgItems.from_flash_pic = false;
|
|
|
|
|
gCfgItems.curFilesize = 0;
|
|
|
|
|
gCfgItems.finish_power_off = 0;
|
|
|
|
|
gCfgItems.pause_reprint = 0;
|
|
|
|
|
gCfgItems.finish_power_off = false;
|
|
|
|
|
gCfgItems.pause_reprint = false;
|
|
|
|
|
gCfgItems.pausePosX = -1;
|
|
|
|
|
gCfgItems.pausePosY = -1;
|
|
|
|
|
gCfgItems.pausePosZ = 5;
|
|
|
|
@ -407,7 +406,6 @@ void tft_style_init() {
|
|
|
|
|
lv_bar_style_indic.body.main_color = lv_color_hex3(0xADF);
|
|
|
|
|
lv_bar_style_indic.body.grad_color = lv_color_hex3(0xADF);
|
|
|
|
|
lv_bar_style_indic.body.border.color = lv_color_hex3(0xADF);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define MAX_TITLE_LEN 28
|
|
|
|
@ -609,14 +607,14 @@ char *creat_title_text() {
|
|
|
|
|
pre_read_cnt = (uint32_t)p1 - (uint32_t)((uint32_t *)(&public_buf[0]));
|
|
|
|
|
|
|
|
|
|
To_pre_view = pre_read_cnt;
|
|
|
|
|
gcode_preview_over = 1;
|
|
|
|
|
gCfgItems.from_flash_pic = 1;
|
|
|
|
|
gcode_preview_over = true;
|
|
|
|
|
gCfgItems.from_flash_pic = true;
|
|
|
|
|
update_spi_flash();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
gcode_preview_over = 0;
|
|
|
|
|
default_preview_flg = 1;
|
|
|
|
|
gCfgItems.from_flash_pic = 0;
|
|
|
|
|
gcode_preview_over = false;
|
|
|
|
|
default_preview_flg = true;
|
|
|
|
|
gCfgItems.from_flash_pic = false;
|
|
|
|
|
update_spi_flash();
|
|
|
|
|
}
|
|
|
|
|
card.closefile();
|
|
|
|
@ -681,8 +679,8 @@ char *creat_title_text() {
|
|
|
|
|
size = 809;
|
|
|
|
|
row = 0;
|
|
|
|
|
|
|
|
|
|
gcode_preview_over = 0;
|
|
|
|
|
//flash_preview_begin = 1;
|
|
|
|
|
gcode_preview_over = false;
|
|
|
|
|
//flash_preview_begin = true;
|
|
|
|
|
|
|
|
|
|
card.closefile();
|
|
|
|
|
|
|
|
|
@ -696,7 +694,7 @@ char *creat_title_text() {
|
|
|
|
|
//bakup_file_path((uint8_t *)curFileName, strlen(curFileName));
|
|
|
|
|
srcfp = file;
|
|
|
|
|
mksReprint.mks_printer_state = MKS_WORKING;
|
|
|
|
|
once_flag = 0;
|
|
|
|
|
once_flag = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
@ -727,7 +725,7 @@ char *creat_title_text() {
|
|
|
|
|
#endif
|
|
|
|
|
card.startFileprint();
|
|
|
|
|
TERN_(POWER_LOSS_RECOVERY, recovery.prepare());
|
|
|
|
|
once_flag = 0;
|
|
|
|
|
once_flag = false;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -813,8 +811,8 @@ char *creat_title_text() {
|
|
|
|
|
size = 809;
|
|
|
|
|
row = 0;
|
|
|
|
|
|
|
|
|
|
gcode_preview_over = 0;
|
|
|
|
|
//flash_preview_begin = 1;
|
|
|
|
|
gcode_preview_over = false;
|
|
|
|
|
//flash_preview_begin = true;
|
|
|
|
|
|
|
|
|
|
card.closefile();
|
|
|
|
|
|
|
|
|
@ -828,7 +826,7 @@ char *creat_title_text() {
|
|
|
|
|
//bakup_file_path((uint8_t *)curFileName, strlen(curFileName));
|
|
|
|
|
srcfp = file;
|
|
|
|
|
mksReprint.mks_printer_state = MKS_WORKING;
|
|
|
|
|
once_flag = 0;
|
|
|
|
|
once_flag = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
@ -859,7 +857,7 @@ char *creat_title_text() {
|
|
|
|
|
#endif
|
|
|
|
|
card.startFileprint();
|
|
|
|
|
TERN_(POWER_LOSS_RECOVERY, recovery.prepare());
|
|
|
|
|
once_flag = 0;
|
|
|
|
|
once_flag = false;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -894,17 +892,17 @@ char *creat_title_text() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void disp_pre_gcode(int xpos_pixel, int ypos_pixel) {
|
|
|
|
|
if (gcode_preview_over == 1) gcode_preview(list_file.file_name[sel_id], xpos_pixel, ypos_pixel);
|
|
|
|
|
if (gcode_preview_over) gcode_preview(list_file.file_name[sel_id], xpos_pixel, ypos_pixel);
|
|
|
|
|
#if HAS_BAK_VIEW_IN_FLASH
|
|
|
|
|
if (flash_preview_begin == 1) {
|
|
|
|
|
flash_preview_begin = 0;
|
|
|
|
|
if (flash_preview_begin) {
|
|
|
|
|
flash_preview_begin = false;
|
|
|
|
|
Draw_default_preview(xpos_pixel, ypos_pixel, 1);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#if HAS_GCODE_DEFAULT_VIEW_IN_FLASH
|
|
|
|
|
if (default_preview_flg == 1) {
|
|
|
|
|
if (default_preview_flg) {
|
|
|
|
|
Draw_default_preview(xpos_pixel, ypos_pixel, 0);
|
|
|
|
|
default_preview_flg = 0;
|
|
|
|
|
default_preview_flg = false;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
@ -971,7 +969,7 @@ void GUI_RefreshPage() {
|
|
|
|
|
}
|
|
|
|
|
if (printing_rate_update_flag || marlin_state == MF_SD_COMPLETE) {
|
|
|
|
|
printing_rate_update_flag = 0;
|
|
|
|
|
if (gcode_preview_over == 0) setProBarRate();
|
|
|
|
|
if (!gcode_preview_over) setProBarRate();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
@ -1359,8 +1357,8 @@ void draw_return_ui() {
|
|
|
|
|
lv_draw_print_file();
|
|
|
|
|
break;
|
|
|
|
|
case PRINTING_UI:
|
|
|
|
|
if (gCfgItems.from_flash_pic == 1) flash_preview_begin = 1;
|
|
|
|
|
else default_preview_flg = 1;
|
|
|
|
|
if (gCfgItems.from_flash_pic) flash_preview_begin = true;
|
|
|
|
|
else default_preview_flg = true;
|
|
|
|
|
lv_draw_printing();
|
|
|
|
|
break;
|
|
|
|
|
case MOVE_MOTOR_UI:
|
|
|
|
|