From cea1dc494be59a3c1d59ef689f69015d43ccb71a Mon Sep 17 00:00:00 2001 From: makerbase-mks <4164049@qq.com> Date: Fri, 22 May 2020 20:35:18 +0800 Subject: [PATCH 01/18] Add color ui --- Marlin/Configuration.h | 5 + Marlin/src/MarlinCore.cpp | 19 + Marlin/src/inc/Conditionals_LCD.h | 6 + Marlin/src/lcd/extui/lib/mks_ui/inc/SPI_TFT.h | 53 + Marlin/src/lcd/extui/lib/mks_ui/inc/W25Qxx.h | 127 ++ .../src/lcd/extui/lib/mks_ui/inc/draw_about.h | 21 + .../extui/lib/mks_ui/inc/draw_change_speed.h | 28 + .../lcd/extui/lib/mks_ui/inc/draw_dialog.h | 65 + .../extui/lib/mks_ui/inc/draw_error_message.h | 21 + .../lcd/extui/lib/mks_ui/inc/draw_extrusion.h | 25 + .../src/lcd/extui/lib/mks_ui/inc/draw_fan.h | 22 + .../src/lcd/extui/lib/mks_ui/inc/draw_home.h | 21 + .../lcd/extui/lib/mks_ui/inc/draw_language.h | 20 + .../extui/lib/mks_ui/inc/draw_manuaLevel.h | 20 + .../extui/lib/mks_ui/inc/draw_move_motor.h | 21 + .../lcd/extui/lib/mks_ui/inc/draw_opration.h | 20 + .../extui/lib/mks_ui/inc/draw_pause_message.h | 19 + .../lcd/extui/lib/mks_ui/inc/draw_preHeat.h | 24 + .../extui/lib/mks_ui/inc/draw_print_file.h | 50 + .../lcd/extui/lib/mks_ui/inc/draw_printing.h | 39 + .../extui/lib/mks_ui/inc/draw_ready_print.h | 26 + .../src/lcd/extui/lib/mks_ui/inc/draw_set.h | 21 + .../src/lcd/extui/lib/mks_ui/inc/draw_tool.h | 20 + Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ui.h | 222 ++ .../extui/lib/mks_ui/inc/mks_hardware_test.h | 14 + .../lcd/extui/lib/mks_ui/inc/pic_manager.h | 102 + .../extui/lib/mks_ui/inc/printer_opration.h | 19 + .../extui/lib/mks_ui/inc/tft_Language_en.h | 698 ++++++ .../extui/lib/mks_ui/inc/tft_Language_fr.h | 256 +++ .../extui/lib/mks_ui/inc/tft_Language_it.h | 251 +++ .../extui/lib/mks_ui/inc/tft_Language_ru.h | 253 +++ .../extui/lib/mks_ui/inc/tft_Language_s_cn.h | 248 +++ .../extui/lib/mks_ui/inc/tft_Language_sp.h | 260 +++ .../extui/lib/mks_ui/inc/tft_Language_t_cn.h | 248 +++ .../src/lcd/extui/lib/mks_ui/inc/tft_fsmc.h | 14 + .../lib/mks_ui/inc/tft_lvgl_configuration.h | 29 + .../extui/lib/mks_ui/inc/tft_multi_language.h | 589 ++++++ .../src/lcd/extui/lib/mks_ui/src/SPI_TFT.cpp | 284 +++ .../src/lcd/extui/lib/mks_ui/src/W25Qxx.cpp | 431 ++++ .../lcd/extui/lib/mks_ui/src/draw_about.cpp | 116 + .../lib/mks_ui/src/draw_change_speed.cpp | 378 ++++ .../lcd/extui/lib/mks_ui/src/draw_dialog.cpp | 357 ++++ .../lib/mks_ui/src/draw_error_message.cpp | 67 + .../extui/lib/mks_ui/src/draw_extrusion.cpp | 438 ++++ .../src/lcd/extui/lib/mks_ui/src/draw_fan.cpp | 242 +++ .../lcd/extui/lib/mks_ui/src/draw_home.cpp | 269 +++ .../extui/lib/mks_ui/src/draw_language.cpp | 366 ++++ .../extui/lib/mks_ui/src/draw_manuaLevel.cpp | 284 +++ .../extui/lib/mks_ui/src/draw_move_motor.cpp | 340 +++ .../extui/lib/mks_ui/src/draw_opration.cpp | 336 +++ .../lib/mks_ui/src/draw_pause_message.cpp | 36 + .../lcd/extui/lib/mks_ui/src/draw_preHeat.cpp | 449 ++++ .../extui/lib/mks_ui/src/draw_print_file.cpp | 701 ++++++ .../extui/lib/mks_ui/src/draw_printing.cpp | 453 ++++ .../extui/lib/mks_ui/src/draw_ready_print.cpp | 314 +++ .../src/lcd/extui/lib/mks_ui/src/draw_set.cpp | 246 +++ .../lcd/extui/lib/mks_ui/src/draw_tool.cpp | 276 +++ .../src/lcd/extui/lib/mks_ui/src/draw_ui.cpp | 1415 +++++++++++++ .../extui/lib/mks_ui/src/gb2312_puhui16.cpp | 103 + .../lib/mks_ui/src/mks_hardware_test.cpp | 963 +++++++++ .../lcd/extui/lib/mks_ui/src/pic_manager.cpp | 811 +++++++ .../extui/lib/mks_ui/src/printer_opration.cpp | 214 ++ .../src/lcd/extui/lib/mks_ui/src/tft_fsmc.cpp | 279 +++ .../lib/mks_ui/src/tft_lvgl_configuration.cpp | 864 ++++++++ .../lib/mks_ui/src/tft_multi_language.cpp | 1877 +++++++++++++++++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 116 +- .../PlatformIO/scripts/mks_robin_nano35.py | 40 + platformio.ini | 17 + 68 files changed, 16974 insertions(+), 4 deletions(-) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/SPI_TFT.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/W25Qxx.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_about.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_change_speed.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_dialog.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_error_message.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_extrusion.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_fan.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_home.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_language.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_manuaLevel.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_move_motor.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_opration.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_pause_message.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_preHeat.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_print_file.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_printing.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ready_print.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_set.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_tool.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ui.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/mks_hardware_test.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/pic_manager.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/printer_opration.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_en.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_fr.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_it.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_ru.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_s_cn.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_sp.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_t_cn.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_fsmc.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_lvgl_configuration.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_multi_language.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/SPI_TFT.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/W25Qxx.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_about.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_change_speed.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_dialog.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_error_message.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_extrusion.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_fan.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_home.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_language.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_manuaLevel.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_move_motor.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_opration.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_pause_message.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_preHeat.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_print_file.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_printing.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_ready_print.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_set.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_tool.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_ui.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/gb2312_puhui16.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/mks_hardware_test.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/pic_manager.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/printer_opration.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/tft_fsmc.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/tft_lvgl_configuration.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/tft_multi_language.cpp create mode 100644 buildroot/share/PlatformIO/scripts/mks_robin_nano35.py diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index cb5ae0661710..163362388351 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2132,6 +2132,11 @@ #define XPT2046_Y_OFFSET 257 #endif +//If TFT_LITTLE_VGL_UI is enabled, there is no need to turn on FSMC_GRAPHICAL_TFT. +//#define TFT_LITTLE_VGL_UI +//Robin_nano_v2.0 motherboard touch screen is spi interface, you need to enable this item. +//#define SPI_GRAPHICAL_TFT + // // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 3b076768406a..fb48fe03dbfd 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -59,6 +59,13 @@ #include "gcode/parser.h" #include "gcode/queue.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lvgl.h" +#include "lcd/extui/lib/mks_ui/inc/tft_lvgl_configuration.h" +#include "lcd/extui/lib/mks_ui/inc/draw_ui.h" +#endif + + #if ENABLED(DIRECT_STEPPING) #include "feature/direct_stepping.h" #endif @@ -726,6 +733,10 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) { // Direct Stepping TERN_(DIRECT_STEPPING, page_manager.write_responses()); + + #if ENABLED(TFT_LITTLE_VGL_UI) + LV_TASK_HANDLER(); + #endif } /** @@ -1141,6 +1152,10 @@ void setup() { SETUP_RUN(page_manager.init()); #endif + #if ENABLED(TFT_LITTLE_VGL_UI) + tft_lvgl_init(); + #endif + marlin_state = MF_RUNNING; SETUP_LOG("setup() completed."); @@ -1173,5 +1188,9 @@ void loop() { endstops.event_handler(); + #if ENABLED(TFT_LITTLE_VGL_UI) + printer_state_polling(); + #endif + } while (ENABLED(__AVR__)); // Loop forever on slower (AVR) boards } diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 11cf5826375e..bfadc829e03f 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -243,6 +243,12 @@ #define DELAYED_BACKLIGHT_INIT #endif +#if ENABLED(SPI_GRAPHICAL_TFT) +//#define DOGLCD +//#define IS_ULTIPANEL +#define DELAYED_BACKLIGHT_INIT +#endif + /** * I2C Panels */ diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/SPI_TFT.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/SPI_TFT.h new file mode 100644 index 000000000000..3964658f4a94 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/SPI_TFT.h @@ -0,0 +1,53 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include + +#define SPI_TFT_CS_H OUT_WRITE(SPI_TFT_CS_PIN, HIGH) +#define SPI_TFT_CS_L OUT_WRITE(SPI_TFT_CS_PIN, LOW) + +#define SPI_TFT_DC_H OUT_WRITE(SPI_TFT_DC_PIN, HIGH) +#define SPI_TFT_DC_L OUT_WRITE(SPI_TFT_DC_PIN, LOW) + +#define SPI_TFT_RST_H OUT_WRITE(SPI_TFT_RST_PIN, HIGH) +#define SPI_TFT_RST_L OUT_WRITE(SPI_TFT_RST_PIN, LOW) + +#define SPI_TFT_BLK_H OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH) +#define SPI_TFT_BLK_L OUT_WRITE(LCD_BACKLIGHT_PIN, LOW) + +class TFT{ +public: + void spi_init(uint8_t spiRate); + uint8_t spi_Rec(); + uint8_t spi_read_write_byte(uint8_t data); + void spi_Read(uint8_t* buf, uint16_t nbyte); + void spi_Send(uint8_t b); + void spi_SendBlock(uint8_t token, const uint8_t* buf); + void LCD_WR_REG(uint8_t cmd); + void LCD_WR_DATA(uint8_t data); + void SetCursor(uint16_t x,uint16_t y); + void SetWindows(uint16_t x,uint16_t y,uint16_t with,uint16_t height); + void LCD_init(); + void LCD_clear(uint16_t color); + void LCD_WriteRAM_Prepare(); +}; + +extern TFT SPI_TFT; + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/W25Qxx.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/W25Qxx.h new file mode 100644 index 000000000000..3520985e62d8 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/W25Qxx.h @@ -0,0 +1,127 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +//#if defined(__cplusplus) +//extern "C" { /* Make sure we have C-declarations in C++ programs */ +//#endif + +#include + +#define W25X_WriteEnable 0x06 +#define W25X_WriteDisable 0x04 +#define W25X_ReadStatusReg 0x05 +#define W25X_WriteStatusReg 0x01 +#define W25X_ReadData 0x03 +#define W25X_FastReadData 0x0B +#define W25X_FastReadDual 0x3B +#define W25X_PageProgram 0x02 +#define W25X_BlockErase 0xD8 +#define W25X_SectorErase 0x20 +#define W25X_ChipErase 0xC7 +#define W25X_PowerDown 0xB9 +#define W25X_ReleasePowerDown 0xAB +#define W25X_DeviceID 0xAB +#define W25X_ManufactDeviceID 0x90 +#define W25X_JedecDeviceID 0x9F + +#define WIP_Flag 0x01 /* Write In Progress (WIP) flag */ + +#define Dummy_Byte 0xA5 + +#define SPI_FLASH_SectorSize 4096 +#define SPI_FLASH_PageSize 256 +#define SPI_FLASH_PerWritePageSize 256 + +#if 0 + +#define PIC_NAME_MAX_LEN 50 + +#define LOGO_MAX_SIZE (300*1024) //logo���ֵ +#define TITLELOGO_MAX_SIZE (150*1024) //logo���ֵ +#define DEFAULT_VIEW_MAX_SIZE (200*200*2) +#define FLASH_VIEW_MAX_SIZE (200*200*2) + +//ͼƬ +//Robin2�洢��ַ +#define PIC_NAME_ADDR 0x003000 //ͼƬ��Ϣ�洢��ַ��ͼƬ���� +#define PIC_SIZE_ADDR 0x007000 //ͼƬ��Ϣ�洢��ַ��ͼƬ��Сֵ +#define PIC_COUNTER_ADDR 0x008000 //ͼƬ������ֵ�洢��ַ +#define PIC_LOGO_ADDR 0x009000 //ͼƬlogo�洢��ַ +//#define PIC_DATA_ADDR 0x02f000 //ͼƬ���ݴ洢��ַ + +#define DEFAULT_VIEW_ADDR 0XC5800 +#define BAK_VIEW_ADDR (DEFAULT_VIEW_ADDR+90*1024) +#define PIC_ICON_LOGO_ADDR (BAK_VIEW_ADDR+80*1024) + +#define PIC_DATA_ADDR (PIC_ICON_LOGO_ADDR+350*1024) //ͼƬ���ݴ洢��ַ//(800*240) + +//�ֿ� +#define FONTINFOADDR 0x600000//6M�Ժ��ַΪ�ֿ� +#define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096)//4*1024 +#define GBK_FLASH_ADDR (UNIGBK_FLASH_ADDR+180224)//176*1024 + +#define PER_PIC_MAX_SPACE (32*1024) //Ϊ�˷�ֹ����Խ������⣬ÿ��СͼƬ�����仮��Ӧ��ȡ�ܹ�����4K��ֵ + +// +union union32 +{ + uint8_t bytes[4]; + uint32_t dwords; +}; +//ͼƬ��Ϣ�ṹ�� +struct pic_msg +{ + uint8_t name[PIC_NAME_MAX_LEN]; + union union32 size; +}; + +typedef struct pic_msg PIC_MSG; + +#endif + +class ext_FLASH{ +public: + void init(uint8_t spiRate); + static uint8_t spi_flash_Rec(); + static uint8_t spi_flash_read_write_byte(uint8_t data); + static void spi_flash_Read(uint8_t* buf, uint16_t nbyte); + static void spi_flash_Send(uint8_t b); + static void spi_flash_SendBlock(uint8_t token, const uint8_t* buf); + static uint16_t W25QXX_ReadID(void); + static void SPI_FLASH_WriteEnable(void); + static void SPI_FLASH_WaitForWriteEnd(void); + static void SPI_FLASH_SectorErase(uint32_t SectorAddr); + static void SPI_FLASH_BlockErase(uint32_t BlockAddr); + static void SPI_FLASH_BulkErase(void); + static void SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); + static void SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); + static void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead); + //uint32_t lv_get_pic_addr(uint8_t *Pname); + void lv_pic_read(uint8_t *P_Rbuff,uint32_t addr,uint32_t size); + +}; +extern ext_FLASH W25QXX; + +//extern uint32_t lv_get_pic_addr(uint8_t *Pname); + +//#if defined(__cplusplus) +//} /* Make sure we have C-declarations in C++ programs */ +//#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_about.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_about.h new file mode 100644 index 000000000000..5ee28f5d8ed4 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_about.h @@ -0,0 +1,21 @@ +#ifndef _LV_DRAW_ABOUT_ +#define _LV_DRAW_ABOUT_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +extern void lv_draw_about(void); +extern void lv_clear_about(); + + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_change_speed.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_change_speed.h new file mode 100644 index 000000000000..015bdde15616 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_change_speed.h @@ -0,0 +1,28 @@ +#ifndef _LV_DRAW_CHANGE_SPEED_ +#define _LV_DRAW_CHANGE_SPEED_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +#define MIN_EXT_SPEED_PERCENT 10 +#define MAX_EXT_SPEED_PERCENT 999 + +extern void lv_draw_change_speed(void); +extern void lv_clear_change_speed(); +extern void disp_speed_step(); +extern void disp_print_speed(); +extern void disp_speed_type(); + + + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_dialog.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_dialog.h new file mode 100644 index 000000000000..b08ad0ad290c --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_dialog.h @@ -0,0 +1,65 @@ +#ifndef _LV_DRAW_DIALOG_ +#define _LV_DRAW_DIALOG_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +#define DIALOG_TYPE_STOP 0 +#define DIALOG_TYPE_PRINT_FILE 1 +#define DIALOG_TYPE_REPRINT_NO_FILE 2 + +#define DIALOG_TYPE_M80_FAIL 3 //** +#define DIALOG_TYPE_MESSEGE_ERR1 4//** + +#define DIALOG_TYPE_UPDATE_ESP_FIRMARE 5 +#define DIALOG_TYPE_UPDATE_ESP_DATA 6 +#define DIALOG_TYPE_UPLOAD_FILE 7 +#define DIALOG_TYPE_UNBIND 8 + +#define DIALOG_TYPE_FILAMENT_LOAD_HEAT 9 +#define DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED 10 +#define DIALOG_TYPE_FILAMENT_LOADING 11 +#define DIALOG_TYPE_FILAMENT_LOAD_COMPLETED 12 +#define DIALOG_TYPE_FILAMENT_UNLOAD_HEAT 13 +#define DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED 14 +#define DIALOG_TYPE_FILAMENT_UNLOADING 15 +#define DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED 16 + +#define DIALOG_TYPE_FILE_LOADING 17//** + +#define DIALOG_TYPE_FILAMENT_NO_PRESS 18 +#define DIALOG_TYPE_FINISH_PRINT 19 + +#define WIFI_ENABLE_TIPS 20 + +#define DIALOG_PAUSE_MESSAGE_PAUSING 21 +#define DIALOG_PAUSE_MESSAGE_CHANGING 22 +#define DIALOG_PAUSE_MESSAGE_UNLOAD 23 +#define DIALOG_PAUSE_MESSAGE_WAITING 24 +#define DIALOG_PAUSE_MESSAGE_INSERT 25 +#define DIALOG_PAUSE_MESSAGE_LOAD 26 +#define DIALOG_PAUSE_MESSAGE_PURGE 27 +#define DIALOG_PAUSE_MESSAGE_RESUME 28 +#define DIALOG_PAUSE_MESSAGE_HEAT 29 +#define DIALOG_PAUSE_MESSAGE_HEATING 30 +#define DIALOG_PAUSE_MESSAGE_OPTION 31 + +#define BTN_OK_X 100 +#define BTN_OK_Y 180 +#define BTN_CANCEL_X 280 +#define BTN_CANCEL_Y 180 + +extern void lv_draw_dialog(uint8_t type); +extern void lv_clear_dialog(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_error_message.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_error_message.h new file mode 100644 index 000000000000..b1d95f9ca922 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_error_message.h @@ -0,0 +1,21 @@ +#ifndef _LV_DRAW_ERROR_MESSAGE_ +#define _LV_DRAW_ERROR_MESSAGE_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +extern void lv_draw_error_message(PGM_P const msg); +extern void lv_clear_error_message(); + + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_extrusion.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_extrusion.h new file mode 100644 index 000000000000..9e29479cf2cf --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_extrusion.h @@ -0,0 +1,25 @@ +#ifndef _LV_DRAW_EXTRUSION_ +#define _LV_DRAW_EXTRUSION_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +extern void lv_draw_extrusion(void); +extern void lv_clear_extrusion(); +extern void disp_ext_type(); +extern void disp_ext_step(); +extern void disp_ext_speed(); +extern void disp_hotend_temp(); +extern void disp_extru_amount(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_fan.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_fan.h new file mode 100644 index 000000000000..56b699bb04b4 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_fan.h @@ -0,0 +1,22 @@ +#ifndef _LV_DRAW_FAN_ +#define _LV_DRAW_FAN_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +extern void lv_draw_fan(void); +extern void lv_clear_fan(); +extern void disp_fan_value(); + + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_home.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_home.h new file mode 100644 index 000000000000..9e8797358080 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_home.h @@ -0,0 +1,21 @@ +#ifndef _LV_DRAW_HOME_ +#define _LV_DRAW_HOME_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +extern void lv_draw_home(void); +extern void lv_clear_home(); + + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_language.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_language.h new file mode 100644 index 000000000000..6fdb4a6bc800 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_language.h @@ -0,0 +1,20 @@ +#ifndef _LV_DRAW_LANGUAGE_ +#define _LV_DRAW_LANGUAGE_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +extern void lv_draw_language(void); +extern void lv_clear_language(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_manuaLevel.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_manuaLevel.h new file mode 100644 index 000000000000..818aca61d35b --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_manuaLevel.h @@ -0,0 +1,20 @@ +#ifndef _LV_DRAW_MANUAL_LEVEL_ +#define _LV_DRAW_MANUAL_LEVEL_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +extern void lv_draw_manualLevel(void); +extern void lv_clear_manualLevel(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_move_motor.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_move_motor.h new file mode 100644 index 000000000000..80f52e44d53b --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_move_motor.h @@ -0,0 +1,21 @@ +#ifndef _LV_DRAW_MOVE_MOTOR_ +#define _LV_DRAW_MOVE_MOTOR_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +extern void lv_draw_move_motor(void); +extern void lv_clear_move_motor(); +extern void disp_move_dist(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_opration.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_opration.h new file mode 100644 index 000000000000..5dd6c9ff61d1 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_opration.h @@ -0,0 +1,20 @@ +#ifndef _LV_DRAW_OPRATION_ +#define _LV_DRAW_OPRATION_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +extern void lv_draw_opration(void); +extern void lv_clear_opration(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_pause_message.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_pause_message.h new file mode 100644 index 000000000000..e8411977a249 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_pause_message.h @@ -0,0 +1,19 @@ +#ifndef _LV_DRAW_ERROR_MESSAGE_ +#define _LV_DRAW_ERROR_MESSAGE_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +extern void lv_draw_pause_message(const PauseMessage msg); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_preHeat.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_preHeat.h new file mode 100644 index 000000000000..aadaeb273570 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_preHeat.h @@ -0,0 +1,24 @@ +#ifndef _LV_DRAW_PREHEAT_ +#define _LV_DRAW_PREHEAT_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +extern void lv_draw_preHeat(void); +extern void lv_clear_preHeat(); +extern void disp_temp_type(); +extern void disp_step_heat(); +extern void disp_desire_temp(); + + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_print_file.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_print_file.h new file mode 100644 index 000000000000..293426632b74 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_print_file.h @@ -0,0 +1,50 @@ +#ifndef _LV_DRAW_PRINT_FILE_ +#define _LV_DRAW_PRINT_FILE_ + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +typedef struct +{ + int cur_page_first_offset; + int cur_page_last_offset; + int curPage; +} DIR_OFFSET; +extern DIR_OFFSET dir_offset[10]; + +#define FILE_NUM 6 +#define SHORT_NEME_LEN 13 +#define NAME_CUT_LEN 23 + +#define MAX_DIR_LEVEL 10 + +typedef struct +{ + //char longName[FILE_NUM][LONG_FILENAME_LENGTH]; + char file_name[FILE_NUM][SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; + char curDirPath[SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; + char long_name[FILE_NUM][SHORT_NEME_LEN*2+1]; + char IsFolder[FILE_NUM]; + char Sd_file_cnt; + char sd_file_index; + char Sd_file_offset; +}LIST_FILE; +extern LIST_FILE list_file; + +extern void disp_gcode_icon(uint8_t file_num); +extern void lv_draw_print_file(void); +extern void lv_open_gcode_file(char *path); +extern void lv_gcode_file_read(uint8_t *data_buf); +extern void lv_close_gcode_file(); +extern void cutFileName(char *path, int len, int bytePerLine, char *outStr); +extern int ascii2dec_test(char *ascii); +extern void lv_clear_print_file(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_printing.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_printing.h new file mode 100644 index 000000000000..1b4d07e49871 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_printing.h @@ -0,0 +1,39 @@ +#ifndef _LV_DRAW_PRINTING_ +#define _LV_DRAW_PRINTING_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +#define IDLE 0 +#define WORKING 1 +#define PAUSING 2 +#define PAUSED 3 +#define REPRINTING 4 +#define REPRINTED 5 +#define RESUMING 6 +#define STOP 7 + + +extern void lv_draw_printing(void); +extern void lv_clear_printing(); +extern void disp_ext_temp(); +extern void disp_bed_temp(); +extern void disp_fan_speed(); +extern void disp_print_time(); +extern void disp_fan_Zpos(); +extern void reset_print_time(); +extern void start_print_time(); +extern void stop_print_time(); +extern void setProBarRate(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ready_print.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ready_print.h new file mode 100644 index 000000000000..7d13d627532f --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ready_print.h @@ -0,0 +1,26 @@ +#ifndef _LV_DRAW_READY_PRINT_ +#define _LV_DRAW_READY_PRINT_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +extern void lv_draw_ready_print(void); +extern void disp_test(); +extern void disp_Limit_ok(); +extern void disp_Limit_error(); +extern void disp_det_error(); +extern void disp_det_ok(); +extern void lv_clear_ready_print(); + + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_set.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_set.h new file mode 100644 index 000000000000..7ddfbe5037ea --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_set.h @@ -0,0 +1,21 @@ +#ifndef _LV_DRAW_SET_ +#define _LV_DRAW_SET_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +extern void lv_draw_set(void); +extern void lv_clear_set(); + + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_tool.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_tool.h new file mode 100644 index 000000000000..c7a5c21dced5 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_tool.h @@ -0,0 +1,20 @@ +#ifndef _LV_DRAW_TOOL_ +#define _LV_DRAW_TOOL_ + + + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +extern void lv_draw_tool(void); +extern void lv_clear_tool(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ui.h new file mode 100644 index 000000000000..5321e0614788 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ui.h @@ -0,0 +1,222 @@ +#ifndef _DRAW_UI_H +#define _DRAW_UI_H + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +#include +#include +#include "lvgl.h" +#include "../inc/tft_multi_language.h" +#include "../inc/draw_ready_print.h" +#include "../inc/draw_language.h" +#include "../inc/draw_set.h" +#include "../inc/draw_tool.h" +#include "../inc/draw_print_file.h" +#include "../inc/draw_dialog.h" +#include "../inc/draw_printing.h" +#include "../inc/draw_opration.h" +#include "../inc/draw_preHeat.h" +#include "../inc/draw_extrusion.h" +#include "../inc/draw_home.h" +#include "../inc/draw_move_motor.h" +#include "../inc/draw_fan.h" +#include "../inc/draw_about.h" +#include "../inc/draw_change_speed.h" +#include "../inc/draw_manuaLevel.h" +#include "../inc/draw_error_message.h" +#include "../inc/printer_opration.h" + + +#define TFT35 + +#ifdef TFT35 + +#define TFT_WIDTH 480 +#define TFT_HEIGHT 320 + +#define titleHeight 36//TFT_screen.title_high +#define INTERVAL_H 2//TFT_screen.gap_h// 2 +#define INTERVAL_V 2//TFT_screen.gap_v// 2 +#define BTN_X_PIXEL 117 //TFT_screen.btn_x_pixel// +#define BTN_Y_PIXEL 140//TFT_screen.btn_y_pixel// + +#define SIMPLE_FIRST_PAGE_GRAP 30 + +#define BUTTON_TEXT_Y_OFFSET -20 + +#define TITLE_XPOS 3 //TFT_screen.title_xpos// +#define TITLE_YPOS 5 //TFT_screen.title_ypos// + +#define FILE_BTN_CNT 6 + +#define OTHER_BTN_XPIEL 117 +#define OTHER_BTN_YPIEL 92 + +#define FILE_PRE_PIC_X_OFFSET 8 +#define FILE_PRE_PIC_Y_OFFSET 0 + +#define PREVIEW_LITTLE_PIC_SIZE 40910//400*100+9*101+1 +#define PREVIEW_SIZE 202720//(PREVIEW_LITTLE_PIC_SIZE+800*200+201*9+1) + +#define GCFG_FLAG_VALUE 0xee +#else + +#define TFT_WIDTH 320 +#define TFT_HEIGHT 240 + +#endif + +extern char public_buf_m[100]; +extern char public_buf_l[30]; + +typedef struct +{ + uint8_t spi_flash_flag; + uint8_t multiple_language; + uint8_t language; + uint8_t leveling_mode; + uint8_t from_flash_pic; + uint8_t finish_power_off; + uint8_t pause_reprint; + uint32_t curFilesize; + +}CFG_ITMES; + +typedef struct +{ + uint8_t curTempType:1, + curSprayerChoose:3, + stepHeat:4; + uint8_t leveling_first_time:1; + uint8_t extruStep; + uint8_t extruSpeed; + uint8_t print_state; + uint8_t stepPrintSpeed; + uint8_t waitEndMoves; + uint16_t moveSpeed; + float move_dist; +}UI_CFG; + +typedef enum +{ + MAIN_UI, + PRINT_READY_UI, + PRINT_FILE_UI, + PRINTING_UI, + MOVE_MOTOR_UI, + OPERATE_UI, + PAUSE_UI, + EXTRUSION_UI, + FAN_UI, + PRE_HEAT_UI, + CHANGE_SPEED_UI, + TEMP_UI, + SET_UI, + ZERO_UI, + SPRAYER_UI, + MACHINE_UI, + LANGUAGE_UI, + ABOUT_UI, + LOG_UI, + DISK_UI, + CALIBRATE_UI, + DIALOG_UI, + WIFI_UI, + MORE_UI, + FILETRANSFER_UI, + FILETRANSFERSTATE_UI, + PRINT_MORE_UI, + FILAMENTCHANGE_UI, + LEVELING_UI, + MESHLEVELING_UI, + BIND_UI, + ZOFFSET_UI, + TOOL_UI, + HARDWARE_TEST_UI, + WIFI_LIST_UI, + KEY_BOARD_UI, + TIPS_UI, + MACHINE_PARA_UI, + MACHINE_SETTINGS_UI, + TEMPERATURE_SETTINGS_UI, + MOTOR_SETTINGS_UI, + MACHINETYPE_UI, + STROKE_UI, + HOME_DIR_UI, + ENDSTOP_TYPE_UI, + FILAMENT_SETTINGS_UI, + LEVELING_SETTIGNS_UI, + LEVELING_PARA_UI, + DELTA_LEVELING_PARA_UI, + XYZ_LEVELING_PARA_UI, + MAXFEEDRATE_UI, + STEPS_UI, + ACCELERATION_UI, + JERK_UI, + MOTORDIR_UI, + HOMESPEED_UI, + NOZZLE_CONFIG_UI, + HOTBED_CONFIG_UI, + ADVANCED_UI, + DOUBLE_Z_UI, + ENABLE_INVERT_UI, + NUMBER_KEY_UI, + BABY_STEP_UI, + ERROR_MESSAGE_UI +} DISP_STATE; + +typedef struct +{ + DISP_STATE _disp_state[100]; + int _disp_index; + +} DISP_STATE_STACK; + +typedef struct +{ + + int16_t days; + uint16_t hours; + uint8_t minutes; + volatile int8_t seconds; + int8_t ms_10; + int8_t start; + +} PRINT_TIME; +extern PRINT_TIME print_time; + +extern CFG_ITMES gCfgItems; +extern UI_CFG uiCfg; +extern DISP_STATE disp_state; +extern DISP_STATE last_disp_state; +extern DISP_STATE_STACK disp_state_stack; + +extern lv_style_t tft_style_scr; +extern lv_style_t tft_style_lable_pre; +extern lv_style_t tft_style_lable_rel; + +extern void gCfgItems_init(); +extern void ui_cfg_init(); +extern void tft_style_init(); +extern char *creat_title_text(void); +extern void preview_gcode_prehandle(char *path); +extern void update_spi_flash(); +extern void disp_pre_gcode(int xpos_pixel,int ypos_pixel); +extern void GUI_RefreshPage(); +extern void clear_cur_ui(); +extern void draw_return_ui(); +extern void sd_detection(); +extern void gCfg_to_spiFlah(); +extern void print_time_count(); + +extern void LV_TASK_HANDLER(); + + +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/mks_hardware_test.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/mks_hardware_test.h new file mode 100644 index 000000000000..9b6728514d2a --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/mks_hardware_test.h @@ -0,0 +1,14 @@ +#ifndef MKS_HARDWARE_TEST_H +#define MKS_HARDWARE_TEST_H + +#include "lvgl.h" + +void Test_GPIO(); +void disp_char_1624(uint16_t x,uint16_t y,uint8_t c,uint16_t charColor,uint16_t bkColor); +void disp_string(uint16_t x,uint16_t y,const char * string,uint16_t charColor,uint16_t bkColor); +void mks_test(); +void disp_pic_update(); +void disp_font_update(); + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/pic_manager.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/pic_manager.h new file mode 100644 index 000000000000..69a54a798b92 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/pic_manager.h @@ -0,0 +1,102 @@ +#ifndef _PIC_MANAGER_H_ +#define _PIC_MANAGER_H_ + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +#include +#include +#include "lvgl.h" + +#if 1 + +#define PIC_MAX_CN 100 //Maximum number of pictures +#define PIC_NAME_MAX_LEN 50 //Picture name maximum length + +#define LOGO_MAX_SIZE_TFT35 (300*1024) +#define LOGO_MAX_SIZE_TFT32 (150*1024) +#define TITLELOGO_MAX_SIZE (150*1024) //little logo maximum +#define DEFAULT_VIEW_MAX_SIZE (200*200*2) +#define FLASH_VIEW_MAX_SIZE (200*200*2) + +#define PER_PIC_MAX_SPACE_TFT35 (32*1024) +#define PER_PIC_MAX_SPACE_TFT32 (16*1024) +#define PER_FONT_MAX_SPACE (16*1024) + +//pic +//Robin_pro pic addr +#define PIC_NAME_ADDR 0x003000 //pic information addr +#define PIC_SIZE_ADDR 0x007000 //pic size information addr +#define PIC_COUNTER_ADDR 0x008000 //pic total number +#define PER_PIC_SAVE_ADDR 0x009000 //Storage address of each picture +#define PIC_LOGO_ADDR 0x00A000 //logo addr +//#define PIC_DATA_ADDR 0x02f000 // +//TFT35 +#define DEFAULT_VIEW_ADDR_TFT35 0XC5800 +#define BAK_VIEW_ADDR_TFT35 (DEFAULT_VIEW_ADDR_TFT35+90*1024) +#define PIC_ICON_LOGO_ADDR_TFT35 (BAK_VIEW_ADDR_TFT35+80*1024) +#define PIC_DATA_ADDR_TFT35 (PIC_ICON_LOGO_ADDR_TFT35+350*1024)//0XC5800 +//TFT32 +#define PIC_DATA_ADDR_TFT32 0x02f000 +#define PIC_ICON_LOGO_ADDR_TFT32 0x5d8000 +#define PIC_OTHER_SIZE_ADDR_TFT32 0X5ee000 + +//font +#define FONTINFOADDR 0x600000//6M -- font addr +#define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096)//4*1024 +#define GBK_FLASH_ADDR (UNIGBK_FLASH_ADDR+180224)//176*1024 + +//flash flag +#define FLASH_INF_VALID_FLAG 0xaa558761 +//SD card information first addr +#define VAR_INF_ADDR 0x000000 + +// +union union32 +{ + uint8_t bytes[4]; + uint32_t dwords; +}; +//pic information +struct pic_msg +{ + uint8_t name[PIC_NAME_MAX_LEN]; + union union32 size; +}; + +typedef struct pic_msg PIC_MSG; + +#define BMP_WRITE_BUF_LEN 512 + +#define PICINFOADDR 0 + +#define PIC_SIZE_xM 6 +#define FONT_SIZE_xM 2 + + +//extern void PicMsg_Init(void); +extern void Pic_Read(uint8_t *Pname,uint8_t *P_Rbuff); +//extern void bindBmpFileData(const uint8_t **pBuf, uint8_t *pName); +//extern void Pic_Logo_Read(uint8_t *LogoName,uint8_t *Logo_Rbuff,uint32_t LogoReadsize); +//extern void default_view_Read(uint8_t *default_view_Rbuff,uint32_t default_view_Readsize); +//extern void flash_view_Read(uint8_t *flash_view_Rbuff,uint32_t flash_view_Readsize); + +//extern void lv_Pic_Read(uint8_t *Pname,uint8_t *P_Rbuff,uint32_t addr,uint32_t size); +extern void lv_pic_test(uint8_t *P_Rbuff,uint32_t addr,uint32_t size); +#endif +extern uint32_t lv_get_pic_addr(uint8_t *Pname); + +extern void get_spi_flash_data(const char *rec_buf,int offset, int size); +//extern void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead); + +extern void spi_flash_read_test(); +extern void default_view_Read(uint8_t *default_view_Rbuff,uint32_t default_view_Readsize); +extern void flash_view_Read(uint8_t *flash_view_Rbuff,uint32_t flash_view_Readsize); + +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/printer_opration.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/printer_opration.h new file mode 100644 index 000000000000..2e1a3165f8ff --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/printer_opration.h @@ -0,0 +1,19 @@ +#ifndef _LV_PRINTER_OPRATION_ +#define _LV_PRINTER_OPRATION_ + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +#define MIN_FILE_PRINTED 100 //5000 + +extern void printer_state_polling(); +extern void filament_pin_setup(); +extern void filament_check(); + +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_en.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_en.h new file mode 100644 index 000000000000..f3df62dffc62 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_en.h @@ -0,0 +1,698 @@ +#ifndef _TFT_LANGUAGE_EN_H +#define _TFT_LANGUAGE_EN_H +//****************英文***************************// +#define MACHINE_CONFIG_EN "Machine\nSettings" + +#define NEXT_EN "Next" +#define PREVIOUS_EN "Previous" +#define DEFAULT_EN "Default" +#define KEY_BACK_EN "Del" +#define KEY_REST_EN "Rest" +#define KEY_CONFIRM_EN "Confirm" + +#define KEYBOARD_KEY0_EN "0" +#define KEYBOARD_KEY1_EN "1" +#define KEYBOARD_KEY2_EN "2" +#define KEYBOARD_KEY3_EN "3" +#define KEYBOARD_KEY4_EN "4" +#define KEYBOARD_KEY5_EN "5" +#define KEYBOARD_KEY6_EN "6" +#define KEYBOARD_KEY7_EN "7" +#define KEYBOARD_KEY8_EN "8" +#define KEYBOARD_KEY9_EN "9" +#define KEYBOARD_KEY_POINT_EN "." +#define KEYBOARD_KEY_NEGATIVE_EN "-" + +#define MACHINE_PARA_EN "Machine\nsettings" +#define MACHINE_PARA_TITLE_EN "Machine settings" +#define MACHINE_TYPE_CNOFIG_EN "Machine" +#define TEMPERATURE_CONFIG_EN "Temperature" +#define MOTOR_CONFIG_EN "Motor" +#define ADVANCE_CONFIG_EN "Adavance" + +#define MACHINE_CONFIG_TITLE_EN "Machine Settings" +#define MACHINE_TYPE_EN "Machine type" +#define MACHINE_STROKE_EN "Machine Size" +#define MACHINE_HOMEDIR_EN "Home direction" +#define MACHINE_ENDSTOP_TYPE_EN "Endstop type" +#define MACHINE_FILAMENT_CONFIG_EN "Filament settings" +#define MACHINE_LEVELING_CONFIG_EN "Leveling settings" + +#define MACHINE_TYPE_CONFIG_TITLE_EN "Machine Settings>Machine type" +#define MACHINE_TYPE_XYZ_EN "XYZ Machine" +#define MACHINE_TYPE_DELTA_EN "Delta Machine" +#define MACHINE_TYPE_COREXY_EN "Corexy Machine" + +#define MACHINE_STROKE_CONF_TITLE_EN "Machine Settings>Machine Size" +#define X_MAX_LENGTH_EN "X-axis maximum stroke" +#define Y_MAX_LENGTH_EN "Y-axis maximum stroke" +#define Z_MAX_LENGTH_EN "Z-axis maximum stroke" + +#define X_MIN_LENGTH_EN "X-axis minimum stroke" +#define Y_MIN_LENGTH_EN "Y-axis minimum stroke" +#define Z_MIN_LENGTH_EN "Z-axis minimum stroke" + +#define HOME_DIR_CONF_TITLE_EN "Machine Settings>Home direction" +#define HOME_DIR_X_EN "X-axis home direction" +#define HOME_DIR_Y_EN "Y-axis home direction" +#define HOME_DIR_Z_EN "Z-axis home direction" +#define HOME_MIN_EN "MIN" +#define HOME_MAX_EN "MAX" + +#define ENDSTOP_CONF_TITLE_EN "Machine Settings>Endstop type" +#define MIN_ENDSTOP_X_EN "X-axis minimum Endstop" +#define MIN_ENDSTOP_Y_EN "Y-axis minimum Endstop" +#define MIN_ENDSTOP_Z_EN "Z-axis minimum Endstop" +#define MAX_ENDSTOP_X_EN "X axis maximum Endstop" +#define MAX_ENDSTOP_Y_EN "Y axis maximum Endstop" +#define MAX_ENDSTOP_Z_EN "Z axis maximum Endstop" +#define ENDSTOP_FIL_EN "Filament sensor" +#define ENDSTOP_LEVEL_EN "Leveling sensor" +#define ENDSTOP_OPENED_EN "Open" +#define ENDSTOP_CLOSED_EN "Close" + +#define FILAMENT_CONF_TITLE_EN "Filament settings" +#define FILAMENT_IN_TEMPERATURE_EN "Load temperature" +#define FILAMENT_IN_LENGTH_EN "Load length" +#define FILAMENT_IN_SPEED_EN "Load speed" +#define FILAMENT_OUT_TEMPERATURE_EN "Unload temperature" +#define FILAMENT_OUT_LENGTH_EN "Unload length" +#define FILAMENT_OUT_SPEED_EN "Unload speed" + +#define LEVELING_CONF_TITLE_EN "Leveling settings" +#define LEVELING_PARA_CONF_EN "Leveling settings" +#define LEVELING_DELTA_EN "delta machine leveling" +#define LEVELING_XYZ_EN "Manual leveling coordinate settings" + +#define LEVELING_PARA_CONF_TITLE_EN "leveling setting" +#define AUTO_LEVELING_ENABLE_EN "Enable auto leveling" +#define BLTOUCH_LEVELING_ENABLE_EN "Enable BLtouch" +#define PROBE_PORT_EN "Probe connector" +#define PROBE_X_OFFSET_EN "Probe x axis offset" +#define PROBE_Y_OFFSET_EN "Probe y axis offset" +#define PROBE_Z_OFFSET_EN "Probe z axis offset" +#define PROBE_XY_SPEED_EN "Probe xy axis speed" +#define PROBE_Z_SPEED_EN "Probe z axis speed" +#define ENABLE_EN "YES" +#define DISABLE_EN "NO" +#define Z_MIN_EN "ZMin" +#define Z_MAX_EN "ZMax" + +#define DELTA_LEVEL_CONF_TITLE_EN "Delta Machine settings" +#define DELTA_LEVEL_CONF_EN "Delta Machine Leveling" +#define DELTA_MACHINE_RADIUS_EN "Machine Radius" +#define DELTA_DIAGONAL_ROD_EN "Machine rod length" +#define DELTA_PRINT_RADIUS_EN "Print radius" +#define DELTA_HEIGHT_EN "Print height" +#define SMOOTH_ROD_OFFSET_EN "Slider offset" +#define EFFECTOR_OFFSET_EN "Effector offset" +#define CALIBRATION_RADIUS_EN "Leveling radius" + +#define XYZ_LEVEL_CONF_TITLE_EN "Cartesian Machine Settings" +#define PROBE_REACH_MAX_LEFT_EN "Probe reaches leftmost position" +#define PROBE_REACH_MAX_RIGHT_EN "Probe reaches rightmost position" +#define PROBE_REACH_MAX_FRONT_EN "Probe reaches front position" +#define PROBE_REACH_MAX_BACK_EN "Probe reaches final position" + +#define TEMPERATURE_CONF_TITLE_EN "Machine Settings>Temperature settings" +#define NOZZLE_CONF_EN "Nozzle settings" +#define HOTBED_CONF_EN "Hotbed settings" +#define PREHEAT_TEMPER_EN "Preset temperature" + +#define NOZZLE_CONF_TITLE_EN "Machine Settings>Nozzle settings" +#define NOZZLECNT_EN "Number of nozzles" +#define NOZZLE_TYPE_EN "E0 Temperature type" +#define NOZZLE_ADJUST_TYPE_EN "PID thermostat" +#define NOZZLE_MIN_TEMPERATURE_EN "lowest temperature" +#define NOZZLE_MAX_TEMPERATURE_EN "Maximum temperature" +#define EXTRUD_MIN_TEMPER_EN "Minimum extrusion temperature" + +#define HOTBED_CONF_TITLE_EN "Machine Settings>Hotbed settings" +#define HOTBED_ADJUST_EN "PID thermostat" +#define HOTBED_MIN_TEMPERATURE_EN "lowest temperature" +#define HOTBED_MAX_TEMPERATURE_EN "Maximum temperature" + +#define MOTOR_CONF_TITLE_EN "Machine Settings>Motor settings" +#define MAXFEEDRATE_CONF_EN "Maximum speed settings" +#define ACCELERATION_CONF_EN "Acceleration settings" +#define JERKCONF_EN "Jerk settings" +#define STEPSCONF_EN "Steps settings" +#define MOTORDIRCONF_EN "Motor direction settings" +#define HOMEFEEDRATECONF_EN "Home speed setting" + +#define MAXFEEDRATE_CONF_TITLE_EN "Machine Settings>Maximum speed" +#define X_MAXFEEDRATE_EN "X axis maximum speed" +#define Y_MAXFEEDRATE_EN "Y axis maximum speed" +#define Z_MAXFEEDRATE_EN "Z axis maximum speed" +#define E0_MAXFEEDRATE_EN "E0 axis maximum speed" +#define E1_MAXFEEDRATE_EN "E1 axis maximum speed" + +#define ACCELERATION_CONF_TITLE_EN "Machine Settings>Acceleration" +#define PRINT_ACCELERATION_EN "Print acceleration" +#define RETRACT_ACCELERATION_EN "Retraction acceleration" +#define TRAVEL_ACCELERATION_EN "Travel acceleration" +#define X_ACCELERATION_EN "X-axis acceleration" +#define Y_ACCELERATION_EN "Y-axis acceleration" +#define Z_ACCELERATION_EN "Z-axis acceleration" +#define E0_ACCELERATION_EN "E0-axis acceleration" +#define E1_ACCELERATION_EN "E1-axis acceleration" + +#define JERK_CONF_TITLE_EN "Machine Settings>Jerk speed" +#define X_JERK_EN "X-axis jerk speed" +#define Y_JERK_EN "Y-axis jerk speed" +#define Z_JERK_EN "J-axis jerk speed" +#define E_JERK_EN "E-axis jerk speed" + +#define STEPS_CONF_TITLE_EN "Machine Settings>Steps settings" +#define X_STEPS_EN "X-axis steps" +#define Y_STEPS_EN "Y-axis stepS" +#define Z_STEPS_EN "Z-axis stepS" +#define E0_STEPS_EN "E0-axis steps" +#define E1_STEPS_EN "E1-axis steps" + +#define MOTORDIR_CONF_TITLE_EN "Machine Settings>Motor direction" +#define X_MOTORDIR_EN "X-axis motor direction invert" +#define Y_MOTORDIR_EN "Y-axis motor direction invert" +#define Z_MOTORDIR_EN "Z-axis motor direction invert" +#define E0_MOTORDIR_EN "E0-axis motor direction invert" +#define E1_MOTORDIR_EN "E1-axis motor direction invert" +#define INVERT_P_EN "YES" +#define INVERT_N_EN "NO" + +#define HOMEFEEDRATE_CONF_TITLE_EN "Machine Settings>Home speed" +#define X_HOMESPEED_EN "XY-axis Home speed" +#define Y_HOMESPEED_EN "Y-axis Home speed" +#define Z_HOMESPEED_EN "Z-axis Home speed" + +#define ADVANCED_CONF_TITLE_EN "Machine Settings>Advance" +#define PWROFF_DECTION_EN "power off dection module" +#define PWROFF_AFTER_PRINT_EN "Auto Shutdown after print" +#define HAVE_UPS_EN "Has UPS power supply" +#define Z2_AND_Z2ENDSTOP_CONF_EN "Z2 Settings" +#define ENABLE_PINS_CONF_EN "Enable pins level settings" + +#define Z2_AND_Z2ENDSTOP_CONF_TITLE_EN "Z2 Settings" +#define Z2_ENABLE_EN "Z2 Enable" +#define Z2_ENDSTOP_EN "Z2_EndStop Enable" +#define Z2_PORT_EN "Z2 Connector" + +#define ENABLE_PINS_CONF_TITLE_EN "ENABLE_PINS_LEVEL" +#define X_ENABLE_PINS_INVERT_EN "X_ENABLE_PIN_INVERT" +#define Y_ENABLE_PINS_INVERT_EN "Y_ENABLE_PIN_INVERT" +#define Z_ENABLE_PINS_INVERT_EN "Z_ENABLE_PIN_INVERT" +#define E_ENABLE_PINS_INVERT_EN "E_ENABLE_PIN_INVERT" + +#define TOOL_TEXT_EN "Tool" +#define PREHEAT_TEXT_EN "Preheat" +#define MOVE_TEXT_EN "Move" +#define HOME_TEXT_EN "Home" +#define PRINT_TEXT_EN "Printing" +#define EXTRUDE_TEXT_EN "Extrusion" +#define LEVELING_TEXT_EN "Leveling" +#define AUTO_LEVELING_TEXT_EN "AutoLevel" +#define SET_TEXT_EN "Settings" +#define MORE_TEXT_EN "More" + +#define ADD_TEXT_EN "Add" +#define DEC_TEXT_EN "Dec" +#define EXTRUDER_1_TEXT_EN "Extrusion1" +#define EXTRUDER_2_TEXT_EN "Extrusion2" +#define HEATBED_TEXT_EN "HeatBed" +#define TEXT_1C_EN "1℃" +#define TEXT_5C_EN "5℃" +#define TEXT_10C_EN "10℃" +#define CLOSE_TEXT_EN "Close" + +#define BACK_TEXT_EN "Back" + +#define TOOL_PREHEAT_EN "Preheat" +#define TOOL_EXTRUDE_EN "Extrusion" +#define TOOL_MOVE_EN "Move" +#define TOOL_HOME_EN "Home" +#define TOOL_LEVELING_EN "Leveling" +#define TOOL_AUTO_LEVELING_EN "AutoLevel" +#define TOOL_FILAMENT_EN "Filament" +#define TOOL_MORE_EN "More" + +#define AXIS_X_ADD_TEXT_EN "X+" +#define AXIS_X_DEC_TEXT_EN "X-" +#define AXIS_Y_ADD_TEXT_EN "Y+" +#define AXIS_Y_DEC_TEXT_EN "Y-" +#define AXIS_Z_ADD_TEXT_EN "Z+" +#define AXIS_Z_DEC_TEXT_EN "Z-" +#define TEXT_01MM_EN "0.1mm" +#define TEXT_1MM_EN "1mm" +#define TEXT_10MM_EN "10mm" + +#define HOME_X_TEXT_EN "X" +#define HOME_Y_TEXT_EN "Y" +#define HOME_Z_TEXT_EN "Z" +#define HOME_ALL_TEXT_EN "Home" +#define HOME_STOPMOVE_EN "Quickstop" + +#define PAGE_UP_TEXT_EN "Page up" +#define PAGE_DOWN_TEXT_EN "Page down" + +#define EXTRUDER_IN_TEXT_EN "In" +#define EXTRUDER_OUT_TEXT_EN "Out" +#define EXTRUDE_1MM_TEXT_EN "1mm" +#define EXTRUDE_5MM_TEXT_EN "5mm" +#define EXTRUDE_10MM_TEXT_EN "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_EN "Low" +#define EXTRUDE_MEDIUM_SPEED_TEXT_EN "Normal" +#define EXTRUDE_HIGH_SPEED_TEXT_EN "High" + +#define LEVELING_POINT1_TEXT_EN "Point1" +#define LEVELING_POINT2_TEXT_EN "Point2" +#define LEVELING_POINT3_TEXT_EN "Point3" +#define LEVELING_POINT4_TEXT_EN "Point4" +#define LEVELING_POINT5_TEXT_EN "Point5" + +#define FILESYS_TEXT_EN "FileSys" +#define WIFI_TEXT_EN "WiFi" +#define FAN_TEXT_EN "Fan" +#define ABOUT_TEXT_EN "About" +#define BREAK_POINT_TEXT_EN "Continue" +#define FILAMENT_TEXT_EN "Filament" +#define LANGUAGE_TEXT_EN "Language" +#define MOTOR_OFF_TEXT_EN "Motor-off" +#define MOTOR_OFF_XY_TEXT_EN "Off-XY" +#define SHUTDOWN_TEXT_EN "Shutdown" + +#define U_DISK_TEXT_EN "USB" +#define SD_CARD_TEXT_EN "SD" +#define WIFI_NAME_TEXT_EN "WiFi: " +#define WIFI_KEY_TEXT_EN "Key: " +#define WIFI_IP_TEXT_EN "IP: " +#define WIFI_AP_TEXT_EN "State: AP" +#define WIFI_STA_TEXT_EN "State: STA" +#define WIFI_CONNECTED_TEXT_EN "Connected" +#define WIFI_DISCONNECTED_TEXT_EN "Disconnected" +#define WIFI_EXCEPTION_TEXT_EN "Exception" +#define WIFI_RECONNECT_TEXT_EN "Reconnect" +#define CLOUD_TEXT_EN "Cloud" +#define CLOUD_BIND_EN "Bind" +#define CLOUD_UNBIND_EN "Unbind" +#define CLOUD_UNBINDING_EN "Unbinding" +#define CLOUD_DISCONNECTED_EN "Disconnected" +#define CLOUD_UNBINDED_EN "Unbinded" +#define CLOUD_BINDED_EN "Binded" +#define CLOUD_DISABLE_EN "Disable" + +#define FAN_ADD_TEXT_EN "Add" +#define FAN_DEC_TEXT_EN "Dec" +#define FAN_OPEN_TEXT_EN "100%" +#define FAN_HALF_TEXT_EN "50%" +#define FAN_CLOSE_TEXT_EN "Close" +#define FAN_TIPS1_TEXT_EN "FAN" +#define FAN_TIPS2_TEXT_EN "FAN\nClose" + +#define FILAMENT_IN_TEXT_EN "Load" +#define FILAMENT_OUT_TEXT_EN "Unload" +#define FILAMENT_EXT0_TEXT_EN "Extrusion1" +#define FILAMENT_EXT1_TEXT_EN "Extrusion2" +#define FILAMENT_HEAT_TEXT_EN "Preheat" +#define FILAMENT_STOP_TEXT_EN "Stop" +//#define FILAMENT_CHANGE_TEXT_EN "Filament replace" +#define FILAMENT_TIPS2_TEXT_EN "T:" +#define FILAMENT_TIPS3_TEXT_EN "Loading..." +#define FILAMENT_TIPS4_TEXT_EN "Unloading..." +#define FILAMENT_TIPS5_TEXT_EN "Temp is too low to go,please heat" +#define FILAMENT_TIPS6_TEXT_EN "Completed" + +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_EN "Please click or \nto replace filament!" + #define FILAMENT_CHANGE_TEXT_EN "Please click or ,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN "Heat completed,please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_EN "Please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN "Heat completed,please click for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_EN "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_EN "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN "Load filament completed,click for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN "Unload filament completed,click for return!" +#endif + + + #define FILAMENT_CHANGE_TEXT_EN "Please click \nor ,After \npinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN "Heat completed,please load filament \nto extruder,and click \nfor start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_EN "Please load filament to extruder,\nand click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN "Heat completed,please \nclick for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_EN "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_EN "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN "Load filament completed,\nclick for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN "Unload filament completed,\nclick for return!" + + +#define PRE_HEAT_EXT_TEXT_EN "E" +#define PRE_HEAT_BED_TEXT_EN "Bed" + +#define FILE_LOADING_EN "Loading......" +#if 0 +#define NO_FILE_AND_CHECK_EN "No files found!Please insert SD card or U disk!" +#endif +#define NO_FILE_AND_CHECK_EN " No files found!\n Check the file system configuration!" + +#define NO_FILE_EN "No files found!" + +#define EXTRUDER_TEMP_TEXT_EN "Temper" +#define EXTRUDER_E_LENGTH1_TEXT_EN "Extrusion1" +#define EXTRUDER_E_LENGTH2_TEXT_EN "Extrusion2" +#define EXTRUDER_E_LENGTH3_TEXT_EN "Extrusion3" + +#define ABOUT_TYPE_TEXT_EN "Type: " +#define ABOUT_VERSION_TEXT_EN "Firmware: " +#define ABOUT_WIFI_TEXT_EN "WiFi: " + +#define PRINTING_OPERATION_EN "Option" +#define PRINTING_PAUSE_EN "Pause" +#define PRINTING_TEMP_EN "Temp." +#define PRINTING_CHANGESPEED_EN "Speed" +#define PRINTING_RESUME_EN "Resume" +#define PRINTING_STOP_EN "Stop" +#define PRINTING_MORE_EN "More" +#define PRINTING_EXTRUDER_EN "Extrusion" +#define PRINTING_MOVE_EN "Move" + +#define EXTRUDER_SPEED_EN "Extrusion" +#define MOVE_SPEED_EN "Move" +#define EXTRUDER_SPEED_STATE_EN "Extrude Speed" +#define MOVE_SPEED_STATE_EN "Move Speed" +#define STEP_1PERCENT_EN "1%" +#define STEP_5PERCENT_EN "5%" +#define STEP_10PERCENT_EN "10%" + +#define ZOFFSET_EN "Z Offset" +#define ZOFFSET_INC_EN "Add" +#define ZOFFSET_DEC_EN "Dec" + +#define TITLE_READYPRINT_EN "ReadyPrint" +#define TITLE_PREHEAT_EN "Preheat" +#define TITLE_MOVE_EN "Move" +#define TITLE_HOME_EN "Home" +#define TITLE_EXTRUDE_EN "Extrusion" +#define TITLE_LEVELING_EN "Leveling" +#define TITLE_SET_EN "Settings" +#define TITLE_MORE_EN "More" +#define TITLE_CHOOSEFILE_EN "ChooseFile" +#define TITLE_PRINTING_EN "Printing" +#define TITLE_OPERATION_EN "Operation" +#define TITLE_ADJUST_EN "Adjust" +#define TITLE_WIRELESS_EN "Wireless" +#define TITLE_FILAMENT_EN "Filament" +#define TITLE_ABOUT_EN "About" +#define TITLE_FAN_EN "Fan" +#define TITLE_LANGUAGE_EN "Language" +#define TITLE_PAUSE_EN "Pause" +#define TITLE_CHANGESPEED_EN "Speed" +#define TITLE_CLOUD_TEXT_EN "Cloud" +#define TITLE_DIALOG_CONFIRM_EN "Confirm" +#define TITLE_FILESYS_EN "FileSys" +#define TITLE_ZOFFSET_EN "Z Offset" + +#define AUTO_SHUTDOWN_EN "Auto" +#define MANUAL_SHUTDOWN_EN "Manual" + +#define DIALOG_CONFIRM_EN "Confirm" +#define DIALOG_CANCLE_EN "Cancel" +#define DIALOG_OK_EN "OK" +#define DIALOG_RESET_EN "Reset" +#define DIALOG_RETRY_EN "Retry" +#define DIALOG_DISABLE_EN "Disable" +#define DIALOG_PRINT_MODEL_EN "Print this model?" +#define DIALOG_CANCEL_PRINT_EN "Stop print?" +#define DIALOG_RETRY_EN "Retry" +#define DIALOG_STOP_EN "Stop" +#define DIALOG_REPRINT_FROM_BREAKPOINT_EN "Reprint from breakpoint?" +//#define DIALOG_UNBIND_PRINTER_EN "Unbind the printer?" +#define DIALOG_ERROR_TIPS1_EN "Error:no file,please check it again." +#define DIALOG_ERROR_TIPS2_EN "Error:transaction failed.please check display baudrate \nwhether as the same as mainboard!" +#define DIALOG_ERROR_TIPS3_EN "Error:file name or path is too long!" +#define DIALOG_CLOSE_MACHINE_EN "Closing machine......" +#define DIALOG_UNBIND_PRINTER_EN "Unbind the printer?" +#define DIALOG_FILAMENT_NO_PRESS_EN "Filament detection switch is not pressed" +#define DIALOG_PRINT_FINISH_EN "Done print!" +#define DIALOG_PRINT_TIME_EN "Print time: " +#define DIALOG_REPRINT_EN "Print again" +#define DIALOG_WIFI_ENABLE_TIPS_EN "The wifi module is being configured\nplease wait a moment....." + +#define HOTBED_ENABLE_EN "Enable heatbed" +#define MOTOR_EN_HIGH_LEVEL_EN "High" +#define MOTOR_EN_LOW_LEVEL_EN "Low" + +#define TEXT_WIFI_MENU_TITLE_EN "WI-FI" +#define TEXT_WIFI_SAPCE_EN "space" +#define TEXT_WIFI_LETTER_EN "abc" +#define TEXT_WIFI_DIGITAL_EN "123" +#define TEXT_WIFI_SYMBOL_EN "#+=" +#define TEXT_WIFI_PASSWORD_EN "Password" + +#define TEXT_WIFI_POINT_BOLD_EN "`" + +#define TEXT_WIFI_JOINING_EN "Joining\nNetwork..." +#define TEXT_WIFI_FAILED_JOIN_EN "Failed to\nJoin Wi-Fi" +#define TEXT_WIFI_WIFI_CONECTED_EN "Wi-Fi\nConnected" + +#define TEXT_BUTTON_DISCONECTED_EN "Disconnect" +#define TEXT_WIFI_FORGET_EN "Forget Network" +#define TEXT_DISCONECTED_EN "Wi-Fi Connected" + +//wifi-list +#define MAIN_BUILT_EN "Build" +#define MAIN_FILAMENT_EN "Filament" +#define MAIN_SETUP_EN "Setup" +#define MAIN_ABOUT_EN "About" +#define MAIN_MENU_EN "Menu" +#define FILE_MENU_BUILD_EN "Build" +#define FILE_MENU_MENU_EN " < Menu" + +//about +#define ABOUT_TITLE_EN "About" +#define ABOUT_BUILT_MACHINES_EN "Built Machines" +#define ABOUT_SPARK_EN "Spark" +#define ABOUT_VERSION_EN "Version 1.1.0" +#define ABOUT_SERIAL_NUMBER_EN "Serial Number:" +#define ABOUT_S_NUMBER_EN "DCPLX02KFC6P" + +//set +#define SETUP_TITLE_EN "Setup" +#define SETUP_WIFI_EN "Wi-Fi" +#define SETUP_MANUAL_IP_EN "Manual IP" +#define SETUP_WIFI_NOT_CONNECTED_EN "Not Connected" +#define SETUP_WIFI_NETWORK_EN "WiFi_Network" + +//build +#define BUILD_TITLE_EN "Build" +#define BUILD_SD_CARD_EN "SD Card" +#define BUILD_USB_DRIVE_EN "USB Drive" + +//SD card +#define SD_CARD_TITLE_EN "SD Card" +#define SD_CARD_BACK_EN "< Back" +//USB Drive +#define USB_DRIVE_TITLE_EN "USB Drive" +#define USB_DRIVE_BACK_EN "< Back" +#define FILE_PAGES_EN "%d/%d" +#define FILE_NEXT_PAGE_EN "Next Page" + +//BUILD PLATE +#define PLATE_TITLE_EN "Build Plate" +#define PLATE_BACK_EN "< Back" +#define PLATE_CONFIRM_EN "Confirm >" +#define PLATE_TIPS_EN "Confirm that there is a Clear\nBuild Plate installed in the\nmachine." + +//build model +#define MODEL_TITLE_EN "Build Model" +#define MODEL_START_BUILD_EN "Start Build" +#define MODEL_BACK_EN "< Back" + +//building +#define BUILDING_TITLE_EN "Building" +#define BUILDING_MENU_EN "Build Menu" +#define BUILDING_COMPLETED "Build\nComplete" + +//building menu +#define BUILDING_MENU_TITLE_EN "Build Menu" +#define BUILDING_MENU_SETTINGS_EN "Build Settings" +#define BUILDING_MENU_PAUSE_EN "Pause Build" +#define BUILDING_MENU_CANCEL_EN "Cancel Build" +#define BUILDING_MENU_BACK_EN "< Back" + +//build settings +#define SETTINGS_TITLE_EN "Build Settings" +#define SETTINGS_NOZZLE_TEMPER_EN "Nozzle Temp:" +#define SETTINGS_NOZZLE_VALUE_EN "%d" +#define SETTINGS_BED_TEMPER_EN "Bed Temp:" +#define SETTINGS_BED_VALUE_EN "%d" +#define SETTINGS_BUILD_SPEED_EN "Build Speed:" +#define SETTINGS_SPEED_VALUE_EN "Standard" +#define SETTINGS_BACK_EN "< Back" + +//build paused +#define PAUSED_TITLE_EN "Build Paused" +#define PAUSED_RESUME_EN "Resume Build" +#define PAUSED_CANCEL_EN "Cancel Build" +#define PAUSED_BACK_EN "< Back" + +//build cancel +#define CANCEL_TITLE_EN "Cancel Build" +#define CANCEL_BUILD_EN "Cancel Build" +#define CANCEL_TIPS_EN "Are you sure you want to\ncancel this build? The model\nwill be deleted from this\nmachine. It will need to be\nresent from your computer\nbefore it can be built in the\nfuture." +#define CANCEL_BACK_EN "< Back" +#define CANCEL_BUILD_DISPLAY_EN "Build\nCanceled" +#define CANCEL_OVER_PLATE_TIPS_EN "Confirm that the Build Plate\nhas been removed from the\nmachine." + +//filament model enter +#define FILAMENT_MODEL_ENTER_TITLE_EN "Model-PLA" +#define FILAMENT_MODEL_ENTER_BACK_EN "< Back" +#define FILAMENT_MODEL_ENTER_BEGIN_EN "Begin >" +#define FILAMENT_MODEL_ENTER_TIPS_EN "The Model Filament spool\ncompartment is located on\nthe right side of the machine." + +//filament model PLA +#define FILAMENT_MODEL_PLA_TITLE_EN "Model-PLA" +#define FILAMENT_PLA_LOAD_TITLE_EN "Load Filament" +#define FILAMENT_PLA_UNLOAD_TITLE_EN "Unload Filament" +#define FILAMENT_MODEL_PLA_LOAD_EN "Load Filament" +#define FILAMENT_MODEL_PLA_UNLOAD_EN "Unload Filament" +//filament support enter +#define FILAMENT_SUPPORT_ENTER_TITLE_EN "Support-PVA" +#define FILAMENT_SUPPORT_ENTER_BACK_EN "< Back" +#define FILAMENT_SUPPORT_ENTER_BEGIN_EN "Begin >" +#define FILAMENT_SUPPORT_ENTER_TIPS_EN "The Support Filament spool\ncompartment is located on\nthe left side of the machine." +//filament heating +#define FILAMENT_HEATING_LOAD_TITLE_EN "Load Filament" +#define FILAMENT_HEATING_UNLOAD_TITLE_EN "Unload Filament" +#define FILAMENT_HEATING_CANCEL_EN "< Cancel" +#define FILAMENT_HEATING_MATERIAL_EN "Material:" +#define FILAMENT_HEATING_PLA_EN "Model-PLA" +#define FILAMENT_HEATING_TIPS_EN "Print head is heating..." +//rotate left +#define ROTATE_LEFT_LOAD_TITLE_EN "Load Filament" +#define ROTATE_LEFT_UNLOAD_TITLE_EN "Unload Filament" +#define ROTATE_LEFT_CANCEL_EN "< Cancel" +#define ROTATE_LEFT_MATERIAL_EN "Material:" +#define ROTATE_LEFT_PLA_EN "Model-PLA" +#define ROTATE_LEFT_NEXT_EN "Next >" +#define ROTATE_LEFT_TIPS_EN "Rotate extruder selection\ndial to the left." + +//hang spool +#define HANG_SPOOL_TITLE_EN "Load Filament" +#define HANG_SPOOL_PREVIOUS_EN "< Previous" +#define HANG_SPOOL_MATERIAL_EN "Material:" +#define HANG_SPOOL_PLA_EN "Model-PLA" +#define HANG_SPOOL_NEXT_EN "Next >" +#define HANG_SPOOL_TIPS_EN "Hang the spool in the spool\ncompartment as shown." + +//feed filament +#define FEED_FILAMENT_TITLE_EN "Load Filament" +#define FEED_FILAMENT_PREVIOUS_EN "< Previous" +#define FEED_FILAMENT_MATERIAL_EN "Material:" +#define FEED_FILAMENT_PLA_EN "Model-PLA" +#define FEED_FILAMENT_NEXT_EN "Next >" +#define FEED_FILAMENT_TIPS_EN "Feed filament into extruder\nup beyond the gears." + +//feed filament +#define ROTATE_UP_TITLE_EN "Load Filament" +#define ROTATE_UP_PREVIOUS_EN "< Previous" +#define ROTATE_UP_MATERIAL_EN "Material:" +#define ROTATE_UP_PLA_EN "Model-PLA" +#define ROTATE_UP_NEXT_EN "Next >" +#define ROTATE_UP_TIPS_EN "Rotate extruder selection\ndial up." + +//filament begin +#define FEED_BEGIN_TITLE_EN "Load Filament" +#define FEED_BEGIN_MATERIAL_EN "Material:" +#define FEED_BEGIN_PLA_EN "Model-PLA" +#define FEED_BEGIN_NEXT_EN "Next >" +#define FEED_BEGIN_TIPS_EN "Press Next when filament\nbegins to extrude." + +//filament finish +#define FEED_FINISH_TITLE_EN "Load Filament" +#define FEED_FINISH_MATERIAL_EN "Material:" +#define FEED_FINISH_PLA_EN "Model-PLA" +#define FEED_FINISH_NEXT_EN "Finish >" +#define FEED_FINISH_TIPS_EN "Remove filament from the\nnozzle and discard." +//fiament remove +#define REMOVE_SPOOL_TITLE_EN "Unload Filament" +#define REMOVE_SPOOL_PREVIOUS_EN "< Previous" +#define REMOVE_SPOOL_FINISH_EN "Finish >" +#define REMOVE_SPOOL_MATERIAL_EN "Material:" +#define REMOVE_SPOOL_PLA_EN "Model-PLA" +#define REMOVE_SPOOL_TIPS_EN "Remove the spool and pull\nfilament out of the machine." + +#define FILAMENT_SUPPORT_PVA_EN "Support-PVA" +#define LOAD_FINISH_EN "Load\nFilament\nComplete" +#define UNLOAD_FINISH_EN "Unload\nFilament\nComplete" + +//manual ip +#define MANUAL_IP_TITLE_EN "Manual IP" +#define MANUAL_IP_CANCEL_EN "< Cancel" +#define MANUAL_IP_APPLY_EN "Join >" +#define MANUAL_IP_ADDRESS_EN "IP Address" +#define MANUAL_IP_MASK_EN "Subnet Mask" +#define MANUAL_IP_GATEWAY_EN "Default Gateway" +#define MANUAL_IP_SERVER_EN "Name Server" +#define MANUAL_IP_INIT_DATA_EN "0.0.0.0" +#define MANUAL_TEXT_POINT_EN "." +#define MANUAL_TEXT_ENTER_EN "enter" + +//Wifi name +//#define TEXT_WIFI_MENU_TITLE_EN "WI-FI" +//#define TEXT_WIFI_SAPCE_EN "space" +//#define TEXT_WIFI_LETTER_EN "abc" +//#define TEXT_WIFI_DIGITAL_EN "123" +//#define TEXT_WIFI_SYMBOL_EN "#+=" +//#define TEXT_WIFI_PASSWORD_EN "Password" + +//#define TEXT_WIFI_POINT_BOLD_EN "`" + +//#define TEXT_WIFI_JOINING_EN "Joining\nNetwork..." +//#define TEXT_WIFI_FAILED_JOIN_EN "Failed to\nJoin Wi-Fi" +//#define TEXT_WIFI_WIFI_CONECTED_EN "Wi-Fi\nConnected" + +//#define TEXT_BUTTON_DISCONECTED_EN "Disconnect" +//#define TEXT_WIFI_FORGET_EN "Forget Network" +//#define TEXT_DISCONECTED_EN "Wi-Fi Connected" + +#define TEXT_FORGET_TIPS_TITLE_EN "Forget Network" +#define TEXT_FORGET_NETWORK_TIPS1_EN "Are you sure you want to\nforget this network?" +#define TEXT_FORGET_NETWORK_TIPS2_EN "This machine will no longer\njoin this Wi-Fi Network." + +#define TEXT_IPADDRESS_EN "IP Address: " + +#define TEXT_BUILD_FROM_CURA_CANCEL_TIPS1_EN "Are you sure you want to\ncancel this build?" +#define TEXT_BUILD_FROM_CURA_CANCEL_TIPS2_EN "The model will be deleted\nfrom this machine.It will\nneed to be resent from your\ncomputer before it can be\nbuilt in the future." + +#define DIALOG_CONFIRM_EN2 "Confirm" + +#define HEATING_TITLE_EN "Heating" +#define LEVELING_TITLE_EN "Leveling" + +#define ABOUT_SPARK_ADD_EN "Spark+" + +#define TEXT_RECEIVING_DATA_EN "Receiving Data" + +#define TEXT_BABY_STEP_EN "Babystep" + +#define PRINTING_OTHER_LANGUGE "Printing" +#define PRINTING_OPERATION_OTHER_LANGUGE "Operation" +#define PRINTING_PAUSE_OTHER_LANGUGE "Pause" + +#define MESSEGE_PAUSING_EN "Parking..." +#define MESSEGE_CHANGING_EN "Wait for filament change to start" +#define MESSEGE_UNLOAD_EN "Wait for filament unload" +#define MESSEGE_WAITING_EN "Press Button to resume print" +#define MESSEGE_INSERT_EN "Insert filament and press button to continue" +#define MESSEGE_LOAD_EN "Wait for filament load" +#define MESSEGE_PURGE_EN "Wait for filament purge" +#define MESSEGE_RESUME_EN "Wait for print to resume..." +#define MESSEGE_HEAT_EN "Press button to heat nozzle" +#define MESSEGE_HEATING_EN "Nozzle heating Please wait..." +#define MESSEGE_OPTION_EN "Purge more or continue print?" +#define MESSEGE_PURGE_MORE_EN "Purge" +#define MESSEGE_CONTINUE_PRINT_EN "Print" + +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_fr.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_fr.h new file mode 100644 index 000000000000..9a82f663b4ea --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_fr.h @@ -0,0 +1,256 @@ +#ifndef _TFT_LANGUAGE_FR_H +#define _TFT_LANGUAGE_FR_H +//*************法文****************************// +#define TOOL_TEXT_FR "prêt" +#define PREHEAT_TEXT_FR "Préchauffe" +#define MOVE_TEXT_FR "Déplace" +#define HOME_TEXT_FR "Acceuil" +#define PRINT_TEXT_FR "Impression" +#define EXTRUDE_TEXT_FR "Extruder" +#define LEVELING_TEXT_FR "Leveling" +#define AUTO_LEVELING_TEXT_FR "AutoLevel" +#define SET_TEXT_FR "Config" +#define MORE_TEXT_FR "Plus" + +#define ADD_TEXT_FR "Ajouter" +#define DEC_TEXT_FR "Réduire" +#define EXTRUDER_1_TEXT_FR "Extr1" +#define EXTRUDER_2_TEXT_FR "Extr2" +#define HEATBED_TEXT_FR "Hotlit" +#define TEXT_1C_FR "1℃" +#define TEXT_5C_FR "5℃" +#define TEXT_10C_FR "10℃" +#define CLOSE_TEXT_FR "Off" + +#define BACK_TEXT_FR "Arrière" + +#define TOOL_PREHEAT_FR "Préchauffe" +#define TOOL_EXTRUDE_FR "Extruder" +#define TOOL_MOVE_FR "Déplace" +#define TOOL_HOME_FR "Acceuil" +#define TOOL_LEVELING_FR "Leveling" +#define TOOL_AUTO_LEVELING_FR "AutoLevel" +#define TOOL_FILAMENT_FR "Filament" +#define TOOL_MORE_FR "Plus" + +#define AXIS_X_ADD_TEXT_FR "X+" +#define AXIS_X_DEC_TEXT_FR "X-" +#define AXIS_Y_ADD_TEXT_FR "Y+" +#define AXIS_Y_DEC_TEXT_FR "Y-" +#define AXIS_Z_ADD_TEXT_FR "Z+" +#define AXIS_Z_DEC_TEXT_FR "Z-" +#define TEXT_01MM_FR "0.1mm" +#define TEXT_1MM_FR "1mm" +#define TEXT_10MM_FR "10mm" + +#define HOME_X_TEXT_FR "X" +#define HOME_Y_TEXT_FR "Y" +#define HOME_Z_TEXT_FR "Z" +#define HOME_ALL_TEXT_FR "ALL" +#define HOME_STOPMOVE_FR "Quickstop" + +#define PAGE_UP_TEXT_FR "En haut" +#define PAGE_DOWN_TEXT_FR "En bas" + +#define EXTRUDER_IN_TEXT_FR "Insérer" +#define EXTRUDER_OUT_TEXT_FR "éjecter" +#define EXTRUDE_1MM_TEXT_FR "1mm" +#define EXTRUDE_5MM_TEXT_FR "5mm" +#define EXTRUDE_10MM_TEXT_FR "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_FR "Lente" +#define EXTRUDE_MEDIUM_SPEED_TEXT_FR "Moyen" +#define EXTRUDE_HIGH_SPEED_TEXT_FR "Rapide" + +#define LEVELING_POINT1_TEXT_FR "Premier" +#define LEVELING_POINT2_TEXT_FR "Seconde" +#define LEVELING_POINT3_TEXT_FR "Troisième" +#define LEVELING_POINT4_TEXT_FR "Quatrième" +#define LEVELING_POINT5_TEXT_FR "Cinquième" + +#define FILESYS_TEXT_FR "Fichier" +#define WIFI_TEXT_FR "WiFi" +#define FAN_TEXT_FR "Fan" +#define ABOUT_TEXT_FR "A propos" +#define BREAK_POINT_TEXT_FR "Continuer" +#define FILAMENT_TEXT_FR "Remplacer" +#define LANGUAGE_TEXT_FR "Langue" +#define MOTOR_OFF_TEXT_FR "M-hors" +#define MOTOR_OFF_XY_TEXT_FR "M-hors-XY" +#define SHUTDOWN_TEXT_FR "Eteindre" + +#define U_DISK_TEXT_FR "Clé usb" +#define SD_CARD_TEXT_FR "Carte SD" +#define WIFI_NAME_TEXT_FR "WiFi: " +#define WIFI_KEY_TEXT_FR "Key: " +#define WIFI_IP_TEXT_FR "IP: " +#define WIFI_AP_TEXT_FR "Etat: AP" +#define WIFI_STA_TEXT_FR "Etat: STA" +#define WIFI_CONNECTED_TEXT_FR "Connecté" +#define WIFI_DISCONNECTED_TEXT_FR "Déconnecté" +#define WIFI_EXCEPTION_TEXT_FR "Exception" +#define WIFI_RECONNECT_TEXT_FR "Reconnect" +#define CLOUD_TEXT_FR "Cloud" +#define CLOUD_BIND_FR "Lié" +#define CLOUD_UNBIND_FR "Délier" +#define CLOUD_UNBINDING_FR "Délier" +#define CLOUD_DISCONNECTED_FR "Déconnecté" +#define CLOUD_UNBINDED_FR "Délier" +#define CLOUD_BINDED_FR "Lié" +#define CLOUD_DISABLE_FR "Désactiver" + +#define FAN_ADD_TEXT_FR "Ajouter" +#define FAN_DEC_TEXT_FR "Réduire" +#define FAN_OPEN_TEXT_FR "100%" +#define FAN_HALF_TEXT_FR "50%" +#define FAN_CLOSE_TEXT_FR "0%" +#define FAN_TIPS1_TEXT_FR "ventilateur" +#define FAN_TIPS2_TEXT_FR "ventilateur\n0" + +#define FILAMENT_IN_TEXT_FR "Insérer" +#define FILAMENT_OUT_TEXT_FR "éjecter" +#define FILAMENT_EXT0_TEXT_FR "Extr1" +#define FILAMENT_EXT1_TEXT_FR "Extr2" +#define FILAMENT_HEAT_TEXT_FR "Preheat" +#define FILAMENT_STOP_TEXT_FR "Arrêter" +//#define FILAMENT_CHANGE_TEXT_FR "Filament remplacer" +#define FILAMENT_TIPS2_TEXT_FR "T:" +#define FILAMENT_TIPS3_TEXT_FR "Insérer le filament..." +#define FILAMENT_TIPS4_TEXT_FR "éjecter le filament..." +#define FILAMENT_TIPS5_TEXT_FR "Température trop basse pour démarrer, chauffez svp" +#define FILAMENT_TIPS6_TEXT_FR "Terminé" + +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_FR "Please click or <éjecter> \nto replace filament!" + #define FILAMENT_CHANGE_TEXT_FR "Please click or <éjecter>,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR "Heat completed,please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR "Please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR "Heat completed,please click for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_FR "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_FR "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Load filament completed,click for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Unload filament completed,click for return!" +#endif + #define FILAMENT_CHANGE_TEXT_FR "Please click \nor ,After \npinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR "Heat completed,please load filament \nto extruder,and click \nfor start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR "Please load filament to extruder,\nand click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR "Heat completed,please \nclick for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_FR "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_FR "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Load filament completed,\nclick for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Unload filament completed,\nclick for return!" + + +#define PRE_HEAT_EXT_TEXT_FR "E" +#define PRE_HEAT_BED_TEXT_FR "Bed" + +#define FILE_LOADING_FR "Chargement......" +#if 0 +#define NO_FILE_AND_CHECK_FR "Aucun fichier trouvé! Insérez une carte SD ou un disque U!" +#endif +#define NO_FILE_AND_CHECK_FR "Aucun fichier,vérifiez à nouveau!" + +#define NO_FILE_FR "Pas de fichier!" + + + +#define EXTRUDER_TEMP_TEXT_FR "Temper" +#define EXTRUDER_E_LENGTH1_TEXT_FR "Extruder1" +#define EXTRUDER_E_LENGTH2_TEXT_FR "Extruder2" +#define EXTRUDER_E_LENGTH3_TEXT_FR "Extruder3" + +#define ABOUT_TYPE_TEXT_FR "Type: " +#define ABOUT_VERSION_TEXT_FR "Firmware: " +#define ABOUT_WIFI_TEXT_FR "Wifi: " + +#define PRINTING_OPERATION_FR "Option" +#define PRINTING_PAUSE_FR "Pause" +#define PRINTING_TEMP_FR "Temp." +#define PRINTING_CHANGESPEED_FR "Speed" +#define PRINTING_RESUME_FR "Reprendre" +#define PRINTING_STOP_FR "Stop" +#define PRINTING_MORE_FR "Plus" +#define PRINTING_EXTRUDER_FR "Extruder" +#define PRINTING_MOVE_FR "Déplace" + +#define EXTRUDER_SPEED_FR "Extruder" +#define MOVE_SPEED_FR "Déplace" +#define EXTRUDER_SPEED_STATE_FR "Vitesse d'extrusion" +#define MOVE_SPEED_STATE_FR "vitesse de déplacement" +#define STEP_1PERCENT_FR "1%" +#define STEP_5PERCENT_FR "5%" +#define STEP_10PERCENT_FR "10%" + +#define ZOFFSET_FR "Z Offset" +#define ZOFFSET_INC_FR "Ajouter" +#define ZOFFSET_DEC_FR "Réduire" + +#define TITLE_READYPRINT_FR "Prête" +#define TITLE_PREHEAT_FR "Préchauffe" +#define TITLE_MOVE_FR "Déplace" +#define TITLE_HOME_FR "Acceuil" +#define TITLE_EXTRUDE_FR "Extruder" +#define TITLE_LEVELING_FR "Leveling" +#define TITLE_SET_FR "Paramètres" +#define TITLE_MORE_FR "Plus" +#define TITLE_CHOOSEFILE_FR "Fichier" +#define TITLE_PRINTING_FR "Pimpression" +#define TITLE_OPERATION_FR "Option" +#define TITLE_ADJUST_FR "Réglage" +#define TITLE_WIRELESS_FR "Sans fil" +#define TITLE_FILAMENT_FR "Remplacer" +#define TITLE_ABOUT_FR "A propos" +#define TITLE_FAN_FR "Ventilateur" +#define TITLE_LANGUAGE_FR "Langue" +#define TITLE_PAUSE_FR "Pause" +#define TITLE_CHANGESPEED_FR "Speed" +#define TITLE_CLOUD_TEXT_FR "Cloud" +#define TITLE_DIALOG_CONFIRM_FR "Confirm" +#define TITLE_FILESYS_FR "FileSys" +#define TITLE_ZOFFSET_FR "Z Offset" + +#define DIALOG_CLOSE_MACHINE_FR "Closing machine......" + +#define AUTO_SHUTDOWN_FR "Auto" +#define MANUAL_SHUTDOWN_FR "Manuel" + +#define DIALOG_CONFIRM_FR "Confirmer" +#define DIALOG_CANCLE_FR "Annuler" +#define DIALOG_OK_FR "OK" +#define DIALOG_RESET_FR "Réinitialiser" +#define DIALOG_RETRY_FR "Recommencez" +#define DIALOG_DISABLE_FR "Disable" +#define DIALOG_PRINT_MODEL_FR "Imprimer le fichier?" +#define DIALOG_CANCEL_PRINT_FR "Arrêter?" + +#define DIALOG_STOP_FR "Arrêter" +#define DIALOG_REPRINT_FROM_BREAKPOINT_FR "Continuer?" +//#define DIALOG_UNBIND_PRINTER_FR "Non lié?" +#define DIALOG_ERROR_TIPS1_FR "Erreur:error:Aucun fichier, \nvérifiez à nouveau." +#define DIALOG_ERROR_TIPS2_FR "Erreur:La opération a échoué. \nVerifiez que le baudrate de l'écran et de \nla carte mère soient identique!" +#define DIALOG_ERROR_TIPS3_FR "Erreur: le nom du fichier ou le \nchemin d'accès est trop long." +#define DIALOG_UNBIND_PRINTER_FR "Unbind the printer?" +#define DIALOG_FILAMENT_NO_PRESS_FR "Filament detection switch is not pressed" +#define DIALOG_PRINT_FINISH_FR "L'impression est terminée!" +#define DIALOG_PRINT_TIME_FR "Temps d'impression: " +#define DIALOG_REPRINT_FR "Print again" +#define DIALOG_WIFI_ENABLE_TIPS_FR "The wifi module is being configured,\nplease wait a moment....." + + +#define MESSEGE_PAUSING_FR "Parking..." +#define MESSEGE_CHANGING_FR "Attente filament pour démarrer" +#define MESSEGE_UNLOAD_FR "Attente retrait du filament" +#define MESSEGE_WAITING_FR "Presser bouton,pour reprendre" +#define MESSEGE_INSERT_FR "Insérer filament et app. bouton pour continuer..." +#define MESSEGE_LOAD_FR "Attente chargement filament" +#define MESSEGE_PURGE_FR "Attente Purge filament" +#define MESSEGE_RESUME_FR "Attente reprise impression" +#define MESSEGE_HEAT_FR "Presser le bouton pour chauffer..." +#define MESSEGE_HEATING_FR "Buse en chauffe Patienter SVP..." +#define MESSEGE_OPTION_FR "Purger davantage ou continuer l'impression?" +#define MESSEGE_PURGE_MORE_FR "Purge" +#define MESSEGE_CONTINUE_PRINT_FR "Impression" +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_it.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_it.h new file mode 100644 index 000000000000..9928218cb7e6 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_it.h @@ -0,0 +1,251 @@ +#ifndef _TFT_LANGUAGE_IT_H +#define _TFT_LANGUAGE_IT_H +//****************意大利语***************************// +#define TOOL_TEXT_IT "Strumento" +#define PREHEAT_TEXT_IT "Prerisc" +#define MOVE_TEXT_IT "Muovi" +#define HOME_TEXT_IT "Home" +#define PRINT_TEXT_IT "Stampa" +#define EXTRUDE_TEXT_IT "Estrude" +#define LEVELING_TEXT_IT "Leveling" +#define AUTO_LEVELING_TEXT_IT "AutoLevel" +#define SET_TEXT_IT "Imposta" +#define MORE_TEXT_IT "Di più" + +#define ADD_TEXT_IT "Aumentare" +#define DEC_TEXT_IT "Ridurre" +#define EXTRUDER_1_TEXT_IT "Estrude1" +#define EXTRUDER_2_TEXT_IT "Estrude2" +#define HEATBED_TEXT_IT "Piano" +#define TEXT_1C_IT "1℃" +#define TEXT_5C_IT "5℃" +#define TEXT_10C_IT "10℃" +#define CLOSE_TEXT_IT "Spento" + +#define BACK_TEXT_IT "Indietro" + +#define TOOL_PREHEAT_IT "Prerisc" +#define TOOL_EXTRUDE_IT "Estrude" +#define TOOL_MOVE_IT "Muovi" +#define TOOL_HOME_IT "Home" +#define TOOL_LEVELING_IT "Leveling" +#define TOOL_AUTO_LEVELING_IT "Autolevel" +#define TOOL_FILAMENT_IT "Filamento" +#define TOOL_MORE_IT "Di più" + +#define AXIS_X_ADD_TEXT_IT "X+" +#define AXIS_X_DEC_TEXT_IT "X-" +#define AXIS_Y_ADD_TEXT_IT "Y+" +#define AXIS_Y_DEC_TEXT_IT "Y-" +#define AXIS_Z_ADD_TEXT_IT "Z+" +#define AXIS_Z_DEC_TEXT_IT "Z-" +#define TEXT_01MM_IT "0.1mm" +#define TEXT_1MM_IT "1mm" +#define TEXT_10MM_IT "10mm" + +#define HOME_X_TEXT_IT "X" +#define HOME_Y_TEXT_IT "Y" +#define HOME_Z_TEXT_IT "Z" +#define HOME_ALL_TEXT_IT "All" +#define HOME_STOPMOVE_IT "Quickstop" + +#define PAGE_UP_TEXT_IT "Pagina su" +#define PAGE_DOWN_TEXT_IT "Pagina giù" + +#define EXTRUDER_IN_TEXT_IT "Estru" +#define EXTRUDER_OUT_TEXT_IT "Ritra" +#define EXTRUDE_1MM_TEXT_IT "1mm" +#define EXTRUDE_5MM_TEXT_IT "5mm" +#define EXTRUDE_10MM_TEXT_IT "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_IT "Bassa" +#define EXTRUDE_MEDIUM_SPEED_TEXT_IT "Media" +#define EXTRUDE_HIGH_SPEED_TEXT_IT "Alta" + +#define LEVELING_POINT1_TEXT_IT "Primo" +#define LEVELING_POINT2_TEXT_IT "Secondo" +#define LEVELING_POINT3_TEXT_IT "Terzo" +#define LEVELING_POINT4_TEXT_IT "Quarto" +#define LEVELING_POINT5_TEXT_IT "Quinto" + +#define FILESYS_TEXT_IT "FileSys" +#define WIFI_TEXT_IT "WIFI" +#define FAN_TEXT_IT "Ventola" +#define ABOUT_TEXT_IT "Circa" +#define BREAK_POINT_TEXT_IT "Continua" +#define FILAMENT_TEXT_IT "Filamento" +#define LANGUAGE_TEXT_IT "Lingua" +#define MOTOR_OFF_TEXT_IT "Motor off" +#define MOTOR_OFF_XY_TEXT_IT "Off-XY" +#define SHUTDOWN_TEXT_IT "Spento" + +#define U_DISK_TEXT_IT "USB" +#define SD_CARD_TEXT_IT "SD" +#define WIFI_NAME_TEXT_IT "WIFI: " +#define WIFI_KEY_TEXT_IT "KEY: " +#define WIFI_IP_TEXT_IT "IP: " +#define WIFI_AP_TEXT_IT "Stato: AP" +#define WIFI_STA_TEXT_IT "Stato: STA" +#define WIFI_CONNECTED_TEXT_IT "Connesso" +#define WIFI_DISCONNECTED_TEXT_IT "Disconnesso" +#define WIFI_EXCEPTION_TEXT_IT "Eccezione" +#define WIFI_RECONNECT_TEXT_IT "Reconnect" +#define CLOUD_TEXT_IT "Cloud" +#define CLOUD_BIND_IT "Legato" +#define CLOUD_UNBIND_IT "Libero" +#define CLOUD_DISCONNECTED_IT "Disconnesso" +#define CLOUD_UNBINDING_IT "Libero" +#define CLOUD_UNBINDED_IT "Sciolto" +#define CLOUD_BINDED_IT "Legato" +#define CLOUD_DISABLE_IT "Disable" + +#define FAN_ADD_TEXT_IT "Aumentare" +#define FAN_DEC_TEXT_IT "Ridurre" +#define FAN_OPEN_TEXT_IT "100%" +#define FAN_HALF_TEXT_IT "50%" +#define FAN_CLOSE_TEXT_IT "Spento" +#define FAN_TIPS1_TEXT_IT "Ventola" +#define FAN_TIPS2_TEXT_IT "Ventola\n0" + +#define FILAMENT_IN_TEXT_IT "Inser" +#define FILAMENT_OUT_TEXT_IT "Estra" +#define FILAMENT_EXT0_TEXT_IT "Estrude1" +#define FILAMENT_EXT1_TEXT_IT "Estrude2" +#define FILAMENT_HEAT_TEXT_IT "Preriscaldamento" +#define FILAMENT_STOP_TEXT_IT "Stop" +//#define FILAMENT_CHANGE_TEXT_IT "Filamento" +#define FILAMENT_TIPS2_TEXT_IT "T:" +#define FILAMENT_TIPS3_TEXT_IT "Inserimento del filamento..." +#define FILAMENT_TIPS4_TEXT_IT "Estrazione del filamento..." +#define FILAMENT_TIPS5_TEXT_IT "Temp is too low to go,please heat" +#define FILAMENT_TIPS6_TEXT_IT "Completato" + +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_IT "Please click or \nto replace filament!" + #define FILAMENT_CHANGE_TEXT_IT "Please click or ,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT "Heat completed,please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_IT "Please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT "Heat completed,please click for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_IT "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_IT "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT "Load filament completed,click for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT "Unload filament completed,click for return!" +#endif + #define FILAMENT_CHANGE_TEXT_IT "Please click \nor ,After \npinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT "Heat completed,please load filament \nto extruder,and click \nfor start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_IT "Please load filament to extruder,\nand click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT "Heat completed,please \nclick for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_IT "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_IT "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT "Load filament completed,\nclick for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT "Unload filament completed,\nclick for return!" + + +#define PRE_HEAT_EXT_TEXT_IT "E" +#define PRE_HEAT_BED_TEXT_IT "Piano" + +#define FILE_LOADING_IT "Caricamento......" +#if 0 +#define NO_FILE_AND_CHECK_IT "Nessun file trovato! Inserisci la scheda SD o il disco U!" +#endif +#define NO_FILE_AND_CHECK_IT "Nessun file,\n per favore controllare di nuovo!" + +#define NO_FILE_IT "Nessun file!" + +#define EXTRUDER_TEMP_TEXT_IT "Temper" +#define EXTRUDER_E_LENGTH1_TEXT_IT "Estrude1" +#define EXTRUDER_E_LENGTH2_TEXT_IT "Estrude2" +#define EXTRUDER_E_LENGTH3_TEXT_IT "Estrude3" + +#define ABOUT_TYPE_TEXT_IT "Type: " +#define ABOUT_VERSION_TEXT_IT "Firmware: " +#define ABOUT_WIFI_TEXT_IT "WiFi: " + +#define PRINTING_OPERATION_IT "Opzioni" +#define PRINTING_PAUSE_IT "Pause" +#define PRINTING_TEMP_IT "Temp." +#define PRINTING_CHANGESPEED_IT "Velocità" +#define PRINTING_RESUME_IT "Recupero" +#define PRINTING_STOP_IT "Stop" +#define PRINTING_MORE_IT "Di più" +#define PRINTING_EXTRUDER_IT "Estrude" +#define PRINTING_MOVE_IT "Muovi" + +#define EXTRUDER_SPEED_IT "Estrude" +#define MOVE_SPEED_IT "Muovi" +#define EXTRUDER_SPEED_STATE_IT "Estrusione" +#define MOVE_SPEED_STATE_IT "Movimento" +#define STEP_1PERCENT_IT "1%" +#define STEP_5PERCENT_IT "5%" +#define STEP_10PERCENT_IT "10%" + +#define ZOFFSET_IT "Z Offset" +#define ZOFFSET_INC_IT "Add" +#define ZOFFSET_DEC_IT "Dec" + +#define TITLE_READYPRINT_IT "Pronto" +#define TITLE_PREHEAT_IT "Preris" +#define TITLE_MOVE_IT "Muovi" +#define TITLE_HOME_IT "Home" +#define TITLE_EXTRUDE_IT "Estrude" +#define TITLE_LEVELING_IT "Livella" +#define TITLE_SET_IT "Impostare" +#define TITLE_MORE_IT "Di più" +#define TITLE_CHOOSEFILE_IT "File" +#define TITLE_PRINTING_IT "Stampa" +#define TITLE_OPERATION_IT "Opzioni" +#define TITLE_ADJUST_IT "Regolare" +#define TITLE_WIRELESS_IT "Wireless" +#define TITLE_FILAMENT_IT "Filamento" +#define TITLE_ABOUT_IT "Circa" +#define TITLE_FAN_IT "Ventola" +#define TITLE_LANGUAGE_IT "Lingua" +#define TITLE_PAUSE_IT "Pausa" +#define TITLE_CHANGESPEED_IT "Velocità" +#define TITLE_CLOUD_TEXT_IT "Cloud" +#define TITLE_DIALOG_CONFIRM_IT "Confirm" +#define TITLE_FILESYS_IT "FileSys" +#define TITLE_ZOFFSET_IT "Z Offset" + +#define AUTO_SHUTDOWN_IT "Auto" +#define MANUAL_SHUTDOWN_IT "Manuale" + +#define DIALOG_CONFIRM_IT "Conferma" +#define DIALOG_CANCLE_IT "Cancella" +#define DIALOG_OK_IT "OK" +#define DIALOG_RESET_IT "Resettare" +#define DIALOG_RETRY_IT "Riprovare" +#define DIALOG_DISABLE_IT "Disable" +#define DIALOG_PRINT_MODEL_IT "Gcode stampa?" +#define DIALOG_CANCEL_PRINT_IT "Stop stampa?" +#define DIALOG_STOP_IT "Stop" +#define DIALOG_REPRINT_FROM_BREAKPOINT_IT "Continua a stampare dal \npunto di interruzione?" +//#define DIALOG_UNBIND_PRINTER_IT "Libero?" +#define DIALOG_ERROR_TIPS1_IT "Errore: nessun file, \nper favore controllare di nuovo." +#define DIALOG_ERROR_TIPS2_IT "Errore: operazione non riuscita, \nsi prega di controllare se il baudrate del \ndisplay è lo stesso scheda madre" +#define DIALOG_ERROR_TIPS3_IT "Errore: il nome del file o il \npercorso è troppo lungo!" +#define DIALOG_CLOSE_MACHINE_IT "Closing machine......" +#define DIALOG_UNBIND_PRINTER_IT "Unbind the printer?" +#define DIALOG_FILAMENT_NO_PRESS_IT "Filament detection switch is not pressed" +#define DIALOG_PRINT_FINISH_IT "La stampa è completa!" +#define DIALOG_PRINT_TIME_IT "Tempo di stampa: " +#define DIALOG_REPRINT_IT "Print again" +#define DIALOG_WIFI_ENABLE_TIPS_IT "The wifi module is being configured,\nplease wait a moment....." + +#define MESSEGE_PAUSING_IT "Parcheggiando..." +#define MESSEGE_CHANGING_IT "Attendere avvio del cambio di filamento" +#define MESSEGE_UNLOAD_IT "Attendere l'espulsione del filamento" +#define MESSEGE_WAITING_IT "Premi per riprendere la stampa" +#define MESSEGE_INSERT_IT "Inserisci il filamento e premi per continuare" +#define MESSEGE_LOAD_IT "Attendere il caricamento del filamento" +#define MESSEGE_PURGE_IT "Attendere lo spurgo del filamento" +#define MESSEGE_RESUME_IT "Attendere la ripresa della stampa..." +#define MESSEGE_HEAT_IT "Premi per riscaldare ugello" +#define MESSEGE_HEATING_IT "Riscaldam. ugello Attendere prego..." +#define MESSEGE_OPTION_IT "Eliminare di più o continuare a stampare?" +#define MESSEGE_PURGE_MORE_IT "Epurazione" +#define MESSEGE_CONTINUE_PRINT_IT "Stampa" +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_ru.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_ru.h new file mode 100644 index 000000000000..a83a06d6afb2 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_ru.h @@ -0,0 +1,253 @@ +#ifndef _TFT_LANGUAGE_RU_H +#define _TFT_LANGUAGE_RU_H +//****************俄语***************************// +#define TOOL_TEXT_RU "инструмент" +#define PREHEAT_TEXT_RU " нагрев" +#define MOVE_TEXT_RU "движение" +#define HOME_TEXT_RU "домой" +#define PRINT_TEXT_RU " печать" +#define EXTRUDE_TEXT_RU "экструзия" +#define LEVELING_TEXT_RU "уровень" +#define AUTO_LEVELING_TEXT_RU "aвто" +#define SET_TEXT_RU "настройки" +#define MORE_TEXT_RU "больше" + +#define ADD_TEXT_RU "добавить" +#define DEC_TEXT_RU "уменьшить" +#define EXTRUDER_1_TEXT_RU "экструдер1" +#define EXTRUDER_2_TEXT_RU "экструдер2" +#define HEATBED_TEXT_RU "стол" +#define TEXT_1C_RU "1℃" +#define TEXT_5C_RU "5℃" +#define TEXT_10C_RU "10℃" +#define CLOSE_TEXT_RU "выкл" + +#define BACK_TEXT_RU "назад" + +#define TOOL_PREHEAT_RU "нагрев" +#define TOOL_EXTRUDE_RU "экструзия" +#define TOOL_MOVE_RU "движение" +#define TOOL_HOME_RU "домой" +#define TOOL_LEVELING_RU "уровень" +#define TOOL_AUTO_LEVELING_RU "aвто" +#define TOOL_FILAMENT_RU "замена" +#define TOOL_MORE_RU "больше" + +#define AXIS_X_ADD_TEXT_RU "X+" +#define AXIS_X_DEC_TEXT_RU "X-" +#define AXIS_Y_ADD_TEXT_RU "Y+" +#define AXIS_Y_DEC_TEXT_RU "Y-" +#define AXIS_Z_ADD_TEXT_RU "Z+" +#define AXIS_Z_DEC_TEXT_RU "Z-" +#define TEXT_01MM_RU "0.1mm" +#define TEXT_1MM_RU "1mm" +#define TEXT_10MM_RU "10mm" + +#define HOME_X_TEXT_RU "X" +#define HOME_Y_TEXT_RU "Y" +#define HOME_Z_TEXT_RU "Z" +#define HOME_ALL_TEXT_RU "Home" +#define HOME_STOPMOVE_RU "Quickstop" + +#define PAGE_UP_TEXT_RU "вверх" +#define PAGE_DOWN_TEXT_RU "вниз" + +#define EXTRUDER_IN_TEXT_RU "втянуть" +#define EXTRUDER_OUT_TEXT_RU "выдавить" +#define EXTRUDE_1MM_TEXT_RU "1mm" +#define EXTRUDE_5MM_TEXT_RU "5mm" +#define EXTRUDE_10MM_TEXT_RU "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_RU "мин" +#define EXTRUDE_MEDIUM_SPEED_TEXT_RU "сред" +#define EXTRUDE_HIGH_SPEED_TEXT_RU "выс" + +#define LEVELING_POINT1_TEXT_RU "1точка" +#define LEVELING_POINT2_TEXT_RU "2точка" +#define LEVELING_POINT3_TEXT_RU "3точка" +#define LEVELING_POINT4_TEXT_RU "4точка" +#define LEVELING_POINT5_TEXT_RU "5точка" + +#define FILESYS_TEXT_RU "система" +#define WIFI_TEXT_RU "WiFi" +#define FAN_TEXT_RU "вентилятор" +#define ABOUT_TEXT_RU "инфо" +#define BREAK_POINT_TEXT_RU "продолжить" +#define FILAMENT_TEXT_RU "замена" +#define LANGUAGE_TEXT_RU "язык" +#define MOTOR_OFF_TEXT_RU "отклмотор" +#define MOTOR_OFF_XY_TEXT_RU "Off-XY" +#define SHUTDOWN_TEXT_RU "выключение" + +#define U_DISK_TEXT_RU "U диск" +#define SD_CARD_TEXT_RU "SD диск" +#define WIFI_NAME_TEXT_RU "WiFi: " +#define WIFI_KEY_TEXT_RU "пароль: " +#define WIFI_IP_TEXT_RU "IP: " +#define WIFI_AP_TEXT_RU "режим: AP" +#define WIFI_STA_TEXT_RU "режим: STA" +#define WIFI_CONNECTED_TEXT_RU "подключен" +#define WIFI_DISCONNECTED_TEXT_RU "не подключен" +#define WIFI_EXCEPTION_TEXT_RU "исключение" +#define WIFI_RECONNECT_TEXT_RU "Reconnect" +#define CLOUD_TEXT_RU "облако" +#define CLOUD_BIND_RU "соединён" +#define CLOUD_UNBIND_RU "не соединён" +#define CLOUD_UNBINDING_RU "Unbinding" +#define CLOUD_DISCONNECTED_RU "Disconnected" +#define CLOUD_UNBINDED_RU "Unbinded" +#define CLOUD_BINDED_RU "Binded" +#define CLOUD_DISABLE_RU "Disable" + +#define FAN_ADD_TEXT_RU "добавить" +#define FAN_DEC_TEXT_RU "уменьшить" +#define FAN_OPEN_TEXT_RU "100%" +#define FAN_HALF_TEXT_RU "50%" +#define FAN_CLOSE_TEXT_RU "откл" +#define FAN_TIPS1_TEXT_RU "вентилятор" +#define FAN_TIPS2_TEXT_RU "вентилятор\nоткл" + +#define FILAMENT_IN_TEXT_RU "втянуть" +#define FILAMENT_OUT_TEXT_RU "выдавить" +#define FILAMENT_EXT0_TEXT_RU "экструдер1" +#define FILAMENT_EXT1_TEXT_RU "экструдер2" +#define FILAMENT_HEAT_TEXT_RU "нагрев" +#define FILAMENT_STOP_TEXT_RU "стоп" +//#define FILAMENT_CHANGE_TEXT_RU "замена" +#define FILAMENT_TIPS2_TEXT_RU "T:" +#define FILAMENT_TIPS3_TEXT_RU "втянуть..." +#define FILAMENT_TIPS4_TEXT_RU "вядавить..." +#define FILAMENT_TIPS5_TEXT_RU "Низкая температура, \nнеобходим нагрев" +#define FILAMENT_TIPS6_TEXT_RU "завершено" + +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_RU "Please click <втянуть> or <выдавить> \nto replace filament!" + #define FILAMENT_CHANGE_TEXT_RU "Please click <втянуть> or <выдавить>,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU "Heat completed,please load filament to extruder,and click <да> for start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_RU "Please load filament to extruder,and click <да> for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU "Heat completed,please click <да> for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_RU "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_RU "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,click <да> for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,click <да> for return!" +#endif + #define FILAMENT_CHANGE_TEXT_RU "Please click \nor ,After \npinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU "Heat completed,please load filament \nto extruder,and click \nfor start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_RU "Please load filament to extruder,\nand click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU "Heat completed,please \nclick for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_RU "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_RU "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,\nclick for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,\nclick for return!" + + +#define PRE_HEAT_EXT_TEXT_RU "E" +#define PRE_HEAT_BED_TEXT_RU "стол" + +#define FILE_LOADING_RU "загрузка......" +#if 0 +#define NO_FILE_AND_CHECK_RU "Файлы не найдены! Вставьте SD-карту или диск U!" +#endif +#define NO_FILE_AND_CHECK_RU "нет файла,попробуйте ещё раз!" + +#define NO_FILE_RU "нет файла!" + +#define EXTRUDER_TEMP_TEXT_RU "температура" +#define EXTRUDER_E_LENGTH1_TEXT_RU "экструзия1" +#define EXTRUDER_E_LENGTH2_TEXT_RU "экструзия2" +#define EXTRUDER_E_LENGTH3_TEXT_RU "экструзия3" + +#define ABOUT_TYPE_TEXT_RU "Type: " +#define ABOUT_VERSION_TEXT_RU "Firmware: " +#define ABOUT_WIFI_TEXT_RU "WiFi: " + +#define PRINTING_OPERATION_RU "управление" +#define PRINTING_PAUSE_RU "пауза" +#define PRINTING_TEMP_RU "темп" +#define PRINTING_CHANGESPEED_RU "скорости" +#define PRINTING_RESUME_RU "возобновить" +#define PRINTING_STOP_RU "стоп" +#define PRINTING_MORE_RU "больше" +#define PRINTING_EXTRUDER_RU "экстр" +#define PRINTING_MOVE_RU "движение" + +#define EXTRUDER_SPEED_RU "экстр" +#define MOVE_SPEED_RU "движ" +#define EXTRUDER_SPEED_STATE_RU "скорость экстр" +#define MOVE_SPEED_STATE_RU "скорость движ" +#define STEP_1PERCENT_RU "1%" +#define STEP_5PERCENT_RU "5%" +#define STEP_10PERCENT_RU "10%" + +#define ZOFFSET_RU "Z Offset" +#define ZOFFSET_INC_RU "добавить" +#define ZOFFSET_DEC_RU "уменьшить" + +#define TITLE_READYPRINT_RU "готов к" +#define TITLE_PREHEAT_RU "движение" +#define TITLE_MOVE_RU "движение" +#define TITLE_HOME_RU "Home" +#define TITLE_EXTRUDE_RU "экструзия" +#define TITLE_LEVELING_RU "уровень" +#define TITLE_SET_RU "настройки" +#define TITLE_MORE_RU "больше" +#define TITLE_CHOOSEFILE_RU "файла" +#define TITLE_PRINTING_RU "печать" +#define TITLE_OPERATION_RU "управление" +#define TITLE_ADJUST_RU "регулировать" +#define TITLE_WIRELESS_RU "Wireless" +#define TITLE_FILAMENT_RU "замена" +#define TITLE_ABOUT_RU "инфо" +#define TITLE_FAN_RU "вентилятор" +#define TITLE_LANGUAGE_RU "язык" +#define TITLE_PAUSE_RU "пауза" +#define TITLE_CHANGESPEED_RU "скорости" +#define TILE_TOOL_RU "инструмент" +#define TITLE_CLOUD_TEXT_RU "Cloud" +#define TITLE_DIALOG_CONFIRM_RU "Confirm" +#define TITLE_FILESYS_RU "FileSys" +#define TITLE_ZOFFSET_RU "Z Offset" + +#define AUTO_SHUTDOWN_RU "авто-откл" +#define MANUAL_SHUTDOWN_RU "ручн-откл" + +#define DIALOG_CONFIRM_RU "да"//"подтвердить" +#define DIALOG_CANCLE_RU "отмена" +#define DIALOG_OK_RU "да" +#define DIALOG_RESET_RU "сброс" +#define DIALOG_RETRY_RU "повтор" +#define DIALOG_DISABLE_RU "запретить" +#define DIALOG_PRINT_MODEL_RU "печать модели?" +#define DIALOG_CANCEL_PRINT_RU "стоп?" +#define DIALOG_STOP_RU "стоп" +#define DIALOG_REPRINT_FROM_BREAKPOINT_RU "продолжить?" +//#define DIALOG_UNBIND_PRINTER_RU "разрыв?" +#define DIALOG_ERROR_TIPS1_RU "ошибка:нет файла, попробуйте ещё раз." +#define DIALOG_ERROR_TIPS2_RU "ошибка:сбой передачи. установите скорость \nпередачи данных как на плате управления!" +#define DIALOG_ERROR_TIPS3_RU "ошибка: имя файла слишком длинное!" +#define DIALOG_CLOSE_MACHINE_RU "Closing machine......" +#define DIALOG_UNBIND_PRINTER_RU "Unbind the printer?" +#define DIALOG_FILAMENT_NO_PRESS_RU "Filament detection switch is not pressed" +#define DIALOG_PRINT_FINISH_RU "Печать завершена!" +#define DIALOG_PRINT_TIME_RU "Время печати: " +#define DIALOG_REPRINT_RU "Print again" +#define DIALOG_WIFI_ENABLE_TIPS_RU "The wifi module is being configured,\nplease wait a moment....." + +#define MESSEGE_PAUSING_RU "Стоянка..." +#define MESSEGE_CHANGING_RU "Подождите, пока начнется смена филамента" +#define MESSEGE_UNLOAD_RU "Дождитесь выгрузки нити" +#define MESSEGE_WAITING_RU "Нажмите кнопку,чтобы возобновить печать" +#define MESSEGE_INSERT_RU "Вставьте нить и нажмите кнопку,чтобы продолжить" +#define MESSEGE_LOAD_RU "Дождитесь загрузки нити" +#define MESSEGE_PURGE_RU "Дождитесь чистки нити" +#define MESSEGE_RESUME_RU "Подождите,пока печать возобновится ..." +#define MESSEGE_HEAT_RU "Нажмите кнопку, чтобы нагреть форсунку" +#define MESSEGE_HEATING_RU "Подогрев форсунки Пожалуйста, подождите ..." +#define MESSEGE_OPTION_RU "Очистить больше или продолжить печать?" +#define MESSEGE_PURGE_MORE_RU "чистка" +#define MESSEGE_CONTINUE_PRINT_RU "Распечатать" + +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_s_cn.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_s_cn.h new file mode 100644 index 000000000000..f0c333f77003 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_s_cn.h @@ -0,0 +1,248 @@ +#ifndef _TFT_LANGUAGE_S_CN_H +#define _TFT_LANGUAGE_S_CN_H +//*************简体中文***********************// +#define TOOL_TEXT_CN "工具" +#define PREHEAT_TEXT_CN "预热" +#define MOVE_TEXT_CN "移动" +#define HOME_TEXT_CN "回零" +#define PRINT_TEXT_CN "打印" +#define EXTRUDE_TEXT_CN "挤出" +#define LEVELING_TEXT_CN "调平" +#define AUTO_LEVELING_TEXT_CN "自动调平" +#define SET_TEXT_CN "设置" +#define MORE_TEXT_CN "更多" + +#define ADD_TEXT_CN "增加" +#define DEC_TEXT_CN "减少" +#define EXTRUDER_1_TEXT_CN "喷头1" +#define EXTRUDER_2_TEXT_CN "喷头2" +#define HEATBED_TEXT_CN "热床" +#define TEXT_1C_CN "1℃" +#define TEXT_5C_CN "5℃" +#define TEXT_10C_CN "10℃" +#define CLOSE_TEXT_CN "关闭" + +#define BACK_TEXT_CN "返回" + +#define TOOL_PREHEAT_CN "预热" +#define TOOL_EXTRUDE_CN "挤出" +#define TOOL_MOVE_CN "移动" +#define TOOL_HOME_CN "回零" +#define TOOL_LEVELING_CN "调平" +#define TOOL_AUTO_LEVELING_CN "自动调平" +#define TOOL_FILAMENT_CN "换料" +#define TOOL_MORE_CN "更多" + +#define AXIS_X_ADD_TEXT_CN "X+" +#define AXIS_X_DEC_TEXT_CN "X-" +#define AXIS_Y_ADD_TEXT_CN "Y+" +#define AXIS_Y_DEC_TEXT_CN "Y-" +#define AXIS_Z_ADD_TEXT_CN "Z+" +#define AXIS_Z_DEC_TEXT_CN "Z-" +#define TEXT_01MM_CN "0.1mm" +#define TEXT_1MM_CN "1mm" +#define TEXT_10MM_CN "10mm" + +#define HOME_X_TEXT_CN "X" +#define HOME_Y_TEXT_CN "Y" +#define HOME_Z_TEXT_CN "Z" +#define HOME_ALL_TEXT_CN "回零" +#define HOME_STOPMOVE_CN "急停" + +#define PAGE_UP_TEXT_CN "上一页" +#define PAGE_DOWN_TEXT_CN "下一页" + +#define EXTRUDER_IN_TEXT_CN "进料" +#define EXTRUDER_OUT_TEXT_CN "退料" +#define EXTRUDE_1MM_TEXT_CN "1mm" +#define EXTRUDE_5MM_TEXT_CN "5mm" +#define EXTRUDE_10MM_TEXT_CN "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_CN "低速" +#define EXTRUDE_MEDIUM_SPEED_TEXT_CN "常速" +#define EXTRUDE_HIGH_SPEED_TEXT_CN "高速" + +#define LEVELING_POINT1_TEXT_CN "第一点" +#define LEVELING_POINT2_TEXT_CN "第二点" +#define LEVELING_POINT3_TEXT_CN "第三点" +#define LEVELING_POINT4_TEXT_CN "第四点" +#define LEVELING_POINT5_TEXT_CN "第五点" + +#define FILESYS_TEXT_CN "文件系统" +#define WIFI_TEXT_CN "WIFI" +#define FAN_TEXT_CN "风扇" +#define ABOUT_TEXT_CN "关于" +#define BREAK_POINT_TEXT_CN "断点续打" +#define FILAMENT_TEXT_CN "换料" +#define LANGUAGE_TEXT_CN "语言" +#define MOTOR_OFF_TEXT_CN "关闭电机" +#define MOTOR_OFF_XY_TEXT_CN "关闭XY" +#define SHUTDOWN_TEXT_CN "关机" + +#define U_DISK_TEXT_CN "U盘" +#define SD_CARD_TEXT_CN "SD卡" +#define WIFI_NAME_TEXT_CN "无线网络:" +#define WIFI_KEY_TEXT_CN "密码: " +#define WIFI_IP_TEXT_CN "IP: " +#define WIFI_AP_TEXT_CN "状态: AP" +#define WIFI_STA_TEXT_CN "状态: STA" +#define WIFI_CONNECTED_TEXT_CN "已连接" +#define WIFI_DISCONNECTED_TEXT_CN "未连接" +#define WIFI_EXCEPTION_TEXT_CN "模块异常" +#define CLOUD_TEXT_CN "云服务" +#define CLOUD_BIND_CN "已绑定" +#define CLOUD_UNBIND_CN "解绑" +#define CLOUD_UNBINDING_CN "解绑中" +#define CLOUD_DISCONNECTED_CN "未连接" +#define CLOUD_UNBINDED_CN "未绑定" +#define CLOUD_BINDED_CN "已绑定" +#define CLOUD_DISABLE_CN "已禁用" + +#define FAN_ADD_TEXT_CN "增加" +#define FAN_DEC_TEXT_CN "减少" +#define FAN_OPEN_TEXT_CN "100%" +#define FAN_HALF_TEXT_CN "50%" +#define FAN_CLOSE_TEXT_CN "关闭" +#define FAN_TIPS1_TEXT_CN "风扇" +#define FAN_TIPS2_TEXT_CN "FAN\nClose" + +#define FILAMENT_IN_TEXT_CN "进料" +#define FILAMENT_OUT_TEXT_CN "退料" +#define FILAMENT_EXT0_TEXT_CN "喷头1" +#define FILAMENT_EXT1_TEXT_CN "喷头2" +#define FILAMENT_HEAT_TEXT_CN "预热" +#define FILAMENT_STOP_TEXT_CN "停止" +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_CN "请按<进料>或<退料>进行换料!" + #define FILAMENT_CHANGE_TEXT_CN "待打印机暂停后,请按<进料>或<退料>进行换料!" + +#endif + + + #define FILAMENT_CHANGE_TEXT_CN "待打印机暂停后,\n请按<进料>或<退料>" + + +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_CN "准备进料,正在加热,请稍等!" +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_CN "准备退料,正在加热,请稍等!" +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_CN "加热完成,请装载耗材后,按<确定>开始进料!" +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_CN "请装载耗材,按<确定>开始进料!" +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_CN "加热完成,请按<确定>开始退料!" +#define FILAMENT_DIALOG_LOADING_TIPS_CN "正在进料,请等待耗材加载完成!" +#define FILAMENT_DIALOG_UNLOADING_TIPS_CN "正在退料,请等待耗材卸载完成!" +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_CN "进料完成,请按<确定>返回" +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_CN "退料完成,请按<确定>返回" + +#define FILAMENT_TIPS3_TEXT_CN "正在进料" +#define FILAMENT_TIPS4_TEXT_CN "正在退料" +#define FILAMENT_TIPS5_TEXT_CN "温度太低,请先预热" +#define FILAMENT_TIPS6_TEXT_CN "换料完成" + +#define PRE_HEAT_EXT_TEXT_CN "喷头" +#define PRE_HEAT_BED_TEXT_CN "热床" + +#define FILE_LOADING_CN "正在载入......" +#define NO_FILE_AND_CHECK_CN "无文件!请插入sd卡或u盘!" +#define NO_FILE_CN "无文件!" + +#define EXTRUDER_TEMP_TEXT_CN "温度" +#define EXTRUDER_E_LENGTH1_TEXT_CN "喷头" +#define EXTRUDER_E_LENGTH2_TEXT_CN "喷头" +#define EXTRUDER_E_LENGTH3_TEXT_CN "喷头" + +#define ABOUT_TYPE_TEXT_CN "Type: " +#define ABOUT_VERSION_TEXT_CN "Firmware: " +#define ABOUT_WIFI_TEXT_CN "Wifi: " + +#define PRINTING_OPERATION_CN "操作" +#define PRINTING_PAUSE_CN "暂停" +#define PRINTING_TEMP_CN "温度" +#define PRINTING_CHANGESPEED_CN "变速" +#define PRINTING_RESUME_CN "恢复" +#define PRINTING_STOP_CN "停止" +#define PRINTING_MORE_CN "更多" +#define PRINTING_EXTRUDER_CN "挤出" +#define PRINTING_MOVE_CN "移动" + +#define EXTRUDER_SPEED_CN "挤出" +#define MOVE_SPEED_CN "移动" +#define EXTRUDER_SPEED_STATE_CN "挤出速度" +#define MOVE_SPEED_STATE_CN "移动速度" +#define STEP_1PERCENT_CN "1%" +#define STEP_5PERCENT_CN "5%" +#define STEP_10PERCENT_CN "10%" + +#define ZOFFSET_CN "Z Offset" +#define ZOFFSET_INC_CN "增加" +#define ZOFFSET_DEC_CN "减少" + +#define TITLE_READYPRINT_CN "准备打印" +#define TITLE_PREHEAT_CN "预热" +#define TITLE_MOVE_CN "移动" +#define TITLE_HOME_CN "回零" +#define TITLE_EXTRUDE_CN "挤出" +#define TITLE_LEVELING_CN "调平" +#define TITLE_SET_CN "设置" +#define TITLE_MORE_CN "更多" +#define TITLE_CHOOSEFILE_CN "选择文件" +#define TITLE_PRINTING_CN "正在打印" +#define TITLE_OPERATION_CN "操作" +#define TITLE_ADJUST_CN "调整" +#define TITLE_WIRELESS_CN "无线网络" +#define TITLE_FILAMENT_CN "换料" +#define TITLE_ABOUT_CN "关于" +#define TITLE_FAN_CN "风扇" +#define TITLE_LANGUAGE_CN "语言" +#define TITLE_PAUSE_CN "暂停" +#define TITLE_CHANGESPEED_CN "变速" +#define TITLE_CLOUD_TEXT_CN "云服务" +#define TITLE_DIALOG_CONFIRM_CN "确认" +#define TITLE_FILESYS_CN "文件系统" +#define TITLE_ZOFFSET_CN "Z Offset" + +#define AUTO_SHUTDOWN_CN "自动关机" +#define MANUAL_SHUTDOWN_CN "手动关机" + +#define DIALOG_CONFIRM_CN "确定" +#define DIALOG_CANCLE_CN "取消" +#define DIALOG_OK_CN "确认" +#define DIALOG_RESET_CN "重置" +#define DIALOG_DISABLE_CN "禁用" +#define DIALOG_PRINT_MODEL_CN "打印模型?" +#define DIALOG_CANCEL_PRINT_CN "停止打印?" +#define DIALOG_RETRY_CN "重试" +#define DIALOG_STOP_CN "停止" +#define DIALOG_REPRINT_FROM_BREAKPOINT_CN "从断点续打?" +//#define DIALOG_UNBIND_PRINTER_CN "解除绑定 ?" +#define DIALOG_ERROR_TIPS1_CN "错误:找不到文件,请插入sd卡/u盘!" +#define DIALOG_ERROR_TIPS2_CN "错误:通信失败,请检查波特率或主板硬件!" +#define DIALOG_ERROR_TIPS3_CN "错误:文件名或文件路径太长 !" +#define DIALOG_CLOSE_MACHINE_CN "正在关机......" +#define DIALOG_UNBIND_PRINTER_CN "解除绑定?" +#define DIALOG_FILAMENT_NO_PRESS_CN "请先装载耗材!" +#define DIALOG_PRINT_FINISH_CN "打印完成!" +#define DIALOG_PRINT_TIME_CN "打印时间: " +#define DIALOG_REPRINT_CN "再打印一次" +#define DIALOG_WIFI_ENABLE_TIPS_CN "wifi模块正在配置中,请稍等......" + +#define TEXT_VALUE_CN "%d℃/%d℃" +#define EXTRUDE_TEXT_VALUE_T_CN ": %d℃" +#define WIFI_RECONNECT_TEXT_CN "重新连接" + +#define PRINTING_GBK "正在打印" +#define PRINTING_OPERATION_GBK "操作" +#define PRINTING_PAUSE_GBK "暂停" + +#define MESSEGE_PAUSING_CN "暂停中..." +#define MESSEGE_CHANGING_CN "等待换料开始..." +#define MESSEGE_UNLOAD_CN "退料中,请稍等..." +#define MESSEGE_WAITING_CN "点击按钮恢复打印" +#define MESSEGE_INSERT_CN "装载耗材后,点击按钮开始打印" +#define MESSEGE_LOAD_CN "进料中,请稍等..." +#define MESSEGE_PURGE_CN "等待挤出..." +#define MESSEGE_RESUME_CN "等待恢复打印..." +#define MESSEGE_HEAT_CN "按下按钮,加热喷头" +#define MESSEGE_HEATING_CN "喷头加热中,请等待..." +#define MESSEGE_OPTION_CN "挤出更多还是继续打印?" +#define MESSEGE_PURGE_MORE_CN "挤出" +#define MESSEGE_CONTINUE_PRINT_CN "打印" + +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_sp.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_sp.h new file mode 100644 index 000000000000..8e5302cd52e8 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_sp.h @@ -0,0 +1,260 @@ +#ifndef _TFT_LANGUAGE_SP_H +#define _TFT_LANGUAGE_SP_H +//****************西班牙语*************************** +#define TOOL_TEXT_SP "Ajustes" +#define PREHEAT_TEXT_SP "Precalentar"//"precalent\nar" +#define MOVE_TEXT_SP "Mover" +#define HOME_TEXT_SP "Origen" +#define PRINT_TEXT_SP "Imprimir" +#define EXTRUDE_TEXT_SP "Extrusor" +#define LEVELING_TEXT_SP "Leveling"//"nivelac\nión" +#define AUTO_LEVELING_TEXT_SP "Autolevel"//"auto\nnivelación" +#define SET_TEXT_SP "Config" +#define MORE_TEXT_SP "Más" + +#define ADD_TEXT_SP "Más" +#define DEC_TEXT_SP "Menos" +#define EXTRUDER_1_TEXT_SP "Extrusor1: " +#define EXTRUDER_2_TEXT_SP "Extrusor2: " +#define HEATBED_TEXT_SP "Cama: " +#define TEXT_1C_SP "1℃" +#define TEXT_5C_SP "5℃" +#define TEXT_10C_SP "10℃" +#define CLOSE_TEXT_SP "Apagar" + +#define BACK_TEXT_SP "Atrás" + +#define TOOL_PREHEAT_SP "Precalentar" +#define TOOL_EXTRUDE_SP "Extrusor" +#define TOOL_MOVE_SP "Mover" +#define TOOL_HOME_SP "Origen" +#define TOOL_LEVELING_SP "Leveling" +#define TOOL_AUTO_LEVELING_SP "Autolevel" +#define TOOL_FILAMENT_SP "Filamento" +#define TOOL_MORE_SP "Más" + +#define AXIS_X_ADD_TEXT_SP "X+" +#define AXIS_X_DEC_TEXT_SP "X-" +#define AXIS_Y_ADD_TEXT_SP "Y+" +#define AXIS_Y_DEC_TEXT_SP "Y-" +#define AXIS_Z_ADD_TEXT_SP "Z+" +#define AXIS_Z_DEC_TEXT_SP "Z-" +#define TEXT_01MM_SP "0.1mm" +#define TEXT_1MM_SP "1mm" +#define TEXT_10MM_SP "10mm" + +#define HOME_X_TEXT_SP "EJE X" +#define HOME_Y_TEXT_SP "EJE Y" +#define HOME_Z_TEXT_SP "EJE Z" +#define HOME_ALL_TEXT_SP "TODOS" +#define HOME_STOPMOVE_SP "Quickstop" + +#define PAGE_UP_TEXT_SP "Arriba" +#define PAGE_DOWN_TEXT_SP "Abajo" + +#define EXTRUDER_IN_TEXT_SP "Dentro" +#define EXTRUDER_OUT_TEXT_SP "Fuera" +#define EXTRUDE_1MM_TEXT_SP "1mm" +#define EXTRUDE_5MM_TEXT_SP "5mm" +#define EXTRUDE_10MM_TEXT_SP "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_SP "Baja" +#define EXTRUDE_MEDIUM_SPEED_TEXT_SP "Media" +#define EXTRUDE_HIGH_SPEED_TEXT_SP "Alta" + +#define LEVELING_POINT1_TEXT_SP "Primero" +#define LEVELING_POINT2_TEXT_SP "Segundo" +#define LEVELING_POINT3_TEXT_SP "Tercero" +#define LEVELING_POINT4_TEXT_SP "Cuarto" +#define LEVELING_POINT5_TEXT_SP "Quinto" + +#define FILESYS_TEXT_SP "Puerto" +#define WIFI_TEXT_SP "WiFi" +#define FAN_TEXT_SP "Ventilador" +#define ABOUT_TEXT_SP "Acerca" +#define BREAK_POINT_TEXT_SP "Continuar" +#define FILAMENT_TEXT_SP "Filamento" +#define LANGUAGE_TEXT_SP "Language" +#define MOTOR_OFF_TEXT_SP "Apagar motor" +#define MOTOR_OFF_XY_TEXT_SP "Off-XY" +#define SHUTDOWN_TEXT_SP "Apagar" + +#define U_DISK_TEXT_SP "PENDRIVE" +#define SD_CARD_TEXT_SP "SD" +#define WIFI_NAME_TEXT_SP "WIFI: " +#define WIFI_KEY_TEXT_SP "Contraseña: " +#define WIFI_IP_TEXT_SP "IP: " +#define WIFI_AP_TEXT_SP "Estado: AP" +#define WIFI_STA_TEXT_SP "Estado: STA" +#define WIFI_CONNECTED_TEXT_SP "Conectado" +#define WIFI_DISCONNECTED_TEXT_SP "Desconectado" +#define WIFI_EXCEPTION_TEXT_SP "Excepción" +#define WIFI_RECONNECT_TEXT_SP "Reconnect" +#define CLOUD_TEXT_SP "Nube" +#define CLOUD_BIND_SP "Atado" +#define CLOUD_UNBIND_SP "Sin atar" +#define CLOUD_UNBINDING_SP "Unbinding" +#define CLOUD_DISCONNECTED_SP "Disconnected" +#define CLOUD_UNBINDED_SP "Unbinded" +#define CLOUD_BINDED_SP "Binded" +#define CLOUD_DISABLE_SP "Disable" + +#define FAN_ADD_TEXT_SP "Más" +#define FAN_DEC_TEXT_SP "Menos" +#define FAN_OPEN_TEXT_SP "100%" +#define FAN_HALF_TEXT_SP "50%" +#define FAN_CLOSE_TEXT_SP "0%" +#define FAN_TIPS1_TEXT_SP "ventilador" +#define FAN_TIPS2_TEXT_SP "ventilador\n0" + +#define FILAMENT_IN_TEXT_SP "Dentro" +#define FILAMENT_OUT_TEXT_SP "Fuera" +#define FILAMENT_EXT0_TEXT_SP "Extrusor1" +#define FILAMENT_EXT1_TEXT_SP "Extrusor2" +#define FILAMENT_HEAT_TEXT_SP "Precalentar" +#define FILAMENT_STOP_TEXT_SP "Parar" +//#define FILAMENT_CHANGE_TEXT_SP "Filamento" +#define FILAMENT_TIPS2_TEXT_SP "T:" +#define FILAMENT_TIPS3_TEXT_SP "Dentro..." +#define FILAMENT_TIPS4_TEXT_SP "Fuera..." +#define FILAMENT_TIPS5_TEXT_SP "Temperatura demasiado baja, por favor calentar" +#define FILAMENT_TIPS6_TEXT_SP "Completado" +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_SP "Please click or \nto replace filament!" + #define FILAMENT_CHANGE_TEXT_SP "Please click or ,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP "Calentando el extrusor, por favor espere..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP "Calentando el extrusor, por favor espere..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP "Temperatura alcanzada.Inserte el filamento y luego presione\"Confirmar\"para comenzar la carga." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_SP "Inserte el filamento y luego presione\"Confirmar\"para comenzar la carga." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP "Temperatura alcanzada.Presione\"Confirmar\"para retirar el filamento." + #define FILAMENT_DIALOG_LOADING_TIPS_SP "Cargando filamento,por favor espere." + #define FILAMENT_DIALOG_UNLOADING_TIPS_SP "Retirando filamento,por favor espere." + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP "Filamento cargado,presione\"Confirmar\"." + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP "Filamento retirado,presione\"Confirmar\"." +#endif + #define FILAMENT_CHANGE_TEXT_SP "Please click \nor ,After \npinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP "Temperatura alcanzada.Inserte el \nfilamento y luego presione\"Confirmar\"\npara comenzar la carga." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_SP "Inserte el filamento y \nluego presione\"Confirmar\"para \ncomenzar la carga." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP "Temperatura alcanzada.\nPresione\"Confirmar\"para retirar \nel filamento." + #define FILAMENT_DIALOG_LOADING_TIPS_SP "Cargando filamento,\npor favor espere." + #define FILAMENT_DIALOG_UNLOADING_TIPS_SP "Retirando filamento,\npor favor espere." + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP "Filamento cargado,\npresione\"Confirmar\"." + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP "Filamento retirado,\npresione\"Confirmar\"." + + +#define PRE_HEAT_EXT_TEXT_SP "Extrusor" +#define PRE_HEAT_BED_TEXT_SP "cama" + +#define FILE_LOADING_SP "Cargando......" +#if 0 +#define NO_FILE_AND_CHECK_SP "No se encontraron archivos! Por favor, inserte la tarjeta SD o el disco U!" +#endif +#define NO_FILE_AND_CHECK_SP "Archivo no encontrado,\n por favor insertar SD o disco USB!" + +#define NO_FILE_SP "Sin archivo!" + + + +#define EXTRUDER_TEMP_TEXT_SP "Temper" +#define EXTRUDER_E_LENGTH1_TEXT_SP "Extrusor1" +#define EXTRUDER_E_LENGTH2_TEXT_SP "Extrusor2" +#define EXTRUDER_E_LENGTH3_TEXT_SP "Extrusor3" + +#define ABOUT_TYPE_TEXT_SP "Pantalla: " +#define ABOUT_VERSION_TEXT_SP "Firmware: " +#define ABOUT_WIFI_TEXT_SP "WiFi: " + +#define PRINTING_OPERATION_SP "Ajustes" +#define PRINTING_PAUSE_SP "Pausar" +#define PRINTING_TEMP_SP "Temp." +#define PRINTING_CHANGESPEED_SP "Velocidad" +#define PRINTING_RESUME_SP "Resumir" +#define PRINTING_STOP_SP "Detener" +#define PRINTING_MORE_SP "Más" +#define PRINTING_EXTRUDER_SP "Extrusor" +#define PRINTING_MOVE_SP "Mover" + +#define EXTRUDER_SPEED_SP "Extrusor" +#define MOVE_SPEED_SP "Mover" +#define EXTRUDER_SPEED_STATE_SP "Extrusión" +#define MOVE_SPEED_STATE_SP "Movimiento" +#define STEP_1PERCENT_SP "1%" +#define STEP_5PERCENT_SP "5%" +#define STEP_10PERCENT_SP "10%" + +#define ZOFFSET_SP "Z Offset" +#define ZOFFSET_INC_SP "Más" +#define ZOFFSET_DEC_SP "Menos" + +#define TITLE_READYPRINT_SP "Inicio" +#define TITLE_PREHEAT_SP "Precalentar" +#define TITLE_MOVE_SP "Mover" +#define TITLE_HOME_SP "Origen" +#define TITLE_EXTRUDE_SP "Extrusor" +#define TITLE_LEVELING_SP "Leveling" +#define TITLE_SET_SP "Config" +#define TITLE_MORE_SP "Más" +#define TITLE_CHOOSEFILE_SP "Imprimir" +#define TITLE_PRINTING_SP "Imprimir" +#define TITLE_OPERATION_SP "Ajustes" +#define TITLE_ADJUST_SP "Temp." +#define TITLE_WIRELESS_SP "Wireless" +#define TITLE_FILAMENT_SP "Filamento" +#define TITLE_ABOUT_SP "Acerca" +#define TITLE_FAN_SP "Ventilador" +#define TITLE_LANGUAGE_SP "Language" +#define TITLE_PAUSE_SP "Pausar" +#define TITLE_CHANGESPEED_SP "Velocidad" +#define TILE_TOOL_SP "Ajustes" +#define TITLE_CLOUD_TEXT_SP "Cloud" +#define TITLE_DIALOG_CONFIRM_SP "Confirmar" +#define TITLE_FILESYS_SP "Puerto" +#define TITLE_ZOFFSET_SP "Z Offset" + +#define AUTO_SHUTDOWN_SP "Auto" +#define MANUAL_SHUTDOWN_SP "manual" + +#define DIALOG_CONFIRM_SP "Confirmar" +#define DIALOG_CANCLE_SP "Cancelar" +#define DIALOG_OK_SP "OK" +#define DIALOG_RESET_SP "Resetear" +#define DIALOG_RETRY_SP "Reintentar" +#define DIALOG_DISABLE_SP "Desactivar" +#define DIALOG_PRINT_MODEL_SP "¿Está seguro?" +#define DIALOG_CANCEL_PRINT_SP "¿Está seguro que desea detener la impresión?" + +#define DIALOG_RETRY_SP "Reintentar" +#define DIALOG_STOP_SP "Stop" +#define DIALOG_REPRINT_FROM_BREAKPOINT_SP "Reprint from breakpoint?" +//#define DIALOG_UNBIND_PRINTER_SP "Unbind the printer?" +#define DIALOG_ERROR_TIPS1_SP "Error:archivo no encontrado, \npor favor insertar SD o disco USB." +#define DIALOG_ERROR_TIPS2_SP "error:transacción fallida, \nconfigurar baudrate del \ndisplay para la placa base!" +#define DIALOG_ERROR_TIPS3_SP "Error : nombre de archivo o \nruta demasiado largo!" +#define DIALOG_CLOSE_MACHINE_SP "Closing machine......" +#define DIALOG_UNBIND_PRINTER_SP "Unbind the printer?" +#define DIALOG_FILAMENT_NO_PRESS_SP "Filament detection switch is not pressed" +#define DIALOG_PRINT_FINISH_SP "¡La impresión está completa!" +#define DIALOG_PRINT_TIME_SP "Tiempo de impresión: " +#define DIALOG_REPRINT_SP "Print again" +#define DIALOG_WIFI_ENABLE_TIPS_SP "The wifi module is being configured,\nplease wait a moment....." + +#define PRINTING_SP "Imprimiendo" +#define PRINTING_AJUSTES_SP "Ajustes" +#define PRINTING_PAUSAR_SP "Pausar" + +#define MESSEGE_PAUSING_SP "Aparcando..." +#define MESSEGE_CHANGING_SP "Esperando para iniciar el cambio de filamento" +#define MESSEGE_UNLOAD_SP "Espere para liberar el filamento" +#define MESSEGE_WAITING_SP "Pulsar el botón para reanudar impresión" +#define MESSEGE_INSERT_SP "Inserte el filamento y pulse el botón para continuar..." +#define MESSEGE_LOAD_SP "Espere para purgar el filamento" +#define MESSEGE_PURGE_SP "Espere para purgar el filamento" +#define MESSEGE_RESUME_SP "Esperando impresora para reanudar..." +#define MESSEGE_HEAT_SP "Pulse el botón para calentar la boquilla" +#define MESSEGE_HEATING_SP "Calentando boquilla Espere por favor..." +#define MESSEGE_OPTION_SP "¿Purgar más o continuar con la impresión?" +#define MESSEGE_PURGE_MORE_SP "Purga" +#define MESSEGE_CONTINUE_PRINT_SP "Impresión" + +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_t_cn.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_t_cn.h new file mode 100644 index 000000000000..0d93c5ee9752 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_t_cn.h @@ -0,0 +1,248 @@ +#ifndef _TFT_LANGUAGE_T_CN_H +#define _TFT_LANGUAGE_T_CN_H +//***************繁体中文**********************// +#define TOOL_TEXT_T_CN "工具" +#define PREHEAT_TEXT_T_CN "預熱" +#define MOVE_TEXT_T_CN "移動" +#define HOME_TEXT_T_CN "回零" +#define PRINT_TEXT_T_CN "打印" +#define EXTRUDE_TEXT_T_CN "擠出" +#define LEVELING_TEXT_T_CN "調平" +#define AUTO_LEVELING_TEXT_T_CN "自動調平" +#define SET_TEXT_T_CN "設置" +#define MORE_TEXT_T_CN "更多" + +#define ADD_TEXT_T_CN "增加" +#define DEC_TEXT_T_CN "減少" +#define EXTRUDER_1_TEXT_T_CN "噴頭1" +#define EXTRUDER_2_TEXT_T_CN "噴頭2" +#define HEATBED_TEXT_T_CN "熱床" +#define TEXT_1C_T_CN "1℃" +#define TEXT_5C_T_CN "5℃" +#define TEXT_10C_T_CN "10℃" +#define CLOSE_TEXT_T_CN "關閉" + +#define BACK_TEXT_T_CN "返回" + +#define TOOL_PREHEAT_T_CN "預熱" +#define TOOL_EXTRUDE_T_CN "擠出" +#define TOOL_MOVE_T_CN "移動" +#define TOOL_HOME_T_CN "回零" +#define TOOL_LEVELING_T_CN "調平" +#define TOOL_AUTO_LEVELING_T_CN "自動調平" +#define TOOL_FILAMENT_T_CN "換料" +#define TOOL_MORE_T_CN "更多" + +#define AXIS_X_ADD_TEXT_T_CN "X+" +#define AXIS_X_DEC_TEXT_T_CN "X-" +#define AXIS_Y_ADD_TEXT_T_CN "Y+" +#define AXIS_Y_DEC_TEXT_T_CN "Y-" +#define AXIS_Z_ADD_TEXT_T_CN "Z+" +#define AXIS_Z_DEC_TEXT_T_CN "Z-" +#define TEXT_01MM_T_CN "0.1mm" +#define TEXT_1MM_T_CN "1mm" +#define TEXT_10MM_T_CN "10mm" + +#define HOME_X_TEXT_T_CN "X" +#define HOME_Y_TEXT_T_CN "Y" +#define HOME_Z_TEXT_T_CN "Z" +#define HOME_ALL_TEXT_T_CN "回零" +#define HOME_STOPMOVE_T_CN "急停" + +#define PAGE_UP_TEXT_T_CN "上一頁" +#define PAGE_DOWN_TEXT_T_CN "下一頁" + +#define EXTRUDER_IN_TEXT_T_CN "進料" +#define EXTRUDER_OUT_TEXT_T_CN "退料" +#define EXTRUDE_1MM_TEXT_T_CN "1mm" +#define EXTRUDE_5MM_TEXT_T_CN "5mm" +#define EXTRUDE_10MM_TEXT_T_CN "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_T_CN "低速" +#define EXTRUDE_MEDIUM_SPEED_TEXT_T_CN "常速" +#define EXTRUDE_HIGH_SPEED_TEXT_T_CN "高速" + +#define LEVELING_POINT1_TEXT_T_CN "第一點" +#define LEVELING_POINT2_TEXT_T_CN "第二點" +#define LEVELING_POINT3_TEXT_T_CN "第三點" +#define LEVELING_POINT4_TEXT_T_CN "第四點" +#define LEVELING_POINT5_TEXT_T_CN "第五點" + +#define FILESYS_TEXT_T_CN "文件系統" +#define WIFI_TEXT_T_CN "WIFI" +#define FAN_TEXT_T_CN "風扇" +#define ABOUT_TEXT_T_CN "關於" +#define BREAK_POINT_TEXT_T_CN "斷點續打" +#define FILAMENT_TEXT_T_CN "換料" +#define LANGUAGE_TEXT_T_CN "語言" +#define MOTOR_OFF_TEXT_T_CN "關閉電機" +#define MOTOR_OFF_XY_TEXT_T_CN "關閉XY" +#define SHUTDOWN_TEXT_T_CN "關機" + +#define U_DISK_TEXT_T_CN "U盤" +#define SD_CARD_TEXT_T_CN "SD卡" +#define WIFI_NAME_TEXT_T_CN "無線網絡:" +#define WIFI_KEY_TEXT_T_CN "密碼: " +#define WIFI_IP_TEXT_T_CN "IP: " +#define WIFI_AP_TEXT_T_CN "狀態: AP" +#define WIFI_STA_TEXT_T_CN "狀態: STA" +#define WIFI_CONNECTED_TEXT_T_CN "已連接" +#define WIFI_DISCONNECTED_TEXT_T_CN "未連接" +#define WIFI_EXCEPTION_TEXT_T_CN "模塊異常" +#define CLOUD_TEXT_T_CN "雲服務" +#define CLOUD_BIND_T_CN "已綁定" +#define CLOUD_UNBIND_T_CN "解綁" +#define CLOUD_UNBINDING_T_CN "解绑中" +#define CLOUD_DISCONNECTED_T_CN "未連接" +#define CLOUD_UNBINDED_T_CN "未綁定" +#define CLOUD_BINDED_T_CN "已綁定" +#define CLOUD_DISABLE_T_CN "已禁用" + +#define FAN_ADD_TEXT_T_CN "增加" +#define FAN_DEC_TEXT_T_CN "減少" +#define FAN_OPEN_TEXT_T_CN "100%" +#define FAN_HALF_TEXT_T_CN "50%" +#define FAN_CLOSE_TEXT_T_CN "關閉" +#define FAN_TIPS1_TEXT_T_CN "風扇" +#define FAN_TIPS2_TEXT_T_CN "FAN\nClose" + +#define FILAMENT_IN_TEXT_T_CN "進料" +#define FILAMENT_OUT_TEXT_T_CN "退料" +#define FILAMENT_EXT0_TEXT_T_CN "噴頭1" +#define FILAMENT_EXT1_TEXT_T_CN "噴頭2" +#define FILAMENT_HEAT_TEXT_T_CN "預熱" +#define FILAMENT_STOP_TEXT_T_CN "停止" +//#define FILAMENT_CHANGE_TEXT_T_CN "準備換料" +#define FILAMENT_TIPS2_TEXT_T_CN "T:" +#define FILAMENT_TIPS3_TEXT_T_CN "正在進料" +#define FILAMENT_TIPS4_TEXT_T_CN "正在退料" +#define FILAMENT_TIPS5_TEXT_T_CN "溫度太低,請先預熱" +#define FILAMENT_TIPS6_TEXT_T_CN "換料完成" + +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_T_CN "請按<進料>或<退料>進行換料!" + #define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,請按<進料>或<退料>進行換料!" + +#endif + + + #define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,\n請按<進料>或<退料>" + + + +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_T_CN "準備進料,正在加熱,請稍等" +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_T_CN "準備退料,正在加熱,請稍等" +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_T_CN "加熱完成,請裝載耗材后,按<確定>開始進料" +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_T_CN "請裝載耗,按<確定>開始進料!" +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_T_CN "加熱完成,请按<確定>開始退料!" +#define FILAMENT_DIALOG_LOADING_TIPS_T_CN "正在進料,请等待耗材加載完成!" +#define FILAMENT_DIALOG_UNLOADING_TIPS_T_CN "正在退料,请等待耗材卸載完成!" +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_T_CN "進料完成,请按<確定>返回" +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_T_CN "退料完成,请按<確定>返回" + +#define PRE_HEAT_EXT_TEXT_T_CN "噴頭" +#define PRE_HEAT_BED_TEXT_T_CN "熱床" + +#define FILE_LOADING_T_CN "正在載入......" +#define NO_FILE_AND_CHECK_T_CN "無文件!請插入sd卡/u盤!" +#define NO_FILE_T_CN "無文件!" + +#define EXTRUDER_TEMP_TEXT_T_CN "溫度" +#define EXTRUDER_E_LENGTH1_TEXT_T_CN "噴頭" +#define EXTRUDER_E_LENGTH2_TEXT_T_CN "噴頭" +#define EXTRUDER_E_LENGTH3_TEXT_T_CN "噴頭" + +#define ABOUT_TYPE_TEXT_T_CN "Type: " +#define ABOUT_VERSION_TEXT_T_CN "Firmware: " +#define ABOUT_WIFI_TEXT_T_CN "Wifi: " + +#define PRINTING_OPERATION_T_CN "操作" +#define PRINTING_PAUSE_T_CN "暫停" +#define PRINTING_TEMP_T_CN "溫度" +#define PRINTING_CHANGESPEED_T_CN "變速" +#define PRINTING_RESUME_T_CN "恢復" +#define PRINTING_STOP_T_CN "停止" +#define PRINTING_MORE_T_CN "更多" +#define PRINTING_EXTRUDER_T_CN "擠出" +#define PRINTING_MOVE_T_CN "移動" + +#define EXTRUDER_SPEED_T_CN "擠出" +#define MOVE_SPEED_T_CN "移動" +#define EXTRUDER_SPEED_STATE_T_CN "擠出速度" +#define MOVE_SPEED_STATE_T_CN "移動速度" +#define STEP_1PERCENT_T_CN "1%%" +#define STEP_5PERCENT_T_CN "5%%" +#define STEP_10PERCENT_T_CN "10%%" + +#define ZOFFSET_T_CN "Z Offset" +#define ZOFFSET_INC_T_CN "增加" +#define ZOFFSET_DEC_T_CN "減少" + +#define TITLE_READYPRINT_T_CN "準備打印" +#define TITLE_PREHEAT_T_CN "預熱" +#define TITLE_MOVE_T_CN "移動" +#define TITLE_HOME_T_CN "回零" +#define TITLE_EXTRUDE_T_CN "擠出" +#define TITLE_LEVELING_T_CN "調平" +#define TITLE_SET_T_CN "設置" +#define TITLE_MORE_T_CN "更多" +#define TITLE_CHOOSEFILE_T_CN "選擇文件" +#define TITLE_PRINTING_T_CN "正在打印" +#define TITLE_OPERATION_T_CN "操作" +#define TITLE_ADJUST_T_CN "調整" +#define TITLE_WIRELESS_T_CN "無線網絡" +#define TITLE_FILAMENT_T_CN "換料" +#define TITLE_ABOUT_T_CN "關於" +#define TITLE_FAN_T_CN "風扇" +#define TITLE_LANGUAGE_T_CN "語言" +#define TITLE_PAUSE_T_CN "暫停" +#define TITLE_CHANGESPEED_T_CN "變速" +#define TITLE_CLOUD_TEXT_T_CN "雲服務" +#define TITLE_DIALOG_CONFIRM_T_CN "確認" +#define TITLE_FILESYS_T_CN "文件系統" +#define TITLE_ZOFFSET_T_CN "Z Offset" + +#define AUTO_SHUTDOWN_T_CN "自動關機" +#define MANUAL_SHUTDOWN_T_CN "手動關機" + +#define DIALOG_CONFIRM_T_CN "確定" +#define DIALOG_CANCLE_T_CN "取消" +#define DIALOG_OK_T_CN "確認" +#define DIALOG_RESET_T_CN "重設" +#define DIALOG_RETRY_T_CN "重試" +#define DIALOG_DISABLE_T_CN "禁用" +#define DIALOG_PRINT_MODEL_T_CN "打印模型?" +#define DIALOG_CANCEL_PRINT_T_CN "停止打印?" +#define DIALOG_RETRY_T_CN "重試" +#define DIALOG_STOP_T_CN "停止" +#define DIALOG_REPRINT_FROM_BREAKPOINT_T_CN "從斷點續打?" +//#define DIALOG_UNBIND_PRINTER_T_CN "解除綁定?" +#define DIALOG_ERROR_TIPS1_T_CN "錯誤:找不到文件,請插入sd卡/u盤!" +#define DIALOG_ERROR_TIPS2_T_CN "錯誤:通信失敗,請檢查波特率或主板硬件!" +#define DIALOG_ERROR_TIPS3_T_CN "錯誤:文件名或文件路徑太長!" +#define DIALOG_CLOSE_MACHINE_T_CN "正在關機......" +#define DIALOG_UNBIND_PRINTER_T_CN "解除綁定?" +#define DIALOG_FILAMENT_NO_PRESS_T_CN "請先裝載耗材!" +#define DIALOG_PRINT_FINISH_T_CN "打印完成!" +#define DIALOG_PRINT_TIME_T_CN "打印時間: " +#define DIALOG_REPRINT_T_CN "再打印壹次" +#define DIALOG_WIFI_ENABLE_TIPS_T_CN "wifi模塊正在配置中,請稍等......" + +#define TEXT_VALUE_T_CN "%d℃/%d℃" +#define EXTRUDE_TEXT_VALUE_T_T_CN ": %d℃" +#define WIFI_RECONNECT_TEXT_T_CN "重新連接" + +#define MESSEGE_PAUSING_T_CN "暫停中..." +#define MESSEGE_CHANGING_T_CN "等待換料開始..." +#define MESSEGE_UNLOAD_T_CN "退料中,請稍等..." +#define MESSEGE_WAITING_T_CN "點擊按鈕恢復打印" +#define MESSEGE_INSERT_T_CN "裝載耗材後,點擊按鈕開始打印" +#define MESSEGE_LOAD_T_CN "進料中,請稍等..." +#define MESSEGE_PURGE_T_CN "等待擠出..." +#define MESSEGE_RESUME_T_CN "等待恢復打印..." +#define MESSEGE_HEAT_T_CN "按下按鈕,加熱噴頭" +#define MESSEGE_HEATING_T_CN "噴頭加熱中,請等待..." +#define MESSEGE_OPTION_T_CN "擠出更多還是繼續打印" +#define MESSEGE_PURGE_MORE_T_CN "擠出" +#define MESSEGE_CONTINUE_PRINT_T_CN "打印" + +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_fsmc.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_fsmc.h new file mode 100644 index 000000000000..4788d5957aed --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_fsmc.h @@ -0,0 +1,14 @@ +#ifndef _TFT_FSMC_H_ +#define _TFT_FSMC_H_ + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + + +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_lvgl_configuration.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_lvgl_configuration.h new file mode 100644 index 000000000000..0da3adf42336 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_lvgl_configuration.h @@ -0,0 +1,29 @@ +/** + * @file tft_lvgl_configuration.h + * @date 2020-02-21 + * */ + +#ifndef TFT_LVGL_CONFIGURATION_H +#define TFT_LVGL_CONFIGURATION_H + +//#ifdef __cplusplus +//extern "C" { +//#endif + +#include "lvgl.h" + +void tft_lvgl_init(); +void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p); +bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data); + +void LCD_Clear(uint16_t Color); +void tft_set_point(uint16_t x,uint16_t y,uint16_t point); +void ili9320_SetWindows(uint16_t StartX,uint16_t StartY,uint16_t width,uint16_t heigh); +void LCD_WriteRAM_Prepare(void); + + +//#ifdef __cplusplus +//} /* extern "C" */ +//#endif + +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_multi_language.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_multi_language.h new file mode 100644 index 000000000000..57b639063441 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_multi_language.h @@ -0,0 +1,589 @@ +#ifndef _TFT_MULTI_LANGUAGE_H +#define _TFT_MULTI_LANGUAGE_H + +//#include "../../MarlinCore.h" +#include "../inc/tft_Language_en.h" +#include "../inc/tft_Language_s_cn.h" +#include "../inc/tft_Language_t_cn.h" +#include "../inc/tft_Language_ru.h" +#include "../inc/tft_Language_fr.h" +#include "../inc/tft_Language_sp.h" +#include "../inc/tft_Language_it.h" + +extern void disp_language_init(); + +#define LANG_SIMPLE_CHINESE 1 +#define LANG_COMPLEX_CHINESE 2 +#define LANG_ENGLISH 3 +#define LANG_JAPAN 4 +#define LANG_GERMAN 5 +#define LANG_FRENCH 6 +#define LANG_RUSSIAN 7 +#define LANG_KOREAN 8 +#define LANG_TURKISH 9 +#define LANG_SPANISH 10 +#define LANG_GREEK 11 +#define LANG_ITALY 12 +#define LANG_PORTUGUESE 13 + + +#define MULTI_LANGUAGE_ENABLE 1 +#define MULTI_LANGUAGE_DISABLE 0 + +typedef struct common_menu_disp +{ + const char *text_back; + const char *dialog_confirm_title; + const char *close_machine_tips; + const char *unbind_printer_tips; + const char *print_special_title; + const char *pause_special_title; + const char *operate_special_title; + const char *next; + const char *previous; +}common_menu_def; +extern common_menu_def common_menu; + +typedef struct main_menu_disp +{ + const char *title; + const char *preheat; + const char *move; + const char *home; + const char *print; + const char *extrude; + const char *leveling; + const char *autoleveling; + const char *fan; + const char *set; + const char *tool; + const char *more; + const char *machine_para; +}main_menu_def; +extern main_menu_def main_menu; +typedef struct preheat_menu_disp +{ + const char *adjust_title; + const char *title; + const char *add; + const char *dec; + const char *ext1; + const char *ext2; + const char *hotbed; + const char *off; + const char *step_1c; + const char *step_5c; + const char *step_10c; + const char *back; + + const char *value_state; + + const char *dialog_tips; + +}preheat_menu_def; +extern preheat_menu_def preheat_menu; +typedef struct move_menu_disp +{ + const char *title; + const char *x_add; + const char *x_dec; + const char *y_add; + const char *y_dec; + const char *z_add; + const char *z_dec; + const char *step_001mm; + const char *step_005mm; + const char *step_01mm; + const char *step_1mm; + const char *step_10mm; + const char *back; +}move_menu_def; +extern move_menu_def move_menu; +typedef struct home_menu_disp +{ + const char *title; + const char *home_all; + const char *home_x; + const char *home_y; + const char *home_z; + const char *stopmove; + const char *back; +}home_menu_def; +extern home_menu_def home_menu; +typedef struct file_menu_disp +{ + const char *title; + const char *page_up; + const char *page_down; + const char *back; + + const char *file_loading; + const char *no_file; + const char *no_file_and_check; + +}file_menu_def; +extern file_menu_def file_menu; +typedef struct extrude_menu_disp +{ + const char *title; + const char *in; + const char *out; + const char *ext1; + const char *ext2; + const char *step_1mm; + const char *step_5mm; + const char *step_10mm; + const char *low; + const char *normal; + const char *high; + const char *back; + + const char *count_value_mm; + const char *count_value_cm; + const char *count_value_m; + const char *temp_value; + const char *temper_text; +}extrude_menu_def; +extern extrude_menu_def extrude_menu; +typedef struct leveling_menu_disp +{ + const char *title; + const char *position1; + const char *position2; + const char *position3; + const char *position4; + const char *position5; + + char *back; +}leveling_menu_def; +extern leveling_menu_def leveling_menu; +typedef struct set_menu_disp +{ + const char *title; + const char *filesys; + const char *wifi; + const char *about; + const char *fan; + const char *filament; + const char *breakpoint; + const char *motoroff; + const char *motoroffXY; + const char *shutdown; + const char *language; + const char *machine_para; + const char *back; +}set_menu_def; +extern set_menu_def set_menu; +typedef struct filesys_menu_disp +{ +const char *title; +const char *filesys; +const char *sd_sys; +const char *usb_sys; +const char *back; + +}filesys_menu_def; +extern filesys_menu_def filesys_menu; +typedef struct more_menu_disp +{ + const char *title; + const char *zoffset; + const char *back; +}more_menu_def; +extern more_menu_def more_menu; +typedef struct wifi_menu_disp +{ + const char *title; + const char *ip; + const char *wifi; + const char *key; + const char *state_ap; + const char *state_sta; + const char *cloud; + const char *connected; + const char *disconnected; + const char *exception; + const char *back; + const char *reconnect; +}wifi_menu_def; +extern wifi_menu_def wifi_menu; +typedef struct cloud_menu_disp +{ + const char *title; + const char *unbind; + const char *unbinding; + const char *unbinded; + const char *bind; + const char *binding; + const char *binded; + const char *disable; + const char *disconnected; + const char *back; + const char *unbind_printer_tips; +}cloud_menu_def; +extern cloud_menu_def cloud_menu; + +typedef struct about_menu_disp +{ + const char *title; + const char *type_name; + const char *firmware_v; + const char *type; + const char *version; + const char *wifi; + const char *type_robin; + const char *type_robin_mini; + const char *back; +}about_menu_def; +extern about_menu_def about_menu; + +typedef struct fan_menu_disp +{ + const char *title; + const char *add; + const char *dec; + const char *full; + const char *half; + const char *off; + const char *back; + + const char *state; + const char *state_value; +}fan_menu_def; +extern fan_menu_def fan_menu; + +typedef struct filament_menu_disp +{ + const char *title; + const char *in; + const char *out; + const char *ext1; + const char *ext2; + const char *back; + const char *stat_temp; + const char *ready_replace; + const char *replacing; + const char *loading; + const char *unloading; + const char *heating; + const char *complete_and_back; + const char *filament_dialog_load_heat; + const char *filament_dialog_unload_heat; + const char *filament_dialog_load_heat_confirm; + const char *filament_dialog_unload_heat_confirm; + const char *filament_dialog_loading; + const char *filament_dialog_unloading; + const char *filament_dialog_load_completed; + const char *filament_dialog_unload_completed; + const char *filament_dialog_ok; + const char *filament_dialog_back; +}filament_menu_def; +extern filament_menu_def filament_menu; + +typedef struct language_menu +{ + const char *title; + const char *chinese_s; + const char *chinese_t; + const char *english; + const char *russian; + const char *japan; + const char *italy; + const char *german; + const char *spanish; + const char *korean; + const char *french; + const char *brazil; + const char *portuguese; + const char *next; + const char *up; + const char *back; +}language_menu_def; +extern language_menu_def language_menu; + + +typedef struct printing_menu_disp +{ + const char *title; + const char *option; + const char *temp1; + const char *temp2; + const char *bed_temp; + const char *fan_speed; + const char *pause; + const char *resume; + const char *stop; +}printing_menu_def; +extern printing_menu_def printing_menu; + +typedef struct operation_menu_disp +{ + const char *title; + const char *pause; + const char *stop; + const char *temp; + const char *fan; + const char *filament; + const char *extr; + const char *speed; + const char *move; + const char *more; + const char *auto_off; + const char *manual_off; + const char *back; + const char *babystep; +}operation_menu_def; +extern operation_menu_def operation_menu; +typedef struct pause_menu_disp +{ + const char *title; + const char *resume; + const char *stop; + const char *extrude; + const char *move; + const char *filament; + const char *more; +}pause_menu_def; +extern pause_menu_def pause_menu; + +typedef struct speed_menu_disp +{ + const char *title; + const char *add; + const char *dec; + const char *extrude; + const char *move; + const char *step_1percent; + const char *step_5percent; + const char *step_10percent; + const char *back; + const char *move_speed; + const char *extrude_speed; +}speed_menu_def; +extern speed_menu_def speed_menu; + +typedef struct printing_more_menu_disp +{ + const char *title; + const char *fan; + const char *auto_close; + const char *manual; + const char *temp; + const char *speed; + const char *back; +}printing_more_menu_def; +extern printing_more_menu_def printing_more_menu; + +typedef struct dialog_menu_disp +{ + const char *confirm_title; + + const char *error1_repint_no_file; + const char *error2_communication_fail; + const char *error3_filename_too_long; + const char *error4_no_file; + const char *error5_check_filesys; + + const char *tip1_print_file; + const char *tip2_stop_file; +}dialog_menu_def; +extern dialog_menu_def dialog_menu; + +typedef struct print_file_dialog_disp +{ + const char *title; + const char *confirm; + const char *cancle; + const char *print_file; + const char *cancle_print; + const char *retry; + const char *stop; + const char *no_file_print_tips; + const char *print_from_breakpoint; + const char *file_name_too_long_error; + const char *close_machine_error; + const char *filament_no_press; + const char *print_finish; + const char *print_time; + const char *reprint; + const char *wifi_enable_tips; +}print_file_dialog_menu_def; +extern print_file_dialog_menu_def print_file_dialog_menu; + +typedef struct zoffset_menu_disp +{ + const char *title; + const char *inc; + const char *dec; + const char *step001; + const char *step01; + const char *step1; + const char *back; +}zoffset_menu_def; +extern zoffset_menu_def zoffset_menu; + +typedef struct tool_menu_disp +{ + const char *title; + const char *preheat; + const char *extrude; + const char *move; + const char *home; + const char *leveling; + const char *autoleveling; + const char *filament; + const char *more; + const char *back; +}tool_menu_def; +extern tool_menu_def tool_menu; + +typedef struct MachinePara_menu_disp +{ + const char *title; + const char *MachineSetting; + const char *TemperatureSetting; + const char *MotorSetting; + const char *AdvanceSetting; + //const char *back; +}MachinePara_menu_def; +extern MachinePara_menu_def MachinePara_menu; + +typedef struct MachineSettings_menu_disp +{ + const char *title; + const char *Machine; + const char *Stroke; + const char *HomeDir; + const char *EndStopType; + const char *filamet; + const char *leveling; + const char *back; +}MachineSettings_menu_def; +extern MachineSettings_menu_def MachineSettings_menu; + +typedef struct TemperatureSettings_menu_disp +{ + const char *title; + const char *nozzle; + const char *hotbed; + const char *preheat; + const char *back; +}TemperatureSettings_menu_def; +extern TemperatureSettings_menu_def TemperatureSettings_menu; + +typedef struct pause_msg_disp +{ + const char *pausing; + const char *changing; + const char *unload; + const char *waiting; + const char *insert; + const char *load; + const char *purge; + const char *resume; + const char *heat; + const char *heating; + const char *option; + const char *purgeMore; + const char *continuePrint; +}pause_msg_def; +extern pause_msg_def pause_msg_menu; + +/*****************************************/ +//********************************************// +//#if defined(TFT70) + +//#elif defined(TFT35) +#define TEXT_VALUE "%d/%d" +//#endif + +#define TEXT_VALUE_T ": %d℃" +#define TEXT_VALUE_mm ": %dmm" +#define TEXT_VALUE_cm ": %dcm" +#define TEXT_VALUE_m ": %dm" + +#define TEMP_UNIT_SYBOL "%d℃" +#define FLOAT_TEMP_UNIT_SYBOL "%.1f℃" + +#define TEXT_1C "1℃" +#define TEXT_5C "5℃" +#define TEXT_10C "10℃" + +#define AXIS_X_ADD_TEXT "X+" +#define AXIS_X_DEC_TEXT "X-" +#define AXIS_Y_ADD_TEXT "Y+" +#define AXIS_Y_DEC_TEXT "Y-" +#define AXIS_Z_ADD_TEXT "Z+" +#define AXIS_Z_DEC_TEXT "Z-" +#define TEXT_001MM "0.01mm" +#define TEXT_005MM "0.05mm" +#define TEXT_01MM "0.1mm" +#define TEXT_1MM "1mm" +#define TEXT_10MM "10mm" + +#define EXTRUDE_1MM_TEXT "1mm" +#define EXTRUDE_5MM_TEXT "5mm" +#define EXTRUDE_10MM_TEXT "10mm" + +#define STEP_1PERCENT "1%" +#define STEP_5PERCENT "5%" +#define STEP_10PERCENT "10%" + +#define LANGUAGE_S_CN "简体" +#define LANGUAGE_T_CN "繁体" +#define LANGUAGE_EN "English" +#define LANGUAGE_JP "日本語" +#define LANGUAGE_GE "Deutsch" +#define LANGUAGE_FR "français" +#define LANGUAGE_IT "Italia" +#define LANGUAGE_PR "português" +#define LANGUAGE_KR "Korean" +#define LANGUAGE_BR "Brazil" +#define LANGUAGE_RU "русский" +#define LANGUAGE_SP "español" + +#define HOME_X_TEXT "X" +#define HOME_Y_TEXT "Y" +#define HOME_Z_TEXT "Z" +#define HOME_ALL_TEXT "All" +//#if defined(MKS_ROBIN_NANO) +#define ABOUT_TYPE_TEXT "MKS Robin Pro" +//#elif defined(MKS_ROBIN_MINI) +//#define ABOUT_TYPE_TEXT "MKS Robin Mini" +//#endif +#define ABOUT_VERSION_TEXT "1.0.0" +//#define ABOUT_WIFI_TEXT "WiFi:" + +#define FAN_OPEN_TEXT "100%" +#define FAN_HALF_TEXT "50%" +#define FAN_CLOSE_TEXT "0%" +//#define FAN_TIPS1_TEXT "FAN" +//#define FAN_TIPS2_TEXT "FAN\nClose" + +#define WIFI_TEXT "WIFI" +#define WIFI_IP_TEXT "IP: " +#define WIFI_NAME_TEXT "WiFi: " +#define WIFI_KEY_TEXT "Key: " +#define WIFI_STATE_AP_TEXT "State: AP" +#define WIFI_STATE_STA_TEXT "State: STA" +#define WIFI_CONNECTED_TEXT "Connected" +#define WIFI_DISCONNECTED_TEXT "Disconnected" +#define WIFI_EXCEPTION_TEXT "Exception" + +#define FILAMENT_TIPS2_TEXT "T:" + +#define DIALOG_UPLOAD_ING_EN "Uploading......" +#define DIALOG_UPLOAD_ERROR_EN "Upload error" +#define DIALOG_UPLOAD_FINISH_EN "Upload finished" +#define DIALOG_UPLOAD_SIZE_EN "Size" +#define DIALOG_UPLOAD_TIME_EN "Time" +#define DIALOG_UPLOAD_SPEED_EN "Speed" +#define DIALOG_UPDATE_WIFI_FIRMWARE_EN "Updating wifi model firmware" +#define DIALOG_UPDATE_WIFI_WEB_EN "Updating wifi model web data" + +#define ZOFFSET_STEP001 "0.01mm" +#define ZOFFSET_STEP01 "0.1mm" +#define ZOFFSET_STEP1 "1mm" + +/*****************************************/ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/SPI_TFT.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/SPI_TFT.cpp new file mode 100644 index 000000000000..b84cec251372 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/SPI_TFT.cpp @@ -0,0 +1,284 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../../inc/MarlinConfigPre.h" + +#if ENABLED(SPI_GRAPHICAL_TFT) + +#include +#include "../../../../../inc/MarlinConfig.h" +#include "../inc/SPI_TFT.h" + +TFT SPI_TFT; + +#ifndef SPI_TFT_MISO_PIN + #define SPI_TFT_MISO_PIN PA6 +#endif +#ifndef SPI_TFT_MOSI_PIN + #define SPI_TFT_MOSI_PIN PA7 +#endif +#ifndef SPI_TFT_SCK_PIN + #define SPI_TFT_SCK_PIN PA5 +#endif +#ifndef SPI_TFT_CS_PIN + #define SPI_TFT_CS_PIN PD11 +#endif +#ifndef SPI_TFT_DC_PIN + #define SPI_TFT_DC_PIN PD10 +#endif +#ifndef SPI_TFT_RST_PIN + #define SPI_TFT_RST_PIN PC6 +#endif + +//use SPI1 for the spi tft. +void TFT::spi_init(uint8_t spiRate){ + + SPI_TFT_CS_H; + + /** + * STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz + * STM32F1 has 3 SPI ports, SPI1 in APB2, SPI2/SPI3 in APB1 + * so the minimum prescale of SPI1 is DIV4, SPI2/SPI3 is DIV2 + */ + uint8_t clock; + switch (spiRate) { + case SPI_FULL_SPEED: clock = SPI_CLOCK_DIV4 ; break; + case SPI_HALF_SPEED: clock = SPI_CLOCK_DIV4 ; break; + case SPI_QUARTER_SPEED: clock = SPI_CLOCK_DIV8 ; break; + case SPI_EIGHTH_SPEED: clock = SPI_CLOCK_DIV16; break; + case SPI_SPEED_5: clock = SPI_CLOCK_DIV32; break; + case SPI_SPEED_6: clock = SPI_CLOCK_DIV64; break; + default: clock = SPI_CLOCK_DIV2; // Default from the SPI library + } + SPI.setModule(1); + SPI.begin(); + SPI.setClockDivider(clock); + SPI.setBitOrder(MSBFIRST); + SPI.setDataMode(SPI_MODE0); +} + +uint8_t TFT::spi_Rec() { + uint8_t returnByte = SPI.transfer(ff); + return returnByte; +} + +uint8_t TFT::spi_read_write_byte(uint8_t data) { + uint8_t returnByte = SPI.transfer(data); + return returnByte; +} + +/** + * @brief Receive a number of bytes from the SPI port to a buffer + * + * @param buf Pointer to starting address of buffer to write to. + * @param nbyte Number of bytes to receive. + * @return Nothing + * + * @details Uses DMA + */ +void TFT::spi_Read(uint8_t* buf, uint16_t nbyte) { + SPI.dmaTransfer(0, const_cast(buf), nbyte); +} + +/** + * @brief Send a single byte on SPI port + * + * @param b Byte to send + * + * @details + */ +void TFT::spi_Send(uint8_t b) { + SPI.send(b); +} + +/** + * @brief Write token and then write from 512 byte buffer to SPI (for SD card) + * + * @param buf Pointer with buffer start address + * @return Nothing + * + * @details Use DMA + */ +void TFT::spi_SendBlock(uint8_t token, const uint8_t* buf) { + SPI.send(token); + SPI.dmaSend(const_cast(buf), 512); +} + +void TFT::LCD_WR_REG(uint8_t cmd) +{ + SPI_TFT_CS_L; + SPI_TFT_DC_L; + spi_Send(cmd); + SPI_TFT_CS_H; +} +void TFT::LCD_WR_DATA(uint8_t data) +{ + SPI_TFT_CS_L; + SPI_TFT_DC_H; + spi_Send(data); + SPI_TFT_CS_H; +} +void TFT::LCD_WriteRAM_Prepare() +{ + LCD_WR_REG(0X2C); +} +void TFT::SetCursor(uint16_t x,uint16_t y) +{ + LCD_WR_REG(0x2a); + LCD_WR_DATA(x>>8); + LCD_WR_DATA(x); + LCD_WR_DATA(x>>8); + LCD_WR_DATA(x); + + LCD_WR_REG(0x2b); + LCD_WR_DATA(y>>8); + LCD_WR_DATA(y); + LCD_WR_DATA(y>>8); + LCD_WR_DATA(y); +} +void TFT::SetWindows(uint16_t x,uint16_t y,uint16_t with,uint16_t height) +{ + LCD_WR_REG(0x2a); + LCD_WR_DATA(x>>8); + LCD_WR_DATA(x); + LCD_WR_DATA((x+with)>>8); + LCD_WR_DATA((x+with)); + + LCD_WR_REG(0x2b); + LCD_WR_DATA(y>>8); + LCD_WR_DATA(y); + LCD_WR_DATA((y+height)>>8); + LCD_WR_DATA(y+height); +} +void TFT::LCD_init() +{ + SPI_TFT_RST_H; + delay(150); + SPI_TFT_RST_L; + delay(150); + SPI_TFT_RST_H; + + delay(120); + LCD_WR_REG(0x11); + delay(120); + + LCD_WR_REG(0xf0); + LCD_WR_DATA(0xc3); + LCD_WR_REG(0xf0); + LCD_WR_DATA(0x96); + + LCD_WR_REG(0x36); + LCD_WR_DATA(0x28); + + LCD_WR_REG(0x3A); + LCD_WR_DATA(0x55); + + LCD_WR_REG(0xB4); + LCD_WR_DATA(0x01); + LCD_WR_REG(0xB7) ; + LCD_WR_DATA(0xC6) ; + LCD_WR_REG(0xe8); + LCD_WR_DATA(0x40); + LCD_WR_DATA(0x8a); + LCD_WR_DATA(0x00); + LCD_WR_DATA(0x00); + LCD_WR_DATA(0x29); + LCD_WR_DATA(0x19); + LCD_WR_DATA(0xa5); + LCD_WR_DATA(0x33); + LCD_WR_REG(0xc1); + LCD_WR_DATA(0x06); + LCD_WR_REG(0xc2); + LCD_WR_DATA(0xa7); + LCD_WR_REG(0xc5); + LCD_WR_DATA(0x18); + LCD_WR_REG(0xe0); //Positive Voltage Gamma Control + LCD_WR_DATA(0xf0); + LCD_WR_DATA(0x09); + LCD_WR_DATA(0x0b); + LCD_WR_DATA(0x06); + LCD_WR_DATA(0x04); + LCD_WR_DATA(0x15); + LCD_WR_DATA(0x2f); + LCD_WR_DATA(0x54); + LCD_WR_DATA(0x42); + LCD_WR_DATA(0x3c); + LCD_WR_DATA(0x17); + LCD_WR_DATA(0x14); + LCD_WR_DATA(0x18); + LCD_WR_DATA(0x1b); + LCD_WR_REG(0xe1); //Negative Voltage Gamma Control + LCD_WR_DATA(0xf0); + LCD_WR_DATA(0x09); + LCD_WR_DATA(0x0b); + LCD_WR_DATA(0x06); + LCD_WR_DATA(0x04); + LCD_WR_DATA(0x03); + LCD_WR_DATA(0x2d); + LCD_WR_DATA(0x43); + LCD_WR_DATA(0x42); + LCD_WR_DATA(0x3b); + LCD_WR_DATA(0x16); + LCD_WR_DATA(0x14); + LCD_WR_DATA(0x17); + LCD_WR_DATA(0x1b); + LCD_WR_REG(0xf0); + LCD_WR_DATA(0x3c); + LCD_WR_REG(0xf0); + LCD_WR_DATA(0x69); + delay(120); //Delay 120ms + LCD_WR_REG(0x29); //Display ON + + LCD_clear(0x0000);// + SPI_TFT_BLK_H; + +} +void TFT::LCD_clear(uint16_t color) +{ + unsigned int i,m; + uint32_t count; + uint8_t tbuf[960]; + + SetCursor(0,0); + SetWindows(0,0,480-1,320-1); + LCD_WriteRAM_Prepare(); + SPI_TFT_CS_L; + SPI_TFT_DC_H; + for(i=0;i<960;) + { + tbuf[i]=color>>8; + tbuf[i+1]=color; + i += 2; + } + for(i=0;i<320;i++) + { + //for(m=0;m<480;m++) + //{ + //LCD_WR_DATA(color>>8); + //LCD_WR_DATA(color); + + SPI.dmaSend(tbuf,960,true); + //SPI_TFT_CS_H; + //} + } + SPI_TFT_CS_H; +} + +#endif + + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/W25Qxx.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/W25Qxx.cpp new file mode 100644 index 000000000000..abff401e8eb5 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/W25Qxx.cpp @@ -0,0 +1,431 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../../inc/MarlinConfigPre.h" +#if 1//ENABLED(SPI_FLASH) +#include +#include "../../../../../inc/MarlinConfig.h" + +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "../inc/W25Qxx.h" + +#ifndef SPI_FLASH_MISO_PIN + #define SPI_FLASH_MISO_PIN W25QXX_MISO_PIN +#endif +#ifndef SPI_FLASH_MOSI_PIN + #define SPI_FLASH_MOSI_PIN W25QXX_MOSI_PIN +#endif +#ifndef SPI_FLASH_SCK_PIN + #define SPI_FLASH_SCK_PIN W25QXX_SCK_PIN +#endif +#ifndef SPI_FLASH_CS_PIN + #define SPI_FLASH_CS_PIN W25QXX_CS_PIN +#endif + +#define W25QXX_CS_H OUT_WRITE(SPI_FLASH_CS_PIN, HIGH) +#define W25QXX_CS_L OUT_WRITE(SPI_FLASH_CS_PIN, LOW) + +ext_FLASH W25QXX; + +void ext_FLASH::init(uint8_t spiRate){ + + OUT_WRITE(SPI_FLASH_CS_PIN, HIGH); + + /** + * STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz + * STM32F1 has 3 SPI ports, SPI1 in APB2, SPI2/SPI3 in APB1 + * so the minimum prescale of SPI1 is DIV4, SPI2/SPI3 is DIV2 + */ + #if SPI_DEVICE == 1 + #define SPI_CLOCK_MAX SPI_CLOCK_DIV4 + #else + #define SPI_CLOCK_MAX SPI_CLOCK_DIV2 + #endif + uint8_t clock; + switch (spiRate) { + case SPI_FULL_SPEED: clock = SPI_CLOCK_MAX ; break; + case SPI_HALF_SPEED: clock = SPI_CLOCK_DIV4 ; break; + case SPI_QUARTER_SPEED: clock = SPI_CLOCK_DIV8 ; break; + case SPI_EIGHTH_SPEED: clock = SPI_CLOCK_DIV16; break; + case SPI_SPEED_5: clock = SPI_CLOCK_DIV32; break; + case SPI_SPEED_6: clock = SPI_CLOCK_DIV64; break; + default: clock = SPI_CLOCK_DIV2; // Default from the SPI library + } + SPI.setModule(SPI_DEVICE); + SPI.begin(); + SPI.setClockDivider(clock); + SPI.setBitOrder(MSBFIRST); + SPI.setDataMode(SPI_MODE0); +} + +/** + * @brief Receive a single byte from the SPI port. + * + * @return Byte received + * + * @details + */ +uint8_t ext_FLASH::spi_flash_Rec() { + uint8_t returnByte = SPI.transfer(ff); + return returnByte; +} + +uint8_t ext_FLASH::spi_flash_read_write_byte(uint8_t data) { + uint8_t returnByte = SPI.transfer(data); + return returnByte; +} + +/** + * @brief Receive a number of bytes from the SPI port to a buffer + * + * @param buf Pointer to starting address of buffer to write to. + * @param nbyte Number of bytes to receive. + * @return Nothing + * + * @details Uses DMA + */ +void ext_FLASH::spi_flash_Read(uint8_t* buf, uint16_t nbyte) { + SPI.dmaTransfer(0, const_cast(buf), nbyte); +} + +/** + * @brief Send a single byte on SPI port + * + * @param b Byte to send + * + * @details + */ +void ext_FLASH::spi_flash_Send(uint8_t b) { + SPI.send(b); +} +/** + * @brief Write token and then write from 512 byte buffer to SPI (for SD card) + * + * @param buf Pointer with buffer start address + * @return Nothing + * + * @details Use DMA + */ +void ext_FLASH::spi_flash_SendBlock(uint8_t token, const uint8_t* buf) { + SPI.send(token); + SPI.dmaSend(const_cast(buf), 512); +} + +uint16_t ext_FLASH::W25QXX_ReadID(void) +{ + uint16_t Temp = 0; + W25QXX_CS_L; + spi_flash_Send(0x90);//���Ͷ�ȡID���� + spi_flash_Send(0x00); + spi_flash_Send(0x00); + spi_flash_Send(0x00); + Temp|=spi_flash_Rec()<<8; + Temp|=spi_flash_Rec(); + W25QXX_CS_H; + return Temp; +} +void ext_FLASH::SPI_FLASH_WriteEnable(void) +{ + /* Select the FLASH: Chip Select low */ + W25QXX_CS_L; + /* Send "Write Enable" instruction */ + spi_flash_Send(W25X_WriteEnable); + /* Deselect the FLASH: Chip Select high */ + W25QXX_CS_H; +} +/******************************************************************************* +* Function Name : SPI_FLASH_WaitForWriteEnd +* Description : Polls the status of the Write In Progress (WIP) flag in the +* FLASH's status register and loop until write opertaion +* has completed. +* Input : None +* Output : None +* Return : None +*******************************************************************************/ +void ext_FLASH::SPI_FLASH_WaitForWriteEnd(void) +{ + uint8_t FLASH_Status = 0; + + /* Select the FLASH: Chip Select low */ + W25QXX_CS_L; + /* Send "Read Status Register" instruction */ + spi_flash_Send(W25X_ReadStatusReg); + + /* Loop as long as the memory is busy with a write cycle */ + do + { + /* Send a dummy byte to generate the clock needed by the FLASH + and put the value of the status register in FLASH_Status variable */ + FLASH_Status = spi_flash_Rec(); + + } + while ((FLASH_Status & WIP_Flag) == 0x01); /* Write in progress */ + + /* Deselect the FLASH: Chip Select high */ + W25QXX_CS_H; +} + +void ext_FLASH::SPI_FLASH_SectorErase(uint32_t SectorAddr) +{ + /* Send write enable instruction */ + SPI_FLASH_WriteEnable(); + + /* Sector Erase */ + /* Select the FLASH: Chip Select low */ + W25QXX_CS_L; + /* Send Sector Erase instruction */ + spi_flash_Send(W25X_SectorErase); + /* Send SectorAddr high nibble address byte */ + spi_flash_Send((SectorAddr & 0xFF0000) >> 16); + /* Send SectorAddr medium nibble address byte */ + spi_flash_Send((SectorAddr & 0xFF00) >> 8); + /* Send SectorAddr low nibble address byte */ + spi_flash_Send(SectorAddr & 0xFF); + /* Deselect the FLASH: Chip Select high */ + + W25QXX_CS_H; + /* Wait the end of Flash writing */ + SPI_FLASH_WaitForWriteEnd(); +} + +void ext_FLASH::SPI_FLASH_BlockErase(uint32_t BlockAddr) +{ + SPI_FLASH_WriteEnable(); + W25QXX_CS_L; + /* Send Sector Erase instruction */ + spi_flash_Send(W25X_BlockErase); + /* Send SectorAddr high nibble address byte */ + spi_flash_Send((BlockAddr & 0xFF0000) >> 16); + /* Send SectorAddr medium nibble address byte */ + spi_flash_Send((BlockAddr & 0xFF00) >> 8); + /* Send SectorAddr low nibble address byte */ + spi_flash_Send(BlockAddr & 0xFF); + + W25QXX_CS_H; + + SPI_FLASH_WaitForWriteEnd(); +} + +/******************************************************************************* +* Function Name : SPI_FLASH_BulkErase +* Description : Erases the entire FLASH. +* Input : None +* Output : None +* Return : None +*******************************************************************************/ +void ext_FLASH::SPI_FLASH_BulkErase(void) +{ + /* Send write enable instruction */ + SPI_FLASH_WriteEnable(); + + /* Bulk Erase */ + /* Select the FLASH: Chip Select low */ + W25QXX_CS_L; + + /* Send Bulk Erase instruction */ + spi_flash_Send(W25X_ChipErase); + /* Deselect the FLASH: Chip Select high */ + W25QXX_CS_H; + /* Wait the end of Flash writing */ + SPI_FLASH_WaitForWriteEnd(); +} + +/******************************************************************************* +* Function Name : SPI_FLASH_PageWrite +* Description : Writes more than one byte to the FLASH with a single WRITE +* cycle(Page WRITE sequence). The number of byte can't exceed +* the FLASH page size. +* Input : - pBuffer : pointer to the buffer containing the data to be +* written to the FLASH. +* - WriteAddr : FLASH's internal address to write to. +* - NumByteToWrite : number of bytes to write to the FLASH, +* must be equal or less than "SPI_FLASH_PageSize" value. +* Output : None +* Return : None +*******************************************************************************/ +void ext_FLASH::SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite) +{ + /* Enable the write access to the FLASH */ + SPI_FLASH_WriteEnable(); + + /* Select the FLASH: Chip Select low */ + W25QXX_CS_L; + /* Send "Write to Memory " instruction */ + spi_flash_Send(W25X_PageProgram); + /* Send WriteAddr high nibble address byte to write to */ + spi_flash_Send((WriteAddr & 0xFF0000) >> 16); + /* Send WriteAddr medium nibble address byte to write to */ + spi_flash_Send((WriteAddr & 0xFF00) >> 8); + /* Send WriteAddr low nibble address byte to write to */ + spi_flash_Send(WriteAddr & 0xFF); + + if(NumByteToWrite > SPI_FLASH_PerWritePageSize) + { + NumByteToWrite = SPI_FLASH_PerWritePageSize; + } + + /* while there is data to be written on the FLASH */ + while (NumByteToWrite--) + { + /* Send the current byte */ + spi_flash_Send(*pBuffer); + /* Point on the next byte to be written */ + pBuffer++; + } + + /* Deselect the FLASH: Chip Select high */ + W25QXX_CS_H; + + /* Wait the end of Flash writing */ + SPI_FLASH_WaitForWriteEnd(); +} + +/******************************************************************************* +* Function Name : SPI_FLASH_BufferWrite +* Description : Writes block of data to the FLASH. In this function, the +* number of WRITE cycles are reduced, using Page WRITE sequence. +* Input : - pBuffer : pointer to the buffer containing the data to be +* written to the FLASH. +* - WriteAddr : FLASH's internal address to write to. +* - NumByteToWrite : number of bytes to write to the FLASH. +* Output : None +* Return : None +*******************************************************************************/ +void ext_FLASH::SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite) +{ + uint8_t NumOfPage = 0, NumOfSingle = 0, Addr = 0, count = 0, temp = 0; + + Addr = WriteAddr % SPI_FLASH_PageSize; + count = SPI_FLASH_PageSize - Addr; + NumOfPage = NumByteToWrite / SPI_FLASH_PageSize; + NumOfSingle = NumByteToWrite % SPI_FLASH_PageSize; + + if (Addr == 0) /* WriteAddr is SPI_FLASH_PageSize aligned */ + { + if (NumOfPage == 0) /* NumByteToWrite < SPI_FLASH_PageSize */ + { + SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite); + } + else /* NumByteToWrite > SPI_FLASH_PageSize */ + { + while (NumOfPage--) + { + SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize); + WriteAddr += SPI_FLASH_PageSize; + pBuffer += SPI_FLASH_PageSize; + } + + SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumOfSingle); + } + } + else /* WriteAddr is not SPI_FLASH_PageSize aligned */ + { + if (NumOfPage == 0) /* NumByteToWrite < SPI_FLASH_PageSize */ + { + if (NumOfSingle > count) /* (NumByteToWrite + WriteAddr) > SPI_FLASH_PageSize */ + { + temp = NumOfSingle - count; + + SPI_FLASH_PageWrite(pBuffer, WriteAddr, count); + WriteAddr += count; + pBuffer += count; + + SPI_FLASH_PageWrite(pBuffer, WriteAddr, temp); + } + else + { + SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite); + } + } + else /* NumByteToWrite > SPI_FLASH_PageSize */ + { + NumByteToWrite -= count; + NumOfPage = NumByteToWrite / SPI_FLASH_PageSize; + NumOfSingle = NumByteToWrite % SPI_FLASH_PageSize; + + SPI_FLASH_PageWrite(pBuffer, WriteAddr, count); + WriteAddr += count; + pBuffer += count; + + while (NumOfPage--) + { + SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize); + WriteAddr += SPI_FLASH_PageSize; + pBuffer += SPI_FLASH_PageSize; + } + + if (NumOfSingle != 0) + { + SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumOfSingle); + } + } + } +} + +/******************************************************************************* +* Function Name : SPI_FLASH_BufferRead +* Description : Reads a block of data from the FLASH. +* Input : - pBuffer : pointer to the buffer that receives the data read +* from the FLASH. +* - ReadAddr : FLASH's internal address to read from. +* - NumByteToRead : number of bytes to read from the FLASH. +* Output : None +* Return : None +*******************************************************************************/ +void ext_FLASH::SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) +{ + /* Select the FLASH: Chip Select low */ + W25QXX_CS_L; + + /* Send "Read from Memory " instruction */ + spi_flash_Send(W25X_ReadData); + + /* Send ReadAddr high nibble address byte to read from */ + spi_flash_Send((ReadAddr & 0xFF0000) >> 16); + /* Send ReadAddr medium nibble address byte to read from */ + spi_flash_Send((ReadAddr& 0xFF00) >> 8); + /* Send ReadAddr low nibble address byte to read from */ + spi_flash_Send(ReadAddr & 0xFF); + + if(NumByteToRead<33) + { + while (NumByteToRead--) /* while there is data to be read */ + { + /* Read a byte from the FLASH */ + *pBuffer = spi_flash_Rec(); + /* Point to the next location where the byte read will be saved */ + pBuffer++; + } + } + else + { + spi_flash_Read(pBuffer, NumByteToRead); + } + W25QXX_CS_H; +} + + +void ext_FLASH::lv_pic_read(uint8_t *P_Rbuff,uint32_t addr,uint32_t size) +{ + SPI_FLASH_BufferRead((uint8_t *)P_Rbuff,addr,size); +} + + +#endif + +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_about.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_about.cpp new file mode 100644 index 000000000000..c914dfca90a1 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_about.cpp @@ -0,0 +1,116 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" +#include "../../../../../../Configuration.h" +#include "../inc/draw_ui.h" +#include "../../../../../module/temperature.h" + +static lv_obj_t * scr; +static lv_obj_t * fw_type,*board,*fw_version; + +#define ID_A_RETURN 1 + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + switch(obj->mks_obj_id) + { + case ID_A_RETURN: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + + } +} + + +void lv_draw_about(void) +{ + lv_obj_t *buttonBack,*label_Back; + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != ABOUT_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = ABOUT_UI; + } + disp_state = ABOUT_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonBack = lv_imgbtn_create(scr, NULL); + + #if 1 + + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_A_RETURN,"bmp_Return.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + /*Create a label on the Image button*/ + + label_Back = lv_label_create(buttonBack, NULL); + + if(gCfgItems.multiple_language !=0) + { + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + + fw_version = lv_label_create(scr, NULL); + lv_obj_set_style(fw_version, &tft_style_lable_rel); + lv_label_set_text(fw_version, "Version: V_2.0.5.3"); + lv_obj_align(fw_version, NULL, LV_ALIGN_CENTER,0, -60); + + fw_type = lv_label_create(scr, NULL); + lv_obj_set_style(fw_type, &tft_style_lable_rel); + #if (MOTHERBOARD == BOARD_MKS_ROBIN_PRO) + lv_label_set_text(fw_type, "Firmware: Robin_Pro35"); + #elif (MOTHERBOARD == BOARD_MKS_ROBIN_NANO) + lv_label_set_text(fw_type, "Firmware: Robin_Nano35"); + #endif + lv_obj_align(fw_type, NULL, LV_ALIGN_CENTER,0, -20); + + board = lv_label_create(scr, NULL); + lv_obj_set_style(board, &tft_style_lable_rel); + #if (MOTHERBOARD == BOARD_MKS_ROBIN_PRO) + lv_label_set_text(board, "Board: MKS Robin pro"); + #elif (MOTHERBOARD == BOARD_MKS_ROBIN_NANO) + lv_label_set_text(board, "Board: MKS Robin nano"); + #endif + + lv_obj_align(board, NULL, LV_ALIGN_CENTER,0, 20); +} + +void lv_clear_about() +{ + lv_obj_del(scr); +} +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_change_speed.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_change_speed.cpp new file mode 100644 index 000000000000..e561e90d3cf3 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_change_speed.cpp @@ -0,0 +1,378 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" +#include "../../../../../../Configuration.h" +#include "../inc/draw_ui.h" +#include "../../../../../module/temperature.h" +#include "../../../../../module/planner.h" + +static lv_obj_t * scr; +static lv_obj_t * labelStep,*buttonStep,*buttonMov,*buttonExt; +static lv_obj_t * labelMov,*labelExt; +static lv_obj_t * printSpeedText; + +#define ID_C_ADD 1 +#define ID_C_DEC 2 +#define ID_C_MOVE 3 +#define ID_C_EXT 4 +#define ID_C_STEP 5 +#define ID_C_RETURN 6 + +static uint8_t speedType; + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + switch(obj->mks_obj_id) + { + case ID_C_ADD: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(speedType == 0) + { + if(feedrate_percentage < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) + { + feedrate_percentage += uiCfg.stepPrintSpeed; + + } + else + { + feedrate_percentage = MAX_EXT_SPEED_PERCENT; + } + } + else if(speedType == 1) + { + if(planner.flow_percentage[0]< MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) + { + planner.flow_percentage[0] += uiCfg.stepPrintSpeed; + + } + else + { + planner.flow_percentage[0] = MAX_EXT_SPEED_PERCENT; + } + //planner.e_factor[0]= planner.flow_percentage[0]*0.01; + //planner.flow_percentage[1] = planner.flow_percentage[0]; + //planner.e_factor[1]= planner.flow_percentage[1]*0.01; + planner.refresh_e_factor(0); + if(EXTRUDERS == 2) + { + planner.flow_percentage[1] = planner.flow_percentage[0]; + planner.refresh_e_factor(1); + } + } + disp_print_speed(); + } + break; + case ID_C_DEC: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + if(speedType == 0) + { + if(feedrate_percentage > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) + { + feedrate_percentage -= uiCfg.stepPrintSpeed; + } + else + { + feedrate_percentage = MIN_EXT_SPEED_PERCENT; + } + } + else if(speedType == 1) + { + if(planner.flow_percentage[0] > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) + { + planner.flow_percentage[0] -= uiCfg.stepPrintSpeed; + } + else + { + planner.flow_percentage[0] = MIN_EXT_SPEED_PERCENT; + } + //planner.e_factor[0]= planner.flow_percentage[0]*0.01; + //planner.flow_percentage[1] = planner.flow_percentage[0]; + //planner.e_factor[1]= planner.flow_percentage[1]*0.01; + planner.refresh_e_factor(0); + if(EXTRUDERS == 2) + { + planner.flow_percentage[1] = planner.flow_percentage[0]; + planner.refresh_e_factor(1); + } + } + disp_print_speed(); + } + + break; + case ID_C_MOVE: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + speedType = 0; + disp_speed_type(); + disp_print_speed(); + } + break; + case ID_C_EXT: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + speedType = 1; + disp_speed_type(); + disp_print_speed(); + } + break; + case ID_C_STEP: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + if(uiCfg.stepPrintSpeed == 1) + { + uiCfg.stepPrintSpeed = 5; + } + else if(uiCfg.stepPrintSpeed == 5) + { + uiCfg.stepPrintSpeed = 10; + } + else + { + uiCfg.stepPrintSpeed = 1; + } + disp_speed_step(); + } + break; + case ID_C_RETURN: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + + } +} + + +void lv_draw_change_speed(void) +{ + lv_obj_t *buttonAdd,*buttonDec; + lv_obj_t *buttonBack; + + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != CHANGE_SPEED_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = CHANGE_SPEED_UI; + } + disp_state = CHANGE_SPEED_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonAdd = lv_imgbtn_create(scr, NULL); + buttonDec = lv_imgbtn_create(scr, NULL); + buttonMov = lv_imgbtn_create(scr, NULL); + buttonExt = lv_imgbtn_create(scr, NULL); + buttonStep = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonAdd, event_handler,ID_C_ADD,"bmp_Add.bin",0); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonDec, event_handler,ID_C_DEC,"bmp_Dec.bin",0); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); + + + lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_REL, &tft_style_lable_rel); + + + + lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_C_RETURN,"bmp_Return.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + + lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonMov,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonExt,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonStep,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonMov, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonExt, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); + lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); + labelMov = lv_label_create(buttonMov, NULL); + labelExt = lv_label_create(buttonExt, NULL); + labelStep = lv_label_create(buttonStep, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if(gCfgItems.multiple_language !=0) + { + lv_label_set_text(labelAdd, speed_menu.add); + lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelDec, speed_menu.dec); + lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + disp_speed_type(); + disp_speed_step(); + + printSpeedText = lv_label_create(scr, NULL); + lv_obj_set_style(printSpeedText, &tft_style_lable_rel); + disp_print_speed(); +} + +void disp_speed_step() +{ + if(uiCfg.stepPrintSpeed == 1) + { + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step1_percent.bin",0); + } + else if(uiCfg.stepPrintSpeed == 5) + { + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step5_percent.bin",0); + } + else if(uiCfg.stepPrintSpeed == 10) + { + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step10_percent.bin",0); + } + + if(gCfgItems.multiple_language != 0) + { + if(uiCfg.stepPrintSpeed == 1) + { + lv_label_set_text(labelStep, speed_menu.step_1percent); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else if(uiCfg.stepPrintSpeed == 5) + { + lv_label_set_text(labelStep, speed_menu.step_5percent); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else if(uiCfg.stepPrintSpeed == 10) + { + lv_label_set_text(labelStep, speed_menu.step_10percent); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } +} + +void disp_print_speed() +{ + char buf[30] = {0}; + + public_buf_l[0] = '\0'; + + if(speedType == 0) //move + { + strcat(public_buf_l,speed_menu.move_speed); + strcat(public_buf_l,": "); + sprintf(buf, "%d%%", feedrate_percentage); + strcat(public_buf_l,buf); + } + else if(speedType == 1) // e1 + { + strcat(public_buf_l,speed_menu.extrude_speed); + strcat(public_buf_l,": "); + sprintf(buf, "%d%%", planner.flow_percentage[0]); + strcat(public_buf_l,buf); + } + lv_label_set_text(printSpeedText, public_buf_l); + lv_obj_align(printSpeedText, NULL, LV_ALIGN_CENTER,0, -65); +} + +void disp_speed_type() +{ + switch(speedType) + { + case 1: + lv_obj_set_event_cb_mks(buttonExt, event_handler,ID_C_EXT,"bmp_Extruct_speed_sel.bin",0); + lv_obj_set_event_cb_mks(buttonMov, event_handler,ID_C_MOVE,"bmp_Mov_speed.bin",0); + break; + + default: + lv_obj_set_event_cb_mks(buttonExt, event_handler,ID_C_EXT,"bmp_Extruct_speed.bin",0); + lv_obj_set_event_cb_mks(buttonMov, event_handler,ID_C_MOVE,"bmp_Mov_speed_sel.bin",0); + break; + } + lv_obj_refresh_ext_draw_pad(buttonExt); + lv_obj_refresh_ext_draw_pad(buttonMov); + + if(gCfgItems.multiple_language != 0) + { + lv_label_set_text(labelMov, speed_menu.move); + lv_obj_align(labelMov, buttonMov, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelExt, speed_menu.extrude); + lv_obj_align(labelExt, buttonExt, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + +} + + +void lv_clear_change_speed() +{ + lv_obj_del(scr); +} +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_dialog.cpp new file mode 100644 index 000000000000..d68909e7669c --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_dialog.cpp @@ -0,0 +1,357 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" +#include "../inc/draw_ui.h" +#include "../../../../../sd/cardreader.h" +#include "../../../../../gcode/queue.h" +#include "../../../../../module/temperature.h" +#include "../../../../../module/planner.h" +#if ENABLED(POWER_LOSS_RECOVERY) +#include "../../../../../feature/powerloss.h" +#endif +#if ENABLED(PARK_HEAD_ON_PAUSE) +#include "../../../../../feature/pause.h" +#endif + +static lv_obj_t * scr; +extern uint8_t sel_id; +extern uint8_t once_flag; +extern uint8_t gcode_preview_over; +uint8_t DialogType; + +static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) +{ + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) + { + if(DialogType == DIALOG_TYPE_PRINT_FILE) + { + preview_gcode_prehandle(list_file.file_name[sel_id]); + reset_print_time(); + start_print_time(); + + uiCfg.print_state = WORKING; + lv_clear_dialog(); + lv_draw_printing(); + + if(gcode_preview_over != 1) + { + #if ENABLED (SDSUPPORT) + char *cur_name; + cur_name=strrchr(list_file.file_name[sel_id],'/'); + + SdFile file; + SdFile *curDir; + card.endFilePrint(); + const char * const fname = card.diveToFile(true, curDir, cur_name); + if (!fname) return; + if (file.open(curDir, fname, O_READ)) + { + gCfgItems.curFilesize = file.fileSize(); + file.close(); + update_spi_flash(); + } + card.openFileRead(cur_name); + if(card.isFileOpen()) + { + feedrate_percentage = 100; + //saved_feedrate_percentage = feedrate_percentage; + planner.flow_percentage[0] = 100; + planner.e_factor[0]= planner.flow_percentage[0]*0.01; + if(EXTRUDERS==2) + { + planner.flow_percentage[1] = 100; + planner.e_factor[1]= planner.flow_percentage[1]*0.01; + } + card.startFileprint(); + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.prepare(); + #endif + once_flag = 0; + } + #endif + } + } + else if(DialogType == DIALOG_TYPE_STOP) + { + stop_print_time(); + lv_clear_dialog(); + lv_draw_ready_print(); + + #if ENABLED (SDSUPPORT) + //card.endFilePrint(); + //wait_for_heatup = false; + uiCfg.print_state = IDLE; + card.flag.abort_sd_printing = true; + //queue.clear(); + //quickstop_stepper(); + //print_job_timer.stop(); + //thermalManager.disable_all_heaters(); + + //#if ENABLED(POWER_LOSS_RECOVERY) + //recovery.purge(); + //#endif + //queue.enqueue_one_now(PSTR("G91")); + //queue.enqueue_one_now(PSTR("G1 Z10")); + //queue.enqueue_one_now(PSTR("G90")); + //queue.enqueue_one_now(PSTR("G28 X0 Y0")); + //queue.inject_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0\nM84\nM107")); + #endif + } + else if(DialogType == DIALOG_TYPE_FINISH_PRINT) + { + clear_cur_ui(); + lv_draw_ready_print(); + } + #if ENABLED(ADVANCED_PAUSE_FEATURE) + else if(DialogType == DIALOG_PAUSE_MESSAGE_WAITING + ||DialogType == DIALOG_PAUSE_MESSAGE_INSERT + ||DialogType == DIALOG_PAUSE_MESSAGE_HEAT) + { + wait_for_user = false; + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_OPTION) + { + pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_RESUME) + { + clear_cur_ui(); + draw_return_ui(); + } + #endif + } +} + +static void btn_cancel_event_cb(lv_obj_t * btn, lv_event_t event) +{ + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) + { + if(DialogType == DIALOG_PAUSE_MESSAGE_OPTION) + { + #if ENABLED(ADVANCED_PAUSE_FEATURE) + pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; + #endif + } + else + { + clear_cur_ui(); + draw_return_ui(); + } + } +} + + +void lv_draw_dialog(uint8_t type) +{ + + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != DIALOG_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = DIALOG_UI; + } + disp_state = DIALOG_UI; + + DialogType = type; + + scr = lv_obj_create(NULL, NULL); + + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + //LV_IMG_DECLARE(bmp_pic); + + static lv_style_t style_btn_rel; /*A variable to store the released style*/ + lv_style_copy(&style_btn_rel, &lv_style_plain); /*Initialize from a built-in style*/ + style_btn_rel.body.border.color = lv_color_hex3(0x269); + style_btn_rel.body.border.width = 1; + style_btn_rel.body.main_color = lv_color_hex3(0xADF); + style_btn_rel.body.grad_color = lv_color_hex3(0x46B); + style_btn_rel.body.shadow.width = 4; + style_btn_rel.body.shadow.type = LV_SHADOW_BOTTOM; + style_btn_rel.body.radius = LV_RADIUS_CIRCLE; + style_btn_rel.text.color = lv_color_hex3(0xDEF); + style_btn_rel.text.font = &gb2312_puhui32; + + + static lv_style_t style_btn_pr; /*A variable to store the pressed style*/ + lv_style_copy(&style_btn_pr, &style_btn_rel); /*Initialize from the released style*/ + style_btn_pr.body.border.color = lv_color_hex3(0x46B); + style_btn_pr.body.main_color = lv_color_hex3(0x8BD); + style_btn_pr.body.grad_color = lv_color_hex3(0x24A); + style_btn_pr.body.shadow.width = 2; + style_btn_pr.text.color = lv_color_hex3(0xBCD); + style_btn_pr.text.font = &gb2312_puhui32; + + lv_obj_t * labelDialog = lv_label_create(scr, NULL); + lv_obj_set_style(labelDialog, &tft_style_lable_rel); + + + if(DialogType == DIALOG_TYPE_FINISH_PRINT || DialogType == DIALOG_PAUSE_MESSAGE_RESUME) + { + lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(btnOk, BTN_OK_X+90, BTN_OK_Y); /*Set its position*/ + lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ + lv_obj_set_event_cb(btnOk, btn_ok_event_cb); + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ + + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_WAITING + ||DialogType == DIALOG_PAUSE_MESSAGE_INSERT + ||DialogType == DIALOG_PAUSE_MESSAGE_HEAT) + { + lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(btnOk, BTN_OK_X+90, BTN_OK_Y); /*Set its position*/ + lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ + lv_obj_set_event_cb(btnOk, btn_ok_event_cb); + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_PAUSING + ||DialogType == DIALOG_PAUSE_MESSAGE_CHANGING + ||DialogType == DIALOG_PAUSE_MESSAGE_UNLOAD + ||DialogType == DIALOG_PAUSE_MESSAGE_LOAD + ||DialogType == DIALOG_PAUSE_MESSAGE_PURGE + ||DialogType == DIALOG_PAUSE_MESSAGE_RESUME + ||DialogType == DIALOG_PAUSE_MESSAGE_HEATING) + { + + } + else + { + lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(btnOk, BTN_OK_X, BTN_OK_Y); /*Set its position*/ + lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ + lv_obj_set_event_cb(btnOk, btn_ok_event_cb); + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ + + lv_obj_t * btnCancel = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(btnCancel, BTN_CANCEL_X, BTN_CANCEL_Y); /*Set its position*/ + lv_obj_set_size(btnCancel, 100, 50); /*Set its size*/ + lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); + lv_btn_set_style(btnCancel, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ + lv_btn_set_style(btnCancel, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ + lv_obj_t * labelCancel = lv_label_create(btnCancel, NULL); /*Add a label to the button*/ + + if(DialogType == DIALOG_PAUSE_MESSAGE_OPTION) + { + lv_label_set_text(labelOk, pause_msg_menu.purgeMore); /*Set the labels text*/ + lv_label_set_text(labelCancel, pause_msg_menu.continuePrint); + } + else + { + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ + lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); + } + } + if(DialogType == DIALOG_TYPE_PRINT_FILE) + { + lv_label_set_text(labelDialog, print_file_dialog_menu.print_file); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + + lv_obj_t * labelFile = lv_label_create(scr, NULL); + lv_obj_set_style(labelFile, &tft_style_lable_rel); + + lv_label_set_text(labelFile, list_file.long_name[sel_id]); + lv_obj_align(labelFile, NULL, LV_ALIGN_CENTER, 0, -60); + } + else if(DialogType == DIALOG_TYPE_STOP) + { + lv_label_set_text(labelDialog, print_file_dialog_menu.cancle_print); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if(DialogType == DIALOG_TYPE_FINISH_PRINT) + { + lv_label_set_text(labelDialog, print_file_dialog_menu.print_finish); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_PAUSING) + { + lv_label_set_text(labelDialog, pause_msg_menu.pausing); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_CHANGING) + { + lv_label_set_text(labelDialog, pause_msg_menu.changing); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_UNLOAD) + { + lv_label_set_text(labelDialog, pause_msg_menu.unload); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_WAITING) + { + lv_label_set_text(labelDialog, pause_msg_menu.waiting); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_INSERT) + { + lv_label_set_text(labelDialog, pause_msg_menu.insert); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_LOAD) + { + lv_label_set_text(labelDialog, pause_msg_menu.load); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_PURGE) + { + lv_label_set_text(labelDialog, pause_msg_menu.purge); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_RESUME) + { + lv_label_set_text(labelDialog, pause_msg_menu.resume); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_HEAT) + { + lv_label_set_text(labelDialog, pause_msg_menu.heat); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_HEATING) + { + lv_label_set_text(labelDialog, pause_msg_menu.heating); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if(DialogType == DIALOG_PAUSE_MESSAGE_OPTION) + { + lv_label_set_text(labelDialog, pause_msg_menu.option); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + +} + +void lv_clear_dialog() +{ + lv_obj_del(scr); +} + +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_error_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_error_message.cpp new file mode 100644 index 000000000000..116682e4edb6 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_error_message.cpp @@ -0,0 +1,67 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" +#include "../../../../../../Configuration.h" +#include "../inc/tft_lvgl_configuration.h" +#include "../inc/mks_hardware_test.h" +#include "../inc/draw_ui.h" + +static lv_obj_t * scr; + +void lv_draw_error_message(PGM_P const msg) +{ + #if 0 + static lv_obj_t * message=NULL,*kill_message=NULL,*reset_tips=NULL; + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != ERROR_MESSAGE_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = ERROR_MESSAGE_UI; + } + disp_state = ERROR_MESSAGE_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + if(msg) + { + message = lv_label_create(scr, NULL); + lv_obj_set_style(message, &tft_style_lable_rel); + lv_label_set_text(message, msg); + lv_obj_align(message, NULL, LV_ALIGN_CENTER,0, -50); + } + + kill_message = lv_label_create(scr, NULL); + lv_obj_set_style(kill_message, &tft_style_lable_rel); + lv_label_set_text(kill_message, "PRINTER HALTED"); + lv_obj_align(kill_message, NULL, LV_ALIGN_CENTER,0, -10); + + reset_tips = lv_label_create(scr, NULL); + lv_obj_set_style(reset_tips, &tft_style_lable_rel); + lv_label_set_text(reset_tips, "Please Reset"); + lv_obj_align(reset_tips, NULL, LV_ALIGN_CENTER,0, 30); + + lv_task_handler(); + #endif + LCD_Clear(0x0000); + if(msg) + disp_string((TFT_WIDTH-strlen(msg)*16)/2,100,msg,0xffff,0x0000); + disp_string((TFT_WIDTH-strlen("PRINTER HALTED")*16)/2,140,"PRINTER HALTED",0xffff,0x0000); + disp_string((TFT_WIDTH-strlen("Please Reset")*16)/2,180,"Please Reset",0xffff,0x0000); + +} + +void lv_clear_error_message() +{ + lv_obj_del(scr); +} +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_extrusion.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_extrusion.cpp new file mode 100644 index 000000000000..d35ec37a7e16 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_extrusion.cpp @@ -0,0 +1,438 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" +#include "../inc/draw_ui.h" +#include "../../../../../module/temperature.h" +#include "../../../../../gcode/queue.h" + +static lv_obj_t * scr; +static lv_obj_t * buttoType,*buttonStep,*buttonSpeed; +static lv_obj_t * labelType; +static lv_obj_t * labelStep; +static lv_obj_t * labelSpeed; +static lv_obj_t * tempText; +static lv_obj_t * ExtruText; + +#define ID_E_ADD 1 +#define ID_E_DEC 2 +#define ID_E_TYPE 3 +#define ID_E_STEP 4 +#define ID_E_SPEED 5 +#define ID_E_RETURN 6 + +static int32_t extructAmount; + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + switch(obj->mks_obj_id) + { + case ID_E_ADD: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius>= EXTRUDE_MINTEMP) + { + queue.enqueue_one_now(PSTR("G91")); + memset(public_buf_l,0,sizeof(public_buf_l)); + sprintf((char *)public_buf_l, "G1 E%d F%d", uiCfg.extruStep, 60 * uiCfg.extruSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + + extructAmount += uiCfg.extruStep; + disp_extru_amount(); + } + } + break; + case ID_E_DEC: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + if(thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius>= EXTRUDE_MINTEMP) + { + queue.enqueue_one_now(PSTR("G91")); + memset(public_buf_l,0,sizeof(public_buf_l)); + sprintf((char *)public_buf_l, "G1 E%d F%d", 0-uiCfg.extruStep, 60 * uiCfg.extruSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + extructAmount -= uiCfg.extruStep; + disp_extru_amount(); + } + } + + break; + case ID_E_TYPE: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(EXTRUDERS == 2) + { + if(uiCfg.curSprayerChoose == 0) + { + uiCfg.curSprayerChoose = 1; + queue.inject_P(PSTR("T1")); + } + else + { + uiCfg.curSprayerChoose = 0; + queue.inject_P(PSTR("T0")); + } + } + else + { + uiCfg.curSprayerChoose = 0; + } + + extructAmount = 0; + disp_hotend_temp(); + + disp_ext_type(); + + disp_extru_amount(); + } + break; + case ID_E_STEP: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + switch(abs(uiCfg.extruStep)) + { + case 1: + uiCfg.extruStep = 5; + break; + + case 5: + uiCfg.extruStep = 10; + break; + + case 10: + uiCfg.extruStep = 1; + break; + + default: + break; + } + disp_ext_step(); + } + break; + case ID_E_SPEED: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + switch(uiCfg.extruSpeed) + { + case 1: + uiCfg.extruSpeed = 10; + break; + + case 10: + uiCfg.extruSpeed = 20; + break; + + case 20: + uiCfg.extruSpeed = 1; + break; + + default: + break; + } + disp_ext_speed(); + } + break; + case ID_E_RETURN: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + + } +} + + +void lv_draw_extrusion(void) +{ + lv_obj_t *buttonAdd,*buttonDec,*buttonBack; + + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != EXTRUSION_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = EXTRUSION_UI; + } + disp_state = EXTRUSION_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonAdd = lv_imgbtn_create(scr, NULL); + buttonDec = lv_imgbtn_create(scr, NULL); + buttoType = lv_imgbtn_create(scr, NULL); + buttonStep = lv_imgbtn_create(scr, NULL); + buttonSpeed = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonAdd, event_handler,ID_E_ADD,"bmp_In.bin",0); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonDec, event_handler,ID_E_DEC,"bmp_Out.bin",0); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); + + + lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttoType, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttoType, LV_BTN_STATE_REL, &tft_style_lable_rel); + + + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_E_RETURN,"bmp_Return.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + + lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttoType,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonStep,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonSpeed,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); + lv_btn_set_layout(buttoType, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonSpeed, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); + lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); + labelType = lv_label_create(buttoType, NULL); + labelStep = lv_label_create(buttonStep, NULL); + labelSpeed = lv_label_create(buttonSpeed, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if(gCfgItems.multiple_language !=0) + { + lv_label_set_text(labelAdd, extrude_menu.in); + lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelDec, extrude_menu.out); + lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + + disp_ext_type(); + disp_ext_step(); + disp_ext_speed(); + + tempText = lv_label_create(scr, NULL); + lv_obj_set_style(tempText, &tft_style_lable_rel); + disp_hotend_temp(); + + ExtruText = lv_label_create(scr, NULL); + lv_obj_set_style(ExtruText, &tft_style_lable_rel); + disp_extru_amount(); +} + +void disp_ext_type() +{ + if(uiCfg.curSprayerChoose == 1) + { + lv_obj_set_event_cb_mks(buttoType, event_handler,ID_E_TYPE,"bmp_Extru2.bin",0); + if(gCfgItems.multiple_language != 0) + { + lv_label_set_text(labelType, extrude_menu.ext2); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } + else + { + lv_obj_set_event_cb_mks(buttoType, event_handler,ID_E_TYPE,"bmp_Extru1.bin",0); + if(gCfgItems.multiple_language != 0) + { + lv_label_set_text(labelType, extrude_menu.ext1); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } +} + +void disp_ext_speed() +{ + if(uiCfg.extruSpeed == 20) + lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_high.bin",0); + else if(uiCfg.extruSpeed == 1) + lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_slow.bin",0); + else + lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_normal.bin",0); + + if(gCfgItems.multiple_language != 0) + { + if(uiCfg.extruSpeed == 20) + { + lv_label_set_text(labelSpeed, extrude_menu.high); + lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else if(uiCfg.extruSpeed == 1) + { + lv_label_set_text(labelSpeed, extrude_menu.low); + lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else + { + lv_label_set_text(labelSpeed, extrude_menu.normal); + lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } +} + +void disp_hotend_temp() +{ + char buf[20] = {0}; + + public_buf_l[0] = '\0'; + + strcat(public_buf_l,extrude_menu.temper_text); + + sprintf(buf, extrude_menu.temp_value, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); + + + strcat(public_buf_l,buf); + lv_label_set_text(tempText, public_buf_l); + lv_obj_align(tempText, NULL, LV_ALIGN_CENTER,0, -50); +} + +void disp_extru_amount() +{ + char buf1[10] = {0}; + + public_buf_l[0] = '\0'; + + if(extructAmount < 999 && extructAmount > -99) + { + sprintf(buf1, extrude_menu.count_value_mm, extructAmount); + if(uiCfg.curSprayerChoose<1) + { + strcat(public_buf_l,extrude_menu.ext1); + } + else + { + strcat(public_buf_l,extrude_menu.ext2); + } + strcat(public_buf_l,buf1); + } + else if(extructAmount < 9999 && extructAmount > -999) + { + sprintf(buf1, extrude_menu.count_value_cm, extructAmount/10); + if(uiCfg.curSprayerChoose<1) + { + strcat(public_buf_l,extrude_menu.ext1); + } + else + { + strcat(public_buf_l,extrude_menu.ext2); + } + strcat(public_buf_l,buf1); + } + else + { + sprintf(buf1, extrude_menu.count_value_m, extructAmount/1000); + if(uiCfg.curSprayerChoose<1) + { + strcat(public_buf_l,extrude_menu.ext1); + } + else + { + strcat(public_buf_l,extrude_menu.ext2); + } + strcat(public_buf_l,buf1); + } + + lv_label_set_text(ExtruText, public_buf_l); + lv_obj_align(ExtruText, NULL, LV_ALIGN_CENTER,0, -75); +} + +void disp_ext_step() +{ + if(uiCfg.extruStep == 1) + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_E_STEP,"bmp_Step1_mm.bin",0); + else if(uiCfg.extruStep == 5) + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_E_STEP,"bmp_Step5_mm.bin",0); + else if(uiCfg.extruStep == 10) + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_E_STEP,"bmp_Step10_mm.bin",0); + + if(gCfgItems.multiple_language != 0) + { + if(uiCfg.extruStep == 1) + { + lv_label_set_text(labelStep, extrude_menu.step_1mm); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else if(uiCfg.extruStep == 5) + { + lv_label_set_text(labelStep, extrude_menu.step_5mm); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else if(uiCfg.extruStep == 10) + { + lv_label_set_text(labelStep, extrude_menu.step_10mm); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } +} + +void lv_clear_extrusion() +{ + lv_obj_del(scr); +} +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_fan.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_fan.cpp new file mode 100644 index 000000000000..f858f66f9261 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_fan.cpp @@ -0,0 +1,242 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" +#include "../../../../../../Configuration.h" +#include "../inc/draw_ui.h" +#include "../../../../../module/temperature.h" +#include "../../../../../gcode/queue.h" + +static lv_obj_t * scr; +static lv_obj_t * fanText; + +#define ID_F_ADD 1 +#define ID_F_DEC 2 +#define ID_F_HIGH 3 +#define ID_F_MID 4 +#define ID_F_OFF 5 +#define ID_F_RETURN 6 + +static uint8_t fanSpeed; + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + switch(obj->mks_obj_id) + { + case ID_F_ADD: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + + if(fanSpeed + 1 <= 255) + { + fanSpeed++; + memset(public_buf_l,0,sizeof(public_buf_l)); + sprintf(public_buf_l, "M106 S%d",fanSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + } + } + break; + case ID_F_DEC: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + if(fanSpeed > 0) + { + fanSpeed--; + memset(public_buf_l,0,sizeof(public_buf_l)); + sprintf(public_buf_l, "M106 S%d",fanSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + } + } + + break; + case ID_F_HIGH: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + queue.enqueue_one_now(PSTR("M106 S255")); + } + break; + case ID_F_MID: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + queue.enqueue_one_now(PSTR("M106 S127")); + } + break; + case ID_F_OFF: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + queue.enqueue_one_now(PSTR("M107")); + } + break; + case ID_F_RETURN: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + + } +} + + +void lv_draw_fan(void) +{ + lv_obj_t *buttonAdd,*buttonDec,*buttonHigh,*buttonMid; + lv_obj_t *buttonOff,*buttonBack; + + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != FAN_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = FAN_UI; + } + disp_state = FAN_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + + + /*Create an Image button*/ + buttonAdd = lv_imgbtn_create(scr, NULL); + buttonDec = lv_imgbtn_create(scr, NULL); + buttonHigh = lv_imgbtn_create(scr, NULL); + buttonMid = lv_imgbtn_create(scr, NULL); + buttonOff = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonAdd, event_handler,ID_F_ADD,"bmp_Add.bin",0); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonDec, event_handler,ID_F_DEC,"bmp_Dec.bin",0); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonHigh, event_handler,ID_F_HIGH,"bmp_Speed255.bin",0); + lv_imgbtn_set_src(buttonHigh, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonHigh, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonHigh, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonHigh, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonMid, event_handler,ID_F_MID,"bmp_Speed127.bin",0); + lv_imgbtn_set_src(buttonMid, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonMid, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonMid, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonMid, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonOff, event_handler,ID_F_OFF,"bmp_Speed0.bin",0); + lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_F_RETURN,"bmp_Return.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + + lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonHigh,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonMid,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonOff,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHigh, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonMid, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOff, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); + lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); + lv_obj_t * labelHigh = lv_label_create(buttonHigh, NULL); + lv_obj_t * labelMid = lv_label_create(buttonMid, NULL); + lv_obj_t * labelOff = lv_label_create(buttonOff, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if(gCfgItems.multiple_language !=0) + { + lv_label_set_text(labelAdd, fan_menu.add); + lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelDec, fan_menu.dec); + lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHigh, fan_menu.full); + lv_obj_align(labelHigh, buttonHigh, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelMid, fan_menu.half); + lv_obj_align(labelMid, buttonMid, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelOff,fan_menu.off); + lv_obj_align(labelOff, buttonOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + + fanText = lv_label_create(scr, NULL); + lv_obj_set_style(fanText, &tft_style_lable_rel); + disp_fan_value(); +} + +void disp_fan_value() +{ + char buf1[10] = {0}; + public_buf_l[0] = '\0'; + strcat(public_buf_l, fan_menu.state); + strcat(public_buf_l, ": "); + sprintf(buf1, "%3d", thermalManager.fan_speed[0]); + strcat(public_buf_l, buf1); + lv_label_set_text(fanText, public_buf_l); + lv_obj_align(fanText, NULL, LV_ALIGN_CENTER,0, -65); +} + +void lv_clear_fan() +{ + lv_obj_del(scr); +} +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_home.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_home.cpp new file mode 100644 index 000000000000..a96307a6dddd --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_home.cpp @@ -0,0 +1,269 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "../inc/draw_ready_print.h" +#include "../inc/draw_set.h" +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" +#include "../inc/draw_ui.h" +#include "../../../../../gcode/queue.h" + +static lv_obj_t * scr; + +#define ID_H_ALL 1 +#define ID_H_X 2 +#define ID_H_Y 3 +#define ID_H_Z 4 +#define ID_H_RETURN 5 +#define ID_H_OFF_ALL 6 +#define ID_H_OFF_XY 7 + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + switch(obj->mks_obj_id) + { + case ID_H_ALL: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("G28")); + } + break; + case ID_H_X: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("G28 X0")); + } + break; + case ID_H_Y: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("G28 Y0")); + } + break; + case ID_H_Z: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("G28 Z0")); + } + break; + case ID_H_OFF_ALL: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("M84")); + } + break; + case ID_H_OFF_XY: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("M84 X Y")); + } + break; + case ID_H_RETURN: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_tool(); + } + break; + + } +} + + +void lv_draw_home(void) +{ + lv_obj_t *buttonHomeAll,*buttonHomeX,*buttonHomeY,*buttonHomeZ; + lv_obj_t *buttonBack; + lv_obj_t *buttonOffAll,*buttonOffXY; + + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != ZERO_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = ZERO_UI; + } + disp_state = ZERO_UI; + + scr = lv_obj_create(NULL, NULL); + + //static lv_style_t tool_style; + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + //buttonWifi = lv_imgbtn_create(scr, NULL); + buttonHomeAll = lv_imgbtn_create(scr, NULL); + buttonHomeX = lv_imgbtn_create(scr, NULL); + //buttonContinue = lv_imgbtn_create(scr, NULL); + buttonHomeY = lv_imgbtn_create(scr, NULL); + buttonHomeZ = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + buttonOffAll = lv_imgbtn_create(scr, NULL); + buttonOffXY = lv_imgbtn_create(scr, NULL); + + //lv_obj_set_event_cb_mks(buttonWifi, event_handler,ID_S_WIFI,"bmp_Wifi.bin",0); + //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_PR, &tft_style_lable_pre); + //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_REL, &tft_style_lable_rel); + //lv_obj_clear_protect(buttonWifi, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonHomeAll, event_handler,ID_H_ALL,"bmp_Zero.bin",0); + lv_imgbtn_set_src(buttonHomeAll, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonHomeAll, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonHomeAll, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonHomeAll, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonHomeX, event_handler,ID_H_X,"bmp_zeroX.bin",0); + lv_imgbtn_set_src(buttonHomeX, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonHomeX, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonHomeX, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonHomeX, LV_BTN_STATE_REL, &tft_style_lable_rel); + + //lv_obj_set_event_cb_mks(buttonContinue, event_handler,ID_S_CONTINUE,"bmp_Breakpoint.bin",0); + //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_PR, &tft_style_lable_pre); + //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonHomeY, event_handler,ID_H_Y,"bmp_zeroY.bin",0); + lv_imgbtn_set_src(buttonHomeY, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonHomeY, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonHomeY, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonHomeY, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonHomeZ, event_handler,ID_H_Z,"bmp_zeroZ.bin",0); + lv_imgbtn_set_src(buttonHomeZ, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonHomeZ, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonHomeZ, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonHomeZ, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonOffAll, event_handler,ID_H_OFF_ALL,"bmp_Motor_off.bin",0); + lv_imgbtn_set_src(buttonOffAll, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonOffAll, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonOffAll, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonOffAll, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonOffXY, event_handler,ID_H_OFF_XY,"bmp_Motor_off.bin",0); + lv_imgbtn_set_src(buttonOffXY, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonOffXY, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonOffXY, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonOffXY, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_H_RETURN,"bmp_Return.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + /*lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonFan,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); + lv_obj_set_pos(buttonAbout,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); + lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buMotorOff,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonLanguage,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight);*/ + + //lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonHomeX,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); + lv_obj_set_pos(buttonHomeY,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); + //lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonHomeZ,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonHomeAll,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonOffAll,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonOffXY,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + /*Create a label on the Image button*/ + //lv_btn_set_layout(buttonWifi, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHomeAll, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHomeX, LV_LAYOUT_OFF); + //lv_btn_set_layout(buttonContinue, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHomeY, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHomeZ, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOffAll, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOffXY, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + //lv_obj_t * labelWifi= lv_label_create(buttonWifi, NULL); + lv_obj_t * labelHomeAll = lv_label_create(buttonHomeAll, NULL); + lv_obj_t * labelHomeX= lv_label_create(buttonHomeX, NULL); + //lv_obj_t * label_Continue = lv_label_create(buttonContinue, NULL); + lv_obj_t * labelHomeY = lv_label_create(buttonHomeY, NULL); + lv_obj_t * labelHomeZ = lv_label_create(buttonHomeZ, NULL); + lv_obj_t * labelOffAll = lv_label_create(buttonOffAll, NULL); + lv_obj_t * labelOffXY = lv_label_create(buttonOffXY, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if(gCfgItems.multiple_language !=0) + { + //lv_label_set_text(labelWifi, set_menu.wifi); + //lv_obj_align(labelWifi, buttonWifi, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHomeAll, home_menu.home_all); + lv_obj_align(labelHomeAll, buttonHomeAll, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHomeX,home_menu.home_x); + lv_obj_align(labelHomeX, buttonHomeX, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_text(label_Continue, set_menu.breakpoint); + //lv_obj_align(label_Continue, buttonContinue, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHomeY, home_menu.home_y); + lv_obj_align(labelHomeY, buttonHomeY, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHomeZ, home_menu.home_z); + lv_obj_align(labelHomeZ, buttonHomeZ, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelOffAll, set_menu.motoroff); + lv_obj_align(labelOffAll, buttonOffAll, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelOffXY, set_menu.motoroffXY); + lv_obj_align(labelOffXY, buttonOffXY, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } +} + +void lv_clear_home() +{ + lv_obj_del(scr); +} + +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_language.cpp new file mode 100644 index 000000000000..dabc71c47c71 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_language.cpp @@ -0,0 +1,366 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" +#include "../inc/draw_ui.h" +#include + +//static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn; + + +#define ID_CN 1 +#define ID_T_CN 2 +#define ID_EN 3 +#define ID_RU 4 +#define ID_ES 5 +#define ID_FR 6 +#define ID_IT 7 +#define ID_L_RETURN 8 + +#define SELECTED 1 +#define UNSELECTED 0 + +static void disp_language(uint8_t language,uint8_t state); + + +static lv_obj_t * scr; + + +static lv_obj_t *buttonCN,*buttonT_CN,*buttonEN,*buttonRU; +static lv_obj_t *buttonES,*buttonFR,*buttonIT,*buttonBack; + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + switch(obj->mks_obj_id) + { + case ID_CN: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language,UNSELECTED); + lv_obj_set_event_cb_mks(buttonCN, event_handler,ID_CN,"bmp_Simple_cn_sel.bin",0); + gCfgItems.language = LANG_SIMPLE_CHINESE; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_T_CN: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language,UNSELECTED); + lv_obj_set_event_cb_mks(buttonT_CN, event_handler,ID_T_CN,"bmp_Tradition_cn_sel.bin",0); + gCfgItems.language = LANG_COMPLEX_CHINESE; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_EN: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language,UNSELECTED); + lv_obj_set_event_cb_mks(buttonEN, event_handler,ID_EN,"bmp_English_sel.bin",0); + gCfgItems.language = LANG_ENGLISH; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_RU: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language,UNSELECTED); + lv_obj_set_event_cb_mks(buttonRU, event_handler,ID_RU,"bmp_Russian_sel.bin",0); + gCfgItems.language = LANG_RUSSIAN; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_ES: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language,UNSELECTED); + lv_obj_set_event_cb_mks(buttonES, event_handler,ID_ES,"bmp_Spanish_sel.bin",0); + gCfgItems.language = LANG_SPANISH; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_FR: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language,UNSELECTED); + lv_obj_set_event_cb_mks(buttonFR, event_handler,ID_FR,"bmp_French_sel.bin",0); + gCfgItems.language = LANG_FRENCH; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_IT: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language,UNSELECTED); + lv_obj_set_event_cb_mks(buttonIT, event_handler,ID_FR,"bmp_Italy_sel.bin",0); + gCfgItems.language = LANG_ITALY; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_L_RETURN: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + + buttonCN = NULL; + buttonT_CN = NULL; + buttonEN = NULL; + buttonRU = NULL; + buttonES = NULL; + buttonFR = NULL; + buttonFR = NULL; + buttonIT = NULL; + buttonBack = NULL; + + lv_obj_del(scr); + lv_draw_set(); + } + break; + + } +} + +static void disp_language(uint8_t language,uint8_t state) +{ + uint16_t id; + lv_obj_t *obj; + + public_buf_l[0] = '\0'; + + switch(language){ + + case LANG_SIMPLE_CHINESE: + id = ID_CN; + strcat(public_buf_l,"bmp_Simple_cn"); + obj = buttonCN; + + break; + case LANG_COMPLEX_CHINESE: + id = ID_T_CN; + strcat(public_buf_l,"bmp_Tradition_cn"); + obj = buttonT_CN; + break; + case LANG_ENGLISH: + id = ID_EN; + strcat(public_buf_l,"bmp_English"); + obj = buttonEN; + break; + case LANG_RUSSIAN: + id = ID_RU; + strcat(public_buf_l,"bmp_Russian"); + obj = buttonRU; + break; + case LANG_SPANISH: + id = ID_ES; + strcat(public_buf_l,"bmp_Spanish"); + obj = buttonES; + break; + case LANG_FRENCH: + id = ID_FR; + strcat(public_buf_l,"bmp_French"); + obj = buttonFR; + break; + case LANG_ITALY: + id = ID_IT; + strcat(public_buf_l,"bmp_Italy"); + obj = buttonIT; + break; + default: + id = ID_CN; + strcat(public_buf_l,"bmp_Simple_cn"); + obj = buttonCN; + break; + } + + if(state == SELECTED) strcat(public_buf_l,"_sel.bin"); + else strcat(public_buf_l,".bin"); + + lv_obj_set_event_cb_mks(obj, event_handler,id,public_buf_l,0); + + if(state == UNSELECTED)lv_obj_refresh_ext_draw_pad(obj); +} + +void lv_draw_language(void) +{ + + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != LANGUAGE_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = LANGUAGE_UI; + } + disp_state = LANGUAGE_UI; + + scr = lv_obj_create(NULL, NULL); + + //static lv_style_t tool_style; + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonCN = lv_imgbtn_create(scr, NULL); + buttonT_CN = lv_imgbtn_create(scr, NULL); + buttonEN = lv_imgbtn_create(scr, NULL); + buttonRU = lv_imgbtn_create(scr, NULL); + buttonES = lv_imgbtn_create(scr, NULL); + buttonFR = lv_imgbtn_create(scr, NULL); + buttonIT = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + + lv_obj_set_event_cb_mks(buttonCN, event_handler,ID_CN,"bmp_Simple_cn.bin",0); + lv_imgbtn_set_src(buttonCN, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonCN, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonCN, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonCN, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonCN, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonT_CN, event_handler,ID_T_CN,"bmp_Tradition_cn.bin",0); + lv_imgbtn_set_src(buttonT_CN, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonT_CN, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonT_CN, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonT_CN, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonEN, event_handler,ID_EN,"bmp_English.bin",0); + lv_imgbtn_set_src(buttonEN, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonEN, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonEN, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonEN, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonRU, event_handler,ID_RU,"bmp_Russian.bin",0); + lv_imgbtn_set_src(buttonRU, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonRU, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonRU, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonRU, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonES, event_handler,ID_ES,"bmp_Spanish.bin",0); + lv_imgbtn_set_src(buttonES, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonES, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonES, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonES, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonFR, event_handler,ID_FR,"bmp_French.bin",0); + lv_imgbtn_set_src(buttonFR, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonFR, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonFR, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonFR, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonIT, event_handler,ID_IT,"bmp_Italy.bin",0); + lv_imgbtn_set_src(buttonIT, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonIT, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonIT, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonIT, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_L_RETURN,"bmp_Return.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + + lv_obj_set_pos(buttonCN,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonT_CN,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); + lv_obj_set_pos(buttonEN,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); + lv_obj_set_pos(buttonRU,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonES,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonFR,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonIT,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonCN, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonT_CN, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonEN, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonRU, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonES, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonFR, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonIT, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * label_CN = lv_label_create(buttonCN, NULL); + lv_obj_t * label_T_CN = lv_label_create(buttonT_CN, NULL); + lv_obj_t * label_EN = lv_label_create(buttonEN, NULL); + lv_obj_t * label_RU = lv_label_create(buttonRU, NULL); + lv_obj_t * label_ES = lv_label_create(buttonES, NULL); + lv_obj_t * label_FR= lv_label_create(buttonFR, NULL); + lv_obj_t * label_IT = lv_label_create(buttonIT, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + disp_language(gCfgItems.language,SELECTED); + + if(gCfgItems.multiple_language !=0) + { + lv_label_set_text(label_CN, language_menu.chinese_s); + lv_obj_align(label_CN, buttonCN, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_T_CN, language_menu.chinese_t); + lv_obj_align(label_T_CN, buttonT_CN, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_EN, language_menu.english); + lv_obj_align(label_EN, buttonEN, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_RU, language_menu.russian); + lv_obj_align(label_RU, buttonRU, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_ES, language_menu.spanish); + lv_obj_align(label_ES, buttonES, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_FR, language_menu.french); + lv_obj_align(label_FR, buttonFR, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_IT, language_menu.italy); + lv_obj_align(label_IT, buttonIT, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } +} + +void lv_clear_language() +{ + lv_obj_del(scr); +} +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_manuaLevel.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_manuaLevel.cpp new file mode 100644 index 000000000000..bd49dda5a52d --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_manuaLevel.cpp @@ -0,0 +1,284 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +#include "../inc/draw_ui.h" +#include "../../../../../gcode/queue.h" + +//static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn; +static lv_obj_t * scr; + +#define ID_M_POINT1 1 +#define ID_M_POINT2 2 +#define ID_M_POINT3 3 +#define ID_M_POINT4 4 +#define ID_M_POINT5 5 + +#define ID_MANUAL_RETURN 6 + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + switch(obj->mks_obj_id) + { + case ID_M_POINT1: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + + if(queue.length == 0) + { + if(uiCfg.leveling_first_time) + { + queue.enqueue_one_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_one_P(PSTR("G1 Z10")); + + memset(public_buf_l,0,sizeof(public_buf_l)); + sprintf(public_buf_l, "G1 X%d Y%d",X_MIN_POS+30, Y_MIN_POS+30); + queue.enqueue_one_P(PSTR(public_buf_l)); + queue.enqueue_one_P(PSTR("G1 Z0")); + } + } + break; + case ID_M_POINT2: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(queue.length == 0) + { + if(uiCfg.leveling_first_time) + { + queue.enqueue_one_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_one_P(PSTR("G1 Z10")); + + memset(public_buf_l,0,sizeof(public_buf_l)); + sprintf(public_buf_l, "G1 X%d Y%d",X_MAX_POS-30, Y_MIN_POS+30); + queue.enqueue_one_P(PSTR(public_buf_l)); + queue.enqueue_one_P(PSTR("G1 Z0")); + } + } + break; + case ID_M_POINT3: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(queue.length == 0) + { + if(uiCfg.leveling_first_time) + { + queue.enqueue_one_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_one_P(PSTR("G1 Z10")); + + memset(public_buf_l,0,sizeof(public_buf_l)); + sprintf(public_buf_l, "G1 X%d Y%d",X_MAX_POS-30, Y_MAX_POS-30); + queue.enqueue_one_P(PSTR(public_buf_l)); + queue.enqueue_one_P(PSTR("G1 Z0")); + } + } + + break; + case ID_M_POINT4: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(queue.length == 0) + { + if(uiCfg.leveling_first_time) + { + queue.enqueue_one_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_one_P(PSTR("G1 Z10")); + + memset(public_buf_l,0,sizeof(public_buf_l)); + sprintf(public_buf_l, "G1 X%d Y%d",X_MIN_POS+30, Y_MAX_POS-30); + queue.enqueue_one_P(PSTR(public_buf_l)); + queue.enqueue_one_P(PSTR("G1 Z0")); + } + } + break; + case ID_M_POINT5: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(queue.length == 0) + { + if(uiCfg.leveling_first_time) + { + queue.enqueue_one_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_one_P(PSTR("G1 Z10")); + + memset(public_buf_l,0,sizeof(public_buf_l)); + sprintf(public_buf_l, "G1 X%d Y%d",X_BED_SIZE/2, Y_BED_SIZE/2); + queue.enqueue_one_P(PSTR(public_buf_l)); + queue.enqueue_one_P(PSTR("G1 Z0")); + } + } + + break; + case ID_MANUAL_RETURN: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + lv_clear_manualLevel(); + lv_draw_tool(); + } + break; + + } +} + + +void lv_draw_manualLevel(void) +{ + lv_obj_t *buttonPoint1,*buttonPoint2,*buttonPoint3,*buttonPoint4,*buttonPoint5; + lv_obj_t *buttonBack; + + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != LEVELING_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = LEVELING_UI; + } + disp_state = LEVELING_UI; + + scr = lv_obj_create(NULL, NULL); + + //static lv_style_t tool_style; + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonPoint1 = lv_imgbtn_create(scr, NULL); + buttonPoint2 = lv_imgbtn_create(scr, NULL); + buttonPoint3 = lv_imgbtn_create(scr, NULL); + buttonPoint4 = lv_imgbtn_create(scr, NULL); + buttonPoint5 = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + + lv_obj_set_event_cb_mks(buttonPoint1, event_handler,ID_M_POINT1,"bmp_Leveling1.bin",0); + lv_imgbtn_set_src(buttonPoint1, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPoint1, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPoint1, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPoint1, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonPoint1, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonPoint2, event_handler,ID_M_POINT2,"bmp_Leveling2.bin",0); + lv_imgbtn_set_src(buttonPoint2, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPoint2, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPoint2, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPoint2, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonPoint3, event_handler,ID_M_POINT3,"bmp_Leveling3.bin",0); + lv_imgbtn_set_src(buttonPoint3, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPoint3, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPoint3, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPoint3, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonPoint4, event_handler,ID_M_POINT4,"bmp_Leveling4.bin",0); + lv_imgbtn_set_src(buttonPoint4, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPoint4, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPoint4, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPoint4, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonPoint5, event_handler,ID_M_POINT5,"bmp_Leveling5.bin",0); + lv_imgbtn_set_src(buttonPoint5, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPoint5, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPoint5, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPoint5, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_MANUAL_RETURN,"bmp_Return.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + + lv_obj_set_pos(buttonPoint1,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonPoint2,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); + lv_obj_set_pos(buttonPoint3,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); + lv_obj_set_pos(buttonPoint4,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonPoint5,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonPoint1, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPoint2, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPoint3, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPoint4, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPoint5, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * label_Point1 = lv_label_create(buttonPoint1, NULL); + lv_obj_t * label_Point2 = lv_label_create(buttonPoint2, NULL); + lv_obj_t * label_Point3 = lv_label_create(buttonPoint3, NULL); + lv_obj_t * label_Point4 = lv_label_create(buttonPoint4, NULL); + lv_obj_t * label_Point5 = lv_label_create(buttonPoint5, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if(gCfgItems.multiple_language !=0) + { + lv_label_set_text(label_Point1, leveling_menu.position1); + lv_obj_align(label_Point1, buttonPoint1, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Point2, leveling_menu.position2); + lv_obj_align(label_Point2, buttonPoint2, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Point3, leveling_menu.position3); + lv_obj_align(label_Point3, buttonPoint3, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Point4, leveling_menu.position4); + lv_obj_align(label_Point4, buttonPoint4, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Point5, leveling_menu.position5); + lv_obj_align(label_Point5, buttonPoint5, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } +} + +void lv_clear_manualLevel() +{ + lv_obj_del(scr); +} +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_move_motor.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_move_motor.cpp new file mode 100644 index 000000000000..c92c97d3c548 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_move_motor.cpp @@ -0,0 +1,340 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" +#include "../inc/draw_ui.h" +#include "../../../../../gcode/queue.h" + +static lv_obj_t * scr; + +static lv_obj_t * labelV,*buttonV; + +#define ID_M_X_P 1 +#define ID_M_X_N 2 +#define ID_M_Y_P 3 +#define ID_M_Y_N 4 +#define ID_M_Z_P 5 +#define ID_M_Z_N 6 +#define ID_M_STEP 7 +#define ID_M_RETURN 8 + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + switch(obj->mks_obj_id) + { + case ID_M_X_P: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(queue.length <= (BUFSIZE-3)) + { + memset(public_buf_l,0,sizeof(public_buf_l)); + queue.enqueue_one_P(PSTR("G91")); + sprintf(public_buf_l, "G1 X%3.1f F%d",uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_P(PSTR(public_buf_l)); + queue.enqueue_one_P(PSTR("G90")); + } + } + break; + case ID_M_X_N: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(queue.length <= (BUFSIZE-3)) + { + memset(public_buf_l,0,sizeof(public_buf_l)); + queue.enqueue_one_now(PSTR("G91")); + sprintf(public_buf_l, "G1 X-%3.1f F%d",uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + } + } + break; + case ID_M_Y_P: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(queue.length <= (BUFSIZE-3)) + { + memset(public_buf_l,0,sizeof(public_buf_l)); + queue.enqueue_one_now(PSTR("G91")); + sprintf(public_buf_l, "G1 Y%3.1f F%d",uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + } + } + break; + case ID_M_Y_N: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(queue.length <= (BUFSIZE-3)) + { + memset(public_buf_l,0,sizeof(public_buf_l)); + queue.enqueue_one_now(PSTR("G91")); + sprintf(public_buf_l, "G1 Y-%3.1f F%d",uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + } + } + break; + case ID_M_Z_P: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + if(queue.length <= (BUFSIZE-3)) + { + memset(public_buf_l,0,sizeof(public_buf_l)); + queue.enqueue_one_now(PSTR("G91")); + sprintf(public_buf_l, "G1 Z%3.1f F%d",uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + } + } + break; + case ID_M_Z_N: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + if(queue.length <= (BUFSIZE-3)) + { + memset(public_buf_l,0,sizeof(public_buf_l)); + queue.enqueue_one_now(PSTR("G91")); + sprintf(public_buf_l, "G1 Z-%3.1f F%d",uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + } + } + break; + case ID_M_STEP: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + if(abs(10 * (int)uiCfg.move_dist) == 100) + { + uiCfg.move_dist = 0.1; + } + else + { + uiCfg.move_dist *= (float)10; + } + + disp_move_dist(); + } + + break; + case ID_M_RETURN: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + + } +} + + +void lv_draw_move_motor(void) +{ + lv_obj_t *buttonXI, *buttonXD, *buttonYI, *buttonYD; + lv_obj_t *buttonZI, *buttonZD, *buttonBack; + + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != MOVE_MOTOR_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = MOVE_MOTOR_UI; + } + disp_state = MOVE_MOTOR_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + + /*Create an Image button*/ + buttonXI = lv_imgbtn_create(scr, NULL); + buttonXD = lv_imgbtn_create(scr, NULL); + buttonYI = lv_imgbtn_create(scr, NULL); + buttonYD = lv_imgbtn_create(scr, NULL); + buttonZI = lv_imgbtn_create(scr, NULL); + buttonZD = lv_imgbtn_create(scr, NULL); + buttonV = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonXI, event_handler,ID_M_X_P,"bmp_xAdd.bin",0); + lv_imgbtn_set_src(buttonXI, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonXI, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonXI, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonXI, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonXI, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonXD, event_handler,ID_M_X_N,"bmp_xDec.bin",0); + lv_imgbtn_set_src(buttonXD, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonXD, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonXD, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonXD, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonYI, event_handler,ID_M_Y_P,"bmp_yAdd.bin",0); + lv_imgbtn_set_src(buttonYI, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonYI, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonYI, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonYI, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonYD, event_handler,ID_M_Y_N,"bmp_yDec.bin",0); + lv_imgbtn_set_src(buttonYD, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonYD, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonYD, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonYD, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonZI, event_handler,ID_M_Z_P,"bmp_zAdd.bin",0); + lv_imgbtn_set_src(buttonZI, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonZI, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonZI, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonZI, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonZD, event_handler,ID_M_Z_N,"bmp_zDec.bin",0); + lv_imgbtn_set_src(buttonZD, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonZD, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_REL, &tft_style_lable_rel); + + //lv_obj_set_event_cb_mks(buttonV, event_handler,ID_T_MORE,"bmp_More.bin",0); + lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonV, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonV, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_M_RETURN,"bmp_Return.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + lv_obj_set_pos(buttonXI,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonYI,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); + lv_obj_set_pos(buttonZI,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); + lv_obj_set_pos(buttonV,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonXD,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonYD,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonZD,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonXI, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonXD, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonYI, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonYD, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonZI, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonZD, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonV, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelXI = lv_label_create(buttonXI, NULL); + lv_obj_t * labelXD = lv_label_create(buttonXD, NULL); + lv_obj_t * labelYI = lv_label_create(buttonYI, NULL); + lv_obj_t * labelYD = lv_label_create(buttonYD, NULL); + lv_obj_t * labelZI = lv_label_create(buttonZI, NULL); + lv_obj_t * labelZD = lv_label_create(buttonZD, NULL); + labelV = lv_label_create(buttonV, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if(gCfgItems.multiple_language !=0) + { + lv_label_set_text(labelXI, move_menu.x_add); + lv_obj_align(labelXI, buttonXI, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelXD, move_menu.x_dec); + lv_obj_align(labelXD, buttonXD, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelYI, move_menu.y_add); + lv_obj_align(labelYI, buttonYI, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelYD, move_menu.y_dec); + lv_obj_align(labelYD, buttonYD, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelZI,move_menu.z_add); + lv_obj_align(labelZI, buttonZI, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelZD, move_menu.z_dec); + lv_obj_align(labelZD, buttonZD, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + + disp_move_dist(); +} + +void disp_move_dist() +{ + //char buf[30] = {0}; + + if((int)(10 * uiCfg.move_dist) == 1) + { + lv_obj_set_event_cb_mks(buttonV, event_handler,ID_M_STEP,"bmp_Step_move0_1.bin",0); + } + else if((int)(10 * uiCfg.move_dist) == 10) + { + lv_obj_set_event_cb_mks(buttonV, event_handler,ID_M_STEP,"bmp_Step_move1.bin",0); + } + else if((int)(10 * uiCfg.move_dist) == 100) + { + lv_obj_set_event_cb_mks(buttonV, event_handler,ID_M_STEP,"bmp_Step_move10.bin",0); + } + if(gCfgItems.multiple_language != 0) + { + if((int)(10 * uiCfg.move_dist) == 1) + { + lv_label_set_text(labelV, move_menu.step_01mm); + lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else if((int)(10 * uiCfg.move_dist) == 10) + { + lv_label_set_text(labelV, move_menu.step_1mm); + lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else if((int)(10 * uiCfg.move_dist) == 100) + { + lv_label_set_text(labelV, move_menu.step_10mm); + lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } +} + +void lv_clear_move_motor() +{ + lv_obj_del(scr); +} + +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_opration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_opration.cpp new file mode 100644 index 000000000000..dd9b9e5bd24a --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_opration.cpp @@ -0,0 +1,336 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" +#include "../inc/draw_ui.h" + +static lv_obj_t * scr; + +#define ID_O_PRE_HEAT 1 +#define ID_O_EXTRUCT 2 +#define ID_O_MOV 3 +#define ID_O_FILAMENT 4 +#define ID_O_SPEED 5 +#define ID_O_RETURN 6 +#define ID_O_FAN 7 +#define ID_O_POWER_OFF 8 + +static lv_obj_t *label_PowerOff; +static lv_obj_t *buttonPowerOff; + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + switch(obj->mks_obj_id) + { + case ID_O_PRE_HEAT: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + lv_clear_opration(); + lv_draw_preHeat(); + } + break; + case ID_O_EXTRUCT: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + lv_clear_opration(); + lv_draw_extrusion(); + } + break; + case ID_O_MOV: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + lv_clear_opration(); + lv_draw_move_motor(); + } + break; + case ID_O_FILAMENT: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + + } + break; + case ID_O_FAN: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + lv_clear_opration(); + lv_draw_fan(); + } + break; + case ID_O_SPEED: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + lv_clear_opration(); + lv_draw_change_speed(); + } + break; + case ID_O_RETURN: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + case ID_O_POWER_OFF: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + if(gCfgItems.finish_power_off == 1) + { + gCfgItems.finish_power_off = 0; + lv_obj_set_event_cb_mks(obj, event_handler,ID_O_POWER_OFF,"bmp_Mamual.bin",0); + lv_label_set_text(label_PowerOff, printing_more_menu.manual); + lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_refresh_ext_draw_pad(label_PowerOff); + update_spi_flash(); + } + else + { + gCfgItems.finish_power_off = 1; + lv_obj_set_event_cb_mks(obj, event_handler,ID_O_POWER_OFF,"bmp_Auto.bin",0); + lv_label_set_text(label_PowerOff, printing_more_menu.auto_close); + lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_refresh_ext_draw_pad(label_PowerOff); + update_spi_flash(); + } + } + break; + + } +} + + +void lv_draw_opration(void) +{ + lv_obj_t *buttonPreHeat,*buttonExtrusion,*buttonSpeed; + lv_obj_t *buttonBack,*buttonFan; + lv_obj_t *labelPreHeat,*labelExtrusion; + lv_obj_t *label_Back,*label_Speed,*label_Fan; + lv_obj_t *buttonMove=NULL,*label_Move=NULL; + + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != OPERATE_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = OPERATE_UI; + } + disp_state = OPERATE_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonPreHeat = lv_imgbtn_create(scr, NULL); + buttonExtrusion = lv_imgbtn_create(scr, NULL); + buttonFan = lv_imgbtn_create(scr, NULL); + buttonSpeed = lv_imgbtn_create(scr, NULL); + + + if(uiCfg.print_state != WORKING) + //buttonFilament = lv_imgbtn_create(scr, NULL); + //else + buttonMove = lv_imgbtn_create(scr, NULL); + buttonPowerOff = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + + lv_obj_set_event_cb_mks(buttonPreHeat, event_handler,ID_O_PRE_HEAT,"bmp_PreHeat.bin",0); + lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonPreHeat, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonExtrusion, event_handler,ID_O_EXTRUCT,"bmp_Extruct.bin",0); + lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonFan, event_handler,ID_O_FAN,"bmp_Fan.bin",0); + lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_O_SPEED,"bmp_Speed.bin",0); + lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_REL, &tft_style_lable_rel); + + if(uiCfg.print_state != WORKING) + /*{ + lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_O_FILAMENT,"bmp_Filamentchange.bin",0); + lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_REL, &tft_style_lable_rel); + } + else*/ + { + lv_obj_set_event_cb_mks(buttonMove, event_handler,ID_O_MOV,"bmp_Mov.bin",0); + lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_REL, &tft_style_lable_rel); + } + if(gCfgItems.finish_power_off == 1) + { + lv_obj_set_event_cb_mks(buttonPowerOff, event_handler,ID_O_POWER_OFF,"bmp_Auto.bin",0); + } + else + { + lv_obj_set_event_cb_mks(buttonPowerOff, event_handler,ID_O_POWER_OFF,"bmp_Mamual.bin",0); + } + lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPowerOff, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPowerOff, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_O_RETURN,"bmp_Return.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + + + + #endif + + lv_obj_set_pos(buttonPreHeat,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonExtrusion,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); + + lv_obj_set_pos(buttonFan,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); + lv_obj_set_pos(buttonSpeed,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + + if(uiCfg.print_state != WORKING) + /*{ + lv_obj_set_pos(buttonFilament,INTERVAL_V,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + } + else*/ + { + lv_obj_set_pos(buttonMove,INTERVAL_V,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonPowerOff,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + } + else + { + lv_obj_set_pos(buttonPowerOff,INTERVAL_V,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + } + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonPreHeat, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonExtrusion, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonFan, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonSpeed, LV_LAYOUT_OFF); + + if(uiCfg.print_state != WORKING) + /*{ + lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF); + } + else*/ + { + lv_btn_set_layout(buttonMove, LV_LAYOUT_OFF); + } + lv_btn_set_layout(buttonPowerOff, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + labelPreHeat = lv_label_create(buttonPreHeat, NULL); + labelExtrusion = lv_label_create(buttonExtrusion, NULL); + + label_Fan = lv_label_create(buttonFan, NULL); + label_Speed = lv_label_create(buttonSpeed, NULL); + + if(uiCfg.print_state != WORKING) + /*{ + label_Filament = lv_label_create(buttonFilament, NULL); + } + else*/ + { + label_Move = lv_label_create(buttonMove, NULL); + } + label_PowerOff = lv_label_create(buttonPowerOff, NULL); + + label_Back = lv_label_create(buttonBack, NULL); + + + if(gCfgItems.multiple_language !=0) + { + lv_label_set_text(labelPreHeat, operation_menu.temp); + lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelExtrusion, operation_menu.extr); + lv_obj_align(labelExtrusion, buttonExtrusion, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Fan, operation_menu.fan); + lv_obj_align(label_Fan, buttonFan, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Speed, operation_menu.speed); + lv_obj_align(label_Speed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + if(uiCfg.print_state != WORKING) + /*{ + lv_label_set_text(label_Filament, operation_menu.filament); + lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else*/ + { + lv_label_set_text(label_Move, operation_menu.move); + lv_obj_align(label_Move, buttonMove, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + + if(gCfgItems.finish_power_off == 1) + { + lv_label_set_text(label_PowerOff, printing_more_menu.auto_close); + } + else + { + lv_label_set_text(label_PowerOff, printing_more_menu.manual); + } + lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } +} + +void lv_clear_opration() +{ + lv_obj_del(scr); +} +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_pause_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_pause_message.cpp new file mode 100644 index 000000000000..80c33e73b500 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_pause_message.cpp @@ -0,0 +1,36 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" + +#include "../inc/draw_ui.h" +#if ENABLED(ADVANCED_PAUSE_FEATURE) +#include "../../../../../feature/pause.h" + + +void lv_draw_pause_message(const PauseMessage msg) +{ + switch (msg) { + case PAUSE_MESSAGE_PAUSING: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_PAUSING);break; + case PAUSE_MESSAGE_CHANGING: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_CHANGING);break; + case PAUSE_MESSAGE_UNLOAD: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_UNLOAD);break; + case PAUSE_MESSAGE_WAITING: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_WAITING);break; + case PAUSE_MESSAGE_INSERT: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_INSERT);break; + case PAUSE_MESSAGE_LOAD: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_LOAD);break; + case PAUSE_MESSAGE_PURGE: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_PURGE);break; + case PAUSE_MESSAGE_RESUME: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_RESUME);break; + case PAUSE_MESSAGE_HEAT: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_HEAT);break; + case PAUSE_MESSAGE_HEATING: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_HEATING);break; + case PAUSE_MESSAGE_OPTION: pause_menu_response = PAUSE_RESPONSE_WAIT_FOR; + clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_OPTION);break; + case PAUSE_MESSAGE_STATUS: + default: break; + } +} +#endif + +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_preHeat.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_preHeat.cpp new file mode 100644 index 000000000000..a71eadc0d01b --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_preHeat.cpp @@ -0,0 +1,449 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" +#include "../../../../../../Configuration.h" +#include "../inc/draw_ui.h" +#include "../../../../../module/temperature.h" + +static lv_obj_t * scr; +static lv_obj_t *buttoType,*buttonStep; +static lv_obj_t * labelType; +static lv_obj_t * labelStep; +static lv_obj_t * tempText1; + +#define ID_P_ADD 1 +#define ID_P_DEC 2 +#define ID_P_TYPE 3 +#define ID_P_STEP 4 +#define ID_P_OFF 5 +#define ID_P_RETURN 6 + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + switch(obj->mks_obj_id) + { + case ID_P_ADD: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(uiCfg.curTempType == 0) + { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target += uiCfg.stepHeat; + if(uiCfg.curSprayerChoose == 0) + { + if((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_0_MAXTEMP- (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) + { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); + + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + } + #if !defined(SINGLENOZZLE) && EXTRUDERS >= 2 + else + { + if((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP- (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) + { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); + + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + } + #endif + } + #if HAS_HEATED_BED + else + { + + thermalManager.temp_bed.target += uiCfg.stepHeat; + + if((int)thermalManager.temp_bed.target > BED_MAXTEMP- (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) + { + thermalManager.temp_bed.target = (float)BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1); + thermalManager.start_watching_bed(); + } + + } + #endif + disp_desire_temp(); + } + break; + case ID_P_DEC: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + if(uiCfg.curTempType == 0) + { + if((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > uiCfg.stepHeat) + { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target -= uiCfg.stepHeat; + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + else + { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)0; + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + } + #if HAS_HEATED_BED + else + { + if((int)thermalManager.temp_bed.target > uiCfg.stepHeat) + { + thermalManager.temp_bed.target -= uiCfg.stepHeat; + thermalManager.start_watching_bed(); + } + else + { + thermalManager.temp_bed.target = (float)0; + thermalManager.start_watching_bed(); + } + } + #endif + disp_desire_temp(); + } + + break; + case ID_P_TYPE: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(uiCfg.curTempType == 0) + { + if(EXTRUDERS == 2) + { + if(uiCfg.curSprayerChoose == 0) + { + uiCfg.curSprayerChoose = 1; + } + else if(uiCfg.curSprayerChoose == 1) + { + if(TEMP_SENSOR_BED != 0) + { + uiCfg.curTempType = 1; + } + else + { + uiCfg.curTempType = 0; + uiCfg.curSprayerChoose = 0; + } + } + + } + else + { + if(uiCfg.curSprayerChoose == 0) + { + if(TEMP_SENSOR_BED != 0) + { + uiCfg.curTempType = 1; + } + else + { + uiCfg.curTempType = 0; + } + } + } + + } + else if(uiCfg.curTempType == 1) + { + uiCfg.curSprayerChoose = 0; + uiCfg.curTempType = 0; + } + disp_temp_type(); + } + break; + case ID_P_STEP: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + switch(uiCfg.stepHeat) + { + case 1: + uiCfg.stepHeat = 5; + break; + + case 5: + uiCfg.stepHeat = 10; + break; + + case 10: + uiCfg.stepHeat = 1; + break; + + default: + break; + } + disp_step_heat(); + } + break; + case ID_P_OFF: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + if(uiCfg.curTempType == 0) + { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)0; + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + #if HAS_HEATED_BED + else + { + thermalManager.temp_bed.target = (float)0; + thermalManager.start_watching_bed(); + } + #endif + disp_desire_temp(); + } + break; + case ID_P_RETURN: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + + } +} + + +void lv_draw_preHeat(void) +{ + lv_obj_t *buttonAdd,*buttonDec; + lv_obj_t *buttonOff,*buttonBack; + + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != PRE_HEAT_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = PRE_HEAT_UI; + } + disp_state = PRE_HEAT_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonAdd = lv_imgbtn_create(scr, NULL); + buttonDec = lv_imgbtn_create(scr, NULL); + buttoType = lv_imgbtn_create(scr, NULL); + buttonStep = lv_imgbtn_create(scr, NULL); + buttonOff = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonAdd, event_handler,ID_P_ADD,"bmp_Add.bin",0); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonDec, event_handler,ID_P_DEC,"bmp_Dec.bin",0); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); + + + lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttoType, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttoType, LV_BTN_STATE_REL, &tft_style_lable_rel); + + + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonOff, event_handler,ID_P_OFF,"bmp_Speed0.bin",0); + lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_P_RETURN,"bmp_Return.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + + lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttoType,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonStep,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonOff,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); + lv_btn_set_layout(buttoType, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOff, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); + lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); + labelType = lv_label_create(buttoType, NULL); + labelStep = lv_label_create(buttonStep, NULL); + lv_obj_t * labelOff = lv_label_create(buttonOff, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if(gCfgItems.multiple_language !=0) + { + lv_label_set_text(labelAdd, preheat_menu.add); + lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelDec, preheat_menu.dec); + lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelOff, preheat_menu.off); + lv_obj_align(labelOff, buttonOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + + disp_temp_type(); + disp_step_heat(); + + tempText1 = lv_label_create(scr, NULL); + lv_obj_set_style(tempText1, &tft_style_lable_rel); + disp_desire_temp(); +} + +void disp_temp_type() +{ + + if(uiCfg.curTempType == 0) + { + if(uiCfg.curSprayerChoose == 1) + { + lv_obj_set_event_cb_mks(buttoType, event_handler,ID_P_TYPE,"bmp_Extru2.bin",0); + if(gCfgItems.multiple_language != 0) + { + lv_label_set_text(labelType, preheat_menu.ext2); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } + else + { + lv_obj_set_event_cb_mks(buttoType, event_handler,ID_P_TYPE,"bmp_Extru1.bin",0); + if(gCfgItems.multiple_language != 0) + { + lv_label_set_text(labelType, preheat_menu.ext1); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } + + } + else + { + lv_obj_set_event_cb_mks(buttoType, event_handler,ID_P_TYPE,"bmp_Bed.bin",0); + if(gCfgItems.multiple_language != 0) + { + lv_label_set_text(labelType, preheat_menu.hotbed); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } + +} + +void disp_desire_temp() +{ + char buf[20] = {0}; + + public_buf_l[0] = '\0'; + + if(uiCfg.curTempType == 0) + { + if(uiCfg.curSprayerChoose<1) + { + strcat(public_buf_l,preheat_menu.ext1); + } + else + { + strcat(public_buf_l,preheat_menu.ext2); + } + sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); + + } + #if HAS_HEATED_BED + else + { + strcat(public_buf_l,preheat_menu.hotbed); + + sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target); + } + #endif + strcat(public_buf_l,": "); + strcat(public_buf_l,buf); + lv_label_set_text(tempText1, public_buf_l); + lv_obj_align(tempText1, NULL, LV_ALIGN_CENTER,0, -50); +} + +void disp_step_heat() +{ + if(uiCfg.stepHeat == 1) + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_P_STEP,"bmp_Step1_degree.bin",0); + else if(uiCfg.stepHeat == 5) + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_P_STEP,"bmp_Step5_degree.bin",0); + else if(uiCfg.stepHeat == 10) + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_P_STEP,"bmp_Step10_degree.bin",0); + + if(gCfgItems.multiple_language != 0) + { + if(uiCfg.stepHeat == 1) + { + lv_label_set_text(labelStep, preheat_menu.step_1c); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else if(uiCfg.stepHeat == 5) + { + lv_label_set_text(labelStep, preheat_menu.step_5c); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else if(uiCfg.stepHeat == 10) + { + lv_label_set_text(labelStep, preheat_menu.step_10c); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } +} + +void lv_clear_preHeat() +{ + lv_obj_del(scr); +} +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_print_file.cpp new file mode 100644 index 000000000000..be70d4865c5d --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_print_file.cpp @@ -0,0 +1,701 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" +#include "../inc/draw_ui.h" +#include "../../../../../sd/cardreader.h" + +static lv_obj_t * scr; + +static lv_obj_t *buttonPageUp,*buttonPageDown,*buttonBack,*buttonGcode[FILE_BTN_CNT]; +static lv_obj_t * labelPageUp[FILE_BTN_CNT]; +static lv_obj_t *buttonText[FILE_BTN_CNT]; + +#define ID_P_UP 7 +#define ID_P_DOWN 8 +#define ID_P_RETURN 9 + + +int8_t curDirLever = 0; +LIST_FILE list_file; +DIR_OFFSET dir_offset[10]; + +extern uint8_t public_buf[512]; +extern char public_buf_m[100]; + +uint8_t sel_id=0; +#if ENABLED (SDSUPPORT) +static uint8_t search_file() +{ + int valid_name_cnt=0; + //char tmp[SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; + + list_file.Sd_file_cnt = 0; + //list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + + //root2.rewind(); + //SERIAL_PROTOCOLLN(list_file.curDirPath); + + if(curDirLever != 0)card.cd(list_file.curDirPath); + else card.cdroot();//while(card.cdup()); + + const uint16_t fileCnt = card.get_num_Files(); + + for (uint16_t i = 0; i < fileCnt; i++) { + if(list_file.Sd_file_cnt == list_file.Sd_file_offset){ + const uint16_t nr = + #if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA) + fileCnt - 1 - + #endif + i; + + #if ENABLED(SDCARD_SORT_ALPHA) + card.getfilename_sorted(nr); + #else + card.getfilename_sorted(nr); + #endif + + if (card.flag.filenameIsDir) + { + /*if(card.longFilename[0] == 0) + SERIAL_PROTOCOLLN(card.filename); + else + SERIAL_PROTOCOLLN(card.longFilename);*/ + list_file.IsFolder[valid_name_cnt] = 1; + } + else + { + //SERIAL_PROTOCOLLN(card.longFilename); + list_file.IsFolder[valid_name_cnt] = 0; + } + #if 1 + // + memset(list_file.file_name[valid_name_cnt],0,strlen(list_file.file_name[valid_name_cnt])); + strcpy(list_file.file_name[valid_name_cnt], list_file.curDirPath); + strcat(list_file.file_name[valid_name_cnt], "/"); + strcat(list_file.file_name[valid_name_cnt],card.filename); + // + memset(list_file.long_name[valid_name_cnt],0,strlen(list_file.long_name[valid_name_cnt])); + if(card.longFilename[0] == 0) + strncpy(list_file.long_name[valid_name_cnt],card.filename,strlen(card.filename)); + else + strncpy(list_file.long_name[valid_name_cnt],card.longFilename,strlen(card.longFilename)); + + + valid_name_cnt++; + if (valid_name_cnt == 1) + dir_offset[curDirLever].cur_page_first_offset = list_file.Sd_file_offset; + if(valid_name_cnt >= FILE_NUM) + { + dir_offset[curDirLever].cur_page_last_offset = list_file.Sd_file_offset; + list_file.Sd_file_offset++; + break; + } + list_file.Sd_file_offset++; + #endif + } + list_file.Sd_file_cnt++; + } + //card.closefile(false); + return valid_name_cnt; + +} +#endif + +uint8_t have_pre_pic(char *path) +{ + #if ENABLED (SDSUPPORT) + char *ps1,*ps2; + char *cur_name; + + cur_name=strrchr(path,'/'); + + card.openFileRead(cur_name); + card.read(public_buf, 512); + ps1 = strstr((char *)public_buf,";simage:"); + card.read(public_buf, 512); + ps2 = strstr((char *)public_buf,";simage:"); + if(ps1 || ps2) + { + card.closefile(); + return 1; + } + else + { + card.closefile(); + return 0; + } + #endif +} + + +LV_IMG_DECLARE(bmp_pic_117x92); +LV_IMG_DECLARE(bmp_pic_100x100); +LV_IMG_DECLARE(bmp_pic); +LV_IMG_DECLARE(bmp_pic_100x40); + + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + uint8_t i; + uint8_t file_count; + //switch(obj->mks_obj_id) + //{ + if(obj->mks_obj_id == ID_P_UP) + { + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(dir_offset[curDirLever].curPage > 0) + { + + //2015.05.19 + list_file.Sd_file_cnt = 0; + + if(dir_offset[curDirLever].cur_page_first_offset >= FILE_NUM) + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset - FILE_NUM; + #if ENABLED (SDSUPPORT) + file_count = search_file(); + #endif + if(file_count != 0) + { + dir_offset[curDirLever].curPage--; + lv_obj_del(scr); + disp_gcode_icon(file_count); + } + } + } + } + else if(obj->mks_obj_id == ID_P_DOWN) + { + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + + if(dir_offset[curDirLever].cur_page_last_offset > 0) + { + list_file.Sd_file_cnt = 0; + + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_last_offset + 1; + #if ENABLED (SDSUPPORT) + file_count = search_file(); + #endif + if(file_count != 0) + { + dir_offset[curDirLever].curPage++; + lv_obj_del(scr); + disp_gcode_icon(file_count); + } + if(file_count < FILE_NUM) + { + dir_offset[curDirLever].cur_page_last_offset = 0; + } + } + } + } + else if(obj->mks_obj_id == ID_P_RETURN) + { + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + if(curDirLever > 0) + { + int8_t *ch = 0; + + ch = (int8_t *)strrchr(list_file.curDirPath, '/'); + if(ch != 0) + { + *ch = 0; + #if ENABLED (SDSUPPORT) + card.cdup(); + #endif + dir_offset[curDirLever].curPage = 0; + dir_offset[curDirLever].cur_page_first_offset = 0; + dir_offset[curDirLever].cur_page_last_offset = 0; + curDirLever--; + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + #if ENABLED (SDSUPPORT) + file_count = search_file(); + #endif + lv_obj_del(scr); + disp_gcode_icon(file_count); + } + + } + else + { + lv_obj_del(scr); + lv_draw_ready_print(); + } + } + } + else + { + for(i = 0; i < FILE_BTN_CNT; i++) + { + if(obj->mks_obj_id == (i+1)) + { + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + if(list_file.file_name[i][0] != 0) + { + if(list_file.IsFolder[i] == 1) + { + memset(list_file.curDirPath, 0, sizeof(list_file.curDirPath)); + strcpy(list_file.curDirPath, list_file.file_name[i]); + curDirLever++; + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + #if ENABLED (SDSUPPORT) + file_count = search_file(); + #endif + lv_obj_del(scr); + disp_gcode_icon(file_count); + } + else + { + sel_id = i; + lv_obj_del(scr); + lv_draw_dialog(DIALOG_TYPE_PRINT_FILE); + } + break; + } + } + } + } + } +} + + +void lv_draw_print_file(void) +{ + //uint8_t i; + uint8_t file_count; + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != PRINT_FILE_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINT_FILE_UI; + } + disp_state = PRINT_FILE_UI; + + curDirLever = 0; + dir_offset[curDirLever].curPage = 0; + + list_file.Sd_file_offset = 0; + list_file.Sd_file_cnt = 0; + + memset(dir_offset, 0, sizeof(dir_offset)); + memset(list_file.IsFolder,0,sizeof(list_file.IsFolder)); + memset(list_file.curDirPath, 0, sizeof(list_file.curDirPath)); + + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + #if ENABLED (SDSUPPORT) + card.mount(); + + + file_count = search_file(); + #endif + disp_gcode_icon(file_count); + + + //lv_obj_t * labelPageUp = lv_label_create(buttonPageUp, NULL); + //lv_obj_t * labelPageDown = lv_label_create(buttonPageDown, NULL); + //lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + /*if(gCfgItems.multiple_language !=0) + { + lv_label_set_text(labelPageUp, tool_menu.preheat); + lv_obj_align(labelPageUp, buttonPageUp, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelPageDown, tool_menu.extrude); + lv_obj_align(labelPageDown, buttonPageDown, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + }*/ +} + +void disp_gcode_icon(uint8_t file_num) +{ + uint8_t i; + + scr = lv_obj_create(NULL, NULL); + + //static lv_style_t tool_style; + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + buttonPageUp = lv_imgbtn_create(scr, NULL); + buttonPageDown = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonPageUp, event_handler,ID_P_UP,"bmp_pageUp.bin",0); + lv_imgbtn_set_src(buttonPageUp, LV_BTN_STATE_REL, &bmp_pic_117x92); + lv_imgbtn_set_src(buttonPageUp, LV_BTN_STATE_PR, &bmp_pic_117x92); + lv_imgbtn_set_style(buttonPageUp, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPageUp, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonPageUp, LV_PROTECT_FOLLOW); + + #if 1 + lv_obj_set_event_cb_mks(buttonPageDown, event_handler,ID_P_DOWN,"bmp_pageDown.bin",0); + lv_imgbtn_set_src(buttonPageDown, LV_BTN_STATE_REL, &bmp_pic_117x92); + lv_imgbtn_set_src(buttonPageDown, LV_BTN_STATE_PR, &bmp_pic_117x92); + lv_imgbtn_set_style(buttonPageDown, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPageDown, LV_BTN_STATE_REL, &tft_style_lable_rel); + + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_P_RETURN,"bmp_Back.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic_117x92); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic_117x92); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + + lv_obj_set_pos(buttonPageUp,OTHER_BTN_XPIEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonPageDown,OTHER_BTN_XPIEL*3+INTERVAL_V*4,titleHeight+OTHER_BTN_YPIEL+INTERVAL_H); + lv_obj_set_pos(buttonBack,OTHER_BTN_XPIEL*3+INTERVAL_V*4,titleHeight+OTHER_BTN_YPIEL*2+INTERVAL_H*2); + + /*Create a label on the Image button*/ + + lv_btn_set_layout(buttonPageUp, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPageDown, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + for(i = 0; i < FILE_BTN_CNT; i++) + { + /*if(seq) + { + j = (FILE_BTN_CNT-1) - i; + back_flg = 1; + } + else + { + j = i; + back_flg = 0; + } + + */ + if(i >= file_num) + { + break; + } + + #ifdef TFT35 + buttonGcode[i] = lv_imgbtn_create(scr, NULL); + + lv_imgbtn_set_style(buttonGcode[i], LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonGcode[i], LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonGcode[i], LV_PROTECT_FOLLOW); + lv_btn_set_layout(buttonGcode[i], LV_LAYOUT_OFF); + + memset(public_buf_m,0,sizeof(public_buf_m)); + cutFileName((char *)list_file.long_name[i], 16, 8, (char *)public_buf_m); + + if(list_file.IsFolder[i] == 1) + { + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler,(i+1),"bmp_Dir.bin",0); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic); + if(i < 3) + lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1), titleHeight); + else + lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1), BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + labelPageUp[i] = lv_label_create(buttonGcode[i], NULL); + lv_obj_set_style(labelPageUp[i], &tft_style_lable_rel); + lv_label_set_text(labelPageUp[i], public_buf_m); + lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID,0, -5); + } + else + { + if(have_pre_pic((char *)list_file.file_name[i])) + { + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler,(i+1),list_file.file_name[i],1); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic_100x100); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic_100x100); + if(i < 3) + { + lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1)+FILE_PRE_PIC_X_OFFSET, titleHeight+FILE_PRE_PIC_Y_OFFSET); + buttonText[i] = lv_btn_create(scr, NULL); + //lv_obj_set_event_cb(buttonText[i], event_handler); + + lv_btn_set_style(buttonText[i], LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_btn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_lable_rel); + //lv_obj_set_style(buttonText[i], &tft_style_lable_pre); + //lv_obj_set_style(buttonText[i], &tft_style_lable_rel); + lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); + lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); + //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL,0); + //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_REL, &bmp_pic_100x40); + //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_PR, &bmp_pic_100x40); + lv_obj_set_pos(buttonText[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1)+FILE_PRE_PIC_X_OFFSET, titleHeight+FILE_PRE_PIC_Y_OFFSET+100); + lv_obj_set_size(buttonText[i],100,40); + } + else + { + lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1)+FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL+INTERVAL_H+titleHeight+FILE_PRE_PIC_Y_OFFSET); + buttonText[i] = lv_btn_create(scr, NULL); + //lv_obj_set_event_cb(buttonText[i], event_handler); + + lv_btn_set_style(buttonText[i], LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_btn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_lable_rel); + + //lv_imgbtn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); + lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); + //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL,0); + //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_REL, &bmp_pic_100x40); + //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_PR, &bmp_pic_100x40); + lv_obj_set_pos(buttonText[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1)+FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL+INTERVAL_H+titleHeight+FILE_PRE_PIC_Y_OFFSET+100); + lv_obj_set_size(buttonText[i],100,40); + } + labelPageUp[i] = lv_label_create(buttonText[i], NULL); + lv_obj_set_style(labelPageUp[i], &tft_style_lable_rel); + lv_label_set_text(labelPageUp[i], public_buf_m); + lv_obj_align(labelPageUp[i], buttonText[i], LV_ALIGN_IN_BOTTOM_MID,0, 0); + } + else + { + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler,(i+1),"bmp_File.bin",0); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic); + if(i < 3) + lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1), titleHeight); + else + lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1), BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + labelPageUp[i] = lv_label_create(buttonGcode[i], NULL); + lv_obj_set_style(labelPageUp[i], &tft_style_lable_rel); + lv_label_set_text(labelPageUp[i], public_buf_m); + lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID,0, -5); + } + } + + + #else + + #endif + } +} + +void lv_open_gcode_file(char *path) +{ + #if ENABLED (SDSUPPORT) + //uint32_t read; + uint32_t *ps4; + int pre_sread_cnt; + char *cur_name; + + cur_name=strrchr(path,'/'); + + card.openFileRead(cur_name); + card.read(public_buf, 512); + ps4 = (uint32_t *)strstr((char *)public_buf,";simage:"); + + if(ps4) + { + pre_sread_cnt = (uint32_t)ps4-(uint32_t)((uint32_t *)(&public_buf[0])); + card.setIndex(pre_sread_cnt+8); + } + #endif +} + +int ascii2dec_test(char *ascii) +{ + int result = 0; + + if(ascii == 0) + return 0; + + if(*(ascii) >= '0' && *(ascii) <= '9') + result = *(ascii) - '0'; + else if(*(ascii) >= 'a' && *(ascii) <= 'f') + result = *(ascii) - 'a' + 0x0a; + else if(*(ascii) >= 'A' && *(ascii) <= 'F') + result = *(ascii) - 'A' + 0x0a; + else + return 0; + + + return result; +} + +void lv_gcode_file_read(uint8_t *data_buf) +{ + #if ENABLED (SDSUPPORT) + uint16_t i=0,j=0,k=0; + //uint32_t read; + uint16_t row_1=0; + char temp_test[200]; + + while(1) + { + card.read(temp_test, 200); + for(i=0;i<200;) + { + public_buf[row_1*200+100*k+j] = (char)(ascii2dec_test(&temp_test[i])<<4|ascii2dec_test(&temp_test[i+1])); + j++; + i+=2; + } + k++; + j=0; + if(k*100>=200) + { + k=0; + card.read(temp_test, 9); + break; + } + } + memcpy(data_buf,public_buf,200); + #endif +} + +void lv_close_gcode_file() +{ + #if ENABLED (SDSUPPORT) + card.closefile(); + #endif +} + +void cutFileName(char *path, int len, int bytePerLine, char *outStr) +{ + #if _LFN_UNICODE + TCHAR *tmpFile; + TCHAR *strIndex1 = 0, *strIndex2 = 0, *beginIndex; + TCHAR secSeg[10] = {0}; + TCHAR gFileTail[4] = {'~', '.', 'g', '\0'}; + #else + char *tmpFile; + char *strIndex1 = 0, *strIndex2 = 0, *beginIndex; + char secSeg[10] = {0}; + #endif + + if(path == 0 || len <= 3 || outStr == 0) + { + return; + } + + tmpFile = path; + #if _LFN_UNICODE + strIndex1 = (WCHAR *)wcsstr((const WCHAR *)tmpFile, (const WCHAR *)'/'); + strIndex2 = (WCHAR *)wcsstr((const WCHAR *)tmpFile, (const WCHAR *)'.'); + #else + strIndex1 = (char *)strrchr(tmpFile, '/'); + strIndex2 = (char *)strrchr(tmpFile, '.'); + #endif + + if(strIndex1 != 0) + { + beginIndex = strIndex1 + 1; + } + /*if((strIndex1 != 0) && (strIndex2 != 0) && (strIndex1 < strIndex2)) + { + beginIndex = strIndex1 + 1; + }*/ + else + { + beginIndex = tmpFile; + } + + if(strIndex2 == 0 || (strIndex1 > strIndex2)) //not gcode file + { + #if _LFN_UNICODE + if(wcslen(beginIndex) > len) + { + wcsncpy(outStr, beginIndex, len); + + } + else + { + wcscpy(outStr, beginIndex); + } + #else + if((int)strlen(beginIndex) > len) + { + strncpy(outStr, beginIndex, len); + + } + else + { + strcpy(outStr, beginIndex); + } + #endif + } + else //gcode file + { + if(strIndex2 - beginIndex > (len - 2)) + { + #if _LFN_UNICODE + wcsncpy(outStr, (const WCHAR *)beginIndex, len - 3); + wcscat(outStr, (const WCHAR *)gFileTail); + #else + //strncpy(outStr, beginIndex, len - 3); + strncpy(outStr, beginIndex, len - 4); + strcat(outStr, "~.g"); + #endif + + } + else + { + #if _LFN_UNICODE + wcsncpy(outStr, (const WCHAR *)beginIndex, strIndex2 - beginIndex + 1); + wcscat(outStr, (const WCHAR *)&gFileTail[3]); + #else + strncpy(outStr, beginIndex, strIndex2 - beginIndex + 1); + strcat(outStr, "g"); + #endif + } + + } + #if _LFN_UNICODE + if(wcslen(outStr) > bytePerLine) + { + + wcscpy(secSeg, (const WCHAR *)&outStr[bytePerLine]); + outStr[bytePerLine] = '\n'; + outStr[bytePerLine + 1] = '\0'; + wcscat(outStr, (const WCHAR *)secSeg); + + } + #else + if((int)strlen(outStr) > bytePerLine) + { + + strcpy(secSeg, &outStr[bytePerLine]); + outStr[bytePerLine] = '\n'; + outStr[bytePerLine + 1] = '\0'; + strcat(outStr, secSeg); + + } + else + { + strcat(outStr,"\n"); + } + #endif +} + +void lv_clear_print_file() +{ + lv_obj_del(scr); +} + +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_printing.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_printing.cpp new file mode 100644 index 000000000000..82d5b81db64f --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_printing.cpp @@ -0,0 +1,453 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +//#include "../../MarlinCore.h" +#include "../inc/draw_ui.h" +#include "../../../../../module/temperature.h" +#include "../../../../../module/motion.h" +#include "../../../../../sd/cardreader.h" +#include "../../../../../gcode/queue.h" +#if ENABLED(POWER_LOSS_RECOVERY) +#include "../../../../../feature/powerloss.h" +#endif + +static lv_obj_t * scr; +static lv_obj_t * labelExt1,* labelExt2,* labelFan,* labelZpos,* labelTime; +static lv_obj_t * labelPause,* labelStop,* labelOperat; +static lv_obj_t * bar1; +static lv_obj_t * buttonPause,*buttonOperat,*buttonStop; +#if HAS_HEATED_BED +static lv_obj_t* labelBed; +#endif + +#define ID_PAUSE 1 +#define ID_STOP 2 +#define ID_OPTION 3 + +lv_style_t lv_bar_style_indic; + +uint8_t once_flag = 0; +extern uint32_t To_pre_view; +extern uint8_t flash_preview_begin; +extern uint8_t default_preview_flg; +extern uint8_t gcode_preview_over; + + + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + switch(obj->mks_obj_id) + { + case ID_PAUSE: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + if(gcode_preview_over != 1) + { + if(uiCfg.print_state == WORKING) + { + //#if ENABLED(PARK_HEAD_ON_PAUSE) + //queue.inject_P(PSTR("M25 P\nM24")); + #if ENABLED(SDSUPPORT) + //queue.inject_P(PSTR("M25\nG91\nG1 Z10\nG90")); + card.pauseSDPrint(); + stop_print_time(); + uiCfg.print_state = PAUSING; + + #endif + + lv_obj_set_event_cb_mks(buttonPause, event_handler,ID_PAUSE,"bmp_Pause.bin",0); + lv_label_set_text(labelPause, printing_menu.resume); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER,30, 0); + } + else if(uiCfg.print_state == PAUSED) + { + uiCfg.print_state = RESUMING; + + //if (IS_SD_PAUSED())queue.inject_P(PSTR("M24"));// queue.inject_P(M24_STR); + + lv_obj_set_event_cb_mks(obj, event_handler,ID_PAUSE,"bmp_Resume.bin",0); + lv_label_set_text(labelPause, printing_menu.pause); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER,30, 0); + } + #if ENABLED(POWER_LOSS_RECOVERY) + else if(uiCfg.print_state == REPRINTING) + { + uiCfg.print_state = REPRINTED; + lv_obj_set_event_cb_mks(obj, event_handler,ID_PAUSE,"bmp_Resume.bin",0); + lv_label_set_text(labelPause, printing_menu.pause); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER,30, 0); + //recovery.resume(); + print_time.minutes = recovery.info.print_job_elapsed / 60; + print_time.seconds = recovery.info.print_job_elapsed % 60; + print_time.hours = print_time.minutes / 60; + } + #endif + } + } + break; + + case ID_STOP: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + if(gcode_preview_over != 1) + { + lv_obj_del(scr); + lv_draw_dialog(DIALOG_TYPE_STOP); + } + } + break; + case ID_OPTION: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + if(gcode_preview_over != 1) + { + lv_obj_del(scr); + lv_draw_opration(); + } + } + break; + + } +} + + +void lv_draw_printing(void) +{ + lv_obj_t *buttonExt1,*buttonExt2,*buttonFanstate; + lv_obj_t *buttonZpos,*buttonTime; + #if HAS_HEATED_BED + lv_obj_t *buttonBedstate; + #endif + + disp_state_stack._disp_index = 0; + memset(disp_state_stack._disp_state, 0, sizeof(disp_state_stack._disp_state)); + disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINTING_UI; + + disp_state = PRINTING_UI; + + scr = lv_obj_create(NULL, NULL); + + //static lv_style_t tool_style; + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic_150x80); + LV_IMG_DECLARE(bmp_pic_45x45); + + + /*Create an Image button*/ + buttonExt1 = lv_imgbtn_create(scr, NULL); + if(EXTRUDERS == 2) + buttonExt2 = lv_imgbtn_create(scr, NULL); + #if HAS_HEATED_BED + buttonBedstate = lv_imgbtn_create(scr, NULL); + #endif + buttonFanstate = lv_imgbtn_create(scr, NULL); + buttonZpos = lv_imgbtn_create(scr, NULL); + buttonPause = lv_imgbtn_create(scr, NULL); + buttonStop = lv_imgbtn_create(scr, NULL); + buttonOperat = lv_imgbtn_create(scr, NULL); + buttonTime = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonExt1, event_handler,0,"bmp_Ext1_state.bin",0); + lv_imgbtn_set_src(buttonExt1, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonExt1, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonExt1, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonExt1, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonExt1, LV_PROTECT_FOLLOW); + #if 1 + if(EXTRUDERS == 2) + { + lv_obj_set_event_cb_mks(buttonExt2, event_handler,0,"bmp_Ext2_state.bin",0); + lv_imgbtn_set_src(buttonExt2, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonExt2, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonExt2, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonExt2, LV_BTN_STATE_REL, &tft_style_lable_rel); + } + #if HAS_HEATED_BED + lv_obj_set_event_cb_mks(buttonBedstate, event_handler,0,"bmp_Bed_state.bin",0); + lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonBedstate, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBedstate, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif + lv_obj_set_event_cb_mks(buttonFanstate, event_handler,0,"bmp_Fan_state.bin",0); + lv_imgbtn_set_src(buttonFanstate, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonFanstate, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonFanstate, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonFanstate, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonTime, event_handler,0,"bmp_Time_state.bin",0); + lv_imgbtn_set_src(buttonTime, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonTime, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonTime, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonTime, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonZpos, event_handler,0,"bmp_Zpos_state.bin",0); + lv_imgbtn_set_src(buttonZpos, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonZpos, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonZpos, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonZpos, LV_BTN_STATE_REL, &tft_style_lable_rel); + if(uiCfg.print_state == WORKING) + lv_obj_set_event_cb_mks(buttonPause, event_handler,ID_PAUSE,"bmp_Resume.bin",0); + else + lv_obj_set_event_cb_mks(buttonPause, event_handler,ID_PAUSE,"bmp_Pause.bin",0); + lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_REL, &bmp_pic_150x80); + lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_PR, &bmp_pic_150x80); + lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonStop, event_handler,ID_STOP,"bmp_Stop.bin",0); + lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_REL, &bmp_pic_150x80); + lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_PR, &bmp_pic_150x80); + lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonOperat, event_handler,ID_OPTION,"bmp_Operate.bin",0); + lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_REL, &bmp_pic_150x80); + lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_PR, &bmp_pic_150x80); + lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + + lv_obj_set_pos(buttonExt1,205,136); + if(EXTRUDERS == 2) + lv_obj_set_pos(buttonExt2,350,136); + #if HAS_HEATED_BED + lv_obj_set_pos(buttonBedstate,205,186); + #endif + lv_obj_set_pos(buttonFanstate,350,186); + lv_obj_set_pos(buttonTime,205,86); + lv_obj_set_pos(buttonZpos,350,86); + lv_obj_set_pos(buttonPause,5,240); + lv_obj_set_pos(buttonStop,165,240); + lv_obj_set_pos(buttonOperat,325,240); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonExt1, LV_LAYOUT_OFF); + if(EXTRUDERS == 2) + lv_btn_set_layout(buttonExt2, LV_LAYOUT_OFF); + #if HAS_HEATED_BED + lv_btn_set_layout(buttonBedstate, LV_LAYOUT_OFF); + #endif + lv_btn_set_layout(buttonFanstate, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonZpos, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPause, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonStop, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOperat, LV_LAYOUT_OFF); + + labelExt1 = lv_label_create(scr, NULL); + lv_obj_set_style(labelExt1, &tft_style_lable_rel); + lv_obj_set_pos(labelExt1,250,146); + if(EXTRUDERS == 2) + { + labelExt2 = lv_label_create(scr, NULL); + lv_obj_set_style(labelExt2, &tft_style_lable_rel); + lv_obj_set_pos(labelExt2,395,146); + } + #if HAS_HEATED_BED + labelBed = lv_label_create(scr, NULL); + lv_obj_set_style(labelBed, &tft_style_lable_rel); + lv_obj_set_pos(labelBed,250,196); + #endif + + labelFan = lv_label_create(scr, NULL); + lv_obj_set_style(labelFan, &tft_style_lable_rel); + lv_obj_set_pos(labelFan,395,196); + + labelZpos = lv_label_create(scr, NULL); + lv_obj_set_style(labelZpos, &tft_style_lable_rel); + lv_obj_set_pos(labelZpos,395,96); + + labelTime = lv_label_create(scr, NULL); + lv_obj_set_style(labelTime, &tft_style_lable_rel); + lv_obj_set_pos(labelTime,250,96); + + labelPause = lv_label_create(buttonPause, NULL); + labelStop = lv_label_create(buttonStop, NULL); + labelOperat = lv_label_create(buttonOperat, NULL); + + + if(gCfgItems.multiple_language !=0) + { + if(uiCfg.print_state == WORKING) + { + lv_label_set_text(labelPause, printing_menu.pause); + } + else + { + lv_label_set_text(labelPause, printing_menu.resume); + } + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER,30, 0); + + lv_label_set_text(labelStop, printing_menu.stop); + lv_obj_align(labelStop, buttonStop, LV_ALIGN_CENTER,30, 0); + + lv_label_set_text(labelOperat, printing_menu.option); + lv_obj_align(labelOperat, buttonOperat, LV_ALIGN_CENTER,30, 0); + } + + lv_style_copy(&lv_bar_style_indic, &lv_style_pretty_color); + lv_bar_style_indic.text.color = lv_color_hex3(0xADF); + lv_bar_style_indic.image.color = lv_color_hex3(0xADF); + lv_bar_style_indic.line.color = lv_color_hex3(0xADF); + 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); + bar1 = lv_bar_create(scr, NULL); + lv_obj_set_pos(bar1, 205, 36); + lv_obj_set_size(bar1, 270, 40); + lv_bar_set_style(bar1, LV_BAR_STYLE_INDIC, &lv_bar_style_indic); + lv_bar_set_anim_time(bar1, 1000); + lv_bar_set_value(bar1, 0, LV_ANIM_ON); + + disp_ext_temp(); + disp_bed_temp(); + disp_fan_speed(); + disp_print_time(); + disp_fan_Zpos(); + +} + +void disp_ext_temp() +{ + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target); + lv_label_set_text(labelExt1, public_buf_l); + + if(EXTRUDERS == 2) + { + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[1].celsius, (int)thermalManager.temp_hotend[1].target); + lv_label_set_text(labelExt2, public_buf_l); + } +} + +void disp_bed_temp() +{ + #if HAS_HEATED_BED + memset(public_buf_l,0,sizeof(public_buf_l)); + sprintf(public_buf_l,printing_menu.bed_temp,(int)thermalManager.temp_bed.celsius,(int)thermalManager.temp_bed.target); + lv_label_set_text(labelBed, public_buf_l); + #endif +} + +void disp_fan_speed() +{ + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, "%3d", thermalManager.fan_speed[0]); + lv_label_set_text(labelFan, public_buf_l); +} + +void disp_print_time() +{ + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, "%d%d:%d%d:%d%d", print_time.hours/10, print_time.hours%10, print_time.minutes/10, print_time.minutes%10, print_time.seconds/10, print_time.seconds%10); + lv_label_set_text(labelTime, public_buf_l); +} + +void disp_fan_Zpos() +{ + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l,"%.3f",current_position[Z_AXIS]); + lv_label_set_text(labelZpos, public_buf_l); +} + +void reset_print_time() +{ + //print_time.days = 0; + print_time.hours = 0; + print_time.minutes = 0; + print_time.seconds = 0; + print_time.ms_10 = 0; + //print_time.start = 1; +} + +void start_print_time() +{ + print_time.start = 1; +} + +void stop_print_time() +{ + print_time.start = 0; +} + +void setProBarRate() +{ + int rate; + volatile long long rate_tmp_r; + + if(gCfgItems.from_flash_pic != 1) + { + #if ENABLED (SDSUPPORT) + rate_tmp_r =(long long)card.getIndex() * 100; + #endif + rate = rate_tmp_r / gCfgItems.curFilesize; + } + else + { + #if ENABLED (SDSUPPORT) + rate_tmp_r =(long long)card.getIndex(); + #endif + rate = (rate_tmp_r-(PREVIEW_SIZE+To_pre_view))* 100 / (gCfgItems.curFilesize-(PREVIEW_SIZE+To_pre_view)); + } + //gCurFileState.totalSend = rate; + + if(rate <= 0) + return; + + if(disp_state == PRINTING_UI) + { + lv_bar_set_value(bar1, rate, LV_ANIM_ON); + + if(marlin_state == MF_SD_COMPLETE) + { + if(once_flag == 0) + { + stop_print_time(); + + flash_preview_begin = 0; + default_preview_flg = 0; + lv_clear_printing(); + lv_draw_dialog(DIALOG_TYPE_FINISH_PRINT); + + once_flag = 1; + + #if HAS_SUICIDE + if(gCfgItems.finish_power_off == 1) + suicide(); + #endif + } + } + + } +} + +void lv_clear_printing() +{ + lv_obj_del(scr); +} + +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_ready_print.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_ready_print.cpp new file mode 100644 index 000000000000..0428c98f1ec8 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_ready_print.cpp @@ -0,0 +1,314 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "../inc/draw_ready_print.h" +#include "../inc/draw_tool.h" +#include "lv_conf.h" +#include "lvgl.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +#include "../../../../../module/temperature.h" +#include "../inc/tft_lvgl_configuration.h" +#include "stdio.h" +#include "../inc/mks_hardware_test.h" +#include "../inc/draw_ui.h" + + +//static lv_obj_t *buttonPrint,*buttonTool,*buttonSet; +static lv_obj_t * scr; +#if ENABLED(MKS_TEST) +uint8_t curent_disp_ui = 0; +#endif + +#define ID_TOOL 1 +#define ID_SET 2 +#define ID_PRINT 3 + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + switch(obj->mks_obj_id) + { + case ID_TOOL: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + #if ENABLED(MKS_TEST) + curent_disp_ui = 2; + #endif + lv_obj_del(scr); + lv_draw_tool(); + } + break; + case ID_SET: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_set(); + } + break; + case ID_PRINT: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_print_file(); + } + break; + + + } +} + + +#if ENABLED(MKS_TEST) +lv_obj_t *limit_info,*det_info; +lv_style_t limit_style,det_style; +void disp_Limit_ok() +{ + limit_style.text.color.full = 0xFFFF; + lv_obj_set_style(limit_info, &limit_style); + lv_label_set_text(limit_info, "Limit:ok"); +} +void disp_Limit_error() +{ + limit_style.text.color.full = 0xF800; + lv_obj_set_style(limit_info, &limit_style); + lv_label_set_text(limit_info, "Limit:error"); +} + +void disp_det_ok() +{ + det_style.text.color.full = 0xFFFF; + lv_obj_set_style(det_info, &det_style); + lv_label_set_text(det_info, "det:ok"); +} +void disp_det_error() +{ + det_style.text.color.full = 0xF800; + lv_obj_set_style(det_info, &det_style); + lv_label_set_text(det_info, "det:error"); +} + +lv_obj_t *e1,*e2,*e3,*bed; +void disp_test() +{ + char buf[30]={0}; + //lv_obj_t * label_tool2 = lv_label_create(scr, NULL); + //lv_obj_set_pos(label_tool,20,50); + memset(buf,0,sizeof(buf)); + sprintf(buf,"e1:%d",(int)thermalManager.temp_hotend[0].celsius); + lv_label_set_text(e1, buf); + + memset(buf,0,sizeof(buf)); + sprintf(buf,"e2:%d",(int)thermalManager.temp_hotend[1].celsius); + lv_label_set_text(e2, buf); + + memset(buf,0,sizeof(buf)); + sprintf(buf,"e3:%d",(int)thermalManager.temp_hotend[2].celsius); + lv_label_set_text(e3, buf); + + memset(buf,0,sizeof(buf)); + sprintf(buf,"bed:%d",(int)thermalManager.temp_bed.celsius); + lv_label_set_text(bed, buf); +} +#endif + +void lv_draw_ready_print(void) +{ + #if ENABLED(MKS_TEST) + char buf[30]={0}; + lv_obj_t *buttonTool; + + static lv_style_t style_pr,style_rel; + + curent_disp_ui = 1; + + scr = lv_obj_create(NULL, NULL); + + static lv_style_t ready_style; + + lv_style_copy(&ready_style, &lv_style_scr); + //ready_style.body.main_color.full = 0X18C3; + //ready_style.body.grad_color.full = 0X18C3; + ready_style.body.main_color.full = 0X0000; + ready_style.body.grad_color.full = 0X0000; + ready_style.text.color.full = 0Xffff; + lv_obj_set_style(scr, &ready_style); + lv_scr_load(scr); + lv_obj_clean(scr); + //lv_obj_set_hidden(scr,true); + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + //LV_IMG_DECLARE(bmp_pic2); + //LV_IMG_DECLARE(bmp_pic3); + + //scr = lv_obj_create(NULL, NULL); + //lv_scr_load(scr); + + /*Create an Image button*/ + buttonTool = lv_imgbtn_create(scr, NULL); + + //lv_btn_setting(&style_pr,0x5d8f16,0x5d8f16); + //lv_btn_setting(&style_rel,0x5d8f16,0x5d8f16); + + lv_obj_set_event_cb_mks(buttonTool, event_handler,3,"bmp_Tool.bin",0); + //lv_imgbtn_set_src_mks(buttonTool, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_tool.bin"); + lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_PR, &style_pr); + lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_REL, &style_rel); + + + + lv_obj_set_pos(buttonTool,360,180); + + + lv_btn_set_layout(buttonTool, LV_LAYOUT_OFF); + + + lv_obj_t * label_tool = lv_label_create(buttonTool, NULL); + + lv_obj_set_pos(label_tool,30,100); + lv_label_set_text(label_tool, "Back"); + + e1 = lv_label_create(scr, NULL); + lv_obj_set_pos(e1,20,20); + sprintf(buf,"e1: %d",(int)thermalManager.temp_hotend[0].celsius); + lv_label_set_text(e1, buf); + + e2 = lv_label_create(scr, NULL); + lv_obj_set_pos(e2,20,45); + sprintf(buf,"e1: %d",(int)thermalManager.temp_hotend[1].celsius); + lv_label_set_text(e2, buf); + + e3 = lv_label_create(scr, NULL); + lv_obj_set_pos(e3,20,70); + sprintf(buf,"e1: %d",(int)thermalManager.temp_hotend[2].celsius); + lv_label_set_text(e3, buf); + + bed = lv_label_create(scr, NULL); + lv_obj_set_pos(bed,20,95); + sprintf(buf,"bed: %d",(int)thermalManager.temp_bed.celsius); + lv_label_set_text(bed, buf); + + limit_info = lv_label_create(scr, NULL); + + lv_style_copy(&limit_style, &lv_style_scr); + limit_style.body.main_color.full = 0X0000; + limit_style.body.grad_color.full = 0X0000; + limit_style.text.color.full = 0Xffff; + lv_obj_set_style(limit_info, &limit_style); + + lv_obj_set_pos(limit_info,20,120); + lv_label_set_text(limit_info, " "); + + det_info = lv_label_create(scr, NULL); + + lv_style_copy(&det_style, &lv_style_scr); + det_style.body.main_color.full = 0X0000; + det_style.body.grad_color.full = 0X0000; + det_style.text.color.full = 0Xffff; + lv_obj_set_style(det_info, &det_style); + + lv_obj_set_pos(det_info,20,145); + lv_label_set_text(det_info, " "); + + #else + lv_obj_t *buttonPrint,*buttonTool,*buttonSet; + + disp_state_stack._disp_index = 0; + memset(disp_state_stack._disp_state, 0, sizeof(disp_state_stack._disp_state)); + disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINT_READY_UI; + + disp_state = PRINT_READY_UI; + + scr = lv_obj_create(NULL, NULL); + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + //lv_obj_set_hidden(scr,true); + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + //lv_obj_t * title = lv_label_create(scr, NULL); + //lv_obj_set_style(title, &tft_style_lable_rel); + //lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + //lv_label_set_text(title, creat_title_text()); + + /*Create an Image button*/ + buttonPrint = lv_imgbtn_create(scr, NULL); + buttonTool = lv_imgbtn_create(scr, NULL); + buttonSet = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonPrint, event_handler,ID_PRINT,"bmp_Print.bin",0); + //lv_imgbtn_set_src_mks(buttonPrint, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_printing.bin"); + lv_imgbtn_set_src(buttonPrint, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPrint, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPrint, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPrint, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonPrint, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonSet, event_handler,ID_SET,"bmp_Set.bin",0); + //lv_imgbtn_set_src_mks(buttonSet, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_set.bin"); + lv_imgbtn_set_src(buttonSet, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonSet, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonSet, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonSet, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonTool, event_handler,ID_TOOL,"bmp_Tool.bin",0); + //lv_imgbtn_set_src_mks(buttonTool, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_tool.bin"); + lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + lv_obj_set_pos(buttonTool,20,90); + lv_obj_set_pos(buttonSet,180,90); + lv_obj_set_pos(buttonPrint,340,90); + + //lv_obj_set_pos(buttonTool,SIMPLE_FIRST_PAGE_GRAP+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + //lv_obj_set_pos(buttonSet,BTN_X_PIXEL+SIMPLE_FIRST_PAGE_GRAP*2+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + //lv_obj_set_pos(buttonPrint,BTN_X_PIXEL*2+SIMPLE_FIRST_PAGE_GRAP*3+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonPrint, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonSet, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonTool, LV_LAYOUT_OFF); + + lv_obj_t * label_print = lv_label_create(buttonPrint, NULL); + lv_obj_t * label_set = lv_label_create(buttonSet, NULL); + lv_obj_t * label_tool = lv_label_create(buttonTool, NULL); + if(gCfgItems.multiple_language !=0) + { + + lv_label_set_text(label_print, main_menu.print); + lv_obj_align(label_print, buttonPrint, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_set, main_menu.set); + lv_obj_align(label_set, buttonSet, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_style(label_tool,LV_BTN_STATE_PR,&tft_style_lable_pre); + //lv_label_set_style(label_tool,LV_BTN_STATE_REL,&tft_style_lable_rel); + lv_label_set_text(label_tool, main_menu.tool); + lv_obj_align(label_tool, buttonTool, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + + #endif +} + + +void lv_clear_ready_print() +{ + lv_obj_del(scr); +} + +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_set.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_set.cpp new file mode 100644 index 000000000000..1879ba5b41b8 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_set.cpp @@ -0,0 +1,246 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "../inc/draw_ready_print.h" +#include "../inc/draw_set.h" +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +#include "../inc/draw_ui.h" +#include "../../../../../gcode/queue.h" + +static lv_obj_t * scr; + +#define ID_S_WIFI 1 +#define ID_S_FAN 2 +#define ID_S_ABOUT 3 +#define ID_S_CONTINUE 4 +#define ID_S_MOTOR_OFF 5 +#define ID_S_LANGUAGE 6 +#define ID_S_RETURN 7 + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + switch(obj->mks_obj_id) + { + case ID_S_WIFI: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + + } + break; + case ID_S_FAN: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_fan(); + } + break; + case ID_S_ABOUT: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_about(); + } + break; + case ID_S_CONTINUE: + + break; + case ID_S_MOTOR_OFF: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + #if HAS_SUICIDE + suicide(); + #else + queue.enqueue_one_now(PSTR("M84")); + #endif + } + break; + case ID_S_LANGUAGE: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_language(); + } + break; + case ID_S_RETURN: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_ready_print(); + } + break; + + } +} + + +void lv_draw_set(void) +{ + lv_obj_t *buttonFan,*buttonAbout; + lv_obj_t *buMotorOff,*buttonLanguage,*buttonBack; + + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != SET_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = SET_UI; + } + disp_state = SET_UI; + + scr = lv_obj_create(NULL, NULL); + + //static lv_style_t tool_style; + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + //buttonWifi = lv_imgbtn_create(scr, NULL); + buttonFan = lv_imgbtn_create(scr, NULL); + buttonAbout = lv_imgbtn_create(scr, NULL); + //buttonContinue = lv_imgbtn_create(scr, NULL); + buMotorOff = lv_imgbtn_create(scr, NULL); + buttonLanguage = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + + //lv_obj_set_event_cb_mks(buttonWifi, event_handler,ID_S_WIFI,"bmp_Wifi.bin",0); + //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_PR, &tft_style_lable_pre); + //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_REL, &tft_style_lable_rel); + //lv_obj_clear_protect(buttonWifi, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonFan, event_handler,ID_S_FAN,"bmp_Fan.bin",0); + lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonAbout, event_handler,ID_S_ABOUT,"bmp_About.bin",0); + lv_imgbtn_set_src(buttonAbout, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonAbout, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonAbout, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonAbout, LV_BTN_STATE_REL, &tft_style_lable_rel); + + //lv_obj_set_event_cb_mks(buttonContinue, event_handler,ID_S_CONTINUE,"bmp_Breakpoint.bin",0); + //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_PR, &tft_style_lable_pre); + //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_REL, &tft_style_lable_rel); + #if HAS_SUICIDE + lv_obj_set_event_cb_mks(buMotorOff, event_handler,ID_S_MOTOR_OFF,"bmp_Mamual.bin",0); + #else + lv_obj_set_event_cb_mks(buMotorOff, event_handler,ID_S_MOTOR_OFF,"bmp_Motor_off.bin",0); + #endif + lv_imgbtn_set_src(buMotorOff, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buMotorOff, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buMotorOff, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buMotorOff, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonLanguage, event_handler,ID_S_LANGUAGE,"bmp_Language.bin",0); + lv_imgbtn_set_src(buttonLanguage, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonLanguage, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonLanguage, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonLanguage, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_S_RETURN,"bmp_Return.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + + /*lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonFan,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); + lv_obj_set_pos(buttonAbout,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); + lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buMotorOff,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonLanguage,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight);*/ + + //lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonFan,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); + lv_obj_set_pos(buttonAbout,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); + //lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buMotorOff,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonLanguage,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + /*Create a label on the Image button*/ + //lv_btn_set_layout(buttonWifi, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonFan, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonAbout, LV_LAYOUT_OFF); + //lv_btn_set_layout(buttonContinue, LV_LAYOUT_OFF); + lv_btn_set_layout(buMotorOff, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonLanguage, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + //lv_obj_t * labelWifi= lv_label_create(buttonWifi, NULL); + lv_obj_t * labelFan = lv_label_create(buttonFan, NULL); + lv_obj_t * label_About = lv_label_create(buttonAbout, NULL); + //lv_obj_t * label_Continue = lv_label_create(buttonContinue, NULL); + lv_obj_t * label_MotorOff = lv_label_create(buMotorOff, NULL); + lv_obj_t * label_Language = lv_label_create(buttonLanguage, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if(gCfgItems.multiple_language !=0) + { + //lv_label_set_text(labelWifi, set_menu.wifi); + //lv_obj_align(labelWifi, buttonWifi, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelFan, set_menu.fan); + lv_obj_align(labelFan, buttonFan, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_About,set_menu.about); + lv_obj_align(label_About, buttonAbout, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_text(label_Continue, set_menu.breakpoint); + //lv_obj_align(label_Continue, buttonContinue, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + #if HAS_SUICIDE + lv_label_set_text(label_MotorOff, set_menu.shutdown); + #else + lv_label_set_text(label_MotorOff, set_menu.motoroff); + #endif + lv_obj_align(label_MotorOff, buMotorOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Language, set_menu.language); + lv_obj_align(label_Language, buttonLanguage, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } +} + +void lv_clear_set() +{ + lv_obj_del(scr); +} + +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_tool.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_tool.cpp new file mode 100644 index 000000000000..51ca7479ba71 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_tool.cpp @@ -0,0 +1,276 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../../lvgl/src/lv_objx/lv_img.h" +//#include "../../lvgl/src/lv_core/lv_disp.h" +//#include "../../lvgl/src/lv_core/lv_refr.h" +#include "../inc/draw_ui.h" +#include "../../../../../gcode/queue.h" + +//static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn; +static lv_obj_t * scr; +#if ENABLED(MKS_TEST) +extern uint8_t curent_disp_ui; +#endif + +#define ID_T_PRE_HEAT 1 +#define ID_T_EXTRUCT 2 +#define ID_T_MOV 3 +#define ID_T_HOME 4 +#define ID_T_LEVELING 5 +#define ID_T_FILAMENT 6 +#define ID_T_MORE 7 +#define ID_T_RETURN 8 + +static void event_handler(lv_obj_t * obj, lv_event_t event) +{ + switch(obj->mks_obj_id) + { + case ID_T_PRE_HEAT: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + lv_clear_tool(); + lv_draw_preHeat(); + } + break; + case ID_T_EXTRUCT: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + lv_clear_tool(); + lv_draw_extrusion(); + } + break; + case ID_T_MOV: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + lv_clear_tool(); + lv_draw_move_motor(); + } + + break; + case ID_T_HOME: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + lv_clear_tool(); + lv_draw_home(); + } + break; + case ID_T_LEVELING: + if(event == LV_EVENT_CLICKED) { + + + } + else if(event == LV_EVENT_RELEASED) { + #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + queue.enqueue_one_P(PSTR("G28")); + queue.enqueue_one_P(PSTR("G29")); + #else + uiCfg.leveling_first_time = 1; + lv_clear_tool(); + lv_draw_manualLevel(); + #endif + } + + break; + case ID_T_FILAMENT: + + break; + case ID_T_MORE: + + break; + case ID_T_RETURN: + if(event == LV_EVENT_CLICKED) { + + } + else if(event == LV_EVENT_RELEASED) { + #if ENABLED(MKS_TEST) + curent_disp_ui = 1; + #endif + lv_obj_del(scr); + lv_draw_ready_print(); + } + break; + + } +} + + +void lv_draw_tool(void) +{ + lv_obj_t *buttonPreHeat,*buttonExtrusion,*buttonMove,*buttonHome,*buttonLevel; + lv_obj_t *buttonBack; + + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != TOOL_UI) + { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = TOOL_UI; + } + disp_state = TOOL_UI; + + scr = lv_obj_create(NULL, NULL); + + //static lv_style_t tool_style; + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonPreHeat = lv_imgbtn_create(scr, NULL); + buttonExtrusion = lv_imgbtn_create(scr, NULL); + buttonMove = lv_imgbtn_create(scr, NULL); + buttonHome = lv_imgbtn_create(scr, NULL); + buttonLevel = lv_imgbtn_create(scr, NULL); + //buttonFilament = lv_imgbtn_create(scr, NULL); + //buttonMore = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + + lv_obj_set_event_cb_mks(buttonPreHeat, event_handler,ID_T_PRE_HEAT,"bmp_PreHeat.bin",0); + lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonPreHeat, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonExtrusion, event_handler,ID_T_EXTRUCT,"bmp_Extruct.bin",0); + lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonMove, event_handler,ID_T_MOV,"bmp_Mov.bin",0); + lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonHome, event_handler,ID_T_HOME,"bmp_Zero.bin",0); + lv_imgbtn_set_src(buttonHome, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonHome, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonHome, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonHome, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonLevel, event_handler,ID_T_LEVELING,"bmp_Leveling.bin",0); + lv_imgbtn_set_src(buttonLevel, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonLevel, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_REL, &tft_style_lable_rel); + + //lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_T_FILAMENT,"bmp_Filamentchange.bin",0); + //lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_PR, &tft_style_lable_pre); + //lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_REL, &tft_style_lable_rel); + + //lv_obj_set_event_cb_mks(buttonMore, event_handler,ID_T_MORE,"bmp_More.bin",0); + //lv_imgbtn_set_src(buttonMore, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonMore, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_PR, &tft_style_lable_pre); + //lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_T_RETURN,"bmp_Return.bin",0); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + + lv_obj_set_pos(buttonPreHeat,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonExtrusion,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); + lv_obj_set_pos(buttonMove,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); + lv_obj_set_pos(buttonHome,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonLevel,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + //lv_obj_set_pos(buttonFilament,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + //lv_obj_set_pos(buttonMore,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonPreHeat, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonExtrusion, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonMove, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHome, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonLevel, LV_LAYOUT_OFF); + //lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF); + //lv_btn_set_layout(buttonMore, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelPreHeat = lv_label_create(buttonPreHeat, NULL); + lv_obj_t * labelExtrusion = lv_label_create(buttonExtrusion, NULL); + lv_obj_t * label_Move = lv_label_create(buttonMove, NULL); + lv_obj_t * label_Home = lv_label_create(buttonHome, NULL); + lv_obj_t * label_Level = lv_label_create(buttonLevel, NULL); + //lv_obj_t * label_Filament = lv_label_create(buttonFilament, NULL); + //lv_obj_t * label_More = lv_label_create(buttonMore, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if(gCfgItems.multiple_language !=0) + { + lv_label_set_text(labelPreHeat, tool_menu.preheat); + lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelExtrusion, tool_menu.extrude); + lv_obj_align(labelExtrusion, buttonExtrusion, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Move, tool_menu.move); + lv_obj_align(label_Move, buttonMove, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Home, tool_menu.home); + lv_obj_align(label_Home, buttonHome, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + /*if(gCfgItems.leveling_mode != 2) + { + if(gCfgItems.leveling_mode == 1) + lv_label_set_text(label_Level, tool_menu.autoleveling); + else + lv_label_set_text(label_Level, tool_menu.leveling); + + lv_obj_align(label_Level, buttonLevel, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + }*/ + #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + lv_label_set_text(label_Level, tool_menu.autoleveling); + #else + lv_label_set_text(label_Level, tool_menu.leveling); + #endif + lv_obj_align(label_Level, buttonLevel, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_text(label_Filament, tool_menu.filament); + //lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_text(label_More, tool_menu.more); + //lv_obj_align(label_More, buttonMore, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } +} + +void lv_clear_tool() +{ + lv_obj_del(scr); +} +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_ui.cpp new file mode 100644 index 000000000000..cb90894557dc --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_ui.cpp @@ -0,0 +1,1415 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "../inc/draw_ui.h" +#include "../../../../../sd/cardreader.h" +#include "../inc/W25Qxx.h" +#include "../inc/tft_lvgl_configuration.h" +#include "../inc/pic_manager.h" +#include "../../../../../module/motion.h" +#include "../../../../../module/planner.h" +#if ENABLED(POWER_LOSS_RECOVERY) +#include "../../../../../feature/powerloss.h" +#endif +#if ENABLED(PARK_HEAD_ON_PAUSE) +#include "../../../../../feature/pause.h" +#endif + +#include +#if ENABLED(SPI_GRAPHICAL_TFT) +#include "../inc/SPI_TFT.h" +#endif + +CFG_ITMES gCfgItems; +UI_CFG uiCfg; +DISP_STATE_STACK disp_state_stack; +DISP_STATE disp_state = MAIN_UI; +DISP_STATE last_disp_state; +PRINT_TIME print_time; + +uint32_t To_pre_view; +uint8_t gcode_preview_over; +uint8_t flash_preview_begin; +uint8_t 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 uint8_t sel_id; +extern uint8_t public_buf[512]; +extern uint8_t bmp_public_buf[17 * 1024]; + +extern void LCD_IO_WriteData(uint16_t RegValue); + +void gCfgItems_init() +{ + gCfgItems.multiple_language = MULTI_LANGUAGE_ENABLE; + gCfgItems.language = LANG_ENGLISH; + gCfgItems.leveling_mode = 0; + gCfgItems.from_flash_pic = 0; + gCfgItems.curFilesize = 0; + gCfgItems.finish_power_off = 0; + gCfgItems.pause_reprint = 0; + + W25QXX.SPI_FLASH_BufferRead((uint8_t *)&gCfgItems.spi_flash_flag,VAR_INF_ADDR,sizeof(gCfgItems.spi_flash_flag)); + if(gCfgItems.spi_flash_flag == GCFG_FLAG_VALUE) + { + W25QXX.SPI_FLASH_BufferRead((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); + } + else + { + gCfgItems.spi_flash_flag = GCFG_FLAG_VALUE; + W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); + W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); + } + +} + +void gCfg_to_spiFlah() +{ + W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); + W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); +} + +void ui_cfg_init() +{ + uiCfg.curTempType = 0; + uiCfg.curSprayerChoose = 0; + uiCfg.stepHeat = 10; + uiCfg.leveling_first_time = 0; + uiCfg.extruStep = 5; + uiCfg.extruSpeed = 10; + uiCfg.move_dist = 1; + uiCfg.moveSpeed = 3000; + uiCfg.stepPrintSpeed = 10; +} + +void update_spi_flash() +{ + W25QXX.init(SPI_QUARTER_SPEED); + W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); + W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); +} + +lv_style_t tft_style_scr; +lv_style_t tft_style_lable_pre; +lv_style_t tft_style_lable_rel; + +void tft_style_init() +{ + lv_style_copy(&tft_style_scr, &lv_style_scr); + tft_style_scr.body.main_color = LV_COLOR_BACKGROUND; + tft_style_scr.body.grad_color = LV_COLOR_BACKGROUND; + tft_style_scr.text.color = LV_COLOR_TEXT; + tft_style_scr.text.sel_color = LV_COLOR_TEXT; + tft_style_scr.line.width = 0; + tft_style_scr.text.letter_space = 0; + tft_style_scr.text.line_space = 0; + + lv_style_copy(&tft_style_lable_pre, &lv_style_scr); + lv_style_copy(&tft_style_lable_rel, &lv_style_scr); + tft_style_lable_pre.body.main_color = LV_COLOR_BACKGROUND; + tft_style_lable_pre.body.grad_color = LV_COLOR_BACKGROUND; + tft_style_lable_pre.text.color = LV_COLOR_TEXT; + tft_style_lable_pre.text.sel_color = LV_COLOR_TEXT; + tft_style_lable_rel.body.main_color = LV_COLOR_BACKGROUND; + tft_style_lable_rel.body.grad_color = LV_COLOR_BACKGROUND; + tft_style_lable_rel.text.color = LV_COLOR_TEXT; + tft_style_lable_rel.text.sel_color = LV_COLOR_TEXT; + tft_style_lable_pre.text.font = &gb2312_puhui32; + tft_style_lable_rel.text.font = &gb2312_puhui32; + tft_style_lable_pre.line.width = 0; + tft_style_lable_rel.line.width = 0; + tft_style_lable_pre.text.letter_space = 0; + tft_style_lable_rel.text.letter_space = 0; + tft_style_lable_pre.text.line_space = -5; + tft_style_lable_rel.text.line_space = -5; +} + +#define MAX_TITLE_LEN 28 + +char public_buf_m[100] = {0}; + +char public_buf_l[30]; + +void titleText_cat(char *str, int strSize, char *addPart) +{ + if(str == 0 || addPart == 0) + { + return; + } + + if((int)(strlen(str) + strlen(addPart)) >= strSize) + { + return; + } + + strcat(str, addPart); +} + +char *getDispText(int index) +{ + + memset(public_buf_l, 0, sizeof(public_buf_l)); + + switch(disp_state_stack._disp_state[index]) + { + case PRINT_READY_UI: + strcpy(public_buf_l, main_menu.title); + + break; + + case PRINT_FILE_UI: + strcpy(public_buf_l, file_menu.title); + + break; + + case PRINTING_UI: + if(disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI + #ifndef TFT35 + || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI + #endif + ) + { + strcpy(public_buf_l, common_menu.print_special_title); + } + else + { + strcpy(public_buf_l, printing_menu.title); + } + + break; + + case MOVE_MOTOR_UI: + strcpy(public_buf_l, move_menu.title); + + break; + + case OPERATE_UI: + if(disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI + #ifndef TFT35 + || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI + #endif + ) + { + strcpy(public_buf_l, common_menu.operate_special_title); + } + else + { + strcpy(public_buf_l, operation_menu.title); + } + + break; + + case PAUSE_UI: + if(disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI) + { + strcpy(public_buf_l, common_menu.pause_special_title); + } + else + { + strcpy(public_buf_l, pause_menu.title); + } + + break; + + case EXTRUSION_UI: + strcpy(public_buf_l, extrude_menu.title); + + break; + + case CHANGE_SPEED_UI: + strcpy(public_buf_l, speed_menu.title); + + break; + + case FAN_UI: + strcpy(public_buf_l, fan_menu.title); + + break; + + case PRE_HEAT_UI: + if((disp_state_stack._disp_state[disp_state_stack._disp_index - 1] == OPERATE_UI)) + { + strcpy(public_buf_l,preheat_menu.adjust_title); + + } + else + { + strcpy(public_buf_l, preheat_menu.title); + + } + break; + + case SET_UI: + strcpy(public_buf_l, set_menu.title); + + break; + + case ZERO_UI: + strcpy(public_buf_l, home_menu.title); + + break; + + case SPRAYER_UI: + + break; + + case MACHINE_UI: + + break; + + case LANGUAGE_UI: + strcpy(public_buf_l, language_menu.title); + + break; + + case ABOUT_UI: + strcpy(public_buf_l, about_menu.title); + + break; + + case LOG_UI: + + break; + + case DISK_UI: + strcpy(public_buf_l, filesys_menu.title); + break; + + case DIALOG_UI: + strcpy(public_buf_l, common_menu.dialog_confirm_title); + break; + + case WIFI_UI: + strcpy(public_buf_l, wifi_menu.title); + + break; + case MORE_UI: + case PRINT_MORE_UI: + strcpy(public_buf_l, more_menu.title); + + break; + case FILAMENTCHANGE_UI: + strcpy(public_buf_l, filament_menu.title); + break; + case LEVELING_UI: + case MESHLEVELING_UI: + strcpy(public_buf_l, leveling_menu.title); + break; + case BIND_UI: + strcpy(public_buf_l, cloud_menu.title); + break; + case ZOFFSET_UI: + strcpy(public_buf_l, zoffset_menu.title); + break; + case TOOL_UI: + strcpy(public_buf_l, tool_menu.title); + break; + case WIFI_LIST_UI: + //strcpy(public_buf_l, list_menu.title); + break; + case MACHINE_PARA_UI: + strcpy(public_buf_l, MachinePara_menu.title); + break; + case BABY_STEP_UI: + strcpy(public_buf_l, operation_menu.babystep); + break; + default: + break; + } + + return public_buf_l; +} + +char *creat_title_text() +{ + int index = 0; + + char *tmpText = 0; + + char tmpCurFileStr[20]; + + + memset(tmpCurFileStr, 0, sizeof(tmpCurFileStr)); + + #if _LFN_UNICODE + //cutFileName((TCHAR *)curFileName, 16, 16, (TCHAR *)tmpCurFileStr); + #else + cutFileName(list_file.long_name[sel_id], 16, 16, tmpCurFileStr); + #endif + + memset(public_buf_m, 0, sizeof(public_buf_m)); + + while(index <= disp_state_stack._disp_index) + { + + tmpText = getDispText(index); + if((*tmpText == 0) || (tmpText == 0)) + { + index++; + continue; + } + + titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); + if(index < disp_state_stack._disp_index) + { + titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)">"); + } + + index++; + } + + if(disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI + /*|| disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI*/) + { + titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)":"); + titleText_cat(public_buf_m, sizeof(public_buf_m), tmpCurFileStr); + } + + if(strlen(public_buf_m) > MAX_TITLE_LEN) + { + memset(public_buf_m, 0, sizeof(public_buf_m)); + + tmpText = getDispText(0); + if(*tmpText != 0) + { + titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); + titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)">...>"); + tmpText = getDispText(disp_state_stack._disp_index); + if(*tmpText != 0) + { + titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); + } + } + + } + + return public_buf_m; +} + + +void preview_gcode_prehandle(char *path) +{ + #if ENABLED (SDSUPPORT) + //uint8_t re; + //uint32_t read; + uint32_t pre_read_cnt = 0; + uint32_t *p1; + char *cur_name; + + cur_name=strrchr(path,'/'); + card.openFileRead(cur_name); + card.read(public_buf, 512); + p1 = (uint32_t *)strstr((char *)public_buf,";simage:"); + + if(p1) + { + 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; + update_spi_flash(); + } + else + { + gcode_preview_over = 0; + default_preview_flg = 1; + gCfgItems.from_flash_pic = 0; + update_spi_flash(); + } + card.closefile(); + #endif +} + +void gcode_preview(char *path,int xpos_pixel,int ypos_pixel) +{ + #if ENABLED (SDSUPPORT) + //uint8_t ress; + //uint32_t write; + volatile uint32_t i,j; + volatile uint16_t *p_index; + //int res; + char *cur_name; + uint16_t Color; + + cur_name=strrchr(path,'/'); + card.openFileRead(cur_name); + + card.setIndex((PREVIEW_LITTLE_PIC_SIZE+To_pre_view)+size*row+8); + #if ENABLED(SPI_GRAPHICAL_TFT) + + SPI_TFT.spi_init(SPI_FULL_SPEED); + //SPI_TFT.SetCursor(0,0); + SPI_TFT.SetWindows(xpos_pixel, ypos_pixel+row, 200,1); + SPI_TFT.LCD_WriteRAM_Prepare(); + + #else + ili9320_SetWindows(xpos_pixel, ypos_pixel+row, 200,1); + LCD_WriteRAM_Prepare(); + #endif + + j=0; + i=0; + + while(1) + { + card.read(public_buf, 400); + for(i=0;i<400;) + { + bmp_public_buf[j]= ascii2dec_test((char*)&public_buf[i])<<4|ascii2dec_test((char*)&public_buf[i+1]); + + i+=2; + j++; + } + + //if(i>800)break; + //#if defined(TFT70) + //if(j>400) + //{ + // f_read(file, buff_pic, 1, &read); + // break; + //} + //#elif defined(TFT35) + if(j>=400) + { + //f_read(file, buff_pic, 1, &read); + break; + } + //#endif + + } + #if ENABLED(SPI_GRAPHICAL_TFT) + for(i=0;i<400;) + { + p_index = (uint16_t *)(&bmp_public_buf[i]); + + Color = (*p_index >> 8); + *p_index = Color | ((*p_index & 0xff) << 8); + i+=2; + } + SPI_TFT_CS_L; + SPI_TFT_DC_H; + SPI.dmaSend(bmp_public_buf,400,true); + SPI_TFT_CS_H; + + #else + for(i=0;i<400;) + { + p_index = (uint16_t *)(&bmp_public_buf[i]); + //if(*p_index == 0x0000)*p_index=gCfgItems.preview_bk_color; + LCD_IO_WriteData(*p_index); + i=i+2; + } + #endif + W25QXX.init(SPI_QUARTER_SPEED); + if(row<20) + { + W25QXX.SPI_FLASH_SectorErase(BAK_VIEW_ADDR_TFT35+row*4096); + } + W25QXX.SPI_FLASH_BufferWrite(bmp_public_buf, BAK_VIEW_ADDR_TFT35+row*400, 400); + row++; + if(row >= 200) + { + size = 809; + row = 0; + + gcode_preview_over = 0; + //flash_preview_begin = 1; + + card.closefile(); + + /*if(gCurFileState.file_open_flag != 0xaa) + { + + + reset_file_info(); + + res = f_open(file, curFileName, FA_OPEN_EXISTING | FA_READ); + + if(res == FR_OK) + { + f_lseek(file,PREVIEW_SIZE+To_pre_view); + gCurFileState.file_open_flag = 0xaa; + + //bakup_file_path((uint8_t *)curFileName, strlen(curFileName)); + + srcfp = file; + + mksReprint.mks_printer_state = MKS_WORKING; + + once_flag = 0; + } + + } */ + char *cur_name; + + cur_name=strrchr(list_file.file_name[sel_id],'/'); + + SdFile file; + SdFile *curDir; + card.endFilePrint(); + const char * const fname = card.diveToFile(true, curDir, cur_name); + if (!fname) return; + if (file.open(curDir, fname, O_READ)) + { + gCfgItems.curFilesize = file.fileSize(); + file.close(); + update_spi_flash(); + } + + card.openFileRead(cur_name); + if (card.isFileOpen()) + { + feedrate_percentage = 100; + //saved_feedrate_percentage = feedrate_percentage; + planner.flow_percentage[0] = 100; + planner.e_factor[0]= planner.flow_percentage[0]*0.01; + if(EXTRUDERS==2) + { + planner.flow_percentage[1] = 100; + planner.e_factor[1]= planner.flow_percentage[1]*0.01; + } + card.startFileprint(); + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.prepare(); + #endif + once_flag = 0; + } + return; + } + card.closefile(); + #endif +} + +void Draw_default_preview(int xpos_pixel,int ypos_pixel,uint8_t sel) +{ + int index; + int x_off = 0, y_off = 0; + int _y; + uint16_t *p_index; + int i,j; + uint16_t temp_p,Color; + + for(index = 0; index < 10; index ++)//200*200 + { + if(sel == 1) + { + flash_view_Read(bmp_public_buf, 8000);//20k + //memset(bmp_public_buf,0x1f,8000); + } + else + { + //memset(bmp_public_buf,0x1f,8000); + default_view_Read(bmp_public_buf, 8000);//20k + } + + i = 0; + #if ENABLED(SPI_GRAPHICAL_TFT) + + //SPI_TFT.spi_init(SPI_FULL_SPEED); + //SPI_TFT.SetWindows(xpos_pixel, y_off * 20+ypos_pixel, 200,20); //200*200 + //SPI_TFT.LCD_WriteRAM_Prepare(); + j=0; + for(_y = y_off * 20; _y < (y_off + 1) * 20; _y++) + { + SPI_TFT.spi_init(SPI_FULL_SPEED); + SPI_TFT.SetWindows(xpos_pixel, y_off * 20+ypos_pixel+j, 200,1); //200*200 + SPI_TFT.LCD_WriteRAM_Prepare(); + + j++; + //memcpy(public_buf,&bmp_public_buf[i],400); + SPI_TFT_CS_L; + SPI_TFT_DC_H; + SPI.dmaSend(&bmp_public_buf[i],400,true); + SPI_TFT_CS_H; + + i = i+400; + if(i >= 8000) + break; + } + + #else + ili9320_SetWindows(xpos_pixel, y_off * 20+ypos_pixel, 200,20); //200*200 + + LCD_WriteRAM_Prepare(); + + for(_y = y_off * 20; _y < (y_off + 1) * 20; _y++) + { + for (x_off = 0; x_off < 200; x_off++) + { + if(sel==1) + { + temp_p = (uint16_t)(bmp_public_buf[i]|bmp_public_buf[i+1]<<8); + p_index = &temp_p; + } + else + { + p_index = (uint16_t *)(&bmp_public_buf[i]); + } + + LCD_IO_WriteData(*p_index); + + + i += 2; + + } + if(i >= 8000) + break; + } + #endif + y_off++; + } + W25QXX.init(SPI_QUARTER_SPEED); +} + + +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(flash_preview_begin == 1) + { + flash_preview_begin = 0; + Draw_default_preview(xpos_pixel,ypos_pixel,1); + } + if(default_preview_flg == 1) + { + Draw_default_preview(xpos_pixel,ypos_pixel,0); + default_preview_flg = 0; + } + +} + +void print_time_run() +{ + static uint8_t lastSec = 0; + + if(print_time.seconds >= 60) + { + print_time.seconds = 0; + print_time.minutes++; + if(print_time.minutes >= 60) + { + print_time.minutes = 0; + print_time.hours++; + } + + } + if(disp_state == PRINTING_UI) + { + if(lastSec != print_time.seconds) + { + disp_print_time(); + } + lastSec = print_time.seconds; + } +} + +void GUI_RefreshPage() +{ + + if((systick_uptime_millis % 1000) == 0) + temperature_change_frequency=1; + if((systick_uptime_millis % 3000) == 0) + printing_rate_update_flag = 1; + switch(disp_state) + { + case MAIN_UI: + + lv_draw_ready_print(); + + break; + case EXTRUSION_UI: + if(temperature_change_frequency == 1) + { + temperature_change_frequency = 0; + disp_hotend_temp(); + } + break; + case PRE_HEAT_UI: + if(temperature_change_frequency == 1) + { + temperature_change_frequency = 0; + disp_desire_temp(); + } + break; + + case PRINT_READY_UI: + + /*if(gCfgItems.display_style == 2) + { + if(temperature_change_frequency){ + temperature_change_frequency=0; + disp_restro_state(); + } + }*/ + + break; + + case PRINT_FILE_UI: + break; + + case PRINTING_UI: + + if(temperature_change_frequency) + { + temperature_change_frequency = 0; + disp_ext_temp(); + disp_bed_temp(); + disp_fan_speed(); + disp_print_time(); + disp_fan_Zpos(); + } + if(printing_rate_update_flag || marlin_state == MF_SD_COMPLETE) + { + printing_rate_update_flag = 0; + if(gcode_preview_over == 0) + { + setProBarRate(); + } + } + break; + + + case OPERATE_UI: + /*if(temperature_change_frequency == 1) + { + temperature_change_frequency = 0; + disp_temp_operate(); + } + + setProBarRateOpera();*/ + + break; + + case PAUSE_UI: + /*if(temperature_change_frequency == 1) + { + temperature_change_frequency = 0; + disp_temp_pause(); + }*/ + + break; + + case FAN_UI: + if(temperature_change_frequency == 1) + { + temperature_change_frequency = 0; + disp_fan_value(); + } + break; + + case MOVE_MOTOR_UI: + /* + if(mksReprint.mks_printer_state == MKS_IDLE) + { + if((z_high_count==1)&&(temper_error_flg != 1)) + { + z_high_count = 0; + { + + memset((char *)gCfgItems.move_z_coordinate,' ',sizeof(gCfgItems.move_z_coordinate)); + GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate,380, TITLE_YPOS); + sprintf((char *)gCfgItems.move_z_coordinate,"Z: %.3f",current_position[Z_AXIS]); + GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate,380, TITLE_YPOS); + } + } + }*/ + break; + + case WIFI_UI: + /*if(wifi_refresh_flg == 1) + { + disp_wifi_state(); + wifi_refresh_flg = 0; + }*/ + break; + case BIND_UI: + /*refresh_bind_ui();*/ + break; + + case FILAMENTCHANGE_UI: + /*if(temperature_change_frequency) + { + temperature_change_frequency = 0; + disp_filament_sprayer_temp(); + }*/ + break; + case DIALOG_UI: + /*filament_dialog_handle(); + wifi_scan_handle();*/ + break; + case MESHLEVELING_UI: + /*disp_zpos();*/ + break; + case HARDWARE_TEST_UI: + + break; + case WIFI_LIST_UI: + /*if(wifi_refresh_flg == 1) + { + disp_wifi_list(); + wifi_refresh_flg = 0; + }*/ + break; + case KEY_BOARD_UI: + /*update_password_disp(); + update_join_state_disp();*/ + break; + case TIPS_UI: + /*switch(tips_type) + { + case TIPS_TYPE_JOINING: + if(wifi_link_state == WIFI_CONNECTED && strcmp((const char *)wifi_list.wifiConnectedName,(const char *)wifi_list.wifiName[wifi_list.nameIndex]) == 0) + { + tips_disp.timer = TIPS_TIMER_STOP; + tips_disp.timer_count = 0; + + Clear_Tips(); + tips_type = TIPS_TYPE_WIFI_CONECTED; + draw_Tips(); + + } + if(tips_disp.timer_count >= 30) + { + tips_disp.timer = TIPS_TIMER_STOP; + tips_disp.timer_count = 0; + + Clear_Tips(); + tips_type = TIPS_TYPE_TAILED_JOIN; + draw_Tips(); + } + break; + case TIPS_TYPE_TAILED_JOIN: + if(tips_disp.timer_count >= 3) + { + tips_disp.timer = TIPS_TIMER_STOP; + tips_disp.timer_count = 0; + + last_disp_state = TIPS_UI; + Clear_Tips(); + draw_Wifi_list(); + } + break; + case TIPS_TYPE_WIFI_CONECTED: + if(tips_disp.timer_count >= 3) + { + tips_disp.timer = TIPS_TIMER_STOP; + tips_disp.timer_count = 0; + + last_disp_state = TIPS_UI; + Clear_Tips(); + draw_Wifi(); + } + break; + default: + break; + }*/ + break; + case BABY_STEP_UI: + /*if(temperature_change_frequency == 1) + { + temperature_change_frequency = 0; + disp_z_offset_value(); + }*/ + break; + default: + break; + + } + + print_time_run(); + + +} + +void clear_cur_ui() +{ + last_disp_state = disp_state_stack._disp_state[disp_state_stack._disp_index]; + + switch(disp_state_stack._disp_state[disp_state_stack._disp_index]) + { + case PRINT_READY_UI: + //Get_Temperature_Flg = 0; + lv_clear_ready_print(); + break; + + case PRINT_FILE_UI: + lv_clear_print_file(); + break; + + case PRINTING_UI: + lv_clear_printing(); + break; + + case MOVE_MOTOR_UI: + lv_clear_move_motor(); + break; + + case OPERATE_UI: + lv_clear_opration(); + break; + + case PAUSE_UI: + //Clear_pause(); + break; + + case EXTRUSION_UI: + lv_clear_extrusion(); + break; + + case PRE_HEAT_UI: + lv_clear_preHeat(); + break; + + case CHANGE_SPEED_UI: + lv_clear_change_speed(); + break; + + case FAN_UI: + lv_clear_fan(); + break; + + case SET_UI: + lv_clear_set(); + break; + + case ZERO_UI: + lv_clear_home(); + break; + + case SPRAYER_UI: + //Clear_Sprayer(); + break; + + case MACHINE_UI: + //Clear_Machine(); + break; + + case LANGUAGE_UI: + lv_clear_language(); + break; + + case ABOUT_UI: + lv_clear_about(); + break; + + case LOG_UI: + //Clear_Connect(); + break; + case DISK_UI: + //Clear_Disk(); + break; + case WIFI_UI: + //Clear_Wifi(); + break; + + case MORE_UI: + //Clear_more(); + break; + + case FILETRANSFER_UI: + //Clear_fileTransfer(); + break; + case DIALOG_UI: + lv_clear_dialog(); + break; + case FILETRANSFERSTATE_UI: + ///// Clear_WifiFileTransferdialog(); + break; + case PRINT_MORE_UI: + //Clear_Printmore(); + break; + case LEVELING_UI: + lv_clear_manualLevel(); + break; + case BIND_UI: + //Clear_Bind(); + break; + case ZOFFSET_UI: + //Clear_Zoffset(); + break; + case TOOL_UI: + lv_clear_tool(); + break; + case MESHLEVELING_UI: + //Clear_MeshLeveling(); + break; + case HARDWARE_TEST_UI: + //Clear_Hardwaretest(); + break; + case WIFI_LIST_UI: + //Clear_Wifi_list(); + break; + case KEY_BOARD_UI: + //Clear_Keyboard(); + break; + case TIPS_UI: + //Clear_Tips(); + break; + case MACHINE_PARA_UI: + //Clear_MachinePara(); + break; + case MACHINE_SETTINGS_UI: + //Clear_MachineSettings(); + break; + case TEMPERATURE_SETTINGS_UI: + //Clear_TemperatureSettings(); + break; + case MOTOR_SETTINGS_UI: + //Clear_MotorSettings(); + break; + case MACHINETYPE_UI: + //Clear_MachineType(); + break; + case STROKE_UI: + //Clear_Stroke(); + break; + case HOME_DIR_UI: + //Clear_HomeDir(); + break; + case ENDSTOP_TYPE_UI: + //Clear_EndstopType(); + break; + case FILAMENT_SETTINGS_UI: + //Clear_FilamentSettings(); + break; + case LEVELING_SETTIGNS_UI: + //Clear_LevelingSettings(); + break; + case LEVELING_PARA_UI: + //Clear_LevelingPara(); + break; + case DELTA_LEVELING_PARA_UI: + //Clear_DeltaLevelPara(); + break; + case XYZ_LEVELING_PARA_UI: + //Clear_XYZLevelPara(); + break; + case MAXFEEDRATE_UI: + //Clear_MaxFeedRate(); + break; + case STEPS_UI: + //Clear_Steps(); + break; + case ACCELERATION_UI: + //Clear_Acceleration(); + break; + case JERK_UI: + //Clear_Jerk(); + break; + case MOTORDIR_UI: + //Clear_MotorDir(); + break; + case HOMESPEED_UI: + //Clear_HomeSpeed(); + break; + case NOZZLE_CONFIG_UI: + //Clear_NozzleConfig(); + break; + case HOTBED_CONFIG_UI: + //Clear_HotbedConfig(); + break; + case ADVANCED_UI: + //Clear_Advanced(); + break; + case DOUBLE_Z_UI: + //Clear_DoubleZ(); + break; + case ENABLE_INVERT_UI: + //Clear_EnableInvert(); + break; + case NUMBER_KEY_UI: + //Clear_NumberKey(); + break; + case BABY_STEP_UI: + //Clear_babyStep(); + break; + default: + break; + } + //GUI_Clear(); +} + +void draw_return_ui() +{ + if(disp_state_stack._disp_index > 0) + { + disp_state_stack._disp_index--; + + switch(disp_state_stack._disp_state[disp_state_stack._disp_index]) + { + case PRINT_READY_UI: + lv_draw_ready_print(); + break; + + + case PRINT_FILE_UI: + lv_draw_print_file(); + break; + case PRINTING_UI: + if(gCfgItems.from_flash_pic == 1) + flash_preview_begin = 1; + else + default_preview_flg = 1; + lv_draw_printing(); + break; + + case MOVE_MOTOR_UI: + lv_draw_move_motor(); + break; + + + case OPERATE_UI: + lv_draw_opration(); + break; +#if 1 + case PAUSE_UI: + //draw_pause(); + break; +#endif + + case EXTRUSION_UI: + lv_draw_extrusion(); + break; + + case PRE_HEAT_UI: + lv_draw_preHeat(); + break; + + case CHANGE_SPEED_UI: + lv_draw_change_speed(); + break; + + case FAN_UI: + lv_draw_fan(); + break; + + case SET_UI: + lv_draw_set(); + break; + + case ZERO_UI: + lv_draw_home(); + break; + + case SPRAYER_UI: + //draw_Sprayer(); + break; + + case MACHINE_UI: + //draw_Machine(); + break; + + case LANGUAGE_UI: + lv_draw_language(); + break; + + case ABOUT_UI: + lv_draw_about(); + break; +#if tan_mask + + case LOG_UI: + //draw_Connect(); + break; +#endif + + case CALIBRATE_UI: + //// draw_calibrate(); + break; + + case DISK_UI: + //draw_Disk(); + break; + + case WIFI_UI: + //draw_Wifi(); + break; + + case MORE_UI: + //draw_More(); + break; + + case PRINT_MORE_UI: + //draw_printmore(); + break; + + case FILAMENTCHANGE_UI: + //draw_FilamentChange(); + break; + case LEVELING_UI: + lv_draw_manualLevel(); + break; + + case BIND_UI: + //draw_bind(); + break; +#if tan_mask + case ZOFFSET_UI: + //draw_Zoffset(); + break; +#endif + case TOOL_UI: + lv_draw_tool(); + break; + case MESHLEVELING_UI: + //draw_meshleveling(); + break; + case HARDWARE_TEST_UI: + //draw_Hardwaretest(); + break; + case WIFI_LIST_UI: + //draw_Wifi_list(); + break; + case KEY_BOARD_UI: + //draw_Keyboard(); + break; + case TIPS_UI: + //draw_Tips(); + break; + case MACHINE_PARA_UI: + //draw_MachinePara(); + break; + case MACHINE_SETTINGS_UI: + //draw_MachineSettings(); + break; + case TEMPERATURE_SETTINGS_UI: + //draw_TemperatureSettings(); + break; + case MOTOR_SETTINGS_UI: + //draw_MotorSettings(); + break; + case MACHINETYPE_UI: + //draw_MachineType(); + break; + case STROKE_UI: + //draw_Stroke(); + break; + case HOME_DIR_UI: + //draw_HomeDir(); + break; + case ENDSTOP_TYPE_UI: + //draw_EndstopType(); + break; + case FILAMENT_SETTINGS_UI: + //draw_FilamentSettings(); + break; + case LEVELING_SETTIGNS_UI: + //draw_LevelingSettings(); + break; + case LEVELING_PARA_UI: + //draw_LevelingPara(); + break; + case DELTA_LEVELING_PARA_UI: + //draw_DeltaLevelPara(); + break; + case XYZ_LEVELING_PARA_UI: + //draw_XYZLevelPara(); + break; + case MAXFEEDRATE_UI: + //draw_MaxFeedRate(); + break; + case STEPS_UI: + //draw_Steps(); + break; + case ACCELERATION_UI: + //draw_Acceleration(); + break; + case JERK_UI: + //draw_Jerk(); + break; + case MOTORDIR_UI: + //draw_MotorDir(); + break; + case HOMESPEED_UI: + //draw_HomeSpeed(); + break; + case NOZZLE_CONFIG_UI: + //draw_NozzleConfig(); + break; + case HOTBED_CONFIG_UI: + //draw_HotbedConfig(); + break; + case ADVANCED_UI: + //draw_Advanced(); + break; + case DOUBLE_Z_UI: + //draw_DoubleZ(); + break; + case ENABLE_INVERT_UI: + //draw_EnableInvert(); + break; + case NUMBER_KEY_UI: + //draw_NumberKey(); + break; + case DIALOG_UI: + //draw_dialog(DialogType); + break; + case BABY_STEP_UI: + //draw_babyStep(); + break; + + default: + break; + } + } + + +} + +#if ENABLED (SDSUPPORT) +void sd_detection() +{ + #if ENABLED(SDSUPPORT) + static bool last_sd_status; + const bool sd_status = IS_SD_INSERTED(); + if (sd_status != last_sd_status) { + last_sd_status = sd_status; + if (sd_status) { + card.mount(); + } + else { + card.release(); + } + } + #endif // SDSUPPORT +} +#endif + +extern volatile uint32_t systick_uptime_millis; + +void print_time_count() +{ + if((systick_uptime_millis % 1000) == 0) + { + if(print_time.start == 1) + { + print_time.seconds++; + } + } +} + +void LV_TASK_HANDLER() +{ + //lv_tick_inc(1); + lv_task_handler(); + #if ENABLED(MKS_TEST) + mks_test(); + #endif + disp_pre_gcode(2,36); + GUI_RefreshPage(); + //sd_detection(); +} + +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/gb2312_puhui16.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/gb2312_puhui16.cpp new file mode 100644 index 000000000000..99e9d99c7555 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/gb2312_puhui16.cpp @@ -0,0 +1,103 @@ +/* +*--------------------------------------------------------------- +*--------------------------------------------------------------- +*/ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lvgl.h" +#include "../inc/pic_manager.h" + + +typedef struct{ + uint16_t min; + uint16_t max; + uint8_t bpp; + uint8_t reserved[3]; +}x_header_t; +typedef struct{ + uint32_t pos; +}x_table_t; +typedef struct{ + uint8_t adv_w; + uint8_t box_w; +}glyph_dsc_t; + + +static x_header_t __g_xbf_hd = { + .min = 0, + .max = 0, + .bpp = 0, +}; +static uint8_t __g_font_buf[75]; + +static uint8_t *__user_font_getdata(int offset, int size){ + //memset(__g_font_buf,0,sizeof(__g_font_buf)); + get_spi_flash_data((char *)__g_font_buf,offset,size); + return __g_font_buf; + //return &buf_test[offset]; +} + + +static const uint8_t * __user_font_get_bitmap(const lv_font_t * font, uint32_t unicode_letter) { + if( __g_xbf_hd.max==0 ) { + uint8_t *p = __user_font_getdata(0, sizeof(x_header_t)); + memcpy(&__g_xbf_hd, p, sizeof(x_header_t)); + } + if( unicode_letter>__g_xbf_hd.max || unicode_letter<__g_xbf_hd.min ) { + return NULL; + } + uint32_t unicode_offset = sizeof(x_header_t)+(unicode_letter-__g_xbf_hd.min)*4; + uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); + if( p_pos[0] != 0 ) { + uint32_t pos = p_pos[0]; + //glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(pos, 2); + __user_font_getdata(pos, 2); + //return __user_font_getdata(pos+2, gdsc->box_w*__g_xbf_hd.bpp/8); + return __user_font_getdata(pos+2, sizeof(__g_font_buf)); + } + return NULL; +} + + +static bool __user_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { + if( __g_xbf_hd.max==0 ) { + uint8_t *p = __user_font_getdata(0, sizeof(x_header_t)); + memcpy(&__g_xbf_hd, p, sizeof(x_header_t)); + } + if( unicode_letter>__g_xbf_hd.max || unicode_letter<__g_xbf_hd.min ) { + return NULL; + } + uint32_t unicode_offset = sizeof(x_header_t)+(unicode_letter-__g_xbf_hd.min)*4; + uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); + if( p_pos[0] != 0 ) { + glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(p_pos[0], 2); + dsc_out->adv_w = gdsc->adv_w; + dsc_out->box_h = font->line_height; + dsc_out->box_w = gdsc->box_w; + dsc_out->ofs_x = 0; + dsc_out->ofs_y = 0; + dsc_out->bpp = __g_xbf_hd.bpp; + return true; + } + return false; +} + + + +/*lv_font_t gb2312_puhui32 = { + .get_glyph_bitmap = __user_font_get_bitmap, + .get_glyph_dsc = __user_font_get_glyph_dsc, + .line_height = 25, + .base_line = 0, +};*/ +lv_font_t gb2312_puhui32; +void init_gb2312_font() +{ + gb2312_puhui32.get_glyph_bitmap = __user_font_get_bitmap; + gb2312_puhui32.get_glyph_dsc = __user_font_get_glyph_dsc; + gb2312_puhui32.line_height = 25; + gb2312_puhui32.base_line = 0; +} + +//end of file +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/mks_hardware_test.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/mks_hardware_test.cpp new file mode 100644 index 000000000000..f5ae4e64b02a --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/mks_hardware_test.cpp @@ -0,0 +1,963 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "../inc/tft_lvgl_configuration.h" +#include "lvgl.h" +#include "../../../../../feature/touch/xpt2046.h" +#include "../inc/draw_ready_print.h" +#include "../inc/W25Qxx.h" +#include "../inc/pic_manager.h" +//#include "../../MarlinCore.h" +#include "../inc/mks_hardware_test.h" +#include "../../../../../module/temperature.h" + + + +#if ENABLED(MKS_TEST) + +extern uint8_t curent_disp_ui; + +uint8_t pw_det_sta,pw_off_sta,mt_det_sta,mt_det2_sta,mt_det3_sta; +uint8_t endstopx1_sta,endstopx2_sta,endstopy1_sta,endstopy2_sta,endstopz1_sta,endstopz2_sta; +void test_gpio_readlevel_L() +{ + volatile uint32_t itest; + + digitalWrite(WIFI_IO2_PIN, HIGH); + itest = 10000; + while(itest--); + if(digitalRead(POWER_LOSS_PIN)==0) + { + pw_det_sta = 1; + } + else + { + pw_det_sta = 0; + } + if(digitalRead(PS_ON_PIN)==0) + { + pw_off_sta = 1; + } + else + { + pw_off_sta = 0; + } + if(digitalRead(FIL_RUNOUT_PIN)==0) + { + mt_det_sta = 1; + } + else + { + mt_det_sta = 0; + } + if(digitalRead(FIL_RUNOUT_2_PIN)==0) + { + mt_det2_sta = 1; + } + else + { + mt_det2_sta = 0; + } + if(digitalRead(FIL_RUNOUT_3_PIN)==0) + { + mt_det3_sta = 1; + } + else + { + mt_det3_sta = 0; + } + if(digitalRead(X_MIN_PIN)==0) + { + endstopx1_sta = 1; + } + else + { + endstopx1_sta = 0; + } + if(digitalRead(X_MAX_PIN)==0) + { + endstopx2_sta = 1; + } + else + { + endstopx2_sta = 0; + } + if(digitalRead(Y_MIN_PIN)==0) + { + endstopy1_sta = 1; + } + else + { + endstopy1_sta = 0; + } + if(digitalRead(Y_MAX_PIN)==0) + { + endstopy2_sta = 1; + } + else + { + endstopy2_sta = 0; + } + if(digitalRead(Z_MIN_PIN)==0) + { + endstopz1_sta = 1; + } + else + { + endstopz1_sta = 0; + } + if(digitalRead(Z_MAX_PIN)==0) + { + endstopz2_sta = 1; + } + else + { + endstopz2_sta = 0; + } +} +void test_gpio_readlevel_H() +{ + volatile uint32_t itest; + + digitalWrite(WIFI_IO2_PIN, LOW); + itest = 10000; + while(itest--); + if(digitalRead(POWER_LOSS_PIN)==1) + { + pw_det_sta = 1; + } + else + { + pw_det_sta = 0; + } + if(digitalRead(PS_ON_PIN)==1) + { + pw_off_sta = 1; + } + else + { + pw_off_sta = 0; + } + if(digitalRead(FIL_RUNOUT_PIN)==1) + { + mt_det_sta = 1; + } + else + { + mt_det_sta = 0; + } + if(digitalRead(FIL_RUNOUT_2_PIN)==1) + { + mt_det2_sta = 1; + } + else + { + mt_det2_sta = 0; + } + if(digitalRead(FIL_RUNOUT_3_PIN)==1) + { + mt_det3_sta = 1; + } + else + { + mt_det3_sta = 0; + } + if(digitalRead(X_MIN_PIN)==1) + { + endstopx1_sta = 1; + } + else + { + endstopx1_sta = 0; + } + if(digitalRead(X_MAX_PIN)==1) + { + endstopx2_sta = 1; + } + else + { + endstopx2_sta = 0; + } + if(digitalRead(Y_MIN_PIN)==1) + { + endstopy1_sta = 1; + } + else + { + endstopy1_sta = 0; + } + if(digitalRead(Y_MAX_PIN)==1) + { + endstopy2_sta = 1; + } + else + { + endstopy2_sta = 0; + } + if(digitalRead(Z_MIN_PIN)==1) + { + endstopz1_sta = 1; + } + else + { + endstopz1_sta = 0; + } + if(digitalRead(Z_MAX_PIN)==1) + { + endstopz2_sta = 1; + } + else + { + endstopz2_sta = 0; + } +} +void init_Tst_GPIO() +{ + pinMode(X_MIN_PIN, INPUT_PULLUP); + pinMode(X_MAX_PIN, INPUT_PULLUP); + pinMode(Y_MIN_PIN, INPUT_PULLUP); + pinMode(Y_MAX_PIN, INPUT_PULLUP); + pinMode(Z_MIN_PIN, INPUT_PULLUP); + pinMode(Z_MAX_PIN, INPUT_PULLUP); + + pinMode(WIFI_IO2_PIN, OUTPUT); + + pinMode(FIL_RUNOUT_PIN, INPUT_PULLUP); + pinMode(FIL_RUNOUT_2_PIN, INPUT_PULLUP); + pinMode(FIL_RUNOUT_3_PIN, INPUT_PULLUP); + + pinMode(POWER_LOSS_PIN, INPUT_PULLUP); + pinMode(PS_ON_PIN, INPUT_PULLUP); + + pinMode(SERVO0_PIN, INPUT_PULLUP); + + pinMode(E0_ENABLE_PIN, OUTPUT); + pinMode(X_ENABLE_PIN, OUTPUT); + + digitalWrite(X_ENABLE_PIN, LOW); + digitalWrite(Y_ENABLE_PIN, LOW); + digitalWrite(Z_ENABLE_PIN, LOW); + digitalWrite(E0_ENABLE_PIN, LOW); + digitalWrite(E1_ENABLE_PIN, LOW); + digitalWrite(E2_ENABLE_PIN, LOW); +} + +void mks_test_beeper(){ + digitalWrite(BEEPER_PIN, HIGH); + delay(100); + digitalWrite(BEEPER_PIN, LOW); + delay(100); +} + +void Test_GPIO() +{ + init_Tst_GPIO(); + + test_gpio_readlevel_L(); + test_gpio_readlevel_H(); + test_gpio_readlevel_L(); + if((pw_det_sta == 1)&&(mt_det_sta == 1)&&(mt_det2_sta == 1)&&(mt_det3_sta == 1)) + { + if(curent_disp_ui == 1) + disp_det_ok(); + } + else + { + if(curent_disp_ui == 1) + disp_det_error(); + } + if((endstopx1_sta== 1) + &&(endstopx2_sta== 1) + &&(endstopy1_sta== 1) + &&(endstopy2_sta== 1) + &&(endstopz1_sta== 1) + &&(endstopz2_sta== 1)) + { + if(curent_disp_ui == 1) + { + disp_Limit_ok(); + } + } + else + { + if(curent_disp_ui == 1) + { + disp_Limit_error(); + //mks_test_beeper(); + } + } +} + +void mks_test(){ + if(millis() % 2000 <1000){ + digitalWrite(X_DIR_PIN, LOW); + digitalWrite(Y_DIR_PIN, LOW); + digitalWrite(Z_DIR_PIN, LOW); + digitalWrite(E0_DIR_PIN, LOW); + digitalWrite(E1_DIR_PIN, LOW); + digitalWrite(E2_DIR_PIN, LOW); + thermalManager.fan_speed[0] = 255; + digitalWrite(HEATER_2_PIN, HIGH);//HE2 + digitalWrite(HEATER_1_PIN, HIGH);//HE1 + digitalWrite(HEATER_0_PIN, HIGH);//HE0 + digitalWrite(HEATER_BED_PIN, HIGH);//HOT-BED + } + else{ + digitalWrite(X_DIR_PIN, HIGH); + digitalWrite(Y_DIR_PIN, HIGH); + digitalWrite(Z_DIR_PIN, HIGH); + digitalWrite(E0_DIR_PIN, HIGH); + digitalWrite(E1_DIR_PIN, HIGH); + digitalWrite(E2_DIR_PIN, HIGH); + thermalManager.fan_speed[0] = 0; + digitalWrite(HEATER_2_PIN, LOW);//HE2 + digitalWrite(HEATER_1_PIN, LOW);//HE1 + digitalWrite(HEATER_0_PIN, LOW);//HE0 + digitalWrite(HEATER_BED_PIN, LOW);//HOT-BED + } + if((endstopx1_sta== 1) + &&(endstopx2_sta== 1) + &&(endstopy1_sta== 1) + &&(endstopy2_sta== 1) + &&(endstopz1_sta== 1) + &&(endstopz2_sta== 1)) + { + + } + else + { + mks_test_beeper(); + } + + if(curent_disp_ui == 1) + { + disp_test(); + } + + } + +#endif +const uint16_t ASCII_Table_16x24[] = +{ +/** + * @brief Space ' ' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '!' + */ + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '"' + */ + 0x0000, 0x0000, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '#' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C60, 0x0C60, + 0x0C60, 0x0630, 0x0630, 0x1FFE, 0x1FFE, 0x0630, 0x0738, 0x0318, + 0x1FFE, 0x1FFE, 0x0318, 0x0318, 0x018C, 0x018C, 0x018C, 0x0000, +/** + * @brief '$' + */ + 0x0000, 0x0080, 0x03E0, 0x0FF8, 0x0E9C, 0x1C8C, 0x188C, 0x008C, + 0x0098, 0x01F8, 0x07E0, 0x0E80, 0x1C80, 0x188C, 0x188C, 0x189C, + 0x0CB8, 0x0FF0, 0x03E0, 0x0080, 0x0080, 0x0000, 0x0000, 0x0000, +/** + * @brief '%' + */ + 0x0000, 0x0000, 0x0000, 0x180E, 0x0C1B, 0x0C11, 0x0611, 0x0611, + 0x0311, 0x0311, 0x019B, 0x018E, 0x38C0, 0x6CC0, 0x4460, 0x4460, + 0x4430, 0x4430, 0x4418, 0x6C18, 0x380C, 0x0000, 0x0000, 0x0000, +/** + * @brief '&' + */ + 0x0000, 0x01E0, 0x03F0, 0x0738, 0x0618, 0x0618, 0x0330, 0x01F0, + 0x00F0, 0x00F8, 0x319C, 0x330E, 0x1E06, 0x1C06, 0x1C06, 0x3F06, + 0x73FC, 0x21F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief ''' + */ + 0x0000, 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '(' + */ + 0x0000, 0x0200, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x0060, 0x0060, + 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0060, 0x0060, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0200, 0x0000, +/** + * @brief ')' + */ + 0x0000, 0x0020, 0x0060, 0x00C0, 0x0180, 0x0180, 0x0300, 0x0300, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, + 0x0300, 0x0300, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0020, 0x0000, +/** + * @brief '*' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x06D8, 0x07F8, 0x01E0, 0x0330, 0x0738, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '+' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x3FFC, 0x3FFC, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief ',' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, +/** + * @brief '-' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x07E0, 0x07E0, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '.' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '/' + */ + 0x0000, 0x0C00, 0x0C00, 0x0600, 0x0600, 0x0600, 0x0300, 0x0300, + 0x0300, 0x0380, 0x0180, 0x0180, 0x0180, 0x00C0, 0x00C0, 0x00C0, + 0x0060, 0x0060, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '0' + */ + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x180C, 0x180C, 0x180C, + 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '1' + */ + 0x0000, 0x0100, 0x0180, 0x01C0, 0x01F0, 0x0198, 0x0188, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '2' + */ + 0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x1800, + 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, + 0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '3' + */ + 0x0000, 0x01E0, 0x07F8, 0x0E18, 0x0C0C, 0x0C0C, 0x0C00, 0x0600, + 0x03C0, 0x07C0, 0x0C00, 0x1800, 0x1800, 0x180C, 0x180C, 0x0C18, + 0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '4' + */ + 0x0000, 0x0C00, 0x0E00, 0x0F00, 0x0F00, 0x0D80, 0x0CC0, 0x0C60, + 0x0C60, 0x0C30, 0x0C18, 0x0C0C, 0x3FFC, 0x3FFC, 0x0C00, 0x0C00, + 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '5' + */ + 0x0000, 0x0FF8, 0x0FF8, 0x0018, 0x0018, 0x000C, 0x03EC, 0x07FC, + 0x0E1C, 0x1C00, 0x1800, 0x1800, 0x1800, 0x180C, 0x0C1C, 0x0E18, + 0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '6' + */ + 0x0000, 0x07C0, 0x0FF0, 0x1C38, 0x1818, 0x0018, 0x000C, 0x03CC, + 0x0FEC, 0x0E3C, 0x1C1C, 0x180C, 0x180C, 0x180C, 0x1C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '7' + */ + 0x0000, 0x1FFC, 0x1FFC, 0x0C00, 0x0600, 0x0600, 0x0300, 0x0380, + 0x0180, 0x01C0, 0x00C0, 0x00E0, 0x0060, 0x0060, 0x0070, 0x0030, + 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '8' + */ + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x0C18, 0x0C18, 0x0638, + 0x07F0, 0x07F0, 0x0C18, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C38, + 0x0FF8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '9' + */ + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C1C, 0x180C, 0x180C, 0x180C, + 0x1C1C, 0x1E38, 0x1BF8, 0x19E0, 0x1800, 0x0C00, 0x0C00, 0x0E1C, + 0x07F8, 0x01F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief ':' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief ';' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, 0x0000, +/** + * @brief '<' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1000, 0x1C00, 0x0F80, 0x03E0, 0x00F8, 0x0018, 0x00F8, 0x03E0, + 0x0F80, 0x1C00, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '=' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1FF8, 0x0000, 0x0000, 0x0000, 0x1FF8, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '>' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0008, 0x0038, 0x01F0, 0x07C0, 0x1F00, 0x1800, 0x1F00, 0x07C0, + 0x01F0, 0x0038, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '?' + */ + 0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x0C00, + 0x0600, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x0000, 0x0000, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '@' + */ + 0x0000, 0x0000, 0x07E0, 0x1818, 0x2004, 0x29C2, 0x4A22, 0x4411, + 0x4409, 0x4409, 0x4409, 0x2209, 0x1311, 0x0CE2, 0x4002, 0x2004, + 0x1818, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'A' + */ + 0x0000, 0x0380, 0x0380, 0x06C0, 0x06C0, 0x06C0, 0x0C60, 0x0C60, + 0x1830, 0x1830, 0x1830, 0x3FF8, 0x3FF8, 0x701C, 0x600C, 0x600C, + 0xC006, 0xC006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'B' + */ + 0x0000, 0x03FC, 0x0FFC, 0x0C0C, 0x180C, 0x180C, 0x180C, 0x0C0C, + 0x07FC, 0x0FFC, 0x180C, 0x300C, 0x300C, 0x300C, 0x300C, 0x180C, + 0x1FFC, 0x07FC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'C' + */ + 0x0000, 0x07C0, 0x1FF0, 0x3838, 0x301C, 0x700C, 0x6006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x6006, 0x700C, 0x301C, + 0x1FF0, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'D' + */ + 0x0000, 0x03FE, 0x0FFE, 0x0E06, 0x1806, 0x1806, 0x3006, 0x3006, + 0x3006, 0x3006, 0x3006, 0x3006, 0x3006, 0x1806, 0x1806, 0x0E06, + 0x0FFE, 0x03FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'E' + */ + 0x0000, 0x3FFC, 0x3FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x1FFC, 0x1FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x3FFC, 0x3FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'F' + */ + 0x0000, 0x3FF8, 0x3FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x0018, 0x0018, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'G' + */ + 0x0000, 0x0FE0, 0x3FF8, 0x783C, 0x600E, 0xE006, 0xC007, 0x0003, + 0x0003, 0xFE03, 0xFE03, 0xC003, 0xC007, 0xC006, 0xC00E, 0xF03C, + 0x3FF8, 0x0FE0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'H' + */ + 0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x3FFC, 0x3FFC, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x300C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'I' + */ + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'J' + */ + 0x0000, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0618, 0x0618, 0x0738, + 0x03F0, 0x01E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'K' + */ + 0x0000, 0x3006, 0x1806, 0x0C06, 0x0606, 0x0306, 0x0186, 0x00C6, + 0x0066, 0x0076, 0x00DE, 0x018E, 0x0306, 0x0606, 0x0C06, 0x1806, + 0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'L' + */ + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x1FF8, 0x1FF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'M' + */ + 0x0000, 0xE00E, 0xF01E, 0xF01E, 0xF01E, 0xD836, 0xD836, 0xD836, + 0xD836, 0xCC66, 0xCC66, 0xCC66, 0xC6C6, 0xC6C6, 0xC6C6, 0xC6C6, + 0xC386, 0xC386, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'N' + */ + 0x0000, 0x300C, 0x301C, 0x303C, 0x303C, 0x306C, 0x306C, 0x30CC, + 0x30CC, 0x318C, 0x330C, 0x330C, 0x360C, 0x360C, 0x3C0C, 0x3C0C, + 0x380C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'O' + */ + 0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xC003, 0xC003, + 0xC003, 0xC003, 0xC003, 0xC003, 0xC003, 0x6006, 0x700E, 0x381C, + 0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'P' + */ + 0x0000, 0x0FFC, 0x1FFC, 0x380C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x180C, 0x1FFC, 0x07FC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'Q' + */ + 0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xE003, 0xC003, + 0xC003, 0xC003, 0xC003, 0xC003, 0xE007, 0x6306, 0x3F0E, 0x3C1C, + 0x3FF8, 0xF7E0, 0xC000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'R' + */ + 0x0000, 0x0FFE, 0x1FFE, 0x3806, 0x3006, 0x3006, 0x3006, 0x3806, + 0x1FFE, 0x07FE, 0x0306, 0x0606, 0x0C06, 0x1806, 0x1806, 0x3006, + 0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'S' + */ + 0x0000, 0x03E0, 0x0FF8, 0x0C1C, 0x180C, 0x180C, 0x000C, 0x001C, + 0x03F8, 0x0FE0, 0x1E00, 0x3800, 0x3006, 0x3006, 0x300E, 0x1C1C, + 0x0FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'T' + */ + 0x0000, 0x7FFE, 0x7FFE, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'U' + */ + 0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x1818, + 0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'V' + */ + 0x0000, 0x6003, 0x3006, 0x3006, 0x3006, 0x180C, 0x180C, 0x180C, + 0x0C18, 0x0C18, 0x0E38, 0x0630, 0x0630, 0x0770, 0x0360, 0x0360, + 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'W' + */ + 0x0000, 0x6003, 0x61C3, 0x61C3, 0x61C3, 0x3366, 0x3366, 0x3366, + 0x3366, 0x3366, 0x3366, 0x1B6C, 0x1B6C, 0x1B6C, 0x1A2C, 0x1E3C, + 0x0E38, 0x0E38, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'X' + */ + 0x0000, 0xE00F, 0x700C, 0x3018, 0x1830, 0x0C70, 0x0E60, 0x07C0, + 0x0380, 0x0380, 0x03C0, 0x06E0, 0x0C70, 0x1C30, 0x1818, 0x300C, + 0x600E, 0xE007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'Y' + */ + 0x0000, 0xC003, 0x6006, 0x300C, 0x381C, 0x1838, 0x0C30, 0x0660, + 0x07E0, 0x03C0, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'Z' + */ + 0x0000, 0x7FFC, 0x7FFC, 0x6000, 0x3000, 0x1800, 0x0C00, 0x0600, + 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, 0x000C, 0x0006, + 0x7FFE, 0x7FFE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '[' + */ + 0x0000, 0x03E0, 0x03E0, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, + 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, + 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x03E0, 0x03E0, 0x0000, +/** + * @brief '\' + */ + 0x0000, 0x0030, 0x0030, 0x0060, 0x0060, 0x0060, 0x00C0, 0x00C0, + 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0300, 0x0300, 0x0300, + 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief ']' + */ + 0x0000, 0x03E0, 0x03E0, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, + 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, + 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x03E0, 0x03E0, 0x0000, +/** + * @brief '^' + */ + 0x0000, 0x0000, 0x01C0, 0x01C0, 0x0360, 0x0360, 0x0360, 0x0630, + 0x0630, 0x0C18, 0x0C18, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '_' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief ''' + */ + 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'a' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03F0, 0x07F8, + 0x0C1C, 0x0C0C, 0x0F00, 0x0FF0, 0x0CF8, 0x0C0C, 0x0C0C, 0x0F1C, + 0x0FF8, 0x18F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'b' + */ + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x03D8, 0x0FF8, + 0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38, + 0x0FF8, 0x03D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'c' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x07F0, + 0x0E30, 0x0C18, 0x0018, 0x0018, 0x0018, 0x0018, 0x0C18, 0x0E30, + 0x07F0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'd' + */ + 0x0000, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x1BC0, 0x1FF0, + 0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30, + 0x1FF0, 0x1BC0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'e' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0, + 0x0C30, 0x1818, 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x1838, 0x1C30, + 0x0FF0, 0x07C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'f' + */ + 0x0000, 0x0F80, 0x0FC0, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'g' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0DE0, 0x0FF8, + 0x0E18, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0E18, + 0x0FF8, 0x0DE0, 0x0C00, 0x0C0C, 0x061C, 0x07F8, 0x01F0, 0x0000, +/** + * @brief 'h' + */ + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x07D8, 0x0FF8, + 0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, + 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'i' + */ + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'j' + */ + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00F8, 0x0078, 0x0000, +/** + * @brief 'k' + */ + 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0C0C, 0x060C, + 0x030C, 0x018C, 0x00CC, 0x006C, 0x00FC, 0x019C, 0x038C, 0x030C, + 0x060C, 0x0C0C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'l' + */ + 0x0000, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'm' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3C7C, 0x7EFF, + 0xE3C7, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, + 0xC183, 0xC183, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'n' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0798, 0x0FF8, + 0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, + 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'o' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0, + 0x0C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C30, + 0x0FF0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'p' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03D8, 0x0FF8, + 0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38, + 0x0FF8, 0x03D8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0000, +/** + * @brief 'q' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1BC0, 0x1FF0, + 0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30, + 0x1FF0, 0x1BC0, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x0000, +/** + * @brief 'r' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07B0, 0x03F0, + 0x0070, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 's' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03E0, 0x03F0, + 0x0E38, 0x0C18, 0x0038, 0x03F0, 0x07C0, 0x0C00, 0x0C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 't' + */ + 0x0000, 0x0000, 0x0080, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x07C0, 0x0780, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'u' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1818, 0x1818, + 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C38, + 0x1FF0, 0x19E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'v' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x180C, 0x0C18, + 0x0C18, 0x0C18, 0x0630, 0x0630, 0x0630, 0x0360, 0x0360, 0x0360, + 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'w' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41C1, 0x41C1, + 0x61C3, 0x6363, 0x6363, 0x6363, 0x3636, 0x3636, 0x3636, 0x1C1C, + 0x1C1C, 0x1C1C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'x' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x381C, 0x1C38, + 0x0C30, 0x0660, 0x0360, 0x0360, 0x0360, 0x0360, 0x0660, 0x0C30, + 0x1C38, 0x381C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'y' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3018, 0x1830, + 0x1830, 0x1870, 0x0C60, 0x0C60, 0x0CE0, 0x06C0, 0x06C0, 0x0380, + 0x0380, 0x0380, 0x0180, 0x0180, 0x01C0, 0x00F0, 0x0070, 0x0000, +/** + * @brief 'z' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1FFC, 0x1FFC, + 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, + 0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '{' + */ + 0x0000, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x0060, 0x0060, 0x0030, 0x0060, 0x0040, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0000, 0x0000, +/** + * @brief '|' + */ + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, +/** + * @brief '}' + */ + 0x0000, 0x0060, 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0300, 0x0300, 0x0600, 0x0300, 0x0100, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0000, 0x0000, +/** + * @brief '~' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x10F0, 0x1FF8, 0x0F08, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +}; +void disp_char_1624(uint16_t x,uint16_t y,uint8_t c,uint16_t charColor,uint16_t bkColor) +{ + + uint16_t i=0; + uint16_t j=0; + + uint16_t tmp_char=0; + + for (i=0;i<24;i++) + { + tmp_char=ASCII_Table_16x24[((c-0x20)*24)+i]; + for (j=0;j<16;j++) + { + if ( ((tmp_char >> j) & 0x01) == 0x01) + { + tft_set_point(x+j,y+i,charColor); + } + else + { + tft_set_point(x+j,y+i,bkColor); + } + } + } + +} + +void disp_string(uint16_t x,uint16_t y,const char * string,uint16_t charColor,uint16_t bkColor) +{ + while(*string != '\0') + { + disp_char_1624(x,y,*string,charColor,bkColor); + string++; + x+=16; + } +} + +//static lv_obj_t * scr_test; +void disp_pic_update() +{ + LCD_Clear(0x0000); + disp_string(120,150,"PIC Updating...",0xffff,0x0000); +} + +void disp_font_update() +{ + LCD_Clear(0x0000); + disp_string(120,150,"FONT Updating...",0xffff,0x0000); +} + + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/pic_manager.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/pic_manager.cpp new file mode 100644 index 000000000000..ccb93f5e36a0 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/pic_manager.cpp @@ -0,0 +1,811 @@ +//#include "type_define.h" +#include "string.h" +#include "../../../../../MarlinCore.h" + +#if ENABLED(TFT_LITTLE_VGL_UI) + +#include "../inc/pic_manager.h" +#include "../inc/W25Qxx.h" +#include "../../../../../sd/cardreader.h" +#include "../inc/draw_ready_print.h" +#include "../inc/mks_hardware_test.h" + +//#include "gui.h" +//#include "spi_flash.h" + +//uint8_t DMA_ERRO_FLAG; +extern uint16_t DeviceCode; +extern unsigned char bmp_public_buf[17 * 1024]; + +#if ENABLED (SDSUPPORT) +extern char *createFilename(char * const buffer, const dir_t &p); +#endif + +/*void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) +{ +}*/ +uint32_t lv_get_pic_addr(uint8_t *Pname) +{ + uint8_t Pic_cnt; + uint8_t i, j; + PIC_MSG PIC; + uint32_t tmp_cnt = 0; + uint32_t addr=0; + + W25QXX.init(SPI_QUARTER_SPEED); + + W25QXX.SPI_FLASH_BufferRead(&Pic_cnt,PIC_COUNTER_ADDR,1); + if(Pic_cnt == 0xff) + { + Pic_cnt = 0; + } + for(i=0;i= logo_maxsize) + { + LogoWrite_Addroffset = 0; + } + return 1; +} + +uint32_t TitleLogoWrite_Addroffset = 0; +uint8_t Pic_TitleLogo_Write(uint8_t *TitleLogoName,uint8_t *TitleLogo_Wbuff,uint32_t TitleLogoWriteSize) +{ + //uint32_t i; + //uint8_t temp1; + + if(TitleLogoWriteSize <= 0) + return 0; + if((DeviceCode==0x9488)||(DeviceCode==0x5761)) + { + W25QXX.SPI_FLASH_BufferWrite(TitleLogo_Wbuff,PIC_ICON_LOGO_ADDR_TFT35+TitleLogoWrite_Addroffset,TitleLogoWriteSize); + } + else + { + W25QXX.SPI_FLASH_BufferWrite(TitleLogo_Wbuff,PIC_ICON_LOGO_ADDR_TFT32+TitleLogoWrite_Addroffset,TitleLogoWriteSize); + + } + TitleLogoWrite_Addroffset += TitleLogoWriteSize; + if(TitleLogoWrite_Addroffset >= TITLELOGO_MAX_SIZE) + { + TitleLogoWrite_Addroffset = 0; + } + return 1; +} + +uint32_t default_view_addroffset_r = 0; +void default_view_Write(uint8_t *default_view__Rbuff,uint32_t default_view_Writesize) +{ + W25QXX.SPI_FLASH_BufferWrite(default_view__Rbuff,DEFAULT_VIEW_ADDR_TFT35+default_view_addroffset_r,default_view_Writesize); + default_view_addroffset_r += default_view_Writesize; + if(default_view_addroffset_r >= DEFAULT_VIEW_MAX_SIZE) + { + default_view_addroffset_r = 0; + } + +} + +uint32_t Pic_Info_Write(uint8_t *P_name,uint32_t P_size) +{ + uint8_t pic_counter = 0; + uint32_t Pic_SaveAddr; + uint32_t Pic_SizeSaveAddr; + uint32_t Pic_NameSaveAddr; + //uint8_t temp; + uint8_t Pname_temp; + uint32_t i,j; + uint32_t name_len = 0; + uint32_t SaveName_len = 0; + union union32 size_tmp; + //union union32 size1; + //uint8_t Pn[PIC_NAME_MAX_LEN]; + //uint8_t cnt_temp; + //uint16_t n0; + //uint32_t Name_saveAddr = 0; + //uint8_t pic_position; + + W25QXX.SPI_FLASH_BufferRead(&pic_counter,PIC_COUNTER_ADDR,1); + + if(pic_counter == 0xff) + { + pic_counter = 0; + } + if((DeviceCode==0x9488)||(DeviceCode==0x5761)) + { + Pic_SaveAddr = PIC_DATA_ADDR_TFT35 + pic_counter * PER_PIC_MAX_SPACE_TFT35; + } + else + { + Pic_SaveAddr = PIC_DATA_ADDR_TFT32 + pic_counter * PER_PIC_MAX_SPACE_TFT32; + } + + for(j = 0;j < pic_counter;j ++) + { + do + { + W25QXX.SPI_FLASH_BufferRead(&Pname_temp,PIC_NAME_ADDR + SaveName_len,1); + SaveName_len ++; + } + while(Pname_temp != '\0'); + } + i=0; + while((*(P_name+i) != '\0')) + { + i++; + name_len++; + } + + Pic_NameSaveAddr = PIC_NAME_ADDR + SaveName_len; + W25QXX.SPI_FLASH_BufferWrite(P_name,Pic_NameSaveAddr,name_len+1); + Pic_SizeSaveAddr = PIC_SIZE_ADDR+4*pic_counter; + size_tmp.dwords = P_size; + W25QXX.SPI_FLASH_BufferWrite(size_tmp.bytes,Pic_SizeSaveAddr,4); + + pic_counter++; + W25QXX.SPI_FLASH_SectorErase(PIC_COUNTER_ADDR); + W25QXX.SPI_FLASH_BufferWrite(&pic_counter,PIC_COUNTER_ADDR,1); + + return Pic_SaveAddr; +} + +uint8_t public_buf[512]; + +//uint8_t public_buf_test[512]; +#if ENABLED (SDSUPPORT) +void UpdatePic() +{ + //int r; + //unsigned char *p; + //char rootPath[10]={0}; + char *fn; + unsigned char logoFlag; + uint16_t pbr; + uint32_t pfileSize; + uint32_t Pic_Write_Addr; + /*----------------------------------*/ + + // FILINFO fno; + //DIR dir; + //char tmp[30]; + #if 0//_USE_LFN + static char lfn[_MAX_LFN + 1]; + finfo.lfname = lfn; + finfo.lfsize = sizeof(lfn); + #endif + //SdFile curDir; + //if (f_opendir(&dirs, picPath) == FR_OK) + //card.cd(picPath); + + //const uint16_t fileCnt = card.get_num_Files(); + + //SdFile *curDir; + //SdFile dir; + //dir.open(picPath, O_READ); + //const char * const fname = card.diveToFile(true, curDir, picPath); + //if (!fname) return; + + SdFile dir, root = card.getroot(); + if (dir.open(&root, picPath, O_RDONLY)) + { + + disp_pic_update(); + spiFlashErase_PIC(); + + dir_t d; + while (dir.readDir(&d, card.longFilename) > 0) + { + #if 1 + /*if(power_det == 0) + { + PW_DET_ON; + power_det=0; + } + SPI_FLASH_Init();*/ + + + //for (uint16_t i = 0; i < fileCnt; i++) + //{ + //res = f_readdir(&dirs, &finfo); + //card.getfilename_sorted(i); + + if (card.longFilename[0] == 0) + { + break; + } + /*if ( card.filename[0] == '.') + continue; + */ + if ( card.longFilename[0] == '.') + continue; + + fn = card.longFilename; + + /*if ((finfo.lfname[0] == 0) || (finfo.lfname == 0)) + fn = finfo.fname; + else + fn = finfo.lfname;*/ + + /* if (fno.fattrib & AM_DIR) + { + continue; + } + else */ + //{ + //if((strstr(fn, ".gco")) || (strstr(fn, ".GCO")) || (fno.fattrib & AM_DIR)) + if(strstr(fn, ".bin")) + { + if(strstr(fn, "_logo")) + logoFlag =1; + else if(strstr(fn, "_titlelogo")) + logoFlag = 2; + else if(strstr(fn, "_preview")) + logoFlag = 3; + else + logoFlag = 0; + + //public_buf[0] = '\0'; + //strcat(public_buf, picPath); + //strcat(public_buf, "/"); + char dosFilename[FILENAME_LENGTH]; + createFilename(dosFilename, d); + //strcat(public_buf, dosFilename); + + SdFile file; + if (file.open(&dir, dosFilename, O_READ)) + { + + #if 1 + /*LCD_Clear(BACK_COLOR); + + if((DeviceCode==0x9488)||(DeviceCode==0x5761)) + { + LCD_ShowString(170,100,200,24,24,(u8 *)fn); + LCD_ShowString(180,130,200,24,24,"Updating..."); + } + else + { + LCD_ShowString(90,90,200,24,24,(u8 *)fn); + LCD_ShowString(90,120,200,24,24,"Updating..."); + } + */ + if(logoFlag == 1) + { + while(1) + { + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + Pic_Logo_Write((uint8_t *)fn,public_buf,pbr); // + if(pbr < BMP_WRITE_BUF_LEN) break; + } + } + else if(logoFlag == 2) + { + while(1) + { + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + Pic_TitleLogo_Write((uint8_t *)fn,public_buf,pbr); // + if(pbr < BMP_WRITE_BUF_LEN) break; + } + } + else if(logoFlag == 3) + { + while(1) + { + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + default_view_Write(public_buf,pbr); // + if(pbr < BMP_WRITE_BUF_LEN) break; + } + } + else + { + pfileSize = file.fileSize(); + Pic_Write_Addr = Pic_Info_Write((uint8_t *)fn,pfileSize); + //uint32_t addr_test = Pic_Write_Addr; + //memset(bmp_public_buf, 0xff, BMP_WRITE_BUF_LEN); + while(1) + { + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + W25QXX.SPI_FLASH_BufferWrite(public_buf,Pic_Write_Addr,pbr); + Pic_Write_Addr += pbr; + if(pbr < BMP_WRITE_BUF_LEN) break; + } + //W25QXX.SPI_FLASH_BufferRead(public_buf_test,addr_test,BMP_WRITE_BUF_LEN); + } + + /*--------------read test--------------------*/ + /* + BufferSet(picBuffer, 0xff, PICTURE_MAX_SIZE); + if(logoFlag == 0) + { + PicMsg_Init(); + Pic_Read(fn,picBuffer); + } + else + Pic_Logo_Read(fn,picBuffer,PICTURE_MAX_SIZE); + */ + /*--------------read test--------------------*/ + + file.close(); + #endif + } + + } + //} + //} + /* + LCD_Clear(LCD_COLOR_BLACK); + //LCD_ShowString(110,100,200,24,24,"Complete"); + LCD_DisplayString(110,80,"Complete"); + delay(0xfffff); + */ + //r = f_chdir("/"); + #if 1 + //SdFile dir, root = card.getroot(); + /*if (dir.open(&root, bakPath, O_RDONLY)) + { + dir.remove(); + }*/ + + //r = f_rename(picPath, bakPath); + + + //update_flag_ok = 1; + #endif + #endif + } + dir.rename(&root, bakPath); + } +} + + +void spi_flash_read_test() +{ + W25QXX.SPI_FLASH_BufferRead(public_buf,UNIGBK_FLASH_ADDR,BMP_WRITE_BUF_LEN); +} + +void UpdateFont() +{ + //int r; + //unsigned char *p; + //char rootPath[10]={0}; + char *fn; + //unsigned char logoFlag; + uint16_t pbr; + uint32_t flashaddr=0; + //uint32_t pfileSize; + //uint32_t Pic_Write_Addr; + /*----------------------------------*/ + + // FILINFO fno; + //DIR dir; + //char tmp[30]; + #if 0//_USE_LFN + static char lfn[_MAX_LFN + 1]; + finfo.lfname = lfn; + finfo.lfsize = sizeof(lfn); + #endif + //SdFile curDir; + //if (f_opendir(&dirs, picPath) == FR_OK) + //card.cd(picPath); + + //const uint16_t fileCnt = card.get_num_Files(); + + //SdFile *curDir; + //SdFile dir; + //dir.open(picPath, O_READ); + //const char * const fname = card.diveToFile(true, curDir, picPath); + //if (!fname) return; + + SdFile dir, root = card.getroot(); + if (dir.open(&root, fontPath, O_RDONLY)) + { + + disp_font_update(); + spiFlashErase_FONT(); + + dir_t d; + while (dir.readDir(&d, card.longFilename) > 0) + { + #if 1 + /*if(power_det == 0) + { + PW_DET_ON; + power_det=0; + } + SPI_FLASH_Init();*/ + + + //for (uint16_t i = 0; i < fileCnt; i++) + //{ + //res = f_readdir(&dirs, &finfo); + //card.getfilename_sorted(i); + + if (card.longFilename[0] == 0) + { + break; + } + /*if ( card.filename[0] == '.') + continue; + */ + if ( card.longFilename[0] == '.') + continue; + + fn = card.longFilename; + + /*if ((finfo.lfname[0] == 0) || (finfo.lfname == 0)) + fn = finfo.fname; + else + fn = finfo.lfname;*/ + + /* if (fno.fattrib & AM_DIR) + { + continue; + } + else */ + //{ + //if((strstr(fn, ".gco")) || (strstr(fn, ".GCO")) || (fno.fattrib & AM_DIR)) + if(strstr(fn, ".bin")) + { + char dosFilename[FILENAME_LENGTH]; + createFilename(dosFilename, d); + //strcat(public_buf, dosFilename); + + SdFile file; + if (file.open(&dir, dosFilename, O_READ)) + { + + #if 1 + /*LCD_Clear(BACK_COLOR); + + if((DeviceCode==0x9488)||(DeviceCode==0x5761)) + { + LCD_ShowString(170,100,200,24,24,(u8 *)fn); + LCD_ShowString(180,130,200,24,24,"Updating..."); + } + else + { + LCD_ShowString(90,90,200,24,24,(u8 *)fn); + LCD_ShowString(90,120,200,24,24,"Updating..."); + } + */ + flashaddr=UNIGBK_FLASH_ADDR; + pbr = 0; + while(1) + { + flashaddr += pbr; + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + W25QXX.SPI_FLASH_BufferWrite(public_buf,flashaddr,pbr); + //W25QXX.SPI_FLASH_BufferRead(public_buf_test,flashaddr,pbr); + /*if(UNIGBKFlag == 1) + { + fontrate = (uint16_t)(((float)(flashaddr - UNIGBK_FLASH_ADDR)/(float)(psrc.fsize))*100); + } + else + { + fontrate = (uint16_t)(((float)(flashaddr - GBK_FLASH_ADDR)/(float)(psrc.fsize))*100); + } + + if(fontrate > 99) fontrate=99; + + if(fontrate < 10) + { + fontString[0] = fontrate%10 + 0x30; + fontString[1] = '%'; + fontString[2] = '\0'; + } + else + { + fontString[0] = fontrate/10 + 0x30; + fontString[1] = fontrate%10 + 0x30; + fontString[2] = '%'; + fontString[3] = '\0'; + }*/ + //LCD_DisplayString(140,130,fontString); + if((DeviceCode==0x9488)||(DeviceCode==0x5761)) + { + //LCD_ShowString(200,160,200,24,24,fontString); + } + else + { + //LCD_ShowString(140,150,200,24,24,fontString); + } + if(pbr < BMP_WRITE_BUF_LEN) break; + } + /*--------------read test--------------------*/ + /* + BufferSet(picBuffer, 0xff, PICTURE_MAX_SIZE); + if(logoFlag == 0) + { + PicMsg_Init(); + Pic_Read(fn,picBuffer); + } + else + Pic_Logo_Read(fn,picBuffer,PICTURE_MAX_SIZE); + */ + /*--------------read test--------------------*/ + + file.close(); + #endif + } + + } + //} + //} + /* + LCD_Clear(LCD_COLOR_BLACK); + //LCD_ShowString(110,100,200,24,24,"Complete"); + LCD_DisplayString(110,80,"Complete"); + delay(0xfffff); + */ + //r = f_chdir("/"); + #if 1 + //SdFile dir, root = card.getroot(); + /*if (dir.open(&root, bakPath, O_RDONLY)) + { + dir.remove(); + }*/ + dir.rename(&root, bakFont); + //r = f_rename(picPath, bakPath); + + + //update_flag_ok = 1; + #endif + #endif + } + } +} +#endif +#endif + +#if 1 +void Pic_Read(uint8_t *Pname,uint8_t *P_Rbuff) +{ + uint8_t i, j; + uint8_t Pic_cnt; + uint32_t tmp_cnt = 0; + PIC_MSG PIC; + + //void SPI_FLASH_BufferRead(u8* pBuffer, u32 ReadAddr, u16 NumByteToRead); + + W25QXX.SPI_FLASH_BufferRead(&Pic_cnt,PIC_COUNTER_ADDR,1); + if(Pic_cnt == 0xff) + { + Pic_cnt = 0; + } + + for(i=0;i= LOGO_MAX_SIZE_TFT35 ) + { + logo_addroffset = 0; + } +} + +uint32_t default_view_addroffset = 0; +void default_view_Read(uint8_t *default_view_Rbuff,uint32_t default_view_Readsize) +{ + W25QXX.init(SPI_QUARTER_SPEED); + + W25QXX.SPI_FLASH_BufferRead(default_view_Rbuff,DEFAULT_VIEW_ADDR_TFT35+default_view_addroffset+4,default_view_Readsize); + default_view_addroffset += default_view_Readsize; + if(default_view_addroffset >= DEFAULT_VIEW_MAX_SIZE) + { + default_view_addroffset = 0; + } + +} + +uint32_t flash_view_addroffset = 0; +void flash_view_Read(uint8_t *flash_view_Rbuff,uint32_t flash_view_Readsize) +{ + W25QXX.init(SPI_QUARTER_SPEED); + + W25QXX.SPI_FLASH_BufferRead(flash_view_Rbuff,BAK_VIEW_ADDR_TFT35+flash_view_addroffset,flash_view_Readsize); + flash_view_addroffset += flash_view_Readsize; + if(flash_view_addroffset >= FLASH_VIEW_MAX_SIZE) + { + flash_view_addroffset = 0; + } + +} + +#endif + + + +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/printer_opration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/printer_opration.cpp new file mode 100644 index 000000000000..a1c4ea5373ef --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/printer_opration.cpp @@ -0,0 +1,214 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "lv_conf.h" +#include "../inc/draw_ui.h" +#include "../../../../../module/temperature.h" +#include "../../../../../module/motion.h" +#include "../../../../../sd/cardreader.h" +#include "../../../../../gcode/queue.h" +#if ENABLED(POWER_LOSS_RECOVERY) +#include "../../../../../feature/powerloss.h" +#endif + +#include "../../../../../gcode/gcode.h" +#include "../../../../../module/planner.h" + + +extern uint32_t To_pre_view; +extern uint8_t flash_preview_begin; +extern uint8_t default_preview_flg; +extern uint8_t gcode_preview_over; + +void printer_state_polling() +{ + if(uiCfg.print_state == PAUSING) + { + #if ENABLED(SDSUPPORT) + if( !planner.has_blocks_queued() && card.getIndex()>MIN_FILE_PRINTED) //���� �ļ��� M109��M190ָ�� + uiCfg.waitEndMoves++; + + if(uiCfg.waitEndMoves > 20) + { + uiCfg.waitEndMoves = 0; + planner.synchronize(); + gcode.process_subcommands_now_P(PSTR("M25")); + gcode.process_subcommands_now_P(PSTR("G91")); + gcode.process_subcommands_now_P(PSTR("G1 Z5")); + gcode.process_subcommands_now_P(PSTR("G90")); + + uiCfg.print_state = PAUSED; + + //#if ENABLED(POWER_LOSS_RECOVERY) + //if (recovery.enabled) recovery.save(true); + //#endif + gCfgItems.pause_reprint = 1; + update_spi_flash(); + } + #endif + } + else + { + uiCfg.waitEndMoves = 0; + } + + if(uiCfg.print_state == PAUSED) + { + + } + if(uiCfg.print_state == RESUMING) + { + if (IS_SD_PAUSED()) + { + gcode.process_subcommands_now_P(PSTR("G91")); + gcode.process_subcommands_now_P(PSTR("G1 Z-5")); + gcode.process_subcommands_now_P(PSTR("G90")); + gcode.process_subcommands_now_P(PSTR("M24")); + uiCfg.print_state = WORKING; + start_print_time(); + + gCfgItems.pause_reprint = 0; + update_spi_flash(); + } + } + #if ENABLED(POWER_LOSS_RECOVERY) + if(uiCfg.print_state == REPRINTED) + { + memset(public_buf_m,0,sizeof(public_buf_m)); + #if HOTENDS + HOTEND_LOOP() { + const int16_t et = recovery.info.target_temperature[e]; + if (et) { + #if HOTENDS > 1 + sprintf_P(public_buf_m, PSTR("T%i"), e); + gcode.process_subcommands_now(public_buf_m); + #endif + sprintf_P(public_buf_m, PSTR("M109 S%i"), et); + gcode.process_subcommands_now(public_buf_m); + } + } + #endif + + if(gCfgItems.pause_reprint == 1) + { + gcode.process_subcommands_now_P(PSTR("G91")); + gcode.process_subcommands_now_P(PSTR("G1 Z-5")); + gcode.process_subcommands_now_P(PSTR("G90")); + } + recovery.resume(); + + uiCfg.print_state = WORKING; + start_print_time(); + + gCfgItems.pause_reprint = 0; + update_spi_flash(); + } + #endif + if(uiCfg.print_state == WORKING) + { + filament_check(); + } +} + + +void filament_pin_setup() +{ + #if PIN_EXISTS(MT_DET_1) + pinMode(MT_DET_1_PIN, INPUT_PULLUP); + #endif + + #if PIN_EXISTS(MT_DET_2) + pinMode(MT_DET_2_PIN, INPUT_PULLUP); + #endif + + #if PIN_EXISTS(MT_DET_3) + pinMode(MT_DET_3_PIN, INPUT_PULLUP); + #endif +} + +void filament_check() +{ + const int FIL_DELAY = 20; + #if PIN_EXISTS(MT_DET_1) + static int fil_det_count_1 = 0; + if (!READ(MT_DET_1_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (READ(MT_DET_1_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (fil_det_count_1 > 0) + fil_det_count_1--; + + if (!READ(MT_DET_1_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (READ(MT_DET_1_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (fil_det_count_1 > 0) + fil_det_count_1--; + + #endif + + #if PIN_EXISTS(MT_DET_2) + static int fil_det_count_2 = 0; + if (!READ(MT_DET_2_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (READ(MT_DET_2_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (fil_det_count_2 > 0) + fil_det_count_2--; + + if (!READ(MT_DET_2_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (READ(MT_DET_2_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (fil_det_count_2 > 0) + fil_det_count_2--; + + #endif + + #if PIN_EXISTS(MT_DET_3) + static int fil_det_count_3 = 0; + if (!READ(MT_DET_3_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (READ(MT_DET_3_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (fil_det_count_3 > 0) + fil_det_count_3--; + + if (!READ(MT_DET_3_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (READ(MT_DET_3_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (fil_det_count_3 > 0) + fil_det_count_3--; + + #endif + + if ( + #if PIN_EXISTS(MT_DET_1) + fil_det_count_1 >= FIL_DELAY + #else + false + #endif + #if PIN_EXISTS(MT_DET_2) + || fil_det_count_2 >= FIL_DELAY + #endif + #if PIN_EXISTS(MT_DET_3) + || fil_det_count_3 >= FIL_DELAY + #endif + ) + { + clear_cur_ui(); + card.pauseSDPrint(); + stop_print_time(); + uiCfg.print_state = PAUSING; + + if(gCfgItems.from_flash_pic == 1) + flash_preview_begin = 1; + else + default_preview_flg = 1; + + lv_draw_printing(); + } +} + + +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/tft_fsmc.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/tft_fsmc.cpp new file mode 100644 index 000000000000..af2901552f63 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/tft_fsmc.cpp @@ -0,0 +1,279 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../../../../inc/MarlinConfig.h" + +#if ENABLED(TFT_LITTLE_VGL_UI) + +#if defined(ARDUINO_ARCH_STM32F1) && PIN_EXISTS(FSMC_CS) // FSMC on 100/144 pins SoCs + +#include +#include +#include +#include + +/* Timing configuration */ +#define FSMC_ADDRESS_SETUP_TIME 15 // AddressSetupTime +#define FSMC_DATA_SETUP_TIME 15 // DataSetupTime + +void LCD_IO_Init(uint8_t cs, uint8_t rs); +void LCD_IO_WriteData(uint16_t RegValue); +void LCD_IO_WriteReg(uint16_t Reg); +uint16_t LCD_IO_ReadData(uint16_t RegValue); +uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize); +uint16_t ILI9488_ReadRAM(); +#ifdef LCD_USE_DMA_FSMC + void LCD_IO_WriteMultiple(uint16_t data, uint32_t count); + void LCD_IO_WriteSequence(uint16_t *data, uint16_t length); +#endif + +/** + * FSMC LCD IO + */ +#define __ASM __asm +#define __STATIC_INLINE static inline + +__attribute__((always_inline)) __STATIC_INLINE void __DSB() { + __ASM volatile ("dsb 0xF":::"memory"); +} + +#define FSMC_CS_NE1 PD7 + +#if ENABLED(STM32_XL_DENSITY) + #define FSMC_CS_NE2 PG9 + #define FSMC_CS_NE3 PG10 + #define FSMC_CS_NE4 PG12 + + #define FSMC_RS_A0 PF0 + #define FSMC_RS_A1 PF1 + #define FSMC_RS_A2 PF2 + #define FSMC_RS_A3 PF3 + #define FSMC_RS_A4 PF4 + #define FSMC_RS_A5 PF5 + #define FSMC_RS_A6 PF12 + #define FSMC_RS_A7 PF13 + #define FSMC_RS_A8 PF14 + #define FSMC_RS_A9 PF15 + #define FSMC_RS_A10 PG0 + #define FSMC_RS_A11 PG1 + #define FSMC_RS_A12 PG2 + #define FSMC_RS_A13 PG3 + #define FSMC_RS_A14 PG4 + #define FSMC_RS_A15 PG5 +#endif + +#define FSMC_RS_A16 PD11 +#define FSMC_RS_A17 PD12 +#define FSMC_RS_A18 PD13 +#define FSMC_RS_A19 PE3 +#define FSMC_RS_A20 PE4 +#define FSMC_RS_A21 PE5 +#define FSMC_RS_A22 PE6 +#define FSMC_RS_A23 PE2 + +#if ENABLED(STM32_XL_DENSITY) + #define FSMC_RS_A24 PG13 + #define FSMC_RS_A25 PG14 +#endif + +static uint8_t fsmcInit = 0; + +typedef struct { + __IO uint16_t REG; + __IO uint16_t RAM; +} LCD_CONTROLLER_TypeDef; + +LCD_CONTROLLER_TypeDef *LCD; + +void LCD_IO_Init(uint8_t cs, uint8_t rs) { + uint32_t controllerAddress; + + if (fsmcInit) return; + fsmcInit = 1; + + switch (cs) { + case FSMC_CS_NE1: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION1; break; + #if ENABLED(STM32_XL_DENSITY) + case FSMC_CS_NE2: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION2; break; + case FSMC_CS_NE3: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION3; break; + case FSMC_CS_NE4: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION4; break; + #endif + default: return; + } + + #define _ORADDR(N) controllerAddress |= (_BV32(N) - 2) + + switch (rs) { + #if ENABLED(STM32_XL_DENSITY) + case FSMC_RS_A0: _ORADDR( 1); break; + case FSMC_RS_A1: _ORADDR( 2); break; + case FSMC_RS_A2: _ORADDR( 3); break; + case FSMC_RS_A3: _ORADDR( 4); break; + case FSMC_RS_A4: _ORADDR( 5); break; + case FSMC_RS_A5: _ORADDR( 6); break; + case FSMC_RS_A6: _ORADDR( 7); break; + case FSMC_RS_A7: _ORADDR( 8); break; + case FSMC_RS_A8: _ORADDR( 9); break; + case FSMC_RS_A9: _ORADDR(10); break; + case FSMC_RS_A10: _ORADDR(11); break; + case FSMC_RS_A11: _ORADDR(12); break; + case FSMC_RS_A12: _ORADDR(13); break; + case FSMC_RS_A13: _ORADDR(14); break; + case FSMC_RS_A14: _ORADDR(15); break; + case FSMC_RS_A15: _ORADDR(16); break; + #endif + case FSMC_RS_A16: _ORADDR(17); break; + case FSMC_RS_A17: _ORADDR(18); break; + case FSMC_RS_A18: _ORADDR(19); break; + case FSMC_RS_A19: _ORADDR(20); break; + case FSMC_RS_A20: _ORADDR(21); break; + case FSMC_RS_A21: _ORADDR(22); break; + case FSMC_RS_A22: _ORADDR(23); break; + case FSMC_RS_A23: _ORADDR(24); break; + #if ENABLED(STM32_XL_DENSITY) + case FSMC_RS_A24: _ORADDR(25); break; + case FSMC_RS_A25: _ORADDR(26); break; + #endif + default: return; + } + + rcc_clk_enable(RCC_FSMC); + + gpio_set_mode(GPIOD, 14, GPIO_AF_OUTPUT_PP); // FSMC_D00 + gpio_set_mode(GPIOD, 15, GPIO_AF_OUTPUT_PP); // FSMC_D01 + gpio_set_mode(GPIOD, 0, GPIO_AF_OUTPUT_PP); // FSMC_D02 + gpio_set_mode(GPIOD, 1, GPIO_AF_OUTPUT_PP); // FSMC_D03 + gpio_set_mode(GPIOE, 7, GPIO_AF_OUTPUT_PP); // FSMC_D04 + gpio_set_mode(GPIOE, 8, GPIO_AF_OUTPUT_PP); // FSMC_D05 + gpio_set_mode(GPIOE, 9, GPIO_AF_OUTPUT_PP); // FSMC_D06 + gpio_set_mode(GPIOE, 10, GPIO_AF_OUTPUT_PP); // FSMC_D07 + gpio_set_mode(GPIOE, 11, GPIO_AF_OUTPUT_PP); // FSMC_D08 + gpio_set_mode(GPIOE, 12, GPIO_AF_OUTPUT_PP); // FSMC_D09 + gpio_set_mode(GPIOE, 13, GPIO_AF_OUTPUT_PP); // FSMC_D10 + gpio_set_mode(GPIOE, 14, GPIO_AF_OUTPUT_PP); // FSMC_D11 + gpio_set_mode(GPIOE, 15, GPIO_AF_OUTPUT_PP); // FSMC_D12 + gpio_set_mode(GPIOD, 8, GPIO_AF_OUTPUT_PP); // FSMC_D13 + gpio_set_mode(GPIOD, 9, GPIO_AF_OUTPUT_PP); // FSMC_D14 + gpio_set_mode(GPIOD, 10, GPIO_AF_OUTPUT_PP); // FSMC_D15 + + gpio_set_mode(GPIOD, 4, GPIO_AF_OUTPUT_PP); // FSMC_NOE + gpio_set_mode(GPIOD, 5, GPIO_AF_OUTPUT_PP); // FSMC_NWE + + gpio_set_mode(PIN_MAP[cs].gpio_device, PIN_MAP[cs].gpio_bit, GPIO_AF_OUTPUT_PP); //FSMC_CS_NEx + gpio_set_mode(PIN_MAP[rs].gpio_device, PIN_MAP[rs].gpio_bit, GPIO_AF_OUTPUT_PP); //FSMC_RS_Ax + + #if ENABLED(STM32_XL_DENSITY) + FSMC_NOR_PSRAM4_BASE->BCR = FSMC_BCR_WREN | FSMC_BCR_MTYP_SRAM | FSMC_BCR_MWID_16BITS | FSMC_BCR_MBKEN; + FSMC_NOR_PSRAM4_BASE->BTR = (FSMC_DATA_SETUP_TIME << 8) | FSMC_ADDRESS_SETUP_TIME; + #else // PSRAM1 for STM32F103V (high density) + FSMC_NOR_PSRAM1_BASE->BCR = FSMC_BCR_WREN | FSMC_BCR_MTYP_SRAM | FSMC_BCR_MWID_16BITS | FSMC_BCR_MBKEN; + FSMC_NOR_PSRAM1_BASE->BTR = (FSMC_DATA_SETUP_TIME << 8) | FSMC_ADDRESS_SETUP_TIME; + #endif + + afio_remap(AFIO_REMAP_FSMC_NADV); + + LCD = (LCD_CONTROLLER_TypeDef*)controllerAddress; +} + +void LCD_IO_WriteData(uint16_t RegValue) { + LCD->RAM = RegValue; + __DSB(); +} + +void LCD_IO_WriteReg(uint16_t Reg) { + LCD->REG = Reg; + __DSB(); +} + +uint16_t LCD_IO_ReadData(uint16_t RegValue) { + LCD->REG = RegValue; + __DSB(); + + return LCD->RAM; +} + +uint16_t ILI9488_ReadRAM() +{ + uint16_t data; + data = LCD->RAM; + return data; +} + +uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize) { + volatile uint32_t data; + LCD->REG = RegValue; + __DSB(); + + data = LCD->RAM; // dummy read + data = LCD->RAM & 0x00FF; + + while (--ReadSize) { + data <<= 8; + data |= (LCD->RAM & 0x00FF); + } + return uint32_t(data); +} + +#if ENABLED(LCD_USE_DMA_FSMC) + +void LCD_IO_WriteMultiple(uint16_t color, uint32_t count) { + while (count > 0) { + dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, &color, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM); + dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, count > 65535 ? 65535 : count); + dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + + while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {}; + dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + + count = count > 65535 ? count - 65535 : 0; + } +} + +void LCD_IO_WriteSequence(uint16_t *data, uint16_t length) { + dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, data, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM | DMA_PINC_MODE); + dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, length); + dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + + while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {}; + dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); +} + +void LCD_IO_WriteSequence_Async(uint16_t *data, uint16_t length) { + dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, data, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM | DMA_PINC_MODE); + dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, length); + dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); +} + +void LCD_IO_WaitSequence_Async() { + while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {}; + dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); +} + +#endif // LCD_USE_DMA_FSMC + +#endif // ARDUINO_ARCH_STM32F1 && FSMC_CS_PIN + +#endif + diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/tft_lvgl_configuration.cpp new file mode 100644 index 000000000000..d081b1cb0863 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/tft_lvgl_configuration.cpp @@ -0,0 +1,864 @@ +/** + * @file lcd_lvgl_configuration.c + * @date 2020-02-21 + * */ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "../inc/tft_lvgl_configuration.h" +#include "lvgl.h" +#include "../../../../../feature/touch/xpt2046.h" +#include "../inc/draw_ready_print.h" +#include "../inc/W25Qxx.h" +#include "../inc/pic_manager.h" + + +#include "../inc/mks_hardware_test.h" +#include "../inc/draw_ui.h" +#if ENABLED(POWER_LOSS_RECOVERY) +#include "../../../../../feature/powerloss.h" +#endif +#include +#if ENABLED(SPI_GRAPHICAL_TFT) +#include "../inc/SPI_TFT.h" +#endif + + +//#include "../../../Configuration.h" +//#include "../../../src/core/macros.h" + + +extern void LCD_IO_Init(uint8_t cs, uint8_t rs); +extern void LCD_IO_WriteData(uint16_t RegValue); +extern void LCD_IO_WriteReg(uint16_t Reg); + +extern void LCD_IO_WriteMultiple(uint16_t color, uint32_t count); + +extern void init_gb2312_font(); + +static lv_disp_buf_t disp_buf; +//static lv_color_t buf[LV_HOR_RES_MAX * 18]; +//static lv_color_t buf[10*5]; +//extern lv_obj_t * scr; +#if ENABLED (SDSUPPORT) +extern void UpdatePic(); +extern void UpdateFont(); +#endif +uint16_t DeviceCode = 0x9488; +extern uint8_t sel_id; + +#define SetCs +#define ClrCs + + +#define HDP 799 //Horizontal Display Period //** +#define HT 1000 //Horizontal Total +#define HPS 51 //LLINE Pulse Start Position +#define LPS 3 // Horizontal Display Period Start Position +#define HPW 8 // LLINE Pulse Width + + +#define VDP 479 //Vertical Display Period +#define VT 530 //Vertical Total +#define VPS 24 // LFRAME Pulse Start Position +#define FPS 23 //Vertical Display Period Start Positio +#define VPW 3 // LFRAME Pulse Width //** + +#define MAX_HZ_POSX HDP+1 +#define MAX_HZ_POSY VDP+1 + +extern uint8_t gcode_preview_over; +extern uint8_t flash_preview_begin; +extern uint8_t default_preview_flg; + +void SysTick_Callback() +{ + lv_tick_inc(1); + print_time_count(); +} + + +void tft_set_cursor(uint16_t x,uint16_t y) +{ + #if 0 + if(DeviceCode==0x8989) + { + LCD_WriteReg(0x004e,y); //行 + LCD_WriteReg(0x004f,x); //列 + } + else if((DeviceCode==0x9919)) + { + LCD_WriteReg(0x004e,x); // 行 + LCD_WriteReg(0x004f,y); // 列 + } + else if((DeviceCode==0x5761)) //SSD1963 + { + LCD_WrtReg(0x002A); + LCD_WrtRAM(x>>8); + LCD_WrtRAM(x&0x00ff); + LCD_WrtRAM(HDP>>8); + LCD_WrtRAM(HDP&0x00ff); + LCD_WrtReg(0x002b); + LCD_WrtRAM(y>>8); + LCD_WrtRAM(y&0x00ff); + LCD_WrtRAM(VDP>>8); + LCD_WrtRAM(VDP&0x00ff); + } + else if(DeviceCode == 0x9488) + { + ILI9488_WriteCmd(0X002A); + ILI9488_WriteData(x>>8); + ILI9488_WriteData(x&0X00FF); + ILI9488_WriteData(x>>8); + ILI9488_WriteData(x&0X00FF); + //ILI9488_WriteData(0X01); + //ILI9488_WriteData(0XDF); + ILI9488_WriteCmd(0X002B); + ILI9488_WriteData(y>>8); + ILI9488_WriteData(y&0X00FF); + ILI9488_WriteData(y>>8); + ILI9488_WriteData(y&0X00FF); + //ILI9488_WriteData(0X01); + //ILI9488_WriteData(0X3F); + } + else + { + LCD_WriteReg(0x0020,y); // 行 + LCD_WriteReg(0x0021,0x13f-x); // 列 + } + #else + LCD_IO_WriteReg(0X002A); + LCD_IO_WriteData(x>>8); + LCD_IO_WriteData(x&0X00FF); + LCD_IO_WriteData(x>>8); + LCD_IO_WriteData(x&0X00FF); + //ILI9488_WriteData(0X01); + //ILI9488_WriteData(0XDF); + LCD_IO_WriteReg(0X002B); + LCD_IO_WriteData(y>>8); + LCD_IO_WriteData(y&0X00FF); + LCD_IO_WriteData(y>>8); + LCD_IO_WriteData(y&0X00FF); + //ILI9488_WriteData(0X01); + //ILI9488_WriteData(0X3F); + #endif +} + +void LCD_WriteRAM_Prepare(void) +{ + #if 0 + if((DeviceCode==0x9325)||(DeviceCode==0x9328)||(DeviceCode==0x8989)) + { + ClrCs + LCD->LCD_REG = R34; + SetCs + } + else + { + LCD_WrtReg(0x002C); + } + #else + LCD_IO_WriteReg(0x002C); + #endif +} + +void tft_set_point(uint16_t x,uint16_t y,uint16_t point) +{ + //if(DeviceCode == 0x9488) + //{ + if ( (x>480)||(y>320) ) return; + //} + //**if ( (x>320)||(y>240) ) return; + tft_set_cursor(x,y); /*设置光标位置*/ + + LCD_WriteRAM_Prepare(); /* 开始写入GRAM*/ + //LCD_WriteRAM(point); + LCD_IO_WriteData(point); +} + +void LCD_WriteReg(uint16_t LCD_Reg,uint16_t LCD_RegValue) +{ + /* Write 16-bit Index, then Write Reg */ + ClrCs + LCD_IO_WriteReg(LCD_Reg); + /* Write 16-bit Reg */ + LCD_IO_WriteData(LCD_RegValue); + SetCs +} + +void ili9320_SetWindows(uint16_t StartX,uint16_t StartY,uint16_t width,uint16_t heigh) +{ + uint16_t s_h,s_l, e_h, e_l; + + uint16_t xEnd, yEnd; + xEnd = StartX + width; + yEnd = StartY + heigh-1; + if(DeviceCode==0x8989) + { + + /*LCD_WriteReg(0x0044, (StartX & 0xff) | (xEnd << 8)); + LCD_WriteReg(0x0045, StartY); + LCD_WriteReg(0x0046, yEnd);*/ + LCD_WriteReg(0x0044, (StartY& 0xff) | (yEnd << 8)); + LCD_WriteReg(0x0045, StartX); + LCD_WriteReg(0x0046, xEnd); + + } + else if(DeviceCode == 0X9488) + { + s_h = (StartX >> 8) & 0X00ff; + s_l = StartX & 0X00ff; + e_h = ((StartX + width - 1) >> 8) & 0X00ff; + e_l = (StartX + width - 1) & 0X00ff; + + LCD_IO_WriteReg(0x002A); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + + s_h = (StartY >> 8) & 0X00ff; + s_l = StartY & 0X00ff; + e_h = ((StartY + heigh - 1) >> 8) & 0X00ff; + e_l = (StartY + heigh - 1) & 0X00ff; + + LCD_IO_WriteReg(0x002B); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + } + else if((DeviceCode==0x9325)||(DeviceCode==0x9328)||(DeviceCode==0x1505)) + { + /* LCD_WriteReg(0x0050, StartX); + LCD_WriteReg(0x0052, StartY); + LCD_WriteReg(0x0051, xEnd); + LCD_WriteReg(0x0053, yEnd);*/ + LCD_WriteReg(0x0050,StartY); //Specify the start/end positions of the window address in the horizontal direction by an address unit + LCD_WriteReg(0x0051,yEnd); //Specify the start positions of the window address in the vertical direction by an address unit + LCD_WriteReg(0x0052,320 - xEnd); + LCD_WriteReg(0x0053,320 - StartX - 1); //Specify the end positions of the window address in the vertical direction by an address unit + + } + else + { + s_h = (StartX >> 8) & 0Xff; + s_l = StartX & 0Xff; + e_h = ((StartX + width - 1) >> 8) & 0Xff; + e_l = (StartX + width - 1) & 0Xff; + + LCD_IO_WriteReg(0x2A); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + + s_h = (StartY >> 8) & 0Xff; + s_l = StartY & 0Xff; + e_h = ((StartY + heigh - 1) >> 8) & 0Xff; + e_l = (StartY + heigh - 1) & 0Xff; + + LCD_IO_WriteReg(0x2B); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + } +} + +void LCD_Clear(uint16_t Color) +{ + uint32_t index=0; + + + unsigned int count; + + if(DeviceCode ==0x9488) + { + tft_set_cursor(0,0); + ili9320_SetWindows(0,0,480,320); + LCD_WriteRAM_Prepare(); + //index = (160*480); + for(index=0;index<320*480;index++) + { + LCD_IO_WriteData(Color); + } + //LCD_IO_WriteMultiple(Color, (480*320)); + //while(index --) + //LCD_IO_WriteData(Color); + } + else if(DeviceCode == 0x5761) + { + LCD_IO_WriteReg(0x002a); + LCD_IO_WriteData(0); + LCD_IO_WriteData(0); + LCD_IO_WriteData(HDP>>8); + LCD_IO_WriteData(HDP&0x00ff); + LCD_IO_WriteReg(0x002b); + LCD_IO_WriteData(0); + LCD_IO_WriteData(0); + LCD_IO_WriteData(VDP>>8); + LCD_IO_WriteData(VDP&0x00ff); + LCD_IO_WriteReg(0x002c); + LCD_IO_WriteReg(0x002c); + for(count=0;count<(HDP+1)*(VDP+1);count++) + { + LCD_IO_WriteData(Color); + } + } + else + { + tft_set_cursor(0,0); + LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */ + for(index=0;index<76800;index++) + { + LCD_IO_WriteData(Color); + } + } +} + +extern uint16_t ILI9488_ReadRAM(); + +#if DISABLED(SPI_GRAPHICAL_TFT) +void init_tft() +{ + uint16_t i; + //************* Start Initial Sequence **********// + + LCD_IO_Init(FSMC_CS_PIN, FSMC_RS_PIN); + + _delay_ms(5); + + LCD_IO_WriteReg(0X00D3); + DeviceCode=ILI9488_ReadRAM(); //dummy read + DeviceCode=ILI9488_ReadRAM(); + DeviceCode=ILI9488_ReadRAM(); + DeviceCode<<=8; + DeviceCode|=ILI9488_ReadRAM(); + + if(DeviceCode == 0x9488) + { + LCD_IO_WriteReg(0x00E0); + LCD_IO_WriteData(0x0000); + LCD_IO_WriteData(0x0007); + LCD_IO_WriteData(0x000f); + LCD_IO_WriteData(0x000D); + LCD_IO_WriteData(0x001B); + LCD_IO_WriteData(0x000A); + LCD_IO_WriteData(0x003c); + LCD_IO_WriteData(0x0078); + LCD_IO_WriteData(0x004A); + LCD_IO_WriteData(0x0007); + LCD_IO_WriteData(0x000E); + LCD_IO_WriteData(0x0009); + LCD_IO_WriteData(0x001B); + LCD_IO_WriteData(0x001e); + LCD_IO_WriteData(0x000f); + + LCD_IO_WriteReg(0x00E1); + LCD_IO_WriteData(0x0000); + LCD_IO_WriteData(0x0022); + LCD_IO_WriteData(0x0024); + LCD_IO_WriteData(0x0006); + LCD_IO_WriteData(0x0012); + LCD_IO_WriteData(0x0007); + LCD_IO_WriteData(0x0036); + LCD_IO_WriteData(0x0047); + LCD_IO_WriteData(0x0047); + LCD_IO_WriteData(0x0006); + LCD_IO_WriteData(0x000a); + LCD_IO_WriteData(0x0007); + LCD_IO_WriteData(0x0030); + LCD_IO_WriteData(0x0037); + LCD_IO_WriteData(0x000f); + + LCD_IO_WriteReg(0x00C0); + LCD_IO_WriteData(0x0010); + LCD_IO_WriteData(0x0010); + + LCD_IO_WriteReg(0x00C1); + LCD_IO_WriteData(0x0041); + + LCD_IO_WriteReg(0x00C5); + LCD_IO_WriteData(0x0000); + LCD_IO_WriteData(0x0022); + LCD_IO_WriteData(0x0080); + + LCD_IO_WriteReg(0x0036); + //ILI9488_WriteData(0x0068); + //if(gCfgItems.overturn_180 != 0xEE) + //{ + LCD_IO_WriteData(0x0068); + //} + //else + //{ + //ILI9488_WriteData(0x00A8); + //} + + LCD_IO_WriteReg(0x003A); //Interface Mode Control + LCD_IO_WriteData(0x0055); + + LCD_IO_WriteReg(0X00B0); //Interface Mode Control + LCD_IO_WriteData(0x0000); + LCD_IO_WriteReg(0x00B1); //Frame rate 70HZ + LCD_IO_WriteData(0x00B0); + LCD_IO_WriteData(0x0011); + LCD_IO_WriteReg(0x00B4); + LCD_IO_WriteData(0x0002); + LCD_IO_WriteReg(0x00B6); //RGB/MCU Interface Control + LCD_IO_WriteData(0x0002); + LCD_IO_WriteData(0x0042); + + LCD_IO_WriteReg(0x00B7); + LCD_IO_WriteData(0x00C6); + + //WriteComm(0XBE); + //WriteData(0x00); + //WriteData(0x04); + + LCD_IO_WriteReg(0x00E9); + LCD_IO_WriteData(0x0000); + + LCD_IO_WriteReg(0X00F7); + LCD_IO_WriteData(0x00A9); + LCD_IO_WriteData(0x0051); + LCD_IO_WriteData(0x002C); + LCD_IO_WriteData(0x0082); + + LCD_IO_WriteReg(0x0011); + for(i=0;i<65535;i++); + LCD_IO_WriteReg(0x0029); + + ili9320_SetWindows(0,0,480,320); + LCD_Clear(0x0000); + + OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); + } + +} +#endif + +extern uint8_t bmp_public_buf[17 * 1024]; +void tft_lvgl_init() +{ + //uint16_t test_id=0; + W25QXX.init(SPI_QUARTER_SPEED); + //test_id=W25QXX.W25QXX_ReadID(); + #if ENABLED (SDSUPPORT) + UpdatePic(); + UpdateFont(); + #endif + gCfgItems_init(); + ui_cfg_init(); + disp_language_init(); + //spi_flash_read_test(); + + #if ENABLED(SPI_GRAPHICAL_TFT) + SPI_TFT.spi_init(SPI_FULL_SPEED); + SPI_TFT.LCD_init(); + #else + init_tft(); + #endif + + lv_init(); + + lv_disp_buf_init(&disp_buf, bmp_public_buf, NULL, LV_HOR_RES_MAX * 18); /*Initialize the display buffer*/ + + lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/ + lv_disp_drv_init(&disp_drv); /*Basic initialization*/ + disp_drv.flush_cb = my_disp_flush; /*Set your driver function*/ + disp_drv.buffer = &disp_buf; /*Assign the buffer to the display*/ + lv_disp_drv_register(&disp_drv); /*Finally register the driver*/ + + lv_indev_drv_t indev_drv; + lv_indev_drv_init(&indev_drv); /*Descriptor of a input device driver*/ + indev_drv.type = LV_INDEV_TYPE_POINTER; /*Touch pad is a pointer-like device*/ + indev_drv.read_cb = my_touchpad_read; /*Set your driver function*/ + lv_indev_drv_register(&indev_drv); /*Finally register the driver*/ + + systick_attach_callback(SysTick_Callback); + + init_gb2312_font(); + + tft_style_init(); + + filament_pin_setup(); + + #if ENABLED(POWER_LOSS_RECOVERY) + if((recovery.info.valid_head != 0) && + (recovery.info.valid_head == recovery.info.valid_foot)) + { + if(gCfgItems.from_flash_pic == 1) + flash_preview_begin = 1; + else + default_preview_flg = 1; + + uiCfg.print_state = REPRINTING; + + memset(public_buf_m,0,sizeof(public_buf_m)); + strncpy(public_buf_m,recovery.info.sd_filename,sizeof(public_buf_m)); + card.printLongPath(public_buf_m); + + strncpy(list_file.long_name[sel_id],card.longFilename,sizeof(list_file.long_name[sel_id])); + + lv_draw_printing(); + } + else + #endif + lv_draw_ready_print(); + + #if ENABLED(MKS_TEST) + Test_GPIO(); + #endif +} + + + +#if 0 +void LCD_WriteRAM(uint16_t RGB_Code) +{ + #if 0 + ClrCs + /* Write 16-bit GRAM Reg */ + LCD->LCD_RAM = RGB_Code; + SetCs + #else + LCD_IO_WriteData(RGB_Code); + #endif +} +#endif + + + + +#if ENABLED(SPI_GRAPHICAL_TFT) +void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) +{ + uint16_t i,width,height; + uint16_t clr_temp; + uint8_t tbuf[480*2]; + + SPI_TFT.spi_init(SPI_FULL_SPEED); + + width = area->x2 - area->x1 + 1; + height = area->y2 - area->y1 +1; + + for(int j=0;jx1,(uint16_t)area->y1+j,width,1); + SPI_TFT.LCD_WriteRAM_Prepare(); + + for(i=0;ich.red<<11) + |((uint16_t)color_p->ch.green<<5) + |((uint16_t)color_p->ch.blue)); + + tbuf[i]=clr_temp>>8; + tbuf[i+1]=clr_temp; + i+=2; + color_p++; + } + SPI_TFT_CS_L; + SPI_TFT_DC_H; + SPI.dmaSend(tbuf,width*2,true); + SPI_TFT_CS_H; + } + + lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ + + W25QXX.init(SPI_QUARTER_SPEED); +} +#else +void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) +{ + #if 1 + uint16_t i,width,height; + uint16_t clr_temp; + #if 0 + int32_t x,y; + for(y = area->y1; y <= area->y2; y++) { + for(x = area->x1; x <= area->x2; x++) { + //set_pixel(x, y, *color_p); /* Put a pixel to the display.*/ + clr_temp = (uint16_t)(((uint16_t)color_p->ch.red<<11) + |((uint16_t)color_p->ch.green<<5) + |((uint16_t)color_p->ch.blue)); + tft_set_point(x, y,clr_temp); + color_p++; + } + } + #else + width = area->x2 - area->x1 + 1; + height = area->y2 - area->y1 +1; + //tft_set_cursor((uint16_t)area->x1,(uint16_t)area->y1); + ili9320_SetWindows((uint16_t)area->x1,(uint16_t)area->y1,width,height); + LCD_WriteRAM_Prepare(); + for(i=0;i<(width*height);i++) + { + clr_temp = (uint16_t)(((uint16_t)color_p->ch.red<<11) + |((uint16_t)color_p->ch.green<<5) + |((uint16_t)color_p->ch.blue)); + LCD_IO_WriteData(clr_temp); + color_p++; + } + #endif + + lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ + #endif +} +#endif + + +#define TICK_CYCLE 1 + +static int32_t touch_time1 = 0; + +unsigned int getTickDiff(unsigned int curTick, unsigned int lastTick) +{ + if(lastTick <= curTick) + { + return (curTick - lastTick) * TICK_CYCLE; + } + else + { + return (0xffffffff - lastTick + curTick) * TICK_CYCLE; + } +} + +#if ENABLED(SPI_GRAPHICAL_TFT) + +#ifndef USE_XPT2046 +#define USE_XPT2046 1 +#define XPT2046_XY_SWAP 1 +#define XPT2046_X_INV 1 +#define XPT2046_Y_INV 0 +#endif + +#if USE_XPT2046 +#define XPT2046_HOR_RES 480 +#define XPT2046_VER_RES 320 +#define XPT2046_X_MIN 201 +#define XPT2046_Y_MIN 164 +#define XPT2046_X_MAX 3919 +#define XPT2046_Y_MAX 3776 +#define XPT2046_AVG 4 +#define XPT2046_INV 1 +#endif + +#else +#ifndef USE_XPT2046 +#define USE_XPT2046 1 +#define XPT2046_XY_SWAP 1 +#define XPT2046_X_INV 0 +#define XPT2046_Y_INV 1 +#endif + +#if USE_XPT2046 +#define XPT2046_HOR_RES 480 +#define XPT2046_VER_RES 320 +#define XPT2046_X_MIN 201 +#define XPT2046_Y_MIN 164 +#define XPT2046_X_MAX 3919 +#define XPT2046_Y_MAX 3776 +#define XPT2046_AVG 4 +#define XPT2046_INV 0 +#endif +#endif + +static void xpt2046_corr(uint16_t * x, uint16_t * y) +{ +#if XPT2046_XY_SWAP + int16_t swap_tmp; + swap_tmp = *x; + *x = *y; + *y = swap_tmp; +#endif + if((*x) > XPT2046_X_MIN) + (*x) -= XPT2046_X_MIN; + else + (*x) = 0; + if((*y) > XPT2046_Y_MIN) + (*y) -= XPT2046_Y_MIN; + else + (*y) = 0; + (*x) = (uint32_t)((uint32_t)(*x) * XPT2046_HOR_RES)/(XPT2046_X_MAX - XPT2046_X_MIN); + (*y) = (uint32_t)((uint32_t)(*y) * XPT2046_VER_RES)/(XPT2046_Y_MAX - XPT2046_Y_MIN); +#if XPT2046_X_INV + (*x) = XPT2046_HOR_RES - (*x); +#endif +#if XPT2046_Y_INV + (*y) = XPT2046_VER_RES - (*y); +#endif +} + +#define times 4 +#define CHX 0x90//0x90 +#define CHY 0xD0//0xd0 + +int SPI2_ReadWrite2Bytes(void) +{ + volatile uint16_t ans=0; + uint16_t temp = 0; + #if ENABLED(SPI_GRAPHICAL_TFT) + temp=SPI_TFT.spi_read_write_byte(0xff); + ans=temp<<8; + temp=SPI_TFT.spi_read_write_byte(0xff); + ans|=temp; + ans>>=3; + #else + temp=W25QXX.spi_flash_read_write_byte(0xff); + ans=temp<<8; + temp=W25QXX.spi_flash_read_write_byte(0xff); + ans|=temp; + ans>>=3; + #endif + return ans&0x0fff; +} + +uint16_t x_addata[times],y_addata[times]; +void XPT2046_Rd_Addata(uint16_t *X_Addata,uint16_t *Y_Addata) +{ + + uint16_t i,j,k; + //int result; + + //#if ENABLED(TOUCH_BUTTONS) + + #if ENABLED(SPI_GRAPHICAL_TFT) + SPI_TFT.spi_init(SPI_QUARTER_SPEED); + #endif + + for(i=0;i x_addata[i]) + { + k = x_addata[j]; + x_addata[j] = x_addata[i]; + x_addata[i] = k; + } + } + } + if(x_addata[times / 2 -1] - x_addata[times / 2 ] > 50) + { + *X_Addata = 0; + *Y_Addata = 0; + return ; + } + + *X_Addata = (x_addata[times / 2 -1] + x_addata[times / 2 ]) /2; + + + //result = y_addata[0]; + for(i=0;i y_addata[i]) + { + k = y_addata[j]; + y_addata[j] = y_addata[i]; + y_addata[i] = k; + } + } + } + + + if(y_addata[times / 2 -1] - y_addata[times / 2 ] > 50) + { + *X_Addata = 0; + *Y_Addata = 0; + return ; + } + + *Y_Addata = (y_addata[times / 2 -1] + y_addata[times / 2 ]) /2; + + +} + +#define ADC_VALID_OFFSET 10 + +uint8_t TOUCH_PressValid(uint16_t _usX, uint16_t _usY) +{ + if ((_usX <= ADC_VALID_OFFSET) || (_usY <= ADC_VALID_OFFSET) + || (_usX >= 4095 - ADC_VALID_OFFSET) + || (_usY >= 4095 - ADC_VALID_OFFSET)) + { + return 0; + } + else + { + return 1; + } +} + +static lv_coord_t last_x = 0; + static lv_coord_t last_y = 0; +bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) +{ + #if 1 + uint32_t tmpTime, diffTime = 0; + + + + tmpTime = millis(); + diffTime = getTickDiff(tmpTime, touch_time1); + /*Save the state and save the pressed coordinate*/ + //data->state = TOUCH_PressValid(last_x, last_y) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; + //if(data->state == LV_INDEV_STATE_PR) ADS7843_Rd_Addata((u16 *)&last_x, (u16 *)&last_y); + //touchpad_get_xy(&last_x, &last_y); + /*Save the pressed coordinates and the state*/ + if(diffTime > 10) + { + XPT2046_Rd_Addata((uint16_t *)&last_x, (uint16_t *)&last_y); + if(TOUCH_PressValid(last_x, last_y)) { + + data->state = LV_INDEV_STATE_PR; + + /*Set the coordinates (if released use the last pressed coordinates)*/ + + xpt2046_corr((uint16_t *)&last_x, (uint16_t *)&last_y); + data->point.x = last_x; + data->point.y = last_y; + + } else { + data->state = LV_INDEV_STATE_REL; + } + touch_time1 = tmpTime; + } + + return false; /*Return `false` because we are not buffering and no more data to read*/ + #endif +} + +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/tft_multi_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/tft_multi_language.cpp new file mode 100644 index 000000000000..b08f68061004 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/src/tft_multi_language.cpp @@ -0,0 +1,1877 @@ +#include "../../../../../MarlinCore.h" +#if ENABLED(TFT_LITTLE_VGL_UI) +#include "../inc/draw_ui.h" +#include "../inc/tft_multi_language.h" + +//********************************************// + +//*********************************************// + +common_menu_def common_menu; +main_menu_def main_menu; +preheat_menu_def preheat_menu; +move_menu_def move_menu; +home_menu_def home_menu; +file_menu_def file_menu; +extrude_menu_def extrude_menu; +leveling_menu_def leveling_menu; +set_menu_def set_menu; +more_menu_def more_menu; +wifi_menu_def wifi_menu; +cloud_menu_def cloud_menu; +about_menu_def about_menu; +fan_menu_def fan_menu; +filament_menu_def filament_menu; +printing_menu_def printing_menu; +operation_menu_def operation_menu; +pause_menu_def pause_menu; +speed_menu_def speed_menu; +printing_more_menu_def printing_more_menu; +dialog_menu_def dialog_menu; +language_menu_def language_menu; +print_file_dialog_menu_def print_file_dialog_menu; +filesys_menu_def filesys_menu; +zoffset_menu_def zoffset_menu; +tool_menu_def tool_menu; +MachinePara_menu_def MachinePara_menu; +MachineSettings_menu_def MachineSettings_menu; +TemperatureSettings_menu_def TemperatureSettings_menu; +pause_msg_def pause_msg_menu; + +void disp_language_init() +{ + preheat_menu.value_state= TEXT_VALUE; + preheat_menu.step_1c= TEXT_1C; + preheat_menu.step_5c= TEXT_5C; + preheat_menu.step_10c= TEXT_10C; + + move_menu.x_add = AXIS_X_ADD_TEXT; + move_menu.x_dec = AXIS_X_DEC_TEXT; + move_menu.y_add = AXIS_Y_ADD_TEXT; + move_menu.y_dec = AXIS_Y_DEC_TEXT; + move_menu.z_add = AXIS_Z_ADD_TEXT; + move_menu.z_dec = AXIS_Z_DEC_TEXT; + + move_menu.step_001mm = TEXT_001MM; + move_menu.step_005mm = TEXT_005MM; + move_menu.step_01mm = TEXT_01MM; + move_menu.step_1mm = TEXT_1MM; + move_menu.step_10mm = TEXT_10MM; + + home_menu.home_x= HOME_X_TEXT; + home_menu.home_y= HOME_Y_TEXT; + home_menu.home_z= HOME_Z_TEXT; + home_menu.home_all= HOME_ALL_TEXT; + + extrude_menu.temp_value = TEXT_VALUE_T; + extrude_menu.count_value_mm= TEXT_VALUE_mm; + extrude_menu.count_value_cm= TEXT_VALUE_cm; + extrude_menu.count_value_m= TEXT_VALUE_m; + extrude_menu.step_1mm = EXTRUDE_1MM_TEXT; + extrude_menu.step_5mm = EXTRUDE_5MM_TEXT; + extrude_menu.step_10mm = EXTRUDE_10MM_TEXT; + + fan_menu.full = FAN_OPEN_TEXT; + fan_menu.half = FAN_HALF_TEXT; + fan_menu.off = FAN_CLOSE_TEXT; + + speed_menu.step_1percent = STEP_1PERCENT; + speed_menu.step_5percent = STEP_5PERCENT; + speed_menu.step_10percent = STEP_10PERCENT; + + language_menu.chinese_s = LANGUAGE_S_CN; + language_menu.chinese_t = LANGUAGE_T_CN; + language_menu.english = LANGUAGE_EN; + language_menu.russian = LANGUAGE_RU; + language_menu.spanish = LANGUAGE_SP; + language_menu.german = LANGUAGE_GE; + language_menu.japan = LANGUAGE_JP; + language_menu.korean = LANGUAGE_KR; + language_menu.portuguese = LANGUAGE_PR; + language_menu.italy = LANGUAGE_IT; + language_menu.brazil = LANGUAGE_BR; + language_menu.french = LANGUAGE_FR; + + about_menu.type_name= ABOUT_TYPE_TEXT; + about_menu.firmware_v= ABOUT_VERSION_TEXT; + //about_menu.wifi = ABOUT_WIFI_TEXT; + + wifi_menu.ip = WIFI_IP_TEXT; + wifi_menu.wifi = WIFI_NAME_TEXT; + wifi_menu.key = WIFI_KEY_TEXT; + wifi_menu.state_ap = WIFI_STATE_AP_TEXT; + wifi_menu.state_sta = WIFI_STATE_STA_TEXT; + wifi_menu.connected = WIFI_CONNECTED_TEXT; + wifi_menu.disconnected = WIFI_DISCONNECTED_TEXT; + wifi_menu.exception = WIFI_EXCEPTION_TEXT; + + printing_menu.temp1 = TEXT_VALUE; + printing_menu.temp2 = TEXT_VALUE; + printing_menu.bed_temp = TEXT_VALUE; + + filament_menu.stat_temp = TEXT_VALUE; + + zoffset_menu.step001 = ZOFFSET_STEP001; + zoffset_menu.step01 = ZOFFSET_STEP01; + zoffset_menu.step1 = ZOFFSET_STEP1; + + //wifi-list + #if 0 + list_menu.title=TEXT_WIFI_MENU_TITLE_EN; + list_menu.file_pages = FILE_PAGES_EN; + //keyboard + keyboard_menu.apply=MANUAL_IP_APPLY_EN; + keyboard_menu.password=TEXT_WIFI_PASSWORD_EN; + keyboard_menu.space = TEXT_WIFI_SAPCE_EN; + keyboard_menu.letter = TEXT_WIFI_LETTER_EN; + keyboard_menu.digital = TEXT_WIFI_DIGITAL_EN; + keyboard_menu.symbol = TEXT_WIFI_SYMBOL_EN; + //tips + tips_menu.pointBold = TEXT_WIFI_POINT_BOLD_EN; + tips_menu.joining = TEXT_WIFI_JOINING_EN; + tips_menu.failedJoin = TEXT_WIFI_FAILED_JOIN_EN; + tips_menu.wifiConected = TEXT_WIFI_WIFI_CONECTED_EN; + #endif + operation_menu.babystep = TEXT_BABY_STEP_EN; + + switch(gCfgItems.language) + { + case LANG_SIMPLE_CHINESE: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_CN; + common_menu.text_back=BACK_TEXT_CN; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_CN; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_CN; + common_menu.print_special_title = PRINTING_GBK; + common_menu.pause_special_title = PRINTING_PAUSE_GBK; + common_menu.operate_special_title = PRINTING_OPERATION_GBK; + // + main_menu.title=TITLE_READYPRINT_CN; + main_menu.preheat=PREHEAT_TEXT_CN; + main_menu.move=MOVE_TEXT_CN; + main_menu.home=HOME_TEXT_CN; + main_menu.print=PRINT_TEXT_CN; + main_menu.extrude=EXTRUDE_TEXT_CN; + main_menu.leveling=LEVELING_TEXT_CN; + main_menu.autoleveling=AUTO_LEVELING_TEXT_CN; + main_menu.fan = FAN_TEXT_CN; + main_menu.set=SET_TEXT_CN; + main_menu.more=MORE_TEXT_CN; + main_menu.tool = TOOL_TEXT_CN; + //TOOL + tool_menu.title = TOOL_TEXT_CN; + tool_menu.preheat = TOOL_PREHEAT_CN; + tool_menu.extrude = TOOL_EXTRUDE_CN; + tool_menu.move = TOOL_MOVE_CN; + tool_menu.home= TOOL_HOME_CN; + tool_menu.leveling = TOOL_LEVELING_CN; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_CN; + tool_menu.filament = TOOL_FILAMENT_CN; + tool_menu.more = TOOL_MORE_CN; + // + preheat_menu.adjust_title = TITLE_ADJUST_CN; + preheat_menu.title=TITLE_PREHEAT_CN; + preheat_menu.add=ADD_TEXT_CN; + preheat_menu.dec=DEC_TEXT_CN; + preheat_menu.ext1=EXTRUDER_1_TEXT_CN; + preheat_menu.ext2=EXTRUDER_2_TEXT_CN; + preheat_menu.hotbed=HEATBED_TEXT_CN; + preheat_menu.off=CLOSE_TEXT_CN; + + preheat_menu.value_state= TEXT_VALUE_CN; + preheat_menu.step_1c= TEXT_1C_CN; + preheat_menu.step_5c= TEXT_5C_CN; + preheat_menu.step_10c= TEXT_10C_CN; + // + move_menu.title = MOVE_TEXT_CN; + // + home_menu.title=TITLE_HOME_CN; + home_menu.stopmove = HOME_STOPMOVE_CN; + // + file_menu.title=TITLE_CHOOSEFILE_CN; + file_menu.page_up=PAGE_UP_TEXT_CN; + file_menu.page_down=PAGE_DOWN_TEXT_CN; + file_menu.file_loading = FILE_LOADING_CN; + file_menu.no_file = NO_FILE_CN; + file_menu.no_file_and_check = NO_FILE_CN;//NO_FILE_AND_CHECK_CN; + // + extrude_menu.title=TITLE_EXTRUDE_CN; + extrude_menu.in=EXTRUDER_IN_TEXT_CN; + extrude_menu.out=EXTRUDER_OUT_TEXT_CN; + extrude_menu.ext1=EXTRUDER_1_TEXT_CN; + extrude_menu.ext2=EXTRUDER_2_TEXT_CN; + extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_CN; + extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_CN; + extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_CN; + extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_CN; + extrude_menu.temp_value = EXTRUDE_TEXT_VALUE_T_CN; + // + leveling_menu.title=TITLE_LEVELING_CN; + leveling_menu.position1=LEVELING_POINT1_TEXT_CN; + leveling_menu.position2=LEVELING_POINT2_TEXT_CN; + leveling_menu.position3=LEVELING_POINT3_TEXT_CN; + leveling_menu.position4=LEVELING_POINT4_TEXT_CN; + leveling_menu.position5=LEVELING_POINT5_TEXT_CN; + // + set_menu.title=TITLE_SET_CN; + set_menu.filesys=FILESYS_TEXT_CN; + set_menu.wifi=WIFI_TEXT_CN; + set_menu.about=ABOUT_TEXT_CN; + set_menu.fan=FAN_TEXT_CN; + set_menu.filament=FILAMENT_TEXT_CN; + set_menu.breakpoint=BREAK_POINT_TEXT_CN; + set_menu.motoroff=MOTOR_OFF_TEXT_CN; + set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_CN; + set_menu.language=LANGUAGE_TEXT_CN; + set_menu.shutdown=SHUTDOWN_TEXT_CN; + //set_menu.machine_para = MACHINE_PARA_CN; + + // + filesys_menu.title = TITLE_FILESYS_CN; + filesys_menu.sd_sys = SD_CARD_TEXT_CN; + filesys_menu.usb_sys = U_DISK_TEXT_CN; + // + more_menu.title = TITLE_MORE_CN; + more_menu.zoffset = ZOFFSET_CN; + //WIFI + wifi_menu.title=WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_CN; + //wifi_menu.ip = WIFI_IP_TEXT_CN; + //wifi_menu.state= WIFI_STA_TEXT_CN; + wifi_menu.cloud= CLOUD_TEXT_CN; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_CN; + //CLOUD + cloud_menu.title = TITLE_CLOUD_TEXT_CN; + cloud_menu.bind = CLOUD_BINDED_CN; + cloud_menu.binded = CLOUD_BINDED_CN; + cloud_menu.unbind = CLOUD_UNBIND_CN; + cloud_menu.unbinding = CLOUD_UNBINDED_CN; + cloud_menu.disconnected = CLOUD_DISCONNECTED_CN; + cloud_menu.disable = CLOUD_DISABLE_CN; + // + about_menu.title = ABOUT_TEXT_CN; + about_menu.type = ABOUT_TYPE_TEXT_CN; + about_menu.version = ABOUT_VERSION_TEXT_CN; + about_menu.wifi = ABOUT_WIFI_TEXT_CN; + + // + fan_menu.title = FAN_TEXT_CN; + fan_menu.add = FAN_ADD_TEXT_CN; + fan_menu.dec = FAN_DEC_TEXT_CN; + fan_menu.state = FAN_TIPS1_TEXT_CN; + // + filament_menu.title = TITLE_FILAMENT_CN; + filament_menu.in = FILAMENT_IN_TEXT_CN; + filament_menu.out = FILAMENT_OUT_TEXT_CN; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_CN; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_CN; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_CN; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_CN; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_CN; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_CN; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_CN; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_CN; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_CN; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_CN; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_CN; + + + // + language_menu.title = TITLE_LANGUAGE_CN; + language_menu.next = PAGE_DOWN_TEXT_CN; + language_menu.up = PAGE_UP_TEXT_CN; + + // + printing_menu.title = TITLE_PRINTING_CN; + printing_menu.option = PRINTING_OPERATION_CN; + printing_menu.stop = PRINTING_STOP_CN; + printing_menu.pause = PRINTING_PAUSE_CN; + printing_menu.resume = PRINTING_RESUME_CN; + + // + operation_menu.title = TITLE_OPERATION_CN; + operation_menu.pause = PRINTING_PAUSE_CN; + operation_menu.stop = PRINTING_STOP_CN; + operation_menu.temp = PRINTING_TEMP_CN; + operation_menu.fan = FAN_TEXT_CN; + operation_menu.filament= FILAMENT_TEXT_CN; + operation_menu.extr = PRINTING_EXTRUDER_CN; + operation_menu.speed = PRINTING_CHANGESPEED_CN; + operation_menu.more = PRINTING_MORE_CN; + operation_menu.move = PRINTING_MOVE_CN; + operation_menu.auto_off = AUTO_SHUTDOWN_CN; + operation_menu.manual_off = MANUAL_SHUTDOWN_CN; + // + pause_menu.title= TITLE_PAUSE_CN; + pause_menu.resume = PRINTING_RESUME_CN; + pause_menu.stop = PRINTING_STOP_CN; + pause_menu.extrude = PRINTING_EXTRUDER_CN; + pause_menu.move = PRINTING_MOVE_CN; + pause_menu.filament= FILAMENT_TEXT_CN; + pause_menu.more = PRINTING_MORE_CN; + + // + speed_menu.title = PRINTING_CHANGESPEED_CN; + speed_menu.add = ADD_TEXT_CN; + speed_menu.dec = DEC_TEXT_CN; + speed_menu.move = MOVE_SPEED_CN; + speed_menu.extrude = EXTRUDER_SPEED_CN; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_CN; + speed_menu.move_speed = MOVE_SPEED_STATE_CN; + // + printing_more_menu.title = TITLE_MORE_CN; + printing_more_menu.fan = FAN_TEXT_CN; + printing_more_menu.auto_close = AUTO_SHUTDOWN_CN; + printing_more_menu.manual = MANUAL_SHUTDOWN_CN; + printing_more_menu.speed = PRINTING_CHANGESPEED_CN; + printing_more_menu.temp = PRINTING_TEMP_CN; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_CN; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_CN; + print_file_dialog_menu.cancle = DIALOG_CANCLE_CN; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_CN; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_CN; + print_file_dialog_menu.retry = DIALOG_RETRY_CN; + print_file_dialog_menu.stop = DIALOG_STOP_CN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_CN; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_CN; + + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_CN; + print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_CN; + + print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_CN; + print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_CN; + print_file_dialog_menu.reprint=DIALOG_REPRINT_CN; + print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_CN; + + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_CN; + zoffset_menu.inc = ZOFFSET_INC_CN; + zoffset_menu.dec = ZOFFSET_DEC_CN; + + pause_msg_menu.pausing = MESSEGE_PAUSING_CN; + pause_msg_menu.changing = MESSEGE_CHANGING_CN; + pause_msg_menu.unload = MESSEGE_UNLOAD_CN; + pause_msg_menu.waiting = MESSEGE_WAITING_CN; + pause_msg_menu.insert = MESSEGE_INSERT_CN; + pause_msg_menu.load = MESSEGE_LOAD_CN; + pause_msg_menu.purge = MESSEGE_PURGE_CN; + pause_msg_menu.resume = MESSEGE_RESUME_CN; + pause_msg_menu.heat = MESSEGE_HEAT_CN; + pause_msg_menu.heating = MESSEGE_HEATING_CN; + pause_msg_menu.option = MESSEGE_OPTION_CN; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_CN; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_CN; + + break; +#if 1 + #if 1 + case LANG_COMPLEX_CHINESE: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_T_CN; + common_menu.text_back=BACK_TEXT_T_CN; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_T_CN; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_T_CN; + common_menu.print_special_title = PRINTING_GBK; + common_menu.pause_special_title = PRINTING_PAUSE_GBK; + common_menu.operate_special_title = PRINTING_OPERATION_GBK; + // + main_menu.title=TITLE_READYPRINT_T_CN; + main_menu.preheat=PREHEAT_TEXT_T_CN; + main_menu.move=MOVE_TEXT_T_CN; + main_menu.home=HOME_TEXT_T_CN; + main_menu.print=PRINT_TEXT_T_CN; + main_menu.extrude=EXTRUDE_TEXT_T_CN; + main_menu.leveling=LEVELING_TEXT_T_CN; + main_menu.autoleveling=AUTO_LEVELING_TEXT_T_CN; + main_menu.fan = FAN_TEXT_T_CN; + main_menu.set=SET_TEXT_T_CN; + main_menu.more=MORE_TEXT_T_CN; + main_menu.tool = TOOL_TEXT_T_CN; + //TOOL + tool_menu.title = TOOL_TEXT_T_CN; + tool_menu.preheat = TOOL_PREHEAT_T_CN; + tool_menu.extrude = TOOL_EXTRUDE_T_CN; + tool_menu.move = TOOL_MOVE_T_CN; + tool_menu.home= TOOL_HOME_T_CN; + tool_menu.leveling = TOOL_LEVELING_T_CN; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_T_CN; + tool_menu.filament = TOOL_FILAMENT_T_CN; + tool_menu.more = TOOL_MORE_T_CN; + // + preheat_menu.adjust_title = TITLE_ADJUST_T_CN; + preheat_menu.title=TITLE_PREHEAT_T_CN; + preheat_menu.add=ADD_TEXT_T_CN; + preheat_menu.dec=DEC_TEXT_T_CN; + preheat_menu.ext1=EXTRUDER_1_TEXT_T_CN; + preheat_menu.ext2=EXTRUDER_2_TEXT_T_CN; + preheat_menu.hotbed=HEATBED_TEXT_T_CN; + preheat_menu.off=CLOSE_TEXT_T_CN; + preheat_menu.value_state= TEXT_VALUE_T_CN; + preheat_menu.step_1c= TEXT_1C_T_CN; + preheat_menu.step_5c= TEXT_5C_T_CN; + preheat_menu.step_10c= TEXT_10C_T_CN; + // + move_menu.title = MOVE_TEXT_T_CN; + more_menu.zoffset = ZOFFSET_T_CN; + // + home_menu.title=TITLE_HOME_T_CN; + home_menu.stopmove = HOME_STOPMOVE_T_CN; + // + file_menu.title=TITLE_CHOOSEFILE_T_CN; + file_menu.page_up=PAGE_UP_TEXT_T_CN; + file_menu.page_down=PAGE_DOWN_TEXT_T_CN; + file_menu.file_loading = FILE_LOADING_T_CN; + file_menu.no_file = NO_FILE_T_CN; + file_menu.no_file_and_check = NO_FILE_T_CN;//NO_FILE_AND_CHECK_T_CN; + // + extrude_menu.title=TITLE_EXTRUDE_T_CN; + extrude_menu.in=EXTRUDER_IN_TEXT_T_CN; + extrude_menu.out=EXTRUDER_OUT_TEXT_T_CN; + extrude_menu.ext1=EXTRUDER_1_TEXT_T_CN; + extrude_menu.ext2=EXTRUDER_2_TEXT_T_CN; + extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_T_CN; + extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_T_CN; + extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_T_CN; + extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_T_CN; + extrude_menu.temp_value = EXTRUDE_TEXT_VALUE_T_T_CN; + // + leveling_menu.title=TITLE_LEVELING_CN; + leveling_menu.position1=LEVELING_POINT1_TEXT_T_CN; + leveling_menu.position2=LEVELING_POINT2_TEXT_T_CN; + leveling_menu.position3=LEVELING_POINT3_TEXT_T_CN; + leveling_menu.position4=LEVELING_POINT4_TEXT_T_CN; + leveling_menu.position5=LEVELING_POINT5_TEXT_T_CN; + // + set_menu.title=TITLE_SET_T_CN; + set_menu.filesys=FILESYS_TEXT_T_CN; + set_menu.wifi=WIFI_TEXT_T_CN; + set_menu.about=ABOUT_TEXT_T_CN; + set_menu.fan=FAN_TEXT_T_CN; + set_menu.filament=FILAMENT_TEXT_T_CN; + set_menu.breakpoint=BREAK_POINT_TEXT_T_CN; + set_menu.motoroff=MOTOR_OFF_TEXT_T_CN; + set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_T_CN; + set_menu.language=LANGUAGE_TEXT_T_CN; + set_menu.shutdown=SHUTDOWN_TEXT_T_CN; + //set_menu.machine_para = MACHINE_PARA_T_CN; + // + filesys_menu.title = TITLE_FILESYS_T_CN; + filesys_menu.sd_sys = SD_CARD_TEXT_T_CN; + filesys_menu.usb_sys = U_DISK_TEXT_T_CN; + // + more_menu.title = TITLE_MORE_T_CN; + //WIFI + wifi_menu.title=WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_CN; + //wifi_menu.ip = WIFI_IP_TEXT_CN; + //wifi_menu.state= WIFI_STA_TEXT_CN; + wifi_menu.cloud= CLOUD_TEXT_T_CN; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_T_CN; + //CLOUD + cloud_menu.title = TITLE_CLOUD_TEXT_T_CN; + cloud_menu.bind = CLOUD_BINDED_T_CN; + cloud_menu.binded = CLOUD_BINDED_T_CN; + cloud_menu.unbind = CLOUD_UNBIND_T_CN; + cloud_menu.unbinding = CLOUD_UNBINDED_T_CN; + cloud_menu.disconnected = CLOUD_DISCONNECTED_T_CN; + cloud_menu.disable = CLOUD_DISABLE_T_CN; + // + about_menu.title = ABOUT_TEXT_T_CN; + about_menu.type = ABOUT_TYPE_TEXT_T_CN; + about_menu.version = ABOUT_VERSION_TEXT_T_CN; + about_menu.wifi = ABOUT_WIFI_TEXT_T_CN; + + // + fan_menu.title = FAN_TEXT_T_CN; + fan_menu.add = FAN_ADD_TEXT_T_CN; + fan_menu.dec = FAN_DEC_TEXT_T_CN; + fan_menu.state = FAN_TIPS1_TEXT_T_CN; + // + filament_menu.title = TITLE_FILAMENT_T_CN; + filament_menu.in = FILAMENT_IN_TEXT_T_CN; + filament_menu.out = FILAMENT_OUT_TEXT_T_CN; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_T_CN; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_T_CN; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_T_CN; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_T_CN; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_T_CN; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_T_CN; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_T_CN; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_T_CN; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_T_CN; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_T_CN; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_T_CN; + + + // + language_menu.title = TITLE_LANGUAGE_T_CN; + language_menu.next = PAGE_DOWN_TEXT_T_CN; + language_menu.up = PAGE_UP_TEXT_T_CN; + + // + printing_menu.title = TITLE_PRINTING_T_CN; + printing_menu.option = PRINTING_OPERATION_T_CN; + printing_menu.stop = PRINTING_STOP_T_CN; + printing_menu.pause = PRINTING_PAUSE_T_CN; + printing_menu.resume = PRINTING_RESUME_T_CN; + + // + operation_menu.title = TITLE_OPERATION_T_CN; + operation_menu.pause = PRINTING_PAUSE_T_CN; + operation_menu.stop = PRINTING_STOP_T_CN; + operation_menu.temp = PRINTING_TEMP_T_CN; + operation_menu.fan = FAN_TEXT_T_CN; + operation_menu.extr = PRINTING_EXTRUDER_T_CN; + operation_menu.speed = PRINTING_CHANGESPEED_T_CN; + operation_menu.filament= FILAMENT_TEXT_T_CN; + operation_menu.more = PRINTING_MORE_T_CN; + operation_menu.move = PRINTING_MOVE_T_CN; + operation_menu.auto_off = AUTO_SHUTDOWN_T_CN; + operation_menu.manual_off = MANUAL_SHUTDOWN_T_CN; + // + pause_menu.title= TITLE_PAUSE_T_CN; + pause_menu.resume = PRINTING_RESUME_T_CN; + pause_menu.stop = PRINTING_STOP_T_CN; + pause_menu.extrude = PRINTING_EXTRUDER_T_CN; + pause_menu.move = PRINTING_MOVE_T_CN; + pause_menu.filament= FILAMENT_TEXT_T_CN; + pause_menu.more = PRINTING_MORE_T_CN; + + // + speed_menu.title = PRINTING_CHANGESPEED_T_CN; + speed_menu.add = ADD_TEXT_T_CN; + speed_menu.dec = DEC_TEXT_T_CN; + speed_menu.move = MOVE_SPEED_T_CN; + speed_menu.extrude = EXTRUDER_SPEED_T_CN; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_T_CN; + speed_menu.move_speed = MOVE_SPEED_STATE_T_CN; + // + printing_more_menu.title = TITLE_MORE_T_CN; + printing_more_menu.fan = FAN_TEXT_T_CN; + printing_more_menu.auto_close = AUTO_SHUTDOWN_T_CN; + printing_more_menu.manual = MANUAL_SHUTDOWN_T_CN; + printing_more_menu.speed = PRINTING_CHANGESPEED_T_CN; + printing_more_menu.temp = PRINTING_TEMP_T_CN; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_CN; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_T_CN; + print_file_dialog_menu.cancle = DIALOG_CANCLE_T_CN; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_T_CN; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_T_CN; + print_file_dialog_menu.retry = DIALOG_RETRY_T_CN; + print_file_dialog_menu.stop = DIALOG_STOP_T_CN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_T_CN; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_T_CN; + + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_T_CN; + print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_T_CN; + print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_T_CN; + print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_T_CN; + print_file_dialog_menu.reprint=DIALOG_REPRINT_T_CN; + print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_T_CN; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_T_CN; + zoffset_menu.inc = ZOFFSET_INC_T_CN; + zoffset_menu.dec = ZOFFSET_DEC_T_CN; + + pause_msg_menu.pausing = MESSEGE_PAUSING_T_CN; + pause_msg_menu.changing = MESSEGE_CHANGING_T_CN; + pause_msg_menu.unload = MESSEGE_UNLOAD_T_CN; + pause_msg_menu.waiting = MESSEGE_WAITING_T_CN; + pause_msg_menu.insert = MESSEGE_INSERT_T_CN; + pause_msg_menu.load = MESSEGE_LOAD_T_CN; + pause_msg_menu.purge = MESSEGE_PURGE_T_CN; + pause_msg_menu.resume = MESSEGE_RESUME_T_CN; + pause_msg_menu.heat = MESSEGE_HEAT_T_CN; + pause_msg_menu.heating = MESSEGE_HEATING_T_CN; + pause_msg_menu.option = MESSEGE_OPTION_T_CN; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_T_CN; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_T_CN; + break; + case LANG_ENGLISH: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_EN; + common_menu.text_back=BACK_TEXT_EN; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_EN; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_EN; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + // + main_menu.title=TITLE_READYPRINT_EN; + main_menu.preheat=PREHEAT_TEXT_EN; + main_menu.move=MOVE_TEXT_EN; + main_menu.home=HOME_TEXT_EN; + main_menu.print=PRINT_TEXT_EN; + main_menu.extrude=EXTRUDE_TEXT_EN; + main_menu.leveling=LEVELING_TEXT_EN; + main_menu.autoleveling=AUTO_LEVELING_TEXT_EN; + main_menu.fan = FAN_TEXT_EN; + main_menu.set=SET_TEXT_EN; + main_menu.more=MORE_TEXT_EN; + main_menu.tool = TOOL_TEXT_EN; + //TOOL + tool_menu.title = TOOL_TEXT_EN; + tool_menu.preheat = TOOL_PREHEAT_EN; + tool_menu.extrude = TOOL_EXTRUDE_EN; + tool_menu.move = TOOL_MOVE_EN; + tool_menu.home= TOOL_HOME_EN; + tool_menu.leveling = TOOL_LEVELING_EN; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_EN; + tool_menu.filament = TOOL_FILAMENT_EN; + tool_menu.more = TOOL_MORE_EN; + // + preheat_menu.adjust_title = TITLE_ADJUST_EN; + preheat_menu.title=TITLE_PREHEAT_EN; + preheat_menu.add=ADD_TEXT_EN; + preheat_menu.dec=DEC_TEXT_EN; + preheat_menu.ext1=EXTRUDER_1_TEXT_EN; + preheat_menu.ext2=EXTRUDER_2_TEXT_EN; + preheat_menu.hotbed=HEATBED_TEXT_EN; + preheat_menu.off=CLOSE_TEXT_EN; + // + move_menu.title = TITLE_MOVE_EN; + // + home_menu.title=TITLE_HOME_EN; + home_menu.stopmove = HOME_STOPMOVE_EN; + // + file_menu.title=TITLE_CHOOSEFILE_EN; + file_menu.page_up=PAGE_UP_TEXT_EN; + file_menu.page_down=PAGE_DOWN_TEXT_EN; + file_menu.file_loading = FILE_LOADING_EN; + file_menu.no_file = NO_FILE_EN; + file_menu.no_file_and_check = NO_FILE_EN;//NO_FILE_AND_CHECK_EN; + // + extrude_menu.title=TITLE_EXTRUDE_EN; + extrude_menu.in=EXTRUDER_IN_TEXT_EN; + extrude_menu.out=EXTRUDER_OUT_TEXT_EN; + extrude_menu.ext1=EXTRUDER_1_TEXT_EN; + extrude_menu.ext2=EXTRUDER_2_TEXT_EN; + extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_EN; + extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_EN; + extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_EN; + extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_EN; + // + leveling_menu.title=TITLE_LEVELING_EN; + leveling_menu.position1=LEVELING_POINT1_TEXT_EN; + leveling_menu.position2=LEVELING_POINT2_TEXT_EN; + leveling_menu.position3=LEVELING_POINT3_TEXT_EN; + leveling_menu.position4=LEVELING_POINT4_TEXT_EN; + leveling_menu.position5=LEVELING_POINT5_TEXT_EN; + // + set_menu.title=TITLE_SET_EN; + set_menu.filesys=FILESYS_TEXT_EN; + set_menu.wifi=WIFI_TEXT_EN; + set_menu.about=ABOUT_TEXT_EN; + set_menu.fan=FAN_TEXT_EN; + set_menu.filament=FILAMENT_TEXT_EN; + set_menu.breakpoint=BREAK_POINT_TEXT_EN; + set_menu.motoroff=MOTOR_OFF_TEXT_EN; + set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_EN; + set_menu.language=LANGUAGE_TEXT_EN; + set_menu.shutdown=SHUTDOWN_TEXT_EN; + //set_menu.machine_para = MACHINE_PARA_EN; + // + more_menu.title = TITLE_MORE_EN; + more_menu.zoffset = ZOFFSET_EN; + // + filesys_menu.title = TITLE_FILESYS_EN; + filesys_menu.sd_sys = SD_CARD_TEXT_EN; + filesys_menu.usb_sys = U_DISK_TEXT_EN; + //WIFI + wifi_menu.title=WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_EN; + //wifi_menu.ip = WIFI_IP_TEXT_EN; + //wifi_menu.state= WIFI_STA_TEXT_EN; + wifi_menu.cloud= CLOUD_TEXT_EN; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_EN; + + cloud_menu.title = TITLE_CLOUD_TEXT_EN; + cloud_menu.bind = CLOUD_BINDED_EN; + cloud_menu.binded = CLOUD_BINDED_EN; + cloud_menu.unbind = CLOUD_UNBIND_EN; + cloud_menu.unbinding = CLOUD_UNBINDED_EN; + cloud_menu.disconnected = CLOUD_DISCONNECTED_EN; + cloud_menu.disable = CLOUD_DISABLE_EN; + // + about_menu.title = TITLE_ABOUT_EN; + about_menu.type = ABOUT_TYPE_TEXT_EN; + about_menu.version = ABOUT_VERSION_TEXT_EN; + about_menu.wifi = ABOUT_WIFI_TEXT_EN; + // + fan_menu.title = TITLE_FAN_EN; + fan_menu.add = FAN_ADD_TEXT_EN; + fan_menu.dec = FAN_DEC_TEXT_EN; + fan_menu.state = FAN_TIPS1_TEXT_EN; + // + filament_menu.title = TITLE_FILAMENT_EN; + filament_menu.in = FILAMENT_IN_TEXT_EN; + filament_menu.out = FILAMENT_OUT_TEXT_EN; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_EN; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_EN; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_EN; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_EN; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_EN; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN; + + // + language_menu.title = TITLE_LANGUAGE_EN; + language_menu.next = PAGE_DOWN_TEXT_EN; + language_menu.up = PAGE_UP_TEXT_EN; + // + printing_menu.title = TITLE_PRINTING_EN; + printing_menu.option = PRINTING_OPERATION_EN; + printing_menu.stop = PRINTING_STOP_EN; + printing_menu.pause = PRINTING_PAUSE_EN; + printing_menu.resume = PRINTING_RESUME_EN; + + // + operation_menu.title = TITLE_OPERATION_EN; + operation_menu.pause = PRINTING_PAUSE_EN; + operation_menu.stop = PRINTING_STOP_EN; + operation_menu.temp = PRINTING_TEMP_EN; + operation_menu.fan = FAN_TEXT_EN; + operation_menu.extr = PRINTING_EXTRUDER_EN; + operation_menu.speed = PRINTING_CHANGESPEED_EN; + operation_menu.filament= FILAMENT_TEXT_EN; + operation_menu.more = PRINTING_MORE_EN; + operation_menu.move = PRINTING_MOVE_EN; + operation_menu.auto_off = AUTO_SHUTDOWN_EN; + operation_menu.manual_off = MANUAL_SHUTDOWN_EN; + // + pause_menu.title= TITLE_PAUSE_EN; + pause_menu.resume = PRINTING_RESUME_EN; + pause_menu.stop = PRINTING_STOP_EN; + pause_menu.extrude = PRINTING_EXTRUDER_EN; + pause_menu.move = PRINTING_MOVE_EN; + pause_menu.filament = FILAMENT_TEXT_EN; + pause_menu.more = PRINTING_MORE_EN; + + // + speed_menu.title = TITLE_CHANGESPEED_EN; + speed_menu.add = ADD_TEXT_EN; + speed_menu.dec = DEC_TEXT_EN; + speed_menu.move = MOVE_SPEED_EN; + speed_menu.extrude = EXTRUDER_SPEED_EN; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_EN; + speed_menu.move_speed = MOVE_SPEED_STATE_EN; + // + printing_more_menu.title = TITLE_MORE_EN; + printing_more_menu.fan = FAN_TEXT_EN; + printing_more_menu.auto_close = AUTO_SHUTDOWN_EN; + printing_more_menu.manual = MANUAL_SHUTDOWN_EN; + printing_more_menu.speed = PRINTING_CHANGESPEED_EN; + printing_more_menu.temp = PRINTING_TEMP_EN; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_EN; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_EN; + print_file_dialog_menu.cancle = DIALOG_CANCLE_EN; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_EN; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; + print_file_dialog_menu.retry = DIALOG_RETRY_EN; + print_file_dialog_menu.stop = DIALOG_STOP_EN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_EN; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_EN; + print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_EN; + print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_EN; + print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_EN; + print_file_dialog_menu.reprint=DIALOG_REPRINT_EN; + print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_EN; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_EN; + zoffset_menu.inc = ZOFFSET_INC_EN; + zoffset_menu.dec = ZOFFSET_DEC_EN; + + pause_msg_menu.pausing = MESSEGE_PAUSING_EN; + pause_msg_menu.changing = MESSEGE_CHANGING_EN; + pause_msg_menu.unload = MESSEGE_UNLOAD_EN; + pause_msg_menu.waiting = MESSEGE_WAITING_EN; + pause_msg_menu.insert = MESSEGE_INSERT_EN; + pause_msg_menu.load = MESSEGE_LOAD_EN; + pause_msg_menu.purge = MESSEGE_PURGE_EN; + pause_msg_menu.resume = MESSEGE_RESUME_EN; + pause_msg_menu.heat = MESSEGE_HEAT_EN; + pause_msg_menu.heating = MESSEGE_HEATING_EN; + pause_msg_menu.option = MESSEGE_OPTION_EN; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_EN; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_EN; + break; + case LANG_RUSSIAN: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_RU; + common_menu.text_back=BACK_TEXT_RU; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_RU; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_RU; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + // + main_menu.title=TITLE_READYPRINT_RU; + main_menu.preheat=PREHEAT_TEXT_RU; + main_menu.move=MOVE_TEXT_RU; + main_menu.home=HOME_TEXT_RU; + main_menu.print=PRINT_TEXT_RU; + main_menu.extrude=EXTRUDE_TEXT_RU; + main_menu.leveling=LEVELING_TEXT_RU; + main_menu.autoleveling=AUTO_LEVELING_TEXT_RU; + main_menu.fan = FAN_TEXT_RU; + main_menu.set=SET_TEXT_RU; + main_menu.more=MORE_TEXT_RU; + main_menu.tool = TOOL_TEXT_RU; + //TOOL + tool_menu.title = TOOL_TEXT_RU; + tool_menu.preheat = TOOL_PREHEAT_RU; + tool_menu.extrude = TOOL_EXTRUDE_RU; + tool_menu.move = TOOL_MOVE_RU; + tool_menu.home= TOOL_HOME_RU; + tool_menu.leveling = TOOL_LEVELING_RU; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_RU; + tool_menu.filament = TOOL_FILAMENT_RU; + tool_menu.more = TOOL_MORE_RU; + // + preheat_menu.adjust_title = TITLE_ADJUST_RU; + preheat_menu.title=TITLE_PREHEAT_RU; + preheat_menu.add=ADD_TEXT_RU; + preheat_menu.dec=DEC_TEXT_RU; + preheat_menu.ext1=EXTRUDER_1_TEXT_RU; + preheat_menu.ext2=EXTRUDER_2_TEXT_RU; + preheat_menu.hotbed=HEATBED_TEXT_RU; + preheat_menu.off=CLOSE_TEXT_RU; + // + move_menu.title = MOVE_TEXT_RU; + // + home_menu.title=TITLE_HOME_RU; + home_menu.stopmove = HOME_STOPMOVE_RU; + // + file_menu.title=TITLE_CHOOSEFILE_RU; + file_menu.page_up=PAGE_UP_TEXT_RU; + file_menu.page_down=PAGE_DOWN_TEXT_RU; + file_menu.file_loading = FILE_LOADING_RU; + file_menu.no_file = NO_FILE_RU; + file_menu.no_file_and_check = NO_FILE_RU;//NO_FILE_AND_CHECK_RU; + // + extrude_menu.title=TITLE_EXTRUDE_RU; + extrude_menu.in=EXTRUDER_IN_TEXT_RU; + extrude_menu.out=EXTRUDER_OUT_TEXT_RU; + extrude_menu.ext1=EXTRUDER_1_TEXT_RU; + extrude_menu.ext2=EXTRUDER_2_TEXT_RU; + extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_RU; + extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_RU; + extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_RU; + extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_RU; + // + leveling_menu.title=TITLE_LEVELING_RU; + leveling_menu.position1=LEVELING_POINT1_TEXT_RU; + leveling_menu.position2=LEVELING_POINT2_TEXT_RU; + leveling_menu.position3=LEVELING_POINT3_TEXT_RU; + leveling_menu.position4=LEVELING_POINT4_TEXT_RU; + leveling_menu.position5=LEVELING_POINT5_TEXT_RU; + // + set_menu.title=TITLE_SET_RU; + set_menu.filesys=FILESYS_TEXT_RU; + set_menu.wifi=WIFI_TEXT_RU; + set_menu.about=ABOUT_TEXT_RU; + set_menu.fan=FAN_TEXT_RU; + set_menu.filament=FILAMENT_TEXT_RU; + set_menu.breakpoint=BREAK_POINT_TEXT_RU; + set_menu.motoroff=MOTOR_OFF_TEXT_RU; + set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_RU; + set_menu.language=LANGUAGE_TEXT_RU; + set_menu.shutdown=SHUTDOWN_TEXT_RU; + // + more_menu.title = TITLE_MORE_RU; + more_menu.zoffset = ZOFFSET_RU; + // + filesys_menu.title = TITLE_FILESYS_RU; + filesys_menu.sd_sys = SD_CARD_TEXT_RU; + filesys_menu.usb_sys = U_DISK_TEXT_RU; + //WIFI + wifi_menu.title=WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_RU; + //wifi_menu.ip = WIFI_IP_TEXT_RU; + //wifi_menu.state= WIFI_STA_TEXT_RU; + wifi_menu.cloud= CLOUD_TEXT_RU; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_RU; + + + cloud_menu.title = TITLE_CLOUD_TEXT_RU; + cloud_menu.bind = CLOUD_BINDED_RU; + cloud_menu.binded = CLOUD_BINDED_RU; + cloud_menu.unbind = CLOUD_UNBIND_RU; + cloud_menu.unbinding = CLOUD_UNBINDED_RU; + cloud_menu.disconnected = CLOUD_DISCONNECTED_RU; + cloud_menu.disable = CLOUD_DISABLE_RU; + // + about_menu.title = ABOUT_TEXT_RU; + about_menu.type = ABOUT_TYPE_TEXT_RU; + about_menu.version = ABOUT_VERSION_TEXT_RU; + about_menu.wifi = ABOUT_WIFI_TEXT_RU; + // + fan_menu.title = FAN_TEXT_RU; + fan_menu.add = FAN_ADD_TEXT_RU; + fan_menu.dec = FAN_DEC_TEXT_RU; + fan_menu.state = FAN_TIPS1_TEXT_RU; + // + filament_menu.title = TITLE_FILAMENT_RU; + filament_menu.in = FILAMENT_IN_TEXT_RU; + filament_menu.out = FILAMENT_OUT_TEXT_RU; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_RU; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_RU; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_RU; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_RU; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_RU; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU; + + // + language_menu.title = LANGUAGE_TEXT_RU; + language_menu.next = PAGE_DOWN_TEXT_RU; + language_menu.up = PAGE_UP_TEXT_RU; + // + printing_menu.title = TITLE_PRINTING_RU; + printing_menu.option = PRINTING_OPERATION_RU; + printing_menu.stop = PRINTING_STOP_RU; + printing_menu.pause = PRINTING_PAUSE_RU; + printing_menu.resume = PRINTING_RESUME_RU; + + // + operation_menu.title = TITLE_OPERATION_RU; + operation_menu.pause = PRINTING_PAUSE_RU; + operation_menu.stop = PRINTING_STOP_RU; + operation_menu.temp = PRINTING_TEMP_RU; + operation_menu.fan = FAN_TEXT_RU; + operation_menu.extr = PRINTING_EXTRUDER_RU; + operation_menu.speed = PRINTING_CHANGESPEED_RU; + operation_menu.filament= FILAMENT_TEXT_RU; + operation_menu.more = PRINTING_MORE_RU; + operation_menu.move = PRINTING_MOVE_RU; + operation_menu.auto_off = AUTO_SHUTDOWN_RU; + operation_menu.manual_off = MANUAL_SHUTDOWN_RU; + // + pause_menu.title= TITLE_PAUSE_RU; + pause_menu.resume = PRINTING_RESUME_RU; + pause_menu.stop = PRINTING_STOP_RU; + pause_menu.extrude = PRINTING_EXTRUDER_RU; + pause_menu.move = PRINTING_MOVE_RU; + pause_menu.filament= FILAMENT_TEXT_RU; + pause_menu.more = PRINTING_MORE_RU; + + // + speed_menu.title = PRINTING_CHANGESPEED_RU; + speed_menu.add = ADD_TEXT_RU; + speed_menu.dec = DEC_TEXT_RU; + speed_menu.move = MOVE_SPEED_RU; + speed_menu.extrude = EXTRUDER_SPEED_RU; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_RU; + speed_menu.move_speed = MOVE_SPEED_STATE_RU; + // + printing_more_menu.title = TITLE_MORE_RU; + printing_more_menu.fan = FAN_TEXT_RU; + printing_more_menu.auto_close = AUTO_SHUTDOWN_RU; + printing_more_menu.manual = MANUAL_SHUTDOWN_RU; + printing_more_menu.speed = PRINTING_CHANGESPEED_RU; + printing_more_menu.temp = PRINTING_TEMP_RU; + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_RU; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_RU; + print_file_dialog_menu.cancle = DIALOG_CANCLE_RU; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_RU; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_RU; + print_file_dialog_menu.retry = DIALOG_RETRY_RU; + print_file_dialog_menu.stop = DIALOG_STOP_RU; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_RU; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_RU; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_RU; + print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_RU; + print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_RU; + print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_RU; + print_file_dialog_menu.reprint=DIALOG_REPRINT_RU; + print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_RU; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_RU; + zoffset_menu.inc = ZOFFSET_INC_RU; + zoffset_menu.dec = ZOFFSET_DEC_RU; + + pause_msg_menu.pausing = MESSEGE_PAUSING_RU; + pause_msg_menu.changing = MESSEGE_CHANGING_RU; + pause_msg_menu.unload = MESSEGE_UNLOAD_RU; + pause_msg_menu.waiting = MESSEGE_WAITING_RU; + pause_msg_menu.insert = MESSEGE_INSERT_RU; + pause_msg_menu.load = MESSEGE_LOAD_RU; + pause_msg_menu.purge = MESSEGE_PURGE_RU; + pause_msg_menu.resume = MESSEGE_RESUME_RU; + pause_msg_menu.heat = MESSEGE_HEAT_RU; + pause_msg_menu.heating = MESSEGE_HEATING_RU; + pause_msg_menu.option = MESSEGE_OPTION_RU; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_RU; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_RU; + break; + case LANG_SPANISH: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_SP; + common_menu.text_back=BACK_TEXT_SP; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_SP; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_SP; + common_menu.print_special_title = PRINTING_SP; + common_menu.pause_special_title = PRINTING_PAUSAR_SP; + common_menu.operate_special_title = PRINTING_AJUSTES_SP; + // + main_menu.title=TITLE_READYPRINT_SP; + main_menu.preheat=PREHEAT_TEXT_SP; + main_menu.move=MOVE_TEXT_SP; + main_menu.home=HOME_TEXT_SP; + main_menu.print=PRINT_TEXT_SP; + main_menu.extrude=EXTRUDE_TEXT_SP; + main_menu.leveling=LEVELING_TEXT_SP; + main_menu.autoleveling=AUTO_LEVELING_TEXT_SP; + main_menu.fan = FAN_TEXT_SP; + main_menu.set=SET_TEXT_SP; + main_menu.more=MORE_TEXT_SP; + main_menu.tool = TOOL_TEXT_SP; + //TOOL + tool_menu.title = TOOL_TEXT_SP; + tool_menu.preheat = TOOL_PREHEAT_SP; + tool_menu.extrude = TOOL_EXTRUDE_SP; + tool_menu.move = TOOL_MOVE_SP; + tool_menu.home= TOOL_HOME_SP; + tool_menu.leveling = TOOL_LEVELING_SP; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_SP; + tool_menu.filament = TOOL_FILAMENT_SP; + tool_menu.more = TOOL_MORE_SP; + // + preheat_menu.adjust_title = TITLE_ADJUST_SP; + preheat_menu.title=TITLE_PREHEAT_SP; + preheat_menu.add=ADD_TEXT_SP; + preheat_menu.dec=DEC_TEXT_SP; + preheat_menu.ext1=EXTRUDER_1_TEXT_SP; + preheat_menu.ext2=EXTRUDER_2_TEXT_SP; + preheat_menu.hotbed=HEATBED_TEXT_SP; + preheat_menu.off=CLOSE_TEXT_SP; + // + move_menu.title = MOVE_TEXT_SP; + // + home_menu.title=TITLE_HOME_SP; + home_menu.home_x= HOME_X_TEXT_SP; + home_menu.home_y= HOME_Y_TEXT_SP; + home_menu.home_z= HOME_Z_TEXT_SP; + home_menu.home_all= HOME_ALL_TEXT_SP; + home_menu.stopmove = HOME_STOPMOVE_SP; + // + file_menu.title=TITLE_CHOOSEFILE_SP; + file_menu.page_up=PAGE_UP_TEXT_SP; + file_menu.page_down=PAGE_DOWN_TEXT_SP; + file_menu.file_loading = FILE_LOADING_SP; + file_menu.no_file = NO_FILE_SP; + file_menu.no_file_and_check = NO_FILE_SP;//NO_FILE_AND_CHECK_SP; + // + extrude_menu.title=TITLE_EXTRUDE_SP; + extrude_menu.in=EXTRUDER_IN_TEXT_SP; + extrude_menu.out=EXTRUDER_OUT_TEXT_SP; + extrude_menu.ext1=EXTRUDER_1_TEXT_SP; + extrude_menu.ext2=EXTRUDER_2_TEXT_SP; + extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_SP; + extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_SP; + extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_SP; + extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_SP; + // + leveling_menu.title=TITLE_LEVELING_SP; + leveling_menu.position1=LEVELING_POINT1_TEXT_SP; + leveling_menu.position2=LEVELING_POINT2_TEXT_SP; + leveling_menu.position3=LEVELING_POINT3_TEXT_SP; + leveling_menu.position4=LEVELING_POINT4_TEXT_SP; + leveling_menu.position5=LEVELING_POINT5_TEXT_SP; + // + set_menu.title=TITLE_SET_SP; + set_menu.filesys=FILESYS_TEXT_SP; + set_menu.wifi=WIFI_TEXT_SP; + set_menu.about=ABOUT_TEXT_SP; + set_menu.fan=FAN_TEXT_SP; + set_menu.filament=FILAMENT_TEXT_SP; + set_menu.breakpoint=BREAK_POINT_TEXT_SP; + set_menu.motoroff=MOTOR_OFF_TEXT_SP; + set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_SP; + set_menu.language=LANGUAGE_TEXT_SP; + set_menu.shutdown=SHUTDOWN_TEXT_SP; + // + more_menu.title = TITLE_MORE_SP; + more_menu.zoffset = ZOFFSET_SP; + // + filesys_menu.title = TITLE_FILESYS_SP; + filesys_menu.sd_sys = SD_CARD_TEXT_SP; + filesys_menu.usb_sys = U_DISK_TEXT_SP; + + //WIFI + wifi_menu.title=WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_SP; + //wifi_menu.ip = WIFI_IP_TEXT_SP; + //wifi_menu.state= WIFI_STA_TEXT_SP; + wifi_menu.cloud= CLOUD_TEXT_SP; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_SP; + + cloud_menu.title = TITLE_CLOUD_TEXT_SP; + cloud_menu.bind = CLOUD_BINDED_SP; + cloud_menu.binded = CLOUD_BINDED_SP; + cloud_menu.unbind = CLOUD_UNBIND_SP; + cloud_menu.unbinding = CLOUD_UNBINDED_SP; + cloud_menu.disconnected = CLOUD_DISCONNECTED_SP; + cloud_menu.disable = CLOUD_DISABLE_SP; + // + about_menu.title = ABOUT_TEXT_SP; + about_menu.type = ABOUT_TYPE_TEXT_SP; + about_menu.version = ABOUT_VERSION_TEXT_SP; + about_menu.wifi = ABOUT_WIFI_TEXT_SP; + // + fan_menu.title = FAN_TEXT_SP; + fan_menu.add = FAN_ADD_TEXT_SP; + fan_menu.dec = FAN_DEC_TEXT_SP; + fan_menu.state = FAN_TIPS1_TEXT_SP; + // + filament_menu.title = TITLE_FILAMENT_SP; + filament_menu.in = FILAMENT_IN_TEXT_SP; + filament_menu.out = FILAMENT_OUT_TEXT_SP; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_SP; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_SP; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_SP; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_SP; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_SP; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP; + + // + language_menu.title = LANGUAGE_TEXT_SP; + language_menu.next = PAGE_DOWN_TEXT_SP; + language_menu.up = PAGE_UP_TEXT_SP; + // + printing_menu.title = TITLE_PRINTING_SP; + printing_menu.option = PRINTING_OPERATION_SP; + printing_menu.stop = PRINTING_STOP_SP; + printing_menu.pause = PRINTING_PAUSE_SP; + printing_menu.resume = PRINTING_RESUME_SP; + + // + operation_menu.title = TITLE_OPERATION_SP; + operation_menu.pause = PRINTING_PAUSE_SP; + operation_menu.stop = PRINTING_STOP_SP; + operation_menu.temp = PRINTING_TEMP_SP; + operation_menu.fan = FAN_TEXT_SP; + operation_menu.extr = PRINTING_EXTRUDER_SP; + operation_menu.speed = PRINTING_CHANGESPEED_SP; + operation_menu.filament = FILAMENT_TEXT_SP; + operation_menu.more = PRINTING_MORE_SP; + operation_menu.move = PRINTING_MOVE_SP; + operation_menu.auto_off = AUTO_SHUTDOWN_SP; + operation_menu.manual_off = MANUAL_SHUTDOWN_SP; + // + pause_menu.title= TITLE_PAUSE_RU; + pause_menu.resume = PRINTING_RESUME_SP; + pause_menu.stop = PRINTING_STOP_SP; + pause_menu.extrude = PRINTING_EXTRUDER_SP; + pause_menu.move = PRINTING_MOVE_SP; + pause_menu.filament= FILAMENT_TEXT_SP; + pause_menu.more = PRINTING_MORE_SP; + + // + speed_menu.title = PRINTING_CHANGESPEED_SP; + speed_menu.add = ADD_TEXT_SP; + speed_menu.dec = DEC_TEXT_SP; + speed_menu.move = MOVE_SPEED_SP; + speed_menu.extrude = EXTRUDER_SPEED_SP; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_SP; + speed_menu.move_speed = MOVE_SPEED_STATE_SP; + // + printing_more_menu.title= TITLE_MORE_SP; + printing_more_menu.fan = FAN_TEXT_SP; + printing_more_menu.auto_close = AUTO_SHUTDOWN_SP; + printing_more_menu.manual = MANUAL_SHUTDOWN_SP; + printing_more_menu.speed = PRINTING_CHANGESPEED_SP; + printing_more_menu.temp = PRINTING_TEMP_SP; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_SP; + print_file_dialog_menu.cancle = DIALOG_CANCLE_SP; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_SP; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_SP; + print_file_dialog_menu.retry = DIALOG_RETRY_SP; + print_file_dialog_menu.stop = DIALOG_STOP_SP; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_SP; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_SP; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_SP; + print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_SP; + print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_SP; + print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_SP; + print_file_dialog_menu.reprint=DIALOG_REPRINT_SP; + print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_SP; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_SP; + zoffset_menu.inc = ZOFFSET_INC_SP; + zoffset_menu.dec = ZOFFSET_DEC_SP; + + pause_msg_menu.pausing = MESSEGE_PAUSING_SP; + pause_msg_menu.changing = MESSEGE_CHANGING_SP; + pause_msg_menu.unload = MESSEGE_UNLOAD_SP; + pause_msg_menu.waiting = MESSEGE_WAITING_SP; + pause_msg_menu.insert = MESSEGE_INSERT_SP; + pause_msg_menu.load = MESSEGE_LOAD_SP; + pause_msg_menu.purge = MESSEGE_PURGE_SP; + pause_msg_menu.resume = MESSEGE_RESUME_SP; + pause_msg_menu.heat = MESSEGE_HEAT_SP; + pause_msg_menu.heating = MESSEGE_HEATING_SP; + pause_msg_menu.option = MESSEGE_OPTION_SP; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_SP; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_SP; + break; + #endif + + case LANG_FRENCH: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_FR; + common_menu.text_back=BACK_TEXT_FR; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_FR; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_FR; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + + // + main_menu.title=TITLE_READYPRINT_FR; + main_menu.preheat=PREHEAT_TEXT_FR; + main_menu.move=MOVE_TEXT_FR; + main_menu.home=HOME_TEXT_FR; + main_menu.print=PRINT_TEXT_FR; + main_menu.extrude=EXTRUDE_TEXT_FR; + main_menu.leveling=LEVELING_TEXT_FR; + main_menu.autoleveling=AUTO_LEVELING_TEXT_FR; + main_menu.fan = FAN_TEXT_FR; + main_menu.set=SET_TEXT_FR; + main_menu.more=MORE_TEXT_FR; + main_menu.tool = TOOL_TEXT_FR; + //TOOL + tool_menu.title = TOOL_TEXT_FR; + tool_menu.preheat = TOOL_PREHEAT_FR; + tool_menu.extrude = TOOL_EXTRUDE_FR; + tool_menu.move = TOOL_MOVE_FR; + tool_menu.home= TOOL_HOME_FR; + tool_menu.leveling = TOOL_LEVELING_FR; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_FR; + tool_menu.filament = TOOL_FILAMENT_FR; + tool_menu.more = TOOL_MORE_FR; + // + preheat_menu.adjust_title = TITLE_ADJUST_FR; + preheat_menu.title=TITLE_PREHEAT_FR; + preheat_menu.add=ADD_TEXT_FR; + preheat_menu.dec=DEC_TEXT_FR; + preheat_menu.ext1=EXTRUDER_1_TEXT_FR; + preheat_menu.ext2=EXTRUDER_2_TEXT_FR; + preheat_menu.hotbed =HEATBED_TEXT_FR; + preheat_menu.off=CLOSE_TEXT_FR; + // + move_menu.title = MOVE_TEXT_FR; + // + home_menu.title=TITLE_HOME_FR; + home_menu.stopmove = HOME_STOPMOVE_FR; + // + file_menu.title=TITLE_CHOOSEFILE_FR; + file_menu.page_up=PAGE_UP_TEXT_FR; + file_menu.page_down=PAGE_DOWN_TEXT_FR; + // + extrude_menu.title=TITLE_EXTRUDE_FR; + extrude_menu.in=EXTRUDER_IN_TEXT_FR; + extrude_menu.out=EXTRUDER_OUT_TEXT_FR; + extrude_menu.ext1=EXTRUDER_1_TEXT_FR; + extrude_menu.ext2=EXTRUDER_2_TEXT_FR; + extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_FR; + extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_FR; + extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_FR; + extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_FR; + // + leveling_menu.title=TITLE_LEVELING_FR; + leveling_menu.position1=LEVELING_POINT1_TEXT_FR; + leveling_menu.position2=LEVELING_POINT2_TEXT_FR; + leveling_menu.position3=LEVELING_POINT3_TEXT_FR; + leveling_menu.position4=LEVELING_POINT4_TEXT_FR; + leveling_menu.position5=LEVELING_POINT5_TEXT_FR; + // + set_menu.title=TITLE_SET_FR; + set_menu.filesys=FILESYS_TEXT_FR; + set_menu.wifi=WIFI_TEXT_FR; + set_menu.about=ABOUT_TEXT_FR; + set_menu.fan=FAN_TEXT_FR; + set_menu.filament=FILAMENT_TEXT_FR; + set_menu.breakpoint=BREAK_POINT_TEXT_FR; + set_menu.motoroff=MOTOR_OFF_TEXT_FR; + set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_FR; + set_menu.language=LANGUAGE_TEXT_FR; + set_menu.shutdown=SHUTDOWN_TEXT_FR; + // + more_menu.title = TITLE_MORE_FR; + more_menu.zoffset = ZOFFSET_FR; + // + filesys_menu.title = TITLE_FILESYS_FR; + filesys_menu.sd_sys = SD_CARD_TEXT_FR; + filesys_menu.usb_sys = U_DISK_TEXT_FR; + file_menu.file_loading = FILE_LOADING_FR; + file_menu.no_file = NO_FILE_FR; + file_menu.no_file_and_check = NO_FILE_FR;//NO_FILE_AND_CHECK_FR; + //WIFI + wifi_menu.title=WIFI_NAME_TEXT_FR; + //wifi_menu.key = WIFI_KEY_TEXT_FR; + //wifi_menu.ip = WIFI_IP_TEXT_FR; + //wifi_menu.state= WIFI_STA_TEXT_FR; + //wifi_menu.cloud= CLOSE_TEXT_FR; + wifi_menu.cloud= CLOUD_TEXT_FR; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_FR; + + cloud_menu.title = TITLE_CLOUD_TEXT_FR; + cloud_menu.bind = CLOUD_BINDED_FR; + cloud_menu.binded = CLOUD_BINDED_FR; + cloud_menu.unbind = CLOUD_UNBIND_FR; + cloud_menu.unbinding = CLOUD_UNBINDED_FR; + cloud_menu.disconnected = CLOUD_DISCONNECTED_FR; + cloud_menu.disable = CLOUD_DISABLE_FR; + // + about_menu.title = ABOUT_TEXT_FR; + about_menu.type = ABOUT_TYPE_TEXT_FR; + about_menu.version = ABOUT_VERSION_TEXT_FR; + about_menu.wifi = ABOUT_WIFI_TEXT_FR; + // + fan_menu.title = FAN_TEXT_FR; + fan_menu.add = FAN_ADD_TEXT_FR; + fan_menu.dec = FAN_DEC_TEXT_FR; + fan_menu.state = FAN_TIPS1_TEXT_FR; + // + filament_menu.title = TITLE_FILAMENT_FR; + filament_menu.in = FILAMENT_IN_TEXT_FR; + filament_menu.out = FILAMENT_OUT_TEXT_FR; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_FR; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_FR; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_FR; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_FR; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_FR; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR; + + // + language_menu.title = LANGUAGE_TEXT_FR; + + // + printing_menu.title = TITLE_PRINTING_FR; + printing_menu.option = PRINTING_OPERATION_FR; + printing_menu.stop = PRINTING_STOP_FR; + printing_menu.pause = PRINTING_PAUSE_FR; + printing_menu.resume = PRINTING_RESUME_FR; + + // + operation_menu.title = TITLE_OPERATION_FR; + operation_menu.pause = PRINTING_PAUSE_FR; + operation_menu.stop = PRINTING_STOP_FR; + operation_menu.temp = PRINTING_TEMP_FR; + operation_menu.fan = FAN_TEXT_FR; + operation_menu.extr = PRINTING_EXTRUDER_FR; + operation_menu.speed = PRINTING_CHANGESPEED_FR; + operation_menu.filament = FILAMENT_TEXT_FR; + operation_menu.more = PRINTING_MORE_FR; + operation_menu.move = PRINTING_MOVE_FR; + operation_menu.auto_off = AUTO_SHUTDOWN_FR; + operation_menu.manual_off = MANUAL_SHUTDOWN_FR; + // + pause_menu.title= TITLE_PAUSE_FR; + pause_menu.resume = PRINTING_RESUME_FR; + pause_menu.stop = PRINTING_STOP_FR; + pause_menu.extrude = PRINTING_EXTRUDER_FR; + pause_menu.move = PRINTING_MOVE_FR; + pause_menu.filament = FILAMENT_TEXT_FR; + pause_menu.more = PRINTING_MORE_FR; + + // + speed_menu.title = PRINTING_CHANGESPEED_FR; + speed_menu.add = ADD_TEXT_FR; + speed_menu.dec = DEC_TEXT_FR; + speed_menu.move = MOVE_SPEED_FR; + speed_menu.extrude = EXTRUDER_SPEED_FR; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_FR; + speed_menu.move_speed = MOVE_SPEED_STATE_FR; + // + printing_more_menu.fan = FAN_TEXT_FR; + printing_more_menu.auto_close = AUTO_SHUTDOWN_FR; + printing_more_menu.manual = MANUAL_SHUTDOWN_FR; + printing_more_menu.speed = PRINTING_CHANGESPEED_FR; + printing_more_menu.temp = PRINTING_TEMP_FR; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_FR; + print_file_dialog_menu.cancle = DIALOG_CANCLE_FR; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_FR; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_FR; + print_file_dialog_menu.retry = DIALOG_RETRY_FR; + print_file_dialog_menu.stop = DIALOG_STOP_FR; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_FR; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_FR; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_FR; + print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_FR; + print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_FR; + print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_FR; + print_file_dialog_menu.reprint=DIALOG_REPRINT_FR; + print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_FR; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_FR; + zoffset_menu.inc = ZOFFSET_INC_FR; + zoffset_menu.dec = ZOFFSET_DEC_FR; + + pause_msg_menu.pausing = MESSEGE_PAUSING_FR; + pause_msg_menu.changing = MESSEGE_CHANGING_FR; + pause_msg_menu.unload = MESSEGE_UNLOAD_FR; + pause_msg_menu.waiting = MESSEGE_WAITING_FR; + pause_msg_menu.insert = MESSEGE_INSERT_FR; + pause_msg_menu.load = MESSEGE_LOAD_FR; + pause_msg_menu.purge = MESSEGE_PURGE_FR; + pause_msg_menu.resume = MESSEGE_RESUME_FR; + pause_msg_menu.heat = MESSEGE_HEAT_FR; + pause_msg_menu.heating = MESSEGE_HEATING_FR; + pause_msg_menu.option = MESSEGE_OPTION_FR; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_FR; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_FR; + break; + + case LANG_ITALY: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_IT; + common_menu.text_back=BACK_TEXT_IT; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_IT; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_IT; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + + // + main_menu.title=TITLE_READYPRINT_IT; + main_menu.preheat=PREHEAT_TEXT_IT; + main_menu.move=MOVE_TEXT_IT; + main_menu.home=HOME_TEXT_IT; + main_menu.print=PRINT_TEXT_IT; + main_menu.extrude=EXTRUDE_TEXT_IT; + main_menu.leveling=LEVELING_TEXT_IT; + main_menu.autoleveling=AUTO_LEVELING_TEXT_IT; + main_menu.fan = FAN_TEXT_IT; + main_menu.set=SET_TEXT_IT; + main_menu.more=MORE_TEXT_IT; + main_menu.tool = TOOL_TEXT_IT; + //TOOL + tool_menu.title = TOOL_TEXT_IT; + tool_menu.preheat = TOOL_PREHEAT_IT; + tool_menu.extrude = TOOL_EXTRUDE_IT; + tool_menu.move = TOOL_MOVE_IT; + tool_menu.home= TOOL_HOME_IT; + tool_menu.leveling = TOOL_LEVELING_IT; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_IT; + tool_menu.filament = TOOL_FILAMENT_IT; + tool_menu.more = TOOL_MORE_IT; + // + preheat_menu.adjust_title = TITLE_ADJUST_IT; + preheat_menu.title=TITLE_PREHEAT_IT; + preheat_menu.add=ADD_TEXT_IT; + preheat_menu.dec=DEC_TEXT_IT; + preheat_menu.ext1=EXTRUDER_1_TEXT_IT; + preheat_menu.ext2=EXTRUDER_2_TEXT_IT; + preheat_menu.hotbed=HEATBED_TEXT_IT; + preheat_menu.off=CLOSE_TEXT_IT; + // + move_menu.title = MOVE_TEXT_IT; + // + home_menu.title=TITLE_HOME_IT; + home_menu.stopmove = HOME_STOPMOVE_IT; + // + file_menu.title=TITLE_CHOOSEFILE_IT; + file_menu.page_up=PAGE_UP_TEXT_IT; + file_menu.page_down=PAGE_DOWN_TEXT_IT; + file_menu.file_loading = FILE_LOADING_IT; + file_menu.no_file = NO_FILE_IT; + file_menu.no_file_and_check = NO_FILE_IT;//NO_FILE_AND_CHECK_IT; + // + extrude_menu.title=TITLE_EXTRUDE_IT; + extrude_menu.in=EXTRUDER_IN_TEXT_IT; + extrude_menu.out=EXTRUDER_OUT_TEXT_IT; + extrude_menu.ext1=EXTRUDER_1_TEXT_IT; + extrude_menu.ext2=EXTRUDER_2_TEXT_IT; + extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_IT; + extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_IT; + extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_IT; + extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_IT; + // + leveling_menu.title=TITLE_LEVELING_IT; + leveling_menu.position1=LEVELING_POINT1_TEXT_IT; + leveling_menu.position2=LEVELING_POINT2_TEXT_IT; + leveling_menu.position3=LEVELING_POINT3_TEXT_IT; + leveling_menu.position4=LEVELING_POINT4_TEXT_IT; + leveling_menu.position5=LEVELING_POINT5_TEXT_IT; + // + set_menu.title=TITLE_SET_IT; + set_menu.filesys=FILESYS_TEXT_IT; + set_menu.wifi=WIFI_TEXT_IT; + set_menu.about=ABOUT_TEXT_IT; + set_menu.fan=FAN_TEXT_IT; + set_menu.filament=FILAMENT_TEXT_IT; + set_menu.breakpoint=BREAK_POINT_TEXT_IT; + set_menu.motoroff=MOTOR_OFF_TEXT_IT; + set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_IT; + set_menu.language=LANGUAGE_TEXT_IT; + set_menu.shutdown=SHUTDOWN_TEXT_IT; + // + more_menu.title = TITLE_MORE_IT; + more_menu.zoffset = ZOFFSET_IT; + // + filesys_menu.title = TITLE_FILESYS_IT; + filesys_menu.sd_sys = SD_CARD_TEXT_IT; + filesys_menu.usb_sys = U_DISK_TEXT_IT; + + //WIFI + wifi_menu.title=WIFI_NAME_TEXT_IT; + //wifi_menu.key = WIFI_KEY_TEXT_IT; + //wifi_menu.ip = WIFI_IP_TEXT_IT; + //wifi_menu.state= WIFI_STA_TEXT_IT; + wifi_menu.cloud= CLOSE_TEXT_IT; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_IT; + + cloud_menu.title = TITLE_CLOUD_TEXT_IT; + cloud_menu.bind = CLOUD_BINDED_IT; + cloud_menu.binded = CLOUD_BINDED_IT; + cloud_menu.unbind = CLOUD_UNBIND_IT; + cloud_menu.unbinding = CLOUD_UNBINDED_IT; + cloud_menu.disconnected = CLOUD_DISCONNECTED_IT; + cloud_menu.disable = CLOUD_DISABLE_IT; + // + about_menu.title = ABOUT_TEXT_IT; + about_menu.type = ABOUT_TYPE_TEXT_IT; + about_menu.version = ABOUT_VERSION_TEXT_IT; + about_menu.wifi = ABOUT_WIFI_TEXT_IT; + // + fan_menu.title = FAN_TEXT_IT; + fan_menu.add = FAN_ADD_TEXT_IT; + fan_menu.dec = FAN_DEC_TEXT_IT; + fan_menu.state = FAN_TIPS1_TEXT_IT; + // + filament_menu.title = TITLE_FILAMENT_IT; + filament_menu.in = FILAMENT_IN_TEXT_IT; + filament_menu.out = FILAMENT_OUT_TEXT_IT; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_IT; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_IT; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_IT; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_IT; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_IT; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT; + + // + language_menu.title = LANGUAGE_TEXT_IT; + + // + printing_menu.title = TITLE_PRINTING_IT; + printing_menu.option = PRINTING_OPERATION_IT; + printing_menu.stop = PRINTING_STOP_IT; + printing_menu.pause = PRINTING_PAUSE_IT; + printing_menu.resume = PRINTING_RESUME_IT; + + // + operation_menu.title = TITLE_OPERATION_IT; + operation_menu.pause = PRINTING_PAUSE_IT; + operation_menu.stop = PRINTING_STOP_IT; + operation_menu.temp = PRINTING_TEMP_IT; + operation_menu.fan = FAN_TEXT_IT; + operation_menu.extr = PRINTING_EXTRUDER_IT; + operation_menu.speed = PRINTING_CHANGESPEED_IT; + operation_menu.filament = FILAMENT_TEXT_IT; + operation_menu.more = PRINTING_MORE_IT; + operation_menu.move = PRINTING_MOVE_IT; + operation_menu.auto_off = AUTO_SHUTDOWN_IT; + operation_menu.manual_off = MANUAL_SHUTDOWN_IT; + // + pause_menu.title= TITLE_PAUSE_IT; + pause_menu.resume = PRINTING_RESUME_IT; + pause_menu.stop = PRINTING_STOP_IT; + pause_menu.extrude = PRINTING_EXTRUDER_IT; + pause_menu.move = PRINTING_MOVE_IT; + pause_menu.filament = FILAMENT_TEXT_IT; + pause_menu.more = PRINTING_MORE_IT; + + // + speed_menu.title = PRINTING_CHANGESPEED_IT; + speed_menu.add = ADD_TEXT_IT; + speed_menu.dec = DEC_TEXT_IT; + speed_menu.move = MOVE_SPEED_IT; + speed_menu.extrude = EXTRUDER_SPEED_IT; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_IT; + speed_menu.move_speed = MOVE_SPEED_STATE_IT; + // + printing_more_menu.fan = FAN_TEXT_IT; + printing_more_menu.auto_close = AUTO_SHUTDOWN_IT; + printing_more_menu.manual = MANUAL_SHUTDOWN_IT; + printing_more_menu.temp = PRINTING_TEMP_IT; + printing_more_menu.speed = PRINTING_CHANGESPEED_IT; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_IT; + print_file_dialog_menu.cancle = DIALOG_CANCLE_IT; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_IT; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_IT; + print_file_dialog_menu.retry = DIALOG_RETRY_IT; + print_file_dialog_menu.stop = DIALOG_STOP_IT; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_IT; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_IT; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_IT; + print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_IT; + print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_IT; + print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_IT; + print_file_dialog_menu.reprint=DIALOG_REPRINT_IT; + print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_IT; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_IT; + zoffset_menu.inc = ZOFFSET_INC_IT; + zoffset_menu.dec = ZOFFSET_DEC_IT; + + pause_msg_menu.pausing = MESSEGE_PAUSING_IT; + pause_msg_menu.changing = MESSEGE_CHANGING_IT; + pause_msg_menu.unload = MESSEGE_UNLOAD_IT; + pause_msg_menu.waiting = MESSEGE_WAITING_IT; + pause_msg_menu.insert = MESSEGE_INSERT_IT; + pause_msg_menu.load = MESSEGE_LOAD_IT; + pause_msg_menu.purge = MESSEGE_PURGE_IT; + pause_msg_menu.resume = MESSEGE_RESUME_IT; + pause_msg_menu.heat = MESSEGE_HEAT_IT; + pause_msg_menu.heating = MESSEGE_HEATING_IT; + pause_msg_menu.option = MESSEGE_OPTION_IT; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_IT; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_IT; + break; + +#endif + default: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_EN; + common_menu.text_back=BACK_TEXT_EN; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_EN; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_EN; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + // + main_menu.title=TITLE_READYPRINT_EN; + main_menu.preheat=PREHEAT_TEXT_EN; + main_menu.move=MOVE_TEXT_EN; + main_menu.home=HOME_TEXT_EN; + main_menu.print=PRINT_TEXT_EN; + main_menu.extrude=EXTRUDE_TEXT_EN; + main_menu.leveling=LEVELING_TEXT_EN; + main_menu.autoleveling=AUTO_LEVELING_TEXT_EN; + main_menu.fan = FAN_TEXT_EN; + main_menu.set=SET_TEXT_EN; + main_menu.more=MORE_TEXT_EN; + main_menu.tool = TOOL_TEXT_EN; + //TOOL + tool_menu.title = TOOL_TEXT_EN; + tool_menu.preheat = TOOL_PREHEAT_EN; + tool_menu.extrude = TOOL_EXTRUDE_EN; + tool_menu.move = TOOL_MOVE_EN; + tool_menu.home= TOOL_HOME_EN; + tool_menu.leveling = TOOL_LEVELING_EN; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_EN; + tool_menu.filament = TOOL_FILAMENT_EN; + tool_menu.more = TOOL_MORE_EN; + // + preheat_menu.adjust_title = TITLE_ADJUST_EN; + preheat_menu.title=TITLE_PREHEAT_EN; + preheat_menu.add=ADD_TEXT_EN; + preheat_menu.dec=DEC_TEXT_EN; + preheat_menu.ext1=EXTRUDER_1_TEXT_EN; + preheat_menu.ext2=EXTRUDER_2_TEXT_EN; + preheat_menu.hotbed=HEATBED_TEXT_EN; + preheat_menu.off=CLOSE_TEXT_EN; + // + move_menu.title = TITLE_MOVE_EN; + // + home_menu.title=TITLE_HOME_EN; + home_menu.stopmove = HOME_STOPMOVE_EN; + // + file_menu.title=TITLE_CHOOSEFILE_EN; + file_menu.page_up=PAGE_UP_TEXT_EN; + file_menu.page_down=PAGE_DOWN_TEXT_EN; + file_menu.file_loading = FILE_LOADING_EN; + file_menu.no_file = NO_FILE_EN; + file_menu.no_file_and_check = NO_FILE_EN;//NO_FILE_AND_CHECK_EN; + // + extrude_menu.title=TITLE_EXTRUDE_EN; + extrude_menu.in=EXTRUDER_IN_TEXT_EN; + extrude_menu.out=EXTRUDER_OUT_TEXT_EN; + extrude_menu.ext1=EXTRUDER_1_TEXT_EN; + extrude_menu.ext2=EXTRUDER_2_TEXT_EN; + extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_EN; + extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_EN; + extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_EN; + extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_EN; + // + leveling_menu.title=TITLE_LEVELING_EN; + leveling_menu.position1=LEVELING_POINT1_TEXT_EN; + leveling_menu.position2=LEVELING_POINT2_TEXT_EN; + leveling_menu.position3=LEVELING_POINT3_TEXT_EN; + leveling_menu.position4=LEVELING_POINT4_TEXT_EN; + leveling_menu.position5=LEVELING_POINT5_TEXT_EN; + // + set_menu.title=TITLE_SET_EN; + set_menu.filesys=FILESYS_TEXT_EN; + set_menu.wifi=WIFI_TEXT_EN; + set_menu.about=ABOUT_TEXT_EN; + set_menu.fan=FAN_TEXT_EN; + set_menu.filament=FILAMENT_TEXT_EN; + set_menu.breakpoint=BREAK_POINT_TEXT_EN; + set_menu.motoroff=MOTOR_OFF_TEXT_EN; + set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_EN; + set_menu.language=LANGUAGE_TEXT_EN; + set_menu.shutdown=SHUTDOWN_TEXT_EN; + //set_menu.machine_para = MACHINE_PARA_EN; + // + more_menu.title = TITLE_MORE_EN; + more_menu.zoffset = ZOFFSET_EN; + // + filesys_menu.title = TITLE_FILESYS_EN; + filesys_menu.sd_sys = SD_CARD_TEXT_EN; + filesys_menu.usb_sys = U_DISK_TEXT_EN; + //WIFI + wifi_menu.title=WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_EN; + //wifi_menu.ip = WIFI_IP_TEXT_EN; + //wifi_menu.state= WIFI_STA_TEXT_EN; + wifi_menu.cloud= CLOUD_TEXT_EN; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_EN; + + cloud_menu.title = TITLE_CLOUD_TEXT_EN; + cloud_menu.bind = CLOUD_BINDED_EN; + cloud_menu.binded = CLOUD_BINDED_EN; + cloud_menu.unbind = CLOUD_UNBIND_EN; + cloud_menu.unbinding = CLOUD_UNBINDED_EN; + cloud_menu.disconnected = CLOUD_DISCONNECTED_EN; + cloud_menu.disable = CLOUD_DISABLE_EN; + // + about_menu.title = TITLE_ABOUT_EN; + about_menu.type = ABOUT_TYPE_TEXT_EN; + about_menu.version = ABOUT_VERSION_TEXT_EN; + about_menu.wifi = ABOUT_WIFI_TEXT_EN; + // + fan_menu.title = TITLE_FAN_EN; + fan_menu.add = FAN_ADD_TEXT_EN; + fan_menu.dec = FAN_DEC_TEXT_EN; + fan_menu.state = FAN_TIPS1_TEXT_EN; + // + filament_menu.title = TITLE_FILAMENT_EN; + filament_menu.in = FILAMENT_IN_TEXT_EN; + filament_menu.out = FILAMENT_OUT_TEXT_EN; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_EN; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_EN; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_EN; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_EN; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_EN; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN; + + // + language_menu.title = TITLE_LANGUAGE_EN; + language_menu.next = PAGE_DOWN_TEXT_EN; + language_menu.up = PAGE_UP_TEXT_EN; + // + printing_menu.title = TITLE_PRINTING_EN; + printing_menu.option = PRINTING_OPERATION_EN; + printing_menu.stop = PRINTING_STOP_EN; + printing_menu.pause = PRINTING_PAUSE_EN; + printing_menu.resume = PRINTING_RESUME_EN; + + // + operation_menu.title = TITLE_OPERATION_EN; + operation_menu.pause = PRINTING_PAUSE_EN; + operation_menu.stop = PRINTING_STOP_EN; + operation_menu.temp = PRINTING_TEMP_EN; + operation_menu.fan = FAN_TEXT_EN; + operation_menu.extr = PRINTING_EXTRUDER_EN; + operation_menu.speed = PRINTING_CHANGESPEED_EN; + operation_menu.filament= FILAMENT_TEXT_EN; + operation_menu.more = PRINTING_MORE_EN; + operation_menu.move = PRINTING_MOVE_EN; + operation_menu.auto_off = AUTO_SHUTDOWN_EN; + operation_menu.manual_off = MANUAL_SHUTDOWN_EN; + // + pause_menu.title= TITLE_PAUSE_EN; + pause_menu.resume = PRINTING_RESUME_EN; + pause_menu.stop = PRINTING_STOP_EN; + pause_menu.extrude = PRINTING_EXTRUDER_EN; + pause_menu.move = PRINTING_MOVE_EN; + pause_menu.filament = FILAMENT_TEXT_EN; + pause_menu.more = PRINTING_MORE_EN; + + // + speed_menu.title = TITLE_CHANGESPEED_EN; + speed_menu.add = ADD_TEXT_EN; + speed_menu.dec = DEC_TEXT_EN; + speed_menu.move = MOVE_SPEED_EN; + speed_menu.extrude = EXTRUDER_SPEED_EN; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_EN; + speed_menu.move_speed = MOVE_SPEED_STATE_EN; + // + printing_more_menu.title = TITLE_MORE_EN; + printing_more_menu.fan = FAN_TEXT_EN; + printing_more_menu.auto_close = AUTO_SHUTDOWN_EN; + printing_more_menu.manual = MANUAL_SHUTDOWN_EN; + printing_more_menu.speed = PRINTING_CHANGESPEED_EN; + printing_more_menu.temp = PRINTING_TEMP_EN; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_EN; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_EN; + print_file_dialog_menu.cancle = DIALOG_CANCLE_EN; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_EN; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; + print_file_dialog_menu.retry = DIALOG_RETRY_EN; + print_file_dialog_menu.stop = DIALOG_STOP_EN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_EN; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_EN; + print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_EN; + print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_EN; + print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_EN; + print_file_dialog_menu.reprint=DIALOG_REPRINT_EN; + print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_EN; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_EN; + zoffset_menu.inc = ZOFFSET_INC_EN; + zoffset_menu.dec = ZOFFSET_DEC_EN; + + pause_msg_menu.pausing = MESSEGE_PAUSING_EN; + pause_msg_menu.changing = MESSEGE_CHANGING_EN; + pause_msg_menu.unload = MESSEGE_UNLOAD_EN; + pause_msg_menu.waiting = MESSEGE_WAITING_EN; + pause_msg_menu.insert = MESSEGE_INSERT_EN; + pause_msg_menu.load = MESSEGE_LOAD_EN; + pause_msg_menu.purge = MESSEGE_PURGE_EN; + pause_msg_menu.resume = MESSEGE_RESUME_EN; + pause_msg_menu.heat = MESSEGE_HEAT_EN; + pause_msg_menu.heating = MESSEGE_HEATING_EN; + pause_msg_menu.option = MESSEGE_OPTION_EN; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_EN; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_EN; + break; + } +} + +#endif \ No newline at end of file diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 06369fbd276d..b828e48e63ba 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -45,6 +45,7 @@ //#define FLASH_EEPROM_EMULATION #define SDCARD_EEPROM_EMULATION #endif +#define ENABLE_SPI2 // // Limit Switches @@ -106,16 +107,27 @@ // // Misc. Functions // -#define POWER_LOSS_PIN PA2 // PW_DET -#define PS_ON_PIN PA3 // PW_OFF +//#define POWER_LOSS_PIN PA2 // PW_DET +//#define PS_ON_PIN PA3 // PW_OFF -#define LED_PIN PB2 +//#define SUICIDE_PIN PB2 // Enable MKSPWC support ROBIN NANO v1.2 ONLY +//#define SUICIDE_PIN_INVERTING false + +//#define KILL_PIN PA2 // Enable MKSPWC support ROBIN NANO v1.2 ONLY +//#define KILL_PIN_INVERTING true // Enable MKSPWC support ROBIN NANO v1.2 ONLY + +//#define SERVO0_PIN PA8 // Enable BLTOUCH support ROBIN NANO v1.2 ONLY + +//#define LED_PIN PB2 + +#define MT_DET_1_PIN PA4 +#define MT_DET_PIN_INVERTING false // // SD Card // #ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION ONBOARD + //#define SDCARD_CONNECTION ONBOARD #endif #define SDIO_SUPPORT @@ -131,6 +143,93 @@ * If the screen stays white, disable 'LCD_RESET_PIN' * to let the bootloader init the screen. */ + +#if ENABLED(SPI_GRAPHICAL_TFT) + + #if HAS_SPI_LCD + + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + #define LCD_PINS_ENABLE PD13 + #define LCD_PINS_RS PC6 + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define LCD_BACKLIGHT_PIN -1 + + // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) + #if ENABLED(MKS_MINI_12864) + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN -1 + #define DOGLCD_A0 PD11 + #define DOGLCD_CS PE15 + #define DOGLCD_SCK PA5 + #define DOGLCD_MOSI PA7 + + // Required for MKS_MINI_12864 with this board + #define MKS_LCD12864B + #undef SHOW_BOOTSCREEN + + #else // !MKS_MINI_12864 + + #define LCD_PINS_D4 PE14 + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PE15 + #define LCD_PINS_D6 PD11 + #define LCD_PINS_D7 PD10 + #endif + + #ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_NS(125) + #endif + #ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_NS(125) + #endif + #ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_NS(125) + #endif + + #endif // !MKS_MINI_12864 + + #else + + #define SPI_TFT_CS_PIN PD11 + #define SPI_TFT_SCK_PIN PA5 + #define SPI_TFT_MISO_PIN PA6 + #define SPI_TFT_MOSI_PIN PA7 + #define SPI_TFT_DC_PIN PD10 + #define SPI_TFT_RST_PIN PC6 + + #define LCD_BACKLIGHT_PIN PD13 + + #define TOUCH_CS_PIN PE14 // SPI1_NSS + #define TOUCH_SCK_PIN PA5 // SPI1_SCK + #define TOUCH_MISO_PIN PA6 // SPI1_MISO + #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + + #endif//HAS_SPI_LCD + +#else + #if ENABLED(TFT_LITTLE_VGL_UI) + //FSMC LCD + #define FSMC_CS_PIN PD7 // NE4 + #define FSMC_RS_PIN PD11 // A0 + + #define TOUCH_CS_PIN PA7 // SPI2_NSS + #define TOUCH_SCK_PIN PB13 // SPI2_SCK + #define TOUCH_MISO_PIN PB14 // SPI2_MISO + #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI + + #define LCD_BACKLIGHT_PIN PD13 + + #endif //TFT_LITTLE_VGL_UI + +#endif// SPI_GRAPHICAL_TFT + #if ENABLED(FSMC_GRAPHICAL_TFT) #define FSMC_CS_PIN PD7 // NE4 #define FSMC_RS_PIN PD11 // A0 @@ -147,3 +246,12 @@ #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI #endif #endif + +#define SPI_FLASH +#if ENABLED(SPI_FLASH) + #define W25QXX_CS_PIN PB12 + #define W25QXX_MOSI_PIN PB15 + #define W25QXX_MISO_PIN PB14 + #define W25QXX_SCK_PIN PB13 +#endif + diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_nano35.py b/buildroot/share/PlatformIO/scripts/mks_robin_nano35.py new file mode 100644 index 000000000000..0047289adfd0 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/mks_robin_nano35.py @@ -0,0 +1,40 @@ +import os +Import("env") + +# Relocate firmware from 0x08000000 to 0x08007000 +for define in env['CPPDEFINES']: + if define[0] == "VECT_TAB_ADDR": + env['CPPDEFINES'].remove(define) +env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) + +custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_nano.ld") +for i, flag in enumerate(env["LINKFLAGS"]): + if "-Wl,-T" in flag: + env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script + elif flag == "-T": + env["LINKFLAGS"][i + 1] = custom_ld_script + + +# Encrypt ${PROGNAME}.bin and save it as 'Robin_nano35.bin' +def encrypt(source, target, env): + import sys + + key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] + + firmware = open(target[0].path, "rb") + robin = open(target[0].dir.path +'/Robin_nano35.bin', "wb") + length = os.path.getsize(target[0].path) + position = 0 + try: + while position < length: + byte = firmware.read(1) + if position >= 320 and position < 31040: + byte = chr(ord(byte) ^ key[position & 31]) + if sys.version_info[0] > 2: + byte = bytes(byte, 'latin1') + robin.write(byte) + position += 1 + finally: + firmware.close() + robin.close() +env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); diff --git a/platformio.ini b/platformio.ini index 413b5201dae7..46f959fea20d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -537,6 +537,23 @@ lib_deps = ${common.lib_deps} SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip lib_ignore = Adafruit NeoPixel, SPI +# +# MKS Robin Nano (STM32F103VET6) +# +[env:mks_robin_nano35] +platform = ststm32 +board = genericSTM32F103VE +platform_packages = tool-stm32duino +build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py + ${common.build_flags} -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 +build_unflags = -std=gnu++11 +extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_nano35.py +src_filter = ${common.default_src_filter} + +lib_deps = ${common.lib_deps} + SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip + MKS-LittlevGL=https://github.com/makerbase-mks/MKS-LittlevGL/archive/master.zip +lib_ignore = Adafruit NeoPixel, SPI + # # MKS Robin (STM32F103ZET6) # From 0ee706ef2587d9f5e919064abde09fcd676c09fb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 May 2020 22:28:35 -0500 Subject: [PATCH 02/18] Move and clean up mks_ui --- .../extui/lib/mks_ui/{src => }/SPI_TFT.cpp | 52 +- Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h | 55 + .../lcd/extui/lib/mks_ui/{src => }/W25Qxx.cpp | 239 ++-- Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h | 127 ++ .../extui/lib/mks_ui/{src => }/draw_about.cpp | 62 +- Marlin/src/lcd/extui/lib/mks_ui/draw_about.h | 34 + .../mks_ui/{src => }/draw_change_speed.cpp | 132 ++- .../lcd/extui/lib/mks_ui/draw_change_speed.h | 40 + .../src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 341 ++++++ Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h | 79 ++ .../mks_ui/{src => }/draw_error_message.cpp | 50 +- .../lcd/extui/lib/mks_ui/draw_error_message.h | 34 + .../lib/mks_ui/{src => }/draw_extrusion.cpp | 146 ++- .../src/lcd/extui/lib/mks_ui/draw_extrusion.h | 39 + .../extui/lib/mks_ui/{src => }/draw_fan.cpp | 106 +- Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h | 35 + .../extui/lib/mks_ui/{src => }/draw_home.cpp | 118 +- Marlin/src/lcd/extui/lib/mks_ui/draw_home.h | 34 + .../lib/mks_ui/{src => }/draw_language.cpp | 124 +- .../src/lcd/extui/lib/mks_ui/draw_language.h | 34 + .../lib/mks_ui/{src => }/draw_manuaLevel.cpp | 110 +- .../lcd/extui/lib/mks_ui/draw_manuaLevel.h | 34 + .../lib/mks_ui/{src => }/draw_move_motor.cpp | 112 +- .../lcd/extui/lib/mks_ui/draw_move_motor.h | 35 + .../lib/mks_ui/{src => }/draw_opration.cpp | 122 +- .../src/lcd/extui/lib/mks_ui/draw_opration.h | 34 + .../mks_ui/{src => }/draw_pause_message.cpp | 40 +- .../lcd/extui/lib/mks_ui/draw_pause_message.h | 33 + .../lib/mks_ui/{src => }/draw_preHeat.cpp | 144 ++- .../src/lcd/extui/lib/mks_ui/draw_preHeat.h | 37 + .../lib/mks_ui/{src => }/draw_print_file.cpp | 184 +-- .../lcd/extui/lib/mks_ui/draw_print_file.h | 65 ++ .../lib/mks_ui/{src => }/draw_printing.cpp | 148 ++- .../src/lcd/extui/lib/mks_ui/draw_printing.h | 52 + .../lib/mks_ui/{src => }/draw_ready_print.cpp | 118 +- .../lcd/extui/lib/mks_ui/draw_ready_print.h | 39 + .../extui/lib/mks_ui/{src => }/draw_set.cpp | 98 +- Marlin/src/lcd/extui/lib/mks_ui/draw_set.h | 34 + .../extui/lib/mks_ui/{src => }/draw_tool.cpp | 114 +- Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h | 34 + .../extui/lib/mks_ui/{src => }/draw_ui.cpp | 334 +++--- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 229 ++++ .../lib/mks_ui/{src => }/gb2312_puhui16.cpp | 30 +- Marlin/src/lcd/extui/lib/mks_ui/inc/SPI_TFT.h | 53 - Marlin/src/lcd/extui/lib/mks_ui/inc/W25Qxx.h | 127 -- .../src/lcd/extui/lib/mks_ui/inc/draw_about.h | 21 - .../extui/lib/mks_ui/inc/draw_change_speed.h | 28 - .../lcd/extui/lib/mks_ui/inc/draw_dialog.h | 65 -- .../extui/lib/mks_ui/inc/draw_error_message.h | 21 - .../lcd/extui/lib/mks_ui/inc/draw_extrusion.h | 25 - .../src/lcd/extui/lib/mks_ui/inc/draw_fan.h | 22 - .../src/lcd/extui/lib/mks_ui/inc/draw_home.h | 21 - .../lcd/extui/lib/mks_ui/inc/draw_language.h | 20 - .../extui/lib/mks_ui/inc/draw_manuaLevel.h | 20 - .../extui/lib/mks_ui/inc/draw_move_motor.h | 21 - .../lcd/extui/lib/mks_ui/inc/draw_opration.h | 20 - .../extui/lib/mks_ui/inc/draw_pause_message.h | 19 - .../lcd/extui/lib/mks_ui/inc/draw_preHeat.h | 24 - .../extui/lib/mks_ui/inc/draw_print_file.h | 50 - .../lcd/extui/lib/mks_ui/inc/draw_printing.h | 39 - .../extui/lib/mks_ui/inc/draw_ready_print.h | 26 - .../src/lcd/extui/lib/mks_ui/inc/draw_set.h | 21 - .../src/lcd/extui/lib/mks_ui/inc/draw_tool.h | 20 - Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ui.h | 222 ---- .../extui/lib/mks_ui/inc/mks_hardware_test.h | 14 - .../extui/lib/mks_ui/inc/printer_opration.h | 19 - .../extui/lib/mks_ui/inc/tft_Language_en.h | 698 ----------- .../extui/lib/mks_ui/inc/tft_Language_fr.h | 256 ---- .../extui/lib/mks_ui/inc/tft_Language_ru.h | 253 ---- .../extui/lib/mks_ui/inc/tft_Language_s_cn.h | 248 ---- .../extui/lib/mks_ui/inc/tft_Language_sp.h | 260 ----- .../extui/lib/mks_ui/inc/tft_Language_t_cn.h | 248 ---- .../src/lcd/extui/lib/mks_ui/inc/tft_fsmc.h | 14 - .../lib/mks_ui/inc/tft_lvgl_configuration.h | 29 - .../extui/lib/mks_ui/inc/tft_multi_language.h | 589 ---------- .../mks_ui/{src => }/mks_hardware_test.cpp | 1037 +++++++---------- .../lcd/extui/lib/mks_ui/mks_hardware_test.h | 31 + .../src/lcd/extui/lib/mks_ui/pic_manager.cpp | 753 ++++++++++++ .../extui/lib/mks_ui/{inc => }/pic_manager.h | 47 +- .../lcd/extui/lib/mks_ui/printer_opration.cpp | 219 ++++ .../lcd/extui/lib/mks_ui/printer_opration.h | 36 + .../lcd/extui/lib/mks_ui/src/draw_dialog.cpp | 357 ------ .../lcd/extui/lib/mks_ui/src/pic_manager.cpp | 811 ------------- .../extui/lib/mks_ui/src/printer_opration.cpp | 214 ---- .../lib/mks_ui/src/tft_lvgl_configuration.cpp | 864 -------------- .../lcd/extui/lib/mks_ui/tft_Language_en.h | 718 ++++++++++++ .../lcd/extui/lib/mks_ui/tft_Language_fr.h | 276 +++++ .../lib/mks_ui/{inc => }/tft_Language_it.h | 28 +- .../lcd/extui/lib/mks_ui/tft_Language_ru.h | 272 +++++ .../lcd/extui/lib/mks_ui/tft_Language_s_cn.h | 264 +++++ .../lcd/extui/lib/mks_ui/tft_Language_sp.h | 279 +++++ .../lcd/extui/lib/mks_ui/tft_Language_t_cn.h | 269 +++++ .../extui/lib/mks_ui/{src => }/tft_fsmc.cpp | 14 +- Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h | 30 + .../lib/mks_ui/tft_lvgl_configuration.cpp | 804 +++++++++++++ .../extui/lib/mks_ui/tft_lvgl_configuration.h | 46 + .../mks_ui/{src => }/tft_multi_language.cpp | 178 +-- .../lcd/extui/lib/mks_ui/tft_multi_language.h | 585 ++++++++++ Marlin/src/module/thermistor/thermistor_22.h | 4 +- Marlin/src/module/thermistor/thermistor_23.h | 4 +- 100 files changed, 8148 insertions(+), 7566 deletions(-) rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/SPI_TFT.cpp (91%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/W25Qxx.cpp (73%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_about.cpp (68%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_about.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_change_speed.cpp (83%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_error_message.cpp (55%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_extrusion.cpp (85%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_fan.cpp (81%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_home.cpp (82%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_home.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_language.cpp (87%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_language.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_manuaLevel.cpp (84%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_move_motor.cpp (85%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_opration.cpp (87%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_opration.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_pause_message.cpp (54%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_preHeat.cpp (87%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_print_file.cpp (90%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_printing.cpp (89%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_ready_print.cpp (85%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_set.cpp (84%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_set.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_tool.cpp (84%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/draw_ui.cpp (90%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/gb2312_puhui16.cpp (76%) delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/SPI_TFT.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/W25Qxx.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_about.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_change_speed.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_dialog.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_error_message.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_extrusion.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_fan.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_home.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_language.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_manuaLevel.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_move_motor.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_opration.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_pause_message.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_preHeat.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_print_file.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_printing.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ready_print.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_set.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_tool.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ui.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/mks_hardware_test.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/printer_opration.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_en.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_fr.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_ru.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_s_cn.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_sp.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_t_cn.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_fsmc.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_lvgl_configuration.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/inc/tft_multi_language.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/mks_hardware_test.cpp (73%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp rename Marlin/src/lcd/extui/lib/mks_ui/{inc => }/pic_manager.h (68%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/printer_opration.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/printer_opration.h delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/draw_dialog.cpp delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/pic_manager.cpp delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/printer_opration.cpp delete mode 100644 Marlin/src/lcd/extui/lib/mks_ui/src/tft_lvgl_configuration.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h rename Marlin/src/lcd/extui/lib/mks_ui/{inc => }/tft_Language_it.h (92%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/tft_fsmc.cpp (98%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h rename Marlin/src/lcd/extui/lib/mks_ui/{src => }/tft_multi_language.cpp (95%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/SPI_TFT.cpp b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp similarity index 91% rename from Marlin/src/lcd/extui/lib/mks_ui/src/SPI_TFT.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp index b84cec251372..27925b47d11b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/SPI_TFT.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp @@ -1,6 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,13 +19,14 @@ * along with this program. If not, see . * */ -#include "../../../../../inc/MarlinConfigPre.h" + +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(SPI_GRAPHICAL_TFT) #include -#include "../../../../../inc/MarlinConfig.h" -#include "../inc/SPI_TFT.h" +#include "../../../../inc/MarlinConfig.h" +#include "SPI_TFT.h" TFT SPI_TFT; @@ -40,14 +44,14 @@ TFT SPI_TFT; #endif #ifndef SPI_TFT_DC_PIN #define SPI_TFT_DC_PIN PD10 -#endif +#endif #ifndef SPI_TFT_RST_PIN #define SPI_TFT_RST_PIN PC6 -#endif +#endif //use SPI1 for the spi tft. void TFT::spi_init(uint8_t spiRate){ - + SPI_TFT_CS_H; /** @@ -69,7 +73,7 @@ void TFT::spi_init(uint8_t spiRate){ SPI.begin(); SPI.setClockDivider(clock); SPI.setBitOrder(MSBFIRST); - SPI.setDataMode(SPI_MODE0); + SPI.setDataMode(SPI_MODE0); } uint8_t TFT::spi_Rec() { @@ -143,13 +147,13 @@ void TFT::SetCursor(uint16_t x,uint16_t y) LCD_WR_DATA(x>>8); LCD_WR_DATA(x); LCD_WR_DATA(x>>8); - LCD_WR_DATA(x); - + LCD_WR_DATA(x); + LCD_WR_REG(0x2b); LCD_WR_DATA(y>>8); LCD_WR_DATA(y); LCD_WR_DATA(y>>8); - LCD_WR_DATA(y); + LCD_WR_DATA(y); } void TFT::SetWindows(uint16_t x,uint16_t y,uint16_t with,uint16_t height) { @@ -157,13 +161,13 @@ void TFT::SetWindows(uint16_t x,uint16_t y,uint16_t with,uint16_t height) LCD_WR_DATA(x>>8); LCD_WR_DATA(x); LCD_WR_DATA((x+with)>>8); - LCD_WR_DATA((x+with)); - + LCD_WR_DATA((x+with)); + LCD_WR_REG(0x2b); LCD_WR_DATA(y>>8); LCD_WR_DATA(y); LCD_WR_DATA((y+height)>>8); - LCD_WR_DATA(y+height); + LCD_WR_DATA(y+height); } void TFT::LCD_init() { @@ -176,7 +180,7 @@ void TFT::LCD_init() delay(120); LCD_WR_REG(0x11); delay(120); - + LCD_WR_REG(0xf0); LCD_WR_DATA(0xc3); LCD_WR_REG(0xf0); @@ -184,10 +188,10 @@ void TFT::LCD_init() LCD_WR_REG(0x36); LCD_WR_DATA(0x28); - + LCD_WR_REG(0x3A); LCD_WR_DATA(0x55); - + LCD_WR_REG(0xB4); LCD_WR_DATA(0x01); LCD_WR_REG(0xB7) ; @@ -242,8 +246,8 @@ void TFT::LCD_init() LCD_WR_REG(0xf0); LCD_WR_DATA(0x69); delay(120); //Delay 120ms - LCD_WR_REG(0x29); //Display ON - + LCD_WR_REG(0x29); //Display ON + LCD_clear(0x0000);// SPI_TFT_BLK_H; @@ -253,12 +257,12 @@ void TFT::LCD_clear(uint16_t color) unsigned int i,m; uint32_t count; uint8_t tbuf[960]; - + SetCursor(0,0); - SetWindows(0,0,480-1,320-1); - LCD_WriteRAM_Prepare(); + SetWindows(0,0,480-1,320-1); + LCD_WriteRAM_Prepare(); SPI_TFT_CS_L; - SPI_TFT_DC_H; + SPI_TFT_DC_H; for(i=0;i<960;) { tbuf[i]=color>>8; @@ -268,7 +272,7 @@ void TFT::LCD_clear(uint16_t color) for(i=0;i<320;i++) { //for(m=0;m<480;m++) - //{ + //{ //LCD_WR_DATA(color>>8); //LCD_WR_DATA(color); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h new file mode 100644 index 000000000000..e88c8f7a8a58 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h @@ -0,0 +1,55 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include + +#define SPI_TFT_CS_H OUT_WRITE(SPI_TFT_CS_PIN, HIGH) +#define SPI_TFT_CS_L OUT_WRITE(SPI_TFT_CS_PIN, LOW) + +#define SPI_TFT_DC_H OUT_WRITE(SPI_TFT_DC_PIN, HIGH) +#define SPI_TFT_DC_L OUT_WRITE(SPI_TFT_DC_PIN, LOW) + +#define SPI_TFT_RST_H OUT_WRITE(SPI_TFT_RST_PIN, HIGH) +#define SPI_TFT_RST_L OUT_WRITE(SPI_TFT_RST_PIN, LOW) + +#define SPI_TFT_BLK_H OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH) +#define SPI_TFT_BLK_L OUT_WRITE(LCD_BACKLIGHT_PIN, LOW) + +class TFT { +public: + void spi_init(uint8_t spiRate); + uint8_t spi_Rec(); + uint8_t spi_read_write_byte(uint8_t data); + void spi_Read(uint8_t* buf, uint16_t nbyte); + void spi_Send(uint8_t b); + void spi_SendBlock(uint8_t token, const uint8_t* buf); + void LCD_WR_REG(uint8_t cmd); + void LCD_WR_DATA(uint8_t data); + void SetCursor(uint16_t x,uint16_t y); + void SetWindows(uint16_t x,uint16_t y,uint16_t with,uint16_t height); + void LCD_init(); + void LCD_clear(uint16_t color); + void LCD_WriteRAM_Prepare(); +}; + +extern TFT SPI_TFT; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/W25Qxx.cpp b/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.cpp similarity index 73% rename from Marlin/src/lcd/extui/lib/mks_ui/src/W25Qxx.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.cpp index abff401e8eb5..4b388cea1321 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/W25Qxx.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.cpp @@ -1,6 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,13 +19,16 @@ * along with this program. If not, see . * */ -#include "../../../../../inc/MarlinConfigPre.h" +#include "../../../../inc/MarlinConfigPre.h" + #if 1//ENABLED(SPI_FLASH) -#include -#include "../../../../../inc/MarlinConfig.h" #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../inc/W25Qxx.h" + +#include +#include "../../../../inc/MarlinConfig.h" + +#include "W25Qxx.h" #ifndef SPI_FLASH_MISO_PIN #define SPI_FLASH_MISO_PIN W25QXX_MISO_PIN @@ -37,40 +43,40 @@ #define SPI_FLASH_CS_PIN W25QXX_CS_PIN #endif -#define W25QXX_CS_H OUT_WRITE(SPI_FLASH_CS_PIN, HIGH) -#define W25QXX_CS_L OUT_WRITE(SPI_FLASH_CS_PIN, LOW) +#define W25QXX_CS_H OUT_WRITE(SPI_FLASH_CS_PIN, HIGH) +#define W25QXX_CS_L OUT_WRITE(SPI_FLASH_CS_PIN, LOW) ext_FLASH W25QXX; void ext_FLASH::init(uint8_t spiRate){ - - OUT_WRITE(SPI_FLASH_CS_PIN, HIGH); - - /** - * STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz - * STM32F1 has 3 SPI ports, SPI1 in APB2, SPI2/SPI3 in APB1 - * so the minimum prescale of SPI1 is DIV4, SPI2/SPI3 is DIV2 - */ - #if SPI_DEVICE == 1 - #define SPI_CLOCK_MAX SPI_CLOCK_DIV4 - #else - #define SPI_CLOCK_MAX SPI_CLOCK_DIV2 - #endif - uint8_t clock; - switch (spiRate) { - case SPI_FULL_SPEED: clock = SPI_CLOCK_MAX ; break; - case SPI_HALF_SPEED: clock = SPI_CLOCK_DIV4 ; break; - case SPI_QUARTER_SPEED: clock = SPI_CLOCK_DIV8 ; break; - case SPI_EIGHTH_SPEED: clock = SPI_CLOCK_DIV16; break; - case SPI_SPEED_5: clock = SPI_CLOCK_DIV32; break; - case SPI_SPEED_6: clock = SPI_CLOCK_DIV64; break; - default: clock = SPI_CLOCK_DIV2; // Default from the SPI library - } - SPI.setModule(SPI_DEVICE); - SPI.begin(); - SPI.setClockDivider(clock); - SPI.setBitOrder(MSBFIRST); - SPI.setDataMode(SPI_MODE0); + + OUT_WRITE(SPI_FLASH_CS_PIN, HIGH); + + /** + * STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz + * STM32F1 has 3 SPI ports, SPI1 in APB2, SPI2/SPI3 in APB1 + * so the minimum prescale of SPI1 is DIV4, SPI2/SPI3 is DIV2 + */ + #if SPI_DEVICE == 1 + #define SPI_CLOCK_MAX SPI_CLOCK_DIV4 + #else + #define SPI_CLOCK_MAX SPI_CLOCK_DIV2 + #endif + uint8_t clock; + switch (spiRate) { + case SPI_FULL_SPEED: clock = SPI_CLOCK_MAX ; break; + case SPI_HALF_SPEED: clock = SPI_CLOCK_DIV4 ; break; + case SPI_QUARTER_SPEED: clock = SPI_CLOCK_DIV8 ; break; + case SPI_EIGHTH_SPEED: clock = SPI_CLOCK_DIV16; break; + case SPI_SPEED_5: clock = SPI_CLOCK_DIV32; break; + case SPI_SPEED_6: clock = SPI_CLOCK_DIV64; break; + default: clock = SPI_CLOCK_DIV2; // Default from the SPI library + } + SPI.setModule(SPI_DEVICE); + SPI.begin(); + SPI.setClockDivider(clock); + SPI.setBitOrder(MSBFIRST); + SPI.setDataMode(SPI_MODE0); } /** @@ -113,6 +119,7 @@ void ext_FLASH::spi_flash_Read(uint8_t* buf, uint16_t nbyte) { void ext_FLASH::spi_flash_Send(uint8_t b) { SPI.send(b); } + /** * @brief Write token and then write from 512 byte buffer to SPI (for SD card) * @@ -126,28 +133,28 @@ void ext_FLASH::spi_flash_SendBlock(uint8_t token, const uint8_t* buf) { SPI.dmaSend(const_cast(buf), 512); } -uint16_t ext_FLASH::W25QXX_ReadID(void) -{ - uint16_t Temp = 0; - W25QXX_CS_L; - spi_flash_Send(0x90);//���Ͷ�ȡID���� - spi_flash_Send(0x00); - spi_flash_Send(0x00); - spi_flash_Send(0x00); - Temp|=spi_flash_Rec()<<8; - Temp|=spi_flash_Rec(); - W25QXX_CS_H; - return Temp; -} -void ext_FLASH::SPI_FLASH_WriteEnable(void) -{ +uint16_t ext_FLASH::W25QXX_ReadID(void) { + uint16_t Temp = 0; + W25QXX_CS_L; + spi_flash_Send(0x90);//���Ͷ�ȡID���� + spi_flash_Send(0x00); + spi_flash_Send(0x00); + spi_flash_Send(0x00); + Temp|=spi_flash_Rec()<<8; + Temp|=spi_flash_Rec(); + W25QXX_CS_H; + return Temp; +} + +void ext_FLASH::SPI_FLASH_WriteEnable(void) { /* Select the FLASH: Chip Select low */ - W25QXX_CS_L; + W25QXX_CS_L; /* Send "Write Enable" instruction */ - spi_flash_Send(W25X_WriteEnable); + spi_flash_Send(W25X_WriteEnable); /* Deselect the FLASH: Chip Select high */ - W25QXX_CS_H; + W25QXX_CS_H; } + /******************************************************************************* * Function Name : SPI_FLASH_WaitForWriteEnd * Description : Polls the status of the Write In Progress (WIP) flag in the @@ -157,8 +164,7 @@ void ext_FLASH::SPI_FLASH_WriteEnable(void) * Output : None * Return : None *******************************************************************************/ -void ext_FLASH::SPI_FLASH_WaitForWriteEnd(void) -{ +void ext_FLASH::SPI_FLASH_WaitForWriteEnd(void) { uint8_t FLASH_Status = 0; /* Select the FLASH: Chip Select low */ @@ -167,27 +173,23 @@ void ext_FLASH::SPI_FLASH_WaitForWriteEnd(void) spi_flash_Send(W25X_ReadStatusReg); /* Loop as long as the memory is busy with a write cycle */ - do - { + do { /* Send a dummy byte to generate the clock needed by the FLASH and put the value of the status register in FLASH_Status variable */ FLASH_Status = spi_flash_Rec(); - - } - while ((FLASH_Status & WIP_Flag) == 0x01); /* Write in progress */ + } while ((FLASH_Status & WIP_Flag) == 0x01); /* Write in progress */ /* Deselect the FLASH: Chip Select high */ W25QXX_CS_H; } -void ext_FLASH::SPI_FLASH_SectorErase(uint32_t SectorAddr) -{ +void ext_FLASH::SPI_FLASH_SectorErase(uint32_t SectorAddr) { /* Send write enable instruction */ SPI_FLASH_WriteEnable(); /* Sector Erase */ /* Select the FLASH: Chip Select low */ - W25QXX_CS_L; + W25QXX_CS_L; /* Send Sector Erase instruction */ spi_flash_Send(W25X_SectorErase); /* Send SectorAddr high nibble address byte */ @@ -203,22 +205,21 @@ void ext_FLASH::SPI_FLASH_SectorErase(uint32_t SectorAddr) SPI_FLASH_WaitForWriteEnd(); } -void ext_FLASH::SPI_FLASH_BlockErase(uint32_t BlockAddr) -{ - SPI_FLASH_WriteEnable(); - W25QXX_CS_L; - /* Send Sector Erase instruction */ - spi_flash_Send(W25X_BlockErase); - /* Send SectorAddr high nibble address byte */ - spi_flash_Send((BlockAddr & 0xFF0000) >> 16); - /* Send SectorAddr medium nibble address byte */ - spi_flash_Send((BlockAddr & 0xFF00) >> 8); - /* Send SectorAddr low nibble address byte */ - spi_flash_Send(BlockAddr & 0xFF); - - W25QXX_CS_H; - - SPI_FLASH_WaitForWriteEnd(); +void ext_FLASH::SPI_FLASH_BlockErase(uint32_t BlockAddr) { + SPI_FLASH_WriteEnable(); + W25QXX_CS_L; + /* Send Sector Erase instruction */ + spi_flash_Send(W25X_BlockErase); + /* Send SectorAddr high nibble address byte */ + spi_flash_Send((BlockAddr & 0xFF0000) >> 16); + /* Send SectorAddr medium nibble address byte */ + spi_flash_Send((BlockAddr & 0xFF00) >> 8); + /* Send SectorAddr low nibble address byte */ + spi_flash_Send(BlockAddr & 0xFF); + + W25QXX_CS_H; + + SPI_FLASH_WaitForWriteEnd(); } /******************************************************************************* @@ -228,15 +229,14 @@ void ext_FLASH::SPI_FLASH_BlockErase(uint32_t BlockAddr) * Output : None * Return : None *******************************************************************************/ -void ext_FLASH::SPI_FLASH_BulkErase(void) -{ +void ext_FLASH::SPI_FLASH_BulkErase(void) { /* Send write enable instruction */ SPI_FLASH_WriteEnable(); /* Bulk Erase */ /* Select the FLASH: Chip Select low */ W25QXX_CS_L; - + /* Send Bulk Erase instruction */ spi_flash_Send(W25X_ChipErase); /* Deselect the FLASH: Chip Select high */ @@ -258,8 +258,7 @@ void ext_FLASH::SPI_FLASH_BulkErase(void) * Output : None * Return : None *******************************************************************************/ -void ext_FLASH::SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite) -{ +void ext_FLASH::SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite) { /* Enable the write access to the FLASH */ SPI_FLASH_WriteEnable(); @@ -274,14 +273,10 @@ void ext_FLASH::SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16 /* Send WriteAddr low nibble address byte to write to */ spi_flash_Send(WriteAddr & 0xFF); - if(NumByteToWrite > SPI_FLASH_PerWritePageSize) - { - NumByteToWrite = SPI_FLASH_PerWritePageSize; - } + NOMORE(NumByteToWrite, SPI_FLASH_PerWritePageSize); /* while there is data to be written on the FLASH */ - while (NumByteToWrite--) - { + while (NumByteToWrite--) { /* Send the current byte */ spi_flash_Send(*pBuffer); /* Point on the next byte to be written */ @@ -306,8 +301,7 @@ void ext_FLASH::SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16 * Output : None * Return : None *******************************************************************************/ -void ext_FLASH::SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite) -{ +void ext_FLASH::SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite) { uint8_t NumOfPage = 0, NumOfSingle = 0, Addr = 0, count = 0, temp = 0; Addr = WriteAddr % SPI_FLASH_PageSize; @@ -315,45 +309,31 @@ void ext_FLASH::SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint NumOfPage = NumByteToWrite / SPI_FLASH_PageSize; NumOfSingle = NumByteToWrite % SPI_FLASH_PageSize; - if (Addr == 0) /* WriteAddr is SPI_FLASH_PageSize aligned */ - { + if (Addr == 0) { /* WriteAddr is SPI_FLASH_PageSize aligned */ if (NumOfPage == 0) /* NumByteToWrite < SPI_FLASH_PageSize */ - { SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite); - } - else /* NumByteToWrite > SPI_FLASH_PageSize */ - { - while (NumOfPage--) - { + else { /* NumByteToWrite > SPI_FLASH_PageSize */ + while (NumOfPage--) { SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize); WriteAddr += SPI_FLASH_PageSize; pBuffer += SPI_FLASH_PageSize; } - SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumOfSingle); } } - else /* WriteAddr is not SPI_FLASH_PageSize aligned */ - { - if (NumOfPage == 0) /* NumByteToWrite < SPI_FLASH_PageSize */ - { - if (NumOfSingle > count) /* (NumByteToWrite + WriteAddr) > SPI_FLASH_PageSize */ - { + else { /* WriteAddr is not SPI_FLASH_PageSize aligned */ + if (NumOfPage == 0) { /* NumByteToWrite < SPI_FLASH_PageSize */ + if (NumOfSingle > count) { /* (NumByteToWrite + WriteAddr) > SPI_FLASH_PageSize */ temp = NumOfSingle - count; - SPI_FLASH_PageWrite(pBuffer, WriteAddr, count); WriteAddr += count; pBuffer += count; - SPI_FLASH_PageWrite(pBuffer, WriteAddr, temp); } else - { SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite); - } } - else /* NumByteToWrite > SPI_FLASH_PageSize */ - { + else { /* NumByteToWrite > SPI_FLASH_PageSize */ NumByteToWrite -= count; NumOfPage = NumByteToWrite / SPI_FLASH_PageSize; NumOfSingle = NumByteToWrite % SPI_FLASH_PageSize; @@ -362,17 +342,14 @@ void ext_FLASH::SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint WriteAddr += count; pBuffer += count; - while (NumOfPage--) - { + while (NumOfPage--) { SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize); WriteAddr += SPI_FLASH_PageSize; pBuffer += SPI_FLASH_PageSize; } if (NumOfSingle != 0) - { SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumOfSingle); - } } } } @@ -387,8 +364,7 @@ void ext_FLASH::SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint * Output : None * Return : None *******************************************************************************/ -void ext_FLASH::SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) -{ +void ext_FLASH::SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) { /* Select the FLASH: Chip Select low */ W25QXX_CS_L; @@ -402,30 +378,23 @@ void ext_FLASH::SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16 /* Send ReadAddr low nibble address byte to read from */ spi_flash_Send(ReadAddr & 0xFF); - if(NumByteToRead<33) - { - while (NumByteToRead--) /* while there is data to be read */ - { + if (NumByteToRead<33) { + while (NumByteToRead--) { /* while there is data to be read */ /* Read a byte from the FLASH */ *pBuffer = spi_flash_Rec(); /* Point to the next location where the byte read will be saved */ pBuffer++; } } - else - { - spi_flash_Read(pBuffer, NumByteToRead); - } + else { + spi_flash_Read(pBuffer, NumByteToRead); + } W25QXX_CS_H; } - -void ext_FLASH::lv_pic_read(uint8_t *P_Rbuff,uint32_t addr,uint32_t size) -{ - SPI_FLASH_BufferRead((uint8_t *)P_Rbuff,addr,size); +void ext_FLASH::lv_pic_read(uint8_t *P_Rbuff,uint32_t addr,uint32_t size) { + SPI_FLASH_BufferRead((uint8_t *)P_Rbuff,addr,size); } - -#endif - -#endif \ No newline at end of file +#endif // TFT_LITTLE_VGL_UI +#endif // 1 ... SPI_FLASH diff --git a/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h b/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h new file mode 100644 index 000000000000..297a5c7c77fd --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h @@ -0,0 +1,127 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +//#if defined(__cplusplus) +//extern "C" { /* C-declarations for C++ */ +//#endif + +#include + +#define W25X_WriteEnable 0x06 +#define W25X_WriteDisable 0x04 +#define W25X_ReadStatusReg 0x05 +#define W25X_WriteStatusReg 0x01 +#define W25X_ReadData 0x03 +#define W25X_FastReadData 0x0B +#define W25X_FastReadDual 0x3B +#define W25X_PageProgram 0x02 +#define W25X_BlockErase 0xD8 +#define W25X_SectorErase 0x20 +#define W25X_ChipErase 0xC7 +#define W25X_PowerDown 0xB9 +#define W25X_ReleasePowerDown 0xAB +#define W25X_DeviceID 0xAB +#define W25X_ManufactDeviceID 0x90 +#define W25X_JedecDeviceID 0x9F + +#define WIP_Flag 0x01 /* Write In Progress (WIP) flag */ + +#define Dummy_Byte 0xA5 + +#define SPI_FLASH_SectorSize 4096 +#define SPI_FLASH_PageSize 256 +#define SPI_FLASH_PerWritePageSize 256 + +#if 0 + +#define PIC_NAME_MAX_LEN 50 + +#define LOGO_MAX_SIZE (300*1024) //logo���ֵ +#define TITLELOGO_MAX_SIZE (150*1024) //logo���ֵ +#define DEFAULT_VIEW_MAX_SIZE (200*200*2) +#define FLASH_VIEW_MAX_SIZE (200*200*2) + +//ͼƬ +//Robin2�洢��ַ +#define PIC_NAME_ADDR 0x003000 //ͼƬ��Ϣ�洢��ַ��ͼƬ���� +#define PIC_SIZE_ADDR 0x007000 //ͼƬ��Ϣ�洢��ַ��ͼƬ��Сֵ +#define PIC_COUNTER_ADDR 0x008000 //ͼƬ������ֵ�洢��ַ +#define PIC_LOGO_ADDR 0x009000 //ͼƬlogo�洢��ַ +//#define PIC_DATA_ADDR 0x02f000 //ͼƬ���ݴ洢��ַ + +#define DEFAULT_VIEW_ADDR 0XC5800 +#define BAK_VIEW_ADDR (DEFAULT_VIEW_ADDR+90*1024) +#define PIC_ICON_LOGO_ADDR (BAK_VIEW_ADDR+80*1024) + +#define PIC_DATA_ADDR (PIC_ICON_LOGO_ADDR+350*1024) //ͼƬ���ݴ洢��ַ//(800*240) + +//�ֿ� +#define FONTINFOADDR 0x600000//6M�Ժ��ַΪ�ֿ� +#define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096)//4*1024 +#define GBK_FLASH_ADDR (UNIGBK_FLASH_ADDR+180224)//176*1024 + +#define PER_PIC_MAX_SPACE (32*1024) //Ϊ�˷�ֹ����Խ������⣬ÿ��СͼƬ�����仮��Ӧ��ȡ�ܹ�����4K��ֵ + +// +union union32 { + uint8_t bytes[4]; + uint32_t dwords; +}; +//ͼƬ��Ϣ�ṹ�� +struct pic_msg { + uint8_t name[PIC_NAME_MAX_LEN]; + union union32 size; +}; + +typedef struct pic_msg PIC_MSG; + +#endif + +class ext_FLASH{ +public: + void init(uint8_t spiRate); + static uint8_t spi_flash_Rec(); + static uint8_t spi_flash_read_write_byte(uint8_t data); + static void spi_flash_Read(uint8_t* buf, uint16_t nbyte); + static void spi_flash_Send(uint8_t b); + static void spi_flash_SendBlock(uint8_t token, const uint8_t* buf); + static uint16_t W25QXX_ReadID(void); + static void SPI_FLASH_WriteEnable(void); + static void SPI_FLASH_WaitForWriteEnd(void); + static void SPI_FLASH_SectorErase(uint32_t SectorAddr); + static void SPI_FLASH_BlockErase(uint32_t BlockAddr); + static void SPI_FLASH_BulkErase(void); + static void SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); + static void SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); + static void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead); + //uint32_t lv_get_pic_addr(uint8_t *Pname); + void lv_pic_read(uint8_t *P_Rbuff,uint32_t addr,uint32_t size); +}; + +extern ext_FLASH W25QXX; + +//extern uint32_t lv_get_pic_addr(uint8_t *Pname); + +//#if defined(__cplusplus) +//} /* C-declarations for C++ */ +//#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_about.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp similarity index 68% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_about.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp index c914dfca90a1..ea65babfba31 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_about.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp @@ -1,14 +1,36 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" -#include "../../../../../../Configuration.h" -#include "../inc/draw_ui.h" -#include "../../../../../module/temperature.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +//#include "../MarlinCore.h" +#include "../../../../../Configuration.h" +#include "draw_ui.h" +#include "../../../../module/temperature.h" static lv_obj_t * scr; static lv_obj_t * fw_type,*board,*fw_version; @@ -21,7 +43,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_A_RETURN: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { clear_cur_ui(); @@ -44,7 +66,7 @@ void lv_draw_about(void) disp_state = ABOUT_UI; scr = lv_obj_create(NULL, NULL); - + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); @@ -53,20 +75,20 @@ void lv_draw_about(void) lv_obj_set_style(title, &tft_style_lable_rel); lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); lv_label_set_text(title, creat_title_text()); - + lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic); - + /*Create an Image button*/ buttonBack = lv_imgbtn_create(scr, NULL); #if 1 - - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_A_RETURN,"bmp_Return.bin",0); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_A_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); @@ -77,7 +99,7 @@ void lv_draw_about(void) /*Create a label on the Image button*/ label_Back = lv_label_create(buttonBack, NULL); - + if(gCfgItems.multiple_language !=0) { lv_label_set_text(label_Back, common_menu.text_back); @@ -105,7 +127,7 @@ void lv_draw_about(void) #elif (MOTHERBOARD == BOARD_MKS_ROBIN_NANO) lv_label_set_text(board, "Board: MKS Robin nano"); #endif - + lv_obj_align(board, NULL, LV_ALIGN_CENTER,0, 20); } @@ -113,4 +135,4 @@ void lv_clear_about() { lv_obj_del(scr); } -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h new file mode 100644 index 000000000000..fa951716603f --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_about(void); +extern void lv_clear_about(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_change_speed.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp similarity index 83% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_change_speed.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp index e561e90d3cf3..ef5573afa95f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_change_speed.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp @@ -1,15 +1,38 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) + #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" -#include "../../../../../../Configuration.h" -#include "../inc/draw_ui.h" -#include "../../../../../module/temperature.h" -#include "../../../../../module/planner.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +//#include "../MarlinCore.h" +#include "../../../../../Configuration.h" +#include "draw_ui.h" +#include "../../../../module/temperature.h" +#include "../../../../module/planner.h" static lv_obj_t * scr; static lv_obj_t * labelStep,*buttonStep,*buttonMov,*buttonExt; @@ -31,8 +54,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_C_ADD: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(speedType == 0) @@ -40,7 +63,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) if(feedrate_percentage < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) { feedrate_percentage += uiCfg.stepPrintSpeed; - + } else { @@ -52,7 +75,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) if(planner.flow_percentage[0]< MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) { planner.flow_percentage[0] += uiCfg.stepPrintSpeed; - + } else { @@ -73,25 +96,25 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_C_DEC: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { if(speedType == 0) - { + { if(feedrate_percentage > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) { - feedrate_percentage -= uiCfg.stepPrintSpeed; + feedrate_percentage -= uiCfg.stepPrintSpeed; } else { feedrate_percentage = MIN_EXT_SPEED_PERCENT; - } + } } else if(speedType == 1) { if(planner.flow_percentage[0] > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) { - planner.flow_percentage[0] -= uiCfg.stepPrintSpeed; + planner.flow_percentage[0] -= uiCfg.stepPrintSpeed; } else { @@ -109,12 +132,12 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } disp_print_speed(); } - + break; case ID_C_MOVE: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { speedType = 0; @@ -124,8 +147,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_C_EXT: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { speedType = 1; @@ -135,7 +158,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_C_STEP: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { if(uiCfg.stepPrintSpeed == 1) @@ -144,18 +167,18 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } else if(uiCfg.stepPrintSpeed == 5) { - uiCfg.stepPrintSpeed = 10; + uiCfg.stepPrintSpeed = 10; } else { - uiCfg.stepPrintSpeed = 1; + uiCfg.stepPrintSpeed = 1; } disp_speed_step(); } break; case ID_C_RETURN: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { clear_cur_ui(); @@ -180,7 +203,7 @@ void lv_draw_change_speed(void) disp_state = CHANGE_SPEED_UI; scr = lv_obj_create(NULL, NULL); - + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); @@ -189,11 +212,11 @@ void lv_draw_change_speed(void) lv_obj_set_style(title, &tft_style_lable_rel); lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); lv_label_set_text(title, creat_title_text()); - + lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic); - + /*Create an Image button*/ buttonAdd = lv_imgbtn_create(scr, NULL); buttonDec = lv_imgbtn_create(scr, NULL); @@ -215,32 +238,32 @@ void lv_draw_change_speed(void) lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); - + lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_REL, &tft_style_lable_rel); - + lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_REL, &tft_style_lable_rel); - + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_C_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_C_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif - + lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); lv_obj_set_pos(buttonMov,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); @@ -255,15 +278,15 @@ void lv_draw_change_speed(void) lv_btn_set_layout(buttonExt, LV_LAYOUT_OFF); lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); labelMov = lv_label_create(buttonMov, NULL); labelExt = lv_label_create(buttonExt, NULL); labelStep = lv_label_create(buttonStep, NULL); lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - + + if(gCfgItems.multiple_language !=0) { lv_label_set_text(labelAdd, speed_menu.add); @@ -287,15 +310,15 @@ void disp_speed_step() { if(uiCfg.stepPrintSpeed == 1) { - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step1_percent.bin",0); + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step1_percent.bin",0); } else if(uiCfg.stepPrintSpeed == 5) { - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step5_percent.bin",0); + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step5_percent.bin",0); } else if(uiCfg.stepPrintSpeed == 10) - { - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step10_percent.bin",0); + { + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step10_percent.bin",0); } if(gCfgItems.multiple_language != 0) @@ -308,7 +331,7 @@ void disp_speed_step() else if(uiCfg.stepPrintSpeed == 5) { lv_label_set_text(labelStep, speed_menu.step_5percent); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); } else if(uiCfg.stepPrintSpeed == 10) { @@ -323,7 +346,7 @@ void disp_print_speed() char buf[30] = {0}; public_buf_l[0] = '\0'; - + if(speedType == 0) //move { strcat(public_buf_l,speed_menu.move_speed); @@ -348,17 +371,17 @@ void disp_speed_type() { case 1: lv_obj_set_event_cb_mks(buttonExt, event_handler,ID_C_EXT,"bmp_Extruct_speed_sel.bin",0); - lv_obj_set_event_cb_mks(buttonMov, event_handler,ID_C_MOVE,"bmp_Mov_speed.bin",0); + lv_obj_set_event_cb_mks(buttonMov, event_handler,ID_C_MOVE,"bmp_Mov_speed.bin",0); break; default: lv_obj_set_event_cb_mks(buttonExt, event_handler,ID_C_EXT,"bmp_Extruct_speed.bin",0); - lv_obj_set_event_cb_mks(buttonMov, event_handler,ID_C_MOVE,"bmp_Mov_speed_sel.bin",0); + lv_obj_set_event_cb_mks(buttonMov, event_handler,ID_C_MOVE,"bmp_Mov_speed_sel.bin",0); break; } lv_obj_refresh_ext_draw_pad(buttonExt); lv_obj_refresh_ext_draw_pad(buttonMov); - + if(gCfgItems.multiple_language != 0) { lv_label_set_text(labelMov, speed_menu.move); @@ -375,4 +398,5 @@ void lv_clear_change_speed() { lv_obj_del(scr); } -#endif \ No newline at end of file + +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h new file mode 100644 index 000000000000..94db796ec836 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h @@ -0,0 +1,40 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +#define MIN_EXT_SPEED_PERCENT 10 +#define MAX_EXT_SPEED_PERCENT 999 + +extern void lv_draw_change_speed(void); +extern void lv_clear_change_speed(); +extern void disp_speed_step(); +extern void disp_print_speed(); +extern void disp_speed_type(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp new file mode 100644 index 000000000000..07270871d1b6 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -0,0 +1,341 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + +#if ENABLED(TFT_LITTLE_VGL_UI) + +#include "lv_conf.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +//#include "../MarlinCore.h" +#include "draw_ui.h" +#include "../../../../sd/cardreader.h" +#include "../../../../gcode/queue.h" +#include "../../../../module/temperature.h" +#include "../../../../module/planner.h" + +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../../feature/powerloss.h" +#endif +#if ENABLED(PARK_HEAD_ON_PAUSE) + #include "../../../../feature/pause.h" +#endif + +static lv_obj_t * scr; +extern uint8_t sel_id; +extern uint8_t once_flag; +extern uint8_t gcode_preview_over; +uint8_t DialogType; + +static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) { + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (DialogType == DIALOG_TYPE_PRINT_FILE) { + preview_gcode_prehandle(list_file.file_name[sel_id]); + reset_print_time(); + start_print_time(); + + uiCfg.print_state = WORKING; + lv_clear_dialog(); + lv_draw_printing(); + + #if ENABLED(SDSUPPORT) + if (gcode_preview_over != 1) { + char *cur_name; + cur_name = strrchr(list_file.file_name[sel_id], '/'); + + SdFile file, *curDir; + card.endFilePrint(); + const char * const fname = card.diveToFile(true, curDir, cur_name); + if (!fname) return; + if (file.open(curDir, fname, O_READ)) { + gCfgItems.curFilesize = file.fileSize(); + file.close(); + update_spi_flash(); + } + card.openFileRead(cur_name); + if (card.isFileOpen()) { + feedrate_percentage = 100; + //saved_feedrate_percentage = feedrate_percentage; + planner.flow_percentage[0] = 100; + planner.e_factor[0]= planner.flow_percentage[0] * 0.01f; + #if EXTRUDERS == 2 + planner.flow_percentage[1] = 100; + planner.e_factor[1]= planner.flow_percentage[1] * 0.01f; + #endif + card.startFileprint(); + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.prepare(); + #endif + once_flag = 0; + } + } + #endif + } + else if (DialogType == DIALOG_TYPE_STOP) { + stop_print_time(); + lv_clear_dialog(); + lv_draw_ready_print(); + + #if ENABLED(SDSUPPORT) + //card.endFilePrint(); + //wait_for_heatup = false; + uiCfg.print_state = IDLE; + card.flag.abort_sd_printing = true; + //queue.clear(); + //quickstop_stepper(); + //print_job_timer.stop(); + //thermalManager.disable_all_heaters(); + + //#if ENABLED(POWER_LOSS_RECOVERY) + //recovery.purge(); + //#endif + //queue.enqueue_one_now(PSTR("G91")); + //queue.enqueue_one_now(PSTR("G1 Z10")); + //queue.enqueue_one_now(PSTR("G90")); + //queue.enqueue_one_now(PSTR("G28 X0 Y0")); + //queue.inject_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0\nM84\nM107")); + #endif + } + else if (DialogType == DIALOG_TYPE_FINISH_PRINT) { + clear_cur_ui(); + lv_draw_ready_print(); + } + #if ENABLED(ADVANCED_PAUSE_FEATURE) + else if (DialogType == DIALOG_PAUSE_MESSAGE_WAITING + || DialogType == DIALOG_PAUSE_MESSAGE_INSERT + || DialogType == DIALOG_PAUSE_MESSAGE_HEAT + ) { + wait_for_user = false; + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_OPTION) { + pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_RESUME) { + clear_cur_ui(); + draw_return_ui(); + } + #endif + } +} + +static void btn_cancel_event_cb(lv_obj_t * btn, lv_event_t event) { + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (DialogType == DIALOG_PAUSE_MESSAGE_OPTION) { + #if ENABLED(ADVANCED_PAUSE_FEATURE) + pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; + #endif + } + else { + clear_cur_ui(); + draw_return_ui(); + } + } +} + +void lv_draw_dialog(uint8_t type) { + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != DIALOG_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = DIALOG_UI; + } + disp_state = DIALOG_UI; + + DialogType = type; + + scr = lv_obj_create(NULL, NULL); + + + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + + lv_obj_t * title = lv_label_create(scr, NULL); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + //LV_IMG_DECLARE(bmp_pic); + + static lv_style_t style_btn_rel; /*A variable to store the released style*/ + lv_style_copy(&style_btn_rel, &lv_style_plain); /*Initialize from a built-in style*/ + style_btn_rel.body.border.color = lv_color_hex3(0x269); + style_btn_rel.body.border.width = 1; + style_btn_rel.body.main_color = lv_color_hex3(0xADF); + style_btn_rel.body.grad_color = lv_color_hex3(0x46B); + style_btn_rel.body.shadow.width = 4; + style_btn_rel.body.shadow.type = LV_SHADOW_BOTTOM; + style_btn_rel.body.radius = LV_RADIUS_CIRCLE; + style_btn_rel.text.color = lv_color_hex3(0xDEF); + style_btn_rel.text.font = &gb2312_puhui32; + + + static lv_style_t style_btn_pr; /*A variable to store the pressed style*/ + lv_style_copy(&style_btn_pr, &style_btn_rel); /*Initialize from the released style*/ + style_btn_pr.body.border.color = lv_color_hex3(0x46B); + style_btn_pr.body.main_color = lv_color_hex3(0x8BD); + style_btn_pr.body.grad_color = lv_color_hex3(0x24A); + style_btn_pr.body.shadow.width = 2; + style_btn_pr.text.color = lv_color_hex3(0xBCD); + style_btn_pr.text.font = &gb2312_puhui32; + + lv_obj_t * labelDialog = lv_label_create(scr, NULL); + lv_obj_set_style(labelDialog, &tft_style_lable_rel); + + + if (DialogType == DIALOG_TYPE_FINISH_PRINT || DialogType == DIALOG_PAUSE_MESSAGE_RESUME) { + lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(btnOk, BTN_OK_X+90, BTN_OK_Y); /*Set its position*/ + lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ + lv_obj_set_event_cb(btnOk, btn_ok_event_cb); + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ + + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_WAITING + ||DialogType == DIALOG_PAUSE_MESSAGE_INSERT + ||DialogType == DIALOG_PAUSE_MESSAGE_HEAT) { + lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(btnOk, BTN_OK_X+90, BTN_OK_Y); /*Set its position*/ + lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ + lv_obj_set_event_cb(btnOk, btn_ok_event_cb); + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_PAUSING + ||DialogType == DIALOG_PAUSE_MESSAGE_CHANGING + ||DialogType == DIALOG_PAUSE_MESSAGE_UNLOAD + ||DialogType == DIALOG_PAUSE_MESSAGE_LOAD + ||DialogType == DIALOG_PAUSE_MESSAGE_PURGE + ||DialogType == DIALOG_PAUSE_MESSAGE_RESUME + ||DialogType == DIALOG_PAUSE_MESSAGE_HEATING) { + + } + else { + lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(btnOk, BTN_OK_X, BTN_OK_Y); /*Set its position*/ + lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ + lv_obj_set_event_cb(btnOk, btn_ok_event_cb); + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ + + lv_obj_t * btnCancel = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(btnCancel, BTN_CANCEL_X, BTN_CANCEL_Y); /*Set its position*/ + lv_obj_set_size(btnCancel, 100, 50); /*Set its size*/ + lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); + lv_btn_set_style(btnCancel, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ + lv_btn_set_style(btnCancel, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ + lv_obj_t * labelCancel = lv_label_create(btnCancel, NULL); /*Add a label to the button*/ + + if (DialogType == DIALOG_PAUSE_MESSAGE_OPTION) { + lv_label_set_text(labelOk, pause_msg_menu.purgeMore); /*Set the labels text*/ + lv_label_set_text(labelCancel, pause_msg_menu.continuePrint); + } + else { + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ + lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); + } + } + if (DialogType == DIALOG_TYPE_PRINT_FILE) { + lv_label_set_text(labelDialog, print_file_dialog_menu.print_file); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + + lv_obj_t * labelFile = lv_label_create(scr, NULL); + lv_obj_set_style(labelFile, &tft_style_lable_rel); + + lv_label_set_text(labelFile, list_file.long_name[sel_id]); + lv_obj_align(labelFile, NULL, LV_ALIGN_CENTER, 0, -60); + } + else if (DialogType == DIALOG_TYPE_STOP) { + lv_label_set_text(labelDialog, print_file_dialog_menu.cancle_print); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_TYPE_FINISH_PRINT) { + lv_label_set_text(labelDialog, print_file_dialog_menu.print_finish); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_PAUSING) { + lv_label_set_text(labelDialog, pause_msg_menu.pausing); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_CHANGING) { + lv_label_set_text(labelDialog, pause_msg_menu.changing); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_UNLOAD) { + lv_label_set_text(labelDialog, pause_msg_menu.unload); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_WAITING) { + lv_label_set_text(labelDialog, pause_msg_menu.waiting); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_INSERT) { + lv_label_set_text(labelDialog, pause_msg_menu.insert); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_LOAD) { + lv_label_set_text(labelDialog, pause_msg_menu.load); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_PURGE) { + lv_label_set_text(labelDialog, pause_msg_menu.purge); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_RESUME) { + lv_label_set_text(labelDialog, pause_msg_menu.resume); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_HEAT) { + lv_label_set_text(labelDialog, pause_msg_menu.heat); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_HEATING) { + lv_label_set_text(labelDialog, pause_msg_menu.heating); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + else if (DialogType == DIALOG_PAUSE_MESSAGE_OPTION) { + lv_label_set_text(labelDialog, pause_msg_menu.option); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } + +} + +void lv_clear_dialog() { + lv_obj_del(scr); +} + +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h new file mode 100644 index 000000000000..3ff6aa6db587 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h @@ -0,0 +1,79 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +#define DIALOG_TYPE_STOP 0 +#define DIALOG_TYPE_PRINT_FILE 1 +#define DIALOG_TYPE_REPRINT_NO_FILE 2 + +#define DIALOG_TYPE_M80_FAIL 3 //** +#define DIALOG_TYPE_MESSEGE_ERR1 4 //** + +#define DIALOG_TYPE_UPDATE_ESP_FIRMARE 5 +#define DIALOG_TYPE_UPDATE_ESP_DATA 6 +#define DIALOG_TYPE_UPLOAD_FILE 7 +#define DIALOG_TYPE_UNBIND 8 + +#define DIALOG_TYPE_FILAMENT_LOAD_HEAT 9 +#define DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED 10 +#define DIALOG_TYPE_FILAMENT_LOADING 11 +#define DIALOG_TYPE_FILAMENT_LOAD_COMPLETED 12 +#define DIALOG_TYPE_FILAMENT_UNLOAD_HEAT 13 +#define DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED 14 +#define DIALOG_TYPE_FILAMENT_UNLOADING 15 +#define DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED 16 + +#define DIALOG_TYPE_FILE_LOADING 17 //** + +#define DIALOG_TYPE_FILAMENT_NO_PRESS 18 +#define DIALOG_TYPE_FINISH_PRINT 19 + +#define WIFI_ENABLE_TIPS 20 + +#define DIALOG_PAUSE_MESSAGE_PAUSING 21 +#define DIALOG_PAUSE_MESSAGE_CHANGING 22 +#define DIALOG_PAUSE_MESSAGE_UNLOAD 23 +#define DIALOG_PAUSE_MESSAGE_WAITING 24 +#define DIALOG_PAUSE_MESSAGE_INSERT 25 +#define DIALOG_PAUSE_MESSAGE_LOAD 26 +#define DIALOG_PAUSE_MESSAGE_PURGE 27 +#define DIALOG_PAUSE_MESSAGE_RESUME 28 +#define DIALOG_PAUSE_MESSAGE_HEAT 29 +#define DIALOG_PAUSE_MESSAGE_HEATING 30 +#define DIALOG_PAUSE_MESSAGE_OPTION 31 + +#define BTN_OK_X 100 +#define BTN_OK_Y 180 +#define BTN_CANCEL_X 280 +#define BTN_CANCEL_Y 180 + +extern void lv_draw_dialog(uint8_t type); +extern void lv_clear_dialog(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_error_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp similarity index 55% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_error_message.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp index 116682e4edb6..0ddf6ea11a67 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_error_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp @@ -1,15 +1,37 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" -#include "../../../../../../Configuration.h" -#include "../inc/tft_lvgl_configuration.h" -#include "../inc/mks_hardware_test.h" -#include "../inc/draw_ui.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +//#include "../MarlinCore.h" +#include "../../../../../Configuration.h" +#include "tft_lvgl_configuration.h" +#include "mks_hardware_test.h" +#include "draw_ui.h" static lv_obj_t * scr; @@ -25,13 +47,13 @@ void lv_draw_error_message(PGM_P const msg) disp_state = ERROR_MESSAGE_UI; scr = lv_obj_create(NULL, NULL); - + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_refr_now(lv_refr_get_disp_refreshing()); - + if(msg) { message = lv_label_create(scr, NULL); @@ -57,11 +79,11 @@ void lv_draw_error_message(PGM_P const msg) disp_string((TFT_WIDTH-strlen(msg)*16)/2,100,msg,0xffff,0x0000); disp_string((TFT_WIDTH-strlen("PRINTER HALTED")*16)/2,140,"PRINTER HALTED",0xffff,0x0000); disp_string((TFT_WIDTH-strlen("Please Reset")*16)/2,180,"Please Reset",0xffff,0x0000); - + } void lv_clear_error_message() { lv_obj_del(scr); } -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h new file mode 100644 index 000000000000..35ac24df0170 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_error_message(PGM_P const msg); +extern void lv_clear_error_message(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_extrusion.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp similarity index 85% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_extrusion.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp index d35ec37a7e16..66a59146a272 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_extrusion.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp @@ -1,14 +1,36 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" -#include "../inc/draw_ui.h" -#include "../../../../../module/temperature.h" -#include "../../../../../gcode/queue.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +//#include "../MarlinCore.h" +#include "draw_ui.h" +#include "../../../../module/temperature.h" +#include "../../../../gcode/queue.h" static lv_obj_t * scr; static lv_obj_t * buttoType,*buttonStep,*buttonSpeed; @@ -33,8 +55,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_E_ADD: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius>= EXTRUDE_MINTEMP) @@ -43,7 +65,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) memset(public_buf_l,0,sizeof(public_buf_l)); sprintf((char *)public_buf_l, "G1 E%d F%d", uiCfg.extruStep, 60 * uiCfg.extruSpeed); queue.enqueue_one_now(PSTR(public_buf_l)); - queue.enqueue_one_now(PSTR("G90")); + queue.enqueue_one_now(PSTR("G90")); extructAmount += uiCfg.extruStep; disp_extru_amount(); @@ -52,7 +74,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_E_DEC: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { if(thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius>= EXTRUDE_MINTEMP) @@ -60,18 +82,18 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) queue.enqueue_one_now(PSTR("G91")); memset(public_buf_l,0,sizeof(public_buf_l)); sprintf((char *)public_buf_l, "G1 E%d F%d", 0-uiCfg.extruStep, 60 * uiCfg.extruSpeed); - queue.enqueue_one_now(PSTR(public_buf_l)); - queue.enqueue_one_now(PSTR("G90")); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); extructAmount -= uiCfg.extruStep; disp_extru_amount(); } } - + break; case ID_E_TYPE: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(EXTRUDERS == 2) @@ -91,19 +113,19 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { uiCfg.curSprayerChoose = 0; } - + extructAmount = 0; disp_hotend_temp(); disp_ext_type(); - + disp_extru_amount(); } break; case ID_E_STEP: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { switch(abs(uiCfg.extruStep)) @@ -115,7 +137,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) case 5: uiCfg.extruStep = 10; break; - + case 10: uiCfg.extruStep = 1; break; @@ -128,7 +150,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_E_SPEED: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { switch(uiCfg.extruSpeed) @@ -144,7 +166,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) case 20: uiCfg.extruSpeed = 1; break; - + default: break; } @@ -153,7 +175,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_E_RETURN: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { clear_cur_ui(); @@ -177,7 +199,7 @@ void lv_draw_extrusion(void) disp_state = EXTRUSION_UI; scr = lv_obj_create(NULL, NULL); - + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); @@ -186,11 +208,11 @@ void lv_draw_extrusion(void) lv_obj_set_style(title, &tft_style_lable_rel); lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); lv_label_set_text(title, creat_title_text()); - + lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic); - + /*Create an Image button*/ buttonAdd = lv_imgbtn_create(scr, NULL); buttonDec = lv_imgbtn_create(scr, NULL); @@ -212,31 +234,31 @@ void lv_draw_extrusion(void) lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); - + lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttoType, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttoType, LV_BTN_STATE_REL, &tft_style_lable_rel); - + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_E_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_E_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif - + lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); lv_obj_set_pos(buttoType,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); @@ -251,15 +273,15 @@ void lv_draw_extrusion(void) lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); lv_btn_set_layout(buttonSpeed, LV_LAYOUT_OFF); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); labelType = lv_label_create(buttoType, NULL); labelStep = lv_label_create(buttonStep, NULL); labelSpeed = lv_label_create(buttonSpeed, NULL); lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - + + if(gCfgItems.multiple_language !=0) { lv_label_set_text(labelAdd, extrude_menu.in); @@ -288,7 +310,7 @@ void lv_draw_extrusion(void) void disp_ext_type() { if(uiCfg.curSprayerChoose == 1) - { + { lv_obj_set_event_cb_mks(buttoType, event_handler,ID_E_TYPE,"bmp_Extru2.bin",0); if(gCfgItems.multiple_language != 0) { @@ -304,13 +326,13 @@ void disp_ext_type() lv_label_set_text(labelType, extrude_menu.ext1); lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); } - } + } } void disp_ext_speed() { if(uiCfg.extruSpeed == 20) - lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_high.bin",0); + lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_high.bin",0); else if(uiCfg.extruSpeed == 1) lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_slow.bin",0); else @@ -322,7 +344,7 @@ void disp_ext_speed() { lv_label_set_text(labelSpeed, extrude_menu.high); lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } + } else if(uiCfg.extruSpeed == 1) { lv_label_set_text(labelSpeed, extrude_menu.low); @@ -332,8 +354,8 @@ void disp_ext_speed() { lv_label_set_text(labelSpeed, extrude_menu.normal); lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - } + } + } } void disp_hotend_temp() @@ -341,12 +363,12 @@ void disp_hotend_temp() char buf[20] = {0}; public_buf_l[0] = '\0'; - + strcat(public_buf_l,extrude_menu.temper_text); - + sprintf(buf, extrude_menu.temp_value, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); - + strcat(public_buf_l,buf); lv_label_set_text(tempText, public_buf_l); lv_obj_align(tempText, NULL, LV_ALIGN_CENTER,0, -50); @@ -367,10 +389,10 @@ void disp_extru_amount() } else { - strcat(public_buf_l,extrude_menu.ext2); + strcat(public_buf_l,extrude_menu.ext2); } strcat(public_buf_l,buf1); - } + } else if(extructAmount < 9999 && extructAmount > -999) { sprintf(buf1, extrude_menu.count_value_cm, extructAmount/10); @@ -380,9 +402,9 @@ void disp_extru_amount() } else { - strcat(public_buf_l,extrude_menu.ext2); + strcat(public_buf_l,extrude_menu.ext2); } - strcat(public_buf_l,buf1); + strcat(public_buf_l,buf1); } else { @@ -393,11 +415,11 @@ void disp_extru_amount() } else { - strcat(public_buf_l,extrude_menu.ext2); + strcat(public_buf_l,extrude_menu.ext2); } - strcat(public_buf_l,buf1); + strcat(public_buf_l,buf1); } - + lv_label_set_text(ExtruText, public_buf_l); lv_obj_align(ExtruText, NULL, LV_ALIGN_CENTER,0, -75); } @@ -405,7 +427,7 @@ void disp_extru_amount() void disp_ext_step() { if(uiCfg.extruStep == 1) - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_E_STEP,"bmp_Step1_mm.bin",0); + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_E_STEP,"bmp_Step1_mm.bin",0); else if(uiCfg.extruStep == 5) lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_E_STEP,"bmp_Step5_mm.bin",0); else if(uiCfg.extruStep == 10) @@ -417,7 +439,7 @@ void disp_ext_step() { lv_label_set_text(labelStep, extrude_menu.step_1mm); lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } + } else if(uiCfg.extruStep == 5) { lv_label_set_text(labelStep, extrude_menu.step_5mm); @@ -427,12 +449,12 @@ void disp_ext_step() { lv_label_set_text(labelStep, extrude_menu.step_10mm); lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - } + } + } } void lv_clear_extrusion() { lv_obj_del(scr); } -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h new file mode 100644 index 000000000000..e9aeaacd8b41 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h @@ -0,0 +1,39 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_extrusion(void); +extern void lv_clear_extrusion(); +extern void disp_ext_type(); +extern void disp_ext_step(); +extern void disp_ext_speed(); +extern void disp_hotend_temp(); +extern void disp_extru_amount(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_fan.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp similarity index 81% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_fan.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp index f858f66f9261..06f43f39fda5 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_fan.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp @@ -1,15 +1,37 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" -#include "../../../../../../Configuration.h" -#include "../inc/draw_ui.h" -#include "../../../../../module/temperature.h" -#include "../../../../../gcode/queue.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +//#include "../MarlinCore.h" +#include "../../../../../Configuration.h" +#include "draw_ui.h" +#include "../../../../module/temperature.h" +#include "../../../../gcode/queue.h" static lv_obj_t * scr; static lv_obj_t * fanText; @@ -29,13 +51,13 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_F_ADD: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { - + if(fanSpeed + 1 <= 255) - { + { fanSpeed++; memset(public_buf_l,0,sizeof(public_buf_l)); sprintf(public_buf_l, "M106 S%d",fanSpeed); @@ -45,23 +67,23 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_F_DEC: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { if(fanSpeed > 0) - { + { fanSpeed--; memset(public_buf_l,0,sizeof(public_buf_l)); sprintf(public_buf_l, "M106 S%d",fanSpeed); queue.enqueue_one_now(PSTR(public_buf_l)); } } - + break; case ID_F_HIGH: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { queue.enqueue_one_now(PSTR("M106 S255")); @@ -69,8 +91,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_F_MID: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { queue.enqueue_one_now(PSTR("M106 S127")); @@ -78,7 +100,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_F_OFF: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { queue.enqueue_one_now(PSTR("M107")); @@ -86,7 +108,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_F_RETURN: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { clear_cur_ui(); @@ -111,7 +133,7 @@ void lv_draw_fan(void) disp_state = FAN_UI; scr = lv_obj_create(NULL, NULL); - + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); @@ -120,13 +142,13 @@ void lv_draw_fan(void) lv_obj_set_style(title, &tft_style_lable_rel); lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); lv_label_set_text(title, creat_title_text()); - + lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic); - - + + /*Create an Image button*/ buttonAdd = lv_imgbtn_create(scr, NULL); buttonDec = lv_imgbtn_create(scr, NULL); @@ -147,33 +169,33 @@ void lv_draw_fan(void) lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonHigh, event_handler,ID_F_HIGH,"bmp_Speed255.bin",0); + + lv_obj_set_event_cb_mks(buttonHigh, event_handler,ID_F_HIGH,"bmp_Speed255.bin",0); lv_imgbtn_set_src(buttonHigh, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonHigh, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonHigh, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonHigh, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonHigh, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_obj_set_event_cb_mks(buttonMid, event_handler,ID_F_MID,"bmp_Speed127.bin",0); lv_imgbtn_set_src(buttonMid, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonMid, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonMid, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonMid, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonMid, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonOff, event_handler,ID_F_OFF,"bmp_Speed0.bin",0); + lv_obj_set_event_cb_mks(buttonOff, event_handler,ID_F_OFF,"bmp_Speed0.bin",0); lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_F_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_F_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif - + lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); lv_obj_set_pos(buttonHigh,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); @@ -188,15 +210,15 @@ void lv_draw_fan(void) lv_btn_set_layout(buttonMid, LV_LAYOUT_OFF); lv_btn_set_layout(buttonOff, LV_LAYOUT_OFF); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); lv_obj_t * labelHigh = lv_label_create(buttonHigh, NULL); lv_obj_t * labelMid = lv_label_create(buttonMid, NULL); lv_obj_t * labelOff = lv_label_create(buttonOff, NULL); lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - + + if(gCfgItems.multiple_language !=0) { lv_label_set_text(labelAdd, fan_menu.add); @@ -210,7 +232,7 @@ void lv_draw_fan(void) lv_label_set_text(labelMid, fan_menu.half); lv_obj_align(labelMid, buttonMid, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - + lv_label_set_text(labelOff,fan_menu.off); lv_obj_align(labelOff, buttonOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); @@ -239,4 +261,4 @@ void lv_clear_fan() { lv_obj_del(scr); } -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h new file mode 100644 index 000000000000..86a04ca724e5 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h @@ -0,0 +1,35 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_fan(void); +extern void lv_clear_fan(); +extern void disp_fan_value(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_home.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp similarity index 82% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_home.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp index a96307a6dddd..6d0f6f206997 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_home.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp @@ -1,15 +1,37 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../inc/draw_ready_print.h" -#include "../inc/draw_set.h" +#include "draw_ready_print.h" +#include "draw_set.h" #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" -#include "../inc/draw_ui.h" -#include "../../../../../gcode/queue.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +//#include "../MarlinCore.h" +#include "draw_ui.h" +#include "../../../../gcode/queue.h" static lv_obj_t * scr; @@ -27,8 +49,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_H_ALL: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { queue.inject_P(PSTR("G28")); @@ -36,8 +58,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_H_X: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { queue.inject_P(PSTR("G28 X0")); @@ -45,8 +67,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_H_Y: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { queue.inject_P(PSTR("G28 Y0")); @@ -54,8 +76,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_H_Z: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { queue.inject_P(PSTR("G28 Z0")); @@ -63,8 +85,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_H_OFF_ALL: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { queue.inject_P(PSTR("M84")); @@ -72,8 +94,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_H_OFF_XY: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { queue.inject_P(PSTR("M84 X Y")); @@ -81,7 +103,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_H_RETURN: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { lv_obj_del(scr); @@ -109,7 +131,7 @@ void lv_draw_home(void) scr = lv_obj_create(NULL, NULL); //static lv_style_t tool_style; - + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); @@ -118,11 +140,11 @@ void lv_draw_home(void) lv_obj_set_style(title, &tft_style_lable_rel); lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); lv_label_set_text(title, creat_title_text()); - + lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic); - + /*Create an Image button*/ //buttonWifi = lv_imgbtn_create(scr, NULL); buttonHomeAll = lv_imgbtn_create(scr, NULL); @@ -133,7 +155,7 @@ void lv_draw_home(void) buttonBack = lv_imgbtn_create(scr, NULL); buttonOffAll = lv_imgbtn_create(scr, NULL); buttonOffXY = lv_imgbtn_create(scr, NULL); - + //lv_obj_set_event_cb_mks(buttonWifi, event_handler,ID_S_WIFI,"bmp_Wifi.bin",0); //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_REL, &bmp_pic); //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_PR, &bmp_pic); @@ -147,45 +169,45 @@ void lv_draw_home(void) lv_imgbtn_set_style(buttonHomeAll, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonHomeAll, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonHomeX, event_handler,ID_H_X,"bmp_zeroX.bin",0); + lv_obj_set_event_cb_mks(buttonHomeX, event_handler,ID_H_X,"bmp_zeroX.bin",0); lv_imgbtn_set_src(buttonHomeX, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonHomeX, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonHomeX, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonHomeX, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonHomeX, LV_BTN_STATE_REL, &tft_style_lable_rel); - //lv_obj_set_event_cb_mks(buttonContinue, event_handler,ID_S_CONTINUE,"bmp_Breakpoint.bin",0); + //lv_obj_set_event_cb_mks(buttonContinue, event_handler,ID_S_CONTINUE,"bmp_Breakpoint.bin",0); //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_REL, &bmp_pic); - //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_PR, &bmp_pic); //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_PR, &tft_style_lable_pre); //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonHomeY, event_handler,ID_H_Y,"bmp_zeroY.bin",0); + lv_obj_set_event_cb_mks(buttonHomeY, event_handler,ID_H_Y,"bmp_zeroY.bin",0); lv_imgbtn_set_src(buttonHomeY, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonHomeY, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonHomeY, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonHomeY, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonHomeY, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonHomeZ, event_handler,ID_H_Z,"bmp_zeroZ.bin",0); + lv_obj_set_event_cb_mks(buttonHomeZ, event_handler,ID_H_Z,"bmp_zeroZ.bin",0); lv_imgbtn_set_src(buttonHomeZ, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonHomeZ, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonHomeZ, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonHomeZ, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonHomeZ, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonOffAll, event_handler,ID_H_OFF_ALL,"bmp_Motor_off.bin",0); + lv_obj_set_event_cb_mks(buttonOffAll, event_handler,ID_H_OFF_ALL,"bmp_Motor_off.bin",0); lv_imgbtn_set_src(buttonOffAll, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonOffAll, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonOffAll, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonOffAll, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonOffAll, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonOffXY, event_handler,ID_H_OFF_XY,"bmp_Motor_off.bin",0); + lv_obj_set_event_cb_mks(buttonOffXY, event_handler,ID_H_OFF_XY,"bmp_Motor_off.bin",0); lv_imgbtn_set_src(buttonOffXY, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonOffXY, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonOffXY, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonOffXY, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonOffXY, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_H_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_H_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); @@ -218,7 +240,7 @@ void lv_draw_home(void) lv_btn_set_layout(buttonOffAll, LV_LAYOUT_OFF); lv_btn_set_layout(buttonOffXY, LV_LAYOUT_OFF); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - + //lv_obj_t * labelWifi= lv_label_create(buttonWifi, NULL); lv_obj_t * labelHomeAll = lv_label_create(buttonHomeAll, NULL); lv_obj_t * labelHomeX= lv_label_create(buttonHomeX, NULL); @@ -228,8 +250,8 @@ void lv_draw_home(void) lv_obj_t * labelOffAll = lv_label_create(buttonOffAll, NULL); lv_obj_t * labelOffXY = lv_label_create(buttonOffXY, NULL); lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - + + if(gCfgItems.multiple_language !=0) { //lv_label_set_text(labelWifi, set_menu.wifi); @@ -244,10 +266,10 @@ void lv_draw_home(void) //lv_label_set_text(label_Continue, set_menu.breakpoint); //lv_obj_align(label_Continue, buttonContinue, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - lv_label_set_text(labelHomeY, home_menu.home_y); + lv_label_set_text(labelHomeY, home_menu.home_y); lv_obj_align(labelHomeY, buttonHomeY, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - lv_label_set_text(labelHomeZ, home_menu.home_z); + lv_label_set_text(labelHomeZ, home_menu.home_z); lv_obj_align(labelHomeZ, buttonHomeZ, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); lv_label_set_text(labelOffAll, set_menu.motoroff); @@ -255,7 +277,7 @@ void lv_draw_home(void) lv_label_set_text(labelOffXY, set_menu.motoroffXY); lv_obj_align(labelOffXY, buttonOffXY, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - + lv_label_set_text(label_Back, common_menu.text_back); lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h new file mode 100644 index 000000000000..0fb1c3095af2 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_home(void); +extern void lv_clear_home(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp similarity index 87% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_language.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp index dabc71c47c71..39117f2fe040 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp @@ -1,12 +1,34 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" -#include "../inc/draw_ui.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +//#include "../MarlinCore.h" +#include "draw_ui.h" #include //static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn; @@ -39,8 +61,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_CN: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language,UNSELECTED); @@ -52,8 +74,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_T_CN: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language,UNSELECTED); @@ -65,8 +87,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_EN: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language,UNSELECTED); @@ -78,8 +100,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_RU: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language,UNSELECTED); @@ -91,8 +113,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_ES: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language,UNSELECTED); @@ -104,8 +126,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_FR: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language,UNSELECTED); @@ -117,8 +139,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_IT: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language,UNSELECTED); @@ -130,10 +152,10 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_L_RETURN: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { - + buttonCN = NULL; buttonT_CN = NULL; buttonEN = NULL; @@ -143,7 +165,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) buttonFR = NULL; buttonIT = NULL; buttonBack = NULL; - + lv_obj_del(scr); lv_draw_set(); } @@ -156,16 +178,16 @@ static void disp_language(uint8_t language,uint8_t state) { uint16_t id; lv_obj_t *obj; - + public_buf_l[0] = '\0'; - + switch(language){ case LANG_SIMPLE_CHINESE: id = ID_CN; strcat(public_buf_l,"bmp_Simple_cn"); obj = buttonCN; - + break; case LANG_COMPLEX_CHINESE: id = ID_T_CN; @@ -203,10 +225,10 @@ static void disp_language(uint8_t language,uint8_t state) obj = buttonCN; break; } - + if(state == SELECTED) strcat(public_buf_l,"_sel.bin"); else strcat(public_buf_l,".bin"); - + lv_obj_set_event_cb_mks(obj, event_handler,id,public_buf_l,0); if(state == UNSELECTED)lv_obj_refresh_ext_draw_pad(obj); @@ -214,7 +236,7 @@ static void disp_language(uint8_t language,uint8_t state) void lv_draw_language(void) { - + if(disp_state_stack._disp_state[disp_state_stack._disp_index] != LANGUAGE_UI) { disp_state_stack._disp_index++; @@ -225,7 +247,7 @@ void lv_draw_language(void) scr = lv_obj_create(NULL, NULL); //static lv_style_t tool_style; - + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); @@ -234,11 +256,11 @@ void lv_draw_language(void) lv_obj_set_style(title, &tft_style_lable_rel); lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); lv_label_set_text(title, creat_title_text()); - + lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic); - + /*Create an Image button*/ buttonCN = lv_imgbtn_create(scr, NULL); buttonT_CN = lv_imgbtn_create(scr, NULL); @@ -249,7 +271,7 @@ void lv_draw_language(void) buttonIT = lv_imgbtn_create(scr, NULL); buttonBack = lv_imgbtn_create(scr, NULL); - + lv_obj_set_event_cb_mks(buttonCN, event_handler,ID_CN,"bmp_Simple_cn.bin",0); lv_imgbtn_set_src(buttonCN, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonCN, LV_BTN_STATE_PR, &bmp_pic); @@ -263,44 +285,44 @@ void lv_draw_language(void) lv_imgbtn_set_style(buttonT_CN, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonT_CN, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonEN, event_handler,ID_EN,"bmp_English.bin",0); + lv_obj_set_event_cb_mks(buttonEN, event_handler,ID_EN,"bmp_English.bin",0); lv_imgbtn_set_src(buttonEN, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonEN, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonEN, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonEN, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonEN, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonRU, event_handler,ID_RU,"bmp_Russian.bin",0); + lv_obj_set_event_cb_mks(buttonRU, event_handler,ID_RU,"bmp_Russian.bin",0); lv_imgbtn_set_src(buttonRU, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonRU, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonRU, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonRU, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonRU, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonES, event_handler,ID_ES,"bmp_Spanish.bin",0); + lv_obj_set_event_cb_mks(buttonES, event_handler,ID_ES,"bmp_Spanish.bin",0); lv_imgbtn_set_src(buttonES, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonES, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonES, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonES, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonES, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonFR, event_handler,ID_FR,"bmp_French.bin",0); + lv_obj_set_event_cb_mks(buttonFR, event_handler,ID_FR,"bmp_French.bin",0); lv_imgbtn_set_src(buttonFR, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonFR, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonFR, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonFR, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonFR, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonIT, event_handler,ID_IT,"bmp_Italy.bin",0); + lv_obj_set_event_cb_mks(buttonIT, event_handler,ID_IT,"bmp_Italy.bin",0); lv_imgbtn_set_src(buttonIT, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonIT, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonIT, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonIT, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonIT, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_L_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_L_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif - + lv_obj_set_pos(buttonCN,INTERVAL_V,titleHeight); lv_obj_set_pos(buttonT_CN,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); lv_obj_set_pos(buttonEN,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); @@ -319,7 +341,7 @@ void lv_draw_language(void) lv_btn_set_layout(buttonFR, LV_LAYOUT_OFF); lv_btn_set_layout(buttonIT, LV_LAYOUT_OFF); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - + lv_obj_t * label_CN = lv_label_create(buttonCN, NULL); lv_obj_t * label_T_CN = lv_label_create(buttonT_CN, NULL); lv_obj_t * label_EN = lv_label_create(buttonEN, NULL); @@ -330,7 +352,7 @@ void lv_draw_language(void) lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); disp_language(gCfgItems.language,SELECTED); - + if(gCfgItems.multiple_language !=0) { lv_label_set_text(label_CN, language_menu.chinese_s); @@ -347,7 +369,7 @@ void lv_draw_language(void) lv_label_set_text(label_ES, language_menu.spanish); lv_obj_align(label_ES, buttonES, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - + lv_label_set_text(label_FR, language_menu.french); lv_obj_align(label_FR, buttonFR, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h new file mode 100644 index 000000000000..8ae91d1c0b70 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_language(void); +extern void lv_clear_language(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_manuaLevel.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp similarity index 84% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_manuaLevel.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp index bd49dda5a52d..70faedbb28b4 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_manuaLevel.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp @@ -1,12 +1,34 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -#include "../inc/draw_ui.h" -#include "../../../../../gcode/queue.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +#include "draw_ui.h" +#include "../../../../gcode/queue.h" //static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn; static lv_obj_t * scr; @@ -25,11 +47,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_M_POINT1: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { - + if(queue.length == 0) { if(uiCfg.leveling_first_time) @@ -39,7 +61,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } queue.enqueue_one_P(PSTR("G1 Z10")); - + memset(public_buf_l,0,sizeof(public_buf_l)); sprintf(public_buf_l, "G1 X%d Y%d",X_MIN_POS+30, Y_MIN_POS+30); queue.enqueue_one_P(PSTR(public_buf_l)); @@ -49,8 +71,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_M_POINT2: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(queue.length == 0) @@ -62,7 +84,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } queue.enqueue_one_P(PSTR("G1 Z10")); - + memset(public_buf_l,0,sizeof(public_buf_l)); sprintf(public_buf_l, "G1 X%d Y%d",X_MAX_POS-30, Y_MIN_POS+30); queue.enqueue_one_P(PSTR(public_buf_l)); @@ -72,8 +94,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_M_POINT3: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(queue.length == 0) @@ -85,19 +107,19 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } queue.enqueue_one_P(PSTR("G1 Z10")); - + memset(public_buf_l,0,sizeof(public_buf_l)); sprintf(public_buf_l, "G1 X%d Y%d",X_MAX_POS-30, Y_MAX_POS-30); queue.enqueue_one_P(PSTR(public_buf_l)); queue.enqueue_one_P(PSTR("G1 Z0")); } } - + break; case ID_M_POINT4: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(queue.length == 0) @@ -109,7 +131,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } queue.enqueue_one_P(PSTR("G1 Z10")); - + memset(public_buf_l,0,sizeof(public_buf_l)); sprintf(public_buf_l, "G1 X%d Y%d",X_MIN_POS+30, Y_MAX_POS-30); queue.enqueue_one_P(PSTR(public_buf_l)); @@ -119,8 +141,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_M_POINT5: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(queue.length == 0) @@ -132,18 +154,18 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } queue.enqueue_one_P(PSTR("G1 Z10")); - + memset(public_buf_l,0,sizeof(public_buf_l)); sprintf(public_buf_l, "G1 X%d Y%d",X_BED_SIZE/2, Y_BED_SIZE/2); queue.enqueue_one_P(PSTR(public_buf_l)); queue.enqueue_one_P(PSTR("G1 Z0")); } } - + break; case ID_MANUAL_RETURN: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { lv_clear_manualLevel(); @@ -170,7 +192,7 @@ void lv_draw_manualLevel(void) scr = lv_obj_create(NULL, NULL); //static lv_style_t tool_style; - + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); @@ -179,11 +201,11 @@ void lv_draw_manualLevel(void) lv_obj_set_style(title, &tft_style_lable_rel); lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); lv_label_set_text(title, creat_title_text()); - + lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic); - + /*Create an Image button*/ buttonPoint1 = lv_imgbtn_create(scr, NULL); buttonPoint2 = lv_imgbtn_create(scr, NULL); @@ -192,7 +214,7 @@ void lv_draw_manualLevel(void) buttonPoint5 = lv_imgbtn_create(scr, NULL); buttonBack = lv_imgbtn_create(scr, NULL); - + lv_obj_set_event_cb_mks(buttonPoint1, event_handler,ID_M_POINT1,"bmp_Leveling1.bin",0); lv_imgbtn_set_src(buttonPoint1, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonPoint1, LV_BTN_STATE_PR, &bmp_pic); @@ -206,32 +228,32 @@ void lv_draw_manualLevel(void) lv_imgbtn_set_style(buttonPoint2, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonPoint2, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonPoint3, event_handler,ID_M_POINT3,"bmp_Leveling3.bin",0); + lv_obj_set_event_cb_mks(buttonPoint3, event_handler,ID_M_POINT3,"bmp_Leveling3.bin",0); lv_imgbtn_set_src(buttonPoint3, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonPoint3, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonPoint3, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonPoint3, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonPoint3, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonPoint4, event_handler,ID_M_POINT4,"bmp_Leveling4.bin",0); + lv_obj_set_event_cb_mks(buttonPoint4, event_handler,ID_M_POINT4,"bmp_Leveling4.bin",0); lv_imgbtn_set_src(buttonPoint4, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonPoint4, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonPoint4, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonPoint4, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonPoint4, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonPoint5, event_handler,ID_M_POINT5,"bmp_Leveling5.bin",0); + lv_obj_set_event_cb_mks(buttonPoint5, event_handler,ID_M_POINT5,"bmp_Leveling5.bin",0); lv_imgbtn_set_src(buttonPoint5, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonPoint5, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonPoint5, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonPoint5, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonPoint5, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_MANUAL_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_MANUAL_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif - + lv_obj_set_pos(buttonPoint1,INTERVAL_V,titleHeight); lv_obj_set_pos(buttonPoint2,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); lv_obj_set_pos(buttonPoint3,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); @@ -246,15 +268,15 @@ void lv_draw_manualLevel(void) lv_btn_set_layout(buttonPoint4, LV_LAYOUT_OFF); lv_btn_set_layout(buttonPoint5, LV_LAYOUT_OFF); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - + lv_obj_t * label_Point1 = lv_label_create(buttonPoint1, NULL); lv_obj_t * label_Point2 = lv_label_create(buttonPoint2, NULL); lv_obj_t * label_Point3 = lv_label_create(buttonPoint3, NULL); lv_obj_t * label_Point4 = lv_label_create(buttonPoint4, NULL); lv_obj_t * label_Point5 = lv_label_create(buttonPoint5, NULL); lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - + + if(gCfgItems.multiple_language !=0) { lv_label_set_text(label_Point1, leveling_menu.position1); @@ -281,4 +303,4 @@ void lv_clear_manualLevel() { lv_obj_del(scr); } -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h new file mode 100644 index 000000000000..4b1b304b140d --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_manualLevel(void); +extern void lv_clear_manualLevel(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_move_motor.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp similarity index 85% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_move_motor.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp index c92c97d3c548..79c4f26d75f2 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_move_motor.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp @@ -1,13 +1,35 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" -#include "../inc/draw_ui.h" -#include "../../../../../gcode/queue.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +//#include "../MarlinCore.h" +#include "draw_ui.h" +#include "../../../../gcode/queue.h" static lv_obj_t * scr; @@ -28,8 +50,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_M_X_P: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(queue.length <= (BUFSIZE-3)) @@ -44,8 +66,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_M_X_N: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(queue.length <= (BUFSIZE-3)) @@ -54,14 +76,14 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) queue.enqueue_one_now(PSTR("G91")); sprintf(public_buf_l, "G1 X-%3.1f F%d",uiCfg.move_dist, uiCfg.moveSpeed); queue.enqueue_one_now(PSTR(public_buf_l)); - queue.enqueue_one_now(PSTR("G90")); + queue.enqueue_one_now(PSTR("G90")); } } break; case ID_M_Y_P: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(queue.length <= (BUFSIZE-3)) @@ -76,8 +98,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_M_Y_N: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(queue.length <= (BUFSIZE-3)) @@ -92,7 +114,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_M_Z_P: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { if(queue.length <= (BUFSIZE-3)) @@ -107,7 +129,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_M_Z_N: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { if(queue.length <= (BUFSIZE-3)) @@ -122,7 +144,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_M_STEP: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { if(abs(10 * (int)uiCfg.move_dist) == 100) @@ -133,14 +155,14 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { uiCfg.move_dist *= (float)10; } - + disp_move_dist(); } - + break; case ID_M_RETURN: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { clear_cur_ui(); @@ -165,7 +187,7 @@ void lv_draw_move_motor(void) disp_state = MOVE_MOTOR_UI; scr = lv_obj_create(NULL, NULL); - + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); @@ -174,12 +196,12 @@ void lv_draw_move_motor(void) lv_obj_set_style(title, &tft_style_lable_rel); lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); lv_label_set_text(title, creat_title_text()); - + lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic); - - + + /*Create an Image button*/ buttonXI = lv_imgbtn_create(scr, NULL); buttonXD = lv_imgbtn_create(scr, NULL); @@ -203,39 +225,39 @@ void lv_draw_move_motor(void) lv_imgbtn_set_style(buttonXD, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonXD, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonYI, event_handler,ID_M_Y_P,"bmp_yAdd.bin",0); + lv_obj_set_event_cb_mks(buttonYI, event_handler,ID_M_Y_P,"bmp_yAdd.bin",0); lv_imgbtn_set_src(buttonYI, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonYI, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonYI, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonYI, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonYI, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonYD, event_handler,ID_M_Y_N,"bmp_yDec.bin",0); + lv_obj_set_event_cb_mks(buttonYD, event_handler,ID_M_Y_N,"bmp_yDec.bin",0); lv_imgbtn_set_src(buttonYD, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonYD, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonYD, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonYD, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonYD, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonZI, event_handler,ID_M_Z_P,"bmp_zAdd.bin",0); + lv_obj_set_event_cb_mks(buttonZI, event_handler,ID_M_Z_P,"bmp_zAdd.bin",0); lv_imgbtn_set_src(buttonZI, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonZI, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonZI, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonZI, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonZI, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonZD, event_handler,ID_M_Z_N,"bmp_zDec.bin",0); + lv_obj_set_event_cb_mks(buttonZD, event_handler,ID_M_Z_N,"bmp_zDec.bin",0); lv_imgbtn_set_src(buttonZD, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonZD, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonZD, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_REL, &tft_style_lable_rel); - //lv_obj_set_event_cb_mks(buttonV, event_handler,ID_T_MORE,"bmp_More.bin",0); + //lv_obj_set_event_cb_mks(buttonV, event_handler,ID_T_MORE,"bmp_More.bin",0); lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonV, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonV, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_M_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_M_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); @@ -258,7 +280,7 @@ void lv_draw_move_motor(void) lv_btn_set_layout(buttonZD, LV_LAYOUT_OFF); lv_btn_set_layout(buttonV, LV_LAYOUT_OFF); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - + lv_obj_t * labelXI = lv_label_create(buttonXI, NULL); lv_obj_t * labelXD = lv_label_create(buttonXD, NULL); lv_obj_t * labelYI = lv_label_create(buttonYI, NULL); @@ -268,7 +290,7 @@ void lv_draw_move_motor(void) labelV = lv_label_create(buttonV, NULL); lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - + if(gCfgItems.multiple_language !=0) { lv_label_set_text(labelXI, move_menu.x_add); @@ -299,7 +321,7 @@ void lv_draw_move_motor(void) void disp_move_dist() { //char buf[30] = {0}; - + if((int)(10 * uiCfg.move_dist) == 1) { lv_obj_set_event_cb_mks(buttonV, event_handler,ID_M_STEP,"bmp_Step_move0_1.bin",0); @@ -329,7 +351,7 @@ void disp_move_dist() lv_label_set_text(labelV, move_menu.step_10mm); lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); } - } + } } void lv_clear_move_motor() @@ -337,4 +359,4 @@ void lv_clear_move_motor() lv_obj_del(scr); } -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h new file mode 100644 index 000000000000..67045a980b7b --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h @@ -0,0 +1,35 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_move_motor(void); +extern void lv_clear_move_motor(); +extern void disp_move_dist(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_opration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp similarity index 87% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_opration.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp index dd9b9e5bd24a..c6a2499be34d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_opration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp @@ -1,12 +1,34 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" -#include "../inc/draw_ui.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +//#include "../MarlinCore.h" +#include "draw_ui.h" static lv_obj_t * scr; @@ -28,7 +50,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_O_PRE_HEAT: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { lv_clear_opration(); @@ -37,8 +59,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_O_EXTRUCT: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { lv_clear_opration(); @@ -47,8 +69,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_O_MOV: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { lv_clear_opration(); @@ -57,17 +79,17 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_O_FILAMENT: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { - + } break; case ID_O_FAN: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { lv_clear_opration(); @@ -76,8 +98,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_O_SPEED: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { lv_clear_opration(); @@ -86,7 +108,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_O_RETURN: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { clear_cur_ui(); @@ -95,7 +117,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_O_POWER_OFF: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { if(gCfgItems.finish_power_off == 1) @@ -148,25 +170,25 @@ void lv_draw_opration(void) lv_obj_set_style(title, &tft_style_lable_rel); lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); lv_label_set_text(title, creat_title_text()); - + lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic); - + /*Create an Image button*/ buttonPreHeat = lv_imgbtn_create(scr, NULL); buttonExtrusion = lv_imgbtn_create(scr, NULL); buttonFan = lv_imgbtn_create(scr, NULL); buttonSpeed = lv_imgbtn_create(scr, NULL); - - + + if(uiCfg.print_state != WORKING) //buttonFilament = lv_imgbtn_create(scr, NULL); //else buttonMove = lv_imgbtn_create(scr, NULL); buttonPowerOff = lv_imgbtn_create(scr, NULL); buttonBack = lv_imgbtn_create(scr, NULL); - + lv_obj_set_event_cb_mks(buttonPreHeat, event_handler,ID_O_PRE_HEAT,"bmp_PreHeat.bin",0); lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_REL, &bmp_pic); @@ -181,31 +203,31 @@ void lv_draw_opration(void) lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonFan, event_handler,ID_O_FAN,"bmp_Fan.bin",0); + lv_obj_set_event_cb_mks(buttonFan, event_handler,ID_O_FAN,"bmp_Fan.bin",0); lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_O_SPEED,"bmp_Speed.bin",0); + lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_O_SPEED,"bmp_Speed.bin",0); lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_REL, &tft_style_lable_rel); if(uiCfg.print_state != WORKING) /*{ - lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_O_FILAMENT,"bmp_Filamentchange.bin",0); + lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_O_FILAMENT,"bmp_Filamentchange.bin",0); lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_REL, &tft_style_lable_rel); } else*/ { - lv_obj_set_event_cb_mks(buttonMove, event_handler,ID_O_MOV,"bmp_Mov.bin",0); + lv_obj_set_event_cb_mks(buttonMove, event_handler,ID_O_MOV,"bmp_Mov.bin",0); lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_REL, &tft_style_lable_rel); } @@ -218,26 +240,26 @@ void lv_draw_opration(void) lv_obj_set_event_cb_mks(buttonPowerOff, event_handler,ID_O_POWER_OFF,"bmp_Mamual.bin",0); } lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonPowerOff, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonPowerOff, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_O_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_O_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - + #endif - + lv_obj_set_pos(buttonPreHeat,INTERVAL_V,titleHeight); lv_obj_set_pos(buttonExtrusion,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); - + lv_obj_set_pos(buttonFan,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); lv_obj_set_pos(buttonSpeed,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - + if(uiCfg.print_state != WORKING) /*{ lv_obj_set_pos(buttonFilament,INTERVAL_V,BTN_Y_PIXEL+INTERVAL_H+titleHeight); @@ -258,7 +280,7 @@ void lv_draw_opration(void) lv_btn_set_layout(buttonExtrusion, LV_LAYOUT_OFF); lv_btn_set_layout(buttonFan, LV_LAYOUT_OFF); lv_btn_set_layout(buttonSpeed, LV_LAYOUT_OFF); - + if(uiCfg.print_state != WORKING) /*{ lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF); @@ -269,13 +291,13 @@ void lv_draw_opration(void) } lv_btn_set_layout(buttonPowerOff, LV_LAYOUT_OFF); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - + labelPreHeat = lv_label_create(buttonPreHeat, NULL); labelExtrusion = lv_label_create(buttonExtrusion, NULL); label_Fan = lv_label_create(buttonFan, NULL); label_Speed = lv_label_create(buttonSpeed, NULL); - + if(uiCfg.print_state != WORKING) /*{ label_Filament = lv_label_create(buttonFilament, NULL); @@ -285,10 +307,10 @@ void lv_draw_opration(void) label_Move = lv_label_create(buttonMove, NULL); } label_PowerOff = lv_label_create(buttonPowerOff, NULL); - + label_Back = lv_label_create(buttonBack, NULL); - - + + if(gCfgItems.multiple_language !=0) { lv_label_set_text(labelPreHeat, operation_menu.temp); @@ -323,7 +345,7 @@ void lv_draw_opration(void) lv_label_set_text(label_PowerOff, printing_more_menu.manual); } lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - + lv_label_set_text(label_Back, common_menu.text_back); lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); } @@ -333,4 +355,4 @@ void lv_clear_opration() { lv_obj_del(scr); } -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.h new file mode 100644 index 000000000000..e1464a834c1a --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_opration(void); +extern void lv_clear_opration(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_pause_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp similarity index 54% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_pause_message.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp index 80c33e73b500..8bcd2ec1e8d3 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_pause_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp @@ -1,15 +1,37 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +//#include "../MarlinCore.h" -#include "../inc/draw_ui.h" +#include "draw_ui.h" #if ENABLED(ADVANCED_PAUSE_FEATURE) -#include "../../../../../feature/pause.h" +#include "../../../../feature/pause.h" void lv_draw_pause_message(const PauseMessage msg) @@ -33,4 +55,4 @@ void lv_draw_pause_message(const PauseMessage msg) } #endif -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h new file mode 100644 index 000000000000..3088018e88b9 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_pause_message(const PauseMessage msg); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_preHeat.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp similarity index 87% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_preHeat.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp index a71eadc0d01b..52f5e3bfb106 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_preHeat.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp @@ -1,14 +1,36 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" -#include "../../../../../../Configuration.h" -#include "../inc/draw_ui.h" -#include "../../../../../module/temperature.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +//#include "../MarlinCore.h" +#include "../../../../../Configuration.h" +#include "draw_ui.h" +#include "../../../../module/temperature.h" static lv_obj_t * scr; static lv_obj_t *buttoType,*buttonStep; @@ -29,19 +51,19 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_P_ADD: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(uiCfg.curTempType == 0) { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target += uiCfg.stepHeat; + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target += uiCfg.stepHeat; if(uiCfg.curSprayerChoose == 0) { if((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_0_MAXTEMP- (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) { thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); - + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); } } @@ -51,24 +73,24 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) if((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP- (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) { thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); - + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); - } + } } #endif } #if HAS_HEATED_BED else { - + thermalManager.temp_bed.target += uiCfg.stepHeat; - + if((int)thermalManager.temp_bed.target > BED_MAXTEMP- (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) { thermalManager.temp_bed.target = (float)BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1); thermalManager.start_watching_bed(); } - + } #endif disp_desire_temp(); @@ -76,7 +98,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_P_DEC: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { if(uiCfg.curTempType == 0) @@ -91,13 +113,13 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)0; thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); } - } + } #if HAS_HEATED_BED else { if((int)thermalManager.temp_bed.target > uiCfg.stepHeat) { - thermalManager.temp_bed.target -= uiCfg.stepHeat; + thermalManager.temp_bed.target -= uiCfg.stepHeat; thermalManager.start_watching_bed(); } else @@ -109,12 +131,12 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) #endif disp_desire_temp(); } - + break; case ID_P_TYPE: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(uiCfg.curTempType == 0) @@ -140,7 +162,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } else - { + { if(uiCfg.curSprayerChoose == 0) { if(TEMP_SENSOR_BED != 0) @@ -153,7 +175,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } } } - + } else if(uiCfg.curTempType == 1) { @@ -165,8 +187,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_P_STEP: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { switch(uiCfg.stepHeat) @@ -178,7 +200,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) case 5: uiCfg.stepHeat = 10; break; - + case 10: uiCfg.stepHeat = 1; break; @@ -191,7 +213,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_P_OFF: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { if(uiCfg.curTempType == 0) @@ -203,7 +225,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) else { thermalManager.temp_bed.target = (float)0; - thermalManager.start_watching_bed(); + thermalManager.start_watching_bed(); } #endif disp_desire_temp(); @@ -211,7 +233,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_P_RETURN: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { clear_cur_ui(); @@ -236,7 +258,7 @@ void lv_draw_preHeat(void) disp_state = PRE_HEAT_UI; scr = lv_obj_create(NULL, NULL); - + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); @@ -245,11 +267,11 @@ void lv_draw_preHeat(void) lv_obj_set_style(title, &tft_style_lable_rel); lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); lv_label_set_text(title, creat_title_text()); - + lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic); - + /*Create an Image button*/ buttonAdd = lv_imgbtn_create(scr, NULL); buttonDec = lv_imgbtn_create(scr, NULL); @@ -271,32 +293,32 @@ void lv_draw_preHeat(void) lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); - + lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttoType, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttoType, LV_BTN_STATE_REL, &tft_style_lable_rel); - + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonOff, event_handler,ID_P_OFF,"bmp_Speed0.bin",0); + lv_obj_set_event_cb_mks(buttonOff, event_handler,ID_P_OFF,"bmp_Speed0.bin",0); lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_P_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_P_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif - + lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); lv_obj_set_pos(buttoType,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); @@ -311,15 +333,15 @@ void lv_draw_preHeat(void) lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); lv_btn_set_layout(buttonOff, LV_LAYOUT_OFF); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); labelType = lv_label_create(buttoType, NULL); labelStep = lv_label_create(buttonStep, NULL); lv_obj_t * labelOff = lv_label_create(buttonOff, NULL); lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - + + if(gCfgItems.multiple_language !=0) { lv_label_set_text(labelAdd, preheat_menu.add); @@ -345,11 +367,11 @@ void lv_draw_preHeat(void) void disp_temp_type() { - + if(uiCfg.curTempType == 0) - { + { if(uiCfg.curSprayerChoose == 1) - { + { lv_obj_set_event_cb_mks(buttoType, event_handler,ID_P_TYPE,"bmp_Extru2.bin",0); if(gCfgItems.multiple_language != 0) { @@ -365,11 +387,11 @@ void disp_temp_type() lv_label_set_text(labelType, preheat_menu.ext1); lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); } - } - + } + } else - { + { lv_obj_set_event_cb_mks(buttoType, event_handler,ID_P_TYPE,"bmp_Bed.bin",0); if(gCfgItems.multiple_language != 0) { @@ -385,7 +407,7 @@ void disp_desire_temp() char buf[20] = {0}; public_buf_l[0] = '\0'; - + if(uiCfg.curTempType == 0) { if(uiCfg.curSprayerChoose<1) @@ -397,7 +419,7 @@ void disp_desire_temp() strcat(public_buf_l,preheat_menu.ext2); } sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); - + } #if HAS_HEATED_BED else @@ -416,7 +438,7 @@ void disp_desire_temp() void disp_step_heat() { if(uiCfg.stepHeat == 1) - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_P_STEP,"bmp_Step1_degree.bin",0); + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_P_STEP,"bmp_Step1_degree.bin",0); else if(uiCfg.stepHeat == 5) lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_P_STEP,"bmp_Step5_degree.bin",0); else if(uiCfg.stepHeat == 10) @@ -428,7 +450,7 @@ void disp_step_heat() { lv_label_set_text(labelStep, preheat_menu.step_1c); lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } + } else if(uiCfg.stepHeat == 5) { lv_label_set_text(labelStep, preheat_menu.step_5c); @@ -438,12 +460,12 @@ void disp_step_heat() { lv_label_set_text(labelStep, preheat_menu.step_10c); lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - } + } + } } void lv_clear_preHeat() { lv_obj_del(scr); } -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h new file mode 100644 index 000000000000..9d99e4f020f1 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h @@ -0,0 +1,37 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_preHeat(void); +extern void lv_clear_preHeat(); +extern void disp_temp_type(); +extern void disp_step_heat(); +extern void disp_desire_temp(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp similarity index 90% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_print_file.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index be70d4865c5d..4e0f76b9b833 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -1,13 +1,35 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" -#include "../inc/draw_ui.h" -#include "../../../../../sd/cardreader.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +//#include "../MarlinCore.h" +#include "draw_ui.h" +#include "../../../../sd/cardreader.h" static lv_obj_t * scr; @@ -28,21 +50,21 @@ extern uint8_t public_buf[512]; extern char public_buf_m[100]; uint8_t sel_id=0; -#if ENABLED (SDSUPPORT) +#if ENABLED(SDSUPPORT) static uint8_t search_file() { int valid_name_cnt=0; //char tmp[SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; - + list_file.Sd_file_cnt = 0; //list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - + //root2.rewind(); //SERIAL_PROTOCOLLN(list_file.curDirPath); - + if(curDirLever != 0)card.cd(list_file.curDirPath); else card.cdroot();//while(card.cdup()); - + const uint16_t fileCnt = card.get_num_Files(); for (uint16_t i = 0; i < fileCnt; i++) { @@ -84,36 +106,36 @@ static uint8_t search_file() strncpy(list_file.long_name[valid_name_cnt],card.filename,strlen(card.filename)); else strncpy(list_file.long_name[valid_name_cnt],card.longFilename,strlen(card.longFilename)); - - + + valid_name_cnt++; if (valid_name_cnt == 1) dir_offset[curDirLever].cur_page_first_offset = list_file.Sd_file_offset; if(valid_name_cnt >= FILE_NUM) { dir_offset[curDirLever].cur_page_last_offset = list_file.Sd_file_offset; - list_file.Sd_file_offset++; + list_file.Sd_file_offset++; break; } - list_file.Sd_file_offset++; + list_file.Sd_file_offset++; #endif } list_file.Sd_file_cnt++; } //card.closefile(false); return valid_name_cnt; - + } #endif uint8_t have_pre_pic(char *path) { - #if ENABLED (SDSUPPORT) + #if ENABLED(SDSUPPORT) char *ps1,*ps2; char *cur_name; cur_name=strrchr(path,'/'); - + card.openFileRead(cur_name); card.read(public_buf, 512); ps1 = strstr((char *)public_buf,";simage:"); @@ -122,12 +144,12 @@ uint8_t have_pre_pic(char *path) if(ps1 || ps2) { card.closefile(); - return 1; + return 1; } else { card.closefile(); - return 0; + return 0; } #endif } @@ -148,19 +170,19 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) if(obj->mks_obj_id == ID_P_UP) { if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(dir_offset[curDirLever].curPage > 0) { - + //2015.05.19 list_file.Sd_file_cnt = 0; - + if(dir_offset[curDirLever].cur_page_first_offset >= FILE_NUM) list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset - FILE_NUM; - #if ENABLED (SDSUPPORT) + #if ENABLED(SDSUPPORT) file_count = search_file(); #endif if(file_count != 0) @@ -175,16 +197,16 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) else if(obj->mks_obj_id == ID_P_DOWN) { if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { - + if(dir_offset[curDirLever].cur_page_last_offset > 0) { list_file.Sd_file_cnt = 0; list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_last_offset + 1; - #if ENABLED (SDSUPPORT) + #if ENABLED(SDSUPPORT) file_count = search_file(); #endif if(file_count != 0) @@ -203,18 +225,18 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) else if(obj->mks_obj_id == ID_P_RETURN) { if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { if(curDirLever > 0) { int8_t *ch = 0; - + ch = (int8_t *)strrchr(list_file.curDirPath, '/'); if(ch != 0) { *ch = 0; - #if ENABLED (SDSUPPORT) + #if ENABLED(SDSUPPORT) card.cdup(); #endif dir_offset[curDirLever].curPage = 0; @@ -222,13 +244,13 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) dir_offset[curDirLever].cur_page_last_offset = 0; curDirLever--; list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if ENABLED (SDSUPPORT) + #if ENABLED(SDSUPPORT) file_count = search_file(); #endif lv_obj_del(scr); disp_gcode_icon(file_count); } - + } else { @@ -244,7 +266,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) if(obj->mks_obj_id == (i+1)) { if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { if(list_file.file_name[i][0] != 0) @@ -255,7 +277,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) strcpy(list_file.curDirPath, list_file.file_name[i]); curDirLever++; list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if ENABLED (SDSUPPORT) + #if ENABLED(SDSUPPORT) file_count = search_file(); #endif lv_obj_del(scr); @@ -287,30 +309,30 @@ void lv_draw_print_file(void) } disp_state = PRINT_FILE_UI; - curDirLever = 0; + curDirLever = 0; dir_offset[curDirLever].curPage = 0; list_file.Sd_file_offset = 0; - list_file.Sd_file_cnt = 0; + list_file.Sd_file_cnt = 0; memset(dir_offset, 0, sizeof(dir_offset)); memset(list_file.IsFolder,0,sizeof(list_file.IsFolder)); memset(list_file.curDirPath, 0, sizeof(list_file.curDirPath)); list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if ENABLED (SDSUPPORT) + #if ENABLED(SDSUPPORT) card.mount(); - - + + file_count = search_file(); #endif disp_gcode_icon(file_count); - - + + //lv_obj_t * labelPageUp = lv_label_create(buttonPageUp, NULL); //lv_obj_t * labelPageDown = lv_label_create(buttonPageDown, NULL); //lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - + /*if(gCfgItems.multiple_language !=0) { lv_label_set_text(labelPageUp, tool_menu.preheat); @@ -331,7 +353,7 @@ void disp_gcode_icon(uint8_t file_num) scr = lv_obj_create(NULL, NULL); //static lv_style_t tool_style; - + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); @@ -340,7 +362,7 @@ void disp_gcode_icon(uint8_t file_num) lv_obj_set_style(title, &tft_style_lable_rel); lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); lv_label_set_text(title, creat_title_text()); - + lv_refr_now(lv_refr_get_disp_refreshing()); buttonPageUp = lv_imgbtn_create(scr, NULL); @@ -353,7 +375,7 @@ void disp_gcode_icon(uint8_t file_num) lv_imgbtn_set_style(buttonPageUp, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonPageUp, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_obj_clear_protect(buttonPageUp, LV_PROTECT_FOLLOW); - + #if 1 lv_obj_set_event_cb_mks(buttonPageDown, event_handler,ID_P_DOWN,"bmp_pageDown.bin",0); lv_imgbtn_set_src(buttonPageDown, LV_BTN_STATE_REL, &bmp_pic_117x92); @@ -361,10 +383,10 @@ void disp_gcode_icon(uint8_t file_num) lv_imgbtn_set_style(buttonPageDown, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonPageDown, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_P_RETURN,"bmp_Back.bin",0); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_P_RETURN,"bmp_Back.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic_117x92); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic_117x92); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic_117x92); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); @@ -392,16 +414,16 @@ void disp_gcode_icon(uint8_t file_num) j = i; back_flg = 0; } - + */ if(i >= file_num) { break; } - + #ifdef TFT35 buttonGcode[i] = lv_imgbtn_create(scr, NULL); - + lv_imgbtn_set_style(buttonGcode[i], LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonGcode[i], LV_BTN_STATE_REL, &tft_style_lable_rel); lv_obj_clear_protect(buttonGcode[i], LV_PROTECT_FOLLOW); @@ -409,7 +431,7 @@ void disp_gcode_icon(uint8_t file_num) memset(public_buf_m,0,sizeof(public_buf_m)); cutFileName((char *)list_file.long_name[i], 16, 8, (char *)public_buf_m); - + if(list_file.IsFolder[i] == 1) { lv_obj_set_event_cb_mks(buttonGcode[i], event_handler,(i+1),"bmp_Dir.bin",0); @@ -437,7 +459,7 @@ void disp_gcode_icon(uint8_t file_num) lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1)+FILE_PRE_PIC_X_OFFSET, titleHeight+FILE_PRE_PIC_Y_OFFSET); buttonText[i] = lv_btn_create(scr, NULL); //lv_obj_set_event_cb(buttonText[i], event_handler); - + lv_btn_set_style(buttonText[i], LV_BTN_STATE_PR, &tft_style_lable_pre); lv_btn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_lable_rel); //lv_obj_set_style(buttonText[i], &tft_style_lable_pre); @@ -455,10 +477,10 @@ void disp_gcode_icon(uint8_t file_num) lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1)+FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL+INTERVAL_H+titleHeight+FILE_PRE_PIC_Y_OFFSET); buttonText[i] = lv_btn_create(scr, NULL); //lv_obj_set_event_cb(buttonText[i], event_handler); - + lv_btn_set_style(buttonText[i], LV_BTN_STATE_PR, &tft_style_lable_pre); lv_btn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_lable_rel); - + //lv_imgbtn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_lable_rel); lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); @@ -489,17 +511,17 @@ void disp_gcode_icon(uint8_t file_num) lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID,0, -5); } } - - + + #else - - #endif + + #endif } } void lv_open_gcode_file(char *path) { - #if ENABLED (SDSUPPORT) + #if ENABLED(SDSUPPORT) //uint32_t read; uint32_t *ps4; int pre_sread_cnt; @@ -514,7 +536,7 @@ void lv_open_gcode_file(char *path) if(ps4) { pre_sread_cnt = (uint32_t)ps4-(uint32_t)((uint32_t *)(&public_buf[0])); - card.setIndex(pre_sread_cnt+8); + card.setIndex(pre_sread_cnt+8); } #endif } @@ -534,14 +556,14 @@ int ascii2dec_test(char *ascii) result = *(ascii) - 'A' + 0x0a; else return 0; - + return result; } void lv_gcode_file_read(uint8_t *data_buf) { - #if ENABLED (SDSUPPORT) + #if ENABLED(SDSUPPORT) uint16_t i=0,j=0,k=0; //uint32_t read; uint16_t row_1=0; @@ -571,14 +593,14 @@ void lv_gcode_file_read(uint8_t *data_buf) void lv_close_gcode_file() { - #if ENABLED (SDSUPPORT) + #if ENABLED(SDSUPPORT) card.closefile(); #endif } void cutFileName(char *path, int len, int bytePerLine, char *outStr) { - #if _LFN_UNICODE + #if _LFN_UNICODE TCHAR *tmpFile; TCHAR *strIndex1 = 0, *strIndex2 = 0, *beginIndex; TCHAR secSeg[10] = {0}; @@ -588,12 +610,12 @@ void cutFileName(char *path, int len, int bytePerLine, char *outStr) char *strIndex1 = 0, *strIndex2 = 0, *beginIndex; char secSeg[10] = {0}; #endif - + if(path == 0 || len <= 3 || outStr == 0) { return; } - + tmpFile = path; #if _LFN_UNICODE strIndex1 = (WCHAR *)wcsstr((const WCHAR *)tmpFile, (const WCHAR *)'/'); @@ -605,11 +627,11 @@ void cutFileName(char *path, int len, int bytePerLine, char *outStr) if(strIndex1 != 0) { - beginIndex = strIndex1 + 1; + beginIndex = strIndex1 + 1; } /*if((strIndex1 != 0) && (strIndex2 != 0) && (strIndex1 < strIndex2)) { - beginIndex = strIndex1 + 1; + beginIndex = strIndex1 + 1; }*/ else { @@ -622,7 +644,7 @@ void cutFileName(char *path, int len, int bytePerLine, char *outStr) if(wcslen(beginIndex) > len) { wcsncpy(outStr, beginIndex, len); - + } else { @@ -632,7 +654,7 @@ void cutFileName(char *path, int len, int bytePerLine, char *outStr) if((int)strlen(beginIndex) > len) { strncpy(outStr, beginIndex, len); - + } else { @@ -652,7 +674,7 @@ void cutFileName(char *path, int len, int bytePerLine, char *outStr) strncpy(outStr, beginIndex, len - 4); strcat(outStr, "~.g"); #endif - + } else { @@ -664,27 +686,27 @@ void cutFileName(char *path, int len, int bytePerLine, char *outStr) strcat(outStr, "g"); #endif } - + } #if _LFN_UNICODE if(wcslen(outStr) > bytePerLine) { - + wcscpy(secSeg, (const WCHAR *)&outStr[bytePerLine]); outStr[bytePerLine] = '\n'; outStr[bytePerLine + 1] = '\0'; wcscat(outStr, (const WCHAR *)secSeg); - + } #else if((int)strlen(outStr) > bytePerLine) { - + strcpy(secSeg, &outStr[bytePerLine]); outStr[bytePerLine] = '\n'; outStr[bytePerLine + 1] = '\0'; strcat(outStr, secSeg); - + } else { @@ -698,4 +720,4 @@ void lv_clear_print_file() lv_obj_del(scr); } -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h new file mode 100644 index 000000000000..86935e073286 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h @@ -0,0 +1,65 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +typedef struct { + int cur_page_first_offset; + int cur_page_last_offset; + int curPage; +} DIR_OFFSET; +extern DIR_OFFSET dir_offset[10]; + +#define FILE_NUM 6 +#define SHORT_NEME_LEN 13 +#define NAME_CUT_LEN 23 + +#define MAX_DIR_LEVEL 10 + +typedef struct { + //char longName[FILE_NUM][LONG_FILENAME_LENGTH]; + char file_name[FILE_NUM][SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; + char curDirPath[SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; + char long_name[FILE_NUM][SHORT_NEME_LEN*2+1]; + char IsFolder[FILE_NUM]; + char Sd_file_cnt; + char sd_file_index; + char Sd_file_offset; +} LIST_FILE; +extern LIST_FILE list_file; + +extern void disp_gcode_icon(uint8_t file_num); +extern void lv_draw_print_file(void); +extern void lv_open_gcode_file(char *path); +extern void lv_gcode_file_read(uint8_t *data_buf); +extern void lv_close_gcode_file(); +extern void cutFileName(char *path, int len, int bytePerLine, char *outStr); +extern int ascii2dec_test(char *ascii); +extern void lv_clear_print_file(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_printing.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp similarity index 89% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_printing.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp index 82d5b81db64f..7d5fba3abb6f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_printing.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp @@ -1,18 +1,40 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" -#include "../inc/draw_ui.h" -#include "../../../../../module/temperature.h" -#include "../../../../../module/motion.h" -#include "../../../../../sd/cardreader.h" -#include "../../../../../gcode/queue.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +//#include "../MarlinCore.h" +#include "draw_ui.h" +#include "../../../../module/temperature.h" +#include "../../../../module/motion.h" +#include "../../../../sd/cardreader.h" +#include "../../../../gcode/queue.h" #if ENABLED(POWER_LOSS_RECOVERY) -#include "../../../../../feature/powerloss.h" +#include "../../../../feature/powerloss.h" #endif static lv_obj_t * scr; @@ -44,8 +66,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_PAUSE: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { if(gcode_preview_over != 1) @@ -59,9 +81,9 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) card.pauseSDPrint(); stop_print_time(); uiCfg.print_state = PAUSING; - + #endif - + lv_obj_set_event_cb_mks(buttonPause, event_handler,ID_PAUSE,"bmp_Pause.bin",0); lv_label_set_text(labelPause, printing_menu.resume); lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER,30, 0); @@ -69,9 +91,9 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) else if(uiCfg.print_state == PAUSED) { uiCfg.print_state = RESUMING; - + //if (IS_SD_PAUSED())queue.inject_P(PSTR("M24"));// queue.inject_P(M24_STR); - + lv_obj_set_event_cb_mks(obj, event_handler,ID_PAUSE,"bmp_Resume.bin",0); lv_label_set_text(labelPause, printing_menu.pause); lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER,30, 0); @@ -95,7 +117,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) case ID_STOP: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { if(gcode_preview_over != 1) @@ -107,7 +129,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_OPTION: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { if(gcode_preview_over != 1) @@ -139,7 +161,7 @@ void lv_draw_printing(void) scr = lv_obj_create(NULL, NULL); //static lv_style_t tool_style; - + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); @@ -148,13 +170,13 @@ void lv_draw_printing(void) lv_obj_set_style(title, &tft_style_lable_rel); lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); lv_label_set_text(title, creat_title_text()); - + lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic_150x80); LV_IMG_DECLARE(bmp_pic_45x45); - - + + /*Create an Image button*/ buttonExt1 = lv_imgbtn_create(scr, NULL); if(EXTRUDERS == 2) @@ -168,7 +190,7 @@ void lv_draw_printing(void) buttonStop = lv_imgbtn_create(scr, NULL); buttonOperat = lv_imgbtn_create(scr, NULL); buttonTime = lv_imgbtn_create(scr, NULL); - + lv_obj_set_event_cb_mks(buttonExt1, event_handler,0,"bmp_Ext1_state.bin",0); lv_imgbtn_set_src(buttonExt1, LV_BTN_STATE_REL, &bmp_pic_45x45); lv_imgbtn_set_src(buttonExt1, LV_BTN_STATE_PR, &bmp_pic_45x45); @@ -185,27 +207,27 @@ void lv_draw_printing(void) lv_imgbtn_set_style(buttonExt2, LV_BTN_STATE_REL, &tft_style_lable_rel); } #if HAS_HEATED_BED - lv_obj_set_event_cb_mks(buttonBedstate, event_handler,0,"bmp_Bed_state.bin",0); + lv_obj_set_event_cb_mks(buttonBedstate, event_handler,0,"bmp_Bed_state.bin",0); lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_REL, &bmp_pic_45x45); - lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_PR, &bmp_pic_45x45); lv_imgbtn_set_style(buttonBedstate, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBedstate, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif - lv_obj_set_event_cb_mks(buttonFanstate, event_handler,0,"bmp_Fan_state.bin",0); + lv_obj_set_event_cb_mks(buttonFanstate, event_handler,0,"bmp_Fan_state.bin",0); lv_imgbtn_set_src(buttonFanstate, LV_BTN_STATE_REL, &bmp_pic_45x45); - lv_imgbtn_set_src(buttonFanstate, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonFanstate, LV_BTN_STATE_PR, &bmp_pic_45x45); lv_imgbtn_set_style(buttonFanstate, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonFanstate, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonTime, event_handler,0,"bmp_Time_state.bin",0); + lv_obj_set_event_cb_mks(buttonTime, event_handler,0,"bmp_Time_state.bin",0); lv_imgbtn_set_src(buttonTime, LV_BTN_STATE_REL, &bmp_pic_45x45); - lv_imgbtn_set_src(buttonTime, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonTime, LV_BTN_STATE_PR, &bmp_pic_45x45); lv_imgbtn_set_style(buttonTime, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonTime, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonZpos, event_handler,0,"bmp_Zpos_state.bin",0); + + lv_obj_set_event_cb_mks(buttonZpos, event_handler,0,"bmp_Zpos_state.bin",0); lv_imgbtn_set_src(buttonZpos, LV_BTN_STATE_REL, &bmp_pic_45x45); - lv_imgbtn_set_src(buttonZpos, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonZpos, LV_BTN_STATE_PR, &bmp_pic_45x45); lv_imgbtn_set_style(buttonZpos, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonZpos, LV_BTN_STATE_REL, &tft_style_lable_rel); if(uiCfg.print_state == WORKING) @@ -213,24 +235,24 @@ void lv_draw_printing(void) else lv_obj_set_event_cb_mks(buttonPause, event_handler,ID_PAUSE,"bmp_Pause.bin",0); lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_REL, &bmp_pic_150x80); - lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_PR, &bmp_pic_150x80); + lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_PR, &bmp_pic_150x80); lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonStop, event_handler,ID_STOP,"bmp_Stop.bin",0); + lv_obj_set_event_cb_mks(buttonStop, event_handler,ID_STOP,"bmp_Stop.bin",0); lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_REL, &bmp_pic_150x80); - lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_PR, &bmp_pic_150x80); + lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_PR, &bmp_pic_150x80); lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonOperat, event_handler,ID_OPTION,"bmp_Operate.bin",0); + lv_obj_set_event_cb_mks(buttonOperat, event_handler,ID_OPTION,"bmp_Operate.bin",0); lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_REL, &bmp_pic_150x80); - lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_PR, &bmp_pic_150x80); + lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_PR, &bmp_pic_150x80); lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif - + lv_obj_set_pos(buttonExt1,205,136); if(EXTRUDERS == 2) lv_obj_set_pos(buttonExt2,350,136); @@ -256,7 +278,7 @@ void lv_draw_printing(void) lv_btn_set_layout(buttonPause, LV_LAYOUT_OFF); lv_btn_set_layout(buttonStop, LV_LAYOUT_OFF); lv_btn_set_layout(buttonOperat, LV_LAYOUT_OFF); - + labelExt1 = lv_label_create(scr, NULL); lv_obj_set_style(labelExt1, &tft_style_lable_rel); lv_obj_set_pos(labelExt1,250,146); @@ -271,11 +293,11 @@ void lv_draw_printing(void) lv_obj_set_style(labelBed, &tft_style_lable_rel); lv_obj_set_pos(labelBed,250,196); #endif - + labelFan = lv_label_create(scr, NULL); lv_obj_set_style(labelFan, &tft_style_lable_rel); lv_obj_set_pos(labelFan,395,196); - + labelZpos = lv_label_create(scr, NULL); lv_obj_set_style(labelZpos, &tft_style_lable_rel); lv_obj_set_pos(labelZpos,395,96); @@ -283,12 +305,12 @@ void lv_draw_printing(void) labelTime = lv_label_create(scr, NULL); lv_obj_set_style(labelTime, &tft_style_lable_rel); lv_obj_set_pos(labelTime,250,96); - + labelPause = lv_label_create(buttonPause, NULL); labelStop = lv_label_create(buttonStop, NULL); labelOperat = lv_label_create(buttonOperat, NULL); - - + + if(gCfgItems.multiple_language !=0) { if(uiCfg.print_state == WORKING) @@ -307,7 +329,7 @@ void lv_draw_printing(void) lv_label_set_text(labelOperat, printing_menu.option); lv_obj_align(labelOperat, buttonOperat, LV_ALIGN_CENTER,30, 0); } - + lv_style_copy(&lv_bar_style_indic, &lv_style_pretty_color); lv_bar_style_indic.text.color = lv_color_hex3(0xADF); lv_bar_style_indic.image.color = lv_color_hex3(0xADF); @@ -317,7 +339,7 @@ void lv_draw_printing(void) lv_bar_style_indic.body.border.color = lv_color_hex3(0xADF); bar1 = lv_bar_create(scr, NULL); lv_obj_set_pos(bar1, 205, 36); - lv_obj_set_size(bar1, 270, 40); + lv_obj_set_size(bar1, 270, 40); lv_bar_set_style(bar1, LV_BAR_STYLE_INDIC, &lv_bar_style_indic); lv_bar_set_anim_time(bar1, 1000); lv_bar_set_value(bar1, 0, LV_ANIM_ON); @@ -327,7 +349,7 @@ void lv_draw_printing(void) disp_fan_speed(); disp_print_time(); disp_fan_Zpos(); - + } void disp_ext_temp() @@ -398,23 +420,23 @@ void setProBarRate() { int rate; volatile long long rate_tmp_r; - + if(gCfgItems.from_flash_pic != 1) { - #if ENABLED (SDSUPPORT) + #if ENABLED(SDSUPPORT) rate_tmp_r =(long long)card.getIndex() * 100; #endif rate = rate_tmp_r / gCfgItems.curFilesize; } else { - #if ENABLED (SDSUPPORT) + #if ENABLED(SDSUPPORT) rate_tmp_r =(long long)card.getIndex(); #endif rate = (rate_tmp_r-(PREVIEW_SIZE+To_pre_view))* 100 / (gCfgItems.curFilesize-(PREVIEW_SIZE+To_pre_view)); } //gCurFileState.totalSend = rate; - + if(rate <= 0) return; @@ -425,24 +447,24 @@ void setProBarRate() if(marlin_state == MF_SD_COMPLETE) { if(once_flag == 0) - { - stop_print_time(); - + { + stop_print_time(); + flash_preview_begin = 0; default_preview_flg = 0; lv_clear_printing(); lv_draw_dialog(DIALOG_TYPE_FINISH_PRINT); - + once_flag = 1; - + #if HAS_SUICIDE if(gCfgItems.finish_power_off == 1) suicide(); #endif - } + } } - - } + + } } void lv_clear_printing() @@ -450,4 +472,4 @@ void lv_clear_printing() lv_obj_del(scr); } -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h new file mode 100644 index 000000000000..234fc72f4f24 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h @@ -0,0 +1,52 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +#define IDLE 0 +#define WORKING 1 +#define PAUSING 2 +#define PAUSED 3 +#define REPRINTING 4 +#define REPRINTED 5 +#define RESUMING 6 +#define STOP 7 + +extern void lv_draw_printing(void); +extern void lv_clear_printing(); +extern void disp_ext_temp(); +extern void disp_bed_temp(); +extern void disp_fan_speed(); +extern void disp_print_time(); +extern void disp_fan_Zpos(); +extern void reset_print_time(); +extern void start_print_time(); +extern void stop_print_time(); +extern void setProBarRate(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_ready_print.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp similarity index 85% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_ready_print.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp index 0428c98f1ec8..9ac408de0d24 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_ready_print.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp @@ -1,18 +1,40 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../inc/draw_ready_print.h" -#include "../inc/draw_tool.h" +#include "draw_ready_print.h" +#include "draw_tool.h" #include "lv_conf.h" #include "lvgl.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -#include "../../../../../module/temperature.h" -#include "../inc/tft_lvgl_configuration.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +#include "../../../../module/temperature.h" +#include "tft_lvgl_configuration.h" #include "stdio.h" -#include "../inc/mks_hardware_test.h" -#include "../inc/draw_ui.h" +#include "mks_hardware_test.h" +#include "draw_ui.h" //static lv_obj_t *buttonPrint,*buttonTool,*buttonSet; @@ -31,7 +53,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_TOOL: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { #if ENABLED(MKS_TEST) @@ -43,7 +65,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_SET: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { lv_obj_del(scr); @@ -52,7 +74,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_PRINT: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { lv_obj_del(scr); @@ -123,15 +145,15 @@ void lv_draw_ready_print(void) #if ENABLED(MKS_TEST) char buf[30]={0}; lv_obj_t *buttonTool; - + static lv_style_t style_pr,style_rel; curent_disp_ui = 1; - + scr = lv_obj_create(NULL, NULL); - + static lv_style_t ready_style; - + lv_style_copy(&ready_style, &lv_style_scr); //ready_style.body.main_color.full = 0X18C3; //ready_style.body.grad_color.full = 0X18C3; @@ -143,40 +165,40 @@ void lv_draw_ready_print(void) lv_obj_clean(scr); //lv_obj_set_hidden(scr,true); lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic); //LV_IMG_DECLARE(bmp_pic2); //LV_IMG_DECLARE(bmp_pic3); - + //scr = lv_obj_create(NULL, NULL); //lv_scr_load(scr); - + /*Create an Image button*/ buttonTool = lv_imgbtn_create(scr, NULL); - + //lv_btn_setting(&style_pr,0x5d8f16,0x5d8f16); //lv_btn_setting(&style_rel,0x5d8f16,0x5d8f16); - - lv_obj_set_event_cb_mks(buttonTool, event_handler,3,"bmp_Tool.bin",0); + + lv_obj_set_event_cb_mks(buttonTool, event_handler,3,"bmp_Tool.bin",0); //lv_imgbtn_set_src_mks(buttonTool, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_tool.bin"); lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_PR, &style_pr); lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_REL, &style_rel); - - + + lv_obj_set_pos(buttonTool,360,180); - - + + lv_btn_set_layout(buttonTool, LV_LAYOUT_OFF); - - + + lv_obj_t * label_tool = lv_label_create(buttonTool, NULL); - + lv_obj_set_pos(label_tool,30,100); lv_label_set_text(label_tool, "Back"); - + e1 = lv_label_create(scr, NULL); lv_obj_set_pos(e1,20,20); sprintf(buf,"e1: %d",(int)thermalManager.temp_hotend[0].celsius); @@ -204,7 +226,7 @@ void lv_draw_ready_print(void) limit_style.body.grad_color.full = 0X0000; limit_style.text.color.full = 0Xffff; lv_obj_set_style(limit_info, &limit_style); - + lv_obj_set_pos(limit_info,20,120); lv_label_set_text(limit_info, " "); @@ -215,17 +237,17 @@ void lv_draw_ready_print(void) det_style.body.grad_color.full = 0X0000; det_style.text.color.full = 0Xffff; lv_obj_set_style(det_info, &det_style); - + lv_obj_set_pos(det_info,20,145); lv_label_set_text(det_info, " "); #else lv_obj_t *buttonPrint,*buttonTool,*buttonSet; - + disp_state_stack._disp_index = 0; memset(disp_state_stack._disp_state, 0, sizeof(disp_state_stack._disp_state)); disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINT_READY_UI; - + disp_state = PRINT_READY_UI; scr = lv_obj_create(NULL, NULL); @@ -235,14 +257,14 @@ void lv_draw_ready_print(void) lv_obj_clean(scr); //lv_obj_set_hidden(scr,true); lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic); //lv_obj_t * title = lv_label_create(scr, NULL); //lv_obj_set_style(title, &tft_style_lable_rel); //lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); //lv_label_set_text(title, creat_title_text()); - + /*Create an Image button*/ buttonPrint = lv_imgbtn_create(scr, NULL); buttonTool = lv_imgbtn_create(scr, NULL); @@ -262,11 +284,11 @@ void lv_draw_ready_print(void) lv_imgbtn_set_src(buttonSet, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonSet, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonSet, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonTool, event_handler,ID_TOOL,"bmp_Tool.bin",0); + + lv_obj_set_event_cb_mks(buttonTool, event_handler,ID_TOOL,"bmp_Tool.bin",0); //lv_imgbtn_set_src_mks(buttonTool, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_tool.bin"); lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_REL, &tft_style_lable_rel); @@ -274,7 +296,7 @@ void lv_draw_ready_print(void) lv_obj_set_pos(buttonTool,20,90); lv_obj_set_pos(buttonSet,180,90); lv_obj_set_pos(buttonPrint,340,90); - + //lv_obj_set_pos(buttonTool,SIMPLE_FIRST_PAGE_GRAP+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); //lv_obj_set_pos(buttonSet,BTN_X_PIXEL+SIMPLE_FIRST_PAGE_GRAP*2+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); //lv_obj_set_pos(buttonPrint,BTN_X_PIXEL*2+SIMPLE_FIRST_PAGE_GRAP*3+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); @@ -283,16 +305,16 @@ void lv_draw_ready_print(void) lv_btn_set_layout(buttonPrint, LV_LAYOUT_OFF); lv_btn_set_layout(buttonSet, LV_LAYOUT_OFF); lv_btn_set_layout(buttonTool, LV_LAYOUT_OFF); - + lv_obj_t * label_print = lv_label_create(buttonPrint, NULL); lv_obj_t * label_set = lv_label_create(buttonSet, NULL); lv_obj_t * label_tool = lv_label_create(buttonTool, NULL); if(gCfgItems.multiple_language !=0) { - + lv_label_set_text(label_print, main_menu.print); lv_obj_align(label_print, buttonPrint, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - + lv_label_set_text(label_set, main_menu.set); lv_obj_align(label_set, buttonSet, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); @@ -301,7 +323,7 @@ void lv_draw_ready_print(void) lv_label_set_text(label_tool, main_menu.tool); lv_obj_align(label_tool, buttonTool, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); } - + #endif } @@ -311,4 +333,4 @@ void lv_clear_ready_print() lv_obj_del(scr); } -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h new file mode 100644 index 000000000000..d67f45a13e24 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h @@ -0,0 +1,39 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_ready_print(void); +extern void disp_test(); +extern void disp_Limit_ok(); +extern void disp_Limit_error(); +extern void disp_det_error(); +extern void disp_det_ok(); +extern void lv_clear_ready_print(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_set.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp similarity index 84% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_set.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp index 1879ba5b41b8..a02e972d4ab1 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_set.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp @@ -1,14 +1,36 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../inc/draw_ready_print.h" -#include "../inc/draw_set.h" +#include "draw_ready_print.h" +#include "draw_set.h" #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -#include "../inc/draw_ui.h" -#include "../../../../../gcode/queue.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +#include "draw_ui.h" +#include "../../../../gcode/queue.h" static lv_obj_t * scr; @@ -26,16 +48,16 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_S_WIFI: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { - + } break; case ID_S_FAN: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { lv_obj_del(scr); @@ -44,7 +66,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_S_ABOUT: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { lv_obj_del(scr); @@ -52,11 +74,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_S_CONTINUE: - + break; case ID_S_MOTOR_OFF: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { #if HAS_SUICIDE @@ -68,7 +90,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_S_LANGUAGE: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { lv_obj_del(scr); @@ -77,7 +99,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_S_RETURN: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { lv_obj_del(scr); @@ -104,7 +126,7 @@ void lv_draw_set(void) scr = lv_obj_create(NULL, NULL); //static lv_style_t tool_style; - + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); @@ -113,11 +135,11 @@ void lv_draw_set(void) lv_obj_set_style(title, &tft_style_lable_rel); lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); lv_label_set_text(title, creat_title_text()); - + lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic); - + /*Create an Image button*/ //buttonWifi = lv_imgbtn_create(scr, NULL); buttonFan = lv_imgbtn_create(scr, NULL); @@ -127,7 +149,7 @@ void lv_draw_set(void) buttonLanguage = lv_imgbtn_create(scr, NULL); buttonBack = lv_imgbtn_create(scr, NULL); - + //lv_obj_set_event_cb_mks(buttonWifi, event_handler,ID_S_WIFI,"bmp_Wifi.bin",0); //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_REL, &bmp_pic); //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_PR, &bmp_pic); @@ -141,15 +163,15 @@ void lv_draw_set(void) lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonAbout, event_handler,ID_S_ABOUT,"bmp_About.bin",0); + lv_obj_set_event_cb_mks(buttonAbout, event_handler,ID_S_ABOUT,"bmp_About.bin",0); lv_imgbtn_set_src(buttonAbout, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonAbout, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonAbout, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonAbout, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonAbout, LV_BTN_STATE_REL, &tft_style_lable_rel); - //lv_obj_set_event_cb_mks(buttonContinue, event_handler,ID_S_CONTINUE,"bmp_Breakpoint.bin",0); + //lv_obj_set_event_cb_mks(buttonContinue, event_handler,ID_S_CONTINUE,"bmp_Breakpoint.bin",0); //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_REL, &bmp_pic); - //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_PR, &bmp_pic); //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_PR, &tft_style_lable_pre); //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_REL, &tft_style_lable_rel); #if HAS_SUICIDE @@ -158,24 +180,24 @@ void lv_draw_set(void) lv_obj_set_event_cb_mks(buMotorOff, event_handler,ID_S_MOTOR_OFF,"bmp_Motor_off.bin",0); #endif lv_imgbtn_set_src(buMotorOff, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buMotorOff, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buMotorOff, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buMotorOff, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buMotorOff, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonLanguage, event_handler,ID_S_LANGUAGE,"bmp_Language.bin",0); + lv_obj_set_event_cb_mks(buttonLanguage, event_handler,ID_S_LANGUAGE,"bmp_Language.bin",0); lv_imgbtn_set_src(buttonLanguage, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonLanguage, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonLanguage, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonLanguage, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonLanguage, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_S_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_S_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif - + /*lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); lv_obj_set_pos(buttonFan,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); lv_obj_set_pos(buttonAbout,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); @@ -200,7 +222,7 @@ void lv_draw_set(void) lv_btn_set_layout(buMotorOff, LV_LAYOUT_OFF); lv_btn_set_layout(buttonLanguage, LV_LAYOUT_OFF); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - + //lv_obj_t * labelWifi= lv_label_create(buttonWifi, NULL); lv_obj_t * labelFan = lv_label_create(buttonFan, NULL); lv_obj_t * label_About = lv_label_create(buttonAbout, NULL); @@ -208,8 +230,8 @@ void lv_draw_set(void) lv_obj_t * label_MotorOff = lv_label_create(buMotorOff, NULL); lv_obj_t * label_Language = lv_label_create(buttonLanguage, NULL); lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - + + if(gCfgItems.multiple_language !=0) { //lv_label_set_text(labelWifi, set_menu.wifi); @@ -229,10 +251,10 @@ void lv_draw_set(void) lv_label_set_text(label_MotorOff, set_menu.motoroff); #endif lv_obj_align(label_MotorOff, buMotorOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - + lv_label_set_text(label_Language, set_menu.language); lv_obj_align(label_Language, buttonLanguage, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - + lv_label_set_text(label_Back, common_menu.text_back); lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h new file mode 100644 index 000000000000..7a640142fd78 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_set(void); +extern void lv_clear_set(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_tool.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp similarity index 84% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_tool.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp index 51ca7479ba71..38a1487564bd 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_tool.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp @@ -1,12 +1,34 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) #include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -#include "../inc/draw_ui.h" -#include "../../../../../gcode/queue.h" +//#include "../lvgl/src/lv_objx/lv_imgbtn.h" +//#include "../lvgl/src/lv_objx/lv_img.h" +//#include "../lvgl/src/lv_core/lv_disp.h" +//#include "../lvgl/src/lv_core/lv_refr.h" +#include "draw_ui.h" +#include "../../../../gcode/queue.h" //static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn; static lv_obj_t * scr; @@ -29,8 +51,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_T_PRE_HEAT: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { lv_clear_tool(); @@ -39,8 +61,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_T_EXTRUCT: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { lv_clear_tool(); @@ -49,19 +71,19 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_T_MOV: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { lv_clear_tool(); lv_draw_move_motor(); } - + break; case ID_T_HOME: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { lv_clear_tool(); @@ -70,8 +92,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_T_LEVELING: if(event == LV_EVENT_CLICKED) { - - + + } else if(event == LV_EVENT_RELEASED) { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) @@ -83,17 +105,17 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) lv_draw_manualLevel(); #endif } - + break; case ID_T_FILAMENT: - + break; case ID_T_MORE: - + break; case ID_T_RETURN: if(event == LV_EVENT_CLICKED) { - + } else if(event == LV_EVENT_RELEASED) { #if ENABLED(MKS_TEST) @@ -123,7 +145,7 @@ void lv_draw_tool(void) scr = lv_obj_create(NULL, NULL); //static lv_style_t tool_style; - + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); @@ -132,11 +154,11 @@ void lv_draw_tool(void) lv_obj_set_style(title, &tft_style_lable_rel); lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); lv_label_set_text(title, creat_title_text()); - + lv_refr_now(lv_refr_get_disp_refreshing()); - + LV_IMG_DECLARE(bmp_pic); - + /*Create an Image button*/ buttonPreHeat = lv_imgbtn_create(scr, NULL); buttonExtrusion = lv_imgbtn_create(scr, NULL); @@ -147,7 +169,7 @@ void lv_draw_tool(void) //buttonMore = lv_imgbtn_create(scr, NULL); buttonBack = lv_imgbtn_create(scr, NULL); - + lv_obj_set_event_cb_mks(buttonPreHeat, event_handler,ID_T_PRE_HEAT,"bmp_PreHeat.bin",0); lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_PR, &bmp_pic); @@ -161,44 +183,44 @@ void lv_draw_tool(void) lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonMove, event_handler,ID_T_MOV,"bmp_Mov.bin",0); + lv_obj_set_event_cb_mks(buttonMove, event_handler,ID_T_MOV,"bmp_Mov.bin",0); lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonHome, event_handler,ID_T_HOME,"bmp_Zero.bin",0); + lv_obj_set_event_cb_mks(buttonHome, event_handler,ID_T_HOME,"bmp_Zero.bin",0); lv_imgbtn_set_src(buttonHome, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonHome, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonHome, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonHome, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonHome, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonLevel, event_handler,ID_T_LEVELING,"bmp_Leveling.bin",0); + lv_obj_set_event_cb_mks(buttonLevel, event_handler,ID_T_LEVELING,"bmp_Leveling.bin",0); lv_imgbtn_set_src(buttonLevel, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonLevel, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonLevel, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_REL, &tft_style_lable_rel); - //lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_T_FILAMENT,"bmp_Filamentchange.bin",0); + //lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_T_FILAMENT,"bmp_Filamentchange.bin",0); //lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_REL, &bmp_pic); - //lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, &bmp_pic); //lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_PR, &tft_style_lable_pre); //lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_REL, &tft_style_lable_rel); - //lv_obj_set_event_cb_mks(buttonMore, event_handler,ID_T_MORE,"bmp_More.bin",0); + //lv_obj_set_event_cb_mks(buttonMore, event_handler,ID_T_MORE,"bmp_More.bin",0); //lv_imgbtn_set_src(buttonMore, LV_BTN_STATE_REL, &bmp_pic); - //lv_imgbtn_set_src(buttonMore, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_src(buttonMore, LV_BTN_STATE_PR, &bmp_pic); //lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_PR, &tft_style_lable_pre); //lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_T_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_T_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif - + lv_obj_set_pos(buttonPreHeat,INTERVAL_V,titleHeight); lv_obj_set_pos(buttonExtrusion,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); lv_obj_set_pos(buttonMove,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); @@ -217,7 +239,7 @@ void lv_draw_tool(void) //lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF); //lv_btn_set_layout(buttonMore, LV_LAYOUT_OFF); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - + lv_obj_t * labelPreHeat = lv_label_create(buttonPreHeat, NULL); lv_obj_t * labelExtrusion = lv_label_create(buttonExtrusion, NULL); lv_obj_t * label_Move = lv_label_create(buttonMove, NULL); @@ -226,8 +248,8 @@ void lv_draw_tool(void) //lv_obj_t * label_Filament = lv_label_create(buttonFilament, NULL); //lv_obj_t * label_More = lv_label_create(buttonMore, NULL); lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - + + if(gCfgItems.multiple_language !=0) { lv_label_set_text(labelPreHeat, tool_menu.preheat); @@ -248,7 +270,7 @@ void lv_draw_tool(void) lv_label_set_text(label_Level, tool_menu.autoleveling); else lv_label_set_text(label_Level, tool_menu.leveling); - + lv_obj_align(label_Level, buttonLevel, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); }*/ #if ENABLED(AUTO_BED_LEVELING_BILINEAR) @@ -257,7 +279,7 @@ void lv_draw_tool(void) lv_label_set_text(label_Level, tool_menu.leveling); #endif lv_obj_align(label_Level, buttonLevel, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - + //lv_label_set_text(label_Filament, tool_menu.filament); //lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); @@ -273,4 +295,4 @@ void lv_clear_tool() { lv_obj_del(scr); } -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h new file mode 100644 index 000000000000..e96eea5fb0c2 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_tool(void); +extern void lv_clear_tool(); + +//extern void disp_temp_ready_print(); +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp similarity index 90% rename from Marlin/src/lcd/extui/lib/mks_ui/src/draw_ui.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index cb90894557dc..591aba7e4ebb 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -1,22 +1,44 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../inc/draw_ui.h" -#include "../../../../../sd/cardreader.h" -#include "../inc/W25Qxx.h" -#include "../inc/tft_lvgl_configuration.h" -#include "../inc/pic_manager.h" -#include "../../../../../module/motion.h" -#include "../../../../../module/planner.h" +#include "draw_ui.h" +#include "../../../../sd/cardreader.h" +#include "W25Qxx.h" +#include "tft_lvgl_configuration.h" +#include "pic_manager.h" +#include "../../../../module/motion.h" +#include "../../../../module/planner.h" #if ENABLED(POWER_LOSS_RECOVERY) -#include "../../../../../feature/powerloss.h" +#include "../../../../feature/powerloss.h" #endif #if ENABLED(PARK_HEAD_ON_PAUSE) -#include "../../../../../feature/pause.h" +#include "../../../../feature/pause.h" #endif #include #if ENABLED(SPI_GRAPHICAL_TFT) -#include "../inc/SPI_TFT.h" +#include "SPI_TFT.h" #endif CFG_ITMES gCfgItems; @@ -51,7 +73,7 @@ void gCfgItems_init() gCfgItems.curFilesize = 0; gCfgItems.finish_power_off = 0; gCfgItems.pause_reprint = 0; - + W25QXX.SPI_FLASH_BufferRead((uint8_t *)&gCfgItems.spi_flash_flag,VAR_INF_ADDR,sizeof(gCfgItems.spi_flash_flag)); if(gCfgItems.spi_flash_flag == GCFG_FLAG_VALUE) { @@ -63,7 +85,7 @@ void gCfgItems_init() W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); } - + } void gCfg_to_spiFlah() @@ -87,7 +109,7 @@ void ui_cfg_init() void update_spi_flash() { - W25QXX.init(SPI_QUARTER_SPEED); + W25QXX.init(SPI_QUARTER_SPEED); W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); } @@ -114,7 +136,7 @@ void tft_style_init() tft_style_lable_pre.text.color = LV_COLOR_TEXT; tft_style_lable_pre.text.sel_color = LV_COLOR_TEXT; tft_style_lable_rel.body.main_color = LV_COLOR_BACKGROUND; - tft_style_lable_rel.body.grad_color = LV_COLOR_BACKGROUND; + tft_style_lable_rel.body.grad_color = LV_COLOR_BACKGROUND; tft_style_lable_rel.text.color = LV_COLOR_TEXT; tft_style_lable_rel.text.sel_color = LV_COLOR_TEXT; tft_style_lable_pre.text.font = &gb2312_puhui32; @@ -150,9 +172,9 @@ void titleText_cat(char *str, int strSize, char *addPart) char *getDispText(int index) { - + memset(public_buf_l, 0, sizeof(public_buf_l)); - + switch(disp_state_stack._disp_state[index]) { case PRINT_READY_UI: @@ -227,12 +249,12 @@ char *getDispText(int index) strcpy(public_buf_l, speed_menu.title); break; - + case FAN_UI: strcpy(public_buf_l, fan_menu.title); break; - + case PRE_HEAT_UI: if((disp_state_stack._disp_state[disp_state_stack._disp_index - 1] == OPERATE_UI)) { @@ -243,7 +265,7 @@ char *getDispText(int index) { strcpy(public_buf_l, preheat_menu.title); - } + } break; case SET_UI: @@ -284,35 +306,35 @@ char *getDispText(int index) case DIALOG_UI: strcpy(public_buf_l, common_menu.dialog_confirm_title); - break; + break; case WIFI_UI: strcpy(public_buf_l, wifi_menu.title); - break; + break; case MORE_UI: case PRINT_MORE_UI: strcpy(public_buf_l, more_menu.title); - break; + break; case FILAMENTCHANGE_UI: - strcpy(public_buf_l, filament_menu.title); - break; + strcpy(public_buf_l, filament_menu.title); + break; case LEVELING_UI: case MESHLEVELING_UI: - strcpy(public_buf_l, leveling_menu.title); - break; + strcpy(public_buf_l, leveling_menu.title); + break; case BIND_UI: - strcpy(public_buf_l, cloud_menu.title); + strcpy(public_buf_l, cloud_menu.title); break; case ZOFFSET_UI: - strcpy(public_buf_l, zoffset_menu.title); - break; + strcpy(public_buf_l, zoffset_menu.title); + break; case TOOL_UI: - strcpy(public_buf_l, tool_menu.title); + strcpy(public_buf_l, tool_menu.title); break; case WIFI_LIST_UI: - //strcpy(public_buf_l, list_menu.title); + //strcpy(public_buf_l, list_menu.title); break; case MACHINE_PARA_UI: strcpy(public_buf_l, MachinePara_menu.title); @@ -330,53 +352,53 @@ char *getDispText(int index) char *creat_title_text() { int index = 0; - + char *tmpText = 0; - + char tmpCurFileStr[20]; - + memset(tmpCurFileStr, 0, sizeof(tmpCurFileStr)); #if _LFN_UNICODE - //cutFileName((TCHAR *)curFileName, 16, 16, (TCHAR *)tmpCurFileStr); + //cutFileName((TCHAR *)curFileName, 16, 16, (TCHAR *)tmpCurFileStr); #else cutFileName(list_file.long_name[sel_id], 16, 16, tmpCurFileStr); #endif - + memset(public_buf_m, 0, sizeof(public_buf_m)); - + while(index <= disp_state_stack._disp_index) { - + tmpText = getDispText(index); if((*tmpText == 0) || (tmpText == 0)) { index++; continue; } - + titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); if(index < disp_state_stack._disp_index) { titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)">"); } - + index++; } - + if(disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI /*|| disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI*/) { titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)":"); - titleText_cat(public_buf_m, sizeof(public_buf_m), tmpCurFileStr); + titleText_cat(public_buf_m, sizeof(public_buf_m), tmpCurFileStr); } if(strlen(public_buf_m) > MAX_TITLE_LEN) { memset(public_buf_m, 0, sizeof(public_buf_m)); - + tmpText = getDispText(0); if(*tmpText != 0) { @@ -388,7 +410,7 @@ char *creat_title_text() titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); } } - + } return public_buf_m; @@ -397,14 +419,14 @@ char *creat_title_text() void preview_gcode_prehandle(char *path) { - #if ENABLED (SDSUPPORT) + #if ENABLED(SDSUPPORT) //uint8_t re; //uint32_t read; uint32_t pre_read_cnt = 0; uint32_t *p1; char *cur_name; - - cur_name=strrchr(path,'/'); + + cur_name=strrchr(path,'/'); card.openFileRead(cur_name); card.read(public_buf, 512); p1 = (uint32_t *)strstr((char *)public_buf,";simage:"); @@ -416,14 +438,14 @@ void preview_gcode_prehandle(char *path) To_pre_view = pre_read_cnt; gcode_preview_over = 1; gCfgItems.from_flash_pic = 1; - update_spi_flash(); + update_spi_flash(); } else { gcode_preview_over = 0; default_preview_flg = 1; - gCfgItems.from_flash_pic = 0; - update_spi_flash(); + gCfgItems.from_flash_pic = 0; + update_spi_flash(); } card.closefile(); #endif @@ -431,7 +453,7 @@ void preview_gcode_prehandle(char *path) void gcode_preview(char *path,int xpos_pixel,int ypos_pixel) { - #if ENABLED (SDSUPPORT) + #if ENABLED(SDSUPPORT) //uint8_t ress; //uint32_t write; volatile uint32_t i,j; @@ -439,50 +461,50 @@ void gcode_preview(char *path,int xpos_pixel,int ypos_pixel) //int res; char *cur_name; uint16_t Color; - - cur_name=strrchr(path,'/'); + + cur_name=strrchr(path,'/'); card.openFileRead(cur_name); card.setIndex((PREVIEW_LITTLE_PIC_SIZE+To_pre_view)+size*row+8); #if ENABLED(SPI_GRAPHICAL_TFT) - + SPI_TFT.spi_init(SPI_FULL_SPEED); //SPI_TFT.SetCursor(0,0); SPI_TFT.SetWindows(xpos_pixel, ypos_pixel+row, 200,1); SPI_TFT.LCD_WriteRAM_Prepare(); - + #else ili9320_SetWindows(xpos_pixel, ypos_pixel+row, 200,1); - LCD_WriteRAM_Prepare(); + LCD_WriteRAM_Prepare(); #endif - + j=0; i=0; - + while(1) { card.read(public_buf, 400); for(i=0;i<400;) { bmp_public_buf[j]= ascii2dec_test((char*)&public_buf[i])<<4|ascii2dec_test((char*)&public_buf[i+1]); - + i+=2; j++; } - + //if(i>800)break; //#if defined(TFT70) //if(j>400) //{ // f_read(file, buff_pic, 1, &read); // break; - //} + //} //#elif defined(TFT35) if(j>=400) { //f_read(file, buff_pic, 1, &read); break; - } + } //#endif } @@ -499,11 +521,11 @@ void gcode_preview(char *path,int xpos_pixel,int ypos_pixel) SPI_TFT_DC_H; SPI.dmaSend(bmp_public_buf,400,true); SPI_TFT_CS_H; - + #else for(i=0;i<400;) { - p_index = (uint16_t *)(&bmp_public_buf[i]); + p_index = (uint16_t *)(&bmp_public_buf[i]); //if(*p_index == 0x0000)*p_index=gCfgItems.preview_bk_color; LCD_IO_WriteData(*p_index); i=i+2; @@ -520,7 +542,7 @@ void gcode_preview(char *path,int xpos_pixel,int ypos_pixel) { size = 809; row = 0; - + gcode_preview_over = 0; //flash_preview_begin = 1; @@ -528,10 +550,10 @@ void gcode_preview(char *path,int xpos_pixel,int ypos_pixel) /*if(gCurFileState.file_open_flag != 0xaa) { - - + + reset_file_info(); - + res = f_open(file, curFileName, FA_OPEN_EXISTING | FA_READ); if(res == FR_OK) @@ -547,11 +569,11 @@ void gcode_preview(char *path,int xpos_pixel,int ypos_pixel) once_flag = 0; } - - } */ + + } */ char *cur_name; - - cur_name=strrchr(list_file.file_name[sel_id],'/'); + + cur_name=strrchr(list_file.file_name[sel_id],'/'); SdFile file; SdFile *curDir; @@ -564,7 +586,7 @@ void gcode_preview(char *path,int xpos_pixel,int ypos_pixel) file.close(); update_spi_flash(); } - + card.openFileRead(cur_name); if (card.isFileOpen()) { @@ -575,8 +597,8 @@ void gcode_preview(char *path,int xpos_pixel,int ypos_pixel) if(EXTRUDERS==2) { planner.flow_percentage[1] = 100; - planner.e_factor[1]= planner.flow_percentage[1]*0.01; - } + planner.e_factor[1]= planner.flow_percentage[1]*0.01; + } card.startFileprint(); #if ENABLED(POWER_LOSS_RECOVERY) recovery.prepare(); @@ -591,13 +613,13 @@ void gcode_preview(char *path,int xpos_pixel,int ypos_pixel) void Draw_default_preview(int xpos_pixel,int ypos_pixel,uint8_t sel) { - int index; + int index; int x_off = 0, y_off = 0; int _y; uint16_t *p_index; int i,j; uint16_t temp_p,Color; - + for(index = 0; index < 10; index ++)//200*200 { if(sel == 1) @@ -613,7 +635,7 @@ void Draw_default_preview(int xpos_pixel,int ypos_pixel,uint8_t sel) i = 0; #if ENABLED(SPI_GRAPHICAL_TFT) - + //SPI_TFT.spi_init(SPI_FULL_SPEED); //SPI_TFT.SetWindows(xpos_pixel, y_off * 20+ypos_pixel, 200,20); //200*200 //SPI_TFT.LCD_WriteRAM_Prepare(); @@ -635,15 +657,15 @@ void Draw_default_preview(int xpos_pixel,int ypos_pixel,uint8_t sel) if(i >= 8000) break; } - + #else ili9320_SetWindows(xpos_pixel, y_off * 20+ypos_pixel, 200,20); //200*200 - LCD_WriteRAM_Prepare(); - + LCD_WriteRAM_Prepare(); + for(_y = y_off * 20; _y < (y_off + 1) * 20; _y++) { - for (x_off = 0; x_off < 200; x_off++) + for (x_off = 0; x_off < 200; x_off++) { if(sel==1) { @@ -652,20 +674,20 @@ void Draw_default_preview(int xpos_pixel,int ypos_pixel,uint8_t sel) } else { - p_index = (uint16_t *)(&bmp_public_buf[i]); + p_index = (uint16_t *)(&bmp_public_buf[i]); } - + LCD_IO_WriteData(*p_index); - - + + i += 2; - + } if(i >= 8000) break; } #endif - y_off++; + y_off++; } W25QXX.init(SPI_QUARTER_SPEED); } @@ -680,7 +702,7 @@ void disp_pre_gcode(int xpos_pixel,int ypos_pixel) if(flash_preview_begin == 1) { flash_preview_begin = 0; - Draw_default_preview(xpos_pixel,ypos_pixel,1); + Draw_default_preview(xpos_pixel,ypos_pixel,1); } if(default_preview_flg == 1) { @@ -693,7 +715,7 @@ void disp_pre_gcode(int xpos_pixel,int ypos_pixel) void print_time_run() { static uint8_t lastSec = 0; - + if(print_time.seconds >= 60) { print_time.seconds = 0; @@ -703,7 +725,7 @@ void print_time_run() print_time.minutes = 0; print_time.hours++; } - + } if(disp_state == PRINTING_UI) { @@ -718,18 +740,18 @@ void print_time_run() void GUI_RefreshPage() { - if((systick_uptime_millis % 1000) == 0) + if((systick_uptime_millis % 1000) == 0) temperature_change_frequency=1; if((systick_uptime_millis % 3000) == 0) printing_rate_update_flag = 1; switch(disp_state) { - case MAIN_UI: - + case MAIN_UI: + lv_draw_ready_print(); - + break; - case EXTRUSION_UI: + case EXTRUSION_UI: if(temperature_change_frequency == 1) { temperature_change_frequency = 0; @@ -745,7 +767,7 @@ void GUI_RefreshPage() break; case PRINT_READY_UI: - + /*if(gCfgItems.display_style == 2) { if(temperature_change_frequency){ @@ -753,14 +775,14 @@ void GUI_RefreshPage() disp_restro_state(); } }*/ - + break; case PRINT_FILE_UI: break; case PRINTING_UI: - + if(temperature_change_frequency) { temperature_change_frequency = 0; @@ -787,7 +809,7 @@ void GUI_RefreshPage() temperature_change_frequency = 0; disp_temp_operate(); } - + setProBarRateOpera();*/ break; @@ -798,9 +820,9 @@ void GUI_RefreshPage() temperature_change_frequency = 0; disp_temp_pause(); }*/ - + break; - + case FAN_UI: if(temperature_change_frequency == 1) { @@ -808,16 +830,16 @@ void GUI_RefreshPage() disp_fan_value(); } break; - + case MOVE_MOTOR_UI: /* if(mksReprint.mks_printer_state == MKS_IDLE) { - if((z_high_count==1)&&(temper_error_flg != 1)) + if((z_high_count==1)&&(temper_error_flg != 1)) { z_high_count = 0; { - + memset((char *)gCfgItems.move_z_coordinate,' ',sizeof(gCfgItems.move_z_coordinate)); GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate,380, TITLE_YPOS); sprintf((char *)gCfgItems.move_z_coordinate,"Z: %.3f",current_position[Z_AXIS]); @@ -829,7 +851,7 @@ void GUI_RefreshPage() case WIFI_UI: /*if(wifi_refresh_flg == 1) - { + { disp_wifi_state(); wifi_refresh_flg = 0; }*/ @@ -848,13 +870,13 @@ void GUI_RefreshPage() case DIALOG_UI: /*filament_dialog_handle(); wifi_scan_handle();*/ - break; + break; case MESHLEVELING_UI: /*disp_zpos();*/ break; case HARDWARE_TEST_UI: - - break; + + break; case WIFI_LIST_UI: /*if(wifi_refresh_flg == 1) { @@ -874,7 +896,7 @@ void GUI_RefreshPage() { tips_disp.timer = TIPS_TIMER_STOP; tips_disp.timer_count = 0; - + Clear_Tips(); tips_type = TIPS_TYPE_WIFI_CONECTED; draw_Tips(); @@ -884,7 +906,7 @@ void GUI_RefreshPage() { tips_disp.timer = TIPS_TIMER_STOP; tips_disp.timer_count = 0; - + Clear_Tips(); tips_type = TIPS_TYPE_TAILED_JOIN; draw_Tips(); @@ -925,21 +947,21 @@ void GUI_RefreshPage() break; default: break; - + } - + print_time_run(); - + } void clear_cur_ui() { last_disp_state = disp_state_stack._disp_state[disp_state_stack._disp_index]; - + switch(disp_state_stack._disp_state[disp_state_stack._disp_index]) { - case PRINT_READY_UI: + case PRINT_READY_UI: //Get_Temperature_Flg = 0; lv_clear_ready_print(); break; @@ -1013,17 +1035,17 @@ void clear_cur_ui() case WIFI_UI: //Clear_Wifi(); break; - + case MORE_UI: //Clear_more(); break; - + case FILETRANSFER_UI: //Clear_fileTransfer(); break; case DIALOG_UI: lv_clear_dialog(); - break; + break; case FILETRANSFERSTATE_UI: ///// Clear_WifiFileTransferdialog(); break; @@ -1068,13 +1090,13 @@ void clear_cur_ui() break; case MOTOR_SETTINGS_UI: //Clear_MotorSettings(); - break; + break; case MACHINETYPE_UI: //Clear_MachineType(); - break; + break; case STROKE_UI: //Clear_Stroke(); - break; + break; case HOME_DIR_UI: //Clear_HomeDir(); break; @@ -1086,19 +1108,19 @@ void clear_cur_ui() break; case LEVELING_SETTIGNS_UI: //Clear_LevelingSettings(); - break; + break; case LEVELING_PARA_UI: //Clear_LevelingPara(); - break; + break; case DELTA_LEVELING_PARA_UI: //Clear_DeltaLevelPara(); break; case XYZ_LEVELING_PARA_UI: //Clear_XYZLevelPara(); - break; + break; case MAXFEEDRATE_UI: //Clear_MaxFeedRate(); - break; + break; case STEPS_UI: //Clear_Steps(); break; @@ -1119,16 +1141,16 @@ void clear_cur_ui() break; case HOTBED_CONFIG_UI: //Clear_HotbedConfig(); - break; + break; case ADVANCED_UI: //Clear_Advanced(); - break; + break; case DOUBLE_Z_UI: //Clear_DoubleZ(); break; case ENABLE_INVERT_UI: //Clear_EnableInvert(); - break; + break; case NUMBER_KEY_UI: //Clear_NumberKey(); break; @@ -1146,7 +1168,7 @@ void draw_return_ui() if(disp_state_stack._disp_index > 0) { disp_state_stack._disp_index--; - + switch(disp_state_stack._disp_state[disp_state_stack._disp_index]) { case PRINT_READY_UI: @@ -1161,7 +1183,7 @@ void draw_return_ui() if(gCfgItems.from_flash_pic == 1) flash_preview_begin = 1; else - default_preview_flg = 1; + default_preview_flg = 1; lv_draw_printing(); break; @@ -1186,7 +1208,7 @@ void draw_return_ui() case PRE_HEAT_UI: lv_draw_preHeat(); break; - + case CHANGE_SPEED_UI: lv_draw_change_speed(); break; @@ -1228,11 +1250,11 @@ void draw_return_ui() case CALIBRATE_UI: //// draw_calibrate(); break; - + case DISK_UI: //draw_Disk(); - break; - + break; + case WIFI_UI: //draw_Wifi(); break; @@ -1240,18 +1262,18 @@ void draw_return_ui() case MORE_UI: //draw_More(); break; - + case PRINT_MORE_UI: //draw_printmore(); break; - + case FILAMENTCHANGE_UI: //draw_FilamentChange(); break; case LEVELING_UI: lv_draw_manualLevel(); break; - + case BIND_UI: //draw_bind(); break; @@ -1280,28 +1302,28 @@ void draw_return_ui() break; case MACHINE_PARA_UI: //draw_MachinePara(); - break; + break; case MACHINE_SETTINGS_UI: //draw_MachineSettings(); - break; + break; case TEMPERATURE_SETTINGS_UI: //draw_TemperatureSettings(); - break; + break; case MOTOR_SETTINGS_UI: //draw_MotorSettings(); break; case MACHINETYPE_UI: //draw_MachineType(); - break; + break; case STROKE_UI: //draw_Stroke(); - break; + break; case HOME_DIR_UI: //draw_HomeDir(); break; case ENDSTOP_TYPE_UI: //draw_EndstopType(); - break; + break; case FILAMENT_SETTINGS_UI: //draw_FilamentSettings(); break; @@ -1328,7 +1350,7 @@ void draw_return_ui() break; case JERK_UI: //draw_Jerk(); - break; + break; case MOTORDIR_UI: //draw_MotorDir(); break; @@ -1337,7 +1359,7 @@ void draw_return_ui() break; case NOZZLE_CONFIG_UI: //draw_NozzleConfig(); - break; + break; case HOTBED_CONFIG_UI: //draw_HotbedConfig(); break; @@ -1346,29 +1368,29 @@ void draw_return_ui() break; case DOUBLE_Z_UI: //draw_DoubleZ(); - break; + break; case ENABLE_INVERT_UI: //draw_EnableInvert(); break; case NUMBER_KEY_UI: //draw_NumberKey(); - break; + break; case DIALOG_UI: //draw_dialog(DialogType); break; case BABY_STEP_UI: //draw_babyStep(); break; - + default: break; } } - + } -#if ENABLED (SDSUPPORT) +#if ENABLED(SDSUPPORT) void sd_detection() { #if ENABLED(SDSUPPORT) @@ -1391,8 +1413,8 @@ extern volatile uint32_t systick_uptime_millis; void print_time_count() { - if((systick_uptime_millis % 1000) == 0) - { + if((systick_uptime_millis % 1000) == 0) + { if(print_time.start == 1) { print_time.seconds++; @@ -1408,8 +1430,8 @@ void LV_TASK_HANDLER() mks_test(); #endif disp_pre_gcode(2,36); - GUI_RefreshPage(); + GUI_RefreshPage(); //sd_detection(); } -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h new file mode 100644 index 000000000000..9ab04b447259 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -0,0 +1,229 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +#include +#include +#include "lvgl.h" +#include "inc/tft_multi_language.h" +#include "inc/draw_ready_print.h" +#include "inc/draw_language.h" +#include "inc/draw_set.h" +#include "inc/draw_tool.h" +#include "inc/draw_print_file.h" +#include "inc/draw_dialog.h" +#include "inc/draw_printing.h" +#include "inc/draw_opration.h" +#include "inc/draw_preHeat.h" +#include "inc/draw_extrusion.h" +#include "inc/draw_home.h" +#include "inc/draw_move_motor.h" +#include "inc/draw_fan.h" +#include "inc/draw_about.h" +#include "inc/draw_change_speed.h" +#include "inc/draw_manuaLevel.h" +#include "inc/draw_error_message.h" +#include "inc/printer_opration.h" + +#define TFT35 + +#ifdef TFT35 + + #define TFT_WIDTH 480 + #define TFT_HEIGHT 320 + + #define titleHeight 36 // TFT_screen.title_high + #define INTERVAL_H 2 // TFT_screen.gap_h // 2 + #define INTERVAL_V 2 // TFT_screen.gap_v // 2 + #define BTN_X_PIXEL 117 // TFT_screen.btn_x_pixel + #define BTN_Y_PIXEL 140 // TFT_screen.btn_y_pixel + + #define SIMPLE_FIRST_PAGE_GRAP 30 + + #define BUTTON_TEXT_Y_OFFSET -20 + + #define TITLE_XPOS 3 //TFT_screen.title_xpos + #define TITLE_YPOS 5 //TFT_screen.title_ypos + + #define FILE_BTN_CNT 6 + + #define OTHER_BTN_XPIEL 117 + #define OTHER_BTN_YPIEL 92 + + #define FILE_PRE_PIC_X_OFFSET 8 + #define FILE_PRE_PIC_Y_OFFSET 0 + + #define PREVIEW_LITTLE_PIC_SIZE 40910//400*100+9*101+1 + #define PREVIEW_SIZE 202720//(PREVIEW_LITTLE_PIC_SIZE+800*200+201*9+1) + + #define GCFG_FLAG_VALUE 0xEE + +#else + + #define TFT_WIDTH 320 + #define TFT_HEIGHT 240 + +#endif + +extern char public_buf_m[100]; +extern char public_buf_l[30]; + +typedef struct { + uint8_t spi_flash_flag; + uint8_t multiple_language; + uint8_t language; + uint8_t leveling_mode; + uint8_t from_flash_pic; + uint8_t finish_power_off; + uint8_t pause_reprint; + uint32_t curFilesize; +} CFG_ITMES; + +typedef struct { + uint8_t curTempType:1, + curSprayerChoose:3, + stepHeat:4; + uint8_t leveling_first_time:1; + uint8_t extruStep; + uint8_t extruSpeed; + uint8_t print_state; + uint8_t stepPrintSpeed; + uint8_t waitEndMoves; + uint16_t moveSpeed; + float move_dist; +} UI_CFG; + +typedef enum { + MAIN_UI, + PRINT_READY_UI, + PRINT_FILE_UI, + PRINTING_UI, + MOVE_MOTOR_UI, + OPERATE_UI, + PAUSE_UI, + EXTRUSION_UI, + FAN_UI, + PRE_HEAT_UI, + CHANGE_SPEED_UI, + TEMP_UI, + SET_UI, + ZERO_UI, + SPRAYER_UI, + MACHINE_UI, + LANGUAGE_UI, + ABOUT_UI, + LOG_UI, + DISK_UI, + CALIBRATE_UI, + DIALOG_UI, + WIFI_UI, + MORE_UI, + FILETRANSFER_UI, + FILETRANSFERSTATE_UI, + PRINT_MORE_UI, + FILAMENTCHANGE_UI, + LEVELING_UI, + MESHLEVELING_UI, + BIND_UI, + ZOFFSET_UI, + TOOL_UI, + HARDWARE_TEST_UI, + WIFI_LIST_UI, + KEY_BOARD_UI, + TIPS_UI, + MACHINE_PARA_UI, + MACHINE_SETTINGS_UI, + TEMPERATURE_SETTINGS_UI, + MOTOR_SETTINGS_UI, + MACHINETYPE_UI, + STROKE_UI, + HOME_DIR_UI, + ENDSTOP_TYPE_UI, + FILAMENT_SETTINGS_UI, + LEVELING_SETTIGNS_UI, + LEVELING_PARA_UI, + DELTA_LEVELING_PARA_UI, + XYZ_LEVELING_PARA_UI, + MAXFEEDRATE_UI, + STEPS_UI, + ACCELERATION_UI, + JERK_UI, + MOTORDIR_UI, + HOMESPEED_UI, + NOZZLE_CONFIG_UI, + HOTBED_CONFIG_UI, + ADVANCED_UI, + DOUBLE_Z_UI, + ENABLE_INVERT_UI, + NUMBER_KEY_UI, + BABY_STEP_UI, + ERROR_MESSAGE_UI +} DISP_STATE; + +typedef struct { + DISP_STATE _disp_state[100]; + int _disp_index; +} DISP_STATE_STACK; + +typedef struct { + int16_t days; + uint16_t hours; + uint8_t minutes; + volatile int8_t seconds; + int8_t ms_10; + int8_t start; +} PRINT_TIME; +extern PRINT_TIME print_time; + +extern CFG_ITMES gCfgItems; +extern UI_CFG uiCfg; +extern DISP_STATE disp_state; +extern DISP_STATE last_disp_state; +extern DISP_STATE_STACK disp_state_stack; + +extern lv_style_t tft_style_scr; +extern lv_style_t tft_style_lable_pre; +extern lv_style_t tft_style_lable_rel; + +extern void gCfgItems_init(); +extern void ui_cfg_init(); +extern void tft_style_init(); +extern char *creat_title_text(void); +extern void preview_gcode_prehandle(char *path); +extern void update_spi_flash(); +extern void disp_pre_gcode(int xpos_pixel,int ypos_pixel); +extern void GUI_RefreshPage(); +extern void clear_cur_ui(); +extern void draw_return_ui(); +extern void sd_detection(); +extern void gCfg_to_spiFlah(); +extern void print_time_count(); + +extern void LV_TASK_HANDLER(); + +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/gb2312_puhui16.cpp b/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp similarity index 76% rename from Marlin/src/lcd/extui/lib/mks_ui/src/gb2312_puhui16.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp index 99e9d99c7555..0a78f3e653ca 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/gb2312_puhui16.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp @@ -1,11 +1,33 @@ /* -*--------------------------------------------------------------- +*--------------------------------------------------------------- *--------------------------------------------------------------- */ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) #include "lvgl.h" -#include "../inc/pic_manager.h" +#include "pic_manager.h" typedef struct{ @@ -100,4 +122,4 @@ void init_gb2312_font() } //end of file -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/SPI_TFT.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/SPI_TFT.h deleted file mode 100644 index 3964658f4a94..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/SPI_TFT.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#include - -#define SPI_TFT_CS_H OUT_WRITE(SPI_TFT_CS_PIN, HIGH) -#define SPI_TFT_CS_L OUT_WRITE(SPI_TFT_CS_PIN, LOW) - -#define SPI_TFT_DC_H OUT_WRITE(SPI_TFT_DC_PIN, HIGH) -#define SPI_TFT_DC_L OUT_WRITE(SPI_TFT_DC_PIN, LOW) - -#define SPI_TFT_RST_H OUT_WRITE(SPI_TFT_RST_PIN, HIGH) -#define SPI_TFT_RST_L OUT_WRITE(SPI_TFT_RST_PIN, LOW) - -#define SPI_TFT_BLK_H OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH) -#define SPI_TFT_BLK_L OUT_WRITE(LCD_BACKLIGHT_PIN, LOW) - -class TFT{ -public: - void spi_init(uint8_t spiRate); - uint8_t spi_Rec(); - uint8_t spi_read_write_byte(uint8_t data); - void spi_Read(uint8_t* buf, uint16_t nbyte); - void spi_Send(uint8_t b); - void spi_SendBlock(uint8_t token, const uint8_t* buf); - void LCD_WR_REG(uint8_t cmd); - void LCD_WR_DATA(uint8_t data); - void SetCursor(uint16_t x,uint16_t y); - void SetWindows(uint16_t x,uint16_t y,uint16_t with,uint16_t height); - void LCD_init(); - void LCD_clear(uint16_t color); - void LCD_WriteRAM_Prepare(); -}; - -extern TFT SPI_TFT; - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/W25Qxx.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/W25Qxx.h deleted file mode 100644 index 3520985e62d8..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/W25Qxx.h +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -//#if defined(__cplusplus) -//extern "C" { /* Make sure we have C-declarations in C++ programs */ -//#endif - -#include - -#define W25X_WriteEnable 0x06 -#define W25X_WriteDisable 0x04 -#define W25X_ReadStatusReg 0x05 -#define W25X_WriteStatusReg 0x01 -#define W25X_ReadData 0x03 -#define W25X_FastReadData 0x0B -#define W25X_FastReadDual 0x3B -#define W25X_PageProgram 0x02 -#define W25X_BlockErase 0xD8 -#define W25X_SectorErase 0x20 -#define W25X_ChipErase 0xC7 -#define W25X_PowerDown 0xB9 -#define W25X_ReleasePowerDown 0xAB -#define W25X_DeviceID 0xAB -#define W25X_ManufactDeviceID 0x90 -#define W25X_JedecDeviceID 0x9F - -#define WIP_Flag 0x01 /* Write In Progress (WIP) flag */ - -#define Dummy_Byte 0xA5 - -#define SPI_FLASH_SectorSize 4096 -#define SPI_FLASH_PageSize 256 -#define SPI_FLASH_PerWritePageSize 256 - -#if 0 - -#define PIC_NAME_MAX_LEN 50 - -#define LOGO_MAX_SIZE (300*1024) //logo���ֵ -#define TITLELOGO_MAX_SIZE (150*1024) //logo���ֵ -#define DEFAULT_VIEW_MAX_SIZE (200*200*2) -#define FLASH_VIEW_MAX_SIZE (200*200*2) - -//ͼƬ -//Robin2�洢��ַ -#define PIC_NAME_ADDR 0x003000 //ͼƬ��Ϣ�洢��ַ��ͼƬ���� -#define PIC_SIZE_ADDR 0x007000 //ͼƬ��Ϣ�洢��ַ��ͼƬ��Сֵ -#define PIC_COUNTER_ADDR 0x008000 //ͼƬ������ֵ�洢��ַ -#define PIC_LOGO_ADDR 0x009000 //ͼƬlogo�洢��ַ -//#define PIC_DATA_ADDR 0x02f000 //ͼƬ���ݴ洢��ַ - -#define DEFAULT_VIEW_ADDR 0XC5800 -#define BAK_VIEW_ADDR (DEFAULT_VIEW_ADDR+90*1024) -#define PIC_ICON_LOGO_ADDR (BAK_VIEW_ADDR+80*1024) - -#define PIC_DATA_ADDR (PIC_ICON_LOGO_ADDR+350*1024) //ͼƬ���ݴ洢��ַ//(800*240) - -//�ֿ� -#define FONTINFOADDR 0x600000//6M�Ժ��ַΪ�ֿ� -#define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096)//4*1024 -#define GBK_FLASH_ADDR (UNIGBK_FLASH_ADDR+180224)//176*1024 - -#define PER_PIC_MAX_SPACE (32*1024) //Ϊ�˷�ֹ����Խ������⣬ÿ��СͼƬ�����仮��Ӧ��ȡ�ܹ�����4K��ֵ - -// -union union32 -{ - uint8_t bytes[4]; - uint32_t dwords; -}; -//ͼƬ��Ϣ�ṹ�� -struct pic_msg -{ - uint8_t name[PIC_NAME_MAX_LEN]; - union union32 size; -}; - -typedef struct pic_msg PIC_MSG; - -#endif - -class ext_FLASH{ -public: - void init(uint8_t spiRate); - static uint8_t spi_flash_Rec(); - static uint8_t spi_flash_read_write_byte(uint8_t data); - static void spi_flash_Read(uint8_t* buf, uint16_t nbyte); - static void spi_flash_Send(uint8_t b); - static void spi_flash_SendBlock(uint8_t token, const uint8_t* buf); - static uint16_t W25QXX_ReadID(void); - static void SPI_FLASH_WriteEnable(void); - static void SPI_FLASH_WaitForWriteEnd(void); - static void SPI_FLASH_SectorErase(uint32_t SectorAddr); - static void SPI_FLASH_BlockErase(uint32_t BlockAddr); - static void SPI_FLASH_BulkErase(void); - static void SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); - static void SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); - static void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead); - //uint32_t lv_get_pic_addr(uint8_t *Pname); - void lv_pic_read(uint8_t *P_Rbuff,uint32_t addr,uint32_t size); - -}; -extern ext_FLASH W25QXX; - -//extern uint32_t lv_get_pic_addr(uint8_t *Pname); - -//#if defined(__cplusplus) -//} /* Make sure we have C-declarations in C++ programs */ -//#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_about.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_about.h deleted file mode 100644 index 5ee28f5d8ed4..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_about.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _LV_DRAW_ABOUT_ -#define _LV_DRAW_ABOUT_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -extern void lv_draw_about(void); -extern void lv_clear_about(); - - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_change_speed.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_change_speed.h deleted file mode 100644 index 015bdde15616..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_change_speed.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _LV_DRAW_CHANGE_SPEED_ -#define _LV_DRAW_CHANGE_SPEED_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -#define MIN_EXT_SPEED_PERCENT 10 -#define MAX_EXT_SPEED_PERCENT 999 - -extern void lv_draw_change_speed(void); -extern void lv_clear_change_speed(); -extern void disp_speed_step(); -extern void disp_print_speed(); -extern void disp_speed_type(); - - - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_dialog.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_dialog.h deleted file mode 100644 index b08ad0ad290c..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_dialog.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef _LV_DRAW_DIALOG_ -#define _LV_DRAW_DIALOG_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -#define DIALOG_TYPE_STOP 0 -#define DIALOG_TYPE_PRINT_FILE 1 -#define DIALOG_TYPE_REPRINT_NO_FILE 2 - -#define DIALOG_TYPE_M80_FAIL 3 //** -#define DIALOG_TYPE_MESSEGE_ERR1 4//** - -#define DIALOG_TYPE_UPDATE_ESP_FIRMARE 5 -#define DIALOG_TYPE_UPDATE_ESP_DATA 6 -#define DIALOG_TYPE_UPLOAD_FILE 7 -#define DIALOG_TYPE_UNBIND 8 - -#define DIALOG_TYPE_FILAMENT_LOAD_HEAT 9 -#define DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED 10 -#define DIALOG_TYPE_FILAMENT_LOADING 11 -#define DIALOG_TYPE_FILAMENT_LOAD_COMPLETED 12 -#define DIALOG_TYPE_FILAMENT_UNLOAD_HEAT 13 -#define DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED 14 -#define DIALOG_TYPE_FILAMENT_UNLOADING 15 -#define DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED 16 - -#define DIALOG_TYPE_FILE_LOADING 17//** - -#define DIALOG_TYPE_FILAMENT_NO_PRESS 18 -#define DIALOG_TYPE_FINISH_PRINT 19 - -#define WIFI_ENABLE_TIPS 20 - -#define DIALOG_PAUSE_MESSAGE_PAUSING 21 -#define DIALOG_PAUSE_MESSAGE_CHANGING 22 -#define DIALOG_PAUSE_MESSAGE_UNLOAD 23 -#define DIALOG_PAUSE_MESSAGE_WAITING 24 -#define DIALOG_PAUSE_MESSAGE_INSERT 25 -#define DIALOG_PAUSE_MESSAGE_LOAD 26 -#define DIALOG_PAUSE_MESSAGE_PURGE 27 -#define DIALOG_PAUSE_MESSAGE_RESUME 28 -#define DIALOG_PAUSE_MESSAGE_HEAT 29 -#define DIALOG_PAUSE_MESSAGE_HEATING 30 -#define DIALOG_PAUSE_MESSAGE_OPTION 31 - -#define BTN_OK_X 100 -#define BTN_OK_Y 180 -#define BTN_CANCEL_X 280 -#define BTN_CANCEL_Y 180 - -extern void lv_draw_dialog(uint8_t type); -extern void lv_clear_dialog(); - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_error_message.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_error_message.h deleted file mode 100644 index b1d95f9ca922..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_error_message.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _LV_DRAW_ERROR_MESSAGE_ -#define _LV_DRAW_ERROR_MESSAGE_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -extern void lv_draw_error_message(PGM_P const msg); -extern void lv_clear_error_message(); - - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_extrusion.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_extrusion.h deleted file mode 100644 index 9e29479cf2cf..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_extrusion.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _LV_DRAW_EXTRUSION_ -#define _LV_DRAW_EXTRUSION_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -extern void lv_draw_extrusion(void); -extern void lv_clear_extrusion(); -extern void disp_ext_type(); -extern void disp_ext_step(); -extern void disp_ext_speed(); -extern void disp_hotend_temp(); -extern void disp_extru_amount(); - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_fan.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_fan.h deleted file mode 100644 index 56b699bb04b4..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_fan.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _LV_DRAW_FAN_ -#define _LV_DRAW_FAN_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -extern void lv_draw_fan(void); -extern void lv_clear_fan(); -extern void disp_fan_value(); - - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_home.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_home.h deleted file mode 100644 index 9e8797358080..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_home.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _LV_DRAW_HOME_ -#define _LV_DRAW_HOME_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -extern void lv_draw_home(void); -extern void lv_clear_home(); - - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_language.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_language.h deleted file mode 100644 index 6fdb4a6bc800..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_language.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _LV_DRAW_LANGUAGE_ -#define _LV_DRAW_LANGUAGE_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -extern void lv_draw_language(void); -extern void lv_clear_language(); - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_manuaLevel.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_manuaLevel.h deleted file mode 100644 index 818aca61d35b..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_manuaLevel.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _LV_DRAW_MANUAL_LEVEL_ -#define _LV_DRAW_MANUAL_LEVEL_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -extern void lv_draw_manualLevel(void); -extern void lv_clear_manualLevel(); - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_move_motor.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_move_motor.h deleted file mode 100644 index 80f52e44d53b..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_move_motor.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _LV_DRAW_MOVE_MOTOR_ -#define _LV_DRAW_MOVE_MOTOR_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -extern void lv_draw_move_motor(void); -extern void lv_clear_move_motor(); -extern void disp_move_dist(); - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_opration.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_opration.h deleted file mode 100644 index 5dd6c9ff61d1..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_opration.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _LV_DRAW_OPRATION_ -#define _LV_DRAW_OPRATION_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -extern void lv_draw_opration(void); -extern void lv_clear_opration(); - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_pause_message.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_pause_message.h deleted file mode 100644 index e8411977a249..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_pause_message.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _LV_DRAW_ERROR_MESSAGE_ -#define _LV_DRAW_ERROR_MESSAGE_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -extern void lv_draw_pause_message(const PauseMessage msg); - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_preHeat.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_preHeat.h deleted file mode 100644 index aadaeb273570..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_preHeat.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef _LV_DRAW_PREHEAT_ -#define _LV_DRAW_PREHEAT_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -extern void lv_draw_preHeat(void); -extern void lv_clear_preHeat(); -extern void disp_temp_type(); -extern void disp_step_heat(); -extern void disp_desire_temp(); - - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_print_file.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_print_file.h deleted file mode 100644 index 293426632b74..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_print_file.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _LV_DRAW_PRINT_FILE_ -#define _LV_DRAW_PRINT_FILE_ - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -typedef struct -{ - int cur_page_first_offset; - int cur_page_last_offset; - int curPage; -} DIR_OFFSET; -extern DIR_OFFSET dir_offset[10]; - -#define FILE_NUM 6 -#define SHORT_NEME_LEN 13 -#define NAME_CUT_LEN 23 - -#define MAX_DIR_LEVEL 10 - -typedef struct -{ - //char longName[FILE_NUM][LONG_FILENAME_LENGTH]; - char file_name[FILE_NUM][SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; - char curDirPath[SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; - char long_name[FILE_NUM][SHORT_NEME_LEN*2+1]; - char IsFolder[FILE_NUM]; - char Sd_file_cnt; - char sd_file_index; - char Sd_file_offset; -}LIST_FILE; -extern LIST_FILE list_file; - -extern void disp_gcode_icon(uint8_t file_num); -extern void lv_draw_print_file(void); -extern void lv_open_gcode_file(char *path); -extern void lv_gcode_file_read(uint8_t *data_buf); -extern void lv_close_gcode_file(); -extern void cutFileName(char *path, int len, int bytePerLine, char *outStr); -extern int ascii2dec_test(char *ascii); -extern void lv_clear_print_file(); - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_printing.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_printing.h deleted file mode 100644 index 1b4d07e49871..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_printing.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _LV_DRAW_PRINTING_ -#define _LV_DRAW_PRINTING_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -#define IDLE 0 -#define WORKING 1 -#define PAUSING 2 -#define PAUSED 3 -#define REPRINTING 4 -#define REPRINTED 5 -#define RESUMING 6 -#define STOP 7 - - -extern void lv_draw_printing(void); -extern void lv_clear_printing(); -extern void disp_ext_temp(); -extern void disp_bed_temp(); -extern void disp_fan_speed(); -extern void disp_print_time(); -extern void disp_fan_Zpos(); -extern void reset_print_time(); -extern void start_print_time(); -extern void stop_print_time(); -extern void setProBarRate(); - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ready_print.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ready_print.h deleted file mode 100644 index 7d13d627532f..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ready_print.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef _LV_DRAW_READY_PRINT_ -#define _LV_DRAW_READY_PRINT_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -extern void lv_draw_ready_print(void); -extern void disp_test(); -extern void disp_Limit_ok(); -extern void disp_Limit_error(); -extern void disp_det_error(); -extern void disp_det_ok(); -extern void lv_clear_ready_print(); - - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_set.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_set.h deleted file mode 100644 index 7ddfbe5037ea..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_set.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _LV_DRAW_SET_ -#define _LV_DRAW_SET_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -extern void lv_draw_set(void); -extern void lv_clear_set(); - - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_tool.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_tool.h deleted file mode 100644 index c7a5c21dced5..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_tool.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _LV_DRAW_TOOL_ -#define _LV_DRAW_TOOL_ - - - - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -extern void lv_draw_tool(void); -extern void lv_clear_tool(); - -//extern void disp_temp_ready_print(); -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ui.h deleted file mode 100644 index 5321e0614788..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/draw_ui.h +++ /dev/null @@ -1,222 +0,0 @@ -#ifndef _DRAW_UI_H -#define _DRAW_UI_H - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -#include -#include -#include "lvgl.h" -#include "../inc/tft_multi_language.h" -#include "../inc/draw_ready_print.h" -#include "../inc/draw_language.h" -#include "../inc/draw_set.h" -#include "../inc/draw_tool.h" -#include "../inc/draw_print_file.h" -#include "../inc/draw_dialog.h" -#include "../inc/draw_printing.h" -#include "../inc/draw_opration.h" -#include "../inc/draw_preHeat.h" -#include "../inc/draw_extrusion.h" -#include "../inc/draw_home.h" -#include "../inc/draw_move_motor.h" -#include "../inc/draw_fan.h" -#include "../inc/draw_about.h" -#include "../inc/draw_change_speed.h" -#include "../inc/draw_manuaLevel.h" -#include "../inc/draw_error_message.h" -#include "../inc/printer_opration.h" - - -#define TFT35 - -#ifdef TFT35 - -#define TFT_WIDTH 480 -#define TFT_HEIGHT 320 - -#define titleHeight 36//TFT_screen.title_high -#define INTERVAL_H 2//TFT_screen.gap_h// 2 -#define INTERVAL_V 2//TFT_screen.gap_v// 2 -#define BTN_X_PIXEL 117 //TFT_screen.btn_x_pixel// -#define BTN_Y_PIXEL 140//TFT_screen.btn_y_pixel// - -#define SIMPLE_FIRST_PAGE_GRAP 30 - -#define BUTTON_TEXT_Y_OFFSET -20 - -#define TITLE_XPOS 3 //TFT_screen.title_xpos// -#define TITLE_YPOS 5 //TFT_screen.title_ypos// - -#define FILE_BTN_CNT 6 - -#define OTHER_BTN_XPIEL 117 -#define OTHER_BTN_YPIEL 92 - -#define FILE_PRE_PIC_X_OFFSET 8 -#define FILE_PRE_PIC_Y_OFFSET 0 - -#define PREVIEW_LITTLE_PIC_SIZE 40910//400*100+9*101+1 -#define PREVIEW_SIZE 202720//(PREVIEW_LITTLE_PIC_SIZE+800*200+201*9+1) - -#define GCFG_FLAG_VALUE 0xee -#else - -#define TFT_WIDTH 320 -#define TFT_HEIGHT 240 - -#endif - -extern char public_buf_m[100]; -extern char public_buf_l[30]; - -typedef struct -{ - uint8_t spi_flash_flag; - uint8_t multiple_language; - uint8_t language; - uint8_t leveling_mode; - uint8_t from_flash_pic; - uint8_t finish_power_off; - uint8_t pause_reprint; - uint32_t curFilesize; - -}CFG_ITMES; - -typedef struct -{ - uint8_t curTempType:1, - curSprayerChoose:3, - stepHeat:4; - uint8_t leveling_first_time:1; - uint8_t extruStep; - uint8_t extruSpeed; - uint8_t print_state; - uint8_t stepPrintSpeed; - uint8_t waitEndMoves; - uint16_t moveSpeed; - float move_dist; -}UI_CFG; - -typedef enum -{ - MAIN_UI, - PRINT_READY_UI, - PRINT_FILE_UI, - PRINTING_UI, - MOVE_MOTOR_UI, - OPERATE_UI, - PAUSE_UI, - EXTRUSION_UI, - FAN_UI, - PRE_HEAT_UI, - CHANGE_SPEED_UI, - TEMP_UI, - SET_UI, - ZERO_UI, - SPRAYER_UI, - MACHINE_UI, - LANGUAGE_UI, - ABOUT_UI, - LOG_UI, - DISK_UI, - CALIBRATE_UI, - DIALOG_UI, - WIFI_UI, - MORE_UI, - FILETRANSFER_UI, - FILETRANSFERSTATE_UI, - PRINT_MORE_UI, - FILAMENTCHANGE_UI, - LEVELING_UI, - MESHLEVELING_UI, - BIND_UI, - ZOFFSET_UI, - TOOL_UI, - HARDWARE_TEST_UI, - WIFI_LIST_UI, - KEY_BOARD_UI, - TIPS_UI, - MACHINE_PARA_UI, - MACHINE_SETTINGS_UI, - TEMPERATURE_SETTINGS_UI, - MOTOR_SETTINGS_UI, - MACHINETYPE_UI, - STROKE_UI, - HOME_DIR_UI, - ENDSTOP_TYPE_UI, - FILAMENT_SETTINGS_UI, - LEVELING_SETTIGNS_UI, - LEVELING_PARA_UI, - DELTA_LEVELING_PARA_UI, - XYZ_LEVELING_PARA_UI, - MAXFEEDRATE_UI, - STEPS_UI, - ACCELERATION_UI, - JERK_UI, - MOTORDIR_UI, - HOMESPEED_UI, - NOZZLE_CONFIG_UI, - HOTBED_CONFIG_UI, - ADVANCED_UI, - DOUBLE_Z_UI, - ENABLE_INVERT_UI, - NUMBER_KEY_UI, - BABY_STEP_UI, - ERROR_MESSAGE_UI -} DISP_STATE; - -typedef struct -{ - DISP_STATE _disp_state[100]; - int _disp_index; - -} DISP_STATE_STACK; - -typedef struct -{ - - int16_t days; - uint16_t hours; - uint8_t minutes; - volatile int8_t seconds; - int8_t ms_10; - int8_t start; - -} PRINT_TIME; -extern PRINT_TIME print_time; - -extern CFG_ITMES gCfgItems; -extern UI_CFG uiCfg; -extern DISP_STATE disp_state; -extern DISP_STATE last_disp_state; -extern DISP_STATE_STACK disp_state_stack; - -extern lv_style_t tft_style_scr; -extern lv_style_t tft_style_lable_pre; -extern lv_style_t tft_style_lable_rel; - -extern void gCfgItems_init(); -extern void ui_cfg_init(); -extern void tft_style_init(); -extern char *creat_title_text(void); -extern void preview_gcode_prehandle(char *path); -extern void update_spi_flash(); -extern void disp_pre_gcode(int xpos_pixel,int ypos_pixel); -extern void GUI_RefreshPage(); -extern void clear_cur_ui(); -extern void draw_return_ui(); -extern void sd_detection(); -extern void gCfg_to_spiFlah(); -extern void print_time_count(); - -extern void LV_TASK_HANDLER(); - - -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/mks_hardware_test.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/mks_hardware_test.h deleted file mode 100644 index 9b6728514d2a..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/mks_hardware_test.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef MKS_HARDWARE_TEST_H -#define MKS_HARDWARE_TEST_H - -#include "lvgl.h" - -void Test_GPIO(); -void disp_char_1624(uint16_t x,uint16_t y,uint8_t c,uint16_t charColor,uint16_t bkColor); -void disp_string(uint16_t x,uint16_t y,const char * string,uint16_t charColor,uint16_t bkColor); -void mks_test(); -void disp_pic_update(); -void disp_font_update(); - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/printer_opration.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/printer_opration.h deleted file mode 100644 index 2e1a3165f8ff..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/printer_opration.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _LV_PRINTER_OPRATION_ -#define _LV_PRINTER_OPRATION_ - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - -#define MIN_FILE_PRINTED 100 //5000 - -extern void printer_state_polling(); -extern void filament_pin_setup(); -extern void filament_check(); - -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_en.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_en.h deleted file mode 100644 index f3df62dffc62..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_en.h +++ /dev/null @@ -1,698 +0,0 @@ -#ifndef _TFT_LANGUAGE_EN_H -#define _TFT_LANGUAGE_EN_H -//****************英文***************************// -#define MACHINE_CONFIG_EN "Machine\nSettings" - -#define NEXT_EN "Next" -#define PREVIOUS_EN "Previous" -#define DEFAULT_EN "Default" -#define KEY_BACK_EN "Del" -#define KEY_REST_EN "Rest" -#define KEY_CONFIRM_EN "Confirm" - -#define KEYBOARD_KEY0_EN "0" -#define KEYBOARD_KEY1_EN "1" -#define KEYBOARD_KEY2_EN "2" -#define KEYBOARD_KEY3_EN "3" -#define KEYBOARD_KEY4_EN "4" -#define KEYBOARD_KEY5_EN "5" -#define KEYBOARD_KEY6_EN "6" -#define KEYBOARD_KEY7_EN "7" -#define KEYBOARD_KEY8_EN "8" -#define KEYBOARD_KEY9_EN "9" -#define KEYBOARD_KEY_POINT_EN "." -#define KEYBOARD_KEY_NEGATIVE_EN "-" - -#define MACHINE_PARA_EN "Machine\nsettings" -#define MACHINE_PARA_TITLE_EN "Machine settings" -#define MACHINE_TYPE_CNOFIG_EN "Machine" -#define TEMPERATURE_CONFIG_EN "Temperature" -#define MOTOR_CONFIG_EN "Motor" -#define ADVANCE_CONFIG_EN "Adavance" - -#define MACHINE_CONFIG_TITLE_EN "Machine Settings" -#define MACHINE_TYPE_EN "Machine type" -#define MACHINE_STROKE_EN "Machine Size" -#define MACHINE_HOMEDIR_EN "Home direction" -#define MACHINE_ENDSTOP_TYPE_EN "Endstop type" -#define MACHINE_FILAMENT_CONFIG_EN "Filament settings" -#define MACHINE_LEVELING_CONFIG_EN "Leveling settings" - -#define MACHINE_TYPE_CONFIG_TITLE_EN "Machine Settings>Machine type" -#define MACHINE_TYPE_XYZ_EN "XYZ Machine" -#define MACHINE_TYPE_DELTA_EN "Delta Machine" -#define MACHINE_TYPE_COREXY_EN "Corexy Machine" - -#define MACHINE_STROKE_CONF_TITLE_EN "Machine Settings>Machine Size" -#define X_MAX_LENGTH_EN "X-axis maximum stroke" -#define Y_MAX_LENGTH_EN "Y-axis maximum stroke" -#define Z_MAX_LENGTH_EN "Z-axis maximum stroke" - -#define X_MIN_LENGTH_EN "X-axis minimum stroke" -#define Y_MIN_LENGTH_EN "Y-axis minimum stroke" -#define Z_MIN_LENGTH_EN "Z-axis minimum stroke" - -#define HOME_DIR_CONF_TITLE_EN "Machine Settings>Home direction" -#define HOME_DIR_X_EN "X-axis home direction" -#define HOME_DIR_Y_EN "Y-axis home direction" -#define HOME_DIR_Z_EN "Z-axis home direction" -#define HOME_MIN_EN "MIN" -#define HOME_MAX_EN "MAX" - -#define ENDSTOP_CONF_TITLE_EN "Machine Settings>Endstop type" -#define MIN_ENDSTOP_X_EN "X-axis minimum Endstop" -#define MIN_ENDSTOP_Y_EN "Y-axis minimum Endstop" -#define MIN_ENDSTOP_Z_EN "Z-axis minimum Endstop" -#define MAX_ENDSTOP_X_EN "X axis maximum Endstop" -#define MAX_ENDSTOP_Y_EN "Y axis maximum Endstop" -#define MAX_ENDSTOP_Z_EN "Z axis maximum Endstop" -#define ENDSTOP_FIL_EN "Filament sensor" -#define ENDSTOP_LEVEL_EN "Leveling sensor" -#define ENDSTOP_OPENED_EN "Open" -#define ENDSTOP_CLOSED_EN "Close" - -#define FILAMENT_CONF_TITLE_EN "Filament settings" -#define FILAMENT_IN_TEMPERATURE_EN "Load temperature" -#define FILAMENT_IN_LENGTH_EN "Load length" -#define FILAMENT_IN_SPEED_EN "Load speed" -#define FILAMENT_OUT_TEMPERATURE_EN "Unload temperature" -#define FILAMENT_OUT_LENGTH_EN "Unload length" -#define FILAMENT_OUT_SPEED_EN "Unload speed" - -#define LEVELING_CONF_TITLE_EN "Leveling settings" -#define LEVELING_PARA_CONF_EN "Leveling settings" -#define LEVELING_DELTA_EN "delta machine leveling" -#define LEVELING_XYZ_EN "Manual leveling coordinate settings" - -#define LEVELING_PARA_CONF_TITLE_EN "leveling setting" -#define AUTO_LEVELING_ENABLE_EN "Enable auto leveling" -#define BLTOUCH_LEVELING_ENABLE_EN "Enable BLtouch" -#define PROBE_PORT_EN "Probe connector" -#define PROBE_X_OFFSET_EN "Probe x axis offset" -#define PROBE_Y_OFFSET_EN "Probe y axis offset" -#define PROBE_Z_OFFSET_EN "Probe z axis offset" -#define PROBE_XY_SPEED_EN "Probe xy axis speed" -#define PROBE_Z_SPEED_EN "Probe z axis speed" -#define ENABLE_EN "YES" -#define DISABLE_EN "NO" -#define Z_MIN_EN "ZMin" -#define Z_MAX_EN "ZMax" - -#define DELTA_LEVEL_CONF_TITLE_EN "Delta Machine settings" -#define DELTA_LEVEL_CONF_EN "Delta Machine Leveling" -#define DELTA_MACHINE_RADIUS_EN "Machine Radius" -#define DELTA_DIAGONAL_ROD_EN "Machine rod length" -#define DELTA_PRINT_RADIUS_EN "Print radius" -#define DELTA_HEIGHT_EN "Print height" -#define SMOOTH_ROD_OFFSET_EN "Slider offset" -#define EFFECTOR_OFFSET_EN "Effector offset" -#define CALIBRATION_RADIUS_EN "Leveling radius" - -#define XYZ_LEVEL_CONF_TITLE_EN "Cartesian Machine Settings" -#define PROBE_REACH_MAX_LEFT_EN "Probe reaches leftmost position" -#define PROBE_REACH_MAX_RIGHT_EN "Probe reaches rightmost position" -#define PROBE_REACH_MAX_FRONT_EN "Probe reaches front position" -#define PROBE_REACH_MAX_BACK_EN "Probe reaches final position" - -#define TEMPERATURE_CONF_TITLE_EN "Machine Settings>Temperature settings" -#define NOZZLE_CONF_EN "Nozzle settings" -#define HOTBED_CONF_EN "Hotbed settings" -#define PREHEAT_TEMPER_EN "Preset temperature" - -#define NOZZLE_CONF_TITLE_EN "Machine Settings>Nozzle settings" -#define NOZZLECNT_EN "Number of nozzles" -#define NOZZLE_TYPE_EN "E0 Temperature type" -#define NOZZLE_ADJUST_TYPE_EN "PID thermostat" -#define NOZZLE_MIN_TEMPERATURE_EN "lowest temperature" -#define NOZZLE_MAX_TEMPERATURE_EN "Maximum temperature" -#define EXTRUD_MIN_TEMPER_EN "Minimum extrusion temperature" - -#define HOTBED_CONF_TITLE_EN "Machine Settings>Hotbed settings" -#define HOTBED_ADJUST_EN "PID thermostat" -#define HOTBED_MIN_TEMPERATURE_EN "lowest temperature" -#define HOTBED_MAX_TEMPERATURE_EN "Maximum temperature" - -#define MOTOR_CONF_TITLE_EN "Machine Settings>Motor settings" -#define MAXFEEDRATE_CONF_EN "Maximum speed settings" -#define ACCELERATION_CONF_EN "Acceleration settings" -#define JERKCONF_EN "Jerk settings" -#define STEPSCONF_EN "Steps settings" -#define MOTORDIRCONF_EN "Motor direction settings" -#define HOMEFEEDRATECONF_EN "Home speed setting" - -#define MAXFEEDRATE_CONF_TITLE_EN "Machine Settings>Maximum speed" -#define X_MAXFEEDRATE_EN "X axis maximum speed" -#define Y_MAXFEEDRATE_EN "Y axis maximum speed" -#define Z_MAXFEEDRATE_EN "Z axis maximum speed" -#define E0_MAXFEEDRATE_EN "E0 axis maximum speed" -#define E1_MAXFEEDRATE_EN "E1 axis maximum speed" - -#define ACCELERATION_CONF_TITLE_EN "Machine Settings>Acceleration" -#define PRINT_ACCELERATION_EN "Print acceleration" -#define RETRACT_ACCELERATION_EN "Retraction acceleration" -#define TRAVEL_ACCELERATION_EN "Travel acceleration" -#define X_ACCELERATION_EN "X-axis acceleration" -#define Y_ACCELERATION_EN "Y-axis acceleration" -#define Z_ACCELERATION_EN "Z-axis acceleration" -#define E0_ACCELERATION_EN "E0-axis acceleration" -#define E1_ACCELERATION_EN "E1-axis acceleration" - -#define JERK_CONF_TITLE_EN "Machine Settings>Jerk speed" -#define X_JERK_EN "X-axis jerk speed" -#define Y_JERK_EN "Y-axis jerk speed" -#define Z_JERK_EN "J-axis jerk speed" -#define E_JERK_EN "E-axis jerk speed" - -#define STEPS_CONF_TITLE_EN "Machine Settings>Steps settings" -#define X_STEPS_EN "X-axis steps" -#define Y_STEPS_EN "Y-axis stepS" -#define Z_STEPS_EN "Z-axis stepS" -#define E0_STEPS_EN "E0-axis steps" -#define E1_STEPS_EN "E1-axis steps" - -#define MOTORDIR_CONF_TITLE_EN "Machine Settings>Motor direction" -#define X_MOTORDIR_EN "X-axis motor direction invert" -#define Y_MOTORDIR_EN "Y-axis motor direction invert" -#define Z_MOTORDIR_EN "Z-axis motor direction invert" -#define E0_MOTORDIR_EN "E0-axis motor direction invert" -#define E1_MOTORDIR_EN "E1-axis motor direction invert" -#define INVERT_P_EN "YES" -#define INVERT_N_EN "NO" - -#define HOMEFEEDRATE_CONF_TITLE_EN "Machine Settings>Home speed" -#define X_HOMESPEED_EN "XY-axis Home speed" -#define Y_HOMESPEED_EN "Y-axis Home speed" -#define Z_HOMESPEED_EN "Z-axis Home speed" - -#define ADVANCED_CONF_TITLE_EN "Machine Settings>Advance" -#define PWROFF_DECTION_EN "power off dection module" -#define PWROFF_AFTER_PRINT_EN "Auto Shutdown after print" -#define HAVE_UPS_EN "Has UPS power supply" -#define Z2_AND_Z2ENDSTOP_CONF_EN "Z2 Settings" -#define ENABLE_PINS_CONF_EN "Enable pins level settings" - -#define Z2_AND_Z2ENDSTOP_CONF_TITLE_EN "Z2 Settings" -#define Z2_ENABLE_EN "Z2 Enable" -#define Z2_ENDSTOP_EN "Z2_EndStop Enable" -#define Z2_PORT_EN "Z2 Connector" - -#define ENABLE_PINS_CONF_TITLE_EN "ENABLE_PINS_LEVEL" -#define X_ENABLE_PINS_INVERT_EN "X_ENABLE_PIN_INVERT" -#define Y_ENABLE_PINS_INVERT_EN "Y_ENABLE_PIN_INVERT" -#define Z_ENABLE_PINS_INVERT_EN "Z_ENABLE_PIN_INVERT" -#define E_ENABLE_PINS_INVERT_EN "E_ENABLE_PIN_INVERT" - -#define TOOL_TEXT_EN "Tool" -#define PREHEAT_TEXT_EN "Preheat" -#define MOVE_TEXT_EN "Move" -#define HOME_TEXT_EN "Home" -#define PRINT_TEXT_EN "Printing" -#define EXTRUDE_TEXT_EN "Extrusion" -#define LEVELING_TEXT_EN "Leveling" -#define AUTO_LEVELING_TEXT_EN "AutoLevel" -#define SET_TEXT_EN "Settings" -#define MORE_TEXT_EN "More" - -#define ADD_TEXT_EN "Add" -#define DEC_TEXT_EN "Dec" -#define EXTRUDER_1_TEXT_EN "Extrusion1" -#define EXTRUDER_2_TEXT_EN "Extrusion2" -#define HEATBED_TEXT_EN "HeatBed" -#define TEXT_1C_EN "1℃" -#define TEXT_5C_EN "5℃" -#define TEXT_10C_EN "10℃" -#define CLOSE_TEXT_EN "Close" - -#define BACK_TEXT_EN "Back" - -#define TOOL_PREHEAT_EN "Preheat" -#define TOOL_EXTRUDE_EN "Extrusion" -#define TOOL_MOVE_EN "Move" -#define TOOL_HOME_EN "Home" -#define TOOL_LEVELING_EN "Leveling" -#define TOOL_AUTO_LEVELING_EN "AutoLevel" -#define TOOL_FILAMENT_EN "Filament" -#define TOOL_MORE_EN "More" - -#define AXIS_X_ADD_TEXT_EN "X+" -#define AXIS_X_DEC_TEXT_EN "X-" -#define AXIS_Y_ADD_TEXT_EN "Y+" -#define AXIS_Y_DEC_TEXT_EN "Y-" -#define AXIS_Z_ADD_TEXT_EN "Z+" -#define AXIS_Z_DEC_TEXT_EN "Z-" -#define TEXT_01MM_EN "0.1mm" -#define TEXT_1MM_EN "1mm" -#define TEXT_10MM_EN "10mm" - -#define HOME_X_TEXT_EN "X" -#define HOME_Y_TEXT_EN "Y" -#define HOME_Z_TEXT_EN "Z" -#define HOME_ALL_TEXT_EN "Home" -#define HOME_STOPMOVE_EN "Quickstop" - -#define PAGE_UP_TEXT_EN "Page up" -#define PAGE_DOWN_TEXT_EN "Page down" - -#define EXTRUDER_IN_TEXT_EN "In" -#define EXTRUDER_OUT_TEXT_EN "Out" -#define EXTRUDE_1MM_TEXT_EN "1mm" -#define EXTRUDE_5MM_TEXT_EN "5mm" -#define EXTRUDE_10MM_TEXT_EN "10mm" -#define EXTRUDE_LOW_SPEED_TEXT_EN "Low" -#define EXTRUDE_MEDIUM_SPEED_TEXT_EN "Normal" -#define EXTRUDE_HIGH_SPEED_TEXT_EN "High" - -#define LEVELING_POINT1_TEXT_EN "Point1" -#define LEVELING_POINT2_TEXT_EN "Point2" -#define LEVELING_POINT3_TEXT_EN "Point3" -#define LEVELING_POINT4_TEXT_EN "Point4" -#define LEVELING_POINT5_TEXT_EN "Point5" - -#define FILESYS_TEXT_EN "FileSys" -#define WIFI_TEXT_EN "WiFi" -#define FAN_TEXT_EN "Fan" -#define ABOUT_TEXT_EN "About" -#define BREAK_POINT_TEXT_EN "Continue" -#define FILAMENT_TEXT_EN "Filament" -#define LANGUAGE_TEXT_EN "Language" -#define MOTOR_OFF_TEXT_EN "Motor-off" -#define MOTOR_OFF_XY_TEXT_EN "Off-XY" -#define SHUTDOWN_TEXT_EN "Shutdown" - -#define U_DISK_TEXT_EN "USB" -#define SD_CARD_TEXT_EN "SD" -#define WIFI_NAME_TEXT_EN "WiFi: " -#define WIFI_KEY_TEXT_EN "Key: " -#define WIFI_IP_TEXT_EN "IP: " -#define WIFI_AP_TEXT_EN "State: AP" -#define WIFI_STA_TEXT_EN "State: STA" -#define WIFI_CONNECTED_TEXT_EN "Connected" -#define WIFI_DISCONNECTED_TEXT_EN "Disconnected" -#define WIFI_EXCEPTION_TEXT_EN "Exception" -#define WIFI_RECONNECT_TEXT_EN "Reconnect" -#define CLOUD_TEXT_EN "Cloud" -#define CLOUD_BIND_EN "Bind" -#define CLOUD_UNBIND_EN "Unbind" -#define CLOUD_UNBINDING_EN "Unbinding" -#define CLOUD_DISCONNECTED_EN "Disconnected" -#define CLOUD_UNBINDED_EN "Unbinded" -#define CLOUD_BINDED_EN "Binded" -#define CLOUD_DISABLE_EN "Disable" - -#define FAN_ADD_TEXT_EN "Add" -#define FAN_DEC_TEXT_EN "Dec" -#define FAN_OPEN_TEXT_EN "100%" -#define FAN_HALF_TEXT_EN "50%" -#define FAN_CLOSE_TEXT_EN "Close" -#define FAN_TIPS1_TEXT_EN "FAN" -#define FAN_TIPS2_TEXT_EN "FAN\nClose" - -#define FILAMENT_IN_TEXT_EN "Load" -#define FILAMENT_OUT_TEXT_EN "Unload" -#define FILAMENT_EXT0_TEXT_EN "Extrusion1" -#define FILAMENT_EXT1_TEXT_EN "Extrusion2" -#define FILAMENT_HEAT_TEXT_EN "Preheat" -#define FILAMENT_STOP_TEXT_EN "Stop" -//#define FILAMENT_CHANGE_TEXT_EN "Filament replace" -#define FILAMENT_TIPS2_TEXT_EN "T:" -#define FILAMENT_TIPS3_TEXT_EN "Loading..." -#define FILAMENT_TIPS4_TEXT_EN "Unloading..." -#define FILAMENT_TIPS5_TEXT_EN "Temp is too low to go,please heat" -#define FILAMENT_TIPS6_TEXT_EN "Completed" - -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_EN "Please click or \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_EN "Please click or ,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN "Heat completed,please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_EN "Please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN "Heat completed,please click for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_EN "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_EN "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN "Load filament completed,click for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN "Unload filament completed,click for return!" -#endif - - - #define FILAMENT_CHANGE_TEXT_EN "Please click \nor ,After \npinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN "Heat completed,please load filament \nto extruder,and click \nfor start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_EN "Please load filament to extruder,\nand click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN "Heat completed,please \nclick for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_EN "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_EN "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN "Load filament completed,\nclick for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN "Unload filament completed,\nclick for return!" - - -#define PRE_HEAT_EXT_TEXT_EN "E" -#define PRE_HEAT_BED_TEXT_EN "Bed" - -#define FILE_LOADING_EN "Loading......" -#if 0 -#define NO_FILE_AND_CHECK_EN "No files found!Please insert SD card or U disk!" -#endif -#define NO_FILE_AND_CHECK_EN " No files found!\n Check the file system configuration!" - -#define NO_FILE_EN "No files found!" - -#define EXTRUDER_TEMP_TEXT_EN "Temper" -#define EXTRUDER_E_LENGTH1_TEXT_EN "Extrusion1" -#define EXTRUDER_E_LENGTH2_TEXT_EN "Extrusion2" -#define EXTRUDER_E_LENGTH3_TEXT_EN "Extrusion3" - -#define ABOUT_TYPE_TEXT_EN "Type: " -#define ABOUT_VERSION_TEXT_EN "Firmware: " -#define ABOUT_WIFI_TEXT_EN "WiFi: " - -#define PRINTING_OPERATION_EN "Option" -#define PRINTING_PAUSE_EN "Pause" -#define PRINTING_TEMP_EN "Temp." -#define PRINTING_CHANGESPEED_EN "Speed" -#define PRINTING_RESUME_EN "Resume" -#define PRINTING_STOP_EN "Stop" -#define PRINTING_MORE_EN "More" -#define PRINTING_EXTRUDER_EN "Extrusion" -#define PRINTING_MOVE_EN "Move" - -#define EXTRUDER_SPEED_EN "Extrusion" -#define MOVE_SPEED_EN "Move" -#define EXTRUDER_SPEED_STATE_EN "Extrude Speed" -#define MOVE_SPEED_STATE_EN "Move Speed" -#define STEP_1PERCENT_EN "1%" -#define STEP_5PERCENT_EN "5%" -#define STEP_10PERCENT_EN "10%" - -#define ZOFFSET_EN "Z Offset" -#define ZOFFSET_INC_EN "Add" -#define ZOFFSET_DEC_EN "Dec" - -#define TITLE_READYPRINT_EN "ReadyPrint" -#define TITLE_PREHEAT_EN "Preheat" -#define TITLE_MOVE_EN "Move" -#define TITLE_HOME_EN "Home" -#define TITLE_EXTRUDE_EN "Extrusion" -#define TITLE_LEVELING_EN "Leveling" -#define TITLE_SET_EN "Settings" -#define TITLE_MORE_EN "More" -#define TITLE_CHOOSEFILE_EN "ChooseFile" -#define TITLE_PRINTING_EN "Printing" -#define TITLE_OPERATION_EN "Operation" -#define TITLE_ADJUST_EN "Adjust" -#define TITLE_WIRELESS_EN "Wireless" -#define TITLE_FILAMENT_EN "Filament" -#define TITLE_ABOUT_EN "About" -#define TITLE_FAN_EN "Fan" -#define TITLE_LANGUAGE_EN "Language" -#define TITLE_PAUSE_EN "Pause" -#define TITLE_CHANGESPEED_EN "Speed" -#define TITLE_CLOUD_TEXT_EN "Cloud" -#define TITLE_DIALOG_CONFIRM_EN "Confirm" -#define TITLE_FILESYS_EN "FileSys" -#define TITLE_ZOFFSET_EN "Z Offset" - -#define AUTO_SHUTDOWN_EN "Auto" -#define MANUAL_SHUTDOWN_EN "Manual" - -#define DIALOG_CONFIRM_EN "Confirm" -#define DIALOG_CANCLE_EN "Cancel" -#define DIALOG_OK_EN "OK" -#define DIALOG_RESET_EN "Reset" -#define DIALOG_RETRY_EN "Retry" -#define DIALOG_DISABLE_EN "Disable" -#define DIALOG_PRINT_MODEL_EN "Print this model?" -#define DIALOG_CANCEL_PRINT_EN "Stop print?" -#define DIALOG_RETRY_EN "Retry" -#define DIALOG_STOP_EN "Stop" -#define DIALOG_REPRINT_FROM_BREAKPOINT_EN "Reprint from breakpoint?" -//#define DIALOG_UNBIND_PRINTER_EN "Unbind the printer?" -#define DIALOG_ERROR_TIPS1_EN "Error:no file,please check it again." -#define DIALOG_ERROR_TIPS2_EN "Error:transaction failed.please check display baudrate \nwhether as the same as mainboard!" -#define DIALOG_ERROR_TIPS3_EN "Error:file name or path is too long!" -#define DIALOG_CLOSE_MACHINE_EN "Closing machine......" -#define DIALOG_UNBIND_PRINTER_EN "Unbind the printer?" -#define DIALOG_FILAMENT_NO_PRESS_EN "Filament detection switch is not pressed" -#define DIALOG_PRINT_FINISH_EN "Done print!" -#define DIALOG_PRINT_TIME_EN "Print time: " -#define DIALOG_REPRINT_EN "Print again" -#define DIALOG_WIFI_ENABLE_TIPS_EN "The wifi module is being configured\nplease wait a moment....." - -#define HOTBED_ENABLE_EN "Enable heatbed" -#define MOTOR_EN_HIGH_LEVEL_EN "High" -#define MOTOR_EN_LOW_LEVEL_EN "Low" - -#define TEXT_WIFI_MENU_TITLE_EN "WI-FI" -#define TEXT_WIFI_SAPCE_EN "space" -#define TEXT_WIFI_LETTER_EN "abc" -#define TEXT_WIFI_DIGITAL_EN "123" -#define TEXT_WIFI_SYMBOL_EN "#+=" -#define TEXT_WIFI_PASSWORD_EN "Password" - -#define TEXT_WIFI_POINT_BOLD_EN "`" - -#define TEXT_WIFI_JOINING_EN "Joining\nNetwork..." -#define TEXT_WIFI_FAILED_JOIN_EN "Failed to\nJoin Wi-Fi" -#define TEXT_WIFI_WIFI_CONECTED_EN "Wi-Fi\nConnected" - -#define TEXT_BUTTON_DISCONECTED_EN "Disconnect" -#define TEXT_WIFI_FORGET_EN "Forget Network" -#define TEXT_DISCONECTED_EN "Wi-Fi Connected" - -//wifi-list -#define MAIN_BUILT_EN "Build" -#define MAIN_FILAMENT_EN "Filament" -#define MAIN_SETUP_EN "Setup" -#define MAIN_ABOUT_EN "About" -#define MAIN_MENU_EN "Menu" -#define FILE_MENU_BUILD_EN "Build" -#define FILE_MENU_MENU_EN " < Menu" - -//about -#define ABOUT_TITLE_EN "About" -#define ABOUT_BUILT_MACHINES_EN "Built Machines" -#define ABOUT_SPARK_EN "Spark" -#define ABOUT_VERSION_EN "Version 1.1.0" -#define ABOUT_SERIAL_NUMBER_EN "Serial Number:" -#define ABOUT_S_NUMBER_EN "DCPLX02KFC6P" - -//set -#define SETUP_TITLE_EN "Setup" -#define SETUP_WIFI_EN "Wi-Fi" -#define SETUP_MANUAL_IP_EN "Manual IP" -#define SETUP_WIFI_NOT_CONNECTED_EN "Not Connected" -#define SETUP_WIFI_NETWORK_EN "WiFi_Network" - -//build -#define BUILD_TITLE_EN "Build" -#define BUILD_SD_CARD_EN "SD Card" -#define BUILD_USB_DRIVE_EN "USB Drive" - -//SD card -#define SD_CARD_TITLE_EN "SD Card" -#define SD_CARD_BACK_EN "< Back" -//USB Drive -#define USB_DRIVE_TITLE_EN "USB Drive" -#define USB_DRIVE_BACK_EN "< Back" -#define FILE_PAGES_EN "%d/%d" -#define FILE_NEXT_PAGE_EN "Next Page" - -//BUILD PLATE -#define PLATE_TITLE_EN "Build Plate" -#define PLATE_BACK_EN "< Back" -#define PLATE_CONFIRM_EN "Confirm >" -#define PLATE_TIPS_EN "Confirm that there is a Clear\nBuild Plate installed in the\nmachine." - -//build model -#define MODEL_TITLE_EN "Build Model" -#define MODEL_START_BUILD_EN "Start Build" -#define MODEL_BACK_EN "< Back" - -//building -#define BUILDING_TITLE_EN "Building" -#define BUILDING_MENU_EN "Build Menu" -#define BUILDING_COMPLETED "Build\nComplete" - -//building menu -#define BUILDING_MENU_TITLE_EN "Build Menu" -#define BUILDING_MENU_SETTINGS_EN "Build Settings" -#define BUILDING_MENU_PAUSE_EN "Pause Build" -#define BUILDING_MENU_CANCEL_EN "Cancel Build" -#define BUILDING_MENU_BACK_EN "< Back" - -//build settings -#define SETTINGS_TITLE_EN "Build Settings" -#define SETTINGS_NOZZLE_TEMPER_EN "Nozzle Temp:" -#define SETTINGS_NOZZLE_VALUE_EN "%d" -#define SETTINGS_BED_TEMPER_EN "Bed Temp:" -#define SETTINGS_BED_VALUE_EN "%d" -#define SETTINGS_BUILD_SPEED_EN "Build Speed:" -#define SETTINGS_SPEED_VALUE_EN "Standard" -#define SETTINGS_BACK_EN "< Back" - -//build paused -#define PAUSED_TITLE_EN "Build Paused" -#define PAUSED_RESUME_EN "Resume Build" -#define PAUSED_CANCEL_EN "Cancel Build" -#define PAUSED_BACK_EN "< Back" - -//build cancel -#define CANCEL_TITLE_EN "Cancel Build" -#define CANCEL_BUILD_EN "Cancel Build" -#define CANCEL_TIPS_EN "Are you sure you want to\ncancel this build? The model\nwill be deleted from this\nmachine. It will need to be\nresent from your computer\nbefore it can be built in the\nfuture." -#define CANCEL_BACK_EN "< Back" -#define CANCEL_BUILD_DISPLAY_EN "Build\nCanceled" -#define CANCEL_OVER_PLATE_TIPS_EN "Confirm that the Build Plate\nhas been removed from the\nmachine." - -//filament model enter -#define FILAMENT_MODEL_ENTER_TITLE_EN "Model-PLA" -#define FILAMENT_MODEL_ENTER_BACK_EN "< Back" -#define FILAMENT_MODEL_ENTER_BEGIN_EN "Begin >" -#define FILAMENT_MODEL_ENTER_TIPS_EN "The Model Filament spool\ncompartment is located on\nthe right side of the machine." - -//filament model PLA -#define FILAMENT_MODEL_PLA_TITLE_EN "Model-PLA" -#define FILAMENT_PLA_LOAD_TITLE_EN "Load Filament" -#define FILAMENT_PLA_UNLOAD_TITLE_EN "Unload Filament" -#define FILAMENT_MODEL_PLA_LOAD_EN "Load Filament" -#define FILAMENT_MODEL_PLA_UNLOAD_EN "Unload Filament" -//filament support enter -#define FILAMENT_SUPPORT_ENTER_TITLE_EN "Support-PVA" -#define FILAMENT_SUPPORT_ENTER_BACK_EN "< Back" -#define FILAMENT_SUPPORT_ENTER_BEGIN_EN "Begin >" -#define FILAMENT_SUPPORT_ENTER_TIPS_EN "The Support Filament spool\ncompartment is located on\nthe left side of the machine." -//filament heating -#define FILAMENT_HEATING_LOAD_TITLE_EN "Load Filament" -#define FILAMENT_HEATING_UNLOAD_TITLE_EN "Unload Filament" -#define FILAMENT_HEATING_CANCEL_EN "< Cancel" -#define FILAMENT_HEATING_MATERIAL_EN "Material:" -#define FILAMENT_HEATING_PLA_EN "Model-PLA" -#define FILAMENT_HEATING_TIPS_EN "Print head is heating..." -//rotate left -#define ROTATE_LEFT_LOAD_TITLE_EN "Load Filament" -#define ROTATE_LEFT_UNLOAD_TITLE_EN "Unload Filament" -#define ROTATE_LEFT_CANCEL_EN "< Cancel" -#define ROTATE_LEFT_MATERIAL_EN "Material:" -#define ROTATE_LEFT_PLA_EN "Model-PLA" -#define ROTATE_LEFT_NEXT_EN "Next >" -#define ROTATE_LEFT_TIPS_EN "Rotate extruder selection\ndial to the left." - -//hang spool -#define HANG_SPOOL_TITLE_EN "Load Filament" -#define HANG_SPOOL_PREVIOUS_EN "< Previous" -#define HANG_SPOOL_MATERIAL_EN "Material:" -#define HANG_SPOOL_PLA_EN "Model-PLA" -#define HANG_SPOOL_NEXT_EN "Next >" -#define HANG_SPOOL_TIPS_EN "Hang the spool in the spool\ncompartment as shown." - -//feed filament -#define FEED_FILAMENT_TITLE_EN "Load Filament" -#define FEED_FILAMENT_PREVIOUS_EN "< Previous" -#define FEED_FILAMENT_MATERIAL_EN "Material:" -#define FEED_FILAMENT_PLA_EN "Model-PLA" -#define FEED_FILAMENT_NEXT_EN "Next >" -#define FEED_FILAMENT_TIPS_EN "Feed filament into extruder\nup beyond the gears." - -//feed filament -#define ROTATE_UP_TITLE_EN "Load Filament" -#define ROTATE_UP_PREVIOUS_EN "< Previous" -#define ROTATE_UP_MATERIAL_EN "Material:" -#define ROTATE_UP_PLA_EN "Model-PLA" -#define ROTATE_UP_NEXT_EN "Next >" -#define ROTATE_UP_TIPS_EN "Rotate extruder selection\ndial up." - -//filament begin -#define FEED_BEGIN_TITLE_EN "Load Filament" -#define FEED_BEGIN_MATERIAL_EN "Material:" -#define FEED_BEGIN_PLA_EN "Model-PLA" -#define FEED_BEGIN_NEXT_EN "Next >" -#define FEED_BEGIN_TIPS_EN "Press Next when filament\nbegins to extrude." - -//filament finish -#define FEED_FINISH_TITLE_EN "Load Filament" -#define FEED_FINISH_MATERIAL_EN "Material:" -#define FEED_FINISH_PLA_EN "Model-PLA" -#define FEED_FINISH_NEXT_EN "Finish >" -#define FEED_FINISH_TIPS_EN "Remove filament from the\nnozzle and discard." -//fiament remove -#define REMOVE_SPOOL_TITLE_EN "Unload Filament" -#define REMOVE_SPOOL_PREVIOUS_EN "< Previous" -#define REMOVE_SPOOL_FINISH_EN "Finish >" -#define REMOVE_SPOOL_MATERIAL_EN "Material:" -#define REMOVE_SPOOL_PLA_EN "Model-PLA" -#define REMOVE_SPOOL_TIPS_EN "Remove the spool and pull\nfilament out of the machine." - -#define FILAMENT_SUPPORT_PVA_EN "Support-PVA" -#define LOAD_FINISH_EN "Load\nFilament\nComplete" -#define UNLOAD_FINISH_EN "Unload\nFilament\nComplete" - -//manual ip -#define MANUAL_IP_TITLE_EN "Manual IP" -#define MANUAL_IP_CANCEL_EN "< Cancel" -#define MANUAL_IP_APPLY_EN "Join >" -#define MANUAL_IP_ADDRESS_EN "IP Address" -#define MANUAL_IP_MASK_EN "Subnet Mask" -#define MANUAL_IP_GATEWAY_EN "Default Gateway" -#define MANUAL_IP_SERVER_EN "Name Server" -#define MANUAL_IP_INIT_DATA_EN "0.0.0.0" -#define MANUAL_TEXT_POINT_EN "." -#define MANUAL_TEXT_ENTER_EN "enter" - -//Wifi name -//#define TEXT_WIFI_MENU_TITLE_EN "WI-FI" -//#define TEXT_WIFI_SAPCE_EN "space" -//#define TEXT_WIFI_LETTER_EN "abc" -//#define TEXT_WIFI_DIGITAL_EN "123" -//#define TEXT_WIFI_SYMBOL_EN "#+=" -//#define TEXT_WIFI_PASSWORD_EN "Password" - -//#define TEXT_WIFI_POINT_BOLD_EN "`" - -//#define TEXT_WIFI_JOINING_EN "Joining\nNetwork..." -//#define TEXT_WIFI_FAILED_JOIN_EN "Failed to\nJoin Wi-Fi" -//#define TEXT_WIFI_WIFI_CONECTED_EN "Wi-Fi\nConnected" - -//#define TEXT_BUTTON_DISCONECTED_EN "Disconnect" -//#define TEXT_WIFI_FORGET_EN "Forget Network" -//#define TEXT_DISCONECTED_EN "Wi-Fi Connected" - -#define TEXT_FORGET_TIPS_TITLE_EN "Forget Network" -#define TEXT_FORGET_NETWORK_TIPS1_EN "Are you sure you want to\nforget this network?" -#define TEXT_FORGET_NETWORK_TIPS2_EN "This machine will no longer\njoin this Wi-Fi Network." - -#define TEXT_IPADDRESS_EN "IP Address: " - -#define TEXT_BUILD_FROM_CURA_CANCEL_TIPS1_EN "Are you sure you want to\ncancel this build?" -#define TEXT_BUILD_FROM_CURA_CANCEL_TIPS2_EN "The model will be deleted\nfrom this machine.It will\nneed to be resent from your\ncomputer before it can be\nbuilt in the future." - -#define DIALOG_CONFIRM_EN2 "Confirm" - -#define HEATING_TITLE_EN "Heating" -#define LEVELING_TITLE_EN "Leveling" - -#define ABOUT_SPARK_ADD_EN "Spark+" - -#define TEXT_RECEIVING_DATA_EN "Receiving Data" - -#define TEXT_BABY_STEP_EN "Babystep" - -#define PRINTING_OTHER_LANGUGE "Printing" -#define PRINTING_OPERATION_OTHER_LANGUGE "Operation" -#define PRINTING_PAUSE_OTHER_LANGUGE "Pause" - -#define MESSEGE_PAUSING_EN "Parking..." -#define MESSEGE_CHANGING_EN "Wait for filament change to start" -#define MESSEGE_UNLOAD_EN "Wait for filament unload" -#define MESSEGE_WAITING_EN "Press Button to resume print" -#define MESSEGE_INSERT_EN "Insert filament and press button to continue" -#define MESSEGE_LOAD_EN "Wait for filament load" -#define MESSEGE_PURGE_EN "Wait for filament purge" -#define MESSEGE_RESUME_EN "Wait for print to resume..." -#define MESSEGE_HEAT_EN "Press button to heat nozzle" -#define MESSEGE_HEATING_EN "Nozzle heating Please wait..." -#define MESSEGE_OPTION_EN "Purge more or continue print?" -#define MESSEGE_PURGE_MORE_EN "Purge" -#define MESSEGE_CONTINUE_PRINT_EN "Print" - -#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_fr.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_fr.h deleted file mode 100644 index 9a82f663b4ea..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_fr.h +++ /dev/null @@ -1,256 +0,0 @@ -#ifndef _TFT_LANGUAGE_FR_H -#define _TFT_LANGUAGE_FR_H -//*************法文****************************// -#define TOOL_TEXT_FR "prêt" -#define PREHEAT_TEXT_FR "Préchauffe" -#define MOVE_TEXT_FR "Déplace" -#define HOME_TEXT_FR "Acceuil" -#define PRINT_TEXT_FR "Impression" -#define EXTRUDE_TEXT_FR "Extruder" -#define LEVELING_TEXT_FR "Leveling" -#define AUTO_LEVELING_TEXT_FR "AutoLevel" -#define SET_TEXT_FR "Config" -#define MORE_TEXT_FR "Plus" - -#define ADD_TEXT_FR "Ajouter" -#define DEC_TEXT_FR "Réduire" -#define EXTRUDER_1_TEXT_FR "Extr1" -#define EXTRUDER_2_TEXT_FR "Extr2" -#define HEATBED_TEXT_FR "Hotlit" -#define TEXT_1C_FR "1℃" -#define TEXT_5C_FR "5℃" -#define TEXT_10C_FR "10℃" -#define CLOSE_TEXT_FR "Off" - -#define BACK_TEXT_FR "Arrière" - -#define TOOL_PREHEAT_FR "Préchauffe" -#define TOOL_EXTRUDE_FR "Extruder" -#define TOOL_MOVE_FR "Déplace" -#define TOOL_HOME_FR "Acceuil" -#define TOOL_LEVELING_FR "Leveling" -#define TOOL_AUTO_LEVELING_FR "AutoLevel" -#define TOOL_FILAMENT_FR "Filament" -#define TOOL_MORE_FR "Plus" - -#define AXIS_X_ADD_TEXT_FR "X+" -#define AXIS_X_DEC_TEXT_FR "X-" -#define AXIS_Y_ADD_TEXT_FR "Y+" -#define AXIS_Y_DEC_TEXT_FR "Y-" -#define AXIS_Z_ADD_TEXT_FR "Z+" -#define AXIS_Z_DEC_TEXT_FR "Z-" -#define TEXT_01MM_FR "0.1mm" -#define TEXT_1MM_FR "1mm" -#define TEXT_10MM_FR "10mm" - -#define HOME_X_TEXT_FR "X" -#define HOME_Y_TEXT_FR "Y" -#define HOME_Z_TEXT_FR "Z" -#define HOME_ALL_TEXT_FR "ALL" -#define HOME_STOPMOVE_FR "Quickstop" - -#define PAGE_UP_TEXT_FR "En haut" -#define PAGE_DOWN_TEXT_FR "En bas" - -#define EXTRUDER_IN_TEXT_FR "Insérer" -#define EXTRUDER_OUT_TEXT_FR "éjecter" -#define EXTRUDE_1MM_TEXT_FR "1mm" -#define EXTRUDE_5MM_TEXT_FR "5mm" -#define EXTRUDE_10MM_TEXT_FR "10mm" -#define EXTRUDE_LOW_SPEED_TEXT_FR "Lente" -#define EXTRUDE_MEDIUM_SPEED_TEXT_FR "Moyen" -#define EXTRUDE_HIGH_SPEED_TEXT_FR "Rapide" - -#define LEVELING_POINT1_TEXT_FR "Premier" -#define LEVELING_POINT2_TEXT_FR "Seconde" -#define LEVELING_POINT3_TEXT_FR "Troisième" -#define LEVELING_POINT4_TEXT_FR "Quatrième" -#define LEVELING_POINT5_TEXT_FR "Cinquième" - -#define FILESYS_TEXT_FR "Fichier" -#define WIFI_TEXT_FR "WiFi" -#define FAN_TEXT_FR "Fan" -#define ABOUT_TEXT_FR "A propos" -#define BREAK_POINT_TEXT_FR "Continuer" -#define FILAMENT_TEXT_FR "Remplacer" -#define LANGUAGE_TEXT_FR "Langue" -#define MOTOR_OFF_TEXT_FR "M-hors" -#define MOTOR_OFF_XY_TEXT_FR "M-hors-XY" -#define SHUTDOWN_TEXT_FR "Eteindre" - -#define U_DISK_TEXT_FR "Clé usb" -#define SD_CARD_TEXT_FR "Carte SD" -#define WIFI_NAME_TEXT_FR "WiFi: " -#define WIFI_KEY_TEXT_FR "Key: " -#define WIFI_IP_TEXT_FR "IP: " -#define WIFI_AP_TEXT_FR "Etat: AP" -#define WIFI_STA_TEXT_FR "Etat: STA" -#define WIFI_CONNECTED_TEXT_FR "Connecté" -#define WIFI_DISCONNECTED_TEXT_FR "Déconnecté" -#define WIFI_EXCEPTION_TEXT_FR "Exception" -#define WIFI_RECONNECT_TEXT_FR "Reconnect" -#define CLOUD_TEXT_FR "Cloud" -#define CLOUD_BIND_FR "Lié" -#define CLOUD_UNBIND_FR "Délier" -#define CLOUD_UNBINDING_FR "Délier" -#define CLOUD_DISCONNECTED_FR "Déconnecté" -#define CLOUD_UNBINDED_FR "Délier" -#define CLOUD_BINDED_FR "Lié" -#define CLOUD_DISABLE_FR "Désactiver" - -#define FAN_ADD_TEXT_FR "Ajouter" -#define FAN_DEC_TEXT_FR "Réduire" -#define FAN_OPEN_TEXT_FR "100%" -#define FAN_HALF_TEXT_FR "50%" -#define FAN_CLOSE_TEXT_FR "0%" -#define FAN_TIPS1_TEXT_FR "ventilateur" -#define FAN_TIPS2_TEXT_FR "ventilateur\n0" - -#define FILAMENT_IN_TEXT_FR "Insérer" -#define FILAMENT_OUT_TEXT_FR "éjecter" -#define FILAMENT_EXT0_TEXT_FR "Extr1" -#define FILAMENT_EXT1_TEXT_FR "Extr2" -#define FILAMENT_HEAT_TEXT_FR "Preheat" -#define FILAMENT_STOP_TEXT_FR "Arrêter" -//#define FILAMENT_CHANGE_TEXT_FR "Filament remplacer" -#define FILAMENT_TIPS2_TEXT_FR "T:" -#define FILAMENT_TIPS3_TEXT_FR "Insérer le filament..." -#define FILAMENT_TIPS4_TEXT_FR "éjecter le filament..." -#define FILAMENT_TIPS5_TEXT_FR "Température trop basse pour démarrer, chauffez svp" -#define FILAMENT_TIPS6_TEXT_FR "Terminé" - -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_FR "Please click or <éjecter> \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_FR "Please click or <éjecter>,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR "Heat completed,please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR "Please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR "Heat completed,please click for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_FR "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_FR "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Load filament completed,click for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Unload filament completed,click for return!" -#endif - #define FILAMENT_CHANGE_TEXT_FR "Please click \nor ,After \npinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR "Heat completed,please load filament \nto extruder,and click \nfor start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR "Please load filament to extruder,\nand click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR "Heat completed,please \nclick for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_FR "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_FR "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Load filament completed,\nclick for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Unload filament completed,\nclick for return!" - - -#define PRE_HEAT_EXT_TEXT_FR "E" -#define PRE_HEAT_BED_TEXT_FR "Bed" - -#define FILE_LOADING_FR "Chargement......" -#if 0 -#define NO_FILE_AND_CHECK_FR "Aucun fichier trouvé! Insérez une carte SD ou un disque U!" -#endif -#define NO_FILE_AND_CHECK_FR "Aucun fichier,vérifiez à nouveau!" - -#define NO_FILE_FR "Pas de fichier!" - - - -#define EXTRUDER_TEMP_TEXT_FR "Temper" -#define EXTRUDER_E_LENGTH1_TEXT_FR "Extruder1" -#define EXTRUDER_E_LENGTH2_TEXT_FR "Extruder2" -#define EXTRUDER_E_LENGTH3_TEXT_FR "Extruder3" - -#define ABOUT_TYPE_TEXT_FR "Type: " -#define ABOUT_VERSION_TEXT_FR "Firmware: " -#define ABOUT_WIFI_TEXT_FR "Wifi: " - -#define PRINTING_OPERATION_FR "Option" -#define PRINTING_PAUSE_FR "Pause" -#define PRINTING_TEMP_FR "Temp." -#define PRINTING_CHANGESPEED_FR "Speed" -#define PRINTING_RESUME_FR "Reprendre" -#define PRINTING_STOP_FR "Stop" -#define PRINTING_MORE_FR "Plus" -#define PRINTING_EXTRUDER_FR "Extruder" -#define PRINTING_MOVE_FR "Déplace" - -#define EXTRUDER_SPEED_FR "Extruder" -#define MOVE_SPEED_FR "Déplace" -#define EXTRUDER_SPEED_STATE_FR "Vitesse d'extrusion" -#define MOVE_SPEED_STATE_FR "vitesse de déplacement" -#define STEP_1PERCENT_FR "1%" -#define STEP_5PERCENT_FR "5%" -#define STEP_10PERCENT_FR "10%" - -#define ZOFFSET_FR "Z Offset" -#define ZOFFSET_INC_FR "Ajouter" -#define ZOFFSET_DEC_FR "Réduire" - -#define TITLE_READYPRINT_FR "Prête" -#define TITLE_PREHEAT_FR "Préchauffe" -#define TITLE_MOVE_FR "Déplace" -#define TITLE_HOME_FR "Acceuil" -#define TITLE_EXTRUDE_FR "Extruder" -#define TITLE_LEVELING_FR "Leveling" -#define TITLE_SET_FR "Paramètres" -#define TITLE_MORE_FR "Plus" -#define TITLE_CHOOSEFILE_FR "Fichier" -#define TITLE_PRINTING_FR "Pimpression" -#define TITLE_OPERATION_FR "Option" -#define TITLE_ADJUST_FR "Réglage" -#define TITLE_WIRELESS_FR "Sans fil" -#define TITLE_FILAMENT_FR "Remplacer" -#define TITLE_ABOUT_FR "A propos" -#define TITLE_FAN_FR "Ventilateur" -#define TITLE_LANGUAGE_FR "Langue" -#define TITLE_PAUSE_FR "Pause" -#define TITLE_CHANGESPEED_FR "Speed" -#define TITLE_CLOUD_TEXT_FR "Cloud" -#define TITLE_DIALOG_CONFIRM_FR "Confirm" -#define TITLE_FILESYS_FR "FileSys" -#define TITLE_ZOFFSET_FR "Z Offset" - -#define DIALOG_CLOSE_MACHINE_FR "Closing machine......" - -#define AUTO_SHUTDOWN_FR "Auto" -#define MANUAL_SHUTDOWN_FR "Manuel" - -#define DIALOG_CONFIRM_FR "Confirmer" -#define DIALOG_CANCLE_FR "Annuler" -#define DIALOG_OK_FR "OK" -#define DIALOG_RESET_FR "Réinitialiser" -#define DIALOG_RETRY_FR "Recommencez" -#define DIALOG_DISABLE_FR "Disable" -#define DIALOG_PRINT_MODEL_FR "Imprimer le fichier?" -#define DIALOG_CANCEL_PRINT_FR "Arrêter?" - -#define DIALOG_STOP_FR "Arrêter" -#define DIALOG_REPRINT_FROM_BREAKPOINT_FR "Continuer?" -//#define DIALOG_UNBIND_PRINTER_FR "Non lié?" -#define DIALOG_ERROR_TIPS1_FR "Erreur:error:Aucun fichier, \nvérifiez à nouveau." -#define DIALOG_ERROR_TIPS2_FR "Erreur:La opération a échoué. \nVerifiez que le baudrate de l'écran et de \nla carte mère soient identique!" -#define DIALOG_ERROR_TIPS3_FR "Erreur: le nom du fichier ou le \nchemin d'accès est trop long." -#define DIALOG_UNBIND_PRINTER_FR "Unbind the printer?" -#define DIALOG_FILAMENT_NO_PRESS_FR "Filament detection switch is not pressed" -#define DIALOG_PRINT_FINISH_FR "L'impression est terminée!" -#define DIALOG_PRINT_TIME_FR "Temps d'impression: " -#define DIALOG_REPRINT_FR "Print again" -#define DIALOG_WIFI_ENABLE_TIPS_FR "The wifi module is being configured,\nplease wait a moment....." - - -#define MESSEGE_PAUSING_FR "Parking..." -#define MESSEGE_CHANGING_FR "Attente filament pour démarrer" -#define MESSEGE_UNLOAD_FR "Attente retrait du filament" -#define MESSEGE_WAITING_FR "Presser bouton,pour reprendre" -#define MESSEGE_INSERT_FR "Insérer filament et app. bouton pour continuer..." -#define MESSEGE_LOAD_FR "Attente chargement filament" -#define MESSEGE_PURGE_FR "Attente Purge filament" -#define MESSEGE_RESUME_FR "Attente reprise impression" -#define MESSEGE_HEAT_FR "Presser le bouton pour chauffer..." -#define MESSEGE_HEATING_FR "Buse en chauffe Patienter SVP..." -#define MESSEGE_OPTION_FR "Purger davantage ou continuer l'impression?" -#define MESSEGE_PURGE_MORE_FR "Purge" -#define MESSEGE_CONTINUE_PRINT_FR "Impression" -#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_ru.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_ru.h deleted file mode 100644 index a83a06d6afb2..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_ru.h +++ /dev/null @@ -1,253 +0,0 @@ -#ifndef _TFT_LANGUAGE_RU_H -#define _TFT_LANGUAGE_RU_H -//****************俄语***************************// -#define TOOL_TEXT_RU "инструмент" -#define PREHEAT_TEXT_RU " нагрев" -#define MOVE_TEXT_RU "движение" -#define HOME_TEXT_RU "домой" -#define PRINT_TEXT_RU " печать" -#define EXTRUDE_TEXT_RU "экструзия" -#define LEVELING_TEXT_RU "уровень" -#define AUTO_LEVELING_TEXT_RU "aвто" -#define SET_TEXT_RU "настройки" -#define MORE_TEXT_RU "больше" - -#define ADD_TEXT_RU "добавить" -#define DEC_TEXT_RU "уменьшить" -#define EXTRUDER_1_TEXT_RU "экструдер1" -#define EXTRUDER_2_TEXT_RU "экструдер2" -#define HEATBED_TEXT_RU "стол" -#define TEXT_1C_RU "1℃" -#define TEXT_5C_RU "5℃" -#define TEXT_10C_RU "10℃" -#define CLOSE_TEXT_RU "выкл" - -#define BACK_TEXT_RU "назад" - -#define TOOL_PREHEAT_RU "нагрев" -#define TOOL_EXTRUDE_RU "экструзия" -#define TOOL_MOVE_RU "движение" -#define TOOL_HOME_RU "домой" -#define TOOL_LEVELING_RU "уровень" -#define TOOL_AUTO_LEVELING_RU "aвто" -#define TOOL_FILAMENT_RU "замена" -#define TOOL_MORE_RU "больше" - -#define AXIS_X_ADD_TEXT_RU "X+" -#define AXIS_X_DEC_TEXT_RU "X-" -#define AXIS_Y_ADD_TEXT_RU "Y+" -#define AXIS_Y_DEC_TEXT_RU "Y-" -#define AXIS_Z_ADD_TEXT_RU "Z+" -#define AXIS_Z_DEC_TEXT_RU "Z-" -#define TEXT_01MM_RU "0.1mm" -#define TEXT_1MM_RU "1mm" -#define TEXT_10MM_RU "10mm" - -#define HOME_X_TEXT_RU "X" -#define HOME_Y_TEXT_RU "Y" -#define HOME_Z_TEXT_RU "Z" -#define HOME_ALL_TEXT_RU "Home" -#define HOME_STOPMOVE_RU "Quickstop" - -#define PAGE_UP_TEXT_RU "вверх" -#define PAGE_DOWN_TEXT_RU "вниз" - -#define EXTRUDER_IN_TEXT_RU "втянуть" -#define EXTRUDER_OUT_TEXT_RU "выдавить" -#define EXTRUDE_1MM_TEXT_RU "1mm" -#define EXTRUDE_5MM_TEXT_RU "5mm" -#define EXTRUDE_10MM_TEXT_RU "10mm" -#define EXTRUDE_LOW_SPEED_TEXT_RU "мин" -#define EXTRUDE_MEDIUM_SPEED_TEXT_RU "сред" -#define EXTRUDE_HIGH_SPEED_TEXT_RU "выс" - -#define LEVELING_POINT1_TEXT_RU "1точка" -#define LEVELING_POINT2_TEXT_RU "2точка" -#define LEVELING_POINT3_TEXT_RU "3точка" -#define LEVELING_POINT4_TEXT_RU "4точка" -#define LEVELING_POINT5_TEXT_RU "5точка" - -#define FILESYS_TEXT_RU "система" -#define WIFI_TEXT_RU "WiFi" -#define FAN_TEXT_RU "вентилятор" -#define ABOUT_TEXT_RU "инфо" -#define BREAK_POINT_TEXT_RU "продолжить" -#define FILAMENT_TEXT_RU "замена" -#define LANGUAGE_TEXT_RU "язык" -#define MOTOR_OFF_TEXT_RU "отклмотор" -#define MOTOR_OFF_XY_TEXT_RU "Off-XY" -#define SHUTDOWN_TEXT_RU "выключение" - -#define U_DISK_TEXT_RU "U диск" -#define SD_CARD_TEXT_RU "SD диск" -#define WIFI_NAME_TEXT_RU "WiFi: " -#define WIFI_KEY_TEXT_RU "пароль: " -#define WIFI_IP_TEXT_RU "IP: " -#define WIFI_AP_TEXT_RU "режим: AP" -#define WIFI_STA_TEXT_RU "режим: STA" -#define WIFI_CONNECTED_TEXT_RU "подключен" -#define WIFI_DISCONNECTED_TEXT_RU "не подключен" -#define WIFI_EXCEPTION_TEXT_RU "исключение" -#define WIFI_RECONNECT_TEXT_RU "Reconnect" -#define CLOUD_TEXT_RU "облако" -#define CLOUD_BIND_RU "соединён" -#define CLOUD_UNBIND_RU "не соединён" -#define CLOUD_UNBINDING_RU "Unbinding" -#define CLOUD_DISCONNECTED_RU "Disconnected" -#define CLOUD_UNBINDED_RU "Unbinded" -#define CLOUD_BINDED_RU "Binded" -#define CLOUD_DISABLE_RU "Disable" - -#define FAN_ADD_TEXT_RU "добавить" -#define FAN_DEC_TEXT_RU "уменьшить" -#define FAN_OPEN_TEXT_RU "100%" -#define FAN_HALF_TEXT_RU "50%" -#define FAN_CLOSE_TEXT_RU "откл" -#define FAN_TIPS1_TEXT_RU "вентилятор" -#define FAN_TIPS2_TEXT_RU "вентилятор\nоткл" - -#define FILAMENT_IN_TEXT_RU "втянуть" -#define FILAMENT_OUT_TEXT_RU "выдавить" -#define FILAMENT_EXT0_TEXT_RU "экструдер1" -#define FILAMENT_EXT1_TEXT_RU "экструдер2" -#define FILAMENT_HEAT_TEXT_RU "нагрев" -#define FILAMENT_STOP_TEXT_RU "стоп" -//#define FILAMENT_CHANGE_TEXT_RU "замена" -#define FILAMENT_TIPS2_TEXT_RU "T:" -#define FILAMENT_TIPS3_TEXT_RU "втянуть..." -#define FILAMENT_TIPS4_TEXT_RU "вядавить..." -#define FILAMENT_TIPS5_TEXT_RU "Низкая температура, \nнеобходим нагрев" -#define FILAMENT_TIPS6_TEXT_RU "завершено" - -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_RU "Please click <втянуть> or <выдавить> \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_RU "Please click <втянуть> or <выдавить>,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU "Heat completed,please load filament to extruder,and click <да> for start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_RU "Please load filament to extruder,and click <да> for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU "Heat completed,please click <да> for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_RU "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_RU "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,click <да> for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,click <да> for return!" -#endif - #define FILAMENT_CHANGE_TEXT_RU "Please click \nor ,After \npinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU "Heat completed,please load filament \nto extruder,and click \nfor start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_RU "Please load filament to extruder,\nand click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU "Heat completed,please \nclick for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_RU "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_RU "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,\nclick for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,\nclick for return!" - - -#define PRE_HEAT_EXT_TEXT_RU "E" -#define PRE_HEAT_BED_TEXT_RU "стол" - -#define FILE_LOADING_RU "загрузка......" -#if 0 -#define NO_FILE_AND_CHECK_RU "Файлы не найдены! Вставьте SD-карту или диск U!" -#endif -#define NO_FILE_AND_CHECK_RU "нет файла,попробуйте ещё раз!" - -#define NO_FILE_RU "нет файла!" - -#define EXTRUDER_TEMP_TEXT_RU "температура" -#define EXTRUDER_E_LENGTH1_TEXT_RU "экструзия1" -#define EXTRUDER_E_LENGTH2_TEXT_RU "экструзия2" -#define EXTRUDER_E_LENGTH3_TEXT_RU "экструзия3" - -#define ABOUT_TYPE_TEXT_RU "Type: " -#define ABOUT_VERSION_TEXT_RU "Firmware: " -#define ABOUT_WIFI_TEXT_RU "WiFi: " - -#define PRINTING_OPERATION_RU "управление" -#define PRINTING_PAUSE_RU "пауза" -#define PRINTING_TEMP_RU "темп" -#define PRINTING_CHANGESPEED_RU "скорости" -#define PRINTING_RESUME_RU "возобновить" -#define PRINTING_STOP_RU "стоп" -#define PRINTING_MORE_RU "больше" -#define PRINTING_EXTRUDER_RU "экстр" -#define PRINTING_MOVE_RU "движение" - -#define EXTRUDER_SPEED_RU "экстр" -#define MOVE_SPEED_RU "движ" -#define EXTRUDER_SPEED_STATE_RU "скорость экстр" -#define MOVE_SPEED_STATE_RU "скорость движ" -#define STEP_1PERCENT_RU "1%" -#define STEP_5PERCENT_RU "5%" -#define STEP_10PERCENT_RU "10%" - -#define ZOFFSET_RU "Z Offset" -#define ZOFFSET_INC_RU "добавить" -#define ZOFFSET_DEC_RU "уменьшить" - -#define TITLE_READYPRINT_RU "готов к" -#define TITLE_PREHEAT_RU "движение" -#define TITLE_MOVE_RU "движение" -#define TITLE_HOME_RU "Home" -#define TITLE_EXTRUDE_RU "экструзия" -#define TITLE_LEVELING_RU "уровень" -#define TITLE_SET_RU "настройки" -#define TITLE_MORE_RU "больше" -#define TITLE_CHOOSEFILE_RU "файла" -#define TITLE_PRINTING_RU "печать" -#define TITLE_OPERATION_RU "управление" -#define TITLE_ADJUST_RU "регулировать" -#define TITLE_WIRELESS_RU "Wireless" -#define TITLE_FILAMENT_RU "замена" -#define TITLE_ABOUT_RU "инфо" -#define TITLE_FAN_RU "вентилятор" -#define TITLE_LANGUAGE_RU "язык" -#define TITLE_PAUSE_RU "пауза" -#define TITLE_CHANGESPEED_RU "скорости" -#define TILE_TOOL_RU "инструмент" -#define TITLE_CLOUD_TEXT_RU "Cloud" -#define TITLE_DIALOG_CONFIRM_RU "Confirm" -#define TITLE_FILESYS_RU "FileSys" -#define TITLE_ZOFFSET_RU "Z Offset" - -#define AUTO_SHUTDOWN_RU "авто-откл" -#define MANUAL_SHUTDOWN_RU "ручн-откл" - -#define DIALOG_CONFIRM_RU "да"//"подтвердить" -#define DIALOG_CANCLE_RU "отмена" -#define DIALOG_OK_RU "да" -#define DIALOG_RESET_RU "сброс" -#define DIALOG_RETRY_RU "повтор" -#define DIALOG_DISABLE_RU "запретить" -#define DIALOG_PRINT_MODEL_RU "печать модели?" -#define DIALOG_CANCEL_PRINT_RU "стоп?" -#define DIALOG_STOP_RU "стоп" -#define DIALOG_REPRINT_FROM_BREAKPOINT_RU "продолжить?" -//#define DIALOG_UNBIND_PRINTER_RU "разрыв?" -#define DIALOG_ERROR_TIPS1_RU "ошибка:нет файла, попробуйте ещё раз." -#define DIALOG_ERROR_TIPS2_RU "ошибка:сбой передачи. установите скорость \nпередачи данных как на плате управления!" -#define DIALOG_ERROR_TIPS3_RU "ошибка: имя файла слишком длинное!" -#define DIALOG_CLOSE_MACHINE_RU "Closing machine......" -#define DIALOG_UNBIND_PRINTER_RU "Unbind the printer?" -#define DIALOG_FILAMENT_NO_PRESS_RU "Filament detection switch is not pressed" -#define DIALOG_PRINT_FINISH_RU "Печать завершена!" -#define DIALOG_PRINT_TIME_RU "Время печати: " -#define DIALOG_REPRINT_RU "Print again" -#define DIALOG_WIFI_ENABLE_TIPS_RU "The wifi module is being configured,\nplease wait a moment....." - -#define MESSEGE_PAUSING_RU "Стоянка..." -#define MESSEGE_CHANGING_RU "Подождите, пока начнется смена филамента" -#define MESSEGE_UNLOAD_RU "Дождитесь выгрузки нити" -#define MESSEGE_WAITING_RU "Нажмите кнопку,чтобы возобновить печать" -#define MESSEGE_INSERT_RU "Вставьте нить и нажмите кнопку,чтобы продолжить" -#define MESSEGE_LOAD_RU "Дождитесь загрузки нити" -#define MESSEGE_PURGE_RU "Дождитесь чистки нити" -#define MESSEGE_RESUME_RU "Подождите,пока печать возобновится ..." -#define MESSEGE_HEAT_RU "Нажмите кнопку, чтобы нагреть форсунку" -#define MESSEGE_HEATING_RU "Подогрев форсунки Пожалуйста, подождите ..." -#define MESSEGE_OPTION_RU "Очистить больше или продолжить печать?" -#define MESSEGE_PURGE_MORE_RU "чистка" -#define MESSEGE_CONTINUE_PRINT_RU "Распечатать" - -#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_s_cn.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_s_cn.h deleted file mode 100644 index f0c333f77003..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_s_cn.h +++ /dev/null @@ -1,248 +0,0 @@ -#ifndef _TFT_LANGUAGE_S_CN_H -#define _TFT_LANGUAGE_S_CN_H -//*************简体中文***********************// -#define TOOL_TEXT_CN "工具" -#define PREHEAT_TEXT_CN "预热" -#define MOVE_TEXT_CN "移动" -#define HOME_TEXT_CN "回零" -#define PRINT_TEXT_CN "打印" -#define EXTRUDE_TEXT_CN "挤出" -#define LEVELING_TEXT_CN "调平" -#define AUTO_LEVELING_TEXT_CN "自动调平" -#define SET_TEXT_CN "设置" -#define MORE_TEXT_CN "更多" - -#define ADD_TEXT_CN "增加" -#define DEC_TEXT_CN "减少" -#define EXTRUDER_1_TEXT_CN "喷头1" -#define EXTRUDER_2_TEXT_CN "喷头2" -#define HEATBED_TEXT_CN "热床" -#define TEXT_1C_CN "1℃" -#define TEXT_5C_CN "5℃" -#define TEXT_10C_CN "10℃" -#define CLOSE_TEXT_CN "关闭" - -#define BACK_TEXT_CN "返回" - -#define TOOL_PREHEAT_CN "预热" -#define TOOL_EXTRUDE_CN "挤出" -#define TOOL_MOVE_CN "移动" -#define TOOL_HOME_CN "回零" -#define TOOL_LEVELING_CN "调平" -#define TOOL_AUTO_LEVELING_CN "自动调平" -#define TOOL_FILAMENT_CN "换料" -#define TOOL_MORE_CN "更多" - -#define AXIS_X_ADD_TEXT_CN "X+" -#define AXIS_X_DEC_TEXT_CN "X-" -#define AXIS_Y_ADD_TEXT_CN "Y+" -#define AXIS_Y_DEC_TEXT_CN "Y-" -#define AXIS_Z_ADD_TEXT_CN "Z+" -#define AXIS_Z_DEC_TEXT_CN "Z-" -#define TEXT_01MM_CN "0.1mm" -#define TEXT_1MM_CN "1mm" -#define TEXT_10MM_CN "10mm" - -#define HOME_X_TEXT_CN "X" -#define HOME_Y_TEXT_CN "Y" -#define HOME_Z_TEXT_CN "Z" -#define HOME_ALL_TEXT_CN "回零" -#define HOME_STOPMOVE_CN "急停" - -#define PAGE_UP_TEXT_CN "上一页" -#define PAGE_DOWN_TEXT_CN "下一页" - -#define EXTRUDER_IN_TEXT_CN "进料" -#define EXTRUDER_OUT_TEXT_CN "退料" -#define EXTRUDE_1MM_TEXT_CN "1mm" -#define EXTRUDE_5MM_TEXT_CN "5mm" -#define EXTRUDE_10MM_TEXT_CN "10mm" -#define EXTRUDE_LOW_SPEED_TEXT_CN "低速" -#define EXTRUDE_MEDIUM_SPEED_TEXT_CN "常速" -#define EXTRUDE_HIGH_SPEED_TEXT_CN "高速" - -#define LEVELING_POINT1_TEXT_CN "第一点" -#define LEVELING_POINT2_TEXT_CN "第二点" -#define LEVELING_POINT3_TEXT_CN "第三点" -#define LEVELING_POINT4_TEXT_CN "第四点" -#define LEVELING_POINT5_TEXT_CN "第五点" - -#define FILESYS_TEXT_CN "文件系统" -#define WIFI_TEXT_CN "WIFI" -#define FAN_TEXT_CN "风扇" -#define ABOUT_TEXT_CN "关于" -#define BREAK_POINT_TEXT_CN "断点续打" -#define FILAMENT_TEXT_CN "换料" -#define LANGUAGE_TEXT_CN "语言" -#define MOTOR_OFF_TEXT_CN "关闭电机" -#define MOTOR_OFF_XY_TEXT_CN "关闭XY" -#define SHUTDOWN_TEXT_CN "关机" - -#define U_DISK_TEXT_CN "U盘" -#define SD_CARD_TEXT_CN "SD卡" -#define WIFI_NAME_TEXT_CN "无线网络:" -#define WIFI_KEY_TEXT_CN "密码: " -#define WIFI_IP_TEXT_CN "IP: " -#define WIFI_AP_TEXT_CN "状态: AP" -#define WIFI_STA_TEXT_CN "状态: STA" -#define WIFI_CONNECTED_TEXT_CN "已连接" -#define WIFI_DISCONNECTED_TEXT_CN "未连接" -#define WIFI_EXCEPTION_TEXT_CN "模块异常" -#define CLOUD_TEXT_CN "云服务" -#define CLOUD_BIND_CN "已绑定" -#define CLOUD_UNBIND_CN "解绑" -#define CLOUD_UNBINDING_CN "解绑中" -#define CLOUD_DISCONNECTED_CN "未连接" -#define CLOUD_UNBINDED_CN "未绑定" -#define CLOUD_BINDED_CN "已绑定" -#define CLOUD_DISABLE_CN "已禁用" - -#define FAN_ADD_TEXT_CN "增加" -#define FAN_DEC_TEXT_CN "减少" -#define FAN_OPEN_TEXT_CN "100%" -#define FAN_HALF_TEXT_CN "50%" -#define FAN_CLOSE_TEXT_CN "关闭" -#define FAN_TIPS1_TEXT_CN "风扇" -#define FAN_TIPS2_TEXT_CN "FAN\nClose" - -#define FILAMENT_IN_TEXT_CN "进料" -#define FILAMENT_OUT_TEXT_CN "退料" -#define FILAMENT_EXT0_TEXT_CN "喷头1" -#define FILAMENT_EXT1_TEXT_CN "喷头2" -#define FILAMENT_HEAT_TEXT_CN "预热" -#define FILAMENT_STOP_TEXT_CN "停止" -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_CN "请按<进料>或<退料>进行换料!" - #define FILAMENT_CHANGE_TEXT_CN "待打印机暂停后,请按<进料>或<退料>进行换料!" - -#endif - - - #define FILAMENT_CHANGE_TEXT_CN "待打印机暂停后,\n请按<进料>或<退料>" - - -#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_CN "准备进料,正在加热,请稍等!" -#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_CN "准备退料,正在加热,请稍等!" -#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_CN "加热完成,请装载耗材后,按<确定>开始进料!" -#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_CN "请装载耗材,按<确定>开始进料!" -#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_CN "加热完成,请按<确定>开始退料!" -#define FILAMENT_DIALOG_LOADING_TIPS_CN "正在进料,请等待耗材加载完成!" -#define FILAMENT_DIALOG_UNLOADING_TIPS_CN "正在退料,请等待耗材卸载完成!" -#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_CN "进料完成,请按<确定>返回" -#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_CN "退料完成,请按<确定>返回" - -#define FILAMENT_TIPS3_TEXT_CN "正在进料" -#define FILAMENT_TIPS4_TEXT_CN "正在退料" -#define FILAMENT_TIPS5_TEXT_CN "温度太低,请先预热" -#define FILAMENT_TIPS6_TEXT_CN "换料完成" - -#define PRE_HEAT_EXT_TEXT_CN "喷头" -#define PRE_HEAT_BED_TEXT_CN "热床" - -#define FILE_LOADING_CN "正在载入......" -#define NO_FILE_AND_CHECK_CN "无文件!请插入sd卡或u盘!" -#define NO_FILE_CN "无文件!" - -#define EXTRUDER_TEMP_TEXT_CN "温度" -#define EXTRUDER_E_LENGTH1_TEXT_CN "喷头" -#define EXTRUDER_E_LENGTH2_TEXT_CN "喷头" -#define EXTRUDER_E_LENGTH3_TEXT_CN "喷头" - -#define ABOUT_TYPE_TEXT_CN "Type: " -#define ABOUT_VERSION_TEXT_CN "Firmware: " -#define ABOUT_WIFI_TEXT_CN "Wifi: " - -#define PRINTING_OPERATION_CN "操作" -#define PRINTING_PAUSE_CN "暂停" -#define PRINTING_TEMP_CN "温度" -#define PRINTING_CHANGESPEED_CN "变速" -#define PRINTING_RESUME_CN "恢复" -#define PRINTING_STOP_CN "停止" -#define PRINTING_MORE_CN "更多" -#define PRINTING_EXTRUDER_CN "挤出" -#define PRINTING_MOVE_CN "移动" - -#define EXTRUDER_SPEED_CN "挤出" -#define MOVE_SPEED_CN "移动" -#define EXTRUDER_SPEED_STATE_CN "挤出速度" -#define MOVE_SPEED_STATE_CN "移动速度" -#define STEP_1PERCENT_CN "1%" -#define STEP_5PERCENT_CN "5%" -#define STEP_10PERCENT_CN "10%" - -#define ZOFFSET_CN "Z Offset" -#define ZOFFSET_INC_CN "增加" -#define ZOFFSET_DEC_CN "减少" - -#define TITLE_READYPRINT_CN "准备打印" -#define TITLE_PREHEAT_CN "预热" -#define TITLE_MOVE_CN "移动" -#define TITLE_HOME_CN "回零" -#define TITLE_EXTRUDE_CN "挤出" -#define TITLE_LEVELING_CN "调平" -#define TITLE_SET_CN "设置" -#define TITLE_MORE_CN "更多" -#define TITLE_CHOOSEFILE_CN "选择文件" -#define TITLE_PRINTING_CN "正在打印" -#define TITLE_OPERATION_CN "操作" -#define TITLE_ADJUST_CN "调整" -#define TITLE_WIRELESS_CN "无线网络" -#define TITLE_FILAMENT_CN "换料" -#define TITLE_ABOUT_CN "关于" -#define TITLE_FAN_CN "风扇" -#define TITLE_LANGUAGE_CN "语言" -#define TITLE_PAUSE_CN "暂停" -#define TITLE_CHANGESPEED_CN "变速" -#define TITLE_CLOUD_TEXT_CN "云服务" -#define TITLE_DIALOG_CONFIRM_CN "确认" -#define TITLE_FILESYS_CN "文件系统" -#define TITLE_ZOFFSET_CN "Z Offset" - -#define AUTO_SHUTDOWN_CN "自动关机" -#define MANUAL_SHUTDOWN_CN "手动关机" - -#define DIALOG_CONFIRM_CN "确定" -#define DIALOG_CANCLE_CN "取消" -#define DIALOG_OK_CN "确认" -#define DIALOG_RESET_CN "重置" -#define DIALOG_DISABLE_CN "禁用" -#define DIALOG_PRINT_MODEL_CN "打印模型?" -#define DIALOG_CANCEL_PRINT_CN "停止打印?" -#define DIALOG_RETRY_CN "重试" -#define DIALOG_STOP_CN "停止" -#define DIALOG_REPRINT_FROM_BREAKPOINT_CN "从断点续打?" -//#define DIALOG_UNBIND_PRINTER_CN "解除绑定 ?" -#define DIALOG_ERROR_TIPS1_CN "错误:找不到文件,请插入sd卡/u盘!" -#define DIALOG_ERROR_TIPS2_CN "错误:通信失败,请检查波特率或主板硬件!" -#define DIALOG_ERROR_TIPS3_CN "错误:文件名或文件路径太长 !" -#define DIALOG_CLOSE_MACHINE_CN "正在关机......" -#define DIALOG_UNBIND_PRINTER_CN "解除绑定?" -#define DIALOG_FILAMENT_NO_PRESS_CN "请先装载耗材!" -#define DIALOG_PRINT_FINISH_CN "打印完成!" -#define DIALOG_PRINT_TIME_CN "打印时间: " -#define DIALOG_REPRINT_CN "再打印一次" -#define DIALOG_WIFI_ENABLE_TIPS_CN "wifi模块正在配置中,请稍等......" - -#define TEXT_VALUE_CN "%d℃/%d℃" -#define EXTRUDE_TEXT_VALUE_T_CN ": %d℃" -#define WIFI_RECONNECT_TEXT_CN "重新连接" - -#define PRINTING_GBK "正在打印" -#define PRINTING_OPERATION_GBK "操作" -#define PRINTING_PAUSE_GBK "暂停" - -#define MESSEGE_PAUSING_CN "暂停中..." -#define MESSEGE_CHANGING_CN "等待换料开始..." -#define MESSEGE_UNLOAD_CN "退料中,请稍等..." -#define MESSEGE_WAITING_CN "点击按钮恢复打印" -#define MESSEGE_INSERT_CN "装载耗材后,点击按钮开始打印" -#define MESSEGE_LOAD_CN "进料中,请稍等..." -#define MESSEGE_PURGE_CN "等待挤出..." -#define MESSEGE_RESUME_CN "等待恢复打印..." -#define MESSEGE_HEAT_CN "按下按钮,加热喷头" -#define MESSEGE_HEATING_CN "喷头加热中,请等待..." -#define MESSEGE_OPTION_CN "挤出更多还是继续打印?" -#define MESSEGE_PURGE_MORE_CN "挤出" -#define MESSEGE_CONTINUE_PRINT_CN "打印" - -#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_sp.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_sp.h deleted file mode 100644 index 8e5302cd52e8..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_sp.h +++ /dev/null @@ -1,260 +0,0 @@ -#ifndef _TFT_LANGUAGE_SP_H -#define _TFT_LANGUAGE_SP_H -//****************西班牙语*************************** -#define TOOL_TEXT_SP "Ajustes" -#define PREHEAT_TEXT_SP "Precalentar"//"precalent\nar" -#define MOVE_TEXT_SP "Mover" -#define HOME_TEXT_SP "Origen" -#define PRINT_TEXT_SP "Imprimir" -#define EXTRUDE_TEXT_SP "Extrusor" -#define LEVELING_TEXT_SP "Leveling"//"nivelac\nión" -#define AUTO_LEVELING_TEXT_SP "Autolevel"//"auto\nnivelación" -#define SET_TEXT_SP "Config" -#define MORE_TEXT_SP "Más" - -#define ADD_TEXT_SP "Más" -#define DEC_TEXT_SP "Menos" -#define EXTRUDER_1_TEXT_SP "Extrusor1: " -#define EXTRUDER_2_TEXT_SP "Extrusor2: " -#define HEATBED_TEXT_SP "Cama: " -#define TEXT_1C_SP "1℃" -#define TEXT_5C_SP "5℃" -#define TEXT_10C_SP "10℃" -#define CLOSE_TEXT_SP "Apagar" - -#define BACK_TEXT_SP "Atrás" - -#define TOOL_PREHEAT_SP "Precalentar" -#define TOOL_EXTRUDE_SP "Extrusor" -#define TOOL_MOVE_SP "Mover" -#define TOOL_HOME_SP "Origen" -#define TOOL_LEVELING_SP "Leveling" -#define TOOL_AUTO_LEVELING_SP "Autolevel" -#define TOOL_FILAMENT_SP "Filamento" -#define TOOL_MORE_SP "Más" - -#define AXIS_X_ADD_TEXT_SP "X+" -#define AXIS_X_DEC_TEXT_SP "X-" -#define AXIS_Y_ADD_TEXT_SP "Y+" -#define AXIS_Y_DEC_TEXT_SP "Y-" -#define AXIS_Z_ADD_TEXT_SP "Z+" -#define AXIS_Z_DEC_TEXT_SP "Z-" -#define TEXT_01MM_SP "0.1mm" -#define TEXT_1MM_SP "1mm" -#define TEXT_10MM_SP "10mm" - -#define HOME_X_TEXT_SP "EJE X" -#define HOME_Y_TEXT_SP "EJE Y" -#define HOME_Z_TEXT_SP "EJE Z" -#define HOME_ALL_TEXT_SP "TODOS" -#define HOME_STOPMOVE_SP "Quickstop" - -#define PAGE_UP_TEXT_SP "Arriba" -#define PAGE_DOWN_TEXT_SP "Abajo" - -#define EXTRUDER_IN_TEXT_SP "Dentro" -#define EXTRUDER_OUT_TEXT_SP "Fuera" -#define EXTRUDE_1MM_TEXT_SP "1mm" -#define EXTRUDE_5MM_TEXT_SP "5mm" -#define EXTRUDE_10MM_TEXT_SP "10mm" -#define EXTRUDE_LOW_SPEED_TEXT_SP "Baja" -#define EXTRUDE_MEDIUM_SPEED_TEXT_SP "Media" -#define EXTRUDE_HIGH_SPEED_TEXT_SP "Alta" - -#define LEVELING_POINT1_TEXT_SP "Primero" -#define LEVELING_POINT2_TEXT_SP "Segundo" -#define LEVELING_POINT3_TEXT_SP "Tercero" -#define LEVELING_POINT4_TEXT_SP "Cuarto" -#define LEVELING_POINT5_TEXT_SP "Quinto" - -#define FILESYS_TEXT_SP "Puerto" -#define WIFI_TEXT_SP "WiFi" -#define FAN_TEXT_SP "Ventilador" -#define ABOUT_TEXT_SP "Acerca" -#define BREAK_POINT_TEXT_SP "Continuar" -#define FILAMENT_TEXT_SP "Filamento" -#define LANGUAGE_TEXT_SP "Language" -#define MOTOR_OFF_TEXT_SP "Apagar motor" -#define MOTOR_OFF_XY_TEXT_SP "Off-XY" -#define SHUTDOWN_TEXT_SP "Apagar" - -#define U_DISK_TEXT_SP "PENDRIVE" -#define SD_CARD_TEXT_SP "SD" -#define WIFI_NAME_TEXT_SP "WIFI: " -#define WIFI_KEY_TEXT_SP "Contraseña: " -#define WIFI_IP_TEXT_SP "IP: " -#define WIFI_AP_TEXT_SP "Estado: AP" -#define WIFI_STA_TEXT_SP "Estado: STA" -#define WIFI_CONNECTED_TEXT_SP "Conectado" -#define WIFI_DISCONNECTED_TEXT_SP "Desconectado" -#define WIFI_EXCEPTION_TEXT_SP "Excepción" -#define WIFI_RECONNECT_TEXT_SP "Reconnect" -#define CLOUD_TEXT_SP "Nube" -#define CLOUD_BIND_SP "Atado" -#define CLOUD_UNBIND_SP "Sin atar" -#define CLOUD_UNBINDING_SP "Unbinding" -#define CLOUD_DISCONNECTED_SP "Disconnected" -#define CLOUD_UNBINDED_SP "Unbinded" -#define CLOUD_BINDED_SP "Binded" -#define CLOUD_DISABLE_SP "Disable" - -#define FAN_ADD_TEXT_SP "Más" -#define FAN_DEC_TEXT_SP "Menos" -#define FAN_OPEN_TEXT_SP "100%" -#define FAN_HALF_TEXT_SP "50%" -#define FAN_CLOSE_TEXT_SP "0%" -#define FAN_TIPS1_TEXT_SP "ventilador" -#define FAN_TIPS2_TEXT_SP "ventilador\n0" - -#define FILAMENT_IN_TEXT_SP "Dentro" -#define FILAMENT_OUT_TEXT_SP "Fuera" -#define FILAMENT_EXT0_TEXT_SP "Extrusor1" -#define FILAMENT_EXT1_TEXT_SP "Extrusor2" -#define FILAMENT_HEAT_TEXT_SP "Precalentar" -#define FILAMENT_STOP_TEXT_SP "Parar" -//#define FILAMENT_CHANGE_TEXT_SP "Filamento" -#define FILAMENT_TIPS2_TEXT_SP "T:" -#define FILAMENT_TIPS3_TEXT_SP "Dentro..." -#define FILAMENT_TIPS4_TEXT_SP "Fuera..." -#define FILAMENT_TIPS5_TEXT_SP "Temperatura demasiado baja, por favor calentar" -#define FILAMENT_TIPS6_TEXT_SP "Completado" -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_SP "Please click or \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_SP "Please click or ,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP "Calentando el extrusor, por favor espere..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP "Calentando el extrusor, por favor espere..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP "Temperatura alcanzada.Inserte el filamento y luego presione\"Confirmar\"para comenzar la carga." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_SP "Inserte el filamento y luego presione\"Confirmar\"para comenzar la carga." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP "Temperatura alcanzada.Presione\"Confirmar\"para retirar el filamento." - #define FILAMENT_DIALOG_LOADING_TIPS_SP "Cargando filamento,por favor espere." - #define FILAMENT_DIALOG_UNLOADING_TIPS_SP "Retirando filamento,por favor espere." - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP "Filamento cargado,presione\"Confirmar\"." - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP "Filamento retirado,presione\"Confirmar\"." -#endif - #define FILAMENT_CHANGE_TEXT_SP "Please click \nor ,After \npinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP "Temperatura alcanzada.Inserte el \nfilamento y luego presione\"Confirmar\"\npara comenzar la carga." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_SP "Inserte el filamento y \nluego presione\"Confirmar\"para \ncomenzar la carga." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP "Temperatura alcanzada.\nPresione\"Confirmar\"para retirar \nel filamento." - #define FILAMENT_DIALOG_LOADING_TIPS_SP "Cargando filamento,\npor favor espere." - #define FILAMENT_DIALOG_UNLOADING_TIPS_SP "Retirando filamento,\npor favor espere." - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP "Filamento cargado,\npresione\"Confirmar\"." - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP "Filamento retirado,\npresione\"Confirmar\"." - - -#define PRE_HEAT_EXT_TEXT_SP "Extrusor" -#define PRE_HEAT_BED_TEXT_SP "cama" - -#define FILE_LOADING_SP "Cargando......" -#if 0 -#define NO_FILE_AND_CHECK_SP "No se encontraron archivos! Por favor, inserte la tarjeta SD o el disco U!" -#endif -#define NO_FILE_AND_CHECK_SP "Archivo no encontrado,\n por favor insertar SD o disco USB!" - -#define NO_FILE_SP "Sin archivo!" - - - -#define EXTRUDER_TEMP_TEXT_SP "Temper" -#define EXTRUDER_E_LENGTH1_TEXT_SP "Extrusor1" -#define EXTRUDER_E_LENGTH2_TEXT_SP "Extrusor2" -#define EXTRUDER_E_LENGTH3_TEXT_SP "Extrusor3" - -#define ABOUT_TYPE_TEXT_SP "Pantalla: " -#define ABOUT_VERSION_TEXT_SP "Firmware: " -#define ABOUT_WIFI_TEXT_SP "WiFi: " - -#define PRINTING_OPERATION_SP "Ajustes" -#define PRINTING_PAUSE_SP "Pausar" -#define PRINTING_TEMP_SP "Temp." -#define PRINTING_CHANGESPEED_SP "Velocidad" -#define PRINTING_RESUME_SP "Resumir" -#define PRINTING_STOP_SP "Detener" -#define PRINTING_MORE_SP "Más" -#define PRINTING_EXTRUDER_SP "Extrusor" -#define PRINTING_MOVE_SP "Mover" - -#define EXTRUDER_SPEED_SP "Extrusor" -#define MOVE_SPEED_SP "Mover" -#define EXTRUDER_SPEED_STATE_SP "Extrusión" -#define MOVE_SPEED_STATE_SP "Movimiento" -#define STEP_1PERCENT_SP "1%" -#define STEP_5PERCENT_SP "5%" -#define STEP_10PERCENT_SP "10%" - -#define ZOFFSET_SP "Z Offset" -#define ZOFFSET_INC_SP "Más" -#define ZOFFSET_DEC_SP "Menos" - -#define TITLE_READYPRINT_SP "Inicio" -#define TITLE_PREHEAT_SP "Precalentar" -#define TITLE_MOVE_SP "Mover" -#define TITLE_HOME_SP "Origen" -#define TITLE_EXTRUDE_SP "Extrusor" -#define TITLE_LEVELING_SP "Leveling" -#define TITLE_SET_SP "Config" -#define TITLE_MORE_SP "Más" -#define TITLE_CHOOSEFILE_SP "Imprimir" -#define TITLE_PRINTING_SP "Imprimir" -#define TITLE_OPERATION_SP "Ajustes" -#define TITLE_ADJUST_SP "Temp." -#define TITLE_WIRELESS_SP "Wireless" -#define TITLE_FILAMENT_SP "Filamento" -#define TITLE_ABOUT_SP "Acerca" -#define TITLE_FAN_SP "Ventilador" -#define TITLE_LANGUAGE_SP "Language" -#define TITLE_PAUSE_SP "Pausar" -#define TITLE_CHANGESPEED_SP "Velocidad" -#define TILE_TOOL_SP "Ajustes" -#define TITLE_CLOUD_TEXT_SP "Cloud" -#define TITLE_DIALOG_CONFIRM_SP "Confirmar" -#define TITLE_FILESYS_SP "Puerto" -#define TITLE_ZOFFSET_SP "Z Offset" - -#define AUTO_SHUTDOWN_SP "Auto" -#define MANUAL_SHUTDOWN_SP "manual" - -#define DIALOG_CONFIRM_SP "Confirmar" -#define DIALOG_CANCLE_SP "Cancelar" -#define DIALOG_OK_SP "OK" -#define DIALOG_RESET_SP "Resetear" -#define DIALOG_RETRY_SP "Reintentar" -#define DIALOG_DISABLE_SP "Desactivar" -#define DIALOG_PRINT_MODEL_SP "¿Está seguro?" -#define DIALOG_CANCEL_PRINT_SP "¿Está seguro que desea detener la impresión?" - -#define DIALOG_RETRY_SP "Reintentar" -#define DIALOG_STOP_SP "Stop" -#define DIALOG_REPRINT_FROM_BREAKPOINT_SP "Reprint from breakpoint?" -//#define DIALOG_UNBIND_PRINTER_SP "Unbind the printer?" -#define DIALOG_ERROR_TIPS1_SP "Error:archivo no encontrado, \npor favor insertar SD o disco USB." -#define DIALOG_ERROR_TIPS2_SP "error:transacción fallida, \nconfigurar baudrate del \ndisplay para la placa base!" -#define DIALOG_ERROR_TIPS3_SP "Error : nombre de archivo o \nruta demasiado largo!" -#define DIALOG_CLOSE_MACHINE_SP "Closing machine......" -#define DIALOG_UNBIND_PRINTER_SP "Unbind the printer?" -#define DIALOG_FILAMENT_NO_PRESS_SP "Filament detection switch is not pressed" -#define DIALOG_PRINT_FINISH_SP "¡La impresión está completa!" -#define DIALOG_PRINT_TIME_SP "Tiempo de impresión: " -#define DIALOG_REPRINT_SP "Print again" -#define DIALOG_WIFI_ENABLE_TIPS_SP "The wifi module is being configured,\nplease wait a moment....." - -#define PRINTING_SP "Imprimiendo" -#define PRINTING_AJUSTES_SP "Ajustes" -#define PRINTING_PAUSAR_SP "Pausar" - -#define MESSEGE_PAUSING_SP "Aparcando..." -#define MESSEGE_CHANGING_SP "Esperando para iniciar el cambio de filamento" -#define MESSEGE_UNLOAD_SP "Espere para liberar el filamento" -#define MESSEGE_WAITING_SP "Pulsar el botón para reanudar impresión" -#define MESSEGE_INSERT_SP "Inserte el filamento y pulse el botón para continuar..." -#define MESSEGE_LOAD_SP "Espere para purgar el filamento" -#define MESSEGE_PURGE_SP "Espere para purgar el filamento" -#define MESSEGE_RESUME_SP "Esperando impresora para reanudar..." -#define MESSEGE_HEAT_SP "Pulse el botón para calentar la boquilla" -#define MESSEGE_HEATING_SP "Calentando boquilla Espere por favor..." -#define MESSEGE_OPTION_SP "¿Purgar más o continuar con la impresión?" -#define MESSEGE_PURGE_MORE_SP "Purga" -#define MESSEGE_CONTINUE_PRINT_SP "Impresión" - -#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_t_cn.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_t_cn.h deleted file mode 100644 index 0d93c5ee9752..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_t_cn.h +++ /dev/null @@ -1,248 +0,0 @@ -#ifndef _TFT_LANGUAGE_T_CN_H -#define _TFT_LANGUAGE_T_CN_H -//***************繁体中文**********************// -#define TOOL_TEXT_T_CN "工具" -#define PREHEAT_TEXT_T_CN "預熱" -#define MOVE_TEXT_T_CN "移動" -#define HOME_TEXT_T_CN "回零" -#define PRINT_TEXT_T_CN "打印" -#define EXTRUDE_TEXT_T_CN "擠出" -#define LEVELING_TEXT_T_CN "調平" -#define AUTO_LEVELING_TEXT_T_CN "自動調平" -#define SET_TEXT_T_CN "設置" -#define MORE_TEXT_T_CN "更多" - -#define ADD_TEXT_T_CN "增加" -#define DEC_TEXT_T_CN "減少" -#define EXTRUDER_1_TEXT_T_CN "噴頭1" -#define EXTRUDER_2_TEXT_T_CN "噴頭2" -#define HEATBED_TEXT_T_CN "熱床" -#define TEXT_1C_T_CN "1℃" -#define TEXT_5C_T_CN "5℃" -#define TEXT_10C_T_CN "10℃" -#define CLOSE_TEXT_T_CN "關閉" - -#define BACK_TEXT_T_CN "返回" - -#define TOOL_PREHEAT_T_CN "預熱" -#define TOOL_EXTRUDE_T_CN "擠出" -#define TOOL_MOVE_T_CN "移動" -#define TOOL_HOME_T_CN "回零" -#define TOOL_LEVELING_T_CN "調平" -#define TOOL_AUTO_LEVELING_T_CN "自動調平" -#define TOOL_FILAMENT_T_CN "換料" -#define TOOL_MORE_T_CN "更多" - -#define AXIS_X_ADD_TEXT_T_CN "X+" -#define AXIS_X_DEC_TEXT_T_CN "X-" -#define AXIS_Y_ADD_TEXT_T_CN "Y+" -#define AXIS_Y_DEC_TEXT_T_CN "Y-" -#define AXIS_Z_ADD_TEXT_T_CN "Z+" -#define AXIS_Z_DEC_TEXT_T_CN "Z-" -#define TEXT_01MM_T_CN "0.1mm" -#define TEXT_1MM_T_CN "1mm" -#define TEXT_10MM_T_CN "10mm" - -#define HOME_X_TEXT_T_CN "X" -#define HOME_Y_TEXT_T_CN "Y" -#define HOME_Z_TEXT_T_CN "Z" -#define HOME_ALL_TEXT_T_CN "回零" -#define HOME_STOPMOVE_T_CN "急停" - -#define PAGE_UP_TEXT_T_CN "上一頁" -#define PAGE_DOWN_TEXT_T_CN "下一頁" - -#define EXTRUDER_IN_TEXT_T_CN "進料" -#define EXTRUDER_OUT_TEXT_T_CN "退料" -#define EXTRUDE_1MM_TEXT_T_CN "1mm" -#define EXTRUDE_5MM_TEXT_T_CN "5mm" -#define EXTRUDE_10MM_TEXT_T_CN "10mm" -#define EXTRUDE_LOW_SPEED_TEXT_T_CN "低速" -#define EXTRUDE_MEDIUM_SPEED_TEXT_T_CN "常速" -#define EXTRUDE_HIGH_SPEED_TEXT_T_CN "高速" - -#define LEVELING_POINT1_TEXT_T_CN "第一點" -#define LEVELING_POINT2_TEXT_T_CN "第二點" -#define LEVELING_POINT3_TEXT_T_CN "第三點" -#define LEVELING_POINT4_TEXT_T_CN "第四點" -#define LEVELING_POINT5_TEXT_T_CN "第五點" - -#define FILESYS_TEXT_T_CN "文件系統" -#define WIFI_TEXT_T_CN "WIFI" -#define FAN_TEXT_T_CN "風扇" -#define ABOUT_TEXT_T_CN "關於" -#define BREAK_POINT_TEXT_T_CN "斷點續打" -#define FILAMENT_TEXT_T_CN "換料" -#define LANGUAGE_TEXT_T_CN "語言" -#define MOTOR_OFF_TEXT_T_CN "關閉電機" -#define MOTOR_OFF_XY_TEXT_T_CN "關閉XY" -#define SHUTDOWN_TEXT_T_CN "關機" - -#define U_DISK_TEXT_T_CN "U盤" -#define SD_CARD_TEXT_T_CN "SD卡" -#define WIFI_NAME_TEXT_T_CN "無線網絡:" -#define WIFI_KEY_TEXT_T_CN "密碼: " -#define WIFI_IP_TEXT_T_CN "IP: " -#define WIFI_AP_TEXT_T_CN "狀態: AP" -#define WIFI_STA_TEXT_T_CN "狀態: STA" -#define WIFI_CONNECTED_TEXT_T_CN "已連接" -#define WIFI_DISCONNECTED_TEXT_T_CN "未連接" -#define WIFI_EXCEPTION_TEXT_T_CN "模塊異常" -#define CLOUD_TEXT_T_CN "雲服務" -#define CLOUD_BIND_T_CN "已綁定" -#define CLOUD_UNBIND_T_CN "解綁" -#define CLOUD_UNBINDING_T_CN "解绑中" -#define CLOUD_DISCONNECTED_T_CN "未連接" -#define CLOUD_UNBINDED_T_CN "未綁定" -#define CLOUD_BINDED_T_CN "已綁定" -#define CLOUD_DISABLE_T_CN "已禁用" - -#define FAN_ADD_TEXT_T_CN "增加" -#define FAN_DEC_TEXT_T_CN "減少" -#define FAN_OPEN_TEXT_T_CN "100%" -#define FAN_HALF_TEXT_T_CN "50%" -#define FAN_CLOSE_TEXT_T_CN "關閉" -#define FAN_TIPS1_TEXT_T_CN "風扇" -#define FAN_TIPS2_TEXT_T_CN "FAN\nClose" - -#define FILAMENT_IN_TEXT_T_CN "進料" -#define FILAMENT_OUT_TEXT_T_CN "退料" -#define FILAMENT_EXT0_TEXT_T_CN "噴頭1" -#define FILAMENT_EXT1_TEXT_T_CN "噴頭2" -#define FILAMENT_HEAT_TEXT_T_CN "預熱" -#define FILAMENT_STOP_TEXT_T_CN "停止" -//#define FILAMENT_CHANGE_TEXT_T_CN "準備換料" -#define FILAMENT_TIPS2_TEXT_T_CN "T:" -#define FILAMENT_TIPS3_TEXT_T_CN "正在進料" -#define FILAMENT_TIPS4_TEXT_T_CN "正在退料" -#define FILAMENT_TIPS5_TEXT_T_CN "溫度太低,請先預熱" -#define FILAMENT_TIPS6_TEXT_T_CN "換料完成" - -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_T_CN "請按<進料>或<退料>進行換料!" - #define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,請按<進料>或<退料>進行換料!" - -#endif - - - #define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,\n請按<進料>或<退料>" - - - -#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_T_CN "準備進料,正在加熱,請稍等" -#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_T_CN "準備退料,正在加熱,請稍等" -#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_T_CN "加熱完成,請裝載耗材后,按<確定>開始進料" -#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_T_CN "請裝載耗,按<確定>開始進料!" -#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_T_CN "加熱完成,请按<確定>開始退料!" -#define FILAMENT_DIALOG_LOADING_TIPS_T_CN "正在進料,请等待耗材加載完成!" -#define FILAMENT_DIALOG_UNLOADING_TIPS_T_CN "正在退料,请等待耗材卸載完成!" -#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_T_CN "進料完成,请按<確定>返回" -#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_T_CN "退料完成,请按<確定>返回" - -#define PRE_HEAT_EXT_TEXT_T_CN "噴頭" -#define PRE_HEAT_BED_TEXT_T_CN "熱床" - -#define FILE_LOADING_T_CN "正在載入......" -#define NO_FILE_AND_CHECK_T_CN "無文件!請插入sd卡/u盤!" -#define NO_FILE_T_CN "無文件!" - -#define EXTRUDER_TEMP_TEXT_T_CN "溫度" -#define EXTRUDER_E_LENGTH1_TEXT_T_CN "噴頭" -#define EXTRUDER_E_LENGTH2_TEXT_T_CN "噴頭" -#define EXTRUDER_E_LENGTH3_TEXT_T_CN "噴頭" - -#define ABOUT_TYPE_TEXT_T_CN "Type: " -#define ABOUT_VERSION_TEXT_T_CN "Firmware: " -#define ABOUT_WIFI_TEXT_T_CN "Wifi: " - -#define PRINTING_OPERATION_T_CN "操作" -#define PRINTING_PAUSE_T_CN "暫停" -#define PRINTING_TEMP_T_CN "溫度" -#define PRINTING_CHANGESPEED_T_CN "變速" -#define PRINTING_RESUME_T_CN "恢復" -#define PRINTING_STOP_T_CN "停止" -#define PRINTING_MORE_T_CN "更多" -#define PRINTING_EXTRUDER_T_CN "擠出" -#define PRINTING_MOVE_T_CN "移動" - -#define EXTRUDER_SPEED_T_CN "擠出" -#define MOVE_SPEED_T_CN "移動" -#define EXTRUDER_SPEED_STATE_T_CN "擠出速度" -#define MOVE_SPEED_STATE_T_CN "移動速度" -#define STEP_1PERCENT_T_CN "1%%" -#define STEP_5PERCENT_T_CN "5%%" -#define STEP_10PERCENT_T_CN "10%%" - -#define ZOFFSET_T_CN "Z Offset" -#define ZOFFSET_INC_T_CN "增加" -#define ZOFFSET_DEC_T_CN "減少" - -#define TITLE_READYPRINT_T_CN "準備打印" -#define TITLE_PREHEAT_T_CN "預熱" -#define TITLE_MOVE_T_CN "移動" -#define TITLE_HOME_T_CN "回零" -#define TITLE_EXTRUDE_T_CN "擠出" -#define TITLE_LEVELING_T_CN "調平" -#define TITLE_SET_T_CN "設置" -#define TITLE_MORE_T_CN "更多" -#define TITLE_CHOOSEFILE_T_CN "選擇文件" -#define TITLE_PRINTING_T_CN "正在打印" -#define TITLE_OPERATION_T_CN "操作" -#define TITLE_ADJUST_T_CN "調整" -#define TITLE_WIRELESS_T_CN "無線網絡" -#define TITLE_FILAMENT_T_CN "換料" -#define TITLE_ABOUT_T_CN "關於" -#define TITLE_FAN_T_CN "風扇" -#define TITLE_LANGUAGE_T_CN "語言" -#define TITLE_PAUSE_T_CN "暫停" -#define TITLE_CHANGESPEED_T_CN "變速" -#define TITLE_CLOUD_TEXT_T_CN "雲服務" -#define TITLE_DIALOG_CONFIRM_T_CN "確認" -#define TITLE_FILESYS_T_CN "文件系統" -#define TITLE_ZOFFSET_T_CN "Z Offset" - -#define AUTO_SHUTDOWN_T_CN "自動關機" -#define MANUAL_SHUTDOWN_T_CN "手動關機" - -#define DIALOG_CONFIRM_T_CN "確定" -#define DIALOG_CANCLE_T_CN "取消" -#define DIALOG_OK_T_CN "確認" -#define DIALOG_RESET_T_CN "重設" -#define DIALOG_RETRY_T_CN "重試" -#define DIALOG_DISABLE_T_CN "禁用" -#define DIALOG_PRINT_MODEL_T_CN "打印模型?" -#define DIALOG_CANCEL_PRINT_T_CN "停止打印?" -#define DIALOG_RETRY_T_CN "重試" -#define DIALOG_STOP_T_CN "停止" -#define DIALOG_REPRINT_FROM_BREAKPOINT_T_CN "從斷點續打?" -//#define DIALOG_UNBIND_PRINTER_T_CN "解除綁定?" -#define DIALOG_ERROR_TIPS1_T_CN "錯誤:找不到文件,請插入sd卡/u盤!" -#define DIALOG_ERROR_TIPS2_T_CN "錯誤:通信失敗,請檢查波特率或主板硬件!" -#define DIALOG_ERROR_TIPS3_T_CN "錯誤:文件名或文件路徑太長!" -#define DIALOG_CLOSE_MACHINE_T_CN "正在關機......" -#define DIALOG_UNBIND_PRINTER_T_CN "解除綁定?" -#define DIALOG_FILAMENT_NO_PRESS_T_CN "請先裝載耗材!" -#define DIALOG_PRINT_FINISH_T_CN "打印完成!" -#define DIALOG_PRINT_TIME_T_CN "打印時間: " -#define DIALOG_REPRINT_T_CN "再打印壹次" -#define DIALOG_WIFI_ENABLE_TIPS_T_CN "wifi模塊正在配置中,請稍等......" - -#define TEXT_VALUE_T_CN "%d℃/%d℃" -#define EXTRUDE_TEXT_VALUE_T_T_CN ": %d℃" -#define WIFI_RECONNECT_TEXT_T_CN "重新連接" - -#define MESSEGE_PAUSING_T_CN "暫停中..." -#define MESSEGE_CHANGING_T_CN "等待換料開始..." -#define MESSEGE_UNLOAD_T_CN "退料中,請稍等..." -#define MESSEGE_WAITING_T_CN "點擊按鈕恢復打印" -#define MESSEGE_INSERT_T_CN "裝載耗材後,點擊按鈕開始打印" -#define MESSEGE_LOAD_T_CN "進料中,請稍等..." -#define MESSEGE_PURGE_T_CN "等待擠出..." -#define MESSEGE_RESUME_T_CN "等待恢復打印..." -#define MESSEGE_HEAT_T_CN "按下按鈕,加熱噴頭" -#define MESSEGE_HEATING_T_CN "噴頭加熱中,請等待..." -#define MESSEGE_OPTION_T_CN "擠出更多還是繼續打印" -#define MESSEGE_PURGE_MORE_T_CN "擠出" -#define MESSEGE_CONTINUE_PRINT_T_CN "打印" - -#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_fsmc.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_fsmc.h deleted file mode 100644 index 4788d5957aed..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_fsmc.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _TFT_FSMC_H_ -#define _TFT_FSMC_H_ - -#if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ -#endif - - -#if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ -#endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_lvgl_configuration.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_lvgl_configuration.h deleted file mode 100644 index 0da3adf42336..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_lvgl_configuration.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file tft_lvgl_configuration.h - * @date 2020-02-21 - * */ - -#ifndef TFT_LVGL_CONFIGURATION_H -#define TFT_LVGL_CONFIGURATION_H - -//#ifdef __cplusplus -//extern "C" { -//#endif - -#include "lvgl.h" - -void tft_lvgl_init(); -void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p); -bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data); - -void LCD_Clear(uint16_t Color); -void tft_set_point(uint16_t x,uint16_t y,uint16_t point); -void ili9320_SetWindows(uint16_t StartX,uint16_t StartY,uint16_t width,uint16_t heigh); -void LCD_WriteRAM_Prepare(void); - - -//#ifdef __cplusplus -//} /* extern "C" */ -//#endif - -#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_multi_language.h b/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_multi_language.h deleted file mode 100644 index 57b639063441..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_multi_language.h +++ /dev/null @@ -1,589 +0,0 @@ -#ifndef _TFT_MULTI_LANGUAGE_H -#define _TFT_MULTI_LANGUAGE_H - -//#include "../../MarlinCore.h" -#include "../inc/tft_Language_en.h" -#include "../inc/tft_Language_s_cn.h" -#include "../inc/tft_Language_t_cn.h" -#include "../inc/tft_Language_ru.h" -#include "../inc/tft_Language_fr.h" -#include "../inc/tft_Language_sp.h" -#include "../inc/tft_Language_it.h" - -extern void disp_language_init(); - -#define LANG_SIMPLE_CHINESE 1 -#define LANG_COMPLEX_CHINESE 2 -#define LANG_ENGLISH 3 -#define LANG_JAPAN 4 -#define LANG_GERMAN 5 -#define LANG_FRENCH 6 -#define LANG_RUSSIAN 7 -#define LANG_KOREAN 8 -#define LANG_TURKISH 9 -#define LANG_SPANISH 10 -#define LANG_GREEK 11 -#define LANG_ITALY 12 -#define LANG_PORTUGUESE 13 - - -#define MULTI_LANGUAGE_ENABLE 1 -#define MULTI_LANGUAGE_DISABLE 0 - -typedef struct common_menu_disp -{ - const char *text_back; - const char *dialog_confirm_title; - const char *close_machine_tips; - const char *unbind_printer_tips; - const char *print_special_title; - const char *pause_special_title; - const char *operate_special_title; - const char *next; - const char *previous; -}common_menu_def; -extern common_menu_def common_menu; - -typedef struct main_menu_disp -{ - const char *title; - const char *preheat; - const char *move; - const char *home; - const char *print; - const char *extrude; - const char *leveling; - const char *autoleveling; - const char *fan; - const char *set; - const char *tool; - const char *more; - const char *machine_para; -}main_menu_def; -extern main_menu_def main_menu; -typedef struct preheat_menu_disp -{ - const char *adjust_title; - const char *title; - const char *add; - const char *dec; - const char *ext1; - const char *ext2; - const char *hotbed; - const char *off; - const char *step_1c; - const char *step_5c; - const char *step_10c; - const char *back; - - const char *value_state; - - const char *dialog_tips; - -}preheat_menu_def; -extern preheat_menu_def preheat_menu; -typedef struct move_menu_disp -{ - const char *title; - const char *x_add; - const char *x_dec; - const char *y_add; - const char *y_dec; - const char *z_add; - const char *z_dec; - const char *step_001mm; - const char *step_005mm; - const char *step_01mm; - const char *step_1mm; - const char *step_10mm; - const char *back; -}move_menu_def; -extern move_menu_def move_menu; -typedef struct home_menu_disp -{ - const char *title; - const char *home_all; - const char *home_x; - const char *home_y; - const char *home_z; - const char *stopmove; - const char *back; -}home_menu_def; -extern home_menu_def home_menu; -typedef struct file_menu_disp -{ - const char *title; - const char *page_up; - const char *page_down; - const char *back; - - const char *file_loading; - const char *no_file; - const char *no_file_and_check; - -}file_menu_def; -extern file_menu_def file_menu; -typedef struct extrude_menu_disp -{ - const char *title; - const char *in; - const char *out; - const char *ext1; - const char *ext2; - const char *step_1mm; - const char *step_5mm; - const char *step_10mm; - const char *low; - const char *normal; - const char *high; - const char *back; - - const char *count_value_mm; - const char *count_value_cm; - const char *count_value_m; - const char *temp_value; - const char *temper_text; -}extrude_menu_def; -extern extrude_menu_def extrude_menu; -typedef struct leveling_menu_disp -{ - const char *title; - const char *position1; - const char *position2; - const char *position3; - const char *position4; - const char *position5; - - char *back; -}leveling_menu_def; -extern leveling_menu_def leveling_menu; -typedef struct set_menu_disp -{ - const char *title; - const char *filesys; - const char *wifi; - const char *about; - const char *fan; - const char *filament; - const char *breakpoint; - const char *motoroff; - const char *motoroffXY; - const char *shutdown; - const char *language; - const char *machine_para; - const char *back; -}set_menu_def; -extern set_menu_def set_menu; -typedef struct filesys_menu_disp -{ -const char *title; -const char *filesys; -const char *sd_sys; -const char *usb_sys; -const char *back; - -}filesys_menu_def; -extern filesys_menu_def filesys_menu; -typedef struct more_menu_disp -{ - const char *title; - const char *zoffset; - const char *back; -}more_menu_def; -extern more_menu_def more_menu; -typedef struct wifi_menu_disp -{ - const char *title; - const char *ip; - const char *wifi; - const char *key; - const char *state_ap; - const char *state_sta; - const char *cloud; - const char *connected; - const char *disconnected; - const char *exception; - const char *back; - const char *reconnect; -}wifi_menu_def; -extern wifi_menu_def wifi_menu; -typedef struct cloud_menu_disp -{ - const char *title; - const char *unbind; - const char *unbinding; - const char *unbinded; - const char *bind; - const char *binding; - const char *binded; - const char *disable; - const char *disconnected; - const char *back; - const char *unbind_printer_tips; -}cloud_menu_def; -extern cloud_menu_def cloud_menu; - -typedef struct about_menu_disp -{ - const char *title; - const char *type_name; - const char *firmware_v; - const char *type; - const char *version; - const char *wifi; - const char *type_robin; - const char *type_robin_mini; - const char *back; -}about_menu_def; -extern about_menu_def about_menu; - -typedef struct fan_menu_disp -{ - const char *title; - const char *add; - const char *dec; - const char *full; - const char *half; - const char *off; - const char *back; - - const char *state; - const char *state_value; -}fan_menu_def; -extern fan_menu_def fan_menu; - -typedef struct filament_menu_disp -{ - const char *title; - const char *in; - const char *out; - const char *ext1; - const char *ext2; - const char *back; - const char *stat_temp; - const char *ready_replace; - const char *replacing; - const char *loading; - const char *unloading; - const char *heating; - const char *complete_and_back; - const char *filament_dialog_load_heat; - const char *filament_dialog_unload_heat; - const char *filament_dialog_load_heat_confirm; - const char *filament_dialog_unload_heat_confirm; - const char *filament_dialog_loading; - const char *filament_dialog_unloading; - const char *filament_dialog_load_completed; - const char *filament_dialog_unload_completed; - const char *filament_dialog_ok; - const char *filament_dialog_back; -}filament_menu_def; -extern filament_menu_def filament_menu; - -typedef struct language_menu -{ - const char *title; - const char *chinese_s; - const char *chinese_t; - const char *english; - const char *russian; - const char *japan; - const char *italy; - const char *german; - const char *spanish; - const char *korean; - const char *french; - const char *brazil; - const char *portuguese; - const char *next; - const char *up; - const char *back; -}language_menu_def; -extern language_menu_def language_menu; - - -typedef struct printing_menu_disp -{ - const char *title; - const char *option; - const char *temp1; - const char *temp2; - const char *bed_temp; - const char *fan_speed; - const char *pause; - const char *resume; - const char *stop; -}printing_menu_def; -extern printing_menu_def printing_menu; - -typedef struct operation_menu_disp -{ - const char *title; - const char *pause; - const char *stop; - const char *temp; - const char *fan; - const char *filament; - const char *extr; - const char *speed; - const char *move; - const char *more; - const char *auto_off; - const char *manual_off; - const char *back; - const char *babystep; -}operation_menu_def; -extern operation_menu_def operation_menu; -typedef struct pause_menu_disp -{ - const char *title; - const char *resume; - const char *stop; - const char *extrude; - const char *move; - const char *filament; - const char *more; -}pause_menu_def; -extern pause_menu_def pause_menu; - -typedef struct speed_menu_disp -{ - const char *title; - const char *add; - const char *dec; - const char *extrude; - const char *move; - const char *step_1percent; - const char *step_5percent; - const char *step_10percent; - const char *back; - const char *move_speed; - const char *extrude_speed; -}speed_menu_def; -extern speed_menu_def speed_menu; - -typedef struct printing_more_menu_disp -{ - const char *title; - const char *fan; - const char *auto_close; - const char *manual; - const char *temp; - const char *speed; - const char *back; -}printing_more_menu_def; -extern printing_more_menu_def printing_more_menu; - -typedef struct dialog_menu_disp -{ - const char *confirm_title; - - const char *error1_repint_no_file; - const char *error2_communication_fail; - const char *error3_filename_too_long; - const char *error4_no_file; - const char *error5_check_filesys; - - const char *tip1_print_file; - const char *tip2_stop_file; -}dialog_menu_def; -extern dialog_menu_def dialog_menu; - -typedef struct print_file_dialog_disp -{ - const char *title; - const char *confirm; - const char *cancle; - const char *print_file; - const char *cancle_print; - const char *retry; - const char *stop; - const char *no_file_print_tips; - const char *print_from_breakpoint; - const char *file_name_too_long_error; - const char *close_machine_error; - const char *filament_no_press; - const char *print_finish; - const char *print_time; - const char *reprint; - const char *wifi_enable_tips; -}print_file_dialog_menu_def; -extern print_file_dialog_menu_def print_file_dialog_menu; - -typedef struct zoffset_menu_disp -{ - const char *title; - const char *inc; - const char *dec; - const char *step001; - const char *step01; - const char *step1; - const char *back; -}zoffset_menu_def; -extern zoffset_menu_def zoffset_menu; - -typedef struct tool_menu_disp -{ - const char *title; - const char *preheat; - const char *extrude; - const char *move; - const char *home; - const char *leveling; - const char *autoleveling; - const char *filament; - const char *more; - const char *back; -}tool_menu_def; -extern tool_menu_def tool_menu; - -typedef struct MachinePara_menu_disp -{ - const char *title; - const char *MachineSetting; - const char *TemperatureSetting; - const char *MotorSetting; - const char *AdvanceSetting; - //const char *back; -}MachinePara_menu_def; -extern MachinePara_menu_def MachinePara_menu; - -typedef struct MachineSettings_menu_disp -{ - const char *title; - const char *Machine; - const char *Stroke; - const char *HomeDir; - const char *EndStopType; - const char *filamet; - const char *leveling; - const char *back; -}MachineSettings_menu_def; -extern MachineSettings_menu_def MachineSettings_menu; - -typedef struct TemperatureSettings_menu_disp -{ - const char *title; - const char *nozzle; - const char *hotbed; - const char *preheat; - const char *back; -}TemperatureSettings_menu_def; -extern TemperatureSettings_menu_def TemperatureSettings_menu; - -typedef struct pause_msg_disp -{ - const char *pausing; - const char *changing; - const char *unload; - const char *waiting; - const char *insert; - const char *load; - const char *purge; - const char *resume; - const char *heat; - const char *heating; - const char *option; - const char *purgeMore; - const char *continuePrint; -}pause_msg_def; -extern pause_msg_def pause_msg_menu; - -/*****************************************/ -//********************************************// -//#if defined(TFT70) - -//#elif defined(TFT35) -#define TEXT_VALUE "%d/%d" -//#endif - -#define TEXT_VALUE_T ": %d℃" -#define TEXT_VALUE_mm ": %dmm" -#define TEXT_VALUE_cm ": %dcm" -#define TEXT_VALUE_m ": %dm" - -#define TEMP_UNIT_SYBOL "%d℃" -#define FLOAT_TEMP_UNIT_SYBOL "%.1f℃" - -#define TEXT_1C "1℃" -#define TEXT_5C "5℃" -#define TEXT_10C "10℃" - -#define AXIS_X_ADD_TEXT "X+" -#define AXIS_X_DEC_TEXT "X-" -#define AXIS_Y_ADD_TEXT "Y+" -#define AXIS_Y_DEC_TEXT "Y-" -#define AXIS_Z_ADD_TEXT "Z+" -#define AXIS_Z_DEC_TEXT "Z-" -#define TEXT_001MM "0.01mm" -#define TEXT_005MM "0.05mm" -#define TEXT_01MM "0.1mm" -#define TEXT_1MM "1mm" -#define TEXT_10MM "10mm" - -#define EXTRUDE_1MM_TEXT "1mm" -#define EXTRUDE_5MM_TEXT "5mm" -#define EXTRUDE_10MM_TEXT "10mm" - -#define STEP_1PERCENT "1%" -#define STEP_5PERCENT "5%" -#define STEP_10PERCENT "10%" - -#define LANGUAGE_S_CN "简体" -#define LANGUAGE_T_CN "繁体" -#define LANGUAGE_EN "English" -#define LANGUAGE_JP "日本語" -#define LANGUAGE_GE "Deutsch" -#define LANGUAGE_FR "français" -#define LANGUAGE_IT "Italia" -#define LANGUAGE_PR "português" -#define LANGUAGE_KR "Korean" -#define LANGUAGE_BR "Brazil" -#define LANGUAGE_RU "русский" -#define LANGUAGE_SP "español" - -#define HOME_X_TEXT "X" -#define HOME_Y_TEXT "Y" -#define HOME_Z_TEXT "Z" -#define HOME_ALL_TEXT "All" -//#if defined(MKS_ROBIN_NANO) -#define ABOUT_TYPE_TEXT "MKS Robin Pro" -//#elif defined(MKS_ROBIN_MINI) -//#define ABOUT_TYPE_TEXT "MKS Robin Mini" -//#endif -#define ABOUT_VERSION_TEXT "1.0.0" -//#define ABOUT_WIFI_TEXT "WiFi:" - -#define FAN_OPEN_TEXT "100%" -#define FAN_HALF_TEXT "50%" -#define FAN_CLOSE_TEXT "0%" -//#define FAN_TIPS1_TEXT "FAN" -//#define FAN_TIPS2_TEXT "FAN\nClose" - -#define WIFI_TEXT "WIFI" -#define WIFI_IP_TEXT "IP: " -#define WIFI_NAME_TEXT "WiFi: " -#define WIFI_KEY_TEXT "Key: " -#define WIFI_STATE_AP_TEXT "State: AP" -#define WIFI_STATE_STA_TEXT "State: STA" -#define WIFI_CONNECTED_TEXT "Connected" -#define WIFI_DISCONNECTED_TEXT "Disconnected" -#define WIFI_EXCEPTION_TEXT "Exception" - -#define FILAMENT_TIPS2_TEXT "T:" - -#define DIALOG_UPLOAD_ING_EN "Uploading......" -#define DIALOG_UPLOAD_ERROR_EN "Upload error" -#define DIALOG_UPLOAD_FINISH_EN "Upload finished" -#define DIALOG_UPLOAD_SIZE_EN "Size" -#define DIALOG_UPLOAD_TIME_EN "Time" -#define DIALOG_UPLOAD_SPEED_EN "Speed" -#define DIALOG_UPDATE_WIFI_FIRMWARE_EN "Updating wifi model firmware" -#define DIALOG_UPDATE_WIFI_WEB_EN "Updating wifi model web data" - -#define ZOFFSET_STEP001 "0.01mm" -#define ZOFFSET_STEP01 "0.1mm" -#define ZOFFSET_STEP1 "1mm" - -/*****************************************/ -#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/mks_hardware_test.cpp b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp similarity index 73% rename from Marlin/src/lcd/extui/lib/mks_ui/src/mks_hardware_test.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp index f5ae4e64b02a..83ac109ec4db 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/mks_hardware_test.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp @@ -1,16 +1,38 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../inc/tft_lvgl_configuration.h" -#include "lvgl.h" -#include "../../../../../feature/touch/xpt2046.h" -#include "../inc/draw_ready_print.h" -#include "../inc/W25Qxx.h" -#include "../inc/pic_manager.h" -//#include "../../MarlinCore.h" -#include "../inc/mks_hardware_test.h" -#include "../../../../../module/temperature.h" +#include "tft_lvgl_configuration.h" +#include "lvgl.h" +#include "../../../../feature/touch/xpt2046.h" +#include "draw_ready_print.h" +#include "W25Qxx.h" +#include "pic_manager.h" +//#include "../MarlinCore.h" +#include "mks_hardware_test.h" +#include "../../../../module/temperature.h" #if ENABLED(MKS_TEST) @@ -18,207 +40,50 @@ extern uint8_t curent_disp_ui; uint8_t pw_det_sta,pw_off_sta,mt_det_sta,mt_det2_sta,mt_det3_sta; uint8_t endstopx1_sta,endstopx2_sta,endstopy1_sta,endstopy2_sta,endstopz1_sta,endstopz2_sta; -void test_gpio_readlevel_L() -{ - volatile uint32_t itest; - +void test_gpio_readlevel_L() { + volatile uint32_t itest; digitalWrite(WIFI_IO2_PIN, HIGH); - itest = 10000; - while(itest--); - if(digitalRead(POWER_LOSS_PIN)==0) - { - pw_det_sta = 1; - } - else - { - pw_det_sta = 0; - } - if(digitalRead(PS_ON_PIN)==0) - { - pw_off_sta = 1; - } - else - { - pw_off_sta = 0; - } - if(digitalRead(FIL_RUNOUT_PIN)==0) - { - mt_det_sta = 1; - } - else - { - mt_det_sta = 0; - } - if(digitalRead(FIL_RUNOUT_2_PIN)==0) - { - mt_det2_sta = 1; - } - else - { - mt_det2_sta = 0; - } - if(digitalRead(FIL_RUNOUT_3_PIN)==0) - { - mt_det3_sta = 1; - } - else - { - mt_det3_sta = 0; - } - if(digitalRead(X_MIN_PIN)==0) - { - endstopx1_sta = 1; - } - else - { - endstopx1_sta = 0; - } - if(digitalRead(X_MAX_PIN)==0) - { - endstopx2_sta = 1; - } - else - { - endstopx2_sta = 0; - } - if(digitalRead(Y_MIN_PIN)==0) - { - endstopy1_sta = 1; - } - else - { - endstopy1_sta = 0; - } - if(digitalRead(Y_MAX_PIN)==0) - { - endstopy2_sta = 1; - } - else - { - endstopy2_sta = 0; - } - if(digitalRead(Z_MIN_PIN)==0) - { - endstopz1_sta = 1; - } - else - { - endstopz1_sta = 0; - } - if(digitalRead(Z_MAX_PIN)==0) - { - endstopz2_sta = 1; - } - else - { - endstopz2_sta = 0; - } + itest = 10000; + while(itest--); + pw_det_sta = (digitalRead(POWER_LOSS_PIN) == 0); + pw_off_sta = (digitalRead(PS_ON_PIN) == 0); + mt_det_sta = (digitalRead(FIL_RUNOUT_PIN) == 0); + mt_det2_sta = (digitalRead(FIL_RUNOUT_2_PIN) == 0); + mt_det3_sta = (digitalRead(FIL_RUNOUT_3_PIN) == 0); + endstopx1_sta = (digitalRead(X_MIN_PIN) == 0); + endstopx2_sta = (digitalRead(X_MAX_PIN) == 0); + endstopy1_sta = (digitalRead(Y_MIN_PIN) == 0); + endstopy2_sta = (digitalRead(Y_MAX_PIN) == 0); + endstopz1_sta = (digitalRead(Z_MIN_PIN) == 0); + endstopz2_sta = (digitalRead(Z_MAX_PIN) == 0); } -void test_gpio_readlevel_H() -{ - volatile uint32_t itest; +void test_gpio_readlevel_H() { + volatile uint32_t itest; digitalWrite(WIFI_IO2_PIN, LOW); - itest = 10000; - while(itest--); - if(digitalRead(POWER_LOSS_PIN)==1) - { - pw_det_sta = 1; - } - else - { - pw_det_sta = 0; - } - if(digitalRead(PS_ON_PIN)==1) - { - pw_off_sta = 1; - } - else - { - pw_off_sta = 0; - } - if(digitalRead(FIL_RUNOUT_PIN)==1) - { - mt_det_sta = 1; - } - else - { - mt_det_sta = 0; - } - if(digitalRead(FIL_RUNOUT_2_PIN)==1) - { - mt_det2_sta = 1; - } - else - { - mt_det2_sta = 0; - } - if(digitalRead(FIL_RUNOUT_3_PIN)==1) - { - mt_det3_sta = 1; - } - else - { - mt_det3_sta = 0; - } - if(digitalRead(X_MIN_PIN)==1) - { - endstopx1_sta = 1; - } - else - { - endstopx1_sta = 0; - } - if(digitalRead(X_MAX_PIN)==1) - { - endstopx2_sta = 1; - } - else - { - endstopx2_sta = 0; - } - if(digitalRead(Y_MIN_PIN)==1) - { - endstopy1_sta = 1; - } - else - { - endstopy1_sta = 0; - } - if(digitalRead(Y_MAX_PIN)==1) - { - endstopy2_sta = 1; - } - else - { - endstopy2_sta = 0; - } - if(digitalRead(Z_MIN_PIN)==1) - { - endstopz1_sta = 1; - } - else - { - endstopz1_sta = 0; - } - if(digitalRead(Z_MAX_PIN)==1) - { - endstopz2_sta = 1; - } - else - { - endstopz2_sta = 0; - } + itest = 10000; + while(itest--); + pw_det_sta = (digitalRead(POWER_LOSS_PIN) == 1); + pw_off_sta = (digitalRead(PS_ON_PIN) == 1); + mt_det_sta = (digitalRead(FIL_RUNOUT_PIN) == 1); + mt_det2_sta = (digitalRead(FIL_RUNOUT_2_PIN) == 1); + mt_det3_sta = (digitalRead(FIL_RUNOUT_3_PIN) == 1); + endstopx1_sta = (digitalRead(X_MIN_PIN) == 1); + endstopx2_sta = (digitalRead(X_MAX_PIN) == 1); + endstopy1_sta = (digitalRead(Y_MIN_PIN) == 1); + endstopy2_sta = (digitalRead(Y_MAX_PIN) == 1); + endstopz1_sta = (digitalRead(Z_MIN_PIN) == 1); + endstopz2_sta = (digitalRead(Z_MAX_PIN) == 1); } -void init_Tst_GPIO() -{ + +void init_Tst_GPIO() { pinMode(X_MIN_PIN, INPUT_PULLUP); pinMode(X_MAX_PIN, INPUT_PULLUP); pinMode(Y_MIN_PIN, INPUT_PULLUP); pinMode(Y_MAX_PIN, INPUT_PULLUP); pinMode(Z_MIN_PIN, INPUT_PULLUP); pinMode(Z_MAX_PIN, INPUT_PULLUP); - + pinMode(WIFI_IO2_PIN, OUTPUT); pinMode(FIL_RUNOUT_PIN, INPUT_PULLUP); @@ -242,722 +107,690 @@ void init_Tst_GPIO() } void mks_test_beeper(){ - digitalWrite(BEEPER_PIN, HIGH); - delay(100); - digitalWrite(BEEPER_PIN, LOW); - delay(100); + digitalWrite(BEEPER_PIN, HIGH); + delay(100); + digitalWrite(BEEPER_PIN, LOW); + delay(100); } -void Test_GPIO() -{ +void Test_GPIO() { init_Tst_GPIO(); test_gpio_readlevel_L(); - test_gpio_readlevel_H(); - test_gpio_readlevel_L(); - if((pw_det_sta == 1)&&(mt_det_sta == 1)&&(mt_det2_sta == 1)&&(mt_det3_sta == 1)) - { - if(curent_disp_ui == 1) - disp_det_ok(); - } - else - { - if(curent_disp_ui == 1) - disp_det_error(); - } - if((endstopx1_sta== 1) - &&(endstopx2_sta== 1) - &&(endstopy1_sta== 1) - &&(endstopy2_sta== 1) - &&(endstopz1_sta== 1) - &&(endstopz2_sta== 1)) - { - if(curent_disp_ui == 1) - { - disp_Limit_ok(); - } - } - else - { - if(curent_disp_ui == 1) - { + test_gpio_readlevel_H(); + test_gpio_readlevel_L(); + if ((pw_det_sta == 1)&&(mt_det_sta == 1)&&(mt_det2_sta == 1)&&(mt_det3_sta == 1)) { + if (curent_disp_ui == 1) disp_det_ok(); + } + else { + if (curent_disp_ui == 1) disp_det_error(); + } + if ( (endstopx1_sta == 1) + && (endstopx2_sta == 1) + && (endstopy1_sta == 1) + && (endstopy2_sta == 1) + && (endstopz1_sta == 1) + && (endstopz2_sta == 1) + ) { + if (curent_disp_ui == 1) disp_Limit_ok(); + } + else { + if (curent_disp_ui == 1) { disp_Limit_error(); //mks_test_beeper(); - } - } + } + } } -void mks_test(){ - if(millis() % 2000 <1000){ - digitalWrite(X_DIR_PIN, LOW); - digitalWrite(Y_DIR_PIN, LOW); - digitalWrite(Z_DIR_PIN, LOW); - digitalWrite(E0_DIR_PIN, LOW); - digitalWrite(E1_DIR_PIN, LOW); +void mks_test() { + if (millis() % 2000 <1000){ + digitalWrite(X_DIR_PIN, LOW); + digitalWrite(Y_DIR_PIN, LOW); + digitalWrite(Z_DIR_PIN, LOW); + digitalWrite(E0_DIR_PIN, LOW); + digitalWrite(E1_DIR_PIN, LOW); digitalWrite(E2_DIR_PIN, LOW); thermalManager.fan_speed[0] = 255; digitalWrite(HEATER_2_PIN, HIGH);//HE2 - digitalWrite(HEATER_1_PIN, HIGH);//HE1 + digitalWrite(HEATER_1_PIN, HIGH);//HE1 digitalWrite(HEATER_0_PIN, HIGH);//HE0 digitalWrite(HEATER_BED_PIN, HIGH);//HOT-BED - } - else{ - digitalWrite(X_DIR_PIN, HIGH); - digitalWrite(Y_DIR_PIN, HIGH); - digitalWrite(Z_DIR_PIN, HIGH); - digitalWrite(E0_DIR_PIN, HIGH); - digitalWrite(E1_DIR_PIN, HIGH); + } + else { + digitalWrite(X_DIR_PIN, HIGH); + digitalWrite(Y_DIR_PIN, HIGH); + digitalWrite(Z_DIR_PIN, HIGH); + digitalWrite(E0_DIR_PIN, HIGH); + digitalWrite(E1_DIR_PIN, HIGH); digitalWrite(E2_DIR_PIN, HIGH); thermalManager.fan_speed[0] = 0; digitalWrite(HEATER_2_PIN, LOW);//HE2 - digitalWrite(HEATER_1_PIN, LOW);//HE1 + digitalWrite(HEATER_1_PIN, LOW);//HE1 digitalWrite(HEATER_0_PIN, LOW);//HE0 digitalWrite(HEATER_BED_PIN, LOW);//HOT-BED - } - if((endstopx1_sta== 1) - &&(endstopx2_sta== 1) - &&(endstopy1_sta== 1) - &&(endstopy2_sta== 1) - &&(endstopz1_sta== 1) - &&(endstopz2_sta== 1)) - { - - } - else - { - mks_test_beeper(); - } - - if(curent_disp_ui == 1) - { - disp_test(); - } - - } + } + if ( (endstopx1_sta == 1) + && (endstopx2_sta == 1) + && (endstopy1_sta == 1) + && (endstopy2_sta == 1) + && (endstopz1_sta == 1) + && (endstopz2_sta == 1) + ) { + + } + else + mks_test_beeper(); + + if (curent_disp_ui == 1) + disp_test(); +} -#endif -const uint16_t ASCII_Table_16x24[] = -{ -/** - * @brief Space ' ' - */ +#endif // MKS_TEST + +const uint16_t ASCII_Table_16x24[] = { + /** + * @brief Space ' ' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '!' - */ + /** + * @brief '!' + */ 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, 0x0000, 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '"' - */ + /** + * @brief '"' + */ 0x0000, 0x0000, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '#' - */ + /** + * @brief '#' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C60, 0x0C60, 0x0C60, 0x0630, 0x0630, 0x1FFE, 0x1FFE, 0x0630, 0x0738, 0x0318, 0x1FFE, 0x1FFE, 0x0318, 0x0318, 0x018C, 0x018C, 0x018C, 0x0000, -/** - * @brief '$' - */ + /** + * @brief '$' + */ 0x0000, 0x0080, 0x03E0, 0x0FF8, 0x0E9C, 0x1C8C, 0x188C, 0x008C, 0x0098, 0x01F8, 0x07E0, 0x0E80, 0x1C80, 0x188C, 0x188C, 0x189C, 0x0CB8, 0x0FF0, 0x03E0, 0x0080, 0x0080, 0x0000, 0x0000, 0x0000, -/** - * @brief '%' - */ + /** + * @brief '%' + */ 0x0000, 0x0000, 0x0000, 0x180E, 0x0C1B, 0x0C11, 0x0611, 0x0611, 0x0311, 0x0311, 0x019B, 0x018E, 0x38C0, 0x6CC0, 0x4460, 0x4460, 0x4430, 0x4430, 0x4418, 0x6C18, 0x380C, 0x0000, 0x0000, 0x0000, -/** - * @brief '&' - */ + /** + * @brief '&' + */ 0x0000, 0x01E0, 0x03F0, 0x0738, 0x0618, 0x0618, 0x0330, 0x01F0, 0x00F0, 0x00F8, 0x319C, 0x330E, 0x1E06, 0x1C06, 0x1C06, 0x3F06, 0x73FC, 0x21F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief ''' - */ + /** + * @brief ''' + */ 0x0000, 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '(' - */ + /** + * @brief '(' + */ 0x0000, 0x0200, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x0060, 0x0060, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0060, 0x0060, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0200, 0x0000, -/** - * @brief ')' - */ + /** + * @brief ')' + */ 0x0000, 0x0020, 0x0060, 0x00C0, 0x0180, 0x0180, 0x0300, 0x0300, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0300, 0x0300, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0020, 0x0000, -/** - * @brief '*' - */ + /** + * @brief '*' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, 0x06D8, 0x07F8, 0x01E0, 0x0330, 0x0738, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '+' - */ + /** + * @brief '+' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x3FFC, 0x3FFC, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief ',' - */ + /** + * @brief ',' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, -/** - * @brief '-' - */ + /** + * @brief '-' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07E0, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '.' - */ + /** + * @brief '.' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '/' - */ + /** + * @brief '/' + */ 0x0000, 0x0C00, 0x0C00, 0x0600, 0x0600, 0x0600, 0x0300, 0x0300, 0x0300, 0x0380, 0x0180, 0x0180, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x0060, 0x0060, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '0' - */ + /** + * @brief '0' + */ 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C18, 0x0E38, 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '1' - */ + /** + * @brief '1' + */ 0x0000, 0x0100, 0x0180, 0x01C0, 0x01F0, 0x0198, 0x0188, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '2' - */ + /** + * @brief '2' + */ 0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x1800, 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, 0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '3' - */ + /** + * @brief '3' + */ 0x0000, 0x01E0, 0x07F8, 0x0E18, 0x0C0C, 0x0C0C, 0x0C00, 0x0600, 0x03C0, 0x07C0, 0x0C00, 0x1800, 0x1800, 0x180C, 0x180C, 0x0C18, 0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '4' - */ + /** + * @brief '4' + */ 0x0000, 0x0C00, 0x0E00, 0x0F00, 0x0F00, 0x0D80, 0x0CC0, 0x0C60, 0x0C60, 0x0C30, 0x0C18, 0x0C0C, 0x3FFC, 0x3FFC, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '5' - */ + /** + * @brief '5' + */ 0x0000, 0x0FF8, 0x0FF8, 0x0018, 0x0018, 0x000C, 0x03EC, 0x07FC, 0x0E1C, 0x1C00, 0x1800, 0x1800, 0x1800, 0x180C, 0x0C1C, 0x0E18, 0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '6' - */ + /** + * @brief '6' + */ 0x0000, 0x07C0, 0x0FF0, 0x1C38, 0x1818, 0x0018, 0x000C, 0x03CC, 0x0FEC, 0x0E3C, 0x1C1C, 0x180C, 0x180C, 0x180C, 0x1C18, 0x0E38, 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '7' - */ + /** + * @brief '7' + */ 0x0000, 0x1FFC, 0x1FFC, 0x0C00, 0x0600, 0x0600, 0x0300, 0x0380, 0x0180, 0x01C0, 0x00C0, 0x00E0, 0x0060, 0x0060, 0x0070, 0x0030, 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '8' - */ + /** + * @brief '8' + */ 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x0C18, 0x0C18, 0x0638, 0x07F0, 0x07F0, 0x0C18, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C38, 0x0FF8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '9' - */ + /** + * @brief '9' + */ 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C1C, 0x180C, 0x180C, 0x180C, 0x1C1C, 0x1E38, 0x1BF8, 0x19E0, 0x1800, 0x0C00, 0x0C00, 0x0E1C, 0x07F8, 0x01F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief ':' - */ + /** + * @brief ':' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief ';' - */ + /** + * @brief ';' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, 0x0000, -/** - * @brief '<' - */ + /** + * @brief '<' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x1C00, 0x0F80, 0x03E0, 0x00F8, 0x0018, 0x00F8, 0x03E0, 0x0F80, 0x1C00, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '=' - */ + /** + * @brief '=' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1FF8, 0x0000, 0x0000, 0x0000, 0x1FF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '>' - */ + /** + * @brief '>' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0038, 0x01F0, 0x07C0, 0x1F00, 0x1800, 0x1F00, 0x07C0, 0x01F0, 0x0038, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '?' - */ + /** + * @brief '?' + */ 0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '@' - */ + /** + * @brief '@' + */ 0x0000, 0x0000, 0x07E0, 0x1818, 0x2004, 0x29C2, 0x4A22, 0x4411, 0x4409, 0x4409, 0x4409, 0x2209, 0x1311, 0x0CE2, 0x4002, 0x2004, 0x1818, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'A' - */ + /** + * @brief 'A' + */ 0x0000, 0x0380, 0x0380, 0x06C0, 0x06C0, 0x06C0, 0x0C60, 0x0C60, 0x1830, 0x1830, 0x1830, 0x3FF8, 0x3FF8, 0x701C, 0x600C, 0x600C, 0xC006, 0xC006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'B' - */ + /** + * @brief 'B' + */ 0x0000, 0x03FC, 0x0FFC, 0x0C0C, 0x180C, 0x180C, 0x180C, 0x0C0C, 0x07FC, 0x0FFC, 0x180C, 0x300C, 0x300C, 0x300C, 0x300C, 0x180C, 0x1FFC, 0x07FC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'C' - */ + /** + * @brief 'C' + */ 0x0000, 0x07C0, 0x1FF0, 0x3838, 0x301C, 0x700C, 0x6006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x6006, 0x700C, 0x301C, 0x1FF0, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'D' - */ + /** + * @brief 'D' + */ 0x0000, 0x03FE, 0x0FFE, 0x0E06, 0x1806, 0x1806, 0x3006, 0x3006, 0x3006, 0x3006, 0x3006, 0x3006, 0x3006, 0x1806, 0x1806, 0x0E06, 0x0FFE, 0x03FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'E' - */ + /** + * @brief 'E' + */ 0x0000, 0x3FFC, 0x3FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x1FFC, 0x1FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x3FFC, 0x3FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'F' - */ + /** + * @brief 'F' + */ 0x0000, 0x3FF8, 0x3FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'G' - */ + /** + * @brief 'G' + */ 0x0000, 0x0FE0, 0x3FF8, 0x783C, 0x600E, 0xE006, 0xC007, 0x0003, 0x0003, 0xFE03, 0xFE03, 0xC003, 0xC007, 0xC006, 0xC00E, 0xF03C, 0x3FF8, 0x0FE0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'H' - */ + /** + * @brief 'H' + */ 0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x3FFC, 0x3FFC, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'I' - */ + /** + * @brief 'I' + */ 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'J' - */ + /** + * @brief 'J' + */ 0x0000, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0618, 0x0618, 0x0738, 0x03F0, 0x01E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'K' - */ + /** + * @brief 'K' + */ 0x0000, 0x3006, 0x1806, 0x0C06, 0x0606, 0x0306, 0x0186, 0x00C6, 0x0066, 0x0076, 0x00DE, 0x018E, 0x0306, 0x0606, 0x0C06, 0x1806, 0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'L' - */ + /** + * @brief 'L' + */ 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x1FF8, 0x1FF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'M' - */ + /** + * @brief 'M' + */ 0x0000, 0xE00E, 0xF01E, 0xF01E, 0xF01E, 0xD836, 0xD836, 0xD836, 0xD836, 0xCC66, 0xCC66, 0xCC66, 0xC6C6, 0xC6C6, 0xC6C6, 0xC6C6, 0xC386, 0xC386, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'N' - */ + /** + * @brief 'N' + */ 0x0000, 0x300C, 0x301C, 0x303C, 0x303C, 0x306C, 0x306C, 0x30CC, 0x30CC, 0x318C, 0x330C, 0x330C, 0x360C, 0x360C, 0x3C0C, 0x3C0C, 0x380C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'O' - */ + /** + * @brief 'O' + */ 0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xC003, 0xC003, 0xC003, 0xC003, 0xC003, 0xC003, 0xC003, 0x6006, 0x700E, 0x381C, 0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'P' - */ + /** + * @brief 'P' + */ 0x0000, 0x0FFC, 0x1FFC, 0x380C, 0x300C, 0x300C, 0x300C, 0x300C, 0x180C, 0x1FFC, 0x07FC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'Q' - */ + /** + * @brief 'Q' + */ 0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xE003, 0xC003, 0xC003, 0xC003, 0xC003, 0xC003, 0xE007, 0x6306, 0x3F0E, 0x3C1C, 0x3FF8, 0xF7E0, 0xC000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'R' - */ + /** + * @brief 'R' + */ 0x0000, 0x0FFE, 0x1FFE, 0x3806, 0x3006, 0x3006, 0x3006, 0x3806, 0x1FFE, 0x07FE, 0x0306, 0x0606, 0x0C06, 0x1806, 0x1806, 0x3006, 0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'S' - */ + /** + * @brief 'S' + */ 0x0000, 0x03E0, 0x0FF8, 0x0C1C, 0x180C, 0x180C, 0x000C, 0x001C, 0x03F8, 0x0FE0, 0x1E00, 0x3800, 0x3006, 0x3006, 0x300E, 0x1C1C, 0x0FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'T' - */ + /** + * @brief 'T' + */ 0x0000, 0x7FFE, 0x7FFE, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'U' - */ + /** + * @brief 'U' + */ 0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x1818, 0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'V' - */ + /** + * @brief 'V' + */ 0x0000, 0x6003, 0x3006, 0x3006, 0x3006, 0x180C, 0x180C, 0x180C, 0x0C18, 0x0C18, 0x0E38, 0x0630, 0x0630, 0x0770, 0x0360, 0x0360, 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'W' - */ + /** + * @brief 'W' + */ 0x0000, 0x6003, 0x61C3, 0x61C3, 0x61C3, 0x3366, 0x3366, 0x3366, 0x3366, 0x3366, 0x3366, 0x1B6C, 0x1B6C, 0x1B6C, 0x1A2C, 0x1E3C, 0x0E38, 0x0E38, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'X' - */ + /** + * @brief 'X' + */ 0x0000, 0xE00F, 0x700C, 0x3018, 0x1830, 0x0C70, 0x0E60, 0x07C0, 0x0380, 0x0380, 0x03C0, 0x06E0, 0x0C70, 0x1C30, 0x1818, 0x300C, 0x600E, 0xE007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'Y' - */ + /** + * @brief 'Y' + */ 0x0000, 0xC003, 0x6006, 0x300C, 0x381C, 0x1838, 0x0C30, 0x0660, 0x07E0, 0x03C0, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'Z' - */ + /** + * @brief 'Z' + */ 0x0000, 0x7FFC, 0x7FFC, 0x6000, 0x3000, 0x1800, 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, 0x000C, 0x0006, 0x7FFE, 0x7FFE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '[' - */ + /** + * @brief '[' + */ 0x0000, 0x03E0, 0x03E0, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x03E0, 0x03E0, 0x0000, -/** - * @brief '\' - */ + /** + * @brief '\' + */ 0x0000, 0x0030, 0x0030, 0x0060, 0x0060, 0x0060, 0x00C0, 0x00C0, 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0300, 0x0300, 0x0300, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief ']' - */ + /** + * @brief ']' + */ 0x0000, 0x03E0, 0x03E0, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x03E0, 0x03E0, 0x0000, -/** - * @brief '^' - */ + /** + * @brief '^' + */ 0x0000, 0x0000, 0x01C0, 0x01C0, 0x0360, 0x0360, 0x0360, 0x0630, 0x0630, 0x0C18, 0x0C18, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '_' - */ + /** + * @brief '_' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief ''' - */ + /** + * @brief ''' + */ 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'a' - */ + /** + * @brief 'a' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03F0, 0x07F8, 0x0C1C, 0x0C0C, 0x0F00, 0x0FF0, 0x0CF8, 0x0C0C, 0x0C0C, 0x0F1C, 0x0FF8, 0x18F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'b' - */ + /** + * @brief 'b' + */ 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x03D8, 0x0FF8, 0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38, 0x0FF8, 0x03D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'c' - */ + /** + * @brief 'c' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x07F0, 0x0E30, 0x0C18, 0x0018, 0x0018, 0x0018, 0x0018, 0x0C18, 0x0E30, 0x07F0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'd' - */ + /** + * @brief 'd' + */ 0x0000, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x1BC0, 0x1FF0, 0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30, 0x1FF0, 0x1BC0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'e' - */ + /** + * @brief 'e' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0, 0x0C30, 0x1818, 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x1838, 0x1C30, 0x0FF0, 0x07C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'f' - */ + /** + * @brief 'f' + */ 0x0000, 0x0F80, 0x0FC0, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'g' - */ + /** + * @brief 'g' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0DE0, 0x0FF8, 0x0E18, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0E18, 0x0FF8, 0x0DE0, 0x0C00, 0x0C0C, 0x061C, 0x07F8, 0x01F0, 0x0000, -/** - * @brief 'h' - */ + /** + * @brief 'h' + */ 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x07D8, 0x0FF8, 0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'i' - */ + /** + * @brief 'i' + */ 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'j' - */ + /** + * @brief 'j' + */ 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00F8, 0x0078, 0x0000, -/** - * @brief 'k' - */ + /** + * @brief 'k' + */ 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0C0C, 0x060C, 0x030C, 0x018C, 0x00CC, 0x006C, 0x00FC, 0x019C, 0x038C, 0x030C, 0x060C, 0x0C0C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'l' - */ + /** + * @brief 'l' + */ 0x0000, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'm' - */ + /** + * @brief 'm' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3C7C, 0x7EFF, 0xE3C7, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'n' - */ + /** + * @brief 'n' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0798, 0x0FF8, 0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'o' - */ + /** + * @brief 'o' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0, 0x0C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C30, 0x0FF0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'p' - */ + /** + * @brief 'p' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03D8, 0x0FF8, 0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38, 0x0FF8, 0x03D8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0000, -/** - * @brief 'q' - */ + /** + * @brief 'q' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1BC0, 0x1FF0, 0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30, 0x1FF0, 0x1BC0, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x0000, -/** - * @brief 'r' - */ + /** + * @brief 'r' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07B0, 0x03F0, 0x0070, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 's' - */ + /** + * @brief 's' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03E0, 0x03F0, 0x0E38, 0x0C18, 0x0038, 0x03F0, 0x07C0, 0x0C00, 0x0C18, 0x0E38, 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 't' - */ + /** + * @brief 't' + */ 0x0000, 0x0000, 0x0080, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x07C0, 0x0780, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'u' - */ + /** + * @brief 'u' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C38, 0x1FF0, 0x19E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'v' - */ + /** + * @brief 'v' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x180C, 0x0C18, 0x0C18, 0x0C18, 0x0630, 0x0630, 0x0630, 0x0360, 0x0360, 0x0360, 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'w' - */ + /** + * @brief 'w' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41C1, 0x41C1, 0x61C3, 0x6363, 0x6363, 0x6363, 0x3636, 0x3636, 0x3636, 0x1C1C, 0x1C1C, 0x1C1C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'x' - */ + /** + * @brief 'x' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x381C, 0x1C38, 0x0C30, 0x0660, 0x0360, 0x0360, 0x0360, 0x0360, 0x0660, 0x0C30, 0x1C38, 0x381C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief 'y' - */ + /** + * @brief 'y' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3018, 0x1830, 0x1830, 0x1870, 0x0C60, 0x0C60, 0x0CE0, 0x06C0, 0x06C0, 0x0380, 0x0380, 0x0380, 0x0180, 0x0180, 0x01C0, 0x00F0, 0x0070, 0x0000, -/** - * @brief 'z' - */ + /** + * @brief 'z' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1FFC, 0x1FFC, 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, 0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -/** - * @brief '{' - */ + /** + * @brief '{' + */ 0x0000, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x0060, 0x0060, 0x0030, 0x0060, 0x0040, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0000, 0x0000, -/** - * @brief '|' - */ + /** + * @brief '|' + */ 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, -/** - * @brief '}' - */ + /** + * @brief '}' + */ 0x0000, 0x0060, 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0300, 0x0300, 0x0600, 0x0300, 0x0100, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0000, 0x0000, -/** - * @brief '~' - */ + /** + * @brief '~' + */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x10F0, 0x1FF8, 0x0F08, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, }; -void disp_char_1624(uint16_t x,uint16_t y,uint8_t c,uint16_t charColor,uint16_t bkColor) -{ - - uint16_t i=0; - uint16_t j=0; - - uint16_t tmp_char=0; - for (i=0;i<24;i++) - { - tmp_char=ASCII_Table_16x24[((c-0x20)*24)+i]; - for (j=0;j<16;j++) - { - if ( ((tmp_char >> j) & 0x01) == 0x01) - { - tft_set_point(x+j,y+i,charColor); - } - else - { - tft_set_point(x+j,y+i,bkColor); - } - } +void disp_char_1624(uint16_t x,uint16_t y,uint8_t c,uint16_t charColor,uint16_t bkColor) { + uint16_t i = 0, j = 0; + uint16_t tmp_char = 0; + for (i=0;i<24;i++) { + tmp_char=ASCII_Table_16x24[((c-0x20)*24)+i]; + for (j=0;j<16;j++) { + if (((tmp_char >> j) & 0x01) == 0x01) + tft_set_point(x + j, y + i, charColor); + else + tft_set_point(x + j, y + i, bkColor); } - + } } -void disp_string(uint16_t x,uint16_t y,const char * string,uint16_t charColor,uint16_t bkColor) -{ - while(*string != '\0') - { - disp_char_1624(x,y,*string,charColor,bkColor); - string++; - x+=16; - } +void disp_string(uint16_t x,uint16_t y,const char * string,uint16_t charColor,uint16_t bkColor) { + while(*string != '\0') { + disp_char_1624(x,y,*string,charColor,bkColor); + string++; + x+=16; + } } //static lv_obj_t * scr_test; -void disp_pic_update() -{ - LCD_Clear(0x0000); - disp_string(120,150,"PIC Updating...",0xffff,0x0000); +void disp_pic_update() { + LCD_Clear(0x0000); + disp_string(120,150,"PIC Updating...",0xffff,0x0000); } -void disp_font_update() -{ - LCD_Clear(0x0000); - disp_string(120,150,"FONT Updating...",0xffff,0x0000); +void disp_font_update() { + LCD_Clear(0x0000); + disp_string(120,150,"FONT Updating...",0xffff,0x0000); } - -#endif - +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.h b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.h new file mode 100644 index 000000000000..f8b117770633 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.h @@ -0,0 +1,31 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "lvgl.h" + +void Test_GPIO(); +void disp_char_1624(uint16_t x,uint16_t y,uint8_t c,uint16_t charColor,uint16_t bkColor); +void disp_string(uint16_t x,uint16_t y,const char * string,uint16_t charColor,uint16_t bkColor); +void mks_test(); +void disp_pic_update(); +void disp_font_update(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp new file mode 100644 index 000000000000..1b1b7034584e --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp @@ -0,0 +1,753 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + +#if ENABLED(TFT_LITTLE_VGL_UI) + +//#include "type_define.h" +#include "string.h" + +#include "pic_manager.h" +#include "W25Qxx.h" +#include "../../../../sd/cardreader.h" +#include "draw_ready_print.h" +#include "mks_hardware_test.h" + +//#include "gui.h" +//#include "spi_flash.h" + +//uint8_t DMA_ERRO_FLAG; +extern uint16_t DeviceCode; +extern unsigned char bmp_public_buf[17 * 1024]; + +#if ENABLED(SDSUPPORT) +extern char *createFilename(char * const buffer, const dir_t &p); +#endif + +/*void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) { +}*/ +uint32_t lv_get_pic_addr(uint8_t *Pname) { + uint8_t Pic_cnt; + uint8_t i, j; + PIC_MSG PIC; + uint32_t tmp_cnt = 0; + uint32_t addr=0; + + W25QXX.init(SPI_QUARTER_SPEED); + + W25QXX.SPI_FLASH_BufferRead(&Pic_cnt,PIC_COUNTER_ADDR,1); + if (Pic_cnt == 0xff) { + Pic_cnt = 0; + } + for (i=0;i= logo_maxsize) + LogoWrite_Addroffset = 0; + return 1; +} + +uint32_t TitleLogoWrite_Addroffset = 0; +uint8_t Pic_TitleLogo_Write(uint8_t *TitleLogoName,uint8_t *TitleLogo_Wbuff,uint32_t TitleLogoWriteSize) { + //uint32_t i; + //uint8_t temp1; + if (TitleLogoWriteSize <= 0) + return 0; + if ((DeviceCode == 0x9488) || (DeviceCode == 0x5761)) + W25QXX.SPI_FLASH_BufferWrite(TitleLogo_Wbuff,PIC_ICON_LOGO_ADDR_TFT35+TitleLogoWrite_Addroffset,TitleLogoWriteSize); + else + W25QXX.SPI_FLASH_BufferWrite(TitleLogo_Wbuff,PIC_ICON_LOGO_ADDR_TFT32+TitleLogoWrite_Addroffset,TitleLogoWriteSize); + TitleLogoWrite_Addroffset += TitleLogoWriteSize; + if (TitleLogoWrite_Addroffset >= TITLELOGO_MAX_SIZE) + TitleLogoWrite_Addroffset = 0; + return 1; +} + +uint32_t default_view_addroffset_r = 0; +void default_view_Write(uint8_t *default_view__Rbuff,uint32_t default_view_Writesize) { + W25QXX.SPI_FLASH_BufferWrite(default_view__Rbuff,DEFAULT_VIEW_ADDR_TFT35+default_view_addroffset_r,default_view_Writesize); + default_view_addroffset_r += default_view_Writesize; + if (default_view_addroffset_r >= DEFAULT_VIEW_MAX_SIZE) + default_view_addroffset_r = 0; +} + +uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { + uint8_t pic_counter = 0; + uint32_t Pic_SaveAddr; + uint32_t Pic_SizeSaveAddr; + uint32_t Pic_NameSaveAddr; + //uint8_t temp; + uint8_t Pname_temp; + uint32_t i,j; + uint32_t name_len = 0; + uint32_t SaveName_len = 0; + union union32 size_tmp; + //union union32 size1; + //uint8_t Pn[PIC_NAME_MAX_LEN]; + //uint8_t cnt_temp; + //uint16_t n0; + //uint32_t Name_saveAddr = 0; + //uint8_t pic_position; + + W25QXX.SPI_FLASH_BufferRead(&pic_counter,PIC_COUNTER_ADDR,1); + + if (pic_counter == 0xFF) + pic_counter = 0; + + if ((DeviceCode==0x9488)||(DeviceCode==0x5761)) + Pic_SaveAddr = PIC_DATA_ADDR_TFT35 + pic_counter * PER_PIC_MAX_SPACE_TFT35; + else + Pic_SaveAddr = PIC_DATA_ADDR_TFT32 + pic_counter * PER_PIC_MAX_SPACE_TFT32; + + for (j = 0;j < pic_counter;j ++) { + do { + W25QXX.SPI_FLASH_BufferRead(&Pname_temp,PIC_NAME_ADDR + SaveName_len,1); + SaveName_len ++; + } while (Pname_temp != '\0'); + } + i = 0; + while ((*(P_name+i) != '\0')) { + i++; + name_len++; + } + + Pic_NameSaveAddr = PIC_NAME_ADDR + SaveName_len; + W25QXX.SPI_FLASH_BufferWrite(P_name,Pic_NameSaveAddr,name_len+1); + Pic_SizeSaveAddr = PIC_SIZE_ADDR+4*pic_counter; + size_tmp.dwords = P_size; + W25QXX.SPI_FLASH_BufferWrite(size_tmp.bytes,Pic_SizeSaveAddr,4); + + pic_counter++; + W25QXX.SPI_FLASH_SectorErase(PIC_COUNTER_ADDR); + W25QXX.SPI_FLASH_BufferWrite(&pic_counter,PIC_COUNTER_ADDR,1); + + return Pic_SaveAddr; +} + +uint8_t public_buf[512]; + +//uint8_t public_buf_test[512]; +#if ENABLED(SDSUPPORT) +void UpdatePic() { + //int r; + //unsigned char *p; + //char rootPath[10]={0}; + char *fn; + unsigned char logoFlag; + uint16_t pbr; + uint32_t pfileSize; + uint32_t Pic_Write_Addr; + /*----------------------------------*/ + + // FILINFO fno; + //DIR dir; + //char tmp[30]; + #if 0//_USE_LFN + static char lfn[_MAX_LFN + 1]; + finfo.lfname = lfn; + finfo.lfsize = sizeof(lfn); + #endif + //SdFile curDir; + //if (f_opendir(&dirs, picPath) == FR_OK) + //card.cd(picPath); + + //const uint16_t fileCnt = card.get_num_Files(); + + //SdFile *curDir; + //SdFile dir; + //dir.open(picPath, O_READ); + //const char * const fname = card.diveToFile(true, curDir, picPath); + //if (!fname) return; + + SdFile dir, root = card.getroot(); + if (dir.open(&root, picPath, O_RDONLY)) { + + disp_pic_update(); + spiFlashErase_PIC(); + + dir_t d; + while (dir.readDir(&d, card.longFilename) > 0) { + #if 1 + /* + if (power_det == 0) { + PW_DET_ON; + power_det=0; + } + SPI_FLASH_Init(); + */ + + //for (uint16_t i = 0; i < fileCnt; i++) { + //res = f_readdir(&dirs, &finfo); + //card.getfilename_sorted(i); + + if (card.longFilename[0] == 0) { + break; + } + /*if ( card.filename[0] == '.') + continue; + */ + if ( card.longFilename[0] == '.') + continue; + + fn = card.longFilename; + + /*if ((finfo.lfname[0] == 0) || (finfo.lfname == 0)) + fn = finfo.fname; + else + fn = finfo.lfname;*/ + + /* if (fno.fattrib & AM_DIR) + { + continue; + } + else */ + //{ + //if ((strstr(fn, ".gco")) || (strstr(fn, ".GCO")) || (fno.fattrib & AM_DIR)) + if (strstr(fn, ".bin")) { + if (strstr(fn, "_logo")) + logoFlag = 1; + else if (strstr(fn, "_titlelogo")) + logoFlag = 2; + else if (strstr(fn, "_preview")) + logoFlag = 3; + else + logoFlag = 0; + + //public_buf[0] = '\0'; + //strcat(public_buf, picPath); + //strcat(public_buf, "/"); + char dosFilename[FILENAME_LENGTH]; + createFilename(dosFilename, d); + //strcat(public_buf, dosFilename); + + SdFile file; + if (file.open(&dir, dosFilename, O_READ)) { + #if 1 + /*LCD_Clear(BACK_COLOR); + + if ((DeviceCode==0x9488)||(DeviceCode==0x5761)) { + LCD_ShowString(170,100,200,24,24,(u8 *)fn); + LCD_ShowString(180,130,200,24,24,"Updating..."); + } + else { + LCD_ShowString(90,90,200,24,24,(u8 *)fn); + LCD_ShowString(90,120,200,24,24,"Updating..."); + } + */ + if (logoFlag == 1) { + while (1) { + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + Pic_Logo_Write((uint8_t *)fn,public_buf,pbr); // + if (pbr < BMP_WRITE_BUF_LEN) break; + } + } + else if (logoFlag == 2) { + while (1) { + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + Pic_TitleLogo_Write((uint8_t *)fn,public_buf,pbr); // + if (pbr < BMP_WRITE_BUF_LEN) break; + } + } + else if (logoFlag == 3) + { + while (1) + { + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + default_view_Write(public_buf,pbr); // + if (pbr < BMP_WRITE_BUF_LEN) break; + } + } + else + { + pfileSize = file.fileSize(); + Pic_Write_Addr = Pic_Info_Write((uint8_t *)fn,pfileSize); + //uint32_t addr_test = Pic_Write_Addr; + //memset(bmp_public_buf, 0xff, BMP_WRITE_BUF_LEN); + while (1) + { + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + W25QXX.SPI_FLASH_BufferWrite(public_buf,Pic_Write_Addr,pbr); + Pic_Write_Addr += pbr; + if (pbr < BMP_WRITE_BUF_LEN) break; + } + //W25QXX.SPI_FLASH_BufferRead(public_buf_test,addr_test,BMP_WRITE_BUF_LEN); + } + + /*--------------read test--------------------*/ + /* + BufferSet(picBuffer, 0xff, PICTURE_MAX_SIZE); + if (logoFlag == 0) + { + PicMsg_Init(); + Pic_Read(fn,picBuffer); + } + else + Pic_Logo_Read(fn,picBuffer,PICTURE_MAX_SIZE); + */ + /*--------------read test--------------------*/ + + file.close(); + #endif + } + + } + //} + //} + /* + LCD_Clear(LCD_COLOR_BLACK); + //LCD_ShowString(110,100,200,24,24,"Complete"); + LCD_DisplayString(110,80,"Complete"); + delay(0xfffff); + */ + //r = f_chdir("/"); + #if 1 + //SdFile dir, root = card.getroot(); + /*if (dir.open(&root, bakPath, O_RDONLY)) + { + dir.remove(); + }*/ + + //r = f_rename(picPath, bakPath); + + + //update_flag_ok = 1; + #endif + #endif + } + dir.rename(&root, bakPath); + } +} + + +void spi_flash_read_test() { + W25QXX.SPI_FLASH_BufferRead(public_buf,UNIGBK_FLASH_ADDR,BMP_WRITE_BUF_LEN); +} + +void UpdateFont() { + //int r; + //unsigned char *p; + //char rootPath[10]={0}; + char *fn; + //unsigned char logoFlag; + uint16_t pbr; + uint32_t flashaddr=0; + //uint32_t pfileSize; + //uint32_t Pic_Write_Addr; + /*----------------------------------*/ + + // FILINFO fno; + //DIR dir; + //char tmp[30]; + #if 0//_USE_LFN + static char lfn[_MAX_LFN + 1]; + finfo.lfname = lfn; + finfo.lfsize = sizeof(lfn); + #endif + //SdFile curDir; + //if (f_opendir(&dirs, picPath) == FR_OK) + //card.cd(picPath); + + //const uint16_t fileCnt = card.get_num_Files(); + + //SdFile *curDir; + //SdFile dir; + //dir.open(picPath, O_READ); + //const char * const fname = card.diveToFile(true, curDir, picPath); + //if (!fname) return; + + SdFile dir, root = card.getroot(); + if (dir.open(&root, fontPath, O_RDONLY)) + { + + disp_font_update(); + spiFlashErase_FONT(); + + dir_t d; + while (dir.readDir(&d, card.longFilename) > 0) + { + #if 1 + /*if (power_det == 0) + { + PW_DET_ON; + power_det=0; + } + SPI_FLASH_Init();*/ + + + //for (uint16_t i = 0; i < fileCnt; i++) + //{ + //res = f_readdir(&dirs, &finfo); + //card.getfilename_sorted(i); + + if (card.longFilename[0] == 0) + { + break; + } + /*if ( card.filename[0] == '.') + continue; + */ + if ( card.longFilename[0] == '.') + continue; + + fn = card.longFilename; + + /*if ((finfo.lfname[0] == 0) || (finfo.lfname == 0)) + fn = finfo.fname; + else + fn = finfo.lfname;*/ + + /* if (fno.fattrib & AM_DIR) + { + continue; + } + else */ + //{ + //if ((strstr(fn, ".gco")) || (strstr(fn, ".GCO")) || (fno.fattrib & AM_DIR)) + if (strstr(fn, ".bin")) + { + char dosFilename[FILENAME_LENGTH]; + createFilename(dosFilename, d); + //strcat(public_buf, dosFilename); + + SdFile file; + if (file.open(&dir, dosFilename, O_READ)) + { + + #if 1 + /*LCD_Clear(BACK_COLOR); + + if ((DeviceCode==0x9488)||(DeviceCode==0x5761)) + { + LCD_ShowString(170,100,200,24,24,(u8 *)fn); + LCD_ShowString(180,130,200,24,24,"Updating..."); + } + else + { + LCD_ShowString(90,90,200,24,24,(u8 *)fn); + LCD_ShowString(90,120,200,24,24,"Updating..."); + } + */ + flashaddr=UNIGBK_FLASH_ADDR; + pbr = 0; + while (1) + { + flashaddr += pbr; + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + W25QXX.SPI_FLASH_BufferWrite(public_buf,flashaddr,pbr); + //W25QXX.SPI_FLASH_BufferRead(public_buf_test,flashaddr,pbr); + /*if (UNIGBKFlag == 1) + { + fontrate = (uint16_t)(((float)(flashaddr - UNIGBK_FLASH_ADDR)/(float)(psrc.fsize))*100); + } + else + { + fontrate = (uint16_t)(((float)(flashaddr - GBK_FLASH_ADDR)/(float)(psrc.fsize))*100); + } + + if (fontrate > 99) fontrate=99; + + if (fontrate < 10) + { + fontString[0] = fontrate%10 + 0x30; + fontString[1] = '%'; + fontString[2] = '\0'; + } + else + { + fontString[0] = fontrate/10 + 0x30; + fontString[1] = fontrate%10 + 0x30; + fontString[2] = '%'; + fontString[3] = '\0'; + }*/ + //LCD_DisplayString(140,130,fontString); + if ((DeviceCode==0x9488)||(DeviceCode==0x5761)) + { + //LCD_ShowString(200,160,200,24,24,fontString); + } + else + { + //LCD_ShowString(140,150,200,24,24,fontString); + } + if (pbr < BMP_WRITE_BUF_LEN) break; + } + /*--------------read test--------------------*/ + /* + BufferSet(picBuffer, 0xff, PICTURE_MAX_SIZE); + if (logoFlag == 0) + { + PicMsg_Init(); + Pic_Read(fn,picBuffer); + } + else + Pic_Logo_Read(fn,picBuffer,PICTURE_MAX_SIZE); + */ + /*--------------read test--------------------*/ + + file.close(); + #endif + } + + } + //} + //} + /* + LCD_Clear(LCD_COLOR_BLACK); + //LCD_ShowString(110,100,200,24,24,"Complete"); + LCD_DisplayString(110,80,"Complete"); + delay(0xfffff); + */ + //r = f_chdir("/"); + #if 1 + //SdFile dir, root = card.getroot(); + /*if (dir.open(&root, bakPath, O_RDONLY)) + { + dir.remove(); + }*/ + dir.rename(&root, bakFont); + //r = f_rename(picPath, bakPath); + + + //update_flag_ok = 1; + #endif + #endif + } + } +} +#endif +#endif + +#if 1 +void Pic_Read(uint8_t *Pname,uint8_t *P_Rbuff) { + uint8_t i, j; + uint8_t Pic_cnt; + uint32_t tmp_cnt = 0; + PIC_MSG PIC; + + //void SPI_FLASH_BufferRead(u8* pBuffer, u32 ReadAddr, u16 NumByteToRead); + + W25QXX.SPI_FLASH_BufferRead(&Pic_cnt,PIC_COUNTER_ADDR,1); + if (Pic_cnt == 0xff) { + Pic_cnt = 0; + } + + for (i=0;i= LOGO_MAX_SIZE_TFT35 ) { + logo_addroffset = 0; + } +} + +uint32_t default_view_addroffset = 0; +void default_view_Read(uint8_t *default_view_Rbuff,uint32_t default_view_Readsize) { + W25QXX.init(SPI_QUARTER_SPEED); + + W25QXX.SPI_FLASH_BufferRead(default_view_Rbuff,DEFAULT_VIEW_ADDR_TFT35+default_view_addroffset+4,default_view_Readsize); + default_view_addroffset += default_view_Readsize; + if (default_view_addroffset >= DEFAULT_VIEW_MAX_SIZE) { + default_view_addroffset = 0; + } + +} + +uint32_t flash_view_addroffset = 0; +void flash_view_Read(uint8_t *flash_view_Rbuff,uint32_t flash_view_Readsize) { + W25QXX.init(SPI_QUARTER_SPEED); + + W25QXX.SPI_FLASH_BufferRead(flash_view_Rbuff,BAK_VIEW_ADDR_TFT35+flash_view_addroffset,flash_view_Readsize); + flash_view_addroffset += flash_view_Readsize; + if (flash_view_addroffset >= FLASH_VIEW_MAX_SIZE) { + flash_view_addroffset = 0; + } + +} + +#endif + +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/pic_manager.h b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h similarity index 68% rename from Marlin/src/lcd/extui/lib/mks_ui/inc/pic_manager.h rename to Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h index 69a54a798b92..3546a71be081 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/pic_manager.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h @@ -1,8 +1,28 @@ -#ifndef _PIC_MANAGER_H_ -#define _PIC_MANAGER_H_ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once #if defined(__cplusplus) -extern "C" { /* Make sure we have C-declarations in C++ programs */ +extern "C" { /* C-declarations for C++ */ #endif #include @@ -14,13 +34,13 @@ extern "C" { /* Make sure we have C-declarations in C++ programs */ #define PIC_MAX_CN 100 //Maximum number of pictures #define PIC_NAME_MAX_LEN 50 //Picture name maximum length -#define LOGO_MAX_SIZE_TFT35 (300*1024) -#define LOGO_MAX_SIZE_TFT32 (150*1024) +#define LOGO_MAX_SIZE_TFT35 (300*1024) +#define LOGO_MAX_SIZE_TFT32 (150*1024) #define TITLELOGO_MAX_SIZE (150*1024) //little logo maximum #define DEFAULT_VIEW_MAX_SIZE (200*200*2) #define FLASH_VIEW_MAX_SIZE (200*200*2) -#define PER_PIC_MAX_SPACE_TFT35 (32*1024) +#define PER_PIC_MAX_SPACE_TFT35 (32*1024) #define PER_PIC_MAX_SPACE_TFT32 (16*1024) #define PER_FONT_MAX_SPACE (16*1024) @@ -36,11 +56,11 @@ extern "C" { /* Make sure we have C-declarations in C++ programs */ #define DEFAULT_VIEW_ADDR_TFT35 0XC5800 #define BAK_VIEW_ADDR_TFT35 (DEFAULT_VIEW_ADDR_TFT35+90*1024) #define PIC_ICON_LOGO_ADDR_TFT35 (BAK_VIEW_ADDR_TFT35+80*1024) -#define PIC_DATA_ADDR_TFT35 (PIC_ICON_LOGO_ADDR_TFT35+350*1024)//0XC5800 +#define PIC_DATA_ADDR_TFT35 (PIC_ICON_LOGO_ADDR_TFT35+350*1024)//0XC5800 //TFT32 -#define PIC_DATA_ADDR_TFT32 0x02f000 -#define PIC_ICON_LOGO_ADDR_TFT32 0x5d8000 -#define PIC_OTHER_SIZE_ADDR_TFT32 0X5ee000 +#define PIC_DATA_ADDR_TFT32 0x02f000 +#define PIC_ICON_LOGO_ADDR_TFT32 0x5d8000 +#define PIC_OTHER_SIZE_ADDR_TFT32 0X5ee000 //font #define FONTINFOADDR 0x600000//6M -- font addr @@ -72,7 +92,7 @@ typedef struct pic_msg PIC_MSG; #define PICINFOADDR 0 #define PIC_SIZE_xM 6 -#define FONT_SIZE_xM 2 +#define FONT_SIZE_xM 2 //extern void PicMsg_Init(void); @@ -95,8 +115,5 @@ extern void default_view_Read(uint8_t *default_view_Rbuff,uint32_t default_view_ extern void flash_view_Read(uint8_t *flash_view_Rbuff,uint32_t flash_view_Readsize); #if defined(__cplusplus) -} /* Make sure we have C-declarations in C++ programs */ +} /* C-declarations for C++ */ #endif - -#endif - diff --git a/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.cpp new file mode 100644 index 000000000000..e681fb542ea9 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.cpp @@ -0,0 +1,219 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + +#if ENABLED(TFT_LITTLE_VGL_UI) + +#include "lv_conf.h" +#include "draw_ui.h" +#include "../../../../module/temperature.h" +#include "../../../../module/motion.h" +#include "../../../../sd/cardreader.h" +#include "../../../../gcode/queue.h" + +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../../feature/powerloss.h" +#endif + +#include "../../../../gcode/gcode.h" +#include "../../../../module/planner.h" + +extern uint32_t To_pre_view; +extern uint8_t flash_preview_begin, default_preview_flg, gcode_preview_over; + +void printer_state_polling() { + if (uiCfg.print_state == PAUSING) { + #if ENABLED(SDSUPPORT) + if (!planner.has_blocks_queued() && card.getIndex() > MIN_FILE_PRINTED) //���� �ļ��� M109��M190ָ�� + uiCfg.waitEndMoves++; + + if (uiCfg.waitEndMoves > 20) { + uiCfg.waitEndMoves = 0; + planner.synchronize(); + gcode.process_subcommands_now_P(PSTR("M25")); + gcode.process_subcommands_now_P(PSTR("G91")); + gcode.process_subcommands_now_P(PSTR("G1 Z5")); + gcode.process_subcommands_now_P(PSTR("G90")); + + uiCfg.print_state = PAUSED; + + //#if ENABLED(POWER_LOSS_RECOVERY) + // if (recovery.enabled) recovery.save(true); + //#endif + gCfgItems.pause_reprint = 1; + update_spi_flash(); + } + #endif + } + else { + uiCfg.waitEndMoves = 0; + } + + if (uiCfg.print_state == PAUSED) { + + } + + if (uiCfg.print_state == RESUMING) { + if (IS_SD_PAUSED()) { + gcode.process_subcommands_now_P(PSTR("G91")); + gcode.process_subcommands_now_P(PSTR("G1 Z-5")); + gcode.process_subcommands_now_P(PSTR("G90")); + gcode.process_subcommands_now_P(PSTR("M24")); + uiCfg.print_state = WORKING; + start_print_time(); + + gCfgItems.pause_reprint = 0; + update_spi_flash(); + } + } + #if ENABLED(POWER_LOSS_RECOVERY) + if (uiCfg.print_state == REPRINTED) { + memset(public_buf_m,0,sizeof(public_buf_m)); + #if HOTENDS + HOTEND_LOOP() { + const int16_t et = recovery.info.target_temperature[e]; + if (et) { + #if HOTENDS > 1 + sprintf_P(public_buf_m, PSTR("T%i"), e); + gcode.process_subcommands_now(public_buf_m); + #endif + sprintf_P(public_buf_m, PSTR("M109 S%i"), et); + gcode.process_subcommands_now(public_buf_m); + } + } + #endif + + if (gCfgItems.pause_reprint == 1) { + gcode.process_subcommands_now_P(PSTR("G91")); + gcode.process_subcommands_now_P(PSTR("G1 Z-5")); + gcode.process_subcommands_now_P(PSTR("G90")); + } + recovery.resume(); + + uiCfg.print_state = WORKING; + start_print_time(); + + gCfgItems.pause_reprint = 0; + update_spi_flash(); + } + #endif + + if (uiCfg.print_state == WORKING) + filament_check(); +} + +void filament_pin_setup() { + #if PIN_EXISTS(MT_DET_1) + pinMode(MT_DET_1_PIN, INPUT_PULLUP); + #endif + #if PIN_EXISTS(MT_DET_2) + pinMode(MT_DET_2_PIN, INPUT_PULLUP); + #endif + #if PIN_EXISTS(MT_DET_3) + pinMode(MT_DET_3_PIN, INPUT_PULLUP); + #endif +} + +void filament_check() { + const int FIL_DELAY = 20; + #if PIN_EXISTS(MT_DET_1) + static int fil_det_count_1 = 0; + if (!READ(MT_DET_1_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (READ(MT_DET_1_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (fil_det_count_1 > 0) + fil_det_count_1--; + + if (!READ(MT_DET_1_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (READ(MT_DET_1_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (fil_det_count_1 > 0) + fil_det_count_1--; + + #endif + + #if PIN_EXISTS(MT_DET_2) + static int fil_det_count_2 = 0; + if (!READ(MT_DET_2_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (READ(MT_DET_2_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (fil_det_count_2 > 0) + fil_det_count_2--; + + if (!READ(MT_DET_2_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (READ(MT_DET_2_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (fil_det_count_2 > 0) + fil_det_count_2--; + + #endif + + #if PIN_EXISTS(MT_DET_3) + static int fil_det_count_3 = 0; + if (!READ(MT_DET_3_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (READ(MT_DET_3_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (fil_det_count_3 > 0) + fil_det_count_3--; + + if (!READ(MT_DET_3_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (READ(MT_DET_3_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (fil_det_count_3 > 0) + fil_det_count_3--; + + #endif + + if ( + #if PIN_EXISTS(MT_DET_1) + fil_det_count_1 >= FIL_DELAY + #else + false + #endif + #if PIN_EXISTS(MT_DET_2) + || fil_det_count_2 >= FIL_DELAY + #endif + #if PIN_EXISTS(MT_DET_3) + || fil_det_count_3 >= FIL_DELAY + #endif + ) { + clear_cur_ui(); + card.pauseSDPrint(); + stop_print_time(); + uiCfg.print_state = PAUSING; + + if (gCfgItems.from_flash_pic == 1) + flash_preview_begin = 1; + else + default_preview_flg = 1; + + lv_draw_printing(); + } +} + +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.h b/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.h new file mode 100644 index 000000000000..693662841700 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.h @@ -0,0 +1,36 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +#define MIN_FILE_PRINTED 100 //5000 + +extern void printer_state_polling(); +extern void filament_pin_setup(); +extern void filament_check(); + +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/draw_dialog.cpp deleted file mode 100644 index d68909e7669c..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/draw_dialog.cpp +++ /dev/null @@ -1,357 +0,0 @@ -#include "../../../../../MarlinCore.h" -#if ENABLED(TFT_LITTLE_VGL_UI) -#include "lv_conf.h" -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" -//#include "../../MarlinCore.h" -#include "../inc/draw_ui.h" -#include "../../../../../sd/cardreader.h" -#include "../../../../../gcode/queue.h" -#include "../../../../../module/temperature.h" -#include "../../../../../module/planner.h" -#if ENABLED(POWER_LOSS_RECOVERY) -#include "../../../../../feature/powerloss.h" -#endif -#if ENABLED(PARK_HEAD_ON_PAUSE) -#include "../../../../../feature/pause.h" -#endif - -static lv_obj_t * scr; -extern uint8_t sel_id; -extern uint8_t once_flag; -extern uint8_t gcode_preview_over; -uint8_t DialogType; - -static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) -{ - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) - { - if(DialogType == DIALOG_TYPE_PRINT_FILE) - { - preview_gcode_prehandle(list_file.file_name[sel_id]); - reset_print_time(); - start_print_time(); - - uiCfg.print_state = WORKING; - lv_clear_dialog(); - lv_draw_printing(); - - if(gcode_preview_over != 1) - { - #if ENABLED (SDSUPPORT) - char *cur_name; - cur_name=strrchr(list_file.file_name[sel_id],'/'); - - SdFile file; - SdFile *curDir; - card.endFilePrint(); - const char * const fname = card.diveToFile(true, curDir, cur_name); - if (!fname) return; - if (file.open(curDir, fname, O_READ)) - { - gCfgItems.curFilesize = file.fileSize(); - file.close(); - update_spi_flash(); - } - card.openFileRead(cur_name); - if(card.isFileOpen()) - { - feedrate_percentage = 100; - //saved_feedrate_percentage = feedrate_percentage; - planner.flow_percentage[0] = 100; - planner.e_factor[0]= planner.flow_percentage[0]*0.01; - if(EXTRUDERS==2) - { - planner.flow_percentage[1] = 100; - planner.e_factor[1]= planner.flow_percentage[1]*0.01; - } - card.startFileprint(); - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.prepare(); - #endif - once_flag = 0; - } - #endif - } - } - else if(DialogType == DIALOG_TYPE_STOP) - { - stop_print_time(); - lv_clear_dialog(); - lv_draw_ready_print(); - - #if ENABLED (SDSUPPORT) - //card.endFilePrint(); - //wait_for_heatup = false; - uiCfg.print_state = IDLE; - card.flag.abort_sd_printing = true; - //queue.clear(); - //quickstop_stepper(); - //print_job_timer.stop(); - //thermalManager.disable_all_heaters(); - - //#if ENABLED(POWER_LOSS_RECOVERY) - //recovery.purge(); - //#endif - //queue.enqueue_one_now(PSTR("G91")); - //queue.enqueue_one_now(PSTR("G1 Z10")); - //queue.enqueue_one_now(PSTR("G90")); - //queue.enqueue_one_now(PSTR("G28 X0 Y0")); - //queue.inject_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0\nM84\nM107")); - #endif - } - else if(DialogType == DIALOG_TYPE_FINISH_PRINT) - { - clear_cur_ui(); - lv_draw_ready_print(); - } - #if ENABLED(ADVANCED_PAUSE_FEATURE) - else if(DialogType == DIALOG_PAUSE_MESSAGE_WAITING - ||DialogType == DIALOG_PAUSE_MESSAGE_INSERT - ||DialogType == DIALOG_PAUSE_MESSAGE_HEAT) - { - wait_for_user = false; - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_OPTION) - { - pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_RESUME) - { - clear_cur_ui(); - draw_return_ui(); - } - #endif - } -} - -static void btn_cancel_event_cb(lv_obj_t * btn, lv_event_t event) -{ - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) - { - if(DialogType == DIALOG_PAUSE_MESSAGE_OPTION) - { - #if ENABLED(ADVANCED_PAUSE_FEATURE) - pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; - #endif - } - else - { - clear_cur_ui(); - draw_return_ui(); - } - } -} - - -void lv_draw_dialog(uint8_t type) -{ - - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != DIALOG_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = DIALOG_UI; - } - disp_state = DIALOG_UI; - - DialogType = type; - - scr = lv_obj_create(NULL, NULL); - - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); - - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); - - //LV_IMG_DECLARE(bmp_pic); - - static lv_style_t style_btn_rel; /*A variable to store the released style*/ - lv_style_copy(&style_btn_rel, &lv_style_plain); /*Initialize from a built-in style*/ - style_btn_rel.body.border.color = lv_color_hex3(0x269); - style_btn_rel.body.border.width = 1; - style_btn_rel.body.main_color = lv_color_hex3(0xADF); - style_btn_rel.body.grad_color = lv_color_hex3(0x46B); - style_btn_rel.body.shadow.width = 4; - style_btn_rel.body.shadow.type = LV_SHADOW_BOTTOM; - style_btn_rel.body.radius = LV_RADIUS_CIRCLE; - style_btn_rel.text.color = lv_color_hex3(0xDEF); - style_btn_rel.text.font = &gb2312_puhui32; - - - static lv_style_t style_btn_pr; /*A variable to store the pressed style*/ - lv_style_copy(&style_btn_pr, &style_btn_rel); /*Initialize from the released style*/ - style_btn_pr.body.border.color = lv_color_hex3(0x46B); - style_btn_pr.body.main_color = lv_color_hex3(0x8BD); - style_btn_pr.body.grad_color = lv_color_hex3(0x24A); - style_btn_pr.body.shadow.width = 2; - style_btn_pr.text.color = lv_color_hex3(0xBCD); - style_btn_pr.text.font = &gb2312_puhui32; - - lv_obj_t * labelDialog = lv_label_create(scr, NULL); - lv_obj_set_style(labelDialog, &tft_style_lable_rel); - - - if(DialogType == DIALOG_TYPE_FINISH_PRINT || DialogType == DIALOG_PAUSE_MESSAGE_RESUME) - { - lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(btnOk, BTN_OK_X+90, BTN_OK_Y); /*Set its position*/ - lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ - lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ - lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ - lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ - lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ - - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_WAITING - ||DialogType == DIALOG_PAUSE_MESSAGE_INSERT - ||DialogType == DIALOG_PAUSE_MESSAGE_HEAT) - { - lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(btnOk, BTN_OK_X+90, BTN_OK_Y); /*Set its position*/ - lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ - lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ - lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ - lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ - lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_PAUSING - ||DialogType == DIALOG_PAUSE_MESSAGE_CHANGING - ||DialogType == DIALOG_PAUSE_MESSAGE_UNLOAD - ||DialogType == DIALOG_PAUSE_MESSAGE_LOAD - ||DialogType == DIALOG_PAUSE_MESSAGE_PURGE - ||DialogType == DIALOG_PAUSE_MESSAGE_RESUME - ||DialogType == DIALOG_PAUSE_MESSAGE_HEATING) - { - - } - else - { - lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(btnOk, BTN_OK_X, BTN_OK_Y); /*Set its position*/ - lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ - lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ - lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ - lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ - - lv_obj_t * btnCancel = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(btnCancel, BTN_CANCEL_X, BTN_CANCEL_Y); /*Set its position*/ - lv_obj_set_size(btnCancel, 100, 50); /*Set its size*/ - lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_set_style(btnCancel, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ - lv_btn_set_style(btnCancel, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ - lv_obj_t * labelCancel = lv_label_create(btnCancel, NULL); /*Add a label to the button*/ - - if(DialogType == DIALOG_PAUSE_MESSAGE_OPTION) - { - lv_label_set_text(labelOk, pause_msg_menu.purgeMore); /*Set the labels text*/ - lv_label_set_text(labelCancel, pause_msg_menu.continuePrint); - } - else - { - lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ - lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); - } - } - if(DialogType == DIALOG_TYPE_PRINT_FILE) - { - lv_label_set_text(labelDialog, print_file_dialog_menu.print_file); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - - lv_obj_t * labelFile = lv_label_create(scr, NULL); - lv_obj_set_style(labelFile, &tft_style_lable_rel); - - lv_label_set_text(labelFile, list_file.long_name[sel_id]); - lv_obj_align(labelFile, NULL, LV_ALIGN_CENTER, 0, -60); - } - else if(DialogType == DIALOG_TYPE_STOP) - { - lv_label_set_text(labelDialog, print_file_dialog_menu.cancle_print); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - } - else if(DialogType == DIALOG_TYPE_FINISH_PRINT) - { - lv_label_set_text(labelDialog, print_file_dialog_menu.print_finish); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_PAUSING) - { - lv_label_set_text(labelDialog, pause_msg_menu.pausing); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_CHANGING) - { - lv_label_set_text(labelDialog, pause_msg_menu.changing); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_UNLOAD) - { - lv_label_set_text(labelDialog, pause_msg_menu.unload); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_WAITING) - { - lv_label_set_text(labelDialog, pause_msg_menu.waiting); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_INSERT) - { - lv_label_set_text(labelDialog, pause_msg_menu.insert); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_LOAD) - { - lv_label_set_text(labelDialog, pause_msg_menu.load); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_PURGE) - { - lv_label_set_text(labelDialog, pause_msg_menu.purge); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_RESUME) - { - lv_label_set_text(labelDialog, pause_msg_menu.resume); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_HEAT) - { - lv_label_set_text(labelDialog, pause_msg_menu.heat); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_HEATING) - { - lv_label_set_text(labelDialog, pause_msg_menu.heating); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - } - else if(DialogType == DIALOG_PAUSE_MESSAGE_OPTION) - { - lv_label_set_text(labelDialog, pause_msg_menu.option); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - } - -} - -void lv_clear_dialog() -{ - lv_obj_del(scr); -} - -#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/pic_manager.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/pic_manager.cpp deleted file mode 100644 index ccb93f5e36a0..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/pic_manager.cpp +++ /dev/null @@ -1,811 +0,0 @@ -//#include "type_define.h" -#include "string.h" -#include "../../../../../MarlinCore.h" - -#if ENABLED(TFT_LITTLE_VGL_UI) - -#include "../inc/pic_manager.h" -#include "../inc/W25Qxx.h" -#include "../../../../../sd/cardreader.h" -#include "../inc/draw_ready_print.h" -#include "../inc/mks_hardware_test.h" - -//#include "gui.h" -//#include "spi_flash.h" - -//uint8_t DMA_ERRO_FLAG; -extern uint16_t DeviceCode; -extern unsigned char bmp_public_buf[17 * 1024]; - -#if ENABLED (SDSUPPORT) -extern char *createFilename(char * const buffer, const dir_t &p); -#endif - -/*void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) -{ -}*/ -uint32_t lv_get_pic_addr(uint8_t *Pname) -{ - uint8_t Pic_cnt; - uint8_t i, j; - PIC_MSG PIC; - uint32_t tmp_cnt = 0; - uint32_t addr=0; - - W25QXX.init(SPI_QUARTER_SPEED); - - W25QXX.SPI_FLASH_BufferRead(&Pic_cnt,PIC_COUNTER_ADDR,1); - if(Pic_cnt == 0xff) - { - Pic_cnt = 0; - } - for(i=0;i= logo_maxsize) - { - LogoWrite_Addroffset = 0; - } - return 1; -} - -uint32_t TitleLogoWrite_Addroffset = 0; -uint8_t Pic_TitleLogo_Write(uint8_t *TitleLogoName,uint8_t *TitleLogo_Wbuff,uint32_t TitleLogoWriteSize) -{ - //uint32_t i; - //uint8_t temp1; - - if(TitleLogoWriteSize <= 0) - return 0; - if((DeviceCode==0x9488)||(DeviceCode==0x5761)) - { - W25QXX.SPI_FLASH_BufferWrite(TitleLogo_Wbuff,PIC_ICON_LOGO_ADDR_TFT35+TitleLogoWrite_Addroffset,TitleLogoWriteSize); - } - else - { - W25QXX.SPI_FLASH_BufferWrite(TitleLogo_Wbuff,PIC_ICON_LOGO_ADDR_TFT32+TitleLogoWrite_Addroffset,TitleLogoWriteSize); - - } - TitleLogoWrite_Addroffset += TitleLogoWriteSize; - if(TitleLogoWrite_Addroffset >= TITLELOGO_MAX_SIZE) - { - TitleLogoWrite_Addroffset = 0; - } - return 1; -} - -uint32_t default_view_addroffset_r = 0; -void default_view_Write(uint8_t *default_view__Rbuff,uint32_t default_view_Writesize) -{ - W25QXX.SPI_FLASH_BufferWrite(default_view__Rbuff,DEFAULT_VIEW_ADDR_TFT35+default_view_addroffset_r,default_view_Writesize); - default_view_addroffset_r += default_view_Writesize; - if(default_view_addroffset_r >= DEFAULT_VIEW_MAX_SIZE) - { - default_view_addroffset_r = 0; - } - -} - -uint32_t Pic_Info_Write(uint8_t *P_name,uint32_t P_size) -{ - uint8_t pic_counter = 0; - uint32_t Pic_SaveAddr; - uint32_t Pic_SizeSaveAddr; - uint32_t Pic_NameSaveAddr; - //uint8_t temp; - uint8_t Pname_temp; - uint32_t i,j; - uint32_t name_len = 0; - uint32_t SaveName_len = 0; - union union32 size_tmp; - //union union32 size1; - //uint8_t Pn[PIC_NAME_MAX_LEN]; - //uint8_t cnt_temp; - //uint16_t n0; - //uint32_t Name_saveAddr = 0; - //uint8_t pic_position; - - W25QXX.SPI_FLASH_BufferRead(&pic_counter,PIC_COUNTER_ADDR,1); - - if(pic_counter == 0xff) - { - pic_counter = 0; - } - if((DeviceCode==0x9488)||(DeviceCode==0x5761)) - { - Pic_SaveAddr = PIC_DATA_ADDR_TFT35 + pic_counter * PER_PIC_MAX_SPACE_TFT35; - } - else - { - Pic_SaveAddr = PIC_DATA_ADDR_TFT32 + pic_counter * PER_PIC_MAX_SPACE_TFT32; - } - - for(j = 0;j < pic_counter;j ++) - { - do - { - W25QXX.SPI_FLASH_BufferRead(&Pname_temp,PIC_NAME_ADDR + SaveName_len,1); - SaveName_len ++; - } - while(Pname_temp != '\0'); - } - i=0; - while((*(P_name+i) != '\0')) - { - i++; - name_len++; - } - - Pic_NameSaveAddr = PIC_NAME_ADDR + SaveName_len; - W25QXX.SPI_FLASH_BufferWrite(P_name,Pic_NameSaveAddr,name_len+1); - Pic_SizeSaveAddr = PIC_SIZE_ADDR+4*pic_counter; - size_tmp.dwords = P_size; - W25QXX.SPI_FLASH_BufferWrite(size_tmp.bytes,Pic_SizeSaveAddr,4); - - pic_counter++; - W25QXX.SPI_FLASH_SectorErase(PIC_COUNTER_ADDR); - W25QXX.SPI_FLASH_BufferWrite(&pic_counter,PIC_COUNTER_ADDR,1); - - return Pic_SaveAddr; -} - -uint8_t public_buf[512]; - -//uint8_t public_buf_test[512]; -#if ENABLED (SDSUPPORT) -void UpdatePic() -{ - //int r; - //unsigned char *p; - //char rootPath[10]={0}; - char *fn; - unsigned char logoFlag; - uint16_t pbr; - uint32_t pfileSize; - uint32_t Pic_Write_Addr; - /*----------------------------------*/ - - // FILINFO fno; - //DIR dir; - //char tmp[30]; - #if 0//_USE_LFN - static char lfn[_MAX_LFN + 1]; - finfo.lfname = lfn; - finfo.lfsize = sizeof(lfn); - #endif - //SdFile curDir; - //if (f_opendir(&dirs, picPath) == FR_OK) - //card.cd(picPath); - - //const uint16_t fileCnt = card.get_num_Files(); - - //SdFile *curDir; - //SdFile dir; - //dir.open(picPath, O_READ); - //const char * const fname = card.diveToFile(true, curDir, picPath); - //if (!fname) return; - - SdFile dir, root = card.getroot(); - if (dir.open(&root, picPath, O_RDONLY)) - { - - disp_pic_update(); - spiFlashErase_PIC(); - - dir_t d; - while (dir.readDir(&d, card.longFilename) > 0) - { - #if 1 - /*if(power_det == 0) - { - PW_DET_ON; - power_det=0; - } - SPI_FLASH_Init();*/ - - - //for (uint16_t i = 0; i < fileCnt; i++) - //{ - //res = f_readdir(&dirs, &finfo); - //card.getfilename_sorted(i); - - if (card.longFilename[0] == 0) - { - break; - } - /*if ( card.filename[0] == '.') - continue; - */ - if ( card.longFilename[0] == '.') - continue; - - fn = card.longFilename; - - /*if ((finfo.lfname[0] == 0) || (finfo.lfname == 0)) - fn = finfo.fname; - else - fn = finfo.lfname;*/ - - /* if (fno.fattrib & AM_DIR) - { - continue; - } - else */ - //{ - //if((strstr(fn, ".gco")) || (strstr(fn, ".GCO")) || (fno.fattrib & AM_DIR)) - if(strstr(fn, ".bin")) - { - if(strstr(fn, "_logo")) - logoFlag =1; - else if(strstr(fn, "_titlelogo")) - logoFlag = 2; - else if(strstr(fn, "_preview")) - logoFlag = 3; - else - logoFlag = 0; - - //public_buf[0] = '\0'; - //strcat(public_buf, picPath); - //strcat(public_buf, "/"); - char dosFilename[FILENAME_LENGTH]; - createFilename(dosFilename, d); - //strcat(public_buf, dosFilename); - - SdFile file; - if (file.open(&dir, dosFilename, O_READ)) - { - - #if 1 - /*LCD_Clear(BACK_COLOR); - - if((DeviceCode==0x9488)||(DeviceCode==0x5761)) - { - LCD_ShowString(170,100,200,24,24,(u8 *)fn); - LCD_ShowString(180,130,200,24,24,"Updating..."); - } - else - { - LCD_ShowString(90,90,200,24,24,(u8 *)fn); - LCD_ShowString(90,120,200,24,24,"Updating..."); - } - */ - if(logoFlag == 1) - { - while(1) - { - pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); - Pic_Logo_Write((uint8_t *)fn,public_buf,pbr); // - if(pbr < BMP_WRITE_BUF_LEN) break; - } - } - else if(logoFlag == 2) - { - while(1) - { - pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); - Pic_TitleLogo_Write((uint8_t *)fn,public_buf,pbr); // - if(pbr < BMP_WRITE_BUF_LEN) break; - } - } - else if(logoFlag == 3) - { - while(1) - { - pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); - default_view_Write(public_buf,pbr); // - if(pbr < BMP_WRITE_BUF_LEN) break; - } - } - else - { - pfileSize = file.fileSize(); - Pic_Write_Addr = Pic_Info_Write((uint8_t *)fn,pfileSize); - //uint32_t addr_test = Pic_Write_Addr; - //memset(bmp_public_buf, 0xff, BMP_WRITE_BUF_LEN); - while(1) - { - pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); - W25QXX.SPI_FLASH_BufferWrite(public_buf,Pic_Write_Addr,pbr); - Pic_Write_Addr += pbr; - if(pbr < BMP_WRITE_BUF_LEN) break; - } - //W25QXX.SPI_FLASH_BufferRead(public_buf_test,addr_test,BMP_WRITE_BUF_LEN); - } - - /*--------------read test--------------------*/ - /* - BufferSet(picBuffer, 0xff, PICTURE_MAX_SIZE); - if(logoFlag == 0) - { - PicMsg_Init(); - Pic_Read(fn,picBuffer); - } - else - Pic_Logo_Read(fn,picBuffer,PICTURE_MAX_SIZE); - */ - /*--------------read test--------------------*/ - - file.close(); - #endif - } - - } - //} - //} - /* - LCD_Clear(LCD_COLOR_BLACK); - //LCD_ShowString(110,100,200,24,24,"Complete"); - LCD_DisplayString(110,80,"Complete"); - delay(0xfffff); - */ - //r = f_chdir("/"); - #if 1 - //SdFile dir, root = card.getroot(); - /*if (dir.open(&root, bakPath, O_RDONLY)) - { - dir.remove(); - }*/ - - //r = f_rename(picPath, bakPath); - - - //update_flag_ok = 1; - #endif - #endif - } - dir.rename(&root, bakPath); - } -} - - -void spi_flash_read_test() -{ - W25QXX.SPI_FLASH_BufferRead(public_buf,UNIGBK_FLASH_ADDR,BMP_WRITE_BUF_LEN); -} - -void UpdateFont() -{ - //int r; - //unsigned char *p; - //char rootPath[10]={0}; - char *fn; - //unsigned char logoFlag; - uint16_t pbr; - uint32_t flashaddr=0; - //uint32_t pfileSize; - //uint32_t Pic_Write_Addr; - /*----------------------------------*/ - - // FILINFO fno; - //DIR dir; - //char tmp[30]; - #if 0//_USE_LFN - static char lfn[_MAX_LFN + 1]; - finfo.lfname = lfn; - finfo.lfsize = sizeof(lfn); - #endif - //SdFile curDir; - //if (f_opendir(&dirs, picPath) == FR_OK) - //card.cd(picPath); - - //const uint16_t fileCnt = card.get_num_Files(); - - //SdFile *curDir; - //SdFile dir; - //dir.open(picPath, O_READ); - //const char * const fname = card.diveToFile(true, curDir, picPath); - //if (!fname) return; - - SdFile dir, root = card.getroot(); - if (dir.open(&root, fontPath, O_RDONLY)) - { - - disp_font_update(); - spiFlashErase_FONT(); - - dir_t d; - while (dir.readDir(&d, card.longFilename) > 0) - { - #if 1 - /*if(power_det == 0) - { - PW_DET_ON; - power_det=0; - } - SPI_FLASH_Init();*/ - - - //for (uint16_t i = 0; i < fileCnt; i++) - //{ - //res = f_readdir(&dirs, &finfo); - //card.getfilename_sorted(i); - - if (card.longFilename[0] == 0) - { - break; - } - /*if ( card.filename[0] == '.') - continue; - */ - if ( card.longFilename[0] == '.') - continue; - - fn = card.longFilename; - - /*if ((finfo.lfname[0] == 0) || (finfo.lfname == 0)) - fn = finfo.fname; - else - fn = finfo.lfname;*/ - - /* if (fno.fattrib & AM_DIR) - { - continue; - } - else */ - //{ - //if((strstr(fn, ".gco")) || (strstr(fn, ".GCO")) || (fno.fattrib & AM_DIR)) - if(strstr(fn, ".bin")) - { - char dosFilename[FILENAME_LENGTH]; - createFilename(dosFilename, d); - //strcat(public_buf, dosFilename); - - SdFile file; - if (file.open(&dir, dosFilename, O_READ)) - { - - #if 1 - /*LCD_Clear(BACK_COLOR); - - if((DeviceCode==0x9488)||(DeviceCode==0x5761)) - { - LCD_ShowString(170,100,200,24,24,(u8 *)fn); - LCD_ShowString(180,130,200,24,24,"Updating..."); - } - else - { - LCD_ShowString(90,90,200,24,24,(u8 *)fn); - LCD_ShowString(90,120,200,24,24,"Updating..."); - } - */ - flashaddr=UNIGBK_FLASH_ADDR; - pbr = 0; - while(1) - { - flashaddr += pbr; - pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); - W25QXX.SPI_FLASH_BufferWrite(public_buf,flashaddr,pbr); - //W25QXX.SPI_FLASH_BufferRead(public_buf_test,flashaddr,pbr); - /*if(UNIGBKFlag == 1) - { - fontrate = (uint16_t)(((float)(flashaddr - UNIGBK_FLASH_ADDR)/(float)(psrc.fsize))*100); - } - else - { - fontrate = (uint16_t)(((float)(flashaddr - GBK_FLASH_ADDR)/(float)(psrc.fsize))*100); - } - - if(fontrate > 99) fontrate=99; - - if(fontrate < 10) - { - fontString[0] = fontrate%10 + 0x30; - fontString[1] = '%'; - fontString[2] = '\0'; - } - else - { - fontString[0] = fontrate/10 + 0x30; - fontString[1] = fontrate%10 + 0x30; - fontString[2] = '%'; - fontString[3] = '\0'; - }*/ - //LCD_DisplayString(140,130,fontString); - if((DeviceCode==0x9488)||(DeviceCode==0x5761)) - { - //LCD_ShowString(200,160,200,24,24,fontString); - } - else - { - //LCD_ShowString(140,150,200,24,24,fontString); - } - if(pbr < BMP_WRITE_BUF_LEN) break; - } - /*--------------read test--------------------*/ - /* - BufferSet(picBuffer, 0xff, PICTURE_MAX_SIZE); - if(logoFlag == 0) - { - PicMsg_Init(); - Pic_Read(fn,picBuffer); - } - else - Pic_Logo_Read(fn,picBuffer,PICTURE_MAX_SIZE); - */ - /*--------------read test--------------------*/ - - file.close(); - #endif - } - - } - //} - //} - /* - LCD_Clear(LCD_COLOR_BLACK); - //LCD_ShowString(110,100,200,24,24,"Complete"); - LCD_DisplayString(110,80,"Complete"); - delay(0xfffff); - */ - //r = f_chdir("/"); - #if 1 - //SdFile dir, root = card.getroot(); - /*if (dir.open(&root, bakPath, O_RDONLY)) - { - dir.remove(); - }*/ - dir.rename(&root, bakFont); - //r = f_rename(picPath, bakPath); - - - //update_flag_ok = 1; - #endif - #endif - } - } -} -#endif -#endif - -#if 1 -void Pic_Read(uint8_t *Pname,uint8_t *P_Rbuff) -{ - uint8_t i, j; - uint8_t Pic_cnt; - uint32_t tmp_cnt = 0; - PIC_MSG PIC; - - //void SPI_FLASH_BufferRead(u8* pBuffer, u32 ReadAddr, u16 NumByteToRead); - - W25QXX.SPI_FLASH_BufferRead(&Pic_cnt,PIC_COUNTER_ADDR,1); - if(Pic_cnt == 0xff) - { - Pic_cnt = 0; - } - - for(i=0;i= LOGO_MAX_SIZE_TFT35 ) - { - logo_addroffset = 0; - } -} - -uint32_t default_view_addroffset = 0; -void default_view_Read(uint8_t *default_view_Rbuff,uint32_t default_view_Readsize) -{ - W25QXX.init(SPI_QUARTER_SPEED); - - W25QXX.SPI_FLASH_BufferRead(default_view_Rbuff,DEFAULT_VIEW_ADDR_TFT35+default_view_addroffset+4,default_view_Readsize); - default_view_addroffset += default_view_Readsize; - if(default_view_addroffset >= DEFAULT_VIEW_MAX_SIZE) - { - default_view_addroffset = 0; - } - -} - -uint32_t flash_view_addroffset = 0; -void flash_view_Read(uint8_t *flash_view_Rbuff,uint32_t flash_view_Readsize) -{ - W25QXX.init(SPI_QUARTER_SPEED); - - W25QXX.SPI_FLASH_BufferRead(flash_view_Rbuff,BAK_VIEW_ADDR_TFT35+flash_view_addroffset,flash_view_Readsize); - flash_view_addroffset += flash_view_Readsize; - if(flash_view_addroffset >= FLASH_VIEW_MAX_SIZE) - { - flash_view_addroffset = 0; - } - -} - -#endif - - - -#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/printer_opration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/printer_opration.cpp deleted file mode 100644 index a1c4ea5373ef..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/printer_opration.cpp +++ /dev/null @@ -1,214 +0,0 @@ -#include "../../../../../MarlinCore.h" -#if ENABLED(TFT_LITTLE_VGL_UI) -#include "lv_conf.h" -#include "../inc/draw_ui.h" -#include "../../../../../module/temperature.h" -#include "../../../../../module/motion.h" -#include "../../../../../sd/cardreader.h" -#include "../../../../../gcode/queue.h" -#if ENABLED(POWER_LOSS_RECOVERY) -#include "../../../../../feature/powerloss.h" -#endif - -#include "../../../../../gcode/gcode.h" -#include "../../../../../module/planner.h" - - -extern uint32_t To_pre_view; -extern uint8_t flash_preview_begin; -extern uint8_t default_preview_flg; -extern uint8_t gcode_preview_over; - -void printer_state_polling() -{ - if(uiCfg.print_state == PAUSING) - { - #if ENABLED(SDSUPPORT) - if( !planner.has_blocks_queued() && card.getIndex()>MIN_FILE_PRINTED) //���� �ļ��� M109��M190ָ�� - uiCfg.waitEndMoves++; - - if(uiCfg.waitEndMoves > 20) - { - uiCfg.waitEndMoves = 0; - planner.synchronize(); - gcode.process_subcommands_now_P(PSTR("M25")); - gcode.process_subcommands_now_P(PSTR("G91")); - gcode.process_subcommands_now_P(PSTR("G1 Z5")); - gcode.process_subcommands_now_P(PSTR("G90")); - - uiCfg.print_state = PAUSED; - - //#if ENABLED(POWER_LOSS_RECOVERY) - //if (recovery.enabled) recovery.save(true); - //#endif - gCfgItems.pause_reprint = 1; - update_spi_flash(); - } - #endif - } - else - { - uiCfg.waitEndMoves = 0; - } - - if(uiCfg.print_state == PAUSED) - { - - } - if(uiCfg.print_state == RESUMING) - { - if (IS_SD_PAUSED()) - { - gcode.process_subcommands_now_P(PSTR("G91")); - gcode.process_subcommands_now_P(PSTR("G1 Z-5")); - gcode.process_subcommands_now_P(PSTR("G90")); - gcode.process_subcommands_now_P(PSTR("M24")); - uiCfg.print_state = WORKING; - start_print_time(); - - gCfgItems.pause_reprint = 0; - update_spi_flash(); - } - } - #if ENABLED(POWER_LOSS_RECOVERY) - if(uiCfg.print_state == REPRINTED) - { - memset(public_buf_m,0,sizeof(public_buf_m)); - #if HOTENDS - HOTEND_LOOP() { - const int16_t et = recovery.info.target_temperature[e]; - if (et) { - #if HOTENDS > 1 - sprintf_P(public_buf_m, PSTR("T%i"), e); - gcode.process_subcommands_now(public_buf_m); - #endif - sprintf_P(public_buf_m, PSTR("M109 S%i"), et); - gcode.process_subcommands_now(public_buf_m); - } - } - #endif - - if(gCfgItems.pause_reprint == 1) - { - gcode.process_subcommands_now_P(PSTR("G91")); - gcode.process_subcommands_now_P(PSTR("G1 Z-5")); - gcode.process_subcommands_now_P(PSTR("G90")); - } - recovery.resume(); - - uiCfg.print_state = WORKING; - start_print_time(); - - gCfgItems.pause_reprint = 0; - update_spi_flash(); - } - #endif - if(uiCfg.print_state == WORKING) - { - filament_check(); - } -} - - -void filament_pin_setup() -{ - #if PIN_EXISTS(MT_DET_1) - pinMode(MT_DET_1_PIN, INPUT_PULLUP); - #endif - - #if PIN_EXISTS(MT_DET_2) - pinMode(MT_DET_2_PIN, INPUT_PULLUP); - #endif - - #if PIN_EXISTS(MT_DET_3) - pinMode(MT_DET_3_PIN, INPUT_PULLUP); - #endif -} - -void filament_check() -{ - const int FIL_DELAY = 20; - #if PIN_EXISTS(MT_DET_1) - static int fil_det_count_1 = 0; - if (!READ(MT_DET_1_PIN) && !MT_DET_PIN_INVERTING) - fil_det_count_1++; - else if (READ(MT_DET_1_PIN) && MT_DET_PIN_INVERTING) - fil_det_count_1++; - else if (fil_det_count_1 > 0) - fil_det_count_1--; - - if (!READ(MT_DET_1_PIN) && !MT_DET_PIN_INVERTING) - fil_det_count_1++; - else if (READ(MT_DET_1_PIN) && MT_DET_PIN_INVERTING) - fil_det_count_1++; - else if (fil_det_count_1 > 0) - fil_det_count_1--; - - #endif - - #if PIN_EXISTS(MT_DET_2) - static int fil_det_count_2 = 0; - if (!READ(MT_DET_2_PIN) && !MT_DET_PIN_INVERTING) - fil_det_count_2++; - else if (READ(MT_DET_2_PIN) && MT_DET_PIN_INVERTING) - fil_det_count_2++; - else if (fil_det_count_2 > 0) - fil_det_count_2--; - - if (!READ(MT_DET_2_PIN) && !MT_DET_PIN_INVERTING) - fil_det_count_2++; - else if (READ(MT_DET_2_PIN) && MT_DET_PIN_INVERTING) - fil_det_count_2++; - else if (fil_det_count_2 > 0) - fil_det_count_2--; - - #endif - - #if PIN_EXISTS(MT_DET_3) - static int fil_det_count_3 = 0; - if (!READ(MT_DET_3_PIN) && !MT_DET_PIN_INVERTING) - fil_det_count_3++; - else if (READ(MT_DET_3_PIN) && MT_DET_PIN_INVERTING) - fil_det_count_3++; - else if (fil_det_count_3 > 0) - fil_det_count_3--; - - if (!READ(MT_DET_3_PIN) && !MT_DET_PIN_INVERTING) - fil_det_count_3++; - else if (READ(MT_DET_3_PIN) && MT_DET_PIN_INVERTING) - fil_det_count_3++; - else if (fil_det_count_3 > 0) - fil_det_count_3--; - - #endif - - if ( - #if PIN_EXISTS(MT_DET_1) - fil_det_count_1 >= FIL_DELAY - #else - false - #endif - #if PIN_EXISTS(MT_DET_2) - || fil_det_count_2 >= FIL_DELAY - #endif - #if PIN_EXISTS(MT_DET_3) - || fil_det_count_3 >= FIL_DELAY - #endif - ) - { - clear_cur_ui(); - card.pauseSDPrint(); - stop_print_time(); - uiCfg.print_state = PAUSING; - - if(gCfgItems.from_flash_pic == 1) - flash_preview_begin = 1; - else - default_preview_flg = 1; - - lv_draw_printing(); - } -} - - -#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/src/tft_lvgl_configuration.cpp deleted file mode 100644 index d081b1cb0863..000000000000 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/tft_lvgl_configuration.cpp +++ /dev/null @@ -1,864 +0,0 @@ -/** - * @file lcd_lvgl_configuration.c - * @date 2020-02-21 - * */ -#include "../../../../../MarlinCore.h" -#if ENABLED(TFT_LITTLE_VGL_UI) -#include "../inc/tft_lvgl_configuration.h" -#include "lvgl.h" -#include "../../../../../feature/touch/xpt2046.h" -#include "../inc/draw_ready_print.h" -#include "../inc/W25Qxx.h" -#include "../inc/pic_manager.h" - - -#include "../inc/mks_hardware_test.h" -#include "../inc/draw_ui.h" -#if ENABLED(POWER_LOSS_RECOVERY) -#include "../../../../../feature/powerloss.h" -#endif -#include -#if ENABLED(SPI_GRAPHICAL_TFT) -#include "../inc/SPI_TFT.h" -#endif - - -//#include "../../../Configuration.h" -//#include "../../../src/core/macros.h" - - -extern void LCD_IO_Init(uint8_t cs, uint8_t rs); -extern void LCD_IO_WriteData(uint16_t RegValue); -extern void LCD_IO_WriteReg(uint16_t Reg); - -extern void LCD_IO_WriteMultiple(uint16_t color, uint32_t count); - -extern void init_gb2312_font(); - -static lv_disp_buf_t disp_buf; -//static lv_color_t buf[LV_HOR_RES_MAX * 18]; -//static lv_color_t buf[10*5]; -//extern lv_obj_t * scr; -#if ENABLED (SDSUPPORT) -extern void UpdatePic(); -extern void UpdateFont(); -#endif -uint16_t DeviceCode = 0x9488; -extern uint8_t sel_id; - -#define SetCs -#define ClrCs - - -#define HDP 799 //Horizontal Display Period //** -#define HT 1000 //Horizontal Total -#define HPS 51 //LLINE Pulse Start Position -#define LPS 3 // Horizontal Display Period Start Position -#define HPW 8 // LLINE Pulse Width - - -#define VDP 479 //Vertical Display Period -#define VT 530 //Vertical Total -#define VPS 24 // LFRAME Pulse Start Position -#define FPS 23 //Vertical Display Period Start Positio -#define VPW 3 // LFRAME Pulse Width //** - -#define MAX_HZ_POSX HDP+1 -#define MAX_HZ_POSY VDP+1 - -extern uint8_t gcode_preview_over; -extern uint8_t flash_preview_begin; -extern uint8_t default_preview_flg; - -void SysTick_Callback() -{ - lv_tick_inc(1); - print_time_count(); -} - - -void tft_set_cursor(uint16_t x,uint16_t y) -{ - #if 0 - if(DeviceCode==0x8989) - { - LCD_WriteReg(0x004e,y); //行 - LCD_WriteReg(0x004f,x); //列 - } - else if((DeviceCode==0x9919)) - { - LCD_WriteReg(0x004e,x); // 行 - LCD_WriteReg(0x004f,y); // 列 - } - else if((DeviceCode==0x5761)) //SSD1963 - { - LCD_WrtReg(0x002A); - LCD_WrtRAM(x>>8); - LCD_WrtRAM(x&0x00ff); - LCD_WrtRAM(HDP>>8); - LCD_WrtRAM(HDP&0x00ff); - LCD_WrtReg(0x002b); - LCD_WrtRAM(y>>8); - LCD_WrtRAM(y&0x00ff); - LCD_WrtRAM(VDP>>8); - LCD_WrtRAM(VDP&0x00ff); - } - else if(DeviceCode == 0x9488) - { - ILI9488_WriteCmd(0X002A); - ILI9488_WriteData(x>>8); - ILI9488_WriteData(x&0X00FF); - ILI9488_WriteData(x>>8); - ILI9488_WriteData(x&0X00FF); - //ILI9488_WriteData(0X01); - //ILI9488_WriteData(0XDF); - ILI9488_WriteCmd(0X002B); - ILI9488_WriteData(y>>8); - ILI9488_WriteData(y&0X00FF); - ILI9488_WriteData(y>>8); - ILI9488_WriteData(y&0X00FF); - //ILI9488_WriteData(0X01); - //ILI9488_WriteData(0X3F); - } - else - { - LCD_WriteReg(0x0020,y); // 行 - LCD_WriteReg(0x0021,0x13f-x); // 列 - } - #else - LCD_IO_WriteReg(0X002A); - LCD_IO_WriteData(x>>8); - LCD_IO_WriteData(x&0X00FF); - LCD_IO_WriteData(x>>8); - LCD_IO_WriteData(x&0X00FF); - //ILI9488_WriteData(0X01); - //ILI9488_WriteData(0XDF); - LCD_IO_WriteReg(0X002B); - LCD_IO_WriteData(y>>8); - LCD_IO_WriteData(y&0X00FF); - LCD_IO_WriteData(y>>8); - LCD_IO_WriteData(y&0X00FF); - //ILI9488_WriteData(0X01); - //ILI9488_WriteData(0X3F); - #endif -} - -void LCD_WriteRAM_Prepare(void) -{ - #if 0 - if((DeviceCode==0x9325)||(DeviceCode==0x9328)||(DeviceCode==0x8989)) - { - ClrCs - LCD->LCD_REG = R34; - SetCs - } - else - { - LCD_WrtReg(0x002C); - } - #else - LCD_IO_WriteReg(0x002C); - #endif -} - -void tft_set_point(uint16_t x,uint16_t y,uint16_t point) -{ - //if(DeviceCode == 0x9488) - //{ - if ( (x>480)||(y>320) ) return; - //} - //**if ( (x>320)||(y>240) ) return; - tft_set_cursor(x,y); /*设置光标位置*/ - - LCD_WriteRAM_Prepare(); /* 开始写入GRAM*/ - //LCD_WriteRAM(point); - LCD_IO_WriteData(point); -} - -void LCD_WriteReg(uint16_t LCD_Reg,uint16_t LCD_RegValue) -{ - /* Write 16-bit Index, then Write Reg */ - ClrCs - LCD_IO_WriteReg(LCD_Reg); - /* Write 16-bit Reg */ - LCD_IO_WriteData(LCD_RegValue); - SetCs -} - -void ili9320_SetWindows(uint16_t StartX,uint16_t StartY,uint16_t width,uint16_t heigh) -{ - uint16_t s_h,s_l, e_h, e_l; - - uint16_t xEnd, yEnd; - xEnd = StartX + width; - yEnd = StartY + heigh-1; - if(DeviceCode==0x8989) - { - - /*LCD_WriteReg(0x0044, (StartX & 0xff) | (xEnd << 8)); - LCD_WriteReg(0x0045, StartY); - LCD_WriteReg(0x0046, yEnd);*/ - LCD_WriteReg(0x0044, (StartY& 0xff) | (yEnd << 8)); - LCD_WriteReg(0x0045, StartX); - LCD_WriteReg(0x0046, xEnd); - - } - else if(DeviceCode == 0X9488) - { - s_h = (StartX >> 8) & 0X00ff; - s_l = StartX & 0X00ff; - e_h = ((StartX + width - 1) >> 8) & 0X00ff; - e_l = (StartX + width - 1) & 0X00ff; - - LCD_IO_WriteReg(0x002A); - LCD_IO_WriteData(s_h); - LCD_IO_WriteData(s_l); - LCD_IO_WriteData(e_h); - LCD_IO_WriteData(e_l); - - s_h = (StartY >> 8) & 0X00ff; - s_l = StartY & 0X00ff; - e_h = ((StartY + heigh - 1) >> 8) & 0X00ff; - e_l = (StartY + heigh - 1) & 0X00ff; - - LCD_IO_WriteReg(0x002B); - LCD_IO_WriteData(s_h); - LCD_IO_WriteData(s_l); - LCD_IO_WriteData(e_h); - LCD_IO_WriteData(e_l); - } - else if((DeviceCode==0x9325)||(DeviceCode==0x9328)||(DeviceCode==0x1505)) - { - /* LCD_WriteReg(0x0050, StartX); - LCD_WriteReg(0x0052, StartY); - LCD_WriteReg(0x0051, xEnd); - LCD_WriteReg(0x0053, yEnd);*/ - LCD_WriteReg(0x0050,StartY); //Specify the start/end positions of the window address in the horizontal direction by an address unit - LCD_WriteReg(0x0051,yEnd); //Specify the start positions of the window address in the vertical direction by an address unit - LCD_WriteReg(0x0052,320 - xEnd); - LCD_WriteReg(0x0053,320 - StartX - 1); //Specify the end positions of the window address in the vertical direction by an address unit - - } - else - { - s_h = (StartX >> 8) & 0Xff; - s_l = StartX & 0Xff; - e_h = ((StartX + width - 1) >> 8) & 0Xff; - e_l = (StartX + width - 1) & 0Xff; - - LCD_IO_WriteReg(0x2A); - LCD_IO_WriteData(s_h); - LCD_IO_WriteData(s_l); - LCD_IO_WriteData(e_h); - LCD_IO_WriteData(e_l); - - s_h = (StartY >> 8) & 0Xff; - s_l = StartY & 0Xff; - e_h = ((StartY + heigh - 1) >> 8) & 0Xff; - e_l = (StartY + heigh - 1) & 0Xff; - - LCD_IO_WriteReg(0x2B); - LCD_IO_WriteData(s_h); - LCD_IO_WriteData(s_l); - LCD_IO_WriteData(e_h); - LCD_IO_WriteData(e_l); - } -} - -void LCD_Clear(uint16_t Color) -{ - uint32_t index=0; - - - unsigned int count; - - if(DeviceCode ==0x9488) - { - tft_set_cursor(0,0); - ili9320_SetWindows(0,0,480,320); - LCD_WriteRAM_Prepare(); - //index = (160*480); - for(index=0;index<320*480;index++) - { - LCD_IO_WriteData(Color); - } - //LCD_IO_WriteMultiple(Color, (480*320)); - //while(index --) - //LCD_IO_WriteData(Color); - } - else if(DeviceCode == 0x5761) - { - LCD_IO_WriteReg(0x002a); - LCD_IO_WriteData(0); - LCD_IO_WriteData(0); - LCD_IO_WriteData(HDP>>8); - LCD_IO_WriteData(HDP&0x00ff); - LCD_IO_WriteReg(0x002b); - LCD_IO_WriteData(0); - LCD_IO_WriteData(0); - LCD_IO_WriteData(VDP>>8); - LCD_IO_WriteData(VDP&0x00ff); - LCD_IO_WriteReg(0x002c); - LCD_IO_WriteReg(0x002c); - for(count=0;count<(HDP+1)*(VDP+1);count++) - { - LCD_IO_WriteData(Color); - } - } - else - { - tft_set_cursor(0,0); - LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */ - for(index=0;index<76800;index++) - { - LCD_IO_WriteData(Color); - } - } -} - -extern uint16_t ILI9488_ReadRAM(); - -#if DISABLED(SPI_GRAPHICAL_TFT) -void init_tft() -{ - uint16_t i; - //************* Start Initial Sequence **********// - - LCD_IO_Init(FSMC_CS_PIN, FSMC_RS_PIN); - - _delay_ms(5); - - LCD_IO_WriteReg(0X00D3); - DeviceCode=ILI9488_ReadRAM(); //dummy read - DeviceCode=ILI9488_ReadRAM(); - DeviceCode=ILI9488_ReadRAM(); - DeviceCode<<=8; - DeviceCode|=ILI9488_ReadRAM(); - - if(DeviceCode == 0x9488) - { - LCD_IO_WriteReg(0x00E0); - LCD_IO_WriteData(0x0000); - LCD_IO_WriteData(0x0007); - LCD_IO_WriteData(0x000f); - LCD_IO_WriteData(0x000D); - LCD_IO_WriteData(0x001B); - LCD_IO_WriteData(0x000A); - LCD_IO_WriteData(0x003c); - LCD_IO_WriteData(0x0078); - LCD_IO_WriteData(0x004A); - LCD_IO_WriteData(0x0007); - LCD_IO_WriteData(0x000E); - LCD_IO_WriteData(0x0009); - LCD_IO_WriteData(0x001B); - LCD_IO_WriteData(0x001e); - LCD_IO_WriteData(0x000f); - - LCD_IO_WriteReg(0x00E1); - LCD_IO_WriteData(0x0000); - LCD_IO_WriteData(0x0022); - LCD_IO_WriteData(0x0024); - LCD_IO_WriteData(0x0006); - LCD_IO_WriteData(0x0012); - LCD_IO_WriteData(0x0007); - LCD_IO_WriteData(0x0036); - LCD_IO_WriteData(0x0047); - LCD_IO_WriteData(0x0047); - LCD_IO_WriteData(0x0006); - LCD_IO_WriteData(0x000a); - LCD_IO_WriteData(0x0007); - LCD_IO_WriteData(0x0030); - LCD_IO_WriteData(0x0037); - LCD_IO_WriteData(0x000f); - - LCD_IO_WriteReg(0x00C0); - LCD_IO_WriteData(0x0010); - LCD_IO_WriteData(0x0010); - - LCD_IO_WriteReg(0x00C1); - LCD_IO_WriteData(0x0041); - - LCD_IO_WriteReg(0x00C5); - LCD_IO_WriteData(0x0000); - LCD_IO_WriteData(0x0022); - LCD_IO_WriteData(0x0080); - - LCD_IO_WriteReg(0x0036); - //ILI9488_WriteData(0x0068); - //if(gCfgItems.overturn_180 != 0xEE) - //{ - LCD_IO_WriteData(0x0068); - //} - //else - //{ - //ILI9488_WriteData(0x00A8); - //} - - LCD_IO_WriteReg(0x003A); //Interface Mode Control - LCD_IO_WriteData(0x0055); - - LCD_IO_WriteReg(0X00B0); //Interface Mode Control - LCD_IO_WriteData(0x0000); - LCD_IO_WriteReg(0x00B1); //Frame rate 70HZ - LCD_IO_WriteData(0x00B0); - LCD_IO_WriteData(0x0011); - LCD_IO_WriteReg(0x00B4); - LCD_IO_WriteData(0x0002); - LCD_IO_WriteReg(0x00B6); //RGB/MCU Interface Control - LCD_IO_WriteData(0x0002); - LCD_IO_WriteData(0x0042); - - LCD_IO_WriteReg(0x00B7); - LCD_IO_WriteData(0x00C6); - - //WriteComm(0XBE); - //WriteData(0x00); - //WriteData(0x04); - - LCD_IO_WriteReg(0x00E9); - LCD_IO_WriteData(0x0000); - - LCD_IO_WriteReg(0X00F7); - LCD_IO_WriteData(0x00A9); - LCD_IO_WriteData(0x0051); - LCD_IO_WriteData(0x002C); - LCD_IO_WriteData(0x0082); - - LCD_IO_WriteReg(0x0011); - for(i=0;i<65535;i++); - LCD_IO_WriteReg(0x0029); - - ili9320_SetWindows(0,0,480,320); - LCD_Clear(0x0000); - - OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); - } - -} -#endif - -extern uint8_t bmp_public_buf[17 * 1024]; -void tft_lvgl_init() -{ - //uint16_t test_id=0; - W25QXX.init(SPI_QUARTER_SPEED); - //test_id=W25QXX.W25QXX_ReadID(); - #if ENABLED (SDSUPPORT) - UpdatePic(); - UpdateFont(); - #endif - gCfgItems_init(); - ui_cfg_init(); - disp_language_init(); - //spi_flash_read_test(); - - #if ENABLED(SPI_GRAPHICAL_TFT) - SPI_TFT.spi_init(SPI_FULL_SPEED); - SPI_TFT.LCD_init(); - #else - init_tft(); - #endif - - lv_init(); - - lv_disp_buf_init(&disp_buf, bmp_public_buf, NULL, LV_HOR_RES_MAX * 18); /*Initialize the display buffer*/ - - lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/ - lv_disp_drv_init(&disp_drv); /*Basic initialization*/ - disp_drv.flush_cb = my_disp_flush; /*Set your driver function*/ - disp_drv.buffer = &disp_buf; /*Assign the buffer to the display*/ - lv_disp_drv_register(&disp_drv); /*Finally register the driver*/ - - lv_indev_drv_t indev_drv; - lv_indev_drv_init(&indev_drv); /*Descriptor of a input device driver*/ - indev_drv.type = LV_INDEV_TYPE_POINTER; /*Touch pad is a pointer-like device*/ - indev_drv.read_cb = my_touchpad_read; /*Set your driver function*/ - lv_indev_drv_register(&indev_drv); /*Finally register the driver*/ - - systick_attach_callback(SysTick_Callback); - - init_gb2312_font(); - - tft_style_init(); - - filament_pin_setup(); - - #if ENABLED(POWER_LOSS_RECOVERY) - if((recovery.info.valid_head != 0) && - (recovery.info.valid_head == recovery.info.valid_foot)) - { - if(gCfgItems.from_flash_pic == 1) - flash_preview_begin = 1; - else - default_preview_flg = 1; - - uiCfg.print_state = REPRINTING; - - memset(public_buf_m,0,sizeof(public_buf_m)); - strncpy(public_buf_m,recovery.info.sd_filename,sizeof(public_buf_m)); - card.printLongPath(public_buf_m); - - strncpy(list_file.long_name[sel_id],card.longFilename,sizeof(list_file.long_name[sel_id])); - - lv_draw_printing(); - } - else - #endif - lv_draw_ready_print(); - - #if ENABLED(MKS_TEST) - Test_GPIO(); - #endif -} - - - -#if 0 -void LCD_WriteRAM(uint16_t RGB_Code) -{ - #if 0 - ClrCs - /* Write 16-bit GRAM Reg */ - LCD->LCD_RAM = RGB_Code; - SetCs - #else - LCD_IO_WriteData(RGB_Code); - #endif -} -#endif - - - - -#if ENABLED(SPI_GRAPHICAL_TFT) -void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) -{ - uint16_t i,width,height; - uint16_t clr_temp; - uint8_t tbuf[480*2]; - - SPI_TFT.spi_init(SPI_FULL_SPEED); - - width = area->x2 - area->x1 + 1; - height = area->y2 - area->y1 +1; - - for(int j=0;jx1,(uint16_t)area->y1+j,width,1); - SPI_TFT.LCD_WriteRAM_Prepare(); - - for(i=0;ich.red<<11) - |((uint16_t)color_p->ch.green<<5) - |((uint16_t)color_p->ch.blue)); - - tbuf[i]=clr_temp>>8; - tbuf[i+1]=clr_temp; - i+=2; - color_p++; - } - SPI_TFT_CS_L; - SPI_TFT_DC_H; - SPI.dmaSend(tbuf,width*2,true); - SPI_TFT_CS_H; - } - - lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ - - W25QXX.init(SPI_QUARTER_SPEED); -} -#else -void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) -{ - #if 1 - uint16_t i,width,height; - uint16_t clr_temp; - #if 0 - int32_t x,y; - for(y = area->y1; y <= area->y2; y++) { - for(x = area->x1; x <= area->x2; x++) { - //set_pixel(x, y, *color_p); /* Put a pixel to the display.*/ - clr_temp = (uint16_t)(((uint16_t)color_p->ch.red<<11) - |((uint16_t)color_p->ch.green<<5) - |((uint16_t)color_p->ch.blue)); - tft_set_point(x, y,clr_temp); - color_p++; - } - } - #else - width = area->x2 - area->x1 + 1; - height = area->y2 - area->y1 +1; - //tft_set_cursor((uint16_t)area->x1,(uint16_t)area->y1); - ili9320_SetWindows((uint16_t)area->x1,(uint16_t)area->y1,width,height); - LCD_WriteRAM_Prepare(); - for(i=0;i<(width*height);i++) - { - clr_temp = (uint16_t)(((uint16_t)color_p->ch.red<<11) - |((uint16_t)color_p->ch.green<<5) - |((uint16_t)color_p->ch.blue)); - LCD_IO_WriteData(clr_temp); - color_p++; - } - #endif - - lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ - #endif -} -#endif - - -#define TICK_CYCLE 1 - -static int32_t touch_time1 = 0; - -unsigned int getTickDiff(unsigned int curTick, unsigned int lastTick) -{ - if(lastTick <= curTick) - { - return (curTick - lastTick) * TICK_CYCLE; - } - else - { - return (0xffffffff - lastTick + curTick) * TICK_CYCLE; - } -} - -#if ENABLED(SPI_GRAPHICAL_TFT) - -#ifndef USE_XPT2046 -#define USE_XPT2046 1 -#define XPT2046_XY_SWAP 1 -#define XPT2046_X_INV 1 -#define XPT2046_Y_INV 0 -#endif - -#if USE_XPT2046 -#define XPT2046_HOR_RES 480 -#define XPT2046_VER_RES 320 -#define XPT2046_X_MIN 201 -#define XPT2046_Y_MIN 164 -#define XPT2046_X_MAX 3919 -#define XPT2046_Y_MAX 3776 -#define XPT2046_AVG 4 -#define XPT2046_INV 1 -#endif - -#else -#ifndef USE_XPT2046 -#define USE_XPT2046 1 -#define XPT2046_XY_SWAP 1 -#define XPT2046_X_INV 0 -#define XPT2046_Y_INV 1 -#endif - -#if USE_XPT2046 -#define XPT2046_HOR_RES 480 -#define XPT2046_VER_RES 320 -#define XPT2046_X_MIN 201 -#define XPT2046_Y_MIN 164 -#define XPT2046_X_MAX 3919 -#define XPT2046_Y_MAX 3776 -#define XPT2046_AVG 4 -#define XPT2046_INV 0 -#endif -#endif - -static void xpt2046_corr(uint16_t * x, uint16_t * y) -{ -#if XPT2046_XY_SWAP - int16_t swap_tmp; - swap_tmp = *x; - *x = *y; - *y = swap_tmp; -#endif - if((*x) > XPT2046_X_MIN) - (*x) -= XPT2046_X_MIN; - else - (*x) = 0; - if((*y) > XPT2046_Y_MIN) - (*y) -= XPT2046_Y_MIN; - else - (*y) = 0; - (*x) = (uint32_t)((uint32_t)(*x) * XPT2046_HOR_RES)/(XPT2046_X_MAX - XPT2046_X_MIN); - (*y) = (uint32_t)((uint32_t)(*y) * XPT2046_VER_RES)/(XPT2046_Y_MAX - XPT2046_Y_MIN); -#if XPT2046_X_INV - (*x) = XPT2046_HOR_RES - (*x); -#endif -#if XPT2046_Y_INV - (*y) = XPT2046_VER_RES - (*y); -#endif -} - -#define times 4 -#define CHX 0x90//0x90 -#define CHY 0xD0//0xd0 - -int SPI2_ReadWrite2Bytes(void) -{ - volatile uint16_t ans=0; - uint16_t temp = 0; - #if ENABLED(SPI_GRAPHICAL_TFT) - temp=SPI_TFT.spi_read_write_byte(0xff); - ans=temp<<8; - temp=SPI_TFT.spi_read_write_byte(0xff); - ans|=temp; - ans>>=3; - #else - temp=W25QXX.spi_flash_read_write_byte(0xff); - ans=temp<<8; - temp=W25QXX.spi_flash_read_write_byte(0xff); - ans|=temp; - ans>>=3; - #endif - return ans&0x0fff; -} - -uint16_t x_addata[times],y_addata[times]; -void XPT2046_Rd_Addata(uint16_t *X_Addata,uint16_t *Y_Addata) -{ - - uint16_t i,j,k; - //int result; - - //#if ENABLED(TOUCH_BUTTONS) - - #if ENABLED(SPI_GRAPHICAL_TFT) - SPI_TFT.spi_init(SPI_QUARTER_SPEED); - #endif - - for(i=0;i x_addata[i]) - { - k = x_addata[j]; - x_addata[j] = x_addata[i]; - x_addata[i] = k; - } - } - } - if(x_addata[times / 2 -1] - x_addata[times / 2 ] > 50) - { - *X_Addata = 0; - *Y_Addata = 0; - return ; - } - - *X_Addata = (x_addata[times / 2 -1] + x_addata[times / 2 ]) /2; - - - //result = y_addata[0]; - for(i=0;i y_addata[i]) - { - k = y_addata[j]; - y_addata[j] = y_addata[i]; - y_addata[i] = k; - } - } - } - - - if(y_addata[times / 2 -1] - y_addata[times / 2 ] > 50) - { - *X_Addata = 0; - *Y_Addata = 0; - return ; - } - - *Y_Addata = (y_addata[times / 2 -1] + y_addata[times / 2 ]) /2; - - -} - -#define ADC_VALID_OFFSET 10 - -uint8_t TOUCH_PressValid(uint16_t _usX, uint16_t _usY) -{ - if ((_usX <= ADC_VALID_OFFSET) || (_usY <= ADC_VALID_OFFSET) - || (_usX >= 4095 - ADC_VALID_OFFSET) - || (_usY >= 4095 - ADC_VALID_OFFSET)) - { - return 0; - } - else - { - return 1; - } -} - -static lv_coord_t last_x = 0; - static lv_coord_t last_y = 0; -bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) -{ - #if 1 - uint32_t tmpTime, diffTime = 0; - - - - tmpTime = millis(); - diffTime = getTickDiff(tmpTime, touch_time1); - /*Save the state and save the pressed coordinate*/ - //data->state = TOUCH_PressValid(last_x, last_y) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; - //if(data->state == LV_INDEV_STATE_PR) ADS7843_Rd_Addata((u16 *)&last_x, (u16 *)&last_y); - //touchpad_get_xy(&last_x, &last_y); - /*Save the pressed coordinates and the state*/ - if(diffTime > 10) - { - XPT2046_Rd_Addata((uint16_t *)&last_x, (uint16_t *)&last_y); - if(TOUCH_PressValid(last_x, last_y)) { - - data->state = LV_INDEV_STATE_PR; - - /*Set the coordinates (if released use the last pressed coordinates)*/ - - xpt2046_corr((uint16_t *)&last_x, (uint16_t *)&last_y); - data->point.x = last_x; - data->point.y = last_y; - - } else { - data->state = LV_INDEV_STATE_REL; - } - touch_time1 = tmpTime; - } - - return false; /*Return `false` because we are not buffering and no more data to read*/ - #endif -} - -#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h new file mode 100644 index 000000000000..a552ed421996 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h @@ -0,0 +1,718 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +//****************英文***************************// +#define MACHINE_CONFIG_EN "Machine\nSettings" + +#define NEXT_EN "Next" +#define PREVIOUS_EN "Previous" +#define DEFAULT_EN "Default" +#define KEY_BACK_EN "Del" +#define KEY_REST_EN "Rest" +#define KEY_CONFIRM_EN "Confirm" + +#define KEYBOARD_KEY0_EN "0" +#define KEYBOARD_KEY1_EN "1" +#define KEYBOARD_KEY2_EN "2" +#define KEYBOARD_KEY3_EN "3" +#define KEYBOARD_KEY4_EN "4" +#define KEYBOARD_KEY5_EN "5" +#define KEYBOARD_KEY6_EN "6" +#define KEYBOARD_KEY7_EN "7" +#define KEYBOARD_KEY8_EN "8" +#define KEYBOARD_KEY9_EN "9" +#define KEYBOARD_KEY_POINT_EN "." +#define KEYBOARD_KEY_NEGATIVE_EN "-" + +#define MACHINE_PARA_EN "Machine\nsettings" +#define MACHINE_PARA_TITLE_EN "Machine settings" +#define MACHINE_TYPE_CNOFIG_EN "Machine" +#define TEMPERATURE_CONFIG_EN "Temperature" +#define MOTOR_CONFIG_EN "Motor" +#define ADVANCE_CONFIG_EN "Adavance" + +#define MACHINE_CONFIG_TITLE_EN "Machine Settings" +#define MACHINE_TYPE_EN "Machine type" +#define MACHINE_STROKE_EN "Machine Size" +#define MACHINE_HOMEDIR_EN "Home direction" +#define MACHINE_ENDSTOP_TYPE_EN "Endstop type" +#define MACHINE_FILAMENT_CONFIG_EN "Filament settings" +#define MACHINE_LEVELING_CONFIG_EN "Leveling settings" + +#define MACHINE_TYPE_CONFIG_TITLE_EN "Machine Settings>Machine type" +#define MACHINE_TYPE_XYZ_EN "XYZ Machine" +#define MACHINE_TYPE_DELTA_EN "Delta Machine" +#define MACHINE_TYPE_COREXY_EN "Corexy Machine" + +#define MACHINE_STROKE_CONF_TITLE_EN "Machine Settings>Machine Size" +#define X_MAX_LENGTH_EN "X-axis maximum stroke" +#define Y_MAX_LENGTH_EN "Y-axis maximum stroke" +#define Z_MAX_LENGTH_EN "Z-axis maximum stroke" + +#define X_MIN_LENGTH_EN "X-axis minimum stroke" +#define Y_MIN_LENGTH_EN "Y-axis minimum stroke" +#define Z_MIN_LENGTH_EN "Z-axis minimum stroke" + +#define HOME_DIR_CONF_TITLE_EN "Machine Settings>Home direction" +#define HOME_DIR_X_EN "X-axis home direction" +#define HOME_DIR_Y_EN "Y-axis home direction" +#define HOME_DIR_Z_EN "Z-axis home direction" +#define HOME_MIN_EN "MIN" +#define HOME_MAX_EN "MAX" + +#define ENDSTOP_CONF_TITLE_EN "Machine Settings>Endstop type" +#define MIN_ENDSTOP_X_EN "X-axis minimum Endstop" +#define MIN_ENDSTOP_Y_EN "Y-axis minimum Endstop" +#define MIN_ENDSTOP_Z_EN "Z-axis minimum Endstop" +#define MAX_ENDSTOP_X_EN "X axis maximum Endstop" +#define MAX_ENDSTOP_Y_EN "Y axis maximum Endstop" +#define MAX_ENDSTOP_Z_EN "Z axis maximum Endstop" +#define ENDSTOP_FIL_EN "Filament sensor" +#define ENDSTOP_LEVEL_EN "Leveling sensor" +#define ENDSTOP_OPENED_EN "Open" +#define ENDSTOP_CLOSED_EN "Close" + +#define FILAMENT_CONF_TITLE_EN "Filament settings" +#define FILAMENT_IN_TEMPERATURE_EN "Load temperature" +#define FILAMENT_IN_LENGTH_EN "Load length" +#define FILAMENT_IN_SPEED_EN "Load speed" +#define FILAMENT_OUT_TEMPERATURE_EN "Unload temperature" +#define FILAMENT_OUT_LENGTH_EN "Unload length" +#define FILAMENT_OUT_SPEED_EN "Unload speed" + +#define LEVELING_CONF_TITLE_EN "Leveling settings" +#define LEVELING_PARA_CONF_EN "Leveling settings" +#define LEVELING_DELTA_EN "delta machine leveling" +#define LEVELING_XYZ_EN "Manual leveling coordinate settings" + +#define LEVELING_PARA_CONF_TITLE_EN "leveling setting" +#define AUTO_LEVELING_ENABLE_EN "Enable auto leveling" +#define BLTOUCH_LEVELING_ENABLE_EN "Enable BLtouch" +#define PROBE_PORT_EN "Probe connector" +#define PROBE_X_OFFSET_EN "Probe x axis offset" +#define PROBE_Y_OFFSET_EN "Probe y axis offset" +#define PROBE_Z_OFFSET_EN "Probe z axis offset" +#define PROBE_XY_SPEED_EN "Probe xy axis speed" +#define PROBE_Z_SPEED_EN "Probe z axis speed" +#define ENABLE_EN "YES" +#define DISABLE_EN "NO" +#define Z_MIN_EN "ZMin" +#define Z_MAX_EN "ZMax" + +#define DELTA_LEVEL_CONF_TITLE_EN "Delta Machine settings" +#define DELTA_LEVEL_CONF_EN "Delta Machine Leveling" +#define DELTA_MACHINE_RADIUS_EN "Machine Radius" +#define DELTA_DIAGONAL_ROD_EN "Machine rod length" +#define DELTA_PRINT_RADIUS_EN "Print radius" +#define DELTA_HEIGHT_EN "Print height" +#define SMOOTH_ROD_OFFSET_EN "Slider offset" +#define EFFECTOR_OFFSET_EN "Effector offset" +#define CALIBRATION_RADIUS_EN "Leveling radius" + +#define XYZ_LEVEL_CONF_TITLE_EN "Cartesian Machine Settings" +#define PROBE_REACH_MAX_LEFT_EN "Probe reaches leftmost position" +#define PROBE_REACH_MAX_RIGHT_EN "Probe reaches rightmost position" +#define PROBE_REACH_MAX_FRONT_EN "Probe reaches front position" +#define PROBE_REACH_MAX_BACK_EN "Probe reaches final position" + +#define TEMPERATURE_CONF_TITLE_EN "Machine Settings>Temperature settings" +#define NOZZLE_CONF_EN "Nozzle settings" +#define HOTBED_CONF_EN "Hotbed settings" +#define PREHEAT_TEMPER_EN "Preset temperature" + +#define NOZZLE_CONF_TITLE_EN "Machine Settings>Nozzle settings" +#define NOZZLECNT_EN "Number of nozzles" +#define NOZZLE_TYPE_EN "E0 Temperature type" +#define NOZZLE_ADJUST_TYPE_EN "PID thermostat" +#define NOZZLE_MIN_TEMPERATURE_EN "lowest temperature" +#define NOZZLE_MAX_TEMPERATURE_EN "Maximum temperature" +#define EXTRUD_MIN_TEMPER_EN "Minimum extrusion temperature" + +#define HOTBED_CONF_TITLE_EN "Machine Settings>Hotbed settings" +#define HOTBED_ADJUST_EN "PID thermostat" +#define HOTBED_MIN_TEMPERATURE_EN "lowest temperature" +#define HOTBED_MAX_TEMPERATURE_EN "Maximum temperature" + +#define MOTOR_CONF_TITLE_EN "Machine Settings>Motor settings" +#define MAXFEEDRATE_CONF_EN "Maximum speed settings" +#define ACCELERATION_CONF_EN "Acceleration settings" +#define JERKCONF_EN "Jerk settings" +#define STEPSCONF_EN "Steps settings" +#define MOTORDIRCONF_EN "Motor direction settings" +#define HOMEFEEDRATECONF_EN "Home speed setting" + +#define MAXFEEDRATE_CONF_TITLE_EN "Machine Settings>Maximum speed" +#define X_MAXFEEDRATE_EN "X axis maximum speed" +#define Y_MAXFEEDRATE_EN "Y axis maximum speed" +#define Z_MAXFEEDRATE_EN "Z axis maximum speed" +#define E0_MAXFEEDRATE_EN "E0 axis maximum speed" +#define E1_MAXFEEDRATE_EN "E1 axis maximum speed" + +#define ACCELERATION_CONF_TITLE_EN "Machine Settings>Acceleration" +#define PRINT_ACCELERATION_EN "Print acceleration" +#define RETRACT_ACCELERATION_EN "Retraction acceleration" +#define TRAVEL_ACCELERATION_EN "Travel acceleration" +#define X_ACCELERATION_EN "X-axis acceleration" +#define Y_ACCELERATION_EN "Y-axis acceleration" +#define Z_ACCELERATION_EN "Z-axis acceleration" +#define E0_ACCELERATION_EN "E0-axis acceleration" +#define E1_ACCELERATION_EN "E1-axis acceleration" + +#define JERK_CONF_TITLE_EN "Machine Settings>Jerk speed" +#define X_JERK_EN "X-axis jerk speed" +#define Y_JERK_EN "Y-axis jerk speed" +#define Z_JERK_EN "J-axis jerk speed" +#define E_JERK_EN "E-axis jerk speed" + +#define STEPS_CONF_TITLE_EN "Machine Settings>Steps settings" +#define X_STEPS_EN "X-axis steps" +#define Y_STEPS_EN "Y-axis stepS" +#define Z_STEPS_EN "Z-axis stepS" +#define E0_STEPS_EN "E0-axis steps" +#define E1_STEPS_EN "E1-axis steps" + +#define MOTORDIR_CONF_TITLE_EN "Machine Settings>Motor direction" +#define X_MOTORDIR_EN "X-axis motor direction invert" +#define Y_MOTORDIR_EN "Y-axis motor direction invert" +#define Z_MOTORDIR_EN "Z-axis motor direction invert" +#define E0_MOTORDIR_EN "E0-axis motor direction invert" +#define E1_MOTORDIR_EN "E1-axis motor direction invert" +#define INVERT_P_EN "YES" +#define INVERT_N_EN "NO" + +#define HOMEFEEDRATE_CONF_TITLE_EN "Machine Settings>Home speed" +#define X_HOMESPEED_EN "XY-axis Home speed" +#define Y_HOMESPEED_EN "Y-axis Home speed" +#define Z_HOMESPEED_EN "Z-axis Home speed" + +#define ADVANCED_CONF_TITLE_EN "Machine Settings>Advance" +#define PWROFF_DECTION_EN "power off dection module" +#define PWROFF_AFTER_PRINT_EN "Auto Shutdown after print" +#define HAVE_UPS_EN "Has UPS power supply" +#define Z2_AND_Z2ENDSTOP_CONF_EN "Z2 Settings" +#define ENABLE_PINS_CONF_EN "Enable pins level settings" + +#define Z2_AND_Z2ENDSTOP_CONF_TITLE_EN "Z2 Settings" +#define Z2_ENABLE_EN "Z2 Enable" +#define Z2_ENDSTOP_EN "Z2_EndStop Enable" +#define Z2_PORT_EN "Z2 Connector" + +#define ENABLE_PINS_CONF_TITLE_EN "ENABLE_PINS_LEVEL" +#define X_ENABLE_PINS_INVERT_EN "X_ENABLE_PIN_INVERT" +#define Y_ENABLE_PINS_INVERT_EN "Y_ENABLE_PIN_INVERT" +#define Z_ENABLE_PINS_INVERT_EN "Z_ENABLE_PIN_INVERT" +#define E_ENABLE_PINS_INVERT_EN "E_ENABLE_PIN_INVERT" + +#define TOOL_TEXT_EN "Tool" +#define PREHEAT_TEXT_EN "Preheat" +#define MOVE_TEXT_EN "Move" +#define HOME_TEXT_EN "Home" +#define PRINT_TEXT_EN "Printing" +#define EXTRUDE_TEXT_EN "Extrusion" +#define LEVELING_TEXT_EN "Leveling" +#define AUTO_LEVELING_TEXT_EN "AutoLevel" +#define SET_TEXT_EN "Settings" +#define MORE_TEXT_EN "More" + +#define ADD_TEXT_EN "Add" +#define DEC_TEXT_EN "Dec" +#define EXTRUDER_1_TEXT_EN "Extrusion1" +#define EXTRUDER_2_TEXT_EN "Extrusion2" +#define HEATBED_TEXT_EN "HeatBed" +#define TEXT_1C_EN "1℃" +#define TEXT_5C_EN "5℃" +#define TEXT_10C_EN "10℃" +#define CLOSE_TEXT_EN "Close" + +#define BACK_TEXT_EN "Back" + +#define TOOL_PREHEAT_EN "Preheat" +#define TOOL_EXTRUDE_EN "Extrusion" +#define TOOL_MOVE_EN "Move" +#define TOOL_HOME_EN "Home" +#define TOOL_LEVELING_EN "Leveling" +#define TOOL_AUTO_LEVELING_EN "AutoLevel" +#define TOOL_FILAMENT_EN "Filament" +#define TOOL_MORE_EN "More" + +#define AXIS_X_ADD_TEXT_EN "X+" +#define AXIS_X_DEC_TEXT_EN "X-" +#define AXIS_Y_ADD_TEXT_EN "Y+" +#define AXIS_Y_DEC_TEXT_EN "Y-" +#define AXIS_Z_ADD_TEXT_EN "Z+" +#define AXIS_Z_DEC_TEXT_EN "Z-" +#define TEXT_01MM_EN "0.1mm" +#define TEXT_1MM_EN "1mm" +#define TEXT_10MM_EN "10mm" + +#define HOME_X_TEXT_EN "X" +#define HOME_Y_TEXT_EN "Y" +#define HOME_Z_TEXT_EN "Z" +#define HOME_ALL_TEXT_EN "Home" +#define HOME_STOPMOVE_EN "Quickstop" + +#define PAGE_UP_TEXT_EN "Page up" +#define PAGE_DOWN_TEXT_EN "Page down" + +#define EXTRUDER_IN_TEXT_EN "In" +#define EXTRUDER_OUT_TEXT_EN "Out" +#define EXTRUDE_1MM_TEXT_EN "1mm" +#define EXTRUDE_5MM_TEXT_EN "5mm" +#define EXTRUDE_10MM_TEXT_EN "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_EN "Low" +#define EXTRUDE_MEDIUM_SPEED_TEXT_EN "Normal" +#define EXTRUDE_HIGH_SPEED_TEXT_EN "High" + +#define LEVELING_POINT1_TEXT_EN "Point1" +#define LEVELING_POINT2_TEXT_EN "Point2" +#define LEVELING_POINT3_TEXT_EN "Point3" +#define LEVELING_POINT4_TEXT_EN "Point4" +#define LEVELING_POINT5_TEXT_EN "Point5" + +#define FILESYS_TEXT_EN "FileSys" +#define WIFI_TEXT_EN "WiFi" +#define FAN_TEXT_EN "Fan" +#define ABOUT_TEXT_EN "About" +#define BREAK_POINT_TEXT_EN "Continue" +#define FILAMENT_TEXT_EN "Filament" +#define LANGUAGE_TEXT_EN "Language" +#define MOTOR_OFF_TEXT_EN "Motor-off" +#define MOTOR_OFF_XY_TEXT_EN "Off-XY" +#define SHUTDOWN_TEXT_EN "Shutdown" + +#define U_DISK_TEXT_EN "USB" +#define SD_CARD_TEXT_EN "SD" +#define WIFI_NAME_TEXT_EN "WiFi: " +#define WIFI_KEY_TEXT_EN "Key: " +#define WIFI_IP_TEXT_EN "IP: " +#define WIFI_AP_TEXT_EN "State: AP" +#define WIFI_STA_TEXT_EN "State: STA" +#define WIFI_CONNECTED_TEXT_EN "Connected" +#define WIFI_DISCONNECTED_TEXT_EN "Disconnected" +#define WIFI_EXCEPTION_TEXT_EN "Exception" +#define WIFI_RECONNECT_TEXT_EN "Reconnect" +#define CLOUD_TEXT_EN "Cloud" +#define CLOUD_BIND_EN "Bind" +#define CLOUD_UNBIND_EN "Unbind" +#define CLOUD_UNBINDING_EN "Unbinding" +#define CLOUD_DISCONNECTED_EN "Disconnected" +#define CLOUD_UNBINDED_EN "Unbinded" +#define CLOUD_BINDED_EN "Binded" +#define CLOUD_DISABLE_EN "Disable" + +#define FAN_ADD_TEXT_EN "Add" +#define FAN_DEC_TEXT_EN "Dec" +#define FAN_OPEN_TEXT_EN "100%" +#define FAN_HALF_TEXT_EN "50%" +#define FAN_CLOSE_TEXT_EN "Close" +#define FAN_TIPS1_TEXT_EN "FAN" +#define FAN_TIPS2_TEXT_EN "FAN\nClose" + +#define FILAMENT_IN_TEXT_EN "Load" +#define FILAMENT_OUT_TEXT_EN "Unload" +#define FILAMENT_EXT0_TEXT_EN "Extrusion1" +#define FILAMENT_EXT1_TEXT_EN "Extrusion2" +#define FILAMENT_HEAT_TEXT_EN "Preheat" +#define FILAMENT_STOP_TEXT_EN "Stop" +//#define FILAMENT_CHANGE_TEXT_EN "Filament replace" +#define FILAMENT_TIPS2_TEXT_EN "T:" +#define FILAMENT_TIPS3_TEXT_EN "Loading..." +#define FILAMENT_TIPS4_TEXT_EN "Unloading..." +#define FILAMENT_TIPS5_TEXT_EN "Temp is too low to go,please heat" +#define FILAMENT_TIPS6_TEXT_EN "Completed" + +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_EN "Please click or \nto replace filament!" + #define FILAMENT_CHANGE_TEXT_EN "Please click or ,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN "Heat completed,please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_EN "Please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN "Heat completed,please click for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_EN "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_EN "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN "Load filament completed,click for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN "Unload filament completed,click for return!" +#endif + + + #define FILAMENT_CHANGE_TEXT_EN "Please click \nor ,After \npinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN "Heat completed,please load filament \nto extruder,and click \nfor start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_EN "Please load filament to extruder,\nand click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN "Heat completed,please \nclick for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_EN "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_EN "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN "Load filament completed,\nclick for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN "Unload filament completed,\nclick for return!" + + +#define PRE_HEAT_EXT_TEXT_EN "E" +#define PRE_HEAT_BED_TEXT_EN "Bed" + +#define FILE_LOADING_EN "Loading......" +#if 0 + #define NO_FILE_AND_CHECK_EN "No files found!Please insert SD card or U disk!" +#else + #define NO_FILE_AND_CHECK_EN " No files found!\n Check the file system configuration!" +#endif + +#define NO_FILE_EN "No files found!" + +#define EXTRUDER_TEMP_TEXT_EN "Temper" +#define EXTRUDER_E_LENGTH1_TEXT_EN "Extrusion1" +#define EXTRUDER_E_LENGTH2_TEXT_EN "Extrusion2" +#define EXTRUDER_E_LENGTH3_TEXT_EN "Extrusion3" + +#define ABOUT_TYPE_TEXT_EN "Type: " +#define ABOUT_VERSION_TEXT_EN "Firmware: " +#define ABOUT_WIFI_TEXT_EN "WiFi: " + +#define PRINTING_OPERATION_EN "Option" +#define PRINTING_PAUSE_EN "Pause" +#define PRINTING_TEMP_EN "Temp." +#define PRINTING_CHANGESPEED_EN "Speed" +#define PRINTING_RESUME_EN "Resume" +#define PRINTING_STOP_EN "Stop" +#define PRINTING_MORE_EN "More" +#define PRINTING_EXTRUDER_EN "Extrusion" +#define PRINTING_MOVE_EN "Move" + +#define EXTRUDER_SPEED_EN "Extrusion" +#define MOVE_SPEED_EN "Move" +#define EXTRUDER_SPEED_STATE_EN "Extrude Speed" +#define MOVE_SPEED_STATE_EN "Move Speed" +#define STEP_1PERCENT_EN "1%" +#define STEP_5PERCENT_EN "5%" +#define STEP_10PERCENT_EN "10%" + +#define ZOFFSET_EN "Z Offset" +#define ZOFFSET_INC_EN "Add" +#define ZOFFSET_DEC_EN "Dec" + +#define TITLE_READYPRINT_EN "ReadyPrint" +#define TITLE_PREHEAT_EN "Preheat" +#define TITLE_MOVE_EN "Move" +#define TITLE_HOME_EN "Home" +#define TITLE_EXTRUDE_EN "Extrusion" +#define TITLE_LEVELING_EN "Leveling" +#define TITLE_SET_EN "Settings" +#define TITLE_MORE_EN "More" +#define TITLE_CHOOSEFILE_EN "ChooseFile" +#define TITLE_PRINTING_EN "Printing" +#define TITLE_OPERATION_EN "Operation" +#define TITLE_ADJUST_EN "Adjust" +#define TITLE_WIRELESS_EN "Wireless" +#define TITLE_FILAMENT_EN "Filament" +#define TITLE_ABOUT_EN "About" +#define TITLE_FAN_EN "Fan" +#define TITLE_LANGUAGE_EN "Language" +#define TITLE_PAUSE_EN "Pause" +#define TITLE_CHANGESPEED_EN "Speed" +#define TITLE_CLOUD_TEXT_EN "Cloud" +#define TITLE_DIALOG_CONFIRM_EN "Confirm" +#define TITLE_FILESYS_EN "FileSys" +#define TITLE_ZOFFSET_EN "Z Offset" + +#define AUTO_SHUTDOWN_EN "Auto" +#define MANUAL_SHUTDOWN_EN "Manual" + +#define DIALOG_CONFIRM_EN "Confirm" +#define DIALOG_CANCLE_EN "Cancel" +#define DIALOG_OK_EN "OK" +#define DIALOG_RESET_EN "Reset" +#define DIALOG_RETRY_EN "Retry" +#define DIALOG_DISABLE_EN "Disable" +#define DIALOG_PRINT_MODEL_EN "Print this model?" +#define DIALOG_CANCEL_PRINT_EN "Stop print?" +#define DIALOG_RETRY_EN "Retry" +#define DIALOG_STOP_EN "Stop" +#define DIALOG_REPRINT_FROM_BREAKPOINT_EN "Reprint from breakpoint?" +//#define DIALOG_UNBIND_PRINTER_EN "Unbind the printer?" +#define DIALOG_ERROR_TIPS1_EN "Error:no file,please check it again." +#define DIALOG_ERROR_TIPS2_EN "Error:transaction failed.please check display baudrate \nwhether as the same as mainboard!" +#define DIALOG_ERROR_TIPS3_EN "Error:file name or path is too long!" +#define DIALOG_CLOSE_MACHINE_EN "Closing machine......" +#define DIALOG_UNBIND_PRINTER_EN "Unbind the printer?" +#define DIALOG_FILAMENT_NO_PRESS_EN "Filament detection switch is not pressed" +#define DIALOG_PRINT_FINISH_EN "Done print!" +#define DIALOG_PRINT_TIME_EN "Print time: " +#define DIALOG_REPRINT_EN "Print again" +#define DIALOG_WIFI_ENABLE_TIPS_EN "The wifi module is being configured\nplease wait a moment....." + +#define HOTBED_ENABLE_EN "Enable heatbed" +#define MOTOR_EN_HIGH_LEVEL_EN "High" +#define MOTOR_EN_LOW_LEVEL_EN "Low" + +#define TEXT_WIFI_MENU_TITLE_EN "WI-FI" +#define TEXT_WIFI_SAPCE_EN "space" +#define TEXT_WIFI_LETTER_EN "abc" +#define TEXT_WIFI_DIGITAL_EN "123" +#define TEXT_WIFI_SYMBOL_EN "#+=" +#define TEXT_WIFI_PASSWORD_EN "Password" + +#define TEXT_WIFI_POINT_BOLD_EN "`" + +#define TEXT_WIFI_JOINING_EN "Joining\nNetwork..." +#define TEXT_WIFI_FAILED_JOIN_EN "Failed to\nJoin Wi-Fi" +#define TEXT_WIFI_WIFI_CONECTED_EN "Wi-Fi\nConnected" + +#define TEXT_BUTTON_DISCONECTED_EN "Disconnect" +#define TEXT_WIFI_FORGET_EN "Forget Network" +#define TEXT_DISCONECTED_EN "Wi-Fi Connected" + +//wifi-list +#define MAIN_BUILT_EN "Build" +#define MAIN_FILAMENT_EN "Filament" +#define MAIN_SETUP_EN "Setup" +#define MAIN_ABOUT_EN "About" +#define MAIN_MENU_EN "Menu" +#define FILE_MENU_BUILD_EN "Build" +#define FILE_MENU_MENU_EN " < Menu" + +//about +#define ABOUT_TITLE_EN "About" +#define ABOUT_BUILT_MACHINES_EN "Built Machines" +#define ABOUT_SPARK_EN "Spark" +#define ABOUT_VERSION_EN "Version 1.1.0" +#define ABOUT_SERIAL_NUMBER_EN "Serial Number:" +#define ABOUT_S_NUMBER_EN "DCPLX02KFC6P" + +//set +#define SETUP_TITLE_EN "Setup" +#define SETUP_WIFI_EN "Wi-Fi" +#define SETUP_MANUAL_IP_EN "Manual IP" +#define SETUP_WIFI_NOT_CONNECTED_EN "Not Connected" +#define SETUP_WIFI_NETWORK_EN "WiFi_Network" + +//build +#define BUILD_TITLE_EN "Build" +#define BUILD_SD_CARD_EN "SD Card" +#define BUILD_USB_DRIVE_EN "USB Drive" + +//SD card +#define SD_CARD_TITLE_EN "SD Card" +#define SD_CARD_BACK_EN "< Back" +//USB Drive +#define USB_DRIVE_TITLE_EN "USB Drive" +#define USB_DRIVE_BACK_EN "< Back" +#define FILE_PAGES_EN "%d/%d" +#define FILE_NEXT_PAGE_EN "Next Page" + +//BUILD PLATE +#define PLATE_TITLE_EN "Build Plate" +#define PLATE_BACK_EN "< Back" +#define PLATE_CONFIRM_EN "Confirm >" +#define PLATE_TIPS_EN "Confirm that there is a Clear\nBuild Plate installed in the\nmachine." + +//build model +#define MODEL_TITLE_EN "Build Model" +#define MODEL_START_BUILD_EN "Start Build" +#define MODEL_BACK_EN "< Back" + +//building +#define BUILDING_TITLE_EN "Building" +#define BUILDING_MENU_EN "Build Menu" +#define BUILDING_COMPLETED "Build\nComplete" + +//building menu +#define BUILDING_MENU_TITLE_EN "Build Menu" +#define BUILDING_MENU_SETTINGS_EN "Build Settings" +#define BUILDING_MENU_PAUSE_EN "Pause Build" +#define BUILDING_MENU_CANCEL_EN "Cancel Build" +#define BUILDING_MENU_BACK_EN "< Back" + +//build settings +#define SETTINGS_TITLE_EN "Build Settings" +#define SETTINGS_NOZZLE_TEMPER_EN "Nozzle Temp:" +#define SETTINGS_NOZZLE_VALUE_EN "%d" +#define SETTINGS_BED_TEMPER_EN "Bed Temp:" +#define SETTINGS_BED_VALUE_EN "%d" +#define SETTINGS_BUILD_SPEED_EN "Build Speed:" +#define SETTINGS_SPEED_VALUE_EN "Standard" +#define SETTINGS_BACK_EN "< Back" + +//build paused +#define PAUSED_TITLE_EN "Build Paused" +#define PAUSED_RESUME_EN "Resume Build" +#define PAUSED_CANCEL_EN "Cancel Build" +#define PAUSED_BACK_EN "< Back" + +//build cancel +#define CANCEL_TITLE_EN "Cancel Build" +#define CANCEL_BUILD_EN "Cancel Build" +#define CANCEL_TIPS_EN "Are you sure you want to\ncancel this build? The model\nwill be deleted from this\nmachine. It will need to be\nresent from your computer\nbefore it can be built in the\nfuture." +#define CANCEL_BACK_EN "< Back" +#define CANCEL_BUILD_DISPLAY_EN "Build\nCanceled" +#define CANCEL_OVER_PLATE_TIPS_EN "Confirm that the Build Plate\nhas been removed from the\nmachine." + +//filament model enter +#define FILAMENT_MODEL_ENTER_TITLE_EN "Model-PLA" +#define FILAMENT_MODEL_ENTER_BACK_EN "< Back" +#define FILAMENT_MODEL_ENTER_BEGIN_EN "Begin >" +#define FILAMENT_MODEL_ENTER_TIPS_EN "The Model Filament spool\ncompartment is located on\nthe right side of the machine." + +//filament model PLA +#define FILAMENT_MODEL_PLA_TITLE_EN "Model-PLA" +#define FILAMENT_PLA_LOAD_TITLE_EN "Load Filament" +#define FILAMENT_PLA_UNLOAD_TITLE_EN "Unload Filament" +#define FILAMENT_MODEL_PLA_LOAD_EN "Load Filament" +#define FILAMENT_MODEL_PLA_UNLOAD_EN "Unload Filament" +//filament support enter +#define FILAMENT_SUPPORT_ENTER_TITLE_EN "Support-PVA" +#define FILAMENT_SUPPORT_ENTER_BACK_EN "< Back" +#define FILAMENT_SUPPORT_ENTER_BEGIN_EN "Begin >" +#define FILAMENT_SUPPORT_ENTER_TIPS_EN "The Support Filament spool\ncompartment is located on\nthe left side of the machine." +//filament heating +#define FILAMENT_HEATING_LOAD_TITLE_EN "Load Filament" +#define FILAMENT_HEATING_UNLOAD_TITLE_EN "Unload Filament" +#define FILAMENT_HEATING_CANCEL_EN "< Cancel" +#define FILAMENT_HEATING_MATERIAL_EN "Material:" +#define FILAMENT_HEATING_PLA_EN "Model-PLA" +#define FILAMENT_HEATING_TIPS_EN "Print head is heating..." +//rotate left +#define ROTATE_LEFT_LOAD_TITLE_EN "Load Filament" +#define ROTATE_LEFT_UNLOAD_TITLE_EN "Unload Filament" +#define ROTATE_LEFT_CANCEL_EN "< Cancel" +#define ROTATE_LEFT_MATERIAL_EN "Material:" +#define ROTATE_LEFT_PLA_EN "Model-PLA" +#define ROTATE_LEFT_NEXT_EN "Next >" +#define ROTATE_LEFT_TIPS_EN "Rotate extruder selection\ndial to the left." + +//hang spool +#define HANG_SPOOL_TITLE_EN "Load Filament" +#define HANG_SPOOL_PREVIOUS_EN "< Previous" +#define HANG_SPOOL_MATERIAL_EN "Material:" +#define HANG_SPOOL_PLA_EN "Model-PLA" +#define HANG_SPOOL_NEXT_EN "Next >" +#define HANG_SPOOL_TIPS_EN "Hang the spool in the spool\ncompartment as shown." + +//feed filament +#define FEED_FILAMENT_TITLE_EN "Load Filament" +#define FEED_FILAMENT_PREVIOUS_EN "< Previous" +#define FEED_FILAMENT_MATERIAL_EN "Material:" +#define FEED_FILAMENT_PLA_EN "Model-PLA" +#define FEED_FILAMENT_NEXT_EN "Next >" +#define FEED_FILAMENT_TIPS_EN "Feed filament into extruder\nup beyond the gears." + +//feed filament +#define ROTATE_UP_TITLE_EN "Load Filament" +#define ROTATE_UP_PREVIOUS_EN "< Previous" +#define ROTATE_UP_MATERIAL_EN "Material:" +#define ROTATE_UP_PLA_EN "Model-PLA" +#define ROTATE_UP_NEXT_EN "Next >" +#define ROTATE_UP_TIPS_EN "Rotate extruder selection\ndial up." + +//filament begin +#define FEED_BEGIN_TITLE_EN "Load Filament" +#define FEED_BEGIN_MATERIAL_EN "Material:" +#define FEED_BEGIN_PLA_EN "Model-PLA" +#define FEED_BEGIN_NEXT_EN "Next >" +#define FEED_BEGIN_TIPS_EN "Press Next when filament\nbegins to extrude." + +//filament finish +#define FEED_FINISH_TITLE_EN "Load Filament" +#define FEED_FINISH_MATERIAL_EN "Material:" +#define FEED_FINISH_PLA_EN "Model-PLA" +#define FEED_FINISH_NEXT_EN "Finish >" +#define FEED_FINISH_TIPS_EN "Remove filament from the\nnozzle and discard." +//fiament remove +#define REMOVE_SPOOL_TITLE_EN "Unload Filament" +#define REMOVE_SPOOL_PREVIOUS_EN "< Previous" +#define REMOVE_SPOOL_FINISH_EN "Finish >" +#define REMOVE_SPOOL_MATERIAL_EN "Material:" +#define REMOVE_SPOOL_PLA_EN "Model-PLA" +#define REMOVE_SPOOL_TIPS_EN "Remove the spool and pull\nfilament out of the machine." + +#define FILAMENT_SUPPORT_PVA_EN "Support-PVA" +#define LOAD_FINISH_EN "Load\nFilament\nComplete" +#define UNLOAD_FINISH_EN "Unload\nFilament\nComplete" + +//manual ip +#define MANUAL_IP_TITLE_EN "Manual IP" +#define MANUAL_IP_CANCEL_EN "< Cancel" +#define MANUAL_IP_APPLY_EN "Join >" +#define MANUAL_IP_ADDRESS_EN "IP Address" +#define MANUAL_IP_MASK_EN "Subnet Mask" +#define MANUAL_IP_GATEWAY_EN "Default Gateway" +#define MANUAL_IP_SERVER_EN "Name Server" +#define MANUAL_IP_INIT_DATA_EN "0.0.0.0" +#define MANUAL_TEXT_POINT_EN "." +#define MANUAL_TEXT_ENTER_EN "enter" + +//Wifi name +//#define TEXT_WIFI_MENU_TITLE_EN "WI-FI" +//#define TEXT_WIFI_SAPCE_EN "space" +//#define TEXT_WIFI_LETTER_EN "abc" +//#define TEXT_WIFI_DIGITAL_EN "123" +//#define TEXT_WIFI_SYMBOL_EN "#+=" +//#define TEXT_WIFI_PASSWORD_EN "Password" + +//#define TEXT_WIFI_POINT_BOLD_EN "`" + +//#define TEXT_WIFI_JOINING_EN "Joining\nNetwork..." +//#define TEXT_WIFI_FAILED_JOIN_EN "Failed to\nJoin Wi-Fi" +//#define TEXT_WIFI_WIFI_CONECTED_EN "Wi-Fi\nConnected" + +//#define TEXT_BUTTON_DISCONECTED_EN "Disconnect" +//#define TEXT_WIFI_FORGET_EN "Forget Network" +//#define TEXT_DISCONECTED_EN "Wi-Fi Connected" + +#define TEXT_FORGET_TIPS_TITLE_EN "Forget Network" +#define TEXT_FORGET_NETWORK_TIPS1_EN "Are you sure you want to\nforget this network?" +#define TEXT_FORGET_NETWORK_TIPS2_EN "This machine will no longer\njoin this Wi-Fi Network." + +#define TEXT_IPADDRESS_EN "IP Address: " + +#define TEXT_BUILD_FROM_CURA_CANCEL_TIPS1_EN "Are you sure you want to\ncancel this build?" +#define TEXT_BUILD_FROM_CURA_CANCEL_TIPS2_EN "The model will be deleted\nfrom this machine.It will\nneed to be resent from your\ncomputer before it can be\nbuilt in the future." + +#define DIALOG_CONFIRM_EN2 "Confirm" + +#define HEATING_TITLE_EN "Heating" +#define LEVELING_TITLE_EN "Leveling" + +#define ABOUT_SPARK_ADD_EN "Spark+" + +#define TEXT_RECEIVING_DATA_EN "Receiving Data" + +#define TEXT_BABY_STEP_EN "Babystep" + +#define PRINTING_OTHER_LANGUGE "Printing" +#define PRINTING_OPERATION_OTHER_LANGUGE "Operation" +#define PRINTING_PAUSE_OTHER_LANGUGE "Pause" + +#define MESSEGE_PAUSING_EN "Parking..." +#define MESSEGE_CHANGING_EN "Wait for filament change to start" +#define MESSEGE_UNLOAD_EN "Wait for filament unload" +#define MESSEGE_WAITING_EN "Press Button to resume print" +#define MESSEGE_INSERT_EN "Insert filament and press button to continue" +#define MESSEGE_LOAD_EN "Wait for filament load" +#define MESSEGE_PURGE_EN "Wait for filament purge" +#define MESSEGE_RESUME_EN "Wait for print to resume..." +#define MESSEGE_HEAT_EN "Press button to heat nozzle" +#define MESSEGE_HEATING_EN "Nozzle heating Please wait..." +#define MESSEGE_OPTION_EN "Purge more or continue print?" +#define MESSEGE_PURGE_MORE_EN "Purge" +#define MESSEGE_CONTINUE_PRINT_EN "Print" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h new file mode 100644 index 000000000000..08d802d8b27e --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h @@ -0,0 +1,276 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +//*************法文****************************// +#define TOOL_TEXT_FR "prêt" +#define PREHEAT_TEXT_FR "Préchauffe" +#define MOVE_TEXT_FR "Déplace" +#define HOME_TEXT_FR "Acceuil" +#define PRINT_TEXT_FR "Impression" +#define EXTRUDE_TEXT_FR "Extruder" +#define LEVELING_TEXT_FR "Leveling" +#define AUTO_LEVELING_TEXT_FR "AutoLevel" +#define SET_TEXT_FR "Config" +#define MORE_TEXT_FR "Plus" + +#define ADD_TEXT_FR "Ajouter" +#define DEC_TEXT_FR "Réduire" +#define EXTRUDER_1_TEXT_FR "Extr1" +#define EXTRUDER_2_TEXT_FR "Extr2" +#define HEATBED_TEXT_FR "Hotlit" +#define TEXT_1C_FR "1℃" +#define TEXT_5C_FR "5℃" +#define TEXT_10C_FR "10℃" +#define CLOSE_TEXT_FR "Off" + +#define BACK_TEXT_FR "Arrière" + +#define TOOL_PREHEAT_FR "Préchauffe" +#define TOOL_EXTRUDE_FR "Extruder" +#define TOOL_MOVE_FR "Déplace" +#define TOOL_HOME_FR "Acceuil" +#define TOOL_LEVELING_FR "Leveling" +#define TOOL_AUTO_LEVELING_FR "AutoLevel" +#define TOOL_FILAMENT_FR "Filament" +#define TOOL_MORE_FR "Plus" + +#define AXIS_X_ADD_TEXT_FR "X+" +#define AXIS_X_DEC_TEXT_FR "X-" +#define AXIS_Y_ADD_TEXT_FR "Y+" +#define AXIS_Y_DEC_TEXT_FR "Y-" +#define AXIS_Z_ADD_TEXT_FR "Z+" +#define AXIS_Z_DEC_TEXT_FR "Z-" +#define TEXT_01MM_FR "0.1mm" +#define TEXT_1MM_FR "1mm" +#define TEXT_10MM_FR "10mm" + +#define HOME_X_TEXT_FR "X" +#define HOME_Y_TEXT_FR "Y" +#define HOME_Z_TEXT_FR "Z" +#define HOME_ALL_TEXT_FR "ALL" +#define HOME_STOPMOVE_FR "Quickstop" + +#define PAGE_UP_TEXT_FR "En haut" +#define PAGE_DOWN_TEXT_FR "En bas" + +#define EXTRUDER_IN_TEXT_FR "Insérer" +#define EXTRUDER_OUT_TEXT_FR "éjecter" +#define EXTRUDE_1MM_TEXT_FR "1mm" +#define EXTRUDE_5MM_TEXT_FR "5mm" +#define EXTRUDE_10MM_TEXT_FR "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_FR "Lente" +#define EXTRUDE_MEDIUM_SPEED_TEXT_FR "Moyen" +#define EXTRUDE_HIGH_SPEED_TEXT_FR "Rapide" + +#define LEVELING_POINT1_TEXT_FR "Premier" +#define LEVELING_POINT2_TEXT_FR "Seconde" +#define LEVELING_POINT3_TEXT_FR "Troisième" +#define LEVELING_POINT4_TEXT_FR "Quatrième" +#define LEVELING_POINT5_TEXT_FR "Cinquième" + +#define FILESYS_TEXT_FR "Fichier" +#define WIFI_TEXT_FR "WiFi" +#define FAN_TEXT_FR "Fan" +#define ABOUT_TEXT_FR "A propos" +#define BREAK_POINT_TEXT_FR "Continuer" +#define FILAMENT_TEXT_FR "Remplacer" +#define LANGUAGE_TEXT_FR "Langue" +#define MOTOR_OFF_TEXT_FR "M-hors" +#define MOTOR_OFF_XY_TEXT_FR "M-hors-XY" +#define SHUTDOWN_TEXT_FR "Eteindre" + +#define U_DISK_TEXT_FR "Clé usb" +#define SD_CARD_TEXT_FR "Carte SD" +#define WIFI_NAME_TEXT_FR "WiFi: " +#define WIFI_KEY_TEXT_FR "Key: " +#define WIFI_IP_TEXT_FR "IP: " +#define WIFI_AP_TEXT_FR "Etat: AP" +#define WIFI_STA_TEXT_FR "Etat: STA" +#define WIFI_CONNECTED_TEXT_FR "Connecté" +#define WIFI_DISCONNECTED_TEXT_FR "Déconnecté" +#define WIFI_EXCEPTION_TEXT_FR "Exception" +#define WIFI_RECONNECT_TEXT_FR "Reconnect" +#define CLOUD_TEXT_FR "Cloud" +#define CLOUD_BIND_FR "Lié" +#define CLOUD_UNBIND_FR "Délier" +#define CLOUD_UNBINDING_FR "Délier" +#define CLOUD_DISCONNECTED_FR "Déconnecté" +#define CLOUD_UNBINDED_FR "Délier" +#define CLOUD_BINDED_FR "Lié" +#define CLOUD_DISABLE_FR "Désactiver" + +#define FAN_ADD_TEXT_FR "Ajouter" +#define FAN_DEC_TEXT_FR "Réduire" +#define FAN_OPEN_TEXT_FR "100%" +#define FAN_HALF_TEXT_FR "50%" +#define FAN_CLOSE_TEXT_FR "0%" +#define FAN_TIPS1_TEXT_FR "ventilateur" +#define FAN_TIPS2_TEXT_FR "ventilateur\n0" + +#define FILAMENT_IN_TEXT_FR "Insérer" +#define FILAMENT_OUT_TEXT_FR "éjecter" +#define FILAMENT_EXT0_TEXT_FR "Extr1" +#define FILAMENT_EXT1_TEXT_FR "Extr2" +#define FILAMENT_HEAT_TEXT_FR "Preheat" +#define FILAMENT_STOP_TEXT_FR "Arrêter" +//#define FILAMENT_CHANGE_TEXT_FR "Filament remplacer" +#define FILAMENT_TIPS2_TEXT_FR "T:" +#define FILAMENT_TIPS3_TEXT_FR "Insérer le filament..." +#define FILAMENT_TIPS4_TEXT_FR "éjecter le filament..." +#define FILAMENT_TIPS5_TEXT_FR "Température trop basse pour démarrer, chauffez svp" +#define FILAMENT_TIPS6_TEXT_FR "Terminé" + +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_FR "Please click or <éjecter> \nto replace filament!" + #define FILAMENT_CHANGE_TEXT_FR "Please click or <éjecter>,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR "Heat completed,please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR "Please load filament to extruder,and click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR "Heat completed,please click for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_FR "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_FR "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Load filament completed,click for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Unload filament completed,click for return!" +#endif + #define FILAMENT_CHANGE_TEXT_FR "Please click \nor ,After \npinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR "Heat completed,please load filament \nto extruder,and click \nfor start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR "Please load filament to extruder,\nand click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR "Heat completed,please \nclick for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_FR "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_FR "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Load filament completed,\nclick for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Unload filament completed,\nclick for return!" + + +#define PRE_HEAT_EXT_TEXT_FR "E" +#define PRE_HEAT_BED_TEXT_FR "Bed" + +#define FILE_LOADING_FR "Chargement......" +#if 0 + #define NO_FILE_AND_CHECK_FR "Aucun fichier trouvé! Insérez une carte SD ou un disque U!" +#else + #define NO_FILE_AND_CHECK_FR "Aucun fichier,vérifiez à nouveau!" +#endif + +#define NO_FILE_FR "Pas de fichier!" + + + +#define EXTRUDER_TEMP_TEXT_FR "Temper" +#define EXTRUDER_E_LENGTH1_TEXT_FR "Extruder1" +#define EXTRUDER_E_LENGTH2_TEXT_FR "Extruder2" +#define EXTRUDER_E_LENGTH3_TEXT_FR "Extruder3" + +#define ABOUT_TYPE_TEXT_FR "Type: " +#define ABOUT_VERSION_TEXT_FR "Firmware: " +#define ABOUT_WIFI_TEXT_FR "Wifi: " + +#define PRINTING_OPERATION_FR "Option" +#define PRINTING_PAUSE_FR "Pause" +#define PRINTING_TEMP_FR "Temp." +#define PRINTING_CHANGESPEED_FR "Speed" +#define PRINTING_RESUME_FR "Reprendre" +#define PRINTING_STOP_FR "Stop" +#define PRINTING_MORE_FR "Plus" +#define PRINTING_EXTRUDER_FR "Extruder" +#define PRINTING_MOVE_FR "Déplace" + +#define EXTRUDER_SPEED_FR "Extruder" +#define MOVE_SPEED_FR "Déplace" +#define EXTRUDER_SPEED_STATE_FR "Vitesse d'extrusion" +#define MOVE_SPEED_STATE_FR "vitesse de déplacement" +#define STEP_1PERCENT_FR "1%" +#define STEP_5PERCENT_FR "5%" +#define STEP_10PERCENT_FR "10%" + +#define ZOFFSET_FR "Z Offset" +#define ZOFFSET_INC_FR "Ajouter" +#define ZOFFSET_DEC_FR "Réduire" + +#define TITLE_READYPRINT_FR "Prête" +#define TITLE_PREHEAT_FR "Préchauffe" +#define TITLE_MOVE_FR "Déplace" +#define TITLE_HOME_FR "Acceuil" +#define TITLE_EXTRUDE_FR "Extruder" +#define TITLE_LEVELING_FR "Leveling" +#define TITLE_SET_FR "Paramètres" +#define TITLE_MORE_FR "Plus" +#define TITLE_CHOOSEFILE_FR "Fichier" +#define TITLE_PRINTING_FR "Pimpression" +#define TITLE_OPERATION_FR "Option" +#define TITLE_ADJUST_FR "Réglage" +#define TITLE_WIRELESS_FR "Sans fil" +#define TITLE_FILAMENT_FR "Remplacer" +#define TITLE_ABOUT_FR "A propos" +#define TITLE_FAN_FR "Ventilateur" +#define TITLE_LANGUAGE_FR "Langue" +#define TITLE_PAUSE_FR "Pause" +#define TITLE_CHANGESPEED_FR "Speed" +#define TITLE_CLOUD_TEXT_FR "Cloud" +#define TITLE_DIALOG_CONFIRM_FR "Confirm" +#define TITLE_FILESYS_FR "FileSys" +#define TITLE_ZOFFSET_FR "Z Offset" + +#define DIALOG_CLOSE_MACHINE_FR "Closing machine......" + +#define AUTO_SHUTDOWN_FR "Auto" +#define MANUAL_SHUTDOWN_FR "Manuel" + +#define DIALOG_CONFIRM_FR "Confirmer" +#define DIALOG_CANCLE_FR "Annuler" +#define DIALOG_OK_FR "OK" +#define DIALOG_RESET_FR "Réinitialiser" +#define DIALOG_RETRY_FR "Recommencez" +#define DIALOG_DISABLE_FR "Disable" +#define DIALOG_PRINT_MODEL_FR "Imprimer le fichier?" +#define DIALOG_CANCEL_PRINT_FR "Arrêter?" + +#define DIALOG_STOP_FR "Arrêter" +#define DIALOG_REPRINT_FROM_BREAKPOINT_FR "Continuer?" +//#define DIALOG_UNBIND_PRINTER_FR "Non lié?" +#define DIALOG_ERROR_TIPS1_FR "Erreur:error:Aucun fichier, \nvérifiez à nouveau." +#define DIALOG_ERROR_TIPS2_FR "Erreur:La opération a échoué. \nVerifiez que le baudrate de l'écran et de \nla carte mère soient identique!" +#define DIALOG_ERROR_TIPS3_FR "Erreur: le nom du fichier ou le \nchemin d'accès est trop long." +#define DIALOG_UNBIND_PRINTER_FR "Unbind the printer?" +#define DIALOG_FILAMENT_NO_PRESS_FR "Filament detection switch is not pressed" +#define DIALOG_PRINT_FINISH_FR "L'impression est terminée!" +#define DIALOG_PRINT_TIME_FR "Temps d'impression: " +#define DIALOG_REPRINT_FR "Print again" +#define DIALOG_WIFI_ENABLE_TIPS_FR "The wifi module is being configured,\nplease wait a moment....." + +#define MESSEGE_PAUSING_FR "Parking..." +#define MESSEGE_CHANGING_FR "Attente filament pour démarrer" +#define MESSEGE_UNLOAD_FR "Attente retrait du filament" +#define MESSEGE_WAITING_FR "Presser bouton,pour reprendre" +#define MESSEGE_INSERT_FR "Insérer filament et app. bouton pour continuer..." +#define MESSEGE_LOAD_FR "Attente chargement filament" +#define MESSEGE_PURGE_FR "Attente Purge filament" +#define MESSEGE_RESUME_FR "Attente reprise impression" +#define MESSEGE_HEAT_FR "Presser le bouton pour chauffer..." +#define MESSEGE_HEATING_FR "Buse en chauffe Patienter SVP..." +#define MESSEGE_OPTION_FR "Purger davantage ou continuer l'impression?" +#define MESSEGE_PURGE_MORE_FR "Purge" +#define MESSEGE_CONTINUE_PRINT_FR "Impression" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_it.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h similarity index 92% rename from Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_it.h rename to Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h index 9928218cb7e6..f88732e79893 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/inc/tft_Language_it.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h @@ -1,5 +1,26 @@ -#ifndef _TFT_LANGUAGE_IT_H -#define _TFT_LANGUAGE_IT_H +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + //****************意大利语***************************// #define TOOL_TEXT_IT "Strumento" #define PREHEAT_TEXT_IT "Prerisc" @@ -110,7 +131,7 @@ #define FILAMENT_OUT_TEXT_IT "Estra" #define FILAMENT_EXT0_TEXT_IT "Estrude1" #define FILAMENT_EXT1_TEXT_IT "Estrude2" -#define FILAMENT_HEAT_TEXT_IT "Preriscaldamento" +#define FILAMENT_HEAT_TEXT_IT "Preriscaldamento" #define FILAMENT_STOP_TEXT_IT "Stop" //#define FILAMENT_CHANGE_TEXT_IT "Filamento" #define FILAMENT_TIPS2_TEXT_IT "T:" @@ -248,4 +269,3 @@ #define MESSEGE_OPTION_IT "Eliminare di più o continuare a stampare?" #define MESSEGE_PURGE_MORE_IT "Epurazione" #define MESSEGE_CONTINUE_PRINT_IT "Stampa" -#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h new file mode 100644 index 000000000000..acbac2140bab --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h @@ -0,0 +1,272 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +//****************俄语***************************// +#define TOOL_TEXT_RU "инструмент" +#define PREHEAT_TEXT_RU " нагрев" +#define MOVE_TEXT_RU "движение" +#define HOME_TEXT_RU "домой" +#define PRINT_TEXT_RU " печать" +#define EXTRUDE_TEXT_RU "экструзия" +#define LEVELING_TEXT_RU "уровень" +#define AUTO_LEVELING_TEXT_RU "aвто" +#define SET_TEXT_RU "настройки" +#define MORE_TEXT_RU "больше" + +#define ADD_TEXT_RU "добавить" +#define DEC_TEXT_RU "уменьшить" +#define EXTRUDER_1_TEXT_RU "экструдер1" +#define EXTRUDER_2_TEXT_RU "экструдер2" +#define HEATBED_TEXT_RU "стол" +#define TEXT_1C_RU "1℃" +#define TEXT_5C_RU "5℃" +#define TEXT_10C_RU "10℃" +#define CLOSE_TEXT_RU "выкл" + +#define BACK_TEXT_RU "назад" + +#define TOOL_PREHEAT_RU "нагрев" +#define TOOL_EXTRUDE_RU "экструзия" +#define TOOL_MOVE_RU "движение" +#define TOOL_HOME_RU "домой" +#define TOOL_LEVELING_RU "уровень" +#define TOOL_AUTO_LEVELING_RU "aвто" +#define TOOL_FILAMENT_RU "замена" +#define TOOL_MORE_RU "больше" + +#define AXIS_X_ADD_TEXT_RU "X+" +#define AXIS_X_DEC_TEXT_RU "X-" +#define AXIS_Y_ADD_TEXT_RU "Y+" +#define AXIS_Y_DEC_TEXT_RU "Y-" +#define AXIS_Z_ADD_TEXT_RU "Z+" +#define AXIS_Z_DEC_TEXT_RU "Z-" +#define TEXT_01MM_RU "0.1mm" +#define TEXT_1MM_RU "1mm" +#define TEXT_10MM_RU "10mm" + +#define HOME_X_TEXT_RU "X" +#define HOME_Y_TEXT_RU "Y" +#define HOME_Z_TEXT_RU "Z" +#define HOME_ALL_TEXT_RU "Home" +#define HOME_STOPMOVE_RU "Quickstop" + +#define PAGE_UP_TEXT_RU "вверх" +#define PAGE_DOWN_TEXT_RU "вниз" + +#define EXTRUDER_IN_TEXT_RU "втянуть" +#define EXTRUDER_OUT_TEXT_RU "выдавить" +#define EXTRUDE_1MM_TEXT_RU "1mm" +#define EXTRUDE_5MM_TEXT_RU "5mm" +#define EXTRUDE_10MM_TEXT_RU "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_RU "мин" +#define EXTRUDE_MEDIUM_SPEED_TEXT_RU "сред" +#define EXTRUDE_HIGH_SPEED_TEXT_RU "выс" + +#define LEVELING_POINT1_TEXT_RU "1точка" +#define LEVELING_POINT2_TEXT_RU "2точка" +#define LEVELING_POINT3_TEXT_RU "3точка" +#define LEVELING_POINT4_TEXT_RU "4точка" +#define LEVELING_POINT5_TEXT_RU "5точка" + +#define FILESYS_TEXT_RU "система" +#define WIFI_TEXT_RU "WiFi" +#define FAN_TEXT_RU "вентилятор" +#define ABOUT_TEXT_RU "инфо" +#define BREAK_POINT_TEXT_RU "продолжить" +#define FILAMENT_TEXT_RU "замена" +#define LANGUAGE_TEXT_RU "язык" +#define MOTOR_OFF_TEXT_RU "отклмотор" +#define MOTOR_OFF_XY_TEXT_RU "Off-XY" +#define SHUTDOWN_TEXT_RU "выключение" + +#define U_DISK_TEXT_RU "U диск" +#define SD_CARD_TEXT_RU "SD диск" +#define WIFI_NAME_TEXT_RU "WiFi: " +#define WIFI_KEY_TEXT_RU "пароль: " +#define WIFI_IP_TEXT_RU "IP: " +#define WIFI_AP_TEXT_RU "режим: AP" +#define WIFI_STA_TEXT_RU "режим: STA" +#define WIFI_CONNECTED_TEXT_RU "подключен" +#define WIFI_DISCONNECTED_TEXT_RU "не подключен" +#define WIFI_EXCEPTION_TEXT_RU "исключение" +#define WIFI_RECONNECT_TEXT_RU "Reconnect" +#define CLOUD_TEXT_RU "облако" +#define CLOUD_BIND_RU "соединён" +#define CLOUD_UNBIND_RU "не соединён" +#define CLOUD_UNBINDING_RU "Unbinding" +#define CLOUD_DISCONNECTED_RU "Disconnected" +#define CLOUD_UNBINDED_RU "Unbinded" +#define CLOUD_BINDED_RU "Binded" +#define CLOUD_DISABLE_RU "Disable" + +#define FAN_ADD_TEXT_RU "добавить" +#define FAN_DEC_TEXT_RU "уменьшить" +#define FAN_OPEN_TEXT_RU "100%" +#define FAN_HALF_TEXT_RU "50%" +#define FAN_CLOSE_TEXT_RU "откл" +#define FAN_TIPS1_TEXT_RU "вентилятор" +#define FAN_TIPS2_TEXT_RU "вентилятор\nоткл" + +#define FILAMENT_IN_TEXT_RU "втянуть" +#define FILAMENT_OUT_TEXT_RU "выдавить" +#define FILAMENT_EXT0_TEXT_RU "экструдер1" +#define FILAMENT_EXT1_TEXT_RU "экструдер2" +#define FILAMENT_HEAT_TEXT_RU "нагрев" +#define FILAMENT_STOP_TEXT_RU "стоп" +//#define FILAMENT_CHANGE_TEXT_RU "замена" +#define FILAMENT_TIPS2_TEXT_RU "T:" +#define FILAMENT_TIPS3_TEXT_RU "втянуть..." +#define FILAMENT_TIPS4_TEXT_RU "вядавить..." +#define FILAMENT_TIPS5_TEXT_RU "Низкая температура, \nнеобходим нагрев" +#define FILAMENT_TIPS6_TEXT_RU "завершено" + +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_RU "Please click <втянуть> or <выдавить> \nto replace filament!" + #define FILAMENT_CHANGE_TEXT_RU "Please click <втянуть> or <выдавить>,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU "Heat completed,please load filament to extruder,and click <да> for start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_RU "Please load filament to extruder,and click <да> for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU "Heat completed,please click <да> for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_RU "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_RU "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,click <да> for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,click <да> for return!" +#endif + #define FILAMENT_CHANGE_TEXT_RU "Please click \nor ,After \npinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU "Heat completed,please load filament \nto extruder,and click \nfor start loading." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_RU "Please load filament to extruder,\nand click for start loading." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU "Heat completed,please \nclick for start unloading.!" + #define FILAMENT_DIALOG_LOADING_TIPS_RU "Is loading ,please wait!" + #define FILAMENT_DIALOG_UNLOADING_TIPS_RU "Is unloading,please wait!" + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,\nclick for return!" + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,\nclick for return!" + + +#define PRE_HEAT_EXT_TEXT_RU "E" +#define PRE_HEAT_BED_TEXT_RU "стол" + +#define FILE_LOADING_RU "загрузка......" +#if 0 +#define NO_FILE_AND_CHECK_RU "Файлы не найдены! Вставьте SD-карту или диск U!" +#endif +#define NO_FILE_AND_CHECK_RU "нет файла,попробуйте ещё раз!" + +#define NO_FILE_RU "нет файла!" + +#define EXTRUDER_TEMP_TEXT_RU "температура" +#define EXTRUDER_E_LENGTH1_TEXT_RU "экструзия1" +#define EXTRUDER_E_LENGTH2_TEXT_RU "экструзия2" +#define EXTRUDER_E_LENGTH3_TEXT_RU "экструзия3" + +#define ABOUT_TYPE_TEXT_RU "Type: " +#define ABOUT_VERSION_TEXT_RU "Firmware: " +#define ABOUT_WIFI_TEXT_RU "WiFi: " + +#define PRINTING_OPERATION_RU "управление" +#define PRINTING_PAUSE_RU "пауза" +#define PRINTING_TEMP_RU "темп" +#define PRINTING_CHANGESPEED_RU "скорости" +#define PRINTING_RESUME_RU "возобновить" +#define PRINTING_STOP_RU "стоп" +#define PRINTING_MORE_RU "больше" +#define PRINTING_EXTRUDER_RU "экстр" +#define PRINTING_MOVE_RU "движение" + +#define EXTRUDER_SPEED_RU "экстр" +#define MOVE_SPEED_RU "движ" +#define EXTRUDER_SPEED_STATE_RU "скорость экстр" +#define MOVE_SPEED_STATE_RU "скорость движ" +#define STEP_1PERCENT_RU "1%" +#define STEP_5PERCENT_RU "5%" +#define STEP_10PERCENT_RU "10%" + +#define ZOFFSET_RU "Z Offset" +#define ZOFFSET_INC_RU "добавить" +#define ZOFFSET_DEC_RU "уменьшить" + +#define TITLE_READYPRINT_RU "готов к" +#define TITLE_PREHEAT_RU "движение" +#define TITLE_MOVE_RU "движение" +#define TITLE_HOME_RU "Home" +#define TITLE_EXTRUDE_RU "экструзия" +#define TITLE_LEVELING_RU "уровень" +#define TITLE_SET_RU "настройки" +#define TITLE_MORE_RU "больше" +#define TITLE_CHOOSEFILE_RU "файла" +#define TITLE_PRINTING_RU "печать" +#define TITLE_OPERATION_RU "управление" +#define TITLE_ADJUST_RU "регулировать" +#define TITLE_WIRELESS_RU "Wireless" +#define TITLE_FILAMENT_RU "замена" +#define TITLE_ABOUT_RU "инфо" +#define TITLE_FAN_RU "вентилятор" +#define TITLE_LANGUAGE_RU "язык" +#define TITLE_PAUSE_RU "пауза" +#define TITLE_CHANGESPEED_RU "скорости" +#define TILE_TOOL_RU "инструмент" +#define TITLE_CLOUD_TEXT_RU "Cloud" +#define TITLE_DIALOG_CONFIRM_RU "Confirm" +#define TITLE_FILESYS_RU "FileSys" +#define TITLE_ZOFFSET_RU "Z Offset" + +#define AUTO_SHUTDOWN_RU "авто-откл" +#define MANUAL_SHUTDOWN_RU "ручн-откл" + +#define DIALOG_CONFIRM_RU "да"//"подтвердить" +#define DIALOG_CANCLE_RU "отмена" +#define DIALOG_OK_RU "да" +#define DIALOG_RESET_RU "сброс" +#define DIALOG_RETRY_RU "повтор" +#define DIALOG_DISABLE_RU "запретить" +#define DIALOG_PRINT_MODEL_RU "печать модели?" +#define DIALOG_CANCEL_PRINT_RU "стоп?" +#define DIALOG_STOP_RU "стоп" +#define DIALOG_REPRINT_FROM_BREAKPOINT_RU "продолжить?" +//#define DIALOG_UNBIND_PRINTER_RU "разрыв?" +#define DIALOG_ERROR_TIPS1_RU "ошибка:нет файла, попробуйте ещё раз." +#define DIALOG_ERROR_TIPS2_RU "ошибка:сбой передачи. установите скорость \nпередачи данных как на плате управления!" +#define DIALOG_ERROR_TIPS3_RU "ошибка: имя файла слишком длинное!" +#define DIALOG_CLOSE_MACHINE_RU "Closing machine......" +#define DIALOG_UNBIND_PRINTER_RU "Unbind the printer?" +#define DIALOG_FILAMENT_NO_PRESS_RU "Filament detection switch is not pressed" +#define DIALOG_PRINT_FINISH_RU "Печать завершена!" +#define DIALOG_PRINT_TIME_RU "Время печати: " +#define DIALOG_REPRINT_RU "Print again" +#define DIALOG_WIFI_ENABLE_TIPS_RU "The wifi module is being configured,\nplease wait a moment....." + +#define MESSEGE_PAUSING_RU "Стоянка..." +#define MESSEGE_CHANGING_RU "Подождите, пока начнется смена филамента" +#define MESSEGE_UNLOAD_RU "Дождитесь выгрузки нити" +#define MESSEGE_WAITING_RU "Нажмите кнопку,чтобы возобновить печать" +#define MESSEGE_INSERT_RU "Вставьте нить и нажмите кнопку,чтобы продолжить" +#define MESSEGE_LOAD_RU "Дождитесь загрузки нити" +#define MESSEGE_PURGE_RU "Дождитесь чистки нити" +#define MESSEGE_RESUME_RU "Подождите,пока печать возобновится ..." +#define MESSEGE_HEAT_RU "Нажмите кнопку, чтобы нагреть форсунку" +#define MESSEGE_HEATING_RU "Подогрев форсунки Пожалуйста, подождите ..." +#define MESSEGE_OPTION_RU "Очистить больше или продолжить печать?" +#define MESSEGE_PURGE_MORE_RU "чистка" +#define MESSEGE_CONTINUE_PRINT_RU "Распечатать" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h new file mode 100644 index 000000000000..50a9deaf2ef5 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h @@ -0,0 +1,264 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +//*************简体中文***********************// +#define TOOL_TEXT_CN "工具" +#define PREHEAT_TEXT_CN "预热" +#define MOVE_TEXT_CN "移动" +#define HOME_TEXT_CN "回零" +#define PRINT_TEXT_CN "打印" +#define EXTRUDE_TEXT_CN "挤出" +#define LEVELING_TEXT_CN "调平" +#define AUTO_LEVELING_TEXT_CN "自动调平" +#define SET_TEXT_CN "设置" +#define MORE_TEXT_CN "更多" + +#define ADD_TEXT_CN "增加" +#define DEC_TEXT_CN "减少" +#define EXTRUDER_1_TEXT_CN "喷头1" +#define EXTRUDER_2_TEXT_CN "喷头2" +#define HEATBED_TEXT_CN "热床" +#define TEXT_1C_CN "1℃" +#define TEXT_5C_CN "5℃" +#define TEXT_10C_CN "10℃" +#define CLOSE_TEXT_CN "关闭" + +#define BACK_TEXT_CN "返回" + +#define TOOL_PREHEAT_CN "预热" +#define TOOL_EXTRUDE_CN "挤出" +#define TOOL_MOVE_CN "移动" +#define TOOL_HOME_CN "回零" +#define TOOL_LEVELING_CN "调平" +#define TOOL_AUTO_LEVELING_CN "自动调平" +#define TOOL_FILAMENT_CN "换料" +#define TOOL_MORE_CN "更多" + +#define AXIS_X_ADD_TEXT_CN "X+" +#define AXIS_X_DEC_TEXT_CN "X-" +#define AXIS_Y_ADD_TEXT_CN "Y+" +#define AXIS_Y_DEC_TEXT_CN "Y-" +#define AXIS_Z_ADD_TEXT_CN "Z+" +#define AXIS_Z_DEC_TEXT_CN "Z-" +#define TEXT_01MM_CN "0.1mm" +#define TEXT_1MM_CN "1mm" +#define TEXT_10MM_CN "10mm" + +#define HOME_X_TEXT_CN "X" +#define HOME_Y_TEXT_CN "Y" +#define HOME_Z_TEXT_CN "Z" +#define HOME_ALL_TEXT_CN "回零" +#define HOME_STOPMOVE_CN "急停" + +#define PAGE_UP_TEXT_CN "上一页" +#define PAGE_DOWN_TEXT_CN "下一页" + +#define EXTRUDER_IN_TEXT_CN "进料" +#define EXTRUDER_OUT_TEXT_CN "退料" +#define EXTRUDE_1MM_TEXT_CN "1mm" +#define EXTRUDE_5MM_TEXT_CN "5mm" +#define EXTRUDE_10MM_TEXT_CN "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_CN "低速" +#define EXTRUDE_MEDIUM_SPEED_TEXT_CN "常速" +#define EXTRUDE_HIGH_SPEED_TEXT_CN "高速" + +#define LEVELING_POINT1_TEXT_CN "第一点" +#define LEVELING_POINT2_TEXT_CN "第二点" +#define LEVELING_POINT3_TEXT_CN "第三点" +#define LEVELING_POINT4_TEXT_CN "第四点" +#define LEVELING_POINT5_TEXT_CN "第五点" + +#define FILESYS_TEXT_CN "文件系统" +#define WIFI_TEXT_CN "WIFI" +#define FAN_TEXT_CN "风扇" +#define ABOUT_TEXT_CN "关于" +#define BREAK_POINT_TEXT_CN "断点续打" +#define FILAMENT_TEXT_CN "换料" +#define LANGUAGE_TEXT_CN "语言" +#define MOTOR_OFF_TEXT_CN "关闭电机" +#define MOTOR_OFF_XY_TEXT_CN "关闭XY" +#define SHUTDOWN_TEXT_CN "关机" + +#define U_DISK_TEXT_CN "U盘" +#define SD_CARD_TEXT_CN "SD卡" +#define WIFI_NAME_TEXT_CN "无线网络:" +#define WIFI_KEY_TEXT_CN "密码: " +#define WIFI_IP_TEXT_CN "IP: " +#define WIFI_AP_TEXT_CN "状态: AP" +#define WIFI_STA_TEXT_CN "状态: STA" +#define WIFI_CONNECTED_TEXT_CN "已连接" +#define WIFI_DISCONNECTED_TEXT_CN "未连接" +#define WIFI_EXCEPTION_TEXT_CN "模块异常" +#define CLOUD_TEXT_CN "云服务" +#define CLOUD_BIND_CN "已绑定" +#define CLOUD_UNBIND_CN "解绑" +#define CLOUD_UNBINDING_CN "解绑中" +#define CLOUD_DISCONNECTED_CN "未连接" +#define CLOUD_UNBINDED_CN "未绑定" +#define CLOUD_BINDED_CN "已绑定" +#define CLOUD_DISABLE_CN "已禁用" + +#define FAN_ADD_TEXT_CN "增加" +#define FAN_DEC_TEXT_CN "减少" +#define FAN_OPEN_TEXT_CN "100%" +#define FAN_HALF_TEXT_CN "50%" +#define FAN_CLOSE_TEXT_CN "关闭" +#define FAN_TIPS1_TEXT_CN "风扇" +#define FAN_TIPS2_TEXT_CN "FAN\nClose" + +#define FILAMENT_IN_TEXT_CN "进料" +#define FILAMENT_OUT_TEXT_CN "退料" +#define FILAMENT_EXT0_TEXT_CN "喷头1" +#define FILAMENT_EXT1_TEXT_CN "喷头2" +#define FILAMENT_HEAT_TEXT_CN "预热" +#define FILAMENT_STOP_TEXT_CN "停止" +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_CN "请按<进料>或<退料>进行换料!" + #define FILAMENT_CHANGE_TEXT_CN "待打印机暂停后,请按<进料>或<退料>进行换料!" +#else + #define FILAMENT_CHANGE_TEXT_CN "待打印机暂停后,\n请按<进料>或<退料>" +#endif + +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_CN "准备进料,正在加热,请稍等!" +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_CN "准备退料,正在加热,请稍等!" +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_CN "加热完成,请装载耗材后,按<确定>开始进料!" +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_CN "请装载耗材,按<确定>开始进料!" +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_CN "加热完成,请按<确定>开始退料!" +#define FILAMENT_DIALOG_LOADING_TIPS_CN "正在进料,请等待耗材加载完成!" +#define FILAMENT_DIALOG_UNLOADING_TIPS_CN "正在退料,请等待耗材卸载完成!" +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_CN "进料完成,请按<确定>返回" +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_CN "退料完成,请按<确定>返回" + +#define FILAMENT_TIPS3_TEXT_CN "正在进料" +#define FILAMENT_TIPS4_TEXT_CN "正在退料" +#define FILAMENT_TIPS5_TEXT_CN "温度太低,请先预热" +#define FILAMENT_TIPS6_TEXT_CN "换料完成" + +#define PRE_HEAT_EXT_TEXT_CN "喷头" +#define PRE_HEAT_BED_TEXT_CN "热床" + +#define FILE_LOADING_CN "正在载入......" +#define NO_FILE_AND_CHECK_CN "无文件!请插入sd卡或u盘!" +#define NO_FILE_CN "无文件!" + +#define EXTRUDER_TEMP_TEXT_CN "温度" +#define EXTRUDER_E_LENGTH1_TEXT_CN "喷头" +#define EXTRUDER_E_LENGTH2_TEXT_CN "喷头" +#define EXTRUDER_E_LENGTH3_TEXT_CN "喷头" + +#define ABOUT_TYPE_TEXT_CN "Type: " +#define ABOUT_VERSION_TEXT_CN "Firmware: " +#define ABOUT_WIFI_TEXT_CN "Wifi: " + +#define PRINTING_OPERATION_CN "操作" +#define PRINTING_PAUSE_CN "暂停" +#define PRINTING_TEMP_CN "温度" +#define PRINTING_CHANGESPEED_CN "变速" +#define PRINTING_RESUME_CN "恢复" +#define PRINTING_STOP_CN "停止" +#define PRINTING_MORE_CN "更多" +#define PRINTING_EXTRUDER_CN "挤出" +#define PRINTING_MOVE_CN "移动" + +#define EXTRUDER_SPEED_CN "挤出" +#define MOVE_SPEED_CN "移动" +#define EXTRUDER_SPEED_STATE_CN "挤出速度" +#define MOVE_SPEED_STATE_CN "移动速度" +#define STEP_1PERCENT_CN "1%" +#define STEP_5PERCENT_CN "5%" +#define STEP_10PERCENT_CN "10%" + +#define ZOFFSET_CN "Z Offset" +#define ZOFFSET_INC_CN "增加" +#define ZOFFSET_DEC_CN "减少" + +#define TITLE_READYPRINT_CN "准备打印" +#define TITLE_PREHEAT_CN "预热" +#define TITLE_MOVE_CN "移动" +#define TITLE_HOME_CN "回零" +#define TITLE_EXTRUDE_CN "挤出" +#define TITLE_LEVELING_CN "调平" +#define TITLE_SET_CN "设置" +#define TITLE_MORE_CN "更多" +#define TITLE_CHOOSEFILE_CN "选择文件" +#define TITLE_PRINTING_CN "正在打印" +#define TITLE_OPERATION_CN "操作" +#define TITLE_ADJUST_CN "调整" +#define TITLE_WIRELESS_CN "无线网络" +#define TITLE_FILAMENT_CN "换料" +#define TITLE_ABOUT_CN "关于" +#define TITLE_FAN_CN "风扇" +#define TITLE_LANGUAGE_CN "语言" +#define TITLE_PAUSE_CN "暂停" +#define TITLE_CHANGESPEED_CN "变速" +#define TITLE_CLOUD_TEXT_CN "云服务" +#define TITLE_DIALOG_CONFIRM_CN "确认" +#define TITLE_FILESYS_CN "文件系统" +#define TITLE_ZOFFSET_CN "Z Offset" + +#define AUTO_SHUTDOWN_CN "自动关机" +#define MANUAL_SHUTDOWN_CN "手动关机" + +#define DIALOG_CONFIRM_CN "确定" +#define DIALOG_CANCLE_CN "取消" +#define DIALOG_OK_CN "确认" +#define DIALOG_RESET_CN "重置" +#define DIALOG_DISABLE_CN "禁用" +#define DIALOG_PRINT_MODEL_CN "打印模型?" +#define DIALOG_CANCEL_PRINT_CN "停止打印?" +#define DIALOG_RETRY_CN "重试" +#define DIALOG_STOP_CN "停止" +#define DIALOG_REPRINT_FROM_BREAKPOINT_CN "从断点续打?" +//#define DIALOG_UNBIND_PRINTER_CN "解除绑定 ?" +#define DIALOG_ERROR_TIPS1_CN "错误:找不到文件,请插入sd卡/u盘!" +#define DIALOG_ERROR_TIPS2_CN "错误:通信失败,请检查波特率或主板硬件!" +#define DIALOG_ERROR_TIPS3_CN "错误:文件名或文件路径太长 !" +#define DIALOG_CLOSE_MACHINE_CN "正在关机......" +#define DIALOG_UNBIND_PRINTER_CN "解除绑定?" +#define DIALOG_FILAMENT_NO_PRESS_CN "请先装载耗材!" +#define DIALOG_PRINT_FINISH_CN "打印完成!" +#define DIALOG_PRINT_TIME_CN "打印时间: " +#define DIALOG_REPRINT_CN "再打印一次" +#define DIALOG_WIFI_ENABLE_TIPS_CN "wifi模块正在配置中,请稍等......" + +#define TEXT_VALUE_CN "%d℃/%d℃" +#define EXTRUDE_TEXT_VALUE_T_CN ": %d℃" +#define WIFI_RECONNECT_TEXT_CN "重新连接" + +#define PRINTING_GBK "正在打印" +#define PRINTING_OPERATION_GBK "操作" +#define PRINTING_PAUSE_GBK "暂停" + +#define MESSEGE_PAUSING_CN "暂停中..." +#define MESSEGE_CHANGING_CN "等待换料开始..." +#define MESSEGE_UNLOAD_CN "退料中,请稍等..." +#define MESSEGE_WAITING_CN "点击按钮恢复打印" +#define MESSEGE_INSERT_CN "装载耗材后,点击按钮开始打印" +#define MESSEGE_LOAD_CN "进料中,请稍等..." +#define MESSEGE_PURGE_CN "等待挤出..." +#define MESSEGE_RESUME_CN "等待恢复打印..." +#define MESSEGE_HEAT_CN "按下按钮,加热喷头" +#define MESSEGE_HEATING_CN "喷头加热中,请等待..." +#define MESSEGE_OPTION_CN "挤出更多还是继续打印?" +#define MESSEGE_PURGE_MORE_CN "挤出" +#define MESSEGE_CONTINUE_PRINT_CN "打印" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h new file mode 100644 index 000000000000..da8167b09880 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h @@ -0,0 +1,279 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +//****************西班牙语*************************** +#define TOOL_TEXT_SP "Ajustes" +#define PREHEAT_TEXT_SP "Precalentar"//"precalent\nar" +#define MOVE_TEXT_SP "Mover" +#define HOME_TEXT_SP "Origen" +#define PRINT_TEXT_SP "Imprimir" +#define EXTRUDE_TEXT_SP "Extrusor" +#define LEVELING_TEXT_SP "Leveling"//"nivelac\nión" +#define AUTO_LEVELING_TEXT_SP "Autolevel"//"auto\nnivelación" +#define SET_TEXT_SP "Config" +#define MORE_TEXT_SP "Más" + +#define ADD_TEXT_SP "Más" +#define DEC_TEXT_SP "Menos" +#define EXTRUDER_1_TEXT_SP "Extrusor1: " +#define EXTRUDER_2_TEXT_SP "Extrusor2: " +#define HEATBED_TEXT_SP "Cama: " +#define TEXT_1C_SP "1℃" +#define TEXT_5C_SP "5℃" +#define TEXT_10C_SP "10℃" +#define CLOSE_TEXT_SP "Apagar" + +#define BACK_TEXT_SP "Atrás" + +#define TOOL_PREHEAT_SP "Precalentar" +#define TOOL_EXTRUDE_SP "Extrusor" +#define TOOL_MOVE_SP "Mover" +#define TOOL_HOME_SP "Origen" +#define TOOL_LEVELING_SP "Leveling" +#define TOOL_AUTO_LEVELING_SP "Autolevel" +#define TOOL_FILAMENT_SP "Filamento" +#define TOOL_MORE_SP "Más" + +#define AXIS_X_ADD_TEXT_SP "X+" +#define AXIS_X_DEC_TEXT_SP "X-" +#define AXIS_Y_ADD_TEXT_SP "Y+" +#define AXIS_Y_DEC_TEXT_SP "Y-" +#define AXIS_Z_ADD_TEXT_SP "Z+" +#define AXIS_Z_DEC_TEXT_SP "Z-" +#define TEXT_01MM_SP "0.1mm" +#define TEXT_1MM_SP "1mm" +#define TEXT_10MM_SP "10mm" + +#define HOME_X_TEXT_SP "EJE X" +#define HOME_Y_TEXT_SP "EJE Y" +#define HOME_Z_TEXT_SP "EJE Z" +#define HOME_ALL_TEXT_SP "TODOS" +#define HOME_STOPMOVE_SP "Quickstop" + +#define PAGE_UP_TEXT_SP "Arriba" +#define PAGE_DOWN_TEXT_SP "Abajo" + +#define EXTRUDER_IN_TEXT_SP "Dentro" +#define EXTRUDER_OUT_TEXT_SP "Fuera" +#define EXTRUDE_1MM_TEXT_SP "1mm" +#define EXTRUDE_5MM_TEXT_SP "5mm" +#define EXTRUDE_10MM_TEXT_SP "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_SP "Baja" +#define EXTRUDE_MEDIUM_SPEED_TEXT_SP "Media" +#define EXTRUDE_HIGH_SPEED_TEXT_SP "Alta" + +#define LEVELING_POINT1_TEXT_SP "Primero" +#define LEVELING_POINT2_TEXT_SP "Segundo" +#define LEVELING_POINT3_TEXT_SP "Tercero" +#define LEVELING_POINT4_TEXT_SP "Cuarto" +#define LEVELING_POINT5_TEXT_SP "Quinto" + +#define FILESYS_TEXT_SP "Puerto" +#define WIFI_TEXT_SP "WiFi" +#define FAN_TEXT_SP "Ventilador" +#define ABOUT_TEXT_SP "Acerca" +#define BREAK_POINT_TEXT_SP "Continuar" +#define FILAMENT_TEXT_SP "Filamento" +#define LANGUAGE_TEXT_SP "Language" +#define MOTOR_OFF_TEXT_SP "Apagar motor" +#define MOTOR_OFF_XY_TEXT_SP "Off-XY" +#define SHUTDOWN_TEXT_SP "Apagar" + +#define U_DISK_TEXT_SP "PENDRIVE" +#define SD_CARD_TEXT_SP "SD" +#define WIFI_NAME_TEXT_SP "WIFI: " +#define WIFI_KEY_TEXT_SP "Contraseña: " +#define WIFI_IP_TEXT_SP "IP: " +#define WIFI_AP_TEXT_SP "Estado: AP" +#define WIFI_STA_TEXT_SP "Estado: STA" +#define WIFI_CONNECTED_TEXT_SP "Conectado" +#define WIFI_DISCONNECTED_TEXT_SP "Desconectado" +#define WIFI_EXCEPTION_TEXT_SP "Excepción" +#define WIFI_RECONNECT_TEXT_SP "Reconnect" +#define CLOUD_TEXT_SP "Nube" +#define CLOUD_BIND_SP "Atado" +#define CLOUD_UNBIND_SP "Sin atar" +#define CLOUD_UNBINDING_SP "Unbinding" +#define CLOUD_DISCONNECTED_SP "Disconnected" +#define CLOUD_UNBINDED_SP "Unbinded" +#define CLOUD_BINDED_SP "Binded" +#define CLOUD_DISABLE_SP "Disable" + +#define FAN_ADD_TEXT_SP "Más" +#define FAN_DEC_TEXT_SP "Menos" +#define FAN_OPEN_TEXT_SP "100%" +#define FAN_HALF_TEXT_SP "50%" +#define FAN_CLOSE_TEXT_SP "0%" +#define FAN_TIPS1_TEXT_SP "ventilador" +#define FAN_TIPS2_TEXT_SP "ventilador\n0" + +#define FILAMENT_IN_TEXT_SP "Dentro" +#define FILAMENT_OUT_TEXT_SP "Fuera" +#define FILAMENT_EXT0_TEXT_SP "Extrusor1" +#define FILAMENT_EXT1_TEXT_SP "Extrusor2" +#define FILAMENT_HEAT_TEXT_SP "Precalentar" +#define FILAMENT_STOP_TEXT_SP "Parar" +//#define FILAMENT_CHANGE_TEXT_SP "Filamento" +#define FILAMENT_TIPS2_TEXT_SP "T:" +#define FILAMENT_TIPS3_TEXT_SP "Dentro..." +#define FILAMENT_TIPS4_TEXT_SP "Fuera..." +#define FILAMENT_TIPS5_TEXT_SP "Temperatura demasiado baja, por favor calentar" +#define FILAMENT_TIPS6_TEXT_SP "Completado" +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_SP "Please click or \nto replace filament!" + #define FILAMENT_CHANGE_TEXT_SP "Please click or ,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP "Calentando el extrusor, por favor espere..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP "Calentando el extrusor, por favor espere..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP "Temperatura alcanzada.Inserte el filamento y luego presione\"Confirmar\"para comenzar la carga." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_SP "Inserte el filamento y luego presione\"Confirmar\"para comenzar la carga." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP "Temperatura alcanzada.Presione\"Confirmar\"para retirar el filamento." + #define FILAMENT_DIALOG_LOADING_TIPS_SP "Cargando filamento,por favor espere." + #define FILAMENT_DIALOG_UNLOADING_TIPS_SP "Retirando filamento,por favor espere." + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP "Filamento cargado,presione\"Confirmar\"." + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP "Filamento retirado,presione\"Confirmar\"." +#else + #define FILAMENT_CHANGE_TEXT_SP "Please click \nor ,After \npinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." + #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP "Temperatura alcanzada.Inserte el \nfilamento y luego presione\"Confirmar\"\npara comenzar la carga." + #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_SP "Inserte el filamento y \nluego presione\"Confirmar\"para \ncomenzar la carga." + #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP "Temperatura alcanzada.\nPresione\"Confirmar\"para retirar \nel filamento." + #define FILAMENT_DIALOG_LOADING_TIPS_SP "Cargando filamento,\npor favor espere." + #define FILAMENT_DIALOG_UNLOADING_TIPS_SP "Retirando filamento,\npor favor espere." + #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP "Filamento cargado,\npresione\"Confirmar\"." + #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP "Filamento retirado,\npresione\"Confirmar\"." +#endif + +#define PRE_HEAT_EXT_TEXT_SP "Extrusor" +#define PRE_HEAT_BED_TEXT_SP "cama" + +#define FILE_LOADING_SP "Cargando......" +#if 0 +#define NO_FILE_AND_CHECK_SP "No se encontraron archivos! Por favor, inserte la tarjeta SD o el disco U!" +#endif +#define NO_FILE_AND_CHECK_SP "Archivo no encontrado,\n por favor insertar SD o disco USB!" + +#define NO_FILE_SP "Sin archivo!" + + + +#define EXTRUDER_TEMP_TEXT_SP "Temper" +#define EXTRUDER_E_LENGTH1_TEXT_SP "Extrusor1" +#define EXTRUDER_E_LENGTH2_TEXT_SP "Extrusor2" +#define EXTRUDER_E_LENGTH3_TEXT_SP "Extrusor3" + +#define ABOUT_TYPE_TEXT_SP "Pantalla: " +#define ABOUT_VERSION_TEXT_SP "Firmware: " +#define ABOUT_WIFI_TEXT_SP "WiFi: " + +#define PRINTING_OPERATION_SP "Ajustes" +#define PRINTING_PAUSE_SP "Pausar" +#define PRINTING_TEMP_SP "Temp." +#define PRINTING_CHANGESPEED_SP "Velocidad" +#define PRINTING_RESUME_SP "Resumir" +#define PRINTING_STOP_SP "Detener" +#define PRINTING_MORE_SP "Más" +#define PRINTING_EXTRUDER_SP "Extrusor" +#define PRINTING_MOVE_SP "Mover" + +#define EXTRUDER_SPEED_SP "Extrusor" +#define MOVE_SPEED_SP "Mover" +#define EXTRUDER_SPEED_STATE_SP "Extrusión" +#define MOVE_SPEED_STATE_SP "Movimiento" +#define STEP_1PERCENT_SP "1%" +#define STEP_5PERCENT_SP "5%" +#define STEP_10PERCENT_SP "10%" + +#define ZOFFSET_SP "Z Offset" +#define ZOFFSET_INC_SP "Más" +#define ZOFFSET_DEC_SP "Menos" + +#define TITLE_READYPRINT_SP "Inicio" +#define TITLE_PREHEAT_SP "Precalentar" +#define TITLE_MOVE_SP "Mover" +#define TITLE_HOME_SP "Origen" +#define TITLE_EXTRUDE_SP "Extrusor" +#define TITLE_LEVELING_SP "Leveling" +#define TITLE_SET_SP "Config" +#define TITLE_MORE_SP "Más" +#define TITLE_CHOOSEFILE_SP "Imprimir" +#define TITLE_PRINTING_SP "Imprimir" +#define TITLE_OPERATION_SP "Ajustes" +#define TITLE_ADJUST_SP "Temp." +#define TITLE_WIRELESS_SP "Wireless" +#define TITLE_FILAMENT_SP "Filamento" +#define TITLE_ABOUT_SP "Acerca" +#define TITLE_FAN_SP "Ventilador" +#define TITLE_LANGUAGE_SP "Language" +#define TITLE_PAUSE_SP "Pausar" +#define TITLE_CHANGESPEED_SP "Velocidad" +#define TILE_TOOL_SP "Ajustes" +#define TITLE_CLOUD_TEXT_SP "Cloud" +#define TITLE_DIALOG_CONFIRM_SP "Confirmar" +#define TITLE_FILESYS_SP "Puerto" +#define TITLE_ZOFFSET_SP "Z Offset" + +#define AUTO_SHUTDOWN_SP "Auto" +#define MANUAL_SHUTDOWN_SP "manual" + +#define DIALOG_CONFIRM_SP "Confirmar" +#define DIALOG_CANCLE_SP "Cancelar" +#define DIALOG_OK_SP "OK" +#define DIALOG_RESET_SP "Resetear" +#define DIALOG_RETRY_SP "Reintentar" +#define DIALOG_DISABLE_SP "Desactivar" +#define DIALOG_PRINT_MODEL_SP "¿Está seguro?" +#define DIALOG_CANCEL_PRINT_SP "¿Está seguro que desea detener la impresión?" + +#define DIALOG_RETRY_SP "Reintentar" +#define DIALOG_STOP_SP "Stop" +#define DIALOG_REPRINT_FROM_BREAKPOINT_SP "Reprint from breakpoint?" +//#define DIALOG_UNBIND_PRINTER_SP "Unbind the printer?" +#define DIALOG_ERROR_TIPS1_SP "Error:archivo no encontrado, \npor favor insertar SD o disco USB." +#define DIALOG_ERROR_TIPS2_SP "error:transacción fallida, \nconfigurar baudrate del \ndisplay para la placa base!" +#define DIALOG_ERROR_TIPS3_SP "Error : nombre de archivo o \nruta demasiado largo!" +#define DIALOG_CLOSE_MACHINE_SP "Closing machine......" +#define DIALOG_UNBIND_PRINTER_SP "Unbind the printer?" +#define DIALOG_FILAMENT_NO_PRESS_SP "Filament detection switch is not pressed" +#define DIALOG_PRINT_FINISH_SP "¡La impresión está completa!" +#define DIALOG_PRINT_TIME_SP "Tiempo de impresión: " +#define DIALOG_REPRINT_SP "Print again" +#define DIALOG_WIFI_ENABLE_TIPS_SP "The wifi module is being configured,\nplease wait a moment....." + +#define PRINTING_SP "Imprimiendo" +#define PRINTING_AJUSTES_SP "Ajustes" +#define PRINTING_PAUSAR_SP "Pausar" + +#define MESSEGE_PAUSING_SP "Aparcando..." +#define MESSEGE_CHANGING_SP "Esperando para iniciar el cambio de filamento" +#define MESSEGE_UNLOAD_SP "Espere para liberar el filamento" +#define MESSEGE_WAITING_SP "Pulsar el botón para reanudar impresión" +#define MESSEGE_INSERT_SP "Inserte el filamento y pulse el botón para continuar..." +#define MESSEGE_LOAD_SP "Espere para purgar el filamento" +#define MESSEGE_PURGE_SP "Espere para purgar el filamento" +#define MESSEGE_RESUME_SP "Esperando impresora para reanudar..." +#define MESSEGE_HEAT_SP "Pulse el botón para calentar la boquilla" +#define MESSEGE_HEATING_SP "Calentando boquilla Espere por favor..." +#define MESSEGE_OPTION_SP "¿Purgar más o continuar con la impresión?" +#define MESSEGE_PURGE_MORE_SP "Purga" +#define MESSEGE_CONTINUE_PRINT_SP "Impresión" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h new file mode 100644 index 000000000000..adade8972ef1 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h @@ -0,0 +1,269 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +//***************繁体中文**********************// +#define TOOL_TEXT_T_CN "工具" +#define PREHEAT_TEXT_T_CN "預熱" +#define MOVE_TEXT_T_CN "移動" +#define HOME_TEXT_T_CN "回零" +#define PRINT_TEXT_T_CN "打印" +#define EXTRUDE_TEXT_T_CN "擠出" +#define LEVELING_TEXT_T_CN "調平" +#define AUTO_LEVELING_TEXT_T_CN "自動調平" +#define SET_TEXT_T_CN "設置" +#define MORE_TEXT_T_CN "更多" + +#define ADD_TEXT_T_CN "增加" +#define DEC_TEXT_T_CN "減少" +#define EXTRUDER_1_TEXT_T_CN "噴頭1" +#define EXTRUDER_2_TEXT_T_CN "噴頭2" +#define HEATBED_TEXT_T_CN "熱床" +#define TEXT_1C_T_CN "1℃" +#define TEXT_5C_T_CN "5℃" +#define TEXT_10C_T_CN "10℃" +#define CLOSE_TEXT_T_CN "關閉" + +#define BACK_TEXT_T_CN "返回" + +#define TOOL_PREHEAT_T_CN "預熱" +#define TOOL_EXTRUDE_T_CN "擠出" +#define TOOL_MOVE_T_CN "移動" +#define TOOL_HOME_T_CN "回零" +#define TOOL_LEVELING_T_CN "調平" +#define TOOL_AUTO_LEVELING_T_CN "自動調平" +#define TOOL_FILAMENT_T_CN "換料" +#define TOOL_MORE_T_CN "更多" + +#define AXIS_X_ADD_TEXT_T_CN "X+" +#define AXIS_X_DEC_TEXT_T_CN "X-" +#define AXIS_Y_ADD_TEXT_T_CN "Y+" +#define AXIS_Y_DEC_TEXT_T_CN "Y-" +#define AXIS_Z_ADD_TEXT_T_CN "Z+" +#define AXIS_Z_DEC_TEXT_T_CN "Z-" +#define TEXT_01MM_T_CN "0.1mm" +#define TEXT_1MM_T_CN "1mm" +#define TEXT_10MM_T_CN "10mm" + +#define HOME_X_TEXT_T_CN "X" +#define HOME_Y_TEXT_T_CN "Y" +#define HOME_Z_TEXT_T_CN "Z" +#define HOME_ALL_TEXT_T_CN "回零" +#define HOME_STOPMOVE_T_CN "急停" + +#define PAGE_UP_TEXT_T_CN "上一頁" +#define PAGE_DOWN_TEXT_T_CN "下一頁" + +#define EXTRUDER_IN_TEXT_T_CN "進料" +#define EXTRUDER_OUT_TEXT_T_CN "退料" +#define EXTRUDE_1MM_TEXT_T_CN "1mm" +#define EXTRUDE_5MM_TEXT_T_CN "5mm" +#define EXTRUDE_10MM_TEXT_T_CN "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_T_CN "低速" +#define EXTRUDE_MEDIUM_SPEED_TEXT_T_CN "常速" +#define EXTRUDE_HIGH_SPEED_TEXT_T_CN "高速" + +#define LEVELING_POINT1_TEXT_T_CN "第一點" +#define LEVELING_POINT2_TEXT_T_CN "第二點" +#define LEVELING_POINT3_TEXT_T_CN "第三點" +#define LEVELING_POINT4_TEXT_T_CN "第四點" +#define LEVELING_POINT5_TEXT_T_CN "第五點" + +#define FILESYS_TEXT_T_CN "文件系統" +#define WIFI_TEXT_T_CN "WIFI" +#define FAN_TEXT_T_CN "風扇" +#define ABOUT_TEXT_T_CN "關於" +#define BREAK_POINT_TEXT_T_CN "斷點續打" +#define FILAMENT_TEXT_T_CN "換料" +#define LANGUAGE_TEXT_T_CN "語言" +#define MOTOR_OFF_TEXT_T_CN "關閉電機" +#define MOTOR_OFF_XY_TEXT_T_CN "關閉XY" +#define SHUTDOWN_TEXT_T_CN "關機" + +#define U_DISK_TEXT_T_CN "U盤" +#define SD_CARD_TEXT_T_CN "SD卡" +#define WIFI_NAME_TEXT_T_CN "無線網絡:" +#define WIFI_KEY_TEXT_T_CN "密碼: " +#define WIFI_IP_TEXT_T_CN "IP: " +#define WIFI_AP_TEXT_T_CN "狀態: AP" +#define WIFI_STA_TEXT_T_CN "狀態: STA" +#define WIFI_CONNECTED_TEXT_T_CN "已連接" +#define WIFI_DISCONNECTED_TEXT_T_CN "未連接" +#define WIFI_EXCEPTION_TEXT_T_CN "模塊異常" +#define CLOUD_TEXT_T_CN "雲服務" +#define CLOUD_BIND_T_CN "已綁定" +#define CLOUD_UNBIND_T_CN "解綁" +#define CLOUD_UNBINDING_T_CN "解绑中" +#define CLOUD_DISCONNECTED_T_CN "未連接" +#define CLOUD_UNBINDED_T_CN "未綁定" +#define CLOUD_BINDED_T_CN "已綁定" +#define CLOUD_DISABLE_T_CN "已禁用" + +#define FAN_ADD_TEXT_T_CN "增加" +#define FAN_DEC_TEXT_T_CN "減少" +#define FAN_OPEN_TEXT_T_CN "100%" +#define FAN_HALF_TEXT_T_CN "50%" +#define FAN_CLOSE_TEXT_T_CN "關閉" +#define FAN_TIPS1_TEXT_T_CN "風扇" +#define FAN_TIPS2_TEXT_T_CN "FAN\nClose" + +#define FILAMENT_IN_TEXT_T_CN "進料" +#define FILAMENT_OUT_TEXT_T_CN "退料" +#define FILAMENT_EXT0_TEXT_T_CN "噴頭1" +#define FILAMENT_EXT1_TEXT_T_CN "噴頭2" +#define FILAMENT_HEAT_TEXT_T_CN "預熱" +#define FILAMENT_STOP_TEXT_T_CN "停止" +//#define FILAMENT_CHANGE_TEXT_T_CN "準備換料" +#define FILAMENT_TIPS2_TEXT_T_CN "T:" +#define FILAMENT_TIPS3_TEXT_T_CN "正在進料" +#define FILAMENT_TIPS4_TEXT_T_CN "正在退料" +#define FILAMENT_TIPS5_TEXT_T_CN "溫度太低,請先預熱" +#define FILAMENT_TIPS6_TEXT_T_CN "換料完成" + +#if 0 + #define FILAMENT_REPLAYS_IDLE_TEXT_T_CN "請按<進料>或<退料>進行換料!" + #define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,請按<進料>或<退料>進行換料!" + +#endif + + + #define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,\n請按<進料>或<退料>" + + + +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_T_CN "準備進料,正在加熱,請稍等" +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_T_CN "準備退料,正在加熱,請稍等" +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_T_CN "加熱完成,請裝載耗材后,按<確定>開始進料" +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_T_CN "請裝載耗,按<確定>開始進料!" +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_T_CN "加熱完成,请按<確定>開始退料!" +#define FILAMENT_DIALOG_LOADING_TIPS_T_CN "正在進料,请等待耗材加載完成!" +#define FILAMENT_DIALOG_UNLOADING_TIPS_T_CN "正在退料,请等待耗材卸載完成!" +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_T_CN "進料完成,请按<確定>返回" +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_T_CN "退料完成,请按<確定>返回" + +#define PRE_HEAT_EXT_TEXT_T_CN "噴頭" +#define PRE_HEAT_BED_TEXT_T_CN "熱床" + +#define FILE_LOADING_T_CN "正在載入......" +#define NO_FILE_AND_CHECK_T_CN "無文件!請插入sd卡/u盤!" +#define NO_FILE_T_CN "無文件!" + +#define EXTRUDER_TEMP_TEXT_T_CN "溫度" +#define EXTRUDER_E_LENGTH1_TEXT_T_CN "噴頭" +#define EXTRUDER_E_LENGTH2_TEXT_T_CN "噴頭" +#define EXTRUDER_E_LENGTH3_TEXT_T_CN "噴頭" + +#define ABOUT_TYPE_TEXT_T_CN "Type: " +#define ABOUT_VERSION_TEXT_T_CN "Firmware: " +#define ABOUT_WIFI_TEXT_T_CN "Wifi: " + +#define PRINTING_OPERATION_T_CN "操作" +#define PRINTING_PAUSE_T_CN "暫停" +#define PRINTING_TEMP_T_CN "溫度" +#define PRINTING_CHANGESPEED_T_CN "變速" +#define PRINTING_RESUME_T_CN "恢復" +#define PRINTING_STOP_T_CN "停止" +#define PRINTING_MORE_T_CN "更多" +#define PRINTING_EXTRUDER_T_CN "擠出" +#define PRINTING_MOVE_T_CN "移動" + +#define EXTRUDER_SPEED_T_CN "擠出" +#define MOVE_SPEED_T_CN "移動" +#define EXTRUDER_SPEED_STATE_T_CN "擠出速度" +#define MOVE_SPEED_STATE_T_CN "移動速度" +#define STEP_1PERCENT_T_CN "1%%" +#define STEP_5PERCENT_T_CN "5%%" +#define STEP_10PERCENT_T_CN "10%%" + +#define ZOFFSET_T_CN "Z Offset" +#define ZOFFSET_INC_T_CN "增加" +#define ZOFFSET_DEC_T_CN "減少" + +#define TITLE_READYPRINT_T_CN "準備打印" +#define TITLE_PREHEAT_T_CN "預熱" +#define TITLE_MOVE_T_CN "移動" +#define TITLE_HOME_T_CN "回零" +#define TITLE_EXTRUDE_T_CN "擠出" +#define TITLE_LEVELING_T_CN "調平" +#define TITLE_SET_T_CN "設置" +#define TITLE_MORE_T_CN "更多" +#define TITLE_CHOOSEFILE_T_CN "選擇文件" +#define TITLE_PRINTING_T_CN "正在打印" +#define TITLE_OPERATION_T_CN "操作" +#define TITLE_ADJUST_T_CN "調整" +#define TITLE_WIRELESS_T_CN "無線網絡" +#define TITLE_FILAMENT_T_CN "換料" +#define TITLE_ABOUT_T_CN "關於" +#define TITLE_FAN_T_CN "風扇" +#define TITLE_LANGUAGE_T_CN "語言" +#define TITLE_PAUSE_T_CN "暫停" +#define TITLE_CHANGESPEED_T_CN "變速" +#define TITLE_CLOUD_TEXT_T_CN "雲服務" +#define TITLE_DIALOG_CONFIRM_T_CN "確認" +#define TITLE_FILESYS_T_CN "文件系統" +#define TITLE_ZOFFSET_T_CN "Z Offset" + +#define AUTO_SHUTDOWN_T_CN "自動關機" +#define MANUAL_SHUTDOWN_T_CN "手動關機" + +#define DIALOG_CONFIRM_T_CN "確定" +#define DIALOG_CANCLE_T_CN "取消" +#define DIALOG_OK_T_CN "確認" +#define DIALOG_RESET_T_CN "重設" +#define DIALOG_RETRY_T_CN "重試" +#define DIALOG_DISABLE_T_CN "禁用" +#define DIALOG_PRINT_MODEL_T_CN "打印模型?" +#define DIALOG_CANCEL_PRINT_T_CN "停止打印?" +#define DIALOG_RETRY_T_CN "重試" +#define DIALOG_STOP_T_CN "停止" +#define DIALOG_REPRINT_FROM_BREAKPOINT_T_CN "從斷點續打?" +//#define DIALOG_UNBIND_PRINTER_T_CN "解除綁定?" +#define DIALOG_ERROR_TIPS1_T_CN "錯誤:找不到文件,請插入sd卡/u盤!" +#define DIALOG_ERROR_TIPS2_T_CN "錯誤:通信失敗,請檢查波特率或主板硬件!" +#define DIALOG_ERROR_TIPS3_T_CN "錯誤:文件名或文件路徑太長!" +#define DIALOG_CLOSE_MACHINE_T_CN "正在關機......" +#define DIALOG_UNBIND_PRINTER_T_CN "解除綁定?" +#define DIALOG_FILAMENT_NO_PRESS_T_CN "請先裝載耗材!" +#define DIALOG_PRINT_FINISH_T_CN "打印完成!" +#define DIALOG_PRINT_TIME_T_CN "打印時間: " +#define DIALOG_REPRINT_T_CN "再打印壹次" +#define DIALOG_WIFI_ENABLE_TIPS_T_CN "wifi模塊正在配置中,請稍等......" + +#define TEXT_VALUE_T_CN "%d℃/%d℃" +#define EXTRUDE_TEXT_VALUE_T_T_CN ": %d℃" +#define WIFI_RECONNECT_TEXT_T_CN "重新連接" + +#define MESSEGE_PAUSING_T_CN "暫停中..." +#define MESSEGE_CHANGING_T_CN "等待換料開始..." +#define MESSEGE_UNLOAD_T_CN "退料中,請稍等..." +#define MESSEGE_WAITING_T_CN "點擊按鈕恢復打印" +#define MESSEGE_INSERT_T_CN "裝載耗材後,點擊按鈕開始打印" +#define MESSEGE_LOAD_T_CN "進料中,請稍等..." +#define MESSEGE_PURGE_T_CN "等待擠出..." +#define MESSEGE_RESUME_T_CN "等待恢復打印..." +#define MESSEGE_HEAT_T_CN "按下按鈕,加熱噴頭" +#define MESSEGE_HEATING_T_CN "噴頭加熱中,請等待..." +#define MESSEGE_OPTION_T_CN "擠出更多還是繼續打印" +#define MESSEGE_PURGE_MORE_T_CN "擠出" +#define MESSEGE_CONTINUE_PRINT_T_CN "打印" + +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/tft_fsmc.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp similarity index 98% rename from Marlin/src/lcd/extui/lib/mks_ui/src/tft_fsmc.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp index af2901552f63..495b8da8e43e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/tft_fsmc.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp @@ -20,7 +20,7 @@ * */ -#include "../../../../../inc/MarlinConfig.h" +#include "../../../../inc/MarlinConfig.h" #if ENABLED(TFT_LITTLE_VGL_UI) @@ -211,10 +211,9 @@ uint16_t LCD_IO_ReadData(uint16_t RegValue) { return LCD->RAM; } -uint16_t ILI9488_ReadRAM() -{ - uint16_t data; - data = LCD->RAM; +uint16_t ILI9488_ReadRAM() { + uint16_t data; + data = LCD->RAM; return data; } @@ -272,8 +271,5 @@ void LCD_IO_WaitSequence_Async() { } #endif // LCD_USE_DMA_FSMC - #endif // ARDUINO_ARCH_STM32F1 && FSMC_CS_PIN - -#endif - +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h new file mode 100644 index 000000000000..50e87b5acc68 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h @@ -0,0 +1,30 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(__cplusplus) +extern "C" { /* C-declarations for C++ */ +#endif + +#if defined(__cplusplus) +} /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp new file mode 100644 index 000000000000..060a6f04ca00 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -0,0 +1,804 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * @file lcd_lvgl_configuration.c + * @date 2020-02-21 + * */ + +#include "../../../../MarlinCore.h" + +#if ENABLED(TFT_LITTLE_VGL_UI) + +#include "tft_lvgl_configuration.h" +#include "lvgl.h" +#include "../../../../feature/touch/xpt2046.h" +#include "draw_ready_print.h" +#include "W25Qxx.h" +#include "pic_manager.h" + +#include "mks_hardware_test.h" +#include "draw_ui.h" + +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../../feature/powerloss.h" +#endif + +#include + +#if ENABLED(SPI_GRAPHICAL_TFT) + #include "SPI_TFT.h" +#endif + +//#include "../../Configuration.h" +//#include "../../src/core/macros.h" + +extern void LCD_IO_Init(uint8_t cs, uint8_t rs); +extern void LCD_IO_WriteData(uint16_t RegValue); +extern void LCD_IO_WriteReg(uint16_t Reg); + +extern void LCD_IO_WriteMultiple(uint16_t color, uint32_t count); + +extern void init_gb2312_font(); + +static lv_disp_buf_t disp_buf; +//static lv_color_t buf[LV_HOR_RES_MAX * 18]; +//static lv_color_t buf[10*5]; +//extern lv_obj_t * scr; +#if ENABLED(SDSUPPORT) +extern void UpdatePic(); +extern void UpdateFont(); +#endif +uint16_t DeviceCode = 0x9488; +extern uint8_t sel_id; + +#define SetCs +#define ClrCs + +#define HDP 799 //Horizontal Display Period //** +#define HT 1000 //Horizontal Total +#define HPS 51 //LLINE Pulse Start Position +#define LPS 3 // Horizontal Display Period Start Position +#define HPW 8 // LLINE Pulse Width + +#define VDP 479 //Vertical Display Period +#define VT 530 //Vertical Total +#define VPS 24 // LFRAME Pulse Start Position +#define FPS 23 //Vertical Display Period Start Positio +#define VPW 3 // LFRAME Pulse Width //** + +#define MAX_HZ_POSX HDP+1 +#define MAX_HZ_POSY VDP+1 + +extern uint8_t gcode_preview_over, flash_preview_begin, default_preview_flg; + +void SysTick_Callback() { + lv_tick_inc(1); + print_time_count(); +} + +void tft_set_cursor(uint16_t x, uint16_t y) { + #if 0 + if (DeviceCode==0x8989) { + LCD_WriteReg(0x004E,y); //行 + LCD_WriteReg(0x004F,x); //列 + } + else if ((DeviceCode==0x9919)) { + LCD_WriteReg(0x004E,x); // 行 + LCD_WriteReg(0x004F,y); // 列 + } + else if ((DeviceCode==0x5761)) { //SSD1963 + LCD_WrtReg(0x002A); + LCD_WrtRAM(x>>8); + LCD_WrtRAM(x&0x00FF); + LCD_WrtRAM(HDP>>8); + LCD_WrtRAM(HDP&0x00FF); + LCD_WrtReg(0x002B); + LCD_WrtRAM(y>>8); + LCD_WrtRAM(y&0x00FF); + LCD_WrtRAM(VDP>>8); + LCD_WrtRAM(VDP&0x00FF); + } + else if (DeviceCode == 0x9488) { + ILI9488_WriteCmd(0x002A); + ILI9488_WriteData(x>>8); + ILI9488_WriteData(x&0x00FF); + ILI9488_WriteData(x>>8); + ILI9488_WriteData(x&0x00FF); + //ILI9488_WriteData(0x01); + //ILI9488_WriteData(0xDF); + ILI9488_WriteCmd(0x002B); + ILI9488_WriteData(y>>8); + ILI9488_WriteData(y&0x00FF); + ILI9488_WriteData(y>>8); + ILI9488_WriteData(y&0x00FF); + //ILI9488_WriteData(0x01); + //ILI9488_WriteData(0x3F); + } + else { + LCD_WriteReg(0x0020,y); // 行 + LCD_WriteReg(0x0021,0x13f-x); // 列 + } + #else + LCD_IO_WriteReg(0x002A); + LCD_IO_WriteData(x >> 8); + LCD_IO_WriteData(x & 0x00FF); + LCD_IO_WriteData(x >> 8); + LCD_IO_WriteData(x & 0x00FF); + //ILI9488_WriteData(0x01); + //ILI9488_WriteData(0xDF); + LCD_IO_WriteReg(0x002B); + LCD_IO_WriteData(y >> 8); + LCD_IO_WriteData(y & 0x00FF); + LCD_IO_WriteData(y >> 8); + LCD_IO_WriteData(y & 0x00FF); + //ILI9488_WriteData(0x01); + //ILI9488_WriteData(0x3F); + #endif +} + +void LCD_WriteRAM_Prepare(void) { + #if 0 + if ((DeviceCode==0x9325) || (DeviceCode==0x9328) || (DeviceCode==0x8989)) { + ClrCs + LCD->LCD_REG = R34; + SetCs + } + else { + LCD_WrtReg(0x002C); + } + #else + LCD_IO_WriteReg(0x002C); + #endif +} + +void tft_set_point(uint16_t x,uint16_t y,uint16_t point) { + //if (DeviceCode == 0x9488) { + if ( (x>480)||(y>320) ) return; + //} + //**if ( (x>320)||(y>240) ) return; + tft_set_cursor(x,y); /*设置光标位置*/ + + LCD_WriteRAM_Prepare(); /* 开始写入GRAM*/ + //LCD_WriteRAM(point); + LCD_IO_WriteData(point); +} + +void LCD_WriteReg(uint16_t LCD_Reg,uint16_t LCD_RegValue) { + /* Write 16-bit Index, then Write Reg */ + ClrCs + LCD_IO_WriteReg(LCD_Reg); + /* Write 16-bit Reg */ + LCD_IO_WriteData(LCD_RegValue); + SetCs +} + +void ili9320_SetWindows(uint16_t StartX,uint16_t StartY,uint16_t width,uint16_t heigh) { + uint16_t s_h,s_l, e_h, e_l; + + uint16_t xEnd, yEnd; + xEnd = StartX + width; + yEnd = StartY + heigh-1; + if (DeviceCode == 0x8989) { + /*LCD_WriteReg(0x0044, (StartX & 0xFF) | (xEnd << 8)); + LCD_WriteReg(0x0045, StartY); + LCD_WriteReg(0x0046, yEnd);*/ + LCD_WriteReg(0x0044, (StartY& 0xFF) | (yEnd << 8)); + LCD_WriteReg(0x0045, StartX); + LCD_WriteReg(0x0046, xEnd); + } + else if (DeviceCode == 0x9488) { + s_h = (StartX >> 8) & 0x00ff; + s_l = StartX & 0x00ff; + e_h = ((StartX + width - 1) >> 8) & 0x00ff; + e_l = (StartX + width - 1) & 0x00ff; + + LCD_IO_WriteReg(0x002A); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + + s_h = (StartY >> 8) & 0x00ff; + s_l = StartY & 0x00ff; + e_h = ((StartY + heigh - 1) >> 8) & 0x00ff; + e_l = (StartY + heigh - 1) & 0x00ff; + + LCD_IO_WriteReg(0x002B); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + } + else if ((DeviceCode == 0x9325) || (DeviceCode == 0x9328) || (DeviceCode == 0x1505)) { + /* LCD_WriteReg(0x0050, StartX); + LCD_WriteReg(0x0052, StartY); + LCD_WriteReg(0x0051, xEnd); + LCD_WriteReg(0x0053, yEnd);*/ + LCD_WriteReg(0x0050,StartY); //Specify the start/end positions of the window address in the horizontal direction by an address unit + LCD_WriteReg(0x0051,yEnd); //Specify the start positions of the window address in the vertical direction by an address unit + LCD_WriteReg(0x0052,320 - xEnd); + LCD_WriteReg(0x0053,320 - StartX - 1); //Specify the end positions of the window address in the vertical direction by an address unit + + } + else { + s_h = (StartX >> 8) & 0xff; + s_l = StartX & 0xff; + e_h = ((StartX + width - 1) >> 8) & 0xff; + e_l = (StartX + width - 1) & 0xff; + + LCD_IO_WriteReg(0x2A); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + + s_h = (StartY >> 8) & 0xff; + s_l = StartY & 0xff; + e_h = ((StartY + heigh - 1) >> 8) & 0xff; + e_l = (StartY + heigh - 1) & 0xff; + + LCD_IO_WriteReg(0x2B); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + } +} + +void LCD_Clear(uint16_t Color) { + uint32_t index=0; + unsigned int count; + + if (DeviceCode ==0x9488) { + tft_set_cursor(0,0); + ili9320_SetWindows(0,0,480,320); + LCD_WriteRAM_Prepare(); + //index = (160*480); + for (index = 0; index < 320*480; index++) + LCD_IO_WriteData(Color); + //LCD_IO_WriteMultiple(Color, (480*320)); + //while(index --) + //LCD_IO_WriteData(Color); + } + else if (DeviceCode == 0x5761) { + LCD_IO_WriteReg(0x002a); + LCD_IO_WriteData(0); + LCD_IO_WriteData(0); + LCD_IO_WriteData(HDP>>8); + LCD_IO_WriteData(HDP&0x00ff); + LCD_IO_WriteReg(0x002b); + LCD_IO_WriteData(0); + LCD_IO_WriteData(0); + LCD_IO_WriteData(VDP>>8); + LCD_IO_WriteData(VDP&0x00ff); + LCD_IO_WriteReg(0x002c); + LCD_IO_WriteReg(0x002c); + for (count = 0; count < (HDP+1)*(VDP+1); count++) + LCD_IO_WriteData(Color); + } + else { + tft_set_cursor(0,0); + LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */ + for (index=0;index<76800;index++) + LCD_IO_WriteData(Color); + } +} + +extern uint16_t ILI9488_ReadRAM(); + +#if DISABLED(SPI_GRAPHICAL_TFT) + + void init_tft() { + uint16_t i; + //************* Start Initial Sequence **********// + + LCD_IO_Init(FSMC_CS_PIN, FSMC_RS_PIN); + + _delay_ms(5); + + LCD_IO_WriteReg(0x00D3); + DeviceCode=ILI9488_ReadRAM(); //dummy read + DeviceCode=ILI9488_ReadRAM(); + DeviceCode=ILI9488_ReadRAM(); + DeviceCode<<=8; + DeviceCode|=ILI9488_ReadRAM(); + + if (DeviceCode == 0x9488) { + LCD_IO_WriteReg(0x00E0); + LCD_IO_WriteData(0x0000); + LCD_IO_WriteData(0x0007); + LCD_IO_WriteData(0x000f); + LCD_IO_WriteData(0x000D); + LCD_IO_WriteData(0x001B); + LCD_IO_WriteData(0x000A); + LCD_IO_WriteData(0x003c); + LCD_IO_WriteData(0x0078); + LCD_IO_WriteData(0x004A); + LCD_IO_WriteData(0x0007); + LCD_IO_WriteData(0x000E); + LCD_IO_WriteData(0x0009); + LCD_IO_WriteData(0x001B); + LCD_IO_WriteData(0x001e); + LCD_IO_WriteData(0x000f); + + LCD_IO_WriteReg(0x00E1); + LCD_IO_WriteData(0x0000); + LCD_IO_WriteData(0x0022); + LCD_IO_WriteData(0x0024); + LCD_IO_WriteData(0x0006); + LCD_IO_WriteData(0x0012); + LCD_IO_WriteData(0x0007); + LCD_IO_WriteData(0x0036); + LCD_IO_WriteData(0x0047); + LCD_IO_WriteData(0x0047); + LCD_IO_WriteData(0x0006); + LCD_IO_WriteData(0x000a); + LCD_IO_WriteData(0x0007); + LCD_IO_WriteData(0x0030); + LCD_IO_WriteData(0x0037); + LCD_IO_WriteData(0x000f); + + LCD_IO_WriteReg(0x00C0); + LCD_IO_WriteData(0x0010); + LCD_IO_WriteData(0x0010); + + LCD_IO_WriteReg(0x00C1); + LCD_IO_WriteData(0x0041); + + LCD_IO_WriteReg(0x00C5); + LCD_IO_WriteData(0x0000); + LCD_IO_WriteData(0x0022); + LCD_IO_WriteData(0x0080); + + LCD_IO_WriteReg(0x0036); + //ILI9488_WriteData(0x0068); + //if (gCfgItems.overturn_180 != 0xEE) + //{ + LCD_IO_WriteData(0x0068); + //} + //else + //{ + //ILI9488_WriteData(0x00A8); + //} + + LCD_IO_WriteReg(0x003A); //Interface Mode Control + LCD_IO_WriteData(0x0055); + + LCD_IO_WriteReg(0x00B0); //Interface Mode Control + LCD_IO_WriteData(0x0000); + LCD_IO_WriteReg(0x00B1); //Frame rate 70HZ + LCD_IO_WriteData(0x00B0); + LCD_IO_WriteData(0x0011); + LCD_IO_WriteReg(0x00B4); + LCD_IO_WriteData(0x0002); + LCD_IO_WriteReg(0x00B6); //RGB/MCU Interface Control + LCD_IO_WriteData(0x0002); + LCD_IO_WriteData(0x0042); + + LCD_IO_WriteReg(0x00B7); + LCD_IO_WriteData(0x00C6); + + //WriteComm(0xBE); + //WriteData(0x00); + //WriteData(0x04); + + LCD_IO_WriteReg(0x00E9); + LCD_IO_WriteData(0x0000); + + LCD_IO_WriteReg(0x00F7); + LCD_IO_WriteData(0x00A9); + LCD_IO_WriteData(0x0051); + LCD_IO_WriteData(0x002C); + LCD_IO_WriteData(0x0082); + + LCD_IO_WriteReg(0x0011); + for (i=0;i<65535;i++); + LCD_IO_WriteReg(0x0029); + + ili9320_SetWindows(0,0,480,320); + LCD_Clear(0x0000); + + OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); + } + + } + +#endif + +extern uint8_t bmp_public_buf[17 * 1024]; +void tft_lvgl_init() { + //uint16_t test_id=0; + W25QXX.init(SPI_QUARTER_SPEED); + //test_id=W25QXX.W25QXX_ReadID(); + #if ENABLED(SDSUPPORT) + UpdatePic(); + UpdateFont(); + #endif + gCfgItems_init(); + ui_cfg_init(); + disp_language_init(); + //spi_flash_read_test(); + + #if ENABLED(SPI_GRAPHICAL_TFT) + SPI_TFT.spi_init(SPI_FULL_SPEED); + SPI_TFT.LCD_init(); + #else + init_tft(); + #endif + + lv_init(); + + lv_disp_buf_init(&disp_buf, bmp_public_buf, NULL, LV_HOR_RES_MAX * 18); /*Initialize the display buffer*/ + + lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/ + lv_disp_drv_init(&disp_drv); /*Basic initialization*/ + disp_drv.flush_cb = my_disp_flush; /*Set your driver function*/ + disp_drv.buffer = &disp_buf; /*Assign the buffer to the display*/ + lv_disp_drv_register(&disp_drv); /*Finally register the driver*/ + + lv_indev_drv_t indev_drv; + lv_indev_drv_init(&indev_drv); /*Descriptor of a input device driver*/ + indev_drv.type = LV_INDEV_TYPE_POINTER; /*Touch pad is a pointer-like device*/ + indev_drv.read_cb = my_touchpad_read; /*Set your driver function*/ + lv_indev_drv_register(&indev_drv); /*Finally register the driver*/ + + systick_attach_callback(SysTick_Callback); + + init_gb2312_font(); + + tft_style_init(); + + filament_pin_setup(); + + #if ENABLED(POWER_LOSS_RECOVERY) + if ( recovery.info.valid_head != 0 + && recovery.info.valid_head == recovery.info.valid_foot + ) { + if (gCfgItems.from_flash_pic == 1) + flash_preview_begin = 1; + else + default_preview_flg = 1; + + uiCfg.print_state = REPRINTING; + + memset(public_buf_m,0,sizeof(public_buf_m)); + strncpy(public_buf_m,recovery.info.sd_filename,sizeof(public_buf_m)); + card.printLongPath(public_buf_m); + + strncpy(list_file.long_name[sel_id],card.longFilename,sizeof(list_file.long_name[sel_id])); + + lv_draw_printing(); + } + else + #endif + lv_draw_ready_print(); + + #if ENABLED(MKS_TEST) + Test_GPIO(); + #endif +} + + +#if 0 +void LCD_WriteRAM(uint16_t RGB_Code) { + #if 0 + ClrCs + /* Write 16-bit GRAM Reg */ + LCD->LCD_RAM = RGB_Code; + SetCs + #else + LCD_IO_WriteData(RGB_Code); + #endif +} +#endif + + +void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) { + #if ENABLED(SPI_GRAPHICAL_TFT) + uint16_t i, width, height; + uint16_t clr_temp; + uint8_t tbuf[480*2]; + + SPI_TFT.spi_init(SPI_FULL_SPEED); + + width = area->x2 - area->x1 + 1; + height = area->y2 - area->y1 +1; + + for (int j = 0; j < height; j++) { + SPI_TFT.SetCursor(0,0); + SPI_TFT.SetWindows((uint16_t)area->x1,(uint16_t)area->y1+j,width,1); + SPI_TFT.LCD_WriteRAM_Prepare(); + + for (i = 0; i < width * 2;) { + clr_temp = (uint16_t)(((uint16_t)color_p->ch.red<<11) + | ((uint16_t)color_p->ch.green<<5) + | ((uint16_t)color_p->ch.blue)); + + tbuf[i] = clr_temp >> 8; + tbuf[i+1] = clr_temp; + i+=2; + color_p++; + } + SPI_TFT_CS_L; + SPI_TFT_DC_H; + SPI.dmaSend(tbuf,width*2,true); + SPI_TFT_CS_H; + } + + lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ + + W25QXX.init(SPI_QUARTER_SPEED); + + #else + + #if 1 + uint16_t i,width,height; + uint16_t clr_temp; + #if 0 + int32_t x,y; + for (y = area->y1; y <= area->y2; y++) { + for (x = area->x1; x <= area->x2; x++) { + //set_pixel(x, y, *color_p); /* Put a pixel to the display.*/ + clr_temp = (uint16_t)(((uint16_t)color_p->ch.red<<11) + |((uint16_t)color_p->ch.green<<5) + |((uint16_t)color_p->ch.blue)); + tft_set_point(x, y,clr_temp); + color_p++; + } + } + #else + width = area->x2 - area->x1 + 1; + height = area->y2 - area->y1 +1; + //tft_set_cursor((uint16_t)area->x1,(uint16_t)area->y1); + ili9320_SetWindows((uint16_t)area->x1,(uint16_t)area->y1,width,height); + LCD_WriteRAM_Prepare(); + for (i = 0; i < width * height; i++) { + clr_temp = (uint16_t)(((uint16_t)color_p->ch.red<<11) + | ((uint16_t)color_p->ch.green<<5) + | ((uint16_t)color_p->ch.blue)); + LCD_IO_WriteData(clr_temp); + color_p++; + } + #endif + + lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ + #endif + + #endif +} + +#define TICK_CYCLE 1 + +static int32_t touch_time1 = 0; + +unsigned int getTickDiff(unsigned int curTick, unsigned int lastTick) { + if (lastTick <= curTick) + return (curTick - lastTick) * TICK_CYCLE; + else + return (0xFFFFFFFF - lastTick + curTick) * TICK_CYCLE; +} + +#if ENABLED(SPI_GRAPHICAL_TFT) + + #ifndef USE_XPT2046 + #define USE_XPT2046 1 + #define XPT2046_XY_SWAP 1 + #define XPT2046_X_INV 1 + #define XPT2046_Y_INV 0 + #endif + + #if USE_XPT2046 + #define XPT2046_HOR_RES 480 + #define XPT2046_VER_RES 320 + #define XPT2046_X_MIN 201 + #define XPT2046_Y_MIN 164 + #define XPT2046_X_MAX 3919 + #define XPT2046_Y_MAX 3776 + #define XPT2046_AVG 4 + #define XPT2046_INV 1 + #endif + +#else + + #ifndef USE_XPT2046 + #define USE_XPT2046 1 + #define XPT2046_XY_SWAP 1 + #define XPT2046_X_INV 0 + #define XPT2046_Y_INV 1 + #endif + + #if USE_XPT2046 + #define XPT2046_HOR_RES 480 + #define XPT2046_VER_RES 320 + #define XPT2046_X_MIN 201 + #define XPT2046_Y_MIN 164 + #define XPT2046_X_MAX 3919 + #define XPT2046_Y_MAX 3776 + #define XPT2046_AVG 4 + #define XPT2046_INV 0 + #endif + +#endif + +static void xpt2046_corr(uint16_t *x, uint16_t *y) { + #if XPT2046_XY_SWAP + int16_t swap_tmp; + swap_tmp = *x; + *x = *y; + *y = swap_tmp; + #endif + if ((*x) > XPT2046_X_MIN) (*x) -= XPT2046_X_MIN; else (*x) = 0; + if ((*y) > XPT2046_Y_MIN) (*y) -= XPT2046_Y_MIN; else (*y) = 0; + (*x) = uint32_t(uint32_t(*x) * XPT2046_HOR_RES) / (XPT2046_X_MAX - XPT2046_X_MIN); + (*y) = uint32_t(uint32_t(*y) * XPT2046_VER_RES) / (XPT2046_Y_MAX - XPT2046_Y_MIN); + #if XPT2046_X_INV + (*x) = XPT2046_HOR_RES - (*x); + #endif + #if XPT2046_Y_INV + (*y) = XPT2046_VER_RES - (*y); + #endif +} + +#define times 4 +#define CHX 0x90 // 0x90 +#define CHY 0xD0 // 0xD0 + +int SPI2_ReadWrite2Bytes(void) { + volatile uint16_t ans=0; + uint16_t temp = 0; + #if ENABLED(SPI_GRAPHICAL_TFT) + temp = SPI_TFT.spi_read_write_byte(0xFF); + ans = temp << 8; + temp = SPI_TFT.spi_read_write_byte(0xFF); + ans |= temp; + ans >>= 3; + #else + temp = W25QXX.spi_flash_read_write_byte(0xFF); + ans = temp << 8; + temp = W25QXX.spi_flash_read_write_byte(0xFF); + ans |= temp; + ans >>= 3; + #endif + return ans & 0x0FFF; +} + +uint16_t x_addata[times],y_addata[times]; +void XPT2046_Rd_Addata(uint16_t *X_Addata,uint16_t *Y_Addata) { + uint16_t i, j, k; + //int result; + //#if ENABLED(TOUCH_BUTTONS) + + #if ENABLED(SPI_GRAPHICAL_TFT) + SPI_TFT.spi_init(SPI_QUARTER_SPEED); + #endif + + for (i = 0; i < times; i++) { + #if ENABLED(SPI_GRAPHICAL_TFT) + OUT_WRITE(TOUCH_CS_PIN, LOW); + SPI_TFT.spi_read_write_byte(CHX); + y_addata[i] = SPI2_ReadWrite2Bytes(); + WRITE(TOUCH_CS_PIN, HIGH); + + OUT_WRITE(TOUCH_CS_PIN, LOW); + SPI_TFT.spi_read_write_byte(CHY); + x_addata[i] = SPI2_ReadWrite2Bytes(); + WRITE(TOUCH_CS_PIN, HIGH); + #else + //#if ENABLED(TOUCH_BUTTONS) + OUT_WRITE(TOUCH_CS_PIN, LOW); + W25QXX.spi_flash_read_write_byte(CHX); + y_addata[i] = SPI2_ReadWrite2Bytes(); + WRITE(TOUCH_CS_PIN, HIGH); + + OUT_WRITE(TOUCH_CS_PIN, LOW); + W25QXX.spi_flash_read_write_byte(CHY); + x_addata[i] = SPI2_ReadWrite2Bytes(); + WRITE(TOUCH_CS_PIN, HIGH); + //#endif + #endif + + } + //#endif + //result = x_addata[0]; + for (i=0;i x_addata[i]) { + k = x_addata[j]; + x_addata[j] = x_addata[i]; + x_addata[i] = k; + } + } + } + if (x_addata[times / 2 - 1] - x_addata[times / 2] > 50) { + *X_Addata = *Y_Addata = 0; + return; + } + + *X_Addata = (x_addata[times / 2 - 1] + x_addata[times / 2]) /2; + + //result = y_addata[0]; + for (i = 0; i < times; i++) { + for (j = i + 1; j < times; j++) { + if (y_addata[j] > y_addata[i]) { + k = y_addata[j]; + y_addata[j] = y_addata[i]; + y_addata[i] = k; + } + } + } + + + if (y_addata[times / 2 - 1] - y_addata[times / 2] > 50) { + *X_Addata = *Y_Addata = 0; + return; + } + + *Y_Addata = (y_addata[times / 2 - 1] + y_addata[times / 2]) / 2; +} + +#define ADC_VALID_OFFSET 10 + +uint8_t TOUCH_PressValid(uint16_t _usX, uint16_t _usY) { + if ( (_usX <= ADC_VALID_OFFSET) || (_usY <= ADC_VALID_OFFSET) + || (_usX >= 4095 - ADC_VALID_OFFSET) || (_usY >= 4095 - ADC_VALID_OFFSET) + ) return 0; + + return 1; +} + +static lv_coord_t last_x = 0, last_y = 0; +bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) { + #if 1 + uint32_t tmpTime, diffTime = 0; + + tmpTime = millis(); + diffTime = getTickDiff(tmpTime, touch_time1); + /*Save the state and save the pressed coordinate*/ + //data->state = TOUCH_PressValid(last_x, last_y) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; + //if (data->state == LV_INDEV_STATE_PR) ADS7843_Rd_Addata((u16 *)&last_x, (u16 *)&last_y); + //touchpad_get_xy(&last_x, &last_y); + /*Save the pressed coordinates and the state*/ + if (diffTime > 10) { + XPT2046_Rd_Addata((uint16_t *)&last_x, (uint16_t *)&last_y); + if (TOUCH_PressValid(last_x, last_y)) { + + data->state = LV_INDEV_STATE_PR; + + /*Set the coordinates (if released use the last pressed coordinates)*/ + + xpt2046_corr((uint16_t *)&last_x, (uint16_t *)&last_y); + data->point.x = last_x; + data->point.y = last_y; + + } + else { + data->state = LV_INDEV_STATE_REL; + } + touch_time1 = tmpTime; + } + + return false; /*Return `false` because we are not buffering and no more data to read*/ + #endif +} + +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h new file mode 100644 index 000000000000..71cb4e747668 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h @@ -0,0 +1,46 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * @file tft_lvgl_configuration.h + * @date 2020-02-21 + * */ + +//#ifdef __cplusplus +//extern "C" { +//#endif + +#include "lvgl.h" + +void tft_lvgl_init(); +void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p); +bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data); + +void LCD_Clear(uint16_t Color); +void tft_set_point(uint16_t x,uint16_t y,uint16_t point); +void ili9320_SetWindows(uint16_t StartX,uint16_t StartY,uint16_t width,uint16_t heigh); +void LCD_WriteRAM_Prepare(void); + +//#ifdef __cplusplus +//} /* extern "C" */ +//#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/src/tft_multi_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp similarity index 95% rename from Marlin/src/lcd/extui/lib/mks_ui/src/tft_multi_language.cpp rename to Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp index b08f68061004..bc7c5933c72b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/src/tft_multi_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp @@ -1,7 +1,29 @@ -#include "../../../../../MarlinCore.h" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../MarlinCore.h" + #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../inc/draw_ui.h" -#include "../inc/tft_multi_language.h" +#include "draw_ui.h" +#include "tft_multi_language.h" //********************************************// @@ -91,10 +113,10 @@ void disp_language_init() language_menu.italy = LANGUAGE_IT; language_menu.brazil = LANGUAGE_BR; language_menu.french = LANGUAGE_FR; - + about_menu.type_name= ABOUT_TYPE_TEXT; about_menu.firmware_v= ABOUT_VERSION_TEXT; - //about_menu.wifi = ABOUT_WIFI_TEXT; + //about_menu.wifi = ABOUT_WIFI_TEXT; wifi_menu.ip = WIFI_IP_TEXT; wifi_menu.wifi = WIFI_NAME_TEXT; @@ -133,7 +155,7 @@ void disp_language_init() tips_menu.wifiConected = TEXT_WIFI_WIFI_CONECTED_EN; #endif operation_menu.babystep = TEXT_BABY_STEP_EN; - + switch(gCfgItems.language) { case LANG_SIMPLE_CHINESE: @@ -143,7 +165,7 @@ void disp_language_init() common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_CN; common_menu.print_special_title = PRINTING_GBK; common_menu.pause_special_title = PRINTING_PAUSE_GBK; - common_menu.operate_special_title = PRINTING_OPERATION_GBK; + common_menu.operate_special_title = PRINTING_OPERATION_GBK; // main_menu.title=TITLE_READYPRINT_CN; main_menu.preheat=PREHEAT_TEXT_CN; @@ -180,7 +202,7 @@ void disp_language_init() preheat_menu.value_state= TEXT_VALUE_CN; preheat_menu.step_1c= TEXT_1C_CN; preheat_menu.step_5c= TEXT_5C_CN; - preheat_menu.step_10c= TEXT_10C_CN; + preheat_menu.step_10c= TEXT_10C_CN; // move_menu.title = MOVE_TEXT_CN; // @@ -224,7 +246,7 @@ void disp_language_init() set_menu.language=LANGUAGE_TEXT_CN; set_menu.shutdown=SHUTDOWN_TEXT_CN; //set_menu.machine_para = MACHINE_PARA_CN; - + // filesys_menu.title = TITLE_FILESYS_CN; filesys_menu.sd_sys = SD_CARD_TEXT_CN; @@ -251,7 +273,7 @@ void disp_language_init() about_menu.title = ABOUT_TEXT_CN; about_menu.type = ABOUT_TYPE_TEXT_CN; about_menu.version = ABOUT_VERSION_TEXT_CN; - about_menu.wifi = ABOUT_WIFI_TEXT_CN; + about_menu.wifi = ABOUT_WIFI_TEXT_CN; // fan_menu.title = FAN_TEXT_CN; @@ -279,7 +301,7 @@ void disp_language_init() language_menu.title = TITLE_LANGUAGE_CN; language_menu.next = PAGE_DOWN_TEXT_CN; language_menu.up = PAGE_UP_TEXT_CN; - + // printing_menu.title = TITLE_PRINTING_CN; printing_menu.option = PRINTING_OPERATION_CN; @@ -299,7 +321,7 @@ void disp_language_init() operation_menu.more = PRINTING_MORE_CN; operation_menu.move = PRINTING_MOVE_CN; operation_menu.auto_off = AUTO_SHUTDOWN_CN; - operation_menu.manual_off = MANUAL_SHUTDOWN_CN; + operation_menu.manual_off = MANUAL_SHUTDOWN_CN; // pause_menu.title= TITLE_PAUSE_CN; pause_menu.resume = PRINTING_RESUME_CN; @@ -332,7 +354,7 @@ void disp_language_init() print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_CN; print_file_dialog_menu.retry = DIALOG_RETRY_CN; print_file_dialog_menu.stop = DIALOG_STOP_CN; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_CN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_CN; print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_CN; print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_CN; @@ -363,7 +385,7 @@ void disp_language_init() pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_CN; break; -#if 1 +#if 1 #if 1 case LANG_COMPLEX_CHINESE: common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_T_CN; @@ -372,7 +394,7 @@ void disp_language_init() common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_T_CN; common_menu.print_special_title = PRINTING_GBK; common_menu.pause_special_title = PRINTING_PAUSE_GBK; - common_menu.operate_special_title = PRINTING_OPERATION_GBK; + common_menu.operate_special_title = PRINTING_OPERATION_GBK; // main_menu.title=TITLE_READYPRINT_T_CN; main_menu.preheat=PREHEAT_TEXT_T_CN; @@ -395,7 +417,7 @@ void disp_language_init() tool_menu.leveling = TOOL_LEVELING_T_CN; tool_menu.autoleveling = TOOL_AUTO_LEVELING_T_CN; tool_menu.filament = TOOL_FILAMENT_T_CN; - tool_menu.more = TOOL_MORE_T_CN; + tool_menu.more = TOOL_MORE_T_CN; // preheat_menu.adjust_title = TITLE_ADJUST_T_CN; preheat_menu.title=TITLE_PREHEAT_T_CN; @@ -408,7 +430,7 @@ void disp_language_init() preheat_menu.value_state= TEXT_VALUE_T_CN; preheat_menu.step_1c= TEXT_1C_T_CN; preheat_menu.step_5c= TEXT_5C_T_CN; - preheat_menu.step_10c= TEXT_10C_T_CN; + preheat_menu.step_10c= TEXT_10C_T_CN; // move_menu.title = MOVE_TEXT_T_CN; more_menu.zoffset = ZOFFSET_T_CN; @@ -506,7 +528,7 @@ void disp_language_init() language_menu.title = TITLE_LANGUAGE_T_CN; language_menu.next = PAGE_DOWN_TEXT_T_CN; language_menu.up = PAGE_UP_TEXT_T_CN; - + // printing_menu.title = TITLE_PRINTING_T_CN; printing_menu.option = PRINTING_OPERATION_T_CN; @@ -521,12 +543,12 @@ void disp_language_init() operation_menu.temp = PRINTING_TEMP_T_CN; operation_menu.fan = FAN_TEXT_T_CN; operation_menu.extr = PRINTING_EXTRUDER_T_CN; - operation_menu.speed = PRINTING_CHANGESPEED_T_CN; + operation_menu.speed = PRINTING_CHANGESPEED_T_CN; operation_menu.filament= FILAMENT_TEXT_T_CN; operation_menu.more = PRINTING_MORE_T_CN; operation_menu.move = PRINTING_MOVE_T_CN; operation_menu.auto_off = AUTO_SHUTDOWN_T_CN; - operation_menu.manual_off = MANUAL_SHUTDOWN_T_CN; + operation_menu.manual_off = MANUAL_SHUTDOWN_T_CN; // pause_menu.title= TITLE_PAUSE_T_CN; pause_menu.resume = PRINTING_RESUME_T_CN; @@ -559,7 +581,7 @@ void disp_language_init() print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_T_CN; print_file_dialog_menu.retry = DIALOG_RETRY_T_CN; print_file_dialog_menu.stop = DIALOG_STOP_T_CN; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_T_CN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_T_CN; print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_T_CN; print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_T_CN; @@ -571,7 +593,7 @@ void disp_language_init() //ZOFFSET zoffset_menu.title = TITLE_ZOFFSET_T_CN; zoffset_menu.inc = ZOFFSET_INC_T_CN; - zoffset_menu.dec = ZOFFSET_DEC_T_CN; + zoffset_menu.dec = ZOFFSET_DEC_T_CN; pause_msg_menu.pausing = MESSEGE_PAUSING_T_CN; pause_msg_menu.changing = MESSEGE_CHANGING_T_CN; @@ -594,7 +616,7 @@ void disp_language_init() common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_EN; common_menu.print_special_title = PRINTING_OTHER_LANGUGE; common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; - common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; // main_menu.title=TITLE_READYPRINT_EN; main_menu.preheat=PREHEAT_TEXT_EN; @@ -617,7 +639,7 @@ void disp_language_init() tool_menu.leveling = TOOL_LEVELING_EN; tool_menu.autoleveling = TOOL_AUTO_LEVELING_EN; tool_menu.filament = TOOL_FILAMENT_EN; - tool_menu.more = TOOL_MORE_EN; + tool_menu.more = TOOL_MORE_EN; // preheat_menu.adjust_title = TITLE_ADJUST_EN; preheat_menu.title=TITLE_PREHEAT_EN; @@ -638,7 +660,7 @@ void disp_language_init() file_menu.page_down=PAGE_DOWN_TEXT_EN; file_menu.file_loading = FILE_LOADING_EN; file_menu.no_file = NO_FILE_EN; - file_menu.no_file_and_check = NO_FILE_EN;//NO_FILE_AND_CHECK_EN; + file_menu.no_file_and_check = NO_FILE_EN;//NO_FILE_AND_CHECK_EN; // extrude_menu.title=TITLE_EXTRUDE_EN; extrude_menu.in=EXTRUDER_IN_TEXT_EN; @@ -695,7 +717,7 @@ void disp_language_init() about_menu.title = TITLE_ABOUT_EN; about_menu.type = ABOUT_TYPE_TEXT_EN; about_menu.version = ABOUT_VERSION_TEXT_EN; - about_menu.wifi = ABOUT_WIFI_TEXT_EN; + about_menu.wifi = ABOUT_WIFI_TEXT_EN; // fan_menu.title = TITLE_FAN_EN; fan_menu.add = FAN_ADD_TEXT_EN; @@ -720,7 +742,7 @@ void disp_language_init() // language_menu.title = TITLE_LANGUAGE_EN; language_menu.next = PAGE_DOWN_TEXT_EN; - language_menu.up = PAGE_UP_TEXT_EN; + language_menu.up = PAGE_UP_TEXT_EN; // printing_menu.title = TITLE_PRINTING_EN; printing_menu.option = PRINTING_OPERATION_EN; @@ -735,12 +757,12 @@ void disp_language_init() operation_menu.temp = PRINTING_TEMP_EN; operation_menu.fan = FAN_TEXT_EN; operation_menu.extr = PRINTING_EXTRUDER_EN; - operation_menu.speed = PRINTING_CHANGESPEED_EN; + operation_menu.speed = PRINTING_CHANGESPEED_EN; operation_menu.filament= FILAMENT_TEXT_EN; operation_menu.more = PRINTING_MORE_EN; operation_menu.move = PRINTING_MOVE_EN; operation_menu.auto_off = AUTO_SHUTDOWN_EN; - operation_menu.manual_off = MANUAL_SHUTDOWN_EN; + operation_menu.manual_off = MANUAL_SHUTDOWN_EN; // pause_menu.title= TITLE_PAUSE_EN; pause_menu.resume = PRINTING_RESUME_EN; @@ -773,7 +795,7 @@ void disp_language_init() print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; print_file_dialog_menu.retry = DIALOG_RETRY_EN; print_file_dialog_menu.stop = DIALOG_STOP_EN; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_EN; print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_EN; print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_EN; @@ -807,7 +829,7 @@ void disp_language_init() common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_RU; common_menu.print_special_title = PRINTING_OTHER_LANGUGE; common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; - common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; // main_menu.title=TITLE_READYPRINT_RU; main_menu.preheat=PREHEAT_TEXT_RU; @@ -830,7 +852,7 @@ void disp_language_init() tool_menu.leveling = TOOL_LEVELING_RU; tool_menu.autoleveling = TOOL_AUTO_LEVELING_RU; tool_menu.filament = TOOL_FILAMENT_RU; - tool_menu.more = TOOL_MORE_RU; + tool_menu.more = TOOL_MORE_RU; // preheat_menu.adjust_title = TITLE_ADJUST_RU; preheat_menu.title=TITLE_PREHEAT_RU; @@ -851,7 +873,7 @@ void disp_language_init() file_menu.page_down=PAGE_DOWN_TEXT_RU; file_menu.file_loading = FILE_LOADING_RU; file_menu.no_file = NO_FILE_RU; - file_menu.no_file_and_check = NO_FILE_RU;//NO_FILE_AND_CHECK_RU; + file_menu.no_file_and_check = NO_FILE_RU;//NO_FILE_AND_CHECK_RU; // extrude_menu.title=TITLE_EXTRUDE_RU; extrude_menu.in=EXTRUDER_IN_TEXT_RU; @@ -882,12 +904,12 @@ void disp_language_init() set_menu.language=LANGUAGE_TEXT_RU; set_menu.shutdown=SHUTDOWN_TEXT_RU; // - more_menu.title = TITLE_MORE_RU; + more_menu.title = TITLE_MORE_RU; more_menu.zoffset = ZOFFSET_RU; // filesys_menu.title = TITLE_FILESYS_RU; filesys_menu.sd_sys = SD_CARD_TEXT_RU; - filesys_menu.usb_sys = U_DISK_TEXT_RU; + filesys_menu.usb_sys = U_DISK_TEXT_RU; //WIFI wifi_menu.title=WIFI_TEXT; //wifi_menu.key = WIFI_KEY_TEXT_RU; @@ -903,12 +925,12 @@ void disp_language_init() cloud_menu.unbind = CLOUD_UNBIND_RU; cloud_menu.unbinding = CLOUD_UNBINDED_RU; cloud_menu.disconnected = CLOUD_DISCONNECTED_RU; - cloud_menu.disable = CLOUD_DISABLE_RU; + cloud_menu.disable = CLOUD_DISABLE_RU; // about_menu.title = ABOUT_TEXT_RU; about_menu.type = ABOUT_TYPE_TEXT_RU; about_menu.version = ABOUT_VERSION_TEXT_RU; - about_menu.wifi = ABOUT_WIFI_TEXT_RU; + about_menu.wifi = ABOUT_WIFI_TEXT_RU; // fan_menu.title = FAN_TEXT_RU; fan_menu.add = FAN_ADD_TEXT_RU; @@ -948,12 +970,12 @@ void disp_language_init() operation_menu.temp = PRINTING_TEMP_RU; operation_menu.fan = FAN_TEXT_RU; operation_menu.extr = PRINTING_EXTRUDER_RU; - operation_menu.speed = PRINTING_CHANGESPEED_RU; + operation_menu.speed = PRINTING_CHANGESPEED_RU; operation_menu.filament= FILAMENT_TEXT_RU; operation_menu.more = PRINTING_MORE_RU; operation_menu.move = PRINTING_MOVE_RU; operation_menu.auto_off = AUTO_SHUTDOWN_RU; - operation_menu.manual_off = MANUAL_SHUTDOWN_RU; + operation_menu.manual_off = MANUAL_SHUTDOWN_RU; // pause_menu.title= TITLE_PAUSE_RU; pause_menu.resume = PRINTING_RESUME_RU; @@ -985,7 +1007,7 @@ void disp_language_init() print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_RU; print_file_dialog_menu.retry = DIALOG_RETRY_RU; print_file_dialog_menu.stop = DIALOG_STOP_RU; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_RU; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_RU; print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_RU; print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_RU; print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_RU; @@ -996,7 +1018,7 @@ void disp_language_init() //ZOFFSET zoffset_menu.title = TITLE_ZOFFSET_RU; zoffset_menu.inc = ZOFFSET_INC_RU; - zoffset_menu.dec = ZOFFSET_DEC_RU; + zoffset_menu.dec = ZOFFSET_DEC_RU; pause_msg_menu.pausing = MESSEGE_PAUSING_RU; pause_msg_menu.changing = MESSEGE_CHANGING_RU; @@ -1019,7 +1041,7 @@ void disp_language_init() common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_SP; common_menu.print_special_title = PRINTING_SP; common_menu.pause_special_title = PRINTING_PAUSAR_SP; - common_menu.operate_special_title = PRINTING_AJUSTES_SP; + common_menu.operate_special_title = PRINTING_AJUSTES_SP; // main_menu.title=TITLE_READYPRINT_SP; main_menu.preheat=PREHEAT_TEXT_SP; @@ -1042,7 +1064,7 @@ void disp_language_init() tool_menu.leveling = TOOL_LEVELING_SP; tool_menu.autoleveling = TOOL_AUTO_LEVELING_SP; tool_menu.filament = TOOL_FILAMENT_SP; - tool_menu.more = TOOL_MORE_SP; + tool_menu.more = TOOL_MORE_SP; // preheat_menu.adjust_title = TITLE_ADJUST_SP; preheat_menu.title=TITLE_PREHEAT_SP; @@ -1067,7 +1089,7 @@ void disp_language_init() file_menu.page_down=PAGE_DOWN_TEXT_SP; file_menu.file_loading = FILE_LOADING_SP; file_menu.no_file = NO_FILE_SP; - file_menu.no_file_and_check = NO_FILE_SP;//NO_FILE_AND_CHECK_SP; + file_menu.no_file_and_check = NO_FILE_SP;//NO_FILE_AND_CHECK_SP; // extrude_menu.title=TITLE_EXTRUDE_SP; extrude_menu.in=EXTRUDER_IN_TEXT_SP; @@ -1103,8 +1125,8 @@ void disp_language_init() // filesys_menu.title = TITLE_FILESYS_SP; filesys_menu.sd_sys = SD_CARD_TEXT_SP; - filesys_menu.usb_sys = U_DISK_TEXT_SP; - + filesys_menu.usb_sys = U_DISK_TEXT_SP; + //WIFI wifi_menu.title=WIFI_TEXT; //wifi_menu.key = WIFI_KEY_TEXT_SP; @@ -1119,12 +1141,12 @@ void disp_language_init() cloud_menu.unbind = CLOUD_UNBIND_SP; cloud_menu.unbinding = CLOUD_UNBINDED_SP; cloud_menu.disconnected = CLOUD_DISCONNECTED_SP; - cloud_menu.disable = CLOUD_DISABLE_SP; + cloud_menu.disable = CLOUD_DISABLE_SP; // about_menu.title = ABOUT_TEXT_SP; about_menu.type = ABOUT_TYPE_TEXT_SP; about_menu.version = ABOUT_VERSION_TEXT_SP; - about_menu.wifi = ABOUT_WIFI_TEXT_SP; + about_menu.wifi = ABOUT_WIFI_TEXT_SP; // fan_menu.title = FAN_TEXT_SP; fan_menu.add = FAN_ADD_TEXT_SP; @@ -1149,7 +1171,7 @@ void disp_language_init() // language_menu.title = LANGUAGE_TEXT_SP; language_menu.next = PAGE_DOWN_TEXT_SP; - language_menu.up = PAGE_UP_TEXT_SP; + language_menu.up = PAGE_UP_TEXT_SP; // printing_menu.title = TITLE_PRINTING_SP; printing_menu.option = PRINTING_OPERATION_SP; @@ -1164,7 +1186,7 @@ void disp_language_init() operation_menu.temp = PRINTING_TEMP_SP; operation_menu.fan = FAN_TEXT_SP; operation_menu.extr = PRINTING_EXTRUDER_SP; - operation_menu.speed = PRINTING_CHANGESPEED_SP; + operation_menu.speed = PRINTING_CHANGESPEED_SP; operation_menu.filament = FILAMENT_TEXT_SP; operation_menu.more = PRINTING_MORE_SP; operation_menu.move = PRINTING_MOVE_SP; @@ -1192,7 +1214,7 @@ void disp_language_init() printing_more_menu.fan = FAN_TEXT_SP; printing_more_menu.auto_close = AUTO_SHUTDOWN_SP; printing_more_menu.manual = MANUAL_SHUTDOWN_SP; - printing_more_menu.speed = PRINTING_CHANGESPEED_SP; + printing_more_menu.speed = PRINTING_CHANGESPEED_SP; printing_more_menu.temp = PRINTING_TEMP_SP; //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; @@ -1235,7 +1257,7 @@ void disp_language_init() common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_FR; common_menu.text_back=BACK_TEXT_FR; common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_FR; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_FR; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_FR; common_menu.print_special_title = PRINTING_OTHER_LANGUGE; common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; @@ -1262,7 +1284,7 @@ void disp_language_init() tool_menu.leveling = TOOL_LEVELING_FR; tool_menu.autoleveling = TOOL_AUTO_LEVELING_FR; tool_menu.filament = TOOL_FILAMENT_FR; - tool_menu.more = TOOL_MORE_FR; + tool_menu.more = TOOL_MORE_FR; // preheat_menu.adjust_title = TITLE_ADJUST_FR; preheat_menu.title=TITLE_PREHEAT_FR; @@ -1319,7 +1341,7 @@ void disp_language_init() filesys_menu.usb_sys = U_DISK_TEXT_FR; file_menu.file_loading = FILE_LOADING_FR; file_menu.no_file = NO_FILE_FR; - file_menu.no_file_and_check = NO_FILE_FR;//NO_FILE_AND_CHECK_FR; + file_menu.no_file_and_check = NO_FILE_FR;//NO_FILE_AND_CHECK_FR; //WIFI wifi_menu.title=WIFI_NAME_TEXT_FR; //wifi_menu.key = WIFI_KEY_TEXT_FR; @@ -1340,7 +1362,7 @@ void disp_language_init() about_menu.title = ABOUT_TEXT_FR; about_menu.type = ABOUT_TYPE_TEXT_FR; about_menu.version = ABOUT_VERSION_TEXT_FR; - about_menu.wifi = ABOUT_WIFI_TEXT_FR; + about_menu.wifi = ABOUT_WIFI_TEXT_FR; // fan_menu.title = FAN_TEXT_FR; fan_menu.add = FAN_ADD_TEXT_FR; @@ -1364,7 +1386,7 @@ void disp_language_init() // language_menu.title = LANGUAGE_TEXT_FR; - + // printing_menu.title = TITLE_PRINTING_FR; printing_menu.option = PRINTING_OPERATION_FR; @@ -1384,7 +1406,7 @@ void disp_language_init() operation_menu.more = PRINTING_MORE_FR; operation_menu.move = PRINTING_MOVE_FR; operation_menu.auto_off = AUTO_SHUTDOWN_FR; - operation_menu.manual_off = MANUAL_SHUTDOWN_FR; + operation_menu.manual_off = MANUAL_SHUTDOWN_FR; // pause_menu.title= TITLE_PAUSE_FR; pause_menu.resume = PRINTING_RESUME_FR; @@ -1406,7 +1428,7 @@ void disp_language_init() printing_more_menu.fan = FAN_TEXT_FR; printing_more_menu.auto_close = AUTO_SHUTDOWN_FR; printing_more_menu.manual = MANUAL_SHUTDOWN_FR; - printing_more_menu.speed = PRINTING_CHANGESPEED_FR; + printing_more_menu.speed = PRINTING_CHANGESPEED_FR; printing_more_menu.temp = PRINTING_TEMP_FR; //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; @@ -1417,7 +1439,7 @@ void disp_language_init() print_file_dialog_menu.retry = DIALOG_RETRY_FR; print_file_dialog_menu.stop = DIALOG_STOP_FR; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_FR; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_FR; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_FR; print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_FR; print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_FR; print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_FR; @@ -1443,7 +1465,7 @@ void disp_language_init() pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_FR; pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_FR; break; - + case LANG_ITALY: common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_IT; common_menu.text_back=BACK_TEXT_IT; @@ -1475,7 +1497,7 @@ void disp_language_init() tool_menu.leveling = TOOL_LEVELING_IT; tool_menu.autoleveling = TOOL_AUTO_LEVELING_IT; tool_menu.filament = TOOL_FILAMENT_IT; - tool_menu.more = TOOL_MORE_IT; + tool_menu.more = TOOL_MORE_IT; // preheat_menu.adjust_title = TITLE_ADJUST_IT; preheat_menu.title=TITLE_PREHEAT_IT; @@ -1496,7 +1518,7 @@ void disp_language_init() file_menu.page_down=PAGE_DOWN_TEXT_IT; file_menu.file_loading = FILE_LOADING_IT; file_menu.no_file = NO_FILE_IT; - file_menu.no_file_and_check = NO_FILE_IT;//NO_FILE_AND_CHECK_IT; + file_menu.no_file_and_check = NO_FILE_IT;//NO_FILE_AND_CHECK_IT; // extrude_menu.title=TITLE_EXTRUDE_IT; extrude_menu.in=EXTRUDER_IN_TEXT_IT; @@ -1553,7 +1575,7 @@ void disp_language_init() about_menu.title = ABOUT_TEXT_IT; about_menu.type = ABOUT_TYPE_TEXT_IT; about_menu.version = ABOUT_VERSION_TEXT_IT; - about_menu.wifi = ABOUT_WIFI_TEXT_IT; + about_menu.wifi = ABOUT_WIFI_TEXT_IT; // fan_menu.title = FAN_TEXT_IT; fan_menu.add = FAN_ADD_TEXT_IT; @@ -1577,7 +1599,7 @@ void disp_language_init() // language_menu.title = LANGUAGE_TEXT_IT; - + // printing_menu.title = TITLE_PRINTING_IT; printing_menu.option = PRINTING_OPERATION_IT; @@ -1592,7 +1614,7 @@ void disp_language_init() operation_menu.temp = PRINTING_TEMP_IT; operation_menu.fan = FAN_TEXT_IT; operation_menu.extr = PRINTING_EXTRUDER_IT; - operation_menu.speed = PRINTING_CHANGESPEED_IT; + operation_menu.speed = PRINTING_CHANGESPEED_IT; operation_menu.filament = FILAMENT_TEXT_IT; operation_menu.more = PRINTING_MORE_IT; operation_menu.move = PRINTING_MOVE_IT; @@ -1619,8 +1641,8 @@ void disp_language_init() printing_more_menu.fan = FAN_TEXT_IT; printing_more_menu.auto_close = AUTO_SHUTDOWN_IT; printing_more_menu.manual = MANUAL_SHUTDOWN_IT; - printing_more_menu.temp = PRINTING_TEMP_IT; - printing_more_menu.speed = PRINTING_CHANGESPEED_IT; + printing_more_menu.temp = PRINTING_TEMP_IT; + printing_more_menu.speed = PRINTING_CHANGESPEED_IT; //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; print_file_dialog_menu.confirm = DIALOG_CONFIRM_IT; @@ -1640,7 +1662,7 @@ void disp_language_init() //ZOFFSET zoffset_menu.title = TITLE_ZOFFSET_IT; zoffset_menu.inc = ZOFFSET_INC_IT; - zoffset_menu.dec = ZOFFSET_DEC_IT; + zoffset_menu.dec = ZOFFSET_DEC_IT; pause_msg_menu.pausing = MESSEGE_PAUSING_IT; pause_msg_menu.changing = MESSEGE_CHANGING_IT; @@ -1657,7 +1679,7 @@ void disp_language_init() pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_IT; break; -#endif +#endif default: common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_EN; common_menu.text_back=BACK_TEXT_EN; @@ -1665,7 +1687,7 @@ void disp_language_init() common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_EN; common_menu.print_special_title = PRINTING_OTHER_LANGUGE; common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; - common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; // main_menu.title=TITLE_READYPRINT_EN; main_menu.preheat=PREHEAT_TEXT_EN; @@ -1688,7 +1710,7 @@ void disp_language_init() tool_menu.leveling = TOOL_LEVELING_EN; tool_menu.autoleveling = TOOL_AUTO_LEVELING_EN; tool_menu.filament = TOOL_FILAMENT_EN; - tool_menu.more = TOOL_MORE_EN; + tool_menu.more = TOOL_MORE_EN; // preheat_menu.adjust_title = TITLE_ADJUST_EN; preheat_menu.title=TITLE_PREHEAT_EN; @@ -1709,7 +1731,7 @@ void disp_language_init() file_menu.page_down=PAGE_DOWN_TEXT_EN; file_menu.file_loading = FILE_LOADING_EN; file_menu.no_file = NO_FILE_EN; - file_menu.no_file_and_check = NO_FILE_EN;//NO_FILE_AND_CHECK_EN; + file_menu.no_file_and_check = NO_FILE_EN;//NO_FILE_AND_CHECK_EN; // extrude_menu.title=TITLE_EXTRUDE_EN; extrude_menu.in=EXTRUDER_IN_TEXT_EN; @@ -1766,7 +1788,7 @@ void disp_language_init() about_menu.title = TITLE_ABOUT_EN; about_menu.type = ABOUT_TYPE_TEXT_EN; about_menu.version = ABOUT_VERSION_TEXT_EN; - about_menu.wifi = ABOUT_WIFI_TEXT_EN; + about_menu.wifi = ABOUT_WIFI_TEXT_EN; // fan_menu.title = TITLE_FAN_EN; fan_menu.add = FAN_ADD_TEXT_EN; @@ -1791,7 +1813,7 @@ void disp_language_init() // language_menu.title = TITLE_LANGUAGE_EN; language_menu.next = PAGE_DOWN_TEXT_EN; - language_menu.up = PAGE_UP_TEXT_EN; + language_menu.up = PAGE_UP_TEXT_EN; // printing_menu.title = TITLE_PRINTING_EN; printing_menu.option = PRINTING_OPERATION_EN; @@ -1806,12 +1828,12 @@ void disp_language_init() operation_menu.temp = PRINTING_TEMP_EN; operation_menu.fan = FAN_TEXT_EN; operation_menu.extr = PRINTING_EXTRUDER_EN; - operation_menu.speed = PRINTING_CHANGESPEED_EN; + operation_menu.speed = PRINTING_CHANGESPEED_EN; operation_menu.filament= FILAMENT_TEXT_EN; operation_menu.more = PRINTING_MORE_EN; operation_menu.move = PRINTING_MOVE_EN; operation_menu.auto_off = AUTO_SHUTDOWN_EN; - operation_menu.manual_off = MANUAL_SHUTDOWN_EN; + operation_menu.manual_off = MANUAL_SHUTDOWN_EN; // pause_menu.title= TITLE_PAUSE_EN; pause_menu.resume = PRINTING_RESUME_EN; @@ -1844,7 +1866,7 @@ void disp_language_init() print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; print_file_dialog_menu.retry = DIALOG_RETRY_EN; print_file_dialog_menu.stop = DIALOG_STOP_EN; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_EN; print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_EN; print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_EN; @@ -1874,4 +1896,4 @@ void disp_language_init() } } -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h new file mode 100644 index 000000000000..80182aa031c4 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h @@ -0,0 +1,585 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +//#include "../MarlinCore.h" +#include "inc/tft_Language_en.h" +#include "inc/tft_Language_s_cn.h" +#include "inc/tft_Language_t_cn.h" +#include "inc/tft_Language_ru.h" +#include "inc/tft_Language_fr.h" +#include "inc/tft_Language_sp.h" +#include "inc/tft_Language_it.h" + +extern void disp_language_init(); + +#define LANG_SIMPLE_CHINESE 1 +#define LANG_COMPLEX_CHINESE 2 +#define LANG_ENGLISH 3 +#define LANG_JAPAN 4 +#define LANG_GERMAN 5 +#define LANG_FRENCH 6 +#define LANG_RUSSIAN 7 +#define LANG_KOREAN 8 +#define LANG_TURKISH 9 +#define LANG_SPANISH 10 +#define LANG_GREEK 11 +#define LANG_ITALY 12 +#define LANG_PORTUGUESE 13 + +#define MULTI_LANGUAGE_ENABLE 1 +#define MULTI_LANGUAGE_DISABLE 0 + +typedef struct common_menu_disp { + const char *text_back; + const char *dialog_confirm_title; + const char *close_machine_tips; + const char *unbind_printer_tips; + const char *print_special_title; + const char *pause_special_title; + const char *operate_special_title; + const char *next; + const char *previous; +} common_menu_def; +extern common_menu_def common_menu; + +typedef struct main_menu_disp { + const char *title; + const char *preheat; + const char *move; + const char *home; + const char *print; + const char *extrude; + const char *leveling; + const char *autoleveling; + const char *fan; + const char *set; + const char *tool; + const char *more; + const char *machine_para; +} main_menu_def; +extern main_menu_def main_menu; + +typedef struct preheat_menu_disp { + const char *adjust_title; + const char *title; + const char *add; + const char *dec; + const char *ext1; + const char *ext2; + const char *hotbed; + const char *off; + const char *step_1c; + const char *step_5c; + const char *step_10c; + const char *back; + + const char *value_state; + + const char *dialog_tips; + +}preheat_menu_def; +extern preheat_menu_def preheat_menu; + +typedef struct move_menu_disp { + const char *title; + const char *x_add; + const char *x_dec; + const char *y_add; + const char *y_dec; + const char *z_add; + const char *z_dec; + const char *step_001mm; + const char *step_005mm; + const char *step_01mm; + const char *step_1mm; + const char *step_10mm; + const char *back; +} move_menu_def; +extern move_menu_def move_menu; + +typedef struct home_menu_disp { + const char *title; + const char *home_all; + const char *home_x; + const char *home_y; + const char *home_z; + const char *stopmove; + const char *back; +} home_menu_def; +extern home_menu_def home_menu; + +typedef struct file_menu_disp { + const char *title; + const char *page_up; + const char *page_down; + const char *back; + + const char *file_loading; + const char *no_file; + const char *no_file_and_check; + +}file_menu_def; +extern file_menu_def file_menu; + +typedef struct extrude_menu_disp { + const char *title; + const char *in; + const char *out; + const char *ext1; + const char *ext2; + const char *step_1mm; + const char *step_5mm; + const char *step_10mm; + const char *low; + const char *normal; + const char *high; + const char *back; + + const char *count_value_mm; + const char *count_value_cm; + const char *count_value_m; + const char *temp_value; + const char *temper_text; +} extrude_menu_def; +extern extrude_menu_def extrude_menu; + +typedef struct leveling_menu_disp { + const char *title; + const char *position1; + const char *position2; + const char *position3; + const char *position4; + const char *position5; + + char *back; +} leveling_menu_def; +extern leveling_menu_def leveling_menu; + +typedef struct set_menu_disp { + const char *title; + const char *filesys; + const char *wifi; + const char *about; + const char *fan; + const char *filament; + const char *breakpoint; + const char *motoroff; + const char *motoroffXY; + const char *shutdown; + const char *language; + const char *machine_para; + const char *back; +} set_menu_def; +extern set_menu_def set_menu; + +typedef struct filesys_menu_disp { + const char *title; + const char *filesys; + const char *sd_sys; + const char *usb_sys; + const char *back; +} filesys_menu_def; +extern filesys_menu_def filesys_menu; + +typedef struct more_menu_disp { + const char *title; + const char *zoffset; + const char *back; +} more_menu_def; +extern more_menu_def more_menu; + +typedef struct wifi_menu_disp { + const char *title; + const char *ip; + const char *wifi; + const char *key; + const char *state_ap; + const char *state_sta; + const char *cloud; + const char *connected; + const char *disconnected; + const char *exception; + const char *back; + const char *reconnect; +} wifi_menu_def; +extern wifi_menu_def wifi_menu; + +typedef struct cloud_menu_disp { + const char *title; + const char *unbind; + const char *unbinding; + const char *unbinded; + const char *bind; + const char *binding; + const char *binded; + const char *disable; + const char *disconnected; + const char *back; + const char *unbind_printer_tips; +} cloud_menu_def; +extern cloud_menu_def cloud_menu; + +typedef struct about_menu_disp { + const char *title; + const char *type_name; + const char *firmware_v; + const char *type; + const char *version; + const char *wifi; + const char *type_robin; + const char *type_robin_mini; + const char *back; +} about_menu_def; +extern about_menu_def about_menu; + +typedef struct fan_menu_disp { + const char *title; + const char *add; + const char *dec; + const char *full; + const char *half; + const char *off; + const char *back; + + const char *state; + const char *state_value; +} fan_menu_def; +extern fan_menu_def fan_menu; + +typedef struct filament_menu_disp { + const char *title; + const char *in; + const char *out; + const char *ext1; + const char *ext2; + const char *back; + const char *stat_temp; + const char *ready_replace; + const char *replacing; + const char *loading; + const char *unloading; + const char *heating; + const char *complete_and_back; + const char *filament_dialog_load_heat; + const char *filament_dialog_unload_heat; + const char *filament_dialog_load_heat_confirm; + const char *filament_dialog_unload_heat_confirm; + const char *filament_dialog_loading; + const char *filament_dialog_unloading; + const char *filament_dialog_load_completed; + const char *filament_dialog_unload_completed; + const char *filament_dialog_ok; + const char *filament_dialog_back; +} filament_menu_def; +extern filament_menu_def filament_menu; + +typedef struct language_menu { + const char *title; + const char *chinese_s; + const char *chinese_t; + const char *english; + const char *russian; + const char *japan; + const char *italy; + const char *german; + const char *spanish; + const char *korean; + const char *french; + const char *brazil; + const char *portuguese; + const char *next; + const char *up; + const char *back; +} language_menu_def; +extern language_menu_def language_menu; + +typedef struct printing_menu_disp { + const char *title; + const char *option; + const char *temp1; + const char *temp2; + const char *bed_temp; + const char *fan_speed; + const char *pause; + const char *resume; + const char *stop; +} printing_menu_def; +extern printing_menu_def printing_menu; + +typedef struct operation_menu_disp { + const char *title; + const char *pause; + const char *stop; + const char *temp; + const char *fan; + const char *filament; + const char *extr; + const char *speed; + const char *move; + const char *more; + const char *auto_off; + const char *manual_off; + const char *back; + const char *babystep; +} operation_menu_def; +extern operation_menu_def operation_menu; + +typedef struct pause_menu_disp { + const char *title; + const char *resume; + const char *stop; + const char *extrude; + const char *move; + const char *filament; + const char *more; +} pause_menu_def; +extern pause_menu_def pause_menu; + +typedef struct speed_menu_disp { + const char *title; + const char *add; + const char *dec; + const char *extrude; + const char *move; + const char *step_1percent; + const char *step_5percent; + const char *step_10percent; + const char *back; + const char *move_speed; + const char *extrude_speed; +} speed_menu_def; +extern speed_menu_def speed_menu; + +typedef struct printing_more_menu_disp { + const char *title; + const char *fan; + const char *auto_close; + const char *manual; + const char *temp; + const char *speed; + const char *back; +} printing_more_menu_def; +extern printing_more_menu_def printing_more_menu; + +typedef struct dialog_menu_disp { + const char *confirm_title; + + const char *error1_repint_no_file; + const char *error2_communication_fail; + const char *error3_filename_too_long; + const char *error4_no_file; + const char *error5_check_filesys; + + const char *tip1_print_file; + const char *tip2_stop_file; +} dialog_menu_def; +extern dialog_menu_def dialog_menu; + +typedef struct print_file_dialog_disp { + const char *title; + const char *confirm; + const char *cancle; + const char *print_file; + const char *cancle_print; + const char *retry; + const char *stop; + const char *no_file_print_tips; + const char *print_from_breakpoint; + const char *file_name_too_long_error; + const char *close_machine_error; + const char *filament_no_press; + const char *print_finish; + const char *print_time; + const char *reprint; + const char *wifi_enable_tips; +} print_file_dialog_menu_def; +extern print_file_dialog_menu_def print_file_dialog_menu; + +typedef struct zoffset_menu_disp { + const char *title; + const char *inc; + const char *dec; + const char *step001; + const char *step01; + const char *step1; + const char *back; +} zoffset_menu_def; +extern zoffset_menu_def zoffset_menu; + +typedef struct tool_menu_disp { + const char *title; + const char *preheat; + const char *extrude; + const char *move; + const char *home; + const char *leveling; + const char *autoleveling; + const char *filament; + const char *more; + const char *back; +} tool_menu_def; +extern tool_menu_def tool_menu; + +typedef struct MachinePara_menu_disp { + const char *title; + const char *MachineSetting; + const char *TemperatureSetting; + const char *MotorSetting; + const char *AdvanceSetting; + //const char *back; +} MachinePara_menu_def; +extern MachinePara_menu_def MachinePara_menu; + +typedef struct MachineSettings_menu_disp { + const char *title; + const char *Machine; + const char *Stroke; + const char *HomeDir; + const char *EndStopType; + const char *filamet; + const char *leveling; + const char *back; +} MachineSettings_menu_def; +extern MachineSettings_menu_def MachineSettings_menu; + +typedef struct TemperatureSettings_menu_disp { + const char *title; + const char *nozzle; + const char *hotbed; + const char *preheat; + const char *back; +} TemperatureSettings_menu_def; +extern TemperatureSettings_menu_def TemperatureSettings_menu; + +typedef struct pause_msg_disp { + const char *pausing; + const char *changing; + const char *unload; + const char *waiting; + const char *insert; + const char *load; + const char *purge; + const char *resume; + const char *heat; + const char *heating; + const char *option; + const char *purgeMore; + const char *continuePrint; +} pause_msg_def; +extern pause_msg_def pause_msg_menu; + +/*****************************************/ +//********************************************// +//#if defined(TFT70) + // +//#elif defined(TFT35) + #define TEXT_VALUE "%d/%d" +//#endif + +#define TEXT_VALUE_T ": %d℃" +#define TEXT_VALUE_mm ": %dmm" +#define TEXT_VALUE_cm ": %dcm" +#define TEXT_VALUE_m ": %dm" + +#define TEMP_UNIT_SYBOL "%d℃" +#define FLOAT_TEMP_UNIT_SYBOL "%.1f℃" + +#define TEXT_1C "1℃" +#define TEXT_5C "5℃" +#define TEXT_10C "10℃" + +#define AXIS_X_ADD_TEXT "X+" +#define AXIS_X_DEC_TEXT "X-" +#define AXIS_Y_ADD_TEXT "Y+" +#define AXIS_Y_DEC_TEXT "Y-" +#define AXIS_Z_ADD_TEXT "Z+" +#define AXIS_Z_DEC_TEXT "Z-" +#define TEXT_001MM "0.01mm" +#define TEXT_005MM "0.05mm" +#define TEXT_01MM "0.1mm" +#define TEXT_1MM "1mm" +#define TEXT_10MM "10mm" + +#define EXTRUDE_1MM_TEXT "1mm" +#define EXTRUDE_5MM_TEXT "5mm" +#define EXTRUDE_10MM_TEXT "10mm" + +#define STEP_1PERCENT "1%" +#define STEP_5PERCENT "5%" +#define STEP_10PERCENT "10%" + +#define LANGUAGE_S_CN "简体" +#define LANGUAGE_T_CN "繁体" +#define LANGUAGE_EN "English" +#define LANGUAGE_JP "日本語" +#define LANGUAGE_GE "Deutsch" +#define LANGUAGE_FR "français" +#define LANGUAGE_IT "Italia" +#define LANGUAGE_PR "português" +#define LANGUAGE_KR "Korean" +#define LANGUAGE_BR "Brazil" +#define LANGUAGE_RU "русский" +#define LANGUAGE_SP "español" + +#define HOME_X_TEXT "X" +#define HOME_Y_TEXT "Y" +#define HOME_Z_TEXT "Z" +#define HOME_ALL_TEXT "All" +//#if defined(MKS_ROBIN_NANO) +#define ABOUT_TYPE_TEXT "MKS Robin Pro" +//#elif defined(MKS_ROBIN_MINI) +//#define ABOUT_TYPE_TEXT "MKS Robin Mini" +//#endif +#define ABOUT_VERSION_TEXT "1.0.0" +//#define ABOUT_WIFI_TEXT "WiFi:" + +#define FAN_OPEN_TEXT "100%" +#define FAN_HALF_TEXT "50%" +#define FAN_CLOSE_TEXT "0%" +//#define FAN_TIPS1_TEXT "FAN" +//#define FAN_TIPS2_TEXT "FAN\nClose" + +#define WIFI_TEXT "WIFI" +#define WIFI_IP_TEXT "IP: " +#define WIFI_NAME_TEXT "WiFi: " +#define WIFI_KEY_TEXT "Key: " +#define WIFI_STATE_AP_TEXT "State: AP" +#define WIFI_STATE_STA_TEXT "State: STA" +#define WIFI_CONNECTED_TEXT "Connected" +#define WIFI_DISCONNECTED_TEXT "Disconnected" +#define WIFI_EXCEPTION_TEXT "Exception" + +#define FILAMENT_TIPS2_TEXT "T:" + +#define DIALOG_UPLOAD_ING_EN "Uploading......" +#define DIALOG_UPLOAD_ERROR_EN "Upload error" +#define DIALOG_UPLOAD_FINISH_EN "Upload finished" +#define DIALOG_UPLOAD_SIZE_EN "Size" +#define DIALOG_UPLOAD_TIME_EN "Time" +#define DIALOG_UPLOAD_SPEED_EN "Speed" +#define DIALOG_UPDATE_WIFI_FIRMWARE_EN "Updating wifi model firmware" +#define DIALOG_UPDATE_WIFI_WEB_EN "Updating wifi model web data" + +#define ZOFFSET_STEP001 "0.01mm" +#define ZOFFSET_STEP01 "0.1mm" +#define ZOFFSET_STEP1 "1mm" diff --git a/Marlin/src/module/thermistor/thermistor_22.h b/Marlin/src/module/thermistor/thermistor_22.h index b3ef68a47e46..e9b6acbb1e34 100644 --- a/Marlin/src/module/thermistor/thermistor_22.h +++ b/Marlin/src/module/thermistor/thermistor_22.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Marlin/src/module/thermistor/thermistor_23.h b/Marlin/src/module/thermistor/thermistor_23.h index 46c025d21aaf..13918c5893cf 100644 --- a/Marlin/src/module/thermistor/thermistor_23.h +++ b/Marlin/src/module/thermistor/thermistor_23.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 195f175e3ad4185de0914c5f8603d3b90cf0d211 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 May 2020 23:49:11 -0500 Subject: [PATCH 03/18] Update platformio.ini --- platformio.ini | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/platformio.ini b/platformio.ini index ba9d95f3e191..6c13bf77abed 100644 --- a/platformio.ini +++ b/platformio.ini @@ -486,24 +486,6 @@ extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_nano.py build_flags = ${common_stm32f1.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 - -# -# MKS Robin Nano (STM32F103VET6) -# -[env:mks_robin_nano35] -platform = ststm32 -board = genericSTM32F103VE -platform_packages = tool-stm32duino -build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py - ${common.build_flags} -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 -build_unflags = -std=gnu++11 -extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_nano35.py -src_filter = ${common.default_src_filter} + -lib_deps = ${common.lib_deps} - SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip - MKS-LittlevGL=https://github.com/makerbase-mks/MKS-LittlevGL/archive/master.zip -lib_ignore = Adafruit NeoPixel, SPI - # # MKS Robin (STM32F103ZET6) # @@ -579,6 +561,23 @@ build_flags = ${common_stm32f1.build_flags} lib_ignore = ${common_stm32f1.lib_ignore} LiquidCrystal, LiquidTWI2, TMCStepper, U8glib-HAL, SoftwareSerialM +# +# MKS Robin Nano (STM32F103VET6) +# +[env:mks_robin_nano35] +platform = ststm32 +board = genericSTM32F103VE +platform_packages = tool-stm32duino +build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py + ${common.build_flags} -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 +build_unflags = -std=gnu++11 +extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_nano35.py +src_filter = ${common.default_src_filter} + +lib_deps = ${common.lib_deps} + SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip + MKS-LittlevGL=https://github.com/makerbase-mks/MKS-LittlevGL/archive/master.zip +lib_ignore = Adafruit NeoPixel, SPI + # # Malyan M200 v2 (STM32F070RB) # From dae25789c5266bd522c888bfce26cd771f5e2d6f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 1 Jun 2020 17:01:47 -0500 Subject: [PATCH 04/18] Various cleanups, more needed --- Marlin/Configuration.h | 15 +- Marlin/src/MarlinCore.cpp | 19 +- Marlin/src/inc/Conditionals_LCD.h | 8 +- .../src/lcd/extui/lib/mks_ui/draw_about.cpp | 157 +- .../extui/lib/mks_ui/draw_change_speed.cpp | 588 ++- .../src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 5 +- .../extui/lib/mks_ui/draw_error_message.cpp | 91 +- .../lcd/extui/lib/mks_ui/draw_extrusion.cpp | 674 ++- Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp | 39 +- Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp | 39 +- .../lcd/extui/lib/mks_ui/draw_language.cpp | 49 +- .../lcd/extui/lib/mks_ui/draw_manuaLevel.cpp | 54 +- .../lcd/extui/lib/mks_ui/draw_move_motor.cpp | 71 +- .../lcd/extui/lib/mks_ui/draw_opration.cpp | 61 +- .../extui/lib/mks_ui/draw_pause_message.cpp | 5 +- .../src/lcd/extui/lib/mks_ui/draw_preHeat.cpp | 103 +- .../lcd/extui/lib/mks_ui/draw_print_file.cpp | 1147 +++--- .../lcd/extui/lib/mks_ui/draw_printing.cpp | 708 ++-- .../lcd/extui/lib/mks_ui/draw_ready_print.cpp | 20 +- Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp | 34 +- Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp | 424 +- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 2328 +++++------ .../lcd/extui/lib/mks_ui/gb2312_puhui16.cpp | 140 +- .../extui/lib/mks_ui/mks_hardware_test.cpp | 1247 +++--- .../lcd/extui/lib/mks_ui/mks_hardware_test.h | 4 +- .../src/lcd/extui/lib/mks_ui/pic_manager.cpp | 4 +- .../lcd/extui/lib/mks_ui/printer_opration.cpp | 4 +- .../lib/mks_ui/tft_lvgl_configuration.cpp | 100 +- .../extui/lib/mks_ui/tft_multi_language.cpp | 3660 +++++++++-------- .../lcd/extui/lib/mks_ui/tft_multi_language.h | 1 - Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 128 +- 31 files changed, 5592 insertions(+), 6335 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 163362388351..63ab2a5ca034 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2114,10 +2114,20 @@ // //#define FSMC_GRAPHICAL_TFT +// +// TFT Little VGL UI +// +//#define TFT_LITTLE_VGL_UI + //============================================================================= //============================ Other Controllers ============================ //============================================================================= +// +// Robin nano v2.0 SPI touch screen +// +//#define SPI_GRAPHICAL_TFT + // // ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // @@ -2132,11 +2142,6 @@ #define XPT2046_Y_OFFSET 257 #endif -//If TFT_LITTLE_VGL_UI is enabled, there is no need to turn on FSMC_GRAPHICAL_TFT. -//#define TFT_LITTLE_VGL_UI -//Robin_nano_v2.0 motherboard touch screen is spi interface, you need to enable this item. -//#define SPI_GRAPHICAL_TFT - // // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index fb48fe03dbfd..c83c5419fa3c 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -60,12 +60,11 @@ #include "gcode/queue.h" #if ENABLED(TFT_LITTLE_VGL_UI) -#include "lvgl.h" -#include "lcd/extui/lib/mks_ui/inc/tft_lvgl_configuration.h" -#include "lcd/extui/lib/mks_ui/inc/draw_ui.h" + #include "lvgl.h" + #include "lcd/extui/lib/mks_ui/inc/tft_lvgl_configuration.h" + #include "lcd/extui/lib/mks_ui/inc/draw_ui.h" #endif - #if ENABLED(DIRECT_STEPPING) #include "feature/direct_stepping.h" #endif @@ -734,8 +733,8 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) { // Direct Stepping TERN_(DIRECT_STEPPING, page_manager.write_responses()); - #if ENABLED(TFT_LITTLE_VGL_UI) - LV_TASK_HANDLER(); + #if ENABLED(TFT_LITTLE_VGL_UI) + LV_TASK_HANDLER(); #endif } @@ -1153,7 +1152,7 @@ void setup() { #endif #if ENABLED(TFT_LITTLE_VGL_UI) - tft_lvgl_init(); + tft_lvgl_init(); #endif marlin_state = MF_RUNNING; @@ -1188,9 +1187,9 @@ void loop() { endstops.event_handler(); - #if ENABLED(TFT_LITTLE_VGL_UI) - printer_state_polling(); - #endif + #if ENABLED(TFT_LITTLE_VGL_UI) + printer_state_polling(); + #endif } while (ENABLED(__AVR__)); // Loop forever on slower (AVR) boards } diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index bfadc829e03f..b2addd6561ba 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -241,12 +241,8 @@ #define DOGLCD #define IS_ULTIPANEL #define DELAYED_BACKLIGHT_INIT -#endif - -#if ENABLED(SPI_GRAPHICAL_TFT) -//#define DOGLCD -//#define IS_ULTIPANEL -#define DELAYED_BACKLIGHT_INIT +#elif ENABLED(SPI_GRAPHICAL_TFT) + #define DELAYED_BACKLIGHT_INIT #endif /** diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp index ea65babfba31..5fdeb152ebd5 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp @@ -19,120 +19,111 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + #include "lv_conf.h" +#include "draw_ui.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -//#include "../MarlinCore.h" -#include "../../../../../Configuration.h" -#include "draw_ui.h" + +#include "../../../../MarlinCore.h" #include "../../../../module/temperature.h" static lv_obj_t * scr; static lv_obj_t * fw_type,*board,*fw_version; -#define ID_A_RETURN 1 - -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - switch(obj->mks_obj_id) - { - case ID_A_RETURN: - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } - break; - - } +#define ID_A_RETURN 1 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_A_RETURN: + if (event == LV_EVENT_CLICKED) { + // do nothing + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + } } +void lv_draw_about(void) { + lv_obj_t *buttonBack,*label_Back; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ABOUT_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = ABOUT_UI; + } + disp_state = ABOUT_UI; -void lv_draw_about(void) -{ - lv_obj_t *buttonBack,*label_Back; - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != ABOUT_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = ABOUT_UI; - } - disp_state = ABOUT_UI; + scr = lv_obj_create(NULL, NULL); - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - LV_IMG_DECLARE(bmp_pic); + LV_IMG_DECLARE(bmp_pic); /*Create an Image button*/ - buttonBack = lv_imgbtn_create(scr, NULL); - - #if 1 + buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_A_RETURN,"bmp_Return.bin",0); + #if 1 + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_A_RETURN, "bmp_Return.bin", 0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - - #endif + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); /*Create a label on the Image button*/ - label_Back = lv_label_create(buttonBack, NULL); - - if(gCfgItems.multiple_language !=0) - { - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - - fw_version = lv_label_create(scr, NULL); - lv_obj_set_style(fw_version, &tft_style_lable_rel); - lv_label_set_text(fw_version, "Version: V_2.0.5.3"); - lv_obj_align(fw_version, NULL, LV_ALIGN_CENTER,0, -60); - - fw_type = lv_label_create(scr, NULL); - lv_obj_set_style(fw_type, &tft_style_lable_rel); - #if (MOTHERBOARD == BOARD_MKS_ROBIN_PRO) - lv_label_set_text(fw_type, "Firmware: Robin_Pro35"); - #elif (MOTHERBOARD == BOARD_MKS_ROBIN_NANO) - lv_label_set_text(fw_type, "Firmware: Robin_Nano35"); - #endif - lv_obj_align(fw_type, NULL, LV_ALIGN_CENTER,0, -20); - - board = lv_label_create(scr, NULL); - lv_obj_set_style(board, &tft_style_lable_rel); - #if (MOTHERBOARD == BOARD_MKS_ROBIN_PRO) - lv_label_set_text(board, "Board: MKS Robin pro"); - #elif (MOTHERBOARD == BOARD_MKS_ROBIN_NANO) - lv_label_set_text(board, "Board: MKS Robin nano"); - #endif - - lv_obj_align(board, NULL, LV_ALIGN_CENTER,0, 20); + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language !=0) { + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + + fw_version = lv_label_create(scr, NULL); + lv_obj_set_style(fw_version, &tft_style_lable_rel); + lv_label_set_text(fw_version, "Version: V_2.0.5.3"); + lv_obj_align(fw_version, NULL, LV_ALIGN_CENTER,0, -60); + + fw_type = lv_label_create(scr, NULL); + lv_obj_set_style(fw_type, &tft_style_lable_rel); + #if (MOTHERBOARD == BOARD_MKS_ROBIN_PRO) + lv_label_set_text(fw_type, "Firmware: Robin_Pro35"); + #elif (MOTHERBOARD == BOARD_MKS_ROBIN_NANO) + lv_label_set_text(fw_type, "Firmware: Robin_Nano35"); + #endif + lv_obj_align(fw_type, NULL, LV_ALIGN_CENTER,0, -20); + + board = lv_label_create(scr, NULL); + lv_obj_set_style(board, &tft_style_lable_rel); + #if (MOTHERBOARD == BOARD_MKS_ROBIN_PRO) + lv_label_set_text(board, "Board: MKS Robin pro"); + #elif (MOTHERBOARD == BOARD_MKS_ROBIN_NANO) + lv_label_set_text(board, "Board: MKS Robin nano"); + #endif + + lv_obj_align(board, NULL, LV_ALIGN_CENTER,0, 20); } -void lv_clear_about() -{ - lv_obj_del(scr); +void lv_clear_about() { + lv_obj_del(scr); } -#endif + +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp index ef5573afa95f..08c5bcac8122 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp @@ -19,18 +19,19 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) +#include "../../../../MarlinCore.h" + #include "lv_conf.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -//#include "../MarlinCore.h" -#include "../../../../../Configuration.h" #include "draw_ui.h" + #include "../../../../module/temperature.h" #include "../../../../module/planner.h" @@ -39,364 +40,325 @@ static lv_obj_t * labelStep,*buttonStep,*buttonMov,*buttonExt; static lv_obj_t * labelMov,*labelExt; static lv_obj_t * printSpeedText; -#define ID_C_ADD 1 -#define ID_C_DEC 2 -#define ID_C_MOVE 3 -#define ID_C_EXT 4 -#define ID_C_STEP 5 -#define ID_C_RETURN 6 +#define ID_C_ADD 1 +#define ID_C_DEC 2 +#define ID_C_MOVE 3 +#define ID_C_EXT 4 +#define ID_C_STEP 5 +#define ID_C_RETURN 6 static uint8_t speedType; -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - switch(obj->mks_obj_id) - { - case ID_C_ADD: - if(event == LV_EVENT_CLICKED) { - - - } - else if(event == LV_EVENT_RELEASED) { - if(speedType == 0) - { - if(feedrate_percentage < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) - { - feedrate_percentage += uiCfg.stepPrintSpeed; - - } - else - { - feedrate_percentage = MAX_EXT_SPEED_PERCENT; - } - } - else if(speedType == 1) - { - if(planner.flow_percentage[0]< MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) - { - planner.flow_percentage[0] += uiCfg.stepPrintSpeed; - - } - else - { - planner.flow_percentage[0] = MAX_EXT_SPEED_PERCENT; - } - //planner.e_factor[0]= planner.flow_percentage[0]*0.01; - //planner.flow_percentage[1] = planner.flow_percentage[0]; - //planner.e_factor[1]= planner.flow_percentage[1]*0.01; - planner.refresh_e_factor(0); - if(EXTRUDERS == 2) - { - planner.flow_percentage[1] = planner.flow_percentage[0]; - planner.refresh_e_factor(1); - } - } - disp_print_speed(); - } - break; - case ID_C_DEC: - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) { - if(speedType == 0) - { - if(feedrate_percentage > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) - { - feedrate_percentage -= uiCfg.stepPrintSpeed; - } - else - { - feedrate_percentage = MIN_EXT_SPEED_PERCENT; - } - } - else if(speedType == 1) - { - if(planner.flow_percentage[0] > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) - { - planner.flow_percentage[0] -= uiCfg.stepPrintSpeed; - } - else - { - planner.flow_percentage[0] = MIN_EXT_SPEED_PERCENT; - } - //planner.e_factor[0]= planner.flow_percentage[0]*0.01; - //planner.flow_percentage[1] = planner.flow_percentage[0]; - //planner.e_factor[1]= planner.flow_percentage[1]*0.01; - planner.refresh_e_factor(0); - if(EXTRUDERS == 2) - { - planner.flow_percentage[1] = planner.flow_percentage[0]; - planner.refresh_e_factor(1); - } - } - disp_print_speed(); - } - - break; - case ID_C_MOVE: - if(event == LV_EVENT_CLICKED) { - - - } - else if(event == LV_EVENT_RELEASED) { - speedType = 0; - disp_speed_type(); - disp_print_speed(); - } - break; - case ID_C_EXT: - if(event == LV_EVENT_CLICKED) { - - - } - else if(event == LV_EVENT_RELEASED) { - speedType = 1; - disp_speed_type(); - disp_print_speed(); - } - break; - case ID_C_STEP: - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) { - if(uiCfg.stepPrintSpeed == 1) - { - uiCfg.stepPrintSpeed = 5; - } - else if(uiCfg.stepPrintSpeed == 5) - { - uiCfg.stepPrintSpeed = 10; - } - else - { - uiCfg.stepPrintSpeed = 1; - } - disp_speed_step(); - } - break; - case ID_C_RETURN: - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } - break; - - } +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_C_ADD: + if (event == LV_EVENT_CLICKED) { + + + } + else if (event == LV_EVENT_RELEASED) { + if (speedType == 0) { + if (feedrate_percentage < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) { + feedrate_percentage += uiCfg.stepPrintSpeed; + + } + else { + feedrate_percentage = MAX_EXT_SPEED_PERCENT; + } + } + else if (speedType == 1) { + if (planner.flow_percentage[0]< MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) { + planner.flow_percentage[0] += uiCfg.stepPrintSpeed; + + } + else { + planner.flow_percentage[0] = MAX_EXT_SPEED_PERCENT; + } + //planner.e_factor[0]= planner.flow_percentage[0]*0.01; + //planner.flow_percentage[1] = planner.flow_percentage[0]; + //planner.e_factor[1]= planner.flow_percentage[1]*0.01; + planner.refresh_e_factor(0); + if (EXTRUDERS == 2) { + planner.flow_percentage[1] = planner.flow_percentage[0]; + planner.refresh_e_factor(1); + } + } + disp_print_speed(); + } + break; + case ID_C_DEC: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (speedType == 0) { + if (feedrate_percentage > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) { + feedrate_percentage -= uiCfg.stepPrintSpeed; + } + else { + feedrate_percentage = MIN_EXT_SPEED_PERCENT; + } + } + else if (speedType == 1) { + if (planner.flow_percentage[0] > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) { + planner.flow_percentage[0] -= uiCfg.stepPrintSpeed; + } + else { + planner.flow_percentage[0] = MIN_EXT_SPEED_PERCENT; + } + //planner.e_factor[0]= planner.flow_percentage[0]*0.01; + //planner.flow_percentage[1] = planner.flow_percentage[0]; + //planner.e_factor[1]= planner.flow_percentage[1]*0.01; + planner.refresh_e_factor(0); + if (EXTRUDERS == 2) { + planner.flow_percentage[1] = planner.flow_percentage[0]; + planner.refresh_e_factor(1); + } + } + disp_print_speed(); + } + + break; + case ID_C_MOVE: + if (event == LV_EVENT_CLICKED) { + + + } + else if (event == LV_EVENT_RELEASED) { + speedType = 0; + disp_speed_type(); + disp_print_speed(); + } + break; + case ID_C_EXT: + if (event == LV_EVENT_CLICKED) { + + + } + else if (event == LV_EVENT_RELEASED) { + speedType = 1; + disp_speed_type(); + disp_print_speed(); + } + break; + case ID_C_STEP: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (uiCfg.stepPrintSpeed == 1) { + uiCfg.stepPrintSpeed = 5; + } + else if (uiCfg.stepPrintSpeed == 5) { + uiCfg.stepPrintSpeed = 10; + } + else { + uiCfg.stepPrintSpeed = 1; + } + disp_speed_step(); + } + break; + case ID_C_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + + } } -void lv_draw_change_speed(void) -{ - lv_obj_t *buttonAdd,*buttonDec; - lv_obj_t *buttonBack; +void lv_draw_change_speed(void) { + lv_obj_t *buttonAdd,*buttonDec; + lv_obj_t *buttonBack; - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != CHANGE_SPEED_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = CHANGE_SPEED_UI; - } - disp_state = CHANGE_SPEED_UI; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != CHANGE_SPEED_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = CHANGE_SPEED_UI; + } + disp_state = CHANGE_SPEED_UI; - scr = lv_obj_create(NULL, NULL); + scr = lv_obj_create(NULL, NULL); - lv_obj_set_style(scr, &tft_style_scr); + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - LV_IMG_DECLARE(bmp_pic); + LV_IMG_DECLARE(bmp_pic); /*Create an Image button*/ buttonAdd = lv_imgbtn_create(scr, NULL); - buttonDec = lv_imgbtn_create(scr, NULL); - buttonMov = lv_imgbtn_create(scr, NULL); - buttonExt = lv_imgbtn_create(scr, NULL); - buttonStep = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonAdd, event_handler,ID_C_ADD,"bmp_Add.bin",0); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); - #if 1 - lv_obj_set_event_cb_mks(buttonDec, event_handler,ID_C_DEC,"bmp_Dec.bin",0); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); + buttonDec = lv_imgbtn_create(scr, NULL); + buttonMov = lv_imgbtn_create(scr, NULL); + buttonExt = lv_imgbtn_create(scr, NULL); + buttonStep = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonAdd, event_handler,ID_C_ADD,"bmp_Add.bin",0); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonDec, event_handler,ID_C_DEC,"bmp_Dec.bin",0); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_C_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_C_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - #endif + #endif - lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttonMov,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonExt,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonStep,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonMov,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonExt,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonStep,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); /*Create a label on the Image button*/ - lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonMov, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonExt, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonMov, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonExt, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); - lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); - labelMov = lv_label_create(buttonMov, NULL); - labelExt = lv_label_create(buttonExt, NULL); - labelStep = lv_label_create(buttonStep, NULL); - lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - - if(gCfgItems.multiple_language !=0) - { - lv_label_set_text(labelAdd, speed_menu.add); - lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelDec, speed_menu.dec); - lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - disp_speed_type(); - disp_speed_step(); - - printSpeedText = lv_label_create(scr, NULL); - lv_obj_set_style(printSpeedText, &tft_style_lable_rel); - disp_print_speed(); -} + lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); + labelMov = lv_label_create(buttonMov, NULL); + labelExt = lv_label_create(buttonExt, NULL); + labelStep = lv_label_create(buttonStep, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); -void disp_speed_step() -{ - if(uiCfg.stepPrintSpeed == 1) - { - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step1_percent.bin",0); - } - else if(uiCfg.stepPrintSpeed == 5) - { - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step5_percent.bin",0); - } - else if(uiCfg.stepPrintSpeed == 10) - { - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step10_percent.bin",0); - } - - if(gCfgItems.multiple_language != 0) - { - if(uiCfg.stepPrintSpeed == 1) - { - lv_label_set_text(labelStep, speed_menu.step_1percent); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - else if(uiCfg.stepPrintSpeed == 5) - { - lv_label_set_text(labelStep, speed_menu.step_5percent); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - else if(uiCfg.stepPrintSpeed == 10) - { - lv_label_set_text(labelStep, speed_menu.step_10percent); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - } -} -void disp_print_speed() -{ - char buf[30] = {0}; - - public_buf_l[0] = '\0'; - - if(speedType == 0) //move - { - strcat(public_buf_l,speed_menu.move_speed); - strcat(public_buf_l,": "); - sprintf(buf, "%d%%", feedrate_percentage); - strcat(public_buf_l,buf); - } - else if(speedType == 1) // e1 - { - strcat(public_buf_l,speed_menu.extrude_speed); - strcat(public_buf_l,": "); - sprintf(buf, "%d%%", planner.flow_percentage[0]); - strcat(public_buf_l,buf); - } - lv_label_set_text(printSpeedText, public_buf_l); - lv_obj_align(printSpeedText, NULL, LV_ALIGN_CENTER,0, -65); + if (gCfgItems.multiple_language !=0) { + lv_label_set_text(labelAdd, speed_menu.add); + lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelDec, speed_menu.dec); + lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + disp_speed_type(); + disp_speed_step(); + + printSpeedText = lv_label_create(scr, NULL); + lv_obj_set_style(printSpeedText, &tft_style_lable_rel); + disp_print_speed(); } -void disp_speed_type() -{ - switch(speedType) - { - case 1: - lv_obj_set_event_cb_mks(buttonExt, event_handler,ID_C_EXT,"bmp_Extruct_speed_sel.bin",0); - lv_obj_set_event_cb_mks(buttonMov, event_handler,ID_C_MOVE,"bmp_Mov_speed.bin",0); - break; - - default: - lv_obj_set_event_cb_mks(buttonExt, event_handler,ID_C_EXT,"bmp_Extruct_speed.bin",0); - lv_obj_set_event_cb_mks(buttonMov, event_handler,ID_C_MOVE,"bmp_Mov_speed_sel.bin",0); - break; - } - lv_obj_refresh_ext_draw_pad(buttonExt); - lv_obj_refresh_ext_draw_pad(buttonMov); - - if(gCfgItems.multiple_language != 0) - { - lv_label_set_text(labelMov, speed_menu.move); - lv_obj_align(labelMov, buttonMov, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelExt, speed_menu.extrude); - lv_obj_align(labelExt, buttonExt, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } +void disp_speed_step() { + if (uiCfg.stepPrintSpeed == 1) { + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step1_percent.bin",0); + } + else if (uiCfg.stepPrintSpeed == 5) { + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step5_percent.bin",0); + } + else if (uiCfg.stepPrintSpeed == 10) { + lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step10_percent.bin",0); + } + + if (gCfgItems.multiple_language != 0) { + if (uiCfg.stepPrintSpeed == 1) { + lv_label_set_text(labelStep, speed_menu.step_1percent); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else if (uiCfg.stepPrintSpeed == 5) { + lv_label_set_text(labelStep, speed_menu.step_5percent); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else if (uiCfg.stepPrintSpeed == 10) { + lv_label_set_text(labelStep, speed_menu.step_10percent); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } +} +void disp_print_speed() { + char buf[30] = {0}; + + public_buf_l[0] = '\0'; + + if (speedType == 0) { //move + strcat(public_buf_l,speed_menu.move_speed); + strcat(public_buf_l,": "); + sprintf(buf, "%d%%", feedrate_percentage); + strcat(public_buf_l,buf); + } + else if (speedType == 1) { // e1 + strcat(public_buf_l,speed_menu.extrude_speed); + strcat(public_buf_l,": "); + sprintf(buf, "%d%%", planner.flow_percentage[0]); + strcat(public_buf_l,buf); + } + lv_label_set_text(printSpeedText, public_buf_l); + lv_obj_align(printSpeedText, NULL, LV_ALIGN_CENTER,0, -65); } +void disp_speed_type() { + switch (speedType) { + case 1: + lv_obj_set_event_cb_mks(buttonExt, event_handler,ID_C_EXT,"bmp_Extruct_speed_sel.bin",0); + lv_obj_set_event_cb_mks(buttonMov, event_handler,ID_C_MOVE,"bmp_Mov_speed.bin",0); + break; + + default: + lv_obj_set_event_cb_mks(buttonExt, event_handler,ID_C_EXT,"bmp_Extruct_speed.bin",0); + lv_obj_set_event_cb_mks(buttonMov, event_handler,ID_C_MOVE,"bmp_Mov_speed_sel.bin",0); + break; + } + lv_obj_refresh_ext_draw_pad(buttonExt); + lv_obj_refresh_ext_draw_pad(buttonMov); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelMov, speed_menu.move); + lv_obj_align(labelMov, buttonMov, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelExt, speed_menu.extrude); + lv_obj_align(labelExt, buttonExt, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } +} -void lv_clear_change_speed() -{ - lv_obj_del(scr); +void lv_clear_change_speed() { + lv_obj_del(scr); } #endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp index 07270871d1b6..a1fb5dbefb50 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -19,16 +19,17 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) +#include "../../../../MarlinCore.h" + #include "lv_conf.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -//#include "../MarlinCore.h" #include "draw_ui.h" #include "../../../../sd/cardreader.h" #include "../../../../gcode/queue.h" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp index 0ddf6ea11a67..1a19617fa82f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp @@ -19,71 +19,68 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + #include "lv_conf.h" +#include "draw_ui.h" +#include "tft_lvgl_configuration.h" +#include "mks_hardware_test.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -//#include "../MarlinCore.h" -#include "../../../../../Configuration.h" -#include "tft_lvgl_configuration.h" -#include "mks_hardware_test.h" -#include "draw_ui.h" + +#include "../../../../MarlinCore.h" static lv_obj_t * scr; -void lv_draw_error_message(PGM_P const msg) -{ - #if 0 - static lv_obj_t * message=NULL,*kill_message=NULL,*reset_tips=NULL; - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != ERROR_MESSAGE_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = ERROR_MESSAGE_UI; - } - disp_state = ERROR_MESSAGE_UI; +void lv_draw_error_message(PGM_P const msg) { + #if 0 + static lv_obj_t * message=NULL,*kill_message=NULL,*reset_tips=NULL; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ERROR_MESSAGE_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = ERROR_MESSAGE_UI; + } + disp_state = ERROR_MESSAGE_UI; - scr = lv_obj_create(NULL, NULL); + scr = lv_obj_create(NULL, NULL); - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); - lv_refr_now(lv_refr_get_disp_refreshing()); + lv_refr_now(lv_refr_get_disp_refreshing()); - if(msg) - { - message = lv_label_create(scr, NULL); - lv_obj_set_style(message, &tft_style_lable_rel); - lv_label_set_text(message, msg); - lv_obj_align(message, NULL, LV_ALIGN_CENTER,0, -50); - } + if (msg) { + message = lv_label_create(scr, NULL); + lv_obj_set_style(message, &tft_style_lable_rel); + lv_label_set_text(message, msg); + lv_obj_align(message, NULL, LV_ALIGN_CENTER,0, -50); + } - kill_message = lv_label_create(scr, NULL); - lv_obj_set_style(kill_message, &tft_style_lable_rel); - lv_label_set_text(kill_message, "PRINTER HALTED"); - lv_obj_align(kill_message, NULL, LV_ALIGN_CENTER,0, -10); + kill_message = lv_label_create(scr, NULL); + lv_obj_set_style(kill_message, &tft_style_lable_rel); + lv_label_set_text(kill_message, "PRINTER HALTED"); + lv_obj_align(kill_message, NULL, LV_ALIGN_CENTER,0, -10); - reset_tips = lv_label_create(scr, NULL); - lv_obj_set_style(reset_tips, &tft_style_lable_rel); - lv_label_set_text(reset_tips, "Please Reset"); - lv_obj_align(reset_tips, NULL, LV_ALIGN_CENTER,0, 30); + reset_tips = lv_label_create(scr, NULL); + lv_obj_set_style(reset_tips, &tft_style_lable_rel); + lv_label_set_text(reset_tips, "Please Reset"); + lv_obj_align(reset_tips, NULL, LV_ALIGN_CENTER,0, 30); - lv_task_handler(); - #endif - LCD_Clear(0x0000); - if(msg) - disp_string((TFT_WIDTH-strlen(msg)*16)/2,100,msg,0xffff,0x0000); - disp_string((TFT_WIDTH-strlen("PRINTER HALTED")*16)/2,140,"PRINTER HALTED",0xffff,0x0000); - disp_string((TFT_WIDTH-strlen("Please Reset")*16)/2,180,"Please Reset",0xffff,0x0000); + lv_task_handler(); + #endif + LCD_Clear(0x0000); + if (msg) disp_string((TFT_WIDTH - strlen(msg) * 16) / 2, 100, msg, 0xFFFF, 0x0000); + disp_string((TFT_WIDTH-strlen("PRINTER HALTED") * 16) / 2, 140, "PRINTER HALTED", 0xFFFF, 0x0000); + disp_string((TFT_WIDTH-strlen("Please Reset") * 16) / 2, 180, "Please Reset", 0xFFFF, 0x0000); } -void lv_clear_error_message() -{ - lv_obj_del(scr); +void lv_clear_error_message() { + lv_obj_del(scr); } -#endif + +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp index 66a59146a272..877947dad1e6 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp @@ -19,16 +19,18 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + #include "lv_conf.h" +#include "draw_ui.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -//#include "../MarlinCore.h" -#include "draw_ui.h" + +#include "../../../../MarlinCore.h" #include "../../../../module/temperature.h" #include "../../../../gcode/queue.h" @@ -40,421 +42,333 @@ static lv_obj_t * labelSpeed; static lv_obj_t * tempText; static lv_obj_t * ExtruText; -#define ID_E_ADD 1 -#define ID_E_DEC 2 -#define ID_E_TYPE 3 -#define ID_E_STEP 4 -#define ID_E_SPEED 5 -#define ID_E_RETURN 6 +#define ID_E_ADD 1 +#define ID_E_DEC 2 +#define ID_E_TYPE 3 +#define ID_E_STEP 4 +#define ID_E_SPEED 5 +#define ID_E_RETURN 6 static int32_t extructAmount; -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - switch(obj->mks_obj_id) - { - case ID_E_ADD: - if(event == LV_EVENT_CLICKED) { - - - } - else if(event == LV_EVENT_RELEASED) { - if(thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius>= EXTRUDE_MINTEMP) - { - queue.enqueue_one_now(PSTR("G91")); - memset(public_buf_l,0,sizeof(public_buf_l)); - sprintf((char *)public_buf_l, "G1 E%d F%d", uiCfg.extruStep, 60 * uiCfg.extruSpeed); - queue.enqueue_one_now(PSTR(public_buf_l)); - queue.enqueue_one_now(PSTR("G90")); - - extructAmount += uiCfg.extruStep; - disp_extru_amount(); - } - } - break; - case ID_E_DEC: - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) { - if(thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius>= EXTRUDE_MINTEMP) - { - queue.enqueue_one_now(PSTR("G91")); - memset(public_buf_l,0,sizeof(public_buf_l)); - sprintf((char *)public_buf_l, "G1 E%d F%d", 0-uiCfg.extruStep, 60 * uiCfg.extruSpeed); - queue.enqueue_one_now(PSTR(public_buf_l)); - queue.enqueue_one_now(PSTR("G90")); - extructAmount -= uiCfg.extruStep; - disp_extru_amount(); - } - } - - break; - case ID_E_TYPE: - if(event == LV_EVENT_CLICKED) { - - - } - else if(event == LV_EVENT_RELEASED) { - if(EXTRUDERS == 2) - { - if(uiCfg.curSprayerChoose == 0) - { - uiCfg.curSprayerChoose = 1; - queue.inject_P(PSTR("T1")); - } - else - { - uiCfg.curSprayerChoose = 0; - queue.inject_P(PSTR("T0")); - } - } - else - { - uiCfg.curSprayerChoose = 0; - } - - extructAmount = 0; - disp_hotend_temp(); - - disp_ext_type(); - - disp_extru_amount(); - } - break; - case ID_E_STEP: - if(event == LV_EVENT_CLICKED) { - - - } - else if(event == LV_EVENT_RELEASED) { - switch(abs(uiCfg.extruStep)) - { - case 1: - uiCfg.extruStep = 5; - break; - - case 5: - uiCfg.extruStep = 10; - break; - - case 10: - uiCfg.extruStep = 1; - break; - - default: - break; - } - disp_ext_step(); - } - break; - case ID_E_SPEED: - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) { - switch(uiCfg.extruSpeed) - { - case 1: - uiCfg.extruSpeed = 10; - break; - - case 10: - uiCfg.extruSpeed = 20; - break; - - case 20: - uiCfg.extruSpeed = 1; - break; - - default: - break; - } - disp_ext_speed(); - } - break; - case ID_E_RETURN: - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } - break; - - } +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_E_ADD: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) { + queue.enqueue_one_now(PSTR("G91")); + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf((char *)public_buf_l, "G1 E%d F%d", uiCfg.extruStep, 60 * uiCfg.extruSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + extructAmount += uiCfg.extruStep; + disp_extru_amount(); + } + } + break; + case ID_E_DEC: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius>= EXTRUDE_MINTEMP) { + queue.enqueue_one_now(PSTR("G91")); + memset(public_buf_l,0,sizeof(public_buf_l)); + sprintf((char *)public_buf_l, "G1 E%d F%d", 0-uiCfg.extruStep, 60 * uiCfg.extruSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + extructAmount -= uiCfg.extruStep; + disp_extru_amount(); + } + } + break; + case ID_E_TYPE: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (EXTRUDERS == 2) { + if (uiCfg.curSprayerChoose == 0) { + uiCfg.curSprayerChoose = 1; + queue.inject_P(PSTR("T1")); + } + else { + uiCfg.curSprayerChoose = 0; + queue.inject_P(PSTR("T0")); + } + } + else { + uiCfg.curSprayerChoose = 0; + } + extructAmount = 0; + disp_hotend_temp(); + disp_ext_type(); + disp_extru_amount(); + } + break; + case ID_E_STEP: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + switch (abs(uiCfg.extruStep)) { + case 1: uiCfg.extruStep = 5; break; + case 5: uiCfg.extruStep = 10; break; + case 10: uiCfg.extruStep = 1; break; + default: break; + } + disp_ext_step(); + } + break; + case ID_E_SPEED: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + switch (uiCfg.extruSpeed) { + case 1: uiCfg.extruSpeed = 10; break; + case 10: uiCfg.extruSpeed = 20; break; + case 20: uiCfg.extruSpeed = 1; break; + default: break; + } + disp_ext_speed(); + } + break; + case ID_E_RETURN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + } } -void lv_draw_extrusion(void) -{ - lv_obj_t *buttonAdd,*buttonDec,*buttonBack; +void lv_draw_extrusion(void) { + lv_obj_t *buttonAdd,*buttonDec,*buttonBack; - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != EXTRUSION_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = EXTRUSION_UI; - } - disp_state = EXTRUSION_UI; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != EXTRUSION_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = EXTRUSION_UI; + } + disp_state = EXTRUSION_UI; - scr = lv_obj_create(NULL, NULL); + scr = lv_obj_create(NULL, NULL); - lv_obj_set_style(scr, &tft_style_scr); + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - LV_IMG_DECLARE(bmp_pic); - - /*Create an Image button*/ - buttonAdd = lv_imgbtn_create(scr, NULL); - buttonDec = lv_imgbtn_create(scr, NULL); - buttoType = lv_imgbtn_create(scr, NULL); - buttonStep = lv_imgbtn_create(scr, NULL); - buttonSpeed = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonAdd, event_handler,ID_E_ADD,"bmp_In.bin",0); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); - #if 1 - lv_obj_set_event_cb_mks(buttonDec, event_handler,ID_E_DEC,"bmp_Out.bin",0); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); - + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonAdd = lv_imgbtn_create(scr, NULL); + buttonDec = lv_imgbtn_create(scr, NULL); + buttoType = lv_imgbtn_create(scr, NULL); + buttonStep = lv_imgbtn_create(scr, NULL); + buttonSpeed = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonAdd, event_handler,ID_E_ADD,"bmp_In.bin",0); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); + + #if 1 + lv_obj_set_event_cb_mks(buttonDec, event_handler,ID_E_DEC,"bmp_Out.bin",0); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttoType, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttoType, LV_BTN_STATE_REL, &tft_style_lable_rel); - + lv_imgbtn_set_style(buttoType, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttoType, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_E_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_E_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - - #endif - - lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttoType,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonStep,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonSpeed,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - - /*Create a label on the Image button*/ - lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); - lv_btn_set_layout(buttoType, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonSpeed, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); - lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); - labelType = lv_label_create(buttoType, NULL); - labelStep = lv_label_create(buttonStep, NULL); - labelSpeed = lv_label_create(buttonSpeed, NULL); - lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - - if(gCfgItems.multiple_language !=0) - { - lv_label_set_text(labelAdd, extrude_menu.in); - lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelDec, extrude_menu.out); - lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - - disp_ext_type(); - disp_ext_step(); - disp_ext_speed(); - - tempText = lv_label_create(scr, NULL); - lv_obj_set_style(tempText, &tft_style_lable_rel); - disp_hotend_temp(); - - ExtruText = lv_label_create(scr, NULL); - lv_obj_set_style(ExtruText, &tft_style_lable_rel); - disp_extru_amount(); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif + + lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttoType,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonStep,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonSpeed,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); + lv_btn_set_layout(buttoType, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonSpeed, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); + lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); + labelType = lv_label_create(buttoType, NULL); + labelStep = lv_label_create(buttonStep, NULL); + labelSpeed = lv_label_create(buttonSpeed, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelAdd, extrude_menu.in); + lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelDec, extrude_menu.out); + lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + + disp_ext_type(); + disp_ext_step(); + disp_ext_speed(); + + tempText = lv_label_create(scr, NULL); + lv_obj_set_style(tempText, &tft_style_lable_rel); + disp_hotend_temp(); + + ExtruText = lv_label_create(scr, NULL); + lv_obj_set_style(ExtruText, &tft_style_lable_rel); + disp_extru_amount(); } -void disp_ext_type() -{ - if(uiCfg.curSprayerChoose == 1) - { - lv_obj_set_event_cb_mks(buttoType, event_handler,ID_E_TYPE,"bmp_Extru2.bin",0); - if(gCfgItems.multiple_language != 0) - { - lv_label_set_text(labelType, extrude_menu.ext2); - lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - } - else - { - lv_obj_set_event_cb_mks(buttoType, event_handler,ID_E_TYPE,"bmp_Extru1.bin",0); - if(gCfgItems.multiple_language != 0) - { - lv_label_set_text(labelType, extrude_menu.ext1); - lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - } +void disp_ext_type() { + if (uiCfg.curSprayerChoose == 1) { + lv_obj_set_event_cb_mks(buttoType, event_handler,ID_E_TYPE,"bmp_Extru2.bin",0); + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelType, extrude_menu.ext2); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } + else { + lv_obj_set_event_cb_mks(buttoType, event_handler,ID_E_TYPE,"bmp_Extru1.bin",0); + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelType, extrude_menu.ext1); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } } -void disp_ext_speed() -{ - if(uiCfg.extruSpeed == 20) - lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_high.bin",0); - else if(uiCfg.extruSpeed == 1) - lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_slow.bin",0); - else - lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_normal.bin",0); - - if(gCfgItems.multiple_language != 0) - { - if(uiCfg.extruSpeed == 20) - { - lv_label_set_text(labelSpeed, extrude_menu.high); - lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - else if(uiCfg.extruSpeed == 1) - { - lv_label_set_text(labelSpeed, extrude_menu.low); - lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - else - { - lv_label_set_text(labelSpeed, extrude_menu.normal); - lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - } +void disp_ext_speed() { + if (uiCfg.extruSpeed == 20) + lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_high.bin",0); + else if (uiCfg.extruSpeed == 1) + lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_slow.bin",0); + else + lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_normal.bin",0); + + if (gCfgItems.multiple_language != 0) { + if (uiCfg.extruSpeed == 20) { + lv_label_set_text(labelSpeed, extrude_menu.high); + lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else if (uiCfg.extruSpeed == 1) { + lv_label_set_text(labelSpeed, extrude_menu.low); + lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else { + lv_label_set_text(labelSpeed, extrude_menu.normal); + lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } } -void disp_hotend_temp() -{ - char buf[20] = {0}; - - public_buf_l[0] = '\0'; - - strcat(public_buf_l,extrude_menu.temper_text); - - sprintf(buf, extrude_menu.temp_value, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); - - - strcat(public_buf_l,buf); - lv_label_set_text(tempText, public_buf_l); - lv_obj_align(tempText, NULL, LV_ALIGN_CENTER,0, -50); +void disp_hotend_temp() { + char buf[20] = {0}; + public_buf_l[0] = '\0'; + strcat(public_buf_l,extrude_menu.temper_text); + sprintf(buf, extrude_menu.temp_value, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); + strcat(public_buf_l,buf); + lv_label_set_text(tempText, public_buf_l); + lv_obj_align(tempText, NULL, LV_ALIGN_CENTER,0, -50); } -void disp_extru_amount() -{ - char buf1[10] = {0}; - - public_buf_l[0] = '\0'; - - if(extructAmount < 999 && extructAmount > -99) - { - sprintf(buf1, extrude_menu.count_value_mm, extructAmount); - if(uiCfg.curSprayerChoose<1) - { - strcat(public_buf_l,extrude_menu.ext1); - } - else - { - strcat(public_buf_l,extrude_menu.ext2); - } - strcat(public_buf_l,buf1); - } - else if(extructAmount < 9999 && extructAmount > -999) - { - sprintf(buf1, extrude_menu.count_value_cm, extructAmount/10); - if(uiCfg.curSprayerChoose<1) - { - strcat(public_buf_l,extrude_menu.ext1); - } - else - { - strcat(public_buf_l,extrude_menu.ext2); - } - strcat(public_buf_l,buf1); - } - else - { - sprintf(buf1, extrude_menu.count_value_m, extructAmount/1000); - if(uiCfg.curSprayerChoose<1) - { - strcat(public_buf_l,extrude_menu.ext1); - } - else - { - strcat(public_buf_l,extrude_menu.ext2); - } - strcat(public_buf_l,buf1); - } - - lv_label_set_text(ExtruText, public_buf_l); - lv_obj_align(ExtruText, NULL, LV_ALIGN_CENTER,0, -75); +void disp_extru_amount() { + char buf1[10] = {0}; + + public_buf_l[0] = '\0'; + + if (extructAmount < 999 && extructAmount > -99) { + sprintf(buf1, extrude_menu.count_value_mm, extructAmount); + if (uiCfg.curSprayerChoose < 1) + strcat(public_buf_l, extrude_menu.ext1); + else + strcat(public_buf_l, extrude_menu.ext2); + strcat(public_buf_l, buf1); + } + else if (extructAmount < 9999 && extructAmount > -999) { + sprintf(buf1, extrude_menu.count_value_cm, extructAmount/10); + if (uiCfg.curSprayerChoose < 1) + strcat(public_buf_l, extrude_menu.ext1); + else + strcat(public_buf_l, extrude_menu.ext2); + strcat(public_buf_l,buf1); + } + else { + sprintf(buf1, extrude_menu.count_value_m, extructAmount/1000); + if (uiCfg.curSprayerChoose < 1) + strcat(public_buf_l, extrude_menu.ext1); + else + strcat(public_buf_l, extrude_menu.ext2); + strcat(public_buf_l,buf1); + } + + lv_label_set_text(ExtruText, public_buf_l); + lv_obj_align(ExtruText, NULL, LV_ALIGN_CENTER,0, -75); } -void disp_ext_step() -{ - if(uiCfg.extruStep == 1) - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_E_STEP,"bmp_Step1_mm.bin",0); - else if(uiCfg.extruStep == 5) - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_E_STEP,"bmp_Step5_mm.bin",0); - else if(uiCfg.extruStep == 10) - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_E_STEP,"bmp_Step10_mm.bin",0); - - if(gCfgItems.multiple_language != 0) - { - if(uiCfg.extruStep == 1) - { - lv_label_set_text(labelStep, extrude_menu.step_1mm); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - else if(uiCfg.extruStep == 5) - { - lv_label_set_text(labelStep, extrude_menu.step_5mm); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - else if(uiCfg.extruStep == 10) - { - lv_label_set_text(labelStep, extrude_menu.step_10mm); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - } +void disp_ext_step() { + if (uiCfg.extruStep == 1) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_E_STEP, "bmp_Step1_mm.bin", 0); + else if (uiCfg.extruStep == 5) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_E_STEP, "bmp_Step5_mm.bin", 0); + else if (uiCfg.extruStep == 10) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_E_STEP, "bmp_Step10_mm.bin", 0); + + if (gCfgItems.multiple_language != 0) { + if (uiCfg.extruStep == 1) { + lv_label_set_text(labelStep, extrude_menu.step_1mm); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else if (uiCfg.extruStep == 5) { + lv_label_set_text(labelStep, extrude_menu.step_5mm); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else if (uiCfg.extruStep == 10) { + lv_label_set_text(labelStep, extrude_menu.step_10mm); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + } } -void lv_clear_extrusion() -{ - lv_obj_del(scr); +void lv_clear_extrusion() { + lv_obj_del(scr); } -#endif + +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp index 06f43f39fda5..ed01de600b16 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp @@ -19,15 +19,16 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + +#include "../../../../MarlinCore.h" #include "lv_conf.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -//#include "../MarlinCore.h" #include "../../../../../Configuration.h" #include "draw_ui.h" #include "../../../../module/temperature.h" @@ -47,16 +48,16 @@ static uint8_t fanSpeed; static void event_handler(lv_obj_t * obj, lv_event_t event) { - switch(obj->mks_obj_id) + switch (obj->mks_obj_id) { case ID_F_ADD: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { - if(fanSpeed + 1 <= 255) + if (fanSpeed + 1 <= 255) { fanSpeed++; memset(public_buf_l,0,sizeof(public_buf_l)); @@ -66,11 +67,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_F_DEC: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(fanSpeed > 0) + else if (event == LV_EVENT_RELEASED) { + if (fanSpeed > 0) { fanSpeed--; memset(public_buf_l,0,sizeof(public_buf_l)); @@ -81,36 +82,36 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_F_HIGH: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { queue.enqueue_one_now(PSTR("M106 S255")); } break; case ID_F_MID: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { queue.enqueue_one_now(PSTR("M106 S127")); } break; case ID_F_OFF: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { queue.enqueue_one_now(PSTR("M107")); } break; case ID_F_RETURN: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { clear_cur_ui(); draw_return_ui(); } @@ -125,7 +126,7 @@ void lv_draw_fan(void) lv_obj_t *buttonAdd,*buttonDec,*buttonHigh,*buttonMid; lv_obj_t *buttonOff,*buttonBack; - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != FAN_UI) + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != FAN_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = FAN_UI; @@ -219,7 +220,7 @@ void lv_draw_fan(void) lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - if(gCfgItems.multiple_language !=0) + if (gCfgItems.multiple_language !=0) { lv_label_set_text(labelAdd, fan_menu.add); lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp index 6d0f6f206997..792c1afe9c37 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp @@ -19,9 +19,11 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + +#include "../../../../MarlinCore.h" #include "draw_ready_print.h" #include "draw_set.h" #include "lv_conf.h" @@ -29,7 +31,6 @@ //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -//#include "../MarlinCore.h" #include "draw_ui.h" #include "../../../../gcode/queue.h" @@ -45,67 +46,67 @@ static lv_obj_t * scr; static void event_handler(lv_obj_t * obj, lv_event_t event) { - switch(obj->mks_obj_id) + switch (obj->mks_obj_id) { case ID_H_ALL: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { queue.inject_P(PSTR("G28")); } break; case ID_H_X: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { queue.inject_P(PSTR("G28 X0")); } break; case ID_H_Y: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { queue.inject_P(PSTR("G28 Y0")); } break; case ID_H_Z: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { queue.inject_P(PSTR("G28 Z0")); } break; case ID_H_OFF_ALL: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { queue.inject_P(PSTR("M84")); } break; case ID_H_OFF_XY: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { queue.inject_P(PSTR("M84 X Y")); } break; case ID_H_RETURN: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { lv_obj_del(scr); lv_draw_tool(); } @@ -121,7 +122,7 @@ void lv_draw_home(void) lv_obj_t *buttonBack; lv_obj_t *buttonOffAll,*buttonOffXY; - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != ZERO_UI) + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ZERO_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = ZERO_UI; @@ -252,7 +253,7 @@ void lv_draw_home(void) lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - if(gCfgItems.multiple_language !=0) + if (gCfgItems.multiple_language !=0) { //lv_label_set_text(labelWifi, set_menu.wifi); //lv_obj_align(labelWifi, buttonWifi, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp index 39117f2fe040..1ae937059446 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp @@ -19,15 +19,16 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + +#include "../../../../MarlinCore.h" #include "lv_conf.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -//#include "../MarlinCore.h" #include "draw_ui.h" #include @@ -57,14 +58,14 @@ static lv_obj_t *buttonES,*buttonFR,*buttonIT,*buttonBack; static void event_handler(lv_obj_t * obj, lv_event_t event) { - switch(obj->mks_obj_id) + switch (obj->mks_obj_id) { case ID_CN: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language,UNSELECTED); lv_obj_set_event_cb_mks(buttonCN, event_handler,ID_CN,"bmp_Simple_cn_sel.bin",0); gCfgItems.language = LANG_SIMPLE_CHINESE; @@ -73,11 +74,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_T_CN: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language,UNSELECTED); lv_obj_set_event_cb_mks(buttonT_CN, event_handler,ID_T_CN,"bmp_Tradition_cn_sel.bin",0); gCfgItems.language = LANG_COMPLEX_CHINESE; @@ -86,11 +87,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_EN: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language,UNSELECTED); lv_obj_set_event_cb_mks(buttonEN, event_handler,ID_EN,"bmp_English_sel.bin",0); gCfgItems.language = LANG_ENGLISH; @@ -99,11 +100,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_RU: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language,UNSELECTED); lv_obj_set_event_cb_mks(buttonRU, event_handler,ID_RU,"bmp_Russian_sel.bin",0); gCfgItems.language = LANG_RUSSIAN; @@ -112,11 +113,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_ES: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language,UNSELECTED); lv_obj_set_event_cb_mks(buttonES, event_handler,ID_ES,"bmp_Spanish_sel.bin",0); gCfgItems.language = LANG_SPANISH; @@ -125,11 +126,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_FR: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language,UNSELECTED); lv_obj_set_event_cb_mks(buttonFR, event_handler,ID_FR,"bmp_French_sel.bin",0); gCfgItems.language = LANG_FRENCH; @@ -138,11 +139,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_IT: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language,UNSELECTED); lv_obj_set_event_cb_mks(buttonIT, event_handler,ID_FR,"bmp_Italy_sel.bin",0); gCfgItems.language = LANG_ITALY; @@ -151,10 +152,10 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_L_RETURN: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { buttonCN = NULL; buttonT_CN = NULL; @@ -181,7 +182,7 @@ static void disp_language(uint8_t language,uint8_t state) public_buf_l[0] = '\0'; - switch(language){ + switch (language){ case LANG_SIMPLE_CHINESE: id = ID_CN; @@ -226,18 +227,18 @@ static void disp_language(uint8_t language,uint8_t state) break; } - if(state == SELECTED) strcat(public_buf_l,"_sel.bin"); + if (state == SELECTED) strcat(public_buf_l,"_sel.bin"); else strcat(public_buf_l,".bin"); lv_obj_set_event_cb_mks(obj, event_handler,id,public_buf_l,0); - if(state == UNSELECTED)lv_obj_refresh_ext_draw_pad(obj); + if (state == UNSELECTED)lv_obj_refresh_ext_draw_pad(obj); } void lv_draw_language(void) { - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != LANGUAGE_UI) + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != LANGUAGE_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = LANGUAGE_UI; @@ -353,7 +354,7 @@ void lv_draw_language(void) disp_language(gCfgItems.language,SELECTED); - if(gCfgItems.multiple_language !=0) + if (gCfgItems.multiple_language !=0) { lv_label_set_text(label_CN, language_menu.chinese_s); lv_obj_align(label_CN, buttonCN, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp index 70faedbb28b4..09ad3ed82b02 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp @@ -19,9 +19,11 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + +#include "../../../../MarlinCore.h" #include "lv_conf.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" @@ -43,18 +45,18 @@ static lv_obj_t * scr; static void event_handler(lv_obj_t * obj, lv_event_t event) { - switch(obj->mks_obj_id) + switch (obj->mks_obj_id) { case ID_M_POINT1: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { - if(queue.length == 0) + if (queue.length == 0) { - if(uiCfg.leveling_first_time) + if (uiCfg.leveling_first_time) { queue.enqueue_one_P(PSTR("G28")); uiCfg.leveling_first_time = 0; @@ -70,14 +72,14 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_M_POINT2: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(queue.length == 0) + else if (event == LV_EVENT_RELEASED) { + if (queue.length == 0) { - if(uiCfg.leveling_first_time) + if (uiCfg.leveling_first_time) { queue.enqueue_one_P(PSTR("G28")); uiCfg.leveling_first_time = 0; @@ -93,14 +95,14 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_M_POINT3: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(queue.length == 0) + else if (event == LV_EVENT_RELEASED) { + if (queue.length == 0) { - if(uiCfg.leveling_first_time) + if (uiCfg.leveling_first_time) { queue.enqueue_one_P(PSTR("G28")); uiCfg.leveling_first_time = 0; @@ -117,14 +119,14 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_M_POINT4: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(queue.length == 0) + else if (event == LV_EVENT_RELEASED) { + if (queue.length == 0) { - if(uiCfg.leveling_first_time) + if (uiCfg.leveling_first_time) { queue.enqueue_one_P(PSTR("G28")); uiCfg.leveling_first_time = 0; @@ -140,14 +142,14 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_M_POINT5: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(queue.length == 0) + else if (event == LV_EVENT_RELEASED) { + if (queue.length == 0) { - if(uiCfg.leveling_first_time) + if (uiCfg.leveling_first_time) { queue.enqueue_one_P(PSTR("G28")); uiCfg.leveling_first_time = 0; @@ -164,10 +166,10 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_MANUAL_RETURN: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { lv_clear_manualLevel(); lv_draw_tool(); } @@ -182,7 +184,7 @@ void lv_draw_manualLevel(void) lv_obj_t *buttonPoint1,*buttonPoint2,*buttonPoint3,*buttonPoint4,*buttonPoint5; lv_obj_t *buttonBack; - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != LEVELING_UI) + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != LEVELING_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = LEVELING_UI; @@ -277,7 +279,7 @@ void lv_draw_manualLevel(void) lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - if(gCfgItems.multiple_language !=0) + if (gCfgItems.multiple_language !=0) { lv_label_set_text(label_Point1, leveling_menu.position1); lv_obj_align(label_Point1, buttonPoint1, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp index 79c4f26d75f2..50ea4b925bf0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp @@ -19,15 +19,16 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + +#include "../../../../MarlinCore.h" #include "lv_conf.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -//#include "../MarlinCore.h" #include "draw_ui.h" #include "../../../../gcode/queue.h" @@ -46,15 +47,15 @@ static lv_obj_t * labelV,*buttonV; static void event_handler(lv_obj_t * obj, lv_event_t event) { - switch(obj->mks_obj_id) + switch (obj->mks_obj_id) { case ID_M_X_P: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(queue.length <= (BUFSIZE-3)) + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE-3)) { memset(public_buf_l,0,sizeof(public_buf_l)); queue.enqueue_one_P(PSTR("G91")); @@ -65,12 +66,12 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_M_X_N: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(queue.length <= (BUFSIZE-3)) + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE-3)) { memset(public_buf_l,0,sizeof(public_buf_l)); queue.enqueue_one_now(PSTR("G91")); @@ -81,12 +82,12 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_M_Y_P: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(queue.length <= (BUFSIZE-3)) + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE-3)) { memset(public_buf_l,0,sizeof(public_buf_l)); queue.enqueue_one_now(PSTR("G91")); @@ -97,12 +98,12 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_M_Y_N: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(queue.length <= (BUFSIZE-3)) + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE-3)) { memset(public_buf_l,0,sizeof(public_buf_l)); queue.enqueue_one_now(PSTR("G91")); @@ -113,11 +114,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_M_Z_P: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(queue.length <= (BUFSIZE-3)) + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE-3)) { memset(public_buf_l,0,sizeof(public_buf_l)); queue.enqueue_one_now(PSTR("G91")); @@ -128,11 +129,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_M_Z_N: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(queue.length <= (BUFSIZE-3)) + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE-3)) { memset(public_buf_l,0,sizeof(public_buf_l)); queue.enqueue_one_now(PSTR("G91")); @@ -143,11 +144,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_M_STEP: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(abs(10 * (int)uiCfg.move_dist) == 100) + else if (event == LV_EVENT_RELEASED) { + if (abs(10 * (int)uiCfg.move_dist) == 100) { uiCfg.move_dist = 0.1; } @@ -161,10 +162,10 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_M_RETURN: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { clear_cur_ui(); draw_return_ui(); } @@ -179,7 +180,7 @@ void lv_draw_move_motor(void) lv_obj_t *buttonXI, *buttonXD, *buttonYI, *buttonYD; lv_obj_t *buttonZI, *buttonZD, *buttonBack; - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != MOVE_MOTOR_UI) + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MOVE_MOTOR_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = MOVE_MOTOR_UI; @@ -291,7 +292,7 @@ void lv_draw_move_motor(void) lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - if(gCfgItems.multiple_language !=0) + if (gCfgItems.multiple_language !=0) { lv_label_set_text(labelXI, move_menu.x_add); lv_obj_align(labelXI, buttonXI, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); @@ -322,31 +323,31 @@ void disp_move_dist() { //char buf[30] = {0}; - if((int)(10 * uiCfg.move_dist) == 1) + if ((int)(10 * uiCfg.move_dist) == 1) { lv_obj_set_event_cb_mks(buttonV, event_handler,ID_M_STEP,"bmp_Step_move0_1.bin",0); } - else if((int)(10 * uiCfg.move_dist) == 10) + else if ((int)(10 * uiCfg.move_dist) == 10) { lv_obj_set_event_cb_mks(buttonV, event_handler,ID_M_STEP,"bmp_Step_move1.bin",0); } - else if((int)(10 * uiCfg.move_dist) == 100) + else if ((int)(10 * uiCfg.move_dist) == 100) { lv_obj_set_event_cb_mks(buttonV, event_handler,ID_M_STEP,"bmp_Step_move10.bin",0); } - if(gCfgItems.multiple_language != 0) + if (gCfgItems.multiple_language != 0) { - if((int)(10 * uiCfg.move_dist) == 1) + if ((int)(10 * uiCfg.move_dist) == 1) { lv_label_set_text(labelV, move_menu.step_01mm); lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); } - else if((int)(10 * uiCfg.move_dist) == 10) + else if ((int)(10 * uiCfg.move_dist) == 10) { lv_label_set_text(labelV, move_menu.step_1mm); lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); } - else if((int)(10 * uiCfg.move_dist) == 100) + else if ((int)(10 * uiCfg.move_dist) == 100) { lv_label_set_text(labelV, move_menu.step_10mm); lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp index c6a2499be34d..88809c84d659 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp @@ -19,15 +19,16 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + +#include "../../../../MarlinCore.h" #include "lv_conf.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -//#include "../MarlinCore.h" #include "draw_ui.h" static lv_obj_t * scr; @@ -46,81 +47,81 @@ static lv_obj_t *buttonPowerOff; static void event_handler(lv_obj_t * obj, lv_event_t event) { - switch(obj->mks_obj_id) + switch (obj->mks_obj_id) { case ID_O_PRE_HEAT: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { lv_clear_opration(); lv_draw_preHeat(); } break; case ID_O_EXTRUCT: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { lv_clear_opration(); lv_draw_extrusion(); } break; case ID_O_MOV: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { lv_clear_opration(); lv_draw_move_motor(); } break; case ID_O_FILAMENT: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { } break; case ID_O_FAN: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { lv_clear_opration(); lv_draw_fan(); } break; case ID_O_SPEED: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { lv_clear_opration(); lv_draw_change_speed(); } break; case ID_O_RETURN: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { clear_cur_ui(); draw_return_ui(); } break; case ID_O_POWER_OFF: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(gCfgItems.finish_power_off == 1) + else if (event == LV_EVENT_RELEASED) { + if (gCfgItems.finish_power_off == 1) { gCfgItems.finish_power_off = 0; lv_obj_set_event_cb_mks(obj, event_handler,ID_O_POWER_OFF,"bmp_Mamual.bin",0); @@ -153,7 +154,7 @@ void lv_draw_opration(void) lv_obj_t *label_Back,*label_Speed,*label_Fan; lv_obj_t *buttonMove=NULL,*label_Move=NULL; - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != OPERATE_UI) + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != OPERATE_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = OPERATE_UI; @@ -182,7 +183,7 @@ void lv_draw_opration(void) buttonSpeed = lv_imgbtn_create(scr, NULL); - if(uiCfg.print_state != WORKING) + if (uiCfg.print_state != WORKING) //buttonFilament = lv_imgbtn_create(scr, NULL); //else buttonMove = lv_imgbtn_create(scr, NULL); @@ -215,7 +216,7 @@ void lv_draw_opration(void) lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_REL, &tft_style_lable_rel); - if(uiCfg.print_state != WORKING) + if (uiCfg.print_state != WORKING) /*{ lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_O_FILAMENT,"bmp_Filamentchange.bin",0); lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_REL, &bmp_pic); @@ -231,7 +232,7 @@ void lv_draw_opration(void) lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_REL, &tft_style_lable_rel); } - if(gCfgItems.finish_power_off == 1) + if (gCfgItems.finish_power_off == 1) { lv_obj_set_event_cb_mks(buttonPowerOff, event_handler,ID_O_POWER_OFF,"bmp_Auto.bin",0); } @@ -260,7 +261,7 @@ void lv_draw_opration(void) lv_obj_set_pos(buttonFan,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); lv_obj_set_pos(buttonSpeed,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - if(uiCfg.print_state != WORKING) + if (uiCfg.print_state != WORKING) /*{ lv_obj_set_pos(buttonFilament,INTERVAL_V,BTN_Y_PIXEL+INTERVAL_H+titleHeight); } @@ -281,7 +282,7 @@ void lv_draw_opration(void) lv_btn_set_layout(buttonFan, LV_LAYOUT_OFF); lv_btn_set_layout(buttonSpeed, LV_LAYOUT_OFF); - if(uiCfg.print_state != WORKING) + if (uiCfg.print_state != WORKING) /*{ lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF); } @@ -298,7 +299,7 @@ void lv_draw_opration(void) label_Fan = lv_label_create(buttonFan, NULL); label_Speed = lv_label_create(buttonSpeed, NULL); - if(uiCfg.print_state != WORKING) + if (uiCfg.print_state != WORKING) /*{ label_Filament = lv_label_create(buttonFilament, NULL); } @@ -311,7 +312,7 @@ void lv_draw_opration(void) label_Back = lv_label_create(buttonBack, NULL); - if(gCfgItems.multiple_language !=0) + if (gCfgItems.multiple_language !=0) { lv_label_set_text(labelPreHeat, operation_menu.temp); lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); @@ -325,7 +326,7 @@ void lv_draw_opration(void) lv_label_set_text(label_Speed, operation_menu.speed); lv_obj_align(label_Speed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - if(uiCfg.print_state != WORKING) + if (uiCfg.print_state != WORKING) /*{ lv_label_set_text(label_Filament, operation_menu.filament); lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); @@ -336,7 +337,7 @@ void lv_draw_opration(void) lv_obj_align(label_Move, buttonMove, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); } - if(gCfgItems.finish_power_off == 1) + if (gCfgItems.finish_power_off == 1) { lv_label_set_text(label_PowerOff, printing_more_menu.auto_close); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp index 8bcd2ec1e8d3..76417038d5c0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp @@ -19,15 +19,16 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + +#include "../../../../MarlinCore.h" #include "lv_conf.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -//#include "../MarlinCore.h" #include "draw_ui.h" #if ENABLED(ADVANCED_PAUSE_FEATURE) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp index 52f5e3bfb106..36b7f6afdfe9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp @@ -19,17 +19,18 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + #include "lv_conf.h" +#include "draw_ui.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -//#include "../MarlinCore.h" -#include "../../../../../Configuration.h" -#include "draw_ui.h" + +#include "../../../../MarlinCore.h" #include "../../../../module/temperature.h" static lv_obj_t * scr; @@ -47,20 +48,20 @@ static lv_obj_t * tempText1; static void event_handler(lv_obj_t * obj, lv_event_t event) { - switch(obj->mks_obj_id) + switch (obj->mks_obj_id) { case ID_P_ADD: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(uiCfg.curTempType == 0) + else if (event == LV_EVENT_RELEASED) { + if (uiCfg.curTempType == 0) { thermalManager.temp_hotend[uiCfg.curSprayerChoose].target += uiCfg.stepHeat; - if(uiCfg.curSprayerChoose == 0) + if (uiCfg.curSprayerChoose == 0) { - if((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_0_MAXTEMP- (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) + if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_0_MAXTEMP- (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) { thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); @@ -70,7 +71,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) #if !defined(SINGLENOZZLE) && EXTRUDERS >= 2 else { - if((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP- (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) + if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP- (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) { thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); @@ -85,7 +86,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) thermalManager.temp_bed.target += uiCfg.stepHeat; - if((int)thermalManager.temp_bed.target > BED_MAXTEMP- (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) + if ((int)thermalManager.temp_bed.target > BED_MAXTEMP- (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) { thermalManager.temp_bed.target = (float)BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1); thermalManager.start_watching_bed(); @@ -97,13 +98,13 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_P_DEC: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(uiCfg.curTempType == 0) + else if (event == LV_EVENT_RELEASED) { + if (uiCfg.curTempType == 0) { - if((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > uiCfg.stepHeat) + if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > uiCfg.stepHeat) { thermalManager.temp_hotend[uiCfg.curSprayerChoose].target -= uiCfg.stepHeat; thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); @@ -117,7 +118,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) #if HAS_HEATED_BED else { - if((int)thermalManager.temp_bed.target > uiCfg.stepHeat) + if ((int)thermalManager.temp_bed.target > uiCfg.stepHeat) { thermalManager.temp_bed.target -= uiCfg.stepHeat; thermalManager.start_watching_bed(); @@ -134,22 +135,22 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_P_TYPE: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(uiCfg.curTempType == 0) + else if (event == LV_EVENT_RELEASED) { + if (uiCfg.curTempType == 0) { - if(EXTRUDERS == 2) + if (EXTRUDERS == 2) { - if(uiCfg.curSprayerChoose == 0) + if (uiCfg.curSprayerChoose == 0) { uiCfg.curSprayerChoose = 1; } - else if(uiCfg.curSprayerChoose == 1) + else if (uiCfg.curSprayerChoose == 1) { - if(TEMP_SENSOR_BED != 0) + if (TEMP_SENSOR_BED != 0) { uiCfg.curTempType = 1; } @@ -163,9 +164,9 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } else { - if(uiCfg.curSprayerChoose == 0) + if (uiCfg.curSprayerChoose == 0) { - if(TEMP_SENSOR_BED != 0) + if (TEMP_SENSOR_BED != 0) { uiCfg.curTempType = 1; } @@ -177,7 +178,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } } - else if(uiCfg.curTempType == 1) + else if (uiCfg.curTempType == 1) { uiCfg.curSprayerChoose = 0; uiCfg.curTempType = 0; @@ -186,12 +187,12 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_P_STEP: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - switch(uiCfg.stepHeat) + else if (event == LV_EVENT_RELEASED) { + switch (uiCfg.stepHeat) { case 1: uiCfg.stepHeat = 5; @@ -212,11 +213,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_P_OFF: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { - if(uiCfg.curTempType == 0) + else if (event == LV_EVENT_RELEASED) { + if (uiCfg.curTempType == 0) { thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)0; thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); @@ -232,10 +233,10 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_P_RETURN: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { clear_cur_ui(); draw_return_ui(); } @@ -250,7 +251,7 @@ void lv_draw_preHeat(void) lv_obj_t *buttonAdd,*buttonDec; lv_obj_t *buttonOff,*buttonBack; - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != PRE_HEAT_UI) + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != PRE_HEAT_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = PRE_HEAT_UI; @@ -342,7 +343,7 @@ void lv_draw_preHeat(void) lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - if(gCfgItems.multiple_language !=0) + if (gCfgItems.multiple_language !=0) { lv_label_set_text(labelAdd, preheat_menu.add); lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); @@ -368,12 +369,12 @@ void lv_draw_preHeat(void) void disp_temp_type() { - if(uiCfg.curTempType == 0) + if (uiCfg.curTempType == 0) { - if(uiCfg.curSprayerChoose == 1) + if (uiCfg.curSprayerChoose == 1) { lv_obj_set_event_cb_mks(buttoType, event_handler,ID_P_TYPE,"bmp_Extru2.bin",0); - if(gCfgItems.multiple_language != 0) + if (gCfgItems.multiple_language != 0) { lv_label_set_text(labelType, preheat_menu.ext2); lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); @@ -382,7 +383,7 @@ void disp_temp_type() else { lv_obj_set_event_cb_mks(buttoType, event_handler,ID_P_TYPE,"bmp_Extru1.bin",0); - if(gCfgItems.multiple_language != 0) + if (gCfgItems.multiple_language != 0) { lv_label_set_text(labelType, preheat_menu.ext1); lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); @@ -393,7 +394,7 @@ void disp_temp_type() else { lv_obj_set_event_cb_mks(buttoType, event_handler,ID_P_TYPE,"bmp_Bed.bin",0); - if(gCfgItems.multiple_language != 0) + if (gCfgItems.multiple_language != 0) { lv_label_set_text(labelType, preheat_menu.hotbed); lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); @@ -408,9 +409,9 @@ void disp_desire_temp() public_buf_l[0] = '\0'; - if(uiCfg.curTempType == 0) + if (uiCfg.curTempType == 0) { - if(uiCfg.curSprayerChoose<1) + if (uiCfg.curSprayerChoose<1) { strcat(public_buf_l,preheat_menu.ext1); } @@ -437,26 +438,26 @@ void disp_desire_temp() void disp_step_heat() { - if(uiCfg.stepHeat == 1) + if (uiCfg.stepHeat == 1) lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_P_STEP,"bmp_Step1_degree.bin",0); - else if(uiCfg.stepHeat == 5) + else if (uiCfg.stepHeat == 5) lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_P_STEP,"bmp_Step5_degree.bin",0); - else if(uiCfg.stepHeat == 10) + else if (uiCfg.stepHeat == 10) lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_P_STEP,"bmp_Step10_degree.bin",0); - if(gCfgItems.multiple_language != 0) + if (gCfgItems.multiple_language != 0) { - if(uiCfg.stepHeat == 1) + if (uiCfg.stepHeat == 1) { lv_label_set_text(labelStep, preheat_menu.step_1c); lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); } - else if(uiCfg.stepHeat == 5) + else if (uiCfg.stepHeat == 5) { lv_label_set_text(labelStep, preheat_menu.step_5c); lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); } - else if(uiCfg.stepHeat == 10) + else if (uiCfg.stepHeat == 10) { lv_label_set_text(labelStep, preheat_menu.step_10c); lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index 4e0f76b9b833..61ef4a533610 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -19,15 +19,16 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + +#include "../../../../MarlinCore.h" #include "lv_conf.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -//#include "../MarlinCore.h" #include "draw_ui.h" #include "../../../../sd/cardreader.h" @@ -37,9 +38,9 @@ static lv_obj_t *buttonPageUp,*buttonPageDown,*buttonBack,*buttonGcode[FILE_BTN_ static lv_obj_t * labelPageUp[FILE_BTN_CNT]; static lv_obj_t *buttonText[FILE_BTN_CNT]; -#define ID_P_UP 7 -#define ID_P_DOWN 8 -#define ID_P_RETURN 9 +#define ID_P_UP 7 +#define ID_P_DOWN 8 +#define ID_P_RETURN 9 int8_t curDirLever = 0; @@ -49,675 +50,555 @@ DIR_OFFSET dir_offset[10]; extern uint8_t public_buf[512]; extern char public_buf_m[100]; -uint8_t sel_id=0; +uint8_t sel_id = 0; + #if ENABLED(SDSUPPORT) -static uint8_t search_file() -{ - int valid_name_cnt=0; - //char tmp[SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; - - list_file.Sd_file_cnt = 0; - //list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - - //root2.rewind(); - //SERIAL_PROTOCOLLN(list_file.curDirPath); - - if(curDirLever != 0)card.cd(list_file.curDirPath); - else card.cdroot();//while(card.cdup()); - - const uint16_t fileCnt = card.get_num_Files(); - - for (uint16_t i = 0; i < fileCnt; i++) { - if(list_file.Sd_file_cnt == list_file.Sd_file_offset){ - const uint16_t nr = - #if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA) - fileCnt - 1 - - #endif - i; - - #if ENABLED(SDCARD_SORT_ALPHA) - card.getfilename_sorted(nr); - #else - card.getfilename_sorted(nr); - #endif - - if (card.flag.filenameIsDir) - { - /*if(card.longFilename[0] == 0) - SERIAL_PROTOCOLLN(card.filename); - else - SERIAL_PROTOCOLLN(card.longFilename);*/ - list_file.IsFolder[valid_name_cnt] = 1; - } - else - { - //SERIAL_PROTOCOLLN(card.longFilename); - list_file.IsFolder[valid_name_cnt] = 0; - } - #if 1 - // - memset(list_file.file_name[valid_name_cnt],0,strlen(list_file.file_name[valid_name_cnt])); - strcpy(list_file.file_name[valid_name_cnt], list_file.curDirPath); - strcat(list_file.file_name[valid_name_cnt], "/"); - strcat(list_file.file_name[valid_name_cnt],card.filename); - // - memset(list_file.long_name[valid_name_cnt],0,strlen(list_file.long_name[valid_name_cnt])); - if(card.longFilename[0] == 0) - strncpy(list_file.long_name[valid_name_cnt],card.filename,strlen(card.filename)); - else - strncpy(list_file.long_name[valid_name_cnt],card.longFilename,strlen(card.longFilename)); - - - valid_name_cnt++; - if (valid_name_cnt == 1) - dir_offset[curDirLever].cur_page_first_offset = list_file.Sd_file_offset; - if(valid_name_cnt >= FILE_NUM) - { - dir_offset[curDirLever].cur_page_last_offset = list_file.Sd_file_offset; - list_file.Sd_file_offset++; - break; - } - list_file.Sd_file_offset++; - #endif - } - list_file.Sd_file_cnt++; - } - //card.closefile(false); - return valid_name_cnt; -} + static uint8_t search_file() { + int valid_name_cnt = 0; + //char tmp[SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; + + list_file.Sd_file_cnt = 0; + //list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + + //root2.rewind(); + //SERIAL_ECHOLN(list_file.curDirPath); + + if (curDirLever != 0)card.cd(list_file.curDirPath); + else card.cdroot();//while(card.cdup()); + + const uint16_t fileCnt = card.get_num_Files(); + + for (uint16_t i = 0; i < fileCnt; i++) { + if (list_file.Sd_file_cnt == list_file.Sd_file_offset) { + const uint16_t nr = SD_ORDER(i, fileCnt); + card.getfilename_sorted(nr); + + if (card.flag.filenameIsDir) { + /* + SERIAL_ECHOLN(card.longest_filename); + */ + list_file.IsFolder[valid_name_cnt] = 1; + } + else { + //SERIAL_ECHOLN(card.longFilename); + list_file.IsFolder[valid_name_cnt] = 0; + } + + #if 1 + // + memset(list_file.file_name[valid_name_cnt],0,strlen(list_file.file_name[valid_name_cnt])); + strcpy(list_file.file_name[valid_name_cnt], list_file.curDirPath); + strcat(list_file.file_name[valid_name_cnt], "/"); + strcat(list_file.file_name[valid_name_cnt],card.filename); + // + memset(list_file.long_name[valid_name_cnt],0,strlen(list_file.long_name[valid_name_cnt])); + if (card.longFilename[0] == 0) + strncpy(list_file.long_name[valid_name_cnt],card.filename,strlen(card.filename)); + else + strncpy(list_file.long_name[valid_name_cnt],card.longFilename,strlen(card.longFilename)); + + valid_name_cnt++; + if (valid_name_cnt == 1) + dir_offset[curDirLever].cur_page_first_offset = list_file.Sd_file_offset; + if (valid_name_cnt >= FILE_NUM) { + dir_offset[curDirLever].cur_page_last_offset = list_file.Sd_file_offset; + list_file.Sd_file_offset++; + break; + } + list_file.Sd_file_offset++; + #endif + } + list_file.Sd_file_cnt++; + } + //card.closefile(false); + return valid_name_cnt; + } + #endif -uint8_t have_pre_pic(char *path) -{ - #if ENABLED(SDSUPPORT) - char *ps1,*ps2; - char *cur_name; - - cur_name=strrchr(path,'/'); - - card.openFileRead(cur_name); - card.read(public_buf, 512); - ps1 = strstr((char *)public_buf,";simage:"); - card.read(public_buf, 512); - ps2 = strstr((char *)public_buf,";simage:"); - if(ps1 || ps2) - { - card.closefile(); - return 1; - } - else - { - card.closefile(); - return 0; - } - #endif +uint8_t have_pre_pic(char *path) { + #if ENABLED(SDSUPPORT) + char *ps1, *ps2, *cur_name = strrchr(path, '/'); + + card.openFileRead(cur_name); + card.read(public_buf, 512); + ps1 = strstr((char *)public_buf, ";simage:"); + card.read(public_buf, 512); + ps2 = strstr((char *)public_buf, ";simage:"); + if (ps1 || ps2) { + card.closefile(); + return 1; + } + card.closefile(); + #endif + + return 0; } - LV_IMG_DECLARE(bmp_pic_117x92); LV_IMG_DECLARE(bmp_pic_100x100); LV_IMG_DECLARE(bmp_pic); LV_IMG_DECLARE(bmp_pic_100x40); - -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - uint8_t i; - uint8_t file_count; - //switch(obj->mks_obj_id) - //{ - if(obj->mks_obj_id == ID_P_UP) - { - if(event == LV_EVENT_CLICKED) { - - - } - else if(event == LV_EVENT_RELEASED) { - if(dir_offset[curDirLever].curPage > 0) - { - - //2015.05.19 - list_file.Sd_file_cnt = 0; - - if(dir_offset[curDirLever].cur_page_first_offset >= FILE_NUM) - list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset - FILE_NUM; - #if ENABLED(SDSUPPORT) - file_count = search_file(); - #endif - if(file_count != 0) - { - dir_offset[curDirLever].curPage--; - lv_obj_del(scr); - disp_gcode_icon(file_count); - } - } - } - } - else if(obj->mks_obj_id == ID_P_DOWN) - { - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) { - - if(dir_offset[curDirLever].cur_page_last_offset > 0) - { - list_file.Sd_file_cnt = 0; - - list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_last_offset + 1; - #if ENABLED(SDSUPPORT) - file_count = search_file(); - #endif - if(file_count != 0) - { - dir_offset[curDirLever].curPage++; - lv_obj_del(scr); - disp_gcode_icon(file_count); - } - if(file_count < FILE_NUM) - { - dir_offset[curDirLever].cur_page_last_offset = 0; - } - } - } - } - else if(obj->mks_obj_id == ID_P_RETURN) - { - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) { - if(curDirLever > 0) - { - int8_t *ch = 0; - - ch = (int8_t *)strrchr(list_file.curDirPath, '/'); - if(ch != 0) - { - *ch = 0; - #if ENABLED(SDSUPPORT) - card.cdup(); - #endif - dir_offset[curDirLever].curPage = 0; - dir_offset[curDirLever].cur_page_first_offset = 0; - dir_offset[curDirLever].cur_page_last_offset = 0; - curDirLever--; - list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if ENABLED(SDSUPPORT) - file_count = search_file(); - #endif - lv_obj_del(scr); - disp_gcode_icon(file_count); - } - - } - else - { - lv_obj_del(scr); - lv_draw_ready_print(); - } - } - } - else - { - for(i = 0; i < FILE_BTN_CNT; i++) - { - if(obj->mks_obj_id == (i+1)) - { - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) { - if(list_file.file_name[i][0] != 0) - { - if(list_file.IsFolder[i] == 1) - { - memset(list_file.curDirPath, 0, sizeof(list_file.curDirPath)); - strcpy(list_file.curDirPath, list_file.file_name[i]); - curDirLever++; - list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if ENABLED(SDSUPPORT) - file_count = search_file(); - #endif - lv_obj_del(scr); - disp_gcode_icon(file_count); - } - else - { - sel_id = i; - lv_obj_del(scr); - lv_draw_dialog(DIALOG_TYPE_PRINT_FILE); - } - break; - } - } - } - } - } +static void event_handler(lv_obj_t * obj, lv_event_t event) { + uint8_t i, file_count = 0; + //switch (obj->mks_obj_id) + //{ + if (obj->mks_obj_id == ID_P_UP) { + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (dir_offset[curDirLever].curPage > 0) { + //2015.05.19 + list_file.Sd_file_cnt = 0; + + if (dir_offset[curDirLever].cur_page_first_offset >= FILE_NUM) + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset - FILE_NUM; + + #if ENABLED(SDSUPPORT) + file_count = search_file(); + #endif + if (file_count != 0) { + dir_offset[curDirLever].curPage--; + lv_obj_del(scr); + disp_gcode_icon(file_count); + } + } + } + } + else if (obj->mks_obj_id == ID_P_DOWN) { + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (dir_offset[curDirLever].cur_page_last_offset > 0) { + list_file.Sd_file_cnt = 0; + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_last_offset + 1; + #if ENABLED(SDSUPPORT) + file_count = search_file(); + #endif + if (file_count != 0) { + dir_offset[curDirLever].curPage++; + lv_obj_del(scr); + disp_gcode_icon(file_count); + } + if (file_count < FILE_NUM) { + dir_offset[curDirLever].cur_page_last_offset = 0; + } + } + } + } + else if (obj->mks_obj_id == ID_P_RETURN) { + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (curDirLever > 0) { + int8_t *ch = (int8_t *)strrchr(list_file.curDirPath, '/'); + if (ch) { + *ch = 0; + #if ENABLED(SDSUPPORT) + card.cdup(); + #endif + dir_offset[curDirLever].curPage = 0; + dir_offset[curDirLever].cur_page_first_offset = 0; + dir_offset[curDirLever].cur_page_last_offset = 0; + curDirLever--; + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + #if ENABLED(SDSUPPORT) + file_count = search_file(); + #endif + lv_obj_del(scr); + disp_gcode_icon(file_count); + } + } + else { + lv_obj_del(scr); + lv_draw_ready_print(); + } + } + } + else { + for (i = 0; i < FILE_BTN_CNT; i++) { + if (obj->mks_obj_id == (i+1)) { + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (list_file.file_name[i][0] != 0) { + if (list_file.IsFolder[i] == 1) { + memset(list_file.curDirPath, 0, sizeof(list_file.curDirPath)); + strcpy(list_file.curDirPath, list_file.file_name[i]); + curDirLever++; + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + #if ENABLED(SDSUPPORT) + file_count = search_file(); + #endif + lv_obj_del(scr); + disp_gcode_icon(file_count); + } + else { + sel_id = i; + lv_obj_del(scr); + lv_draw_dialog(DIALOG_TYPE_PRINT_FILE); + } + break; + } + } + } + } + } } - -void lv_draw_print_file(void) -{ - //uint8_t i; - uint8_t file_count; - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != PRINT_FILE_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINT_FILE_UI; - } - disp_state = PRINT_FILE_UI; - - curDirLever = 0; - dir_offset[curDirLever].curPage = 0; - - list_file.Sd_file_offset = 0; - list_file.Sd_file_cnt = 0; - - memset(dir_offset, 0, sizeof(dir_offset)); - memset(list_file.IsFolder,0,sizeof(list_file.IsFolder)); - memset(list_file.curDirPath, 0, sizeof(list_file.curDirPath)); - - list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if ENABLED(SDSUPPORT) - card.mount(); - - - file_count = search_file(); - #endif - disp_gcode_icon(file_count); - - - //lv_obj_t * labelPageUp = lv_label_create(buttonPageUp, NULL); - //lv_obj_t * labelPageDown = lv_label_create(buttonPageDown, NULL); - //lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - /*if(gCfgItems.multiple_language !=0) - { - lv_label_set_text(labelPageUp, tool_menu.preheat); - lv_obj_align(labelPageUp, buttonPageUp, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelPageDown, tool_menu.extrude); - lv_obj_align(labelPageDown, buttonPageDown, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - }*/ +void lv_draw_print_file(void) { + //uint8_t i; + uint8_t file_count; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != PRINT_FILE_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINT_FILE_UI; + } + disp_state = PRINT_FILE_UI; + + curDirLever = 0; + dir_offset[curDirLever].curPage = 0; + + list_file.Sd_file_offset = 0; + list_file.Sd_file_cnt = 0; + + ZERO(dir_offset); + ZERO(list_file.IsFolder); + ZERO(list_file.curDirPath); + + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + #if ENABLED(SDSUPPORT) + card.mount(); + file_count = search_file(); + #endif + disp_gcode_icon(file_count); + + //lv_obj_t * labelPageUp = lv_label_create(buttonPageUp, NULL); + //lv_obj_t * labelPageDown = lv_label_create(buttonPageDown, NULL); + //lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + /* + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelPageUp, tool_menu.preheat); + lv_obj_align(labelPageUp, buttonPageUp, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelPageDown, tool_menu.extrude); + lv_obj_align(labelPageDown, buttonPageDown, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + */ } -void disp_gcode_icon(uint8_t file_num) -{ - uint8_t i; +void disp_gcode_icon(uint8_t file_num) { + uint8_t i; - scr = lv_obj_create(NULL, NULL); + scr = lv_obj_create(NULL, NULL); - //static lv_style_t tool_style; + //static lv_style_t tool_style; - lv_obj_set_style(scr, &tft_style_scr); + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - buttonPageUp = lv_imgbtn_create(scr, NULL); - buttonPageDown = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonPageUp, event_handler,ID_P_UP,"bmp_pageUp.bin",0); - lv_imgbtn_set_src(buttonPageUp, LV_BTN_STATE_REL, &bmp_pic_117x92); - lv_imgbtn_set_src(buttonPageUp, LV_BTN_STATE_PR, &bmp_pic_117x92); - lv_imgbtn_set_style(buttonPageUp, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonPageUp, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_clear_protect(buttonPageUp, LV_PROTECT_FOLLOW); - - #if 1 - lv_obj_set_event_cb_mks(buttonPageDown, event_handler,ID_P_DOWN,"bmp_pageDown.bin",0); - lv_imgbtn_set_src(buttonPageDown, LV_BTN_STATE_REL, &bmp_pic_117x92); - lv_imgbtn_set_src(buttonPageDown, LV_BTN_STATE_PR, &bmp_pic_117x92); - lv_imgbtn_set_style(buttonPageDown, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonPageDown, LV_BTN_STATE_REL, &tft_style_lable_rel); - - - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_P_RETURN,"bmp_Back.bin",0); + buttonPageUp = lv_imgbtn_create(scr, NULL); + buttonPageDown = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonPageUp, event_handler,ID_P_UP,"bmp_pageUp.bin",0); + lv_imgbtn_set_src(buttonPageUp, LV_BTN_STATE_REL, &bmp_pic_117x92); + lv_imgbtn_set_src(buttonPageUp, LV_BTN_STATE_PR, &bmp_pic_117x92); + lv_imgbtn_set_style(buttonPageUp, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPageUp, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonPageUp, LV_PROTECT_FOLLOW); + + #if 1 + lv_obj_set_event_cb_mks(buttonPageDown, event_handler,ID_P_DOWN,"bmp_pageDown.bin",0); + lv_imgbtn_set_src(buttonPageDown, LV_BTN_STATE_REL, &bmp_pic_117x92); + lv_imgbtn_set_src(buttonPageDown, LV_BTN_STATE_PR, &bmp_pic_117x92); + lv_imgbtn_set_style(buttonPageDown, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPageDown, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_P_RETURN,"bmp_Back.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic_117x92); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic_117x92); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - - #endif - - lv_obj_set_pos(buttonPageUp,OTHER_BTN_XPIEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttonPageDown,OTHER_BTN_XPIEL*3+INTERVAL_V*4,titleHeight+OTHER_BTN_YPIEL+INTERVAL_H); - lv_obj_set_pos(buttonBack,OTHER_BTN_XPIEL*3+INTERVAL_V*4,titleHeight+OTHER_BTN_YPIEL*2+INTERVAL_H*2); - - /*Create a label on the Image button*/ - - lv_btn_set_layout(buttonPageUp, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonPageDown, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - for(i = 0; i < FILE_BTN_CNT; i++) - { - /*if(seq) - { - j = (FILE_BTN_CNT-1) - i; - back_flg = 1; - } - else - { - j = i; - back_flg = 0; - } - - */ - if(i >= file_num) - { - break; - } - - #ifdef TFT35 - buttonGcode[i] = lv_imgbtn_create(scr, NULL); - - lv_imgbtn_set_style(buttonGcode[i], LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonGcode[i], LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_clear_protect(buttonGcode[i], LV_PROTECT_FOLLOW); - lv_btn_set_layout(buttonGcode[i], LV_LAYOUT_OFF); - - memset(public_buf_m,0,sizeof(public_buf_m)); - cutFileName((char *)list_file.long_name[i], 16, 8, (char *)public_buf_m); - - if(list_file.IsFolder[i] == 1) - { - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler,(i+1),"bmp_Dir.bin",0); - lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic); - if(i < 3) - lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1), titleHeight); - else - lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1), BTN_Y_PIXEL+INTERVAL_H+titleHeight); - - labelPageUp[i] = lv_label_create(buttonGcode[i], NULL); - lv_obj_set_style(labelPageUp[i], &tft_style_lable_rel); - lv_label_set_text(labelPageUp[i], public_buf_m); - lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID,0, -5); - } - else - { - if(have_pre_pic((char *)list_file.file_name[i])) - { - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler,(i+1),list_file.file_name[i],1); - lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic_100x100); - lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic_100x100); - if(i < 3) - { - lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1)+FILE_PRE_PIC_X_OFFSET, titleHeight+FILE_PRE_PIC_Y_OFFSET); - buttonText[i] = lv_btn_create(scr, NULL); - //lv_obj_set_event_cb(buttonText[i], event_handler); - - lv_btn_set_style(buttonText[i], LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_btn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_lable_rel); - //lv_obj_set_style(buttonText[i], &tft_style_lable_pre); - //lv_obj_set_style(buttonText[i], &tft_style_lable_rel); - lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); - lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); - //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL,0); - //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_REL, &bmp_pic_100x40); - //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_PR, &bmp_pic_100x40); - lv_obj_set_pos(buttonText[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1)+FILE_PRE_PIC_X_OFFSET, titleHeight+FILE_PRE_PIC_Y_OFFSET+100); - lv_obj_set_size(buttonText[i],100,40); - } - else - { - lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1)+FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL+INTERVAL_H+titleHeight+FILE_PRE_PIC_Y_OFFSET); - buttonText[i] = lv_btn_create(scr, NULL); - //lv_obj_set_event_cb(buttonText[i], event_handler); - - lv_btn_set_style(buttonText[i], LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_btn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_lable_rel); - - //lv_imgbtn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); - lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); - //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL,0); - //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_REL, &bmp_pic_100x40); - //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_PR, &bmp_pic_100x40); - lv_obj_set_pos(buttonText[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1)+FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL+INTERVAL_H+titleHeight+FILE_PRE_PIC_Y_OFFSET+100); - lv_obj_set_size(buttonText[i],100,40); - } - labelPageUp[i] = lv_label_create(buttonText[i], NULL); - lv_obj_set_style(labelPageUp[i], &tft_style_lable_rel); - lv_label_set_text(labelPageUp[i], public_buf_m); - lv_obj_align(labelPageUp[i], buttonText[i], LV_ALIGN_IN_BOTTOM_MID,0, 0); - } - else - { - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler,(i+1),"bmp_File.bin",0); - lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic); - if(i < 3) - lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1), titleHeight); - else - lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1), BTN_Y_PIXEL+INTERVAL_H+titleHeight); - - labelPageUp[i] = lv_label_create(buttonGcode[i], NULL); - lv_obj_set_style(labelPageUp[i], &tft_style_lable_rel); - lv_label_set_text(labelPageUp[i], public_buf_m); - lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID,0, -5); - } - } - - - #else - - #endif - } + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif + + lv_obj_set_pos(buttonPageUp,OTHER_BTN_XPIEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonPageDown,OTHER_BTN_XPIEL*3+INTERVAL_V*4,titleHeight+OTHER_BTN_YPIEL+INTERVAL_H); + lv_obj_set_pos(buttonBack,OTHER_BTN_XPIEL*3+INTERVAL_V*4,titleHeight+OTHER_BTN_YPIEL*2+INTERVAL_H*2); + + /*Create a label on the Image button*/ + + lv_btn_set_layout(buttonPageUp, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPageDown, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + for (i = 0; i < FILE_BTN_CNT; i++) { + /* + if(seq) { + j = (FILE_BTN_CNT-1) - i; + back_flg = 1; + } + else { + j = i; + back_flg = 0; + } + */ + if (i >= file_num) break; + + #ifdef TFT35 + buttonGcode[i] = lv_imgbtn_create(scr, NULL); + + lv_imgbtn_set_style(buttonGcode[i], LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonGcode[i], LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonGcode[i], LV_PROTECT_FOLLOW); + lv_btn_set_layout(buttonGcode[i], LV_LAYOUT_OFF); + + ZERO(public_buf_m); + cutFileName((char *)list_file.long_name[i], 16, 8, (char *)public_buf_m); + + if (list_file.IsFolder[i] == 1) { + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler,(i+1),"bmp_Dir.bin",0); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic); + if (i < 3) + lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1), titleHeight); + else + lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1), BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + labelPageUp[i] = lv_label_create(buttonGcode[i], NULL); + lv_obj_set_style(labelPageUp[i], &tft_style_lable_rel); + lv_label_set_text(labelPageUp[i], public_buf_m); + lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID,0, -5); + } + else { + if (have_pre_pic((char *)list_file.file_name[i])) { + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler,(i+1),list_file.file_name[i],1); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic_100x100); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic_100x100); + if (i < 3) { + lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1)+FILE_PRE_PIC_X_OFFSET, titleHeight+FILE_PRE_PIC_Y_OFFSET); + buttonText[i] = lv_btn_create(scr, NULL); + //lv_obj_set_event_cb(buttonText[i], event_handler); + + lv_btn_set_style(buttonText[i], LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_btn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_lable_rel); + //lv_obj_set_style(buttonText[i], &tft_style_lable_pre); + //lv_obj_set_style(buttonText[i], &tft_style_lable_rel); + lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); + lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); + //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL,0); + //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_REL, &bmp_pic_100x40); + //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_PR, &bmp_pic_100x40); + lv_obj_set_pos(buttonText[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1)+FILE_PRE_PIC_X_OFFSET, titleHeight+FILE_PRE_PIC_Y_OFFSET+100); + lv_obj_set_size(buttonText[i],100,40); + } + else { + lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1)+FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL+INTERVAL_H+titleHeight+FILE_PRE_PIC_Y_OFFSET); + buttonText[i] = lv_btn_create(scr, NULL); + //lv_obj_set_event_cb(buttonText[i], event_handler); + + lv_btn_set_style(buttonText[i], LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_btn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_lable_rel); + + //lv_imgbtn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); + lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); + //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL,0); + //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_REL, &bmp_pic_100x40); + //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_PR, &bmp_pic_100x40); + lv_obj_set_pos(buttonText[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1)+FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL+INTERVAL_H+titleHeight+FILE_PRE_PIC_Y_OFFSET+100); + lv_obj_set_size(buttonText[i],100,40); + } + labelPageUp[i] = lv_label_create(buttonText[i], NULL); + lv_obj_set_style(labelPageUp[i], &tft_style_lable_rel); + lv_label_set_text(labelPageUp[i], public_buf_m); + lv_obj_align(labelPageUp[i], buttonText[i], LV_ALIGN_IN_BOTTOM_MID,0, 0); + } + else { + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler,(i+1),"bmp_File.bin",0); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic); + if (i < 3) + lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1), titleHeight); + else + lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1), BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + labelPageUp[i] = lv_label_create(buttonGcode[i], NULL); + lv_obj_set_style(labelPageUp[i], &tft_style_lable_rel); + lv_label_set_text(labelPageUp[i], public_buf_m); + lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID,0, -5); + } + } + + #else + + #endif + } } -void lv_open_gcode_file(char *path) -{ - #if ENABLED(SDSUPPORT) - //uint32_t read; - uint32_t *ps4; - int pre_sread_cnt; - char *cur_name; - - cur_name=strrchr(path,'/'); - - card.openFileRead(cur_name); - card.read(public_buf, 512); - ps4 = (uint32_t *)strstr((char *)public_buf,";simage:"); - - if(ps4) - { - pre_sread_cnt = (uint32_t)ps4-(uint32_t)((uint32_t *)(&public_buf[0])); - card.setIndex(pre_sread_cnt+8); - } - #endif -} +void lv_open_gcode_file(char *path) { + #if ENABLED(SDSUPPORT) + //uint32_t read; + uint32_t *ps4; + int pre_sread_cnt; + char *cur_name; -int ascii2dec_test(char *ascii) -{ - int result = 0; + cur_name=strrchr(path,'/'); - if(ascii == 0) - return 0; + card.openFileRead(cur_name); + card.read(public_buf, 512); + ps4 = (uint32_t *)strstr((char *)public_buf,";simage:"); - if(*(ascii) >= '0' && *(ascii) <= '9') - result = *(ascii) - '0'; - else if(*(ascii) >= 'a' && *(ascii) <= 'f') - result = *(ascii) - 'a' + 0x0a; - else if(*(ascii) >= 'A' && *(ascii) <= 'F') - result = *(ascii) - 'A' + 0x0a; - else - return 0; + if (ps4) { + pre_sread_cnt = (uint32_t)ps4-(uint32_t)((uint32_t *)(&public_buf[0])); + card.setIndex(pre_sread_cnt+8); + } + #endif +} + +int ascii2dec_test(char *ascii) { + int result = 0; + if (ascii == 0) return 0; - return result; + if (*(ascii) >= '0' && *(ascii) <= '9') + result = *(ascii) - '0'; + else if (*(ascii) >= 'a' && *(ascii) <= 'f') + result = *(ascii) - 'a' + 0x0a; + else if (*(ascii) >= 'A' && *(ascii) <= 'F') + result = *(ascii) - 'A' + 0x0a; + else + return 0; + + return result; } -void lv_gcode_file_read(uint8_t *data_buf) -{ - #if ENABLED(SDSUPPORT) - uint16_t i=0,j=0,k=0; - //uint32_t read; - uint16_t row_1=0; - char temp_test[200]; - - while(1) - { - card.read(temp_test, 200); - for(i=0;i<200;) - { - public_buf[row_1*200+100*k+j] = (char)(ascii2dec_test(&temp_test[i])<<4|ascii2dec_test(&temp_test[i+1])); - j++; - i+=2; - } - k++; - j=0; - if(k*100>=200) - { - k=0; - card.read(temp_test, 9); - break; - } - } - memcpy(data_buf,public_buf,200); - #endif +void lv_gcode_file_read(uint8_t *data_buf) { + #if ENABLED(SDSUPPORT) + uint16_t i = 0, j = 0, k = 0; + //uint32_t read; + uint16_t row_1 = 0; + char temp_test[200]; + + while (1) { + card.read(temp_test, 200); + for (i = 0;i < 200;) { + public_buf[row_1 * 200 + 100 * k + j] = (char)(ascii2dec_test(&temp_test[i]) << 4 | ascii2dec_test(&temp_test[i+1])); + j++; + i += 2; + } + k++; + j = 0; + if (k >= 2) { + k = 0; + card.read(temp_test, 9); + break; + } + } + memcpy(data_buf,public_buf,200); + #endif } -void lv_close_gcode_file() -{ - #if ENABLED(SDSUPPORT) - card.closefile(); - #endif +void lv_close_gcode_file() { + TERN_(SDSUPPORT, card.closefile()); } -void cutFileName(char *path, int len, int bytePerLine, char *outStr) -{ - #if _LFN_UNICODE - TCHAR *tmpFile; - TCHAR *strIndex1 = 0, *strIndex2 = 0, *beginIndex; - TCHAR secSeg[10] = {0}; - TCHAR gFileTail[4] = {'~', '.', 'g', '\0'}; - #else - char *tmpFile; - char *strIndex1 = 0, *strIndex2 = 0, *beginIndex; - char secSeg[10] = {0}; - #endif - - if(path == 0 || len <= 3 || outStr == 0) - { - return; - } - - tmpFile = path; - #if _LFN_UNICODE - strIndex1 = (WCHAR *)wcsstr((const WCHAR *)tmpFile, (const WCHAR *)'/'); - strIndex2 = (WCHAR *)wcsstr((const WCHAR *)tmpFile, (const WCHAR *)'.'); - #else - strIndex1 = (char *)strrchr(tmpFile, '/'); - strIndex2 = (char *)strrchr(tmpFile, '.'); - #endif - - if(strIndex1 != 0) - { - beginIndex = strIndex1 + 1; - } - /*if((strIndex1 != 0) && (strIndex2 != 0) && (strIndex1 < strIndex2)) - { - beginIndex = strIndex1 + 1; - }*/ - else - { - beginIndex = tmpFile; - } - - if(strIndex2 == 0 || (strIndex1 > strIndex2)) //not gcode file - { - #if _LFN_UNICODE - if(wcslen(beginIndex) > len) - { - wcsncpy(outStr, beginIndex, len); - - } - else - { - wcscpy(outStr, beginIndex); - } - #else - if((int)strlen(beginIndex) > len) - { - strncpy(outStr, beginIndex, len); - - } - else - { - strcpy(outStr, beginIndex); - } - #endif - } - else //gcode file - { - if(strIndex2 - beginIndex > (len - 2)) - { - #if _LFN_UNICODE - wcsncpy(outStr, (const WCHAR *)beginIndex, len - 3); - wcscat(outStr, (const WCHAR *)gFileTail); - #else - //strncpy(outStr, beginIndex, len - 3); - strncpy(outStr, beginIndex, len - 4); - strcat(outStr, "~.g"); - #endif - - } - else - { - #if _LFN_UNICODE - wcsncpy(outStr, (const WCHAR *)beginIndex, strIndex2 - beginIndex + 1); - wcscat(outStr, (const WCHAR *)&gFileTail[3]); - #else - strncpy(outStr, beginIndex, strIndex2 - beginIndex + 1); - strcat(outStr, "g"); - #endif - } - - } - #if _LFN_UNICODE - if(wcslen(outStr) > bytePerLine) - { - - wcscpy(secSeg, (const WCHAR *)&outStr[bytePerLine]); - outStr[bytePerLine] = '\n'; - outStr[bytePerLine + 1] = '\0'; - wcscat(outStr, (const WCHAR *)secSeg); - - } - #else - if((int)strlen(outStr) > bytePerLine) - { - - strcpy(secSeg, &outStr[bytePerLine]); - outStr[bytePerLine] = '\n'; - outStr[bytePerLine + 1] = '\0'; - strcat(outStr, secSeg); - - } - else - { - strcat(outStr,"\n"); - } - #endif +void cutFileName(char *path, int len, int bytePerLine, char *outStr) { + #if _LFN_UNICODE + TCHAR *tmpFile; + TCHAR *strIndex1 = 0, *strIndex2 = 0, *beginIndex; + TCHAR secSeg[10] = {0}; + TCHAR gFileTail[4] = {'~', '.', 'g', '\0'}; + #else + char *tmpFile; + char *strIndex1 = 0, *strIndex2 = 0, *beginIndex; + char secSeg[10] = {0}; + #endif + + if (path == 0 || len <= 3 || outStr == 0) return; + + tmpFile = path; + #if _LFN_UNICODE + strIndex1 = (WCHAR *)wcsstr((const WCHAR *)tmpFile, (const WCHAR *)'/'); + strIndex2 = (WCHAR *)wcsstr((const WCHAR *)tmpFile, (const WCHAR *)'.'); + #else + strIndex1 = (char *)strrchr(tmpFile, '/'); + strIndex2 = (char *)strrchr(tmpFile, '.'); + #endif + + beginIndex = (strIndex1 != 0 + // && (strIndex2 != 0) && (strIndex1 < strIndex2) + ) ? strIndex1 + 1 : tmpFile; + + if (strIndex2 == 0 || (strIndex1 > strIndex2)) { // not gcode file + #if _LFN_UNICODE + if (wcslen(beginIndex) > len) + wcsncpy(outStr, beginIndex, len); + else + wcscpy(outStr, beginIndex); + #else + if ((int)strlen(beginIndex) > len) + strncpy(outStr, beginIndex, len); + else + strcpy(outStr, beginIndex); + #endif + } + else { //gcode file + if (strIndex2 - beginIndex > (len - 2)) { + #if _LFN_UNICODE + wcsncpy(outStr, (const WCHAR *)beginIndex, len - 3); + wcscat(outStr, (const WCHAR *)gFileTail); + #else + //strncpy(outStr, beginIndex, len - 3); + strncpy(outStr, beginIndex, len - 4); + strcat(outStr, "~.g"); + #endif + } + else { + #if _LFN_UNICODE + wcsncpy(outStr, (const WCHAR *)beginIndex, strIndex2 - beginIndex + 1); + wcscat(outStr, (const WCHAR *)&gFileTail[3]); + #else + strncpy(outStr, beginIndex, strIndex2 - beginIndex + 1); + strcat(outStr, "g"); + #endif + } + } + + #if _LFN_UNICODE + if (wcslen(outStr) > bytePerLine) { + wcscpy(secSeg, (const WCHAR *)&outStr[bytePerLine]); + outStr[bytePerLine] = '\n'; + outStr[bytePerLine + 1] = '\0'; + wcscat(outStr, (const WCHAR *)secSeg); + } + #else + if ((int)strlen(outStr) > bytePerLine) { + strcpy(secSeg, &outStr[bytePerLine]); + outStr[bytePerLine] = '\n'; + outStr[bytePerLine + 1] = '\0'; + strcat(outStr, secSeg); + } + else + strcat(outStr, "\n"); + #endif } -void lv_clear_print_file() -{ - lv_obj_del(scr); +void lv_clear_print_file() { + lv_obj_del(scr); } -#endif +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp index 7d5fba3abb6f..32499225eb90 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp @@ -19,36 +19,40 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + #include "lv_conf.h" +#include "draw_ui.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -//#include "../MarlinCore.h" -#include "draw_ui.h" + +#include "../../../../MarlinCore.h" #include "../../../../module/temperature.h" #include "../../../../module/motion.h" #include "../../../../sd/cardreader.h" #include "../../../../gcode/queue.h" + #if ENABLED(POWER_LOSS_RECOVERY) -#include "../../../../feature/powerloss.h" + #include "../../../../feature/powerloss.h" #endif static lv_obj_t * scr; -static lv_obj_t * labelExt1,* labelExt2,* labelFan,* labelZpos,* labelTime; -static lv_obj_t * labelPause,* labelStop,* labelOperat; +static lv_obj_t * labelExt1, * labelExt2, * labelFan, * labelZpos, * labelTime; +static lv_obj_t * labelPause, * labelStop, * labelOperat; static lv_obj_t * bar1; -static lv_obj_t * buttonPause,*buttonOperat,*buttonStop; +static lv_obj_t * buttonPause, *buttonOperat, *buttonStop; + #if HAS_HEATED_BED -static lv_obj_t* labelBed; + static lv_obj_t* labelBed; #endif -#define ID_PAUSE 1 -#define ID_STOP 2 -#define ID_OPTION 3 +#define ID_PAUSE 1 +#define ID_STOP 2 +#define ID_OPTION 3 lv_style_t lv_bar_style_indic; @@ -58,418 +62,378 @@ extern uint8_t flash_preview_begin; extern uint8_t default_preview_flg; extern uint8_t gcode_preview_over; - - -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - switch(obj->mks_obj_id) - { - case ID_PAUSE: - if(event == LV_EVENT_CLICKED) { - - - } - else if(event == LV_EVENT_RELEASED) { - if(gcode_preview_over != 1) - { - if(uiCfg.print_state == WORKING) - { - //#if ENABLED(PARK_HEAD_ON_PAUSE) - //queue.inject_P(PSTR("M25 P\nM24")); - #if ENABLED(SDSUPPORT) - //queue.inject_P(PSTR("M25\nG91\nG1 Z10\nG90")); - card.pauseSDPrint(); - stop_print_time(); - uiCfg.print_state = PAUSING; - - #endif - - lv_obj_set_event_cb_mks(buttonPause, event_handler,ID_PAUSE,"bmp_Pause.bin",0); - lv_label_set_text(labelPause, printing_menu.resume); - lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER,30, 0); - } - else if(uiCfg.print_state == PAUSED) - { - uiCfg.print_state = RESUMING; - - //if (IS_SD_PAUSED())queue.inject_P(PSTR("M24"));// queue.inject_P(M24_STR); - - lv_obj_set_event_cb_mks(obj, event_handler,ID_PAUSE,"bmp_Resume.bin",0); - lv_label_set_text(labelPause, printing_menu.pause); - lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER,30, 0); - } - #if ENABLED(POWER_LOSS_RECOVERY) - else if(uiCfg.print_state == REPRINTING) - { - uiCfg.print_state = REPRINTED; - lv_obj_set_event_cb_mks(obj, event_handler,ID_PAUSE,"bmp_Resume.bin",0); - lv_label_set_text(labelPause, printing_menu.pause); - lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER,30, 0); - //recovery.resume(); - print_time.minutes = recovery.info.print_job_elapsed / 60; - print_time.seconds = recovery.info.print_job_elapsed % 60; - print_time.hours = print_time.minutes / 60; - } - #endif - } - } - break; - - case ID_STOP: - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) { - if(gcode_preview_over != 1) - { - lv_obj_del(scr); - lv_draw_dialog(DIALOG_TYPE_STOP); - } - } - break; - case ID_OPTION: - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) { - if(gcode_preview_over != 1) - { - lv_obj_del(scr); - lv_draw_opration(); - } - } - break; - - } +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_PAUSE: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (gcode_preview_over != 1) { + if (uiCfg.print_state == WORKING) { + //#if ENABLED(PARK_HEAD_ON_PAUSE) + //queue.inject_P(PSTR("M25 P\nM24")); + #if ENABLED(SDSUPPORT) + //queue.inject_P(PSTR("M25\nG91\nG1 Z10\nG90")); + card.pauseSDPrint(); + stop_print_time(); + uiCfg.print_state = PAUSING; + #endif + lv_obj_set_event_cb_mks(buttonPause, event_handler, ID_PAUSE, "bmp_Pause.bin", 0); + lv_label_set_text(labelPause, printing_menu.resume); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); + } + else if (uiCfg.print_state == PAUSED) { + uiCfg.print_state = RESUMING; + //if (IS_SD_PAUSED())queue.inject_P(PSTR("M24"));// queue.inject_P(M24_STR); + lv_obj_set_event_cb_mks(obj, event_handler, ID_PAUSE, "bmp_Resume.bin", 0); + lv_label_set_text(labelPause, printing_menu.pause); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); + } + #if ENABLED(POWER_LOSS_RECOVERY) + else if (uiCfg.print_state == REPRINTING) { + uiCfg.print_state = REPRINTED; + lv_obj_set_event_cb_mks(obj, event_handler, ID_PAUSE, "bmp_Resume.bin", 0); + lv_label_set_text(labelPause, printing_menu.pause); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); + //recovery.resume(); + print_time.minutes = recovery.info.print_job_elapsed / 60; + print_time.seconds = recovery.info.print_job_elapsed % 60; + print_time.hours = print_time.minutes / 60; + } + #endif + } + } + break; + + case ID_STOP: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (gcode_preview_over != 1) { + lv_obj_del(scr); + lv_draw_dialog(DIALOG_TYPE_STOP); + } + } + break; + case ID_OPTION: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + if (gcode_preview_over != 1) { + lv_obj_del(scr); + lv_draw_opration(); + } + } + break; + } } +void lv_draw_printing(void) { + lv_obj_t *buttonExt1, *buttonExt2, *buttonFanstate, *buttonZpos, *buttonTime; + TERN_(HAS_HEATED_BED, lv_obj_t *buttonBedstate); -void lv_draw_printing(void) -{ - lv_obj_t *buttonExt1,*buttonExt2,*buttonFanstate; - lv_obj_t *buttonZpos,*buttonTime; - #if HAS_HEATED_BED - lv_obj_t *buttonBedstate; - #endif + disp_state_stack._disp_index = 0; + ZERO(disp_state_stack._disp_state); + disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINTING_UI; - disp_state_stack._disp_index = 0; - memset(disp_state_stack._disp_state, 0, sizeof(disp_state_stack._disp_state)); - disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINTING_UI; + disp_state = PRINTING_UI; - disp_state = PRINTING_UI; + scr = lv_obj_create(NULL, NULL); - scr = lv_obj_create(NULL, NULL); + //static lv_style_t tool_style; - //static lv_style_t tool_style; - - lv_obj_set_style(scr, &tft_style_scr); + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - LV_IMG_DECLARE(bmp_pic_150x80); - LV_IMG_DECLARE(bmp_pic_45x45); - - - /*Create an Image button*/ - buttonExt1 = lv_imgbtn_create(scr, NULL); - if(EXTRUDERS == 2) - buttonExt2 = lv_imgbtn_create(scr, NULL); - #if HAS_HEATED_BED - buttonBedstate = lv_imgbtn_create(scr, NULL); - #endif - buttonFanstate = lv_imgbtn_create(scr, NULL); - buttonZpos = lv_imgbtn_create(scr, NULL); - buttonPause = lv_imgbtn_create(scr, NULL); - buttonStop = lv_imgbtn_create(scr, NULL); - buttonOperat = lv_imgbtn_create(scr, NULL); - buttonTime = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonExt1, event_handler,0,"bmp_Ext1_state.bin",0); - lv_imgbtn_set_src(buttonExt1, LV_BTN_STATE_REL, &bmp_pic_45x45); - lv_imgbtn_set_src(buttonExt1, LV_BTN_STATE_PR, &bmp_pic_45x45); - lv_imgbtn_set_style(buttonExt1, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonExt1, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_clear_protect(buttonExt1, LV_PROTECT_FOLLOW); - #if 1 - if(EXTRUDERS == 2) - { - lv_obj_set_event_cb_mks(buttonExt2, event_handler,0,"bmp_Ext2_state.bin",0); - lv_imgbtn_set_src(buttonExt2, LV_BTN_STATE_REL, &bmp_pic_45x45); - lv_imgbtn_set_src(buttonExt2, LV_BTN_STATE_PR, &bmp_pic_45x45); - lv_imgbtn_set_style(buttonExt2, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonExt2, LV_BTN_STATE_REL, &tft_style_lable_rel); - } - #if HAS_HEATED_BED - lv_obj_set_event_cb_mks(buttonBedstate, event_handler,0,"bmp_Bed_state.bin",0); - lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_REL, &bmp_pic_45x45); - lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_PR, &bmp_pic_45x45); - lv_imgbtn_set_style(buttonBedstate, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBedstate, LV_BTN_STATE_REL, &tft_style_lable_rel); - #endif - lv_obj_set_event_cb_mks(buttonFanstate, event_handler,0,"bmp_Fan_state.bin",0); + LV_IMG_DECLARE(bmp_pic_150x80); + LV_IMG_DECLARE(bmp_pic_45x45); + + /*Create an Image button*/ + buttonExt1 = lv_imgbtn_create(scr, NULL); + if (EXTRUDERS == 2) + buttonExt2 = lv_imgbtn_create(scr, NULL); + + #if HAS_HEATED_BED + buttonBedstate = lv_imgbtn_create(scr, NULL); + #endif + + buttonFanstate = lv_imgbtn_create(scr, NULL); + buttonZpos = lv_imgbtn_create(scr, NULL); + buttonPause = lv_imgbtn_create(scr, NULL); + buttonStop = lv_imgbtn_create(scr, NULL); + buttonOperat = lv_imgbtn_create(scr, NULL); + buttonTime = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonExt1, event_handler, 0, "bmp_Ext1_state.bin", 0); + lv_imgbtn_set_src(buttonExt1, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonExt1, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonExt1, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonExt1, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonExt1, LV_PROTECT_FOLLOW); + #if 1 + if (EXTRUDERS == 2) { + lv_obj_set_event_cb_mks(buttonExt2, event_handler, 0, "bmp_Ext2_state.bin", 0); + lv_imgbtn_set_src(buttonExt2, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonExt2, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonExt2, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonExt2, LV_BTN_STATE_REL, &tft_style_lable_rel); + } + #if HAS_HEATED_BED + lv_obj_set_event_cb_mks(buttonBedstate, event_handler, 0, "bmp_Bed_state.bin", 0); + lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonBedstate, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBedstate, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif + + lv_obj_set_event_cb_mks(buttonFanstate, event_handler, 0, "bmp_Fan_state.bin", 0); lv_imgbtn_set_src(buttonFanstate, LV_BTN_STATE_REL, &bmp_pic_45x45); lv_imgbtn_set_src(buttonFanstate, LV_BTN_STATE_PR, &bmp_pic_45x45); - lv_imgbtn_set_style(buttonFanstate, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonFanstate, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonFanstate, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonFanstate, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonTime, event_handler,0,"bmp_Time_state.bin",0); + lv_obj_set_event_cb_mks(buttonTime, event_handler, 0, "bmp_Time_state.bin", 0); lv_imgbtn_set_src(buttonTime, LV_BTN_STATE_REL, &bmp_pic_45x45); lv_imgbtn_set_src(buttonTime, LV_BTN_STATE_PR, &bmp_pic_45x45); - lv_imgbtn_set_style(buttonTime, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonTime, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonTime, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonTime, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonZpos, event_handler,0,"bmp_Zpos_state.bin",0); + lv_obj_set_event_cb_mks(buttonZpos, event_handler, 0, "bmp_Zpos_state.bin", 0); lv_imgbtn_set_src(buttonZpos, LV_BTN_STATE_REL, &bmp_pic_45x45); lv_imgbtn_set_src(buttonZpos, LV_BTN_STATE_PR, &bmp_pic_45x45); - lv_imgbtn_set_style(buttonZpos, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonZpos, LV_BTN_STATE_REL, &tft_style_lable_rel); - if(uiCfg.print_state == WORKING) - lv_obj_set_event_cb_mks(buttonPause, event_handler,ID_PAUSE,"bmp_Resume.bin",0); - else - lv_obj_set_event_cb_mks(buttonPause, event_handler,ID_PAUSE,"bmp_Pause.bin",0); + lv_imgbtn_set_style(buttonZpos, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonZpos, LV_BTN_STATE_REL, &tft_style_lable_rel); + + if (uiCfg.print_state == WORKING) + lv_obj_set_event_cb_mks(buttonPause, event_handler, ID_PAUSE, "bmp_Resume.bin", 0); + else + lv_obj_set_event_cb_mks(buttonPause, event_handler, ID_PAUSE, "bmp_Pause.bin", 0); + lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_REL, &bmp_pic_150x80); lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_PR, &bmp_pic_150x80); - lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonStop, event_handler,ID_STOP,"bmp_Stop.bin",0); + lv_obj_set_event_cb_mks(buttonStop, event_handler, ID_STOP, "bmp_Stop.bin", 0); lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_REL, &bmp_pic_150x80); lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_PR, &bmp_pic_150x80); - lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonOperat, event_handler,ID_OPTION,"bmp_Operate.bin",0); + lv_obj_set_event_cb_mks(buttonOperat, event_handler, ID_OPTION, "bmp_Operate.bin", 0); lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_REL, &bmp_pic_150x80); lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_PR, &bmp_pic_150x80); - lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_REL, &tft_style_lable_rel); - - #endif - - lv_obj_set_pos(buttonExt1,205,136); - if(EXTRUDERS == 2) - lv_obj_set_pos(buttonExt2,350,136); - #if HAS_HEATED_BED - lv_obj_set_pos(buttonBedstate,205,186); - #endif - lv_obj_set_pos(buttonFanstate,350,186); - lv_obj_set_pos(buttonTime,205,86); - lv_obj_set_pos(buttonZpos,350,86); - lv_obj_set_pos(buttonPause,5,240); - lv_obj_set_pos(buttonStop,165,240); - lv_obj_set_pos(buttonOperat,325,240); + lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif - /*Create a label on the Image button*/ - lv_btn_set_layout(buttonExt1, LV_LAYOUT_OFF); - if(EXTRUDERS == 2) - lv_btn_set_layout(buttonExt2, LV_LAYOUT_OFF); - #if HAS_HEATED_BED - lv_btn_set_layout(buttonBedstate, LV_LAYOUT_OFF); - #endif - lv_btn_set_layout(buttonFanstate, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonZpos, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonPause, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonStop, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonOperat, LV_LAYOUT_OFF); - - labelExt1 = lv_label_create(scr, NULL); - lv_obj_set_style(labelExt1, &tft_style_lable_rel); - lv_obj_set_pos(labelExt1,250,146); - if(EXTRUDERS == 2) - { - labelExt2 = lv_label_create(scr, NULL); - lv_obj_set_style(labelExt2, &tft_style_lable_rel); - lv_obj_set_pos(labelExt2,395,146); - } - #if HAS_HEATED_BED - labelBed = lv_label_create(scr, NULL); - lv_obj_set_style(labelBed, &tft_style_lable_rel); - lv_obj_set_pos(labelBed,250,196); - #endif - - labelFan = lv_label_create(scr, NULL); - lv_obj_set_style(labelFan, &tft_style_lable_rel); - lv_obj_set_pos(labelFan,395,196); - - labelZpos = lv_label_create(scr, NULL); - lv_obj_set_style(labelZpos, &tft_style_lable_rel); - lv_obj_set_pos(labelZpos,395,96); - - labelTime = lv_label_create(scr, NULL); - lv_obj_set_style(labelTime, &tft_style_lable_rel); - lv_obj_set_pos(labelTime,250,96); - - labelPause = lv_label_create(buttonPause, NULL); - labelStop = lv_label_create(buttonStop, NULL); - labelOperat = lv_label_create(buttonOperat, NULL); - - - if(gCfgItems.multiple_language !=0) - { - if(uiCfg.print_state == WORKING) - { - lv_label_set_text(labelPause, printing_menu.pause); - } - else - { - lv_label_set_text(labelPause, printing_menu.resume); - } - lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER,30, 0); - - lv_label_set_text(labelStop, printing_menu.stop); - lv_obj_align(labelStop, buttonStop, LV_ALIGN_CENTER,30, 0); - - lv_label_set_text(labelOperat, printing_menu.option); - lv_obj_align(labelOperat, buttonOperat, LV_ALIGN_CENTER,30, 0); - } - - lv_style_copy(&lv_bar_style_indic, &lv_style_pretty_color); - lv_bar_style_indic.text.color = lv_color_hex3(0xADF); - lv_bar_style_indic.image.color = lv_color_hex3(0xADF); - lv_bar_style_indic.line.color = lv_color_hex3(0xADF); - 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); - bar1 = lv_bar_create(scr, NULL); - lv_obj_set_pos(bar1, 205, 36); - lv_obj_set_size(bar1, 270, 40); - lv_bar_set_style(bar1, LV_BAR_STYLE_INDIC, &lv_bar_style_indic); - lv_bar_set_anim_time(bar1, 1000); - lv_bar_set_value(bar1, 0, LV_ANIM_ON); - - disp_ext_temp(); - disp_bed_temp(); - disp_fan_speed(); - disp_print_time(); - disp_fan_Zpos(); + lv_obj_set_pos(buttonExt1, 205, 136); + if (EXTRUDERS == 2) + lv_obj_set_pos(buttonExt2, 350, 136); + + #if HAS_HEATED_BED + lv_obj_set_pos(buttonBedstate, 205, 186); + #endif + lv_obj_set_pos(buttonFanstate, 350, 186); + lv_obj_set_pos(buttonTime, 205, 86); + lv_obj_set_pos(buttonZpos, 350, 86); + lv_obj_set_pos(buttonPause, 5, 240); + lv_obj_set_pos(buttonStop, 165, 240); + lv_obj_set_pos(buttonOperat, 325, 240); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonExt1, LV_LAYOUT_OFF); + if (EXTRUDERS == 2) + lv_btn_set_layout(buttonExt2, LV_LAYOUT_OFF); + + #if HAS_HEATED_BED + lv_btn_set_layout(buttonBedstate, LV_LAYOUT_OFF); + #endif + + lv_btn_set_layout(buttonFanstate, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonZpos, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPause, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonStop, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOperat, LV_LAYOUT_OFF); + + labelExt1 = lv_label_create(scr, NULL); + lv_obj_set_style(labelExt1, &tft_style_lable_rel); + lv_obj_set_pos(labelExt1, 250, 146); + + if (EXTRUDERS == 2) { + labelExt2 = lv_label_create(scr, NULL); + lv_obj_set_style(labelExt2, &tft_style_lable_rel); + lv_obj_set_pos(labelExt2, 395, 146); + } + + #if HAS_HEATED_BED + labelBed = lv_label_create(scr, NULL); + lv_obj_set_style(labelBed, &tft_style_lable_rel); + lv_obj_set_pos(labelBed, 250, 196); + #endif + + labelFan = lv_label_create(scr, NULL); + lv_obj_set_style(labelFan, &tft_style_lable_rel); + lv_obj_set_pos(labelFan, 395, 196); + + labelZpos = lv_label_create(scr, NULL); + lv_obj_set_style(labelZpos, &tft_style_lable_rel); + lv_obj_set_pos(labelZpos, 395, 96); + + labelTime = lv_label_create(scr, NULL); + lv_obj_set_style(labelTime, &tft_style_lable_rel); + lv_obj_set_pos(labelTime, 250, 96); + + labelPause = lv_label_create(buttonPause, NULL); + labelStop = lv_label_create(buttonStop, NULL); + labelOperat = lv_label_create(buttonOperat, NULL); + + if (gCfgItems.multiple_language !=0) { + if (uiCfg.print_state == WORKING) + lv_label_set_text(labelPause, printing_menu.pause); + else + lv_label_set_text(labelPause, printing_menu.resume); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); + + lv_label_set_text(labelStop, printing_menu.stop); + lv_obj_align(labelStop, buttonStop, LV_ALIGN_CENTER, 30, 0); + + lv_label_set_text(labelOperat, printing_menu.option); + lv_obj_align(labelOperat, buttonOperat, LV_ALIGN_CENTER, 30, 0); + } + + lv_style_copy(&lv_bar_style_indic, &lv_style_pretty_color); + lv_bar_style_indic.text.color = lv_color_hex3(0xADF); + lv_bar_style_indic.image.color = lv_color_hex3(0xADF); + lv_bar_style_indic.line.color = lv_color_hex3(0xADF); + 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); + + bar1 = lv_bar_create(scr, NULL); + lv_obj_set_pos(bar1, 205, 36); + lv_obj_set_size(bar1, 270, 40); + lv_bar_set_style(bar1, LV_BAR_STYLE_INDIC, &lv_bar_style_indic); + lv_bar_set_anim_time(bar1, 1000); + lv_bar_set_value(bar1, 0, LV_ANIM_ON); + + disp_ext_temp(); + disp_bed_temp(); + disp_fan_speed(); + disp_print_time(); + disp_fan_Zpos(); } -void disp_ext_temp() -{ - memset(public_buf_l, 0, sizeof(public_buf_l)); - sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target); - lv_label_set_text(labelExt1, public_buf_l); - - if(EXTRUDERS == 2) - { - memset(public_buf_l, 0, sizeof(public_buf_l)); - sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[1].celsius, (int)thermalManager.temp_hotend[1].target); - lv_label_set_text(labelExt2, public_buf_l); - } +void disp_ext_temp() { + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target); + lv_label_set_text(labelExt1, public_buf_l); + + if (EXTRUDERS == 2) { + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[1].celsius, (int)thermalManager.temp_hotend[1].target); + lv_label_set_text(labelExt2, public_buf_l); + } } -void disp_bed_temp() -{ - #if HAS_HEATED_BED - memset(public_buf_l,0,sizeof(public_buf_l)); - sprintf(public_buf_l,printing_menu.bed_temp,(int)thermalManager.temp_bed.celsius,(int)thermalManager.temp_bed.target); - lv_label_set_text(labelBed, public_buf_l); - #endif +void disp_bed_temp() { + #if HAS_HEATED_BED + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, printing_menu.bed_temp, (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target); + lv_label_set_text(labelBed, public_buf_l); + #endif } -void disp_fan_speed() -{ - memset(public_buf_l, 0, sizeof(public_buf_l)); - sprintf(public_buf_l, "%3d", thermalManager.fan_speed[0]); - lv_label_set_text(labelFan, public_buf_l); +void disp_fan_speed() { + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, "%3d", thermalManager.fan_speed[0]); + lv_label_set_text(labelFan, public_buf_l); } -void disp_print_time() -{ - memset(public_buf_l, 0, sizeof(public_buf_l)); - sprintf(public_buf_l, "%d%d:%d%d:%d%d", print_time.hours/10, print_time.hours%10, print_time.minutes/10, print_time.minutes%10, print_time.seconds/10, print_time.seconds%10); - lv_label_set_text(labelTime, public_buf_l); +void disp_print_time() { + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, "%d%d:%d%d:%d%d", print_time.hours/10, print_time.hours%10, print_time.minutes/10, print_time.minutes%10, print_time.seconds/10, print_time.seconds%10); + lv_label_set_text(labelTime, public_buf_l); } -void disp_fan_Zpos() -{ - memset(public_buf_l, 0, sizeof(public_buf_l)); - sprintf(public_buf_l,"%.3f",current_position[Z_AXIS]); - lv_label_set_text(labelZpos, public_buf_l); +void disp_fan_Zpos() { + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, "%.3f", current_position[Z_AXIS]); + lv_label_set_text(labelZpos, public_buf_l); } -void reset_print_time() -{ - //print_time.days = 0; - print_time.hours = 0; - print_time.minutes = 0; - print_time.seconds = 0; - print_time.ms_10 = 0; - //print_time.start = 1; +void reset_print_time() { + //print_time.days = 0; + print_time.hours = 0; + print_time.minutes = 0; + print_time.seconds = 0; + print_time.ms_10 = 0; + //print_time.start = 1; } -void start_print_time() -{ - print_time.start = 1; +void start_print_time() { + print_time.start = 1; } -void stop_print_time() -{ - print_time.start = 0; +void stop_print_time() { + print_time.start = 0; } -void setProBarRate() -{ - int rate; - volatile long long rate_tmp_r; - - if(gCfgItems.from_flash_pic != 1) - { - #if ENABLED(SDSUPPORT) - rate_tmp_r =(long long)card.getIndex() * 100; - #endif - rate = rate_tmp_r / gCfgItems.curFilesize; - } - else - { - #if ENABLED(SDSUPPORT) - rate_tmp_r =(long long)card.getIndex(); - #endif - rate = (rate_tmp_r-(PREVIEW_SIZE+To_pre_view))* 100 / (gCfgItems.curFilesize-(PREVIEW_SIZE+To_pre_view)); - } - //gCurFileState.totalSend = rate; - - if(rate <= 0) - return; - - if(disp_state == PRINTING_UI) - { - lv_bar_set_value(bar1, rate, LV_ANIM_ON); - - if(marlin_state == MF_SD_COMPLETE) - { - if(once_flag == 0) - { - stop_print_time(); - - flash_preview_begin = 0; - default_preview_flg = 0; - lv_clear_printing(); - lv_draw_dialog(DIALOG_TYPE_FINISH_PRINT); - - once_flag = 1; - - #if HAS_SUICIDE - if(gCfgItems.finish_power_off == 1) - suicide(); - #endif - } - } - - } +void setProBarRate() { + int rate; + volatile long long rate_tmp_r; + + if (gCfgItems.from_flash_pic != 1) { + #if ENABLED(SDSUPPORT) + rate_tmp_r =(long long)card.getIndex() * 100; + #endif + rate = rate_tmp_r / gCfgItems.curFilesize; + } + else { + #if ENABLED(SDSUPPORT) + rate_tmp_r =(long long)card.getIndex(); + #endif + rate = (rate_tmp_r-(PREVIEW_SIZE+To_pre_view))* 100 / (gCfgItems.curFilesize-(PREVIEW_SIZE+To_pre_view)); + } + //gCurFileState.totalSend = rate; + + if (rate <= 0) return; + + if (disp_state == PRINTING_UI) { + lv_bar_set_value(bar1, rate, LV_ANIM_ON); + + if (marlin_state == MF_SD_COMPLETE) { + if (once_flag == 0) { + stop_print_time(); + + flash_preview_begin = 0; + default_preview_flg = 0; + lv_clear_printing(); + lv_draw_dialog(DIALOG_TYPE_FINISH_PRINT); + + once_flag = 1; + + #if HAS_SUICIDE + if (gCfgItems.finish_power_off == 1) + suicide(); + #endif + } + } + } } -void lv_clear_printing() -{ - lv_obj_del(scr); +void lv_clear_printing() { + lv_obj_del(scr); } -#endif +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp index 9ac408de0d24..4e8ebb942e59 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp @@ -19,9 +19,11 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + +#include "../../../../MarlinCore.h" #include "draw_ready_print.h" #include "draw_tool.h" #include "lv_conf.h" @@ -49,13 +51,13 @@ uint8_t curent_disp_ui = 0; static void event_handler(lv_obj_t * obj, lv_event_t event) { - switch(obj->mks_obj_id) + switch (obj->mks_obj_id) { case ID_TOOL: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { #if ENABLED(MKS_TEST) curent_disp_ui = 2; #endif @@ -64,19 +66,19 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_SET: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { lv_obj_del(scr); lv_draw_set(); } break; case ID_PRINT: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { lv_obj_del(scr); lv_draw_print_file(); } @@ -309,7 +311,7 @@ void lv_draw_ready_print(void) lv_obj_t * label_print = lv_label_create(buttonPrint, NULL); lv_obj_t * label_set = lv_label_create(buttonSet, NULL); lv_obj_t * label_tool = lv_label_create(buttonTool, NULL); - if(gCfgItems.multiple_language !=0) + if (gCfgItems.multiple_language !=0) { lv_label_set_text(label_print, main_menu.print); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp index a02e972d4ab1..c56a13408337 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp @@ -19,9 +19,11 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + +#include "../../../../MarlinCore.h" #include "draw_ready_print.h" #include "draw_set.h" #include "lv_conf.h" @@ -44,31 +46,31 @@ static lv_obj_t * scr; static void event_handler(lv_obj_t * obj, lv_event_t event) { - switch(obj->mks_obj_id) + switch (obj->mks_obj_id) { case ID_S_WIFI: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { } break; case ID_S_FAN: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { lv_obj_del(scr); lv_draw_fan(); } break; case ID_S_ABOUT: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { lv_obj_del(scr); lv_draw_about(); } @@ -77,10 +79,10 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) break; case ID_S_MOTOR_OFF: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { #if HAS_SUICIDE suicide(); #else @@ -89,19 +91,19 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) } break; case ID_S_LANGUAGE: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { lv_obj_del(scr); lv_draw_language(); } break; case ID_S_RETURN: - if(event == LV_EVENT_CLICKED) { + if (event == LV_EVENT_CLICKED) { } - else if(event == LV_EVENT_RELEASED) { + else if (event == LV_EVENT_RELEASED) { lv_obj_del(scr); lv_draw_ready_print(); } @@ -116,7 +118,7 @@ void lv_draw_set(void) lv_obj_t *buttonFan,*buttonAbout; lv_obj_t *buMotorOff,*buttonLanguage,*buttonBack; - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != SET_UI) + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != SET_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = SET_UI; @@ -232,7 +234,7 @@ void lv_draw_set(void) lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - if(gCfgItems.multiple_language !=0) + if (gCfgItems.multiple_language !=0) { //lv_label_set_text(labelWifi, set_menu.wifi); //lv_obj_align(labelWifi, buttonWifi, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp index 38a1487564bd..b243c2018a4f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp @@ -19,280 +19,248 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + #include "lv_conf.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" #include "draw_ui.h" + +#include "../../../../MarlinCore.h" #include "../../../../gcode/queue.h" //static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn; static lv_obj_t * scr; #if ENABLED(MKS_TEST) -extern uint8_t curent_disp_ui; + extern uint8_t curent_disp_ui; #endif -#define ID_T_PRE_HEAT 1 -#define ID_T_EXTRUCT 2 -#define ID_T_MOV 3 -#define ID_T_HOME 4 -#define ID_T_LEVELING 5 -#define ID_T_FILAMENT 6 -#define ID_T_MORE 7 -#define ID_T_RETURN 8 - -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - switch(obj->mks_obj_id) - { - case ID_T_PRE_HEAT: - if(event == LV_EVENT_CLICKED) { - - - } - else if(event == LV_EVENT_RELEASED) { - lv_clear_tool(); - lv_draw_preHeat(); - } - break; - case ID_T_EXTRUCT: - if(event == LV_EVENT_CLICKED) { - - - } - else if(event == LV_EVENT_RELEASED) { - lv_clear_tool(); - lv_draw_extrusion(); - } - break; - case ID_T_MOV: - if(event == LV_EVENT_CLICKED) { - - - } - else if(event == LV_EVENT_RELEASED) { - lv_clear_tool(); - lv_draw_move_motor(); - } - - break; - case ID_T_HOME: - if(event == LV_EVENT_CLICKED) { - - - } - else if(event == LV_EVENT_RELEASED) { - lv_clear_tool(); - lv_draw_home(); - } - break; - case ID_T_LEVELING: - if(event == LV_EVENT_CLICKED) { - - - } - else if(event == LV_EVENT_RELEASED) { - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - queue.enqueue_one_P(PSTR("G28")); - queue.enqueue_one_P(PSTR("G29")); - #else - uiCfg.leveling_first_time = 1; - lv_clear_tool(); - lv_draw_manualLevel(); - #endif - } - - break; - case ID_T_FILAMENT: - - break; - case ID_T_MORE: - - break; - case ID_T_RETURN: - if(event == LV_EVENT_CLICKED) { - - } - else if(event == LV_EVENT_RELEASED) { - #if ENABLED(MKS_TEST) - curent_disp_ui = 1; - #endif - lv_obj_del(scr); - lv_draw_ready_print(); - } - break; - - } +#define ID_T_PRE_HEAT 1 +#define ID_T_EXTRUCT 2 +#define ID_T_MOV 3 +#define ID_T_HOME 4 +#define ID_T_LEVELING 5 +#define ID_T_FILAMENT 6 +#define ID_T_MORE 7 +#define ID_T_RETURN 8 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_T_PRE_HEAT: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_tool(); + lv_draw_preHeat(); + } + break; + case ID_T_EXTRUCT: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_tool(); + lv_draw_extrusion(); + } + break; + case ID_T_MOV: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_tool(); + lv_draw_move_motor(); + } + break; + case ID_T_HOME: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_tool(); + lv_draw_home(); + } + break; + case ID_T_LEVELING: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + queue.enqueue_one_P(PSTR("G28")); + queue.enqueue_one_P(PSTR("G29")); + #else + uiCfg.leveling_first_time = 1; + lv_clear_tool(); + lv_draw_manualLevel(); + #endif + } + break; + case ID_T_FILAMENT: break; + case ID_T_MORE: break; + case ID_T_RETURN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + TERN_(MKS_TEST, curent_disp_ui = 1); + lv_obj_del(scr); + lv_draw_ready_print(); + } + break; + } } +void lv_draw_tool(void) { + lv_obj_t *buttonPreHeat,*buttonExtrusion,*buttonMove,*buttonHome,*buttonLevel; + lv_obj_t *buttonBack; -void lv_draw_tool(void) -{ - lv_obj_t *buttonPreHeat,*buttonExtrusion,*buttonMove,*buttonHome,*buttonLevel; - lv_obj_t *buttonBack; - - if(disp_state_stack._disp_state[disp_state_stack._disp_index] != TOOL_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = TOOL_UI; - } - disp_state = TOOL_UI; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != TOOL_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = TOOL_UI; + } + disp_state = TOOL_UI; - scr = lv_obj_create(NULL, NULL); + scr = lv_obj_create(NULL, NULL); - //static lv_style_t tool_style; + //static lv_style_t tool_style; - lv_obj_set_style(scr, &tft_style_scr); + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - LV_IMG_DECLARE(bmp_pic); - - /*Create an Image button*/ - buttonPreHeat = lv_imgbtn_create(scr, NULL); - buttonExtrusion = lv_imgbtn_create(scr, NULL); - buttonMove = lv_imgbtn_create(scr, NULL); - buttonHome = lv_imgbtn_create(scr, NULL); - buttonLevel = lv_imgbtn_create(scr, NULL); - //buttonFilament = lv_imgbtn_create(scr, NULL); - //buttonMore = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - - lv_obj_set_event_cb_mks(buttonPreHeat, event_handler,ID_T_PRE_HEAT,"bmp_PreHeat.bin",0); - lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_clear_protect(buttonPreHeat, LV_PROTECT_FOLLOW); - #if 1 - lv_obj_set_event_cb_mks(buttonExtrusion, event_handler,ID_T_EXTRUCT,"bmp_Extruct.bin",0); - lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonMove, event_handler,ID_T_MOV,"bmp_Mov.bin",0); + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonPreHeat = lv_imgbtn_create(scr, NULL); + buttonExtrusion = lv_imgbtn_create(scr, NULL); + buttonMove = lv_imgbtn_create(scr, NULL); + buttonHome = lv_imgbtn_create(scr, NULL); + buttonLevel = lv_imgbtn_create(scr, NULL); + //buttonFilament = lv_imgbtn_create(scr, NULL); + //buttonMore = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonPreHeat, event_handler, ID_T_PRE_HEAT, "bmp_PreHeat.bin", 0); + lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonPreHeat, LV_PROTECT_FOLLOW); + + #if 1 + lv_obj_set_event_cb_mks(buttonExtrusion, event_handler, ID_T_EXTRUCT, "bmp_Extruct.bin", 0); + lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonMove, event_handler, ID_T_MOV, "bmp_Mov.bin", 0); lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonHome, event_handler,ID_T_HOME,"bmp_Zero.bin",0); + lv_obj_set_event_cb_mks(buttonHome, event_handler,ID_T_HOME,"bmp_Zero.bin",0); lv_imgbtn_set_src(buttonHome, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonHome, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonHome, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonHome, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonHome, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonHome, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonLevel, event_handler,ID_T_LEVELING,"bmp_Leveling.bin",0); + lv_obj_set_event_cb_mks(buttonLevel, event_handler,ID_T_LEVELING,"bmp_Leveling.bin",0); lv_imgbtn_set_src(buttonLevel, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonLevel, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_REL, &tft_style_lable_rel); - //lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_T_FILAMENT,"bmp_Filamentchange.bin",0); + //lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_T_FILAMENT,"bmp_Filamentchange.bin",0); //lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_REL, &bmp_pic); //lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, &bmp_pic); - //lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_PR, &tft_style_lable_pre); - //lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_REL, &tft_style_lable_rel); + //lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_PR, &tft_style_lable_pre); + //lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_REL, &tft_style_lable_rel); - //lv_obj_set_event_cb_mks(buttonMore, event_handler,ID_T_MORE,"bmp_More.bin",0); + //lv_obj_set_event_cb_mks(buttonMore, event_handler,ID_T_MORE,"bmp_More.bin",0); //lv_imgbtn_set_src(buttonMore, LV_BTN_STATE_REL, &bmp_pic); //lv_imgbtn_set_src(buttonMore, LV_BTN_STATE_PR, &bmp_pic); - //lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_PR, &tft_style_lable_pre); - //lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_REL, &tft_style_lable_rel); + //lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_PR, &tft_style_lable_pre); + //lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_T_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_T_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - - #endif - - lv_obj_set_pos(buttonPreHeat,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonExtrusion,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); - lv_obj_set_pos(buttonMove,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); - lv_obj_set_pos(buttonHome,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttonLevel,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - //lv_obj_set_pos(buttonFilament,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - //lv_obj_set_pos(buttonMore,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - - /*Create a label on the Image button*/ - lv_btn_set_layout(buttonPreHeat, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonExtrusion, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonMove, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonHome, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonLevel, LV_LAYOUT_OFF); - //lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF); - //lv_btn_set_layout(buttonMore, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t * labelPreHeat = lv_label_create(buttonPreHeat, NULL); - lv_obj_t * labelExtrusion = lv_label_create(buttonExtrusion, NULL); - lv_obj_t * label_Move = lv_label_create(buttonMove, NULL); - lv_obj_t * label_Home = lv_label_create(buttonHome, NULL); - lv_obj_t * label_Level = lv_label_create(buttonLevel, NULL); - //lv_obj_t * label_Filament = lv_label_create(buttonFilament, NULL); - //lv_obj_t * label_More = lv_label_create(buttonMore, NULL); - lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - - if(gCfgItems.multiple_language !=0) - { - lv_label_set_text(labelPreHeat, tool_menu.preheat); - lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelExtrusion, tool_menu.extrude); - lv_obj_align(labelExtrusion, buttonExtrusion, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Move, tool_menu.move); - lv_obj_align(label_Move, buttonMove, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Home, tool_menu.home); - lv_obj_align(label_Home, buttonHome, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - /*if(gCfgItems.leveling_mode != 2) - { - if(gCfgItems.leveling_mode == 1) - lv_label_set_text(label_Level, tool_menu.autoleveling); - else - lv_label_set_text(label_Level, tool_menu.leveling); - - lv_obj_align(label_Level, buttonLevel, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - }*/ - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - lv_label_set_text(label_Level, tool_menu.autoleveling); - #else - lv_label_set_text(label_Level, tool_menu.leveling); - #endif - lv_obj_align(label_Level, buttonLevel, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - //lv_label_set_text(label_Filament, tool_menu.filament); - //lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - //lv_label_set_text(label_More, tool_menu.more); - //lv_obj_align(label_More, buttonMore, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif + + lv_obj_set_pos(buttonPreHeat,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonExtrusion,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); + lv_obj_set_pos(buttonMove,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); + lv_obj_set_pos(buttonHome,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonLevel,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + //lv_obj_set_pos(buttonFilament,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + //lv_obj_set_pos(buttonMore,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonPreHeat, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonExtrusion, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonMove, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHome, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonLevel, LV_LAYOUT_OFF); + //lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF); + //lv_btn_set_layout(buttonMore, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelPreHeat = lv_label_create(buttonPreHeat, NULL); + lv_obj_t * labelExtrusion = lv_label_create(buttonExtrusion, NULL); + lv_obj_t * label_Move = lv_label_create(buttonMove, NULL); + lv_obj_t * label_Home = lv_label_create(buttonHome, NULL); + lv_obj_t * label_Level = lv_label_create(buttonLevel, NULL); + //lv_obj_t * label_Filament = lv_label_create(buttonFilament, NULL); + //lv_obj_t * label_More = lv_label_create(buttonMore, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language !=0) { + lv_label_set_text(labelPreHeat, tool_menu.preheat); + lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelExtrusion, tool_menu.extrude); + lv_obj_align(labelExtrusion, buttonExtrusion, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Move, tool_menu.move); + lv_obj_align(label_Move, buttonMove, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Home, tool_menu.home); + lv_obj_align(label_Home, buttonHome, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + /* + if (gCfgItems.leveling_mode != 2) { + lv_label_set_text(label_Level, gCfgItems.leveling_mode == 1 ? tool_menu.autoleveling : tool_menu.leveling); + lv_obj_align(label_Level, buttonLevel, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + */ + lv_label_set_text(label_Level, tool_menu.TERN(AUTO_BED_LEVELING_BILINEAR, autoleveling, leveling)); + lv_obj_align(label_Level, buttonLevel, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_text(label_Filament, tool_menu.filament); + //lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_text(label_More, tool_menu.more); + //lv_obj_align(label_More, buttonMore, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } } -void lv_clear_tool() -{ - lv_obj_del(scr); +void lv_clear_tool() { + lv_obj_del(scr); } + #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index 591aba7e4ebb..44871e3115dc 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -19,26 +19,31 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) -#include "draw_ui.h" -#include "../../../../sd/cardreader.h" + #include "W25Qxx.h" #include "tft_lvgl_configuration.h" #include "pic_manager.h" + +#include + +#if ENABLED(SPI_GRAPHICAL_TFT) + #include "SPI_TFT.h" +#endif + +#include "../../../../MarlinCore.h" +#include "../../../../sd/cardreader.h" #include "../../../../module/motion.h" #include "../../../../module/planner.h" + #if ENABLED(POWER_LOSS_RECOVERY) -#include "../../../../feature/powerloss.h" -#endif -#if ENABLED(PARK_HEAD_ON_PAUSE) -#include "../../../../feature/pause.h" + #include "../../../../feature/powerloss.h" #endif -#include -#if ENABLED(SPI_GRAPHICAL_TFT) -#include "SPI_TFT.h" +#if ENABLED(PARK_HEAD_ON_PAUSE) + #include "../../../../feature/pause.h" #endif CFG_ITMES gCfgItems; @@ -64,1374 +69,1143 @@ extern uint8_t bmp_public_buf[17 * 1024]; extern void LCD_IO_WriteData(uint16_t RegValue); -void gCfgItems_init() -{ - gCfgItems.multiple_language = MULTI_LANGUAGE_ENABLE; - gCfgItems.language = LANG_ENGLISH; - gCfgItems.leveling_mode = 0; - gCfgItems.from_flash_pic = 0; - gCfgItems.curFilesize = 0; - gCfgItems.finish_power_off = 0; - gCfgItems.pause_reprint = 0; - - W25QXX.SPI_FLASH_BufferRead((uint8_t *)&gCfgItems.spi_flash_flag,VAR_INF_ADDR,sizeof(gCfgItems.spi_flash_flag)); - if(gCfgItems.spi_flash_flag == GCFG_FLAG_VALUE) - { - W25QXX.SPI_FLASH_BufferRead((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); - } - else - { - gCfgItems.spi_flash_flag = GCFG_FLAG_VALUE; - W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); - W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); - } +void gCfgItems_init() { + gCfgItems.multiple_language = MULTI_LANGUAGE_ENABLE; + gCfgItems.language = LANG_ENGLISH; + gCfgItems.leveling_mode = 0; + gCfgItems.from_flash_pic = 0; + gCfgItems.curFilesize = 0; + gCfgItems.finish_power_off = 0; + gCfgItems.pause_reprint = 0; + + W25QXX.SPI_FLASH_BufferRead((uint8_t *)&gCfgItems.spi_flash_flag,VAR_INF_ADDR,sizeof(gCfgItems.spi_flash_flag)); + if (gCfgItems.spi_flash_flag == GCFG_FLAG_VALUE) { + W25QXX.SPI_FLASH_BufferRead((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); + } + else { + gCfgItems.spi_flash_flag = GCFG_FLAG_VALUE; + W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); + W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); + } } -void gCfg_to_spiFlah() -{ - W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); - W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); +void gCfg_to_spiFlah() { + W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); + W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); } -void ui_cfg_init() -{ - uiCfg.curTempType = 0; - uiCfg.curSprayerChoose = 0; - uiCfg.stepHeat = 10; - uiCfg.leveling_first_time = 0; - uiCfg.extruStep = 5; - uiCfg.extruSpeed = 10; - uiCfg.move_dist = 1; - uiCfg.moveSpeed = 3000; - uiCfg.stepPrintSpeed = 10; +void ui_cfg_init() { + uiCfg.curTempType = 0; + uiCfg.curSprayerChoose = 0; + uiCfg.stepHeat = 10; + uiCfg.leveling_first_time = 0; + uiCfg.extruStep = 5; + uiCfg.extruSpeed = 10; + uiCfg.move_dist = 1; + uiCfg.moveSpeed = 3000; + uiCfg.stepPrintSpeed = 10; } -void update_spi_flash() -{ - W25QXX.init(SPI_QUARTER_SPEED); - W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); - W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); +void update_spi_flash() { + W25QXX.init(SPI_QUARTER_SPEED); + W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); + W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); } lv_style_t tft_style_scr; lv_style_t tft_style_lable_pre; lv_style_t tft_style_lable_rel; -void tft_style_init() -{ - lv_style_copy(&tft_style_scr, &lv_style_scr); - tft_style_scr.body.main_color = LV_COLOR_BACKGROUND; - tft_style_scr.body.grad_color = LV_COLOR_BACKGROUND; - tft_style_scr.text.color = LV_COLOR_TEXT; - tft_style_scr.text.sel_color = LV_COLOR_TEXT; - tft_style_scr.line.width = 0; - tft_style_scr.text.letter_space = 0; - tft_style_scr.text.line_space = 0; - - lv_style_copy(&tft_style_lable_pre, &lv_style_scr); - lv_style_copy(&tft_style_lable_rel, &lv_style_scr); - tft_style_lable_pre.body.main_color = LV_COLOR_BACKGROUND; - tft_style_lable_pre.body.grad_color = LV_COLOR_BACKGROUND; - tft_style_lable_pre.text.color = LV_COLOR_TEXT; - tft_style_lable_pre.text.sel_color = LV_COLOR_TEXT; - tft_style_lable_rel.body.main_color = LV_COLOR_BACKGROUND; - tft_style_lable_rel.body.grad_color = LV_COLOR_BACKGROUND; - tft_style_lable_rel.text.color = LV_COLOR_TEXT; - tft_style_lable_rel.text.sel_color = LV_COLOR_TEXT; - tft_style_lable_pre.text.font = &gb2312_puhui32; - tft_style_lable_rel.text.font = &gb2312_puhui32; - tft_style_lable_pre.line.width = 0; - tft_style_lable_rel.line.width = 0; - tft_style_lable_pre.text.letter_space = 0; - tft_style_lable_rel.text.letter_space = 0; - tft_style_lable_pre.text.line_space = -5; - tft_style_lable_rel.text.line_space = -5; +void tft_style_init() { + lv_style_copy(&tft_style_scr, &lv_style_scr); + tft_style_scr.body.main_color = LV_COLOR_BACKGROUND; + tft_style_scr.body.grad_color = LV_COLOR_BACKGROUND; + tft_style_scr.text.color = LV_COLOR_TEXT; + tft_style_scr.text.sel_color = LV_COLOR_TEXT; + tft_style_scr.line.width = 0; + tft_style_scr.text.letter_space = 0; + tft_style_scr.text.line_space = 0; + + lv_style_copy(&tft_style_lable_pre, &lv_style_scr); + lv_style_copy(&tft_style_lable_rel, &lv_style_scr); + tft_style_lable_pre.body.main_color = LV_COLOR_BACKGROUND; + tft_style_lable_pre.body.grad_color = LV_COLOR_BACKGROUND; + tft_style_lable_pre.text.color = LV_COLOR_TEXT; + tft_style_lable_pre.text.sel_color = LV_COLOR_TEXT; + tft_style_lable_rel.body.main_color = LV_COLOR_BACKGROUND; + tft_style_lable_rel.body.grad_color = LV_COLOR_BACKGROUND; + tft_style_lable_rel.text.color = LV_COLOR_TEXT; + tft_style_lable_rel.text.sel_color = LV_COLOR_TEXT; + tft_style_lable_pre.text.font = &gb2312_puhui32; + tft_style_lable_rel.text.font = &gb2312_puhui32; + tft_style_lable_pre.line.width = 0; + tft_style_lable_rel.line.width = 0; + tft_style_lable_pre.text.letter_space = 0; + tft_style_lable_rel.text.letter_space = 0; + tft_style_lable_pre.text.line_space = -5; + tft_style_lable_rel.text.line_space = -5; } -#define MAX_TITLE_LEN 28 +#define MAX_TITLE_LEN 28 char public_buf_m[100] = {0}; char public_buf_l[30]; -void titleText_cat(char *str, int strSize, char *addPart) -{ - if(str == 0 || addPart == 0) - { - return; - } - - if((int)(strlen(str) + strlen(addPart)) >= strSize) - { - return; - } - - strcat(str, addPart); +void titleText_cat(char *str, int strSize, char *addPart) { + if (str == 0 || addPart == 0) + return; + if ((int)(strlen(str) + strlen(addPart)) >= strSize) + return; + strcat(str, addPart); } -char *getDispText(int index) -{ +char *getDispText(int index) { + + memset(public_buf_l, 0, sizeof(public_buf_l)); + + switch (disp_state_stack._disp_state[index]) { + case PRINT_READY_UI: + strcpy(public_buf_l, main_menu.title); + break; + case PRINT_FILE_UI: + strcpy(public_buf_l, file_menu.title); + break; + case PRINTING_UI: + if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI + #ifndef TFT35 + || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI + #endif + ) + strcpy(public_buf_l, common_menu.print_special_title); + else + strcpy(public_buf_l, printing_menu.title); + break; + case MOVE_MOTOR_UI: + strcpy(public_buf_l, move_menu.title); + break; + case OPERATE_UI: + if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI + #ifndef TFT35 + || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI + #endif + ) + strcpy(public_buf_l, common_menu.operate_special_title); + else + strcpy(public_buf_l, operation_menu.title); + break; + + case PAUSE_UI: + if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI + ) + strcpy(public_buf_l, common_menu.pause_special_title); + else + strcpy(public_buf_l, pause_menu.title); + break; + + case EXTRUSION_UI: + strcpy(public_buf_l, extrude_menu.title); + break; + case CHANGE_SPEED_UI: + strcpy(public_buf_l, speed_menu.title); + break; + case FAN_UI: + strcpy(public_buf_l, fan_menu.title); + break; + case PRE_HEAT_UI: + if ((disp_state_stack._disp_state[disp_state_stack._disp_index - 1] == OPERATE_UI)) + strcpy(public_buf_l,preheat_menu.adjust_title); + else + strcpy(public_buf_l, preheat_menu.title); + break; + case SET_UI: + strcpy(public_buf_l, set_menu.title); + break; + case ZERO_UI: + strcpy(public_buf_l, home_menu.title); + break; + case SPRAYER_UI: break; + case MACHINE_UI: break; + case LANGUAGE_UI: + strcpy(public_buf_l, language_menu.title); + break; + case ABOUT_UI: + strcpy(public_buf_l, about_menu.title); + break; + case LOG_UI: break; + case DISK_UI: + strcpy(public_buf_l, filesys_menu.title); + break; + case DIALOG_UI: + strcpy(public_buf_l, common_menu.dialog_confirm_title); + break; + case WIFI_UI: + strcpy(public_buf_l, wifi_menu.title); + break; + case MORE_UI: + case PRINT_MORE_UI: + strcpy(public_buf_l, more_menu.title); + break; + case FILAMENTCHANGE_UI: + strcpy(public_buf_l, filament_menu.title); + break; + case LEVELING_UI: + case MESHLEVELING_UI: + strcpy(public_buf_l, leveling_menu.title); + break; + case BIND_UI: + strcpy(public_buf_l, cloud_menu.title); + break; + case ZOFFSET_UI: + strcpy(public_buf_l, zoffset_menu.title); + break; + case TOOL_UI: + strcpy(public_buf_l, tool_menu.title); + break; + case WIFI_LIST_UI: + //strcpy(public_buf_l, list_menu.title); + break; + case MACHINE_PARA_UI: + strcpy(public_buf_l, MachinePara_menu.title); + break; + case BABY_STEP_UI: + strcpy(public_buf_l, operation_menu.babystep); + break; + default: break; + } + + return public_buf_l; +} - memset(public_buf_l, 0, sizeof(public_buf_l)); +char *creat_title_text() { + int index = 0; + char *tmpText = 0; + char tmpCurFileStr[20]; - switch(disp_state_stack._disp_state[index]) - { - case PRINT_READY_UI: - strcpy(public_buf_l, main_menu.title); + memset(tmpCurFileStr, 0, sizeof(tmpCurFileStr)); - break; + #if _LFN_UNICODE + //cutFileName((TCHAR *)curFileName, 16, 16, (TCHAR *)tmpCurFileStr); + #else + cutFileName(list_file.long_name[sel_id], 16, 16, tmpCurFileStr); + #endif - case PRINT_FILE_UI: - strcpy(public_buf_l, file_menu.title); + memset(public_buf_m, 0, sizeof(public_buf_m)); - break; + while (index <= disp_state_stack._disp_index) { + tmpText = getDispText(index); + if ((*tmpText == 0) || (tmpText == 0)) { + index++; + continue; + } - case PRINTING_UI: - if(disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI - #ifndef TFT35 - || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI - || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI - #endif - ) - { - strcpy(public_buf_l, common_menu.print_special_title); - } - else - { - strcpy(public_buf_l, printing_menu.title); - } + titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); + if (index < disp_state_stack._disp_index) { + titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)">"); + } - break; + index++; + } + + if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI + /*|| disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI*/) + { + titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)":"); + titleText_cat(public_buf_m, sizeof(public_buf_m), tmpCurFileStr); + } + + if (strlen(public_buf_m) > MAX_TITLE_LEN) { + memset(public_buf_m, 0, sizeof(public_buf_m)); + + tmpText = getDispText(0); + if (*tmpText != 0) { + titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); + titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)">...>"); + tmpText = getDispText(disp_state_stack._disp_index); + if (*tmpText != 0) { + titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); + } + } - case MOVE_MOTOR_UI: - strcpy(public_buf_l, move_menu.title); + } - break; + return public_buf_m; +} - case OPERATE_UI: - if(disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI - #ifndef TFT35 - || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI - || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI - #endif - ) - { - strcpy(public_buf_l, common_menu.operate_special_title); - } - else - { - strcpy(public_buf_l, operation_menu.title); - } - break; +void preview_gcode_prehandle(char *path) { + #if ENABLED(SDSUPPORT) + //uint8_t re; + //uint32_t read; + uint32_t pre_read_cnt = 0; + uint32_t *p1; + char *cur_name; + + cur_name=strrchr(path,'/'); + card.openFileRead(cur_name); + card.read(public_buf, 512); + p1 = (uint32_t *)strstr((char *)public_buf,";simage:"); + + if (p1) { + 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; + update_spi_flash(); + } + else { + gcode_preview_over = 0; + default_preview_flg = 1; + gCfgItems.from_flash_pic = 0; + update_spi_flash(); + } + card.closefile(); + #endif +} - case PAUSE_UI: - if(disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI - || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI - || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI) - { - strcpy(public_buf_l, common_menu.pause_special_title); - } - else - { - strcpy(public_buf_l, pause_menu.title); - } +void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) { + #if ENABLED(SDSUPPORT) + //uint8_t ress; + //uint32_t write; + volatile uint32_t i, j; + volatile uint16_t *p_index; + //int res; + char *cur_name; + uint16_t Color; + + cur_name = strrchr(path, '/'); + card.openFileRead(cur_name); + + card.setIndex((PREVIEW_LITTLE_PIC_SIZE+To_pre_view)+size*row+8); + #if ENABLED(SPI_GRAPHICAL_TFT) + SPI_TFT.spi_init(SPI_FULL_SPEED); + //SPI_TFT.SetCursor(0,0); + SPI_TFT.SetWindows(xpos_pixel, ypos_pixel+row, 200,1); + SPI_TFT.LCD_WriteRAM_Prepare(); + #else + ili9320_SetWindows(xpos_pixel, ypos_pixel+row, 200,1); + LCD_WriteRAM_Prepare(); + #endif + + j = i = 0; + + while (1) { + card.read(public_buf, 400); + for(i = 0; i < 400;) { + bmp_public_buf[j] = ascii2dec_test((char*)&public_buf[i])<<4|ascii2dec_test((char*)&public_buf[i+1]); + i += 2; + j++; + } - break; + //if (i > 800) break; + //#ifdef TFT70 + //if (j>400) { + // f_read(file, buff_pic, 1, &read); + // break; + //} + //#elif defined(TFT35) + if (j >= 400) { + //f_read(file, buff_pic, 1, &read); + break; + } + //#endif - case EXTRUSION_UI: - strcpy(public_buf_l, extrude_menu.title); - - break; - - case CHANGE_SPEED_UI: - strcpy(public_buf_l, speed_menu.title); - - break; - - case FAN_UI: - strcpy(public_buf_l, fan_menu.title); - - break; - - case PRE_HEAT_UI: - if((disp_state_stack._disp_state[disp_state_stack._disp_index - 1] == OPERATE_UI)) - { - strcpy(public_buf_l,preheat_menu.adjust_title); - - } - else - { - strcpy(public_buf_l, preheat_menu.title); - - } - break; - - case SET_UI: - strcpy(public_buf_l, set_menu.title); - - break; - - case ZERO_UI: - strcpy(public_buf_l, home_menu.title); - - break; - - case SPRAYER_UI: - - break; - - case MACHINE_UI: - - break; - - case LANGUAGE_UI: - strcpy(public_buf_l, language_menu.title); - - break; - - case ABOUT_UI: - strcpy(public_buf_l, about_menu.title); - - break; - - case LOG_UI: - - break; - - case DISK_UI: - strcpy(public_buf_l, filesys_menu.title); - break; - - case DIALOG_UI: - strcpy(public_buf_l, common_menu.dialog_confirm_title); - break; - - case WIFI_UI: - strcpy(public_buf_l, wifi_menu.title); - - break; - case MORE_UI: - case PRINT_MORE_UI: - strcpy(public_buf_l, more_menu.title); - - break; - case FILAMENTCHANGE_UI: - strcpy(public_buf_l, filament_menu.title); - break; - case LEVELING_UI: - case MESHLEVELING_UI: - strcpy(public_buf_l, leveling_menu.title); - break; - case BIND_UI: - strcpy(public_buf_l, cloud_menu.title); - break; - case ZOFFSET_UI: - strcpy(public_buf_l, zoffset_menu.title); - break; - case TOOL_UI: - strcpy(public_buf_l, tool_menu.title); - break; - case WIFI_LIST_UI: - //strcpy(public_buf_l, list_menu.title); - break; - case MACHINE_PARA_UI: - strcpy(public_buf_l, MachinePara_menu.title); - break; - case BABY_STEP_UI: - strcpy(public_buf_l, operation_menu.babystep); - break; - default: - break; - } + } + #if ENABLED(SPI_GRAPHICAL_TFT) + for (i = 0; i < 400;) { + p_index = (uint16_t *)(&bmp_public_buf[i]); + Color = (*p_index >> 8); + *p_index = Color | ((*p_index & 0xFF) << 8); + i += 2; + } + SPI_TFT_CS_L; + SPI_TFT_DC_H; + SPI.dmaSend(bmp_public_buf, 400, true); + SPI_TFT_CS_H; + + #else + for (i = 0; i < 400;) { + p_index = (uint16_t *)(&bmp_public_buf[i]); + //if (*p_index == 0x0000)*p_index=gCfgItems.preview_bk_color; + LCD_IO_WriteData(*p_index); + i += 2; + } + #endif + W25QXX.init(SPI_QUARTER_SPEED); + if (row < 20) + W25QXX.SPI_FLASH_SectorErase(BAK_VIEW_ADDR_TFT35 + row*4096); + W25QXX.SPI_FLASH_BufferWrite(bmp_public_buf, BAK_VIEW_ADDR_TFT35 + row*400, 400); + row++; + if (row >= 200) { + size = 809; + row = 0; + + gcode_preview_over = 0; + //flash_preview_begin = 1; + + card.closefile(); + + /* + if (gCurFileState.file_open_flag != 0xaa) { + reset_file_info(); + res = f_open(file, curFileName, FA_OPEN_EXISTING | FA_READ); + if (res == FR_OK) { + f_lseek(file,PREVIEW_SIZE+To_pre_view); + gCurFileState.file_open_flag = 0xaa; + //bakup_file_path((uint8_t *)curFileName, strlen(curFileName)); + srcfp = file; + mksReprint.mks_printer_state = MKS_WORKING; + once_flag = 0; + } + } + */ + char *cur_name; + + cur_name = strrchr(list_file.file_name[sel_id], '/'); + + SdFile file; + SdFile *curDir; + card.endFilePrint(); + const char * const fname = card.diveToFile(true, curDir, cur_name); + if (!fname) return; + if (file.open(curDir, fname, O_READ)) { + gCfgItems.curFilesize = file.fileSize(); + file.close(); + update_spi_flash(); + } - return public_buf_l; + card.openFileRead(cur_name); + if (card.isFileOpen()) { + feedrate_percentage = 100; + // saved_feedrate_percentage = feedrate_percentage; + planner.flow_percentage[0] = 100; + planner.e_factor[0]= planner.flow_percentage[0] * 0.01; + if (EXTRUDERS == 2) { + planner.flow_percentage[1] = 100; + planner.e_factor[1]= planner.flow_percentage[1] * 0.01; + } + card.startFileprint(); + TERN_(POWER_LOSS_RECOVERY, recovery.prepare()); + once_flag = 0; + } + return; + } + card.closefile(); + #endif } -char *creat_title_text() -{ - int index = 0; - - char *tmpText = 0; - - char tmpCurFileStr[20]; +void Draw_default_preview(int xpos_pixel,int ypos_pixel,uint8_t sel) { + int index; + int x_off = 0, y_off = 0; + int _y; + uint16_t *p_index; + int i,j; + uint16_t temp_p,Color; + + for(index = 0; index < 10; index ++)//200*200 { + if (sel == 1) { + flash_view_Read(bmp_public_buf, 8000);//20k + //memset(bmp_public_buf,0x1f,8000); + } + else { + //memset(bmp_public_buf,0x1f,8000); + default_view_Read(bmp_public_buf, 8000);//20k + } + i = 0; + #if ENABLED(SPI_GRAPHICAL_TFT) + //SPI_TFT.spi_init(SPI_FULL_SPEED); + //SPI_TFT.SetWindows(xpos_pixel, y_off * 20+ypos_pixel, 200,20); //200*200 + //SPI_TFT.LCD_WriteRAM_Prepare(); + j = 0; + for (_y = y_off * 20; _y < (y_off + 1) * 20; _y++) { + SPI_TFT.spi_init(SPI_FULL_SPEED); + SPI_TFT.SetWindows(xpos_pixel, y_off * 20+ypos_pixel+j, 200, 1); //200*200 + SPI_TFT.LCD_WriteRAM_Prepare(); + + j++; + //memcpy(public_buf,&bmp_public_buf[i],400); + SPI_TFT_CS_L; + SPI_TFT_DC_H; + SPI.dmaSend(&bmp_public_buf[i], 400, true); + SPI_TFT_CS_H; + + i += 400; + if (i >= 8000) break; + } - memset(tmpCurFileStr, 0, sizeof(tmpCurFileStr)); + #else - #if _LFN_UNICODE - //cutFileName((TCHAR *)curFileName, 16, 16, (TCHAR *)tmpCurFileStr); - #else - cutFileName(list_file.long_name[sel_id], 16, 16, tmpCurFileStr); - #endif + ili9320_SetWindows(xpos_pixel, y_off * 20 + ypos_pixel, 200, 20); //200*200 - memset(public_buf_m, 0, sizeof(public_buf_m)); + LCD_WriteRAM_Prepare(); - while(index <= disp_state_stack._disp_index) - { + for (_y = y_off * 20; _y < (y_off + 1) * 20; _y++) { + for (x_off = 0; x_off < 200; x_off++) { + if (sel==1) { + temp_p = (uint16_t)(bmp_public_buf[i]|bmp_public_buf[i+1]<<8); + p_index = &temp_p; + } + else + p_index = (uint16_t *)(&bmp_public_buf[i]); + LCD_IO_WriteData(*p_index); + i += 2; + } + if (i >= 8000) break; + } + #endif + y_off++; + } + W25QXX.init(SPI_QUARTER_SPEED); +} - tmpText = getDispText(index); - if((*tmpText == 0) || (tmpText == 0)) - { - index++; - continue; - } - titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); - if(index < disp_state_stack._disp_index) - { - titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)">"); - } +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 (flash_preview_begin == 1) { + flash_preview_begin = 0; + Draw_default_preview(xpos_pixel,ypos_pixel,1); + } + if (default_preview_flg == 1) { + Draw_default_preview(xpos_pixel,ypos_pixel,0); + default_preview_flg = 0; + } +} - index++; - } +void print_time_run() { + static uint8_t lastSec = 0; - if(disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI - /*|| disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI - || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI*/) - { - titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)":"); - titleText_cat(public_buf_m, sizeof(public_buf_m), tmpCurFileStr); - } + if (print_time.seconds >= 60) { + print_time.seconds = 0; + print_time.minutes++; + if (print_time.minutes >= 60) { + print_time.minutes = 0; + print_time.hours++; + } + } + if (disp_state == PRINTING_UI) { + if (lastSec != print_time.seconds) + disp_print_time(); + lastSec = print_time.seconds; + } +} - if(strlen(public_buf_m) > MAX_TITLE_LEN) - { - memset(public_buf_m, 0, sizeof(public_buf_m)); +void GUI_RefreshPage() { + if ((systick_uptime_millis % 1000) == 0) + temperature_change_frequency = 1; + if ((systick_uptime_millis % 3000) == 0) + printing_rate_update_flag = 1; + + switch (disp_state) { + case MAIN_UI: + lv_draw_ready_print(); + break; + case EXTRUSION_UI: + if (temperature_change_frequency == 1) { + temperature_change_frequency = 0; + disp_hotend_temp(); + } + break; + case PRE_HEAT_UI: + if (temperature_change_frequency == 1) { + temperature_change_frequency = 0; + disp_desire_temp(); + } + break; + case PRINT_READY_UI: + /* + if (gCfgItems.display_style == 2) { + if (temperature_change_frequency) { + temperature_change_frequency = 0; + disp_restro_state(); + } + } + */ + break; + + case PRINT_FILE_UI: break; + + case PRINTING_UI: + if (temperature_change_frequency) { + temperature_change_frequency = 0; + disp_ext_temp(); + disp_bed_temp(); + disp_fan_speed(); + disp_print_time(); + disp_fan_Zpos(); + } + if (printing_rate_update_flag || marlin_state == MF_SD_COMPLETE) { + printing_rate_update_flag = 0; + if (gcode_preview_over == 0) setProBarRate(); + } + break; - tmpText = getDispText(0); - if(*tmpText != 0) - { - titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); - titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)">...>"); - tmpText = getDispText(disp_state_stack._disp_index); - if(*tmpText != 0) - { - titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); - } - } + case OPERATE_UI: + /* + if (temperature_change_frequency == 1) { + temperature_change_frequency = 0; + disp_temp_operate(); + } - } - - return public_buf_m; -} + setProBarRateOpera(); + */ + break; + case PAUSE_UI: + /* + if (temperature_change_frequency == 1) { + temperature_change_frequency = 0; + disp_temp_pause(); + } + */ + break; -void preview_gcode_prehandle(char *path) -{ - #if ENABLED(SDSUPPORT) - //uint8_t re; - //uint32_t read; - uint32_t pre_read_cnt = 0; - uint32_t *p1; - char *cur_name; - - cur_name=strrchr(path,'/'); - card.openFileRead(cur_name); - card.read(public_buf, 512); - p1 = (uint32_t *)strstr((char *)public_buf,";simage:"); - - if(p1) - { - 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; - update_spi_flash(); - } - else - { - gcode_preview_over = 0; - default_preview_flg = 1; - gCfgItems.from_flash_pic = 0; - update_spi_flash(); - } - card.closefile(); - #endif -} + case FAN_UI: + if (temperature_change_frequency == 1) { + temperature_change_frequency = 0; + disp_fan_value(); + } + break; + + case MOVE_MOTOR_UI: + /* + if (mksReprint.mks_printer_state == MKS_IDLE) { + if ((z_high_count==1)&&(temper_error_flg != 1)) { + z_high_count = 0; + { + memset((char *)gCfgItems.move_z_coordinate, ' ', sizeof(gCfgItems.move_z_coordinate)); + GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate, 380, TITLE_YPOS); + sprintf((char *)gCfgItems.move_z_coordinate, "Z: %.3f", current_position[Z_AXIS]); + GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate, 380, TITLE_YPOS); + } + } + } + */ + break; + + case WIFI_UI: + /* + if (wifi_refresh_flg == 1) { + disp_wifi_state(); + wifi_refresh_flg = 0; + } + */ + break; + case BIND_UI: + /*refresh_bind_ui();*/ + break; + + case FILAMENTCHANGE_UI: + /* + if (temperature_change_frequency) { + temperature_change_frequency = 0; + disp_filament_sprayer_temp(); + } + */ + break; + case DIALOG_UI: + /*filament_dialog_handle(); + wifi_scan_handle();*/ + break; + case MESHLEVELING_UI: + /*disp_zpos();*/ + break; + case HARDWARE_TEST_UI: + break; + case WIFI_LIST_UI: + /* + if (wifi_refresh_flg == 1) { + disp_wifi_list(); + wifi_refresh_flg = 0; + } + */ + break; + case KEY_BOARD_UI: + /*update_password_disp(); + update_join_state_disp();*/ + break; + case TIPS_UI: + /* + switch (tips_type) { + case TIPS_TYPE_JOINING: + if (wifi_link_state == WIFI_CONNECTED && strcmp((const char *)wifi_list.wifiConnectedName, (const char *)wifi_list.wifiName[wifi_list.nameIndex]) == 0) { + tips_disp.timer = TIPS_TIMER_STOP; + tips_disp.timer_count = 0; + Clear_Tips(); + tips_type = TIPS_TYPE_WIFI_CONECTED; + draw_Tips(); + } + if (tips_disp.timer_count >= 30) { + tips_disp.timer = TIPS_TIMER_STOP; + tips_disp.timer_count = 0; + Clear_Tips(); + tips_type = TIPS_TYPE_TAILED_JOIN; + draw_Tips(); + } + break; + case TIPS_TYPE_TAILED_JOIN: + if (tips_disp.timer_count >= 3) { + tips_disp.timer = TIPS_TIMER_STOP; + tips_disp.timer_count = 0; + last_disp_state = TIPS_UI; + Clear_Tips(); + draw_Wifi_list(); + } + break; + case TIPS_TYPE_WIFI_CONECTED: + if (tips_disp.timer_count >= 3) { + tips_disp.timer = TIPS_TIMER_STOP; + tips_disp.timer_count = 0; + + last_disp_state = TIPS_UI; + Clear_Tips(); + draw_Wifi(); + } + break; + default: break; + } + */ + break; + case BABY_STEP_UI: + /* + if (temperature_change_frequency == 1) { + temperature_change_frequency = 0; + disp_z_offset_value(); + } + */ + break; + default: break; + } -void gcode_preview(char *path,int xpos_pixel,int ypos_pixel) -{ - #if ENABLED(SDSUPPORT) - //uint8_t ress; - //uint32_t write; - volatile uint32_t i,j; - volatile uint16_t *p_index; - //int res; - char *cur_name; - uint16_t Color; - - cur_name=strrchr(path,'/'); - card.openFileRead(cur_name); - - card.setIndex((PREVIEW_LITTLE_PIC_SIZE+To_pre_view)+size*row+8); - #if ENABLED(SPI_GRAPHICAL_TFT) - - SPI_TFT.spi_init(SPI_FULL_SPEED); - //SPI_TFT.SetCursor(0,0); - SPI_TFT.SetWindows(xpos_pixel, ypos_pixel+row, 200,1); - SPI_TFT.LCD_WriteRAM_Prepare(); - - #else - ili9320_SetWindows(xpos_pixel, ypos_pixel+row, 200,1); - LCD_WriteRAM_Prepare(); - #endif - - j=0; - i=0; - - while(1) - { - card.read(public_buf, 400); - for(i=0;i<400;) - { - bmp_public_buf[j]= ascii2dec_test((char*)&public_buf[i])<<4|ascii2dec_test((char*)&public_buf[i+1]); - - i+=2; - j++; - } - - //if(i>800)break; - //#if defined(TFT70) - //if(j>400) - //{ - // f_read(file, buff_pic, 1, &read); - // break; - //} - //#elif defined(TFT35) - if(j>=400) - { - //f_read(file, buff_pic, 1, &read); - break; - } - //#endif - - } - #if ENABLED(SPI_GRAPHICAL_TFT) - for(i=0;i<400;) - { - p_index = (uint16_t *)(&bmp_public_buf[i]); - - Color = (*p_index >> 8); - *p_index = Color | ((*p_index & 0xff) << 8); - i+=2; - } - SPI_TFT_CS_L; - SPI_TFT_DC_H; - SPI.dmaSend(bmp_public_buf,400,true); - SPI_TFT_CS_H; - - #else - for(i=0;i<400;) - { - p_index = (uint16_t *)(&bmp_public_buf[i]); - //if(*p_index == 0x0000)*p_index=gCfgItems.preview_bk_color; - LCD_IO_WriteData(*p_index); - i=i+2; - } - #endif - W25QXX.init(SPI_QUARTER_SPEED); - if(row<20) - { - W25QXX.SPI_FLASH_SectorErase(BAK_VIEW_ADDR_TFT35+row*4096); - } - W25QXX.SPI_FLASH_BufferWrite(bmp_public_buf, BAK_VIEW_ADDR_TFT35+row*400, 400); - row++; - if(row >= 200) - { - size = 809; - row = 0; - - gcode_preview_over = 0; - //flash_preview_begin = 1; - - card.closefile(); - - /*if(gCurFileState.file_open_flag != 0xaa) - { - - - reset_file_info(); - - res = f_open(file, curFileName, FA_OPEN_EXISTING | FA_READ); - - if(res == FR_OK) - { - f_lseek(file,PREVIEW_SIZE+To_pre_view); - gCurFileState.file_open_flag = 0xaa; - - //bakup_file_path((uint8_t *)curFileName, strlen(curFileName)); - - srcfp = file; - - mksReprint.mks_printer_state = MKS_WORKING; - - once_flag = 0; - } - - } */ - char *cur_name; - - cur_name=strrchr(list_file.file_name[sel_id],'/'); - - SdFile file; - SdFile *curDir; - card.endFilePrint(); - const char * const fname = card.diveToFile(true, curDir, cur_name); - if (!fname) return; - if (file.open(curDir, fname, O_READ)) - { - gCfgItems.curFilesize = file.fileSize(); - file.close(); - update_spi_flash(); - } - - card.openFileRead(cur_name); - if (card.isFileOpen()) - { - feedrate_percentage = 100; - //saved_feedrate_percentage = feedrate_percentage; - planner.flow_percentage[0] = 100; - planner.e_factor[0]= planner.flow_percentage[0]*0.01; - if(EXTRUDERS==2) - { - planner.flow_percentage[1] = 100; - planner.e_factor[1]= planner.flow_percentage[1]*0.01; - } - card.startFileprint(); - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.prepare(); - #endif - once_flag = 0; - } - return; - } - card.closefile(); - #endif + print_time_run(); } -void Draw_default_preview(int xpos_pixel,int ypos_pixel,uint8_t sel) -{ - int index; - int x_off = 0, y_off = 0; - int _y; - uint16_t *p_index; - int i,j; - uint16_t temp_p,Color; - - for(index = 0; index < 10; index ++)//200*200 - { - if(sel == 1) - { - flash_view_Read(bmp_public_buf, 8000);//20k - //memset(bmp_public_buf,0x1f,8000); - } - else - { - //memset(bmp_public_buf,0x1f,8000); - default_view_Read(bmp_public_buf, 8000);//20k - } - - i = 0; - #if ENABLED(SPI_GRAPHICAL_TFT) - - //SPI_TFT.spi_init(SPI_FULL_SPEED); - //SPI_TFT.SetWindows(xpos_pixel, y_off * 20+ypos_pixel, 200,20); //200*200 - //SPI_TFT.LCD_WriteRAM_Prepare(); - j=0; - for(_y = y_off * 20; _y < (y_off + 1) * 20; _y++) - { - SPI_TFT.spi_init(SPI_FULL_SPEED); - SPI_TFT.SetWindows(xpos_pixel, y_off * 20+ypos_pixel+j, 200,1); //200*200 - SPI_TFT.LCD_WriteRAM_Prepare(); - - j++; - //memcpy(public_buf,&bmp_public_buf[i],400); - SPI_TFT_CS_L; - SPI_TFT_DC_H; - SPI.dmaSend(&bmp_public_buf[i],400,true); - SPI_TFT_CS_H; - - i = i+400; - if(i >= 8000) - break; - } - - #else - ili9320_SetWindows(xpos_pixel, y_off * 20+ypos_pixel, 200,20); //200*200 - - LCD_WriteRAM_Prepare(); - - for(_y = y_off * 20; _y < (y_off + 1) * 20; _y++) - { - for (x_off = 0; x_off < 200; x_off++) - { - if(sel==1) - { - temp_p = (uint16_t)(bmp_public_buf[i]|bmp_public_buf[i+1]<<8); - p_index = &temp_p; - } - else - { - p_index = (uint16_t *)(&bmp_public_buf[i]); - } - - LCD_IO_WriteData(*p_index); - - - i += 2; - - } - if(i >= 8000) - break; - } - #endif - y_off++; - } - W25QXX.init(SPI_QUARTER_SPEED); +void clear_cur_ui() { + last_disp_state = disp_state_stack._disp_state[disp_state_stack._disp_index]; + + switch (disp_state_stack._disp_state[disp_state_stack._disp_index]) { + case PRINT_READY_UI: + //Get_Temperature_Flg = 0; + lv_clear_ready_print(); + break; + case PRINT_FILE_UI: + lv_clear_print_file(); + break; + case PRINTING_UI: + lv_clear_printing(); + break; + case MOVE_MOTOR_UI: + lv_clear_move_motor(); + break; + case OPERATE_UI: + lv_clear_opration(); + break; + case PAUSE_UI: + //Clear_pause(); + break; + case EXTRUSION_UI: + lv_clear_extrusion(); + break; + case PRE_HEAT_UI: + lv_clear_preHeat(); + break; + case CHANGE_SPEED_UI: + lv_clear_change_speed(); + break; + case FAN_UI: + lv_clear_fan(); + break; + case SET_UI: + lv_clear_set(); + break; + case ZERO_UI: + lv_clear_home(); + break; + case SPRAYER_UI: + //Clear_Sprayer(); + break; + case MACHINE_UI: + //Clear_Machine(); + break; + case LANGUAGE_UI: + lv_clear_language(); + break; + case ABOUT_UI: + lv_clear_about(); + break; + case LOG_UI: + //Clear_Connect(); + break; + case DISK_UI: + //Clear_Disk(); + break; + case WIFI_UI: + //Clear_Wifi(); + break; + case MORE_UI: + //Clear_more(); + break; + case FILETRANSFER_UI: + //Clear_fileTransfer(); + break; + case DIALOG_UI: + lv_clear_dialog(); + break; + case FILETRANSFERSTATE_UI: + //Clear_WifiFileTransferdialog(); + break; + case PRINT_MORE_UI: + //Clear_Printmore(); + break; + case LEVELING_UI: + lv_clear_manualLevel(); + break; + case BIND_UI: + //Clear_Bind(); + break; + case ZOFFSET_UI: + //Clear_Zoffset(); + break; + case TOOL_UI: + lv_clear_tool(); + break; + case MESHLEVELING_UI: + //Clear_MeshLeveling(); + break; + case HARDWARE_TEST_UI: + //Clear_Hardwaretest(); + break; + case WIFI_LIST_UI: + //Clear_Wifi_list(); + break; + case KEY_BOARD_UI: + //Clear_Keyboard(); + break; + case TIPS_UI: + //Clear_Tips(); + break; + case MACHINE_PARA_UI: + //Clear_MachinePara(); + break; + case MACHINE_SETTINGS_UI: + //Clear_MachineSettings(); + break; + case TEMPERATURE_SETTINGS_UI: + //Clear_TemperatureSettings(); + break; + case MOTOR_SETTINGS_UI: + //Clear_MotorSettings(); + break; + case MACHINETYPE_UI: + //Clear_MachineType(); + break; + case STROKE_UI: + //Clear_Stroke(); + break; + case HOME_DIR_UI: + //Clear_HomeDir(); + break; + case ENDSTOP_TYPE_UI: + //Clear_EndstopType(); + break; + case FILAMENT_SETTINGS_UI: + //Clear_FilamentSettings(); + break; + case LEVELING_SETTIGNS_UI: + //Clear_LevelingSettings(); + break; + case LEVELING_PARA_UI: + //Clear_LevelingPara(); + break; + case DELTA_LEVELING_PARA_UI: + //Clear_DeltaLevelPara(); + break; + case XYZ_LEVELING_PARA_UI: + //Clear_XYZLevelPara(); + break; + case MAXFEEDRATE_UI: + //Clear_MaxFeedRate(); + break; + case STEPS_UI: + //Clear_Steps(); + break; + case ACCELERATION_UI: + //Clear_Acceleration(); + break; + case JERK_UI: + //Clear_Jerk(); + break; + case MOTORDIR_UI: + //Clear_MotorDir(); + break; + case HOMESPEED_UI: + //Clear_HomeSpeed(); + break; + case NOZZLE_CONFIG_UI: + //Clear_NozzleConfig(); + break; + case HOTBED_CONFIG_UI: + //Clear_HotbedConfig(); + break; + case ADVANCED_UI: + //Clear_Advanced(); + break; + case DOUBLE_Z_UI: + //Clear_DoubleZ(); + break; + case ENABLE_INVERT_UI: + //Clear_EnableInvert(); + break; + case NUMBER_KEY_UI: + //Clear_NumberKey(); + break; + case BABY_STEP_UI: + //Clear_babyStep(); + break; + default: + break; + } + //GUI_Clear(); } +void draw_return_ui() { + if (disp_state_stack._disp_index > 0) { + disp_state_stack._disp_index--; -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(flash_preview_begin == 1) - { - flash_preview_begin = 0; - Draw_default_preview(xpos_pixel,ypos_pixel,1); - } - if(default_preview_flg == 1) - { - Draw_default_preview(xpos_pixel,ypos_pixel,0); - default_preview_flg = 0; - } + switch (disp_state_stack._disp_state[disp_state_stack._disp_index]) { + case PRINT_READY_UI: + lv_draw_ready_print(); + break; + case PRINT_FILE_UI: + lv_draw_print_file(); + break; + case PRINTING_UI: + if (gCfgItems.from_flash_pic == 1) + flash_preview_begin = 1; + else + default_preview_flg = 1; + lv_draw_printing(); + break; + case MOVE_MOTOR_UI: + lv_draw_move_motor(); + break; + case OPERATE_UI: + lv_draw_opration(); + break; -} + #if 1 + case PAUSE_UI: + //draw_pause(); + break; + #endif -void print_time_run() -{ - static uint8_t lastSec = 0; - - if(print_time.seconds >= 60) - { - print_time.seconds = 0; - print_time.minutes++; - if(print_time.minutes >= 60) - { - print_time.minutes = 0; - print_time.hours++; - } - - } - if(disp_state == PRINTING_UI) - { - if(lastSec != print_time.seconds) - { - disp_print_time(); - } - lastSec = print_time.seconds; - } -} + case EXTRUSION_UI: + lv_draw_extrusion(); + break; + case PRE_HEAT_UI: + lv_draw_preHeat(); + break; + case CHANGE_SPEED_UI: + lv_draw_change_speed(); + break; + case FAN_UI: + lv_draw_fan(); + break; + case SET_UI: + lv_draw_set(); + break; + case ZERO_UI: + lv_draw_home(); + break; + case SPRAYER_UI: + //draw_Sprayer(); + break; + case MACHINE_UI: + //draw_Machine(); + break; + case LANGUAGE_UI: + lv_draw_language(); + break; + case ABOUT_UI: + lv_draw_about(); + break; -void GUI_RefreshPage() -{ - - if((systick_uptime_millis % 1000) == 0) - temperature_change_frequency=1; - if((systick_uptime_millis % 3000) == 0) - printing_rate_update_flag = 1; - switch(disp_state) - { - case MAIN_UI: - - lv_draw_ready_print(); - - break; - case EXTRUSION_UI: - if(temperature_change_frequency == 1) - { - temperature_change_frequency = 0; - disp_hotend_temp(); - } - break; - case PRE_HEAT_UI: - if(temperature_change_frequency == 1) - { - temperature_change_frequency = 0; - disp_desire_temp(); - } - break; - - case PRINT_READY_UI: - - /*if(gCfgItems.display_style == 2) - { - if(temperature_change_frequency){ - temperature_change_frequency=0; - disp_restro_state(); - } - }*/ - - break; - - case PRINT_FILE_UI: - break; - - case PRINTING_UI: - - if(temperature_change_frequency) - { - temperature_change_frequency = 0; - disp_ext_temp(); - disp_bed_temp(); - disp_fan_speed(); - disp_print_time(); - disp_fan_Zpos(); - } - if(printing_rate_update_flag || marlin_state == MF_SD_COMPLETE) - { - printing_rate_update_flag = 0; - if(gcode_preview_over == 0) - { - setProBarRate(); - } - } - break; - - - case OPERATE_UI: - /*if(temperature_change_frequency == 1) - { - temperature_change_frequency = 0; - disp_temp_operate(); - } - - setProBarRateOpera();*/ - - break; - - case PAUSE_UI: - /*if(temperature_change_frequency == 1) - { - temperature_change_frequency = 0; - disp_temp_pause(); - }*/ - - break; - - case FAN_UI: - if(temperature_change_frequency == 1) - { - temperature_change_frequency = 0; - disp_fan_value(); - } - break; - - case MOVE_MOTOR_UI: - /* - if(mksReprint.mks_printer_state == MKS_IDLE) - { - if((z_high_count==1)&&(temper_error_flg != 1)) - { - z_high_count = 0; - { - - memset((char *)gCfgItems.move_z_coordinate,' ',sizeof(gCfgItems.move_z_coordinate)); - GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate,380, TITLE_YPOS); - sprintf((char *)gCfgItems.move_z_coordinate,"Z: %.3f",current_position[Z_AXIS]); - GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate,380, TITLE_YPOS); - } - } - }*/ - break; - - case WIFI_UI: - /*if(wifi_refresh_flg == 1) - { - disp_wifi_state(); - wifi_refresh_flg = 0; - }*/ - break; - case BIND_UI: - /*refresh_bind_ui();*/ - break; - - case FILAMENTCHANGE_UI: - /*if(temperature_change_frequency) - { - temperature_change_frequency = 0; - disp_filament_sprayer_temp(); - }*/ - break; - case DIALOG_UI: - /*filament_dialog_handle(); - wifi_scan_handle();*/ - break; - case MESHLEVELING_UI: - /*disp_zpos();*/ - break; - case HARDWARE_TEST_UI: - - break; - case WIFI_LIST_UI: - /*if(wifi_refresh_flg == 1) - { - disp_wifi_list(); - wifi_refresh_flg = 0; - }*/ - break; - case KEY_BOARD_UI: - /*update_password_disp(); - update_join_state_disp();*/ - break; - case TIPS_UI: - /*switch(tips_type) - { - case TIPS_TYPE_JOINING: - if(wifi_link_state == WIFI_CONNECTED && strcmp((const char *)wifi_list.wifiConnectedName,(const char *)wifi_list.wifiName[wifi_list.nameIndex]) == 0) - { - tips_disp.timer = TIPS_TIMER_STOP; - tips_disp.timer_count = 0; - - Clear_Tips(); - tips_type = TIPS_TYPE_WIFI_CONECTED; - draw_Tips(); - - } - if(tips_disp.timer_count >= 30) - { - tips_disp.timer = TIPS_TIMER_STOP; - tips_disp.timer_count = 0; - - Clear_Tips(); - tips_type = TIPS_TYPE_TAILED_JOIN; - draw_Tips(); - } - break; - case TIPS_TYPE_TAILED_JOIN: - if(tips_disp.timer_count >= 3) - { - tips_disp.timer = TIPS_TIMER_STOP; - tips_disp.timer_count = 0; - - last_disp_state = TIPS_UI; - Clear_Tips(); - draw_Wifi_list(); - } - break; - case TIPS_TYPE_WIFI_CONECTED: - if(tips_disp.timer_count >= 3) - { - tips_disp.timer = TIPS_TIMER_STOP; - tips_disp.timer_count = 0; - - last_disp_state = TIPS_UI; - Clear_Tips(); - draw_Wifi(); - } - break; - default: - break; - }*/ - break; - case BABY_STEP_UI: - /*if(temperature_change_frequency == 1) - { - temperature_change_frequency = 0; - disp_z_offset_value(); - }*/ - break; - default: - break; - - } - - print_time_run(); + #if tan_mask + case LOG_UI: + //draw_Connect(); + break; + #endif + case CALIBRATE_UI: + //draw_calibrate(); + break; + case DISK_UI: + //draw_Disk(); + break; + case WIFI_UI: + //draw_Wifi(); + break; + case MORE_UI: + //draw_More(); + break; + case PRINT_MORE_UI: + //draw_printmore(); + break; + case FILAMENTCHANGE_UI: + //draw_FilamentChange(); + break; + case LEVELING_UI: + lv_draw_manualLevel(); + break; + case BIND_UI: + //draw_bind(); + break; -} + #if tan_mask + case ZOFFSET_UI: + //draw_Zoffset(); + break; + #endif -void clear_cur_ui() -{ - last_disp_state = disp_state_stack._disp_state[disp_state_stack._disp_index]; - - switch(disp_state_stack._disp_state[disp_state_stack._disp_index]) - { - case PRINT_READY_UI: - //Get_Temperature_Flg = 0; - lv_clear_ready_print(); - break; - - case PRINT_FILE_UI: - lv_clear_print_file(); - break; - - case PRINTING_UI: - lv_clear_printing(); - break; - - case MOVE_MOTOR_UI: - lv_clear_move_motor(); - break; - - case OPERATE_UI: - lv_clear_opration(); - break; - - case PAUSE_UI: - //Clear_pause(); - break; - - case EXTRUSION_UI: - lv_clear_extrusion(); - break; - - case PRE_HEAT_UI: - lv_clear_preHeat(); - break; - - case CHANGE_SPEED_UI: - lv_clear_change_speed(); - break; - - case FAN_UI: - lv_clear_fan(); - break; - - case SET_UI: - lv_clear_set(); - break; - - case ZERO_UI: - lv_clear_home(); - break; - - case SPRAYER_UI: - //Clear_Sprayer(); - break; - - case MACHINE_UI: - //Clear_Machine(); - break; - - case LANGUAGE_UI: - lv_clear_language(); - break; - - case ABOUT_UI: - lv_clear_about(); - break; - - case LOG_UI: - //Clear_Connect(); - break; - case DISK_UI: - //Clear_Disk(); - break; - case WIFI_UI: - //Clear_Wifi(); - break; - - case MORE_UI: - //Clear_more(); - break; - - case FILETRANSFER_UI: - //Clear_fileTransfer(); - break; - case DIALOG_UI: - lv_clear_dialog(); - break; - case FILETRANSFERSTATE_UI: - ///// Clear_WifiFileTransferdialog(); - break; - case PRINT_MORE_UI: - //Clear_Printmore(); - break; - case LEVELING_UI: - lv_clear_manualLevel(); - break; - case BIND_UI: - //Clear_Bind(); - break; - case ZOFFSET_UI: - //Clear_Zoffset(); - break; - case TOOL_UI: - lv_clear_tool(); - break; - case MESHLEVELING_UI: - //Clear_MeshLeveling(); - break; - case HARDWARE_TEST_UI: - //Clear_Hardwaretest(); - break; - case WIFI_LIST_UI: - //Clear_Wifi_list(); - break; - case KEY_BOARD_UI: - //Clear_Keyboard(); - break; - case TIPS_UI: - //Clear_Tips(); - break; - case MACHINE_PARA_UI: - //Clear_MachinePara(); - break; - case MACHINE_SETTINGS_UI: - //Clear_MachineSettings(); + case TOOL_UI: + lv_draw_tool(); break; - case TEMPERATURE_SETTINGS_UI: - //Clear_TemperatureSettings(); + case MESHLEVELING_UI: + //draw_meshleveling(); break; - case MOTOR_SETTINGS_UI: - //Clear_MotorSettings(); + case HARDWARE_TEST_UI: + //draw_Hardwaretest(); break; - case MACHINETYPE_UI: - //Clear_MachineType(); + case WIFI_LIST_UI: + //draw_Wifi_list(); break; - case STROKE_UI: - //Clear_Stroke(); + case KEY_BOARD_UI: + //draw_Keyboard(); break; - case HOME_DIR_UI: - //Clear_HomeDir(); + case TIPS_UI: + //draw_Tips(); break; - case ENDSTOP_TYPE_UI: - //Clear_EndstopType(); + case MACHINE_PARA_UI: + //draw_MachinePara(); break; - case FILAMENT_SETTINGS_UI: - //Clear_FilamentSettings(); + case MACHINE_SETTINGS_UI: + //draw_MachineSettings(); break; - case LEVELING_SETTIGNS_UI: - //Clear_LevelingSettings(); + case TEMPERATURE_SETTINGS_UI: + //draw_TemperatureSettings(); break; - case LEVELING_PARA_UI: - //Clear_LevelingPara(); + case MOTOR_SETTINGS_UI: + //draw_MotorSettings(); break; - case DELTA_LEVELING_PARA_UI: - //Clear_DeltaLevelPara(); + case MACHINETYPE_UI: + //draw_MachineType(); break; - case XYZ_LEVELING_PARA_UI: - //Clear_XYZLevelPara(); + case STROKE_UI: + //draw_Stroke(); break; - case MAXFEEDRATE_UI: - //Clear_MaxFeedRate(); + case HOME_DIR_UI: + //draw_HomeDir(); break; - case STEPS_UI: - //Clear_Steps(); + case ENDSTOP_TYPE_UI: + //draw_EndstopType(); break; - case ACCELERATION_UI: - //Clear_Acceleration(); + case FILAMENT_SETTINGS_UI: + //draw_FilamentSettings(); break; - case JERK_UI: - //Clear_Jerk(); + case LEVELING_SETTIGNS_UI: + //draw_LevelingSettings(); break; - case MOTORDIR_UI: - //Clear_MotorDir(); + case LEVELING_PARA_UI: + //draw_LevelingPara(); break; - case HOMESPEED_UI: - //Clear_HomeSpeed(); + case DELTA_LEVELING_PARA_UI: + //draw_DeltaLevelPara(); break; - case NOZZLE_CONFIG_UI: - //Clear_NozzleConfig(); + case XYZ_LEVELING_PARA_UI: + //draw_XYZLevelPara(); break; - case HOTBED_CONFIG_UI: - //Clear_HotbedConfig(); - break; - case ADVANCED_UI: - //Clear_Advanced(); + case MAXFEEDRATE_UI: + //draw_MaxFeedRate(); break; - case DOUBLE_Z_UI: - //Clear_DoubleZ(); + case STEPS_UI: + //draw_Steps(); break; - case ENABLE_INVERT_UI: - //Clear_EnableInvert(); + case ACCELERATION_UI: + //draw_Acceleration(); break; - case NUMBER_KEY_UI: - //Clear_NumberKey(); + case JERK_UI: + //draw_Jerk(); break; - case BABY_STEP_UI: - //Clear_babyStep(); - break; - default: - break; - } - //GUI_Clear(); -} - -void draw_return_ui() -{ - if(disp_state_stack._disp_index > 0) - { - disp_state_stack._disp_index--; - - switch(disp_state_stack._disp_state[disp_state_stack._disp_index]) - { - case PRINT_READY_UI: - lv_draw_ready_print(); - break; - - - case PRINT_FILE_UI: - lv_draw_print_file(); - break; - case PRINTING_UI: - if(gCfgItems.from_flash_pic == 1) - flash_preview_begin = 1; - else - default_preview_flg = 1; - lv_draw_printing(); - break; - - case MOVE_MOTOR_UI: - lv_draw_move_motor(); - break; - - - case OPERATE_UI: - lv_draw_opration(); - break; -#if 1 - case PAUSE_UI: - //draw_pause(); - break; -#endif - - case EXTRUSION_UI: - lv_draw_extrusion(); - break; - - case PRE_HEAT_UI: - lv_draw_preHeat(); - break; - - case CHANGE_SPEED_UI: - lv_draw_change_speed(); - break; - - case FAN_UI: - lv_draw_fan(); - break; - - case SET_UI: - lv_draw_set(); - break; - - case ZERO_UI: - lv_draw_home(); - break; - - case SPRAYER_UI: - //draw_Sprayer(); - break; - - case MACHINE_UI: - //draw_Machine(); - break; - - case LANGUAGE_UI: - lv_draw_language(); - break; - - case ABOUT_UI: - lv_draw_about(); - break; -#if tan_mask - - case LOG_UI: - //draw_Connect(); - break; -#endif - - case CALIBRATE_UI: - //// draw_calibrate(); - break; - - case DISK_UI: - //draw_Disk(); - break; - - case WIFI_UI: - //draw_Wifi(); - break; - - case MORE_UI: - //draw_More(); - break; - - case PRINT_MORE_UI: - //draw_printmore(); - break; - - case FILAMENTCHANGE_UI: - //draw_FilamentChange(); - break; - case LEVELING_UI: - lv_draw_manualLevel(); - break; - - case BIND_UI: - //draw_bind(); - break; -#if tan_mask - case ZOFFSET_UI: - //draw_Zoffset(); - break; -#endif - case TOOL_UI: - lv_draw_tool(); - break; - case MESHLEVELING_UI: - //draw_meshleveling(); - break; - case HARDWARE_TEST_UI: - //draw_Hardwaretest(); - break; - case WIFI_LIST_UI: - //draw_Wifi_list(); - break; - case KEY_BOARD_UI: - //draw_Keyboard(); - break; - case TIPS_UI: - //draw_Tips(); - break; - case MACHINE_PARA_UI: - //draw_MachinePara(); - break; - case MACHINE_SETTINGS_UI: - //draw_MachineSettings(); - break; - case TEMPERATURE_SETTINGS_UI: - //draw_TemperatureSettings(); - break; - case MOTOR_SETTINGS_UI: - //draw_MotorSettings(); - break; - case MACHINETYPE_UI: - //draw_MachineType(); - break; - case STROKE_UI: - //draw_Stroke(); - break; - case HOME_DIR_UI: - //draw_HomeDir(); - break; - case ENDSTOP_TYPE_UI: - //draw_EndstopType(); - break; - case FILAMENT_SETTINGS_UI: - //draw_FilamentSettings(); - break; - case LEVELING_SETTIGNS_UI: - //draw_LevelingSettings(); - break; - case LEVELING_PARA_UI: - //draw_LevelingPara(); - break; - case DELTA_LEVELING_PARA_UI: - //draw_DeltaLevelPara(); - break; - case XYZ_LEVELING_PARA_UI: - //draw_XYZLevelPara(); - break; - case MAXFEEDRATE_UI: - //draw_MaxFeedRate(); - break; - case STEPS_UI: - //draw_Steps(); - break; - case ACCELERATION_UI: - //draw_Acceleration(); - break; - case JERK_UI: - //draw_Jerk(); - break; - case MOTORDIR_UI: - //draw_MotorDir(); - break; - case HOMESPEED_UI: - //draw_HomeSpeed(); - break; - case NOZZLE_CONFIG_UI: - //draw_NozzleConfig(); - break; - case HOTBED_CONFIG_UI: - //draw_HotbedConfig(); - break; - case ADVANCED_UI: - //draw_Advanced(); - break; - case DOUBLE_Z_UI: - //draw_DoubleZ(); - break; - case ENABLE_INVERT_UI: - //draw_EnableInvert(); - break; - case NUMBER_KEY_UI: - //draw_NumberKey(); - break; - case DIALOG_UI: - //draw_dialog(DialogType); - break; - case BABY_STEP_UI: - //draw_babyStep(); - break; - - default: - break; - } - } - - + case MOTORDIR_UI: + //draw_MotorDir(); + break; + case HOMESPEED_UI: + //draw_HomeSpeed(); + break; + case NOZZLE_CONFIG_UI: + //draw_NozzleConfig(); + break; + case HOTBED_CONFIG_UI: + //draw_HotbedConfig(); + break; + case ADVANCED_UI: + //draw_Advanced(); + break; + case DOUBLE_Z_UI: + //draw_DoubleZ(); + break; + case ENABLE_INVERT_UI: + //draw_EnableInvert(); + break; + case NUMBER_KEY_UI: + //draw_NumberKey(); + break; + case DIALOG_UI: + //draw_dialog(DialogType); + break; + case BABY_STEP_UI: + //draw_babyStep(); + break; + default: break; + } + } } #if ENABLED(SDSUPPORT) -void sd_detection() -{ - #if ENABLED(SDSUPPORT) + void sd_detection() { static bool last_sd_status; const bool sd_status = IS_SD_INSERTED(); if (sd_status != last_sd_status) { last_sd_status = sd_status; - if (sd_status) { - card.mount(); - } - else { - card.release(); - } + if (sd_status) card.mount(); else card.release(); } - #endif // SDSUPPORT -} + } #endif extern volatile uint32_t systick_uptime_millis; -void print_time_count() -{ - if((systick_uptime_millis % 1000) == 0) - { - if(print_time.start == 1) - { - print_time.seconds++; - } - } +void print_time_count() { + if ((systick_uptime_millis % 1000) == 0) { + if (print_time.start == 1) + print_time.seconds++; + } } -void LV_TASK_HANDLER() -{ - //lv_tick_inc(1); - lv_task_handler(); - #if ENABLED(MKS_TEST) - mks_test(); - #endif - disp_pre_gcode(2,36); - GUI_RefreshPage(); - //sd_detection(); +void LV_TASK_HANDLER() { + //lv_tick_inc(1); + lv_task_handler(); + TERN_(MKS_TEST, mks_test()); + disp_pre_gcode(2,36); + GUI_RefreshPage(); + //sd_detection(); } -#endif +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp b/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp index 0a78f3e653ca..513fe41c391c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp @@ -23,103 +23,95 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + +#include "../../../../MarlinCore.h" #include "lvgl.h" #include "pic_manager.h" - -typedef struct{ - uint16_t min; - uint16_t max; - uint8_t bpp; - uint8_t reserved[3]; -}x_header_t; typedef struct{ - uint32_t pos; -}x_table_t; + uint16_t min; + uint16_t max; + uint8_t bpp; + uint8_t reserved[3]; +} x_header_t; + typedef struct{ - uint8_t adv_w; - uint8_t box_w; -}glyph_dsc_t; + uint32_t pos; +} x_table_t; +typedef struct{ + uint8_t adv_w; + uint8_t box_w; +} glyph_dsc_t; -static x_header_t __g_xbf_hd = { - .min = 0, - .max = 0, - .bpp = 0, -}; +static x_header_t __g_xbf_hd = { .min = 0, .max = 0, .bpp = 0 }; static uint8_t __g_font_buf[75]; static uint8_t *__user_font_getdata(int offset, int size){ - //memset(__g_font_buf,0,sizeof(__g_font_buf)); - get_spi_flash_data((char *)__g_font_buf,offset,size); - return __g_font_buf; - //return &buf_test[offset]; + //memset(__g_font_buf,0,sizeof(__g_font_buf)); + get_spi_flash_data((char *)__g_font_buf,offset,size); + return __g_font_buf; + //return &buf_test[offset]; } - static const uint8_t * __user_font_get_bitmap(const lv_font_t * font, uint32_t unicode_letter) { - if( __g_xbf_hd.max==0 ) { - uint8_t *p = __user_font_getdata(0, sizeof(x_header_t)); - memcpy(&__g_xbf_hd, p, sizeof(x_header_t)); - } - if( unicode_letter>__g_xbf_hd.max || unicode_letter<__g_xbf_hd.min ) { - return NULL; - } - uint32_t unicode_offset = sizeof(x_header_t)+(unicode_letter-__g_xbf_hd.min)*4; - uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); - if( p_pos[0] != 0 ) { - uint32_t pos = p_pos[0]; - //glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(pos, 2); - __user_font_getdata(pos, 2); - //return __user_font_getdata(pos+2, gdsc->box_w*__g_xbf_hd.bpp/8); - return __user_font_getdata(pos+2, sizeof(__g_font_buf)); - } + if ( __g_xbf_hd.max==0 ) { + uint8_t *p = __user_font_getdata(0, sizeof(x_header_t)); + memcpy(&__g_xbf_hd, p, sizeof(x_header_t)); + } + if ( unicode_letter>__g_xbf_hd.max || unicode_letter<__g_xbf_hd.min ) { return NULL; + } + uint32_t unicode_offset = sizeof(x_header_t)+(unicode_letter-__g_xbf_hd.min)*4; + uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); + if ( p_pos[0] != 0 ) { + uint32_t pos = p_pos[0]; + //glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(pos, 2); + __user_font_getdata(pos, 2); + //return __user_font_getdata(pos+2, gdsc->box_w*__g_xbf_hd.bpp/8); + return __user_font_getdata(pos+2, sizeof(__g_font_buf)); + } + return NULL; } - static bool __user_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { - if( __g_xbf_hd.max==0 ) { - uint8_t *p = __user_font_getdata(0, sizeof(x_header_t)); - memcpy(&__g_xbf_hd, p, sizeof(x_header_t)); - } - if( unicode_letter>__g_xbf_hd.max || unicode_letter<__g_xbf_hd.min ) { - return NULL; - } - uint32_t unicode_offset = sizeof(x_header_t)+(unicode_letter-__g_xbf_hd.min)*4; - uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); - if( p_pos[0] != 0 ) { - glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(p_pos[0], 2); - dsc_out->adv_w = gdsc->adv_w; - dsc_out->box_h = font->line_height; - dsc_out->box_w = gdsc->box_w; - dsc_out->ofs_x = 0; - dsc_out->ofs_y = 0; - dsc_out->bpp = __g_xbf_hd.bpp; - return true; - } - return false; + if ( __g_xbf_hd.max==0 ) { + uint8_t *p = __user_font_getdata(0, sizeof(x_header_t)); + memcpy(&__g_xbf_hd, p, sizeof(x_header_t)); + } + if ( unicode_letter>__g_xbf_hd.max || unicode_letter<__g_xbf_hd.min ) { + return NULL; + } + uint32_t unicode_offset = sizeof(x_header_t)+(unicode_letter-__g_xbf_hd.min)*4; + uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); + if ( p_pos[0] != 0 ) { + glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(p_pos[0], 2); + dsc_out->adv_w = gdsc->adv_w; + dsc_out->box_h = font->line_height; + dsc_out->box_w = gdsc->box_w; + dsc_out->ofs_x = 0; + dsc_out->ofs_y = 0; + dsc_out->bpp = __g_xbf_hd.bpp; + return true; + } + return false; } - - /*lv_font_t gb2312_puhui32 = { - .get_glyph_bitmap = __user_font_get_bitmap, - .get_glyph_dsc = __user_font_get_glyph_dsc, - .line_height = 25, - .base_line = 0, + .get_glyph_bitmap = __user_font_get_bitmap, + .get_glyph_dsc = __user_font_get_glyph_dsc, + .line_height = 25, + .base_line = 0, };*/ lv_font_t gb2312_puhui32; -void init_gb2312_font() -{ - gb2312_puhui32.get_glyph_bitmap = __user_font_get_bitmap; - gb2312_puhui32.get_glyph_dsc = __user_font_get_glyph_dsc; - gb2312_puhui32.line_height = 25; - gb2312_puhui32.base_line = 0; +void init_gb2312_font() { + gb2312_puhui32.get_glyph_bitmap = __user_font_get_bitmap; + gb2312_puhui32.get_glyph_dsc = __user_font_get_glyph_dsc; + gb2312_puhui32.line_height = 25; + gb2312_puhui32.base_line = 0; } -//end of file -#endif +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp index 83ac109ec4db..2965a6b96bf0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp @@ -19,10 +19,12 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) +#include "../../../../MarlinCore.h" + #include "tft_lvgl_configuration.h" #include "lvgl.h" #include "../../../../feature/touch/xpt2046.h" @@ -30,767 +32,570 @@ #include "W25Qxx.h" #include "pic_manager.h" -//#include "../MarlinCore.h" #include "mks_hardware_test.h" #include "../../../../module/temperature.h" #if ENABLED(MKS_TEST) -extern uint8_t curent_disp_ui; + extern uint8_t curent_disp_ui; -uint8_t pw_det_sta,pw_off_sta,mt_det_sta,mt_det2_sta,mt_det3_sta; -uint8_t endstopx1_sta,endstopx2_sta,endstopy1_sta,endstopy2_sta,endstopz1_sta,endstopz2_sta; -void test_gpio_readlevel_L() { - volatile uint32_t itest; - digitalWrite(WIFI_IO2_PIN, HIGH); - itest = 10000; - while(itest--); - pw_det_sta = (digitalRead(POWER_LOSS_PIN) == 0); - pw_off_sta = (digitalRead(PS_ON_PIN) == 0); - mt_det_sta = (digitalRead(FIL_RUNOUT_PIN) == 0); - mt_det2_sta = (digitalRead(FIL_RUNOUT_2_PIN) == 0); - mt_det3_sta = (digitalRead(FIL_RUNOUT_3_PIN) == 0); - endstopx1_sta = (digitalRead(X_MIN_PIN) == 0); - endstopx2_sta = (digitalRead(X_MAX_PIN) == 0); - endstopy1_sta = (digitalRead(Y_MIN_PIN) == 0); - endstopy2_sta = (digitalRead(Y_MAX_PIN) == 0); - endstopz1_sta = (digitalRead(Z_MIN_PIN) == 0); - endstopz2_sta = (digitalRead(Z_MAX_PIN) == 0); -} + uint8_t pw_det_sta, pw_off_sta, mt_det_sta, mt_det2_sta, mt_det3_sta; + uint8_t endstopx1_sta, endstopx2_sta, endstopy1_sta, endstopy2_sta, endstopz1_sta, endstopz2_sta; + void test_gpio_readlevel_L() { + volatile uint32_t itest; + digitalWrite(WIFI_IO2_PIN, HIGH); + itest = 10000; + while (itest--); + pw_det_sta = (digitalRead(POWER_LOSS_PIN) == 0); + pw_off_sta = (digitalRead(PS_ON_PIN) == 0); + mt_det_sta = (digitalRead(FIL_RUNOUT_PIN) == 0); + mt_det2_sta = (digitalRead(FIL_RUNOUT_2_PIN) == 0); + mt_det3_sta = (digitalRead(FIL_RUNOUT_3_PIN) == 0); + endstopx1_sta = (digitalRead(X_MIN_PIN) == 0); + endstopx2_sta = (digitalRead(X_MAX_PIN) == 0); + endstopy1_sta = (digitalRead(Y_MIN_PIN) == 0); + endstopy2_sta = (digitalRead(Y_MAX_PIN) == 0); + endstopz1_sta = (digitalRead(Z_MIN_PIN) == 0); + endstopz2_sta = (digitalRead(Z_MAX_PIN) == 0); + } -void test_gpio_readlevel_H() { - volatile uint32_t itest; - digitalWrite(WIFI_IO2_PIN, LOW); - itest = 10000; - while(itest--); - pw_det_sta = (digitalRead(POWER_LOSS_PIN) == 1); - pw_off_sta = (digitalRead(PS_ON_PIN) == 1); - mt_det_sta = (digitalRead(FIL_RUNOUT_PIN) == 1); - mt_det2_sta = (digitalRead(FIL_RUNOUT_2_PIN) == 1); - mt_det3_sta = (digitalRead(FIL_RUNOUT_3_PIN) == 1); - endstopx1_sta = (digitalRead(X_MIN_PIN) == 1); - endstopx2_sta = (digitalRead(X_MAX_PIN) == 1); - endstopy1_sta = (digitalRead(Y_MIN_PIN) == 1); - endstopy2_sta = (digitalRead(Y_MAX_PIN) == 1); - endstopz1_sta = (digitalRead(Z_MIN_PIN) == 1); - endstopz2_sta = (digitalRead(Z_MAX_PIN) == 1); -} + void test_gpio_readlevel_H() { + volatile uint32_t itest; + digitalWrite(WIFI_IO2_PIN, LOW); + itest = 10000; + while (itest--); + pw_det_sta = (digitalRead(POWER_LOSS_PIN) == 1); + pw_off_sta = (digitalRead(PS_ON_PIN) == 1); + mt_det_sta = (digitalRead(FIL_RUNOUT_PIN) == 1); + mt_det2_sta = (digitalRead(FIL_RUNOUT_2_PIN) == 1); + mt_det3_sta = (digitalRead(FIL_RUNOUT_3_PIN) == 1); + endstopx1_sta = (digitalRead(X_MIN_PIN) == 1); + endstopx2_sta = (digitalRead(X_MAX_PIN) == 1); + endstopy1_sta = (digitalRead(Y_MIN_PIN) == 1); + endstopy2_sta = (digitalRead(Y_MAX_PIN) == 1); + endstopz1_sta = (digitalRead(Z_MIN_PIN) == 1); + endstopz2_sta = (digitalRead(Z_MAX_PIN) == 1); + } -void init_Tst_GPIO() { - pinMode(X_MIN_PIN, INPUT_PULLUP); - pinMode(X_MAX_PIN, INPUT_PULLUP); - pinMode(Y_MIN_PIN, INPUT_PULLUP); - pinMode(Y_MAX_PIN, INPUT_PULLUP); - pinMode(Z_MIN_PIN, INPUT_PULLUP); - pinMode(Z_MAX_PIN, INPUT_PULLUP); + void init_Tst_GPIO() { + pinMode(X_MIN_PIN, INPUT_PULLUP); + pinMode(X_MAX_PIN, INPUT_PULLUP); + pinMode(Y_MIN_PIN, INPUT_PULLUP); + pinMode(Y_MAX_PIN, INPUT_PULLUP); + pinMode(Z_MIN_PIN, INPUT_PULLUP); + pinMode(Z_MAX_PIN, INPUT_PULLUP); - pinMode(WIFI_IO2_PIN, OUTPUT); + pinMode(WIFI_IO2_PIN, OUTPUT); - pinMode(FIL_RUNOUT_PIN, INPUT_PULLUP); - pinMode(FIL_RUNOUT_2_PIN, INPUT_PULLUP); - pinMode(FIL_RUNOUT_3_PIN, INPUT_PULLUP); + pinMode(FIL_RUNOUT_PIN, INPUT_PULLUP); + pinMode(FIL_RUNOUT_2_PIN, INPUT_PULLUP); + pinMode(FIL_RUNOUT_3_PIN, INPUT_PULLUP); - pinMode(POWER_LOSS_PIN, INPUT_PULLUP); - pinMode(PS_ON_PIN, INPUT_PULLUP); + pinMode(POWER_LOSS_PIN, INPUT_PULLUP); + pinMode(PS_ON_PIN, INPUT_PULLUP); - pinMode(SERVO0_PIN, INPUT_PULLUP); + pinMode(SERVO0_PIN, INPUT_PULLUP); - pinMode(E0_ENABLE_PIN, OUTPUT); - pinMode(X_ENABLE_PIN, OUTPUT); + pinMode(E0_ENABLE_PIN, OUTPUT); + pinMode(X_ENABLE_PIN, OUTPUT); - digitalWrite(X_ENABLE_PIN, LOW); - digitalWrite(Y_ENABLE_PIN, LOW); - digitalWrite(Z_ENABLE_PIN, LOW); - digitalWrite(E0_ENABLE_PIN, LOW); - digitalWrite(E1_ENABLE_PIN, LOW); - digitalWrite(E2_ENABLE_PIN, LOW); -} + digitalWrite(X_ENABLE_PIN, LOW); + digitalWrite(Y_ENABLE_PIN, LOW); + digitalWrite(Z_ENABLE_PIN, LOW); + digitalWrite(E0_ENABLE_PIN, LOW); + digitalWrite(E1_ENABLE_PIN, LOW); + digitalWrite(E2_ENABLE_PIN, LOW); + } -void mks_test_beeper(){ - digitalWrite(BEEPER_PIN, HIGH); - delay(100); - digitalWrite(BEEPER_PIN, LOW); - delay(100); -} + void mks_test_beeper(){ + digitalWrite(BEEPER_PIN, HIGH); + delay(100); + digitalWrite(BEEPER_PIN, LOW); + delay(100); + } -void Test_GPIO() { - init_Tst_GPIO(); + void Test_GPIO() { + init_Tst_GPIO(); - test_gpio_readlevel_L(); - test_gpio_readlevel_H(); - test_gpio_readlevel_L(); - if ((pw_det_sta == 1)&&(mt_det_sta == 1)&&(mt_det2_sta == 1)&&(mt_det3_sta == 1)) { - if (curent_disp_ui == 1) disp_det_ok(); - } - else { - if (curent_disp_ui == 1) disp_det_error(); - } - if ( (endstopx1_sta == 1) - && (endstopx2_sta == 1) - && (endstopy1_sta == 1) - && (endstopy2_sta == 1) - && (endstopz1_sta == 1) - && (endstopz2_sta == 1) - ) { - if (curent_disp_ui == 1) disp_Limit_ok(); - } - else { - if (curent_disp_ui == 1) { - disp_Limit_error(); - //mks_test_beeper(); + test_gpio_readlevel_L(); + test_gpio_readlevel_H(); + test_gpio_readlevel_L(); + if ((pw_det_sta == 1)&&(mt_det_sta == 1)&&(mt_det2_sta == 1)&&(mt_det3_sta == 1)) { + if (curent_disp_ui == 1) disp_det_ok(); + } + else { + if (curent_disp_ui == 1) disp_det_error(); + } + if ( (endstopx1_sta == 1) + && (endstopx2_sta == 1) + && (endstopy1_sta == 1) + && (endstopy2_sta == 1) + && (endstopz1_sta == 1) + && (endstopz2_sta == 1) + ) { + if (curent_disp_ui == 1) disp_Limit_ok(); + } + else { + if (curent_disp_ui == 1) { + disp_Limit_error(); + //mks_test_beeper(); + } } } -} -void mks_test() { - if (millis() % 2000 <1000){ - digitalWrite(X_DIR_PIN, LOW); - digitalWrite(Y_DIR_PIN, LOW); - digitalWrite(Z_DIR_PIN, LOW); - digitalWrite(E0_DIR_PIN, LOW); - digitalWrite(E1_DIR_PIN, LOW); - digitalWrite(E2_DIR_PIN, LOW); - thermalManager.fan_speed[0] = 255; - digitalWrite(HEATER_2_PIN, HIGH);//HE2 - digitalWrite(HEATER_1_PIN, HIGH);//HE1 - digitalWrite(HEATER_0_PIN, HIGH);//HE0 - digitalWrite(HEATER_BED_PIN, HIGH);//HOT-BED - } - else { - digitalWrite(X_DIR_PIN, HIGH); - digitalWrite(Y_DIR_PIN, HIGH); - digitalWrite(Z_DIR_PIN, HIGH); - digitalWrite(E0_DIR_PIN, HIGH); - digitalWrite(E1_DIR_PIN, HIGH); - digitalWrite(E2_DIR_PIN, HIGH); - thermalManager.fan_speed[0] = 0; - digitalWrite(HEATER_2_PIN, LOW);//HE2 - digitalWrite(HEATER_1_PIN, LOW);//HE1 - digitalWrite(HEATER_0_PIN, LOW);//HE0 - digitalWrite(HEATER_BED_PIN, LOW);//HOT-BED - } - if ( (endstopx1_sta == 1) - && (endstopx2_sta == 1) - && (endstopy1_sta == 1) - && (endstopy2_sta == 1) - && (endstopz1_sta == 1) - && (endstopz2_sta == 1) - ) { + void mks_test() { + if (millis() % 2000 <1000){ + digitalWrite(X_DIR_PIN, LOW); + digitalWrite(Y_DIR_PIN, LOW); + digitalWrite(Z_DIR_PIN, LOW); + digitalWrite(E0_DIR_PIN, LOW); + digitalWrite(E1_DIR_PIN, LOW); + digitalWrite(E2_DIR_PIN, LOW); + thermalManager.fan_speed[0] = 255; + digitalWrite(HEATER_2_PIN, HIGH);//HE2 + digitalWrite(HEATER_1_PIN, HIGH);//HE1 + digitalWrite(HEATER_0_PIN, HIGH);//HE0 + digitalWrite(HEATER_BED_PIN, HIGH);//HOT-BED + } + else { + digitalWrite(X_DIR_PIN, HIGH); + digitalWrite(Y_DIR_PIN, HIGH); + digitalWrite(Z_DIR_PIN, HIGH); + digitalWrite(E0_DIR_PIN, HIGH); + digitalWrite(E1_DIR_PIN, HIGH); + digitalWrite(E2_DIR_PIN, HIGH); + thermalManager.fan_speed[0] = 0; + digitalWrite(HEATER_2_PIN, LOW);//HE2 + digitalWrite(HEATER_1_PIN, LOW);//HE1 + digitalWrite(HEATER_0_PIN, LOW);//HE0 + digitalWrite(HEATER_BED_PIN, LOW);//HOT-BED + } + if ( (endstopx1_sta == 1) + && (endstopx2_sta == 1) + && (endstopy1_sta == 1) + && (endstopy2_sta == 1) + && (endstopz1_sta == 1) + && (endstopz2_sta == 1) + ) { - } - else - mks_test_beeper(); + } + else + mks_test_beeper(); - if (curent_disp_ui == 1) - disp_test(); -} + if (curent_disp_ui == 1) + disp_test(); + } #endif // MKS_TEST -const uint16_t ASCII_Table_16x24[] = { - /** - * @brief Space ' ' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '!' - */ - 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, - 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, 0x0000, - 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '"' - */ - 0x0000, 0x0000, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '#' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C60, 0x0C60, - 0x0C60, 0x0630, 0x0630, 0x1FFE, 0x1FFE, 0x0630, 0x0738, 0x0318, - 0x1FFE, 0x1FFE, 0x0318, 0x0318, 0x018C, 0x018C, 0x018C, 0x0000, - /** - * @brief '$' - */ - 0x0000, 0x0080, 0x03E0, 0x0FF8, 0x0E9C, 0x1C8C, 0x188C, 0x008C, - 0x0098, 0x01F8, 0x07E0, 0x0E80, 0x1C80, 0x188C, 0x188C, 0x189C, - 0x0CB8, 0x0FF0, 0x03E0, 0x0080, 0x0080, 0x0000, 0x0000, 0x0000, - /** - * @brief '%' - */ - 0x0000, 0x0000, 0x0000, 0x180E, 0x0C1B, 0x0C11, 0x0611, 0x0611, - 0x0311, 0x0311, 0x019B, 0x018E, 0x38C0, 0x6CC0, 0x4460, 0x4460, - 0x4430, 0x4430, 0x4418, 0x6C18, 0x380C, 0x0000, 0x0000, 0x0000, - /** - * @brief '&' - */ - 0x0000, 0x01E0, 0x03F0, 0x0738, 0x0618, 0x0618, 0x0330, 0x01F0, - 0x00F0, 0x00F8, 0x319C, 0x330E, 0x1E06, 0x1C06, 0x1C06, 0x3F06, - 0x73FC, 0x21F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief ''' - */ - 0x0000, 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '(' - */ - 0x0000, 0x0200, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x0060, 0x0060, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0060, 0x0060, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0200, 0x0000, - /** - * @brief ')' - */ - 0x0000, 0x0020, 0x0060, 0x00C0, 0x0180, 0x0180, 0x0300, 0x0300, - 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, - 0x0300, 0x0300, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0020, 0x0000, - /** - * @brief '*' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, - 0x06D8, 0x07F8, 0x01E0, 0x0330, 0x0738, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '+' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, - 0x0180, 0x0180, 0x0180, 0x3FFC, 0x3FFC, 0x0180, 0x0180, 0x0180, - 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief ',' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, - /** - * @brief '-' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x07E0, 0x07E0, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '.' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '/' - */ - 0x0000, 0x0C00, 0x0C00, 0x0600, 0x0600, 0x0600, 0x0300, 0x0300, - 0x0300, 0x0380, 0x0180, 0x0180, 0x0180, 0x00C0, 0x00C0, 0x00C0, - 0x0060, 0x0060, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '0' - */ - 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x180C, 0x180C, 0x180C, - 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C18, 0x0E38, - 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '1' - */ - 0x0000, 0x0100, 0x0180, 0x01C0, 0x01F0, 0x0198, 0x0188, 0x0180, - 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, - 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '2' - */ - 0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x1800, - 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, - 0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '3' - */ - 0x0000, 0x01E0, 0x07F8, 0x0E18, 0x0C0C, 0x0C0C, 0x0C00, 0x0600, - 0x03C0, 0x07C0, 0x0C00, 0x1800, 0x1800, 0x180C, 0x180C, 0x0C18, - 0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '4' - */ - 0x0000, 0x0C00, 0x0E00, 0x0F00, 0x0F00, 0x0D80, 0x0CC0, 0x0C60, - 0x0C60, 0x0C30, 0x0C18, 0x0C0C, 0x3FFC, 0x3FFC, 0x0C00, 0x0C00, - 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '5' - */ - 0x0000, 0x0FF8, 0x0FF8, 0x0018, 0x0018, 0x000C, 0x03EC, 0x07FC, - 0x0E1C, 0x1C00, 0x1800, 0x1800, 0x1800, 0x180C, 0x0C1C, 0x0E18, - 0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '6' - */ - 0x0000, 0x07C0, 0x0FF0, 0x1C38, 0x1818, 0x0018, 0x000C, 0x03CC, - 0x0FEC, 0x0E3C, 0x1C1C, 0x180C, 0x180C, 0x180C, 0x1C18, 0x0E38, - 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '7' - */ - 0x0000, 0x1FFC, 0x1FFC, 0x0C00, 0x0600, 0x0600, 0x0300, 0x0380, - 0x0180, 0x01C0, 0x00C0, 0x00E0, 0x0060, 0x0060, 0x0070, 0x0030, - 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '8' - */ - 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x0C18, 0x0C18, 0x0638, - 0x07F0, 0x07F0, 0x0C18, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C38, - 0x0FF8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '9' - */ - 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C1C, 0x180C, 0x180C, 0x180C, - 0x1C1C, 0x1E38, 0x1BF8, 0x19E0, 0x1800, 0x0C00, 0x0C00, 0x0E1C, - 0x07F8, 0x01F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief ':' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief ';' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, 0x0000, - /** - * @brief '<' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1000, 0x1C00, 0x0F80, 0x03E0, 0x00F8, 0x0018, 0x00F8, 0x03E0, - 0x0F80, 0x1C00, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '=' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1FF8, 0x0000, 0x0000, 0x0000, 0x1FF8, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '>' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0008, 0x0038, 0x01F0, 0x07C0, 0x1F00, 0x1800, 0x1F00, 0x07C0, - 0x01F0, 0x0038, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '?' - */ - 0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x0C00, - 0x0600, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x0000, 0x0000, - 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '@' - */ - 0x0000, 0x0000, 0x07E0, 0x1818, 0x2004, 0x29C2, 0x4A22, 0x4411, - 0x4409, 0x4409, 0x4409, 0x2209, 0x1311, 0x0CE2, 0x4002, 0x2004, - 0x1818, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'A' - */ - 0x0000, 0x0380, 0x0380, 0x06C0, 0x06C0, 0x06C0, 0x0C60, 0x0C60, - 0x1830, 0x1830, 0x1830, 0x3FF8, 0x3FF8, 0x701C, 0x600C, 0x600C, - 0xC006, 0xC006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'B' - */ - 0x0000, 0x03FC, 0x0FFC, 0x0C0C, 0x180C, 0x180C, 0x180C, 0x0C0C, - 0x07FC, 0x0FFC, 0x180C, 0x300C, 0x300C, 0x300C, 0x300C, 0x180C, - 0x1FFC, 0x07FC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'C' - */ - 0x0000, 0x07C0, 0x1FF0, 0x3838, 0x301C, 0x700C, 0x6006, 0x0006, - 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x6006, 0x700C, 0x301C, - 0x1FF0, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'D' - */ - 0x0000, 0x03FE, 0x0FFE, 0x0E06, 0x1806, 0x1806, 0x3006, 0x3006, - 0x3006, 0x3006, 0x3006, 0x3006, 0x3006, 0x1806, 0x1806, 0x0E06, - 0x0FFE, 0x03FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'E' - */ - 0x0000, 0x3FFC, 0x3FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, - 0x1FFC, 0x1FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, - 0x3FFC, 0x3FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'F' - */ - 0x0000, 0x3FF8, 0x3FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, - 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, - 0x0018, 0x0018, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'G' - */ - 0x0000, 0x0FE0, 0x3FF8, 0x783C, 0x600E, 0xE006, 0xC007, 0x0003, - 0x0003, 0xFE03, 0xFE03, 0xC003, 0xC007, 0xC006, 0xC00E, 0xF03C, - 0x3FF8, 0x0FE0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'H' - */ - 0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, - 0x3FFC, 0x3FFC, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, - 0x300C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'I' - */ - 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, - 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, - 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'J' - */ - 0x0000, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, - 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0618, 0x0618, 0x0738, - 0x03F0, 0x01E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'K' - */ - 0x0000, 0x3006, 0x1806, 0x0C06, 0x0606, 0x0306, 0x0186, 0x00C6, - 0x0066, 0x0076, 0x00DE, 0x018E, 0x0306, 0x0606, 0x0C06, 0x1806, - 0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'L' - */ - 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, - 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, - 0x1FF8, 0x1FF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'M' - */ - 0x0000, 0xE00E, 0xF01E, 0xF01E, 0xF01E, 0xD836, 0xD836, 0xD836, - 0xD836, 0xCC66, 0xCC66, 0xCC66, 0xC6C6, 0xC6C6, 0xC6C6, 0xC6C6, - 0xC386, 0xC386, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'N' - */ - 0x0000, 0x300C, 0x301C, 0x303C, 0x303C, 0x306C, 0x306C, 0x30CC, - 0x30CC, 0x318C, 0x330C, 0x330C, 0x360C, 0x360C, 0x3C0C, 0x3C0C, - 0x380C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'O' - */ - 0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xC003, 0xC003, - 0xC003, 0xC003, 0xC003, 0xC003, 0xC003, 0x6006, 0x700E, 0x381C, - 0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'P' - */ - 0x0000, 0x0FFC, 0x1FFC, 0x380C, 0x300C, 0x300C, 0x300C, 0x300C, - 0x180C, 0x1FFC, 0x07FC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, - 0x000C, 0x000C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'Q' - */ - 0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xE003, 0xC003, - 0xC003, 0xC003, 0xC003, 0xC003, 0xE007, 0x6306, 0x3F0E, 0x3C1C, - 0x3FF8, 0xF7E0, 0xC000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'R' - */ - 0x0000, 0x0FFE, 0x1FFE, 0x3806, 0x3006, 0x3006, 0x3006, 0x3806, - 0x1FFE, 0x07FE, 0x0306, 0x0606, 0x0C06, 0x1806, 0x1806, 0x3006, - 0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'S' - */ - 0x0000, 0x03E0, 0x0FF8, 0x0C1C, 0x180C, 0x180C, 0x000C, 0x001C, - 0x03F8, 0x0FE0, 0x1E00, 0x3800, 0x3006, 0x3006, 0x300E, 0x1C1C, - 0x0FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'T' - */ - 0x0000, 0x7FFE, 0x7FFE, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, - 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, - 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'U' - */ - 0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, - 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x1818, - 0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'V' - */ - 0x0000, 0x6003, 0x3006, 0x3006, 0x3006, 0x180C, 0x180C, 0x180C, - 0x0C18, 0x0C18, 0x0E38, 0x0630, 0x0630, 0x0770, 0x0360, 0x0360, - 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'W' - */ - 0x0000, 0x6003, 0x61C3, 0x61C3, 0x61C3, 0x3366, 0x3366, 0x3366, - 0x3366, 0x3366, 0x3366, 0x1B6C, 0x1B6C, 0x1B6C, 0x1A2C, 0x1E3C, - 0x0E38, 0x0E38, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'X' - */ - 0x0000, 0xE00F, 0x700C, 0x3018, 0x1830, 0x0C70, 0x0E60, 0x07C0, - 0x0380, 0x0380, 0x03C0, 0x06E0, 0x0C70, 0x1C30, 0x1818, 0x300C, - 0x600E, 0xE007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'Y' - */ - 0x0000, 0xC003, 0x6006, 0x300C, 0x381C, 0x1838, 0x0C30, 0x0660, - 0x07E0, 0x03C0, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, - 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'Z' - */ - 0x0000, 0x7FFC, 0x7FFC, 0x6000, 0x3000, 0x1800, 0x0C00, 0x0600, - 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, 0x000C, 0x0006, - 0x7FFE, 0x7FFE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '[' - */ - 0x0000, 0x03E0, 0x03E0, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, - 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, - 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x03E0, 0x03E0, 0x0000, - /** - * @brief '\' - */ - 0x0000, 0x0030, 0x0030, 0x0060, 0x0060, 0x0060, 0x00C0, 0x00C0, - 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0300, 0x0300, 0x0300, - 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief ']' - */ - 0x0000, 0x03E0, 0x03E0, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, - 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, - 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x03E0, 0x03E0, 0x0000, - /** - * @brief '^' - */ - 0x0000, 0x0000, 0x01C0, 0x01C0, 0x0360, 0x0360, 0x0360, 0x0630, - 0x0630, 0x0C18, 0x0C18, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '_' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief ''' - */ - 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'a' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03F0, 0x07F8, - 0x0C1C, 0x0C0C, 0x0F00, 0x0FF0, 0x0CF8, 0x0C0C, 0x0C0C, 0x0F1C, - 0x0FF8, 0x18F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'b' - */ - 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x03D8, 0x0FF8, - 0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38, - 0x0FF8, 0x03D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'c' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x07F0, - 0x0E30, 0x0C18, 0x0018, 0x0018, 0x0018, 0x0018, 0x0C18, 0x0E30, - 0x07F0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'd' - */ - 0x0000, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x1BC0, 0x1FF0, - 0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30, - 0x1FF0, 0x1BC0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'e' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0, - 0x0C30, 0x1818, 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x1838, 0x1C30, - 0x0FF0, 0x07C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'f' - */ - 0x0000, 0x0F80, 0x0FC0, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0, - 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, - 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'g' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0DE0, 0x0FF8, - 0x0E18, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0E18, - 0x0FF8, 0x0DE0, 0x0C00, 0x0C0C, 0x061C, 0x07F8, 0x01F0, 0x0000, - /** - * @brief 'h' - */ - 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x07D8, 0x0FF8, - 0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, - 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'i' - */ - 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, - 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, - 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'j' - */ - 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, - 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, - 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00F8, 0x0078, 0x0000, - /** - * @brief 'k' - */ - 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0C0C, 0x060C, - 0x030C, 0x018C, 0x00CC, 0x006C, 0x00FC, 0x019C, 0x038C, 0x030C, - 0x060C, 0x0C0C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'l' - */ - 0x0000, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, - 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, - 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'm' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3C7C, 0x7EFF, - 0xE3C7, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, - 0xC183, 0xC183, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'n' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0798, 0x0FF8, - 0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, - 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'o' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0, - 0x0C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C30, - 0x0FF0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'p' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03D8, 0x0FF8, - 0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38, - 0x0FF8, 0x03D8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0000, - /** - * @brief 'q' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1BC0, 0x1FF0, - 0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30, - 0x1FF0, 0x1BC0, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x0000, - /** - * @brief 'r' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07B0, 0x03F0, - 0x0070, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 's' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03E0, 0x03F0, - 0x0E38, 0x0C18, 0x0038, 0x03F0, 0x07C0, 0x0C00, 0x0C18, 0x0E38, - 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 't' - */ - 0x0000, 0x0000, 0x0080, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0, - 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, - 0x07C0, 0x0780, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'u' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1818, 0x1818, - 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C38, - 0x1FF0, 0x19E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'v' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x180C, 0x0C18, - 0x0C18, 0x0C18, 0x0630, 0x0630, 0x0630, 0x0360, 0x0360, 0x0360, - 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'w' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41C1, 0x41C1, - 0x61C3, 0x6363, 0x6363, 0x6363, 0x3636, 0x3636, 0x3636, 0x1C1C, - 0x1C1C, 0x1C1C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'x' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x381C, 0x1C38, - 0x0C30, 0x0660, 0x0360, 0x0360, 0x0360, 0x0360, 0x0660, 0x0C30, - 0x1C38, 0x381C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief 'y' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3018, 0x1830, - 0x1830, 0x1870, 0x0C60, 0x0C60, 0x0CE0, 0x06C0, 0x06C0, 0x0380, - 0x0380, 0x0380, 0x0180, 0x0180, 0x01C0, 0x00F0, 0x0070, 0x0000, - /** - * @brief 'z' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1FFC, 0x1FFC, - 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, - 0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /** - * @brief '{' - */ - 0x0000, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, - 0x00C0, 0x0060, 0x0060, 0x0030, 0x0060, 0x0040, 0x00C0, 0x00C0, - 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0000, 0x0000, - /** - * @brief '|' - */ - 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, - 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, - 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, - /** - * @brief '}' - */ - 0x0000, 0x0060, 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0180, - 0x0180, 0x0300, 0x0300, 0x0600, 0x0300, 0x0100, 0x0180, 0x0180, - 0x0180, 0x0180, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0000, 0x0000, - /** - * @brief '~' - */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x10F0, 0x1FF8, 0x0F08, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +static const uint16_t ASCII_Table_16x24[] PROGMEM = { + // Space ' ' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '!' + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '"' + 0x0000, 0x0000, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '#' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C60, 0x0C60, + 0x0C60, 0x0630, 0x0630, 0x1FFE, 0x1FFE, 0x0630, 0x0738, 0x0318, + 0x1FFE, 0x1FFE, 0x0318, 0x0318, 0x018C, 0x018C, 0x018C, 0x0000, + // '$' + 0x0000, 0x0080, 0x03E0, 0x0FF8, 0x0E9C, 0x1C8C, 0x188C, 0x008C, + 0x0098, 0x01F8, 0x07E0, 0x0E80, 0x1C80, 0x188C, 0x188C, 0x189C, + 0x0CB8, 0x0FF0, 0x03E0, 0x0080, 0x0080, 0x0000, 0x0000, 0x0000, + // '%' + 0x0000, 0x0000, 0x0000, 0x180E, 0x0C1B, 0x0C11, 0x0611, 0x0611, + 0x0311, 0x0311, 0x019B, 0x018E, 0x38C0, 0x6CC0, 0x4460, 0x4460, + 0x4430, 0x4430, 0x4418, 0x6C18, 0x380C, 0x0000, 0x0000, 0x0000, + // '&' + 0x0000, 0x01E0, 0x03F0, 0x0738, 0x0618, 0x0618, 0x0330, 0x01F0, + 0x00F0, 0x00F8, 0x319C, 0x330E, 0x1E06, 0x1C06, 0x1C06, 0x3F06, + 0x73FC, 0x21F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // ''' + 0x0000, 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '(' + 0x0000, 0x0200, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x0060, 0x0060, + 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0060, 0x0060, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0200, 0x0000, + // ')' + 0x0000, 0x0020, 0x0060, 0x00C0, 0x0180, 0x0180, 0x0300, 0x0300, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, + 0x0300, 0x0300, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0020, 0x0000, + // '*' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x06D8, 0x07F8, 0x01E0, 0x0330, 0x0738, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '+' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x3FFC, 0x3FFC, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // ',' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, + // '-' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x07E0, 0x07E0, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '.' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '/' + 0x0000, 0x0C00, 0x0C00, 0x0600, 0x0600, 0x0600, 0x0300, 0x0300, + 0x0300, 0x0380, 0x0180, 0x0180, 0x0180, 0x00C0, 0x00C0, 0x00C0, + 0x0060, 0x0060, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '0' + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x180C, 0x180C, 0x180C, + 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '1' + 0x0000, 0x0100, 0x0180, 0x01C0, 0x01F0, 0x0198, 0x0188, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '2' + 0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x1800, + 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, + 0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '3' + 0x0000, 0x01E0, 0x07F8, 0x0E18, 0x0C0C, 0x0C0C, 0x0C00, 0x0600, + 0x03C0, 0x07C0, 0x0C00, 0x1800, 0x1800, 0x180C, 0x180C, 0x0C18, + 0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '4' + 0x0000, 0x0C00, 0x0E00, 0x0F00, 0x0F00, 0x0D80, 0x0CC0, 0x0C60, + 0x0C60, 0x0C30, 0x0C18, 0x0C0C, 0x3FFC, 0x3FFC, 0x0C00, 0x0C00, + 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '5' + 0x0000, 0x0FF8, 0x0FF8, 0x0018, 0x0018, 0x000C, 0x03EC, 0x07FC, + 0x0E1C, 0x1C00, 0x1800, 0x1800, 0x1800, 0x180C, 0x0C1C, 0x0E18, + 0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '6' + 0x0000, 0x07C0, 0x0FF0, 0x1C38, 0x1818, 0x0018, 0x000C, 0x03CC, + 0x0FEC, 0x0E3C, 0x1C1C, 0x180C, 0x180C, 0x180C, 0x1C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '7' + 0x0000, 0x1FFC, 0x1FFC, 0x0C00, 0x0600, 0x0600, 0x0300, 0x0380, + 0x0180, 0x01C0, 0x00C0, 0x00E0, 0x0060, 0x0060, 0x0070, 0x0030, + 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '8' + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x0C18, 0x0C18, 0x0638, + 0x07F0, 0x07F0, 0x0C18, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C38, + 0x0FF8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '9' + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C1C, 0x180C, 0x180C, 0x180C, + 0x1C1C, 0x1E38, 0x1BF8, 0x19E0, 0x1800, 0x0C00, 0x0C00, 0x0E1C, + 0x07F8, 0x01F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // ':' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // ';' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, 0x0000, + // '<' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1000, 0x1C00, 0x0F80, 0x03E0, 0x00F8, 0x0018, 0x00F8, 0x03E0, + 0x0F80, 0x1C00, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '=' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1FF8, 0x0000, 0x0000, 0x0000, 0x1FF8, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '>' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0008, 0x0038, 0x01F0, 0x07C0, 0x1F00, 0x1800, 0x1F00, 0x07C0, + 0x01F0, 0x0038, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '?' + 0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x0C00, + 0x0600, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x0000, 0x0000, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '@' + 0x0000, 0x0000, 0x07E0, 0x1818, 0x2004, 0x29C2, 0x4A22, 0x4411, + 0x4409, 0x4409, 0x4409, 0x2209, 0x1311, 0x0CE2, 0x4002, 0x2004, + 0x1818, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'A' + 0x0000, 0x0380, 0x0380, 0x06C0, 0x06C0, 0x06C0, 0x0C60, 0x0C60, + 0x1830, 0x1830, 0x1830, 0x3FF8, 0x3FF8, 0x701C, 0x600C, 0x600C, + 0xC006, 0xC006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'B' + 0x0000, 0x03FC, 0x0FFC, 0x0C0C, 0x180C, 0x180C, 0x180C, 0x0C0C, + 0x07FC, 0x0FFC, 0x180C, 0x300C, 0x300C, 0x300C, 0x300C, 0x180C, + 0x1FFC, 0x07FC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'C' + 0x0000, 0x07C0, 0x1FF0, 0x3838, 0x301C, 0x700C, 0x6006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x6006, 0x700C, 0x301C, + 0x1FF0, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'D' + 0x0000, 0x03FE, 0x0FFE, 0x0E06, 0x1806, 0x1806, 0x3006, 0x3006, + 0x3006, 0x3006, 0x3006, 0x3006, 0x3006, 0x1806, 0x1806, 0x0E06, + 0x0FFE, 0x03FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'E' + 0x0000, 0x3FFC, 0x3FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x1FFC, 0x1FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x3FFC, 0x3FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'F' + 0x0000, 0x3FF8, 0x3FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x0018, 0x0018, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'G' + 0x0000, 0x0FE0, 0x3FF8, 0x783C, 0x600E, 0xE006, 0xC007, 0x0003, + 0x0003, 0xFE03, 0xFE03, 0xC003, 0xC007, 0xC006, 0xC00E, 0xF03C, + 0x3FF8, 0x0FE0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'H' + 0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x3FFC, 0x3FFC, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x300C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'I' + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'J' + 0x0000, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0618, 0x0618, 0x0738, + 0x03F0, 0x01E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'K' + 0x0000, 0x3006, 0x1806, 0x0C06, 0x0606, 0x0306, 0x0186, 0x00C6, + 0x0066, 0x0076, 0x00DE, 0x018E, 0x0306, 0x0606, 0x0C06, 0x1806, + 0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'L' + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x1FF8, 0x1FF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'M' + 0x0000, 0xE00E, 0xF01E, 0xF01E, 0xF01E, 0xD836, 0xD836, 0xD836, + 0xD836, 0xCC66, 0xCC66, 0xCC66, 0xC6C6, 0xC6C6, 0xC6C6, 0xC6C6, + 0xC386, 0xC386, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'N' + 0x0000, 0x300C, 0x301C, 0x303C, 0x303C, 0x306C, 0x306C, 0x30CC, + 0x30CC, 0x318C, 0x330C, 0x330C, 0x360C, 0x360C, 0x3C0C, 0x3C0C, + 0x380C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'O' + 0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xC003, 0xC003, + 0xC003, 0xC003, 0xC003, 0xC003, 0xC003, 0x6006, 0x700E, 0x381C, + 0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'P' + 0x0000, 0x0FFC, 0x1FFC, 0x380C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x180C, 0x1FFC, 0x07FC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'Q' + 0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xE003, 0xC003, + 0xC003, 0xC003, 0xC003, 0xC003, 0xE007, 0x6306, 0x3F0E, 0x3C1C, + 0x3FF8, 0xF7E0, 0xC000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'R' + 0x0000, 0x0FFE, 0x1FFE, 0x3806, 0x3006, 0x3006, 0x3006, 0x3806, + 0x1FFE, 0x07FE, 0x0306, 0x0606, 0x0C06, 0x1806, 0x1806, 0x3006, + 0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'S' + 0x0000, 0x03E0, 0x0FF8, 0x0C1C, 0x180C, 0x180C, 0x000C, 0x001C, + 0x03F8, 0x0FE0, 0x1E00, 0x3800, 0x3006, 0x3006, 0x300E, 0x1C1C, + 0x0FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'T' + 0x0000, 0x7FFE, 0x7FFE, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'U' + 0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x1818, + 0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'V' + 0x0000, 0x6003, 0x3006, 0x3006, 0x3006, 0x180C, 0x180C, 0x180C, + 0x0C18, 0x0C18, 0x0E38, 0x0630, 0x0630, 0x0770, 0x0360, 0x0360, + 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'W' + 0x0000, 0x6003, 0x61C3, 0x61C3, 0x61C3, 0x3366, 0x3366, 0x3366, + 0x3366, 0x3366, 0x3366, 0x1B6C, 0x1B6C, 0x1B6C, 0x1A2C, 0x1E3C, + 0x0E38, 0x0E38, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'X' + 0x0000, 0xE00F, 0x700C, 0x3018, 0x1830, 0x0C70, 0x0E60, 0x07C0, + 0x0380, 0x0380, 0x03C0, 0x06E0, 0x0C70, 0x1C30, 0x1818, 0x300C, + 0x600E, 0xE007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'Y' + 0x0000, 0xC003, 0x6006, 0x300C, 0x381C, 0x1838, 0x0C30, 0x0660, + 0x07E0, 0x03C0, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'Z' + 0x0000, 0x7FFC, 0x7FFC, 0x6000, 0x3000, 0x1800, 0x0C00, 0x0600, + 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, 0x000C, 0x0006, + 0x7FFE, 0x7FFE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '[' + 0x0000, 0x03E0, 0x03E0, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, + 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, + 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x03E0, 0x03E0, 0x0000, + // '\' + 0x0000, 0x0030, 0x0030, 0x0060, 0x0060, 0x0060, 0x00C0, 0x00C0, + 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0300, 0x0300, 0x0300, + 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // ']' + 0x0000, 0x03E0, 0x03E0, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, + 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, + 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x03E0, 0x03E0, 0x0000, + // '^' + 0x0000, 0x0000, 0x01C0, 0x01C0, 0x0360, 0x0360, 0x0360, 0x0630, + 0x0630, 0x0C18, 0x0C18, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '_' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // ''' + 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'a' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03F0, 0x07F8, + 0x0C1C, 0x0C0C, 0x0F00, 0x0FF0, 0x0CF8, 0x0C0C, 0x0C0C, 0x0F1C, + 0x0FF8, 0x18F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'b' + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x03D8, 0x0FF8, + 0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38, + 0x0FF8, 0x03D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'c' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x07F0, + 0x0E30, 0x0C18, 0x0018, 0x0018, 0x0018, 0x0018, 0x0C18, 0x0E30, + 0x07F0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'd' + 0x0000, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x1BC0, 0x1FF0, + 0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30, + 0x1FF0, 0x1BC0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'e' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0, + 0x0C30, 0x1818, 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x1838, 0x1C30, + 0x0FF0, 0x07C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'f' + 0x0000, 0x0F80, 0x0FC0, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'g' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0DE0, 0x0FF8, + 0x0E18, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0E18, + 0x0FF8, 0x0DE0, 0x0C00, 0x0C0C, 0x061C, 0x07F8, 0x01F0, 0x0000, + // 'h' + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x07D8, 0x0FF8, + 0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, + 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'i' + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'j' + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00F8, 0x0078, 0x0000, + // 'k' + 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0C0C, 0x060C, + 0x030C, 0x018C, 0x00CC, 0x006C, 0x00FC, 0x019C, 0x038C, 0x030C, + 0x060C, 0x0C0C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'l' + 0x0000, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'm' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3C7C, 0x7EFF, + 0xE3C7, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, + 0xC183, 0xC183, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'n' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0798, 0x0FF8, + 0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, + 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'o' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0, + 0x0C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C30, + 0x0FF0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'p' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03D8, 0x0FF8, + 0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38, + 0x0FF8, 0x03D8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0000, + // 'q' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1BC0, 0x1FF0, + 0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30, + 0x1FF0, 0x1BC0, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x0000, + // 'r' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07B0, 0x03F0, + 0x0070, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 's' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03E0, 0x03F0, + 0x0E38, 0x0C18, 0x0038, 0x03F0, 0x07C0, 0x0C00, 0x0C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 't' + 0x0000, 0x0000, 0x0080, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x07C0, 0x0780, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'u' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1818, 0x1818, + 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C38, + 0x1FF0, 0x19E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'v' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x180C, 0x0C18, + 0x0C18, 0x0C18, 0x0630, 0x0630, 0x0630, 0x0360, 0x0360, 0x0360, + 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'w' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41C1, 0x41C1, + 0x61C3, 0x6363, 0x6363, 0x6363, 0x3636, 0x3636, 0x3636, 0x1C1C, + 0x1C1C, 0x1C1C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'x' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x381C, 0x1C38, + 0x0C30, 0x0660, 0x0360, 0x0360, 0x0360, 0x0360, 0x0660, 0x0C30, + 0x1C38, 0x381C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // 'y' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3018, 0x1830, + 0x1830, 0x1870, 0x0C60, 0x0C60, 0x0CE0, 0x06C0, 0x06C0, 0x0380, + 0x0380, 0x0380, 0x0180, 0x0180, 0x01C0, 0x00F0, 0x0070, 0x0000, + // 'z' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1FFC, 0x1FFC, + 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, + 0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + // '{' + 0x0000, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x0060, 0x0060, 0x0030, 0x0060, 0x0040, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0000, 0x0000, + // '|' + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, + // '}' + 0x0000, 0x0060, 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0300, 0x0300, 0x0600, 0x0300, 0x0100, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0000, 0x0000, + // '~' + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x10F0, 0x1FF8, 0x0F08, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, }; -void disp_char_1624(uint16_t x,uint16_t y,uint8_t c,uint16_t charColor,uint16_t bkColor) { - uint16_t i = 0, j = 0; - uint16_t tmp_char = 0; - for (i=0;i<24;i++) { - tmp_char=ASCII_Table_16x24[((c-0x20)*24)+i]; - for (j=0;j<16;j++) { - if (((tmp_char >> j) & 0x01) == 0x01) - tft_set_point(x + j, y + i, charColor); - else - tft_set_point(x + j, y + i, bkColor); - } +void disp_char_1624(uint16_t x, uint16_t y, uint8_t c, uint16_t charColor, uint16_t bkColor) { + for (uint16_t i = 0; i < 24; i++) { + const uint16_t tmp_char = pgm_read_word(&ASCII_Table_16x24[((c-0x20)*24)+i]); + for (uint16_t j = 0; j < 16; j++) + tft_set_point(x + j, y + i, ((tmp_char >> j) & 0x01) ? charColor : bkColor); } } -void disp_string(uint16_t x,uint16_t y,const char * string,uint16_t charColor,uint16_t bkColor) { - while(*string != '\0') { - disp_char_1624(x,y,*string,charColor,bkColor); +void disp_string(uint16_t x, uint16_t y, const char * string, uint16_t charColor, uint16_t bkColor) { + while (*string != '\0') { + disp_char_1624(x, y, *string, charColor, bkColor); string++; - x+=16; + x += 16; } } //static lv_obj_t * scr_test; void disp_pic_update() { LCD_Clear(0x0000); - disp_string(120,150,"PIC Updating...",0xffff,0x0000); + disp_string(120, 150, "PIC Updating...", 0xFFFF, 0x0000); } void disp_font_update() { LCD_Clear(0x0000); - disp_string(120,150,"FONT Updating...",0xffff,0x0000); + disp_string(120, 150, "FONT Updating...", 0xFFFF, 0x0000); } #endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.h b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.h index f8b117770633..a1e2972aa7f0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.h @@ -24,8 +24,8 @@ #include "lvgl.h" void Test_GPIO(); -void disp_char_1624(uint16_t x,uint16_t y,uint8_t c,uint16_t charColor,uint16_t bkColor); -void disp_string(uint16_t x,uint16_t y,const char * string,uint16_t charColor,uint16_t bkColor); +void disp_char_1624(uint16_t x, uint16_t y, uint8_t c, uint16_t charColor, uint16_t bkColor); +void disp_string(uint16_t x, uint16_t y, const char * string, uint16_t charColor, uint16_t bkColor); void mks_test(); void disp_pic_update(); void disp_font_update(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp index 1b1b7034584e..0d49a4a28646 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp @@ -19,10 +19,12 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) +#include "../../../../MarlinCore.h" + //#include "type_define.h" #include "string.h" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.cpp index e681fb542ea9..7a27365267fe 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.cpp @@ -19,10 +19,12 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) +#include "../../../../MarlinCore.h" + #include "lv_conf.h" #include "draw_ui.h" #include "../../../../module/temperature.h" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index 060a6f04ca00..a4ebbdf5f6e1 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -23,12 +23,14 @@ /** * @file lcd_lvgl_configuration.c * @date 2020-02-21 - * */ + */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) +#include "../../../../MarlinCore.h" + #include "tft_lvgl_configuration.h" #include "lvgl.h" #include "../../../../feature/touch/xpt2046.h" @@ -234,17 +236,17 @@ void ili9320_SetWindows(uint16_t StartX,uint16_t StartY,uint16_t width,uint16_t LCD_WriteReg(0x0052, StartY); LCD_WriteReg(0x0051, xEnd); LCD_WriteReg(0x0053, yEnd);*/ - LCD_WriteReg(0x0050,StartY); //Specify the start/end positions of the window address in the horizontal direction by an address unit - LCD_WriteReg(0x0051,yEnd); //Specify the start positions of the window address in the vertical direction by an address unit - LCD_WriteReg(0x0052,320 - xEnd); - LCD_WriteReg(0x0053,320 - StartX - 1); //Specify the end positions of the window address in the vertical direction by an address unit + LCD_WriteReg(0x0050, StartY); //Specify the start/end positions of the window address in the horizontal direction by an address unit + LCD_WriteReg(0x0051, yEnd); //Specify the start positions of the window address in the vertical direction by an address unit + LCD_WriteReg(0x0052, 320 - xEnd); + LCD_WriteReg(0x0053, 320 - StartX - 1); //Specify the end positions of the window address in the vertical direction by an address unit } else { - s_h = (StartX >> 8) & 0xff; - s_l = StartX & 0xff; - e_h = ((StartX + width - 1) >> 8) & 0xff; - e_l = (StartX + width - 1) & 0xff; + s_h = (StartX >> 8) & 0xFF; + s_l = StartX & 0xFF; + e_h = ((StartX + width - 1) >> 8) & 0xFF; + e_l = (StartX + width - 1) & 0xFF; LCD_IO_WriteReg(0x2A); LCD_IO_WriteData(s_h); @@ -252,10 +254,10 @@ void ili9320_SetWindows(uint16_t StartX,uint16_t StartY,uint16_t width,uint16_t LCD_IO_WriteData(e_h); LCD_IO_WriteData(e_l); - s_h = (StartY >> 8) & 0xff; - s_l = StartY & 0xff; - e_h = ((StartY + heigh - 1) >> 8) & 0xff; - e_l = (StartY + heigh - 1) & 0xff; + s_h = (StartY >> 8) & 0xFF; + s_l = StartY & 0xFF; + e_h = ((StartY + heigh - 1) >> 8) & 0xFF; + e_l = (StartY + heigh - 1) & 0xFF; LCD_IO_WriteReg(0x2B); LCD_IO_WriteData(s_h); @@ -265,20 +267,19 @@ void ili9320_SetWindows(uint16_t StartX,uint16_t StartY,uint16_t width,uint16_t } } -void LCD_Clear(uint16_t Color) { - uint32_t index=0; +void LCD_Clear(uint16_t Color) { + uint32_t index = 0; unsigned int count; - if (DeviceCode ==0x9488) { - tft_set_cursor(0,0); - ili9320_SetWindows(0,0,480,320); + if (DeviceCode == 0x9488) { + tft_set_cursor(0, 0); + ili9320_SetWindows(0, 0, 480, 320); LCD_WriteRAM_Prepare(); //index = (160*480); for (index = 0; index < 320*480; index++) LCD_IO_WriteData(Color); //LCD_IO_WriteMultiple(Color, (480*320)); - //while(index --) - //LCD_IO_WriteData(Color); + //while(index --) LCD_IO_WriteData(Color); } else if (DeviceCode == 0x5761) { LCD_IO_WriteReg(0x002a); @@ -297,9 +298,9 @@ void LCD_Clear(uint16_t Color) { LCD_IO_WriteData(Color); } else { - tft_set_cursor(0,0); + tft_set_cursor(0, 0); LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */ - for (index=0;index<76800;index++) + for (index = 0; index < 76800; index++) LCD_IO_WriteData(Color); } } @@ -317,11 +318,11 @@ extern uint16_t ILI9488_ReadRAM(); _delay_ms(5); LCD_IO_WriteReg(0x00D3); - DeviceCode=ILI9488_ReadRAM(); //dummy read - DeviceCode=ILI9488_ReadRAM(); - DeviceCode=ILI9488_ReadRAM(); - DeviceCode<<=8; - DeviceCode|=ILI9488_ReadRAM(); + DeviceCode = ILI9488_ReadRAM(); //dummy read + DeviceCode = ILI9488_ReadRAM(); + DeviceCode = ILI9488_ReadRAM(); + DeviceCode <<= 8; + DeviceCode |= ILI9488_ReadRAM(); if (DeviceCode == 0x9488) { LCD_IO_WriteReg(0x00E0); @@ -420,7 +421,6 @@ extern uint16_t ILI9488_ReadRAM(); OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); } - } #endif @@ -434,6 +434,7 @@ void tft_lvgl_init() { UpdatePic(); UpdateFont(); #endif + gCfgItems_init(); ui_cfg_init(); disp_language_init(); @@ -471,9 +472,7 @@ void tft_lvgl_init() { filament_pin_setup(); #if ENABLED(POWER_LOSS_RECOVERY) - if ( recovery.info.valid_head != 0 - && recovery.info.valid_head == recovery.info.valid_foot - ) { + if (recovery.valid()) { if (gCfgItems.from_flash_pic == 1) flash_preview_begin = 1; else @@ -481,11 +480,11 @@ void tft_lvgl_init() { uiCfg.print_state = REPRINTING; - memset(public_buf_m,0,sizeof(public_buf_m)); - strncpy(public_buf_m,recovery.info.sd_filename,sizeof(public_buf_m)); + memset(public_buf_m, 0, sizeof(public_buf_m)); + strncpy(public_buf_m, recovery.info.sd_filename, sizeof(public_buf_m)); card.printLongPath(public_buf_m); - strncpy(list_file.long_name[sel_id],card.longFilename,sizeof(list_file.long_name[sel_id])); + strncpy(list_file.long_name[sel_id], card.longFilename, sizeof(list_file.long_name[sel_id])); lv_draw_printing(); } @@ -498,21 +497,19 @@ void tft_lvgl_init() { #endif } - #if 0 -void LCD_WriteRAM(uint16_t RGB_Code) { - #if 0 - ClrCs - /* Write 16-bit GRAM Reg */ - LCD->LCD_RAM = RGB_Code; - SetCs - #else - LCD_IO_WriteData(RGB_Code); - #endif -} + void LCD_WriteRAM(uint16_t RGB_Code) { + #if 0 + ClrCs + /* Write 16-bit GRAM Reg */ + LCD->LCD_RAM = RGB_Code; + SetCs + #else + LCD_IO_WriteData(RGB_Code); + #endif + } #endif - void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) { #if ENABLED(SPI_GRAPHICAL_TFT) uint16_t i, width, height; @@ -684,7 +681,7 @@ int SPI2_ReadWrite2Bytes(void) { uint16_t x_addata[times],y_addata[times]; void XPT2046_Rd_Addata(uint16_t *X_Addata,uint16_t *Y_Addata) { - uint16_t i, j, k; + uint16_t i, j, k; //int result; //#if ENABLED(TOUCH_BUTTONS) @@ -703,8 +700,7 @@ void XPT2046_Rd_Addata(uint16_t *X_Addata,uint16_t *Y_Addata) { SPI_TFT.spi_read_write_byte(CHY); x_addata[i] = SPI2_ReadWrite2Bytes(); WRITE(TOUCH_CS_PIN, HIGH); - #else - //#if ENABLED(TOUCH_BUTTONS) + #else // #if ENABLED(TOUCH_BUTTONS) OUT_WRITE(TOUCH_CS_PIN, LOW); W25QXX.spi_flash_read_write_byte(CHX); y_addata[i] = SPI2_ReadWrite2Bytes(); @@ -714,13 +710,12 @@ void XPT2046_Rd_Addata(uint16_t *X_Addata,uint16_t *Y_Addata) { W25QXX.spi_flash_read_write_byte(CHY); x_addata[i] = SPI2_ReadWrite2Bytes(); WRITE(TOUCH_CS_PIN, HIGH); - //#endif #endif } //#endif //result = x_addata[0]; - for (i=0;i x_addata[i]) { k = x_addata[j]; @@ -747,7 +742,6 @@ void XPT2046_Rd_Addata(uint16_t *X_Addata,uint16_t *Y_Addata) { } } - if (y_addata[times / 2 - 1] - y_addata[times / 2] > 50) { *X_Addata = *Y_Addata = 0; return; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp index bc7c5933c72b..4c094d7e168f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp @@ -19,9 +19,12 @@ * along with this program. If not, see . * */ -#include "../../../../MarlinCore.h" +#include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) + +#include "../../../../MarlinCore.h" + #include "draw_ui.h" #include "tft_multi_language.h" @@ -60,1840 +63,1839 @@ MachineSettings_menu_def MachineSettings_menu; TemperatureSettings_menu_def TemperatureSettings_menu; pause_msg_def pause_msg_menu; -void disp_language_init() -{ - preheat_menu.value_state= TEXT_VALUE; - preheat_menu.step_1c= TEXT_1C; - preheat_menu.step_5c= TEXT_5C; - preheat_menu.step_10c= TEXT_10C; - - move_menu.x_add = AXIS_X_ADD_TEXT; - move_menu.x_dec = AXIS_X_DEC_TEXT; - move_menu.y_add = AXIS_Y_ADD_TEXT; - move_menu.y_dec = AXIS_Y_DEC_TEXT; - move_menu.z_add = AXIS_Z_ADD_TEXT; - move_menu.z_dec = AXIS_Z_DEC_TEXT; - - move_menu.step_001mm = TEXT_001MM; - move_menu.step_005mm = TEXT_005MM; - move_menu.step_01mm = TEXT_01MM; - move_menu.step_1mm = TEXT_1MM; - move_menu.step_10mm = TEXT_10MM; - - home_menu.home_x= HOME_X_TEXT; - home_menu.home_y= HOME_Y_TEXT; - home_menu.home_z= HOME_Z_TEXT; - home_menu.home_all= HOME_ALL_TEXT; - - extrude_menu.temp_value = TEXT_VALUE_T; - extrude_menu.count_value_mm= TEXT_VALUE_mm; - extrude_menu.count_value_cm= TEXT_VALUE_cm; - extrude_menu.count_value_m= TEXT_VALUE_m; - extrude_menu.step_1mm = EXTRUDE_1MM_TEXT; - extrude_menu.step_5mm = EXTRUDE_5MM_TEXT; - extrude_menu.step_10mm = EXTRUDE_10MM_TEXT; - - fan_menu.full = FAN_OPEN_TEXT; - fan_menu.half = FAN_HALF_TEXT; - fan_menu.off = FAN_CLOSE_TEXT; - - speed_menu.step_1percent = STEP_1PERCENT; - speed_menu.step_5percent = STEP_5PERCENT; - speed_menu.step_10percent = STEP_10PERCENT; - - language_menu.chinese_s = LANGUAGE_S_CN; - language_menu.chinese_t = LANGUAGE_T_CN; - language_menu.english = LANGUAGE_EN; - language_menu.russian = LANGUAGE_RU; - language_menu.spanish = LANGUAGE_SP; - language_menu.german = LANGUAGE_GE; - language_menu.japan = LANGUAGE_JP; - language_menu.korean = LANGUAGE_KR; - language_menu.portuguese = LANGUAGE_PR; - language_menu.italy = LANGUAGE_IT; - language_menu.brazil = LANGUAGE_BR; - language_menu.french = LANGUAGE_FR; - - about_menu.type_name= ABOUT_TYPE_TEXT; - about_menu.firmware_v= ABOUT_VERSION_TEXT; - //about_menu.wifi = ABOUT_WIFI_TEXT; - - wifi_menu.ip = WIFI_IP_TEXT; - wifi_menu.wifi = WIFI_NAME_TEXT; - wifi_menu.key = WIFI_KEY_TEXT; - wifi_menu.state_ap = WIFI_STATE_AP_TEXT; - wifi_menu.state_sta = WIFI_STATE_STA_TEXT; - wifi_menu.connected = WIFI_CONNECTED_TEXT; - wifi_menu.disconnected = WIFI_DISCONNECTED_TEXT; - wifi_menu.exception = WIFI_EXCEPTION_TEXT; - - printing_menu.temp1 = TEXT_VALUE; - printing_menu.temp2 = TEXT_VALUE; - printing_menu.bed_temp = TEXT_VALUE; - - filament_menu.stat_temp = TEXT_VALUE; - - zoffset_menu.step001 = ZOFFSET_STEP001; - zoffset_menu.step01 = ZOFFSET_STEP01; - zoffset_menu.step1 = ZOFFSET_STEP1; - - //wifi-list - #if 0 - list_menu.title=TEXT_WIFI_MENU_TITLE_EN; - list_menu.file_pages = FILE_PAGES_EN; - //keyboard - keyboard_menu.apply=MANUAL_IP_APPLY_EN; - keyboard_menu.password=TEXT_WIFI_PASSWORD_EN; - keyboard_menu.space = TEXT_WIFI_SAPCE_EN; +void disp_language_init() { + preheat_menu.value_state = TEXT_VALUE; + preheat_menu.step_1c = TEXT_1C; + preheat_menu.step_5c = TEXT_5C; + preheat_menu.step_10c = TEXT_10C; + + move_menu.x_add = AXIS_X_ADD_TEXT; + move_menu.x_dec = AXIS_X_DEC_TEXT; + move_menu.y_add = AXIS_Y_ADD_TEXT; + move_menu.y_dec = AXIS_Y_DEC_TEXT; + move_menu.z_add = AXIS_Z_ADD_TEXT; + move_menu.z_dec = AXIS_Z_DEC_TEXT; + + move_menu.step_001mm = TEXT_001MM; + move_menu.step_005mm = TEXT_005MM; + move_menu.step_01mm = TEXT_01MM; + move_menu.step_1mm = TEXT_1MM; + move_menu.step_10mm = TEXT_10MM; + + home_menu.home_x = HOME_X_TEXT; + home_menu.home_y = HOME_Y_TEXT; + home_menu.home_z = HOME_Z_TEXT; + home_menu.home_all = HOME_ALL_TEXT; + + extrude_menu.temp_value = TEXT_VALUE_T; + extrude_menu.count_value_mm = TEXT_VALUE_mm; + extrude_menu.count_value_cm = TEXT_VALUE_cm; + extrude_menu.count_value_m = TEXT_VALUE_m; + extrude_menu.step_1mm = EXTRUDE_1MM_TEXT; + extrude_menu.step_5mm = EXTRUDE_5MM_TEXT; + extrude_menu.step_10mm = EXTRUDE_10MM_TEXT; + + fan_menu.full = FAN_OPEN_TEXT; + fan_menu.half = FAN_HALF_TEXT; + fan_menu.off = FAN_CLOSE_TEXT; + + speed_menu.step_1percent = STEP_1PERCENT; + speed_menu.step_5percent = STEP_5PERCENT; + speed_menu.step_10percent = STEP_10PERCENT; + + language_menu.chinese_s = LANGUAGE_S_CN; + language_menu.chinese_t = LANGUAGE_T_CN; + language_menu.english = LANGUAGE_EN; + language_menu.russian = LANGUAGE_RU; + language_menu.spanish = LANGUAGE_SP; + language_menu.german = LANGUAGE_GE; + language_menu.japan = LANGUAGE_JP; + language_menu.korean = LANGUAGE_KR; + language_menu.portuguese = LANGUAGE_PR; + language_menu.italy = LANGUAGE_IT; + language_menu.brazil = LANGUAGE_BR; + language_menu.french = LANGUAGE_FR; + + about_menu.type_name = ABOUT_TYPE_TEXT; + about_menu.firmware_v = ABOUT_VERSION_TEXT; + //about_menu.wifi = ABOUT_WIFI_TEXT; + + wifi_menu.ip = WIFI_IP_TEXT; + wifi_menu.wifi = WIFI_NAME_TEXT; + wifi_menu.key = WIFI_KEY_TEXT; + wifi_menu.state_ap = WIFI_STATE_AP_TEXT; + wifi_menu.state_sta = WIFI_STATE_STA_TEXT; + wifi_menu.connected = WIFI_CONNECTED_TEXT; + wifi_menu.disconnected = WIFI_DISCONNECTED_TEXT; + wifi_menu.exception = WIFI_EXCEPTION_TEXT; + + printing_menu.temp1 = TEXT_VALUE; + printing_menu.temp2 = TEXT_VALUE; + printing_menu.bed_temp = TEXT_VALUE; + + filament_menu.stat_temp = TEXT_VALUE; + + zoffset_menu.step001 = ZOFFSET_STEP001; + zoffset_menu.step01 = ZOFFSET_STEP01; + zoffset_menu.step1 = ZOFFSET_STEP1; + + //wifi-list + #if 0 + list_menu.title = TEXT_WIFI_MENU_TITLE_EN; + list_menu.file_pages = FILE_PAGES_EN; + //keyboard + keyboard_menu.apply = MANUAL_IP_APPLY_EN; + keyboard_menu.password = TEXT_WIFI_PASSWORD_EN; + keyboard_menu.space = TEXT_WIFI_SAPCE_EN; keyboard_menu.letter = TEXT_WIFI_LETTER_EN; keyboard_menu.digital = TEXT_WIFI_DIGITAL_EN; keyboard_menu.symbol = TEXT_WIFI_SYMBOL_EN; //tips tips_menu.pointBold = TEXT_WIFI_POINT_BOLD_EN; - tips_menu.joining = TEXT_WIFI_JOINING_EN; - tips_menu.failedJoin = TEXT_WIFI_FAILED_JOIN_EN; - tips_menu.wifiConected = TEXT_WIFI_WIFI_CONECTED_EN; - #endif - operation_menu.babystep = TEXT_BABY_STEP_EN; - - switch(gCfgItems.language) - { - case LANG_SIMPLE_CHINESE: - common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_CN; - common_menu.text_back=BACK_TEXT_CN; - common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_CN; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_CN; - common_menu.print_special_title = PRINTING_GBK; - common_menu.pause_special_title = PRINTING_PAUSE_GBK; - common_menu.operate_special_title = PRINTING_OPERATION_GBK; - // - main_menu.title=TITLE_READYPRINT_CN; - main_menu.preheat=PREHEAT_TEXT_CN; - main_menu.move=MOVE_TEXT_CN; - main_menu.home=HOME_TEXT_CN; - main_menu.print=PRINT_TEXT_CN; - main_menu.extrude=EXTRUDE_TEXT_CN; - main_menu.leveling=LEVELING_TEXT_CN; - main_menu.autoleveling=AUTO_LEVELING_TEXT_CN; - main_menu.fan = FAN_TEXT_CN; - main_menu.set=SET_TEXT_CN; - main_menu.more=MORE_TEXT_CN; - main_menu.tool = TOOL_TEXT_CN; - //TOOL - tool_menu.title = TOOL_TEXT_CN; - tool_menu.preheat = TOOL_PREHEAT_CN; - tool_menu.extrude = TOOL_EXTRUDE_CN; - tool_menu.move = TOOL_MOVE_CN; - tool_menu.home= TOOL_HOME_CN; - tool_menu.leveling = TOOL_LEVELING_CN; - tool_menu.autoleveling = TOOL_AUTO_LEVELING_CN; - tool_menu.filament = TOOL_FILAMENT_CN; - tool_menu.more = TOOL_MORE_CN; - // - preheat_menu.adjust_title = TITLE_ADJUST_CN; - preheat_menu.title=TITLE_PREHEAT_CN; - preheat_menu.add=ADD_TEXT_CN; - preheat_menu.dec=DEC_TEXT_CN; - preheat_menu.ext1=EXTRUDER_1_TEXT_CN; - preheat_menu.ext2=EXTRUDER_2_TEXT_CN; - preheat_menu.hotbed=HEATBED_TEXT_CN; - preheat_menu.off=CLOSE_TEXT_CN; - - preheat_menu.value_state= TEXT_VALUE_CN; - preheat_menu.step_1c= TEXT_1C_CN; - preheat_menu.step_5c= TEXT_5C_CN; - preheat_menu.step_10c= TEXT_10C_CN; - // - move_menu.title = MOVE_TEXT_CN; - // - home_menu.title=TITLE_HOME_CN; - home_menu.stopmove = HOME_STOPMOVE_CN; - // - file_menu.title=TITLE_CHOOSEFILE_CN; - file_menu.page_up=PAGE_UP_TEXT_CN; - file_menu.page_down=PAGE_DOWN_TEXT_CN; - file_menu.file_loading = FILE_LOADING_CN; - file_menu.no_file = NO_FILE_CN; - file_menu.no_file_and_check = NO_FILE_CN;//NO_FILE_AND_CHECK_CN; - // - extrude_menu.title=TITLE_EXTRUDE_CN; - extrude_menu.in=EXTRUDER_IN_TEXT_CN; - extrude_menu.out=EXTRUDER_OUT_TEXT_CN; - extrude_menu.ext1=EXTRUDER_1_TEXT_CN; - extrude_menu.ext2=EXTRUDER_2_TEXT_CN; - extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_CN; - extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_CN; - extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_CN; - extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_CN; - extrude_menu.temp_value = EXTRUDE_TEXT_VALUE_T_CN; - // - leveling_menu.title=TITLE_LEVELING_CN; - leveling_menu.position1=LEVELING_POINT1_TEXT_CN; - leveling_menu.position2=LEVELING_POINT2_TEXT_CN; - leveling_menu.position3=LEVELING_POINT3_TEXT_CN; - leveling_menu.position4=LEVELING_POINT4_TEXT_CN; - leveling_menu.position5=LEVELING_POINT5_TEXT_CN; - // - set_menu.title=TITLE_SET_CN; - set_menu.filesys=FILESYS_TEXT_CN; - set_menu.wifi=WIFI_TEXT_CN; - set_menu.about=ABOUT_TEXT_CN; - set_menu.fan=FAN_TEXT_CN; - set_menu.filament=FILAMENT_TEXT_CN; - set_menu.breakpoint=BREAK_POINT_TEXT_CN; - set_menu.motoroff=MOTOR_OFF_TEXT_CN; - set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_CN; - set_menu.language=LANGUAGE_TEXT_CN; - set_menu.shutdown=SHUTDOWN_TEXT_CN; - //set_menu.machine_para = MACHINE_PARA_CN; - - // - filesys_menu.title = TITLE_FILESYS_CN; - filesys_menu.sd_sys = SD_CARD_TEXT_CN; - filesys_menu.usb_sys = U_DISK_TEXT_CN; - // - more_menu.title = TITLE_MORE_CN; - more_menu.zoffset = ZOFFSET_CN; - //WIFI - wifi_menu.title=WIFI_TEXT; - //wifi_menu.key = WIFI_KEY_TEXT_CN; - //wifi_menu.ip = WIFI_IP_TEXT_CN; - //wifi_menu.state= WIFI_STA_TEXT_CN; - wifi_menu.cloud= CLOUD_TEXT_CN; - wifi_menu.reconnect = WIFI_RECONNECT_TEXT_CN; - //CLOUD - cloud_menu.title = TITLE_CLOUD_TEXT_CN; - cloud_menu.bind = CLOUD_BINDED_CN; - cloud_menu.binded = CLOUD_BINDED_CN; - cloud_menu.unbind = CLOUD_UNBIND_CN; - cloud_menu.unbinding = CLOUD_UNBINDED_CN; - cloud_menu.disconnected = CLOUD_DISCONNECTED_CN; - cloud_menu.disable = CLOUD_DISABLE_CN; - // - about_menu.title = ABOUT_TEXT_CN; - about_menu.type = ABOUT_TYPE_TEXT_CN; - about_menu.version = ABOUT_VERSION_TEXT_CN; - about_menu.wifi = ABOUT_WIFI_TEXT_CN; - - // - fan_menu.title = FAN_TEXT_CN; - fan_menu.add = FAN_ADD_TEXT_CN; - fan_menu.dec = FAN_DEC_TEXT_CN; - fan_menu.state = FAN_TIPS1_TEXT_CN; - // - filament_menu.title = TITLE_FILAMENT_CN; - filament_menu.in = FILAMENT_IN_TEXT_CN; - filament_menu.out = FILAMENT_OUT_TEXT_CN; - filament_menu.ext1 = FILAMENT_EXT0_TEXT_CN; - filament_menu.ext2 = FILAMENT_EXT1_TEXT_CN; - filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_CN; - filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_CN; - filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_CN; - filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_CN; - filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_CN; - filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_CN; - filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_CN; - filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_CN; - filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_CN; - - - // - language_menu.title = TITLE_LANGUAGE_CN; - language_menu.next = PAGE_DOWN_TEXT_CN; - language_menu.up = PAGE_UP_TEXT_CN; - - // - printing_menu.title = TITLE_PRINTING_CN; - printing_menu.option = PRINTING_OPERATION_CN; - printing_menu.stop = PRINTING_STOP_CN; - printing_menu.pause = PRINTING_PAUSE_CN; - printing_menu.resume = PRINTING_RESUME_CN; - - // - operation_menu.title = TITLE_OPERATION_CN; - operation_menu.pause = PRINTING_PAUSE_CN; - operation_menu.stop = PRINTING_STOP_CN; - operation_menu.temp = PRINTING_TEMP_CN; - operation_menu.fan = FAN_TEXT_CN; - operation_menu.filament= FILAMENT_TEXT_CN; - operation_menu.extr = PRINTING_EXTRUDER_CN; - operation_menu.speed = PRINTING_CHANGESPEED_CN; - operation_menu.more = PRINTING_MORE_CN; - operation_menu.move = PRINTING_MOVE_CN; - operation_menu.auto_off = AUTO_SHUTDOWN_CN; - operation_menu.manual_off = MANUAL_SHUTDOWN_CN; - // - pause_menu.title= TITLE_PAUSE_CN; - pause_menu.resume = PRINTING_RESUME_CN; - pause_menu.stop = PRINTING_STOP_CN; - pause_menu.extrude = PRINTING_EXTRUDER_CN; - pause_menu.move = PRINTING_MOVE_CN; - pause_menu.filament= FILAMENT_TEXT_CN; - pause_menu.more = PRINTING_MORE_CN; - - // - speed_menu.title = PRINTING_CHANGESPEED_CN; - speed_menu.add = ADD_TEXT_CN; - speed_menu.dec = DEC_TEXT_CN; - speed_menu.move = MOVE_SPEED_CN; - speed_menu.extrude = EXTRUDER_SPEED_CN; - speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_CN; - speed_menu.move_speed = MOVE_SPEED_STATE_CN; - // - printing_more_menu.title = TITLE_MORE_CN; - printing_more_menu.fan = FAN_TEXT_CN; - printing_more_menu.auto_close = AUTO_SHUTDOWN_CN; - printing_more_menu.manual = MANUAL_SHUTDOWN_CN; - printing_more_menu.speed = PRINTING_CHANGESPEED_CN; - printing_more_menu.temp = PRINTING_TEMP_CN; - - //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_CN; - print_file_dialog_menu.confirm = DIALOG_CONFIRM_CN; - print_file_dialog_menu.cancle = DIALOG_CANCLE_CN; - print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_CN; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_CN; - print_file_dialog_menu.retry = DIALOG_RETRY_CN; - print_file_dialog_menu.stop = DIALOG_STOP_CN; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_CN; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_CN; - - print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_CN; - print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_CN; - - print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_CN; - print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_CN; - print_file_dialog_menu.reprint=DIALOG_REPRINT_CN; - print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_CN; - - //ZOFFSET - zoffset_menu.title = TITLE_ZOFFSET_CN; - zoffset_menu.inc = ZOFFSET_INC_CN; - zoffset_menu.dec = ZOFFSET_DEC_CN; - - pause_msg_menu.pausing = MESSEGE_PAUSING_CN; - pause_msg_menu.changing = MESSEGE_CHANGING_CN; - pause_msg_menu.unload = MESSEGE_UNLOAD_CN; - pause_msg_menu.waiting = MESSEGE_WAITING_CN; - pause_msg_menu.insert = MESSEGE_INSERT_CN; - pause_msg_menu.load = MESSEGE_LOAD_CN; - pause_msg_menu.purge = MESSEGE_PURGE_CN; - pause_msg_menu.resume = MESSEGE_RESUME_CN; - pause_msg_menu.heat = MESSEGE_HEAT_CN; - pause_msg_menu.heating = MESSEGE_HEATING_CN; - pause_msg_menu.option = MESSEGE_OPTION_CN; - pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_CN; - pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_CN; - - break; -#if 1 - #if 1 - case LANG_COMPLEX_CHINESE: - common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_T_CN; - common_menu.text_back=BACK_TEXT_T_CN; - common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_T_CN; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_T_CN; - common_menu.print_special_title = PRINTING_GBK; - common_menu.pause_special_title = PRINTING_PAUSE_GBK; - common_menu.operate_special_title = PRINTING_OPERATION_GBK; - // - main_menu.title=TITLE_READYPRINT_T_CN; - main_menu.preheat=PREHEAT_TEXT_T_CN; - main_menu.move=MOVE_TEXT_T_CN; - main_menu.home=HOME_TEXT_T_CN; - main_menu.print=PRINT_TEXT_T_CN; - main_menu.extrude=EXTRUDE_TEXT_T_CN; - main_menu.leveling=LEVELING_TEXT_T_CN; - main_menu.autoleveling=AUTO_LEVELING_TEXT_T_CN; - main_menu.fan = FAN_TEXT_T_CN; - main_menu.set=SET_TEXT_T_CN; - main_menu.more=MORE_TEXT_T_CN; - main_menu.tool = TOOL_TEXT_T_CN; - //TOOL - tool_menu.title = TOOL_TEXT_T_CN; - tool_menu.preheat = TOOL_PREHEAT_T_CN; - tool_menu.extrude = TOOL_EXTRUDE_T_CN; - tool_menu.move = TOOL_MOVE_T_CN; - tool_menu.home= TOOL_HOME_T_CN; - tool_menu.leveling = TOOL_LEVELING_T_CN; - tool_menu.autoleveling = TOOL_AUTO_LEVELING_T_CN; - tool_menu.filament = TOOL_FILAMENT_T_CN; - tool_menu.more = TOOL_MORE_T_CN; - // - preheat_menu.adjust_title = TITLE_ADJUST_T_CN; - preheat_menu.title=TITLE_PREHEAT_T_CN; - preheat_menu.add=ADD_TEXT_T_CN; - preheat_menu.dec=DEC_TEXT_T_CN; - preheat_menu.ext1=EXTRUDER_1_TEXT_T_CN; - preheat_menu.ext2=EXTRUDER_2_TEXT_T_CN; - preheat_menu.hotbed=HEATBED_TEXT_T_CN; - preheat_menu.off=CLOSE_TEXT_T_CN; - preheat_menu.value_state= TEXT_VALUE_T_CN; - preheat_menu.step_1c= TEXT_1C_T_CN; - preheat_menu.step_5c= TEXT_5C_T_CN; - preheat_menu.step_10c= TEXT_10C_T_CN; - // - move_menu.title = MOVE_TEXT_T_CN; - more_menu.zoffset = ZOFFSET_T_CN; - // - home_menu.title=TITLE_HOME_T_CN; - home_menu.stopmove = HOME_STOPMOVE_T_CN; - // - file_menu.title=TITLE_CHOOSEFILE_T_CN; - file_menu.page_up=PAGE_UP_TEXT_T_CN; - file_menu.page_down=PAGE_DOWN_TEXT_T_CN; - file_menu.file_loading = FILE_LOADING_T_CN; - file_menu.no_file = NO_FILE_T_CN; - file_menu.no_file_and_check = NO_FILE_T_CN;//NO_FILE_AND_CHECK_T_CN; - // - extrude_menu.title=TITLE_EXTRUDE_T_CN; - extrude_menu.in=EXTRUDER_IN_TEXT_T_CN; - extrude_menu.out=EXTRUDER_OUT_TEXT_T_CN; - extrude_menu.ext1=EXTRUDER_1_TEXT_T_CN; - extrude_menu.ext2=EXTRUDER_2_TEXT_T_CN; - extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_T_CN; - extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_T_CN; - extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_T_CN; - extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_T_CN; - extrude_menu.temp_value = EXTRUDE_TEXT_VALUE_T_T_CN; - // - leveling_menu.title=TITLE_LEVELING_CN; - leveling_menu.position1=LEVELING_POINT1_TEXT_T_CN; - leveling_menu.position2=LEVELING_POINT2_TEXT_T_CN; - leveling_menu.position3=LEVELING_POINT3_TEXT_T_CN; - leveling_menu.position4=LEVELING_POINT4_TEXT_T_CN; - leveling_menu.position5=LEVELING_POINT5_TEXT_T_CN; - // - set_menu.title=TITLE_SET_T_CN; - set_menu.filesys=FILESYS_TEXT_T_CN; - set_menu.wifi=WIFI_TEXT_T_CN; - set_menu.about=ABOUT_TEXT_T_CN; - set_menu.fan=FAN_TEXT_T_CN; - set_menu.filament=FILAMENT_TEXT_T_CN; - set_menu.breakpoint=BREAK_POINT_TEXT_T_CN; - set_menu.motoroff=MOTOR_OFF_TEXT_T_CN; - set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_T_CN; - set_menu.language=LANGUAGE_TEXT_T_CN; - set_menu.shutdown=SHUTDOWN_TEXT_T_CN; - //set_menu.machine_para = MACHINE_PARA_T_CN; - // - filesys_menu.title = TITLE_FILESYS_T_CN; - filesys_menu.sd_sys = SD_CARD_TEXT_T_CN; - filesys_menu.usb_sys = U_DISK_TEXT_T_CN; - // - more_menu.title = TITLE_MORE_T_CN; - //WIFI - wifi_menu.title=WIFI_TEXT; - //wifi_menu.key = WIFI_KEY_TEXT_CN; - //wifi_menu.ip = WIFI_IP_TEXT_CN; - //wifi_menu.state= WIFI_STA_TEXT_CN; - wifi_menu.cloud= CLOUD_TEXT_T_CN; - wifi_menu.reconnect = WIFI_RECONNECT_TEXT_T_CN; - //CLOUD - cloud_menu.title = TITLE_CLOUD_TEXT_T_CN; - cloud_menu.bind = CLOUD_BINDED_T_CN; - cloud_menu.binded = CLOUD_BINDED_T_CN; - cloud_menu.unbind = CLOUD_UNBIND_T_CN; - cloud_menu.unbinding = CLOUD_UNBINDED_T_CN; - cloud_menu.disconnected = CLOUD_DISCONNECTED_T_CN; - cloud_menu.disable = CLOUD_DISABLE_T_CN; - // - about_menu.title = ABOUT_TEXT_T_CN; - about_menu.type = ABOUT_TYPE_TEXT_T_CN; - about_menu.version = ABOUT_VERSION_TEXT_T_CN; - about_menu.wifi = ABOUT_WIFI_TEXT_T_CN; - - // - fan_menu.title = FAN_TEXT_T_CN; - fan_menu.add = FAN_ADD_TEXT_T_CN; - fan_menu.dec = FAN_DEC_TEXT_T_CN; - fan_menu.state = FAN_TIPS1_TEXT_T_CN; - // - filament_menu.title = TITLE_FILAMENT_T_CN; - filament_menu.in = FILAMENT_IN_TEXT_T_CN; - filament_menu.out = FILAMENT_OUT_TEXT_T_CN; - filament_menu.ext1 = FILAMENT_EXT0_TEXT_T_CN; - filament_menu.ext2 = FILAMENT_EXT1_TEXT_T_CN; - filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_T_CN; - filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_T_CN; - filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_T_CN; - filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_T_CN; - filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_T_CN; - filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_T_CN; - filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_T_CN; - filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_T_CN; - filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_T_CN; - - - // - language_menu.title = TITLE_LANGUAGE_T_CN; - language_menu.next = PAGE_DOWN_TEXT_T_CN; - language_menu.up = PAGE_UP_TEXT_T_CN; - - // - printing_menu.title = TITLE_PRINTING_T_CN; - printing_menu.option = PRINTING_OPERATION_T_CN; - printing_menu.stop = PRINTING_STOP_T_CN; - printing_menu.pause = PRINTING_PAUSE_T_CN; - printing_menu.resume = PRINTING_RESUME_T_CN; - - // - operation_menu.title = TITLE_OPERATION_T_CN; - operation_menu.pause = PRINTING_PAUSE_T_CN; - operation_menu.stop = PRINTING_STOP_T_CN; - operation_menu.temp = PRINTING_TEMP_T_CN; - operation_menu.fan = FAN_TEXT_T_CN; - operation_menu.extr = PRINTING_EXTRUDER_T_CN; - operation_menu.speed = PRINTING_CHANGESPEED_T_CN; - operation_menu.filament= FILAMENT_TEXT_T_CN; - operation_menu.more = PRINTING_MORE_T_CN; - operation_menu.move = PRINTING_MOVE_T_CN; - operation_menu.auto_off = AUTO_SHUTDOWN_T_CN; - operation_menu.manual_off = MANUAL_SHUTDOWN_T_CN; - // - pause_menu.title= TITLE_PAUSE_T_CN; - pause_menu.resume = PRINTING_RESUME_T_CN; - pause_menu.stop = PRINTING_STOP_T_CN; - pause_menu.extrude = PRINTING_EXTRUDER_T_CN; - pause_menu.move = PRINTING_MOVE_T_CN; - pause_menu.filament= FILAMENT_TEXT_T_CN; - pause_menu.more = PRINTING_MORE_T_CN; - - // - speed_menu.title = PRINTING_CHANGESPEED_T_CN; - speed_menu.add = ADD_TEXT_T_CN; - speed_menu.dec = DEC_TEXT_T_CN; - speed_menu.move = MOVE_SPEED_T_CN; - speed_menu.extrude = EXTRUDER_SPEED_T_CN; - speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_T_CN; - speed_menu.move_speed = MOVE_SPEED_STATE_T_CN; - // - printing_more_menu.title = TITLE_MORE_T_CN; - printing_more_menu.fan = FAN_TEXT_T_CN; - printing_more_menu.auto_close = AUTO_SHUTDOWN_T_CN; - printing_more_menu.manual = MANUAL_SHUTDOWN_T_CN; - printing_more_menu.speed = PRINTING_CHANGESPEED_T_CN; - printing_more_menu.temp = PRINTING_TEMP_T_CN; - - //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_CN; - print_file_dialog_menu.confirm = DIALOG_CONFIRM_T_CN; - print_file_dialog_menu.cancle = DIALOG_CANCLE_T_CN; - print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_T_CN; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_T_CN; - print_file_dialog_menu.retry = DIALOG_RETRY_T_CN; - print_file_dialog_menu.stop = DIALOG_STOP_T_CN; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_T_CN; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_T_CN; - - print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_T_CN; - print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_T_CN; - print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_T_CN; - print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_T_CN; - print_file_dialog_menu.reprint=DIALOG_REPRINT_T_CN; - print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_T_CN; - //ZOFFSET - zoffset_menu.title = TITLE_ZOFFSET_T_CN; - zoffset_menu.inc = ZOFFSET_INC_T_CN; - zoffset_menu.dec = ZOFFSET_DEC_T_CN; - - pause_msg_menu.pausing = MESSEGE_PAUSING_T_CN; - pause_msg_menu.changing = MESSEGE_CHANGING_T_CN; - pause_msg_menu.unload = MESSEGE_UNLOAD_T_CN; - pause_msg_menu.waiting = MESSEGE_WAITING_T_CN; - pause_msg_menu.insert = MESSEGE_INSERT_T_CN; - pause_msg_menu.load = MESSEGE_LOAD_T_CN; - pause_msg_menu.purge = MESSEGE_PURGE_T_CN; - pause_msg_menu.resume = MESSEGE_RESUME_T_CN; - pause_msg_menu.heat = MESSEGE_HEAT_T_CN; - pause_msg_menu.heating = MESSEGE_HEATING_T_CN; - pause_msg_menu.option = MESSEGE_OPTION_T_CN; - pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_T_CN; - pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_T_CN; - break; - case LANG_ENGLISH: - common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_EN; - common_menu.text_back=BACK_TEXT_EN; - common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_EN; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_EN; - common_menu.print_special_title = PRINTING_OTHER_LANGUGE; - common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; - common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; - // - main_menu.title=TITLE_READYPRINT_EN; - main_menu.preheat=PREHEAT_TEXT_EN; - main_menu.move=MOVE_TEXT_EN; - main_menu.home=HOME_TEXT_EN; - main_menu.print=PRINT_TEXT_EN; - main_menu.extrude=EXTRUDE_TEXT_EN; - main_menu.leveling=LEVELING_TEXT_EN; - main_menu.autoleveling=AUTO_LEVELING_TEXT_EN; - main_menu.fan = FAN_TEXT_EN; - main_menu.set=SET_TEXT_EN; - main_menu.more=MORE_TEXT_EN; - main_menu.tool = TOOL_TEXT_EN; - //TOOL - tool_menu.title = TOOL_TEXT_EN; - tool_menu.preheat = TOOL_PREHEAT_EN; - tool_menu.extrude = TOOL_EXTRUDE_EN; - tool_menu.move = TOOL_MOVE_EN; - tool_menu.home= TOOL_HOME_EN; - tool_menu.leveling = TOOL_LEVELING_EN; - tool_menu.autoleveling = TOOL_AUTO_LEVELING_EN; - tool_menu.filament = TOOL_FILAMENT_EN; - tool_menu.more = TOOL_MORE_EN; - // - preheat_menu.adjust_title = TITLE_ADJUST_EN; - preheat_menu.title=TITLE_PREHEAT_EN; - preheat_menu.add=ADD_TEXT_EN; - preheat_menu.dec=DEC_TEXT_EN; - preheat_menu.ext1=EXTRUDER_1_TEXT_EN; - preheat_menu.ext2=EXTRUDER_2_TEXT_EN; - preheat_menu.hotbed=HEATBED_TEXT_EN; - preheat_menu.off=CLOSE_TEXT_EN; - // - move_menu.title = TITLE_MOVE_EN; - // - home_menu.title=TITLE_HOME_EN; - home_menu.stopmove = HOME_STOPMOVE_EN; - // - file_menu.title=TITLE_CHOOSEFILE_EN; - file_menu.page_up=PAGE_UP_TEXT_EN; - file_menu.page_down=PAGE_DOWN_TEXT_EN; - file_menu.file_loading = FILE_LOADING_EN; - file_menu.no_file = NO_FILE_EN; - file_menu.no_file_and_check = NO_FILE_EN;//NO_FILE_AND_CHECK_EN; - // - extrude_menu.title=TITLE_EXTRUDE_EN; - extrude_menu.in=EXTRUDER_IN_TEXT_EN; - extrude_menu.out=EXTRUDER_OUT_TEXT_EN; - extrude_menu.ext1=EXTRUDER_1_TEXT_EN; - extrude_menu.ext2=EXTRUDER_2_TEXT_EN; - extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_EN; - extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_EN; - extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_EN; - extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_EN; - // - leveling_menu.title=TITLE_LEVELING_EN; - leveling_menu.position1=LEVELING_POINT1_TEXT_EN; - leveling_menu.position2=LEVELING_POINT2_TEXT_EN; - leveling_menu.position3=LEVELING_POINT3_TEXT_EN; - leveling_menu.position4=LEVELING_POINT4_TEXT_EN; - leveling_menu.position5=LEVELING_POINT5_TEXT_EN; - // - set_menu.title=TITLE_SET_EN; - set_menu.filesys=FILESYS_TEXT_EN; - set_menu.wifi=WIFI_TEXT_EN; - set_menu.about=ABOUT_TEXT_EN; - set_menu.fan=FAN_TEXT_EN; - set_menu.filament=FILAMENT_TEXT_EN; - set_menu.breakpoint=BREAK_POINT_TEXT_EN; - set_menu.motoroff=MOTOR_OFF_TEXT_EN; - set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_EN; - set_menu.language=LANGUAGE_TEXT_EN; - set_menu.shutdown=SHUTDOWN_TEXT_EN; - //set_menu.machine_para = MACHINE_PARA_EN; - // - more_menu.title = TITLE_MORE_EN; - more_menu.zoffset = ZOFFSET_EN; - // - filesys_menu.title = TITLE_FILESYS_EN; - filesys_menu.sd_sys = SD_CARD_TEXT_EN; - filesys_menu.usb_sys = U_DISK_TEXT_EN; - //WIFI - wifi_menu.title=WIFI_TEXT; - //wifi_menu.key = WIFI_KEY_TEXT_EN; - //wifi_menu.ip = WIFI_IP_TEXT_EN; - //wifi_menu.state= WIFI_STA_TEXT_EN; - wifi_menu.cloud= CLOUD_TEXT_EN; - wifi_menu.reconnect = WIFI_RECONNECT_TEXT_EN; - - cloud_menu.title = TITLE_CLOUD_TEXT_EN; - cloud_menu.bind = CLOUD_BINDED_EN; - cloud_menu.binded = CLOUD_BINDED_EN; - cloud_menu.unbind = CLOUD_UNBIND_EN; - cloud_menu.unbinding = CLOUD_UNBINDED_EN; - cloud_menu.disconnected = CLOUD_DISCONNECTED_EN; - cloud_menu.disable = CLOUD_DISABLE_EN; - // - about_menu.title = TITLE_ABOUT_EN; - about_menu.type = ABOUT_TYPE_TEXT_EN; - about_menu.version = ABOUT_VERSION_TEXT_EN; - about_menu.wifi = ABOUT_WIFI_TEXT_EN; - // - fan_menu.title = TITLE_FAN_EN; - fan_menu.add = FAN_ADD_TEXT_EN; - fan_menu.dec = FAN_DEC_TEXT_EN; - fan_menu.state = FAN_TIPS1_TEXT_EN; - // - filament_menu.title = TITLE_FILAMENT_EN; - filament_menu.in = FILAMENT_IN_TEXT_EN; - filament_menu.out = FILAMENT_OUT_TEXT_EN; - filament_menu.ext1 = FILAMENT_EXT0_TEXT_EN; - filament_menu.ext2 = FILAMENT_EXT1_TEXT_EN; - filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_EN; - filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN; - filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN; - filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_EN; - filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN; - filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN; - filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN; - filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_EN; - filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN; - - // - language_menu.title = TITLE_LANGUAGE_EN; - language_menu.next = PAGE_DOWN_TEXT_EN; - language_menu.up = PAGE_UP_TEXT_EN; - // - printing_menu.title = TITLE_PRINTING_EN; - printing_menu.option = PRINTING_OPERATION_EN; - printing_menu.stop = PRINTING_STOP_EN; - printing_menu.pause = PRINTING_PAUSE_EN; - printing_menu.resume = PRINTING_RESUME_EN; - - // - operation_menu.title = TITLE_OPERATION_EN; - operation_menu.pause = PRINTING_PAUSE_EN; - operation_menu.stop = PRINTING_STOP_EN; - operation_menu.temp = PRINTING_TEMP_EN; - operation_menu.fan = FAN_TEXT_EN; - operation_menu.extr = PRINTING_EXTRUDER_EN; - operation_menu.speed = PRINTING_CHANGESPEED_EN; - operation_menu.filament= FILAMENT_TEXT_EN; - operation_menu.more = PRINTING_MORE_EN; - operation_menu.move = PRINTING_MOVE_EN; - operation_menu.auto_off = AUTO_SHUTDOWN_EN; - operation_menu.manual_off = MANUAL_SHUTDOWN_EN; - // - pause_menu.title= TITLE_PAUSE_EN; - pause_menu.resume = PRINTING_RESUME_EN; - pause_menu.stop = PRINTING_STOP_EN; - pause_menu.extrude = PRINTING_EXTRUDER_EN; - pause_menu.move = PRINTING_MOVE_EN; - pause_menu.filament = FILAMENT_TEXT_EN; - pause_menu.more = PRINTING_MORE_EN; - - // - speed_menu.title = TITLE_CHANGESPEED_EN; - speed_menu.add = ADD_TEXT_EN; - speed_menu.dec = DEC_TEXT_EN; - speed_menu.move = MOVE_SPEED_EN; - speed_menu.extrude = EXTRUDER_SPEED_EN; - speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_EN; - speed_menu.move_speed = MOVE_SPEED_STATE_EN; - // - printing_more_menu.title = TITLE_MORE_EN; - printing_more_menu.fan = FAN_TEXT_EN; - printing_more_menu.auto_close = AUTO_SHUTDOWN_EN; - printing_more_menu.manual = MANUAL_SHUTDOWN_EN; - printing_more_menu.speed = PRINTING_CHANGESPEED_EN; - printing_more_menu.temp = PRINTING_TEMP_EN; - - //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_EN; - print_file_dialog_menu.confirm = DIALOG_CONFIRM_EN; - print_file_dialog_menu.cancle = DIALOG_CANCLE_EN; - print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_EN; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; - print_file_dialog_menu.retry = DIALOG_RETRY_EN; - print_file_dialog_menu.stop = DIALOG_STOP_EN; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_EN; - print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_EN; - print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_EN; - print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_EN; - print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_EN; - print_file_dialog_menu.reprint=DIALOG_REPRINT_EN; - print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_EN; - //ZOFFSET - zoffset_menu.title = TITLE_ZOFFSET_EN; - zoffset_menu.inc = ZOFFSET_INC_EN; - zoffset_menu.dec = ZOFFSET_DEC_EN; - - pause_msg_menu.pausing = MESSEGE_PAUSING_EN; - pause_msg_menu.changing = MESSEGE_CHANGING_EN; - pause_msg_menu.unload = MESSEGE_UNLOAD_EN; - pause_msg_menu.waiting = MESSEGE_WAITING_EN; - pause_msg_menu.insert = MESSEGE_INSERT_EN; - pause_msg_menu.load = MESSEGE_LOAD_EN; - pause_msg_menu.purge = MESSEGE_PURGE_EN; - pause_msg_menu.resume = MESSEGE_RESUME_EN; - pause_msg_menu.heat = MESSEGE_HEAT_EN; - pause_msg_menu.heating = MESSEGE_HEATING_EN; - pause_msg_menu.option = MESSEGE_OPTION_EN; - pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_EN; - pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_EN; - break; - case LANG_RUSSIAN: - common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_RU; - common_menu.text_back=BACK_TEXT_RU; - common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_RU; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_RU; - common_menu.print_special_title = PRINTING_OTHER_LANGUGE; - common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; - common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; - // - main_menu.title=TITLE_READYPRINT_RU; - main_menu.preheat=PREHEAT_TEXT_RU; - main_menu.move=MOVE_TEXT_RU; - main_menu.home=HOME_TEXT_RU; - main_menu.print=PRINT_TEXT_RU; - main_menu.extrude=EXTRUDE_TEXT_RU; - main_menu.leveling=LEVELING_TEXT_RU; - main_menu.autoleveling=AUTO_LEVELING_TEXT_RU; - main_menu.fan = FAN_TEXT_RU; - main_menu.set=SET_TEXT_RU; - main_menu.more=MORE_TEXT_RU; - main_menu.tool = TOOL_TEXT_RU; - //TOOL - tool_menu.title = TOOL_TEXT_RU; - tool_menu.preheat = TOOL_PREHEAT_RU; - tool_menu.extrude = TOOL_EXTRUDE_RU; - tool_menu.move = TOOL_MOVE_RU; - tool_menu.home= TOOL_HOME_RU; - tool_menu.leveling = TOOL_LEVELING_RU; - tool_menu.autoleveling = TOOL_AUTO_LEVELING_RU; - tool_menu.filament = TOOL_FILAMENT_RU; - tool_menu.more = TOOL_MORE_RU; - // - preheat_menu.adjust_title = TITLE_ADJUST_RU; - preheat_menu.title=TITLE_PREHEAT_RU; - preheat_menu.add=ADD_TEXT_RU; - preheat_menu.dec=DEC_TEXT_RU; - preheat_menu.ext1=EXTRUDER_1_TEXT_RU; - preheat_menu.ext2=EXTRUDER_2_TEXT_RU; - preheat_menu.hotbed=HEATBED_TEXT_RU; - preheat_menu.off=CLOSE_TEXT_RU; - // - move_menu.title = MOVE_TEXT_RU; - // - home_menu.title=TITLE_HOME_RU; - home_menu.stopmove = HOME_STOPMOVE_RU; - // - file_menu.title=TITLE_CHOOSEFILE_RU; - file_menu.page_up=PAGE_UP_TEXT_RU; - file_menu.page_down=PAGE_DOWN_TEXT_RU; - file_menu.file_loading = FILE_LOADING_RU; - file_menu.no_file = NO_FILE_RU; - file_menu.no_file_and_check = NO_FILE_RU;//NO_FILE_AND_CHECK_RU; - // - extrude_menu.title=TITLE_EXTRUDE_RU; - extrude_menu.in=EXTRUDER_IN_TEXT_RU; - extrude_menu.out=EXTRUDER_OUT_TEXT_RU; - extrude_menu.ext1=EXTRUDER_1_TEXT_RU; - extrude_menu.ext2=EXTRUDER_2_TEXT_RU; - extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_RU; - extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_RU; - extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_RU; - extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_RU; - // - leveling_menu.title=TITLE_LEVELING_RU; - leveling_menu.position1=LEVELING_POINT1_TEXT_RU; - leveling_menu.position2=LEVELING_POINT2_TEXT_RU; - leveling_menu.position3=LEVELING_POINT3_TEXT_RU; - leveling_menu.position4=LEVELING_POINT4_TEXT_RU; - leveling_menu.position5=LEVELING_POINT5_TEXT_RU; - // - set_menu.title=TITLE_SET_RU; - set_menu.filesys=FILESYS_TEXT_RU; - set_menu.wifi=WIFI_TEXT_RU; - set_menu.about=ABOUT_TEXT_RU; - set_menu.fan=FAN_TEXT_RU; - set_menu.filament=FILAMENT_TEXT_RU; - set_menu.breakpoint=BREAK_POINT_TEXT_RU; - set_menu.motoroff=MOTOR_OFF_TEXT_RU; - set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_RU; - set_menu.language=LANGUAGE_TEXT_RU; - set_menu.shutdown=SHUTDOWN_TEXT_RU; - // - more_menu.title = TITLE_MORE_RU; - more_menu.zoffset = ZOFFSET_RU; - // - filesys_menu.title = TITLE_FILESYS_RU; - filesys_menu.sd_sys = SD_CARD_TEXT_RU; - filesys_menu.usb_sys = U_DISK_TEXT_RU; - //WIFI - wifi_menu.title=WIFI_TEXT; - //wifi_menu.key = WIFI_KEY_TEXT_RU; - //wifi_menu.ip = WIFI_IP_TEXT_RU; - //wifi_menu.state= WIFI_STA_TEXT_RU; - wifi_menu.cloud= CLOUD_TEXT_RU; - wifi_menu.reconnect = WIFI_RECONNECT_TEXT_RU; - - - cloud_menu.title = TITLE_CLOUD_TEXT_RU; - cloud_menu.bind = CLOUD_BINDED_RU; - cloud_menu.binded = CLOUD_BINDED_RU; - cloud_menu.unbind = CLOUD_UNBIND_RU; - cloud_menu.unbinding = CLOUD_UNBINDED_RU; - cloud_menu.disconnected = CLOUD_DISCONNECTED_RU; - cloud_menu.disable = CLOUD_DISABLE_RU; - // - about_menu.title = ABOUT_TEXT_RU; - about_menu.type = ABOUT_TYPE_TEXT_RU; - about_menu.version = ABOUT_VERSION_TEXT_RU; - about_menu.wifi = ABOUT_WIFI_TEXT_RU; - // - fan_menu.title = FAN_TEXT_RU; - fan_menu.add = FAN_ADD_TEXT_RU; - fan_menu.dec = FAN_DEC_TEXT_RU; - fan_menu.state = FAN_TIPS1_TEXT_RU; - // - filament_menu.title = TITLE_FILAMENT_RU; - filament_menu.in = FILAMENT_IN_TEXT_RU; - filament_menu.out = FILAMENT_OUT_TEXT_RU; - filament_menu.ext1 = FILAMENT_EXT0_TEXT_RU; - filament_menu.ext2 = FILAMENT_EXT1_TEXT_RU; - filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_RU; - filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU; - filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU; - filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_RU; - filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU; - filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU; - filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU; - filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_RU; - filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU; - - // - language_menu.title = LANGUAGE_TEXT_RU; - language_menu.next = PAGE_DOWN_TEXT_RU; - language_menu.up = PAGE_UP_TEXT_RU; - // - printing_menu.title = TITLE_PRINTING_RU; - printing_menu.option = PRINTING_OPERATION_RU; - printing_menu.stop = PRINTING_STOP_RU; - printing_menu.pause = PRINTING_PAUSE_RU; - printing_menu.resume = PRINTING_RESUME_RU; - - // - operation_menu.title = TITLE_OPERATION_RU; - operation_menu.pause = PRINTING_PAUSE_RU; - operation_menu.stop = PRINTING_STOP_RU; - operation_menu.temp = PRINTING_TEMP_RU; - operation_menu.fan = FAN_TEXT_RU; - operation_menu.extr = PRINTING_EXTRUDER_RU; - operation_menu.speed = PRINTING_CHANGESPEED_RU; - operation_menu.filament= FILAMENT_TEXT_RU; - operation_menu.more = PRINTING_MORE_RU; - operation_menu.move = PRINTING_MOVE_RU; - operation_menu.auto_off = AUTO_SHUTDOWN_RU; - operation_menu.manual_off = MANUAL_SHUTDOWN_RU; - // - pause_menu.title= TITLE_PAUSE_RU; - pause_menu.resume = PRINTING_RESUME_RU; - pause_menu.stop = PRINTING_STOP_RU; - pause_menu.extrude = PRINTING_EXTRUDER_RU; - pause_menu.move = PRINTING_MOVE_RU; - pause_menu.filament= FILAMENT_TEXT_RU; - pause_menu.more = PRINTING_MORE_RU; - - // - speed_menu.title = PRINTING_CHANGESPEED_RU; - speed_menu.add = ADD_TEXT_RU; - speed_menu.dec = DEC_TEXT_RU; - speed_menu.move = MOVE_SPEED_RU; - speed_menu.extrude = EXTRUDER_SPEED_RU; - speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_RU; - speed_menu.move_speed = MOVE_SPEED_STATE_RU; - // - printing_more_menu.title = TITLE_MORE_RU; - printing_more_menu.fan = FAN_TEXT_RU; - printing_more_menu.auto_close = AUTO_SHUTDOWN_RU; - printing_more_menu.manual = MANUAL_SHUTDOWN_RU; - printing_more_menu.speed = PRINTING_CHANGESPEED_RU; - printing_more_menu.temp = PRINTING_TEMP_RU; - //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_RU; - print_file_dialog_menu.confirm = DIALOG_CONFIRM_RU; - print_file_dialog_menu.cancle = DIALOG_CANCLE_RU; - print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_RU; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_RU; - print_file_dialog_menu.retry = DIALOG_RETRY_RU; - print_file_dialog_menu.stop = DIALOG_STOP_RU; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_RU; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_RU; - print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_RU; - print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_RU; - print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_RU; - print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_RU; - print_file_dialog_menu.reprint=DIALOG_REPRINT_RU; - print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_RU; - //ZOFFSET - zoffset_menu.title = TITLE_ZOFFSET_RU; - zoffset_menu.inc = ZOFFSET_INC_RU; - zoffset_menu.dec = ZOFFSET_DEC_RU; - - pause_msg_menu.pausing = MESSEGE_PAUSING_RU; - pause_msg_menu.changing = MESSEGE_CHANGING_RU; - pause_msg_menu.unload = MESSEGE_UNLOAD_RU; - pause_msg_menu.waiting = MESSEGE_WAITING_RU; - pause_msg_menu.insert = MESSEGE_INSERT_RU; - pause_msg_menu.load = MESSEGE_LOAD_RU; - pause_msg_menu.purge = MESSEGE_PURGE_RU; - pause_msg_menu.resume = MESSEGE_RESUME_RU; - pause_msg_menu.heat = MESSEGE_HEAT_RU; - pause_msg_menu.heating = MESSEGE_HEATING_RU; - pause_msg_menu.option = MESSEGE_OPTION_RU; - pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_RU; - pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_RU; - break; - case LANG_SPANISH: - common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_SP; - common_menu.text_back=BACK_TEXT_SP; - common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_SP; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_SP; - common_menu.print_special_title = PRINTING_SP; - common_menu.pause_special_title = PRINTING_PAUSAR_SP; - common_menu.operate_special_title = PRINTING_AJUSTES_SP; - // - main_menu.title=TITLE_READYPRINT_SP; - main_menu.preheat=PREHEAT_TEXT_SP; - main_menu.move=MOVE_TEXT_SP; - main_menu.home=HOME_TEXT_SP; - main_menu.print=PRINT_TEXT_SP; - main_menu.extrude=EXTRUDE_TEXT_SP; - main_menu.leveling=LEVELING_TEXT_SP; - main_menu.autoleveling=AUTO_LEVELING_TEXT_SP; - main_menu.fan = FAN_TEXT_SP; - main_menu.set=SET_TEXT_SP; - main_menu.more=MORE_TEXT_SP; - main_menu.tool = TOOL_TEXT_SP; - //TOOL - tool_menu.title = TOOL_TEXT_SP; - tool_menu.preheat = TOOL_PREHEAT_SP; - tool_menu.extrude = TOOL_EXTRUDE_SP; - tool_menu.move = TOOL_MOVE_SP; - tool_menu.home= TOOL_HOME_SP; - tool_menu.leveling = TOOL_LEVELING_SP; - tool_menu.autoleveling = TOOL_AUTO_LEVELING_SP; - tool_menu.filament = TOOL_FILAMENT_SP; - tool_menu.more = TOOL_MORE_SP; - // - preheat_menu.adjust_title = TITLE_ADJUST_SP; - preheat_menu.title=TITLE_PREHEAT_SP; - preheat_menu.add=ADD_TEXT_SP; - preheat_menu.dec=DEC_TEXT_SP; - preheat_menu.ext1=EXTRUDER_1_TEXT_SP; - preheat_menu.ext2=EXTRUDER_2_TEXT_SP; - preheat_menu.hotbed=HEATBED_TEXT_SP; - preheat_menu.off=CLOSE_TEXT_SP; - // - move_menu.title = MOVE_TEXT_SP; - // - home_menu.title=TITLE_HOME_SP; - home_menu.home_x= HOME_X_TEXT_SP; - home_menu.home_y= HOME_Y_TEXT_SP; - home_menu.home_z= HOME_Z_TEXT_SP; - home_menu.home_all= HOME_ALL_TEXT_SP; - home_menu.stopmove = HOME_STOPMOVE_SP; - // - file_menu.title=TITLE_CHOOSEFILE_SP; - file_menu.page_up=PAGE_UP_TEXT_SP; - file_menu.page_down=PAGE_DOWN_TEXT_SP; - file_menu.file_loading = FILE_LOADING_SP; - file_menu.no_file = NO_FILE_SP; - file_menu.no_file_and_check = NO_FILE_SP;//NO_FILE_AND_CHECK_SP; - // - extrude_menu.title=TITLE_EXTRUDE_SP; - extrude_menu.in=EXTRUDER_IN_TEXT_SP; - extrude_menu.out=EXTRUDER_OUT_TEXT_SP; - extrude_menu.ext1=EXTRUDER_1_TEXT_SP; - extrude_menu.ext2=EXTRUDER_2_TEXT_SP; - extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_SP; - extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_SP; - extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_SP; - extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_SP; - // - leveling_menu.title=TITLE_LEVELING_SP; - leveling_menu.position1=LEVELING_POINT1_TEXT_SP; - leveling_menu.position2=LEVELING_POINT2_TEXT_SP; - leveling_menu.position3=LEVELING_POINT3_TEXT_SP; - leveling_menu.position4=LEVELING_POINT4_TEXT_SP; - leveling_menu.position5=LEVELING_POINT5_TEXT_SP; - // - set_menu.title=TITLE_SET_SP; - set_menu.filesys=FILESYS_TEXT_SP; - set_menu.wifi=WIFI_TEXT_SP; - set_menu.about=ABOUT_TEXT_SP; - set_menu.fan=FAN_TEXT_SP; - set_menu.filament=FILAMENT_TEXT_SP; - set_menu.breakpoint=BREAK_POINT_TEXT_SP; - set_menu.motoroff=MOTOR_OFF_TEXT_SP; - set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_SP; - set_menu.language=LANGUAGE_TEXT_SP; - set_menu.shutdown=SHUTDOWN_TEXT_SP; - // - more_menu.title = TITLE_MORE_SP; - more_menu.zoffset = ZOFFSET_SP; - // - filesys_menu.title = TITLE_FILESYS_SP; - filesys_menu.sd_sys = SD_CARD_TEXT_SP; - filesys_menu.usb_sys = U_DISK_TEXT_SP; - - //WIFI - wifi_menu.title=WIFI_TEXT; - //wifi_menu.key = WIFI_KEY_TEXT_SP; - //wifi_menu.ip = WIFI_IP_TEXT_SP; - //wifi_menu.state= WIFI_STA_TEXT_SP; - wifi_menu.cloud= CLOUD_TEXT_SP; - wifi_menu.reconnect = WIFI_RECONNECT_TEXT_SP; - - cloud_menu.title = TITLE_CLOUD_TEXT_SP; - cloud_menu.bind = CLOUD_BINDED_SP; - cloud_menu.binded = CLOUD_BINDED_SP; - cloud_menu.unbind = CLOUD_UNBIND_SP; - cloud_menu.unbinding = CLOUD_UNBINDED_SP; - cloud_menu.disconnected = CLOUD_DISCONNECTED_SP; - cloud_menu.disable = CLOUD_DISABLE_SP; - // - about_menu.title = ABOUT_TEXT_SP; - about_menu.type = ABOUT_TYPE_TEXT_SP; - about_menu.version = ABOUT_VERSION_TEXT_SP; - about_menu.wifi = ABOUT_WIFI_TEXT_SP; - // - fan_menu.title = FAN_TEXT_SP; - fan_menu.add = FAN_ADD_TEXT_SP; - fan_menu.dec = FAN_DEC_TEXT_SP; - fan_menu.state = FAN_TIPS1_TEXT_SP; - // - filament_menu.title = TITLE_FILAMENT_SP; - filament_menu.in = FILAMENT_IN_TEXT_SP; - filament_menu.out = FILAMENT_OUT_TEXT_SP; - filament_menu.ext1 = FILAMENT_EXT0_TEXT_SP; - filament_menu.ext2 = FILAMENT_EXT1_TEXT_SP; - filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_SP; - filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP; - filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP; - filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_SP; - filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP; - filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP; - filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP; - filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_SP; - filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP; - - // - language_menu.title = LANGUAGE_TEXT_SP; - language_menu.next = PAGE_DOWN_TEXT_SP; - language_menu.up = PAGE_UP_TEXT_SP; - // - printing_menu.title = TITLE_PRINTING_SP; - printing_menu.option = PRINTING_OPERATION_SP; - printing_menu.stop = PRINTING_STOP_SP; - printing_menu.pause = PRINTING_PAUSE_SP; - printing_menu.resume = PRINTING_RESUME_SP; - - // - operation_menu.title = TITLE_OPERATION_SP; - operation_menu.pause = PRINTING_PAUSE_SP; - operation_menu.stop = PRINTING_STOP_SP; - operation_menu.temp = PRINTING_TEMP_SP; - operation_menu.fan = FAN_TEXT_SP; - operation_menu.extr = PRINTING_EXTRUDER_SP; - operation_menu.speed = PRINTING_CHANGESPEED_SP; - operation_menu.filament = FILAMENT_TEXT_SP; - operation_menu.more = PRINTING_MORE_SP; - operation_menu.move = PRINTING_MOVE_SP; - operation_menu.auto_off = AUTO_SHUTDOWN_SP; - operation_menu.manual_off = MANUAL_SHUTDOWN_SP; - // - pause_menu.title= TITLE_PAUSE_RU; - pause_menu.resume = PRINTING_RESUME_SP; - pause_menu.stop = PRINTING_STOP_SP; - pause_menu.extrude = PRINTING_EXTRUDER_SP; - pause_menu.move = PRINTING_MOVE_SP; - pause_menu.filament= FILAMENT_TEXT_SP; - pause_menu.more = PRINTING_MORE_SP; - - // - speed_menu.title = PRINTING_CHANGESPEED_SP; - speed_menu.add = ADD_TEXT_SP; - speed_menu.dec = DEC_TEXT_SP; - speed_menu.move = MOVE_SPEED_SP; - speed_menu.extrude = EXTRUDER_SPEED_SP; - speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_SP; - speed_menu.move_speed = MOVE_SPEED_STATE_SP; - // - printing_more_menu.title= TITLE_MORE_SP; - printing_more_menu.fan = FAN_TEXT_SP; - printing_more_menu.auto_close = AUTO_SHUTDOWN_SP; - printing_more_menu.manual = MANUAL_SHUTDOWN_SP; - printing_more_menu.speed = PRINTING_CHANGESPEED_SP; - printing_more_menu.temp = PRINTING_TEMP_SP; - - //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; - print_file_dialog_menu.confirm = DIALOG_CONFIRM_SP; - print_file_dialog_menu.cancle = DIALOG_CANCLE_SP; - print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_SP; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_SP; - print_file_dialog_menu.retry = DIALOG_RETRY_SP; - print_file_dialog_menu.stop = DIALOG_STOP_SP; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_SP; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_SP; - print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_SP; - print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_SP; - print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_SP; - print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_SP; - print_file_dialog_menu.reprint=DIALOG_REPRINT_SP; - print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_SP; - //ZOFFSET - zoffset_menu.title = TITLE_ZOFFSET_SP; - zoffset_menu.inc = ZOFFSET_INC_SP; - zoffset_menu.dec = ZOFFSET_DEC_SP; - - pause_msg_menu.pausing = MESSEGE_PAUSING_SP; - pause_msg_menu.changing = MESSEGE_CHANGING_SP; - pause_msg_menu.unload = MESSEGE_UNLOAD_SP; - pause_msg_menu.waiting = MESSEGE_WAITING_SP; - pause_msg_menu.insert = MESSEGE_INSERT_SP; - pause_msg_menu.load = MESSEGE_LOAD_SP; - pause_msg_menu.purge = MESSEGE_PURGE_SP; - pause_msg_menu.resume = MESSEGE_RESUME_SP; - pause_msg_menu.heat = MESSEGE_HEAT_SP; - pause_msg_menu.heating = MESSEGE_HEATING_SP; - pause_msg_menu.option = MESSEGE_OPTION_SP; - pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_SP; - pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_SP; - break; - #endif - - case LANG_FRENCH: - common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_FR; - common_menu.text_back=BACK_TEXT_FR; - common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_FR; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_FR; - common_menu.print_special_title = PRINTING_OTHER_LANGUGE; - common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; - common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; - - // - main_menu.title=TITLE_READYPRINT_FR; - main_menu.preheat=PREHEAT_TEXT_FR; - main_menu.move=MOVE_TEXT_FR; - main_menu.home=HOME_TEXT_FR; - main_menu.print=PRINT_TEXT_FR; - main_menu.extrude=EXTRUDE_TEXT_FR; - main_menu.leveling=LEVELING_TEXT_FR; - main_menu.autoleveling=AUTO_LEVELING_TEXT_FR; - main_menu.fan = FAN_TEXT_FR; - main_menu.set=SET_TEXT_FR; - main_menu.more=MORE_TEXT_FR; - main_menu.tool = TOOL_TEXT_FR; - //TOOL - tool_menu.title = TOOL_TEXT_FR; - tool_menu.preheat = TOOL_PREHEAT_FR; - tool_menu.extrude = TOOL_EXTRUDE_FR; - tool_menu.move = TOOL_MOVE_FR; - tool_menu.home= TOOL_HOME_FR; - tool_menu.leveling = TOOL_LEVELING_FR; - tool_menu.autoleveling = TOOL_AUTO_LEVELING_FR; - tool_menu.filament = TOOL_FILAMENT_FR; - tool_menu.more = TOOL_MORE_FR; - // - preheat_menu.adjust_title = TITLE_ADJUST_FR; - preheat_menu.title=TITLE_PREHEAT_FR; - preheat_menu.add=ADD_TEXT_FR; - preheat_menu.dec=DEC_TEXT_FR; - preheat_menu.ext1=EXTRUDER_1_TEXT_FR; - preheat_menu.ext2=EXTRUDER_2_TEXT_FR; - preheat_menu.hotbed =HEATBED_TEXT_FR; - preheat_menu.off=CLOSE_TEXT_FR; - // - move_menu.title = MOVE_TEXT_FR; - // - home_menu.title=TITLE_HOME_FR; - home_menu.stopmove = HOME_STOPMOVE_FR; - // - file_menu.title=TITLE_CHOOSEFILE_FR; - file_menu.page_up=PAGE_UP_TEXT_FR; - file_menu.page_down=PAGE_DOWN_TEXT_FR; - // - extrude_menu.title=TITLE_EXTRUDE_FR; - extrude_menu.in=EXTRUDER_IN_TEXT_FR; - extrude_menu.out=EXTRUDER_OUT_TEXT_FR; - extrude_menu.ext1=EXTRUDER_1_TEXT_FR; - extrude_menu.ext2=EXTRUDER_2_TEXT_FR; - extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_FR; - extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_FR; - extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_FR; - extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_FR; - // - leveling_menu.title=TITLE_LEVELING_FR; - leveling_menu.position1=LEVELING_POINT1_TEXT_FR; - leveling_menu.position2=LEVELING_POINT2_TEXT_FR; - leveling_menu.position3=LEVELING_POINT3_TEXT_FR; - leveling_menu.position4=LEVELING_POINT4_TEXT_FR; - leveling_menu.position5=LEVELING_POINT5_TEXT_FR; - // - set_menu.title=TITLE_SET_FR; - set_menu.filesys=FILESYS_TEXT_FR; - set_menu.wifi=WIFI_TEXT_FR; - set_menu.about=ABOUT_TEXT_FR; - set_menu.fan=FAN_TEXT_FR; - set_menu.filament=FILAMENT_TEXT_FR; - set_menu.breakpoint=BREAK_POINT_TEXT_FR; - set_menu.motoroff=MOTOR_OFF_TEXT_FR; - set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_FR; - set_menu.language=LANGUAGE_TEXT_FR; - set_menu.shutdown=SHUTDOWN_TEXT_FR; - // - more_menu.title = TITLE_MORE_FR; - more_menu.zoffset = ZOFFSET_FR; - // - filesys_menu.title = TITLE_FILESYS_FR; - filesys_menu.sd_sys = SD_CARD_TEXT_FR; - filesys_menu.usb_sys = U_DISK_TEXT_FR; - file_menu.file_loading = FILE_LOADING_FR; - file_menu.no_file = NO_FILE_FR; - file_menu.no_file_and_check = NO_FILE_FR;//NO_FILE_AND_CHECK_FR; - //WIFI - wifi_menu.title=WIFI_NAME_TEXT_FR; - //wifi_menu.key = WIFI_KEY_TEXT_FR; - //wifi_menu.ip = WIFI_IP_TEXT_FR; - //wifi_menu.state= WIFI_STA_TEXT_FR; - //wifi_menu.cloud= CLOSE_TEXT_FR; - wifi_menu.cloud= CLOUD_TEXT_FR; - wifi_menu.reconnect = WIFI_RECONNECT_TEXT_FR; - - cloud_menu.title = TITLE_CLOUD_TEXT_FR; - cloud_menu.bind = CLOUD_BINDED_FR; - cloud_menu.binded = CLOUD_BINDED_FR; - cloud_menu.unbind = CLOUD_UNBIND_FR; - cloud_menu.unbinding = CLOUD_UNBINDED_FR; - cloud_menu.disconnected = CLOUD_DISCONNECTED_FR; - cloud_menu.disable = CLOUD_DISABLE_FR; - // - about_menu.title = ABOUT_TEXT_FR; - about_menu.type = ABOUT_TYPE_TEXT_FR; - about_menu.version = ABOUT_VERSION_TEXT_FR; - about_menu.wifi = ABOUT_WIFI_TEXT_FR; - // - fan_menu.title = FAN_TEXT_FR; - fan_menu.add = FAN_ADD_TEXT_FR; - fan_menu.dec = FAN_DEC_TEXT_FR; - fan_menu.state = FAN_TIPS1_TEXT_FR; - // - filament_menu.title = TITLE_FILAMENT_FR; - filament_menu.in = FILAMENT_IN_TEXT_FR; - filament_menu.out = FILAMENT_OUT_TEXT_FR; - filament_menu.ext1 = FILAMENT_EXT0_TEXT_FR; - filament_menu.ext2 = FILAMENT_EXT1_TEXT_FR; - filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_FR; - filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR; - filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR; - filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_FR; - filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR; - filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR; - filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR; - filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_FR; - filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR; - - // - language_menu.title = LANGUAGE_TEXT_FR; - - // - printing_menu.title = TITLE_PRINTING_FR; - printing_menu.option = PRINTING_OPERATION_FR; - printing_menu.stop = PRINTING_STOP_FR; - printing_menu.pause = PRINTING_PAUSE_FR; - printing_menu.resume = PRINTING_RESUME_FR; - - // - operation_menu.title = TITLE_OPERATION_FR; - operation_menu.pause = PRINTING_PAUSE_FR; - operation_menu.stop = PRINTING_STOP_FR; - operation_menu.temp = PRINTING_TEMP_FR; - operation_menu.fan = FAN_TEXT_FR; - operation_menu.extr = PRINTING_EXTRUDER_FR; - operation_menu.speed = PRINTING_CHANGESPEED_FR; - operation_menu.filament = FILAMENT_TEXT_FR; - operation_menu.more = PRINTING_MORE_FR; - operation_menu.move = PRINTING_MOVE_FR; - operation_menu.auto_off = AUTO_SHUTDOWN_FR; - operation_menu.manual_off = MANUAL_SHUTDOWN_FR; - // - pause_menu.title= TITLE_PAUSE_FR; - pause_menu.resume = PRINTING_RESUME_FR; - pause_menu.stop = PRINTING_STOP_FR; - pause_menu.extrude = PRINTING_EXTRUDER_FR; - pause_menu.move = PRINTING_MOVE_FR; - pause_menu.filament = FILAMENT_TEXT_FR; - pause_menu.more = PRINTING_MORE_FR; - - // - speed_menu.title = PRINTING_CHANGESPEED_FR; - speed_menu.add = ADD_TEXT_FR; - speed_menu.dec = DEC_TEXT_FR; - speed_menu.move = MOVE_SPEED_FR; - speed_menu.extrude = EXTRUDER_SPEED_FR; - speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_FR; - speed_menu.move_speed = MOVE_SPEED_STATE_FR; - // - printing_more_menu.fan = FAN_TEXT_FR; - printing_more_menu.auto_close = AUTO_SHUTDOWN_FR; - printing_more_menu.manual = MANUAL_SHUTDOWN_FR; - printing_more_menu.speed = PRINTING_CHANGESPEED_FR; - printing_more_menu.temp = PRINTING_TEMP_FR; - - //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; - print_file_dialog_menu.confirm = DIALOG_CONFIRM_FR; - print_file_dialog_menu.cancle = DIALOG_CANCLE_FR; - print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_FR; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_FR; - print_file_dialog_menu.retry = DIALOG_RETRY_FR; - print_file_dialog_menu.stop = DIALOG_STOP_FR; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_FR; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_FR; - print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_FR; - print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_FR; - print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_FR; - print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_FR; - print_file_dialog_menu.reprint=DIALOG_REPRINT_FR; - print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_FR; - //ZOFFSET - zoffset_menu.title = TITLE_ZOFFSET_FR; - zoffset_menu.inc = ZOFFSET_INC_FR; - zoffset_menu.dec = ZOFFSET_DEC_FR; - - pause_msg_menu.pausing = MESSEGE_PAUSING_FR; - pause_msg_menu.changing = MESSEGE_CHANGING_FR; - pause_msg_menu.unload = MESSEGE_UNLOAD_FR; - pause_msg_menu.waiting = MESSEGE_WAITING_FR; - pause_msg_menu.insert = MESSEGE_INSERT_FR; - pause_msg_menu.load = MESSEGE_LOAD_FR; - pause_msg_menu.purge = MESSEGE_PURGE_FR; - pause_msg_menu.resume = MESSEGE_RESUME_FR; - pause_msg_menu.heat = MESSEGE_HEAT_FR; - pause_msg_menu.heating = MESSEGE_HEATING_FR; - pause_msg_menu.option = MESSEGE_OPTION_FR; - pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_FR; - pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_FR; - break; - - case LANG_ITALY: - common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_IT; - common_menu.text_back=BACK_TEXT_IT; - common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_IT; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_IT; - common_menu.print_special_title = PRINTING_OTHER_LANGUGE; - common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; - common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; - - // - main_menu.title=TITLE_READYPRINT_IT; - main_menu.preheat=PREHEAT_TEXT_IT; - main_menu.move=MOVE_TEXT_IT; - main_menu.home=HOME_TEXT_IT; - main_menu.print=PRINT_TEXT_IT; - main_menu.extrude=EXTRUDE_TEXT_IT; - main_menu.leveling=LEVELING_TEXT_IT; - main_menu.autoleveling=AUTO_LEVELING_TEXT_IT; - main_menu.fan = FAN_TEXT_IT; - main_menu.set=SET_TEXT_IT; - main_menu.more=MORE_TEXT_IT; - main_menu.tool = TOOL_TEXT_IT; - //TOOL - tool_menu.title = TOOL_TEXT_IT; - tool_menu.preheat = TOOL_PREHEAT_IT; - tool_menu.extrude = TOOL_EXTRUDE_IT; - tool_menu.move = TOOL_MOVE_IT; - tool_menu.home= TOOL_HOME_IT; - tool_menu.leveling = TOOL_LEVELING_IT; - tool_menu.autoleveling = TOOL_AUTO_LEVELING_IT; - tool_menu.filament = TOOL_FILAMENT_IT; - tool_menu.more = TOOL_MORE_IT; - // - preheat_menu.adjust_title = TITLE_ADJUST_IT; - preheat_menu.title=TITLE_PREHEAT_IT; - preheat_menu.add=ADD_TEXT_IT; - preheat_menu.dec=DEC_TEXT_IT; - preheat_menu.ext1=EXTRUDER_1_TEXT_IT; - preheat_menu.ext2=EXTRUDER_2_TEXT_IT; - preheat_menu.hotbed=HEATBED_TEXT_IT; - preheat_menu.off=CLOSE_TEXT_IT; - // - move_menu.title = MOVE_TEXT_IT; - // - home_menu.title=TITLE_HOME_IT; - home_menu.stopmove = HOME_STOPMOVE_IT; - // - file_menu.title=TITLE_CHOOSEFILE_IT; - file_menu.page_up=PAGE_UP_TEXT_IT; - file_menu.page_down=PAGE_DOWN_TEXT_IT; - file_menu.file_loading = FILE_LOADING_IT; - file_menu.no_file = NO_FILE_IT; - file_menu.no_file_and_check = NO_FILE_IT;//NO_FILE_AND_CHECK_IT; - // - extrude_menu.title=TITLE_EXTRUDE_IT; - extrude_menu.in=EXTRUDER_IN_TEXT_IT; - extrude_menu.out=EXTRUDER_OUT_TEXT_IT; - extrude_menu.ext1=EXTRUDER_1_TEXT_IT; - extrude_menu.ext2=EXTRUDER_2_TEXT_IT; - extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_IT; - extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_IT; - extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_IT; - extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_IT; - // - leveling_menu.title=TITLE_LEVELING_IT; - leveling_menu.position1=LEVELING_POINT1_TEXT_IT; - leveling_menu.position2=LEVELING_POINT2_TEXT_IT; - leveling_menu.position3=LEVELING_POINT3_TEXT_IT; - leveling_menu.position4=LEVELING_POINT4_TEXT_IT; - leveling_menu.position5=LEVELING_POINT5_TEXT_IT; - // - set_menu.title=TITLE_SET_IT; - set_menu.filesys=FILESYS_TEXT_IT; - set_menu.wifi=WIFI_TEXT_IT; - set_menu.about=ABOUT_TEXT_IT; - set_menu.fan=FAN_TEXT_IT; - set_menu.filament=FILAMENT_TEXT_IT; - set_menu.breakpoint=BREAK_POINT_TEXT_IT; - set_menu.motoroff=MOTOR_OFF_TEXT_IT; - set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_IT; - set_menu.language=LANGUAGE_TEXT_IT; - set_menu.shutdown=SHUTDOWN_TEXT_IT; - // - more_menu.title = TITLE_MORE_IT; - more_menu.zoffset = ZOFFSET_IT; - // - filesys_menu.title = TITLE_FILESYS_IT; - filesys_menu.sd_sys = SD_CARD_TEXT_IT; - filesys_menu.usb_sys = U_DISK_TEXT_IT; - - //WIFI - wifi_menu.title=WIFI_NAME_TEXT_IT; - //wifi_menu.key = WIFI_KEY_TEXT_IT; - //wifi_menu.ip = WIFI_IP_TEXT_IT; - //wifi_menu.state= WIFI_STA_TEXT_IT; - wifi_menu.cloud= CLOSE_TEXT_IT; - wifi_menu.reconnect = WIFI_RECONNECT_TEXT_IT; - - cloud_menu.title = TITLE_CLOUD_TEXT_IT; - cloud_menu.bind = CLOUD_BINDED_IT; - cloud_menu.binded = CLOUD_BINDED_IT; - cloud_menu.unbind = CLOUD_UNBIND_IT; - cloud_menu.unbinding = CLOUD_UNBINDED_IT; - cloud_menu.disconnected = CLOUD_DISCONNECTED_IT; - cloud_menu.disable = CLOUD_DISABLE_IT; - // - about_menu.title = ABOUT_TEXT_IT; - about_menu.type = ABOUT_TYPE_TEXT_IT; - about_menu.version = ABOUT_VERSION_TEXT_IT; - about_menu.wifi = ABOUT_WIFI_TEXT_IT; - // - fan_menu.title = FAN_TEXT_IT; - fan_menu.add = FAN_ADD_TEXT_IT; - fan_menu.dec = FAN_DEC_TEXT_IT; - fan_menu.state = FAN_TIPS1_TEXT_IT; - // - filament_menu.title = TITLE_FILAMENT_IT; - filament_menu.in = FILAMENT_IN_TEXT_IT; - filament_menu.out = FILAMENT_OUT_TEXT_IT; - filament_menu.ext1 = FILAMENT_EXT0_TEXT_IT; - filament_menu.ext2 = FILAMENT_EXT1_TEXT_IT; - filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_IT; - filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT; - filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT; - filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_IT; - filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT; - filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT; - filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT; - filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_IT; - filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT; - - // - language_menu.title = LANGUAGE_TEXT_IT; - - // - printing_menu.title = TITLE_PRINTING_IT; - printing_menu.option = PRINTING_OPERATION_IT; - printing_menu.stop = PRINTING_STOP_IT; - printing_menu.pause = PRINTING_PAUSE_IT; - printing_menu.resume = PRINTING_RESUME_IT; - - // - operation_menu.title = TITLE_OPERATION_IT; - operation_menu.pause = PRINTING_PAUSE_IT; - operation_menu.stop = PRINTING_STOP_IT; - operation_menu.temp = PRINTING_TEMP_IT; - operation_menu.fan = FAN_TEXT_IT; - operation_menu.extr = PRINTING_EXTRUDER_IT; - operation_menu.speed = PRINTING_CHANGESPEED_IT; - operation_menu.filament = FILAMENT_TEXT_IT; - operation_menu.more = PRINTING_MORE_IT; - operation_menu.move = PRINTING_MOVE_IT; - operation_menu.auto_off = AUTO_SHUTDOWN_IT; - operation_menu.manual_off = MANUAL_SHUTDOWN_IT; - // - pause_menu.title= TITLE_PAUSE_IT; - pause_menu.resume = PRINTING_RESUME_IT; - pause_menu.stop = PRINTING_STOP_IT; - pause_menu.extrude = PRINTING_EXTRUDER_IT; - pause_menu.move = PRINTING_MOVE_IT; - pause_menu.filament = FILAMENT_TEXT_IT; - pause_menu.more = PRINTING_MORE_IT; - - // - speed_menu.title = PRINTING_CHANGESPEED_IT; - speed_menu.add = ADD_TEXT_IT; - speed_menu.dec = DEC_TEXT_IT; - speed_menu.move = MOVE_SPEED_IT; - speed_menu.extrude = EXTRUDER_SPEED_IT; - speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_IT; - speed_menu.move_speed = MOVE_SPEED_STATE_IT; - // - printing_more_menu.fan = FAN_TEXT_IT; - printing_more_menu.auto_close = AUTO_SHUTDOWN_IT; - printing_more_menu.manual = MANUAL_SHUTDOWN_IT; - printing_more_menu.temp = PRINTING_TEMP_IT; - printing_more_menu.speed = PRINTING_CHANGESPEED_IT; - - //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; - print_file_dialog_menu.confirm = DIALOG_CONFIRM_IT; - print_file_dialog_menu.cancle = DIALOG_CANCLE_IT; - print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_IT; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_IT; - print_file_dialog_menu.retry = DIALOG_RETRY_IT; - print_file_dialog_menu.stop = DIALOG_STOP_IT; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_IT; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_IT; - print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_IT; - print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_IT; - print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_IT; - print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_IT; - print_file_dialog_menu.reprint=DIALOG_REPRINT_IT; - print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_IT; - //ZOFFSET - zoffset_menu.title = TITLE_ZOFFSET_IT; - zoffset_menu.inc = ZOFFSET_INC_IT; - zoffset_menu.dec = ZOFFSET_DEC_IT; - - pause_msg_menu.pausing = MESSEGE_PAUSING_IT; - pause_msg_menu.changing = MESSEGE_CHANGING_IT; - pause_msg_menu.unload = MESSEGE_UNLOAD_IT; - pause_msg_menu.waiting = MESSEGE_WAITING_IT; - pause_msg_menu.insert = MESSEGE_INSERT_IT; - pause_msg_menu.load = MESSEGE_LOAD_IT; - pause_msg_menu.purge = MESSEGE_PURGE_IT; - pause_msg_menu.resume = MESSEGE_RESUME_IT; - pause_msg_menu.heat = MESSEGE_HEAT_IT; - pause_msg_menu.heating = MESSEGE_HEATING_IT; - pause_msg_menu.option = MESSEGE_OPTION_IT; - pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_IT; - pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_IT; - break; + tips_menu.joining = TEXT_WIFI_JOINING_EN; + tips_menu.failedJoin = TEXT_WIFI_FAILED_JOIN_EN; + tips_menu.wifiConected = TEXT_WIFI_WIFI_CONECTED_EN; + #endif + operation_menu.babystep = TEXT_BABY_STEP_EN; + + switch (gCfgItems.language) + { + case LANG_SIMPLE_CHINESE: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_CN; + common_menu.text_back = BACK_TEXT_CN; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_CN; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_CN; + common_menu.print_special_title = PRINTING_GBK; + common_menu.pause_special_title = PRINTING_PAUSE_GBK; + common_menu.operate_special_title = PRINTING_OPERATION_GBK; + // + main_menu.title = TITLE_READYPRINT_CN; + main_menu.preheat = PREHEAT_TEXT_CN; + main_menu.move = MOVE_TEXT_CN; + main_menu.home = HOME_TEXT_CN; + main_menu.print = PRINT_TEXT_CN; + main_menu.extrude = EXTRUDE_TEXT_CN; + main_menu.leveling = LEVELING_TEXT_CN; + main_menu.autoleveling = AUTO_LEVELING_TEXT_CN; + main_menu.fan = FAN_TEXT_CN; + main_menu.set = SET_TEXT_CN; + main_menu.more = MORE_TEXT_CN; + main_menu.tool = TOOL_TEXT_CN; + //TOOL + tool_menu.title = TOOL_TEXT_CN; + tool_menu.preheat = TOOL_PREHEAT_CN; + tool_menu.extrude = TOOL_EXTRUDE_CN; + tool_menu.move = TOOL_MOVE_CN; + tool_menu.home = TOOL_HOME_CN; + tool_menu.leveling = TOOL_LEVELING_CN; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_CN; + tool_menu.filament = TOOL_FILAMENT_CN; + tool_menu.more = TOOL_MORE_CN; + // + preheat_menu.adjust_title = TITLE_ADJUST_CN; + preheat_menu.title = TITLE_PREHEAT_CN; + preheat_menu.add = ADD_TEXT_CN; + preheat_menu.dec = DEC_TEXT_CN; + preheat_menu.ext1 = EXTRUDER_1_TEXT_CN; + preheat_menu.ext2 = EXTRUDER_2_TEXT_CN; + preheat_menu.hotbed = HEATBED_TEXT_CN; + preheat_menu.off = CLOSE_TEXT_CN; + + preheat_menu.value_state = TEXT_VALUE_CN; + preheat_menu.step_1c = TEXT_1C_CN; + preheat_menu.step_5c = TEXT_5C_CN; + preheat_menu.step_10c = TEXT_10C_CN; + // + move_menu.title = MOVE_TEXT_CN; + // + home_menu.title = TITLE_HOME_CN; + home_menu.stopmove = HOME_STOPMOVE_CN; + // + file_menu.title = TITLE_CHOOSEFILE_CN; + file_menu.page_up = PAGE_UP_TEXT_CN; + file_menu.page_down = PAGE_DOWN_TEXT_CN; + file_menu.file_loading = FILE_LOADING_CN; + file_menu.no_file = NO_FILE_CN; + file_menu.no_file_and_check = NO_FILE_CN;//NO_FILE_AND_CHECK_CN; + // + extrude_menu.title = TITLE_EXTRUDE_CN; + extrude_menu.in = EXTRUDER_IN_TEXT_CN; + extrude_menu.out = EXTRUDER_OUT_TEXT_CN; + extrude_menu.ext1 = EXTRUDER_1_TEXT_CN; + extrude_menu.ext2 = EXTRUDER_2_TEXT_CN; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_CN; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_CN; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_CN; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_CN; + extrude_menu.temp_value = EXTRUDE_TEXT_VALUE_T_CN; + // + leveling_menu.title = TITLE_LEVELING_CN; + leveling_menu.position1 = LEVELING_POINT1_TEXT_CN; + leveling_menu.position2 = LEVELING_POINT2_TEXT_CN; + leveling_menu.position3 = LEVELING_POINT3_TEXT_CN; + leveling_menu.position4 = LEVELING_POINT4_TEXT_CN; + leveling_menu.position5 = LEVELING_POINT5_TEXT_CN; + // + set_menu.title = TITLE_SET_CN; + set_menu.filesys = FILESYS_TEXT_CN; + set_menu.wifi = WIFI_TEXT_CN; + set_menu.about = ABOUT_TEXT_CN; + set_menu.fan = FAN_TEXT_CN; + set_menu.filament = FILAMENT_TEXT_CN; + set_menu.breakpoint = BREAK_POINT_TEXT_CN; + set_menu.motoroff = MOTOR_OFF_TEXT_CN; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_CN; + set_menu.language = LANGUAGE_TEXT_CN; + set_menu.shutdown = SHUTDOWN_TEXT_CN; + //set_menu.machine_para = MACHINE_PARA_CN; + + // + filesys_menu.title = TITLE_FILESYS_CN; + filesys_menu.sd_sys = SD_CARD_TEXT_CN; + filesys_menu.usb_sys = U_DISK_TEXT_CN; + // + more_menu.title = TITLE_MORE_CN; + more_menu.zoffset = ZOFFSET_CN; + //WIFI + wifi_menu.title = WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_CN; + //wifi_menu.ip = WIFI_IP_TEXT_CN; + //wifi_menu.state = WIFI_STA_TEXT_CN; + wifi_menu.cloud = CLOUD_TEXT_CN; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_CN; + //CLOUD + cloud_menu.title = TITLE_CLOUD_TEXT_CN; + cloud_menu.bind = CLOUD_BINDED_CN; + cloud_menu.binded = CLOUD_BINDED_CN; + cloud_menu.unbind = CLOUD_UNBIND_CN; + cloud_menu.unbinding = CLOUD_UNBINDED_CN; + cloud_menu.disconnected = CLOUD_DISCONNECTED_CN; + cloud_menu.disable = CLOUD_DISABLE_CN; + // + about_menu.title = ABOUT_TEXT_CN; + about_menu.type = ABOUT_TYPE_TEXT_CN; + about_menu.version = ABOUT_VERSION_TEXT_CN; + about_menu.wifi = ABOUT_WIFI_TEXT_CN; + + // + fan_menu.title = FAN_TEXT_CN; + fan_menu.add = FAN_ADD_TEXT_CN; + fan_menu.dec = FAN_DEC_TEXT_CN; + fan_menu.state = FAN_TIPS1_TEXT_CN; + // + filament_menu.title = TITLE_FILAMENT_CN; + filament_menu.in = FILAMENT_IN_TEXT_CN; + filament_menu.out = FILAMENT_OUT_TEXT_CN; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_CN; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_CN; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_CN; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_CN; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_CN; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_CN; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_CN; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_CN; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_CN; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_CN; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_CN; + + + // + language_menu.title = TITLE_LANGUAGE_CN; + language_menu.next = PAGE_DOWN_TEXT_CN; + language_menu.up = PAGE_UP_TEXT_CN; + + // + printing_menu.title = TITLE_PRINTING_CN; + printing_menu.option = PRINTING_OPERATION_CN; + printing_menu.stop = PRINTING_STOP_CN; + printing_menu.pause = PRINTING_PAUSE_CN; + printing_menu.resume = PRINTING_RESUME_CN; + + // + operation_menu.title = TITLE_OPERATION_CN; + operation_menu.pause = PRINTING_PAUSE_CN; + operation_menu.stop = PRINTING_STOP_CN; + operation_menu.temp = PRINTING_TEMP_CN; + operation_menu.fan = FAN_TEXT_CN; + operation_menu.filament = FILAMENT_TEXT_CN; + operation_menu.extr = PRINTING_EXTRUDER_CN; + operation_menu.speed = PRINTING_CHANGESPEED_CN; + operation_menu.more = PRINTING_MORE_CN; + operation_menu.move = PRINTING_MOVE_CN; + operation_menu.auto_off = AUTO_SHUTDOWN_CN; + operation_menu.manual_off = MANUAL_SHUTDOWN_CN; + // + pause_menu.title = TITLE_PAUSE_CN; + pause_menu.resume = PRINTING_RESUME_CN; + pause_menu.stop = PRINTING_STOP_CN; + pause_menu.extrude = PRINTING_EXTRUDER_CN; + pause_menu.move = PRINTING_MOVE_CN; + pause_menu.filament = FILAMENT_TEXT_CN; + pause_menu.more = PRINTING_MORE_CN; + + // + speed_menu.title = PRINTING_CHANGESPEED_CN; + speed_menu.add = ADD_TEXT_CN; + speed_menu.dec = DEC_TEXT_CN; + speed_menu.move = MOVE_SPEED_CN; + speed_menu.extrude = EXTRUDER_SPEED_CN; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_CN; + speed_menu.move_speed = MOVE_SPEED_STATE_CN; + // + printing_more_menu.title = TITLE_MORE_CN; + printing_more_menu.fan = FAN_TEXT_CN; + printing_more_menu.auto_close = AUTO_SHUTDOWN_CN; + printing_more_menu.manual = MANUAL_SHUTDOWN_CN; + printing_more_menu.speed = PRINTING_CHANGESPEED_CN; + printing_more_menu.temp = PRINTING_TEMP_CN; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_CN; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_CN; + print_file_dialog_menu.cancle = DIALOG_CANCLE_CN; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_CN; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_CN; + print_file_dialog_menu.retry = DIALOG_RETRY_CN; + print_file_dialog_menu.stop = DIALOG_STOP_CN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_CN; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_CN; + + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_CN; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_CN; + + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_CN; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_CN; + print_file_dialog_menu.reprint = DIALOG_REPRINT_CN; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_CN; + + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_CN; + zoffset_menu.inc = ZOFFSET_INC_CN; + zoffset_menu.dec = ZOFFSET_DEC_CN; + + pause_msg_menu.pausing = MESSEGE_PAUSING_CN; + pause_msg_menu.changing = MESSEGE_CHANGING_CN; + pause_msg_menu.unload = MESSEGE_UNLOAD_CN; + pause_msg_menu.waiting = MESSEGE_WAITING_CN; + pause_msg_menu.insert = MESSEGE_INSERT_CN; + pause_msg_menu.load = MESSEGE_LOAD_CN; + pause_msg_menu.purge = MESSEGE_PURGE_CN; + pause_msg_menu.resume = MESSEGE_RESUME_CN; + pause_msg_menu.heat = MESSEGE_HEAT_CN; + pause_msg_menu.heating = MESSEGE_HEATING_CN; + pause_msg_menu.option = MESSEGE_OPTION_CN; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_CN; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_CN; + break; -#endif - default: - common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_EN; - common_menu.text_back=BACK_TEXT_EN; - common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_EN; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_EN; - common_menu.print_special_title = PRINTING_OTHER_LANGUGE; - common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; - common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; - // - main_menu.title=TITLE_READYPRINT_EN; - main_menu.preheat=PREHEAT_TEXT_EN; - main_menu.move=MOVE_TEXT_EN; - main_menu.home=HOME_TEXT_EN; - main_menu.print=PRINT_TEXT_EN; - main_menu.extrude=EXTRUDE_TEXT_EN; - main_menu.leveling=LEVELING_TEXT_EN; - main_menu.autoleveling=AUTO_LEVELING_TEXT_EN; - main_menu.fan = FAN_TEXT_EN; - main_menu.set=SET_TEXT_EN; - main_menu.more=MORE_TEXT_EN; - main_menu.tool = TOOL_TEXT_EN; - //TOOL - tool_menu.title = TOOL_TEXT_EN; - tool_menu.preheat = TOOL_PREHEAT_EN; - tool_menu.extrude = TOOL_EXTRUDE_EN; - tool_menu.move = TOOL_MOVE_EN; - tool_menu.home= TOOL_HOME_EN; - tool_menu.leveling = TOOL_LEVELING_EN; - tool_menu.autoleveling = TOOL_AUTO_LEVELING_EN; - tool_menu.filament = TOOL_FILAMENT_EN; - tool_menu.more = TOOL_MORE_EN; - // - preheat_menu.adjust_title = TITLE_ADJUST_EN; - preheat_menu.title=TITLE_PREHEAT_EN; - preheat_menu.add=ADD_TEXT_EN; - preheat_menu.dec=DEC_TEXT_EN; - preheat_menu.ext1=EXTRUDER_1_TEXT_EN; - preheat_menu.ext2=EXTRUDER_2_TEXT_EN; - preheat_menu.hotbed=HEATBED_TEXT_EN; - preheat_menu.off=CLOSE_TEXT_EN; - // - move_menu.title = TITLE_MOVE_EN; - // - home_menu.title=TITLE_HOME_EN; - home_menu.stopmove = HOME_STOPMOVE_EN; - // - file_menu.title=TITLE_CHOOSEFILE_EN; - file_menu.page_up=PAGE_UP_TEXT_EN; - file_menu.page_down=PAGE_DOWN_TEXT_EN; - file_menu.file_loading = FILE_LOADING_EN; - file_menu.no_file = NO_FILE_EN; - file_menu.no_file_and_check = NO_FILE_EN;//NO_FILE_AND_CHECK_EN; - // - extrude_menu.title=TITLE_EXTRUDE_EN; - extrude_menu.in=EXTRUDER_IN_TEXT_EN; - extrude_menu.out=EXTRUDER_OUT_TEXT_EN; - extrude_menu.ext1=EXTRUDER_1_TEXT_EN; - extrude_menu.ext2=EXTRUDER_2_TEXT_EN; - extrude_menu.low=EXTRUDE_LOW_SPEED_TEXT_EN; - extrude_menu.normal=EXTRUDE_MEDIUM_SPEED_TEXT_EN; - extrude_menu.high=EXTRUDE_HIGH_SPEED_TEXT_EN; - extrude_menu.temper_text=EXTRUDER_TEMP_TEXT_EN; - // - leveling_menu.title=TITLE_LEVELING_EN; - leveling_menu.position1=LEVELING_POINT1_TEXT_EN; - leveling_menu.position2=LEVELING_POINT2_TEXT_EN; - leveling_menu.position3=LEVELING_POINT3_TEXT_EN; - leveling_menu.position4=LEVELING_POINT4_TEXT_EN; - leveling_menu.position5=LEVELING_POINT5_TEXT_EN; - // - set_menu.title=TITLE_SET_EN; - set_menu.filesys=FILESYS_TEXT_EN; - set_menu.wifi=WIFI_TEXT_EN; - set_menu.about=ABOUT_TEXT_EN; - set_menu.fan=FAN_TEXT_EN; - set_menu.filament=FILAMENT_TEXT_EN; - set_menu.breakpoint=BREAK_POINT_TEXT_EN; - set_menu.motoroff=MOTOR_OFF_TEXT_EN; - set_menu.motoroffXY=MOTOR_OFF_XY_TEXT_EN; - set_menu.language=LANGUAGE_TEXT_EN; - set_menu.shutdown=SHUTDOWN_TEXT_EN; - //set_menu.machine_para = MACHINE_PARA_EN; - // - more_menu.title = TITLE_MORE_EN; - more_menu.zoffset = ZOFFSET_EN; - // - filesys_menu.title = TITLE_FILESYS_EN; - filesys_menu.sd_sys = SD_CARD_TEXT_EN; - filesys_menu.usb_sys = U_DISK_TEXT_EN; - //WIFI - wifi_menu.title=WIFI_TEXT; - //wifi_menu.key = WIFI_KEY_TEXT_EN; - //wifi_menu.ip = WIFI_IP_TEXT_EN; - //wifi_menu.state= WIFI_STA_TEXT_EN; - wifi_menu.cloud= CLOUD_TEXT_EN; - wifi_menu.reconnect = WIFI_RECONNECT_TEXT_EN; - - cloud_menu.title = TITLE_CLOUD_TEXT_EN; - cloud_menu.bind = CLOUD_BINDED_EN; - cloud_menu.binded = CLOUD_BINDED_EN; - cloud_menu.unbind = CLOUD_UNBIND_EN; - cloud_menu.unbinding = CLOUD_UNBINDED_EN; - cloud_menu.disconnected = CLOUD_DISCONNECTED_EN; - cloud_menu.disable = CLOUD_DISABLE_EN; - // - about_menu.title = TITLE_ABOUT_EN; - about_menu.type = ABOUT_TYPE_TEXT_EN; - about_menu.version = ABOUT_VERSION_TEXT_EN; - about_menu.wifi = ABOUT_WIFI_TEXT_EN; - // - fan_menu.title = TITLE_FAN_EN; - fan_menu.add = FAN_ADD_TEXT_EN; - fan_menu.dec = FAN_DEC_TEXT_EN; - fan_menu.state = FAN_TIPS1_TEXT_EN; - // - filament_menu.title = TITLE_FILAMENT_EN; - filament_menu.in = FILAMENT_IN_TEXT_EN; - filament_menu.out = FILAMENT_OUT_TEXT_EN; - filament_menu.ext1 = FILAMENT_EXT0_TEXT_EN; - filament_menu.ext2 = FILAMENT_EXT1_TEXT_EN; - filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_EN; - filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN; - filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN; - filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_EN; - filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN; - filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN; - filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN; - filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_EN; - filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN; - - // - language_menu.title = TITLE_LANGUAGE_EN; - language_menu.next = PAGE_DOWN_TEXT_EN; - language_menu.up = PAGE_UP_TEXT_EN; - // - printing_menu.title = TITLE_PRINTING_EN; - printing_menu.option = PRINTING_OPERATION_EN; - printing_menu.stop = PRINTING_STOP_EN; - printing_menu.pause = PRINTING_PAUSE_EN; - printing_menu.resume = PRINTING_RESUME_EN; - - // - operation_menu.title = TITLE_OPERATION_EN; - operation_menu.pause = PRINTING_PAUSE_EN; - operation_menu.stop = PRINTING_STOP_EN; - operation_menu.temp = PRINTING_TEMP_EN; - operation_menu.fan = FAN_TEXT_EN; - operation_menu.extr = PRINTING_EXTRUDER_EN; - operation_menu.speed = PRINTING_CHANGESPEED_EN; - operation_menu.filament= FILAMENT_TEXT_EN; - operation_menu.more = PRINTING_MORE_EN; - operation_menu.move = PRINTING_MOVE_EN; - operation_menu.auto_off = AUTO_SHUTDOWN_EN; - operation_menu.manual_off = MANUAL_SHUTDOWN_EN; - // - pause_menu.title= TITLE_PAUSE_EN; - pause_menu.resume = PRINTING_RESUME_EN; - pause_menu.stop = PRINTING_STOP_EN; - pause_menu.extrude = PRINTING_EXTRUDER_EN; - pause_menu.move = PRINTING_MOVE_EN; - pause_menu.filament = FILAMENT_TEXT_EN; - pause_menu.more = PRINTING_MORE_EN; - - // - speed_menu.title = TITLE_CHANGESPEED_EN; - speed_menu.add = ADD_TEXT_EN; - speed_menu.dec = DEC_TEXT_EN; - speed_menu.move = MOVE_SPEED_EN; - speed_menu.extrude = EXTRUDER_SPEED_EN; - speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_EN; - speed_menu.move_speed = MOVE_SPEED_STATE_EN; - // - printing_more_menu.title = TITLE_MORE_EN; - printing_more_menu.fan = FAN_TEXT_EN; - printing_more_menu.auto_close = AUTO_SHUTDOWN_EN; - printing_more_menu.manual = MANUAL_SHUTDOWN_EN; - printing_more_menu.speed = PRINTING_CHANGESPEED_EN; - printing_more_menu.temp = PRINTING_TEMP_EN; - - //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_EN; - print_file_dialog_menu.confirm = DIALOG_CONFIRM_EN; - print_file_dialog_menu.cancle = DIALOG_CANCLE_EN; - print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_EN; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; - print_file_dialog_menu.retry = DIALOG_RETRY_EN; - print_file_dialog_menu.stop = DIALOG_STOP_EN; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_EN; - print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_EN; - print_file_dialog_menu.filament_no_press=DIALOG_FILAMENT_NO_PRESS_EN; - print_file_dialog_menu.print_finish=DIALOG_PRINT_FINISH_EN; - print_file_dialog_menu.print_time=DIALOG_PRINT_TIME_EN; - print_file_dialog_menu.reprint=DIALOG_REPRINT_EN; - print_file_dialog_menu.wifi_enable_tips=DIALOG_WIFI_ENABLE_TIPS_EN; - //ZOFFSET - zoffset_menu.title = TITLE_ZOFFSET_EN; - zoffset_menu.inc = ZOFFSET_INC_EN; - zoffset_menu.dec = ZOFFSET_DEC_EN; - - pause_msg_menu.pausing = MESSEGE_PAUSING_EN; - pause_msg_menu.changing = MESSEGE_CHANGING_EN; - pause_msg_menu.unload = MESSEGE_UNLOAD_EN; - pause_msg_menu.waiting = MESSEGE_WAITING_EN; - pause_msg_menu.insert = MESSEGE_INSERT_EN; - pause_msg_menu.load = MESSEGE_LOAD_EN; - pause_msg_menu.purge = MESSEGE_PURGE_EN; - pause_msg_menu.resume = MESSEGE_RESUME_EN; - pause_msg_menu.heat = MESSEGE_HEAT_EN; - pause_msg_menu.heating = MESSEGE_HEATING_EN; - pause_msg_menu.option = MESSEGE_OPTION_EN; - pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_EN; - pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_EN; - break; - } +#if 1 + #if 1 + case LANG_COMPLEX_CHINESE: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_T_CN; + common_menu.text_back = BACK_TEXT_T_CN; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_T_CN; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_T_CN; + common_menu.print_special_title = PRINTING_GBK; + common_menu.pause_special_title = PRINTING_PAUSE_GBK; + common_menu.operate_special_title = PRINTING_OPERATION_GBK; + // + main_menu.title = TITLE_READYPRINT_T_CN; + main_menu.preheat = PREHEAT_TEXT_T_CN; + main_menu.move = MOVE_TEXT_T_CN; + main_menu.home = HOME_TEXT_T_CN; + main_menu.print = PRINT_TEXT_T_CN; + main_menu.extrude = EXTRUDE_TEXT_T_CN; + main_menu.leveling = LEVELING_TEXT_T_CN; + main_menu.autoleveling = AUTO_LEVELING_TEXT_T_CN; + main_menu.fan = FAN_TEXT_T_CN; + main_menu.set = SET_TEXT_T_CN; + main_menu.more = MORE_TEXT_T_CN; + main_menu.tool = TOOL_TEXT_T_CN; + //TOOL + tool_menu.title = TOOL_TEXT_T_CN; + tool_menu.preheat = TOOL_PREHEAT_T_CN; + tool_menu.extrude = TOOL_EXTRUDE_T_CN; + tool_menu.move = TOOL_MOVE_T_CN; + tool_menu.home = TOOL_HOME_T_CN; + tool_menu.leveling = TOOL_LEVELING_T_CN; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_T_CN; + tool_menu.filament = TOOL_FILAMENT_T_CN; + tool_menu.more = TOOL_MORE_T_CN; + // + preheat_menu.adjust_title = TITLE_ADJUST_T_CN; + preheat_menu.title = TITLE_PREHEAT_T_CN; + preheat_menu.add = ADD_TEXT_T_CN; + preheat_menu.dec = DEC_TEXT_T_CN; + preheat_menu.ext1 = EXTRUDER_1_TEXT_T_CN; + preheat_menu.ext2 = EXTRUDER_2_TEXT_T_CN; + preheat_menu.hotbed = HEATBED_TEXT_T_CN; + preheat_menu.off = CLOSE_TEXT_T_CN; + preheat_menu.value_state = TEXT_VALUE_T_CN; + preheat_menu.step_1c = TEXT_1C_T_CN; + preheat_menu.step_5c = TEXT_5C_T_CN; + preheat_menu.step_10c = TEXT_10C_T_CN; + // + move_menu.title = MOVE_TEXT_T_CN; + more_menu.zoffset = ZOFFSET_T_CN; + // + home_menu.title = TITLE_HOME_T_CN; + home_menu.stopmove = HOME_STOPMOVE_T_CN; + // + file_menu.title = TITLE_CHOOSEFILE_T_CN; + file_menu.page_up = PAGE_UP_TEXT_T_CN; + file_menu.page_down = PAGE_DOWN_TEXT_T_CN; + file_menu.file_loading = FILE_LOADING_T_CN; + file_menu.no_file = NO_FILE_T_CN; + file_menu.no_file_and_check = NO_FILE_T_CN;//NO_FILE_AND_CHECK_T_CN; + // + extrude_menu.title = TITLE_EXTRUDE_T_CN; + extrude_menu.in = EXTRUDER_IN_TEXT_T_CN; + extrude_menu.out = EXTRUDER_OUT_TEXT_T_CN; + extrude_menu.ext1 = EXTRUDER_1_TEXT_T_CN; + extrude_menu.ext2 = EXTRUDER_2_TEXT_T_CN; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_T_CN; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_T_CN; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_T_CN; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_T_CN; + extrude_menu.temp_value = EXTRUDE_TEXT_VALUE_T_T_CN; + // + leveling_menu.title = TITLE_LEVELING_CN; + leveling_menu.position1 = LEVELING_POINT1_TEXT_T_CN; + leveling_menu.position2 = LEVELING_POINT2_TEXT_T_CN; + leveling_menu.position3 = LEVELING_POINT3_TEXT_T_CN; + leveling_menu.position4 = LEVELING_POINT4_TEXT_T_CN; + leveling_menu.position5 = LEVELING_POINT5_TEXT_T_CN; + // + set_menu.title = TITLE_SET_T_CN; + set_menu.filesys = FILESYS_TEXT_T_CN; + set_menu.wifi = WIFI_TEXT_T_CN; + set_menu.about = ABOUT_TEXT_T_CN; + set_menu.fan = FAN_TEXT_T_CN; + set_menu.filament = FILAMENT_TEXT_T_CN; + set_menu.breakpoint = BREAK_POINT_TEXT_T_CN; + set_menu.motoroff = MOTOR_OFF_TEXT_T_CN; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_T_CN; + set_menu.language = LANGUAGE_TEXT_T_CN; + set_menu.shutdown = SHUTDOWN_TEXT_T_CN; + //set_menu.machine_para = MACHINE_PARA_T_CN; + // + filesys_menu.title = TITLE_FILESYS_T_CN; + filesys_menu.sd_sys = SD_CARD_TEXT_T_CN; + filesys_menu.usb_sys = U_DISK_TEXT_T_CN; + // + more_menu.title = TITLE_MORE_T_CN; + //WIFI + wifi_menu.title = WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_CN; + //wifi_menu.ip = WIFI_IP_TEXT_CN; + //wifi_menu.state = WIFI_STA_TEXT_CN; + wifi_menu.cloud = CLOUD_TEXT_T_CN; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_T_CN; + //CLOUD + cloud_menu.title = TITLE_CLOUD_TEXT_T_CN; + cloud_menu.bind = CLOUD_BINDED_T_CN; + cloud_menu.binded = CLOUD_BINDED_T_CN; + cloud_menu.unbind = CLOUD_UNBIND_T_CN; + cloud_menu.unbinding = CLOUD_UNBINDED_T_CN; + cloud_menu.disconnected = CLOUD_DISCONNECTED_T_CN; + cloud_menu.disable = CLOUD_DISABLE_T_CN; + // + about_menu.title = ABOUT_TEXT_T_CN; + about_menu.type = ABOUT_TYPE_TEXT_T_CN; + about_menu.version = ABOUT_VERSION_TEXT_T_CN; + about_menu.wifi = ABOUT_WIFI_TEXT_T_CN; + + // + fan_menu.title = FAN_TEXT_T_CN; + fan_menu.add = FAN_ADD_TEXT_T_CN; + fan_menu.dec = FAN_DEC_TEXT_T_CN; + fan_menu.state = FAN_TIPS1_TEXT_T_CN; + // + filament_menu.title = TITLE_FILAMENT_T_CN; + filament_menu.in = FILAMENT_IN_TEXT_T_CN; + filament_menu.out = FILAMENT_OUT_TEXT_T_CN; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_T_CN; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_T_CN; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_T_CN; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_T_CN; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_T_CN; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_T_CN; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_T_CN; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_T_CN; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_T_CN; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_T_CN; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_T_CN; + + + // + language_menu.title = TITLE_LANGUAGE_T_CN; + language_menu.next = PAGE_DOWN_TEXT_T_CN; + language_menu.up = PAGE_UP_TEXT_T_CN; + + // + printing_menu.title = TITLE_PRINTING_T_CN; + printing_menu.option = PRINTING_OPERATION_T_CN; + printing_menu.stop = PRINTING_STOP_T_CN; + printing_menu.pause = PRINTING_PAUSE_T_CN; + printing_menu.resume = PRINTING_RESUME_T_CN; + + // + operation_menu.title = TITLE_OPERATION_T_CN; + operation_menu.pause = PRINTING_PAUSE_T_CN; + operation_menu.stop = PRINTING_STOP_T_CN; + operation_menu.temp = PRINTING_TEMP_T_CN; + operation_menu.fan = FAN_TEXT_T_CN; + operation_menu.extr = PRINTING_EXTRUDER_T_CN; + operation_menu.speed = PRINTING_CHANGESPEED_T_CN; + operation_menu.filament = FILAMENT_TEXT_T_CN; + operation_menu.more = PRINTING_MORE_T_CN; + operation_menu.move = PRINTING_MOVE_T_CN; + operation_menu.auto_off = AUTO_SHUTDOWN_T_CN; + operation_menu.manual_off = MANUAL_SHUTDOWN_T_CN; + // + pause_menu.title = TITLE_PAUSE_T_CN; + pause_menu.resume = PRINTING_RESUME_T_CN; + pause_menu.stop = PRINTING_STOP_T_CN; + pause_menu.extrude = PRINTING_EXTRUDER_T_CN; + pause_menu.move = PRINTING_MOVE_T_CN; + pause_menu.filament = FILAMENT_TEXT_T_CN; + pause_menu.more = PRINTING_MORE_T_CN; + + // + speed_menu.title = PRINTING_CHANGESPEED_T_CN; + speed_menu.add = ADD_TEXT_T_CN; + speed_menu.dec = DEC_TEXT_T_CN; + speed_menu.move = MOVE_SPEED_T_CN; + speed_menu.extrude = EXTRUDER_SPEED_T_CN; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_T_CN; + speed_menu.move_speed = MOVE_SPEED_STATE_T_CN; + // + printing_more_menu.title = TITLE_MORE_T_CN; + printing_more_menu.fan = FAN_TEXT_T_CN; + printing_more_menu.auto_close = AUTO_SHUTDOWN_T_CN; + printing_more_menu.manual = MANUAL_SHUTDOWN_T_CN; + printing_more_menu.speed = PRINTING_CHANGESPEED_T_CN; + printing_more_menu.temp = PRINTING_TEMP_T_CN; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_CN; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_T_CN; + print_file_dialog_menu.cancle = DIALOG_CANCLE_T_CN; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_T_CN; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_T_CN; + print_file_dialog_menu.retry = DIALOG_RETRY_T_CN; + print_file_dialog_menu.stop = DIALOG_STOP_T_CN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_T_CN; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_T_CN; + + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_T_CN; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_T_CN; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_T_CN; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_T_CN; + print_file_dialog_menu.reprint = DIALOG_REPRINT_T_CN; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_T_CN; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_T_CN; + zoffset_menu.inc = ZOFFSET_INC_T_CN; + zoffset_menu.dec = ZOFFSET_DEC_T_CN; + + pause_msg_menu.pausing = MESSEGE_PAUSING_T_CN; + pause_msg_menu.changing = MESSEGE_CHANGING_T_CN; + pause_msg_menu.unload = MESSEGE_UNLOAD_T_CN; + pause_msg_menu.waiting = MESSEGE_WAITING_T_CN; + pause_msg_menu.insert = MESSEGE_INSERT_T_CN; + pause_msg_menu.load = MESSEGE_LOAD_T_CN; + pause_msg_menu.purge = MESSEGE_PURGE_T_CN; + pause_msg_menu.resume = MESSEGE_RESUME_T_CN; + pause_msg_menu.heat = MESSEGE_HEAT_T_CN; + pause_msg_menu.heating = MESSEGE_HEATING_T_CN; + pause_msg_menu.option = MESSEGE_OPTION_T_CN; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_T_CN; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_T_CN; + break; + case LANG_ENGLISH: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_EN; + common_menu.text_back = BACK_TEXT_EN; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_EN; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_EN; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + // + main_menu.title = TITLE_READYPRINT_EN; + main_menu.preheat = PREHEAT_TEXT_EN; + main_menu.move = MOVE_TEXT_EN; + main_menu.home = HOME_TEXT_EN; + main_menu.print = PRINT_TEXT_EN; + main_menu.extrude = EXTRUDE_TEXT_EN; + main_menu.leveling = LEVELING_TEXT_EN; + main_menu.autoleveling = AUTO_LEVELING_TEXT_EN; + main_menu.fan = FAN_TEXT_EN; + main_menu.set = SET_TEXT_EN; + main_menu.more = MORE_TEXT_EN; + main_menu.tool = TOOL_TEXT_EN; + //TOOL + tool_menu.title = TOOL_TEXT_EN; + tool_menu.preheat = TOOL_PREHEAT_EN; + tool_menu.extrude = TOOL_EXTRUDE_EN; + tool_menu.move = TOOL_MOVE_EN; + tool_menu.home = TOOL_HOME_EN; + tool_menu.leveling = TOOL_LEVELING_EN; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_EN; + tool_menu.filament = TOOL_FILAMENT_EN; + tool_menu.more = TOOL_MORE_EN; + // + preheat_menu.adjust_title = TITLE_ADJUST_EN; + preheat_menu.title = TITLE_PREHEAT_EN; + preheat_menu.add = ADD_TEXT_EN; + preheat_menu.dec = DEC_TEXT_EN; + preheat_menu.ext1 = EXTRUDER_1_TEXT_EN; + preheat_menu.ext2 = EXTRUDER_2_TEXT_EN; + preheat_menu.hotbed = HEATBED_TEXT_EN; + preheat_menu.off = CLOSE_TEXT_EN; + // + move_menu.title = TITLE_MOVE_EN; + // + home_menu.title = TITLE_HOME_EN; + home_menu.stopmove = HOME_STOPMOVE_EN; + // + file_menu.title = TITLE_CHOOSEFILE_EN; + file_menu.page_up = PAGE_UP_TEXT_EN; + file_menu.page_down = PAGE_DOWN_TEXT_EN; + file_menu.file_loading = FILE_LOADING_EN; + file_menu.no_file = NO_FILE_EN; + file_menu.no_file_and_check = NO_FILE_EN;//NO_FILE_AND_CHECK_EN; + // + extrude_menu.title = TITLE_EXTRUDE_EN; + extrude_menu.in = EXTRUDER_IN_TEXT_EN; + extrude_menu.out = EXTRUDER_OUT_TEXT_EN; + extrude_menu.ext1 = EXTRUDER_1_TEXT_EN; + extrude_menu.ext2 = EXTRUDER_2_TEXT_EN; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_EN; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_EN; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_EN; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_EN; + // + leveling_menu.title = TITLE_LEVELING_EN; + leveling_menu.position1 = LEVELING_POINT1_TEXT_EN; + leveling_menu.position2 = LEVELING_POINT2_TEXT_EN; + leveling_menu.position3 = LEVELING_POINT3_TEXT_EN; + leveling_menu.position4 = LEVELING_POINT4_TEXT_EN; + leveling_menu.position5 = LEVELING_POINT5_TEXT_EN; + // + set_menu.title = TITLE_SET_EN; + set_menu.filesys = FILESYS_TEXT_EN; + set_menu.wifi = WIFI_TEXT_EN; + set_menu.about = ABOUT_TEXT_EN; + set_menu.fan = FAN_TEXT_EN; + set_menu.filament = FILAMENT_TEXT_EN; + set_menu.breakpoint = BREAK_POINT_TEXT_EN; + set_menu.motoroff = MOTOR_OFF_TEXT_EN; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_EN; + set_menu.language = LANGUAGE_TEXT_EN; + set_menu.shutdown = SHUTDOWN_TEXT_EN; + //set_menu.machine_para = MACHINE_PARA_EN; + // + more_menu.title = TITLE_MORE_EN; + more_menu.zoffset = ZOFFSET_EN; + // + filesys_menu.title = TITLE_FILESYS_EN; + filesys_menu.sd_sys = SD_CARD_TEXT_EN; + filesys_menu.usb_sys = U_DISK_TEXT_EN; + //WIFI + wifi_menu.title = WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_EN; + //wifi_menu.ip = WIFI_IP_TEXT_EN; + //wifi_menu.state = WIFI_STA_TEXT_EN; + wifi_menu.cloud = CLOUD_TEXT_EN; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_EN; + + cloud_menu.title = TITLE_CLOUD_TEXT_EN; + cloud_menu.bind = CLOUD_BINDED_EN; + cloud_menu.binded = CLOUD_BINDED_EN; + cloud_menu.unbind = CLOUD_UNBIND_EN; + cloud_menu.unbinding = CLOUD_UNBINDED_EN; + cloud_menu.disconnected = CLOUD_DISCONNECTED_EN; + cloud_menu.disable = CLOUD_DISABLE_EN; + // + about_menu.title = TITLE_ABOUT_EN; + about_menu.type = ABOUT_TYPE_TEXT_EN; + about_menu.version = ABOUT_VERSION_TEXT_EN; + about_menu.wifi = ABOUT_WIFI_TEXT_EN; + // + fan_menu.title = TITLE_FAN_EN; + fan_menu.add = FAN_ADD_TEXT_EN; + fan_menu.dec = FAN_DEC_TEXT_EN; + fan_menu.state = FAN_TIPS1_TEXT_EN; + // + filament_menu.title = TITLE_FILAMENT_EN; + filament_menu.in = FILAMENT_IN_TEXT_EN; + filament_menu.out = FILAMENT_OUT_TEXT_EN; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_EN; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_EN; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_EN; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_EN; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_EN; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN; + + // + language_menu.title = TITLE_LANGUAGE_EN; + language_menu.next = PAGE_DOWN_TEXT_EN; + language_menu.up = PAGE_UP_TEXT_EN; + // + printing_menu.title = TITLE_PRINTING_EN; + printing_menu.option = PRINTING_OPERATION_EN; + printing_menu.stop = PRINTING_STOP_EN; + printing_menu.pause = PRINTING_PAUSE_EN; + printing_menu.resume = PRINTING_RESUME_EN; + + // + operation_menu.title = TITLE_OPERATION_EN; + operation_menu.pause = PRINTING_PAUSE_EN; + operation_menu.stop = PRINTING_STOP_EN; + operation_menu.temp = PRINTING_TEMP_EN; + operation_menu.fan = FAN_TEXT_EN; + operation_menu.extr = PRINTING_EXTRUDER_EN; + operation_menu.speed = PRINTING_CHANGESPEED_EN; + operation_menu.filament = FILAMENT_TEXT_EN; + operation_menu.more = PRINTING_MORE_EN; + operation_menu.move = PRINTING_MOVE_EN; + operation_menu.auto_off = AUTO_SHUTDOWN_EN; + operation_menu.manual_off = MANUAL_SHUTDOWN_EN; + // + pause_menu.title = TITLE_PAUSE_EN; + pause_menu.resume = PRINTING_RESUME_EN; + pause_menu.stop = PRINTING_STOP_EN; + pause_menu.extrude = PRINTING_EXTRUDER_EN; + pause_menu.move = PRINTING_MOVE_EN; + pause_menu.filament = FILAMENT_TEXT_EN; + pause_menu.more = PRINTING_MORE_EN; + + // + speed_menu.title = TITLE_CHANGESPEED_EN; + speed_menu.add = ADD_TEXT_EN; + speed_menu.dec = DEC_TEXT_EN; + speed_menu.move = MOVE_SPEED_EN; + speed_menu.extrude = EXTRUDER_SPEED_EN; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_EN; + speed_menu.move_speed = MOVE_SPEED_STATE_EN; + // + printing_more_menu.title = TITLE_MORE_EN; + printing_more_menu.fan = FAN_TEXT_EN; + printing_more_menu.auto_close = AUTO_SHUTDOWN_EN; + printing_more_menu.manual = MANUAL_SHUTDOWN_EN; + printing_more_menu.speed = PRINTING_CHANGESPEED_EN; + printing_more_menu.temp = PRINTING_TEMP_EN; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_EN; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_EN; + print_file_dialog_menu.cancle = DIALOG_CANCLE_EN; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_EN; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; + print_file_dialog_menu.retry = DIALOG_RETRY_EN; + print_file_dialog_menu.stop = DIALOG_STOP_EN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_EN; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_EN; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_EN; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_EN; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_EN; + print_file_dialog_menu.reprint = DIALOG_REPRINT_EN; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_EN; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_EN; + zoffset_menu.inc = ZOFFSET_INC_EN; + zoffset_menu.dec = ZOFFSET_DEC_EN; + + pause_msg_menu.pausing = MESSEGE_PAUSING_EN; + pause_msg_menu.changing = MESSEGE_CHANGING_EN; + pause_msg_menu.unload = MESSEGE_UNLOAD_EN; + pause_msg_menu.waiting = MESSEGE_WAITING_EN; + pause_msg_menu.insert = MESSEGE_INSERT_EN; + pause_msg_menu.load = MESSEGE_LOAD_EN; + pause_msg_menu.purge = MESSEGE_PURGE_EN; + pause_msg_menu.resume = MESSEGE_RESUME_EN; + pause_msg_menu.heat = MESSEGE_HEAT_EN; + pause_msg_menu.heating = MESSEGE_HEATING_EN; + pause_msg_menu.option = MESSEGE_OPTION_EN; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_EN; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_EN; + break; + case LANG_RUSSIAN: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_RU; + common_menu.text_back = BACK_TEXT_RU; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_RU; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_RU; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + // + main_menu.title = TITLE_READYPRINT_RU; + main_menu.preheat = PREHEAT_TEXT_RU; + main_menu.move = MOVE_TEXT_RU; + main_menu.home = HOME_TEXT_RU; + main_menu.print = PRINT_TEXT_RU; + main_menu.extrude = EXTRUDE_TEXT_RU; + main_menu.leveling = LEVELING_TEXT_RU; + main_menu.autoleveling = AUTO_LEVELING_TEXT_RU; + main_menu.fan = FAN_TEXT_RU; + main_menu.set = SET_TEXT_RU; + main_menu.more = MORE_TEXT_RU; + main_menu.tool = TOOL_TEXT_RU; + //TOOL + tool_menu.title = TOOL_TEXT_RU; + tool_menu.preheat = TOOL_PREHEAT_RU; + tool_menu.extrude = TOOL_EXTRUDE_RU; + tool_menu.move = TOOL_MOVE_RU; + tool_menu.home = TOOL_HOME_RU; + tool_menu.leveling = TOOL_LEVELING_RU; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_RU; + tool_menu.filament = TOOL_FILAMENT_RU; + tool_menu.more = TOOL_MORE_RU; + // + preheat_menu.adjust_title = TITLE_ADJUST_RU; + preheat_menu.title = TITLE_PREHEAT_RU; + preheat_menu.add = ADD_TEXT_RU; + preheat_menu.dec = DEC_TEXT_RU; + preheat_menu.ext1 = EXTRUDER_1_TEXT_RU; + preheat_menu.ext2 = EXTRUDER_2_TEXT_RU; + preheat_menu.hotbed = HEATBED_TEXT_RU; + preheat_menu.off = CLOSE_TEXT_RU; + // + move_menu.title = MOVE_TEXT_RU; + // + home_menu.title = TITLE_HOME_RU; + home_menu.stopmove = HOME_STOPMOVE_RU; + // + file_menu.title = TITLE_CHOOSEFILE_RU; + file_menu.page_up = PAGE_UP_TEXT_RU; + file_menu.page_down = PAGE_DOWN_TEXT_RU; + file_menu.file_loading = FILE_LOADING_RU; + file_menu.no_file = NO_FILE_RU; + file_menu.no_file_and_check = NO_FILE_RU;//NO_FILE_AND_CHECK_RU; + // + extrude_menu.title = TITLE_EXTRUDE_RU; + extrude_menu.in = EXTRUDER_IN_TEXT_RU; + extrude_menu.out = EXTRUDER_OUT_TEXT_RU; + extrude_menu.ext1 = EXTRUDER_1_TEXT_RU; + extrude_menu.ext2 = EXTRUDER_2_TEXT_RU; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_RU; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_RU; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_RU; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_RU; + // + leveling_menu.title = TITLE_LEVELING_RU; + leveling_menu.position1 = LEVELING_POINT1_TEXT_RU; + leveling_menu.position2 = LEVELING_POINT2_TEXT_RU; + leveling_menu.position3 = LEVELING_POINT3_TEXT_RU; + leveling_menu.position4 = LEVELING_POINT4_TEXT_RU; + leveling_menu.position5 = LEVELING_POINT5_TEXT_RU; + // + set_menu.title = TITLE_SET_RU; + set_menu.filesys = FILESYS_TEXT_RU; + set_menu.wifi = WIFI_TEXT_RU; + set_menu.about = ABOUT_TEXT_RU; + set_menu.fan = FAN_TEXT_RU; + set_menu.filament = FILAMENT_TEXT_RU; + set_menu.breakpoint = BREAK_POINT_TEXT_RU; + set_menu.motoroff = MOTOR_OFF_TEXT_RU; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_RU; + set_menu.language = LANGUAGE_TEXT_RU; + set_menu.shutdown = SHUTDOWN_TEXT_RU; + // + more_menu.title = TITLE_MORE_RU; + more_menu.zoffset = ZOFFSET_RU; + // + filesys_menu.title = TITLE_FILESYS_RU; + filesys_menu.sd_sys = SD_CARD_TEXT_RU; + filesys_menu.usb_sys = U_DISK_TEXT_RU; + //WIFI + wifi_menu.title = WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_RU; + //wifi_menu.ip = WIFI_IP_TEXT_RU; + //wifi_menu.state = WIFI_STA_TEXT_RU; + wifi_menu.cloud = CLOUD_TEXT_RU; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_RU; + + + cloud_menu.title = TITLE_CLOUD_TEXT_RU; + cloud_menu.bind = CLOUD_BINDED_RU; + cloud_menu.binded = CLOUD_BINDED_RU; + cloud_menu.unbind = CLOUD_UNBIND_RU; + cloud_menu.unbinding = CLOUD_UNBINDED_RU; + cloud_menu.disconnected = CLOUD_DISCONNECTED_RU; + cloud_menu.disable = CLOUD_DISABLE_RU; + // + about_menu.title = ABOUT_TEXT_RU; + about_menu.type = ABOUT_TYPE_TEXT_RU; + about_menu.version = ABOUT_VERSION_TEXT_RU; + about_menu.wifi = ABOUT_WIFI_TEXT_RU; + // + fan_menu.title = FAN_TEXT_RU; + fan_menu.add = FAN_ADD_TEXT_RU; + fan_menu.dec = FAN_DEC_TEXT_RU; + fan_menu.state = FAN_TIPS1_TEXT_RU; + // + filament_menu.title = TITLE_FILAMENT_RU; + filament_menu.in = FILAMENT_IN_TEXT_RU; + filament_menu.out = FILAMENT_OUT_TEXT_RU; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_RU; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_RU; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_RU; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_RU; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_RU; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU; + + // + language_menu.title = LANGUAGE_TEXT_RU; + language_menu.next = PAGE_DOWN_TEXT_RU; + language_menu.up = PAGE_UP_TEXT_RU; + // + printing_menu.title = TITLE_PRINTING_RU; + printing_menu.option = PRINTING_OPERATION_RU; + printing_menu.stop = PRINTING_STOP_RU; + printing_menu.pause = PRINTING_PAUSE_RU; + printing_menu.resume = PRINTING_RESUME_RU; + + // + operation_menu.title = TITLE_OPERATION_RU; + operation_menu.pause = PRINTING_PAUSE_RU; + operation_menu.stop = PRINTING_STOP_RU; + operation_menu.temp = PRINTING_TEMP_RU; + operation_menu.fan = FAN_TEXT_RU; + operation_menu.extr = PRINTING_EXTRUDER_RU; + operation_menu.speed = PRINTING_CHANGESPEED_RU; + operation_menu.filament = FILAMENT_TEXT_RU; + operation_menu.more = PRINTING_MORE_RU; + operation_menu.move = PRINTING_MOVE_RU; + operation_menu.auto_off = AUTO_SHUTDOWN_RU; + operation_menu.manual_off = MANUAL_SHUTDOWN_RU; + // + pause_menu.title = TITLE_PAUSE_RU; + pause_menu.resume = PRINTING_RESUME_RU; + pause_menu.stop = PRINTING_STOP_RU; + pause_menu.extrude = PRINTING_EXTRUDER_RU; + pause_menu.move = PRINTING_MOVE_RU; + pause_menu.filament = FILAMENT_TEXT_RU; + pause_menu.more = PRINTING_MORE_RU; + + // + speed_menu.title = PRINTING_CHANGESPEED_RU; + speed_menu.add = ADD_TEXT_RU; + speed_menu.dec = DEC_TEXT_RU; + speed_menu.move = MOVE_SPEED_RU; + speed_menu.extrude = EXTRUDER_SPEED_RU; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_RU; + speed_menu.move_speed = MOVE_SPEED_STATE_RU; + // + printing_more_menu.title = TITLE_MORE_RU; + printing_more_menu.fan = FAN_TEXT_RU; + printing_more_menu.auto_close = AUTO_SHUTDOWN_RU; + printing_more_menu.manual = MANUAL_SHUTDOWN_RU; + printing_more_menu.speed = PRINTING_CHANGESPEED_RU; + printing_more_menu.temp = PRINTING_TEMP_RU; + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_RU; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_RU; + print_file_dialog_menu.cancle = DIALOG_CANCLE_RU; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_RU; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_RU; + print_file_dialog_menu.retry = DIALOG_RETRY_RU; + print_file_dialog_menu.stop = DIALOG_STOP_RU; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_RU; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_RU; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_RU; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_RU; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_RU; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_RU; + print_file_dialog_menu.reprint = DIALOG_REPRINT_RU; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_RU; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_RU; + zoffset_menu.inc = ZOFFSET_INC_RU; + zoffset_menu.dec = ZOFFSET_DEC_RU; + + pause_msg_menu.pausing = MESSEGE_PAUSING_RU; + pause_msg_menu.changing = MESSEGE_CHANGING_RU; + pause_msg_menu.unload = MESSEGE_UNLOAD_RU; + pause_msg_menu.waiting = MESSEGE_WAITING_RU; + pause_msg_menu.insert = MESSEGE_INSERT_RU; + pause_msg_menu.load = MESSEGE_LOAD_RU; + pause_msg_menu.purge = MESSEGE_PURGE_RU; + pause_msg_menu.resume = MESSEGE_RESUME_RU; + pause_msg_menu.heat = MESSEGE_HEAT_RU; + pause_msg_menu.heating = MESSEGE_HEATING_RU; + pause_msg_menu.option = MESSEGE_OPTION_RU; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_RU; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_RU; + break; + case LANG_SPANISH: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_SP; + common_menu.text_back = BACK_TEXT_SP; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_SP; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_SP; + common_menu.print_special_title = PRINTING_SP; + common_menu.pause_special_title = PRINTING_PAUSAR_SP; + common_menu.operate_special_title = PRINTING_AJUSTES_SP; + // + main_menu.title = TITLE_READYPRINT_SP; + main_menu.preheat = PREHEAT_TEXT_SP; + main_menu.move = MOVE_TEXT_SP; + main_menu.home = HOME_TEXT_SP; + main_menu.print = PRINT_TEXT_SP; + main_menu.extrude = EXTRUDE_TEXT_SP; + main_menu.leveling = LEVELING_TEXT_SP; + main_menu.autoleveling = AUTO_LEVELING_TEXT_SP; + main_menu.fan = FAN_TEXT_SP; + main_menu.set = SET_TEXT_SP; + main_menu.more = MORE_TEXT_SP; + main_menu.tool = TOOL_TEXT_SP; + //TOOL + tool_menu.title = TOOL_TEXT_SP; + tool_menu.preheat = TOOL_PREHEAT_SP; + tool_menu.extrude = TOOL_EXTRUDE_SP; + tool_menu.move = TOOL_MOVE_SP; + tool_menu.home = TOOL_HOME_SP; + tool_menu.leveling = TOOL_LEVELING_SP; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_SP; + tool_menu.filament = TOOL_FILAMENT_SP; + tool_menu.more = TOOL_MORE_SP; + // + preheat_menu.adjust_title = TITLE_ADJUST_SP; + preheat_menu.title = TITLE_PREHEAT_SP; + preheat_menu.add = ADD_TEXT_SP; + preheat_menu.dec = DEC_TEXT_SP; + preheat_menu.ext1 = EXTRUDER_1_TEXT_SP; + preheat_menu.ext2 = EXTRUDER_2_TEXT_SP; + preheat_menu.hotbed = HEATBED_TEXT_SP; + preheat_menu.off = CLOSE_TEXT_SP; + // + move_menu.title = MOVE_TEXT_SP; + // + home_menu.title = TITLE_HOME_SP; + home_menu.home_x = HOME_X_TEXT_SP; + home_menu.home_y = HOME_Y_TEXT_SP; + home_menu.home_z = HOME_Z_TEXT_SP; + home_menu.home_all = HOME_ALL_TEXT_SP; + home_menu.stopmove = HOME_STOPMOVE_SP; + // + file_menu.title = TITLE_CHOOSEFILE_SP; + file_menu.page_up = PAGE_UP_TEXT_SP; + file_menu.page_down = PAGE_DOWN_TEXT_SP; + file_menu.file_loading = FILE_LOADING_SP; + file_menu.no_file = NO_FILE_SP; + file_menu.no_file_and_check = NO_FILE_SP;//NO_FILE_AND_CHECK_SP; + // + extrude_menu.title = TITLE_EXTRUDE_SP; + extrude_menu.in = EXTRUDER_IN_TEXT_SP; + extrude_menu.out = EXTRUDER_OUT_TEXT_SP; + extrude_menu.ext1 = EXTRUDER_1_TEXT_SP; + extrude_menu.ext2 = EXTRUDER_2_TEXT_SP; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_SP; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_SP; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_SP; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_SP; + // + leveling_menu.title = TITLE_LEVELING_SP; + leveling_menu.position1 = LEVELING_POINT1_TEXT_SP; + leveling_menu.position2 = LEVELING_POINT2_TEXT_SP; + leveling_menu.position3 = LEVELING_POINT3_TEXT_SP; + leveling_menu.position4 = LEVELING_POINT4_TEXT_SP; + leveling_menu.position5 = LEVELING_POINT5_TEXT_SP; + // + set_menu.title = TITLE_SET_SP; + set_menu.filesys = FILESYS_TEXT_SP; + set_menu.wifi = WIFI_TEXT_SP; + set_menu.about = ABOUT_TEXT_SP; + set_menu.fan = FAN_TEXT_SP; + set_menu.filament = FILAMENT_TEXT_SP; + set_menu.breakpoint = BREAK_POINT_TEXT_SP; + set_menu.motoroff = MOTOR_OFF_TEXT_SP; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_SP; + set_menu.language = LANGUAGE_TEXT_SP; + set_menu.shutdown = SHUTDOWN_TEXT_SP; + // + more_menu.title = TITLE_MORE_SP; + more_menu.zoffset = ZOFFSET_SP; + // + filesys_menu.title = TITLE_FILESYS_SP; + filesys_menu.sd_sys = SD_CARD_TEXT_SP; + filesys_menu.usb_sys = U_DISK_TEXT_SP; + + //WIFI + wifi_menu.title = WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_SP; + //wifi_menu.ip = WIFI_IP_TEXT_SP; + //wifi_menu.state = WIFI_STA_TEXT_SP; + wifi_menu.cloud = CLOUD_TEXT_SP; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_SP; + + cloud_menu.title = TITLE_CLOUD_TEXT_SP; + cloud_menu.bind = CLOUD_BINDED_SP; + cloud_menu.binded = CLOUD_BINDED_SP; + cloud_menu.unbind = CLOUD_UNBIND_SP; + cloud_menu.unbinding = CLOUD_UNBINDED_SP; + cloud_menu.disconnected = CLOUD_DISCONNECTED_SP; + cloud_menu.disable = CLOUD_DISABLE_SP; + // + about_menu.title = ABOUT_TEXT_SP; + about_menu.type = ABOUT_TYPE_TEXT_SP; + about_menu.version = ABOUT_VERSION_TEXT_SP; + about_menu.wifi = ABOUT_WIFI_TEXT_SP; + // + fan_menu.title = FAN_TEXT_SP; + fan_menu.add = FAN_ADD_TEXT_SP; + fan_menu.dec = FAN_DEC_TEXT_SP; + fan_menu.state = FAN_TIPS1_TEXT_SP; + // + filament_menu.title = TITLE_FILAMENT_SP; + filament_menu.in = FILAMENT_IN_TEXT_SP; + filament_menu.out = FILAMENT_OUT_TEXT_SP; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_SP; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_SP; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_SP; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_SP; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_SP; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP; + + // + language_menu.title = LANGUAGE_TEXT_SP; + language_menu.next = PAGE_DOWN_TEXT_SP; + language_menu.up = PAGE_UP_TEXT_SP; + // + printing_menu.title = TITLE_PRINTING_SP; + printing_menu.option = PRINTING_OPERATION_SP; + printing_menu.stop = PRINTING_STOP_SP; + printing_menu.pause = PRINTING_PAUSE_SP; + printing_menu.resume = PRINTING_RESUME_SP; + + // + operation_menu.title = TITLE_OPERATION_SP; + operation_menu.pause = PRINTING_PAUSE_SP; + operation_menu.stop = PRINTING_STOP_SP; + operation_menu.temp = PRINTING_TEMP_SP; + operation_menu.fan = FAN_TEXT_SP; + operation_menu.extr = PRINTING_EXTRUDER_SP; + operation_menu.speed = PRINTING_CHANGESPEED_SP; + operation_menu.filament = FILAMENT_TEXT_SP; + operation_menu.more = PRINTING_MORE_SP; + operation_menu.move = PRINTING_MOVE_SP; + operation_menu.auto_off = AUTO_SHUTDOWN_SP; + operation_menu.manual_off = MANUAL_SHUTDOWN_SP; + // + pause_menu.title = TITLE_PAUSE_RU; + pause_menu.resume = PRINTING_RESUME_SP; + pause_menu.stop = PRINTING_STOP_SP; + pause_menu.extrude = PRINTING_EXTRUDER_SP; + pause_menu.move = PRINTING_MOVE_SP; + pause_menu.filament = FILAMENT_TEXT_SP; + pause_menu.more = PRINTING_MORE_SP; + + // + speed_menu.title = PRINTING_CHANGESPEED_SP; + speed_menu.add = ADD_TEXT_SP; + speed_menu.dec = DEC_TEXT_SP; + speed_menu.move = MOVE_SPEED_SP; + speed_menu.extrude = EXTRUDER_SPEED_SP; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_SP; + speed_menu.move_speed = MOVE_SPEED_STATE_SP; + // + printing_more_menu.title = TITLE_MORE_SP; + printing_more_menu.fan = FAN_TEXT_SP; + printing_more_menu.auto_close = AUTO_SHUTDOWN_SP; + printing_more_menu.manual = MANUAL_SHUTDOWN_SP; + printing_more_menu.speed = PRINTING_CHANGESPEED_SP; + printing_more_menu.temp = PRINTING_TEMP_SP; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_SP; + print_file_dialog_menu.cancle = DIALOG_CANCLE_SP; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_SP; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_SP; + print_file_dialog_menu.retry = DIALOG_RETRY_SP; + print_file_dialog_menu.stop = DIALOG_STOP_SP; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_SP; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_SP; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_SP; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_SP; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_SP; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_SP; + print_file_dialog_menu.reprint = DIALOG_REPRINT_SP; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_SP; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_SP; + zoffset_menu.inc = ZOFFSET_INC_SP; + zoffset_menu.dec = ZOFFSET_DEC_SP; + + pause_msg_menu.pausing = MESSEGE_PAUSING_SP; + pause_msg_menu.changing = MESSEGE_CHANGING_SP; + pause_msg_menu.unload = MESSEGE_UNLOAD_SP; + pause_msg_menu.waiting = MESSEGE_WAITING_SP; + pause_msg_menu.insert = MESSEGE_INSERT_SP; + pause_msg_menu.load = MESSEGE_LOAD_SP; + pause_msg_menu.purge = MESSEGE_PURGE_SP; + pause_msg_menu.resume = MESSEGE_RESUME_SP; + pause_msg_menu.heat = MESSEGE_HEAT_SP; + pause_msg_menu.heating = MESSEGE_HEATING_SP; + pause_msg_menu.option = MESSEGE_OPTION_SP; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_SP; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_SP; + break; + #endif + + case LANG_FRENCH: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_FR; + common_menu.text_back = BACK_TEXT_FR; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_FR; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_FR; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + + // + main_menu.title = TITLE_READYPRINT_FR; + main_menu.preheat = PREHEAT_TEXT_FR; + main_menu.move = MOVE_TEXT_FR; + main_menu.home = HOME_TEXT_FR; + main_menu.print = PRINT_TEXT_FR; + main_menu.extrude = EXTRUDE_TEXT_FR; + main_menu.leveling = LEVELING_TEXT_FR; + main_menu.autoleveling = AUTO_LEVELING_TEXT_FR; + main_menu.fan = FAN_TEXT_FR; + main_menu.set = SET_TEXT_FR; + main_menu.more = MORE_TEXT_FR; + main_menu.tool = TOOL_TEXT_FR; + //TOOL + tool_menu.title = TOOL_TEXT_FR; + tool_menu.preheat = TOOL_PREHEAT_FR; + tool_menu.extrude = TOOL_EXTRUDE_FR; + tool_menu.move = TOOL_MOVE_FR; + tool_menu.home = TOOL_HOME_FR; + tool_menu.leveling = TOOL_LEVELING_FR; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_FR; + tool_menu.filament = TOOL_FILAMENT_FR; + tool_menu.more = TOOL_MORE_FR; + // + preheat_menu.adjust_title = TITLE_ADJUST_FR; + preheat_menu.title = TITLE_PREHEAT_FR; + preheat_menu.add = ADD_TEXT_FR; + preheat_menu.dec = DEC_TEXT_FR; + preheat_menu.ext1 = EXTRUDER_1_TEXT_FR; + preheat_menu.ext2 = EXTRUDER_2_TEXT_FR; + preheat_menu.hotbed =HEATBED_TEXT_FR; + preheat_menu.off = CLOSE_TEXT_FR; + // + move_menu.title = MOVE_TEXT_FR; + // + home_menu.title = TITLE_HOME_FR; + home_menu.stopmove = HOME_STOPMOVE_FR; + // + file_menu.title = TITLE_CHOOSEFILE_FR; + file_menu.page_up = PAGE_UP_TEXT_FR; + file_menu.page_down = PAGE_DOWN_TEXT_FR; + // + extrude_menu.title = TITLE_EXTRUDE_FR; + extrude_menu.in = EXTRUDER_IN_TEXT_FR; + extrude_menu.out = EXTRUDER_OUT_TEXT_FR; + extrude_menu.ext1 = EXTRUDER_1_TEXT_FR; + extrude_menu.ext2 = EXTRUDER_2_TEXT_FR; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_FR; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_FR; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_FR; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_FR; + // + leveling_menu.title = TITLE_LEVELING_FR; + leveling_menu.position1 = LEVELING_POINT1_TEXT_FR; + leveling_menu.position2 = LEVELING_POINT2_TEXT_FR; + leveling_menu.position3 = LEVELING_POINT3_TEXT_FR; + leveling_menu.position4 = LEVELING_POINT4_TEXT_FR; + leveling_menu.position5 = LEVELING_POINT5_TEXT_FR; + // + set_menu.title = TITLE_SET_FR; + set_menu.filesys = FILESYS_TEXT_FR; + set_menu.wifi = WIFI_TEXT_FR; + set_menu.about = ABOUT_TEXT_FR; + set_menu.fan = FAN_TEXT_FR; + set_menu.filament = FILAMENT_TEXT_FR; + set_menu.breakpoint = BREAK_POINT_TEXT_FR; + set_menu.motoroff = MOTOR_OFF_TEXT_FR; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_FR; + set_menu.language = LANGUAGE_TEXT_FR; + set_menu.shutdown = SHUTDOWN_TEXT_FR; + // + more_menu.title = TITLE_MORE_FR; + more_menu.zoffset = ZOFFSET_FR; + // + filesys_menu.title = TITLE_FILESYS_FR; + filesys_menu.sd_sys = SD_CARD_TEXT_FR; + filesys_menu.usb_sys = U_DISK_TEXT_FR; + file_menu.file_loading = FILE_LOADING_FR; + file_menu.no_file = NO_FILE_FR; + file_menu.no_file_and_check = NO_FILE_FR;//NO_FILE_AND_CHECK_FR; + //WIFI + wifi_menu.title = WIFI_NAME_TEXT_FR; + //wifi_menu.key = WIFI_KEY_TEXT_FR; + //wifi_menu.ip = WIFI_IP_TEXT_FR; + //wifi_menu.state = WIFI_STA_TEXT_FR; + //wifi_menu.cloud = CLOSE_TEXT_FR; + wifi_menu.cloud = CLOUD_TEXT_FR; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_FR; + + cloud_menu.title = TITLE_CLOUD_TEXT_FR; + cloud_menu.bind = CLOUD_BINDED_FR; + cloud_menu.binded = CLOUD_BINDED_FR; + cloud_menu.unbind = CLOUD_UNBIND_FR; + cloud_menu.unbinding = CLOUD_UNBINDED_FR; + cloud_menu.disconnected = CLOUD_DISCONNECTED_FR; + cloud_menu.disable = CLOUD_DISABLE_FR; + // + about_menu.title = ABOUT_TEXT_FR; + about_menu.type = ABOUT_TYPE_TEXT_FR; + about_menu.version = ABOUT_VERSION_TEXT_FR; + about_menu.wifi = ABOUT_WIFI_TEXT_FR; + // + fan_menu.title = FAN_TEXT_FR; + fan_menu.add = FAN_ADD_TEXT_FR; + fan_menu.dec = FAN_DEC_TEXT_FR; + fan_menu.state = FAN_TIPS1_TEXT_FR; + // + filament_menu.title = TITLE_FILAMENT_FR; + filament_menu.in = FILAMENT_IN_TEXT_FR; + filament_menu.out = FILAMENT_OUT_TEXT_FR; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_FR; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_FR; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_FR; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_FR; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_FR; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR; + + // + language_menu.title = LANGUAGE_TEXT_FR; + + // + printing_menu.title = TITLE_PRINTING_FR; + printing_menu.option = PRINTING_OPERATION_FR; + printing_menu.stop = PRINTING_STOP_FR; + printing_menu.pause = PRINTING_PAUSE_FR; + printing_menu.resume = PRINTING_RESUME_FR; + + // + operation_menu.title = TITLE_OPERATION_FR; + operation_menu.pause = PRINTING_PAUSE_FR; + operation_menu.stop = PRINTING_STOP_FR; + operation_menu.temp = PRINTING_TEMP_FR; + operation_menu.fan = FAN_TEXT_FR; + operation_menu.extr = PRINTING_EXTRUDER_FR; + operation_menu.speed = PRINTING_CHANGESPEED_FR; + operation_menu.filament = FILAMENT_TEXT_FR; + operation_menu.more = PRINTING_MORE_FR; + operation_menu.move = PRINTING_MOVE_FR; + operation_menu.auto_off = AUTO_SHUTDOWN_FR; + operation_menu.manual_off = MANUAL_SHUTDOWN_FR; + // + pause_menu.title = TITLE_PAUSE_FR; + pause_menu.resume = PRINTING_RESUME_FR; + pause_menu.stop = PRINTING_STOP_FR; + pause_menu.extrude = PRINTING_EXTRUDER_FR; + pause_menu.move = PRINTING_MOVE_FR; + pause_menu.filament = FILAMENT_TEXT_FR; + pause_menu.more = PRINTING_MORE_FR; + + // + speed_menu.title = PRINTING_CHANGESPEED_FR; + speed_menu.add = ADD_TEXT_FR; + speed_menu.dec = DEC_TEXT_FR; + speed_menu.move = MOVE_SPEED_FR; + speed_menu.extrude = EXTRUDER_SPEED_FR; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_FR; + speed_menu.move_speed = MOVE_SPEED_STATE_FR; + // + printing_more_menu.fan = FAN_TEXT_FR; + printing_more_menu.auto_close = AUTO_SHUTDOWN_FR; + printing_more_menu.manual = MANUAL_SHUTDOWN_FR; + printing_more_menu.speed = PRINTING_CHANGESPEED_FR; + printing_more_menu.temp = PRINTING_TEMP_FR; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_FR; + print_file_dialog_menu.cancle = DIALOG_CANCLE_FR; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_FR; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_FR; + print_file_dialog_menu.retry = DIALOG_RETRY_FR; + print_file_dialog_menu.stop = DIALOG_STOP_FR; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_FR; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_FR; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_FR; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_FR; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_FR; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_FR; + print_file_dialog_menu.reprint = DIALOG_REPRINT_FR; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_FR; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_FR; + zoffset_menu.inc = ZOFFSET_INC_FR; + zoffset_menu.dec = ZOFFSET_DEC_FR; + + pause_msg_menu.pausing = MESSEGE_PAUSING_FR; + pause_msg_menu.changing = MESSEGE_CHANGING_FR; + pause_msg_menu.unload = MESSEGE_UNLOAD_FR; + pause_msg_menu.waiting = MESSEGE_WAITING_FR; + pause_msg_menu.insert = MESSEGE_INSERT_FR; + pause_msg_menu.load = MESSEGE_LOAD_FR; + pause_msg_menu.purge = MESSEGE_PURGE_FR; + pause_msg_menu.resume = MESSEGE_RESUME_FR; + pause_msg_menu.heat = MESSEGE_HEAT_FR; + pause_msg_menu.heating = MESSEGE_HEATING_FR; + pause_msg_menu.option = MESSEGE_OPTION_FR; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_FR; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_FR; + break; + + case LANG_ITALY: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_IT; + common_menu.text_back = BACK_TEXT_IT; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_IT; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_IT; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + + // + main_menu.title = TITLE_READYPRINT_IT; + main_menu.preheat = PREHEAT_TEXT_IT; + main_menu.move = MOVE_TEXT_IT; + main_menu.home = HOME_TEXT_IT; + main_menu.print = PRINT_TEXT_IT; + main_menu.extrude = EXTRUDE_TEXT_IT; + main_menu.leveling = LEVELING_TEXT_IT; + main_menu.autoleveling = AUTO_LEVELING_TEXT_IT; + main_menu.fan = FAN_TEXT_IT; + main_menu.set = SET_TEXT_IT; + main_menu.more = MORE_TEXT_IT; + main_menu.tool = TOOL_TEXT_IT; + //TOOL + tool_menu.title = TOOL_TEXT_IT; + tool_menu.preheat = TOOL_PREHEAT_IT; + tool_menu.extrude = TOOL_EXTRUDE_IT; + tool_menu.move = TOOL_MOVE_IT; + tool_menu.home = TOOL_HOME_IT; + tool_menu.leveling = TOOL_LEVELING_IT; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_IT; + tool_menu.filament = TOOL_FILAMENT_IT; + tool_menu.more = TOOL_MORE_IT; + // + preheat_menu.adjust_title = TITLE_ADJUST_IT; + preheat_menu.title = TITLE_PREHEAT_IT; + preheat_menu.add = ADD_TEXT_IT; + preheat_menu.dec = DEC_TEXT_IT; + preheat_menu.ext1 = EXTRUDER_1_TEXT_IT; + preheat_menu.ext2 = EXTRUDER_2_TEXT_IT; + preheat_menu.hotbed = HEATBED_TEXT_IT; + preheat_menu.off = CLOSE_TEXT_IT; + // + move_menu.title = MOVE_TEXT_IT; + // + home_menu.title = TITLE_HOME_IT; + home_menu.stopmove = HOME_STOPMOVE_IT; + // + file_menu.title = TITLE_CHOOSEFILE_IT; + file_menu.page_up = PAGE_UP_TEXT_IT; + file_menu.page_down = PAGE_DOWN_TEXT_IT; + file_menu.file_loading = FILE_LOADING_IT; + file_menu.no_file = NO_FILE_IT; + file_menu.no_file_and_check = NO_FILE_IT;//NO_FILE_AND_CHECK_IT; + // + extrude_menu.title = TITLE_EXTRUDE_IT; + extrude_menu.in = EXTRUDER_IN_TEXT_IT; + extrude_menu.out = EXTRUDER_OUT_TEXT_IT; + extrude_menu.ext1 = EXTRUDER_1_TEXT_IT; + extrude_menu.ext2 = EXTRUDER_2_TEXT_IT; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_IT; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_IT; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_IT; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_IT; + // + leveling_menu.title = TITLE_LEVELING_IT; + leveling_menu.position1 = LEVELING_POINT1_TEXT_IT; + leveling_menu.position2 = LEVELING_POINT2_TEXT_IT; + leveling_menu.position3 = LEVELING_POINT3_TEXT_IT; + leveling_menu.position4 = LEVELING_POINT4_TEXT_IT; + leveling_menu.position5 = LEVELING_POINT5_TEXT_IT; + // + set_menu.title = TITLE_SET_IT; + set_menu.filesys = FILESYS_TEXT_IT; + set_menu.wifi = WIFI_TEXT_IT; + set_menu.about = ABOUT_TEXT_IT; + set_menu.fan = FAN_TEXT_IT; + set_menu.filament = FILAMENT_TEXT_IT; + set_menu.breakpoint = BREAK_POINT_TEXT_IT; + set_menu.motoroff = MOTOR_OFF_TEXT_IT; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_IT; + set_menu.language = LANGUAGE_TEXT_IT; + set_menu.shutdown = SHUTDOWN_TEXT_IT; + // + more_menu.title = TITLE_MORE_IT; + more_menu.zoffset = ZOFFSET_IT; + // + filesys_menu.title = TITLE_FILESYS_IT; + filesys_menu.sd_sys = SD_CARD_TEXT_IT; + filesys_menu.usb_sys = U_DISK_TEXT_IT; + + //WIFI + wifi_menu.title = WIFI_NAME_TEXT_IT; + //wifi_menu.key = WIFI_KEY_TEXT_IT; + //wifi_menu.ip = WIFI_IP_TEXT_IT; + //wifi_menu.state = WIFI_STA_TEXT_IT; + wifi_menu.cloud = CLOSE_TEXT_IT; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_IT; + + cloud_menu.title = TITLE_CLOUD_TEXT_IT; + cloud_menu.bind = CLOUD_BINDED_IT; + cloud_menu.binded = CLOUD_BINDED_IT; + cloud_menu.unbind = CLOUD_UNBIND_IT; + cloud_menu.unbinding = CLOUD_UNBINDED_IT; + cloud_menu.disconnected = CLOUD_DISCONNECTED_IT; + cloud_menu.disable = CLOUD_DISABLE_IT; + // + about_menu.title = ABOUT_TEXT_IT; + about_menu.type = ABOUT_TYPE_TEXT_IT; + about_menu.version = ABOUT_VERSION_TEXT_IT; + about_menu.wifi = ABOUT_WIFI_TEXT_IT; + // + fan_menu.title = FAN_TEXT_IT; + fan_menu.add = FAN_ADD_TEXT_IT; + fan_menu.dec = FAN_DEC_TEXT_IT; + fan_menu.state = FAN_TIPS1_TEXT_IT; + // + filament_menu.title = TITLE_FILAMENT_IT; + filament_menu.in = FILAMENT_IN_TEXT_IT; + filament_menu.out = FILAMENT_OUT_TEXT_IT; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_IT; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_IT; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_IT; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_IT; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_IT; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT; + + // + language_menu.title = LANGUAGE_TEXT_IT; + + // + printing_menu.title = TITLE_PRINTING_IT; + printing_menu.option = PRINTING_OPERATION_IT; + printing_menu.stop = PRINTING_STOP_IT; + printing_menu.pause = PRINTING_PAUSE_IT; + printing_menu.resume = PRINTING_RESUME_IT; + + // + operation_menu.title = TITLE_OPERATION_IT; + operation_menu.pause = PRINTING_PAUSE_IT; + operation_menu.stop = PRINTING_STOP_IT; + operation_menu.temp = PRINTING_TEMP_IT; + operation_menu.fan = FAN_TEXT_IT; + operation_menu.extr = PRINTING_EXTRUDER_IT; + operation_menu.speed = PRINTING_CHANGESPEED_IT; + operation_menu.filament = FILAMENT_TEXT_IT; + operation_menu.more = PRINTING_MORE_IT; + operation_menu.move = PRINTING_MOVE_IT; + operation_menu.auto_off = AUTO_SHUTDOWN_IT; + operation_menu.manual_off = MANUAL_SHUTDOWN_IT; + // + pause_menu.title = TITLE_PAUSE_IT; + pause_menu.resume = PRINTING_RESUME_IT; + pause_menu.stop = PRINTING_STOP_IT; + pause_menu.extrude = PRINTING_EXTRUDER_IT; + pause_menu.move = PRINTING_MOVE_IT; + pause_menu.filament = FILAMENT_TEXT_IT; + pause_menu.more = PRINTING_MORE_IT; + + // + speed_menu.title = PRINTING_CHANGESPEED_IT; + speed_menu.add = ADD_TEXT_IT; + speed_menu.dec = DEC_TEXT_IT; + speed_menu.move = MOVE_SPEED_IT; + speed_menu.extrude = EXTRUDER_SPEED_IT; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_IT; + speed_menu.move_speed = MOVE_SPEED_STATE_IT; + // + printing_more_menu.fan = FAN_TEXT_IT; + printing_more_menu.auto_close = AUTO_SHUTDOWN_IT; + printing_more_menu.manual = MANUAL_SHUTDOWN_IT; + printing_more_menu.temp = PRINTING_TEMP_IT; + printing_more_menu.speed = PRINTING_CHANGESPEED_IT; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_IT; + print_file_dialog_menu.cancle = DIALOG_CANCLE_IT; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_IT; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_IT; + print_file_dialog_menu.retry = DIALOG_RETRY_IT; + print_file_dialog_menu.stop = DIALOG_STOP_IT; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_IT; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_IT; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_IT; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_IT; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_IT; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_IT; + print_file_dialog_menu.reprint = DIALOG_REPRINT_IT; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_IT; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_IT; + zoffset_menu.inc = ZOFFSET_INC_IT; + zoffset_menu.dec = ZOFFSET_DEC_IT; + + pause_msg_menu.pausing = MESSEGE_PAUSING_IT; + pause_msg_menu.changing = MESSEGE_CHANGING_IT; + pause_msg_menu.unload = MESSEGE_UNLOAD_IT; + pause_msg_menu.waiting = MESSEGE_WAITING_IT; + pause_msg_menu.insert = MESSEGE_INSERT_IT; + pause_msg_menu.load = MESSEGE_LOAD_IT; + pause_msg_menu.purge = MESSEGE_PURGE_IT; + pause_msg_menu.resume = MESSEGE_RESUME_IT; + pause_msg_menu.heat = MESSEGE_HEAT_IT; + pause_msg_menu.heating = MESSEGE_HEATING_IT; + pause_msg_menu.option = MESSEGE_OPTION_IT; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_IT; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_IT; + break; + + #endif + default: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_EN; + common_menu.text_back = BACK_TEXT_EN; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_EN; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_EN; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + // + main_menu.title = TITLE_READYPRINT_EN; + main_menu.preheat = PREHEAT_TEXT_EN; + main_menu.move = MOVE_TEXT_EN; + main_menu.home = HOME_TEXT_EN; + main_menu.print = PRINT_TEXT_EN; + main_menu.extrude = EXTRUDE_TEXT_EN; + main_menu.leveling = LEVELING_TEXT_EN; + main_menu.autoleveling = AUTO_LEVELING_TEXT_EN; + main_menu.fan = FAN_TEXT_EN; + main_menu.set = SET_TEXT_EN; + main_menu.more = MORE_TEXT_EN; + main_menu.tool = TOOL_TEXT_EN; + //TOOL + tool_menu.title = TOOL_TEXT_EN; + tool_menu.preheat = TOOL_PREHEAT_EN; + tool_menu.extrude = TOOL_EXTRUDE_EN; + tool_menu.move = TOOL_MOVE_EN; + tool_menu.home = TOOL_HOME_EN; + tool_menu.leveling = TOOL_LEVELING_EN; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_EN; + tool_menu.filament = TOOL_FILAMENT_EN; + tool_menu.more = TOOL_MORE_EN; + // + preheat_menu.adjust_title = TITLE_ADJUST_EN; + preheat_menu.title = TITLE_PREHEAT_EN; + preheat_menu.add = ADD_TEXT_EN; + preheat_menu.dec = DEC_TEXT_EN; + preheat_menu.ext1 = EXTRUDER_1_TEXT_EN; + preheat_menu.ext2 = EXTRUDER_2_TEXT_EN; + preheat_menu.hotbed = HEATBED_TEXT_EN; + preheat_menu.off = CLOSE_TEXT_EN; + // + move_menu.title = TITLE_MOVE_EN; + // + home_menu.title = TITLE_HOME_EN; + home_menu.stopmove = HOME_STOPMOVE_EN; + // + file_menu.title = TITLE_CHOOSEFILE_EN; + file_menu.page_up = PAGE_UP_TEXT_EN; + file_menu.page_down = PAGE_DOWN_TEXT_EN; + file_menu.file_loading = FILE_LOADING_EN; + file_menu.no_file = NO_FILE_EN; + file_menu.no_file_and_check = NO_FILE_EN;//NO_FILE_AND_CHECK_EN; + // + extrude_menu.title = TITLE_EXTRUDE_EN; + extrude_menu.in = EXTRUDER_IN_TEXT_EN; + extrude_menu.out = EXTRUDER_OUT_TEXT_EN; + extrude_menu.ext1 = EXTRUDER_1_TEXT_EN; + extrude_menu.ext2 = EXTRUDER_2_TEXT_EN; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_EN; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_EN; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_EN; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_EN; + // + leveling_menu.title = TITLE_LEVELING_EN; + leveling_menu.position1 = LEVELING_POINT1_TEXT_EN; + leveling_menu.position2 = LEVELING_POINT2_TEXT_EN; + leveling_menu.position3 = LEVELING_POINT3_TEXT_EN; + leveling_menu.position4 = LEVELING_POINT4_TEXT_EN; + leveling_menu.position5 = LEVELING_POINT5_TEXT_EN; + // + set_menu.title = TITLE_SET_EN; + set_menu.filesys = FILESYS_TEXT_EN; + set_menu.wifi = WIFI_TEXT_EN; + set_menu.about = ABOUT_TEXT_EN; + set_menu.fan = FAN_TEXT_EN; + set_menu.filament = FILAMENT_TEXT_EN; + set_menu.breakpoint = BREAK_POINT_TEXT_EN; + set_menu.motoroff = MOTOR_OFF_TEXT_EN; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_EN; + set_menu.language = LANGUAGE_TEXT_EN; + set_menu.shutdown = SHUTDOWN_TEXT_EN; + //set_menu.machine_para = MACHINE_PARA_EN; + // + more_menu.title = TITLE_MORE_EN; + more_menu.zoffset = ZOFFSET_EN; + // + filesys_menu.title = TITLE_FILESYS_EN; + filesys_menu.sd_sys = SD_CARD_TEXT_EN; + filesys_menu.usb_sys = U_DISK_TEXT_EN; + //WIFI + wifi_menu.title = WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_EN; + //wifi_menu.ip = WIFI_IP_TEXT_EN; + //wifi_menu.state = WIFI_STA_TEXT_EN; + wifi_menu.cloud = CLOUD_TEXT_EN; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_EN; + + cloud_menu.title = TITLE_CLOUD_TEXT_EN; + cloud_menu.bind = CLOUD_BINDED_EN; + cloud_menu.binded = CLOUD_BINDED_EN; + cloud_menu.unbind = CLOUD_UNBIND_EN; + cloud_menu.unbinding = CLOUD_UNBINDED_EN; + cloud_menu.disconnected = CLOUD_DISCONNECTED_EN; + cloud_menu.disable = CLOUD_DISABLE_EN; + // + about_menu.title = TITLE_ABOUT_EN; + about_menu.type = ABOUT_TYPE_TEXT_EN; + about_menu.version = ABOUT_VERSION_TEXT_EN; + about_menu.wifi = ABOUT_WIFI_TEXT_EN; + // + fan_menu.title = TITLE_FAN_EN; + fan_menu.add = FAN_ADD_TEXT_EN; + fan_menu.dec = FAN_DEC_TEXT_EN; + fan_menu.state = FAN_TIPS1_TEXT_EN; + // + filament_menu.title = TITLE_FILAMENT_EN; + filament_menu.in = FILAMENT_IN_TEXT_EN; + filament_menu.out = FILAMENT_OUT_TEXT_EN; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_EN; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_EN; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_EN; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_EN; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_EN; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN; + + // + language_menu.title = TITLE_LANGUAGE_EN; + language_menu.next = PAGE_DOWN_TEXT_EN; + language_menu.up = PAGE_UP_TEXT_EN; + // + printing_menu.title = TITLE_PRINTING_EN; + printing_menu.option = PRINTING_OPERATION_EN; + printing_menu.stop = PRINTING_STOP_EN; + printing_menu.pause = PRINTING_PAUSE_EN; + printing_menu.resume = PRINTING_RESUME_EN; + + // + operation_menu.title = TITLE_OPERATION_EN; + operation_menu.pause = PRINTING_PAUSE_EN; + operation_menu.stop = PRINTING_STOP_EN; + operation_menu.temp = PRINTING_TEMP_EN; + operation_menu.fan = FAN_TEXT_EN; + operation_menu.extr = PRINTING_EXTRUDER_EN; + operation_menu.speed = PRINTING_CHANGESPEED_EN; + operation_menu.filament = FILAMENT_TEXT_EN; + operation_menu.more = PRINTING_MORE_EN; + operation_menu.move = PRINTING_MOVE_EN; + operation_menu.auto_off = AUTO_SHUTDOWN_EN; + operation_menu.manual_off = MANUAL_SHUTDOWN_EN; + // + pause_menu.title = TITLE_PAUSE_EN; + pause_menu.resume = PRINTING_RESUME_EN; + pause_menu.stop = PRINTING_STOP_EN; + pause_menu.extrude = PRINTING_EXTRUDER_EN; + pause_menu.move = PRINTING_MOVE_EN; + pause_menu.filament = FILAMENT_TEXT_EN; + pause_menu.more = PRINTING_MORE_EN; + + // + speed_menu.title = TITLE_CHANGESPEED_EN; + speed_menu.add = ADD_TEXT_EN; + speed_menu.dec = DEC_TEXT_EN; + speed_menu.move = MOVE_SPEED_EN; + speed_menu.extrude = EXTRUDER_SPEED_EN; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_EN; + speed_menu.move_speed = MOVE_SPEED_STATE_EN; + // + printing_more_menu.title = TITLE_MORE_EN; + printing_more_menu.fan = FAN_TEXT_EN; + printing_more_menu.auto_close = AUTO_SHUTDOWN_EN; + printing_more_menu.manual = MANUAL_SHUTDOWN_EN; + printing_more_menu.speed = PRINTING_CHANGESPEED_EN; + printing_more_menu.temp = PRINTING_TEMP_EN; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_EN; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_EN; + print_file_dialog_menu.cancle = DIALOG_CANCLE_EN; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_EN; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; + print_file_dialog_menu.retry = DIALOG_RETRY_EN; + print_file_dialog_menu.stop = DIALOG_STOP_EN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_EN; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_EN; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_EN; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_EN; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_EN; + print_file_dialog_menu.reprint = DIALOG_REPRINT_EN; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_EN; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_EN; + zoffset_menu.inc = ZOFFSET_INC_EN; + zoffset_menu.dec = ZOFFSET_DEC_EN; + + pause_msg_menu.pausing = MESSEGE_PAUSING_EN; + pause_msg_menu.changing = MESSEGE_CHANGING_EN; + pause_msg_menu.unload = MESSEGE_UNLOAD_EN; + pause_msg_menu.waiting = MESSEGE_WAITING_EN; + pause_msg_menu.insert = MESSEGE_INSERT_EN; + pause_msg_menu.load = MESSEGE_LOAD_EN; + pause_msg_menu.purge = MESSEGE_PURGE_EN; + pause_msg_menu.resume = MESSEGE_RESUME_EN; + pause_msg_menu.heat = MESSEGE_HEAT_EN; + pause_msg_menu.heating = MESSEGE_HEATING_EN; + pause_msg_menu.option = MESSEGE_OPTION_EN; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_EN; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_EN; + break; + } } #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h index 80182aa031c4..ee08efc9c19d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h @@ -21,7 +21,6 @@ */ #pragma once -//#include "../MarlinCore.h" #include "inc/tft_Language_en.h" #include "inc/tft_Language_s_cn.h" #include "inc/tft_Language_t_cn.h" diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index b828e48e63ba..d1f418ce0080 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -110,24 +110,24 @@ //#define POWER_LOSS_PIN PA2 // PW_DET //#define PS_ON_PIN PA3 // PW_OFF -//#define SUICIDE_PIN PB2 // Enable MKSPWC support ROBIN NANO v1.2 ONLY -//#define SUICIDE_PIN_INVERTING false +//#define SUICIDE_PIN PB2 // Enable MKSPWC support ROBIN NANO v1.2 ONLY +//#define SUICIDE_PIN_INVERTING false -//#define KILL_PIN PA2 // Enable MKSPWC support ROBIN NANO v1.2 ONLY -//#define KILL_PIN_INVERTING true // Enable MKSPWC support ROBIN NANO v1.2 ONLY +//#define KILL_PIN PA2 // Enable MKSPWC support ROBIN NANO v1.2 ONLY +//#define KILL_PIN_INVERTING true // Enable MKSPWC support ROBIN NANO v1.2 ONLY -//#define SERVO0_PIN PA8 // Enable BLTOUCH support ROBIN NANO v1.2 ONLY +//#define SERVO0_PIN PA8 // Enable BLTOUCH support ROBIN NANO v1.2 ONLY -//#define LED_PIN PB2 +//#define LED_PIN PB2 -#define MT_DET_1_PIN PA4 -#define MT_DET_PIN_INVERTING false +#define MT_DET_1_PIN PA4 +#define MT_DET_PIN_INVERTING false // // SD Card // #ifndef SDCARD_CONNECTION - //#define SDCARD_CONNECTION ONBOARD + //#define SDCARD_CONNECTION ONBOARD #endif #define SDIO_SUPPORT @@ -148,89 +148,85 @@ #if HAS_SPI_LCD - #define BEEPER_PIN PC5 - #define BTN_ENC PE13 - #define LCD_PINS_ENABLE PD13 - #define LCD_PINS_RS PC6 - #define BTN_EN1 PE8 - #define BTN_EN2 PE11 - #define LCD_BACKLIGHT_PIN -1 + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + #define LCD_PINS_ENABLE PD13 + #define LCD_PINS_RS PC6 + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define LCD_BACKLIGHT_PIN -1 // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) #if ENABLED(MKS_MINI_12864) - #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN -1 - #define DOGLCD_A0 PD11 - #define DOGLCD_CS PE15 - #define DOGLCD_SCK PA5 - #define DOGLCD_MOSI PA7 + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN -1 + #define DOGLCD_A0 PD11 + #define DOGLCD_CS PE15 + #define DOGLCD_SCK PA5 + #define DOGLCD_MOSI PA7 // Required for MKS_MINI_12864 with this board #define MKS_LCD12864B #undef SHOW_BOOTSCREEN - #else // !MKS_MINI_12864 + #else // !MKS_MINI_12864 - #define LCD_PINS_D4 PE14 + #define LCD_PINS_D4 PE14 #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 PE15 - #define LCD_PINS_D6 PD11 - #define LCD_PINS_D7 PD10 + #define LCD_PINS_D5 PE15 + #define LCD_PINS_D6 PD11 + #define LCD_PINS_D7 PD10 #endif #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(125) + #define ST7920_DELAY_1 DELAY_NS(125) #endif #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) + #define ST7920_DELAY_2 DELAY_NS(125) #endif #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(125) + #define ST7920_DELAY_3 DELAY_NS(125) #endif #endif // !MKS_MINI_12864 - #else + #else - #define SPI_TFT_CS_PIN PD11 - #define SPI_TFT_SCK_PIN PA5 - #define SPI_TFT_MISO_PIN PA6 - #define SPI_TFT_MOSI_PIN PA7 - #define SPI_TFT_DC_PIN PD10 - #define SPI_TFT_RST_PIN PC6 + #define SPI_TFT_CS_PIN PD11 + #define SPI_TFT_SCK_PIN PA5 + #define SPI_TFT_MISO_PIN PA6 + #define SPI_TFT_MOSI_PIN PA7 + #define SPI_TFT_DC_PIN PD10 + #define SPI_TFT_RST_PIN PC6 - #define LCD_BACKLIGHT_PIN PD13 + #define LCD_BACKLIGHT_PIN PD13 - #define TOUCH_CS_PIN PE14 // SPI1_NSS - #define TOUCH_SCK_PIN PA5 // SPI1_SCK - #define TOUCH_MISO_PIN PA6 // SPI1_MISO - #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + #define TOUCH_CS_PIN PE14 // SPI1_NSS + #define TOUCH_SCK_PIN PA5 // SPI1_SCK + #define TOUCH_MISO_PIN PA6 // SPI1_MISO + #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI - #define BTN_EN1 PE8 - #define BTN_EN2 PE11 - #define BEEPER_PIN PC5 - #define BTN_ENC PE13 + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 - #endif//HAS_SPI_LCD + #endif // HAS_SPI_LCD -#else - #if ENABLED(TFT_LITTLE_VGL_UI) - //FSMC LCD - #define FSMC_CS_PIN PD7 // NE4 - #define FSMC_RS_PIN PD11 // A0 +#elif ENABLED(TFT_LITTLE_VGL_UI) - #define TOUCH_CS_PIN PA7 // SPI2_NSS - #define TOUCH_SCK_PIN PB13 // SPI2_SCK - #define TOUCH_MISO_PIN PB14 // SPI2_MISO - #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI + #define FSMC_CS_PIN PD7 // NE4 + #define FSMC_RS_PIN PD11 // A0 + + #define TOUCH_CS_PIN PA7 // SPI2_NSS + #define TOUCH_SCK_PIN PB13 // SPI2_SCK + #define TOUCH_MISO_PIN PB14 // SPI2_MISO + #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI - #define LCD_BACKLIGHT_PIN PD13 - - #endif //TFT_LITTLE_VGL_UI + #define LCD_BACKLIGHT_PIN PD13 -#endif// SPI_GRAPHICAL_TFT +#elif ENABLED(FSMC_GRAPHICAL_TFT) -#if ENABLED(FSMC_GRAPHICAL_TFT) #define FSMC_CS_PIN PD7 // NE4 #define FSMC_RS_PIN PD11 // A0 @@ -245,13 +241,13 @@ #define TOUCH_MISO_PIN PB14 // SPI2_MISO #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI #endif + #endif #define SPI_FLASH #if ENABLED(SPI_FLASH) - #define W25QXX_CS_PIN PB12 - #define W25QXX_MOSI_PIN PB15 - #define W25QXX_MISO_PIN PB14 - #define W25QXX_SCK_PIN PB13 + #define W25QXX_CS_PIN PB12 + #define W25QXX_MOSI_PIN PB15 + #define W25QXX_MISO_PIN PB14 + #define W25QXX_SCK_PIN PB13 #endif - From 78df7d38411e7af398b607470e881c11be5ac237 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 1 Jun 2020 18:52:24 -0500 Subject: [PATCH 05/18] Update MarlinCore.cpp --- Marlin/src/MarlinCore.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index c83c5419fa3c..0179634a6bac 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1152,7 +1152,7 @@ void setup() { #endif #if ENABLED(TFT_LITTLE_VGL_UI) - tft_lvgl_init(); + SETUP_RUN(tft_lvgl_init()); #endif marlin_state = MF_RUNNING; @@ -1187,9 +1187,7 @@ void loop() { endstops.event_handler(); - #if ENABLED(TFT_LITTLE_VGL_UI) - printer_state_polling(); - #endif + TERN_(TFT_LITTLE_VGL_UI, printer_state_polling()); } while (ENABLED(__AVR__)); // Loop forever on slower (AVR) boards } From 180470a42417d832184f6e8e3515a0e63e43c886 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 1 Jun 2020 18:59:53 -0500 Subject: [PATCH 06/18] Clean, clean, clean --- .../extui/lib/mks_ui/draw_change_speed.cpp | 220 ++++++++---------- 1 file changed, 97 insertions(+), 123 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp index 08c5bcac8122..31a620df9457 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp @@ -23,15 +23,14 @@ #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../../../../MarlinCore.h" - #include "lv_conf.h" +#include "draw_ui.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "draw_ui.h" +#include "../../../../MarlinCore.h" #include "../../../../module/temperature.h" #include "../../../../module/planner.h" @@ -53,125 +52,105 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_C_ADD: if (event == LV_EVENT_CLICKED) { - - } else if (event == LV_EVENT_RELEASED) { if (speedType == 0) { - if (feedrate_percentage < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) { - feedrate_percentage += uiCfg.stepPrintSpeed; - - } - else { - feedrate_percentage = MAX_EXT_SPEED_PERCENT; - } - } - else if (speedType == 1) { - if (planner.flow_percentage[0]< MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) { - planner.flow_percentage[0] += uiCfg.stepPrintSpeed; - - } - else { - planner.flow_percentage[0] = MAX_EXT_SPEED_PERCENT; + if (feedrate_percentage < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) { + feedrate_percentage += uiCfg.stepPrintSpeed; + } + else { + feedrate_percentage = MAX_EXT_SPEED_PERCENT; + } } - //planner.e_factor[0]= planner.flow_percentage[0]*0.01; - //planner.flow_percentage[1] = planner.flow_percentage[0]; - //planner.e_factor[1]= planner.flow_percentage[1]*0.01; - planner.refresh_e_factor(0); - if (EXTRUDERS == 2) { - planner.flow_percentage[1] = planner.flow_percentage[0]; - planner.refresh_e_factor(1); + else if (speedType == 1) { + if (planner.flow_percentage[0]< MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) { + planner.flow_percentage[0] += uiCfg.stepPrintSpeed; + } + else { + planner.flow_percentage[0] = MAX_EXT_SPEED_PERCENT; + } + //planner.e_factor[0]= planner.flow_percentage[0]*0.01; + //planner.flow_percentage[1] = planner.flow_percentage[0]; + //planner.e_factor[1]= planner.flow_percentage[1]*0.01; + planner.refresh_e_factor(0); + if (EXTRUDERS == 2) { + planner.flow_percentage[1] = planner.flow_percentage[0]; + planner.refresh_e_factor(1); + } } + disp_print_speed(); } - disp_print_speed(); - } - break; - case ID_C_DEC: - if (event == LV_EVENT_CLICKED) { - + break; + case ID_C_DEC: + if (event == LV_EVENT_CLICKED) { } else if (event == LV_EVENT_RELEASED) { - if (speedType == 0) { - if (feedrate_percentage > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) { - feedrate_percentage -= uiCfg.stepPrintSpeed; - } - else { - feedrate_percentage = MIN_EXT_SPEED_PERCENT; - } - } - else if (speedType == 1) { - if (planner.flow_percentage[0] > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) { - planner.flow_percentage[0] -= uiCfg.stepPrintSpeed; - } - else { - planner.flow_percentage[0] = MIN_EXT_SPEED_PERCENT; + if (speedType == 0) { + if (feedrate_percentage > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) + feedrate_percentage -= uiCfg.stepPrintSpeed; + else + feedrate_percentage = MIN_EXT_SPEED_PERCENT; } - //planner.e_factor[0]= planner.flow_percentage[0]*0.01; - //planner.flow_percentage[1] = planner.flow_percentage[0]; - //planner.e_factor[1]= planner.flow_percentage[1]*0.01; - planner.refresh_e_factor(0); - if (EXTRUDERS == 2) { - planner.flow_percentage[1] = planner.flow_percentage[0]; - planner.refresh_e_factor(1); + else if (speedType == 1) { + if (planner.flow_percentage[0] > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) + planner.flow_percentage[0] -= uiCfg.stepPrintSpeed; + else + planner.flow_percentage[0] = MIN_EXT_SPEED_PERCENT; + //planner.e_factor[0]= planner.flow_percentage[0] * 0.01; + //planner.flow_percentage[1] = planner.flow_percentage[0]; + //planner.e_factor[1]= planner.flow_percentage[1] * 0.01; + planner.refresh_e_factor(0); + if (EXTRUDERS == 2) { + planner.flow_percentage[1] = planner.flow_percentage[0]; + planner.refresh_e_factor(1); + } } + disp_print_speed(); } - disp_print_speed(); - } - - break; - case ID_C_MOVE: - if (event == LV_EVENT_CLICKED) { - - + break; + case ID_C_MOVE: + if (event == LV_EVENT_CLICKED) { } else if (event == LV_EVENT_RELEASED) { - speedType = 0; - disp_speed_type(); - disp_print_speed(); + speedType = 0; + disp_speed_type(); + disp_print_speed(); } - break; - case ID_C_EXT: - if (event == LV_EVENT_CLICKED) { - - + break; + case ID_C_EXT: + if (event == LV_EVENT_CLICKED) { } else if (event == LV_EVENT_RELEASED) { - speedType = 1; - disp_speed_type(); - disp_print_speed(); + speedType = 1; + disp_speed_type(); + disp_print_speed(); } - break; - case ID_C_STEP: - if (event == LV_EVENT_CLICKED) { + break; + case ID_C_STEP: + if (event == LV_EVENT_CLICKED) { } else if (event == LV_EVENT_RELEASED) { - if (uiCfg.stepPrintSpeed == 1) { - uiCfg.stepPrintSpeed = 5; - } - else if (uiCfg.stepPrintSpeed == 5) { - uiCfg.stepPrintSpeed = 10; + if (uiCfg.stepPrintSpeed == 1) + uiCfg.stepPrintSpeed = 5; + else if (uiCfg.stepPrintSpeed == 5) + uiCfg.stepPrintSpeed = 10; + else + uiCfg.stepPrintSpeed = 1; + disp_speed_step(); } - else { - uiCfg.stepPrintSpeed = 1; - } - disp_speed_step(); - } - break; - case ID_C_RETURN: + break; + case ID_C_RETURN: if (event == LV_EVENT_CLICKED) { - } else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); + clear_cur_ui(); + draw_return_ui(); } - break; - + break; } } - void lv_draw_change_speed(void) { lv_obj_t *buttonAdd,*buttonDec; lv_obj_t *buttonBack; @@ -197,8 +176,8 @@ void lv_draw_change_speed(void) { LV_IMG_DECLARE(bmp_pic); - /*Create an Image button*/ - buttonAdd = lv_imgbtn_create(scr, NULL); + /*Create an Image button*/ + buttonAdd = lv_imgbtn_create(scr, NULL); buttonDec = lv_imgbtn_create(scr, NULL); buttonMov = lv_imgbtn_create(scr, NULL); buttonExt = lv_imgbtn_create(scr, NULL); @@ -211,36 +190,35 @@ void lv_draw_change_speed(void) { lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); + #if 1 - lv_obj_set_event_cb_mks(buttonDec, event_handler,ID_C_DEC,"bmp_Dec.bin",0); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_set_event_cb_mks(buttonDec, event_handler,ID_C_DEC,"bmp_Dec.bin",0); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_REL, &tft_style_lable_rel); - - + lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_C_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_C_RETURN,"bmp_Return.bin",0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif @@ -251,7 +229,7 @@ void lv_draw_change_speed(void) { lv_obj_set_pos(buttonStep,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - /*Create a label on the Image button*/ + /*Create a label on the Image button*/ lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); lv_btn_set_layout(buttonMov, LV_LAYOUT_OFF); @@ -259,16 +237,15 @@ void lv_draw_change_speed(void) { lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); labelMov = lv_label_create(buttonMov, NULL); labelExt = lv_label_create(buttonExt, NULL); labelStep = lv_label_create(buttonStep, NULL); lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - if (gCfgItems.multiple_language !=0) { - lv_label_set_text(labelAdd, speed_menu.add); + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelAdd, speed_menu.add); lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); lv_label_set_text(labelDec, speed_menu.dec); @@ -286,15 +263,12 @@ void lv_draw_change_speed(void) { } void disp_speed_step() { - if (uiCfg.stepPrintSpeed == 1) { + if (uiCfg.stepPrintSpeed == 1) lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step1_percent.bin",0); - } - else if (uiCfg.stepPrintSpeed == 5) { + else if (uiCfg.stepPrintSpeed == 5) lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step5_percent.bin",0); - } - else if (uiCfg.stepPrintSpeed == 10) { + else if (uiCfg.stepPrintSpeed == 10) lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step10_percent.bin",0); - } if (gCfgItems.multiple_language != 0) { if (uiCfg.stepPrintSpeed == 1) { From 20dd574ec9d7345c9718290904656cec15beba8e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 1 Jun 2020 19:01:32 -0500 Subject: [PATCH 07/18] Update draw_dialog.cpp --- Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp index a1fb5dbefb50..443427a5ae7f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -23,14 +23,14 @@ #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../../../../MarlinCore.h" - #include "lv_conf.h" +#include "draw_ui.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "draw_ui.h" + +#include "../../../../MarlinCore.h" #include "../../../../sd/cardreader.h" #include "../../../../gcode/queue.h" #include "../../../../module/temperature.h" @@ -39,6 +39,7 @@ #if ENABLED(POWER_LOSS_RECOVERY) #include "../../../../feature/powerloss.h" #endif + #if ENABLED(PARK_HEAD_ON_PAUSE) #include "../../../../feature/pause.h" #endif @@ -198,7 +199,6 @@ void lv_draw_dialog(uint8_t type) { style_btn_rel.text.color = lv_color_hex3(0xDEF); style_btn_rel.text.font = &gb2312_puhui32; - static lv_style_t style_btn_pr; /*A variable to store the pressed style*/ lv_style_copy(&style_btn_pr, &style_btn_rel); /*Initialize from the released style*/ style_btn_pr.body.border.color = lv_color_hex3(0x46B); @@ -211,7 +211,6 @@ void lv_draw_dialog(uint8_t type) { lv_obj_t * labelDialog = lv_label_create(scr, NULL); lv_obj_set_style(labelDialog, &tft_style_lable_rel); - if (DialogType == DIALOG_TYPE_FINISH_PRINT || DialogType == DIALOG_PAUSE_MESSAGE_RESUME) { lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ lv_obj_set_pos(btnOk, BTN_OK_X+90, BTN_OK_Y); /*Set its position*/ @@ -221,7 +220,6 @@ void lv_draw_dialog(uint8_t type) { lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ - } else if (DialogType == DIALOG_PAUSE_MESSAGE_WAITING ||DialogType == DIALOG_PAUSE_MESSAGE_INSERT @@ -332,7 +330,6 @@ void lv_draw_dialog(uint8_t type) { lv_label_set_text(labelDialog, pause_msg_menu.option); lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); } - } void lv_clear_dialog() { From 4adc9c9f699f0eca748af221f2d1a7264b9dc13b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 1 Jun 2020 19:07:24 -0500 Subject: [PATCH 08/18] Update mks_hardware_test.cpp --- Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp index 2965a6b96bf0..455f11450824 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp @@ -23,17 +23,16 @@ #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../../../../MarlinCore.h" - #include "tft_lvgl_configuration.h" #include "lvgl.h" -#include "../../../../feature/touch/xpt2046.h" #include "draw_ready_print.h" #include "W25Qxx.h" #include "pic_manager.h" - #include "mks_hardware_test.h" + +#include "../../../../MarlinCore.h" #include "../../../../module/temperature.h" +#include "../../../../feature/touch/xpt2046.h" #if ENABLED(MKS_TEST) @@ -120,7 +119,7 @@ test_gpio_readlevel_L(); test_gpio_readlevel_H(); test_gpio_readlevel_L(); - if ((pw_det_sta == 1)&&(mt_det_sta == 1)&&(mt_det2_sta == 1)&&(mt_det3_sta == 1)) { + if ((pw_det_sta == 1) && (mt_det_sta == 1) && (mt_det2_sta == 1) && (mt_det3_sta == 1)) { if (curent_disp_ui == 1) disp_det_ok(); } else { @@ -217,7 +216,7 @@ static const uint16_t ASCII_Table_16x24[] PROGMEM = { 0x0000, 0x01E0, 0x03F0, 0x0738, 0x0618, 0x0618, 0x0330, 0x01F0, 0x00F0, 0x00F8, 0x319C, 0x330E, 0x1E06, 0x1C06, 0x1C06, 0x3F06, 0x73FC, 0x21F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - // ''' + // "'" 0x0000, 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, From eca68345697628217509c26dd209c3dac1fc9714 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 1 Jun 2020 19:12:59 -0500 Subject: [PATCH 09/18] Apply FastIO --- .../extui/lib/mks_ui/mks_hardware_test.cpp | 145 +++++++++--------- 1 file changed, 71 insertions(+), 74 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp index 455f11450824..50af31a5f1d5 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp @@ -42,74 +42,74 @@ uint8_t endstopx1_sta, endstopx2_sta, endstopy1_sta, endstopy2_sta, endstopz1_sta, endstopz2_sta; void test_gpio_readlevel_L() { volatile uint32_t itest; - digitalWrite(WIFI_IO2_PIN, HIGH); + WRITE(WIFI_IO2_PIN, HIGH); itest = 10000; while (itest--); - pw_det_sta = (digitalRead(POWER_LOSS_PIN) == 0); - pw_off_sta = (digitalRead(PS_ON_PIN) == 0); - mt_det_sta = (digitalRead(FIL_RUNOUT_PIN) == 0); - mt_det2_sta = (digitalRead(FIL_RUNOUT_2_PIN) == 0); - mt_det3_sta = (digitalRead(FIL_RUNOUT_3_PIN) == 0); - endstopx1_sta = (digitalRead(X_MIN_PIN) == 0); - endstopx2_sta = (digitalRead(X_MAX_PIN) == 0); - endstopy1_sta = (digitalRead(Y_MIN_PIN) == 0); - endstopy2_sta = (digitalRead(Y_MAX_PIN) == 0); - endstopz1_sta = (digitalRead(Z_MIN_PIN) == 0); - endstopz2_sta = (digitalRead(Z_MAX_PIN) == 0); + pw_det_sta = (READ(POWER_LOSS_PIN) == 0); + pw_off_sta = (READ(PS_ON_PIN) == 0); + mt_det_sta = (READ(FIL_RUNOUT_PIN) == 0); + mt_det2_sta = (READ(FIL_RUNOUT_2_PIN) == 0); + mt_det3_sta = (READ(FIL_RUNOUT_3_PIN) == 0); + endstopx1_sta = (READ(X_MIN_PIN) == 0); + endstopx2_sta = (READ(X_MAX_PIN) == 0); + endstopy1_sta = (READ(Y_MIN_PIN) == 0); + endstopy2_sta = (READ(Y_MAX_PIN) == 0); + endstopz1_sta = (READ(Z_MIN_PIN) == 0); + endstopz2_sta = (READ(Z_MAX_PIN) == 0); } void test_gpio_readlevel_H() { volatile uint32_t itest; - digitalWrite(WIFI_IO2_PIN, LOW); + WRITE(WIFI_IO2_PIN, LOW); itest = 10000; while (itest--); - pw_det_sta = (digitalRead(POWER_LOSS_PIN) == 1); - pw_off_sta = (digitalRead(PS_ON_PIN) == 1); - mt_det_sta = (digitalRead(FIL_RUNOUT_PIN) == 1); - mt_det2_sta = (digitalRead(FIL_RUNOUT_2_PIN) == 1); - mt_det3_sta = (digitalRead(FIL_RUNOUT_3_PIN) == 1); - endstopx1_sta = (digitalRead(X_MIN_PIN) == 1); - endstopx2_sta = (digitalRead(X_MAX_PIN) == 1); - endstopy1_sta = (digitalRead(Y_MIN_PIN) == 1); - endstopy2_sta = (digitalRead(Y_MAX_PIN) == 1); - endstopz1_sta = (digitalRead(Z_MIN_PIN) == 1); - endstopz2_sta = (digitalRead(Z_MAX_PIN) == 1); + pw_det_sta = (READ(POWER_LOSS_PIN) == 1); + pw_off_sta = (READ(PS_ON_PIN) == 1); + mt_det_sta = (READ(FIL_RUNOUT_PIN) == 1); + mt_det2_sta = (READ(FIL_RUNOUT_2_PIN) == 1); + mt_det3_sta = (READ(FIL_RUNOUT_3_PIN) == 1); + endstopx1_sta = (READ(X_MIN_PIN) == 1); + endstopx2_sta = (READ(X_MAX_PIN) == 1); + endstopy1_sta = (READ(Y_MIN_PIN) == 1); + endstopy2_sta = (READ(Y_MAX_PIN) == 1); + endstopz1_sta = (READ(Z_MIN_PIN) == 1); + endstopz2_sta = (READ(Z_MAX_PIN) == 1); } void init_Tst_GPIO() { - pinMode(X_MIN_PIN, INPUT_PULLUP); - pinMode(X_MAX_PIN, INPUT_PULLUP); - pinMode(Y_MIN_PIN, INPUT_PULLUP); - pinMode(Y_MAX_PIN, INPUT_PULLUP); - pinMode(Z_MIN_PIN, INPUT_PULLUP); - pinMode(Z_MAX_PIN, INPUT_PULLUP); + SET_INPUT_PULLUP(X_MIN_PIN); + SET_INPUT_PULLUP(X_MAX_PIN); + SET_INPUT_PULLUP(Y_MIN_PIN); + SET_INPUT_PULLUP(Y_MAX_PIN); + SET_INPUT_PULLUP(Z_MIN_PIN); + SET_INPUT_PULLUP(Z_MAX_PIN); - pinMode(WIFI_IO2_PIN, OUTPUT); + SET_OUTPUT(WIFI_IO2_PIN); - pinMode(FIL_RUNOUT_PIN, INPUT_PULLUP); - pinMode(FIL_RUNOUT_2_PIN, INPUT_PULLUP); - pinMode(FIL_RUNOUT_3_PIN, INPUT_PULLUP); + SET_INPUT_PULLUP(FIL_RUNOUT_PIN); + SET_INPUT_PULLUP(FIL_RUNOUT_2_PIN); + SET_INPUT_PULLUP(FIL_RUNOUT_3_PIN); - pinMode(POWER_LOSS_PIN, INPUT_PULLUP); - pinMode(PS_ON_PIN, INPUT_PULLUP); + SET_INPUT_PULLUP(POWER_LOSS_PIN); + SET_INPUT_PULLUP(PS_ON_PIN); - pinMode(SERVO0_PIN, INPUT_PULLUP); + SET_INPUT_PULLUP(SERVO0_PIN); - pinMode(E0_ENABLE_PIN, OUTPUT); - pinMode(X_ENABLE_PIN, OUTPUT); + SET_OUTPUT(E0_ENABLE_PIN); + SET_OUTPUT(X_ENABLE_PIN); - digitalWrite(X_ENABLE_PIN, LOW); - digitalWrite(Y_ENABLE_PIN, LOW); - digitalWrite(Z_ENABLE_PIN, LOW); - digitalWrite(E0_ENABLE_PIN, LOW); - digitalWrite(E1_ENABLE_PIN, LOW); - digitalWrite(E2_ENABLE_PIN, LOW); + WRITE(X_ENABLE_PIN, LOW); + WRITE(Y_ENABLE_PIN, LOW); + WRITE(Z_ENABLE_PIN, LOW); + WRITE(E0_ENABLE_PIN, LOW); + WRITE(E1_ENABLE_PIN, LOW); + WRITE(E2_ENABLE_PIN, LOW); } void mks_test_beeper(){ - digitalWrite(BEEPER_PIN, HIGH); + WRITE(BEEPER_PIN, HIGH); delay(100); - digitalWrite(BEEPER_PIN, LOW); + WRITE(BEEPER_PIN, LOW); delay(100); } @@ -143,38 +143,35 @@ } void mks_test() { - if (millis() % 2000 <1000){ - digitalWrite(X_DIR_PIN, LOW); - digitalWrite(Y_DIR_PIN, LOW); - digitalWrite(Z_DIR_PIN, LOW); - digitalWrite(E0_DIR_PIN, LOW); - digitalWrite(E1_DIR_PIN, LOW); - digitalWrite(E2_DIR_PIN, LOW); + if (millis() % 2000 < 1000) { + WRITE(X_DIR_PIN, LOW); + WRITE(Y_DIR_PIN, LOW); + WRITE(Z_DIR_PIN, LOW); + WRITE(E0_DIR_PIN, LOW); + WRITE(E1_DIR_PIN, LOW); + WRITE(E2_DIR_PIN, LOW); thermalManager.fan_speed[0] = 255; - digitalWrite(HEATER_2_PIN, HIGH);//HE2 - digitalWrite(HEATER_1_PIN, HIGH);//HE1 - digitalWrite(HEATER_0_PIN, HIGH);//HE0 - digitalWrite(HEATER_BED_PIN, HIGH);//HOT-BED + WRITE(HEATER_2_PIN, HIGH); // HE2 + WRITE(HEATER_1_PIN, HIGH); // HE1 + WRITE(HEATER_0_PIN, HIGH); // HE0 + WRITE(HEATER_BED_PIN, HIGH); // HOT-BED } else { - digitalWrite(X_DIR_PIN, HIGH); - digitalWrite(Y_DIR_PIN, HIGH); - digitalWrite(Z_DIR_PIN, HIGH); - digitalWrite(E0_DIR_PIN, HIGH); - digitalWrite(E1_DIR_PIN, HIGH); - digitalWrite(E2_DIR_PIN, HIGH); + WRITE(X_DIR_PIN, HIGH); + WRITE(Y_DIR_PIN, HIGH); + WRITE(Z_DIR_PIN, HIGH); + WRITE(E0_DIR_PIN, HIGH); + WRITE(E1_DIR_PIN, HIGH); + WRITE(E2_DIR_PIN, HIGH); thermalManager.fan_speed[0] = 0; - digitalWrite(HEATER_2_PIN, LOW);//HE2 - digitalWrite(HEATER_1_PIN, LOW);//HE1 - digitalWrite(HEATER_0_PIN, LOW);//HE0 - digitalWrite(HEATER_BED_PIN, LOW);//HOT-BED + WRITE(HEATER_2_PIN, LOW); // HE2 + WRITE(HEATER_1_PIN, LOW); // HE1 + WRITE(HEATER_0_PIN, LOW); // HE0 + WRITE(HEATER_BED_PIN, LOW); // HOT-BED } - if ( (endstopx1_sta == 1) - && (endstopx2_sta == 1) - && (endstopy1_sta == 1) - && (endstopy2_sta == 1) - && (endstopz1_sta == 1) - && (endstopz2_sta == 1) + if ( (endstopx1_sta == 1) && (endstopx2_sta == 1) + && (endstopy1_sta == 1) && (endstopy2_sta == 1) + && (endstopz1_sta == 1) && (endstopz2_sta == 1) ) { } From 21af96bd7e32f899581e2638e236281e40f56ea8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 12 Jun 2020 15:19:11 -0500 Subject: [PATCH 10/18] Auto-format --- Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp | 357 +++++++++---------- 1 file changed, 169 insertions(+), 188 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp index ed01de600b16..3a0d14149b96 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp @@ -37,229 +37,210 @@ static lv_obj_t * scr; static lv_obj_t * fanText; -#define ID_F_ADD 1 -#define ID_F_DEC 2 -#define ID_F_HIGH 3 -#define ID_F_MID 4 -#define ID_F_OFF 5 -#define ID_F_RETURN 6 +#define ID_F_ADD 1 +#define ID_F_DEC 2 +#define ID_F_HIGH 3 +#define ID_F_MID 4 +#define ID_F_OFF 5 +#define ID_F_RETURN 6 static uint8_t fanSpeed; -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - switch (obj->mks_obj_id) - { - case ID_F_ADD: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - - if (fanSpeed + 1 <= 255) - { - fanSpeed++; - memset(public_buf_l,0,sizeof(public_buf_l)); - sprintf(public_buf_l, "M106 S%d",fanSpeed); - queue.enqueue_one_now(PSTR(public_buf_l)); - } - } - break; - case ID_F_DEC: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (fanSpeed > 0) - { - fanSpeed--; - memset(public_buf_l,0,sizeof(public_buf_l)); - sprintf(public_buf_l, "M106 S%d",fanSpeed); - queue.enqueue_one_now(PSTR(public_buf_l)); - } - } - - break; - case ID_F_HIGH: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - queue.enqueue_one_now(PSTR("M106 S255")); - } - break; - case ID_F_MID: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - queue.enqueue_one_now(PSTR("M106 S127")); - } - break; - case ID_F_OFF: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - queue.enqueue_one_now(PSTR("M107")); - } - break; - case ID_F_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } - break; - - } +static void event_handler(lv_obj_t * obj, lv_event_t event){ + switch (obj->mks_obj_id) { + case ID_F_ADD: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (fanSpeed + 1 <= 255) { + fanSpeed++; + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, "M106 S%d", fanSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + } + } + break; + case ID_F_DEC: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (fanSpeed > 0) { + fanSpeed--; + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, "M106 S%d", fanSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + } + } + + break; + case ID_F_HIGH: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + queue.enqueue_one_now(PSTR("M106 S255")); + } + break; + case ID_F_MID: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + queue.enqueue_one_now(PSTR("M106 S127")); + } + break; + case ID_F_OFF: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + queue.enqueue_one_now(PSTR("M107")); + } + break; + case ID_F_RETURN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + } } -void lv_draw_fan(void) -{ - lv_obj_t *buttonAdd,*buttonDec,*buttonHigh,*buttonMid; - lv_obj_t *buttonOff,*buttonBack; +void lv_draw_fan(void){ + lv_obj_t *buttonAdd, *buttonDec, *buttonHigh, *buttonMid; + lv_obj_t *buttonOff, *buttonBack; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != FAN_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = FAN_UI; - } - disp_state = FAN_UI; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != FAN_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = FAN_UI; + } + disp_state = FAN_UI; - scr = lv_obj_create(NULL, NULL); + scr = lv_obj_create(NULL, NULL); - lv_obj_set_style(scr, &tft_style_scr); + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - LV_IMG_DECLARE(bmp_pic); + LV_IMG_DECLARE(bmp_pic); - /*Create an Image button*/ - buttonAdd = lv_imgbtn_create(scr, NULL); - buttonDec = lv_imgbtn_create(scr, NULL); - buttonHigh = lv_imgbtn_create(scr, NULL); - buttonMid = lv_imgbtn_create(scr, NULL); - buttonOff = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); + /*Create an Image button*/ + buttonAdd = lv_imgbtn_create(scr, NULL); + buttonDec = lv_imgbtn_create(scr, NULL); + buttonHigh = lv_imgbtn_create(scr, NULL); + buttonMid = lv_imgbtn_create(scr, NULL); + buttonOff = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonAdd, event_handler,ID_F_ADD,"bmp_Add.bin",0); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); - #if 1 - lv_obj_set_event_cb_mks(buttonDec, event_handler,ID_F_DEC,"bmp_Dec.bin",0); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_set_event_cb_mks(buttonAdd, event_handler, ID_F_ADD, "bmp_Add.bin", 0); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonDec, event_handler, ID_F_DEC, "bmp_Dec.bin", 0); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonHigh, event_handler,ID_F_HIGH,"bmp_Speed255.bin",0); + lv_obj_set_event_cb_mks(buttonHigh, event_handler, ID_F_HIGH, "bmp_Speed255.bin", 0); lv_imgbtn_set_src(buttonHigh, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonHigh, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonHigh, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonHigh, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonHigh, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonHigh, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonMid, event_handler,ID_F_MID,"bmp_Speed127.bin",0); + lv_obj_set_event_cb_mks(buttonMid, event_handler, ID_F_MID, "bmp_Speed127.bin", 0); lv_imgbtn_set_src(buttonMid, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonMid, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonMid, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonMid, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonMid, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonMid, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonOff, event_handler,ID_F_OFF,"bmp_Speed0.bin",0); + lv_obj_set_event_cb_mks(buttonOff, event_handler, ID_F_OFF, "bmp_Speed0.bin", 0); lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_F_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_F_RETURN, "bmp_Return.bin", 0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - - #endif - - lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttonHigh,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonMid,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonOff,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - - /*Create a label on the Image button*/ - lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonHigh, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonMid, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonOff, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); - lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); - lv_obj_t * labelHigh = lv_label_create(buttonHigh, NULL); - lv_obj_t * labelMid = lv_label_create(buttonMid, NULL); - lv_obj_t * labelOff = lv_label_create(buttonOff, NULL); - lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - - if (gCfgItems.multiple_language !=0) - { - lv_label_set_text(labelAdd, fan_menu.add); - lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelDec, fan_menu.dec); - lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelHigh, fan_menu.full); - lv_obj_align(labelHigh, buttonHigh, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelMid, fan_menu.half); - lv_obj_align(labelMid, buttonMid, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelOff,fan_menu.off); - lv_obj_align(labelOff, buttonOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - - fanText = lv_label_create(scr, NULL); - lv_obj_set_style(fanText, &tft_style_lable_rel); - disp_fan_value(); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + + #endif + + lv_obj_set_pos(buttonAdd, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonDec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonHigh, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonMid, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonOff, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHigh, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonMid, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOff, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); + lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); + lv_obj_t * labelHigh = lv_label_create(buttonHigh, NULL); + lv_obj_t * labelMid = lv_label_create(buttonMid, NULL); + lv_obj_t * labelOff = lv_label_create(buttonOff, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelAdd, fan_menu.add); + lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelDec, fan_menu.dec); + lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHigh, fan_menu.full); + lv_obj_align(labelHigh, buttonHigh, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelMid, fan_menu.half); + lv_obj_align(labelMid, buttonMid, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelOff, fan_menu.off); + lv_obj_align(labelOff, buttonOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + + fanText = lv_label_create(scr, NULL); + lv_obj_set_style(fanText, &tft_style_lable_rel); + disp_fan_value(); } -void disp_fan_value() -{ - char buf1[10] = {0}; - public_buf_l[0] = '\0'; - strcat(public_buf_l, fan_menu.state); - strcat(public_buf_l, ": "); - sprintf(buf1, "%3d", thermalManager.fan_speed[0]); - strcat(public_buf_l, buf1); - lv_label_set_text(fanText, public_buf_l); - lv_obj_align(fanText, NULL, LV_ALIGN_CENTER,0, -65); +void disp_fan_value(){ + char buf1[10] = {0}; + public_buf_l[0] = '\0'; + strcat(public_buf_l, fan_menu.state); + strcat(public_buf_l, ": "); + sprintf(buf1, "%3d", thermalManager.fan_speed[0]); + strcat(public_buf_l, buf1); + lv_label_set_text(fanText, public_buf_l); + lv_obj_align(fanText, NULL, LV_ALIGN_CENTER, 0, -65); } -void lv_clear_fan() -{ - lv_obj_del(scr); +void lv_clear_fan(){ + lv_obj_del(scr); } + #endif From a372d6fca921e9e41219b8ba25f413fe54418f4b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 12 Jun 2020 16:30:42 -0500 Subject: [PATCH 11/18] Apply some formatting --- Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h | 4 +- Marlin/src/lcd/extui/lib/mks_ui/draw_about.h | 4 +- .../lcd/extui/lib/mks_ui/draw_change_speed.h | 4 +- Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h | 4 +- .../lcd/extui/lib/mks_ui/draw_error_message.h | 4 +- .../src/lcd/extui/lib/mks_ui/draw_extrusion.h | 4 +- Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp | 5 +- Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h | 4 +- Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp | 425 +++++++++--------- Marlin/src/lcd/extui/lib/mks_ui/draw_home.h | 4 +- .../src/lcd/extui/lib/mks_ui/draw_language.h | 4 +- .../lcd/extui/lib/mks_ui/draw_manuaLevel.h | 4 +- .../lcd/extui/lib/mks_ui/draw_move_motor.h | 4 +- .../src/lcd/extui/lib/mks_ui/draw_opration.h | 4 +- .../lcd/extui/lib/mks_ui/draw_pause_message.h | 4 +- .../src/lcd/extui/lib/mks_ui/draw_preHeat.h | 4 +- .../lcd/extui/lib/mks_ui/draw_print_file.h | 4 +- .../src/lcd/extui/lib/mks_ui/draw_printing.h | 4 +- .../lcd/extui/lib/mks_ui/draw_ready_print.h | 4 +- Marlin/src/lcd/extui/lib/mks_ui/draw_set.h | 4 +- Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h | 4 +- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 4 +- Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h | 4 +- .../lcd/extui/lib/mks_ui/printer_opration.h | 4 +- Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h | 4 +- 25 files changed, 255 insertions(+), 267 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h b/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h index 297a5c7c77fd..52696393f8a6 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h @@ -21,7 +21,7 @@ */ #pragma once -//#if defined(__cplusplus) +//#ifdef __cplusplus //extern "C" { /* C-declarations for C++ */ //#endif @@ -122,6 +122,6 @@ extern ext_FLASH W25QXX; //extern uint32_t lv_get_pic_addr(uint8_t *Pname); -//#if defined(__cplusplus) +//#ifdef __cplusplus //} /* C-declarations for C++ */ //#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h index fa951716603f..5904a8a2e97e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -29,6 +29,6 @@ extern void lv_draw_about(void); extern void lv_clear_about(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h index 94db796ec836..14d2b7cdf4b8 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -35,6 +35,6 @@ extern void disp_print_speed(); extern void disp_speed_type(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h index 3ff6aa6db587..894675b9c058 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -74,6 +74,6 @@ extern void lv_draw_dialog(uint8_t type); extern void lv_clear_dialog(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h index 35ac24df0170..53071f9048d1 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -29,6 +29,6 @@ extern void lv_draw_error_message(PGM_P const msg); extern void lv_clear_error_message(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h index e9aeaacd8b41..7ebf32b66cf3 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -34,6 +34,6 @@ extern void disp_hotend_temp(); extern void disp_extru_amount(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp index 3a0d14149b96..85ff3580cfc1 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp @@ -131,8 +131,6 @@ void lv_draw_fan(void){ LV_IMG_DECLARE(bmp_pic); - - /*Create an Image button*/ buttonAdd = lv_imgbtn_create(scr, NULL); buttonDec = lv_imgbtn_create(scr, NULL); @@ -177,7 +175,6 @@ void lv_draw_fan(void){ lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - #endif lv_obj_set_pos(buttonAdd, INTERVAL_V, titleHeight); @@ -243,4 +240,4 @@ void lv_clear_fan(){ lv_obj_del(scr); } -#endif +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h index 86a04ca724e5..6ad2024e9f57 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -30,6 +30,6 @@ extern void lv_clear_fan(); extern void disp_fan_value(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp index 792c1afe9c37..e3d35789fda0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp @@ -36,257 +36,248 @@ static lv_obj_t * scr; -#define ID_H_ALL 1 -#define ID_H_X 2 -#define ID_H_Y 3 -#define ID_H_Z 4 -#define ID_H_RETURN 5 -#define ID_H_OFF_ALL 6 -#define ID_H_OFF_XY 7 - -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - switch (obj->mks_obj_id) - { - case ID_H_ALL: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - queue.inject_P(PSTR("G28")); - } - break; - case ID_H_X: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - queue.inject_P(PSTR("G28 X0")); - } - break; - case ID_H_Y: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - queue.inject_P(PSTR("G28 Y0")); - } - break; - case ID_H_Z: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - queue.inject_P(PSTR("G28 Z0")); - } - break; - case ID_H_OFF_ALL: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - queue.inject_P(PSTR("M84")); - } - break; - case ID_H_OFF_XY: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - queue.inject_P(PSTR("M84 X Y")); - } - break; - case ID_H_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_obj_del(scr); - lv_draw_tool(); - } - break; - - } +#define ID_H_ALL 1 +#define ID_H_X 2 +#define ID_H_Y 3 +#define ID_H_Z 4 +#define ID_H_RETURN 5 +#define ID_H_OFF_ALL 6 +#define ID_H_OFF_XY 7 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_H_ALL: + if (event == LV_EVENT_CLICKED) { + + + } + else if (event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("G28")); + } + break; + case ID_H_X: + if (event == LV_EVENT_CLICKED) { + + + } + else if (event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("G28 X0")); + } + break; + case ID_H_Y: + if (event == LV_EVENT_CLICKED) { + + + } + else if (event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("G28 Y0")); + } + break; + case ID_H_Z: + if (event == LV_EVENT_CLICKED) { + + + } + else if (event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("G28 Z0")); + } + break; + case ID_H_OFF_ALL: + if (event == LV_EVENT_CLICKED) { + + + } + else if (event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("M84")); + } + break; + case ID_H_OFF_XY: + if (event == LV_EVENT_CLICKED) { + + + } + else if (event == LV_EVENT_RELEASED) { + queue.inject_P(PSTR("M84 X Y")); + } + break; + case ID_H_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_tool(); + } + break; + + } } -void lv_draw_home(void) -{ - lv_obj_t *buttonHomeAll,*buttonHomeX,*buttonHomeY,*buttonHomeZ; - lv_obj_t *buttonBack; - lv_obj_t *buttonOffAll,*buttonOffXY; +void lv_draw_home(void) { + lv_obj_t *buttonHomeAll, *buttonHomeX, *buttonHomeY, *buttonHomeZ; + lv_obj_t *buttonBack; + lv_obj_t *buttonOffAll, *buttonOffXY; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ZERO_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = ZERO_UI; - } - disp_state = ZERO_UI; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ZERO_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = ZERO_UI; + } + disp_state = ZERO_UI; - scr = lv_obj_create(NULL, NULL); + scr = lv_obj_create(NULL, NULL); - //static lv_style_t tool_style; + //static lv_style_t tool_style; - lv_obj_set_style(scr, &tft_style_scr); + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - LV_IMG_DECLARE(bmp_pic); - - /*Create an Image button*/ - //buttonWifi = lv_imgbtn_create(scr, NULL); - buttonHomeAll = lv_imgbtn_create(scr, NULL); - buttonHomeX = lv_imgbtn_create(scr, NULL); - //buttonContinue = lv_imgbtn_create(scr, NULL); - buttonHomeY = lv_imgbtn_create(scr, NULL); - buttonHomeZ = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - buttonOffAll = lv_imgbtn_create(scr, NULL); - buttonOffXY = lv_imgbtn_create(scr, NULL); - - //lv_obj_set_event_cb_mks(buttonWifi, event_handler,ID_S_WIFI,"bmp_Wifi.bin",0); - //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_REL, &bmp_pic); - //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_PR, &bmp_pic); - //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_PR, &tft_style_lable_pre); - //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_REL, &tft_style_lable_rel); - //lv_obj_clear_protect(buttonWifi, LV_PROTECT_FOLLOW); - #if 1 - lv_obj_set_event_cb_mks(buttonHomeAll, event_handler,ID_H_ALL,"bmp_Zero.bin",0); - lv_imgbtn_set_src(buttonHomeAll, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonHomeAll, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonHomeAll, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonHomeAll, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonHomeX, event_handler,ID_H_X,"bmp_zeroX.bin",0); + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + //buttonWifi = lv_imgbtn_create(scr, NULL); + buttonHomeAll = lv_imgbtn_create(scr, NULL); + buttonHomeX = lv_imgbtn_create(scr, NULL); + //buttonContinue = lv_imgbtn_create(scr, NULL); + buttonHomeY = lv_imgbtn_create(scr, NULL); + buttonHomeZ = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + buttonOffAll = lv_imgbtn_create(scr, NULL); + buttonOffXY = lv_imgbtn_create(scr, NULL); + + //lv_obj_set_event_cb_mks(buttonWifi, event_handler,ID_S_WIFI,"bmp_Wifi.bin",0); + //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_PR, &tft_style_lable_pre); + //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_REL, &tft_style_lable_rel); + //lv_obj_clear_protect(buttonWifi, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonHomeAll, event_handler, ID_H_ALL, "bmp_Zero.bin", 0); + lv_imgbtn_set_src(buttonHomeAll, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonHomeAll, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonHomeAll, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonHomeAll, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonHomeX, event_handler, ID_H_X, "bmp_zeroX.bin", 0); lv_imgbtn_set_src(buttonHomeX, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonHomeX, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonHomeX, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonHomeX, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonHomeX, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonHomeX, LV_BTN_STATE_REL, &tft_style_lable_rel); - //lv_obj_set_event_cb_mks(buttonContinue, event_handler,ID_S_CONTINUE,"bmp_Breakpoint.bin",0); + //lv_obj_set_event_cb_mks(buttonContinue, event_handler,ID_S_CONTINUE,"bmp_Breakpoint.bin",0); //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_REL, &bmp_pic); //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_PR, &bmp_pic); - //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_PR, &tft_style_lable_pre); - //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_REL, &tft_style_lable_rel); + //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_PR, &tft_style_lable_pre); + //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonHomeY, event_handler,ID_H_Y,"bmp_zeroY.bin",0); + lv_obj_set_event_cb_mks(buttonHomeY, event_handler, ID_H_Y, "bmp_zeroY.bin", 0); lv_imgbtn_set_src(buttonHomeY, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonHomeY, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonHomeY, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonHomeY, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonHomeY, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonHomeY, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonHomeZ, event_handler,ID_H_Z,"bmp_zeroZ.bin",0); + lv_obj_set_event_cb_mks(buttonHomeZ, event_handler, ID_H_Z, "bmp_zeroZ.bin", 0); lv_imgbtn_set_src(buttonHomeZ, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonHomeZ, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonHomeZ, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonHomeZ, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonHomeZ, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonHomeZ, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonOffAll, event_handler,ID_H_OFF_ALL,"bmp_Motor_off.bin",0); + lv_obj_set_event_cb_mks(buttonOffAll, event_handler, ID_H_OFF_ALL, "bmp_Motor_off.bin", 0); lv_imgbtn_set_src(buttonOffAll, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonOffAll, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonOffAll, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonOffAll, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonOffAll, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonOffAll, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonOffXY, event_handler,ID_H_OFF_XY,"bmp_Motor_off.bin",0); + lv_obj_set_event_cb_mks(buttonOffXY, event_handler, ID_H_OFF_XY, "bmp_Motor_off.bin", 0); lv_imgbtn_set_src(buttonOffXY, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonOffXY, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonOffXY, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonOffXY, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonOffXY, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonOffXY, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_H_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_H_RETURN, "bmp_Return.bin", 0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - - #endif - /*lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonFan,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); - lv_obj_set_pos(buttonAbout,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); - lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buMotorOff,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonLanguage,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight);*/ - - //lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonHomeX,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); - lv_obj_set_pos(buttonHomeY,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); - //lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttonHomeZ,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttonHomeAll,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonOffAll,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonOffXY,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - - /*Create a label on the Image button*/ - //lv_btn_set_layout(buttonWifi, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonHomeAll, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonHomeX, LV_LAYOUT_OFF); - //lv_btn_set_layout(buttonContinue, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonHomeY, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonHomeZ, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonOffAll, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonOffXY, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - //lv_obj_t * labelWifi= lv_label_create(buttonWifi, NULL); - lv_obj_t * labelHomeAll = lv_label_create(buttonHomeAll, NULL); - lv_obj_t * labelHomeX= lv_label_create(buttonHomeX, NULL); - //lv_obj_t * label_Continue = lv_label_create(buttonContinue, NULL); - lv_obj_t * labelHomeY = lv_label_create(buttonHomeY, NULL); - lv_obj_t * labelHomeZ = lv_label_create(buttonHomeZ, NULL); - lv_obj_t * labelOffAll = lv_label_create(buttonOffAll, NULL); - lv_obj_t * labelOffXY = lv_label_create(buttonOffXY, NULL); - lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - - if (gCfgItems.multiple_language !=0) - { - //lv_label_set_text(labelWifi, set_menu.wifi); - //lv_obj_align(labelWifi, buttonWifi, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelHomeAll, home_menu.home_all); - lv_obj_align(labelHomeAll, buttonHomeAll, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelHomeX,home_menu.home_x); - lv_obj_align(labelHomeX, buttonHomeX, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - //lv_label_set_text(label_Continue, set_menu.breakpoint); - //lv_obj_align(label_Continue, buttonContinue, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelHomeY, home_menu.home_y); - lv_obj_align(labelHomeY, buttonHomeY, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelHomeZ, home_menu.home_z); - lv_obj_align(labelHomeZ, buttonHomeZ, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelOffAll, set_menu.motoroff); - lv_obj_align(labelOffAll, buttonOffAll, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelOffXY, set_menu.motoroffXY); - lv_obj_align(labelOffXY, buttonOffXY, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif // if 1 + /*lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonFan,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); + lv_obj_set_pos(buttonAbout,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); + lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buMotorOff,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonLanguage,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight);*/ + + //lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonHomeX, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); + lv_obj_set_pos(buttonHomeY, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); + //lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buttonHomeZ, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonHomeAll, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonOffAll, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonOffXY, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + //lv_btn_set_layout(buttonWifi, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHomeAll, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHomeX, LV_LAYOUT_OFF); + //lv_btn_set_layout(buttonContinue, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHomeY, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonHomeZ, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOffAll, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOffXY, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + //lv_obj_t * labelWifi= lv_label_create(buttonWifi, NULL); + lv_obj_t * labelHomeAll = lv_label_create(buttonHomeAll, NULL); + lv_obj_t * labelHomeX = lv_label_create(buttonHomeX, NULL); + //lv_obj_t * label_Continue = lv_label_create(buttonContinue, NULL); + lv_obj_t * labelHomeY = lv_label_create(buttonHomeY, NULL); + lv_obj_t * labelHomeZ = lv_label_create(buttonHomeZ, NULL); + lv_obj_t * labelOffAll = lv_label_create(buttonOffAll, NULL); + lv_obj_t * labelOffXY = lv_label_create(buttonOffXY, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if (gCfgItems.multiple_language != 0) { + //lv_label_set_text(labelWifi, set_menu.wifi); + //lv_obj_align(labelWifi, buttonWifi, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHomeAll, home_menu.home_all); + lv_obj_align(labelHomeAll, buttonHomeAll, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHomeX, home_menu.home_x); + lv_obj_align(labelHomeX, buttonHomeX, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_text(label_Continue, set_menu.breakpoint); + //lv_obj_align(label_Continue, buttonContinue, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHomeY, home_menu.home_y); + lv_obj_align(labelHomeY, buttonHomeY, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelHomeZ, home_menu.home_z); + lv_obj_align(labelHomeZ, buttonHomeZ, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelOffAll, set_menu.motoroff); + lv_obj_align(labelOffAll, buttonOffAll, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelOffXY, set_menu.motoroffXY); + lv_obj_align(labelOffXY, buttonOffXY, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } } -void lv_clear_home() -{ - lv_obj_del(scr); -} +void lv_clear_home() { lv_obj_del(scr); } -#endif +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h index 0fb1c3095af2..9fd373b8bdec 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -29,6 +29,6 @@ extern void lv_draw_home(void); extern void lv_clear_home(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h index 8ae91d1c0b70..4d967b4f069d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -29,6 +29,6 @@ extern void lv_draw_language(void); extern void lv_clear_language(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h index 4b1b304b140d..346e0bb3f7ff 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -29,6 +29,6 @@ extern void lv_draw_manualLevel(void); extern void lv_clear_manualLevel(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h index 67045a980b7b..407ff311e904 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -30,6 +30,6 @@ extern void lv_clear_move_motor(); extern void disp_move_dist(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.h index e1464a834c1a..27f21d4b4ccb 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -29,6 +29,6 @@ extern void lv_draw_opration(void); extern void lv_clear_opration(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h index 3088018e88b9..5b0d4aba6e3e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h @@ -21,13 +21,13 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif extern void lv_draw_pause_message(const PauseMessage msg); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h index 9d99e4f020f1..c042b70cf917 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -32,6 +32,6 @@ extern void disp_step_heat(); extern void disp_desire_temp(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h index 86935e073286..dbcd0d33f3a0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -60,6 +60,6 @@ extern int ascii2dec_test(char *ascii); extern void lv_clear_print_file(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h index 234fc72f4f24..1e0cc86eec70 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -47,6 +47,6 @@ extern void stop_print_time(); extern void setProBarRate(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h index d67f45a13e24..fbb3a00d78d0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -34,6 +34,6 @@ extern void disp_det_ok(); extern void lv_clear_ready_print(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h index 7a640142fd78..e2300e419245 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -29,6 +29,6 @@ extern void lv_draw_set(void); extern void lv_clear_set(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h index e96eea5fb0c2..b05b6fed1967 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -29,6 +29,6 @@ extern void lv_draw_tool(void); extern void lv_clear_tool(); //extern void disp_temp_ready_print(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h index 9ab04b447259..8ee047abd466 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -224,6 +224,6 @@ extern void print_time_count(); extern void LV_TASK_HANDLER(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h index 3546a71be081..1bb3221ad3dd 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -114,6 +114,6 @@ extern void spi_flash_read_test(); extern void default_view_Read(uint8_t *default_view_Rbuff,uint32_t default_view_Readsize); extern void flash_view_Read(uint8_t *flash_view_Rbuff,uint32_t flash_view_Readsize); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.h b/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.h index 693662841700..723518863455 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.h @@ -21,7 +21,7 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -31,6 +31,6 @@ extern void printer_state_polling(); extern void filament_pin_setup(); extern void filament_check(); -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h index 50e87b5acc68..13720d1bbf0b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.h @@ -21,10 +21,10 @@ */ #pragma once -#if defined(__cplusplus) +#ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif -#if defined(__cplusplus) +#ifdef __cplusplus } /* C-declarations for C++ */ #endif From ff7d0152769c5d6d7d69479d821801cf6d8324eb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 12 Jun 2020 17:05:48 -0500 Subject: [PATCH 12/18] More one-liner options --- buildroot/share/extras/uncrustify.cfg | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/buildroot/share/extras/uncrustify.cfg b/buildroot/share/extras/uncrustify.cfg index 836d8c7845e9..3f657e34f1fd 100644 --- a/buildroot/share/extras/uncrustify.cfg +++ b/buildroot/share/extras/uncrustify.cfg @@ -260,6 +260,23 @@ nl_squeeze_ifdef = true # Newline adding and removing options # +# Whether to remove a newline in simple unbraced if statements, turning them +# into one-liners, as in 'if(b)\n i++;' => 'if(b) i++;'. +nl_create_if_one_liner = true + +# Whether to remove a newline in simple unbraced for statements, turning them +# into one-liners, as in 'for (...)\n stmt;' => 'for (...) stmt;'. +nl_create_for_one_liner = true + +# Whether to remove a newline in simple unbraced while statements, turning +# them into one-liners, as in 'while (expr)\n stmt;' => 'while (expr) stmt;'. +nl_create_while_one_liner = true + +# Whether to collapse a function definition whose body (not counting braces) +# is only one line so that the entire definition (prototype, braces, body) is +# a single line. +nl_create_list_one_liner = true + # Don't split one-line braced assignments, as in 'foo_t f = { 1, 2 };'. nl_assign_leave_one_liners = true @@ -291,6 +308,10 @@ nl_while_leave_one_liners = true # Don't split one-line for statements, as in 'for(...) b++;'. nl_for_leave_one_liners = true +# +# Indentation +# + # Whether to indent the body of a C++11 lambda. indent_cpp_lambda_body = true From ffa822e3853b408092b6c8ab9c505bccaa881db6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 13 Jun 2020 16:45:58 -0500 Subject: [PATCH 13/18] Apply formatting --- Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp | 413 ++- Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h | 26 +- Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.cpp | 59 +- Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h | 90 +- .../src/lcd/extui/lib/mks_ui/draw_about.cpp | 28 +- .../extui/lib/mks_ui/draw_change_speed.cpp | 91 +- .../src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 188 +- .../extui/lib/mks_ui/draw_error_message.cpp | 22 +- .../lcd/extui/lib/mks_ui/draw_extrusion.cpp | 236 +- Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp | 10 +- Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp | 2 +- .../lcd/extui/lib/mks_ui/draw_language.cpp | 608 ++-- .../lcd/extui/lib/mks_ui/draw_manuaLevel.cpp | 458 ++- .../lcd/extui/lib/mks_ui/draw_move_motor.cpp | 542 ++-- .../lcd/extui/lib/mks_ui/draw_opration.cpp | 558 ++-- .../extui/lib/mks_ui/draw_pause_message.cpp | 38 +- .../src/lcd/extui/lib/mks_ui/draw_preHeat.cpp | 708 ++--- .../lcd/extui/lib/mks_ui/draw_print_file.cpp | 199 +- .../lcd/extui/lib/mks_ui/draw_print_file.h | 6 +- .../lcd/extui/lib/mks_ui/draw_printing.cpp | 167 +- .../lcd/extui/lib/mks_ui/draw_ready_print.cpp | 488 ++- Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp | 388 ++- Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp | 140 +- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 312 +- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 26 +- .../lcd/extui/lib/mks_ui/gb2312_puhui16.cpp | 48 +- .../extui/lib/mks_ui/mks_hardware_test.cpp | 59 +- .../src/lcd/extui/lib/mks_ui/pic_manager.cpp | 509 ++-- Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h | 153 +- .../lcd/extui/lib/mks_ui/printer_opration.cpp | 313 +- .../lcd/extui/lib/mks_ui/tft_Language_en.h | 20 +- .../lcd/extui/lib/mks_ui/tft_Language_fr.h | 20 +- .../lcd/extui/lib/mks_ui/tft_Language_it.h | 350 +-- .../lcd/extui/lib/mks_ui/tft_Language_ru.h | 22 +- .../lcd/extui/lib/mks_ui/tft_Language_sp.h | 2 +- .../lcd/extui/lib/mks_ui/tft_Language_t_cn.h | 269 -- Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp | 468 ++- .../lib/mks_ui/tft_lvgl_configuration.cpp | 1033 ++++--- .../extui/lib/mks_ui/tft_lvgl_configuration.h | 6 +- .../extui/lib/mks_ui/tft_multi_language.cpp | 2626 +++++++++-------- .../lcd/extui/lib/mks_ui/tft_multi_language.h | 6 +- buildroot/share/extras/uncrustify.cfg | 2 +- 42 files changed, 5522 insertions(+), 6187 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp index 27925b47d11b..0beb79005608 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp @@ -24,67 +24,67 @@ #if ENABLED(SPI_GRAPHICAL_TFT) -#include -#include "../../../../inc/MarlinConfig.h" -#include "SPI_TFT.h" + #include + #include "../../../../inc/MarlinConfig.h" + #include "SPI_TFT.h" -TFT SPI_TFT; + TFT SPI_TFT; -#ifndef SPI_TFT_MISO_PIN - #define SPI_TFT_MISO_PIN PA6 -#endif -#ifndef SPI_TFT_MOSI_PIN - #define SPI_TFT_MOSI_PIN PA7 -#endif -#ifndef SPI_TFT_SCK_PIN - #define SPI_TFT_SCK_PIN PA5 -#endif -#ifndef SPI_TFT_CS_PIN - #define SPI_TFT_CS_PIN PD11 -#endif -#ifndef SPI_TFT_DC_PIN - #define SPI_TFT_DC_PIN PD10 -#endif -#ifndef SPI_TFT_RST_PIN - #define SPI_TFT_RST_PIN PC6 -#endif + #ifndef SPI_TFT_MISO_PIN + #define SPI_TFT_MISO_PIN PA6 + #endif + #ifndef SPI_TFT_MOSI_PIN + #define SPI_TFT_MOSI_PIN PA7 + #endif + #ifndef SPI_TFT_SCK_PIN + #define SPI_TFT_SCK_PIN PA5 + #endif + #ifndef SPI_TFT_CS_PIN + #define SPI_TFT_CS_PIN PD11 + #endif + #ifndef SPI_TFT_DC_PIN + #define SPI_TFT_DC_PIN PD10 + #endif + #ifndef SPI_TFT_RST_PIN + #define SPI_TFT_RST_PIN PC6 + #endif //use SPI1 for the spi tft. -void TFT::spi_init(uint8_t spiRate){ + void TFT::spi_init(uint8_t spiRate) { - SPI_TFT_CS_H; + SPI_TFT_CS_H; - /** - * STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz - * STM32F1 has 3 SPI ports, SPI1 in APB2, SPI2/SPI3 in APB1 - * so the minimum prescale of SPI1 is DIV4, SPI2/SPI3 is DIV2 - */ - uint8_t clock; - switch (spiRate) { - case SPI_FULL_SPEED: clock = SPI_CLOCK_DIV4 ; break; - case SPI_HALF_SPEED: clock = SPI_CLOCK_DIV4 ; break; - case SPI_QUARTER_SPEED: clock = SPI_CLOCK_DIV8 ; break; - case SPI_EIGHTH_SPEED: clock = SPI_CLOCK_DIV16; break; - case SPI_SPEED_5: clock = SPI_CLOCK_DIV32; break; - case SPI_SPEED_6: clock = SPI_CLOCK_DIV64; break; - default: clock = SPI_CLOCK_DIV2; // Default from the SPI library - } - SPI.setModule(1); - SPI.begin(); - SPI.setClockDivider(clock); - SPI.setBitOrder(MSBFIRST); - SPI.setDataMode(SPI_MODE0); -} + /** + * STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz + * STM32F1 has 3 SPI ports, SPI1 in APB2, SPI2/SPI3 in APB1 + * so the minimum prescale of SPI1 is DIV4, SPI2/SPI3 is DIV2 + */ + uint8_t clock; + switch (spiRate) { + case SPI_FULL_SPEED: clock = SPI_CLOCK_DIV4; break; + case SPI_HALF_SPEED: clock = SPI_CLOCK_DIV4; break; + case SPI_QUARTER_SPEED: clock = SPI_CLOCK_DIV8; break; + case SPI_EIGHTH_SPEED: clock = SPI_CLOCK_DIV16; break; + case SPI_SPEED_5: clock = SPI_CLOCK_DIV32; break; + case SPI_SPEED_6: clock = SPI_CLOCK_DIV64; break; + default: clock = SPI_CLOCK_DIV2; // Default from the SPI library + } + SPI.setModule(1); + SPI.begin(); + SPI.setClockDivider(clock); + SPI.setBitOrder(MSBFIRST); + SPI.setDataMode(SPI_MODE0); + } -uint8_t TFT::spi_Rec() { - uint8_t returnByte = SPI.transfer(ff); - return returnByte; -} + uint8_t TFT::spi_Rec() { + uint8_t returnByte = SPI.transfer(ff); + return returnByte; + } -uint8_t TFT::spi_read_write_byte(uint8_t data) { - uint8_t returnByte = SPI.transfer(data); - return returnByte; -} + uint8_t TFT::spi_read_write_byte(uint8_t data) { + uint8_t returnByte = SPI.transfer(data); + return returnByte; + } /** * @brief Receive a number of bytes from the SPI port to a buffer @@ -95,9 +95,7 @@ uint8_t TFT::spi_read_write_byte(uint8_t data) { * * @details Uses DMA */ -void TFT::spi_Read(uint8_t* buf, uint16_t nbyte) { - SPI.dmaTransfer(0, const_cast(buf), nbyte); -} + void TFT::spi_Read(uint8_t* buf, uint16_t nbyte) {SPI.dmaTransfer(0, const_cast(buf), nbyte);} /** * @brief Send a single byte on SPI port @@ -106,9 +104,7 @@ void TFT::spi_Read(uint8_t* buf, uint16_t nbyte) { * * @details */ -void TFT::spi_Send(uint8_t b) { - SPI.send(b); -} + void TFT::spi_Send(uint8_t b) {SPI.send(b);} /** * @brief Write token and then write from 512 byte buffer to SPI (for SD card) @@ -118,171 +114,160 @@ void TFT::spi_Send(uint8_t b) { * * @details Use DMA */ -void TFT::spi_SendBlock(uint8_t token, const uint8_t* buf) { - SPI.send(token); - SPI.dmaSend(const_cast(buf), 512); -} + void TFT::spi_SendBlock(uint8_t token, const uint8_t* buf) { + SPI.send(token); + SPI.dmaSend(const_cast(buf), 512); + } -void TFT::LCD_WR_REG(uint8_t cmd) -{ - SPI_TFT_CS_L; - SPI_TFT_DC_L; - spi_Send(cmd); - SPI_TFT_CS_H; -} -void TFT::LCD_WR_DATA(uint8_t data) -{ - SPI_TFT_CS_L; - SPI_TFT_DC_H; - spi_Send(data); - SPI_TFT_CS_H; -} -void TFT::LCD_WriteRAM_Prepare() -{ - LCD_WR_REG(0X2C); -} -void TFT::SetCursor(uint16_t x,uint16_t y) -{ - LCD_WR_REG(0x2a); - LCD_WR_DATA(x>>8); - LCD_WR_DATA(x); - LCD_WR_DATA(x>>8); - LCD_WR_DATA(x); + void TFT::LCD_WR_REG(uint8_t cmd) { + SPI_TFT_CS_L; + SPI_TFT_DC_L; + spi_Send(cmd); + SPI_TFT_CS_H; + } + void TFT::LCD_WR_DATA(uint8_t data) { + SPI_TFT_CS_L; + SPI_TFT_DC_H; + spi_Send(data); + SPI_TFT_CS_H; + } + void TFT::LCD_WriteRAM_Prepare() {LCD_WR_REG(0X2C);} + void TFT::SetCursor(uint16_t x, uint16_t y) { + LCD_WR_REG(0x2a); + LCD_WR_DATA(x >> 8); + LCD_WR_DATA(x); + LCD_WR_DATA(x >> 8); + LCD_WR_DATA(x); - LCD_WR_REG(0x2b); - LCD_WR_DATA(y>>8); - LCD_WR_DATA(y); - LCD_WR_DATA(y>>8); - LCD_WR_DATA(y); -} -void TFT::SetWindows(uint16_t x,uint16_t y,uint16_t with,uint16_t height) -{ - LCD_WR_REG(0x2a); - LCD_WR_DATA(x>>8); - LCD_WR_DATA(x); - LCD_WR_DATA((x+with)>>8); - LCD_WR_DATA((x+with)); + LCD_WR_REG(0x2b); + LCD_WR_DATA(y >> 8); + LCD_WR_DATA(y); + LCD_WR_DATA(y >> 8); + LCD_WR_DATA(y); + } + void TFT::SetWindows(uint16_t x, uint16_t y, uint16_t with, uint16_t height) { + LCD_WR_REG(0x2a); + LCD_WR_DATA(x >> 8); + LCD_WR_DATA(x); + LCD_WR_DATA((x + with) >> 8); + LCD_WR_DATA((x + with)); - LCD_WR_REG(0x2b); - LCD_WR_DATA(y>>8); - LCD_WR_DATA(y); - LCD_WR_DATA((y+height)>>8); - LCD_WR_DATA(y+height); -} -void TFT::LCD_init() -{ - SPI_TFT_RST_H; - delay(150); - SPI_TFT_RST_L; - delay(150); - SPI_TFT_RST_H; + LCD_WR_REG(0x2b); + LCD_WR_DATA(y >> 8); + LCD_WR_DATA(y); + LCD_WR_DATA((y + height) >> 8); + LCD_WR_DATA(y + height); + } + void TFT::LCD_init() { + SPI_TFT_RST_H; + delay(150); + SPI_TFT_RST_L; + delay(150); + SPI_TFT_RST_H; - delay(120); - LCD_WR_REG(0x11); - delay(120); + delay(120); + LCD_WR_REG(0x11); + delay(120); - LCD_WR_REG(0xf0); - LCD_WR_DATA(0xc3); - LCD_WR_REG(0xf0); - LCD_WR_DATA(0x96); + LCD_WR_REG(0xf0); + LCD_WR_DATA(0xc3); + LCD_WR_REG(0xf0); + LCD_WR_DATA(0x96); - LCD_WR_REG(0x36); - LCD_WR_DATA(0x28); + LCD_WR_REG(0x36); + LCD_WR_DATA(0x28); - LCD_WR_REG(0x3A); - LCD_WR_DATA(0x55); + LCD_WR_REG(0x3A); + LCD_WR_DATA(0x55); - LCD_WR_REG(0xB4); - LCD_WR_DATA(0x01); - LCD_WR_REG(0xB7) ; - LCD_WR_DATA(0xC6) ; - LCD_WR_REG(0xe8); - LCD_WR_DATA(0x40); - LCD_WR_DATA(0x8a); - LCD_WR_DATA(0x00); - LCD_WR_DATA(0x00); - LCD_WR_DATA(0x29); - LCD_WR_DATA(0x19); - LCD_WR_DATA(0xa5); - LCD_WR_DATA(0x33); - LCD_WR_REG(0xc1); - LCD_WR_DATA(0x06); - LCD_WR_REG(0xc2); - LCD_WR_DATA(0xa7); - LCD_WR_REG(0xc5); - LCD_WR_DATA(0x18); - LCD_WR_REG(0xe0); //Positive Voltage Gamma Control - LCD_WR_DATA(0xf0); - LCD_WR_DATA(0x09); - LCD_WR_DATA(0x0b); - LCD_WR_DATA(0x06); - LCD_WR_DATA(0x04); - LCD_WR_DATA(0x15); - LCD_WR_DATA(0x2f); - LCD_WR_DATA(0x54); - LCD_WR_DATA(0x42); - LCD_WR_DATA(0x3c); - LCD_WR_DATA(0x17); - LCD_WR_DATA(0x14); - LCD_WR_DATA(0x18); - LCD_WR_DATA(0x1b); - LCD_WR_REG(0xe1); //Negative Voltage Gamma Control - LCD_WR_DATA(0xf0); - LCD_WR_DATA(0x09); - LCD_WR_DATA(0x0b); - LCD_WR_DATA(0x06); - LCD_WR_DATA(0x04); - LCD_WR_DATA(0x03); - LCD_WR_DATA(0x2d); - LCD_WR_DATA(0x43); - LCD_WR_DATA(0x42); - LCD_WR_DATA(0x3b); - LCD_WR_DATA(0x16); - LCD_WR_DATA(0x14); - LCD_WR_DATA(0x17); - LCD_WR_DATA(0x1b); - LCD_WR_REG(0xf0); - LCD_WR_DATA(0x3c); - LCD_WR_REG(0xf0); - LCD_WR_DATA(0x69); - delay(120); //Delay 120ms - LCD_WR_REG(0x29); //Display ON + LCD_WR_REG(0xB4); + LCD_WR_DATA(0x01); + LCD_WR_REG(0xB7); + LCD_WR_DATA(0xC6); + LCD_WR_REG(0xe8); + LCD_WR_DATA(0x40); + LCD_WR_DATA(0x8a); + LCD_WR_DATA(0x00); + LCD_WR_DATA(0x00); + LCD_WR_DATA(0x29); + LCD_WR_DATA(0x19); + LCD_WR_DATA(0xa5); + LCD_WR_DATA(0x33); + LCD_WR_REG(0xc1); + LCD_WR_DATA(0x06); + LCD_WR_REG(0xc2); + LCD_WR_DATA(0xa7); + LCD_WR_REG(0xc5); + LCD_WR_DATA(0x18); + LCD_WR_REG(0xe0); //Positive Voltage Gamma Control + LCD_WR_DATA(0xf0); + LCD_WR_DATA(0x09); + LCD_WR_DATA(0x0b); + LCD_WR_DATA(0x06); + LCD_WR_DATA(0x04); + LCD_WR_DATA(0x15); + LCD_WR_DATA(0x2f); + LCD_WR_DATA(0x54); + LCD_WR_DATA(0x42); + LCD_WR_DATA(0x3c); + LCD_WR_DATA(0x17); + LCD_WR_DATA(0x14); + LCD_WR_DATA(0x18); + LCD_WR_DATA(0x1b); + LCD_WR_REG(0xe1); //Negative Voltage Gamma Control + LCD_WR_DATA(0xf0); + LCD_WR_DATA(0x09); + LCD_WR_DATA(0x0b); + LCD_WR_DATA(0x06); + LCD_WR_DATA(0x04); + LCD_WR_DATA(0x03); + LCD_WR_DATA(0x2d); + LCD_WR_DATA(0x43); + LCD_WR_DATA(0x42); + LCD_WR_DATA(0x3b); + LCD_WR_DATA(0x16); + LCD_WR_DATA(0x14); + LCD_WR_DATA(0x17); + LCD_WR_DATA(0x1b); + LCD_WR_REG(0xf0); + LCD_WR_DATA(0x3c); + LCD_WR_REG(0xf0); + LCD_WR_DATA(0x69); + delay(120); //Delay 120ms + LCD_WR_REG(0x29); //Display ON - LCD_clear(0x0000);// - SPI_TFT_BLK_H; + LCD_clear(0x0000); // + SPI_TFT_BLK_H; -} -void TFT::LCD_clear(uint16_t color) -{ - unsigned int i,m; - uint32_t count; - uint8_t tbuf[960]; + } + void TFT::LCD_clear(uint16_t color) { + unsigned int i, m; + uint32_t count; + uint8_t tbuf[960]; - SetCursor(0,0); - SetWindows(0,0,480-1,320-1); - LCD_WriteRAM_Prepare(); - SPI_TFT_CS_L; - SPI_TFT_DC_H; - for(i=0;i<960;) - { - tbuf[i]=color>>8; - tbuf[i+1]=color; - i += 2; - } - for(i=0;i<320;i++) - { - //for(m=0;m<480;m++) - //{ - //LCD_WR_DATA(color>>8); - //LCD_WR_DATA(color); - - SPI.dmaSend(tbuf,960,true); - //SPI_TFT_CS_H; - //} - } - SPI_TFT_CS_H; -} - -#endif + SetCursor(0, 0); + SetWindows(0, 0, 480 - 1, 320 - 1); + LCD_WriteRAM_Prepare(); + SPI_TFT_CS_L; + SPI_TFT_DC_H; + for (i = 0; i < 960;) + { + tbuf[i] = color >> 8; + tbuf[i + 1] = color; + i += 2; + } + for (i = 0; i < 320; i++) + { + //for(m=0;m<480;m++) + //{ + //LCD_WR_DATA(color>>8); + //LCD_WR_DATA(color); + SPI.dmaSend(tbuf, 960, true); + //SPI_TFT_CS_H; + //} + } + SPI_TFT_CS_H; + } +#endif // SPI_GRAPHICAL_TFT diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h index e88c8f7a8a58..e1216097028c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h @@ -37,19 +37,19 @@ class TFT { public: - void spi_init(uint8_t spiRate); - uint8_t spi_Rec(); - uint8_t spi_read_write_byte(uint8_t data); - void spi_Read(uint8_t* buf, uint16_t nbyte); - void spi_Send(uint8_t b); - void spi_SendBlock(uint8_t token, const uint8_t* buf); - void LCD_WR_REG(uint8_t cmd); - void LCD_WR_DATA(uint8_t data); - void SetCursor(uint16_t x,uint16_t y); - void SetWindows(uint16_t x,uint16_t y,uint16_t with,uint16_t height); - void LCD_init(); - void LCD_clear(uint16_t color); - void LCD_WriteRAM_Prepare(); +void spi_init(uint8_t spiRate); +uint8_t spi_Rec(); +uint8_t spi_read_write_byte(uint8_t data); +void spi_Read(uint8_t* buf, uint16_t nbyte); +void spi_Send(uint8_t b); +void spi_SendBlock(uint8_t token, const uint8_t* buf); +void LCD_WR_REG(uint8_t cmd); +void LCD_WR_DATA(uint8_t data); +void SetCursor(uint16_t x, uint16_t y); +void SetWindows(uint16_t x, uint16_t y, uint16_t with, uint16_t height); +void LCD_init(); +void LCD_clear(uint16_t color); +void LCD_WriteRAM_Prepare(); }; extern TFT SPI_TFT; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.cpp b/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.cpp index 4b388cea1321..21ed3f999cb6 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.cpp @@ -21,8 +21,7 @@ */ #include "../../../../inc/MarlinConfigPre.h" -#if 1//ENABLED(SPI_FLASH) - +#if 1 // ENABLED(SPI_FLASH) #if ENABLED(TFT_LITTLE_VGL_UI) #include @@ -48,7 +47,7 @@ ext_FLASH W25QXX; -void ext_FLASH::init(uint8_t spiRate){ +void ext_FLASH::init(uint8_t spiRate) { OUT_WRITE(SPI_FLASH_CS_PIN, HIGH); @@ -62,15 +61,15 @@ void ext_FLASH::init(uint8_t spiRate){ #else #define SPI_CLOCK_MAX SPI_CLOCK_DIV2 #endif - uint8_t clock; + uint8_t clock; switch (spiRate) { - case SPI_FULL_SPEED: clock = SPI_CLOCK_MAX ; break; - case SPI_HALF_SPEED: clock = SPI_CLOCK_DIV4 ; break; - case SPI_QUARTER_SPEED: clock = SPI_CLOCK_DIV8 ; break; + case SPI_FULL_SPEED: clock = SPI_CLOCK_MAX; break; + case SPI_HALF_SPEED: clock = SPI_CLOCK_DIV4; break; + case SPI_QUARTER_SPEED: clock = SPI_CLOCK_DIV8; break; case SPI_EIGHTH_SPEED: clock = SPI_CLOCK_DIV16; break; case SPI_SPEED_5: clock = SPI_CLOCK_DIV32; break; case SPI_SPEED_6: clock = SPI_CLOCK_DIV64; break; - default: clock = SPI_CLOCK_DIV2; // Default from the SPI library + default: clock = SPI_CLOCK_DIV2;// Default from the SPI library } SPI.setModule(SPI_DEVICE); SPI.begin(); @@ -105,9 +104,7 @@ uint8_t ext_FLASH::spi_flash_read_write_byte(uint8_t data) { * * @details Uses DMA */ -void ext_FLASH::spi_flash_Read(uint8_t* buf, uint16_t nbyte) { - SPI.dmaTransfer(0, const_cast(buf), nbyte); -} +void ext_FLASH::spi_flash_Read(uint8_t* buf, uint16_t nbyte) { SPI.dmaTransfer(0, const_cast(buf), nbyte); } /** * @brief Send a single byte on SPI port @@ -116,9 +113,7 @@ void ext_FLASH::spi_flash_Read(uint8_t* buf, uint16_t nbyte) { * * @details */ -void ext_FLASH::spi_flash_Send(uint8_t b) { - SPI.send(b); -} +void ext_FLASH::spi_flash_Send(uint8_t b) { SPI.send(b); } /** * @brief Write token and then write from 512 byte buffer to SPI (for SD card) @@ -140,8 +135,8 @@ uint16_t ext_FLASH::W25QXX_ReadID(void) { spi_flash_Send(0x00); spi_flash_Send(0x00); spi_flash_Send(0x00); - Temp|=spi_flash_Rec()<<8; - Temp|=spi_flash_Rec(); + Temp |= spi_flash_Rec() << 8; + Temp |= spi_flash_Rec(); W25QXX_CS_H; return Temp; } @@ -150,7 +145,7 @@ void ext_FLASH::SPI_FLASH_WriteEnable(void) { /* Select the FLASH: Chip Select low */ W25QXX_CS_L; /* Send "Write Enable" instruction */ - spi_flash_Send(W25X_WriteEnable); + spi_flash_Send(W25X_WriteEnable); /* Deselect the FLASH: Chip Select high */ W25QXX_CS_H; } @@ -173,11 +168,11 @@ void ext_FLASH::SPI_FLASH_WaitForWriteEnd(void) { spi_flash_Send(W25X_ReadStatusReg); /* Loop as long as the memory is busy with a write cycle */ - do { + do /* Send a dummy byte to generate the clock needed by the FLASH and put the value of the status register in FLASH_Status variable */ FLASH_Status = spi_flash_Rec(); - } while ((FLASH_Status & WIP_Flag) == 0x01); /* Write in progress */ + while ((FLASH_Status & WIP_Flag) == 0x01); /* Write in progress */ /* Deselect the FLASH: Chip Select high */ W25QXX_CS_H; @@ -306,16 +301,17 @@ void ext_FLASH::SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint Addr = WriteAddr % SPI_FLASH_PageSize; count = SPI_FLASH_PageSize - Addr; - NumOfPage = NumByteToWrite / SPI_FLASH_PageSize; + NumOfPage = NumByteToWrite / SPI_FLASH_PageSize; NumOfSingle = NumByteToWrite % SPI_FLASH_PageSize; if (Addr == 0) { /* WriteAddr is SPI_FLASH_PageSize aligned */ - if (NumOfPage == 0) /* NumByteToWrite < SPI_FLASH_PageSize */ + if (NumOfPage == 0) { /* NumByteToWrite < SPI_FLASH_PageSize */ SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite); + } else { /* NumByteToWrite > SPI_FLASH_PageSize */ while (NumOfPage--) { SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize); - WriteAddr += SPI_FLASH_PageSize; + WriteAddr += SPI_FLASH_PageSize; pBuffer += SPI_FLASH_PageSize; } SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumOfSingle); @@ -326,25 +322,26 @@ void ext_FLASH::SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint if (NumOfSingle > count) { /* (NumByteToWrite + WriteAddr) > SPI_FLASH_PageSize */ temp = NumOfSingle - count; SPI_FLASH_PageWrite(pBuffer, WriteAddr, count); - WriteAddr += count; + WriteAddr += count; pBuffer += count; SPI_FLASH_PageWrite(pBuffer, WriteAddr, temp); } - else + else { SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite); + } } else { /* NumByteToWrite > SPI_FLASH_PageSize */ NumByteToWrite -= count; - NumOfPage = NumByteToWrite / SPI_FLASH_PageSize; + NumOfPage = NumByteToWrite / SPI_FLASH_PageSize; NumOfSingle = NumByteToWrite % SPI_FLASH_PageSize; SPI_FLASH_PageWrite(pBuffer, WriteAddr, count); - WriteAddr += count; + WriteAddr += count; pBuffer += count; while (NumOfPage--) { SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize); - WriteAddr += SPI_FLASH_PageSize; + WriteAddr += SPI_FLASH_PageSize; pBuffer += SPI_FLASH_PageSize; } @@ -374,11 +371,11 @@ void ext_FLASH::SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16 /* Send ReadAddr high nibble address byte to read from */ spi_flash_Send((ReadAddr & 0xFF0000) >> 16); /* Send ReadAddr medium nibble address byte to read from */ - spi_flash_Send((ReadAddr& 0xFF00) >> 8); + spi_flash_Send((ReadAddr & 0xFF00) >> 8); /* Send ReadAddr low nibble address byte to read from */ spi_flash_Send(ReadAddr & 0xFF); - if (NumByteToRead<33) { + if (NumByteToRead < 33) { while (NumByteToRead--) { /* while there is data to be read */ /* Read a byte from the FLASH */ *pBuffer = spi_flash_Rec(); @@ -392,9 +389,7 @@ void ext_FLASH::SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16 W25QXX_CS_H; } -void ext_FLASH::lv_pic_read(uint8_t *P_Rbuff,uint32_t addr,uint32_t size) { - SPI_FLASH_BufferRead((uint8_t *)P_Rbuff,addr,size); -} +void ext_FLASH::lv_pic_read(uint8_t *P_Rbuff, uint32_t addr, uint32_t size) {SPI_FLASH_BufferRead((uint8_t *)P_Rbuff, addr, size);} #endif // TFT_LITTLE_VGL_UI #endif // 1 ... SPI_FLASH diff --git a/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h b/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h index 52696393f8a6..89b22c30fc5b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h @@ -54,50 +54,50 @@ #if 0 -#define PIC_NAME_MAX_LEN 50 - -#define LOGO_MAX_SIZE (300*1024) //logo���ֵ -#define TITLELOGO_MAX_SIZE (150*1024) //logo���ֵ -#define DEFAULT_VIEW_MAX_SIZE (200*200*2) -#define FLASH_VIEW_MAX_SIZE (200*200*2) - -//ͼƬ -//Robin2�洢��ַ -#define PIC_NAME_ADDR 0x003000 //ͼƬ��Ϣ�洢��ַ��ͼƬ���� -#define PIC_SIZE_ADDR 0x007000 //ͼƬ��Ϣ�洢��ַ��ͼƬ��Сֵ -#define PIC_COUNTER_ADDR 0x008000 //ͼƬ������ֵ�洢��ַ -#define PIC_LOGO_ADDR 0x009000 //ͼƬlogo�洢��ַ -//#define PIC_DATA_ADDR 0x02f000 //ͼƬ���ݴ洢��ַ - -#define DEFAULT_VIEW_ADDR 0XC5800 -#define BAK_VIEW_ADDR (DEFAULT_VIEW_ADDR+90*1024) -#define PIC_ICON_LOGO_ADDR (BAK_VIEW_ADDR+80*1024) - -#define PIC_DATA_ADDR (PIC_ICON_LOGO_ADDR+350*1024) //ͼƬ���ݴ洢��ַ//(800*240) - -//�ֿ� -#define FONTINFOADDR 0x600000//6M�Ժ��ַΪ�ֿ� -#define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096)//4*1024 -#define GBK_FLASH_ADDR (UNIGBK_FLASH_ADDR+180224)//176*1024 - -#define PER_PIC_MAX_SPACE (32*1024) //Ϊ�˷�ֹ����Խ������⣬ÿ��СͼƬ�����仮��Ӧ��ȡ�ܹ�����4K��ֵ - -// -union union32 { - uint8_t bytes[4]; - uint32_t dwords; -}; -//ͼƬ��Ϣ�ṹ�� -struct pic_msg { - uint8_t name[PIC_NAME_MAX_LEN]; - union union32 size; -}; - -typedef struct pic_msg PIC_MSG; - -#endif - -class ext_FLASH{ + #define PIC_NAME_MAX_LEN 50 + + #define LOGO_MAX_SIZE (300*1024)//logo���ֵ + #define TITLELOGO_MAX_SIZE (150*1024)//logo���ֵ + #define DEFAULT_VIEW_MAX_SIZE (200*200*2) + #define FLASH_VIEW_MAX_SIZE (200*200*2) + + //ͼƬ + //Robin2�洢��ַ + #define PIC_NAME_ADDR 0x003000 //ͼƬ��Ϣ�洢��ַ��ͼƬ���� + #define PIC_SIZE_ADDR 0x007000 //ͼƬ��Ϣ�洢��ַ��ͼƬ��Сֵ + #define PIC_COUNTER_ADDR 0x008000 //ͼƬ������ֵ�洢��ַ + #define PIC_LOGO_ADDR 0x009000 //ͼƬlogo�洢��ַ + //#define PIC_DATA_ADDR 0x02f000 //ͼƬ���ݴ洢��ַ + + #define DEFAULT_VIEW_ADDR 0XC5800 + #define BAK_VIEW_ADDR (DEFAULT_VIEW_ADDR+90*1024) + #define PIC_ICON_LOGO_ADDR (BAK_VIEW_ADDR+80*1024) + + #define PIC_DATA_ADDR (PIC_ICON_LOGO_ADDR+350*1024) //ͼƬ���ݴ洢��ַ//(800*240) + + // �ֿ� + #define FONTINFOADDR 0x600000 // 6M�Ժ��ַΪ�ֿ� + #define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096) // 4*1024 + #define GBK_FLASH_ADDR (UNIGBK_FLASH_ADDR+180224) // 176*1024 + + #define PER_PIC_MAX_SPACE (32*1024) // Ϊ�˷�ֹ����Խ������⣬ÿ��СͼƬ�����仮��Ӧ��ȡ�ܹ�����4K��ֵ + + // + union union32 { + uint8_t bytes[4]; + uint32_t dwords; + }; + // ͼƬ��Ϣ�ṹ�� + struct pic_msg { + uint8_t name[PIC_NAME_MAX_LEN]; + union union32 size; + }; + + typedef struct pic_msg PIC_MSG; + +#endif // if 0 + +class ext_FLASH { public: void init(uint8_t spiRate); static uint8_t spi_flash_Rec(); @@ -115,7 +115,7 @@ class ext_FLASH{ static void SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); static void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead); //uint32_t lv_get_pic_addr(uint8_t *Pname); - void lv_pic_read(uint8_t *P_Rbuff,uint32_t addr,uint32_t size); + void lv_pic_read(uint8_t *P_Rbuff, uint32_t addr, uint32_t size); }; extern ext_FLASH W25QXX; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp index 5fdeb152ebd5..8193563e41f7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp @@ -34,7 +34,7 @@ #include "../../../../module/temperature.h" static lv_obj_t * scr; -static lv_obj_t * fw_type,*board,*fw_version; +static lv_obj_t * fw_type, *board, *fw_version; #define ID_A_RETURN 1 @@ -48,12 +48,12 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { clear_cur_ui(); draw_return_ui(); } - break; + break; } } void lv_draw_about(void) { - lv_obj_t *buttonBack,*label_Back; + lv_obj_t *buttonBack, *label_Back; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ABOUT_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = ABOUT_UI; @@ -68,14 +68,14 @@ void lv_draw_about(void) { lv_obj_t * title = lv_label_create(scr, NULL); lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); LV_IMG_DECLARE(bmp_pic); - /*Create an Image button*/ + /*Create an Image button*/ buttonBack = lv_imgbtn_create(scr, NULL); #if 1 @@ -86,21 +86,21 @@ void lv_draw_about(void) { lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - /*Create a label on the Image button*/ + /*Create a label on the Image button*/ label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language !=0) { + if (gCfgItems.multiple_language != 0) { lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } fw_version = lv_label_create(scr, NULL); lv_obj_set_style(fw_version, &tft_style_lable_rel); lv_label_set_text(fw_version, "Version: V_2.0.5.3"); - lv_obj_align(fw_version, NULL, LV_ALIGN_CENTER,0, -60); + lv_obj_align(fw_version, NULL, LV_ALIGN_CENTER, 0, -60); fw_type = lv_label_create(scr, NULL); lv_obj_set_style(fw_type, &tft_style_lable_rel); @@ -109,7 +109,7 @@ void lv_draw_about(void) { #elif (MOTHERBOARD == BOARD_MKS_ROBIN_NANO) lv_label_set_text(fw_type, "Firmware: Robin_Nano35"); #endif - lv_obj_align(fw_type, NULL, LV_ALIGN_CENTER,0, -20); + lv_obj_align(fw_type, NULL, LV_ALIGN_CENTER, 0, -20); board = lv_label_create(scr, NULL); lv_obj_set_style(board, &tft_style_lable_rel); @@ -119,11 +119,9 @@ void lv_draw_about(void) { lv_label_set_text(board, "Board: MKS Robin nano"); #endif - lv_obj_align(board, NULL, LV_ALIGN_CENTER,0, 20); + lv_obj_align(board, NULL, LV_ALIGN_CENTER, 0, 20); } -void lv_clear_about() { - lv_obj_del(scr); -} +void lv_clear_about() { lv_obj_del(scr); } #endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp index 31a620df9457..e2308e9463d7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp @@ -35,8 +35,8 @@ #include "../../../../module/planner.h" static lv_obj_t * scr; -static lv_obj_t * labelStep,*buttonStep,*buttonMov,*buttonExt; -static lv_obj_t * labelMov,*labelExt; +static lv_obj_t * labelStep, *buttonStep, *buttonMov, *buttonExt; +static lv_obj_t * labelMov, *labelExt; static lv_obj_t * printSpeedText; #define ID_C_ADD 1 @@ -55,20 +55,16 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { if (speedType == 0) { - if (feedrate_percentage < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) { + if (feedrate_percentage < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) feedrate_percentage += uiCfg.stepPrintSpeed; - } - else { + else feedrate_percentage = MAX_EXT_SPEED_PERCENT; - } } else if (speedType == 1) { - if (planner.flow_percentage[0]< MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) { + if (planner.flow_percentage[0] < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) planner.flow_percentage[0] += uiCfg.stepPrintSpeed; - } - else { + else planner.flow_percentage[0] = MAX_EXT_SPEED_PERCENT; - } //planner.e_factor[0]= planner.flow_percentage[0]*0.01; //planner.flow_percentage[1] = planner.flow_percentage[0]; //planner.e_factor[1]= planner.flow_percentage[1]*0.01; @@ -152,7 +148,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } void lv_draw_change_speed(void) { - lv_obj_t *buttonAdd,*buttonDec; + lv_obj_t *buttonAdd, *buttonDec; lv_obj_t *buttonBack; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != CHANGE_SPEED_UI) { @@ -169,7 +165,7 @@ void lv_draw_change_speed(void) { lv_obj_t * title = lv_label_create(scr, NULL); lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); @@ -184,7 +180,7 @@ void lv_draw_change_speed(void) { buttonStep = lv_imgbtn_create(scr, NULL); buttonBack = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonAdd, event_handler,ID_C_ADD,"bmp_Add.bin",0); + lv_obj_set_event_cb_mks(buttonAdd, event_handler, ID_C_ADD, "bmp_Add.bin", 0); lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); @@ -192,7 +188,7 @@ void lv_draw_change_speed(void) { lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); #if 1 - lv_obj_set_event_cb_mks(buttonDec, event_handler,ID_C_DEC,"bmp_Dec.bin",0); + lv_obj_set_event_cb_mks(buttonDec, event_handler, ID_C_DEC, "bmp_Dec.bin", 0); lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); @@ -214,20 +210,19 @@ void lv_draw_change_speed(void) { lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_C_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_C_RETURN, "bmp_Return.bin", 0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - #endif - lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttonMov,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonExt,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonStep,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonAdd, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonDec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonMov, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonExt, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonStep, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); /*Create a label on the Image button*/ lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); @@ -246,13 +241,13 @@ void lv_draw_change_speed(void) { if (gCfgItems.multiple_language != 0) { lv_label_set_text(labelAdd, speed_menu.add); - lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); lv_label_set_text(labelDec, speed_menu.dec); - lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } disp_speed_type(); disp_speed_step(); @@ -264,24 +259,24 @@ void lv_draw_change_speed(void) { void disp_speed_step() { if (uiCfg.stepPrintSpeed == 1) - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step1_percent.bin",0); + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_C_STEP, "bmp_Step1_percent.bin", 0); else if (uiCfg.stepPrintSpeed == 5) - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step5_percent.bin",0); + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_C_STEP, "bmp_Step5_percent.bin", 0); else if (uiCfg.stepPrintSpeed == 10) - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_C_STEP,"bmp_Step10_percent.bin",0); + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_C_STEP, "bmp_Step10_percent.bin", 0); if (gCfgItems.multiple_language != 0) { if (uiCfg.stepPrintSpeed == 1) { lv_label_set_text(labelStep, speed_menu.step_1percent); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } else if (uiCfg.stepPrintSpeed == 5) { lv_label_set_text(labelStep, speed_menu.step_5percent); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } else if (uiCfg.stepPrintSpeed == 10) { lv_label_set_text(labelStep, speed_menu.step_10percent); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } } } @@ -291,32 +286,32 @@ void disp_print_speed() { public_buf_l[0] = '\0'; - if (speedType == 0) { //move - strcat(public_buf_l,speed_menu.move_speed); - strcat(public_buf_l,": "); + if (speedType == 0) { //move + strcat(public_buf_l, speed_menu.move_speed); + strcat(public_buf_l, ": "); sprintf(buf, "%d%%", feedrate_percentage); - strcat(public_buf_l,buf); + strcat(public_buf_l, buf); } - else if (speedType == 1) { // e1 - strcat(public_buf_l,speed_menu.extrude_speed); - strcat(public_buf_l,": "); + else if (speedType == 1) { // e1 + strcat(public_buf_l, speed_menu.extrude_speed); + strcat(public_buf_l, ": "); sprintf(buf, "%d%%", planner.flow_percentage[0]); - strcat(public_buf_l,buf); + strcat(public_buf_l, buf); } lv_label_set_text(printSpeedText, public_buf_l); - lv_obj_align(printSpeedText, NULL, LV_ALIGN_CENTER,0, -65); + lv_obj_align(printSpeedText, NULL, LV_ALIGN_CENTER, 0, -65); } void disp_speed_type() { switch (speedType) { case 1: - lv_obj_set_event_cb_mks(buttonExt, event_handler,ID_C_EXT,"bmp_Extruct_speed_sel.bin",0); - lv_obj_set_event_cb_mks(buttonMov, event_handler,ID_C_MOVE,"bmp_Mov_speed.bin",0); + lv_obj_set_event_cb_mks(buttonExt, event_handler, ID_C_EXT, "bmp_Extruct_speed_sel.bin", 0); + lv_obj_set_event_cb_mks(buttonMov, event_handler, ID_C_MOVE, "bmp_Mov_speed.bin", 0); break; default: - lv_obj_set_event_cb_mks(buttonExt, event_handler,ID_C_EXT,"bmp_Extruct_speed.bin",0); - lv_obj_set_event_cb_mks(buttonMov, event_handler,ID_C_MOVE,"bmp_Mov_speed_sel.bin",0); + lv_obj_set_event_cb_mks(buttonExt, event_handler, ID_C_EXT, "bmp_Extruct_speed.bin", 0); + lv_obj_set_event_cb_mks(buttonMov, event_handler, ID_C_MOVE, "bmp_Mov_speed_sel.bin", 0); break; } lv_obj_refresh_ext_draw_pad(buttonExt); @@ -324,15 +319,13 @@ void disp_speed_type() { if (gCfgItems.multiple_language != 0) { lv_label_set_text(labelMov, speed_menu.move); - lv_obj_align(labelMov, buttonMov, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelMov, buttonMov, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); lv_label_set_text(labelExt, speed_menu.extrude); - lv_obj_align(labelExt, buttonExt, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelExt, buttonExt, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } } -void lv_clear_change_speed() { - lv_obj_del(scr); -} +void lv_clear_change_speed() { lv_obj_del(scr); } #endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp index 443427a5ae7f..3b813abc5ad7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -65,36 +65,36 @@ static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) { lv_draw_printing(); #if ENABLED(SDSUPPORT) - if (gcode_preview_over != 1) { - char *cur_name; - cur_name = strrchr(list_file.file_name[sel_id], '/'); - - SdFile file, *curDir; - card.endFilePrint(); - const char * const fname = card.diveToFile(true, curDir, cur_name); - if (!fname) return; - if (file.open(curDir, fname, O_READ)) { - gCfgItems.curFilesize = file.fileSize(); - file.close(); - update_spi_flash(); - } - card.openFileRead(cur_name); - if (card.isFileOpen()) { - feedrate_percentage = 100; - //saved_feedrate_percentage = feedrate_percentage; - planner.flow_percentage[0] = 100; - planner.e_factor[0]= planner.flow_percentage[0] * 0.01f; - #if EXTRUDERS == 2 - planner.flow_percentage[1] = 100; - planner.e_factor[1]= planner.flow_percentage[1] * 0.01f; - #endif - card.startFileprint(); - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.prepare(); - #endif - once_flag = 0; - } + if (gcode_preview_over != 1) { + char *cur_name; + cur_name = strrchr(list_file.file_name[sel_id], '/'); + + SdFile file, *curDir; + card.endFilePrint(); + const char * const fname = card.diveToFile(true, curDir, cur_name); + if (!fname) return; + if (file.open(curDir, fname, O_READ)) { + gCfgItems.curFilesize = file.fileSize(); + file.close(); + update_spi_flash(); } + card.openFileRead(cur_name); + if (card.isFileOpen()) { + feedrate_percentage = 100; + //saved_feedrate_percentage = feedrate_percentage; + planner.flow_percentage[0] = 100; + planner.e_factor[0] = planner.flow_percentage[0] * 0.01f; + #if EXTRUDERS == 2 + planner.flow_percentage[1] = 100; + planner.e_factor[1] = planner.flow_percentage[1] * 0.01f; + #endif + card.startFileprint(); + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.prepare(); + #endif + once_flag = 0; + } + } #endif } else if (DialogType == DIALOG_TYPE_STOP) { @@ -103,23 +103,23 @@ static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) { lv_draw_ready_print(); #if ENABLED(SDSUPPORT) - //card.endFilePrint(); - //wait_for_heatup = false; - uiCfg.print_state = IDLE; - card.flag.abort_sd_printing = true; - //queue.clear(); - //quickstop_stepper(); - //print_job_timer.stop(); - //thermalManager.disable_all_heaters(); - - //#if ENABLED(POWER_LOSS_RECOVERY) - //recovery.purge(); - //#endif - //queue.enqueue_one_now(PSTR("G91")); - //queue.enqueue_one_now(PSTR("G1 Z10")); - //queue.enqueue_one_now(PSTR("G90")); - //queue.enqueue_one_now(PSTR("G28 X0 Y0")); - //queue.inject_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0\nM84\nM107")); + //card.endFilePrint(); + //wait_for_heatup = false; + uiCfg.print_state = IDLE; + card.flag.abort_sd_printing = true; + //queue.clear(); + //quickstop_stepper(); + //print_job_timer.stop(); + //thermalManager.disable_all_heaters(); + + //#if ENABLED(POWER_LOSS_RECOVERY) + //recovery.purge(); + //#endif + //queue.enqueue_one_now(PSTR("G91")); + //queue.enqueue_one_now(PSTR("G1 Z10")); + //queue.enqueue_one_now(PSTR("G90")); + //queue.enqueue_one_now(PSTR("G28 X0 Y0")); + //queue.inject_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0\nM84\nM107")); #endif } else if (DialogType == DIALOG_TYPE_FINISH_PRINT) { @@ -128,9 +128,9 @@ static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) { } #if ENABLED(ADVANCED_PAUSE_FEATURE) else if (DialogType == DIALOG_PAUSE_MESSAGE_WAITING - || DialogType == DIALOG_PAUSE_MESSAGE_INSERT - || DialogType == DIALOG_PAUSE_MESSAGE_HEAT - ) { + || DialogType == DIALOG_PAUSE_MESSAGE_INSERT + || DialogType == DIALOG_PAUSE_MESSAGE_HEAT + ) { wait_for_user = false; } else if (DialogType == DIALOG_PAUSE_MESSAGE_OPTION) { @@ -180,15 +180,15 @@ void lv_draw_dialog(uint8_t type) { lv_obj_t * title = lv_label_create(scr, NULL); lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); //LV_IMG_DECLARE(bmp_pic); - static lv_style_t style_btn_rel; /*A variable to store the released style*/ - lv_style_copy(&style_btn_rel, &lv_style_plain); /*Initialize from a built-in style*/ + static lv_style_t style_btn_rel; /*A variable to store the released style*/ + lv_style_copy(&style_btn_rel, &lv_style_plain); /*Initialize from a built-in style*/ style_btn_rel.body.border.color = lv_color_hex3(0x269); style_btn_rel.body.border.width = 1; style_btn_rel.body.main_color = lv_color_hex3(0xADF); @@ -197,74 +197,74 @@ void lv_draw_dialog(uint8_t type) { style_btn_rel.body.shadow.type = LV_SHADOW_BOTTOM; style_btn_rel.body.radius = LV_RADIUS_CIRCLE; style_btn_rel.text.color = lv_color_hex3(0xDEF); - style_btn_rel.text.font = &gb2312_puhui32; + style_btn_rel.text.font = &gb2312_puhui32; - static lv_style_t style_btn_pr; /*A variable to store the pressed style*/ - lv_style_copy(&style_btn_pr, &style_btn_rel); /*Initialize from the released style*/ + static lv_style_t style_btn_pr; /*A variable to store the pressed style*/ + lv_style_copy(&style_btn_pr, &style_btn_rel); /*Initialize from the released style*/ style_btn_pr.body.border.color = lv_color_hex3(0x46B); style_btn_pr.body.main_color = lv_color_hex3(0x8BD); style_btn_pr.body.grad_color = lv_color_hex3(0x24A); style_btn_pr.body.shadow.width = 2; style_btn_pr.text.color = lv_color_hex3(0xBCD); - style_btn_pr.text.font = &gb2312_puhui32; + style_btn_pr.text.font = &gb2312_puhui32; lv_obj_t * labelDialog = lv_label_create(scr, NULL); lv_obj_set_style(labelDialog, &tft_style_lable_rel); if (DialogType == DIALOG_TYPE_FINISH_PRINT || DialogType == DIALOG_PAUSE_MESSAGE_RESUME) { - lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(btnOk, BTN_OK_X+90, BTN_OK_Y); /*Set its position*/ - lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ + lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); /*Set its position*/ + lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ - lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ - lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ - lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ } else if (DialogType == DIALOG_PAUSE_MESSAGE_WAITING - ||DialogType == DIALOG_PAUSE_MESSAGE_INSERT - ||DialogType == DIALOG_PAUSE_MESSAGE_HEAT) { - lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(btnOk, BTN_OK_X+90, BTN_OK_Y); /*Set its position*/ - lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ + || DialogType == DIALOG_PAUSE_MESSAGE_INSERT + || DialogType == DIALOG_PAUSE_MESSAGE_HEAT) { + lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); /*Set its position*/ + lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ - lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ - lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ - lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ } else if (DialogType == DIALOG_PAUSE_MESSAGE_PAUSING - ||DialogType == DIALOG_PAUSE_MESSAGE_CHANGING - ||DialogType == DIALOG_PAUSE_MESSAGE_UNLOAD - ||DialogType == DIALOG_PAUSE_MESSAGE_LOAD - ||DialogType == DIALOG_PAUSE_MESSAGE_PURGE - ||DialogType == DIALOG_PAUSE_MESSAGE_RESUME - ||DialogType == DIALOG_PAUSE_MESSAGE_HEATING) { + || DialogType == DIALOG_PAUSE_MESSAGE_CHANGING + || DialogType == DIALOG_PAUSE_MESSAGE_UNLOAD + || DialogType == DIALOG_PAUSE_MESSAGE_LOAD + || DialogType == DIALOG_PAUSE_MESSAGE_PURGE + || DialogType == DIALOG_PAUSE_MESSAGE_RESUME + || DialogType == DIALOG_PAUSE_MESSAGE_HEATING) { } else { - lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(btnOk, BTN_OK_X, BTN_OK_Y); /*Set its position*/ - lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ + lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(btnOk, BTN_OK_X, BTN_OK_Y); /*Set its position*/ + lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ - lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ - lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ - lv_obj_t * btnCancel = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(btnCancel, BTN_CANCEL_X, BTN_CANCEL_Y); /*Set its position*/ - lv_obj_set_size(btnCancel, 100, 50); /*Set its size*/ + lv_obj_t * btnCancel = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(btnCancel, BTN_CANCEL_X, BTN_CANCEL_Y); /*Set its position*/ + lv_obj_set_size(btnCancel, 100, 50); /*Set its size*/ lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_set_style(btnCancel, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ - lv_btn_set_style(btnCancel, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ - lv_obj_t * labelCancel = lv_label_create(btnCancel, NULL); /*Add a label to the button*/ + lv_btn_set_style(btnCancel, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ + lv_btn_set_style(btnCancel, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ + lv_obj_t * labelCancel = lv_label_create(btnCancel, NULL); /*Add a label to the button*/ if (DialogType == DIALOG_PAUSE_MESSAGE_OPTION) { - lv_label_set_text(labelOk, pause_msg_menu.purgeMore); /*Set the labels text*/ + lv_label_set_text(labelOk, pause_msg_menu.purgeMore); /*Set the labels text*/ lv_label_set_text(labelCancel, pause_msg_menu.continuePrint); } else { - lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); } } @@ -332,8 +332,6 @@ void lv_draw_dialog(uint8_t type) { } } -void lv_clear_dialog() { - lv_obj_del(scr); -} +void lv_clear_dialog() { lv_obj_del(scr); } #endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp index 1a19617fa82f..de57804c2d41 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp @@ -38,7 +38,7 @@ static lv_obj_t * scr; void lv_draw_error_message(PGM_P const msg) { #if 0 - static lv_obj_t * message=NULL,*kill_message=NULL,*reset_tips=NULL; + static lv_obj_t * message = NULL, *kill_message = NULL, *reset_tips = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ERROR_MESSAGE_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = ERROR_MESSAGE_UI; @@ -48,39 +48,37 @@ void lv_draw_error_message(PGM_P const msg) { scr = lv_obj_create(NULL, NULL); lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + lv_scr_load(scr); + lv_obj_clean(scr); - lv_refr_now(lv_refr_get_disp_refreshing()); + lv_refr_now(lv_refr_get_disp_refreshing()); if (msg) { message = lv_label_create(scr, NULL); lv_obj_set_style(message, &tft_style_lable_rel); lv_label_set_text(message, msg); - lv_obj_align(message, NULL, LV_ALIGN_CENTER,0, -50); + lv_obj_align(message, NULL, LV_ALIGN_CENTER, 0, -50); } kill_message = lv_label_create(scr, NULL); lv_obj_set_style(kill_message, &tft_style_lable_rel); lv_label_set_text(kill_message, "PRINTER HALTED"); - lv_obj_align(kill_message, NULL, LV_ALIGN_CENTER,0, -10); + lv_obj_align(kill_message, NULL, LV_ALIGN_CENTER, 0, -10); reset_tips = lv_label_create(scr, NULL); lv_obj_set_style(reset_tips, &tft_style_lable_rel); lv_label_set_text(reset_tips, "Please Reset"); - lv_obj_align(reset_tips, NULL, LV_ALIGN_CENTER,0, 30); + lv_obj_align(reset_tips, NULL, LV_ALIGN_CENTER, 0, 30); lv_task_handler(); #endif LCD_Clear(0x0000); if (msg) disp_string((TFT_WIDTH - strlen(msg) * 16) / 2, 100, msg, 0xFFFF, 0x0000); - disp_string((TFT_WIDTH-strlen("PRINTER HALTED") * 16) / 2, 140, "PRINTER HALTED", 0xFFFF, 0x0000); - disp_string((TFT_WIDTH-strlen("Please Reset") * 16) / 2, 180, "Please Reset", 0xFFFF, 0x0000); + disp_string((TFT_WIDTH - strlen("PRINTER HALTED") * 16) / 2, 140, "PRINTER HALTED", 0xFFFF, 0x0000); + disp_string((TFT_WIDTH - strlen("Please Reset") * 16) / 2, 180, "Please Reset", 0xFFFF, 0x0000); } -void lv_clear_error_message() { - lv_obj_del(scr); -} +void lv_clear_error_message() { lv_obj_del(scr); } #endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp index 877947dad1e6..b356f5376a15 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp @@ -35,7 +35,7 @@ #include "../../../../gcode/queue.h" static lv_obj_t * scr; -static lv_obj_t * buttoType,*buttonStep,*buttonSpeed; +static lv_obj_t * buttoType, *buttonStep, *buttonSpeed; static lv_obj_t * labelType; static lv_obj_t * labelStep; static lv_obj_t * labelSpeed; @@ -43,109 +43,109 @@ static lv_obj_t * tempText; static lv_obj_t * ExtruText; #define ID_E_ADD 1 -#define ID_E_DEC 2 +#define ID_E_DEC 2 #define ID_E_TYPE 3 #define ID_E_STEP 4 -#define ID_E_SPEED 5 -#define ID_E_RETURN 6 +#define ID_E_SPEED 5 +#define ID_E_RETURN 6 static int32_t extructAmount; static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { - case ID_E_ADD: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) { - queue.enqueue_one_now(PSTR("G91")); - memset(public_buf_l, 0, sizeof(public_buf_l)); - sprintf((char *)public_buf_l, "G1 E%d F%d", uiCfg.extruStep, 60 * uiCfg.extruSpeed); - queue.enqueue_one_now(PSTR(public_buf_l)); - queue.enqueue_one_now(PSTR("G90")); - extructAmount += uiCfg.extruStep; - disp_extru_amount(); + case ID_E_ADD: + if (event == LV_EVENT_CLICKED) { } - } - break; - case ID_E_DEC: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius>= EXTRUDE_MINTEMP) { - queue.enqueue_one_now(PSTR("G91")); - memset(public_buf_l,0,sizeof(public_buf_l)); - sprintf((char *)public_buf_l, "G1 E%d F%d", 0-uiCfg.extruStep, 60 * uiCfg.extruSpeed); - queue.enqueue_one_now(PSTR(public_buf_l)); - queue.enqueue_one_now(PSTR("G90")); - extructAmount -= uiCfg.extruStep; - disp_extru_amount(); + else if (event == LV_EVENT_RELEASED) { + if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) { + queue.enqueue_one_now(PSTR("G91")); + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf((char *)public_buf_l, "G1 E%d F%d", uiCfg.extruStep, 60 * uiCfg.extruSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + extructAmount += uiCfg.extruStep; + disp_extru_amount(); + } } - } - break; - case ID_E_TYPE: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - if (EXTRUDERS == 2) { - if (uiCfg.curSprayerChoose == 0) { - uiCfg.curSprayerChoose = 1; - queue.inject_P(PSTR("T1")); + break; + case ID_E_DEC: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) { + queue.enqueue_one_now(PSTR("G91")); + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf((char *)public_buf_l, "G1 E%d F%d", 0 - uiCfg.extruStep, 60 * uiCfg.extruSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + extructAmount -= uiCfg.extruStep; + disp_extru_amount(); + } + } + break; + case ID_E_TYPE: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (EXTRUDERS == 2) { + if (uiCfg.curSprayerChoose == 0) { + uiCfg.curSprayerChoose = 1; + queue.inject_P(PSTR("T1")); + } + else { + uiCfg.curSprayerChoose = 0; + queue.inject_P(PSTR("T0")); + } } else { uiCfg.curSprayerChoose = 0; - queue.inject_P(PSTR("T0")); } + extructAmount = 0; + disp_hotend_temp(); + disp_ext_type(); + disp_extru_amount(); } - else { - uiCfg.curSprayerChoose = 0; + break; + case ID_E_STEP: + if (event == LV_EVENT_CLICKED) { } - extructAmount = 0; - disp_hotend_temp(); - disp_ext_type(); - disp_extru_amount(); - } - break; - case ID_E_STEP: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - switch (abs(uiCfg.extruStep)) { - case 1: uiCfg.extruStep = 5; break; - case 5: uiCfg.extruStep = 10; break; - case 10: uiCfg.extruStep = 1; break; - default: break; + else if (event == LV_EVENT_RELEASED) { + switch (abs(uiCfg.extruStep)) { + case 1: uiCfg.extruStep = 5; break; + case 5: uiCfg.extruStep = 10; break; + case 10: uiCfg.extruStep = 1; break; + default: break; + } + disp_ext_step(); } - disp_ext_step(); - } - break; - case ID_E_SPEED: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - switch (uiCfg.extruSpeed) { - case 1: uiCfg.extruSpeed = 10; break; - case 10: uiCfg.extruSpeed = 20; break; - case 20: uiCfg.extruSpeed = 1; break; - default: break; + break; + case ID_E_SPEED: + if (event == LV_EVENT_CLICKED) { } - disp_ext_speed(); - } - break; - case ID_E_RETURN: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } - break; + else if (event == LV_EVENT_RELEASED) { + switch (uiCfg.extruSpeed) { + case 1: uiCfg.extruSpeed = 10; break; + case 10: uiCfg.extruSpeed = 20; break; + case 20: uiCfg.extruSpeed = 1; break; + default: break; + } + disp_ext_speed(); + } + break; + case ID_E_RETURN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; } } void lv_draw_extrusion(void) { - lv_obj_t *buttonAdd,*buttonDec,*buttonBack; + lv_obj_t *buttonAdd, *buttonDec, *buttonBack; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != EXTRUSION_UI) { disp_state_stack._disp_index++; @@ -161,7 +161,7 @@ void lv_draw_extrusion(void) { lv_obj_t * title = lv_label_create(scr, NULL); lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); @@ -176,7 +176,7 @@ void lv_draw_extrusion(void) { buttonSpeed = lv_imgbtn_create(scr, NULL); buttonBack = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonAdd, event_handler,ID_E_ADD,"bmp_In.bin",0); + lv_obj_set_event_cb_mks(buttonAdd, event_handler, ID_E_ADD, "bmp_In.bin", 0); lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); @@ -184,7 +184,7 @@ void lv_draw_extrusion(void) { lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); #if 1 - lv_obj_set_event_cb_mks(buttonDec, event_handler,ID_E_DEC,"bmp_Out.bin",0); + lv_obj_set_event_cb_mks(buttonDec, event_handler, ID_E_DEC, "bmp_Out.bin", 0); lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); @@ -205,19 +205,19 @@ void lv_draw_extrusion(void) { lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_E_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_E_RETURN, "bmp_Return.bin", 0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif - lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttoType,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonStep,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonSpeed,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonAdd, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonDec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttoType, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonStep, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonSpeed, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); /*Create a label on the Image button*/ lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); @@ -236,13 +236,13 @@ void lv_draw_extrusion(void) { if (gCfgItems.multiple_language != 0) { lv_label_set_text(labelAdd, extrude_menu.in); - lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); lv_label_set_text(labelDec, extrude_menu.out); - lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } disp_ext_type(); @@ -260,41 +260,41 @@ void lv_draw_extrusion(void) { void disp_ext_type() { if (uiCfg.curSprayerChoose == 1) { - lv_obj_set_event_cb_mks(buttoType, event_handler,ID_E_TYPE,"bmp_Extru2.bin",0); + lv_obj_set_event_cb_mks(buttoType, event_handler, ID_E_TYPE, "bmp_Extru2.bin", 0); if (gCfgItems.multiple_language != 0) { lv_label_set_text(labelType, extrude_menu.ext2); - lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } } else { - lv_obj_set_event_cb_mks(buttoType, event_handler,ID_E_TYPE,"bmp_Extru1.bin",0); + lv_obj_set_event_cb_mks(buttoType, event_handler, ID_E_TYPE, "bmp_Extru1.bin", 0); if (gCfgItems.multiple_language != 0) { lv_label_set_text(labelType, extrude_menu.ext1); - lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } } } void disp_ext_speed() { if (uiCfg.extruSpeed == 20) - lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_high.bin",0); + lv_obj_set_event_cb_mks(buttonSpeed, event_handler, ID_E_SPEED, "bmp_Speed_high.bin", 0); else if (uiCfg.extruSpeed == 1) - lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_slow.bin",0); + lv_obj_set_event_cb_mks(buttonSpeed, event_handler, ID_E_SPEED, "bmp_Speed_slow.bin", 0); else - lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_E_SPEED,"bmp_Speed_normal.bin",0); + lv_obj_set_event_cb_mks(buttonSpeed, event_handler, ID_E_SPEED, "bmp_Speed_normal.bin", 0); if (gCfgItems.multiple_language != 0) { if (uiCfg.extruSpeed == 20) { lv_label_set_text(labelSpeed, extrude_menu.high); - lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } else if (uiCfg.extruSpeed == 1) { lv_label_set_text(labelSpeed, extrude_menu.low); - lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } else { lv_label_set_text(labelSpeed, extrude_menu.normal); - lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } } } @@ -302,11 +302,11 @@ void disp_ext_speed() { void disp_hotend_temp() { char buf[20] = {0}; public_buf_l[0] = '\0'; - strcat(public_buf_l,extrude_menu.temper_text); + strcat(public_buf_l, extrude_menu.temper_text); sprintf(buf, extrude_menu.temp_value, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); - strcat(public_buf_l,buf); + strcat(public_buf_l, buf); lv_label_set_text(tempText, public_buf_l); - lv_obj_align(tempText, NULL, LV_ALIGN_CENTER,0, -50); + lv_obj_align(tempText, NULL, LV_ALIGN_CENTER, 0, -50); } void disp_extru_amount() { @@ -323,24 +323,24 @@ void disp_extru_amount() { strcat(public_buf_l, buf1); } else if (extructAmount < 9999 && extructAmount > -999) { - sprintf(buf1, extrude_menu.count_value_cm, extructAmount/10); + sprintf(buf1, extrude_menu.count_value_cm, extructAmount / 10); if (uiCfg.curSprayerChoose < 1) strcat(public_buf_l, extrude_menu.ext1); else strcat(public_buf_l, extrude_menu.ext2); - strcat(public_buf_l,buf1); + strcat(public_buf_l, buf1); } else { - sprintf(buf1, extrude_menu.count_value_m, extructAmount/1000); + sprintf(buf1, extrude_menu.count_value_m, extructAmount / 1000); if (uiCfg.curSprayerChoose < 1) strcat(public_buf_l, extrude_menu.ext1); else strcat(public_buf_l, extrude_menu.ext2); - strcat(public_buf_l,buf1); + strcat(public_buf_l, buf1); } lv_label_set_text(ExtruText, public_buf_l); - lv_obj_align(ExtruText, NULL, LV_ALIGN_CENTER,0, -75); + lv_obj_align(ExtruText, NULL, LV_ALIGN_CENTER, 0, -75); } void disp_ext_step() { @@ -354,21 +354,19 @@ void disp_ext_step() { if (gCfgItems.multiple_language != 0) { if (uiCfg.extruStep == 1) { lv_label_set_text(labelStep, extrude_menu.step_1mm); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } else if (uiCfg.extruStep == 5) { lv_label_set_text(labelStep, extrude_menu.step_5mm); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } else if (uiCfg.extruStep == 10) { lv_label_set_text(labelStep, extrude_menu.step_10mm); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } } } -void lv_clear_extrusion() { - lv_obj_del(scr); -} +void lv_clear_extrusion() { lv_obj_del(scr); } #endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp index 85ff3580cfc1..60a9031154c4 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp @@ -46,7 +46,7 @@ static lv_obj_t * fanText; static uint8_t fanSpeed; -static void event_handler(lv_obj_t * obj, lv_event_t event){ +static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_F_ADD: if (event == LV_EVENT_CLICKED) { @@ -106,7 +106,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event){ } -void lv_draw_fan(void){ +void lv_draw_fan(void) { lv_obj_t *buttonAdd, *buttonDec, *buttonHigh, *buttonMid; lv_obj_t *buttonOff, *buttonBack; @@ -225,7 +225,7 @@ void lv_draw_fan(void){ disp_fan_value(); } -void disp_fan_value(){ +void disp_fan_value() { char buf1[10] = {0}; public_buf_l[0] = '\0'; strcat(public_buf_l, fan_menu.state); @@ -236,8 +236,6 @@ void disp_fan_value(){ lv_obj_align(fanText, NULL, LV_ALIGN_CENTER, 0, -65); } -void lv_clear_fan(){ - lv_obj_del(scr); -} +void lv_clear_fan() { lv_obj_del(scr); } #endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp index e3d35789fda0..79f550afefe8 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp @@ -207,7 +207,7 @@ void lv_draw_home(void) { lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - #endif // if 1 + #endif /*lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); lv_obj_set_pos(buttonFan,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); lv_obj_set_pos(buttonAbout,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp index 1ae937059446..074a0bbc3e58 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp @@ -23,367 +23,341 @@ #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../../../../MarlinCore.h" #include "lv_conf.h" +#include "draw_ui.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "draw_ui.h" + +#include "../../../../MarlinCore.h" #include //static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn; +#define ID_CN 1 +#define ID_T_CN 2 +#define ID_EN 3 +#define ID_RU 4 +#define ID_ES 5 +#define ID_FR 6 +#define ID_IT 7 +#define ID_L_RETURN 8 -#define ID_CN 1 -#define ID_T_CN 2 -#define ID_EN 3 -#define ID_RU 4 -#define ID_ES 5 -#define ID_FR 6 -#define ID_IT 7 -#define ID_L_RETURN 8 - -#define SELECTED 1 -#define UNSELECTED 0 - -static void disp_language(uint8_t language,uint8_t state); +#define SELECTED 1 +#define UNSELECTED 0 +static void disp_language(uint8_t language, uint8_t state); static lv_obj_t * scr; - - -static lv_obj_t *buttonCN,*buttonT_CN,*buttonEN,*buttonRU; -static lv_obj_t *buttonES,*buttonFR,*buttonIT,*buttonBack; - -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - switch (obj->mks_obj_id) - { - case ID_CN: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - disp_language(gCfgItems.language,UNSELECTED); - lv_obj_set_event_cb_mks(buttonCN, event_handler,ID_CN,"bmp_Simple_cn_sel.bin",0); - gCfgItems.language = LANG_SIMPLE_CHINESE; - gCfg_to_spiFlah(); - disp_language_init(); - } - break; - case ID_T_CN: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - disp_language(gCfgItems.language,UNSELECTED); - lv_obj_set_event_cb_mks(buttonT_CN, event_handler,ID_T_CN,"bmp_Tradition_cn_sel.bin",0); - gCfgItems.language = LANG_COMPLEX_CHINESE; - gCfg_to_spiFlah(); - disp_language_init(); - } - break; - case ID_EN: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - disp_language(gCfgItems.language,UNSELECTED); - lv_obj_set_event_cb_mks(buttonEN, event_handler,ID_EN,"bmp_English_sel.bin",0); - gCfgItems.language = LANG_ENGLISH; - gCfg_to_spiFlah(); - disp_language_init(); - } - break; - case ID_RU: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - disp_language(gCfgItems.language,UNSELECTED); - lv_obj_set_event_cb_mks(buttonRU, event_handler,ID_RU,"bmp_Russian_sel.bin",0); - gCfgItems.language = LANG_RUSSIAN; - gCfg_to_spiFlah(); - disp_language_init(); - } - break; - case ID_ES: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - disp_language(gCfgItems.language,UNSELECTED); - lv_obj_set_event_cb_mks(buttonES, event_handler,ID_ES,"bmp_Spanish_sel.bin",0); - gCfgItems.language = LANG_SPANISH; - gCfg_to_spiFlah(); - disp_language_init(); - } - break; - case ID_FR: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - disp_language(gCfgItems.language,UNSELECTED); - lv_obj_set_event_cb_mks(buttonFR, event_handler,ID_FR,"bmp_French_sel.bin",0); - gCfgItems.language = LANG_FRENCH; - gCfg_to_spiFlah(); - disp_language_init(); - } - break; - case ID_IT: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - disp_language(gCfgItems.language,UNSELECTED); - lv_obj_set_event_cb_mks(buttonIT, event_handler,ID_FR,"bmp_Italy_sel.bin",0); - gCfgItems.language = LANG_ITALY; - gCfg_to_spiFlah(); - disp_language_init(); - } - break; - case ID_L_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - - buttonCN = NULL; - buttonT_CN = NULL; - buttonEN = NULL; - buttonRU = NULL; - buttonES = NULL; - buttonFR = NULL; - buttonFR = NULL; - buttonIT = NULL; - buttonBack = NULL; - - lv_obj_del(scr); - lv_draw_set(); - } - break; - - } +static lv_obj_t *buttonCN, *buttonT_CN, *buttonEN, *buttonRU; +static lv_obj_t *buttonES, *buttonFR, *buttonIT, *buttonBack; + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_CN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language, UNSELECTED); + lv_obj_set_event_cb_mks(buttonCN, event_handler, ID_CN, "bmp_Simple_cn_sel.bin", 0); + gCfgItems.language = LANG_SIMPLE_CHINESE; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_T_CN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language, UNSELECTED); + lv_obj_set_event_cb_mks(buttonT_CN, event_handler, ID_T_CN, "bmp_Tradition_cn_sel.bin", 0); + gCfgItems.language = LANG_COMPLEX_CHINESE; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_EN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language, UNSELECTED); + lv_obj_set_event_cb_mks(buttonEN, event_handler, ID_EN, "bmp_English_sel.bin", 0); + gCfgItems.language = LANG_ENGLISH; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_RU: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language, UNSELECTED); + lv_obj_set_event_cb_mks(buttonRU, event_handler, ID_RU, "bmp_Russian_sel.bin", 0); + gCfgItems.language = LANG_RUSSIAN; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_ES: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language, UNSELECTED); + lv_obj_set_event_cb_mks(buttonES, event_handler, ID_ES, "bmp_Spanish_sel.bin", 0); + gCfgItems.language = LANG_SPANISH; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_FR: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language, UNSELECTED); + lv_obj_set_event_cb_mks(buttonFR, event_handler, ID_FR, "bmp_French_sel.bin", 0); + gCfgItems.language = LANG_FRENCH; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_IT: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + disp_language(gCfgItems.language, UNSELECTED); + lv_obj_set_event_cb_mks(buttonIT, event_handler, ID_FR, "bmp_Italy_sel.bin", 0); + gCfgItems.language = LANG_ITALY; + gCfg_to_spiFlah(); + disp_language_init(); + } + break; + case ID_L_RETURN: + if (event == LV_EVENT_CLICKED) { + + } + else if (event == LV_EVENT_RELEASED) { + + buttonCN = NULL; + buttonT_CN = NULL; + buttonEN = NULL; + buttonRU = NULL; + buttonES = NULL; + buttonFR = NULL; + buttonFR = NULL; + buttonIT = NULL; + buttonBack = NULL; + + lv_obj_del(scr); + lv_draw_set(); + } + break; + + } } -static void disp_language(uint8_t language,uint8_t state) -{ - uint16_t id; - lv_obj_t *obj; - - public_buf_l[0] = '\0'; - - switch (language){ - - case LANG_SIMPLE_CHINESE: - id = ID_CN; - strcat(public_buf_l,"bmp_Simple_cn"); - obj = buttonCN; - - break; - case LANG_COMPLEX_CHINESE: - id = ID_T_CN; - strcat(public_buf_l,"bmp_Tradition_cn"); - obj = buttonT_CN; - break; - case LANG_ENGLISH: - id = ID_EN; - strcat(public_buf_l,"bmp_English"); - obj = buttonEN; - break; - case LANG_RUSSIAN: - id = ID_RU; - strcat(public_buf_l,"bmp_Russian"); - obj = buttonRU; - break; - case LANG_SPANISH: - id = ID_ES; - strcat(public_buf_l,"bmp_Spanish"); - obj = buttonES; - break; - case LANG_FRENCH: - id = ID_FR; - strcat(public_buf_l,"bmp_French"); - obj = buttonFR; - break; - case LANG_ITALY: - id = ID_IT; - strcat(public_buf_l,"bmp_Italy"); - obj = buttonIT; - break; - default: - id = ID_CN; - strcat(public_buf_l,"bmp_Simple_cn"); - obj = buttonCN; - break; - } - - if (state == SELECTED) strcat(public_buf_l,"_sel.bin"); - else strcat(public_buf_l,".bin"); - - lv_obj_set_event_cb_mks(obj, event_handler,id,public_buf_l,0); - - if (state == UNSELECTED)lv_obj_refresh_ext_draw_pad(obj); +static void disp_language(uint8_t language, uint8_t state) { + uint16_t id; + lv_obj_t *obj; + + public_buf_l[0] = '\0'; + + switch (language) { + + case LANG_SIMPLE_CHINESE: + id = ID_CN; + strcat(public_buf_l, "bmp_Simple_cn"); + obj = buttonCN; + + break; + case LANG_COMPLEX_CHINESE: + id = ID_T_CN; + strcat(public_buf_l, "bmp_Tradition_cn"); + obj = buttonT_CN; + break; + case LANG_ENGLISH: + id = ID_EN; + strcat(public_buf_l, "bmp_English"); + obj = buttonEN; + break; + case LANG_RUSSIAN: + id = ID_RU; + strcat(public_buf_l, "bmp_Russian"); + obj = buttonRU; + break; + case LANG_SPANISH: + id = ID_ES; + strcat(public_buf_l, "bmp_Spanish"); + obj = buttonES; + break; + case LANG_FRENCH: + id = ID_FR; + strcat(public_buf_l, "bmp_French"); + obj = buttonFR; + break; + case LANG_ITALY: + id = ID_IT; + strcat(public_buf_l, "bmp_Italy"); + obj = buttonIT; + break; + default: + id = ID_CN; + strcat(public_buf_l, "bmp_Simple_cn"); + obj = buttonCN; + break; + } + + if (state == SELECTED) strcat(public_buf_l, "_sel.bin"); + else strcat(public_buf_l, ".bin"); + + lv_obj_set_event_cb_mks(obj, event_handler, id, public_buf_l, 0); + + if (state == UNSELECTED) lv_obj_refresh_ext_draw_pad(obj); } -void lv_draw_language(void) -{ +void lv_draw_language(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != LANGUAGE_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = LANGUAGE_UI; - } - disp_state = LANGUAGE_UI; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != LANGUAGE_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = LANGUAGE_UI; + } + disp_state = LANGUAGE_UI; - scr = lv_obj_create(NULL, NULL); + scr = lv_obj_create(NULL, NULL); - //static lv_style_t tool_style; + //static lv_style_t tool_style; - lv_obj_set_style(scr, &tft_style_scr); + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - LV_IMG_DECLARE(bmp_pic); - - /*Create an Image button*/ - buttonCN = lv_imgbtn_create(scr, NULL); - buttonT_CN = lv_imgbtn_create(scr, NULL); - buttonEN = lv_imgbtn_create(scr, NULL); - buttonRU = lv_imgbtn_create(scr, NULL); - buttonES = lv_imgbtn_create(scr, NULL); - buttonFR = lv_imgbtn_create(scr, NULL); - buttonIT = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - - lv_obj_set_event_cb_mks(buttonCN, event_handler,ID_CN,"bmp_Simple_cn.bin",0); - lv_imgbtn_set_src(buttonCN, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonCN, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonCN, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonCN, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_clear_protect(buttonCN, LV_PROTECT_FOLLOW); - #if 1 - lv_obj_set_event_cb_mks(buttonT_CN, event_handler,ID_T_CN,"bmp_Tradition_cn.bin",0); - lv_imgbtn_set_src(buttonT_CN, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonT_CN, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonT_CN, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonT_CN, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonEN, event_handler,ID_EN,"bmp_English.bin",0); + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonCN = lv_imgbtn_create(scr, NULL); + buttonT_CN = lv_imgbtn_create(scr, NULL); + buttonEN = lv_imgbtn_create(scr, NULL); + buttonRU = lv_imgbtn_create(scr, NULL); + buttonES = lv_imgbtn_create(scr, NULL); + buttonFR = lv_imgbtn_create(scr, NULL); + buttonIT = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + + lv_obj_set_event_cb_mks(buttonCN, event_handler, ID_CN, "bmp_Simple_cn.bin", 0); + lv_imgbtn_set_src(buttonCN, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonCN, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonCN, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonCN, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonCN, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonT_CN, event_handler, ID_T_CN, "bmp_Tradition_cn.bin", 0); + lv_imgbtn_set_src(buttonT_CN, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonT_CN, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonT_CN, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonT_CN, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonEN, event_handler, ID_EN, "bmp_English.bin", 0); lv_imgbtn_set_src(buttonEN, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonEN, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonEN, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonEN, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonEN, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonEN, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonRU, event_handler,ID_RU,"bmp_Russian.bin",0); + lv_obj_set_event_cb_mks(buttonRU, event_handler, ID_RU, "bmp_Russian.bin", 0); lv_imgbtn_set_src(buttonRU, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonRU, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonRU, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonRU, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonRU, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonRU, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonES, event_handler,ID_ES,"bmp_Spanish.bin",0); + lv_obj_set_event_cb_mks(buttonES, event_handler, ID_ES, "bmp_Spanish.bin", 0); lv_imgbtn_set_src(buttonES, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonES, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonES, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonES, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonES, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonES, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonFR, event_handler,ID_FR,"bmp_French.bin",0); + lv_obj_set_event_cb_mks(buttonFR, event_handler, ID_FR, "bmp_French.bin", 0); lv_imgbtn_set_src(buttonFR, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonFR, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonFR, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonFR, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonFR, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonFR, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonIT, event_handler,ID_IT,"bmp_Italy.bin",0); + lv_obj_set_event_cb_mks(buttonIT, event_handler, ID_IT, "bmp_Italy.bin", 0); lv_imgbtn_set_src(buttonIT, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonIT, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonIT, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonIT, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonIT, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonIT, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_L_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_L_RETURN, "bmp_Return.bin", 0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - - #endif - - lv_obj_set_pos(buttonCN,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonT_CN,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); - lv_obj_set_pos(buttonEN,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); - lv_obj_set_pos(buttonRU,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttonES,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonFR,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonIT,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - - /*Create a label on the Image button*/ - lv_btn_set_layout(buttonCN, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonT_CN, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonEN, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonRU, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonES, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonFR, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonIT, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t * label_CN = lv_label_create(buttonCN, NULL); - lv_obj_t * label_T_CN = lv_label_create(buttonT_CN, NULL); - lv_obj_t * label_EN = lv_label_create(buttonEN, NULL); - lv_obj_t * label_RU = lv_label_create(buttonRU, NULL); - lv_obj_t * label_ES = lv_label_create(buttonES, NULL); - lv_obj_t * label_FR= lv_label_create(buttonFR, NULL); - lv_obj_t * label_IT = lv_label_create(buttonIT, NULL); - lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - disp_language(gCfgItems.language,SELECTED); - - if (gCfgItems.multiple_language !=0) - { - lv_label_set_text(label_CN, language_menu.chinese_s); - lv_obj_align(label_CN, buttonCN, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_T_CN, language_menu.chinese_t); - lv_obj_align(label_T_CN, buttonT_CN, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_EN, language_menu.english); - lv_obj_align(label_EN, buttonEN, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_RU, language_menu.russian); - lv_obj_align(label_RU, buttonRU, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_ES, language_menu.spanish); - lv_obj_align(label_ES, buttonES, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_FR, language_menu.french); - lv_obj_align(label_FR, buttonFR, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_IT, language_menu.italy); - lv_obj_align(label_IT, buttonIT, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif + + lv_obj_set_pos(buttonCN, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonT_CN, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); + lv_obj_set_pos(buttonEN, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); + lv_obj_set_pos(buttonRU, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonES, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonFR, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonIT, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonCN, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonT_CN, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonEN, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonRU, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonES, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonFR, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonIT, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * label_CN = lv_label_create(buttonCN, NULL); + lv_obj_t * label_T_CN = lv_label_create(buttonT_CN, NULL); + lv_obj_t * label_EN = lv_label_create(buttonEN, NULL); + lv_obj_t * label_RU = lv_label_create(buttonRU, NULL); + lv_obj_t * label_ES = lv_label_create(buttonES, NULL); + lv_obj_t * label_FR = lv_label_create(buttonFR, NULL); + lv_obj_t * label_IT = lv_label_create(buttonIT, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + disp_language(gCfgItems.language, SELECTED); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(label_CN, language_menu.chinese_s); + lv_obj_align(label_CN, buttonCN, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_T_CN, language_menu.chinese_t); + lv_obj_align(label_T_CN, buttonT_CN, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_EN, language_menu.english); + lv_obj_align(label_EN, buttonEN, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_RU, language_menu.russian); + lv_obj_align(label_RU, buttonRU, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_ES, language_menu.spanish); + lv_obj_align(label_ES, buttonES, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_FR, language_menu.french); + lv_obj_align(label_FR, buttonFR, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_IT, language_menu.italy); + lv_obj_align(label_IT, buttonIT, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } } -void lv_clear_language() -{ - lv_obj_del(scr); -} -#endif +void lv_clear_language() { lv_obj_del(scr); } + +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp index 09ad3ed82b02..4cc59ea5b35a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp @@ -35,274 +35,244 @@ //static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn; static lv_obj_t * scr; -#define ID_M_POINT1 1 -#define ID_M_POINT2 2 -#define ID_M_POINT3 3 -#define ID_M_POINT4 4 -#define ID_M_POINT5 5 - -#define ID_MANUAL_RETURN 6 - -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - switch (obj->mks_obj_id) - { - case ID_M_POINT1: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - - if (queue.length == 0) - { - if (uiCfg.leveling_first_time) - { - queue.enqueue_one_P(PSTR("G28")); - uiCfg.leveling_first_time = 0; - } - - queue.enqueue_one_P(PSTR("G1 Z10")); - - memset(public_buf_l,0,sizeof(public_buf_l)); - sprintf(public_buf_l, "G1 X%d Y%d",X_MIN_POS+30, Y_MIN_POS+30); - queue.enqueue_one_P(PSTR(public_buf_l)); - queue.enqueue_one_P(PSTR("G1 Z0")); - } - } - break; - case ID_M_POINT2: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length == 0) - { - if (uiCfg.leveling_first_time) - { - queue.enqueue_one_P(PSTR("G28")); - uiCfg.leveling_first_time = 0; - } - - queue.enqueue_one_P(PSTR("G1 Z10")); - - memset(public_buf_l,0,sizeof(public_buf_l)); - sprintf(public_buf_l, "G1 X%d Y%d",X_MAX_POS-30, Y_MIN_POS+30); - queue.enqueue_one_P(PSTR(public_buf_l)); - queue.enqueue_one_P(PSTR("G1 Z0")); - } - } - break; - case ID_M_POINT3: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length == 0) - { - if (uiCfg.leveling_first_time) - { - queue.enqueue_one_P(PSTR("G28")); - uiCfg.leveling_first_time = 0; - } - - queue.enqueue_one_P(PSTR("G1 Z10")); - - memset(public_buf_l,0,sizeof(public_buf_l)); - sprintf(public_buf_l, "G1 X%d Y%d",X_MAX_POS-30, Y_MAX_POS-30); - queue.enqueue_one_P(PSTR(public_buf_l)); - queue.enqueue_one_P(PSTR("G1 Z0")); - } - } - - break; - case ID_M_POINT4: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length == 0) - { - if (uiCfg.leveling_first_time) - { - queue.enqueue_one_P(PSTR("G28")); - uiCfg.leveling_first_time = 0; - } - - queue.enqueue_one_P(PSTR("G1 Z10")); - - memset(public_buf_l,0,sizeof(public_buf_l)); - sprintf(public_buf_l, "G1 X%d Y%d",X_MIN_POS+30, Y_MAX_POS-30); - queue.enqueue_one_P(PSTR(public_buf_l)); - queue.enqueue_one_P(PSTR("G1 Z0")); - } - } - break; - case ID_M_POINT5: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length == 0) - { - if (uiCfg.leveling_first_time) - { - queue.enqueue_one_P(PSTR("G28")); - uiCfg.leveling_first_time = 0; - } - - queue.enqueue_one_P(PSTR("G1 Z10")); - - memset(public_buf_l,0,sizeof(public_buf_l)); - sprintf(public_buf_l, "G1 X%d Y%d",X_BED_SIZE/2, Y_BED_SIZE/2); - queue.enqueue_one_P(PSTR(public_buf_l)); - queue.enqueue_one_P(PSTR("G1 Z0")); - } - } - - break; - case ID_MANUAL_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_manualLevel(); - lv_draw_tool(); - } - break; - - } +#define ID_M_POINT1 1 +#define ID_M_POINT2 2 +#define ID_M_POINT3 3 +#define ID_M_POINT4 4 +#define ID_M_POINT5 5 + +#define ID_MANUAL_RETURN 6 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_M_POINT1: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_one_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_one_P(PSTR("G1 Z10")); + + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, "G1 X%d Y%d", X_MIN_POS + 30, Y_MIN_POS + 30); + queue.enqueue_one_P(PSTR(public_buf_l)); + queue.enqueue_one_P(PSTR("G1 Z0")); + } + } + break; + case ID_M_POINT2: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_one_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_one_P(PSTR("G1 Z10")); + + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, "G1 X%d Y%d", X_MAX_POS - 30, Y_MIN_POS + 30); + queue.enqueue_one_P(PSTR(public_buf_l)); + queue.enqueue_one_P(PSTR("G1 Z0")); + } + } + break; + case ID_M_POINT3: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_one_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_one_P(PSTR("G1 Z10")); + + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, "G1 X%d Y%d", X_MAX_POS - 30, Y_MAX_POS - 30); + queue.enqueue_one_P(PSTR(public_buf_l)); + queue.enqueue_one_P(PSTR("G1 Z0")); + } + } + + break; + case ID_M_POINT4: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_one_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_one_P(PSTR("G1 Z10")); + + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, "G1 X%d Y%d", X_MIN_POS + 30, Y_MAX_POS - 30); + queue.enqueue_one_P(PSTR(public_buf_l)); + queue.enqueue_one_P(PSTR("G1 Z0")); + } + } + break; + case ID_M_POINT5: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_one_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; + } + + queue.enqueue_one_P(PSTR("G1 Z10")); + + memset(public_buf_l, 0, sizeof(public_buf_l)); + sprintf(public_buf_l, "G1 X%d Y%d", X_BED_SIZE / 2, Y_BED_SIZE / 2); + queue.enqueue_one_P(PSTR(public_buf_l)); + queue.enqueue_one_P(PSTR("G1 Z0")); + } + } + + break; + case ID_MANUAL_RETURN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_manualLevel(); + lv_draw_tool(); + } + break; + + } } -void lv_draw_manualLevel(void) -{ - lv_obj_t *buttonPoint1,*buttonPoint2,*buttonPoint3,*buttonPoint4,*buttonPoint5; - lv_obj_t *buttonBack; +void lv_draw_manualLevel(void) { + lv_obj_t *buttonPoint1, *buttonPoint2, *buttonPoint3, *buttonPoint4, *buttonPoint5; + lv_obj_t *buttonBack; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != LEVELING_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = LEVELING_UI; - } - disp_state = LEVELING_UI; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != LEVELING_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = LEVELING_UI; + } + disp_state = LEVELING_UI; - scr = lv_obj_create(NULL, NULL); + scr = lv_obj_create(NULL, NULL); - //static lv_style_t tool_style; + //static lv_style_t tool_style; - lv_obj_set_style(scr, &tft_style_scr); + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - LV_IMG_DECLARE(bmp_pic); - - /*Create an Image button*/ - buttonPoint1 = lv_imgbtn_create(scr, NULL); - buttonPoint2 = lv_imgbtn_create(scr, NULL); - buttonPoint3 = lv_imgbtn_create(scr, NULL); - buttonPoint4 = lv_imgbtn_create(scr, NULL); - buttonPoint5 = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - - lv_obj_set_event_cb_mks(buttonPoint1, event_handler,ID_M_POINT1,"bmp_Leveling1.bin",0); - lv_imgbtn_set_src(buttonPoint1, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonPoint1, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonPoint1, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonPoint1, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_clear_protect(buttonPoint1, LV_PROTECT_FOLLOW); - #if 1 - lv_obj_set_event_cb_mks(buttonPoint2, event_handler,ID_M_POINT2,"bmp_Leveling2.bin",0); - lv_imgbtn_set_src(buttonPoint2, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonPoint2, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonPoint2, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonPoint2, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonPoint3, event_handler,ID_M_POINT3,"bmp_Leveling3.bin",0); + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonPoint1 = lv_imgbtn_create(scr, NULL); + buttonPoint2 = lv_imgbtn_create(scr, NULL); + buttonPoint3 = lv_imgbtn_create(scr, NULL); + buttonPoint4 = lv_imgbtn_create(scr, NULL); + buttonPoint5 = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonPoint1, event_handler, ID_M_POINT1, "bmp_Leveling1.bin", 0); + lv_imgbtn_set_src(buttonPoint1, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPoint1, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPoint1, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPoint1, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonPoint1, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonPoint2, event_handler, ID_M_POINT2, "bmp_Leveling2.bin", 0); + lv_imgbtn_set_src(buttonPoint2, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPoint2, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPoint2, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPoint2, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonPoint3, event_handler, ID_M_POINT3, "bmp_Leveling3.bin", 0); lv_imgbtn_set_src(buttonPoint3, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonPoint3, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonPoint3, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonPoint3, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonPoint3, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPoint3, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonPoint4, event_handler,ID_M_POINT4,"bmp_Leveling4.bin",0); + lv_obj_set_event_cb_mks(buttonPoint4, event_handler, ID_M_POINT4, "bmp_Leveling4.bin", 0); lv_imgbtn_set_src(buttonPoint4, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonPoint4, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonPoint4, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonPoint4, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonPoint4, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPoint4, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonPoint5, event_handler,ID_M_POINT5,"bmp_Leveling5.bin",0); + lv_obj_set_event_cb_mks(buttonPoint5, event_handler, ID_M_POINT5, "bmp_Leveling5.bin", 0); lv_imgbtn_set_src(buttonPoint5, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonPoint5, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonPoint5, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonPoint5, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonPoint5, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPoint5, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_MANUAL_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_MANUAL_RETURN, "bmp_Return.bin", 0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - - #endif - - lv_obj_set_pos(buttonPoint1,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonPoint2,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); - lv_obj_set_pos(buttonPoint3,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); - lv_obj_set_pos(buttonPoint4,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttonPoint5,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - - /*Create a label on the Image button*/ - lv_btn_set_layout(buttonPoint1, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonPoint2, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonPoint3, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonPoint4, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonPoint5, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t * label_Point1 = lv_label_create(buttonPoint1, NULL); - lv_obj_t * label_Point2 = lv_label_create(buttonPoint2, NULL); - lv_obj_t * label_Point3 = lv_label_create(buttonPoint3, NULL); - lv_obj_t * label_Point4 = lv_label_create(buttonPoint4, NULL); - lv_obj_t * label_Point5 = lv_label_create(buttonPoint5, NULL); - lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - - if (gCfgItems.multiple_language !=0) - { - lv_label_set_text(label_Point1, leveling_menu.position1); - lv_obj_align(label_Point1, buttonPoint1, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Point2, leveling_menu.position2); - lv_obj_align(label_Point2, buttonPoint2, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Point3, leveling_menu.position3); - lv_obj_align(label_Point3, buttonPoint3, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Point4, leveling_menu.position4); - lv_obj_align(label_Point4, buttonPoint4, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Point5, leveling_menu.position5); - lv_obj_align(label_Point5, buttonPoint5, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif + + lv_obj_set_pos(buttonPoint1, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonPoint2, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); + lv_obj_set_pos(buttonPoint3, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); + lv_obj_set_pos(buttonPoint4, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonPoint5, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonPoint1, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPoint2, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPoint3, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPoint4, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPoint5, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * label_Point1 = lv_label_create(buttonPoint1, NULL); + lv_obj_t * label_Point2 = lv_label_create(buttonPoint2, NULL); + lv_obj_t * label_Point3 = lv_label_create(buttonPoint3, NULL); + lv_obj_t * label_Point4 = lv_label_create(buttonPoint4, NULL); + lv_obj_t * label_Point5 = lv_label_create(buttonPoint5, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(label_Point1, leveling_menu.position1); + lv_obj_align(label_Point1, buttonPoint1, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Point2, leveling_menu.position2); + lv_obj_align(label_Point2, buttonPoint2, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Point3, leveling_menu.position3); + lv_obj_align(label_Point3, buttonPoint3, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Point4, leveling_menu.position4); + lv_obj_align(label_Point4, buttonPoint4, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Point5, leveling_menu.position5); + lv_obj_align(label_Point5, buttonPoint5, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } } -void lv_clear_manualLevel() -{ - lv_obj_del(scr); -} -#endif +void lv_clear_manualLevel() { lv_obj_del(scr); } + +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp index 50ea4b925bf0..6cde142d9bf7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp @@ -34,330 +34,288 @@ static lv_obj_t * scr; -static lv_obj_t * labelV,*buttonV; - -#define ID_M_X_P 1 -#define ID_M_X_N 2 -#define ID_M_Y_P 3 -#define ID_M_Y_N 4 -#define ID_M_Z_P 5 -#define ID_M_Z_N 6 -#define ID_M_STEP 7 -#define ID_M_RETURN 8 - -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - switch (obj->mks_obj_id) - { - case ID_M_X_P: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length <= (BUFSIZE-3)) - { - memset(public_buf_l,0,sizeof(public_buf_l)); - queue.enqueue_one_P(PSTR("G91")); - sprintf(public_buf_l, "G1 X%3.1f F%d",uiCfg.move_dist, uiCfg.moveSpeed); - queue.enqueue_one_P(PSTR(public_buf_l)); - queue.enqueue_one_P(PSTR("G90")); - } - } - break; - case ID_M_X_N: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length <= (BUFSIZE-3)) - { - memset(public_buf_l,0,sizeof(public_buf_l)); - queue.enqueue_one_now(PSTR("G91")); - sprintf(public_buf_l, "G1 X-%3.1f F%d",uiCfg.move_dist, uiCfg.moveSpeed); - queue.enqueue_one_now(PSTR(public_buf_l)); - queue.enqueue_one_now(PSTR("G90")); - } - } - break; - case ID_M_Y_P: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length <= (BUFSIZE-3)) - { - memset(public_buf_l,0,sizeof(public_buf_l)); - queue.enqueue_one_now(PSTR("G91")); - sprintf(public_buf_l, "G1 Y%3.1f F%d",uiCfg.move_dist, uiCfg.moveSpeed); - queue.enqueue_one_now(PSTR(public_buf_l)); - queue.enqueue_one_now(PSTR("G90")); - } - } - break; - case ID_M_Y_N: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length <= (BUFSIZE-3)) - { - memset(public_buf_l,0,sizeof(public_buf_l)); - queue.enqueue_one_now(PSTR("G91")); - sprintf(public_buf_l, "G1 Y-%3.1f F%d",uiCfg.move_dist, uiCfg.moveSpeed); - queue.enqueue_one_now(PSTR(public_buf_l)); - queue.enqueue_one_now(PSTR("G90")); - } - } - break; - case ID_M_Z_P: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length <= (BUFSIZE-3)) - { - memset(public_buf_l,0,sizeof(public_buf_l)); - queue.enqueue_one_now(PSTR("G91")); - sprintf(public_buf_l, "G1 Z%3.1f F%d",uiCfg.move_dist, uiCfg.moveSpeed); - queue.enqueue_one_now(PSTR(public_buf_l)); - queue.enqueue_one_now(PSTR("G90")); - } - } - break; - case ID_M_Z_N: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length <= (BUFSIZE-3)) - { - memset(public_buf_l,0,sizeof(public_buf_l)); - queue.enqueue_one_now(PSTR("G91")); - sprintf(public_buf_l, "G1 Z-%3.1f F%d",uiCfg.move_dist, uiCfg.moveSpeed); - queue.enqueue_one_now(PSTR(public_buf_l)); - queue.enqueue_one_now(PSTR("G90")); - } - } - break; - case ID_M_STEP: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (abs(10 * (int)uiCfg.move_dist) == 100) - { - uiCfg.move_dist = 0.1; - } - else - { - uiCfg.move_dist *= (float)10; - } - - disp_move_dist(); - } - - break; - case ID_M_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } - break; - - } +static lv_obj_t * labelV, *buttonV; + +#define ID_M_X_P 1 +#define ID_M_X_N 2 +#define ID_M_Y_P 3 +#define ID_M_Y_N 4 +#define ID_M_Z_P 5 +#define ID_M_Z_N 6 +#define ID_M_STEP 7 +#define ID_M_RETURN 8 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_M_X_P: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE - 3)) { + memset(public_buf_l, 0, sizeof(public_buf_l)); + queue.enqueue_one_P(PSTR("G91")); + sprintf(public_buf_l, "G1 X%3.1f F%d", uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_P(PSTR(public_buf_l)); + queue.enqueue_one_P(PSTR("G90")); + } + } + break; + case ID_M_X_N: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE - 3)) { + memset(public_buf_l, 0, sizeof(public_buf_l)); + queue.enqueue_one_now(PSTR("G91")); + sprintf(public_buf_l, "G1 X-%3.1f F%d", uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + } + } + break; + case ID_M_Y_P: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE - 3)) { + memset(public_buf_l, 0, sizeof(public_buf_l)); + queue.enqueue_one_now(PSTR("G91")); + sprintf(public_buf_l, "G1 Y%3.1f F%d", uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + } + } + break; + case ID_M_Y_N: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE - 3)) { + memset(public_buf_l, 0, sizeof(public_buf_l)); + queue.enqueue_one_now(PSTR("G91")); + sprintf(public_buf_l, "G1 Y-%3.1f F%d", uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + } + } + break; + case ID_M_Z_P: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE - 3)) { + memset(public_buf_l, 0, sizeof(public_buf_l)); + queue.enqueue_one_now(PSTR("G91")); + sprintf(public_buf_l, "G1 Z%3.1f F%d", uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + } + } + break; + case ID_M_Z_N: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (queue.length <= (BUFSIZE - 3)) { + memset(public_buf_l, 0, sizeof(public_buf_l)); + queue.enqueue_one_now(PSTR("G91")); + sprintf(public_buf_l, "G1 Z-%3.1f F%d", uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(PSTR(public_buf_l)); + queue.enqueue_one_now(PSTR("G90")); + } + } + break; + case ID_M_STEP: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (abs(10 * (int)uiCfg.move_dist) == 100) + uiCfg.move_dist = 0.1; + else + uiCfg.move_dist *= (float)10; + + disp_move_dist(); + } + + break; + case ID_M_RETURN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + + } } -void lv_draw_move_motor(void) -{ - lv_obj_t *buttonXI, *buttonXD, *buttonYI, *buttonYD; - lv_obj_t *buttonZI, *buttonZD, *buttonBack; +void lv_draw_move_motor(void) { + lv_obj_t *buttonXI, *buttonXD, *buttonYI, *buttonYD; + lv_obj_t *buttonZI, *buttonZD, *buttonBack; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MOVE_MOTOR_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = MOVE_MOTOR_UI; - } - disp_state = MOVE_MOTOR_UI; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MOVE_MOTOR_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = MOVE_MOTOR_UI; + } + disp_state = MOVE_MOTOR_UI; - scr = lv_obj_create(NULL, NULL); + scr = lv_obj_create(NULL, NULL); - lv_obj_set_style(scr, &tft_style_scr); + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - LV_IMG_DECLARE(bmp_pic); - - - /*Create an Image button*/ - buttonXI = lv_imgbtn_create(scr, NULL); - buttonXD = lv_imgbtn_create(scr, NULL); - buttonYI = lv_imgbtn_create(scr, NULL); - buttonYD = lv_imgbtn_create(scr, NULL); - buttonZI = lv_imgbtn_create(scr, NULL); - buttonZD = lv_imgbtn_create(scr, NULL); - buttonV = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonXI, event_handler,ID_M_X_P,"bmp_xAdd.bin",0); - lv_imgbtn_set_src(buttonXI, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonXI, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonXI, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonXI, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_clear_protect(buttonXI, LV_PROTECT_FOLLOW); - #if 1 - lv_obj_set_event_cb_mks(buttonXD, event_handler,ID_M_X_N,"bmp_xDec.bin",0); - lv_imgbtn_set_src(buttonXD, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonXD, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonXD, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonXD, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonYI, event_handler,ID_M_Y_P,"bmp_yAdd.bin",0); + LV_IMG_DECLARE(bmp_pic); + + + /*Create an Image button*/ + buttonXI = lv_imgbtn_create(scr, NULL); + buttonXD = lv_imgbtn_create(scr, NULL); + buttonYI = lv_imgbtn_create(scr, NULL); + buttonYD = lv_imgbtn_create(scr, NULL); + buttonZI = lv_imgbtn_create(scr, NULL); + buttonZD = lv_imgbtn_create(scr, NULL); + buttonV = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonXI, event_handler, ID_M_X_P, "bmp_xAdd.bin", 0); + lv_imgbtn_set_src(buttonXI, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonXI, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonXI, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonXI, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonXI, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonXD, event_handler, ID_M_X_N, "bmp_xDec.bin", 0); + lv_imgbtn_set_src(buttonXD, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonXD, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonXD, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonXD, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonYI, event_handler, ID_M_Y_P, "bmp_yAdd.bin", 0); lv_imgbtn_set_src(buttonYI, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonYI, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonYI, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonYI, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonYI, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonYI, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonYD, event_handler,ID_M_Y_N,"bmp_yDec.bin",0); + lv_obj_set_event_cb_mks(buttonYD, event_handler, ID_M_Y_N, "bmp_yDec.bin", 0); lv_imgbtn_set_src(buttonYD, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonYD, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonYD, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonYD, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonYD, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonYD, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonZI, event_handler,ID_M_Z_P,"bmp_zAdd.bin",0); + lv_obj_set_event_cb_mks(buttonZI, event_handler, ID_M_Z_P, "bmp_zAdd.bin", 0); lv_imgbtn_set_src(buttonZI, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonZI, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonZI, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonZI, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonZI, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonZI, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonZD, event_handler,ID_M_Z_N,"bmp_zDec.bin",0); + lv_obj_set_event_cb_mks(buttonZD, event_handler, ID_M_Z_N, "bmp_zDec.bin", 0); lv_imgbtn_set_src(buttonZD, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonZD, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_REL, &tft_style_lable_rel); - //lv_obj_set_event_cb_mks(buttonV, event_handler,ID_T_MORE,"bmp_More.bin",0); + //lv_obj_set_event_cb_mks(buttonV, event_handler,ID_T_MORE,"bmp_More.bin",0); lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonV, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonV, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonV, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonV, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_M_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_M_RETURN, "bmp_Return.bin", 0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - - #endif - lv_obj_set_pos(buttonXI,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonYI,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); - lv_obj_set_pos(buttonZI,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); - lv_obj_set_pos(buttonV,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttonXD,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonYD,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonZD,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - - /*Create a label on the Image button*/ - lv_btn_set_layout(buttonXI, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonXD, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonYI, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonYD, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonZI, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonZD, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonV, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t * labelXI = lv_label_create(buttonXI, NULL); - lv_obj_t * labelXD = lv_label_create(buttonXD, NULL); - lv_obj_t * labelYI = lv_label_create(buttonYI, NULL); - lv_obj_t * labelYD = lv_label_create(buttonYD, NULL); - lv_obj_t * labelZI = lv_label_create(buttonZI, NULL); - lv_obj_t * labelZD = lv_label_create(buttonZD, NULL); - labelV = lv_label_create(buttonV, NULL); - lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - - if (gCfgItems.multiple_language !=0) - { - lv_label_set_text(labelXI, move_menu.x_add); - lv_obj_align(labelXI, buttonXI, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelXD, move_menu.x_dec); - lv_obj_align(labelXD, buttonXD, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelYI, move_menu.y_add); - lv_obj_align(labelYI, buttonYI, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelYD, move_menu.y_dec); - lv_obj_align(labelYD, buttonYD, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelZI,move_menu.z_add); - lv_obj_align(labelZI, buttonZI, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelZD, move_menu.z_dec); - lv_obj_align(labelZD, buttonZD, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - - disp_move_dist(); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif + lv_obj_set_pos(buttonXI, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonYI, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); + lv_obj_set_pos(buttonZI, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); + lv_obj_set_pos(buttonV, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonXD, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonYD, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonZD, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonXI, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonXD, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonYI, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonYD, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonZI, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonZD, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonV, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelXI = lv_label_create(buttonXI, NULL); + lv_obj_t * labelXD = lv_label_create(buttonXD, NULL); + lv_obj_t * labelYI = lv_label_create(buttonYI, NULL); + lv_obj_t * labelYD = lv_label_create(buttonYD, NULL); + lv_obj_t * labelZI = lv_label_create(buttonZI, NULL); + lv_obj_t * labelZD = lv_label_create(buttonZD, NULL); + labelV = lv_label_create(buttonV, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelXI, move_menu.x_add); + lv_obj_align(labelXI, buttonXI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelXD, move_menu.x_dec); + lv_obj_align(labelXD, buttonXD, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelYI, move_menu.y_add); + lv_obj_align(labelYI, buttonYI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelYD, move_menu.y_dec); + lv_obj_align(labelYD, buttonYD, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelZI, move_menu.z_add); + lv_obj_align(labelZI, buttonZI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelZD, move_menu.z_dec); + lv_obj_align(labelZD, buttonZD, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + + disp_move_dist(); } -void disp_move_dist() -{ - //char buf[30] = {0}; - - if ((int)(10 * uiCfg.move_dist) == 1) - { - lv_obj_set_event_cb_mks(buttonV, event_handler,ID_M_STEP,"bmp_Step_move0_1.bin",0); - } - else if ((int)(10 * uiCfg.move_dist) == 10) - { - lv_obj_set_event_cb_mks(buttonV, event_handler,ID_M_STEP,"bmp_Step_move1.bin",0); - } - else if ((int)(10 * uiCfg.move_dist) == 100) - { - lv_obj_set_event_cb_mks(buttonV, event_handler,ID_M_STEP,"bmp_Step_move10.bin",0); - } - if (gCfgItems.multiple_language != 0) - { - if ((int)(10 * uiCfg.move_dist) == 1) - { - lv_label_set_text(labelV, move_menu.step_01mm); - lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - else if ((int)(10 * uiCfg.move_dist) == 10) - { - lv_label_set_text(labelV, move_menu.step_1mm); - lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - else if ((int)(10 * uiCfg.move_dist) == 100) - { - lv_label_set_text(labelV, move_menu.step_10mm); - lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - } +void disp_move_dist() { + //char buf[30] = {0}; + + if ((int)(10 * uiCfg.move_dist) == 1) + lv_obj_set_event_cb_mks(buttonV, event_handler, ID_M_STEP, "bmp_Step_move0_1.bin", 0); + else if ((int)(10 * uiCfg.move_dist) == 10) + lv_obj_set_event_cb_mks(buttonV, event_handler, ID_M_STEP, "bmp_Step_move1.bin", 0); + else if ((int)(10 * uiCfg.move_dist) == 100) + lv_obj_set_event_cb_mks(buttonV, event_handler, ID_M_STEP, "bmp_Step_move10.bin", 0); + if (gCfgItems.multiple_language != 0) { + if ((int)(10 * uiCfg.move_dist) == 1) { + lv_label_set_text(labelV, move_menu.step_01mm); + lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if ((int)(10 * uiCfg.move_dist) == 10) { + lv_label_set_text(labelV, move_menu.step_1mm); + lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if ((int)(10 * uiCfg.move_dist) == 100) { + lv_label_set_text(labelV, move_menu.step_10mm); + lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } } -void lv_clear_move_motor() -{ - lv_obj_del(scr); -} +void lv_clear_move_motor() { lv_obj_del(scr); } -#endif +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp index 88809c84d659..13b62a74875d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp @@ -33,327 +33,281 @@ static lv_obj_t * scr; -#define ID_O_PRE_HEAT 1 -#define ID_O_EXTRUCT 2 -#define ID_O_MOV 3 -#define ID_O_FILAMENT 4 -#define ID_O_SPEED 5 -#define ID_O_RETURN 6 -#define ID_O_FAN 7 -#define ID_O_POWER_OFF 8 +#define ID_O_PRE_HEAT 1 +#define ID_O_EXTRUCT 2 +#define ID_O_MOV 3 +#define ID_O_FILAMENT 4 +#define ID_O_SPEED 5 +#define ID_O_RETURN 6 +#define ID_O_FAN 7 +#define ID_O_POWER_OFF 8 static lv_obj_t *label_PowerOff; static lv_obj_t *buttonPowerOff; -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - switch (obj->mks_obj_id) - { - case ID_O_PRE_HEAT: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_opration(); - lv_draw_preHeat(); - } - break; - case ID_O_EXTRUCT: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_opration(); - lv_draw_extrusion(); - } - break; - case ID_O_MOV: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_opration(); - lv_draw_move_motor(); - } - break; - case ID_O_FILAMENT: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - - } - break; - case ID_O_FAN: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_opration(); - lv_draw_fan(); - } - break; - case ID_O_SPEED: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_opration(); - lv_draw_change_speed(); - } - break; - case ID_O_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } - break; - case ID_O_POWER_OFF: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (gCfgItems.finish_power_off == 1) - { - gCfgItems.finish_power_off = 0; - lv_obj_set_event_cb_mks(obj, event_handler,ID_O_POWER_OFF,"bmp_Mamual.bin",0); - lv_label_set_text(label_PowerOff, printing_more_menu.manual); - lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - lv_obj_refresh_ext_draw_pad(label_PowerOff); - update_spi_flash(); - } - else - { - gCfgItems.finish_power_off = 1; - lv_obj_set_event_cb_mks(obj, event_handler,ID_O_POWER_OFF,"bmp_Auto.bin",0); - lv_label_set_text(label_PowerOff, printing_more_menu.auto_close); - lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - lv_obj_refresh_ext_draw_pad(label_PowerOff); - update_spi_flash(); - } - } - break; - - } +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_O_PRE_HEAT: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_opration(); + lv_draw_preHeat(); + } + break; + case ID_O_EXTRUCT: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_opration(); + lv_draw_extrusion(); + } + break; + case ID_O_MOV: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_opration(); + lv_draw_move_motor(); + } + break; + case ID_O_FILAMENT: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + } + break; + case ID_O_FAN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_opration(); + lv_draw_fan(); + } + break; + case ID_O_SPEED: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_opration(); + lv_draw_change_speed(); + } + break; + case ID_O_RETURN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + case ID_O_POWER_OFF: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (gCfgItems.finish_power_off == 1) { + gCfgItems.finish_power_off = 0; + lv_obj_set_event_cb_mks(obj, event_handler, ID_O_POWER_OFF, "bmp_Mamual.bin", 0); + lv_label_set_text(label_PowerOff, printing_more_menu.manual); + lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + lv_obj_refresh_ext_draw_pad(label_PowerOff); + update_spi_flash(); + } + else { + gCfgItems.finish_power_off = 1; + lv_obj_set_event_cb_mks(obj, event_handler, ID_O_POWER_OFF, "bmp_Auto.bin", 0); + lv_label_set_text(label_PowerOff, printing_more_menu.auto_close); + lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + lv_obj_refresh_ext_draw_pad(label_PowerOff); + update_spi_flash(); + } + } + break; + + } } +void lv_draw_opration(void) { + lv_obj_t *buttonPreHeat, *buttonExtrusion, *buttonSpeed; + lv_obj_t *buttonBack, *buttonFan; + lv_obj_t *labelPreHeat, *labelExtrusion; + lv_obj_t *label_Back, *label_Speed, *label_Fan; + lv_obj_t *buttonMove = NULL, *label_Move = NULL; -void lv_draw_opration(void) -{ - lv_obj_t *buttonPreHeat,*buttonExtrusion,*buttonSpeed; - lv_obj_t *buttonBack,*buttonFan; - lv_obj_t *labelPreHeat,*labelExtrusion; - lv_obj_t *label_Back,*label_Speed,*label_Fan; - lv_obj_t *buttonMove=NULL,*label_Move=NULL; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != OPERATE_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = OPERATE_UI; + } + disp_state = OPERATE_UI; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != OPERATE_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = OPERATE_UI; - } - disp_state = OPERATE_UI; + scr = lv_obj_create(NULL, NULL); - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - LV_IMG_DECLARE(bmp_pic); - - /*Create an Image button*/ - buttonPreHeat = lv_imgbtn_create(scr, NULL); - buttonExtrusion = lv_imgbtn_create(scr, NULL); - buttonFan = lv_imgbtn_create(scr, NULL); - buttonSpeed = lv_imgbtn_create(scr, NULL); - - - if (uiCfg.print_state != WORKING) - //buttonFilament = lv_imgbtn_create(scr, NULL); - //else - buttonMove = lv_imgbtn_create(scr, NULL); - buttonPowerOff = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - - lv_obj_set_event_cb_mks(buttonPreHeat, event_handler,ID_O_PRE_HEAT,"bmp_PreHeat.bin",0); - lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_clear_protect(buttonPreHeat, LV_PROTECT_FOLLOW); - #if 1 - lv_obj_set_event_cb_mks(buttonExtrusion, event_handler,ID_O_EXTRUCT,"bmp_Extruct.bin",0); - lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonFan, event_handler,ID_O_FAN,"bmp_Fan.bin",0); + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonPreHeat = lv_imgbtn_create(scr, NULL); + buttonExtrusion = lv_imgbtn_create(scr, NULL); + buttonFan = lv_imgbtn_create(scr, NULL); + buttonSpeed = lv_imgbtn_create(scr, NULL); + + if (uiCfg.print_state != WORKING) + //buttonFilament = lv_imgbtn_create(scr, NULL); + //else + buttonMove = lv_imgbtn_create(scr, NULL); + buttonPowerOff = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonPreHeat, event_handler, ID_O_PRE_HEAT, "bmp_PreHeat.bin", 0); + lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonPreHeat, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonExtrusion, event_handler, ID_O_EXTRUCT, "bmp_Extruct.bin", 0); + lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonFan, event_handler, ID_O_FAN, "bmp_Fan.bin", 0); lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonSpeed, event_handler,ID_O_SPEED,"bmp_Speed.bin",0); - lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_REL, &tft_style_lable_rel); - - if (uiCfg.print_state != WORKING) - /*{ - lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_O_FILAMENT,"bmp_Filamentchange.bin",0); - lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_REL, &tft_style_lable_rel); - } - else*/ - { - lv_obj_set_event_cb_mks(buttonMove, event_handler,ID_O_MOV,"bmp_Mov.bin",0); - lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_REL, &tft_style_lable_rel); - } - if (gCfgItems.finish_power_off == 1) - { - lv_obj_set_event_cb_mks(buttonPowerOff, event_handler,ID_O_POWER_OFF,"bmp_Auto.bin",0); - } - else - { - lv_obj_set_event_cb_mks(buttonPowerOff, event_handler,ID_O_POWER_OFF,"bmp_Mamual.bin",0); - } - lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonPowerOff, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonPowerOff, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_O_RETURN,"bmp_Return.bin",0); + lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonSpeed, event_handler, ID_O_SPEED, "bmp_Speed.bin", 0); + lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_REL, &tft_style_lable_rel); + + if (uiCfg.print_state != WORKING) { + /*{ + lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_O_FILAMENT,"bmp_Filamentchange.bin",0); + lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_REL, &tft_style_lable_rel); + } + else*/ + lv_obj_set_event_cb_mks(buttonMove, event_handler, ID_O_MOV, "bmp_Mov.bin", 0); + lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_REL, &tft_style_lable_rel); + } + if (gCfgItems.finish_power_off == 1) + lv_obj_set_event_cb_mks(buttonPowerOff, event_handler, ID_O_POWER_OFF, "bmp_Auto.bin", 0); + else + lv_obj_set_event_cb_mks(buttonPowerOff, event_handler, ID_O_POWER_OFF, "bmp_Mamual.bin", 0); + lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPowerOff, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPowerOff, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_O_RETURN, "bmp_Return.bin", 0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - - - - #endif - - lv_obj_set_pos(buttonPreHeat,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonExtrusion,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); - - lv_obj_set_pos(buttonFan,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); - lv_obj_set_pos(buttonSpeed,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - - if (uiCfg.print_state != WORKING) - /*{ - lv_obj_set_pos(buttonFilament,INTERVAL_V,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - } - else*/ - { - lv_obj_set_pos(buttonMove,INTERVAL_V,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonPowerOff,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - } - else - { - lv_obj_set_pos(buttonPowerOff,INTERVAL_V,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - } - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - - /*Create a label on the Image button*/ - lv_btn_set_layout(buttonPreHeat, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonExtrusion, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonFan, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonSpeed, LV_LAYOUT_OFF); - - if (uiCfg.print_state != WORKING) - /*{ - lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF); - } - else*/ - { - lv_btn_set_layout(buttonMove, LV_LAYOUT_OFF); - } - lv_btn_set_layout(buttonPowerOff, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - labelPreHeat = lv_label_create(buttonPreHeat, NULL); - labelExtrusion = lv_label_create(buttonExtrusion, NULL); - - label_Fan = lv_label_create(buttonFan, NULL); - label_Speed = lv_label_create(buttonSpeed, NULL); - - if (uiCfg.print_state != WORKING) - /*{ - label_Filament = lv_label_create(buttonFilament, NULL); - } - else*/ - { - label_Move = lv_label_create(buttonMove, NULL); - } - label_PowerOff = lv_label_create(buttonPowerOff, NULL); - - label_Back = lv_label_create(buttonBack, NULL); - - - if (gCfgItems.multiple_language !=0) - { - lv_label_set_text(labelPreHeat, operation_menu.temp); - lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelExtrusion, operation_menu.extr); - lv_obj_align(labelExtrusion, buttonExtrusion, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Fan, operation_menu.fan); - lv_obj_align(label_Fan, buttonFan, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Speed, operation_menu.speed); - lv_obj_align(label_Speed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - if (uiCfg.print_state != WORKING) - /*{ - lv_label_set_text(label_Filament, operation_menu.filament); - lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - else*/ - { - lv_label_set_text(label_Move, operation_menu.move); - lv_obj_align(label_Move, buttonMove, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - - if (gCfgItems.finish_power_off == 1) - { - lv_label_set_text(label_PowerOff, printing_more_menu.auto_close); - } - else - { - lv_label_set_text(label_PowerOff, printing_more_menu.manual); - } - lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif + + lv_obj_set_pos(buttonPreHeat, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonExtrusion, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); + + lv_obj_set_pos(buttonFan, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); + lv_obj_set_pos(buttonSpeed, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + + if (uiCfg.print_state != WORKING) { + /*{ + lv_obj_set_pos(buttonFilament,INTERVAL_V,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + } + else*/ + lv_obj_set_pos(buttonMove, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonPowerOff, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + } + else { + lv_obj_set_pos(buttonPowerOff, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + } + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonPreHeat, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonExtrusion, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonFan, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonSpeed, LV_LAYOUT_OFF); + + if (uiCfg.print_state != WORKING) + /*{ + lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF); + } + else*/ + lv_btn_set_layout(buttonMove, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPowerOff, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + labelPreHeat = lv_label_create(buttonPreHeat, NULL); + labelExtrusion = lv_label_create(buttonExtrusion, NULL); + + label_Fan = lv_label_create(buttonFan, NULL); + label_Speed = lv_label_create(buttonSpeed, NULL); + + if (uiCfg.print_state != WORKING) + /*{ + label_Filament = lv_label_create(buttonFilament, NULL); + } + else*/ + label_Move = lv_label_create(buttonMove, NULL); + label_PowerOff = lv_label_create(buttonPowerOff, NULL); + + label_Back = lv_label_create(buttonBack, NULL); + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelPreHeat, operation_menu.temp); + lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelExtrusion, operation_menu.extr); + lv_obj_align(labelExtrusion, buttonExtrusion, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Fan, operation_menu.fan); + lv_obj_align(label_Fan, buttonFan, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Speed, operation_menu.speed); + lv_obj_align(label_Speed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + if (uiCfg.print_state != WORKING) { + /*{ + lv_label_set_text(label_Filament, operation_menu.filament); + lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + } + else*/ + lv_label_set_text(label_Move, operation_menu.move); + lv_obj_align(label_Move, buttonMove, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + + if (gCfgItems.finish_power_off == 1) + lv_label_set_text(label_PowerOff, printing_more_menu.auto_close); + else + lv_label_set_text(label_PowerOff, printing_more_menu.manual); + lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } } -void lv_clear_opration() -{ - lv_obj_del(scr); -} -#endif +void lv_clear_opration() { lv_obj_del(scr); } + +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp index 76417038d5c0..cf477ec10400 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp @@ -21,39 +21,35 @@ */ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(TFT_LITTLE_VGL_UI) +#if BOTH(TFT_LITTLE_VGL_UI, ADVANCED_PAUSE_FEATURE) -#include "../../../../MarlinCore.h" +#include "draw_ui.h" #include "lv_conf.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "draw_ui.h" -#if ENABLED(ADVANCED_PAUSE_FEATURE) +#include "../../../../MarlinCore.h" #include "../../../../feature/pause.h" - -void lv_draw_pause_message(const PauseMessage msg) -{ - switch (msg) { - case PAUSE_MESSAGE_PAUSING: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_PAUSING);break; - case PAUSE_MESSAGE_CHANGING: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_CHANGING);break; - case PAUSE_MESSAGE_UNLOAD: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_UNLOAD);break; - case PAUSE_MESSAGE_WAITING: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_WAITING);break; - case PAUSE_MESSAGE_INSERT: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_INSERT);break; - case PAUSE_MESSAGE_LOAD: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_LOAD);break; - case PAUSE_MESSAGE_PURGE: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_PURGE);break; - case PAUSE_MESSAGE_RESUME: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_RESUME);break; - case PAUSE_MESSAGE_HEAT: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_HEAT);break; - case PAUSE_MESSAGE_HEATING: clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_HEATING);break; +void lv_draw_pause_message(const PauseMessage msg) { + switch (msg) { + case PAUSE_MESSAGE_PAUSING: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_PAUSING); break; + case PAUSE_MESSAGE_CHANGING: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_CHANGING); break; + case PAUSE_MESSAGE_UNLOAD: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_UNLOAD); break; + case PAUSE_MESSAGE_WAITING: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_WAITING); break; + case PAUSE_MESSAGE_INSERT: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_INSERT); break; + case PAUSE_MESSAGE_LOAD: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_LOAD); break; + case PAUSE_MESSAGE_PURGE: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_PURGE); break; + case PAUSE_MESSAGE_RESUME: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_RESUME); break; + case PAUSE_MESSAGE_HEAT: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_HEAT); break; + case PAUSE_MESSAGE_HEATING: clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_HEATING); break; case PAUSE_MESSAGE_OPTION: pause_menu_response = PAUSE_RESPONSE_WAIT_FOR; - clear_cur_ui();lv_draw_dialog(DIALOG_PAUSE_MESSAGE_OPTION);break; + clear_cur_ui(); lv_draw_dialog(DIALOG_PAUSE_MESSAGE_OPTION); break; case PAUSE_MESSAGE_STATUS: default: break; } } -#endif -#endif +#endif // TFT_LITTLE_VGL_UI && ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp index 36b7f6afdfe9..8aa1ed95c4c7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp @@ -34,439 +34,353 @@ #include "../../../../module/temperature.h" static lv_obj_t * scr; -static lv_obj_t *buttoType,*buttonStep; +static lv_obj_t *buttoType, *buttonStep; static lv_obj_t * labelType; static lv_obj_t * labelStep; static lv_obj_t * tempText1; -#define ID_P_ADD 1 -#define ID_P_DEC 2 -#define ID_P_TYPE 3 -#define ID_P_STEP 4 -#define ID_P_OFF 5 -#define ID_P_RETURN 6 - -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - switch (obj->mks_obj_id) - { - case ID_P_ADD: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - if (uiCfg.curTempType == 0) - { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target += uiCfg.stepHeat; - if (uiCfg.curSprayerChoose == 0) - { - if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_0_MAXTEMP- (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) - { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); - - thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); - } - } - #if !defined(SINGLENOZZLE) && EXTRUDERS >= 2 - else - { - if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP- (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) - { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); - - thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); - } - } - #endif - } - #if HAS_HEATED_BED - else - { - - thermalManager.temp_bed.target += uiCfg.stepHeat; - - if ((int)thermalManager.temp_bed.target > BED_MAXTEMP- (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) - { - thermalManager.temp_bed.target = (float)BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1); - thermalManager.start_watching_bed(); - } - - } - #endif - disp_desire_temp(); - } - break; - case ID_P_DEC: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (uiCfg.curTempType == 0) - { - if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > uiCfg.stepHeat) - { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target -= uiCfg.stepHeat; - thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); - } - else - { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)0; - thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); - } - } - #if HAS_HEATED_BED - else - { - if ((int)thermalManager.temp_bed.target > uiCfg.stepHeat) - { - thermalManager.temp_bed.target -= uiCfg.stepHeat; - thermalManager.start_watching_bed(); - } - else - { - thermalManager.temp_bed.target = (float)0; - thermalManager.start_watching_bed(); - } - } - #endif - disp_desire_temp(); - } - - break; - case ID_P_TYPE: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - if (uiCfg.curTempType == 0) - { - if (EXTRUDERS == 2) - { - if (uiCfg.curSprayerChoose == 0) - { - uiCfg.curSprayerChoose = 1; - } - else if (uiCfg.curSprayerChoose == 1) - { - if (TEMP_SENSOR_BED != 0) - { - uiCfg.curTempType = 1; - } - else - { - uiCfg.curTempType = 0; - uiCfg.curSprayerChoose = 0; - } - } - - } - else - { - if (uiCfg.curSprayerChoose == 0) - { - if (TEMP_SENSOR_BED != 0) - { - uiCfg.curTempType = 1; - } - else - { - uiCfg.curTempType = 0; - } - } - } - - } - else if (uiCfg.curTempType == 1) - { - uiCfg.curSprayerChoose = 0; - uiCfg.curTempType = 0; - } - disp_temp_type(); - } - break; - case ID_P_STEP: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - switch (uiCfg.stepHeat) - { - case 1: - uiCfg.stepHeat = 5; - break; - - case 5: - uiCfg.stepHeat = 10; - break; - - case 10: - uiCfg.stepHeat = 1; - break; - - default: - break; - } - disp_step_heat(); - } - break; - case ID_P_OFF: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (uiCfg.curTempType == 0) - { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)0; - thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); - } - #if HAS_HEATED_BED - else - { - thermalManager.temp_bed.target = (float)0; - thermalManager.start_watching_bed(); - } - #endif - disp_desire_temp(); - } - break; - case ID_P_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } - break; - - } +#define ID_P_ADD 1 +#define ID_P_DEC 2 +#define ID_P_TYPE 3 +#define ID_P_STEP 4 +#define ID_P_OFF 5 +#define ID_P_RETURN 6 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_P_ADD: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (uiCfg.curTempType == 0) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target += uiCfg.stepHeat; + if (uiCfg.curSprayerChoose == 0) { + if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); + + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + } + #if !defined(SINGLENOZZLE) && EXTRUDERS >= 2 + else if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); + + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + #endif + } + #if HAS_HEATED_BED + else { + + thermalManager.temp_bed.target += uiCfg.stepHeat; + + if ((int)thermalManager.temp_bed.target > BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) { + thermalManager.temp_bed.target = (float)BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1); + thermalManager.start_watching_bed(); + } + + } + #endif + disp_desire_temp(); + } + break; + case ID_P_DEC: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (uiCfg.curTempType == 0) { + if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > uiCfg.stepHeat) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target -= uiCfg.stepHeat; + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + else { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)0; + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + } + #if HAS_HEATED_BED + else { + if ((int)thermalManager.temp_bed.target > uiCfg.stepHeat) { + thermalManager.temp_bed.target -= uiCfg.stepHeat; + thermalManager.start_watching_bed(); + } + else { + thermalManager.temp_bed.target = (float)0; + thermalManager.start_watching_bed(); + } + } + #endif + disp_desire_temp(); + } + + break; + case ID_P_TYPE: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (uiCfg.curTempType == 0) { + if (EXTRUDERS == 2) { + if (uiCfg.curSprayerChoose == 0) { + uiCfg.curSprayerChoose = 1; + } + else if (uiCfg.curSprayerChoose == 1) { + if (TEMP_SENSOR_BED != 0) { + uiCfg.curTempType = 1; + } + else { + uiCfg.curTempType = 0; + uiCfg.curSprayerChoose = 0; + } + } + } + else if (uiCfg.curSprayerChoose == 0) { + if (TEMP_SENSOR_BED != 0) + uiCfg.curTempType = 1; + else + uiCfg.curTempType = 0; + } + } + else if (uiCfg.curTempType == 1) { + uiCfg.curSprayerChoose = 0; + uiCfg.curTempType = 0; + } + disp_temp_type(); + } + break; + case ID_P_STEP: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + switch (uiCfg.stepHeat) { + case 1: uiCfg.stepHeat = 5; break; + case 5: uiCfg.stepHeat = 10; break; + case 10: uiCfg.stepHeat = 1; break; + default: break; + } + disp_step_heat(); + } + break; + case ID_P_OFF: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + if (uiCfg.curTempType == 0) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)0; + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + } + #if HAS_HEATED_BED + else { + thermalManager.temp_bed.target = (float)0; + thermalManager.start_watching_bed(); + } + #endif + disp_desire_temp(); + } + break; + case ID_P_RETURN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + clear_cur_ui(); + draw_return_ui(); + } + break; + } } +void lv_draw_preHeat(void) { + lv_obj_t *buttonAdd, *buttonDec; + lv_obj_t *buttonOff, *buttonBack; -void lv_draw_preHeat(void) -{ - lv_obj_t *buttonAdd,*buttonDec; - lv_obj_t *buttonOff,*buttonBack; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != PRE_HEAT_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = PRE_HEAT_UI; + } + disp_state = PRE_HEAT_UI; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != PRE_HEAT_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = PRE_HEAT_UI; - } - disp_state = PRE_HEAT_UI; + scr = lv_obj_create(NULL, NULL); - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - LV_IMG_DECLARE(bmp_pic); - - /*Create an Image button*/ - buttonAdd = lv_imgbtn_create(scr, NULL); - buttonDec = lv_imgbtn_create(scr, NULL); - buttoType = lv_imgbtn_create(scr, NULL); - buttonStep = lv_imgbtn_create(scr, NULL); - buttonOff = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonAdd, event_handler,ID_P_ADD,"bmp_Add.bin",0); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); - #if 1 - lv_obj_set_event_cb_mks(buttonDec, event_handler,ID_P_DEC,"bmp_Dec.bin",0); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + buttonAdd = lv_imgbtn_create(scr, NULL); + buttonDec = lv_imgbtn_create(scr, NULL); + buttoType = lv_imgbtn_create(scr, NULL); + buttonStep = lv_imgbtn_create(scr, NULL); + buttonOff = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + lv_obj_set_event_cb_mks(buttonAdd, event_handler, ID_P_ADD, "bmp_Add.bin", 0); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonDec, event_handler, ID_P_DEC, "bmp_Dec.bin", 0); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttoType, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttoType, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttoType, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttoType, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonOff, event_handler,ID_P_OFF,"bmp_Speed0.bin",0); + lv_obj_set_event_cb_mks(buttonOff, event_handler, ID_P_OFF, "bmp_Speed0.bin", 0); lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_P_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_P_RETURN, "bmp_Return.bin", 0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - - #endif - - lv_obj_set_pos(buttonAdd,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonDec,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttoType,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonStep,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonOff,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - - /*Create a label on the Image button*/ - lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); - lv_btn_set_layout(buttoType, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonOff, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); - lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); - labelType = lv_label_create(buttoType, NULL); - labelStep = lv_label_create(buttonStep, NULL); - lv_obj_t * labelOff = lv_label_create(buttonOff, NULL); - lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - - if (gCfgItems.multiple_language !=0) - { - lv_label_set_text(labelAdd, preheat_menu.add); - lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelDec, preheat_menu.dec); - lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelOff, preheat_menu.off); - lv_obj_align(labelOff, buttonOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - - disp_temp_type(); - disp_step_heat(); - - tempText1 = lv_label_create(scr, NULL); - lv_obj_set_style(tempText1, &tft_style_lable_rel); - disp_desire_temp(); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif + + lv_obj_set_pos(buttonAdd, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonDec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttoType, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonStep, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonOff, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); + lv_btn_set_layout(buttoType, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonOff, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + lv_obj_t * labelAdd = lv_label_create(buttonAdd, NULL); + lv_obj_t * labelDec = lv_label_create(buttonDec, NULL); + labelType = lv_label_create(buttoType, NULL); + labelStep = lv_label_create(buttonStep, NULL); + lv_obj_t * labelOff = lv_label_create(buttonOff, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelAdd, preheat_menu.add); + lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelDec, preheat_menu.dec); + lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelOff, preheat_menu.off); + lv_obj_align(labelOff, buttonOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + + disp_temp_type(); + disp_step_heat(); + + tempText1 = lv_label_create(scr, NULL); + lv_obj_set_style(tempText1, &tft_style_lable_rel); + disp_desire_temp(); } -void disp_temp_type() -{ - - if (uiCfg.curTempType == 0) - { - if (uiCfg.curSprayerChoose == 1) - { - lv_obj_set_event_cb_mks(buttoType, event_handler,ID_P_TYPE,"bmp_Extru2.bin",0); - if (gCfgItems.multiple_language != 0) - { - lv_label_set_text(labelType, preheat_menu.ext2); - lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - } - else - { - lv_obj_set_event_cb_mks(buttoType, event_handler,ID_P_TYPE,"bmp_Extru1.bin",0); - if (gCfgItems.multiple_language != 0) - { - lv_label_set_text(labelType, preheat_menu.ext1); - lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - } - - } - else - { - lv_obj_set_event_cb_mks(buttoType, event_handler,ID_P_TYPE,"bmp_Bed.bin",0); - if (gCfgItems.multiple_language != 0) - { - lv_label_set_text(labelType, preheat_menu.hotbed); - lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - } +void disp_temp_type() { + + if (uiCfg.curTempType == 0) { + if (uiCfg.curSprayerChoose == 1) { + lv_obj_set_event_cb_mks(buttoType, event_handler, ID_P_TYPE, "bmp_Extru2.bin", 0); + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelType, preheat_menu.ext2); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } + else { + lv_obj_set_event_cb_mks(buttoType, event_handler, ID_P_TYPE, "bmp_Extru1.bin", 0); + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelType, preheat_menu.ext1); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } + + } + else { + lv_obj_set_event_cb_mks(buttoType, event_handler, ID_P_TYPE, "bmp_Bed.bin", 0); + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelType, preheat_menu.hotbed); + lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } } -void disp_desire_temp() -{ - char buf[20] = {0}; - - public_buf_l[0] = '\0'; - - if (uiCfg.curTempType == 0) - { - if (uiCfg.curSprayerChoose<1) - { - strcat(public_buf_l,preheat_menu.ext1); - } - else - { - strcat(public_buf_l,preheat_menu.ext2); - } - sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); - - } - #if HAS_HEATED_BED - else - { - strcat(public_buf_l,preheat_menu.hotbed); - - sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target); - } - #endif - strcat(public_buf_l,": "); - strcat(public_buf_l,buf); - lv_label_set_text(tempText1, public_buf_l); - lv_obj_align(tempText1, NULL, LV_ALIGN_CENTER,0, -50); +void disp_desire_temp() { + char buf[20] = {0}; + + public_buf_l[0] = '\0'; + + if (uiCfg.curTempType == 0) { + if (uiCfg.curSprayerChoose < 1) + strcat(public_buf_l, preheat_menu.ext1); + else + strcat(public_buf_l, preheat_menu.ext2); + sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); + } + #if HAS_HEATED_BED + else { + strcat(public_buf_l, preheat_menu.hotbed); + sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target); + } + #endif + strcat(public_buf_l, ": "); + strcat(public_buf_l, buf); + lv_label_set_text(tempText1, public_buf_l); + lv_obj_align(tempText1, NULL, LV_ALIGN_CENTER, 0, -50); } -void disp_step_heat() -{ - if (uiCfg.stepHeat == 1) - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_P_STEP,"bmp_Step1_degree.bin",0); - else if (uiCfg.stepHeat == 5) - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_P_STEP,"bmp_Step5_degree.bin",0); - else if (uiCfg.stepHeat == 10) - lv_obj_set_event_cb_mks(buttonStep, event_handler,ID_P_STEP,"bmp_Step10_degree.bin",0); - - if (gCfgItems.multiple_language != 0) - { - if (uiCfg.stepHeat == 1) - { - lv_label_set_text(labelStep, preheat_menu.step_1c); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - else if (uiCfg.stepHeat == 5) - { - lv_label_set_text(labelStep, preheat_menu.step_5c); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - else if (uiCfg.stepHeat == 10) - { - lv_label_set_text(labelStep, preheat_menu.step_10c); - lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - } +void disp_step_heat() { + if (uiCfg.stepHeat == 1) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_P_STEP, "bmp_Step1_degree.bin", 0); + else if (uiCfg.stepHeat == 5) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_P_STEP, "bmp_Step5_degree.bin", 0); + else if (uiCfg.stepHeat == 10) + lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_P_STEP, "bmp_Step10_degree.bin", 0); + + if (gCfgItems.multiple_language != 0) { + if (uiCfg.stepHeat == 1) { + lv_label_set_text(labelStep, preheat_menu.step_1c); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if (uiCfg.stepHeat == 5) { + lv_label_set_text(labelStep, preheat_menu.step_5c); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if (uiCfg.stepHeat == 10) { + lv_label_set_text(labelStep, preheat_menu.step_10c); + lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } } -void lv_clear_preHeat() -{ - lv_obj_del(scr); -} -#endif +void lv_clear_preHeat() { lv_obj_del(scr); } + +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index 61ef4a533610..cc9fa0e04dfe 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -34,14 +34,13 @@ static lv_obj_t * scr; -static lv_obj_t *buttonPageUp,*buttonPageDown,*buttonBack,*buttonGcode[FILE_BTN_CNT]; +static lv_obj_t *buttonPageUp, *buttonPageDown, *buttonBack, *buttonGcode[FILE_BTN_CNT]; static lv_obj_t * labelPageUp[FILE_BTN_CNT]; static lv_obj_t *buttonText[FILE_BTN_CNT]; -#define ID_P_UP 7 -#define ID_P_DOWN 8 -#define ID_P_RETURN 9 - +#define ID_P_UP 7 +#define ID_P_DOWN 8 +#define ID_P_RETURN 9 int8_t curDirLever = 0; LIST_FILE list_file; @@ -54,68 +53,66 @@ uint8_t sel_id = 0; #if ENABLED(SDSUPPORT) - static uint8_t search_file() { - int valid_name_cnt = 0; - //char tmp[SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; +static uint8_t search_file() { + int valid_name_cnt = 0; + //char tmp[SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; - list_file.Sd_file_cnt = 0; - //list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + list_file.Sd_file_cnt = 0; + //list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - //root2.rewind(); - //SERIAL_ECHOLN(list_file.curDirPath); + //root2.rewind(); + //SERIAL_ECHOLN(list_file.curDirPath); - if (curDirLever != 0)card.cd(list_file.curDirPath); - else card.cdroot();//while(card.cdup()); + if (curDirLever != 0) card.cd(list_file.curDirPath); + else card.cdroot(); //while(card.cdup()); - const uint16_t fileCnt = card.get_num_Files(); + const uint16_t fileCnt = card.get_num_Files(); - for (uint16_t i = 0; i < fileCnt; i++) { - if (list_file.Sd_file_cnt == list_file.Sd_file_offset) { - const uint16_t nr = SD_ORDER(i, fileCnt); - card.getfilename_sorted(nr); + for (uint16_t i = 0; i < fileCnt; i++) { + if (list_file.Sd_file_cnt == list_file.Sd_file_offset) { + const uint16_t nr = SD_ORDER(i, fileCnt); + card.getfilename_sorted(nr); - if (card.flag.filenameIsDir) { - /* - SERIAL_ECHOLN(card.longest_filename); - */ - list_file.IsFolder[valid_name_cnt] = 1; - } - else { - //SERIAL_ECHOLN(card.longFilename); - list_file.IsFolder[valid_name_cnt] = 0; - } - - #if 1 - // - memset(list_file.file_name[valid_name_cnt],0,strlen(list_file.file_name[valid_name_cnt])); - strcpy(list_file.file_name[valid_name_cnt], list_file.curDirPath); - strcat(list_file.file_name[valid_name_cnt], "/"); - strcat(list_file.file_name[valid_name_cnt],card.filename); - // - memset(list_file.long_name[valid_name_cnt],0,strlen(list_file.long_name[valid_name_cnt])); - if (card.longFilename[0] == 0) - strncpy(list_file.long_name[valid_name_cnt],card.filename,strlen(card.filename)); - else - strncpy(list_file.long_name[valid_name_cnt],card.longFilename,strlen(card.longFilename)); + if (card.flag.filenameIsDir) + /* + SERIAL_ECHOLN(card.longest_filename); + */ + list_file.IsFolder[valid_name_cnt] = 1; + else + //SERIAL_ECHOLN(card.longFilename); + list_file.IsFolder[valid_name_cnt] = 0; + + #if 1 + // + memset(list_file.file_name[valid_name_cnt], 0, strlen(list_file.file_name[valid_name_cnt])); + strcpy(list_file.file_name[valid_name_cnt], list_file.curDirPath); + strcat(list_file.file_name[valid_name_cnt], "/"); + strcat(list_file.file_name[valid_name_cnt], card.filename); + // + memset(list_file.long_name[valid_name_cnt], 0, strlen(list_file.long_name[valid_name_cnt])); + if (card.longFilename[0] == 0) + strncpy(list_file.long_name[valid_name_cnt], card.filename, strlen(card.filename)); + else + strncpy(list_file.long_name[valid_name_cnt], card.longFilename, strlen(card.longFilename)); - valid_name_cnt++; - if (valid_name_cnt == 1) + valid_name_cnt++; + if (valid_name_cnt == 1) dir_offset[curDirLever].cur_page_first_offset = list_file.Sd_file_offset; - if (valid_name_cnt >= FILE_NUM) { - dir_offset[curDirLever].cur_page_last_offset = list_file.Sd_file_offset; - list_file.Sd_file_offset++; - break; - } + if (valid_name_cnt >= FILE_NUM) { + dir_offset[curDirLever].cur_page_last_offset = list_file.Sd_file_offset; list_file.Sd_file_offset++; - #endif - } - list_file.Sd_file_cnt++; + break; + } + list_file.Sd_file_offset++; + #endif } - //card.closefile(false); - return valid_name_cnt; + list_file.Sd_file_cnt++; } + //card.closefile(false); + return valid_name_cnt; +} -#endif +#endif // SDSUPPORT uint8_t have_pre_pic(char *path) { #if ENABLED(SDSUPPORT) @@ -182,9 +179,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { lv_obj_del(scr); disp_gcode_icon(file_count); } - if (file_count < FILE_NUM) { + if (file_count < FILE_NUM) dir_offset[curDirLever].cur_page_last_offset = 0; - } } } } @@ -193,7 +189,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { if (curDirLever > 0) { - int8_t *ch = (int8_t *)strrchr(list_file.curDirPath, '/'); + int8_t *ch = (int8_t *)strrchr(list_file.curDirPath, '/'); if (ch) { *ch = 0; #if ENABLED(SDSUPPORT) @@ -219,7 +215,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else { for (i = 0; i < FILE_BTN_CNT; i++) { - if (obj->mks_obj_id == (i+1)) { + if (obj->mks_obj_id == (i + 1)) { if (event == LV_EVENT_CLICKED) { } else if (event == LV_EVENT_RELEASED) { @@ -305,7 +301,7 @@ void disp_gcode_icon(uint8_t file_num) { lv_obj_t * title = lv_label_create(scr, NULL); lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); @@ -314,7 +310,7 @@ void disp_gcode_icon(uint8_t file_num) { buttonPageDown = lv_imgbtn_create(scr, NULL); buttonBack = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonPageUp, event_handler,ID_P_UP,"bmp_pageUp.bin",0); + lv_obj_set_event_cb_mks(buttonPageUp, event_handler, ID_P_UP, "bmp_pageUp.bin", 0); lv_imgbtn_set_src(buttonPageUp, LV_BTN_STATE_REL, &bmp_pic_117x92); lv_imgbtn_set_src(buttonPageUp, LV_BTN_STATE_PR, &bmp_pic_117x92); lv_imgbtn_set_style(buttonPageUp, LV_BTN_STATE_PR, &tft_style_lable_pre); @@ -322,22 +318,22 @@ void disp_gcode_icon(uint8_t file_num) { lv_obj_clear_protect(buttonPageUp, LV_PROTECT_FOLLOW); #if 1 - lv_obj_set_event_cb_mks(buttonPageDown, event_handler,ID_P_DOWN,"bmp_pageDown.bin",0); + lv_obj_set_event_cb_mks(buttonPageDown, event_handler, ID_P_DOWN, "bmp_pageDown.bin", 0); lv_imgbtn_set_src(buttonPageDown, LV_BTN_STATE_REL, &bmp_pic_117x92); lv_imgbtn_set_src(buttonPageDown, LV_BTN_STATE_PR, &bmp_pic_117x92); lv_imgbtn_set_style(buttonPageDown, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonPageDown, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_P_RETURN,"bmp_Back.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_P_RETURN, "bmp_Back.bin", 0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic_117x92); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic_117x92); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif - lv_obj_set_pos(buttonPageUp,OTHER_BTN_XPIEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttonPageDown,OTHER_BTN_XPIEL*3+INTERVAL_V*4,titleHeight+OTHER_BTN_YPIEL+INTERVAL_H); - lv_obj_set_pos(buttonBack,OTHER_BTN_XPIEL*3+INTERVAL_V*4,titleHeight+OTHER_BTN_YPIEL*2+INTERVAL_H*2); + lv_obj_set_pos(buttonPageUp, OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonPageDown, OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + OTHER_BTN_YPIEL + INTERVAL_H); + lv_obj_set_pos(buttonBack, OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + OTHER_BTN_YPIEL * 2 + INTERVAL_H * 2); /*Create a label on the Image button*/ @@ -356,7 +352,7 @@ void disp_gcode_icon(uint8_t file_num) { back_flg = 0; } */ - if (i >= file_num) break; + if (i >= file_num) break; #ifdef TFT35 buttonGcode[i] = lv_imgbtn_create(scr, NULL); @@ -370,26 +366,26 @@ void disp_gcode_icon(uint8_t file_num) { cutFileName((char *)list_file.long_name[i], 16, 8, (char *)public_buf_m); if (list_file.IsFolder[i] == 1) { - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler,(i+1),"bmp_Dir.bin",0); + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "bmp_Dir.bin", 0); lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic); if (i < 3) - lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1), titleHeight); + lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight); else - lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1), BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1), BTN_Y_PIXEL + INTERVAL_H + titleHeight); labelPageUp[i] = lv_label_create(buttonGcode[i], NULL); lv_obj_set_style(labelPageUp[i], &tft_style_lable_rel); lv_label_set_text(labelPageUp[i], public_buf_m); - lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID,0, -5); + lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID, 0, -5); } else { if (have_pre_pic((char *)list_file.file_name[i])) { - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler,(i+1),list_file.file_name[i],1); + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), list_file.file_name[i], 1); lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic_100x100); lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic_100x100); if (i < 3) { - lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1)+FILE_PRE_PIC_X_OFFSET, titleHeight+FILE_PRE_PIC_Y_OFFSET); + lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET); buttonText[i] = lv_btn_create(scr, NULL); //lv_obj_set_event_cb(buttonText[i], event_handler); @@ -402,11 +398,11 @@ void disp_gcode_icon(uint8_t file_num) { //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL,0); //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_REL, &bmp_pic_100x40); //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_PR, &bmp_pic_100x40); - lv_obj_set_pos(buttonText[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1)+FILE_PRE_PIC_X_OFFSET, titleHeight+FILE_PRE_PIC_Y_OFFSET+100); - lv_obj_set_size(buttonText[i],100,40); + lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET + 100); + lv_obj_set_size(buttonText[i], 100, 40); } else { - lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1)+FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL+INTERVAL_H+titleHeight+FILE_PRE_PIC_Y_OFFSET); + lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1) + FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL + INTERVAL_H + titleHeight + FILE_PRE_PIC_Y_OFFSET); buttonText[i] = lv_btn_create(scr, NULL); //lv_obj_set_event_cb(buttonText[i], event_handler); @@ -419,33 +415,31 @@ void disp_gcode_icon(uint8_t file_num) { //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL,0); //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_REL, &bmp_pic_100x40); //lv_imgbtn_set_src(buttonText[i], LV_BTN_STATE_PR, &bmp_pic_100x40); - lv_obj_set_pos(buttonText[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1)+FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL+INTERVAL_H+titleHeight+FILE_PRE_PIC_Y_OFFSET+100); - lv_obj_set_size(buttonText[i],100,40); + lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1) + FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL + INTERVAL_H + titleHeight + FILE_PRE_PIC_Y_OFFSET + 100); + lv_obj_set_size(buttonText[i], 100, 40); } labelPageUp[i] = lv_label_create(buttonText[i], NULL); lv_obj_set_style(labelPageUp[i], &tft_style_lable_rel); lv_label_set_text(labelPageUp[i], public_buf_m); - lv_obj_align(labelPageUp[i], buttonText[i], LV_ALIGN_IN_BOTTOM_MID,0, 0); + lv_obj_align(labelPageUp[i], buttonText[i], LV_ALIGN_IN_BOTTOM_MID, 0, 0); } else { - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler,(i+1),"bmp_File.bin",0); + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "bmp_File.bin", 0); lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, &bmp_pic); if (i < 3) - lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*i+INTERVAL_V*(i+1), titleHeight); + lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight); else - lv_obj_set_pos(buttonGcode[i],BTN_X_PIXEL*(i-3)+INTERVAL_V*((i-3)+1), BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1), BTN_Y_PIXEL + INTERVAL_H + titleHeight); labelPageUp[i] = lv_label_create(buttonGcode[i], NULL); lv_obj_set_style(labelPageUp[i], &tft_style_lable_rel); lv_label_set_text(labelPageUp[i], public_buf_m); - lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID,0, -5); + lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID, 0, -5); } } - - #else - - #endif + #else // ifdef TFT35 + #endif // ifdef TFT35 } } @@ -456,15 +450,15 @@ void lv_open_gcode_file(char *path) { int pre_sread_cnt; char *cur_name; - cur_name=strrchr(path,'/'); + cur_name = strrchr(path, '/'); card.openFileRead(cur_name); card.read(public_buf, 512); - ps4 = (uint32_t *)strstr((char *)public_buf,";simage:"); + ps4 = (uint32_t *)strstr((char *)public_buf, ";simage:"); if (ps4) { - pre_sread_cnt = (uint32_t)ps4-(uint32_t)((uint32_t *)(&public_buf[0])); - card.setIndex(pre_sread_cnt+8); + pre_sread_cnt = (uint32_t)ps4 - (uint32_t)((uint32_t *)(&public_buf[0])); + card.setIndex(pre_sread_cnt + 8); } #endif } @@ -495,8 +489,8 @@ void lv_gcode_file_read(uint8_t *data_buf) { while (1) { card.read(temp_test, 200); - for (i = 0;i < 200;) { - public_buf[row_1 * 200 + 100 * k + j] = (char)(ascii2dec_test(&temp_test[i]) << 4 | ascii2dec_test(&temp_test[i+1])); + for (i = 0; i < 200;) { + public_buf[row_1 * 200 + 100 * k + j] = (char)(ascii2dec_test(&temp_test[i]) << 4 | ascii2dec_test(&temp_test[i + 1])); j++; i += 2; } @@ -508,13 +502,11 @@ void lv_gcode_file_read(uint8_t *data_buf) { break; } } - memcpy(data_buf,public_buf,200); + memcpy(data_buf, public_buf, 200); #endif } -void lv_close_gcode_file() { - TERN_(SDSUPPORT, card.closefile()); -} +void lv_close_gcode_file() {TERN_(SDSUPPORT, card.closefile());} void cutFileName(char *path, int len, int bytePerLine, char *outStr) { #if _LFN_UNICODE @@ -540,10 +532,10 @@ void cutFileName(char *path, int len, int bytePerLine, char *outStr) { #endif beginIndex = (strIndex1 != 0 - // && (strIndex2 != 0) && (strIndex1 < strIndex2) - ) ? strIndex1 + 1 : tmpFile; + // && (strIndex2 != 0) && (strIndex1 < strIndex2) + ) ? strIndex1 + 1 : tmpFile; - if (strIndex2 == 0 || (strIndex1 > strIndex2)) { // not gcode file + if (strIndex2 == 0 || (strIndex1 > strIndex2)) { // not gcode file #if _LFN_UNICODE if (wcslen(beginIndex) > len) wcsncpy(outStr, beginIndex, len); @@ -592,13 +584,12 @@ void cutFileName(char *path, int len, int bytePerLine, char *outStr) { outStr[bytePerLine + 1] = '\0'; strcat(outStr, secSeg); } - else + else { strcat(outStr, "\n"); + } #endif } -void lv_clear_print_file() { - lv_obj_del(scr); -} +void lv_clear_print_file() { lv_obj_del(scr); } #endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h index dbcd0d33f3a0..1b060d44ba2a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h @@ -40,9 +40,9 @@ extern DIR_OFFSET dir_offset[10]; typedef struct { //char longName[FILE_NUM][LONG_FILENAME_LENGTH]; - char file_name[FILE_NUM][SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; - char curDirPath[SHORT_NEME_LEN*MAX_DIR_LEVEL+1]; - char long_name[FILE_NUM][SHORT_NEME_LEN*2+1]; + char file_name[FILE_NUM][SHORT_NEME_LEN * MAX_DIR_LEVEL + 1]; + char curDirPath[SHORT_NEME_LEN * MAX_DIR_LEVEL + 1]; + char long_name[FILE_NUM][SHORT_NEME_LEN * 2 + 1]; char IsFolder[FILE_NUM]; char Sd_file_cnt; char sd_file_index; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp index 32499225eb90..627b77e9c096 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp @@ -90,16 +90,16 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); } #if ENABLED(POWER_LOSS_RECOVERY) - else if (uiCfg.print_state == REPRINTING) { - uiCfg.print_state = REPRINTED; - lv_obj_set_event_cb_mks(obj, event_handler, ID_PAUSE, "bmp_Resume.bin", 0); - lv_label_set_text(labelPause, printing_menu.pause); - lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); - //recovery.resume(); - print_time.minutes = recovery.info.print_job_elapsed / 60; - print_time.seconds = recovery.info.print_job_elapsed % 60; - print_time.hours = print_time.minutes / 60; - } + else if (uiCfg.print_state == REPRINTING) { + uiCfg.print_state = REPRINTED; + lv_obj_set_event_cb_mks(obj, event_handler, ID_PAUSE, "bmp_Resume.bin", 0); + lv_label_set_text(labelPause, printing_menu.pause); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); + //recovery.resume(); + print_time.minutes = recovery.info.print_job_elapsed / 60; + print_time.seconds = recovery.info.print_job_elapsed % 60; + print_time.hours = print_time.minutes / 60; + } #endif } } @@ -117,7 +117,6 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_OPTION: if (event == LV_EVENT_CLICKED) { - } else if (event == LV_EVENT_RELEASED) { if (gcode_preview_over != 1) { @@ -131,7 +130,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { void lv_draw_printing(void) { lv_obj_t *buttonExt1, *buttonExt2, *buttonFanstate, *buttonZpos, *buttonTime; - TERN_(HAS_HEATED_BED, lv_obj_t *buttonBedstate); + TERN_(HAS_HEATED_BED, lv_obj_t * buttonBedstate); disp_state_stack._disp_index = 0; ZERO(disp_state_stack._disp_state); @@ -180,60 +179,60 @@ void lv_draw_printing(void) { lv_imgbtn_set_style(buttonExt1, LV_BTN_STATE_REL, &tft_style_lable_rel); lv_obj_clear_protect(buttonExt1, LV_PROTECT_FOLLOW); #if 1 - if (EXTRUDERS == 2) { - lv_obj_set_event_cb_mks(buttonExt2, event_handler, 0, "bmp_Ext2_state.bin", 0); - lv_imgbtn_set_src(buttonExt2, LV_BTN_STATE_REL, &bmp_pic_45x45); - lv_imgbtn_set_src(buttonExt2, LV_BTN_STATE_PR, &bmp_pic_45x45); - lv_imgbtn_set_style(buttonExt2, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonExt2, LV_BTN_STATE_REL, &tft_style_lable_rel); - } - #if HAS_HEATED_BED - lv_obj_set_event_cb_mks(buttonBedstate, event_handler, 0, "bmp_Bed_state.bin", 0); - lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_REL, &bmp_pic_45x45); - lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_PR, &bmp_pic_45x45); - lv_imgbtn_set_style(buttonBedstate, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBedstate, LV_BTN_STATE_REL, &tft_style_lable_rel); - #endif - - lv_obj_set_event_cb_mks(buttonFanstate, event_handler, 0, "bmp_Fan_state.bin", 0); - lv_imgbtn_set_src(buttonFanstate, LV_BTN_STATE_REL, &bmp_pic_45x45); - lv_imgbtn_set_src(buttonFanstate, LV_BTN_STATE_PR, &bmp_pic_45x45); - lv_imgbtn_set_style(buttonFanstate, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonFanstate, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonTime, event_handler, 0, "bmp_Time_state.bin", 0); - lv_imgbtn_set_src(buttonTime, LV_BTN_STATE_REL, &bmp_pic_45x45); - lv_imgbtn_set_src(buttonTime, LV_BTN_STATE_PR, &bmp_pic_45x45); - lv_imgbtn_set_style(buttonTime, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonTime, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonZpos, event_handler, 0, "bmp_Zpos_state.bin", 0); - lv_imgbtn_set_src(buttonZpos, LV_BTN_STATE_REL, &bmp_pic_45x45); - lv_imgbtn_set_src(buttonZpos, LV_BTN_STATE_PR, &bmp_pic_45x45); - lv_imgbtn_set_style(buttonZpos, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonZpos, LV_BTN_STATE_REL, &tft_style_lable_rel); + if (EXTRUDERS == 2) { + lv_obj_set_event_cb_mks(buttonExt2, event_handler, 0, "bmp_Ext2_state.bin", 0); + lv_imgbtn_set_src(buttonExt2, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonExt2, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonExt2, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonExt2, LV_BTN_STATE_REL, &tft_style_lable_rel); + } + #if HAS_HEATED_BED + lv_obj_set_event_cb_mks(buttonBedstate, event_handler, 0, "bmp_Bed_state.bin", 0); + lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonBedstate, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonBedstate, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBedstate, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif - if (uiCfg.print_state == WORKING) - lv_obj_set_event_cb_mks(buttonPause, event_handler, ID_PAUSE, "bmp_Resume.bin", 0); - else - lv_obj_set_event_cb_mks(buttonPause, event_handler, ID_PAUSE, "bmp_Pause.bin", 0); - - lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_REL, &bmp_pic_150x80); - lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_PR, &bmp_pic_150x80); - lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonStop, event_handler, ID_STOP, "bmp_Stop.bin", 0); - lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_REL, &bmp_pic_150x80); - lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_PR, &bmp_pic_150x80); - lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonOperat, event_handler, ID_OPTION, "bmp_Operate.bin", 0); - lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_REL, &bmp_pic_150x80); - lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_PR, &bmp_pic_150x80); - lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_set_event_cb_mks(buttonFanstate, event_handler, 0, "bmp_Fan_state.bin", 0); + lv_imgbtn_set_src(buttonFanstate, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonFanstate, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonFanstate, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonFanstate, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonTime, event_handler, 0, "bmp_Time_state.bin", 0); + lv_imgbtn_set_src(buttonTime, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonTime, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonTime, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonTime, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonZpos, event_handler, 0, "bmp_Zpos_state.bin", 0); + lv_imgbtn_set_src(buttonZpos, LV_BTN_STATE_REL, &bmp_pic_45x45); + lv_imgbtn_set_src(buttonZpos, LV_BTN_STATE_PR, &bmp_pic_45x45); + lv_imgbtn_set_style(buttonZpos, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonZpos, LV_BTN_STATE_REL, &tft_style_lable_rel); + + if (uiCfg.print_state == WORKING) + lv_obj_set_event_cb_mks(buttonPause, event_handler, ID_PAUSE, "bmp_Resume.bin", 0); + else + lv_obj_set_event_cb_mks(buttonPause, event_handler, ID_PAUSE, "bmp_Pause.bin", 0); + + lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_REL, &bmp_pic_150x80); + lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_PR, &bmp_pic_150x80); + lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonStop, event_handler, ID_STOP, "bmp_Stop.bin", 0); + lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_REL, &bmp_pic_150x80); + lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_PR, &bmp_pic_150x80); + lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonOperat, event_handler, ID_OPTION, "bmp_Operate.bin", 0); + lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_REL, &bmp_pic_150x80); + lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_PR, &bmp_pic_150x80); + lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif lv_obj_set_pos(buttonExt1, 205, 136); @@ -251,7 +250,7 @@ void lv_draw_printing(void) { lv_obj_set_pos(buttonStop, 165, 240); lv_obj_set_pos(buttonOperat, 325, 240); - /*Create a label on the Image button*/ + /*Create a label on the Image button*/ lv_btn_set_layout(buttonExt1, LV_LAYOUT_OFF); if (EXTRUDERS == 2) lv_btn_set_layout(buttonExt2, LV_LAYOUT_OFF); @@ -298,7 +297,7 @@ void lv_draw_printing(void) { labelStop = lv_label_create(buttonStop, NULL); labelOperat = lv_label_create(buttonOperat, NULL); - if (gCfgItems.multiple_language !=0) { + if (gCfgItems.multiple_language != 0) { if (uiCfg.print_state == WORKING) lv_label_set_text(labelPause, printing_menu.pause); else @@ -313,11 +312,11 @@ void lv_draw_printing(void) { } lv_style_copy(&lv_bar_style_indic, &lv_style_pretty_color); - lv_bar_style_indic.text.color = lv_color_hex3(0xADF); - lv_bar_style_indic.image.color = lv_color_hex3(0xADF); - lv_bar_style_indic.line.color = lv_color_hex3(0xADF); - 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.text.color = lv_color_hex3(0xADF); + lv_bar_style_indic.image.color = lv_color_hex3(0xADF); + lv_bar_style_indic.line.color = lv_color_hex3(0xADF); + 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); bar1 = lv_bar_create(scr, NULL); @@ -362,7 +361,7 @@ void disp_fan_speed() { void disp_print_time() { memset(public_buf_l, 0, sizeof(public_buf_l)); - sprintf(public_buf_l, "%d%d:%d%d:%d%d", print_time.hours/10, print_time.hours%10, print_time.minutes/10, print_time.minutes%10, print_time.seconds/10, print_time.seconds%10); + sprintf(public_buf_l, "%d%d:%d%d:%d%d", print_time.hours / 10, print_time.hours % 10, print_time.minutes / 10, print_time.minutes % 10, print_time.seconds / 10, print_time.seconds % 10); lv_label_set_text(labelTime, public_buf_l); } @@ -381,13 +380,9 @@ void reset_print_time() { //print_time.start = 1; } -void start_print_time() { - print_time.start = 1; -} +void start_print_time() { print_time.start = 1; } -void stop_print_time() { - print_time.start = 0; -} +void stop_print_time() { print_time.start = 0; } void setProBarRate() { int rate; @@ -395,15 +390,15 @@ void setProBarRate() { if (gCfgItems.from_flash_pic != 1) { #if ENABLED(SDSUPPORT) - rate_tmp_r =(long long)card.getIndex() * 100; + rate_tmp_r = (long long)card.getIndex() * 100; #endif rate = rate_tmp_r / gCfgItems.curFilesize; } else { #if ENABLED(SDSUPPORT) - rate_tmp_r =(long long)card.getIndex(); + rate_tmp_r = (long long)card.getIndex(); #endif - rate = (rate_tmp_r-(PREVIEW_SIZE+To_pre_view))* 100 / (gCfgItems.curFilesize-(PREVIEW_SIZE+To_pre_view)); + rate = (rate_tmp_r - (PREVIEW_SIZE + To_pre_view)) * 100 / (gCfgItems.curFilesize - (PREVIEW_SIZE + To_pre_view)); } //gCurFileState.totalSend = rate; @@ -424,16 +419,14 @@ void setProBarRate() { once_flag = 1; #if HAS_SUICIDE - if (gCfgItems.finish_power_off == 1) - suicide(); + if (gCfgItems.finish_power_off == 1) + suicide(); #endif } } } } -void lv_clear_printing() { - lv_obj_del(scr); -} +void lv_clear_printing() { lv_obj_del(scr); } #endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp index 4e8ebb942e59..442308b2cf5b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp @@ -23,7 +23,6 @@ #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../../../../MarlinCore.h" #include "draw_ready_print.h" #include "draw_tool.h" #include "lv_conf.h" @@ -32,307 +31,286 @@ //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "../../../../module/temperature.h" #include "tft_lvgl_configuration.h" -#include "stdio.h" #include "mks_hardware_test.h" #include "draw_ui.h" +#include + +#include "../../../../MarlinCore.h" +#include "../../../../module/temperature.h" //static lv_obj_t *buttonPrint,*buttonTool,*buttonSet; static lv_obj_t * scr; #if ENABLED(MKS_TEST) -uint8_t curent_disp_ui = 0; + uint8_t curent_disp_ui = 0; #endif -#define ID_TOOL 1 -#define ID_SET 2 -#define ID_PRINT 3 - -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - switch (obj->mks_obj_id) - { - case ID_TOOL: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - #if ENABLED(MKS_TEST) - curent_disp_ui = 2; - #endif - lv_obj_del(scr); - lv_draw_tool(); - } - break; - case ID_SET: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_obj_del(scr); - lv_draw_set(); - } - break; - case ID_PRINT: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_obj_del(scr); - lv_draw_print_file(); - } - break; - - - } +#define ID_TOOL 1 +#define ID_SET 2 +#define ID_PRINT 3 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_TOOL: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + #if ENABLED(MKS_TEST) + curent_disp_ui = 2; + #endif + lv_obj_del(scr); + lv_draw_tool(); + } + break; + case ID_SET: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_set(); + } + break; + case ID_PRINT: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_print_file(); + } + break; + } } #if ENABLED(MKS_TEST) -lv_obj_t *limit_info,*det_info; -lv_style_t limit_style,det_style; -void disp_Limit_ok() -{ - limit_style.text.color.full = 0xFFFF; - lv_obj_set_style(limit_info, &limit_style); - lv_label_set_text(limit_info, "Limit:ok"); -} -void disp_Limit_error() -{ - limit_style.text.color.full = 0xF800; - lv_obj_set_style(limit_info, &limit_style); - lv_label_set_text(limit_info, "Limit:error"); -} - -void disp_det_ok() -{ - det_style.text.color.full = 0xFFFF; - lv_obj_set_style(det_info, &det_style); - lv_label_set_text(det_info, "det:ok"); -} -void disp_det_error() -{ - det_style.text.color.full = 0xF800; - lv_obj_set_style(det_info, &det_style); - lv_label_set_text(det_info, "det:error"); -} - -lv_obj_t *e1,*e2,*e3,*bed; -void disp_test() -{ - char buf[30]={0}; - //lv_obj_t * label_tool2 = lv_label_create(scr, NULL); - //lv_obj_set_pos(label_tool,20,50); - memset(buf,0,sizeof(buf)); - sprintf(buf,"e1:%d",(int)thermalManager.temp_hotend[0].celsius); - lv_label_set_text(e1, buf); - - memset(buf,0,sizeof(buf)); - sprintf(buf,"e2:%d",(int)thermalManager.temp_hotend[1].celsius); - lv_label_set_text(e2, buf); - - memset(buf,0,sizeof(buf)); - sprintf(buf,"e3:%d",(int)thermalManager.temp_hotend[2].celsius); - lv_label_set_text(e3, buf); - - memset(buf,0,sizeof(buf)); - sprintf(buf,"bed:%d",(int)thermalManager.temp_bed.celsius); - lv_label_set_text(bed, buf); -} -#endif - -void lv_draw_ready_print(void) -{ - #if ENABLED(MKS_TEST) - char buf[30]={0}; - lv_obj_t *buttonTool; - - static lv_style_t style_pr,style_rel; - - curent_disp_ui = 1; - - scr = lv_obj_create(NULL, NULL); - - static lv_style_t ready_style; - - lv_style_copy(&ready_style, &lv_style_scr); - //ready_style.body.main_color.full = 0X18C3; - //ready_style.body.grad_color.full = 0X18C3; - ready_style.body.main_color.full = 0X0000; - ready_style.body.grad_color.full = 0X0000; - ready_style.text.color.full = 0Xffff; - lv_obj_set_style(scr, &ready_style); - lv_scr_load(scr); - lv_obj_clean(scr); - //lv_obj_set_hidden(scr,true); - lv_refr_now(lv_refr_get_disp_refreshing()); - - LV_IMG_DECLARE(bmp_pic); - //LV_IMG_DECLARE(bmp_pic2); - //LV_IMG_DECLARE(bmp_pic3); - - //scr = lv_obj_create(NULL, NULL); - //lv_scr_load(scr); - /*Create an Image button*/ - buttonTool = lv_imgbtn_create(scr, NULL); + lv_obj_t *limit_info, *det_info; + lv_style_t limit_style, det_style; + void disp_Limit_ok() { + limit_style.text.color.full = 0xFFFF; + lv_obj_set_style(limit_info, &limit_style); + lv_label_set_text(limit_info, "Limit:ok"); + } + void disp_Limit_error() { + limit_style.text.color.full = 0xF800; + lv_obj_set_style(limit_info, &limit_style); + lv_label_set_text(limit_info, "Limit:error"); + } + + void disp_det_ok() { + det_style.text.color.full = 0xFFFF; + lv_obj_set_style(det_info, &det_style); + lv_label_set_text(det_info, "det:ok"); + } + void disp_det_error() { + det_style.text.color.full = 0xF800; + lv_obj_set_style(det_info, &det_style); + lv_label_set_text(det_info, "det:error"); + } + + lv_obj_t *e1, *e2, *e3, *bed; + void disp_test() { + char buf[30] = {0}; + //lv_obj_t * label_tool2 = lv_label_create(scr, NULL); + //lv_obj_set_pos(label_tool,20,50); + memset(buf, 0, sizeof(buf)); + sprintf(buf, "e1:%d", (int)thermalManager.temp_hotend[0].celsius); + lv_label_set_text(e1, buf); + + memset(buf, 0, sizeof(buf)); + sprintf(buf, "e2:%d", (int)thermalManager.temp_hotend[1].celsius); + lv_label_set_text(e2, buf); + + memset(buf, 0, sizeof(buf)); + sprintf(buf, "e3:%d", (int)thermalManager.temp_hotend[2].celsius); + lv_label_set_text(e3, buf); + + memset(buf, 0, sizeof(buf)); + sprintf(buf, "bed:%d", (int)thermalManager.temp_bed.celsius); + lv_label_set_text(bed, buf); + } + +#endif // MKS_TEST + +void lv_draw_ready_print(void) { + #if ENABLED(MKS_TEST) + char buf[30] = {0}; + lv_obj_t *buttonTool; + + static lv_style_t style_pr, style_rel; + + curent_disp_ui = 1; + + scr = lv_obj_create(NULL, NULL); + + static lv_style_t ready_style; + + lv_style_copy(&ready_style, &lv_style_scr); + //ready_style.body.main_color.full = 0X18C3; + //ready_style.body.grad_color.full = 0X18C3; + ready_style.body.main_color.full = 0X0000; + ready_style.body.grad_color.full = 0X0000; + ready_style.text.color.full = 0Xffff; + lv_obj_set_style(scr, &ready_style); + lv_scr_load(scr); + lv_obj_clean(scr); + //lv_obj_set_hidden(scr,true); + lv_refr_now(lv_refr_get_disp_refreshing()); + + LV_IMG_DECLARE(bmp_pic); + //LV_IMG_DECLARE(bmp_pic2); + //LV_IMG_DECLARE(bmp_pic3); + + //scr = lv_obj_create(NULL, NULL); + //lv_scr_load(scr); - //lv_btn_setting(&style_pr,0x5d8f16,0x5d8f16); - //lv_btn_setting(&style_rel,0x5d8f16,0x5d8f16); - - lv_obj_set_event_cb_mks(buttonTool, event_handler,3,"bmp_Tool.bin",0); - //lv_imgbtn_set_src_mks(buttonTool, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_tool.bin"); - lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_PR, &style_pr); - lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_REL, &style_rel); - - - - lv_obj_set_pos(buttonTool,360,180); + /*Create an Image button*/ + buttonTool = lv_imgbtn_create(scr, NULL); + //lv_btn_setting(&style_pr,0x5d8f16,0x5d8f16); + //lv_btn_setting(&style_rel,0x5d8f16,0x5d8f16); - lv_btn_set_layout(buttonTool, LV_LAYOUT_OFF); + lv_obj_set_event_cb_mks(buttonTool, event_handler, 3, "bmp_Tool.bin", 0); + //lv_imgbtn_set_src_mks(buttonTool, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_tool.bin"); + lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_PR, &style_pr); + lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_REL, &style_rel); + lv_obj_set_pos(buttonTool, 360, 180); - lv_obj_t * label_tool = lv_label_create(buttonTool, NULL); + lv_btn_set_layout(buttonTool, LV_LAYOUT_OFF); - lv_obj_set_pos(label_tool,30,100); - lv_label_set_text(label_tool, "Back"); + lv_obj_t * label_tool = lv_label_create(buttonTool, NULL); - e1 = lv_label_create(scr, NULL); - lv_obj_set_pos(e1,20,20); - sprintf(buf,"e1: %d",(int)thermalManager.temp_hotend[0].celsius); - lv_label_set_text(e1, buf); + lv_obj_set_pos(label_tool, 30, 100); + lv_label_set_text(label_tool, "Back"); - e2 = lv_label_create(scr, NULL); - lv_obj_set_pos(e2,20,45); - sprintf(buf,"e1: %d",(int)thermalManager.temp_hotend[1].celsius); - lv_label_set_text(e2, buf); + e1 = lv_label_create(scr, NULL); + lv_obj_set_pos(e1, 20, 20); + sprintf(buf, "e1: %d", (int)thermalManager.temp_hotend[0].celsius); + lv_label_set_text(e1, buf); - e3 = lv_label_create(scr, NULL); - lv_obj_set_pos(e3,20,70); - sprintf(buf,"e1: %d",(int)thermalManager.temp_hotend[2].celsius); - lv_label_set_text(e3, buf); + e2 = lv_label_create(scr, NULL); + lv_obj_set_pos(e2, 20, 45); + sprintf(buf, "e1: %d", (int)thermalManager.temp_hotend[1].celsius); + lv_label_set_text(e2, buf); - bed = lv_label_create(scr, NULL); - lv_obj_set_pos(bed,20,95); - sprintf(buf,"bed: %d",(int)thermalManager.temp_bed.celsius); - lv_label_set_text(bed, buf); + e3 = lv_label_create(scr, NULL); + lv_obj_set_pos(e3, 20, 70); + sprintf(buf, "e1: %d", (int)thermalManager.temp_hotend[2].celsius); + lv_label_set_text(e3, buf); - limit_info = lv_label_create(scr, NULL); + bed = lv_label_create(scr, NULL); + lv_obj_set_pos(bed, 20, 95); + sprintf(buf, "bed: %d", (int)thermalManager.temp_bed.celsius); + lv_label_set_text(bed, buf); - lv_style_copy(&limit_style, &lv_style_scr); - limit_style.body.main_color.full = 0X0000; - limit_style.body.grad_color.full = 0X0000; - limit_style.text.color.full = 0Xffff; - lv_obj_set_style(limit_info, &limit_style); + limit_info = lv_label_create(scr, NULL); - lv_obj_set_pos(limit_info,20,120); - lv_label_set_text(limit_info, " "); + lv_style_copy(&limit_style, &lv_style_scr); + limit_style.body.main_color.full = 0X0000; + limit_style.body.grad_color.full = 0X0000; + limit_style.text.color.full = 0Xffff; + lv_obj_set_style(limit_info, &limit_style); - det_info = lv_label_create(scr, NULL); + lv_obj_set_pos(limit_info, 20, 120); + lv_label_set_text(limit_info, " "); - lv_style_copy(&det_style, &lv_style_scr); - det_style.body.main_color.full = 0X0000; - det_style.body.grad_color.full = 0X0000; - det_style.text.color.full = 0Xffff; - lv_obj_set_style(det_info, &det_style); + det_info = lv_label_create(scr, NULL); - lv_obj_set_pos(det_info,20,145); - lv_label_set_text(det_info, " "); + lv_style_copy(&det_style, &lv_style_scr); + det_style.body.main_color.full = 0X0000; + det_style.body.grad_color.full = 0X0000; + det_style.text.color.full = 0Xffff; + lv_obj_set_style(det_info, &det_style); - #else - lv_obj_t *buttonPrint,*buttonTool,*buttonSet; + lv_obj_set_pos(det_info, 20, 145); + lv_label_set_text(det_info, " "); + #else // !MKS_TEST + lv_obj_t *buttonPrint, *buttonTool, *buttonSet; - disp_state_stack._disp_index = 0; - memset(disp_state_stack._disp_state, 0, sizeof(disp_state_stack._disp_state)); - disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINT_READY_UI; + disp_state_stack._disp_index = 0; + memset(disp_state_stack._disp_state, 0, sizeof(disp_state_stack._disp_state)); + disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINT_READY_UI; - disp_state = PRINT_READY_UI; + disp_state = PRINT_READY_UI; - scr = lv_obj_create(NULL, NULL); + scr = lv_obj_create(NULL, NULL); - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); - //lv_obj_set_hidden(scr,true); - lv_refr_now(lv_refr_get_disp_refreshing()); + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + //lv_obj_set_hidden(scr,true); + lv_refr_now(lv_refr_get_disp_refreshing()); - LV_IMG_DECLARE(bmp_pic); + LV_IMG_DECLARE(bmp_pic); - //lv_obj_t * title = lv_label_create(scr, NULL); - //lv_obj_set_style(title, &tft_style_lable_rel); - //lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - //lv_label_set_text(title, creat_title_text()); + //lv_obj_t * title = lv_label_create(scr, NULL); + //lv_obj_set_style(title, &tft_style_lable_rel); + //lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + //lv_label_set_text(title, creat_title_text()); /*Create an Image button*/ buttonPrint = lv_imgbtn_create(scr, NULL); - buttonTool = lv_imgbtn_create(scr, NULL); - buttonSet = lv_imgbtn_create(scr, NULL); + buttonTool = lv_imgbtn_create(scr, NULL); + buttonSet = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonPrint, event_handler,ID_PRINT,"bmp_Print.bin",0); + lv_obj_set_event_cb_mks(buttonPrint, event_handler, ID_PRINT, "bmp_Print.bin", 0); //lv_imgbtn_set_src_mks(buttonPrint, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_printing.bin"); - lv_imgbtn_set_src(buttonPrint, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonPrint, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonPrint, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonPrint, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_clear_protect(buttonPrint, LV_PROTECT_FOLLOW); - #if 1 - lv_obj_set_event_cb_mks(buttonSet, event_handler,ID_SET,"bmp_Set.bin",0); - //lv_imgbtn_set_src_mks(buttonSet, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_set.bin"); - lv_imgbtn_set_src(buttonSet, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonSet, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonSet, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonSet, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonTool, event_handler,ID_TOOL,"bmp_Tool.bin",0); - //lv_imgbtn_set_src_mks(buttonTool, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_tool.bin"); - lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_REL, &tft_style_lable_rel); - - #endif - lv_obj_set_pos(buttonTool,20,90); - lv_obj_set_pos(buttonSet,180,90); - lv_obj_set_pos(buttonPrint,340,90); - - //lv_obj_set_pos(buttonTool,SIMPLE_FIRST_PAGE_GRAP+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); - //lv_obj_set_pos(buttonSet,BTN_X_PIXEL+SIMPLE_FIRST_PAGE_GRAP*2+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); - //lv_obj_set_pos(buttonPrint,BTN_X_PIXEL*2+SIMPLE_FIRST_PAGE_GRAP*3+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + lv_imgbtn_set_src(buttonPrint, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonPrint, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonPrint, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonPrint, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_obj_clear_protect(buttonPrint, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonSet, event_handler, ID_SET, "bmp_Set.bin", 0); + //lv_imgbtn_set_src_mks(buttonSet, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_set.bin"); + lv_imgbtn_set_src(buttonSet, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonSet, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonSet, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonSet, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonTool, event_handler, ID_TOOL, "bmp_Tool.bin", 0); + //lv_imgbtn_set_src_mks(buttonTool, LV_BTN_STATE_REL, &bmp_pic,(uint8_t *)"bmp_tool.bin"); + lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif + lv_obj_set_pos(buttonTool, 20, 90); + lv_obj_set_pos(buttonSet, 180, 90); + lv_obj_set_pos(buttonPrint, 340, 90); + + //lv_obj_set_pos(buttonTool,SIMPLE_FIRST_PAGE_GRAP+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + //lv_obj_set_pos(buttonSet,BTN_X_PIXEL+SIMPLE_FIRST_PAGE_GRAP*2+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + //lv_obj_set_pos(buttonPrint,BTN_X_PIXEL*2+SIMPLE_FIRST_PAGE_GRAP*3+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); /*Create a label on the Image button*/ - lv_btn_set_layout(buttonPrint, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonSet, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonTool, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonPrint, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonSet, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonTool, LV_LAYOUT_OFF); lv_obj_t * label_print = lv_label_create(buttonPrint, NULL); - lv_obj_t * label_set = lv_label_create(buttonSet, NULL); - lv_obj_t * label_tool = lv_label_create(buttonTool, NULL); - if (gCfgItems.multiple_language !=0) - { - - lv_label_set_text(label_print, main_menu.print); - lv_obj_align(label_print, buttonPrint, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_set, main_menu.set); - lv_obj_align(label_set, buttonSet, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - //lv_label_set_style(label_tool,LV_BTN_STATE_PR,&tft_style_lable_pre); - //lv_label_set_style(label_tool,LV_BTN_STATE_REL,&tft_style_lable_rel); - lv_label_set_text(label_tool, main_menu.tool); - lv_obj_align(label_tool, buttonTool, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } - - #endif + lv_obj_t * label_set = lv_label_create(buttonSet, NULL); + lv_obj_t * label_tool = lv_label_create(buttonTool, NULL); + if (gCfgItems.multiple_language != 0) { + + lv_label_set_text(label_print, main_menu.print); + lv_obj_align(label_print, buttonPrint, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_set, main_menu.set); + lv_obj_align(label_set, buttonSet, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_style(label_tool,LV_BTN_STATE_PR,&tft_style_lable_pre); + //lv_label_set_style(label_tool,LV_BTN_STATE_REL,&tft_style_lable_rel); + lv_label_set_text(label_tool, main_menu.tool); + lv_obj_align(label_tool, buttonTool, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + #endif // !MKS_TEST } +void lv_clear_ready_print() { lv_obj_del(scr); } -void lv_clear_ready_print() -{ - lv_obj_del(scr); -} - -#endif +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp index c56a13408337..25932c94a36b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp @@ -36,235 +36,217 @@ static lv_obj_t * scr; -#define ID_S_WIFI 1 -#define ID_S_FAN 2 -#define ID_S_ABOUT 3 -#define ID_S_CONTINUE 4 -#define ID_S_MOTOR_OFF 5 -#define ID_S_LANGUAGE 6 -#define ID_S_RETURN 7 - -static void event_handler(lv_obj_t * obj, lv_event_t event) -{ - switch (obj->mks_obj_id) - { - case ID_S_WIFI: - if (event == LV_EVENT_CLICKED) { - - - } - else if (event == LV_EVENT_RELEASED) { - - } - break; - case ID_S_FAN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_obj_del(scr); - lv_draw_fan(); - } - break; - case ID_S_ABOUT: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_obj_del(scr); - lv_draw_about(); - } - break; - case ID_S_CONTINUE: - - break; - case ID_S_MOTOR_OFF: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - #if HAS_SUICIDE - suicide(); - #else - queue.enqueue_one_now(PSTR("M84")); - #endif - } - break; - case ID_S_LANGUAGE: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_obj_del(scr); - lv_draw_language(); - } - break; - case ID_S_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_obj_del(scr); - lv_draw_ready_print(); - } - break; - - } +#define ID_S_WIFI 1 +#define ID_S_FAN 2 +#define ID_S_ABOUT 3 +#define ID_S_CONTINUE 4 +#define ID_S_MOTOR_OFF 5 +#define ID_S_LANGUAGE 6 +#define ID_S_RETURN 7 + +static void event_handler(lv_obj_t * obj, lv_event_t event) { + switch (obj->mks_obj_id) { + case ID_S_WIFI: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + } + break; + case ID_S_FAN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_fan(); + } + break; + case ID_S_ABOUT: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_about(); + } + break; + case ID_S_CONTINUE: + + break; + case ID_S_MOTOR_OFF: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + #if HAS_SUICIDE + suicide(); + #else + queue.enqueue_one_now(PSTR("M84")); + #endif + } + break; + case ID_S_LANGUAGE: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_language(); + } + break; + case ID_S_RETURN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_obj_del(scr); + lv_draw_ready_print(); + } + break; + + } } +void lv_draw_set(void) { + lv_obj_t *buttonFan, *buttonAbout; + lv_obj_t *buMotorOff, *buttonLanguage, *buttonBack; -void lv_draw_set(void) -{ - lv_obj_t *buttonFan,*buttonAbout; - lv_obj_t *buMotorOff,*buttonLanguage,*buttonBack; + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != SET_UI) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = SET_UI; + } + disp_state = SET_UI; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != SET_UI) - { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = SET_UI; - } - disp_state = SET_UI; + scr = lv_obj_create(NULL, NULL); - scr = lv_obj_create(NULL, NULL); + //static lv_style_t tool_style; - //static lv_style_t tool_style; - - lv_obj_set_style(scr, &tft_style_scr); + lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + lv_obj_set_style(title, &tft_style_lable_rel); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); + lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - LV_IMG_DECLARE(bmp_pic); - - /*Create an Image button*/ - //buttonWifi = lv_imgbtn_create(scr, NULL); - buttonFan = lv_imgbtn_create(scr, NULL); - buttonAbout = lv_imgbtn_create(scr, NULL); - //buttonContinue = lv_imgbtn_create(scr, NULL); - buMotorOff = lv_imgbtn_create(scr, NULL); - buttonLanguage = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - - //lv_obj_set_event_cb_mks(buttonWifi, event_handler,ID_S_WIFI,"bmp_Wifi.bin",0); - //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_REL, &bmp_pic); - //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_PR, &bmp_pic); - //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_PR, &tft_style_lable_pre); - //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_REL, &tft_style_lable_rel); - //lv_obj_clear_protect(buttonWifi, LV_PROTECT_FOLLOW); - #if 1 - lv_obj_set_event_cb_mks(buttonFan, event_handler,ID_S_FAN,"bmp_Fan.bin",0); - lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_REL, &bmp_pic); - lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_REL, &tft_style_lable_rel); - - lv_obj_set_event_cb_mks(buttonAbout, event_handler,ID_S_ABOUT,"bmp_About.bin",0); + LV_IMG_DECLARE(bmp_pic); + + /*Create an Image button*/ + //buttonWifi = lv_imgbtn_create(scr, NULL); + buttonFan = lv_imgbtn_create(scr, NULL); + buttonAbout = lv_imgbtn_create(scr, NULL); + //buttonContinue = lv_imgbtn_create(scr, NULL); + buMotorOff = lv_imgbtn_create(scr, NULL); + buttonLanguage = lv_imgbtn_create(scr, NULL); + buttonBack = lv_imgbtn_create(scr, NULL); + + + //lv_obj_set_event_cb_mks(buttonWifi, event_handler,ID_S_WIFI,"bmp_Wifi.bin",0); + //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_REL, &bmp_pic); + //lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_PR, &bmp_pic); + //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_PR, &tft_style_lable_pre); + //lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_REL, &tft_style_lable_rel); + //lv_obj_clear_protect(buttonWifi, LV_PROTECT_FOLLOW); + #if 1 + lv_obj_set_event_cb_mks(buttonFan, event_handler, ID_S_FAN, "bmp_Fan.bin", 0); + lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_REL, &bmp_pic); + lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_PR, &bmp_pic); + lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_REL, &tft_style_lable_rel); + + lv_obj_set_event_cb_mks(buttonAbout, event_handler, ID_S_ABOUT, "bmp_About.bin", 0); lv_imgbtn_set_src(buttonAbout, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonAbout, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonAbout, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonAbout, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonAbout, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonAbout, LV_BTN_STATE_REL, &tft_style_lable_rel); - //lv_obj_set_event_cb_mks(buttonContinue, event_handler,ID_S_CONTINUE,"bmp_Breakpoint.bin",0); + //lv_obj_set_event_cb_mks(buttonContinue, event_handler,ID_S_CONTINUE,"bmp_Breakpoint.bin",0); //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_REL, &bmp_pic); //lv_imgbtn_set_src(buttonContinue, LV_BTN_STATE_PR, &bmp_pic); - //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_PR, &tft_style_lable_pre); - //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_REL, &tft_style_lable_rel); - #if HAS_SUICIDE - lv_obj_set_event_cb_mks(buMotorOff, event_handler,ID_S_MOTOR_OFF,"bmp_Mamual.bin",0); - #else - lv_obj_set_event_cb_mks(buMotorOff, event_handler,ID_S_MOTOR_OFF,"bmp_Motor_off.bin",0); - #endif + //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_PR, &tft_style_lable_pre); + //lv_imgbtn_set_style(buttonContinue, LV_BTN_STATE_REL, &tft_style_lable_rel); + #if HAS_SUICIDE + lv_obj_set_event_cb_mks(buMotorOff, event_handler, ID_S_MOTOR_OFF, "bmp_Mamual.bin", 0); + #else + lv_obj_set_event_cb_mks(buMotorOff, event_handler, ID_S_MOTOR_OFF, "bmp_Motor_off.bin", 0); + #endif lv_imgbtn_set_src(buMotorOff, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buMotorOff, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buMotorOff, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buMotorOff, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buMotorOff, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buMotorOff, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonLanguage, event_handler,ID_S_LANGUAGE,"bmp_Language.bin",0); + lv_obj_set_event_cb_mks(buttonLanguage, event_handler, ID_S_LANGUAGE, "bmp_Language.bin", 0); lv_imgbtn_set_src(buttonLanguage, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonLanguage, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonLanguage, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonLanguage, LV_BTN_STATE_REL, &tft_style_lable_rel); + lv_imgbtn_set_style(buttonLanguage, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonLanguage, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_S_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_S_RETURN, "bmp_Return.bin", 0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); - - #endif - - /*lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonFan,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); - lv_obj_set_pos(buttonAbout,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); - lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buMotorOff,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonLanguage,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight);*/ - - //lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonFan,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); - lv_obj_set_pos(buttonAbout,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); - //lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buMotorOff,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttonLanguage,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - - /*Create a label on the Image button*/ - //lv_btn_set_layout(buttonWifi, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonFan, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonAbout, LV_LAYOUT_OFF); - //lv_btn_set_layout(buttonContinue, LV_LAYOUT_OFF); - lv_btn_set_layout(buMotorOff, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonLanguage, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - //lv_obj_t * labelWifi= lv_label_create(buttonWifi, NULL); - lv_obj_t * labelFan = lv_label_create(buttonFan, NULL); - lv_obj_t * label_About = lv_label_create(buttonAbout, NULL); - //lv_obj_t * label_Continue = lv_label_create(buttonContinue, NULL); - lv_obj_t * label_MotorOff = lv_label_create(buMotorOff, NULL); - lv_obj_t * label_Language = lv_label_create(buttonLanguage, NULL); - lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - - - if (gCfgItems.multiple_language !=0) - { - //lv_label_set_text(labelWifi, set_menu.wifi); - //lv_obj_align(labelWifi, buttonWifi, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelFan, set_menu.fan); - lv_obj_align(labelFan, buttonFan, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_About,set_menu.about); - lv_obj_align(label_About, buttonAbout, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - //lv_label_set_text(label_Continue, set_menu.breakpoint); - //lv_obj_align(label_Continue, buttonContinue, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - #if HAS_SUICIDE - lv_label_set_text(label_MotorOff, set_menu.shutdown); - #else - lv_label_set_text(label_MotorOff, set_menu.motoroff); - #endif - lv_obj_align(label_MotorOff, buMotorOff, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Language, set_menu.language); - lv_obj_align(label_Language, buttonLanguage, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); + lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); + #endif + + /*lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonFan,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); + lv_obj_set_pos(buttonAbout,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); + lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buMotorOff,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonLanguage,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight);*/ + + //lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); + lv_obj_set_pos(buttonFan, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); + lv_obj_set_pos(buttonAbout, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); + //lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); + lv_obj_set_pos(buMotorOff, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonLanguage, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + + /*Create a label on the Image button*/ + //lv_btn_set_layout(buttonWifi, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonFan, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonAbout, LV_LAYOUT_OFF); + //lv_btn_set_layout(buttonContinue, LV_LAYOUT_OFF); + lv_btn_set_layout(buMotorOff, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonLanguage, LV_LAYOUT_OFF); + lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + + //lv_obj_t * labelWifi= lv_label_create(buttonWifi, NULL); + lv_obj_t * labelFan = lv_label_create(buttonFan, NULL); + lv_obj_t * label_About = lv_label_create(buttonAbout, NULL); + //lv_obj_t * label_Continue = lv_label_create(buttonContinue, NULL); + lv_obj_t * label_MotorOff = lv_label_create(buMotorOff, NULL); + lv_obj_t * label_Language = lv_label_create(buttonLanguage, NULL); + lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); + + + if (gCfgItems.multiple_language != 0) { + //lv_label_set_text(labelWifi, set_menu.wifi); + //lv_obj_align(labelWifi, buttonWifi, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(labelFan, set_menu.fan); + lv_obj_align(labelFan, buttonFan, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_About, set_menu.about); + lv_obj_align(label_About, buttonAbout, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + //lv_label_set_text(label_Continue, set_menu.breakpoint); + //lv_obj_align(label_Continue, buttonContinue, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + #if HAS_SUICIDE + lv_label_set_text(label_MotorOff, set_menu.shutdown); + #else + lv_label_set_text(label_MotorOff, set_menu.motoroff); + #endif + lv_obj_align(label_MotorOff, buMotorOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Language, set_menu.language); + lv_obj_align(label_Language, buttonLanguage, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } } -void lv_clear_set() -{ - lv_obj_del(scr); -} +void lv_clear_set() { lv_obj_del(scr); } -#endif +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp index b243c2018a4f..ff801f77e933 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp @@ -24,11 +24,11 @@ #if ENABLED(TFT_LITTLE_VGL_UI) #include "lv_conf.h" +#include "draw_ui.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "draw_ui.h" #include "../../../../MarlinCore.h" #include "../../../../gcode/queue.h" @@ -58,60 +58,60 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { lv_draw_preHeat(); } break; - case ID_T_EXTRUCT: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_tool(); - lv_draw_extrusion(); - } - break; - case ID_T_MOV: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_tool(); - lv_draw_move_motor(); - } - break; - case ID_T_HOME: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_tool(); - lv_draw_home(); - } - break; - case ID_T_LEVELING: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - queue.enqueue_one_P(PSTR("G28")); - queue.enqueue_one_P(PSTR("G29")); - #else - uiCfg.leveling_first_time = 1; + case ID_T_EXTRUCT: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { lv_clear_tool(); - lv_draw_manualLevel(); - #endif - } - break; - case ID_T_FILAMENT: break; - case ID_T_MORE: break; - case ID_T_RETURN: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - TERN_(MKS_TEST, curent_disp_ui = 1); - lv_obj_del(scr); - lv_draw_ready_print(); - } - break; + lv_draw_extrusion(); + } + break; + case ID_T_MOV: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_tool(); + lv_draw_move_motor(); + } + break; + case ID_T_HOME: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + lv_clear_tool(); + lv_draw_home(); + } + break; + case ID_T_LEVELING: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + queue.enqueue_one_P(PSTR("G28")); + queue.enqueue_one_P(PSTR("G29")); + #else + uiCfg.leveling_first_time = 1; + lv_clear_tool(); + lv_draw_manualLevel(); + #endif + } + break; + case ID_T_FILAMENT: break; + case ID_T_MORE: break; + case ID_T_RETURN: + if (event == LV_EVENT_CLICKED) { + } + else if (event == LV_EVENT_RELEASED) { + TERN_(MKS_TEST, curent_disp_ui = 1); + lv_obj_del(scr); + lv_draw_ready_print(); + } + break; } } void lv_draw_tool(void) { - lv_obj_t *buttonPreHeat,*buttonExtrusion,*buttonMove,*buttonHome,*buttonLevel; + lv_obj_t *buttonPreHeat, *buttonExtrusion, *buttonMove, *buttonHome, *buttonLevel; lv_obj_t *buttonBack; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != TOOL_UI) { @@ -130,7 +130,7 @@ void lv_draw_tool(void) { lv_obj_t * title = lv_label_create(scr, NULL); lv_obj_set_style(title, &tft_style_lable_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); + lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); lv_label_set_text(title, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); @@ -167,13 +167,13 @@ void lv_draw_tool(void) { lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonHome, event_handler,ID_T_HOME,"bmp_Zero.bin",0); + lv_obj_set_event_cb_mks(buttonHome, event_handler, ID_T_HOME, "bmp_Zero.bin", 0); lv_imgbtn_set_src(buttonHome, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonHome, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonHome, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonHome, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonLevel, event_handler,ID_T_LEVELING,"bmp_Leveling.bin",0); + lv_obj_set_event_cb_mks(buttonLevel, event_handler, ID_T_LEVELING, "bmp_Leveling.bin", 0); lv_imgbtn_set_src(buttonLevel, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonLevel, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_PR, &tft_style_lable_pre); @@ -191,21 +191,21 @@ void lv_draw_tool(void) { //lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_PR, &tft_style_lable_pre); //lv_imgbtn_set_style(buttonMore, LV_BTN_STATE_REL, &tft_style_lable_rel); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_T_RETURN,"bmp_Return.bin",0); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_T_RETURN, "bmp_Return.bin", 0); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic); lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre); lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_lable_rel); #endif - lv_obj_set_pos(buttonPreHeat,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonExtrusion,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); - lv_obj_set_pos(buttonMove,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); - lv_obj_set_pos(buttonHome,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buttonLevel,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonPreHeat, INTERVAL_V, titleHeight); + lv_obj_set_pos(buttonExtrusion, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); + lv_obj_set_pos(buttonMove, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); + lv_obj_set_pos(buttonHome, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); + lv_obj_set_pos(buttonLevel, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); //lv_obj_set_pos(buttonFilament,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); //lv_obj_set_pos(buttonMore,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); /*Create a label on the Image button*/ lv_btn_set_layout(buttonPreHeat, LV_LAYOUT_OFF); @@ -226,18 +226,18 @@ void lv_draw_tool(void) { //lv_obj_t * label_More = lv_label_create(buttonMore, NULL); lv_obj_t * label_Back = lv_label_create(buttonBack, NULL); - if (gCfgItems.multiple_language !=0) { - lv_label_set_text(labelPreHeat, tool_menu.preheat); - lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + if (gCfgItems.multiple_language != 0) { + lv_label_set_text(labelPreHeat, tool_menu.preheat); + lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); lv_label_set_text(labelExtrusion, tool_menu.extrude); - lv_obj_align(labelExtrusion, buttonExtrusion, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelExtrusion, buttonExtrusion, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); lv_label_set_text(label_Move, tool_menu.move); - lv_obj_align(label_Move, buttonMove, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(label_Move, buttonMove, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - lv_label_set_text(label_Home, tool_menu.home); - lv_obj_align(label_Home, buttonHome, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_label_set_text(label_Home, tool_menu.home); + lv_obj_align(label_Home, buttonHome, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); /* if (gCfgItems.leveling_mode != 2) { @@ -259,8 +259,6 @@ void lv_draw_tool(void) { } } -void lv_clear_tool() { - lv_obj_del(scr); -} +void lv_clear_tool() { lv_obj_del(scr); } -#endif +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index 44871e3115dc..01fa6bc37a69 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -51,7 +51,7 @@ UI_CFG uiCfg; DISP_STATE_STACK disp_state_stack; DISP_STATE disp_state = MAIN_UI; DISP_STATE last_disp_state; -PRINT_TIME print_time; +PRINT_TIME print_time; uint32_t To_pre_view; uint8_t gcode_preview_over; @@ -78,21 +78,21 @@ void gCfgItems_init() { gCfgItems.finish_power_off = 0; gCfgItems.pause_reprint = 0; - W25QXX.SPI_FLASH_BufferRead((uint8_t *)&gCfgItems.spi_flash_flag,VAR_INF_ADDR,sizeof(gCfgItems.spi_flash_flag)); + W25QXX.SPI_FLASH_BufferRead((uint8_t *)&gCfgItems.spi_flash_flag, VAR_INF_ADDR, sizeof(gCfgItems.spi_flash_flag)); if (gCfgItems.spi_flash_flag == GCFG_FLAG_VALUE) { - W25QXX.SPI_FLASH_BufferRead((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); + W25QXX.SPI_FLASH_BufferRead((uint8_t *)&gCfgItems, VAR_INF_ADDR, sizeof(gCfgItems)); } else { gCfgItems.spi_flash_flag = GCFG_FLAG_VALUE; W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); - W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); + W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems, VAR_INF_ADDR, sizeof(gCfgItems)); } } void gCfg_to_spiFlah() { W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); - W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); + W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems, VAR_INF_ADDR, sizeof(gCfgItems)); } void ui_cfg_init() { @@ -110,7 +110,7 @@ void ui_cfg_init() { void update_spi_flash() { W25QXX.init(SPI_QUARTER_SPEED); W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); - W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems,VAR_INF_ADDR,sizeof(gCfgItems)); + W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems, VAR_INF_ADDR, sizeof(gCfgItems)); } lv_style_t tft_style_scr; @@ -119,32 +119,32 @@ lv_style_t tft_style_lable_rel; void tft_style_init() { lv_style_copy(&tft_style_scr, &lv_style_scr); - tft_style_scr.body.main_color = LV_COLOR_BACKGROUND; - tft_style_scr.body.grad_color = LV_COLOR_BACKGROUND; - tft_style_scr.text.color = LV_COLOR_TEXT; - tft_style_scr.text.sel_color = LV_COLOR_TEXT; - tft_style_scr.line.width = 0; - tft_style_scr.text.letter_space = 0; - tft_style_scr.text.line_space = 0; + tft_style_scr.body.main_color = LV_COLOR_BACKGROUND; + tft_style_scr.body.grad_color = LV_COLOR_BACKGROUND; + tft_style_scr.text.color = LV_COLOR_TEXT; + tft_style_scr.text.sel_color = LV_COLOR_TEXT; + tft_style_scr.line.width = 0; + tft_style_scr.text.letter_space = 0; + tft_style_scr.text.line_space = 0; lv_style_copy(&tft_style_lable_pre, &lv_style_scr); lv_style_copy(&tft_style_lable_rel, &lv_style_scr); tft_style_lable_pre.body.main_color = LV_COLOR_BACKGROUND; tft_style_lable_pre.body.grad_color = LV_COLOR_BACKGROUND; - tft_style_lable_pre.text.color = LV_COLOR_TEXT; - tft_style_lable_pre.text.sel_color = LV_COLOR_TEXT; + tft_style_lable_pre.text.color = LV_COLOR_TEXT; + tft_style_lable_pre.text.sel_color = LV_COLOR_TEXT; tft_style_lable_rel.body.main_color = LV_COLOR_BACKGROUND; tft_style_lable_rel.body.grad_color = LV_COLOR_BACKGROUND; - tft_style_lable_rel.text.color = LV_COLOR_TEXT; - tft_style_lable_rel.text.sel_color = LV_COLOR_TEXT; - tft_style_lable_pre.text.font = &gb2312_puhui32; - tft_style_lable_rel.text.font = &gb2312_puhui32; - tft_style_lable_pre.line.width = 0; - tft_style_lable_rel.line.width = 0; - tft_style_lable_pre.text.letter_space = 0; - tft_style_lable_rel.text.letter_space = 0; - tft_style_lable_pre.text.line_space = -5; - tft_style_lable_rel.text.line_space = -5; + tft_style_lable_rel.text.color = LV_COLOR_TEXT; + tft_style_lable_rel.text.sel_color = LV_COLOR_TEXT; + tft_style_lable_pre.text.font = &gb2312_puhui32; + tft_style_lable_rel.text.font = &gb2312_puhui32; + tft_style_lable_pre.line.width = 0; + tft_style_lable_rel.line.width = 0; + tft_style_lable_pre.text.letter_space = 0; + tft_style_lable_rel.text.letter_space = 0; + tft_style_lable_pre.text.line_space = -5; + tft_style_lable_rel.text.line_space = -5; } #define MAX_TITLE_LEN 28 @@ -154,10 +154,8 @@ char public_buf_m[100] = {0}; char public_buf_l[30]; void titleText_cat(char *str, int strSize, char *addPart) { - if (str == 0 || addPart == 0) - return; - if ((int)(strlen(str) + strlen(addPart)) >= strSize) - return; + if (str == 0 || addPart == 0) return; + if ((int)(strlen(str) + strlen(addPart)) >= strSize) return; strcat(str, addPart); } @@ -174,38 +172,32 @@ char *getDispText(int index) { break; case PRINTING_UI: if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI - #ifndef TFT35 - || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI - || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI - #endif - ) - strcpy(public_buf_l, common_menu.print_special_title); - else - strcpy(public_buf_l, printing_menu.title); + #ifndef TFT35 + || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI + #endif + ) strcpy(public_buf_l, common_menu.print_special_title); + else strcpy(public_buf_l, printing_menu.title); break; case MOVE_MOTOR_UI: strcpy(public_buf_l, move_menu.title); break; case OPERATE_UI: if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI - #ifndef TFT35 - || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI - || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI - #endif - ) - strcpy(public_buf_l, common_menu.operate_special_title); - else - strcpy(public_buf_l, operation_menu.title); + #ifndef TFT35 + || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI + #endif + ) strcpy(public_buf_l, common_menu.operate_special_title); + else strcpy(public_buf_l, operation_menu.title); break; case PAUSE_UI: if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI - || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI - || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI - ) - strcpy(public_buf_l, common_menu.pause_special_title); - else - strcpy(public_buf_l, pause_menu.title); + || disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI + ) strcpy(public_buf_l, common_menu.pause_special_title); + else strcpy(public_buf_l, pause_menu.title); break; case EXTRUSION_UI: @@ -218,10 +210,8 @@ char *getDispText(int index) { strcpy(public_buf_l, fan_menu.title); break; case PRE_HEAT_UI: - if ((disp_state_stack._disp_state[disp_state_stack._disp_index - 1] == OPERATE_UI)) - strcpy(public_buf_l,preheat_menu.adjust_title); - else - strcpy(public_buf_l, preheat_menu.title); + if ((disp_state_stack._disp_state[disp_state_stack._disp_index - 1] == OPERATE_UI)) strcpy(public_buf_l, preheat_menu.adjust_title); + else strcpy(public_buf_l, preheat_menu.title); break; case SET_UI: strcpy(public_buf_l, set_menu.title); @@ -305,17 +295,14 @@ char *creat_title_text() { } titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); - if (index < disp_state_stack._disp_index) { - titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)">"); - } + if (index < disp_state_stack._disp_index) titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)">"); index++; } if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI - /*|| disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI - || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI*/) - { + /*|| disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI + || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI*/) { titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)":"); titleText_cat(public_buf_m, sizeof(public_buf_m), tmpCurFileStr); } @@ -328,9 +315,7 @@ char *creat_title_text() { titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)">...>"); tmpText = getDispText(disp_state_stack._disp_index); - if (*tmpText != 0) { - titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); - } + if (*tmpText != 0) titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); } } @@ -338,35 +323,34 @@ char *creat_title_text() { return public_buf_m; } - void preview_gcode_prehandle(char *path) { #if ENABLED(SDSUPPORT) - //uint8_t re; - //uint32_t read; - uint32_t pre_read_cnt = 0; - uint32_t *p1; - char *cur_name; - - cur_name=strrchr(path,'/'); - card.openFileRead(cur_name); - card.read(public_buf, 512); - p1 = (uint32_t *)strstr((char *)public_buf,";simage:"); - - if (p1) { - 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; - update_spi_flash(); - } - else { - gcode_preview_over = 0; - default_preview_flg = 1; - gCfgItems.from_flash_pic = 0; - update_spi_flash(); - } - card.closefile(); + //uint8_t re; + //uint32_t read; + uint32_t pre_read_cnt = 0; + uint32_t *p1; + char *cur_name; + + cur_name = strrchr(path, '/'); + card.openFileRead(cur_name); + card.read(public_buf, 512); + p1 = (uint32_t *)strstr((char *)public_buf, ";simage:"); + + if (p1) { + 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; + update_spi_flash(); + } + else { + gcode_preview_over = 0; + default_preview_flg = 1; + gCfgItems.from_flash_pic = 0; + update_spi_flash(); + } + card.closefile(); #endif } @@ -383,14 +367,14 @@ void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) { cur_name = strrchr(path, '/'); card.openFileRead(cur_name); - card.setIndex((PREVIEW_LITTLE_PIC_SIZE+To_pre_view)+size*row+8); + card.setIndex((PREVIEW_LITTLE_PIC_SIZE + To_pre_view) + size * row + 8); #if ENABLED(SPI_GRAPHICAL_TFT) SPI_TFT.spi_init(SPI_FULL_SPEED); //SPI_TFT.SetCursor(0,0); - SPI_TFT.SetWindows(xpos_pixel, ypos_pixel+row, 200,1); + SPI_TFT.SetWindows(xpos_pixel, ypos_pixel + row, 200, 1); SPI_TFT.LCD_WriteRAM_Prepare(); #else - ili9320_SetWindows(xpos_pixel, ypos_pixel+row, 200,1); + ili9320_SetWindows(xpos_pixel, ypos_pixel + row, 200, 1); LCD_WriteRAM_Prepare(); #endif @@ -398,23 +382,22 @@ void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) { while (1) { card.read(public_buf, 400); - for(i = 0; i < 400;) { - bmp_public_buf[j] = ascii2dec_test((char*)&public_buf[i])<<4|ascii2dec_test((char*)&public_buf[i+1]); + for (i = 0; i < 400;) { + bmp_public_buf[j] = ascii2dec_test((char*)&public_buf[i]) << 4 | ascii2dec_test((char*)&public_buf[i + 1]); i += 2; j++; } //if (i > 800) break; //#ifdef TFT70 - //if (j>400) { - // f_read(file, buff_pic, 1, &read); - // break; - //} + //if (j>400) { + // f_read(file, buff_pic, 1, &read); + // break; + //} //#elif defined(TFT35) - if (j >= 400) { - //f_read(file, buff_pic, 1, &read); - break; - } + if (j >= 400) + //f_read(file, buff_pic, 1, &read); + break; //#endif } @@ -429,7 +412,6 @@ void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) { SPI_TFT_DC_H; SPI.dmaSend(bmp_public_buf, 400, true); SPI_TFT_CS_H; - #else for (i = 0; i < 400;) { p_index = (uint16_t *)(&bmp_public_buf[i]); @@ -439,9 +421,8 @@ void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) { } #endif W25QXX.init(SPI_QUARTER_SPEED); - if (row < 20) - W25QXX.SPI_FLASH_SectorErase(BAK_VIEW_ADDR_TFT35 + row*4096); - W25QXX.SPI_FLASH_BufferWrite(bmp_public_buf, BAK_VIEW_ADDR_TFT35 + row*400, 400); + if (row < 20) W25QXX.SPI_FLASH_SectorErase(BAK_VIEW_ADDR_TFT35 + row * 4096); + W25QXX.SPI_FLASH_BufferWrite(bmp_public_buf, BAK_VIEW_ADDR_TFT35 + row * 400, 400); row++; if (row >= 200) { size = 809; @@ -483,14 +464,14 @@ void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) { card.openFileRead(cur_name); if (card.isFileOpen()) { - feedrate_percentage = 100; - // saved_feedrate_percentage = feedrate_percentage; - planner.flow_percentage[0] = 100; - planner.e_factor[0]= planner.flow_percentage[0] * 0.01; - if (EXTRUDERS == 2) { - planner.flow_percentage[1] = 100; - planner.e_factor[1]= planner.flow_percentage[1] * 0.01; - } + feedrate_percentage = 100; + // saved_feedrate_percentage = feedrate_percentage; + planner.flow_percentage[0] = 100; + planner.e_factor[0] = planner.flow_percentage[0] * 0.01; + if (EXTRUDERS == 2) { + planner.flow_percentage[1] = 100; + planner.e_factor[1] = planner.flow_percentage[1] * 0.01; + } card.startFileprint(); TERN_(POWER_LOSS_RECOVERY, recovery.prepare()); once_flag = 0; @@ -498,26 +479,23 @@ void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) { return; } card.closefile(); - #endif + #endif // SDSUPPORT } -void Draw_default_preview(int xpos_pixel,int ypos_pixel,uint8_t sel) { +void Draw_default_preview(int xpos_pixel, int ypos_pixel, uint8_t sel) { int index; int x_off = 0, y_off = 0; int _y; uint16_t *p_index; - int i,j; - uint16_t temp_p,Color; + int i, j; + uint16_t temp_p, Color; - for(index = 0; index < 10; index ++)//200*200 { - if (sel == 1) { - flash_view_Read(bmp_public_buf, 8000);//20k - //memset(bmp_public_buf,0x1f,8000); - } - else { + for (index = 0; index < 10; index++) { // 200*200 + if (sel == 1) flash_view_Read(bmp_public_buf, 8000); //20k + //memset(bmp_public_buf,0x1f,8000); + else //memset(bmp_public_buf,0x1f,8000); - default_view_Read(bmp_public_buf, 8000);//20k - } + default_view_Read(bmp_public_buf, 8000); //20k i = 0; #if ENABLED(SPI_GRAPHICAL_TFT) @@ -527,7 +505,7 @@ void Draw_default_preview(int xpos_pixel,int ypos_pixel,uint8_t sel) { j = 0; for (_y = y_off * 20; _y < (y_off + 1) * 20; _y++) { SPI_TFT.spi_init(SPI_FULL_SPEED); - SPI_TFT.SetWindows(xpos_pixel, y_off * 20+ypos_pixel+j, 200, 1); //200*200 + SPI_TFT.SetWindows(xpos_pixel, y_off * 20 + ypos_pixel + j, 200, 1); //200*200 SPI_TFT.LCD_WriteRAM_Prepare(); j++; @@ -540,21 +518,20 @@ void Draw_default_preview(int xpos_pixel,int ypos_pixel,uint8_t sel) { i += 400; if (i >= 8000) break; } - #else - ili9320_SetWindows(xpos_pixel, y_off * 20 + ypos_pixel, 200, 20); //200*200 LCD_WriteRAM_Prepare(); for (_y = y_off * 20; _y < (y_off + 1) * 20; _y++) { for (x_off = 0; x_off < 200; x_off++) { - if (sel==1) { - temp_p = (uint16_t)(bmp_public_buf[i]|bmp_public_buf[i+1]<<8); + if (sel == 1) { + temp_p = (uint16_t)(bmp_public_buf[i] | bmp_public_buf[i + 1] << 8); p_index = &temp_p; } - else + else { p_index = (uint16_t *)(&bmp_public_buf[i]); + } LCD_IO_WriteData(*p_index); i += 2; } @@ -566,16 +543,14 @@ void Draw_default_preview(int xpos_pixel,int ypos_pixel,uint8_t sel) { W25QXX.init(SPI_QUARTER_SPEED); } - -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); +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 (flash_preview_begin == 1) { flash_preview_begin = 0; - Draw_default_preview(xpos_pixel,ypos_pixel,1); + Draw_default_preview(xpos_pixel, ypos_pixel, 1); } if (default_preview_flg == 1) { - Draw_default_preview(xpos_pixel,ypos_pixel,0); + Draw_default_preview(xpos_pixel, ypos_pixel, 0); default_preview_flg = 0; } } @@ -592,17 +567,14 @@ void print_time_run() { } } if (disp_state == PRINTING_UI) { - if (lastSec != print_time.seconds) - disp_print_time(); - lastSec = print_time.seconds; + if (lastSec != print_time.seconds) disp_print_time(); + lastSec = print_time.seconds; } } void GUI_RefreshPage() { - if ((systick_uptime_millis % 1000) == 0) - temperature_change_frequency = 1; - if ((systick_uptime_millis % 3000) == 0) - printing_rate_update_flag = 1; + if ((systick_uptime_millis % 1000) == 0) temperature_change_frequency = 1; + if ((systick_uptime_millis % 3000) == 0) printing_rate_update_flag = 1; switch (disp_state) { case MAIN_UI: @@ -988,10 +960,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 == 1) flash_preview_begin = 1; + else default_preview_flg = 1; lv_draw_printing(); break; case MOVE_MOTOR_UI: @@ -1001,11 +971,11 @@ void draw_return_ui() { lv_draw_opration(); break; - #if 1 - case PAUSE_UI: - //draw_pause(); - break; - #endif + #if 1 + case PAUSE_UI: + //draw_pause(); + break; + #endif case EXTRUSION_UI: lv_draw_extrusion(); @@ -1038,11 +1008,11 @@ void draw_return_ui() { lv_draw_about(); break; - #if tan_mask - case LOG_UI: - //draw_Connect(); - break; - #endif + #if tan_mask + case LOG_UI: + //draw_Connect(); + break; + #endif case CALIBRATE_UI: //draw_calibrate(); @@ -1069,11 +1039,11 @@ void draw_return_ui() { //draw_bind(); break; - #if tan_mask - case ZOFFSET_UI: - //draw_Zoffset(); - break; - #endif + #if tan_mask + case ZOFFSET_UI: + //draw_Zoffset(); + break; + #endif case TOOL_UI: lv_draw_tool(); @@ -1180,6 +1150,7 @@ void draw_return_ui() { } #if ENABLED(SDSUPPORT) + void sd_detection() { static bool last_sd_status; const bool sd_status = IS_SD_INSERTED(); @@ -1188,22 +1159,21 @@ void draw_return_ui() { if (sd_status) card.mount(); else card.release(); } } + #endif extern volatile uint32_t systick_uptime_millis; void print_time_count() { - if ((systick_uptime_millis % 1000) == 0) { - if (print_time.start == 1) - print_time.seconds++; - } + if ((systick_uptime_millis % 1000) == 0) + if (print_time.start == 1) print_time.seconds++; } void LV_TASK_HANDLER() { //lv_tick_inc(1); lv_task_handler(); TERN_(MKS_TEST, mks_test()); - disp_pre_gcode(2,36); + disp_pre_gcode(2, 36); GUI_RefreshPage(); //sd_detection(); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h index 8ee047abd466..54720a3c1f41 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -103,17 +103,17 @@ typedef struct { } CFG_ITMES; typedef struct { - uint8_t curTempType:1, - curSprayerChoose:3, - stepHeat:4; - uint8_t leveling_first_time:1; + uint8_t curTempType : 1, + curSprayerChoose : 3, + stepHeat : 4; + uint8_t leveling_first_time : 1; uint8_t extruStep; uint8_t extruSpeed; uint8_t print_state; uint8_t stepPrintSpeed; uint8_t waitEndMoves; uint16_t moveSpeed; - float move_dist; + float move_dist; } UI_CFG; typedef enum { @@ -185,18 +185,18 @@ typedef enum { typedef struct { DISP_STATE _disp_state[100]; - int _disp_index; + int _disp_index; } DISP_STATE_STACK; typedef struct { - int16_t days; - uint16_t hours; - uint8_t minutes; + int16_t days; + uint16_t hours; + uint8_t minutes; volatile int8_t seconds; - int8_t ms_10; - int8_t start; + int8_t ms_10; + int8_t start; } PRINT_TIME; -extern PRINT_TIME print_time; +extern PRINT_TIME print_time; extern CFG_ITMES gCfgItems; extern UI_CFG uiCfg; @@ -214,7 +214,7 @@ extern void tft_style_init(); extern char *creat_title_text(void); extern void preview_gcode_prehandle(char *path); extern void update_spi_flash(); -extern void disp_pre_gcode(int xpos_pixel,int ypos_pixel); +extern void disp_pre_gcode(int xpos_pixel, int ypos_pixel); extern void GUI_RefreshPage(); extern void clear_cur_ui(); extern void draw_return_ui(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp b/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp index 513fe41c391c..39fb836b6054 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp @@ -1,7 +1,3 @@ -/* -*--------------------------------------------------------------- -*--------------------------------------------------------------- -*/ /** * Marlin 3D Printer Firmware * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] @@ -31,18 +27,18 @@ #include "lvgl.h" #include "pic_manager.h" -typedef struct{ +typedef struct { uint16_t min; uint16_t max; - uint8_t bpp; - uint8_t reserved[3]; + uint8_t bpp; + uint8_t reserved[3]; } x_header_t; -typedef struct{ +typedef struct { uint32_t pos; } x_table_t; -typedef struct{ +typedef struct { uint8_t adv_w; uint8_t box_w; } glyph_dsc_t; @@ -50,61 +46,59 @@ typedef struct{ static x_header_t __g_xbf_hd = { .min = 0, .max = 0, .bpp = 0 }; static uint8_t __g_font_buf[75]; -static uint8_t *__user_font_getdata(int offset, int size){ +static uint8_t *__user_font_getdata(int offset, int size) { //memset(__g_font_buf,0,sizeof(__g_font_buf)); - get_spi_flash_data((char *)__g_font_buf,offset,size); + get_spi_flash_data((char *)__g_font_buf, offset, size); return __g_font_buf; //return &buf_test[offset]; } static const uint8_t * __user_font_get_bitmap(const lv_font_t * font, uint32_t unicode_letter) { - if ( __g_xbf_hd.max==0 ) { + if (__g_xbf_hd.max == 0) { uint8_t *p = __user_font_getdata(0, sizeof(x_header_t)); memcpy(&__g_xbf_hd, p, sizeof(x_header_t)); } - if ( unicode_letter>__g_xbf_hd.max || unicode_letter<__g_xbf_hd.min ) { + if (unicode_letter > __g_xbf_hd.max || unicode_letter < __g_xbf_hd.min) return NULL; - } - uint32_t unicode_offset = sizeof(x_header_t)+(unicode_letter-__g_xbf_hd.min)*4; + uint32_t unicode_offset = sizeof(x_header_t) + (unicode_letter - __g_xbf_hd.min) * 4; uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); - if ( p_pos[0] != 0 ) { + if (p_pos[0] != 0) { uint32_t pos = p_pos[0]; //glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(pos, 2); __user_font_getdata(pos, 2); //return __user_font_getdata(pos+2, gdsc->box_w*__g_xbf_hd.bpp/8); - return __user_font_getdata(pos+2, sizeof(__g_font_buf)); + return __user_font_getdata(pos + 2, sizeof(__g_font_buf)); } return NULL; } static bool __user_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { - if ( __g_xbf_hd.max==0 ) { + if (__g_xbf_hd.max == 0) { uint8_t *p = __user_font_getdata(0, sizeof(x_header_t)); memcpy(&__g_xbf_hd, p, sizeof(x_header_t)); } - if ( unicode_letter>__g_xbf_hd.max || unicode_letter<__g_xbf_hd.min ) { + if (unicode_letter > __g_xbf_hd.max || unicode_letter < __g_xbf_hd.min) return NULL; - } - uint32_t unicode_offset = sizeof(x_header_t)+(unicode_letter-__g_xbf_hd.min)*4; + uint32_t unicode_offset = sizeof(x_header_t) + (unicode_letter - __g_xbf_hd.min) * 4; uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); - if ( p_pos[0] != 0 ) { + if (p_pos[0] != 0) { glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(p_pos[0], 2); dsc_out->adv_w = gdsc->adv_w; dsc_out->box_h = font->line_height; dsc_out->box_w = gdsc->box_w; dsc_out->ofs_x = 0; dsc_out->ofs_y = 0; - dsc_out->bpp = __g_xbf_hd.bpp; + dsc_out->bpp = __g_xbf_hd.bpp; return true; } return false; } /*lv_font_t gb2312_puhui32 = { - .get_glyph_bitmap = __user_font_get_bitmap, - .get_glyph_dsc = __user_font_get_glyph_dsc, - .line_height = 25, - .base_line = 0, +.get_glyph_bitmap = __user_font_get_bitmap, +.get_glyph_dsc = __user_font_get_glyph_dsc, +.line_height = 25, +.base_line = 0, };*/ lv_font_t gb2312_puhui32; void init_gb2312_font() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp index 50af31a5f1d5..08ce13c8aa80 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp @@ -106,7 +106,7 @@ WRITE(E2_ENABLE_PIN, LOW); } - void mks_test_beeper(){ + void mks_test_beeper() { WRITE(BEEPER_PIN, HIGH); delay(100); WRITE(BEEPER_PIN, LOW); @@ -122,24 +122,20 @@ if ((pw_det_sta == 1) && (mt_det_sta == 1) && (mt_det2_sta == 1) && (mt_det3_sta == 1)) { if (curent_disp_ui == 1) disp_det_ok(); } - else { - if (curent_disp_ui == 1) disp_det_error(); - } - if ( (endstopx1_sta == 1) - && (endstopx2_sta == 1) - && (endstopy1_sta == 1) - && (endstopy2_sta == 1) - && (endstopz1_sta == 1) - && (endstopz2_sta == 1) - ) { + else if (curent_disp_ui == 1) disp_det_error(); + if ((endstopx1_sta == 1) + && (endstopx2_sta == 1) + && (endstopy1_sta == 1) + && (endstopy2_sta == 1) + && (endstopz1_sta == 1) + && (endstopz2_sta == 1) + ) { if (curent_disp_ui == 1) disp_Limit_ok(); } - else { - if (curent_disp_ui == 1) { - disp_Limit_error(); - //mks_test_beeper(); - } - } + else if (curent_disp_ui == 1) + disp_Limit_error(); + //mks_test_beeper(); + } void mks_test() { @@ -151,10 +147,10 @@ WRITE(E1_DIR_PIN, LOW); WRITE(E2_DIR_PIN, LOW); thermalManager.fan_speed[0] = 255; - WRITE(HEATER_2_PIN, HIGH); // HE2 - WRITE(HEATER_1_PIN, HIGH); // HE1 - WRITE(HEATER_0_PIN, HIGH); // HE0 - WRITE(HEATER_BED_PIN, HIGH); // HOT-BED + WRITE(HEATER_2_PIN, HIGH); // HE2 + WRITE(HEATER_1_PIN, HIGH); // HE1 + WRITE(HEATER_0_PIN, HIGH); // HE0 + WRITE(HEATER_BED_PIN, HIGH); // HOT-BED } else { WRITE(X_DIR_PIN, HIGH); @@ -164,19 +160,20 @@ WRITE(E1_DIR_PIN, HIGH); WRITE(E2_DIR_PIN, HIGH); thermalManager.fan_speed[0] = 0; - WRITE(HEATER_2_PIN, LOW); // HE2 - WRITE(HEATER_1_PIN, LOW); // HE1 - WRITE(HEATER_0_PIN, LOW); // HE0 - WRITE(HEATER_BED_PIN, LOW); // HOT-BED + WRITE(HEATER_2_PIN, LOW); // HE2 + WRITE(HEATER_1_PIN, LOW); // HE1 + WRITE(HEATER_0_PIN, LOW); // HE0 + WRITE(HEATER_BED_PIN, LOW); // HOT-BED } - if ( (endstopx1_sta == 1) && (endstopx2_sta == 1) - && (endstopy1_sta == 1) && (endstopy2_sta == 1) - && (endstopz1_sta == 1) && (endstopz2_sta == 1) - ) { + if ((endstopx1_sta == 1) && (endstopx2_sta == 1) + && (endstopy1_sta == 1) && (endstopy2_sta == 1) + && (endstopz1_sta == 1) && (endstopz2_sta == 1) + ) { } - else + else { mks_test_beeper(); + } if (curent_disp_ui == 1) disp_test(); @@ -569,7 +566,7 @@ static const uint16_t ASCII_Table_16x24[] PROGMEM = { void disp_char_1624(uint16_t x, uint16_t y, uint8_t c, uint16_t charColor, uint16_t bkColor) { for (uint16_t i = 0; i < 24; i++) { - const uint16_t tmp_char = pgm_read_word(&ASCII_Table_16x24[((c-0x20)*24)+i]); + const uint16_t tmp_char = pgm_read_word(&ASCII_Table_16x24[((c - 0x20) * 24) + i]); for (uint16_t j = 0; j < 16; j++) tft_set_point(x + j, y + i, ((tmp_char >> j) & 0x01) ? charColor : bkColor); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp index 0d49a4a28646..85049ed3a19c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp @@ -42,44 +42,38 @@ extern uint16_t DeviceCode; extern unsigned char bmp_public_buf[17 * 1024]; #if ENABLED(SDSUPPORT) -extern char *createFilename(char * const buffer, const dir_t &p); + extern char *createFilename(char * const buffer, const dir_t &p); #endif -/*void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) { -}*/ +/*void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) {}*/ + uint32_t lv_get_pic_addr(uint8_t *Pname) { uint8_t Pic_cnt; uint8_t i, j; PIC_MSG PIC; uint32_t tmp_cnt = 0; - uint32_t addr=0; + uint32_t addr = 0; W25QXX.init(SPI_QUARTER_SPEED); - W25QXX.SPI_FLASH_BufferRead(&Pic_cnt,PIC_COUNTER_ADDR,1); - if (Pic_cnt == 0xff) { + W25QXX.SPI_FLASH_BufferRead(&Pic_cnt, PIC_COUNTER_ADDR, 1); + if (Pic_cnt == 0xff) Pic_cnt = 0; - } - for (i=0;i= TITLELOGO_MAX_SIZE) TitleLogoWrite_Addroffset = 0; @@ -210,8 +204,8 @@ uint8_t Pic_TitleLogo_Write(uint8_t *TitleLogoName,uint8_t *TitleLogo_Wbuff,uint } uint32_t default_view_addroffset_r = 0; -void default_view_Write(uint8_t *default_view__Rbuff,uint32_t default_view_Writesize) { - W25QXX.SPI_FLASH_BufferWrite(default_view__Rbuff,DEFAULT_VIEW_ADDR_TFT35+default_view_addroffset_r,default_view_Writesize); +void default_view_Write(uint8_t *default_view__Rbuff, uint32_t default_view_Writesize) { + W25QXX.SPI_FLASH_BufferWrite(default_view__Rbuff, DEFAULT_VIEW_ADDR_TFT35 + default_view_addroffset_r, default_view_Writesize); default_view_addroffset_r += default_view_Writesize; if (default_view_addroffset_r >= DEFAULT_VIEW_MAX_SIZE) default_view_addroffset_r = 0; @@ -224,7 +218,7 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { uint32_t Pic_NameSaveAddr; //uint8_t temp; uint8_t Pname_temp; - uint32_t i,j; + uint32_t i, j; uint32_t name_len = 0; uint32_t SaveName_len = 0; union union32 size_tmp; @@ -235,37 +229,37 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { //uint32_t Name_saveAddr = 0; //uint8_t pic_position; - W25QXX.SPI_FLASH_BufferRead(&pic_counter,PIC_COUNTER_ADDR,1); + W25QXX.SPI_FLASH_BufferRead(&pic_counter, PIC_COUNTER_ADDR, 1); if (pic_counter == 0xFF) pic_counter = 0; - if ((DeviceCode==0x9488)||(DeviceCode==0x5761)) + if ((DeviceCode == 0x9488) || (DeviceCode == 0x5761)) Pic_SaveAddr = PIC_DATA_ADDR_TFT35 + pic_counter * PER_PIC_MAX_SPACE_TFT35; else Pic_SaveAddr = PIC_DATA_ADDR_TFT32 + pic_counter * PER_PIC_MAX_SPACE_TFT32; - for (j = 0;j < pic_counter;j ++) { + for (j = 0; j < pic_counter; j++) { do { - W25QXX.SPI_FLASH_BufferRead(&Pname_temp,PIC_NAME_ADDR + SaveName_len,1); - SaveName_len ++; + W25QXX.SPI_FLASH_BufferRead(&Pname_temp, PIC_NAME_ADDR + SaveName_len, 1); + SaveName_len++; } while (Pname_temp != '\0'); } i = 0; - while ((*(P_name+i) != '\0')) { + while ((*(P_name + i) != '\0')) { i++; name_len++; } Pic_NameSaveAddr = PIC_NAME_ADDR + SaveName_len; - W25QXX.SPI_FLASH_BufferWrite(P_name,Pic_NameSaveAddr,name_len+1); - Pic_SizeSaveAddr = PIC_SIZE_ADDR+4*pic_counter; + W25QXX.SPI_FLASH_BufferWrite(P_name, Pic_NameSaveAddr, name_len + 1); + Pic_SizeSaveAddr = PIC_SIZE_ADDR + 4 * pic_counter; size_tmp.dwords = P_size; - W25QXX.SPI_FLASH_BufferWrite(size_tmp.bytes,Pic_SizeSaveAddr,4); + W25QXX.SPI_FLASH_BufferWrite(size_tmp.bytes, Pic_SizeSaveAddr, 4); pic_counter++; W25QXX.SPI_FLASH_SectorErase(PIC_COUNTER_ADDR); - W25QXX.SPI_FLASH_BufferWrite(&pic_counter,PIC_COUNTER_ADDR,1); + W25QXX.SPI_FLASH_BufferWrite(&pic_counter, PIC_COUNTER_ADDR, 1); return Pic_SaveAddr; } @@ -273,7 +267,7 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { uint8_t public_buf[512]; //uint8_t public_buf_test[512]; -#if ENABLED(SDSUPPORT) + #if ENABLED(SDSUPPORT) void UpdatePic() { //int r; //unsigned char *p; @@ -286,9 +280,9 @@ void UpdatePic() { /*----------------------------------*/ // FILINFO fno; - //DIR dir; + //DIR dir; //char tmp[30]; - #if 0//_USE_LFN + #if 0//_USE_LFN static char lfn[_MAX_LFN + 1]; finfo.lfname = lfn; finfo.lfsize = sizeof(lfn); @@ -314,25 +308,24 @@ void UpdatePic() { dir_t d; while (dir.readDir(&d, card.longFilename) > 0) { #if 1 - /* - if (power_det == 0) { - PW_DET_ON; - power_det=0; - } - SPI_FLASH_Init(); - */ + /* + if (power_det == 0) { + PW_DET_ON; + power_det=0; + } + SPI_FLASH_Init(); + */ - //for (uint16_t i = 0; i < fileCnt; i++) { + //for (uint16_t i = 0; i < fileCnt; i++) { //res = f_readdir(&dirs, &finfo); //card.getfilename_sorted(i); - if (card.longFilename[0] == 0) { + if (card.longFilename[0] == 0) break; - } /*if ( card.filename[0] == '.') - continue; - */ - if ( card.longFilename[0] == '.') + continue; + */ + if (card.longFilename[0] == '.') continue; fn = card.longFilename; @@ -383,36 +376,34 @@ void UpdatePic() { if (logoFlag == 1) { while (1) { pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); - Pic_Logo_Write((uint8_t *)fn,public_buf,pbr); // + Pic_Logo_Write((uint8_t *)fn, public_buf, pbr); // if (pbr < BMP_WRITE_BUF_LEN) break; } } else if (logoFlag == 2) { while (1) { pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); - Pic_TitleLogo_Write((uint8_t *)fn,public_buf,pbr); // + Pic_TitleLogo_Write((uint8_t *)fn, public_buf, pbr); // if (pbr < BMP_WRITE_BUF_LEN) break; } } - else if (logoFlag == 3) - { + else if (logoFlag == 3) { while (1) { pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); - default_view_Write(public_buf,pbr); // + default_view_Write(public_buf, pbr); // if (pbr < BMP_WRITE_BUF_LEN) break; } } - else - { + else { pfileSize = file.fileSize(); - Pic_Write_Addr = Pic_Info_Write((uint8_t *)fn,pfileSize); + Pic_Write_Addr = Pic_Info_Write((uint8_t *)fn, pfileSize); //uint32_t addr_test = Pic_Write_Addr; //memset(bmp_public_buf, 0xff, BMP_WRITE_BUF_LEN); while (1) { pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); - W25QXX.SPI_FLASH_BufferWrite(public_buf,Pic_Write_Addr,pbr); + W25QXX.SPI_FLASH_BufferWrite(public_buf, Pic_Write_Addr, pbr); Pic_Write_Addr += pbr; if (pbr < BMP_WRITE_BUF_LEN) break; } @@ -437,37 +428,35 @@ void UpdatePic() { } } - //} - //} - /* - LCD_Clear(LCD_COLOR_BLACK); - //LCD_ShowString(110,100,200,24,24,"Complete"); - LCD_DisplayString(110,80,"Complete"); - delay(0xfffff); - */ - //r = f_chdir("/"); - #if 1 - //SdFile dir, root = card.getroot(); + //} + //} + /* + LCD_Clear(LCD_COLOR_BLACK); + //LCD_ShowString(110,100,200,24,24,"Complete"); + LCD_DisplayString(110,80,"Complete"); + delay(0xfffff); + */ + //r = f_chdir("/"); + #if 1 + //SdFile dir, root = card.getroot(); /*if (dir.open(&root, bakPath, O_RDONLY)) { dir.remove(); }*/ - //r = f_rename(picPath, bakPath); + //r = f_rename(picPath, bakPath); - //update_flag_ok = 1; - #endif + //update_flag_ok = 1; + #endif #endif } dir.rename(&root, bakPath); - } + } } -void spi_flash_read_test() { - W25QXX.SPI_FLASH_BufferRead(public_buf,UNIGBK_FLASH_ADDR,BMP_WRITE_BUF_LEN); -} +void spi_flash_read_test() {W25QXX.SPI_FLASH_BufferRead(public_buf, UNIGBK_FLASH_ADDR, BMP_WRITE_BUF_LEN);} void UpdateFont() { //int r; @@ -476,15 +465,15 @@ void UpdateFont() { char *fn; //unsigned char logoFlag; uint16_t pbr; - uint32_t flashaddr=0; + uint32_t flashaddr = 0; //uint32_t pfileSize; //uint32_t Pic_Write_Addr; /*----------------------------------*/ // FILINFO fno; - //DIR dir; + //DIR dir; //char tmp[30]; - #if 0//_USE_LFN + #if 0//_USE_LFN static char lfn[_MAX_LFN + 1]; finfo.lfname = lfn; finfo.lfsize = sizeof(lfn); @@ -502,37 +491,34 @@ void UpdateFont() { //if (!fname) return; SdFile dir, root = card.getroot(); - if (dir.open(&root, fontPath, O_RDONLY)) - { + if (dir.open(&root, fontPath, O_RDONLY)) { - disp_font_update(); - spiFlashErase_FONT(); + disp_font_update(); + spiFlashErase_FONT(); dir_t d; while (dir.readDir(&d, card.longFilename) > 0) { #if 1 - /*if (power_det == 0) - { - PW_DET_ON; - power_det=0; - } - SPI_FLASH_Init();*/ + /*if (power_det == 0) + { + PW_DET_ON; + power_det=0; + } + SPI_FLASH_Init();*/ - //for (uint16_t i = 0; i < fileCnt; i++) - //{ + //for (uint16_t i = 0; i < fileCnt; i++) + //{ //res = f_readdir(&dirs, &finfo); //card.getfilename_sorted(i); if (card.longFilename[0] == 0) - { break; - } /*if ( card.filename[0] == '.') - continue; - */ - if ( card.longFilename[0] == '.') + continue; + */ + if (card.longFilename[0] == '.') continue; fn = card.longFilename; @@ -549,121 +535,119 @@ void UpdateFont() { else */ //{ //if ((strstr(fn, ".gco")) || (strstr(fn, ".GCO")) || (fno.fattrib & AM_DIR)) - if (strstr(fn, ".bin")) - { + if (strstr(fn, ".bin")) { char dosFilename[FILENAME_LENGTH]; createFilename(dosFilename, d); //strcat(public_buf, dosFilename); SdFile file; - if (file.open(&dir, dosFilename, O_READ)) - { + if (file.open(&dir, dosFilename, O_READ)) { #if 1 - /*LCD_Clear(BACK_COLOR); + /*LCD_Clear(BACK_COLOR); - if ((DeviceCode==0x9488)||(DeviceCode==0x5761)) - { - LCD_ShowString(170,100,200,24,24,(u8 *)fn); - LCD_ShowString(180,130,200,24,24,"Updating..."); - } - else - { - LCD_ShowString(90,90,200,24,24,(u8 *)fn); - LCD_ShowString(90,120,200,24,24,"Updating..."); - } - */ - flashaddr=UNIGBK_FLASH_ADDR; - pbr = 0; - while (1) - { - flashaddr += pbr; - pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); - W25QXX.SPI_FLASH_BufferWrite(public_buf,flashaddr,pbr); - //W25QXX.SPI_FLASH_BufferRead(public_buf_test,flashaddr,pbr); - /*if (UNIGBKFlag == 1) + if ((DeviceCode==0x9488)||(DeviceCode==0x5761)) { - fontrate = (uint16_t)(((float)(flashaddr - UNIGBK_FLASH_ADDR)/(float)(psrc.fsize))*100); + LCD_ShowString(170,100,200,24,24,(u8 *)fn); + LCD_ShowString(180,130,200,24,24,"Updating..."); } else { - fontrate = (uint16_t)(((float)(flashaddr - GBK_FLASH_ADDR)/(float)(psrc.fsize))*100); + LCD_ShowString(90,90,200,24,24,(u8 *)fn); + LCD_ShowString(90,120,200,24,24,"Updating..."); } - - if (fontrate > 99) fontrate=99; - - if (fontrate < 10) + */ + flashaddr = UNIGBK_FLASH_ADDR; + pbr = 0; + while (1) { - fontString[0] = fontrate%10 + 0x30; - fontString[1] = '%'; - fontString[2] = '\0'; + flashaddr += pbr; + pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); + W25QXX.SPI_FLASH_BufferWrite(public_buf, flashaddr, pbr); + //W25QXX.SPI_FLASH_BufferRead(public_buf_test,flashaddr,pbr); + /*if (UNIGBKFlag == 1) + { + fontrate = (uint16_t)(((float)(flashaddr - UNIGBK_FLASH_ADDR)/(float)(psrc.fsize))*100); + } + else + { + fontrate = (uint16_t)(((float)(flashaddr - GBK_FLASH_ADDR)/(float)(psrc.fsize))*100); + } + + if (fontrate > 99) fontrate=99; + + if (fontrate < 10) + { + fontString[0] = fontrate%10 + 0x30; + fontString[1] = '%'; + fontString[2] = '\0'; + } + else + { + fontString[0] = fontrate/10 + 0x30; + fontString[1] = fontrate%10 + 0x30; + fontString[2] = '%'; + fontString[3] = '\0'; + }*/ + //LCD_DisplayString(140,130,fontString); + if ((DeviceCode == 0x9488) || (DeviceCode == 0x5761)) { + //LCD_ShowString(200,160,200,24,24,fontString); + } + else { + //LCD_ShowString(140,150,200,24,24,fontString); + } + if (pbr < BMP_WRITE_BUF_LEN) break; } - else - { - fontString[0] = fontrate/10 + 0x30; - fontString[1] = fontrate%10 + 0x30; - fontString[2] = '%'; - fontString[3] = '\0'; - }*/ - //LCD_DisplayString(140,130,fontString); - if ((DeviceCode==0x9488)||(DeviceCode==0x5761)) + /*--------------read test--------------------*/ + /* + BufferSet(picBuffer, 0xff, PICTURE_MAX_SIZE); + if (logoFlag == 0) { - //LCD_ShowString(200,160,200,24,24,fontString); + PicMsg_Init(); + Pic_Read(fn,picBuffer); } else - { - //LCD_ShowString(140,150,200,24,24,fontString); - } - if (pbr < BMP_WRITE_BUF_LEN) break; - } - /*--------------read test--------------------*/ - /* - BufferSet(picBuffer, 0xff, PICTURE_MAX_SIZE); - if (logoFlag == 0) - { - PicMsg_Init(); - Pic_Read(fn,picBuffer); - } - else - Pic_Logo_Read(fn,picBuffer,PICTURE_MAX_SIZE); - */ - /*--------------read test--------------------*/ + Pic_Logo_Read(fn,picBuffer,PICTURE_MAX_SIZE); + */ + /*--------------read test--------------------*/ - file.close(); + file.close(); #endif } } - //} - //} - /* - LCD_Clear(LCD_COLOR_BLACK); - //LCD_ShowString(110,100,200,24,24,"Complete"); - LCD_DisplayString(110,80,"Complete"); - delay(0xfffff); - */ - //r = f_chdir("/"); - #if 1 - //SdFile dir, root = card.getroot(); + //} + //} + /* + LCD_Clear(LCD_COLOR_BLACK); + //LCD_ShowString(110,100,200,24,24,"Complete"); + LCD_DisplayString(110,80,"Complete"); + delay(0xfffff); + */ + //r = f_chdir("/"); + #if 1 + //SdFile dir, root = card.getroot(); /*if (dir.open(&root, bakPath, O_RDONLY)) { dir.remove(); }*/ - dir.rename(&root, bakFont); - //r = f_rename(picPath, bakPath); + dir.rename(&root, bakFont); + //r = f_rename(picPath, bakPath); - //update_flag_ok = 1; - #endif + //update_flag_ok = 1; + #endif #endif } - } + } } -#endif + #endif // SDSUPPORT + #endif #if 1 -void Pic_Read(uint8_t *Pname,uint8_t *P_Rbuff) { + +void Pic_Read(uint8_t *Pname, uint8_t *P_Rbuff) { uint8_t i, j; uint8_t Pic_cnt; uint32_t tmp_cnt = 0; @@ -671,25 +655,23 @@ void Pic_Read(uint8_t *Pname,uint8_t *P_Rbuff) { //void SPI_FLASH_BufferRead(u8* pBuffer, u32 ReadAddr, u16 NumByteToRead); - W25QXX.SPI_FLASH_BufferRead(&Pic_cnt,PIC_COUNTER_ADDR,1); - if (Pic_cnt == 0xff) { + W25QXX.SPI_FLASH_BufferRead(&Pic_cnt, PIC_COUNTER_ADDR, 1); + if (Pic_cnt == 0xff) Pic_cnt = 0; - } - for (i=0;i= LOGO_MAX_SIZE_TFT35 ) { - logo_addroffset = 0; + + uint32_t logo_addroffset = 0; + void Pic_Logo_Read(uint8_t *LogoName, uint8_t *Logo_Rbuff, uint32_t LogoReadsize) { + W25QXX.SPI_FLASH_BufferRead(Logo_Rbuff, PIC_LOGO_ADDR + logo_addroffset, LogoReadsize); + logo_addroffset += LogoReadsize; + if (logo_addroffset >= LOGO_MAX_SIZE_TFT35) + logo_addroffset = 0; } -} -uint32_t default_view_addroffset = 0; -void default_view_Read(uint8_t *default_view_Rbuff,uint32_t default_view_Readsize) { - W25QXX.init(SPI_QUARTER_SPEED); + uint32_t default_view_addroffset = 0; + void default_view_Read(uint8_t *default_view_Rbuff, uint32_t default_view_Readsize) { + W25QXX.init(SPI_QUARTER_SPEED); + + W25QXX.SPI_FLASH_BufferRead(default_view_Rbuff, DEFAULT_VIEW_ADDR_TFT35 + default_view_addroffset + 4, default_view_Readsize); + default_view_addroffset += default_view_Readsize; + if (default_view_addroffset >= DEFAULT_VIEW_MAX_SIZE) + default_view_addroffset = 0; - W25QXX.SPI_FLASH_BufferRead(default_view_Rbuff,DEFAULT_VIEW_ADDR_TFT35+default_view_addroffset+4,default_view_Readsize); - default_view_addroffset += default_view_Readsize; - if (default_view_addroffset >= DEFAULT_VIEW_MAX_SIZE) { - default_view_addroffset = 0; } -} + uint32_t flash_view_addroffset = 0; + void flash_view_Read(uint8_t *flash_view_Rbuff, uint32_t flash_view_Readsize) { + W25QXX.init(SPI_QUARTER_SPEED); -uint32_t flash_view_addroffset = 0; -void flash_view_Read(uint8_t *flash_view_Rbuff,uint32_t flash_view_Readsize) { - W25QXX.init(SPI_QUARTER_SPEED); + W25QXX.SPI_FLASH_BufferRead(flash_view_Rbuff, BAK_VIEW_ADDR_TFT35 + flash_view_addroffset, flash_view_Readsize); + flash_view_addroffset += flash_view_Readsize; + if (flash_view_addroffset >= FLASH_VIEW_MAX_SIZE) + flash_view_addroffset = 0; - W25QXX.SPI_FLASH_BufferRead(flash_view_Rbuff,BAK_VIEW_ADDR_TFT35+flash_view_addroffset,flash_view_Readsize); - flash_view_addroffset += flash_view_Readsize; - if (flash_view_addroffset >= FLASH_VIEW_MAX_SIZE) { - flash_view_addroffset = 0; } -} - #endif #endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h index 1bb3221ad3dd..b307cc8dba0f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h @@ -31,88 +31,89 @@ extern "C" { /* C-declarations for C++ */ #if 1 -#define PIC_MAX_CN 100 //Maximum number of pictures -#define PIC_NAME_MAX_LEN 50 //Picture name maximum length - -#define LOGO_MAX_SIZE_TFT35 (300*1024) -#define LOGO_MAX_SIZE_TFT32 (150*1024) -#define TITLELOGO_MAX_SIZE (150*1024) //little logo maximum -#define DEFAULT_VIEW_MAX_SIZE (200*200*2) -#define FLASH_VIEW_MAX_SIZE (200*200*2) - -#define PER_PIC_MAX_SPACE_TFT35 (32*1024) -#define PER_PIC_MAX_SPACE_TFT32 (16*1024) -#define PER_FONT_MAX_SPACE (16*1024) - -//pic -//Robin_pro pic addr -#define PIC_NAME_ADDR 0x003000 //pic information addr -#define PIC_SIZE_ADDR 0x007000 //pic size information addr -#define PIC_COUNTER_ADDR 0x008000 //pic total number -#define PER_PIC_SAVE_ADDR 0x009000 //Storage address of each picture -#define PIC_LOGO_ADDR 0x00A000 //logo addr -//#define PIC_DATA_ADDR 0x02f000 // -//TFT35 -#define DEFAULT_VIEW_ADDR_TFT35 0XC5800 -#define BAK_VIEW_ADDR_TFT35 (DEFAULT_VIEW_ADDR_TFT35+90*1024) -#define PIC_ICON_LOGO_ADDR_TFT35 (BAK_VIEW_ADDR_TFT35+80*1024) -#define PIC_DATA_ADDR_TFT35 (PIC_ICON_LOGO_ADDR_TFT35+350*1024)//0XC5800 -//TFT32 -#define PIC_DATA_ADDR_TFT32 0x02f000 -#define PIC_ICON_LOGO_ADDR_TFT32 0x5d8000 -#define PIC_OTHER_SIZE_ADDR_TFT32 0X5ee000 - -//font -#define FONTINFOADDR 0x600000//6M -- font addr -#define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096)//4*1024 -#define GBK_FLASH_ADDR (UNIGBK_FLASH_ADDR+180224)//176*1024 - -//flash flag -#define FLASH_INF_VALID_FLAG 0xaa558761 -//SD card information first addr -#define VAR_INF_ADDR 0x000000 - -// -union union32 -{ - uint8_t bytes[4]; - uint32_t dwords; -}; -//pic information -struct pic_msg -{ - uint8_t name[PIC_NAME_MAX_LEN]; - union union32 size; -}; - -typedef struct pic_msg PIC_MSG; - -#define BMP_WRITE_BUF_LEN 512 - -#define PICINFOADDR 0 - -#define PIC_SIZE_xM 6 -#define FONT_SIZE_xM 2 - - -//extern void PicMsg_Init(void); -extern void Pic_Read(uint8_t *Pname,uint8_t *P_Rbuff); -//extern void bindBmpFileData(const uint8_t **pBuf, uint8_t *pName); -//extern void Pic_Logo_Read(uint8_t *LogoName,uint8_t *Logo_Rbuff,uint32_t LogoReadsize); -//extern void default_view_Read(uint8_t *default_view_Rbuff,uint32_t default_view_Readsize); -//extern void flash_view_Read(uint8_t *flash_view_Rbuff,uint32_t flash_view_Readsize); - -//extern void lv_Pic_Read(uint8_t *Pname,uint8_t *P_Rbuff,uint32_t addr,uint32_t size); -extern void lv_pic_test(uint8_t *P_Rbuff,uint32_t addr,uint32_t size); + #define PIC_MAX_CN 100 // Maximum number of pictures + #define PIC_NAME_MAX_LEN 50 // Picture name maximum length + + #define LOGO_MAX_SIZE_TFT35 (300*1024) + #define LOGO_MAX_SIZE_TFT32 (150*1024) + #define TITLELOGO_MAX_SIZE (150*1024) // Little logo maximum + #define DEFAULT_VIEW_MAX_SIZE (200*200*2) + #define FLASH_VIEW_MAX_SIZE (200*200*2) + + #define PER_PIC_MAX_SPACE_TFT35 (32*1024) + #define PER_PIC_MAX_SPACE_TFT32 (16*1024) + #define PER_FONT_MAX_SPACE (16*1024) + + //pic + //Robin_pro pic addr + #define PIC_NAME_ADDR 0x003000 // Pic information addr + #define PIC_SIZE_ADDR 0x007000 // Pic size information addr + #define PIC_COUNTER_ADDR 0x008000 // Pic total number + #define PER_PIC_SAVE_ADDR 0x009000 // Storage address of each picture + #define PIC_LOGO_ADDR 0x00A000 // Logo addr + //#define PIC_DATA_ADDR 0x02F000 // + + // TFT35 + #define DEFAULT_VIEW_ADDR_TFT35 0XC5800 + #define BAK_VIEW_ADDR_TFT35 (DEFAULT_VIEW_ADDR_TFT35+90*1024) + #define PIC_ICON_LOGO_ADDR_TFT35 (BAK_VIEW_ADDR_TFT35+80*1024) + #define PIC_DATA_ADDR_TFT35 (PIC_ICON_LOGO_ADDR_TFT35+350*1024)//0XC5800 + + // TFT32 + #define PIC_DATA_ADDR_TFT32 0x02F000 + #define PIC_ICON_LOGO_ADDR_TFT32 0x5D8000 + #define PIC_OTHER_SIZE_ADDR_TFT32 0x5EE000 + + // font + #define FONTINFOADDR 0x600000 // 6M -- font addr + #define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096) // 4*1024 + #define GBK_FLASH_ADDR (UNIGBK_FLASH_ADDR+180224) // 176*1024 + + // Flash flag + #define FLASH_INF_VALID_FLAG 0xAA558761 + // SD card information first addr + #define VAR_INF_ADDR 0x000000 + + union union32 { + uint8_t bytes[4]; + uint32_t dwords; + }; + + // pic information + struct pic_msg { + uint8_t name[PIC_NAME_MAX_LEN]; + union union32 size; + }; + + typedef struct pic_msg PIC_MSG; + + #define BMP_WRITE_BUF_LEN 512 + + #define PICINFOADDR 0 + + #define PIC_SIZE_xM 6 + #define FONT_SIZE_xM 2 + + //extern void PicMsg_Init(void); + extern void Pic_Read(uint8_t *Pname, uint8_t *P_Rbuff); + //extern void bindBmpFileData(const uint8_t **pBuf, uint8_t *pName); + //extern void Pic_Logo_Read(uint8_t *LogoName,uint8_t *Logo_Rbuff,uint32_t LogoReadsize); + //extern void default_view_Read(uint8_t *default_view_Rbuff,uint32_t default_view_Readsize); + //extern void flash_view_Read(uint8_t *flash_view_Rbuff,uint32_t flash_view_Readsize); + + //extern void lv_Pic_Read(uint8_t *Pname,uint8_t *P_Rbuff,uint32_t addr,uint32_t size); + extern void lv_pic_test(uint8_t *P_Rbuff, uint32_t addr, uint32_t size); + #endif + extern uint32_t lv_get_pic_addr(uint8_t *Pname); -extern void get_spi_flash_data(const char *rec_buf,int offset, int size); +extern void get_spi_flash_data(const char *rec_buf, int offset, int size); //extern void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead); extern void spi_flash_read_test(); -extern void default_view_Read(uint8_t *default_view_Rbuff,uint32_t default_view_Readsize); -extern void flash_view_Read(uint8_t *flash_view_Rbuff,uint32_t flash_view_Readsize); +extern void default_view_Read(uint8_t *default_view_Rbuff, uint32_t default_view_Readsize); +extern void flash_view_Read(uint8_t *flash_view_Rbuff, uint32_t flash_view_Readsize); #ifdef __cplusplus } /* C-declarations for C++ */ diff --git a/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.cpp index 7a27365267fe..584a009badfb 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/printer_opration.cpp @@ -23,85 +23,85 @@ #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../../../../MarlinCore.h" - -#include "lv_conf.h" -#include "draw_ui.h" -#include "../../../../module/temperature.h" -#include "../../../../module/motion.h" -#include "../../../../sd/cardreader.h" -#include "../../../../gcode/queue.h" - -#if ENABLED(POWER_LOSS_RECOVERY) - #include "../../../../feature/powerloss.h" -#endif - -#include "../../../../gcode/gcode.h" -#include "../../../../module/planner.h" - -extern uint32_t To_pre_view; -extern uint8_t flash_preview_begin, default_preview_flg, gcode_preview_over; - -void printer_state_polling() { - if (uiCfg.print_state == PAUSING) { - #if ENABLED(SDSUPPORT) - if (!planner.has_blocks_queued() && card.getIndex() > MIN_FILE_PRINTED) //���� �ļ��� M109��M190ָ�� - uiCfg.waitEndMoves++; - - if (uiCfg.waitEndMoves > 20) { - uiCfg.waitEndMoves = 0; - planner.synchronize(); - gcode.process_subcommands_now_P(PSTR("M25")); - gcode.process_subcommands_now_P(PSTR("G91")); - gcode.process_subcommands_now_P(PSTR("G1 Z5")); - gcode.process_subcommands_now_P(PSTR("G90")); + #include "../../../../MarlinCore.h" - uiCfg.print_state = PAUSED; + #include "lv_conf.h" + #include "draw_ui.h" + #include "../../../../module/temperature.h" + #include "../../../../module/motion.h" + #include "../../../../sd/cardreader.h" + #include "../../../../gcode/queue.h" - //#if ENABLED(POWER_LOSS_RECOVERY) - // if (recovery.enabled) recovery.save(true); - //#endif - gCfgItems.pause_reprint = 1; - update_spi_flash(); - } - #endif - } - else { - uiCfg.waitEndMoves = 0; - } + #if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../../feature/powerloss.h" + #endif - if (uiCfg.print_state == PAUSED) { + #include "../../../../gcode/gcode.h" + #include "../../../../module/planner.h" + + extern uint32_t To_pre_view; + extern uint8_t flash_preview_begin, default_preview_flg, gcode_preview_over; + + void printer_state_polling() { + if (uiCfg.print_state == PAUSING) { + #if ENABLED(SDSUPPORT) + if (!planner.has_blocks_queued() && card.getIndex() > MIN_FILE_PRINTED) //���� �ļ��� M109��M190ָ�� + uiCfg.waitEndMoves++; + + if (uiCfg.waitEndMoves > 20) { + uiCfg.waitEndMoves = 0; + planner.synchronize(); + gcode.process_subcommands_now_P(PSTR("M25")); + gcode.process_subcommands_now_P(PSTR("G91")); + gcode.process_subcommands_now_P(PSTR("G1 Z5")); + gcode.process_subcommands_now_P(PSTR("G90")); + + uiCfg.print_state = PAUSED; + + //#if ENABLED(POWER_LOSS_RECOVERY) + // if (recovery.enabled) recovery.save(true); + //#endif + gCfgItems.pause_reprint = 1; + update_spi_flash(); + } + #endif + } + else { + uiCfg.waitEndMoves = 0; + } - } + if (uiCfg.print_state == PAUSED) { - if (uiCfg.print_state == RESUMING) { - if (IS_SD_PAUSED()) { - gcode.process_subcommands_now_P(PSTR("G91")); - gcode.process_subcommands_now_P(PSTR("G1 Z-5")); - gcode.process_subcommands_now_P(PSTR("G90")); - gcode.process_subcommands_now_P(PSTR("M24")); - uiCfg.print_state = WORKING; - start_print_time(); + } - gCfgItems.pause_reprint = 0; - update_spi_flash(); + if (uiCfg.print_state == RESUMING) { + if (IS_SD_PAUSED()) { + gcode.process_subcommands_now_P(PSTR("G91")); + gcode.process_subcommands_now_P(PSTR("G1 Z-5")); + gcode.process_subcommands_now_P(PSTR("G90")); + gcode.process_subcommands_now_P(PSTR("M24")); + uiCfg.print_state = WORKING; + start_print_time(); + + gCfgItems.pause_reprint = 0; + update_spi_flash(); + } } - } - #if ENABLED(POWER_LOSS_RECOVERY) + #if ENABLED(POWER_LOSS_RECOVERY) if (uiCfg.print_state == REPRINTED) { - memset(public_buf_m,0,sizeof(public_buf_m)); + memset(public_buf_m, 0, sizeof(public_buf_m)); #if HOTENDS - HOTEND_LOOP() { - const int16_t et = recovery.info.target_temperature[e]; - if (et) { - #if HOTENDS > 1 - sprintf_P(public_buf_m, PSTR("T%i"), e); - gcode.process_subcommands_now(public_buf_m); - #endif - sprintf_P(public_buf_m, PSTR("M109 S%i"), et); + HOTEND_LOOP() { + const int16_t et = recovery.info.target_temperature[e]; + if (et) { + #if HOTENDS > 1 + sprintf_P(public_buf_m, PSTR("T%i"), e); gcode.process_subcommands_now(public_buf_m); - } + #endif + sprintf_P(public_buf_m, PSTR("M109 S%i"), et); + gcode.process_subcommands_now(public_buf_m); } + } #endif if (gCfgItems.pause_reprint == 1) { @@ -117,105 +117,102 @@ void printer_state_polling() { gCfgItems.pause_reprint = 0; update_spi_flash(); } - #endif - - if (uiCfg.print_state == WORKING) - filament_check(); -} - -void filament_pin_setup() { - #if PIN_EXISTS(MT_DET_1) - pinMode(MT_DET_1_PIN, INPUT_PULLUP); - #endif - #if PIN_EXISTS(MT_DET_2) - pinMode(MT_DET_2_PIN, INPUT_PULLUP); - #endif - #if PIN_EXISTS(MT_DET_3) - pinMode(MT_DET_3_PIN, INPUT_PULLUP); - #endif -} - -void filament_check() { - const int FIL_DELAY = 20; - #if PIN_EXISTS(MT_DET_1) - static int fil_det_count_1 = 0; - if (!READ(MT_DET_1_PIN) && !MT_DET_PIN_INVERTING) - fil_det_count_1++; - else if (READ(MT_DET_1_PIN) && MT_DET_PIN_INVERTING) - fil_det_count_1++; - else if (fil_det_count_1 > 0) - fil_det_count_1--; - - if (!READ(MT_DET_1_PIN) && !MT_DET_PIN_INVERTING) - fil_det_count_1++; - else if (READ(MT_DET_1_PIN) && MT_DET_PIN_INVERTING) - fil_det_count_1++; - else if (fil_det_count_1 > 0) - fil_det_count_1--; - - #endif - - #if PIN_EXISTS(MT_DET_2) - static int fil_det_count_2 = 0; - if (!READ(MT_DET_2_PIN) && !MT_DET_PIN_INVERTING) - fil_det_count_2++; - else if (READ(MT_DET_2_PIN) && MT_DET_PIN_INVERTING) - fil_det_count_2++; - else if (fil_det_count_2 > 0) - fil_det_count_2--; - - if (!READ(MT_DET_2_PIN) && !MT_DET_PIN_INVERTING) - fil_det_count_2++; - else if (READ(MT_DET_2_PIN) && MT_DET_PIN_INVERTING) - fil_det_count_2++; - else if (fil_det_count_2 > 0) - fil_det_count_2--; - - #endif + #endif - #if PIN_EXISTS(MT_DET_3) - static int fil_det_count_3 = 0; - if (!READ(MT_DET_3_PIN) && !MT_DET_PIN_INVERTING) - fil_det_count_3++; - else if (READ(MT_DET_3_PIN) && MT_DET_PIN_INVERTING) - fil_det_count_3++; - else if (fil_det_count_3 > 0) - fil_det_count_3--; - - if (!READ(MT_DET_3_PIN) && !MT_DET_PIN_INVERTING) - fil_det_count_3++; - else if (READ(MT_DET_3_PIN) && MT_DET_PIN_INVERTING) - fil_det_count_3++; - else if (fil_det_count_3 > 0) - fil_det_count_3--; + if (uiCfg.print_state == WORKING) + filament_check(); + } - #endif + void filament_pin_setup() { + #if PIN_EXISTS(MT_DET_1) + pinMode(MT_DET_1_PIN, INPUT_PULLUP); + #endif + #if PIN_EXISTS(MT_DET_2) + pinMode(MT_DET_2_PIN, INPUT_PULLUP); + #endif + #if PIN_EXISTS(MT_DET_3) + pinMode(MT_DET_3_PIN, INPUT_PULLUP); + #endif + } - if ( + void filament_check() { + const int FIL_DELAY = 20; #if PIN_EXISTS(MT_DET_1) - fil_det_count_1 >= FIL_DELAY - #else - false + static int fil_det_count_1 = 0; + if (!READ(MT_DET_1_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (READ(MT_DET_1_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (fil_det_count_1 > 0) + fil_det_count_1--; + + if (!READ(MT_DET_1_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (READ(MT_DET_1_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_1++; + else if (fil_det_count_1 > 0) + fil_det_count_1--; #endif + #if PIN_EXISTS(MT_DET_2) - || fil_det_count_2 >= FIL_DELAY + static int fil_det_count_2 = 0; + if (!READ(MT_DET_2_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (READ(MT_DET_2_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (fil_det_count_2 > 0) + fil_det_count_2--; + + if (!READ(MT_DET_2_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (READ(MT_DET_2_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_2++; + else if (fil_det_count_2 > 0) + fil_det_count_2--; #endif + #if PIN_EXISTS(MT_DET_3) - || fil_det_count_3 >= FIL_DELAY + static int fil_det_count_3 = 0; + if (!READ(MT_DET_3_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (READ(MT_DET_3_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (fil_det_count_3 > 0) + fil_det_count_3--; + + if (!READ(MT_DET_3_PIN) && !MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (READ(MT_DET_3_PIN) && MT_DET_PIN_INVERTING) + fil_det_count_3++; + else if (fil_det_count_3 > 0) + fil_det_count_3--; #endif - ) { - clear_cur_ui(); - card.pauseSDPrint(); - stop_print_time(); - uiCfg.print_state = PAUSING; - - if (gCfgItems.from_flash_pic == 1) - flash_preview_begin = 1; - else - default_preview_flg = 1; - - lv_draw_printing(); + + if ( + #if PIN_EXISTS(MT_DET_1) + fil_det_count_1 >= FIL_DELAY + #else + false + #endif + #if PIN_EXISTS(MT_DET_2) + || fil_det_count_2 >= FIL_DELAY + #endif + #if PIN_EXISTS(MT_DET_3) + || fil_det_count_3 >= FIL_DELAY + #endif + ) { + clear_cur_ui(); + card.pauseSDPrint(); + stop_print_time(); + uiCfg.print_state = PAUSING; + + if (gCfgItems.from_flash_pic == 1) + flash_preview_begin = 1; + else + default_preview_flg = 1; + + lv_draw_printing(); + } } -} #endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h index a552ed421996..038f5f47400e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h @@ -356,16 +356,16 @@ #endif - #define FILAMENT_CHANGE_TEXT_EN "Please click \nor ,After \npinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN "Heat completed,please load filament \nto extruder,and click \nfor start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_EN "Please load filament to extruder,\nand click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN "Heat completed,please \nclick for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_EN "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_EN "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN "Load filament completed,\nclick for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN "Unload filament completed,\nclick for return!" +#define FILAMENT_CHANGE_TEXT_EN "Please click \nor ,After \npinter pause." +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN "Heat completed,please load filament \nto extruder,and click \nfor start loading." +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_EN "Please load filament to extruder,\nand click for start loading." +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN "Heat completed,please \nclick for start unloading.!" +#define FILAMENT_DIALOG_LOADING_TIPS_EN "Is loading ,please wait!" +#define FILAMENT_DIALOG_UNLOADING_TIPS_EN "Is unloading,please wait!" +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN "Load filament completed,\nclick for return!" +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN "Unload filament completed,\nclick for return!" #define PRE_HEAT_EXT_TEXT_EN "E" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h index 08d802d8b27e..c1dd8eb0a4d5 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h @@ -153,16 +153,16 @@ #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Load filament completed,click for return!" #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Unload filament completed,click for return!" #endif - #define FILAMENT_CHANGE_TEXT_FR "Please click \nor ,After \npinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR "Heat completed,please load filament \nto extruder,and click \nfor start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR "Please load filament to extruder,\nand click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR "Heat completed,please \nclick for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_FR "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_FR "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Load filament completed,\nclick for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Unload filament completed,\nclick for return!" +#define FILAMENT_CHANGE_TEXT_FR "Please click \nor ,After \npinter pause." +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR "Heat completed,please load filament \nto extruder,and click \nfor start loading." +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR "Please load filament to extruder,\nand click for start loading." +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR "Heat completed,please \nclick for start unloading.!" +#define FILAMENT_DIALOG_LOADING_TIPS_FR "Is loading ,please wait!" +#define FILAMENT_DIALOG_UNLOADING_TIPS_FR "Is unloading,please wait!" +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Load filament completed,\nclick for return!" +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Unload filament completed,\nclick for return!" #define PRE_HEAT_EXT_TEXT_FR "E" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h index f88732e79893..d43ba086dbcd 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h @@ -22,28 +22,28 @@ #pragma once //****************意大利语***************************// -#define TOOL_TEXT_IT "Strumento" +#define TOOL_TEXT_IT "Strumento" #define PREHEAT_TEXT_IT "Prerisc" -#define MOVE_TEXT_IT "Muovi" +#define MOVE_TEXT_IT "Muovi" #define HOME_TEXT_IT "Home" -#define PRINT_TEXT_IT "Stampa" +#define PRINT_TEXT_IT "Stampa" #define EXTRUDE_TEXT_IT "Estrude" #define LEVELING_TEXT_IT "Leveling" #define AUTO_LEVELING_TEXT_IT "AutoLevel" -#define SET_TEXT_IT "Imposta" +#define SET_TEXT_IT "Imposta" #define MORE_TEXT_IT "Di più" -#define ADD_TEXT_IT "Aumentare" -#define DEC_TEXT_IT "Ridurre" -#define EXTRUDER_1_TEXT_IT "Estrude1" -#define EXTRUDER_2_TEXT_IT "Estrude2" -#define HEATBED_TEXT_IT "Piano" -#define TEXT_1C_IT "1℃" -#define TEXT_5C_IT "5℃" -#define TEXT_10C_IT "10℃" -#define CLOSE_TEXT_IT "Spento" +#define ADD_TEXT_IT "Aumentare" +#define DEC_TEXT_IT "Ridurre" +#define EXTRUDER_1_TEXT_IT "Estrude1" +#define EXTRUDER_2_TEXT_IT "Estrude2" +#define HEATBED_TEXT_IT "Piano" +#define TEXT_1C_IT "1℃" +#define TEXT_5C_IT "5℃" +#define TEXT_10C_IT "10℃" +#define CLOSE_TEXT_IT "Spento" -#define BACK_TEXT_IT "Indietro" +#define BACK_TEXT_IT "Indietro" #define TOOL_PREHEAT_IT "Prerisc" #define TOOL_EXTRUDE_IT "Estrude" @@ -54,97 +54,97 @@ #define TOOL_FILAMENT_IT "Filamento" #define TOOL_MORE_IT "Di più" -#define AXIS_X_ADD_TEXT_IT "X+" -#define AXIS_X_DEC_TEXT_IT "X-" -#define AXIS_Y_ADD_TEXT_IT "Y+" -#define AXIS_Y_DEC_TEXT_IT "Y-" -#define AXIS_Z_ADD_TEXT_IT "Z+" -#define AXIS_Z_DEC_TEXT_IT "Z-" -#define TEXT_01MM_IT "0.1mm" -#define TEXT_1MM_IT "1mm" -#define TEXT_10MM_IT "10mm" +#define AXIS_X_ADD_TEXT_IT "X+" +#define AXIS_X_DEC_TEXT_IT "X-" +#define AXIS_Y_ADD_TEXT_IT "Y+" +#define AXIS_Y_DEC_TEXT_IT "Y-" +#define AXIS_Z_ADD_TEXT_IT "Z+" +#define AXIS_Z_DEC_TEXT_IT "Z-" +#define TEXT_01MM_IT "0.1mm" +#define TEXT_1MM_IT "1mm" +#define TEXT_10MM_IT "10mm" -#define HOME_X_TEXT_IT "X" -#define HOME_Y_TEXT_IT "Y" -#define HOME_Z_TEXT_IT "Z" -#define HOME_ALL_TEXT_IT "All" +#define HOME_X_TEXT_IT "X" +#define HOME_Y_TEXT_IT "Y" +#define HOME_Z_TEXT_IT "Z" +#define HOME_ALL_TEXT_IT "All" #define HOME_STOPMOVE_IT "Quickstop" -#define PAGE_UP_TEXT_IT "Pagina su" -#define PAGE_DOWN_TEXT_IT "Pagina giù" +#define PAGE_UP_TEXT_IT "Pagina su" +#define PAGE_DOWN_TEXT_IT "Pagina giù" -#define EXTRUDER_IN_TEXT_IT "Estru" -#define EXTRUDER_OUT_TEXT_IT "Ritra" -#define EXTRUDE_1MM_TEXT_IT "1mm" -#define EXTRUDE_5MM_TEXT_IT "5mm" -#define EXTRUDE_10MM_TEXT_IT "10mm" -#define EXTRUDE_LOW_SPEED_TEXT_IT "Bassa" -#define EXTRUDE_MEDIUM_SPEED_TEXT_IT "Media" -#define EXTRUDE_HIGH_SPEED_TEXT_IT "Alta" +#define EXTRUDER_IN_TEXT_IT "Estru" +#define EXTRUDER_OUT_TEXT_IT "Ritra" +#define EXTRUDE_1MM_TEXT_IT "1mm" +#define EXTRUDE_5MM_TEXT_IT "5mm" +#define EXTRUDE_10MM_TEXT_IT "10mm" +#define EXTRUDE_LOW_SPEED_TEXT_IT "Bassa" +#define EXTRUDE_MEDIUM_SPEED_TEXT_IT "Media" +#define EXTRUDE_HIGH_SPEED_TEXT_IT "Alta" -#define LEVELING_POINT1_TEXT_IT "Primo" -#define LEVELING_POINT2_TEXT_IT "Secondo" -#define LEVELING_POINT3_TEXT_IT "Terzo" -#define LEVELING_POINT4_TEXT_IT "Quarto" -#define LEVELING_POINT5_TEXT_IT "Quinto" +#define LEVELING_POINT1_TEXT_IT "Primo" +#define LEVELING_POINT2_TEXT_IT "Secondo" +#define LEVELING_POINT3_TEXT_IT "Terzo" +#define LEVELING_POINT4_TEXT_IT "Quarto" +#define LEVELING_POINT5_TEXT_IT "Quinto" -#define FILESYS_TEXT_IT "FileSys" -#define WIFI_TEXT_IT "WIFI" -#define FAN_TEXT_IT "Ventola" -#define ABOUT_TEXT_IT "Circa" -#define BREAK_POINT_TEXT_IT "Continua" -#define FILAMENT_TEXT_IT "Filamento" -#define LANGUAGE_TEXT_IT "Lingua" -#define MOTOR_OFF_TEXT_IT "Motor off" +#define FILESYS_TEXT_IT "FileSys" +#define WIFI_TEXT_IT "WIFI" +#define FAN_TEXT_IT "Ventola" +#define ABOUT_TEXT_IT "Circa" +#define BREAK_POINT_TEXT_IT "Continua" +#define FILAMENT_TEXT_IT "Filamento" +#define LANGUAGE_TEXT_IT "Lingua" +#define MOTOR_OFF_TEXT_IT "Motor off" #define MOTOR_OFF_XY_TEXT_IT "Off-XY" -#define SHUTDOWN_TEXT_IT "Spento" +#define SHUTDOWN_TEXT_IT "Spento" -#define U_DISK_TEXT_IT "USB" -#define SD_CARD_TEXT_IT "SD" -#define WIFI_NAME_TEXT_IT "WIFI: " -#define WIFI_KEY_TEXT_IT "KEY: " -#define WIFI_IP_TEXT_IT "IP: " -#define WIFI_AP_TEXT_IT "Stato: AP" -#define WIFI_STA_TEXT_IT "Stato: STA" -#define WIFI_CONNECTED_TEXT_IT "Connesso" -#define WIFI_DISCONNECTED_TEXT_IT "Disconnesso" -#define WIFI_EXCEPTION_TEXT_IT "Eccezione" +#define U_DISK_TEXT_IT "USB" +#define SD_CARD_TEXT_IT "SD" +#define WIFI_NAME_TEXT_IT "WIFI: " +#define WIFI_KEY_TEXT_IT "KEY: " +#define WIFI_IP_TEXT_IT "IP: " +#define WIFI_AP_TEXT_IT "Stato: AP" +#define WIFI_STA_TEXT_IT "Stato: STA" +#define WIFI_CONNECTED_TEXT_IT "Connesso" +#define WIFI_DISCONNECTED_TEXT_IT "Disconnesso" +#define WIFI_EXCEPTION_TEXT_IT "Eccezione" #define WIFI_RECONNECT_TEXT_IT "Reconnect" -#define CLOUD_TEXT_IT "Cloud" -#define CLOUD_BIND_IT "Legato" -#define CLOUD_UNBIND_IT "Libero" -#define CLOUD_DISCONNECTED_IT "Disconnesso" -#define CLOUD_UNBINDING_IT "Libero" -#define CLOUD_UNBINDED_IT "Sciolto" -#define CLOUD_BINDED_IT "Legato" -#define CLOUD_DISABLE_IT "Disable" +#define CLOUD_TEXT_IT "Cloud" +#define CLOUD_BIND_IT "Legato" +#define CLOUD_UNBIND_IT "Libero" +#define CLOUD_DISCONNECTED_IT "Disconnesso" +#define CLOUD_UNBINDING_IT "Libero" +#define CLOUD_UNBINDED_IT "Sciolto" +#define CLOUD_BINDED_IT "Legato" +#define CLOUD_DISABLE_IT "Disable" -#define FAN_ADD_TEXT_IT "Aumentare" -#define FAN_DEC_TEXT_IT "Ridurre" -#define FAN_OPEN_TEXT_IT "100%" -#define FAN_HALF_TEXT_IT "50%" -#define FAN_CLOSE_TEXT_IT "Spento" -#define FAN_TIPS1_TEXT_IT "Ventola" -#define FAN_TIPS2_TEXT_IT "Ventola\n0" +#define FAN_ADD_TEXT_IT "Aumentare" +#define FAN_DEC_TEXT_IT "Ridurre" +#define FAN_OPEN_TEXT_IT "100%" +#define FAN_HALF_TEXT_IT "50%" +#define FAN_CLOSE_TEXT_IT "Spento" +#define FAN_TIPS1_TEXT_IT "Ventola" +#define FAN_TIPS2_TEXT_IT "Ventola\n0" -#define FILAMENT_IN_TEXT_IT "Inser" -#define FILAMENT_OUT_TEXT_IT "Estra" -#define FILAMENT_EXT0_TEXT_IT "Estrude1" -#define FILAMENT_EXT1_TEXT_IT "Estrude2" -#define FILAMENT_HEAT_TEXT_IT "Preriscaldamento" -#define FILAMENT_STOP_TEXT_IT "Stop" -//#define FILAMENT_CHANGE_TEXT_IT "Filamento" -#define FILAMENT_TIPS2_TEXT_IT "T:" -#define FILAMENT_TIPS3_TEXT_IT "Inserimento del filamento..." -#define FILAMENT_TIPS4_TEXT_IT "Estrazione del filamento..." -#define FILAMENT_TIPS5_TEXT_IT "Temp is too low to go,please heat" -#define FILAMENT_TIPS6_TEXT_IT "Completato" +#define FILAMENT_IN_TEXT_IT "Inser" +#define FILAMENT_OUT_TEXT_IT "Estra" +#define FILAMENT_EXT0_TEXT_IT "Estrude1" +#define FILAMENT_EXT1_TEXT_IT "Estrude2" +#define FILAMENT_HEAT_TEXT_IT "Preriscaldamento" +#define FILAMENT_STOP_TEXT_IT "Stop" +//#define FILAMENT_CHANGE_TEXT_IT "Filamento" +#define FILAMENT_TIPS2_TEXT_IT "T:" +#define FILAMENT_TIPS3_TEXT_IT "Inserimento del filamento..." +#define FILAMENT_TIPS4_TEXT_IT "Estrazione del filamento..." +#define FILAMENT_TIPS5_TEXT_IT "Temp is too low to go,please heat" +#define FILAMENT_TIPS6_TEXT_IT "Completato" #if 0 #define FILAMENT_REPLAYS_IDLE_TEXT_IT "Please click or \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_IT "Please click or ,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." + #define FILAMENT_CHANGE_TEXT_IT "Please click or ,\nAfter pinter pause." + #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." + #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT "Heat completed,please load filament to extruder,and click for start loading." #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_IT "Please load filament to extruder,and click for start loading." #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT "Heat completed,please click for start unloading.!" @@ -153,101 +153,101 @@ #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT "Load filament completed,click for return!" #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT "Unload filament completed,click for return!" #endif - #define FILAMENT_CHANGE_TEXT_IT "Please click \nor ,After \npinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT "Heat completed,please load filament \nto extruder,and click \nfor start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_IT "Please load filament to extruder,\nand click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT "Heat completed,please \nclick for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_IT "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_IT "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT "Load filament completed,\nclick for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT "Unload filament completed,\nclick for return!" +#define FILAMENT_CHANGE_TEXT_IT "Please click \nor ,After \npinter pause." +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT "Heat completed,please load filament \nto extruder,and click \nfor start loading." +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_IT "Please load filament to extruder,\nand click for start loading." +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT "Heat completed,please \nclick for start unloading.!" +#define FILAMENT_DIALOG_LOADING_TIPS_IT "Is loading ,please wait!" +#define FILAMENT_DIALOG_UNLOADING_TIPS_IT "Is unloading,please wait!" +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT "Load filament completed,\nclick for return!" +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT "Unload filament completed,\nclick for return!" -#define PRE_HEAT_EXT_TEXT_IT "E" -#define PRE_HEAT_BED_TEXT_IT "Piano" +#define PRE_HEAT_EXT_TEXT_IT "E" +#define PRE_HEAT_BED_TEXT_IT "Piano" -#define FILE_LOADING_IT "Caricamento......" +#define FILE_LOADING_IT "Caricamento......" #if 0 -#define NO_FILE_AND_CHECK_IT "Nessun file trovato! Inserisci la scheda SD o il disco U!" + #define NO_FILE_AND_CHECK_IT "Nessun file trovato! Inserisci la scheda SD o il disco U!" #endif -#define NO_FILE_AND_CHECK_IT "Nessun file,\n per favore controllare di nuovo!" +#define NO_FILE_AND_CHECK_IT "Nessun file,\n per favore controllare di nuovo!" -#define NO_FILE_IT "Nessun file!" +#define NO_FILE_IT "Nessun file!" -#define EXTRUDER_TEMP_TEXT_IT "Temper" +#define EXTRUDER_TEMP_TEXT_IT "Temper" #define EXTRUDER_E_LENGTH1_TEXT_IT "Estrude1" #define EXTRUDER_E_LENGTH2_TEXT_IT "Estrude2" #define EXTRUDER_E_LENGTH3_TEXT_IT "Estrude3" -#define ABOUT_TYPE_TEXT_IT "Type: " -#define ABOUT_VERSION_TEXT_IT "Firmware: " -#define ABOUT_WIFI_TEXT_IT "WiFi: " +#define ABOUT_TYPE_TEXT_IT "Type: " +#define ABOUT_VERSION_TEXT_IT "Firmware: " +#define ABOUT_WIFI_TEXT_IT "WiFi: " -#define PRINTING_OPERATION_IT "Opzioni" -#define PRINTING_PAUSE_IT "Pause" -#define PRINTING_TEMP_IT "Temp." -#define PRINTING_CHANGESPEED_IT "Velocità" -#define PRINTING_RESUME_IT "Recupero" -#define PRINTING_STOP_IT "Stop" -#define PRINTING_MORE_IT "Di più" -#define PRINTING_EXTRUDER_IT "Estrude" +#define PRINTING_OPERATION_IT "Opzioni" +#define PRINTING_PAUSE_IT "Pause" +#define PRINTING_TEMP_IT "Temp." +#define PRINTING_CHANGESPEED_IT "Velocità" +#define PRINTING_RESUME_IT "Recupero" +#define PRINTING_STOP_IT "Stop" +#define PRINTING_MORE_IT "Di più" +#define PRINTING_EXTRUDER_IT "Estrude" #define PRINTING_MOVE_IT "Muovi" -#define EXTRUDER_SPEED_IT "Estrude" -#define MOVE_SPEED_IT "Muovi" -#define EXTRUDER_SPEED_STATE_IT "Estrusione" -#define MOVE_SPEED_STATE_IT "Movimento" -#define STEP_1PERCENT_IT "1%" -#define STEP_5PERCENT_IT "5%" -#define STEP_10PERCENT_IT "10%" +#define EXTRUDER_SPEED_IT "Estrude" +#define MOVE_SPEED_IT "Muovi" +#define EXTRUDER_SPEED_STATE_IT "Estrusione" +#define MOVE_SPEED_STATE_IT "Movimento" +#define STEP_1PERCENT_IT "1%" +#define STEP_5PERCENT_IT "5%" +#define STEP_10PERCENT_IT "10%" #define ZOFFSET_IT "Z Offset" #define ZOFFSET_INC_IT "Add" #define ZOFFSET_DEC_IT "Dec" -#define TITLE_READYPRINT_IT "Pronto" -#define TITLE_PREHEAT_IT "Preris" -#define TITLE_MOVE_IT "Muovi" -#define TITLE_HOME_IT "Home" -#define TITLE_EXTRUDE_IT "Estrude" -#define TITLE_LEVELING_IT "Livella" -#define TITLE_SET_IT "Impostare" -#define TITLE_MORE_IT "Di più" -#define TITLE_CHOOSEFILE_IT "File" -#define TITLE_PRINTING_IT "Stampa" -#define TITLE_OPERATION_IT "Opzioni" -#define TITLE_ADJUST_IT "Regolare" -#define TITLE_WIRELESS_IT "Wireless" -#define TITLE_FILAMENT_IT "Filamento" -#define TITLE_ABOUT_IT "Circa" -#define TITLE_FAN_IT "Ventola" -#define TITLE_LANGUAGE_IT "Lingua" -#define TITLE_PAUSE_IT "Pausa" -#define TITLE_CHANGESPEED_IT "Velocità" -#define TITLE_CLOUD_TEXT_IT "Cloud" -#define TITLE_DIALOG_CONFIRM_IT "Confirm" -#define TITLE_FILESYS_IT "FileSys" +#define TITLE_READYPRINT_IT "Pronto" +#define TITLE_PREHEAT_IT "Preris" +#define TITLE_MOVE_IT "Muovi" +#define TITLE_HOME_IT "Home" +#define TITLE_EXTRUDE_IT "Estrude" +#define TITLE_LEVELING_IT "Livella" +#define TITLE_SET_IT "Impostare" +#define TITLE_MORE_IT "Di più" +#define TITLE_CHOOSEFILE_IT "File" +#define TITLE_PRINTING_IT "Stampa" +#define TITLE_OPERATION_IT "Opzioni" +#define TITLE_ADJUST_IT "Regolare" +#define TITLE_WIRELESS_IT "Wireless" +#define TITLE_FILAMENT_IT "Filamento" +#define TITLE_ABOUT_IT "Circa" +#define TITLE_FAN_IT "Ventola" +#define TITLE_LANGUAGE_IT "Lingua" +#define TITLE_PAUSE_IT "Pausa" +#define TITLE_CHANGESPEED_IT "Velocità" +#define TITLE_CLOUD_TEXT_IT "Cloud" +#define TITLE_DIALOG_CONFIRM_IT "Confirm" +#define TITLE_FILESYS_IT "FileSys" #define TITLE_ZOFFSET_IT "Z Offset" -#define AUTO_SHUTDOWN_IT "Auto" -#define MANUAL_SHUTDOWN_IT "Manuale" +#define AUTO_SHUTDOWN_IT "Auto" +#define MANUAL_SHUTDOWN_IT "Manuale" -#define DIALOG_CONFIRM_IT "Conferma" -#define DIALOG_CANCLE_IT "Cancella" -#define DIALOG_OK_IT "OK" -#define DIALOG_RESET_IT "Resettare" -#define DIALOG_RETRY_IT "Riprovare" -#define DIALOG_DISABLE_IT "Disable" -#define DIALOG_PRINT_MODEL_IT "Gcode stampa?" -#define DIALOG_CANCEL_PRINT_IT "Stop stampa?" -#define DIALOG_STOP_IT "Stop" -#define DIALOG_REPRINT_FROM_BREAKPOINT_IT "Continua a stampare dal \npunto di interruzione?" -//#define DIALOG_UNBIND_PRINTER_IT "Libero?" -#define DIALOG_ERROR_TIPS1_IT "Errore: nessun file, \nper favore controllare di nuovo." -#define DIALOG_ERROR_TIPS2_IT "Errore: operazione non riuscita, \nsi prega di controllare se il baudrate del \ndisplay è lo stesso scheda madre" -#define DIALOG_ERROR_TIPS3_IT "Errore: il nome del file o il \npercorso è troppo lungo!" +#define DIALOG_CONFIRM_IT "Conferma" +#define DIALOG_CANCLE_IT "Cancella" +#define DIALOG_OK_IT "OK" +#define DIALOG_RESET_IT "Resettare" +#define DIALOG_RETRY_IT "Riprovare" +#define DIALOG_DISABLE_IT "Disable" +#define DIALOG_PRINT_MODEL_IT "Gcode stampa?" +#define DIALOG_CANCEL_PRINT_IT "Stop stampa?" +#define DIALOG_STOP_IT "Stop" +#define DIALOG_REPRINT_FROM_BREAKPOINT_IT "Continua a stampare dal \npunto di interruzione?" +//#define DIALOG_UNBIND_PRINTER_IT "Libero?" +#define DIALOG_ERROR_TIPS1_IT "Errore: nessun file, \nper favore controllare di nuovo." +#define DIALOG_ERROR_TIPS2_IT "Errore: operazione non riuscita, \nsi prega di controllare se il baudrate del \ndisplay è lo stesso scheda madre" +#define DIALOG_ERROR_TIPS3_IT "Errore: il nome del file o il \npercorso è troppo lungo!" #define DIALOG_CLOSE_MACHINE_IT "Closing machine......" #define DIALOG_UNBIND_PRINTER_IT "Unbind the printer?" #define DIALOG_FILAMENT_NO_PRESS_IT "Filament detection switch is not pressed" @@ -256,16 +256,16 @@ #define DIALOG_REPRINT_IT "Print again" #define DIALOG_WIFI_ENABLE_TIPS_IT "The wifi module is being configured,\nplease wait a moment....." -#define MESSEGE_PAUSING_IT "Parcheggiando..." -#define MESSEGE_CHANGING_IT "Attendere avvio del cambio di filamento" -#define MESSEGE_UNLOAD_IT "Attendere l'espulsione del filamento" -#define MESSEGE_WAITING_IT "Premi per riprendere la stampa" -#define MESSEGE_INSERT_IT "Inserisci il filamento e premi per continuare" -#define MESSEGE_LOAD_IT "Attendere il caricamento del filamento" -#define MESSEGE_PURGE_IT "Attendere lo spurgo del filamento" -#define MESSEGE_RESUME_IT "Attendere la ripresa della stampa..." -#define MESSEGE_HEAT_IT "Premi per riscaldare ugello" -#define MESSEGE_HEATING_IT "Riscaldam. ugello Attendere prego..." -#define MESSEGE_OPTION_IT "Eliminare di più o continuare a stampare?" +#define MESSEGE_PAUSING_IT "Parcheggiando..." +#define MESSEGE_CHANGING_IT "Attendere avvio del cambio di filamento" +#define MESSEGE_UNLOAD_IT "Attendere l'espulsione del filamento" +#define MESSEGE_WAITING_IT "Premi per riprendere la stampa" +#define MESSEGE_INSERT_IT "Inserisci il filamento e premi per continuare" +#define MESSEGE_LOAD_IT "Attendere il caricamento del filamento" +#define MESSEGE_PURGE_IT "Attendere lo spurgo del filamento" +#define MESSEGE_RESUME_IT "Attendere la ripresa della stampa..." +#define MESSEGE_HEAT_IT "Premi per riscaldare ugello" +#define MESSEGE_HEATING_IT "Riscaldam. ugello Attendere prego..." +#define MESSEGE_OPTION_IT "Eliminare di più o continuare a stampare?" #define MESSEGE_PURGE_MORE_IT "Epurazione" #define MESSEGE_CONTINUE_PRINT_IT "Stampa" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h index acbac2140bab..e78067d89826 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h @@ -153,16 +153,16 @@ #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,click <да> for return!" #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,click <да> for return!" #endif - #define FILAMENT_CHANGE_TEXT_RU "Please click \nor ,After \npinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU "Heat completed,please load filament \nto extruder,and click \nfor start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_RU "Please load filament to extruder,\nand click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU "Heat completed,please \nclick for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_RU "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_RU "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,\nclick for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,\nclick for return!" +#define FILAMENT_CHANGE_TEXT_RU "Please click \nor ,After \npinter pause." +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU "Heat completed,please load filament \nto extruder,and click \nfor start loading." +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_RU "Please load filament to extruder,\nand click for start loading." +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU "Heat completed,please \nclick for start unloading.!" +#define FILAMENT_DIALOG_LOADING_TIPS_RU "Is loading ,please wait!" +#define FILAMENT_DIALOG_UNLOADING_TIPS_RU "Is unloading,please wait!" +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,\nclick for return!" +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,\nclick for return!" #define PRE_HEAT_EXT_TEXT_RU "E" @@ -170,7 +170,7 @@ #define FILE_LOADING_RU "загрузка......" #if 0 -#define NO_FILE_AND_CHECK_RU "Файлы не найдены! Вставьте SD-карту или диск U!" + #define NO_FILE_AND_CHECK_RU "Файлы не найдены! Вставьте SD-карту или диск U!" #endif #define NO_FILE_AND_CHECK_RU "нет файла,попробуйте ещё раз!" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h index da8167b09880..f83771b838fc 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h @@ -169,7 +169,7 @@ #define FILE_LOADING_SP "Cargando......" #if 0 -#define NO_FILE_AND_CHECK_SP "No se encontraron archivos! Por favor, inserte la tarjeta SD o el disco U!" + #define NO_FILE_AND_CHECK_SP "No se encontraron archivos! Por favor, inserte la tarjeta SD o el disco U!" #endif #define NO_FILE_AND_CHECK_SP "Archivo no encontrado,\n por favor insertar SD o disco USB!" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h index adade8972ef1..e69de29bb2d1 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h @@ -1,269 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -//***************繁体中文**********************// -#define TOOL_TEXT_T_CN "工具" -#define PREHEAT_TEXT_T_CN "預熱" -#define MOVE_TEXT_T_CN "移動" -#define HOME_TEXT_T_CN "回零" -#define PRINT_TEXT_T_CN "打印" -#define EXTRUDE_TEXT_T_CN "擠出" -#define LEVELING_TEXT_T_CN "調平" -#define AUTO_LEVELING_TEXT_T_CN "自動調平" -#define SET_TEXT_T_CN "設置" -#define MORE_TEXT_T_CN "更多" - -#define ADD_TEXT_T_CN "增加" -#define DEC_TEXT_T_CN "減少" -#define EXTRUDER_1_TEXT_T_CN "噴頭1" -#define EXTRUDER_2_TEXT_T_CN "噴頭2" -#define HEATBED_TEXT_T_CN "熱床" -#define TEXT_1C_T_CN "1℃" -#define TEXT_5C_T_CN "5℃" -#define TEXT_10C_T_CN "10℃" -#define CLOSE_TEXT_T_CN "關閉" - -#define BACK_TEXT_T_CN "返回" - -#define TOOL_PREHEAT_T_CN "預熱" -#define TOOL_EXTRUDE_T_CN "擠出" -#define TOOL_MOVE_T_CN "移動" -#define TOOL_HOME_T_CN "回零" -#define TOOL_LEVELING_T_CN "調平" -#define TOOL_AUTO_LEVELING_T_CN "自動調平" -#define TOOL_FILAMENT_T_CN "換料" -#define TOOL_MORE_T_CN "更多" - -#define AXIS_X_ADD_TEXT_T_CN "X+" -#define AXIS_X_DEC_TEXT_T_CN "X-" -#define AXIS_Y_ADD_TEXT_T_CN "Y+" -#define AXIS_Y_DEC_TEXT_T_CN "Y-" -#define AXIS_Z_ADD_TEXT_T_CN "Z+" -#define AXIS_Z_DEC_TEXT_T_CN "Z-" -#define TEXT_01MM_T_CN "0.1mm" -#define TEXT_1MM_T_CN "1mm" -#define TEXT_10MM_T_CN "10mm" - -#define HOME_X_TEXT_T_CN "X" -#define HOME_Y_TEXT_T_CN "Y" -#define HOME_Z_TEXT_T_CN "Z" -#define HOME_ALL_TEXT_T_CN "回零" -#define HOME_STOPMOVE_T_CN "急停" - -#define PAGE_UP_TEXT_T_CN "上一頁" -#define PAGE_DOWN_TEXT_T_CN "下一頁" - -#define EXTRUDER_IN_TEXT_T_CN "進料" -#define EXTRUDER_OUT_TEXT_T_CN "退料" -#define EXTRUDE_1MM_TEXT_T_CN "1mm" -#define EXTRUDE_5MM_TEXT_T_CN "5mm" -#define EXTRUDE_10MM_TEXT_T_CN "10mm" -#define EXTRUDE_LOW_SPEED_TEXT_T_CN "低速" -#define EXTRUDE_MEDIUM_SPEED_TEXT_T_CN "常速" -#define EXTRUDE_HIGH_SPEED_TEXT_T_CN "高速" - -#define LEVELING_POINT1_TEXT_T_CN "第一點" -#define LEVELING_POINT2_TEXT_T_CN "第二點" -#define LEVELING_POINT3_TEXT_T_CN "第三點" -#define LEVELING_POINT4_TEXT_T_CN "第四點" -#define LEVELING_POINT5_TEXT_T_CN "第五點" - -#define FILESYS_TEXT_T_CN "文件系統" -#define WIFI_TEXT_T_CN "WIFI" -#define FAN_TEXT_T_CN "風扇" -#define ABOUT_TEXT_T_CN "關於" -#define BREAK_POINT_TEXT_T_CN "斷點續打" -#define FILAMENT_TEXT_T_CN "換料" -#define LANGUAGE_TEXT_T_CN "語言" -#define MOTOR_OFF_TEXT_T_CN "關閉電機" -#define MOTOR_OFF_XY_TEXT_T_CN "關閉XY" -#define SHUTDOWN_TEXT_T_CN "關機" - -#define U_DISK_TEXT_T_CN "U盤" -#define SD_CARD_TEXT_T_CN "SD卡" -#define WIFI_NAME_TEXT_T_CN "無線網絡:" -#define WIFI_KEY_TEXT_T_CN "密碼: " -#define WIFI_IP_TEXT_T_CN "IP: " -#define WIFI_AP_TEXT_T_CN "狀態: AP" -#define WIFI_STA_TEXT_T_CN "狀態: STA" -#define WIFI_CONNECTED_TEXT_T_CN "已連接" -#define WIFI_DISCONNECTED_TEXT_T_CN "未連接" -#define WIFI_EXCEPTION_TEXT_T_CN "模塊異常" -#define CLOUD_TEXT_T_CN "雲服務" -#define CLOUD_BIND_T_CN "已綁定" -#define CLOUD_UNBIND_T_CN "解綁" -#define CLOUD_UNBINDING_T_CN "解绑中" -#define CLOUD_DISCONNECTED_T_CN "未連接" -#define CLOUD_UNBINDED_T_CN "未綁定" -#define CLOUD_BINDED_T_CN "已綁定" -#define CLOUD_DISABLE_T_CN "已禁用" - -#define FAN_ADD_TEXT_T_CN "增加" -#define FAN_DEC_TEXT_T_CN "減少" -#define FAN_OPEN_TEXT_T_CN "100%" -#define FAN_HALF_TEXT_T_CN "50%" -#define FAN_CLOSE_TEXT_T_CN "關閉" -#define FAN_TIPS1_TEXT_T_CN "風扇" -#define FAN_TIPS2_TEXT_T_CN "FAN\nClose" - -#define FILAMENT_IN_TEXT_T_CN "進料" -#define FILAMENT_OUT_TEXT_T_CN "退料" -#define FILAMENT_EXT0_TEXT_T_CN "噴頭1" -#define FILAMENT_EXT1_TEXT_T_CN "噴頭2" -#define FILAMENT_HEAT_TEXT_T_CN "預熱" -#define FILAMENT_STOP_TEXT_T_CN "停止" -//#define FILAMENT_CHANGE_TEXT_T_CN "準備換料" -#define FILAMENT_TIPS2_TEXT_T_CN "T:" -#define FILAMENT_TIPS3_TEXT_T_CN "正在進料" -#define FILAMENT_TIPS4_TEXT_T_CN "正在退料" -#define FILAMENT_TIPS5_TEXT_T_CN "溫度太低,請先預熱" -#define FILAMENT_TIPS6_TEXT_T_CN "換料完成" - -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_T_CN "請按<進料>或<退料>進行換料!" - #define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,請按<進料>或<退料>進行換料!" - -#endif - - - #define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,\n請按<進料>或<退料>" - - - -#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_T_CN "準備進料,正在加熱,請稍等" -#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_T_CN "準備退料,正在加熱,請稍等" -#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_T_CN "加熱完成,請裝載耗材后,按<確定>開始進料" -#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_T_CN "請裝載耗,按<確定>開始進料!" -#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_T_CN "加熱完成,请按<確定>開始退料!" -#define FILAMENT_DIALOG_LOADING_TIPS_T_CN "正在進料,请等待耗材加載完成!" -#define FILAMENT_DIALOG_UNLOADING_TIPS_T_CN "正在退料,请等待耗材卸載完成!" -#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_T_CN "進料完成,请按<確定>返回" -#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_T_CN "退料完成,请按<確定>返回" - -#define PRE_HEAT_EXT_TEXT_T_CN "噴頭" -#define PRE_HEAT_BED_TEXT_T_CN "熱床" - -#define FILE_LOADING_T_CN "正在載入......" -#define NO_FILE_AND_CHECK_T_CN "無文件!請插入sd卡/u盤!" -#define NO_FILE_T_CN "無文件!" - -#define EXTRUDER_TEMP_TEXT_T_CN "溫度" -#define EXTRUDER_E_LENGTH1_TEXT_T_CN "噴頭" -#define EXTRUDER_E_LENGTH2_TEXT_T_CN "噴頭" -#define EXTRUDER_E_LENGTH3_TEXT_T_CN "噴頭" - -#define ABOUT_TYPE_TEXT_T_CN "Type: " -#define ABOUT_VERSION_TEXT_T_CN "Firmware: " -#define ABOUT_WIFI_TEXT_T_CN "Wifi: " - -#define PRINTING_OPERATION_T_CN "操作" -#define PRINTING_PAUSE_T_CN "暫停" -#define PRINTING_TEMP_T_CN "溫度" -#define PRINTING_CHANGESPEED_T_CN "變速" -#define PRINTING_RESUME_T_CN "恢復" -#define PRINTING_STOP_T_CN "停止" -#define PRINTING_MORE_T_CN "更多" -#define PRINTING_EXTRUDER_T_CN "擠出" -#define PRINTING_MOVE_T_CN "移動" - -#define EXTRUDER_SPEED_T_CN "擠出" -#define MOVE_SPEED_T_CN "移動" -#define EXTRUDER_SPEED_STATE_T_CN "擠出速度" -#define MOVE_SPEED_STATE_T_CN "移動速度" -#define STEP_1PERCENT_T_CN "1%%" -#define STEP_5PERCENT_T_CN "5%%" -#define STEP_10PERCENT_T_CN "10%%" - -#define ZOFFSET_T_CN "Z Offset" -#define ZOFFSET_INC_T_CN "增加" -#define ZOFFSET_DEC_T_CN "減少" - -#define TITLE_READYPRINT_T_CN "準備打印" -#define TITLE_PREHEAT_T_CN "預熱" -#define TITLE_MOVE_T_CN "移動" -#define TITLE_HOME_T_CN "回零" -#define TITLE_EXTRUDE_T_CN "擠出" -#define TITLE_LEVELING_T_CN "調平" -#define TITLE_SET_T_CN "設置" -#define TITLE_MORE_T_CN "更多" -#define TITLE_CHOOSEFILE_T_CN "選擇文件" -#define TITLE_PRINTING_T_CN "正在打印" -#define TITLE_OPERATION_T_CN "操作" -#define TITLE_ADJUST_T_CN "調整" -#define TITLE_WIRELESS_T_CN "無線網絡" -#define TITLE_FILAMENT_T_CN "換料" -#define TITLE_ABOUT_T_CN "關於" -#define TITLE_FAN_T_CN "風扇" -#define TITLE_LANGUAGE_T_CN "語言" -#define TITLE_PAUSE_T_CN "暫停" -#define TITLE_CHANGESPEED_T_CN "變速" -#define TITLE_CLOUD_TEXT_T_CN "雲服務" -#define TITLE_DIALOG_CONFIRM_T_CN "確認" -#define TITLE_FILESYS_T_CN "文件系統" -#define TITLE_ZOFFSET_T_CN "Z Offset" - -#define AUTO_SHUTDOWN_T_CN "自動關機" -#define MANUAL_SHUTDOWN_T_CN "手動關機" - -#define DIALOG_CONFIRM_T_CN "確定" -#define DIALOG_CANCLE_T_CN "取消" -#define DIALOG_OK_T_CN "確認" -#define DIALOG_RESET_T_CN "重設" -#define DIALOG_RETRY_T_CN "重試" -#define DIALOG_DISABLE_T_CN "禁用" -#define DIALOG_PRINT_MODEL_T_CN "打印模型?" -#define DIALOG_CANCEL_PRINT_T_CN "停止打印?" -#define DIALOG_RETRY_T_CN "重試" -#define DIALOG_STOP_T_CN "停止" -#define DIALOG_REPRINT_FROM_BREAKPOINT_T_CN "從斷點續打?" -//#define DIALOG_UNBIND_PRINTER_T_CN "解除綁定?" -#define DIALOG_ERROR_TIPS1_T_CN "錯誤:找不到文件,請插入sd卡/u盤!" -#define DIALOG_ERROR_TIPS2_T_CN "錯誤:通信失敗,請檢查波特率或主板硬件!" -#define DIALOG_ERROR_TIPS3_T_CN "錯誤:文件名或文件路徑太長!" -#define DIALOG_CLOSE_MACHINE_T_CN "正在關機......" -#define DIALOG_UNBIND_PRINTER_T_CN "解除綁定?" -#define DIALOG_FILAMENT_NO_PRESS_T_CN "請先裝載耗材!" -#define DIALOG_PRINT_FINISH_T_CN "打印完成!" -#define DIALOG_PRINT_TIME_T_CN "打印時間: " -#define DIALOG_REPRINT_T_CN "再打印壹次" -#define DIALOG_WIFI_ENABLE_TIPS_T_CN "wifi模塊正在配置中,請稍等......" - -#define TEXT_VALUE_T_CN "%d℃/%d℃" -#define EXTRUDE_TEXT_VALUE_T_T_CN ": %d℃" -#define WIFI_RECONNECT_TEXT_T_CN "重新連接" - -#define MESSEGE_PAUSING_T_CN "暫停中..." -#define MESSEGE_CHANGING_T_CN "等待換料開始..." -#define MESSEGE_UNLOAD_T_CN "退料中,請稍等..." -#define MESSEGE_WAITING_T_CN "點擊按鈕恢復打印" -#define MESSEGE_INSERT_T_CN "裝載耗材後,點擊按鈕開始打印" -#define MESSEGE_LOAD_T_CN "進料中,請稍等..." -#define MESSEGE_PURGE_T_CN "等待擠出..." -#define MESSEGE_RESUME_T_CN "等待恢復打印..." -#define MESSEGE_HEAT_T_CN "按下按鈕,加熱噴頭" -#define MESSEGE_HEATING_T_CN "噴頭加熱中,請等待..." -#define MESSEGE_OPTION_T_CN "擠出更多還是繼續打印" -#define MESSEGE_PURGE_MORE_T_CN "擠出" -#define MESSEGE_CONTINUE_PRINT_T_CN "打印" - -#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp index 495b8da8e43e..25fd7082d9c5 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp @@ -24,252 +24,250 @@ #if ENABLED(TFT_LITTLE_VGL_UI) -#if defined(ARDUINO_ARCH_STM32F1) && PIN_EXISTS(FSMC_CS) // FSMC on 100/144 pins SoCs + #if defined(ARDUINO_ARCH_STM32F1) && PIN_EXISTS(FSMC_CS) // FSMC on 100/144 pins SoCs -#include -#include -#include -#include + #include + #include + #include + #include /* Timing configuration */ -#define FSMC_ADDRESS_SETUP_TIME 15 // AddressSetupTime -#define FSMC_DATA_SETUP_TIME 15 // DataSetupTime - -void LCD_IO_Init(uint8_t cs, uint8_t rs); -void LCD_IO_WriteData(uint16_t RegValue); -void LCD_IO_WriteReg(uint16_t Reg); -uint16_t LCD_IO_ReadData(uint16_t RegValue); -uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize); -uint16_t ILI9488_ReadRAM(); -#ifdef LCD_USE_DMA_FSMC - void LCD_IO_WriteMultiple(uint16_t data, uint32_t count); - void LCD_IO_WriteSequence(uint16_t *data, uint16_t length); -#endif + #define FSMC_ADDRESS_SETUP_TIME 15// AddressSetupTime + #define FSMC_DATA_SETUP_TIME 15// DataSetupTime + + void LCD_IO_Init(uint8_t cs, uint8_t rs); + void LCD_IO_WriteData(uint16_t RegValue); + void LCD_IO_WriteReg(uint16_t Reg); + uint16_t LCD_IO_ReadData(uint16_t RegValue); + uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize); + uint16_t ILI9488_ReadRAM(); + #ifdef LCD_USE_DMA_FSMC + void LCD_IO_WriteMultiple(uint16_t data, uint32_t count); + void LCD_IO_WriteSequence(uint16_t *data, uint16_t length); + #endif /** * FSMC LCD IO */ -#define __ASM __asm -#define __STATIC_INLINE static inline - -__attribute__((always_inline)) __STATIC_INLINE void __DSB() { - __ASM volatile ("dsb 0xF":::"memory"); -} - -#define FSMC_CS_NE1 PD7 - -#if ENABLED(STM32_XL_DENSITY) - #define FSMC_CS_NE2 PG9 - #define FSMC_CS_NE3 PG10 - #define FSMC_CS_NE4 PG12 - - #define FSMC_RS_A0 PF0 - #define FSMC_RS_A1 PF1 - #define FSMC_RS_A2 PF2 - #define FSMC_RS_A3 PF3 - #define FSMC_RS_A4 PF4 - #define FSMC_RS_A5 PF5 - #define FSMC_RS_A6 PF12 - #define FSMC_RS_A7 PF13 - #define FSMC_RS_A8 PF14 - #define FSMC_RS_A9 PF15 - #define FSMC_RS_A10 PG0 - #define FSMC_RS_A11 PG1 - #define FSMC_RS_A12 PG2 - #define FSMC_RS_A13 PG3 - #define FSMC_RS_A14 PG4 - #define FSMC_RS_A15 PG5 -#endif - -#define FSMC_RS_A16 PD11 -#define FSMC_RS_A17 PD12 -#define FSMC_RS_A18 PD13 -#define FSMC_RS_A19 PE3 -#define FSMC_RS_A20 PE4 -#define FSMC_RS_A21 PE5 -#define FSMC_RS_A22 PE6 -#define FSMC_RS_A23 PE2 - -#if ENABLED(STM32_XL_DENSITY) - #define FSMC_RS_A24 PG13 - #define FSMC_RS_A25 PG14 -#endif - -static uint8_t fsmcInit = 0; - -typedef struct { - __IO uint16_t REG; - __IO uint16_t RAM; -} LCD_CONTROLLER_TypeDef; - -LCD_CONTROLLER_TypeDef *LCD; - -void LCD_IO_Init(uint8_t cs, uint8_t rs) { - uint32_t controllerAddress; - - if (fsmcInit) return; - fsmcInit = 1; - - switch (cs) { - case FSMC_CS_NE1: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION1; break; - #if ENABLED(STM32_XL_DENSITY) - case FSMC_CS_NE2: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION2; break; - case FSMC_CS_NE3: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION3; break; - case FSMC_CS_NE4: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION4; break; - #endif - default: return; - } + #define __ASM __asm + #define __STATIC_INLINE static inline + + __attribute__((always_inline)) __STATIC_INLINE void __DSB() {__ASM volatile ("dsb 0xF" ::: "memory");} - #define _ORADDR(N) controllerAddress |= (_BV32(N) - 2) + #define FSMC_CS_NE1 PD7 - switch (rs) { #if ENABLED(STM32_XL_DENSITY) - case FSMC_RS_A0: _ORADDR( 1); break; - case FSMC_RS_A1: _ORADDR( 2); break; - case FSMC_RS_A2: _ORADDR( 3); break; - case FSMC_RS_A3: _ORADDR( 4); break; - case FSMC_RS_A4: _ORADDR( 5); break; - case FSMC_RS_A5: _ORADDR( 6); break; - case FSMC_RS_A6: _ORADDR( 7); break; - case FSMC_RS_A7: _ORADDR( 8); break; - case FSMC_RS_A8: _ORADDR( 9); break; - case FSMC_RS_A9: _ORADDR(10); break; - case FSMC_RS_A10: _ORADDR(11); break; - case FSMC_RS_A11: _ORADDR(12); break; - case FSMC_RS_A12: _ORADDR(13); break; - case FSMC_RS_A13: _ORADDR(14); break; - case FSMC_RS_A14: _ORADDR(15); break; - case FSMC_RS_A15: _ORADDR(16); break; + #define FSMC_CS_NE2 PG9 + #define FSMC_CS_NE3 PG10 + #define FSMC_CS_NE4 PG12 + + #define FSMC_RS_A0 PF0 + #define FSMC_RS_A1 PF1 + #define FSMC_RS_A2 PF2 + #define FSMC_RS_A3 PF3 + #define FSMC_RS_A4 PF4 + #define FSMC_RS_A5 PF5 + #define FSMC_RS_A6 PF12 + #define FSMC_RS_A7 PF13 + #define FSMC_RS_A8 PF14 + #define FSMC_RS_A9 PF15 + #define FSMC_RS_A10 PG0 + #define FSMC_RS_A11 PG1 + #define FSMC_RS_A12 PG2 + #define FSMC_RS_A13 PG3 + #define FSMC_RS_A14 PG4 + #define FSMC_RS_A15 PG5 #endif - case FSMC_RS_A16: _ORADDR(17); break; - case FSMC_RS_A17: _ORADDR(18); break; - case FSMC_RS_A18: _ORADDR(19); break; - case FSMC_RS_A19: _ORADDR(20); break; - case FSMC_RS_A20: _ORADDR(21); break; - case FSMC_RS_A21: _ORADDR(22); break; - case FSMC_RS_A22: _ORADDR(23); break; - case FSMC_RS_A23: _ORADDR(24); break; + + #define FSMC_RS_A16 PD11 + #define FSMC_RS_A17 PD12 + #define FSMC_RS_A18 PD13 + #define FSMC_RS_A19 PE3 + #define FSMC_RS_A20 PE4 + #define FSMC_RS_A21 PE5 + #define FSMC_RS_A22 PE6 + #define FSMC_RS_A23 PE2 + #if ENABLED(STM32_XL_DENSITY) - case FSMC_RS_A24: _ORADDR(25); break; - case FSMC_RS_A25: _ORADDR(26); break; + #define FSMC_RS_A24 PG13 + #define FSMC_RS_A25 PG14 #endif - default: return; - } - - rcc_clk_enable(RCC_FSMC); - - gpio_set_mode(GPIOD, 14, GPIO_AF_OUTPUT_PP); // FSMC_D00 - gpio_set_mode(GPIOD, 15, GPIO_AF_OUTPUT_PP); // FSMC_D01 - gpio_set_mode(GPIOD, 0, GPIO_AF_OUTPUT_PP); // FSMC_D02 - gpio_set_mode(GPIOD, 1, GPIO_AF_OUTPUT_PP); // FSMC_D03 - gpio_set_mode(GPIOE, 7, GPIO_AF_OUTPUT_PP); // FSMC_D04 - gpio_set_mode(GPIOE, 8, GPIO_AF_OUTPUT_PP); // FSMC_D05 - gpio_set_mode(GPIOE, 9, GPIO_AF_OUTPUT_PP); // FSMC_D06 - gpio_set_mode(GPIOE, 10, GPIO_AF_OUTPUT_PP); // FSMC_D07 - gpio_set_mode(GPIOE, 11, GPIO_AF_OUTPUT_PP); // FSMC_D08 - gpio_set_mode(GPIOE, 12, GPIO_AF_OUTPUT_PP); // FSMC_D09 - gpio_set_mode(GPIOE, 13, GPIO_AF_OUTPUT_PP); // FSMC_D10 - gpio_set_mode(GPIOE, 14, GPIO_AF_OUTPUT_PP); // FSMC_D11 - gpio_set_mode(GPIOE, 15, GPIO_AF_OUTPUT_PP); // FSMC_D12 - gpio_set_mode(GPIOD, 8, GPIO_AF_OUTPUT_PP); // FSMC_D13 - gpio_set_mode(GPIOD, 9, GPIO_AF_OUTPUT_PP); // FSMC_D14 - gpio_set_mode(GPIOD, 10, GPIO_AF_OUTPUT_PP); // FSMC_D15 - - gpio_set_mode(GPIOD, 4, GPIO_AF_OUTPUT_PP); // FSMC_NOE - gpio_set_mode(GPIOD, 5, GPIO_AF_OUTPUT_PP); // FSMC_NWE - - gpio_set_mode(PIN_MAP[cs].gpio_device, PIN_MAP[cs].gpio_bit, GPIO_AF_OUTPUT_PP); //FSMC_CS_NEx - gpio_set_mode(PIN_MAP[rs].gpio_device, PIN_MAP[rs].gpio_bit, GPIO_AF_OUTPUT_PP); //FSMC_RS_Ax - - #if ENABLED(STM32_XL_DENSITY) - FSMC_NOR_PSRAM4_BASE->BCR = FSMC_BCR_WREN | FSMC_BCR_MTYP_SRAM | FSMC_BCR_MWID_16BITS | FSMC_BCR_MBKEN; - FSMC_NOR_PSRAM4_BASE->BTR = (FSMC_DATA_SETUP_TIME << 8) | FSMC_ADDRESS_SETUP_TIME; - #else // PSRAM1 for STM32F103V (high density) - FSMC_NOR_PSRAM1_BASE->BCR = FSMC_BCR_WREN | FSMC_BCR_MTYP_SRAM | FSMC_BCR_MWID_16BITS | FSMC_BCR_MBKEN; - FSMC_NOR_PSRAM1_BASE->BTR = (FSMC_DATA_SETUP_TIME << 8) | FSMC_ADDRESS_SETUP_TIME; - #endif - - afio_remap(AFIO_REMAP_FSMC_NADV); - - LCD = (LCD_CONTROLLER_TypeDef*)controllerAddress; -} - -void LCD_IO_WriteData(uint16_t RegValue) { - LCD->RAM = RegValue; - __DSB(); -} - -void LCD_IO_WriteReg(uint16_t Reg) { - LCD->REG = Reg; - __DSB(); -} - -uint16_t LCD_IO_ReadData(uint16_t RegValue) { - LCD->REG = RegValue; - __DSB(); - - return LCD->RAM; -} - -uint16_t ILI9488_ReadRAM() { - uint16_t data; - data = LCD->RAM; - return data; -} - -uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize) { - volatile uint32_t data; - LCD->REG = RegValue; - __DSB(); - - data = LCD->RAM; // dummy read - data = LCD->RAM & 0x00FF; - - while (--ReadSize) { - data <<= 8; - data |= (LCD->RAM & 0x00FF); - } - return uint32_t(data); -} - -#if ENABLED(LCD_USE_DMA_FSMC) - -void LCD_IO_WriteMultiple(uint16_t color, uint32_t count) { - while (count > 0) { - dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, &color, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM); - dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, count > 65535 ? 65535 : count); - dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); - dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); - - while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {}; - dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); - - count = count > 65535 ? count - 65535 : 0; - } -} - -void LCD_IO_WriteSequence(uint16_t *data, uint16_t length) { - dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, data, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM | DMA_PINC_MODE); - dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, length); - dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); - dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); - - while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {}; - dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); -} - -void LCD_IO_WriteSequence_Async(uint16_t *data, uint16_t length) { - dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, data, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM | DMA_PINC_MODE); - dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, length); - dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); - dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); -} - -void LCD_IO_WaitSequence_Async() { - while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {}; - dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); -} - -#endif // LCD_USE_DMA_FSMC -#endif // ARDUINO_ARCH_STM32F1 && FSMC_CS_PIN + + static uint8_t fsmcInit = 0; + + typedef struct { + __IO uint16_t REG; + __IO uint16_t RAM; + } LCD_CONTROLLER_TypeDef; + + LCD_CONTROLLER_TypeDef *LCD; + + void LCD_IO_Init(uint8_t cs, uint8_t rs) { + uint32_t controllerAddress; + + if (fsmcInit) return; + fsmcInit = 1; + + switch (cs) { + case FSMC_CS_NE1: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION1; break; + #if ENABLED(STM32_XL_DENSITY) + case FSMC_CS_NE2: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION2; break; + case FSMC_CS_NE3: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION3; break; + case FSMC_CS_NE4: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION4; break; + #endif + default: return; + } + + #define _ORADDR(N) controllerAddress |= (_BV32(N) - 2) + + switch (rs) { + #if ENABLED(STM32_XL_DENSITY) + case FSMC_RS_A0: _ORADDR( 1); break; + case FSMC_RS_A1: _ORADDR( 2); break; + case FSMC_RS_A2: _ORADDR( 3); break; + case FSMC_RS_A3: _ORADDR( 4); break; + case FSMC_RS_A4: _ORADDR( 5); break; + case FSMC_RS_A5: _ORADDR( 6); break; + case FSMC_RS_A6: _ORADDR( 7); break; + case FSMC_RS_A7: _ORADDR( 8); break; + case FSMC_RS_A8: _ORADDR( 9); break; + case FSMC_RS_A9: _ORADDR(10); break; + case FSMC_RS_A10: _ORADDR(11); break; + case FSMC_RS_A11: _ORADDR(12); break; + case FSMC_RS_A12: _ORADDR(13); break; + case FSMC_RS_A13: _ORADDR(14); break; + case FSMC_RS_A14: _ORADDR(15); break; + case FSMC_RS_A15: _ORADDR(16); break; + #endif + case FSMC_RS_A16: _ORADDR(17); break; + case FSMC_RS_A17: _ORADDR(18); break; + case FSMC_RS_A18: _ORADDR(19); break; + case FSMC_RS_A19: _ORADDR(20); break; + case FSMC_RS_A20: _ORADDR(21); break; + case FSMC_RS_A21: _ORADDR(22); break; + case FSMC_RS_A22: _ORADDR(23); break; + case FSMC_RS_A23: _ORADDR(24); break; + #if ENABLED(STM32_XL_DENSITY) + case FSMC_RS_A24: _ORADDR(25); break; + case FSMC_RS_A25: _ORADDR(26); break; + #endif + default: return; + } + + rcc_clk_enable(RCC_FSMC); + + gpio_set_mode(GPIOD, 14, GPIO_AF_OUTPUT_PP); // FSMC_D00 + gpio_set_mode(GPIOD, 15, GPIO_AF_OUTPUT_PP); // FSMC_D01 + gpio_set_mode(GPIOD, 0, GPIO_AF_OUTPUT_PP);// FSMC_D02 + gpio_set_mode(GPIOD, 1, GPIO_AF_OUTPUT_PP);// FSMC_D03 + gpio_set_mode(GPIOE, 7, GPIO_AF_OUTPUT_PP);// FSMC_D04 + gpio_set_mode(GPIOE, 8, GPIO_AF_OUTPUT_PP);// FSMC_D05 + gpio_set_mode(GPIOE, 9, GPIO_AF_OUTPUT_PP);// FSMC_D06 + gpio_set_mode(GPIOE, 10, GPIO_AF_OUTPUT_PP); // FSMC_D07 + gpio_set_mode(GPIOE, 11, GPIO_AF_OUTPUT_PP); // FSMC_D08 + gpio_set_mode(GPIOE, 12, GPIO_AF_OUTPUT_PP); // FSMC_D09 + gpio_set_mode(GPIOE, 13, GPIO_AF_OUTPUT_PP); // FSMC_D10 + gpio_set_mode(GPIOE, 14, GPIO_AF_OUTPUT_PP); // FSMC_D11 + gpio_set_mode(GPIOE, 15, GPIO_AF_OUTPUT_PP); // FSMC_D12 + gpio_set_mode(GPIOD, 8, GPIO_AF_OUTPUT_PP);// FSMC_D13 + gpio_set_mode(GPIOD, 9, GPIO_AF_OUTPUT_PP);// FSMC_D14 + gpio_set_mode(GPIOD, 10, GPIO_AF_OUTPUT_PP); // FSMC_D15 + + gpio_set_mode(GPIOD, 4, GPIO_AF_OUTPUT_PP);// FSMC_NOE + gpio_set_mode(GPIOD, 5, GPIO_AF_OUTPUT_PP);// FSMC_NWE + + gpio_set_mode(PIN_MAP[cs].gpio_device, PIN_MAP[cs].gpio_bit, GPIO_AF_OUTPUT_PP); //FSMC_CS_NEx + gpio_set_mode(PIN_MAP[rs].gpio_device, PIN_MAP[rs].gpio_bit, GPIO_AF_OUTPUT_PP); //FSMC_RS_Ax + + #if ENABLED(STM32_XL_DENSITY) + FSMC_NOR_PSRAM4_BASE->BCR = FSMC_BCR_WREN | FSMC_BCR_MTYP_SRAM | FSMC_BCR_MWID_16BITS | FSMC_BCR_MBKEN; + FSMC_NOR_PSRAM4_BASE->BTR = (FSMC_DATA_SETUP_TIME << 8) | FSMC_ADDRESS_SETUP_TIME; + #else // PSRAM1 for STM32F103V (high density) + FSMC_NOR_PSRAM1_BASE->BCR = FSMC_BCR_WREN | FSMC_BCR_MTYP_SRAM | FSMC_BCR_MWID_16BITS | FSMC_BCR_MBKEN; + FSMC_NOR_PSRAM1_BASE->BTR = (FSMC_DATA_SETUP_TIME << 8) | FSMC_ADDRESS_SETUP_TIME; + #endif + + afio_remap(AFIO_REMAP_FSMC_NADV); + + LCD = (LCD_CONTROLLER_TypeDef*)controllerAddress; + } + + void LCD_IO_WriteData(uint16_t RegValue) { + LCD->RAM = RegValue; + __DSB(); + } + + void LCD_IO_WriteReg(uint16_t Reg) { + LCD->REG = Reg; + __DSB(); + } + + uint16_t LCD_IO_ReadData(uint16_t RegValue) { + LCD->REG = RegValue; + __DSB(); + + return LCD->RAM; + } + + uint16_t ILI9488_ReadRAM() { + uint16_t data; + data = LCD->RAM; + return data; + } + + uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize) { + volatile uint32_t data; + LCD->REG = RegValue; + __DSB(); + + data = LCD->RAM; // dummy read + data = LCD->RAM & 0x00FF; + + while (--ReadSize) { + data <<= 8; + data |= (LCD->RAM & 0x00FF); + } + return uint32_t(data); + } + + #if ENABLED(LCD_USE_DMA_FSMC) + + void LCD_IO_WriteMultiple(uint16_t color, uint32_t count) { + while (count > 0) { + dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, &color, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM); + dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, count > 65535 ? 65535 : count); + dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + + while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {} + dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + + count = count > 65535 ? count - 65535 : 0; + } + } + + void LCD_IO_WriteSequence(uint16_t *data, uint16_t length) { + dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, data, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM | DMA_PINC_MODE); + dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, length); + dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + + while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {} + dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + } + + void LCD_IO_WriteSequence_Async(uint16_t *data, uint16_t length) { + dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, data, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM | DMA_PINC_MODE); + dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, length); + dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + } + + void LCD_IO_WaitSequence_Async() { + while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {} + dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + } + + #endif // LCD_USE_DMA_FSMC + #endif // ARDUINO_ARCH_STM32F1 && FSMC_CS_PIN #endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index a4ebbdf5f6e1..a34b1ff4709b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -29,138 +29,138 @@ #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../../../../MarlinCore.h" + #include "../../../../MarlinCore.h" -#include "tft_lvgl_configuration.h" -#include "lvgl.h" -#include "../../../../feature/touch/xpt2046.h" -#include "draw_ready_print.h" -#include "W25Qxx.h" -#include "pic_manager.h" + #include "tft_lvgl_configuration.h" + #include "lvgl.h" + #include "../../../../feature/touch/xpt2046.h" + #include "draw_ready_print.h" + #include "W25Qxx.h" + #include "pic_manager.h" -#include "mks_hardware_test.h" -#include "draw_ui.h" + #include "mks_hardware_test.h" + #include "draw_ui.h" -#if ENABLED(POWER_LOSS_RECOVERY) - #include "../../../../feature/powerloss.h" -#endif + #if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../../feature/powerloss.h" + #endif -#include + #include -#if ENABLED(SPI_GRAPHICAL_TFT) - #include "SPI_TFT.h" -#endif + #if ENABLED(SPI_GRAPHICAL_TFT) + #include "SPI_TFT.h" + #endif //#include "../../Configuration.h" //#include "../../src/core/macros.h" -extern void LCD_IO_Init(uint8_t cs, uint8_t rs); -extern void LCD_IO_WriteData(uint16_t RegValue); -extern void LCD_IO_WriteReg(uint16_t Reg); + extern void LCD_IO_Init(uint8_t cs, uint8_t rs); + extern void LCD_IO_WriteData(uint16_t RegValue); + extern void LCD_IO_WriteReg(uint16_t Reg); -extern void LCD_IO_WriteMultiple(uint16_t color, uint32_t count); + extern void LCD_IO_WriteMultiple(uint16_t color, uint32_t count); -extern void init_gb2312_font(); + extern void init_gb2312_font(); -static lv_disp_buf_t disp_buf; + static lv_disp_buf_t disp_buf; //static lv_color_t buf[LV_HOR_RES_MAX * 18]; //static lv_color_t buf[10*5]; //extern lv_obj_t * scr; -#if ENABLED(SDSUPPORT) -extern void UpdatePic(); -extern void UpdateFont(); -#endif -uint16_t DeviceCode = 0x9488; -extern uint8_t sel_id; - -#define SetCs -#define ClrCs - -#define HDP 799 //Horizontal Display Period //** -#define HT 1000 //Horizontal Total -#define HPS 51 //LLINE Pulse Start Position -#define LPS 3 // Horizontal Display Period Start Position -#define HPW 8 // LLINE Pulse Width - -#define VDP 479 //Vertical Display Period -#define VT 530 //Vertical Total -#define VPS 24 // LFRAME Pulse Start Position -#define FPS 23 //Vertical Display Period Start Positio -#define VPW 3 // LFRAME Pulse Width //** - -#define MAX_HZ_POSX HDP+1 -#define MAX_HZ_POSY VDP+1 - -extern uint8_t gcode_preview_over, flash_preview_begin, default_preview_flg; - -void SysTick_Callback() { - lv_tick_inc(1); - print_time_count(); -} - -void tft_set_cursor(uint16_t x, uint16_t y) { - #if 0 - if (DeviceCode==0x8989) { - LCD_WriteReg(0x004E,y); //行 - LCD_WriteReg(0x004F,x); //列 + #if ENABLED(SDSUPPORT) + extern void UpdatePic(); + extern void UpdateFont(); + #endif + uint16_t DeviceCode = 0x9488; + extern uint8_t sel_id; + + #define SetCs + #define ClrCs + + #define HDP 799//Horizontal Display Period //** + #define HT 1000//Horizontal Total + #define HPS 51//LLINE Pulse Start Position + #define LPS 3 // Horizontal Display Period Start Position + #define HPW 8 // LLINE Pulse Width + + #define VDP 479//Vertical Display Period + #define VT 530//Vertical Total + #define VPS 24// LFRAME Pulse Start Position + #define FPS 23//Vertical Display Period Start Positio + #define VPW 3 // LFRAME Pulse Width //** + + #define MAX_HZ_POSX HDP+1 + #define MAX_HZ_POSY VDP+1 + + extern uint8_t gcode_preview_over, flash_preview_begin, default_preview_flg; + + void SysTick_Callback() { + lv_tick_inc(1); + print_time_count(); + } + + void tft_set_cursor(uint16_t x, uint16_t y) { + #if 0 + if (DeviceCode == 0x8989) { + LCD_WriteReg(0x004E, y); //行 + LCD_WriteReg(0x004F, x); //列 } - else if ((DeviceCode==0x9919)) { - LCD_WriteReg(0x004E,x); // 行 - LCD_WriteReg(0x004F,y); // 列 + else if ((DeviceCode == 0x9919)) { + LCD_WriteReg(0x004E, x); // 行 + LCD_WriteReg(0x004F, y); // 列 } - else if ((DeviceCode==0x5761)) { //SSD1963 + else if ((DeviceCode == 0x5761)) { //SSD1963 LCD_WrtReg(0x002A); - LCD_WrtRAM(x>>8); - LCD_WrtRAM(x&0x00FF); - LCD_WrtRAM(HDP>>8); - LCD_WrtRAM(HDP&0x00FF); + LCD_WrtRAM(x >> 8); + LCD_WrtRAM(x & 0x00FF); + LCD_WrtRAM(HDP >> 8); + LCD_WrtRAM(HDP & 0x00FF); LCD_WrtReg(0x002B); - LCD_WrtRAM(y>>8); - LCD_WrtRAM(y&0x00FF); - LCD_WrtRAM(VDP>>8); - LCD_WrtRAM(VDP&0x00FF); + LCD_WrtRAM(y >> 8); + LCD_WrtRAM(y & 0x00FF); + LCD_WrtRAM(VDP >> 8); + LCD_WrtRAM(VDP & 0x00FF); } else if (DeviceCode == 0x9488) { ILI9488_WriteCmd(0x002A); - ILI9488_WriteData(x>>8); - ILI9488_WriteData(x&0x00FF); - ILI9488_WriteData(x>>8); - ILI9488_WriteData(x&0x00FF); + ILI9488_WriteData(x >> 8); + ILI9488_WriteData(x & 0x00FF); + ILI9488_WriteData(x >> 8); + ILI9488_WriteData(x & 0x00FF); //ILI9488_WriteData(0x01); //ILI9488_WriteData(0xDF); ILI9488_WriteCmd(0x002B); - ILI9488_WriteData(y>>8); - ILI9488_WriteData(y&0x00FF); - ILI9488_WriteData(y>>8); - ILI9488_WriteData(y&0x00FF); + ILI9488_WriteData(y >> 8); + ILI9488_WriteData(y & 0x00FF); + ILI9488_WriteData(y >> 8); + ILI9488_WriteData(y & 0x00FF); //ILI9488_WriteData(0x01); //ILI9488_WriteData(0x3F); } else { - LCD_WriteReg(0x0020,y); // 行 - LCD_WriteReg(0x0021,0x13f-x); // 列 + LCD_WriteReg(0x0020, y); // 行 + LCD_WriteReg(0x0021, 0x13f - x); // 列 } - #else - LCD_IO_WriteReg(0x002A); - LCD_IO_WriteData(x >> 8); - LCD_IO_WriteData(x & 0x00FF); - LCD_IO_WriteData(x >> 8); - LCD_IO_WriteData(x & 0x00FF); - //ILI9488_WriteData(0x01); - //ILI9488_WriteData(0xDF); - LCD_IO_WriteReg(0x002B); - LCD_IO_WriteData(y >> 8); - LCD_IO_WriteData(y & 0x00FF); - LCD_IO_WriteData(y >> 8); - LCD_IO_WriteData(y & 0x00FF); - //ILI9488_WriteData(0x01); - //ILI9488_WriteData(0x3F); - #endif -} + #else // if 0 + LCD_IO_WriteReg(0x002A); + LCD_IO_WriteData(x >> 8); + LCD_IO_WriteData(x & 0x00FF); + LCD_IO_WriteData(x >> 8); + LCD_IO_WriteData(x & 0x00FF); + //ILI9488_WriteData(0x01); + //ILI9488_WriteData(0xDF); + LCD_IO_WriteReg(0x002B); + LCD_IO_WriteData(y >> 8); + LCD_IO_WriteData(y & 0x00FF); + LCD_IO_WriteData(y >> 8); + LCD_IO_WriteData(y & 0x00FF); + //ILI9488_WriteData(0x01); + //ILI9488_WriteData(0x3F); + #endif // if 0 + } -void LCD_WriteRAM_Prepare(void) { - #if 0 - if ((DeviceCode==0x9325) || (DeviceCode==0x9328) || (DeviceCode==0x8989)) { + void LCD_WriteRAM_Prepare(void) { + #if 0 + if ((DeviceCode == 0x9325) || (DeviceCode == 0x9328) || (DeviceCode == 0x8989)) { ClrCs LCD->LCD_REG = R34; SetCs @@ -168,146 +168,146 @@ void LCD_WriteRAM_Prepare(void) { else { LCD_WrtReg(0x002C); } - #else - LCD_IO_WriteReg(0x002C); - #endif -} - -void tft_set_point(uint16_t x,uint16_t y,uint16_t point) { - //if (DeviceCode == 0x9488) { - if ( (x>480)||(y>320) ) return; - //} - //**if ( (x>320)||(y>240) ) return; - tft_set_cursor(x,y); /*设置光标位置*/ - - LCD_WriteRAM_Prepare(); /* 开始写入GRAM*/ - //LCD_WriteRAM(point); - LCD_IO_WriteData(point); -} - -void LCD_WriteReg(uint16_t LCD_Reg,uint16_t LCD_RegValue) { - /* Write 16-bit Index, then Write Reg */ - ClrCs - LCD_IO_WriteReg(LCD_Reg); - /* Write 16-bit Reg */ - LCD_IO_WriteData(LCD_RegValue); - SetCs -} - -void ili9320_SetWindows(uint16_t StartX,uint16_t StartY,uint16_t width,uint16_t heigh) { - uint16_t s_h,s_l, e_h, e_l; - - uint16_t xEnd, yEnd; - xEnd = StartX + width; - yEnd = StartY + heigh-1; - if (DeviceCode == 0x8989) { - /*LCD_WriteReg(0x0044, (StartX & 0xFF) | (xEnd << 8)); - LCD_WriteReg(0x0045, StartY); - LCD_WriteReg(0x0046, yEnd);*/ - LCD_WriteReg(0x0044, (StartY& 0xFF) | (yEnd << 8)); - LCD_WriteReg(0x0045, StartX); - LCD_WriteReg(0x0046, xEnd); - } - else if (DeviceCode == 0x9488) { - s_h = (StartX >> 8) & 0x00ff; - s_l = StartX & 0x00ff; - e_h = ((StartX + width - 1) >> 8) & 0x00ff; - e_l = (StartX + width - 1) & 0x00ff; - - LCD_IO_WriteReg(0x002A); - LCD_IO_WriteData(s_h); - LCD_IO_WriteData(s_l); - LCD_IO_WriteData(e_h); - LCD_IO_WriteData(e_l); - - s_h = (StartY >> 8) & 0x00ff; - s_l = StartY & 0x00ff; - e_h = ((StartY + heigh - 1) >> 8) & 0x00ff; - e_l = (StartY + heigh - 1) & 0x00ff; - - LCD_IO_WriteReg(0x002B); - LCD_IO_WriteData(s_h); - LCD_IO_WriteData(s_l); - LCD_IO_WriteData(e_h); - LCD_IO_WriteData(e_l); + #else + LCD_IO_WriteReg(0x002C); + #endif } - else if ((DeviceCode == 0x9325) || (DeviceCode == 0x9328) || (DeviceCode == 0x1505)) { - /* LCD_WriteReg(0x0050, StartX); - LCD_WriteReg(0x0052, StartY); - LCD_WriteReg(0x0051, xEnd); - LCD_WriteReg(0x0053, yEnd);*/ - LCD_WriteReg(0x0050, StartY); //Specify the start/end positions of the window address in the horizontal direction by an address unit - LCD_WriteReg(0x0051, yEnd); //Specify the start positions of the window address in the vertical direction by an address unit - LCD_WriteReg(0x0052, 320 - xEnd); - LCD_WriteReg(0x0053, 320 - StartX - 1); //Specify the end positions of the window address in the vertical direction by an address unit + void tft_set_point(uint16_t x, uint16_t y, uint16_t point) { + //if (DeviceCode == 0x9488) { + if ((x > 480) || (y > 320)) return; + //} + //**if ( (x>320)||(y>240) ) return; + tft_set_cursor(x, y); /*设置光标位置*/ + + LCD_WriteRAM_Prepare(); /* 开始写入GRAM*/ + //LCD_WriteRAM(point); + LCD_IO_WriteData(point); } - else { - s_h = (StartX >> 8) & 0xFF; - s_l = StartX & 0xFF; - e_h = ((StartX + width - 1) >> 8) & 0xFF; - e_l = (StartX + width - 1) & 0xFF; - - LCD_IO_WriteReg(0x2A); - LCD_IO_WriteData(s_h); - LCD_IO_WriteData(s_l); - LCD_IO_WriteData(e_h); - LCD_IO_WriteData(e_l); - - s_h = (StartY >> 8) & 0xFF; - s_l = StartY & 0xFF; - e_h = ((StartY + heigh - 1) >> 8) & 0xFF; - e_l = (StartY + heigh - 1) & 0xFF; - - LCD_IO_WriteReg(0x2B); - LCD_IO_WriteData(s_h); - LCD_IO_WriteData(s_l); - LCD_IO_WriteData(e_h); - LCD_IO_WriteData(e_l); - } -} - -void LCD_Clear(uint16_t Color) { - uint32_t index = 0; - unsigned int count; - - if (DeviceCode == 0x9488) { - tft_set_cursor(0, 0); - ili9320_SetWindows(0, 0, 480, 320); - LCD_WriteRAM_Prepare(); - //index = (160*480); - for (index = 0; index < 320*480; index++) - LCD_IO_WriteData(Color); - //LCD_IO_WriteMultiple(Color, (480*320)); - //while(index --) LCD_IO_WriteData(Color); + + void LCD_WriteReg(uint16_t LCD_Reg, uint16_t LCD_RegValue) { + /* Write 16-bit Index, then Write Reg */ + ClrCs + LCD_IO_WriteReg(LCD_Reg); + /* Write 16-bit Reg */ + LCD_IO_WriteData(LCD_RegValue); + SetCs } - else if (DeviceCode == 0x5761) { - LCD_IO_WriteReg(0x002a); - LCD_IO_WriteData(0); - LCD_IO_WriteData(0); - LCD_IO_WriteData(HDP>>8); - LCD_IO_WriteData(HDP&0x00ff); - LCD_IO_WriteReg(0x002b); - LCD_IO_WriteData(0); - LCD_IO_WriteData(0); - LCD_IO_WriteData(VDP>>8); - LCD_IO_WriteData(VDP&0x00ff); - LCD_IO_WriteReg(0x002c); - LCD_IO_WriteReg(0x002c); - for (count = 0; count < (HDP+1)*(VDP+1); count++) - LCD_IO_WriteData(Color); + + void ili9320_SetWindows(uint16_t StartX, uint16_t StartY, uint16_t width, uint16_t heigh) { + uint16_t s_h, s_l, e_h, e_l; + + uint16_t xEnd, yEnd; + xEnd = StartX + width; + yEnd = StartY + heigh - 1; + if (DeviceCode == 0x8989) { + /*LCD_WriteReg(0x0044, (StartX & 0xFF) | (xEnd << 8)); + LCD_WriteReg(0x0045, StartY); + LCD_WriteReg(0x0046, yEnd);*/ + LCD_WriteReg(0x0044, (StartY & 0xFF) | (yEnd << 8)); + LCD_WriteReg(0x0045, StartX); + LCD_WriteReg(0x0046, xEnd); + } + else if (DeviceCode == 0x9488) { + s_h = (StartX >> 8) & 0x00ff; + s_l = StartX & 0x00ff; + e_h = ((StartX + width - 1) >> 8) & 0x00ff; + e_l = (StartX + width - 1) & 0x00ff; + + LCD_IO_WriteReg(0x002A); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + + s_h = (StartY >> 8) & 0x00ff; + s_l = StartY & 0x00ff; + e_h = ((StartY + heigh - 1) >> 8) & 0x00ff; + e_l = (StartY + heigh - 1) & 0x00ff; + + LCD_IO_WriteReg(0x002B); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + } + else if ((DeviceCode == 0x9325) || (DeviceCode == 0x9328) || (DeviceCode == 0x1505)) { + /* LCD_WriteReg(0x0050, StartX); + LCD_WriteReg(0x0052, StartY); + LCD_WriteReg(0x0051, xEnd); + LCD_WriteReg(0x0053, yEnd);*/ + LCD_WriteReg(0x0050, StartY); //Specify the start/end positions of the window address in the horizontal direction by an address unit + LCD_WriteReg(0x0051, yEnd); //Specify the start positions of the window address in the vertical direction by an address unit + LCD_WriteReg(0x0052, 320 - xEnd); + LCD_WriteReg(0x0053, 320 - StartX - 1); //Specify the end positions of the window address in the vertical direction by an address unit + + } + else { + s_h = (StartX >> 8) & 0xFF; + s_l = StartX & 0xFF; + e_h = ((StartX + width - 1) >> 8) & 0xFF; + e_l = (StartX + width - 1) & 0xFF; + + LCD_IO_WriteReg(0x2A); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + + s_h = (StartY >> 8) & 0xFF; + s_l = StartY & 0xFF; + e_h = ((StartY + heigh - 1) >> 8) & 0xFF; + e_l = (StartY + heigh - 1) & 0xFF; + + LCD_IO_WriteReg(0x2B); + LCD_IO_WriteData(s_h); + LCD_IO_WriteData(s_l); + LCD_IO_WriteData(e_h); + LCD_IO_WriteData(e_l); + } } - else { - tft_set_cursor(0, 0); - LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */ - for (index = 0; index < 76800; index++) - LCD_IO_WriteData(Color); + + void LCD_Clear(uint16_t Color) { + uint32_t index = 0; + unsigned int count; + + if (DeviceCode == 0x9488) { + tft_set_cursor(0, 0); + ili9320_SetWindows(0, 0, 480, 320); + LCD_WriteRAM_Prepare(); + //index = (160*480); + for (index = 0; index < 320 * 480; index++) + LCD_IO_WriteData(Color); + //LCD_IO_WriteMultiple(Color, (480*320)); + //while(index --) LCD_IO_WriteData(Color); + } + else if (DeviceCode == 0x5761) { + LCD_IO_WriteReg(0x002a); + LCD_IO_WriteData(0); + LCD_IO_WriteData(0); + LCD_IO_WriteData(HDP >> 8); + LCD_IO_WriteData(HDP & 0x00ff); + LCD_IO_WriteReg(0x002b); + LCD_IO_WriteData(0); + LCD_IO_WriteData(0); + LCD_IO_WriteData(VDP >> 8); + LCD_IO_WriteData(VDP & 0x00ff); + LCD_IO_WriteReg(0x002c); + LCD_IO_WriteReg(0x002c); + for (count = 0; count < (HDP + 1) * (VDP + 1); count++) + LCD_IO_WriteData(Color); + } + else { + tft_set_cursor(0, 0); + LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */ + for (index = 0; index < 76800; index++) + LCD_IO_WriteData(Color); + } } -} -extern uint16_t ILI9488_ReadRAM(); + extern uint16_t ILI9488_ReadRAM(); -#if DISABLED(SPI_GRAPHICAL_TFT) + #if DISABLED(SPI_GRAPHICAL_TFT) void init_tft() { uint16_t i; @@ -375,11 +375,11 @@ extern uint16_t ILI9488_ReadRAM(); //ILI9488_WriteData(0x0068); //if (gCfgItems.overturn_180 != 0xEE) //{ - LCD_IO_WriteData(0x0068); + LCD_IO_WriteData(0x0068); //} //else //{ - //ILI9488_WriteData(0x00A8); + //ILI9488_WriteData(0x00A8); //} LCD_IO_WriteReg(0x003A); //Interface Mode Control @@ -413,65 +413,65 @@ extern uint16_t ILI9488_ReadRAM(); LCD_IO_WriteData(0x0082); LCD_IO_WriteReg(0x0011); - for (i=0;i<65535;i++); + for (i = 0; i < 65535; i++); LCD_IO_WriteReg(0x0029); - ili9320_SetWindows(0,0,480,320); + ili9320_SetWindows(0, 0, 480, 320); LCD_Clear(0x0000); OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); } } -#endif + #endif // if DISABLED(SPI_GRAPHICAL_TFT) -extern uint8_t bmp_public_buf[17 * 1024]; -void tft_lvgl_init() { - //uint16_t test_id=0; - W25QXX.init(SPI_QUARTER_SPEED); - //test_id=W25QXX.W25QXX_ReadID(); - #if ENABLED(SDSUPPORT) - UpdatePic(); - UpdateFont(); - #endif + extern uint8_t bmp_public_buf[17 * 1024]; + void tft_lvgl_init() { + //uint16_t test_id=0; + W25QXX.init(SPI_QUARTER_SPEED); + //test_id=W25QXX.W25QXX_ReadID(); + #if ENABLED(SDSUPPORT) + UpdatePic(); + UpdateFont(); + #endif - gCfgItems_init(); - ui_cfg_init(); - disp_language_init(); - //spi_flash_read_test(); + gCfgItems_init(); + ui_cfg_init(); + disp_language_init(); + //spi_flash_read_test(); - #if ENABLED(SPI_GRAPHICAL_TFT) - SPI_TFT.spi_init(SPI_FULL_SPEED); - SPI_TFT.LCD_init(); - #else - init_tft(); - #endif + #if ENABLED(SPI_GRAPHICAL_TFT) + SPI_TFT.spi_init(SPI_FULL_SPEED); + SPI_TFT.LCD_init(); + #else + init_tft(); + #endif - lv_init(); + lv_init(); - lv_disp_buf_init(&disp_buf, bmp_public_buf, NULL, LV_HOR_RES_MAX * 18); /*Initialize the display buffer*/ + lv_disp_buf_init(&disp_buf, bmp_public_buf, NULL, LV_HOR_RES_MAX * 18); /*Initialize the display buffer*/ - lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/ - lv_disp_drv_init(&disp_drv); /*Basic initialization*/ - disp_drv.flush_cb = my_disp_flush; /*Set your driver function*/ - disp_drv.buffer = &disp_buf; /*Assign the buffer to the display*/ - lv_disp_drv_register(&disp_drv); /*Finally register the driver*/ + lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/ + lv_disp_drv_init(&disp_drv); /*Basic initialization*/ + disp_drv.flush_cb = my_disp_flush; /*Set your driver function*/ + disp_drv.buffer = &disp_buf; /*Assign the buffer to the display*/ + lv_disp_drv_register(&disp_drv); /*Finally register the driver*/ - lv_indev_drv_t indev_drv; - lv_indev_drv_init(&indev_drv); /*Descriptor of a input device driver*/ - indev_drv.type = LV_INDEV_TYPE_POINTER; /*Touch pad is a pointer-like device*/ - indev_drv.read_cb = my_touchpad_read; /*Set your driver function*/ - lv_indev_drv_register(&indev_drv); /*Finally register the driver*/ + lv_indev_drv_t indev_drv; + lv_indev_drv_init(&indev_drv); /*Descriptor of a input device driver*/ + indev_drv.type = LV_INDEV_TYPE_POINTER; /*Touch pad is a pointer-like device*/ + indev_drv.read_cb = my_touchpad_read; /*Set your driver function*/ + lv_indev_drv_register(&indev_drv); /*Finally register the driver*/ - systick_attach_callback(SysTick_Callback); + systick_attach_callback(SysTick_Callback); - init_gb2312_font(); + init_gb2312_font(); - tft_style_init(); + tft_style_init(); - filament_pin_setup(); + filament_pin_setup(); - #if ENABLED(POWER_LOSS_RECOVERY) + #if ENABLED(POWER_LOSS_RECOVERY) if (recovery.valid()) { if (gCfgItems.from_flash_pic == 1) flash_preview_begin = 1; @@ -489,310 +489,303 @@ void tft_lvgl_init() { lv_draw_printing(); } else - #endif - lv_draw_ready_print(); + #endif + lv_draw_ready_print(); - #if ENABLED(MKS_TEST) - Test_GPIO(); - #endif -} + #if ENABLED(MKS_TEST) + Test_GPIO(); + #endif + } -#if 0 + #if 0 void LCD_WriteRAM(uint16_t RGB_Code) { #if 0 ClrCs /* Write 16-bit GRAM Reg */ LCD->LCD_RAM = RGB_Code; SetCs - #else + #else LCD_IO_WriteData(RGB_Code); #endif } -#endif + #endif -void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) { - #if ENABLED(SPI_GRAPHICAL_TFT) - uint16_t i, width, height; - uint16_t clr_temp; - uint8_t tbuf[480*2]; + void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) { + #if ENABLED(SPI_GRAPHICAL_TFT) + uint16_t i, width, height; + uint16_t clr_temp; + uint8_t tbuf[480 * 2]; - SPI_TFT.spi_init(SPI_FULL_SPEED); + SPI_TFT.spi_init(SPI_FULL_SPEED); - width = area->x2 - area->x1 + 1; - height = area->y2 - area->y1 +1; + width = area->x2 - area->x1 + 1; + height = area->y2 - area->y1 + 1; - for (int j = 0; j < height; j++) { - SPI_TFT.SetCursor(0,0); - SPI_TFT.SetWindows((uint16_t)area->x1,(uint16_t)area->y1+j,width,1); - SPI_TFT.LCD_WriteRAM_Prepare(); + for (int j = 0; j < height; j++) { + SPI_TFT.SetCursor(0, 0); + SPI_TFT.SetWindows((uint16_t)area->x1, (uint16_t)area->y1 + j, width, 1); + SPI_TFT.LCD_WriteRAM_Prepare(); - for (i = 0; i < width * 2;) { - clr_temp = (uint16_t)(((uint16_t)color_p->ch.red<<11) - | ((uint16_t)color_p->ch.green<<5) - | ((uint16_t)color_p->ch.blue)); + for (i = 0; i < width * 2;) { + clr_temp = (uint16_t)(((uint16_t)color_p->ch.red << 11) + | ((uint16_t)color_p->ch.green << 5) + | ((uint16_t)color_p->ch.blue)); - tbuf[i] = clr_temp >> 8; - tbuf[i+1] = clr_temp; - i+=2; - color_p++; + tbuf[i] = clr_temp >> 8; + tbuf[i + 1] = clr_temp; + i += 2; + color_p++; + } + SPI_TFT_CS_L; + SPI_TFT_DC_H; + SPI.dmaSend(tbuf, width * 2, true); + SPI_TFT_CS_H; } - SPI_TFT_CS_L; - SPI_TFT_DC_H; - SPI.dmaSend(tbuf,width*2,true); - SPI_TFT_CS_H; - } - - lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ - - W25QXX.init(SPI_QUARTER_SPEED); - #else - - #if 1 - uint16_t i,width,height; - uint16_t clr_temp; - #if 0 - int32_t x,y; - for (y = area->y1; y <= area->y2; y++) { - for (x = area->x1; x <= area->x2; x++) { - //set_pixel(x, y, *color_p); /* Put a pixel to the display.*/ - clr_temp = (uint16_t)(((uint16_t)color_p->ch.red<<11) - |((uint16_t)color_p->ch.green<<5) - |((uint16_t)color_p->ch.blue)); - tft_set_point(x, y,clr_temp); + lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ + + W25QXX.init(SPI_QUARTER_SPEED); + #else + #if 1 + uint16_t i, width, height; + uint16_t clr_temp; + #if 0 + int32_t x, y; + for (y = area->y1; y <= area->y2; y++) + for (x = area->x1; x <= area->x2; x++) { + //set_pixel(x, y, *color_p); /* Put a pixel to the display.*/ + clr_temp = (uint16_t)(((uint16_t)color_p->ch.red << 11) + | ((uint16_t)color_p->ch.green << 5) + | ((uint16_t)color_p->ch.blue)); + tft_set_point(x, y, clr_temp); + color_p++; + } + + #else + width = area->x2 - area->x1 + 1; + height = area->y2 - area->y1 + 1; + //tft_set_cursor((uint16_t)area->x1,(uint16_t)area->y1); + ili9320_SetWindows((uint16_t)area->x1, (uint16_t)area->y1, width, height); + LCD_WriteRAM_Prepare(); + for (i = 0; i < width * height; i++) { + clr_temp = (uint16_t)(((uint16_t)color_p->ch.red << 11) + | ((uint16_t)color_p->ch.green << 5) + | ((uint16_t)color_p->ch.blue)); + LCD_IO_WriteData(clr_temp); color_p++; } - } - #else - width = area->x2 - area->x1 + 1; - height = area->y2 - area->y1 +1; - //tft_set_cursor((uint16_t)area->x1,(uint16_t)area->y1); - ili9320_SetWindows((uint16_t)area->x1,(uint16_t)area->y1,width,height); - LCD_WriteRAM_Prepare(); - for (i = 0; i < width * height; i++) { - clr_temp = (uint16_t)(((uint16_t)color_p->ch.red<<11) - | ((uint16_t)color_p->ch.green<<5) - | ((uint16_t)color_p->ch.blue)); - LCD_IO_WriteData(clr_temp); - color_p++; - } - #endif - - lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ - #endif - - #endif -} + #endif -#define TICK_CYCLE 1 + lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ + #endif + #endif // SPI_GRAPHICAL_TFT + } -static int32_t touch_time1 = 0; + #define TICK_CYCLE 1 -unsigned int getTickDiff(unsigned int curTick, unsigned int lastTick) { - if (lastTick <= curTick) - return (curTick - lastTick) * TICK_CYCLE; - else - return (0xFFFFFFFF - lastTick + curTick) * TICK_CYCLE; -} + static int32_t touch_time1 = 0; -#if ENABLED(SPI_GRAPHICAL_TFT) + unsigned int getTickDiff(unsigned int curTick, unsigned int lastTick) { + if (lastTick <= curTick) + return (curTick - lastTick) * TICK_CYCLE; + else + return (0xFFFFFFFF - lastTick + curTick) * TICK_CYCLE; + } - #ifndef USE_XPT2046 - #define USE_XPT2046 1 - #define XPT2046_XY_SWAP 1 - #define XPT2046_X_INV 1 - #define XPT2046_Y_INV 0 - #endif + #if ENABLED(SPI_GRAPHICAL_TFT) - #if USE_XPT2046 - #define XPT2046_HOR_RES 480 - #define XPT2046_VER_RES 320 - #define XPT2046_X_MIN 201 - #define XPT2046_Y_MIN 164 - #define XPT2046_X_MAX 3919 - #define XPT2046_Y_MAX 3776 - #define XPT2046_AVG 4 - #define XPT2046_INV 1 - #endif + #ifndef USE_XPT2046 + #define USE_XPT2046 1 + #define XPT2046_XY_SWAP 1 + #define XPT2046_X_INV 1 + #define XPT2046_Y_INV 0 + #endif -#else + #if USE_XPT2046 + #define XPT2046_HOR_RES 480 + #define XPT2046_VER_RES 320 + #define XPT2046_X_MIN 201 + #define XPT2046_Y_MIN 164 + #define XPT2046_X_MAX 3919 + #define XPT2046_Y_MAX 3776 + #define XPT2046_AVG 4 + #define XPT2046_INV 1 + #endif - #ifndef USE_XPT2046 - #define USE_XPT2046 1 - #define XPT2046_XY_SWAP 1 - #define XPT2046_X_INV 0 - #define XPT2046_Y_INV 1 - #endif + #else - #if USE_XPT2046 - #define XPT2046_HOR_RES 480 - #define XPT2046_VER_RES 320 - #define XPT2046_X_MIN 201 - #define XPT2046_Y_MIN 164 - #define XPT2046_X_MAX 3919 - #define XPT2046_Y_MAX 3776 - #define XPT2046_AVG 4 - #define XPT2046_INV 0 - #endif + #ifndef USE_XPT2046 + #define USE_XPT2046 1 + #define XPT2046_XY_SWAP 1 + #define XPT2046_X_INV 0 + #define XPT2046_Y_INV 1 + #endif -#endif + #if USE_XPT2046 + #define XPT2046_HOR_RES 480 + #define XPT2046_VER_RES 320 + #define XPT2046_X_MIN 201 + #define XPT2046_Y_MIN 164 + #define XPT2046_X_MAX 3919 + #define XPT2046_Y_MAX 3776 + #define XPT2046_AVG 4 + #define XPT2046_INV 0 + #endif -static void xpt2046_corr(uint16_t *x, uint16_t *y) { - #if XPT2046_XY_SWAP - int16_t swap_tmp; - swap_tmp = *x; - *x = *y; - *y = swap_tmp; - #endif - if ((*x) > XPT2046_X_MIN) (*x) -= XPT2046_X_MIN; else (*x) = 0; - if ((*y) > XPT2046_Y_MIN) (*y) -= XPT2046_Y_MIN; else (*y) = 0; - (*x) = uint32_t(uint32_t(*x) * XPT2046_HOR_RES) / (XPT2046_X_MAX - XPT2046_X_MIN); - (*y) = uint32_t(uint32_t(*y) * XPT2046_VER_RES) / (XPT2046_Y_MAX - XPT2046_Y_MIN); - #if XPT2046_X_INV - (*x) = XPT2046_HOR_RES - (*x); #endif - #if XPT2046_Y_INV - (*y) = XPT2046_VER_RES - (*y); - #endif -} -#define times 4 -#define CHX 0x90 // 0x90 -#define CHY 0xD0 // 0xD0 + static void xpt2046_corr(uint16_t *x, uint16_t *y) { + #if XPT2046_XY_SWAP + int16_t swap_tmp; + swap_tmp = *x; + *x = *y; + *y = swap_tmp; + #endif + if ((*x) > XPT2046_X_MIN) (*x) -= XPT2046_X_MIN; else (*x) = 0; + if ((*y) > XPT2046_Y_MIN) (*y) -= XPT2046_Y_MIN; else (*y) = 0; + (*x) = uint32_t(uint32_t(*x) * XPT2046_HOR_RES) / (XPT2046_X_MAX - XPT2046_X_MIN); + (*y) = uint32_t(uint32_t(*y) * XPT2046_VER_RES) / (XPT2046_Y_MAX - XPT2046_Y_MIN); + #if XPT2046_X_INV + (*x) = XPT2046_HOR_RES - (*x); + #endif + #if XPT2046_Y_INV + (*y) = XPT2046_VER_RES - (*y); + #endif + } -int SPI2_ReadWrite2Bytes(void) { - volatile uint16_t ans=0; - uint16_t temp = 0; - #if ENABLED(SPI_GRAPHICAL_TFT) - temp = SPI_TFT.spi_read_write_byte(0xFF); - ans = temp << 8; - temp = SPI_TFT.spi_read_write_byte(0xFF); - ans |= temp; - ans >>= 3; - #else - temp = W25QXX.spi_flash_read_write_byte(0xFF); - ans = temp << 8; - temp = W25QXX.spi_flash_read_write_byte(0xFF); - ans |= temp; - ans >>= 3; - #endif - return ans & 0x0FFF; -} + #define times 4 + #define CHX 0x90// 0x90 + #define CHY 0xD0// 0xD0 -uint16_t x_addata[times],y_addata[times]; -void XPT2046_Rd_Addata(uint16_t *X_Addata,uint16_t *Y_Addata) { - uint16_t i, j, k; - //int result; - //#if ENABLED(TOUCH_BUTTONS) + int SPI2_ReadWrite2Bytes(void) { + volatile uint16_t ans = 0; + uint16_t temp = 0; + #if ENABLED(SPI_GRAPHICAL_TFT) + temp = SPI_TFT.spi_read_write_byte(0xFF); + ans = temp << 8; + temp = SPI_TFT.spi_read_write_byte(0xFF); + ans |= temp; + ans >>= 3; + #else + temp = W25QXX.spi_flash_read_write_byte(0xFF); + ans = temp << 8; + temp = W25QXX.spi_flash_read_write_byte(0xFF); + ans |= temp; + ans >>= 3; + #endif + return ans & 0x0FFF; + } - #if ENABLED(SPI_GRAPHICAL_TFT) - SPI_TFT.spi_init(SPI_QUARTER_SPEED); - #endif + uint16_t x_addata[times], y_addata[times]; + void XPT2046_Rd_Addata(uint16_t *X_Addata, uint16_t *Y_Addata) { + uint16_t i, j, k; + //int result; + //#if ENABLED(TOUCH_BUTTONS) - for (i = 0; i < times; i++) { #if ENABLED(SPI_GRAPHICAL_TFT) - OUT_WRITE(TOUCH_CS_PIN, LOW); - SPI_TFT.spi_read_write_byte(CHX); - y_addata[i] = SPI2_ReadWrite2Bytes(); - WRITE(TOUCH_CS_PIN, HIGH); - - OUT_WRITE(TOUCH_CS_PIN, LOW); - SPI_TFT.spi_read_write_byte(CHY); - x_addata[i] = SPI2_ReadWrite2Bytes(); - WRITE(TOUCH_CS_PIN, HIGH); - #else // #if ENABLED(TOUCH_BUTTONS) - OUT_WRITE(TOUCH_CS_PIN, LOW); - W25QXX.spi_flash_read_write_byte(CHX); - y_addata[i] = SPI2_ReadWrite2Bytes(); - WRITE(TOUCH_CS_PIN, HIGH); - - OUT_WRITE(TOUCH_CS_PIN, LOW); - W25QXX.spi_flash_read_write_byte(CHY); - x_addata[i] = SPI2_ReadWrite2Bytes(); - WRITE(TOUCH_CS_PIN, HIGH); + SPI_TFT.spi_init(SPI_QUARTER_SPEED); #endif - } - //#endif - //result = x_addata[0]; - for (i = 0; i < times; i++) { - for (j = i + 1; j < times; j++) { - if (x_addata[j] > x_addata[i]) { - k = x_addata[j]; - x_addata[j] = x_addata[i]; - x_addata[i] = k; - } + for (i = 0; i < times; i++) { + #if ENABLED(SPI_GRAPHICAL_TFT) + OUT_WRITE(TOUCH_CS_PIN, LOW); + SPI_TFT.spi_read_write_byte(CHX); + y_addata[i] = SPI2_ReadWrite2Bytes(); + WRITE(TOUCH_CS_PIN, HIGH); + + OUT_WRITE(TOUCH_CS_PIN, LOW); + SPI_TFT.spi_read_write_byte(CHY); + x_addata[i] = SPI2_ReadWrite2Bytes(); + WRITE(TOUCH_CS_PIN, HIGH); + #else // #if ENABLED(TOUCH_BUTTONS) + OUT_WRITE(TOUCH_CS_PIN, LOW); + W25QXX.spi_flash_read_write_byte(CHX); + y_addata[i] = SPI2_ReadWrite2Bytes(); + WRITE(TOUCH_CS_PIN, HIGH); + + OUT_WRITE(TOUCH_CS_PIN, LOW); + W25QXX.spi_flash_read_write_byte(CHY); + x_addata[i] = SPI2_ReadWrite2Bytes(); + WRITE(TOUCH_CS_PIN, HIGH); + #endif + + } + //#endif + //result = x_addata[0]; + for (i = 0; i < times; i++) + for (j = i + 1; j < times; j++) + if (x_addata[j] > x_addata[i]) { + k = x_addata[j]; + x_addata[j] = x_addata[i]; + x_addata[i] = k; + } + if (x_addata[times / 2 - 1] - x_addata[times / 2] > 50) { + *X_Addata = *Y_Addata = 0; + return; } - } - if (x_addata[times / 2 - 1] - x_addata[times / 2] > 50) { - *X_Addata = *Y_Addata = 0; - return; - } - *X_Addata = (x_addata[times / 2 - 1] + x_addata[times / 2]) /2; + *X_Addata = (x_addata[times / 2 - 1] + x_addata[times / 2]) / 2; - //result = y_addata[0]; - for (i = 0; i < times; i++) { - for (j = i + 1; j < times; j++) { - if (y_addata[j] > y_addata[i]) { - k = y_addata[j]; - y_addata[j] = y_addata[i]; - y_addata[i] = k; - } + //result = y_addata[0]; + for (i = 0; i < times; i++) + for (j = i + 1; j < times; j++) + if (y_addata[j] > y_addata[i]) { + k = y_addata[j]; + y_addata[j] = y_addata[i]; + y_addata[i] = k; + } + + if (y_addata[times / 2 - 1] - y_addata[times / 2] > 50) { + *X_Addata = *Y_Addata = 0; + return; } - } - if (y_addata[times / 2 - 1] - y_addata[times / 2] > 50) { - *X_Addata = *Y_Addata = 0; - return; + *Y_Addata = (y_addata[times / 2 - 1] + y_addata[times / 2]) / 2; } - *Y_Addata = (y_addata[times / 2 - 1] + y_addata[times / 2]) / 2; -} + #define ADC_VALID_OFFSET 10 -#define ADC_VALID_OFFSET 10 + uint8_t TOUCH_PressValid(uint16_t _usX, uint16_t _usY) { + if ((_usX <= ADC_VALID_OFFSET) || (_usY <= ADC_VALID_OFFSET) + || (_usX >= 4095 - ADC_VALID_OFFSET) || (_usY >= 4095 - ADC_VALID_OFFSET) + ) return 0; -uint8_t TOUCH_PressValid(uint16_t _usX, uint16_t _usY) { - if ( (_usX <= ADC_VALID_OFFSET) || (_usY <= ADC_VALID_OFFSET) - || (_usX >= 4095 - ADC_VALID_OFFSET) || (_usY >= 4095 - ADC_VALID_OFFSET) - ) return 0; - - return 1; -} + return 1; + } -static lv_coord_t last_x = 0, last_y = 0; -bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) { - #if 1 - uint32_t tmpTime, diffTime = 0; + static lv_coord_t last_x = 0, last_y = 0; + bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) { + #if 1 + uint32_t tmpTime, diffTime = 0; - tmpTime = millis(); - diffTime = getTickDiff(tmpTime, touch_time1); - /*Save the state and save the pressed coordinate*/ - //data->state = TOUCH_PressValid(last_x, last_y) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; - //if (data->state == LV_INDEV_STATE_PR) ADS7843_Rd_Addata((u16 *)&last_x, (u16 *)&last_y); + tmpTime = millis(); + diffTime = getTickDiff(tmpTime, touch_time1); + /*Save the state and save the pressed coordinate*/ + //data->state = TOUCH_PressValid(last_x, last_y) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; + //if (data->state == LV_INDEV_STATE_PR) ADS7843_Rd_Addata((u16 *)&last_x, (u16 *)&last_y); //touchpad_get_xy(&last_x, &last_y); - /*Save the pressed coordinates and the state*/ - if (diffTime > 10) { - XPT2046_Rd_Addata((uint16_t *)&last_x, (uint16_t *)&last_y); - if (TOUCH_PressValid(last_x, last_y)) { + /*Save the pressed coordinates and the state*/ + if (diffTime > 10) { + XPT2046_Rd_Addata((uint16_t *)&last_x, (uint16_t *)&last_y); + if (TOUCH_PressValid(last_x, last_y)) { - data->state = LV_INDEV_STATE_PR; + data->state = LV_INDEV_STATE_PR; - /*Set the coordinates (if released use the last pressed coordinates)*/ + /*Set the coordinates (if released use the last pressed coordinates)*/ - xpt2046_corr((uint16_t *)&last_x, (uint16_t *)&last_y); - data->point.x = last_x; - data->point.y = last_y; + xpt2046_corr((uint16_t *)&last_x, (uint16_t *)&last_y); + data->point.x = last_x; + data->point.y = last_y; + } + else { + data->state = LV_INDEV_STATE_REL; + } + touch_time1 = tmpTime; } - else { - data->state = LV_INDEV_STATE_REL; - } - touch_time1 = tmpTime; - } - return false; /*Return `false` because we are not buffering and no more data to read*/ - #endif -} + return false; /*Return `false` because we are not buffering and no more data to read*/ + #endif + } #endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h index 71cb4e747668..c1e40e77f36f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h @@ -36,9 +36,9 @@ void tft_lvgl_init(); void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p); bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data); -void LCD_Clear(uint16_t Color); -void tft_set_point(uint16_t x,uint16_t y,uint16_t point); -void ili9320_SetWindows(uint16_t StartX,uint16_t StartY,uint16_t width,uint16_t heigh); +void LCD_Clear(uint16_t Color); +void tft_set_point(uint16_t x, uint16_t y, uint16_t point); +void ili9320_SetWindows(uint16_t StartX, uint16_t StartY, uint16_t width, uint16_t heigh); void LCD_WriteRAM_Prepare(void); //#ifdef __cplusplus diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp index 4c094d7e168f..9874d2406b9a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp @@ -141,25 +141,24 @@ void disp_language_init() { //wifi-list #if 0 - list_menu.title = TEXT_WIFI_MENU_TITLE_EN; - list_menu.file_pages = FILE_PAGES_EN; - //keyboard - keyboard_menu.apply = MANUAL_IP_APPLY_EN; - keyboard_menu.password = TEXT_WIFI_PASSWORD_EN; - keyboard_menu.space = TEXT_WIFI_SAPCE_EN; - keyboard_menu.letter = TEXT_WIFI_LETTER_EN; - keyboard_menu.digital = TEXT_WIFI_DIGITAL_EN; - keyboard_menu.symbol = TEXT_WIFI_SYMBOL_EN; - //tips - tips_menu.pointBold = TEXT_WIFI_POINT_BOLD_EN; - tips_menu.joining = TEXT_WIFI_JOINING_EN; - tips_menu.failedJoin = TEXT_WIFI_FAILED_JOIN_EN; - tips_menu.wifiConected = TEXT_WIFI_WIFI_CONECTED_EN; + list_menu.title = TEXT_WIFI_MENU_TITLE_EN; + list_menu.file_pages = FILE_PAGES_EN; + //keyboard + keyboard_menu.apply = MANUAL_IP_APPLY_EN; + keyboard_menu.password = TEXT_WIFI_PASSWORD_EN; + keyboard_menu.space = TEXT_WIFI_SAPCE_EN; + keyboard_menu.letter = TEXT_WIFI_LETTER_EN; + keyboard_menu.digital = TEXT_WIFI_DIGITAL_EN; + keyboard_menu.symbol = TEXT_WIFI_SYMBOL_EN; + //tips + tips_menu.pointBold = TEXT_WIFI_POINT_BOLD_EN; + tips_menu.joining = TEXT_WIFI_JOINING_EN; + tips_menu.failedJoin = TEXT_WIFI_FAILED_JOIN_EN; + tips_menu.wifiConected = TEXT_WIFI_WIFI_CONECTED_EN; #endif operation_menu.babystep = TEXT_BABY_STEP_EN; - switch (gCfgItems.language) - { + switch (gCfgItems.language) { case LANG_SIMPLE_CHINESE: common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_CN; common_menu.text_back = BACK_TEXT_CN; @@ -387,1301 +386,1304 @@ void disp_language_init() { pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_CN; break; -#if 1 - #if 1 - case LANG_COMPLEX_CHINESE: - common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_T_CN; - common_menu.text_back = BACK_TEXT_T_CN; - common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_T_CN; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_T_CN; - common_menu.print_special_title = PRINTING_GBK; - common_menu.pause_special_title = PRINTING_PAUSE_GBK; - common_menu.operate_special_title = PRINTING_OPERATION_GBK; - // - main_menu.title = TITLE_READYPRINT_T_CN; - main_menu.preheat = PREHEAT_TEXT_T_CN; - main_menu.move = MOVE_TEXT_T_CN; - main_menu.home = HOME_TEXT_T_CN; - main_menu.print = PRINT_TEXT_T_CN; - main_menu.extrude = EXTRUDE_TEXT_T_CN; - main_menu.leveling = LEVELING_TEXT_T_CN; - main_menu.autoleveling = AUTO_LEVELING_TEXT_T_CN; - main_menu.fan = FAN_TEXT_T_CN; - main_menu.set = SET_TEXT_T_CN; - main_menu.more = MORE_TEXT_T_CN; - main_menu.tool = TOOL_TEXT_T_CN; - //TOOL - tool_menu.title = TOOL_TEXT_T_CN; - tool_menu.preheat = TOOL_PREHEAT_T_CN; - tool_menu.extrude = TOOL_EXTRUDE_T_CN; - tool_menu.move = TOOL_MOVE_T_CN; - tool_menu.home = TOOL_HOME_T_CN; - tool_menu.leveling = TOOL_LEVELING_T_CN; - tool_menu.autoleveling = TOOL_AUTO_LEVELING_T_CN; - tool_menu.filament = TOOL_FILAMENT_T_CN; - tool_menu.more = TOOL_MORE_T_CN; - // - preheat_menu.adjust_title = TITLE_ADJUST_T_CN; - preheat_menu.title = TITLE_PREHEAT_T_CN; - preheat_menu.add = ADD_TEXT_T_CN; - preheat_menu.dec = DEC_TEXT_T_CN; - preheat_menu.ext1 = EXTRUDER_1_TEXT_T_CN; - preheat_menu.ext2 = EXTRUDER_2_TEXT_T_CN; - preheat_menu.hotbed = HEATBED_TEXT_T_CN; - preheat_menu.off = CLOSE_TEXT_T_CN; - preheat_menu.value_state = TEXT_VALUE_T_CN; - preheat_menu.step_1c = TEXT_1C_T_CN; - preheat_menu.step_5c = TEXT_5C_T_CN; - preheat_menu.step_10c = TEXT_10C_T_CN; - // - move_menu.title = MOVE_TEXT_T_CN; - more_menu.zoffset = ZOFFSET_T_CN; - // - home_menu.title = TITLE_HOME_T_CN; - home_menu.stopmove = HOME_STOPMOVE_T_CN; - // - file_menu.title = TITLE_CHOOSEFILE_T_CN; - file_menu.page_up = PAGE_UP_TEXT_T_CN; - file_menu.page_down = PAGE_DOWN_TEXT_T_CN; - file_menu.file_loading = FILE_LOADING_T_CN; - file_menu.no_file = NO_FILE_T_CN; - file_menu.no_file_and_check = NO_FILE_T_CN;//NO_FILE_AND_CHECK_T_CN; - // - extrude_menu.title = TITLE_EXTRUDE_T_CN; - extrude_menu.in = EXTRUDER_IN_TEXT_T_CN; - extrude_menu.out = EXTRUDER_OUT_TEXT_T_CN; - extrude_menu.ext1 = EXTRUDER_1_TEXT_T_CN; - extrude_menu.ext2 = EXTRUDER_2_TEXT_T_CN; - extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_T_CN; - extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_T_CN; - extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_T_CN; - extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_T_CN; - extrude_menu.temp_value = EXTRUDE_TEXT_VALUE_T_T_CN; - // - leveling_menu.title = TITLE_LEVELING_CN; - leveling_menu.position1 = LEVELING_POINT1_TEXT_T_CN; - leveling_menu.position2 = LEVELING_POINT2_TEXT_T_CN; - leveling_menu.position3 = LEVELING_POINT3_TEXT_T_CN; - leveling_menu.position4 = LEVELING_POINT4_TEXT_T_CN; - leveling_menu.position5 = LEVELING_POINT5_TEXT_T_CN; - // - set_menu.title = TITLE_SET_T_CN; - set_menu.filesys = FILESYS_TEXT_T_CN; - set_menu.wifi = WIFI_TEXT_T_CN; - set_menu.about = ABOUT_TEXT_T_CN; - set_menu.fan = FAN_TEXT_T_CN; - set_menu.filament = FILAMENT_TEXT_T_CN; - set_menu.breakpoint = BREAK_POINT_TEXT_T_CN; - set_menu.motoroff = MOTOR_OFF_TEXT_T_CN; - set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_T_CN; - set_menu.language = LANGUAGE_TEXT_T_CN; - set_menu.shutdown = SHUTDOWN_TEXT_T_CN; - //set_menu.machine_para = MACHINE_PARA_T_CN; - // - filesys_menu.title = TITLE_FILESYS_T_CN; - filesys_menu.sd_sys = SD_CARD_TEXT_T_CN; - filesys_menu.usb_sys = U_DISK_TEXT_T_CN; - // - more_menu.title = TITLE_MORE_T_CN; - //WIFI - wifi_menu.title = WIFI_TEXT; - //wifi_menu.key = WIFI_KEY_TEXT_CN; - //wifi_menu.ip = WIFI_IP_TEXT_CN; - //wifi_menu.state = WIFI_STA_TEXT_CN; - wifi_menu.cloud = CLOUD_TEXT_T_CN; - wifi_menu.reconnect = WIFI_RECONNECT_TEXT_T_CN; - //CLOUD - cloud_menu.title = TITLE_CLOUD_TEXT_T_CN; - cloud_menu.bind = CLOUD_BINDED_T_CN; - cloud_menu.binded = CLOUD_BINDED_T_CN; - cloud_menu.unbind = CLOUD_UNBIND_T_CN; - cloud_menu.unbinding = CLOUD_UNBINDED_T_CN; - cloud_menu.disconnected = CLOUD_DISCONNECTED_T_CN; - cloud_menu.disable = CLOUD_DISABLE_T_CN; - // - about_menu.title = ABOUT_TEXT_T_CN; - about_menu.type = ABOUT_TYPE_TEXT_T_CN; - about_menu.version = ABOUT_VERSION_TEXT_T_CN; - about_menu.wifi = ABOUT_WIFI_TEXT_T_CN; - - // - fan_menu.title = FAN_TEXT_T_CN; - fan_menu.add = FAN_ADD_TEXT_T_CN; - fan_menu.dec = FAN_DEC_TEXT_T_CN; - fan_menu.state = FAN_TIPS1_TEXT_T_CN; - // - filament_menu.title = TITLE_FILAMENT_T_CN; - filament_menu.in = FILAMENT_IN_TEXT_T_CN; - filament_menu.out = FILAMENT_OUT_TEXT_T_CN; - filament_menu.ext1 = FILAMENT_EXT0_TEXT_T_CN; - filament_menu.ext2 = FILAMENT_EXT1_TEXT_T_CN; - filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_T_CN; - filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_T_CN; - filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_T_CN; - filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_T_CN; - filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_T_CN; - filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_T_CN; - filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_T_CN; - filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_T_CN; - filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_T_CN; - - - // - language_menu.title = TITLE_LANGUAGE_T_CN; - language_menu.next = PAGE_DOWN_TEXT_T_CN; - language_menu.up = PAGE_UP_TEXT_T_CN; - - // - printing_menu.title = TITLE_PRINTING_T_CN; - printing_menu.option = PRINTING_OPERATION_T_CN; - printing_menu.stop = PRINTING_STOP_T_CN; - printing_menu.pause = PRINTING_PAUSE_T_CN; - printing_menu.resume = PRINTING_RESUME_T_CN; - - // - operation_menu.title = TITLE_OPERATION_T_CN; - operation_menu.pause = PRINTING_PAUSE_T_CN; - operation_menu.stop = PRINTING_STOP_T_CN; - operation_menu.temp = PRINTING_TEMP_T_CN; - operation_menu.fan = FAN_TEXT_T_CN; - operation_menu.extr = PRINTING_EXTRUDER_T_CN; - operation_menu.speed = PRINTING_CHANGESPEED_T_CN; - operation_menu.filament = FILAMENT_TEXT_T_CN; - operation_menu.more = PRINTING_MORE_T_CN; - operation_menu.move = PRINTING_MOVE_T_CN; - operation_menu.auto_off = AUTO_SHUTDOWN_T_CN; - operation_menu.manual_off = MANUAL_SHUTDOWN_T_CN; - // - pause_menu.title = TITLE_PAUSE_T_CN; - pause_menu.resume = PRINTING_RESUME_T_CN; - pause_menu.stop = PRINTING_STOP_T_CN; - pause_menu.extrude = PRINTING_EXTRUDER_T_CN; - pause_menu.move = PRINTING_MOVE_T_CN; - pause_menu.filament = FILAMENT_TEXT_T_CN; - pause_menu.more = PRINTING_MORE_T_CN; - - // - speed_menu.title = PRINTING_CHANGESPEED_T_CN; - speed_menu.add = ADD_TEXT_T_CN; - speed_menu.dec = DEC_TEXT_T_CN; - speed_menu.move = MOVE_SPEED_T_CN; - speed_menu.extrude = EXTRUDER_SPEED_T_CN; - speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_T_CN; - speed_menu.move_speed = MOVE_SPEED_STATE_T_CN; - // - printing_more_menu.title = TITLE_MORE_T_CN; - printing_more_menu.fan = FAN_TEXT_T_CN; - printing_more_menu.auto_close = AUTO_SHUTDOWN_T_CN; - printing_more_menu.manual = MANUAL_SHUTDOWN_T_CN; - printing_more_menu.speed = PRINTING_CHANGESPEED_T_CN; - printing_more_menu.temp = PRINTING_TEMP_T_CN; + #if 1 + #if 1 + + case LANG_COMPLEX_CHINESE: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_T_CN; + common_menu.text_back = BACK_TEXT_T_CN; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_T_CN; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_T_CN; + common_menu.print_special_title = PRINTING_GBK; + common_menu.pause_special_title = PRINTING_PAUSE_GBK; + common_menu.operate_special_title = PRINTING_OPERATION_GBK; + // + main_menu.title = TITLE_READYPRINT_T_CN; + main_menu.preheat = PREHEAT_TEXT_T_CN; + main_menu.move = MOVE_TEXT_T_CN; + main_menu.home = HOME_TEXT_T_CN; + main_menu.print = PRINT_TEXT_T_CN; + main_menu.extrude = EXTRUDE_TEXT_T_CN; + main_menu.leveling = LEVELING_TEXT_T_CN; + main_menu.autoleveling = AUTO_LEVELING_TEXT_T_CN; + main_menu.fan = FAN_TEXT_T_CN; + main_menu.set = SET_TEXT_T_CN; + main_menu.more = MORE_TEXT_T_CN; + main_menu.tool = TOOL_TEXT_T_CN; + //TOOL + tool_menu.title = TOOL_TEXT_T_CN; + tool_menu.preheat = TOOL_PREHEAT_T_CN; + tool_menu.extrude = TOOL_EXTRUDE_T_CN; + tool_menu.move = TOOL_MOVE_T_CN; + tool_menu.home = TOOL_HOME_T_CN; + tool_menu.leveling = TOOL_LEVELING_T_CN; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_T_CN; + tool_menu.filament = TOOL_FILAMENT_T_CN; + tool_menu.more = TOOL_MORE_T_CN; + // + preheat_menu.adjust_title = TITLE_ADJUST_T_CN; + preheat_menu.title = TITLE_PREHEAT_T_CN; + preheat_menu.add = ADD_TEXT_T_CN; + preheat_menu.dec = DEC_TEXT_T_CN; + preheat_menu.ext1 = EXTRUDER_1_TEXT_T_CN; + preheat_menu.ext2 = EXTRUDER_2_TEXT_T_CN; + preheat_menu.hotbed = HEATBED_TEXT_T_CN; + preheat_menu.off = CLOSE_TEXT_T_CN; + preheat_menu.value_state = TEXT_VALUE_T_CN; + preheat_menu.step_1c = TEXT_1C_T_CN; + preheat_menu.step_5c = TEXT_5C_T_CN; + preheat_menu.step_10c = TEXT_10C_T_CN; + // + move_menu.title = MOVE_TEXT_T_CN; + more_menu.zoffset = ZOFFSET_T_CN; + // + home_menu.title = TITLE_HOME_T_CN; + home_menu.stopmove = HOME_STOPMOVE_T_CN; + // + file_menu.title = TITLE_CHOOSEFILE_T_CN; + file_menu.page_up = PAGE_UP_TEXT_T_CN; + file_menu.page_down = PAGE_DOWN_TEXT_T_CN; + file_menu.file_loading = FILE_LOADING_T_CN; + file_menu.no_file = NO_FILE_T_CN; + file_menu.no_file_and_check = NO_FILE_T_CN;//NO_FILE_AND_CHECK_T_CN; + // + extrude_menu.title = TITLE_EXTRUDE_T_CN; + extrude_menu.in = EXTRUDER_IN_TEXT_T_CN; + extrude_menu.out = EXTRUDER_OUT_TEXT_T_CN; + extrude_menu.ext1 = EXTRUDER_1_TEXT_T_CN; + extrude_menu.ext2 = EXTRUDER_2_TEXT_T_CN; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_T_CN; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_T_CN; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_T_CN; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_T_CN; + extrude_menu.temp_value = EXTRUDE_TEXT_VALUE_T_T_CN; + // + leveling_menu.title = TITLE_LEVELING_CN; + leveling_menu.position1 = LEVELING_POINT1_TEXT_T_CN; + leveling_menu.position2 = LEVELING_POINT2_TEXT_T_CN; + leveling_menu.position3 = LEVELING_POINT3_TEXT_T_CN; + leveling_menu.position4 = LEVELING_POINT4_TEXT_T_CN; + leveling_menu.position5 = LEVELING_POINT5_TEXT_T_CN; + // + set_menu.title = TITLE_SET_T_CN; + set_menu.filesys = FILESYS_TEXT_T_CN; + set_menu.wifi = WIFI_TEXT_T_CN; + set_menu.about = ABOUT_TEXT_T_CN; + set_menu.fan = FAN_TEXT_T_CN; + set_menu.filament = FILAMENT_TEXT_T_CN; + set_menu.breakpoint = BREAK_POINT_TEXT_T_CN; + set_menu.motoroff = MOTOR_OFF_TEXT_T_CN; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_T_CN; + set_menu.language = LANGUAGE_TEXT_T_CN; + set_menu.shutdown = SHUTDOWN_TEXT_T_CN; + //set_menu.machine_para = MACHINE_PARA_T_CN; + // + filesys_menu.title = TITLE_FILESYS_T_CN; + filesys_menu.sd_sys = SD_CARD_TEXT_T_CN; + filesys_menu.usb_sys = U_DISK_TEXT_T_CN; + // + more_menu.title = TITLE_MORE_T_CN; + //WIFI + wifi_menu.title = WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_CN; + //wifi_menu.ip = WIFI_IP_TEXT_CN; + //wifi_menu.state = WIFI_STA_TEXT_CN; + wifi_menu.cloud = CLOUD_TEXT_T_CN; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_T_CN; + //CLOUD + cloud_menu.title = TITLE_CLOUD_TEXT_T_CN; + cloud_menu.bind = CLOUD_BINDED_T_CN; + cloud_menu.binded = CLOUD_BINDED_T_CN; + cloud_menu.unbind = CLOUD_UNBIND_T_CN; + cloud_menu.unbinding = CLOUD_UNBINDED_T_CN; + cloud_menu.disconnected = CLOUD_DISCONNECTED_T_CN; + cloud_menu.disable = CLOUD_DISABLE_T_CN; + // + about_menu.title = ABOUT_TEXT_T_CN; + about_menu.type = ABOUT_TYPE_TEXT_T_CN; + about_menu.version = ABOUT_VERSION_TEXT_T_CN; + about_menu.wifi = ABOUT_WIFI_TEXT_T_CN; + + // + fan_menu.title = FAN_TEXT_T_CN; + fan_menu.add = FAN_ADD_TEXT_T_CN; + fan_menu.dec = FAN_DEC_TEXT_T_CN; + fan_menu.state = FAN_TIPS1_TEXT_T_CN; + // + filament_menu.title = TITLE_FILAMENT_T_CN; + filament_menu.in = FILAMENT_IN_TEXT_T_CN; + filament_menu.out = FILAMENT_OUT_TEXT_T_CN; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_T_CN; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_T_CN; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_T_CN; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_T_CN; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_T_CN; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_T_CN; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_T_CN; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_T_CN; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_T_CN; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_T_CN; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_T_CN; + + + // + language_menu.title = TITLE_LANGUAGE_T_CN; + language_menu.next = PAGE_DOWN_TEXT_T_CN; + language_menu.up = PAGE_UP_TEXT_T_CN; + + // + printing_menu.title = TITLE_PRINTING_T_CN; + printing_menu.option = PRINTING_OPERATION_T_CN; + printing_menu.stop = PRINTING_STOP_T_CN; + printing_menu.pause = PRINTING_PAUSE_T_CN; + printing_menu.resume = PRINTING_RESUME_T_CN; + + // + operation_menu.title = TITLE_OPERATION_T_CN; + operation_menu.pause = PRINTING_PAUSE_T_CN; + operation_menu.stop = PRINTING_STOP_T_CN; + operation_menu.temp = PRINTING_TEMP_T_CN; + operation_menu.fan = FAN_TEXT_T_CN; + operation_menu.extr = PRINTING_EXTRUDER_T_CN; + operation_menu.speed = PRINTING_CHANGESPEED_T_CN; + operation_menu.filament = FILAMENT_TEXT_T_CN; + operation_menu.more = PRINTING_MORE_T_CN; + operation_menu.move = PRINTING_MOVE_T_CN; + operation_menu.auto_off = AUTO_SHUTDOWN_T_CN; + operation_menu.manual_off = MANUAL_SHUTDOWN_T_CN; + // + pause_menu.title = TITLE_PAUSE_T_CN; + pause_menu.resume = PRINTING_RESUME_T_CN; + pause_menu.stop = PRINTING_STOP_T_CN; + pause_menu.extrude = PRINTING_EXTRUDER_T_CN; + pause_menu.move = PRINTING_MOVE_T_CN; + pause_menu.filament = FILAMENT_TEXT_T_CN; + pause_menu.more = PRINTING_MORE_T_CN; + + // + speed_menu.title = PRINTING_CHANGESPEED_T_CN; + speed_menu.add = ADD_TEXT_T_CN; + speed_menu.dec = DEC_TEXT_T_CN; + speed_menu.move = MOVE_SPEED_T_CN; + speed_menu.extrude = EXTRUDER_SPEED_T_CN; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_T_CN; + speed_menu.move_speed = MOVE_SPEED_STATE_T_CN; + // + printing_more_menu.title = TITLE_MORE_T_CN; + printing_more_menu.fan = FAN_TEXT_T_CN; + printing_more_menu.auto_close = AUTO_SHUTDOWN_T_CN; + printing_more_menu.manual = MANUAL_SHUTDOWN_T_CN; + printing_more_menu.speed = PRINTING_CHANGESPEED_T_CN; + printing_more_menu.temp = PRINTING_TEMP_T_CN; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_CN; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_T_CN; + print_file_dialog_menu.cancle = DIALOG_CANCLE_T_CN; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_T_CN; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_T_CN; + print_file_dialog_menu.retry = DIALOG_RETRY_T_CN; + print_file_dialog_menu.stop = DIALOG_STOP_T_CN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_T_CN; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_T_CN; + + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_T_CN; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_T_CN; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_T_CN; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_T_CN; + print_file_dialog_menu.reprint = DIALOG_REPRINT_T_CN; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_T_CN; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_T_CN; + zoffset_menu.inc = ZOFFSET_INC_T_CN; + zoffset_menu.dec = ZOFFSET_DEC_T_CN; + + pause_msg_menu.pausing = MESSEGE_PAUSING_T_CN; + pause_msg_menu.changing = MESSEGE_CHANGING_T_CN; + pause_msg_menu.unload = MESSEGE_UNLOAD_T_CN; + pause_msg_menu.waiting = MESSEGE_WAITING_T_CN; + pause_msg_menu.insert = MESSEGE_INSERT_T_CN; + pause_msg_menu.load = MESSEGE_LOAD_T_CN; + pause_msg_menu.purge = MESSEGE_PURGE_T_CN; + pause_msg_menu.resume = MESSEGE_RESUME_T_CN; + pause_msg_menu.heat = MESSEGE_HEAT_T_CN; + pause_msg_menu.heating = MESSEGE_HEATING_T_CN; + pause_msg_menu.option = MESSEGE_OPTION_T_CN; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_T_CN; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_T_CN; + break; + case LANG_ENGLISH: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_EN; + common_menu.text_back = BACK_TEXT_EN; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_EN; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_EN; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + // + main_menu.title = TITLE_READYPRINT_EN; + main_menu.preheat = PREHEAT_TEXT_EN; + main_menu.move = MOVE_TEXT_EN; + main_menu.home = HOME_TEXT_EN; + main_menu.print = PRINT_TEXT_EN; + main_menu.extrude = EXTRUDE_TEXT_EN; + main_menu.leveling = LEVELING_TEXT_EN; + main_menu.autoleveling = AUTO_LEVELING_TEXT_EN; + main_menu.fan = FAN_TEXT_EN; + main_menu.set = SET_TEXT_EN; + main_menu.more = MORE_TEXT_EN; + main_menu.tool = TOOL_TEXT_EN; + //TOOL + tool_menu.title = TOOL_TEXT_EN; + tool_menu.preheat = TOOL_PREHEAT_EN; + tool_menu.extrude = TOOL_EXTRUDE_EN; + tool_menu.move = TOOL_MOVE_EN; + tool_menu.home = TOOL_HOME_EN; + tool_menu.leveling = TOOL_LEVELING_EN; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_EN; + tool_menu.filament = TOOL_FILAMENT_EN; + tool_menu.more = TOOL_MORE_EN; + // + preheat_menu.adjust_title = TITLE_ADJUST_EN; + preheat_menu.title = TITLE_PREHEAT_EN; + preheat_menu.add = ADD_TEXT_EN; + preheat_menu.dec = DEC_TEXT_EN; + preheat_menu.ext1 = EXTRUDER_1_TEXT_EN; + preheat_menu.ext2 = EXTRUDER_2_TEXT_EN; + preheat_menu.hotbed = HEATBED_TEXT_EN; + preheat_menu.off = CLOSE_TEXT_EN; + // + move_menu.title = TITLE_MOVE_EN; + // + home_menu.title = TITLE_HOME_EN; + home_menu.stopmove = HOME_STOPMOVE_EN; + // + file_menu.title = TITLE_CHOOSEFILE_EN; + file_menu.page_up = PAGE_UP_TEXT_EN; + file_menu.page_down = PAGE_DOWN_TEXT_EN; + file_menu.file_loading = FILE_LOADING_EN; + file_menu.no_file = NO_FILE_EN; + file_menu.no_file_and_check = NO_FILE_EN;//NO_FILE_AND_CHECK_EN; + // + extrude_menu.title = TITLE_EXTRUDE_EN; + extrude_menu.in = EXTRUDER_IN_TEXT_EN; + extrude_menu.out = EXTRUDER_OUT_TEXT_EN; + extrude_menu.ext1 = EXTRUDER_1_TEXT_EN; + extrude_menu.ext2 = EXTRUDER_2_TEXT_EN; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_EN; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_EN; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_EN; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_EN; + // + leveling_menu.title = TITLE_LEVELING_EN; + leveling_menu.position1 = LEVELING_POINT1_TEXT_EN; + leveling_menu.position2 = LEVELING_POINT2_TEXT_EN; + leveling_menu.position3 = LEVELING_POINT3_TEXT_EN; + leveling_menu.position4 = LEVELING_POINT4_TEXT_EN; + leveling_menu.position5 = LEVELING_POINT5_TEXT_EN; + // + set_menu.title = TITLE_SET_EN; + set_menu.filesys = FILESYS_TEXT_EN; + set_menu.wifi = WIFI_TEXT_EN; + set_menu.about = ABOUT_TEXT_EN; + set_menu.fan = FAN_TEXT_EN; + set_menu.filament = FILAMENT_TEXT_EN; + set_menu.breakpoint = BREAK_POINT_TEXT_EN; + set_menu.motoroff = MOTOR_OFF_TEXT_EN; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_EN; + set_menu.language = LANGUAGE_TEXT_EN; + set_menu.shutdown = SHUTDOWN_TEXT_EN; + //set_menu.machine_para = MACHINE_PARA_EN; + // + more_menu.title = TITLE_MORE_EN; + more_menu.zoffset = ZOFFSET_EN; + // + filesys_menu.title = TITLE_FILESYS_EN; + filesys_menu.sd_sys = SD_CARD_TEXT_EN; + filesys_menu.usb_sys = U_DISK_TEXT_EN; + //WIFI + wifi_menu.title = WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_EN; + //wifi_menu.ip = WIFI_IP_TEXT_EN; + //wifi_menu.state = WIFI_STA_TEXT_EN; + wifi_menu.cloud = CLOUD_TEXT_EN; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_EN; + + cloud_menu.title = TITLE_CLOUD_TEXT_EN; + cloud_menu.bind = CLOUD_BINDED_EN; + cloud_menu.binded = CLOUD_BINDED_EN; + cloud_menu.unbind = CLOUD_UNBIND_EN; + cloud_menu.unbinding = CLOUD_UNBINDED_EN; + cloud_menu.disconnected = CLOUD_DISCONNECTED_EN; + cloud_menu.disable = CLOUD_DISABLE_EN; + // + about_menu.title = TITLE_ABOUT_EN; + about_menu.type = ABOUT_TYPE_TEXT_EN; + about_menu.version = ABOUT_VERSION_TEXT_EN; + about_menu.wifi = ABOUT_WIFI_TEXT_EN; + // + fan_menu.title = TITLE_FAN_EN; + fan_menu.add = FAN_ADD_TEXT_EN; + fan_menu.dec = FAN_DEC_TEXT_EN; + fan_menu.state = FAN_TIPS1_TEXT_EN; + // + filament_menu.title = TITLE_FILAMENT_EN; + filament_menu.in = FILAMENT_IN_TEXT_EN; + filament_menu.out = FILAMENT_OUT_TEXT_EN; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_EN; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_EN; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_EN; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_EN; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_EN; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN; + + // + language_menu.title = TITLE_LANGUAGE_EN; + language_menu.next = PAGE_DOWN_TEXT_EN; + language_menu.up = PAGE_UP_TEXT_EN; + // + printing_menu.title = TITLE_PRINTING_EN; + printing_menu.option = PRINTING_OPERATION_EN; + printing_menu.stop = PRINTING_STOP_EN; + printing_menu.pause = PRINTING_PAUSE_EN; + printing_menu.resume = PRINTING_RESUME_EN; + + // + operation_menu.title = TITLE_OPERATION_EN; + operation_menu.pause = PRINTING_PAUSE_EN; + operation_menu.stop = PRINTING_STOP_EN; + operation_menu.temp = PRINTING_TEMP_EN; + operation_menu.fan = FAN_TEXT_EN; + operation_menu.extr = PRINTING_EXTRUDER_EN; + operation_menu.speed = PRINTING_CHANGESPEED_EN; + operation_menu.filament = FILAMENT_TEXT_EN; + operation_menu.more = PRINTING_MORE_EN; + operation_menu.move = PRINTING_MOVE_EN; + operation_menu.auto_off = AUTO_SHUTDOWN_EN; + operation_menu.manual_off = MANUAL_SHUTDOWN_EN; + // + pause_menu.title = TITLE_PAUSE_EN; + pause_menu.resume = PRINTING_RESUME_EN; + pause_menu.stop = PRINTING_STOP_EN; + pause_menu.extrude = PRINTING_EXTRUDER_EN; + pause_menu.move = PRINTING_MOVE_EN; + pause_menu.filament = FILAMENT_TEXT_EN; + pause_menu.more = PRINTING_MORE_EN; + + // + speed_menu.title = TITLE_CHANGESPEED_EN; + speed_menu.add = ADD_TEXT_EN; + speed_menu.dec = DEC_TEXT_EN; + speed_menu.move = MOVE_SPEED_EN; + speed_menu.extrude = EXTRUDER_SPEED_EN; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_EN; + speed_menu.move_speed = MOVE_SPEED_STATE_EN; + // + printing_more_menu.title = TITLE_MORE_EN; + printing_more_menu.fan = FAN_TEXT_EN; + printing_more_menu.auto_close = AUTO_SHUTDOWN_EN; + printing_more_menu.manual = MANUAL_SHUTDOWN_EN; + printing_more_menu.speed = PRINTING_CHANGESPEED_EN; + printing_more_menu.temp = PRINTING_TEMP_EN; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_EN; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_EN; + print_file_dialog_menu.cancle = DIALOG_CANCLE_EN; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_EN; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; + print_file_dialog_menu.retry = DIALOG_RETRY_EN; + print_file_dialog_menu.stop = DIALOG_STOP_EN; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_EN; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_EN; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_EN; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_EN; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_EN; + print_file_dialog_menu.reprint = DIALOG_REPRINT_EN; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_EN; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_EN; + zoffset_menu.inc = ZOFFSET_INC_EN; + zoffset_menu.dec = ZOFFSET_DEC_EN; + + pause_msg_menu.pausing = MESSEGE_PAUSING_EN; + pause_msg_menu.changing = MESSEGE_CHANGING_EN; + pause_msg_menu.unload = MESSEGE_UNLOAD_EN; + pause_msg_menu.waiting = MESSEGE_WAITING_EN; + pause_msg_menu.insert = MESSEGE_INSERT_EN; + pause_msg_menu.load = MESSEGE_LOAD_EN; + pause_msg_menu.purge = MESSEGE_PURGE_EN; + pause_msg_menu.resume = MESSEGE_RESUME_EN; + pause_msg_menu.heat = MESSEGE_HEAT_EN; + pause_msg_menu.heating = MESSEGE_HEATING_EN; + pause_msg_menu.option = MESSEGE_OPTION_EN; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_EN; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_EN; + break; + case LANG_RUSSIAN: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_RU; + common_menu.text_back = BACK_TEXT_RU; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_RU; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_RU; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + // + main_menu.title = TITLE_READYPRINT_RU; + main_menu.preheat = PREHEAT_TEXT_RU; + main_menu.move = MOVE_TEXT_RU; + main_menu.home = HOME_TEXT_RU; + main_menu.print = PRINT_TEXT_RU; + main_menu.extrude = EXTRUDE_TEXT_RU; + main_menu.leveling = LEVELING_TEXT_RU; + main_menu.autoleveling = AUTO_LEVELING_TEXT_RU; + main_menu.fan = FAN_TEXT_RU; + main_menu.set = SET_TEXT_RU; + main_menu.more = MORE_TEXT_RU; + main_menu.tool = TOOL_TEXT_RU; + //TOOL + tool_menu.title = TOOL_TEXT_RU; + tool_menu.preheat = TOOL_PREHEAT_RU; + tool_menu.extrude = TOOL_EXTRUDE_RU; + tool_menu.move = TOOL_MOVE_RU; + tool_menu.home = TOOL_HOME_RU; + tool_menu.leveling = TOOL_LEVELING_RU; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_RU; + tool_menu.filament = TOOL_FILAMENT_RU; + tool_menu.more = TOOL_MORE_RU; + // + preheat_menu.adjust_title = TITLE_ADJUST_RU; + preheat_menu.title = TITLE_PREHEAT_RU; + preheat_menu.add = ADD_TEXT_RU; + preheat_menu.dec = DEC_TEXT_RU; + preheat_menu.ext1 = EXTRUDER_1_TEXT_RU; + preheat_menu.ext2 = EXTRUDER_2_TEXT_RU; + preheat_menu.hotbed = HEATBED_TEXT_RU; + preheat_menu.off = CLOSE_TEXT_RU; + // + move_menu.title = MOVE_TEXT_RU; + // + home_menu.title = TITLE_HOME_RU; + home_menu.stopmove = HOME_STOPMOVE_RU; + // + file_menu.title = TITLE_CHOOSEFILE_RU; + file_menu.page_up = PAGE_UP_TEXT_RU; + file_menu.page_down = PAGE_DOWN_TEXT_RU; + file_menu.file_loading = FILE_LOADING_RU; + file_menu.no_file = NO_FILE_RU; + file_menu.no_file_and_check = NO_FILE_RU;//NO_FILE_AND_CHECK_RU; + // + extrude_menu.title = TITLE_EXTRUDE_RU; + extrude_menu.in = EXTRUDER_IN_TEXT_RU; + extrude_menu.out = EXTRUDER_OUT_TEXT_RU; + extrude_menu.ext1 = EXTRUDER_1_TEXT_RU; + extrude_menu.ext2 = EXTRUDER_2_TEXT_RU; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_RU; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_RU; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_RU; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_RU; + // + leveling_menu.title = TITLE_LEVELING_RU; + leveling_menu.position1 = LEVELING_POINT1_TEXT_RU; + leveling_menu.position2 = LEVELING_POINT2_TEXT_RU; + leveling_menu.position3 = LEVELING_POINT3_TEXT_RU; + leveling_menu.position4 = LEVELING_POINT4_TEXT_RU; + leveling_menu.position5 = LEVELING_POINT5_TEXT_RU; + // + set_menu.title = TITLE_SET_RU; + set_menu.filesys = FILESYS_TEXT_RU; + set_menu.wifi = WIFI_TEXT_RU; + set_menu.about = ABOUT_TEXT_RU; + set_menu.fan = FAN_TEXT_RU; + set_menu.filament = FILAMENT_TEXT_RU; + set_menu.breakpoint = BREAK_POINT_TEXT_RU; + set_menu.motoroff = MOTOR_OFF_TEXT_RU; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_RU; + set_menu.language = LANGUAGE_TEXT_RU; + set_menu.shutdown = SHUTDOWN_TEXT_RU; + // + more_menu.title = TITLE_MORE_RU; + more_menu.zoffset = ZOFFSET_RU; + // + filesys_menu.title = TITLE_FILESYS_RU; + filesys_menu.sd_sys = SD_CARD_TEXT_RU; + filesys_menu.usb_sys = U_DISK_TEXT_RU; + //WIFI + wifi_menu.title = WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_RU; + //wifi_menu.ip = WIFI_IP_TEXT_RU; + //wifi_menu.state = WIFI_STA_TEXT_RU; + wifi_menu.cloud = CLOUD_TEXT_RU; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_RU; + + + cloud_menu.title = TITLE_CLOUD_TEXT_RU; + cloud_menu.bind = CLOUD_BINDED_RU; + cloud_menu.binded = CLOUD_BINDED_RU; + cloud_menu.unbind = CLOUD_UNBIND_RU; + cloud_menu.unbinding = CLOUD_UNBINDED_RU; + cloud_menu.disconnected = CLOUD_DISCONNECTED_RU; + cloud_menu.disable = CLOUD_DISABLE_RU; + // + about_menu.title = ABOUT_TEXT_RU; + about_menu.type = ABOUT_TYPE_TEXT_RU; + about_menu.version = ABOUT_VERSION_TEXT_RU; + about_menu.wifi = ABOUT_WIFI_TEXT_RU; + // + fan_menu.title = FAN_TEXT_RU; + fan_menu.add = FAN_ADD_TEXT_RU; + fan_menu.dec = FAN_DEC_TEXT_RU; + fan_menu.state = FAN_TIPS1_TEXT_RU; + // + filament_menu.title = TITLE_FILAMENT_RU; + filament_menu.in = FILAMENT_IN_TEXT_RU; + filament_menu.out = FILAMENT_OUT_TEXT_RU; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_RU; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_RU; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_RU; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_RU; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_RU; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU; + + // + language_menu.title = LANGUAGE_TEXT_RU; + language_menu.next = PAGE_DOWN_TEXT_RU; + language_menu.up = PAGE_UP_TEXT_RU; + // + printing_menu.title = TITLE_PRINTING_RU; + printing_menu.option = PRINTING_OPERATION_RU; + printing_menu.stop = PRINTING_STOP_RU; + printing_menu.pause = PRINTING_PAUSE_RU; + printing_menu.resume = PRINTING_RESUME_RU; + + // + operation_menu.title = TITLE_OPERATION_RU; + operation_menu.pause = PRINTING_PAUSE_RU; + operation_menu.stop = PRINTING_STOP_RU; + operation_menu.temp = PRINTING_TEMP_RU; + operation_menu.fan = FAN_TEXT_RU; + operation_menu.extr = PRINTING_EXTRUDER_RU; + operation_menu.speed = PRINTING_CHANGESPEED_RU; + operation_menu.filament = FILAMENT_TEXT_RU; + operation_menu.more = PRINTING_MORE_RU; + operation_menu.move = PRINTING_MOVE_RU; + operation_menu.auto_off = AUTO_SHUTDOWN_RU; + operation_menu.manual_off = MANUAL_SHUTDOWN_RU; + // + pause_menu.title = TITLE_PAUSE_RU; + pause_menu.resume = PRINTING_RESUME_RU; + pause_menu.stop = PRINTING_STOP_RU; + pause_menu.extrude = PRINTING_EXTRUDER_RU; + pause_menu.move = PRINTING_MOVE_RU; + pause_menu.filament = FILAMENT_TEXT_RU; + pause_menu.more = PRINTING_MORE_RU; + + // + speed_menu.title = PRINTING_CHANGESPEED_RU; + speed_menu.add = ADD_TEXT_RU; + speed_menu.dec = DEC_TEXT_RU; + speed_menu.move = MOVE_SPEED_RU; + speed_menu.extrude = EXTRUDER_SPEED_RU; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_RU; + speed_menu.move_speed = MOVE_SPEED_STATE_RU; + // + printing_more_menu.title = TITLE_MORE_RU; + printing_more_menu.fan = FAN_TEXT_RU; + printing_more_menu.auto_close = AUTO_SHUTDOWN_RU; + printing_more_menu.manual = MANUAL_SHUTDOWN_RU; + printing_more_menu.speed = PRINTING_CHANGESPEED_RU; + printing_more_menu.temp = PRINTING_TEMP_RU; + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_RU; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_RU; + print_file_dialog_menu.cancle = DIALOG_CANCLE_RU; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_RU; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_RU; + print_file_dialog_menu.retry = DIALOG_RETRY_RU; + print_file_dialog_menu.stop = DIALOG_STOP_RU; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_RU; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_RU; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_RU; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_RU; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_RU; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_RU; + print_file_dialog_menu.reprint = DIALOG_REPRINT_RU; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_RU; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_RU; + zoffset_menu.inc = ZOFFSET_INC_RU; + zoffset_menu.dec = ZOFFSET_DEC_RU; + + pause_msg_menu.pausing = MESSEGE_PAUSING_RU; + pause_msg_menu.changing = MESSEGE_CHANGING_RU; + pause_msg_menu.unload = MESSEGE_UNLOAD_RU; + pause_msg_menu.waiting = MESSEGE_WAITING_RU; + pause_msg_menu.insert = MESSEGE_INSERT_RU; + pause_msg_menu.load = MESSEGE_LOAD_RU; + pause_msg_menu.purge = MESSEGE_PURGE_RU; + pause_msg_menu.resume = MESSEGE_RESUME_RU; + pause_msg_menu.heat = MESSEGE_HEAT_RU; + pause_msg_menu.heating = MESSEGE_HEATING_RU; + pause_msg_menu.option = MESSEGE_OPTION_RU; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_RU; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_RU; + break; + case LANG_SPANISH: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_SP; + common_menu.text_back = BACK_TEXT_SP; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_SP; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_SP; + common_menu.print_special_title = PRINTING_SP; + common_menu.pause_special_title = PRINTING_PAUSAR_SP; + common_menu.operate_special_title = PRINTING_AJUSTES_SP; + // + main_menu.title = TITLE_READYPRINT_SP; + main_menu.preheat = PREHEAT_TEXT_SP; + main_menu.move = MOVE_TEXT_SP; + main_menu.home = HOME_TEXT_SP; + main_menu.print = PRINT_TEXT_SP; + main_menu.extrude = EXTRUDE_TEXT_SP; + main_menu.leveling = LEVELING_TEXT_SP; + main_menu.autoleveling = AUTO_LEVELING_TEXT_SP; + main_menu.fan = FAN_TEXT_SP; + main_menu.set = SET_TEXT_SP; + main_menu.more = MORE_TEXT_SP; + main_menu.tool = TOOL_TEXT_SP; + //TOOL + tool_menu.title = TOOL_TEXT_SP; + tool_menu.preheat = TOOL_PREHEAT_SP; + tool_menu.extrude = TOOL_EXTRUDE_SP; + tool_menu.move = TOOL_MOVE_SP; + tool_menu.home = TOOL_HOME_SP; + tool_menu.leveling = TOOL_LEVELING_SP; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_SP; + tool_menu.filament = TOOL_FILAMENT_SP; + tool_menu.more = TOOL_MORE_SP; + // + preheat_menu.adjust_title = TITLE_ADJUST_SP; + preheat_menu.title = TITLE_PREHEAT_SP; + preheat_menu.add = ADD_TEXT_SP; + preheat_menu.dec = DEC_TEXT_SP; + preheat_menu.ext1 = EXTRUDER_1_TEXT_SP; + preheat_menu.ext2 = EXTRUDER_2_TEXT_SP; + preheat_menu.hotbed = HEATBED_TEXT_SP; + preheat_menu.off = CLOSE_TEXT_SP; + // + move_menu.title = MOVE_TEXT_SP; + // + home_menu.title = TITLE_HOME_SP; + home_menu.home_x = HOME_X_TEXT_SP; + home_menu.home_y = HOME_Y_TEXT_SP; + home_menu.home_z = HOME_Z_TEXT_SP; + home_menu.home_all = HOME_ALL_TEXT_SP; + home_menu.stopmove = HOME_STOPMOVE_SP; + // + file_menu.title = TITLE_CHOOSEFILE_SP; + file_menu.page_up = PAGE_UP_TEXT_SP; + file_menu.page_down = PAGE_DOWN_TEXT_SP; + file_menu.file_loading = FILE_LOADING_SP; + file_menu.no_file = NO_FILE_SP; + file_menu.no_file_and_check = NO_FILE_SP;//NO_FILE_AND_CHECK_SP; + // + extrude_menu.title = TITLE_EXTRUDE_SP; + extrude_menu.in = EXTRUDER_IN_TEXT_SP; + extrude_menu.out = EXTRUDER_OUT_TEXT_SP; + extrude_menu.ext1 = EXTRUDER_1_TEXT_SP; + extrude_menu.ext2 = EXTRUDER_2_TEXT_SP; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_SP; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_SP; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_SP; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_SP; + // + leveling_menu.title = TITLE_LEVELING_SP; + leveling_menu.position1 = LEVELING_POINT1_TEXT_SP; + leveling_menu.position2 = LEVELING_POINT2_TEXT_SP; + leveling_menu.position3 = LEVELING_POINT3_TEXT_SP; + leveling_menu.position4 = LEVELING_POINT4_TEXT_SP; + leveling_menu.position5 = LEVELING_POINT5_TEXT_SP; + // + set_menu.title = TITLE_SET_SP; + set_menu.filesys = FILESYS_TEXT_SP; + set_menu.wifi = WIFI_TEXT_SP; + set_menu.about = ABOUT_TEXT_SP; + set_menu.fan = FAN_TEXT_SP; + set_menu.filament = FILAMENT_TEXT_SP; + set_menu.breakpoint = BREAK_POINT_TEXT_SP; + set_menu.motoroff = MOTOR_OFF_TEXT_SP; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_SP; + set_menu.language = LANGUAGE_TEXT_SP; + set_menu.shutdown = SHUTDOWN_TEXT_SP; + // + more_menu.title = TITLE_MORE_SP; + more_menu.zoffset = ZOFFSET_SP; + // + filesys_menu.title = TITLE_FILESYS_SP; + filesys_menu.sd_sys = SD_CARD_TEXT_SP; + filesys_menu.usb_sys = U_DISK_TEXT_SP; + + //WIFI + wifi_menu.title = WIFI_TEXT; + //wifi_menu.key = WIFI_KEY_TEXT_SP; + //wifi_menu.ip = WIFI_IP_TEXT_SP; + //wifi_menu.state = WIFI_STA_TEXT_SP; + wifi_menu.cloud = CLOUD_TEXT_SP; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_SP; + + cloud_menu.title = TITLE_CLOUD_TEXT_SP; + cloud_menu.bind = CLOUD_BINDED_SP; + cloud_menu.binded = CLOUD_BINDED_SP; + cloud_menu.unbind = CLOUD_UNBIND_SP; + cloud_menu.unbinding = CLOUD_UNBINDED_SP; + cloud_menu.disconnected = CLOUD_DISCONNECTED_SP; + cloud_menu.disable = CLOUD_DISABLE_SP; + // + about_menu.title = ABOUT_TEXT_SP; + about_menu.type = ABOUT_TYPE_TEXT_SP; + about_menu.version = ABOUT_VERSION_TEXT_SP; + about_menu.wifi = ABOUT_WIFI_TEXT_SP; + // + fan_menu.title = FAN_TEXT_SP; + fan_menu.add = FAN_ADD_TEXT_SP; + fan_menu.dec = FAN_DEC_TEXT_SP; + fan_menu.state = FAN_TIPS1_TEXT_SP; + // + filament_menu.title = TITLE_FILAMENT_SP; + filament_menu.in = FILAMENT_IN_TEXT_SP; + filament_menu.out = FILAMENT_OUT_TEXT_SP; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_SP; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_SP; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_SP; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_SP; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_SP; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP; + + // + language_menu.title = LANGUAGE_TEXT_SP; + language_menu.next = PAGE_DOWN_TEXT_SP; + language_menu.up = PAGE_UP_TEXT_SP; + // + printing_menu.title = TITLE_PRINTING_SP; + printing_menu.option = PRINTING_OPERATION_SP; + printing_menu.stop = PRINTING_STOP_SP; + printing_menu.pause = PRINTING_PAUSE_SP; + printing_menu.resume = PRINTING_RESUME_SP; + + // + operation_menu.title = TITLE_OPERATION_SP; + operation_menu.pause = PRINTING_PAUSE_SP; + operation_menu.stop = PRINTING_STOP_SP; + operation_menu.temp = PRINTING_TEMP_SP; + operation_menu.fan = FAN_TEXT_SP; + operation_menu.extr = PRINTING_EXTRUDER_SP; + operation_menu.speed = PRINTING_CHANGESPEED_SP; + operation_menu.filament = FILAMENT_TEXT_SP; + operation_menu.more = PRINTING_MORE_SP; + operation_menu.move = PRINTING_MOVE_SP; + operation_menu.auto_off = AUTO_SHUTDOWN_SP; + operation_menu.manual_off = MANUAL_SHUTDOWN_SP; + // + pause_menu.title = TITLE_PAUSE_RU; + pause_menu.resume = PRINTING_RESUME_SP; + pause_menu.stop = PRINTING_STOP_SP; + pause_menu.extrude = PRINTING_EXTRUDER_SP; + pause_menu.move = PRINTING_MOVE_SP; + pause_menu.filament = FILAMENT_TEXT_SP; + pause_menu.more = PRINTING_MORE_SP; + + // + speed_menu.title = PRINTING_CHANGESPEED_SP; + speed_menu.add = ADD_TEXT_SP; + speed_menu.dec = DEC_TEXT_SP; + speed_menu.move = MOVE_SPEED_SP; + speed_menu.extrude = EXTRUDER_SPEED_SP; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_SP; + speed_menu.move_speed = MOVE_SPEED_STATE_SP; + // + printing_more_menu.title = TITLE_MORE_SP; + printing_more_menu.fan = FAN_TEXT_SP; + printing_more_menu.auto_close = AUTO_SHUTDOWN_SP; + printing_more_menu.manual = MANUAL_SHUTDOWN_SP; + printing_more_menu.speed = PRINTING_CHANGESPEED_SP; + printing_more_menu.temp = PRINTING_TEMP_SP; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_SP; + print_file_dialog_menu.cancle = DIALOG_CANCLE_SP; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_SP; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_SP; + print_file_dialog_menu.retry = DIALOG_RETRY_SP; + print_file_dialog_menu.stop = DIALOG_STOP_SP; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_SP; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_SP; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_SP; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_SP; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_SP; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_SP; + print_file_dialog_menu.reprint = DIALOG_REPRINT_SP; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_SP; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_SP; + zoffset_menu.inc = ZOFFSET_INC_SP; + zoffset_menu.dec = ZOFFSET_DEC_SP; + + pause_msg_menu.pausing = MESSEGE_PAUSING_SP; + pause_msg_menu.changing = MESSEGE_CHANGING_SP; + pause_msg_menu.unload = MESSEGE_UNLOAD_SP; + pause_msg_menu.waiting = MESSEGE_WAITING_SP; + pause_msg_menu.insert = MESSEGE_INSERT_SP; + pause_msg_menu.load = MESSEGE_LOAD_SP; + pause_msg_menu.purge = MESSEGE_PURGE_SP; + pause_msg_menu.resume = MESSEGE_RESUME_SP; + pause_msg_menu.heat = MESSEGE_HEAT_SP; + pause_msg_menu.heating = MESSEGE_HEATING_SP; + pause_msg_menu.option = MESSEGE_OPTION_SP; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_SP; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_SP; + break; + + #endif + + case LANG_FRENCH: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_FR; + common_menu.text_back = BACK_TEXT_FR; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_FR; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_FR; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + + // + main_menu.title = TITLE_READYPRINT_FR; + main_menu.preheat = PREHEAT_TEXT_FR; + main_menu.move = MOVE_TEXT_FR; + main_menu.home = HOME_TEXT_FR; + main_menu.print = PRINT_TEXT_FR; + main_menu.extrude = EXTRUDE_TEXT_FR; + main_menu.leveling = LEVELING_TEXT_FR; + main_menu.autoleveling = AUTO_LEVELING_TEXT_FR; + main_menu.fan = FAN_TEXT_FR; + main_menu.set = SET_TEXT_FR; + main_menu.more = MORE_TEXT_FR; + main_menu.tool = TOOL_TEXT_FR; + //TOOL + tool_menu.title = TOOL_TEXT_FR; + tool_menu.preheat = TOOL_PREHEAT_FR; + tool_menu.extrude = TOOL_EXTRUDE_FR; + tool_menu.move = TOOL_MOVE_FR; + tool_menu.home = TOOL_HOME_FR; + tool_menu.leveling = TOOL_LEVELING_FR; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_FR; + tool_menu.filament = TOOL_FILAMENT_FR; + tool_menu.more = TOOL_MORE_FR; + // + preheat_menu.adjust_title = TITLE_ADJUST_FR; + preheat_menu.title = TITLE_PREHEAT_FR; + preheat_menu.add = ADD_TEXT_FR; + preheat_menu.dec = DEC_TEXT_FR; + preheat_menu.ext1 = EXTRUDER_1_TEXT_FR; + preheat_menu.ext2 = EXTRUDER_2_TEXT_FR; + preheat_menu.hotbed = HEATBED_TEXT_FR; + preheat_menu.off = CLOSE_TEXT_FR; + // + move_menu.title = MOVE_TEXT_FR; + // + home_menu.title = TITLE_HOME_FR; + home_menu.stopmove = HOME_STOPMOVE_FR; + // + file_menu.title = TITLE_CHOOSEFILE_FR; + file_menu.page_up = PAGE_UP_TEXT_FR; + file_menu.page_down = PAGE_DOWN_TEXT_FR; + // + extrude_menu.title = TITLE_EXTRUDE_FR; + extrude_menu.in = EXTRUDER_IN_TEXT_FR; + extrude_menu.out = EXTRUDER_OUT_TEXT_FR; + extrude_menu.ext1 = EXTRUDER_1_TEXT_FR; + extrude_menu.ext2 = EXTRUDER_2_TEXT_FR; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_FR; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_FR; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_FR; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_FR; + // + leveling_menu.title = TITLE_LEVELING_FR; + leveling_menu.position1 = LEVELING_POINT1_TEXT_FR; + leveling_menu.position2 = LEVELING_POINT2_TEXT_FR; + leveling_menu.position3 = LEVELING_POINT3_TEXT_FR; + leveling_menu.position4 = LEVELING_POINT4_TEXT_FR; + leveling_menu.position5 = LEVELING_POINT5_TEXT_FR; + // + set_menu.title = TITLE_SET_FR; + set_menu.filesys = FILESYS_TEXT_FR; + set_menu.wifi = WIFI_TEXT_FR; + set_menu.about = ABOUT_TEXT_FR; + set_menu.fan = FAN_TEXT_FR; + set_menu.filament = FILAMENT_TEXT_FR; + set_menu.breakpoint = BREAK_POINT_TEXT_FR; + set_menu.motoroff = MOTOR_OFF_TEXT_FR; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_FR; + set_menu.language = LANGUAGE_TEXT_FR; + set_menu.shutdown = SHUTDOWN_TEXT_FR; + // + more_menu.title = TITLE_MORE_FR; + more_menu.zoffset = ZOFFSET_FR; + // + filesys_menu.title = TITLE_FILESYS_FR; + filesys_menu.sd_sys = SD_CARD_TEXT_FR; + filesys_menu.usb_sys = U_DISK_TEXT_FR; + file_menu.file_loading = FILE_LOADING_FR; + file_menu.no_file = NO_FILE_FR; + file_menu.no_file_and_check = NO_FILE_FR;//NO_FILE_AND_CHECK_FR; + //WIFI + wifi_menu.title = WIFI_NAME_TEXT_FR; + //wifi_menu.key = WIFI_KEY_TEXT_FR; + //wifi_menu.ip = WIFI_IP_TEXT_FR; + //wifi_menu.state = WIFI_STA_TEXT_FR; + //wifi_menu.cloud = CLOSE_TEXT_FR; + wifi_menu.cloud = CLOUD_TEXT_FR; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_FR; + + cloud_menu.title = TITLE_CLOUD_TEXT_FR; + cloud_menu.bind = CLOUD_BINDED_FR; + cloud_menu.binded = CLOUD_BINDED_FR; + cloud_menu.unbind = CLOUD_UNBIND_FR; + cloud_menu.unbinding = CLOUD_UNBINDED_FR; + cloud_menu.disconnected = CLOUD_DISCONNECTED_FR; + cloud_menu.disable = CLOUD_DISABLE_FR; + // + about_menu.title = ABOUT_TEXT_FR; + about_menu.type = ABOUT_TYPE_TEXT_FR; + about_menu.version = ABOUT_VERSION_TEXT_FR; + about_menu.wifi = ABOUT_WIFI_TEXT_FR; + // + fan_menu.title = FAN_TEXT_FR; + fan_menu.add = FAN_ADD_TEXT_FR; + fan_menu.dec = FAN_DEC_TEXT_FR; + fan_menu.state = FAN_TIPS1_TEXT_FR; + // + filament_menu.title = TITLE_FILAMENT_FR; + filament_menu.in = FILAMENT_IN_TEXT_FR; + filament_menu.out = FILAMENT_OUT_TEXT_FR; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_FR; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_FR; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_FR; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_FR; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_FR; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR; + + // + language_menu.title = LANGUAGE_TEXT_FR; + + // + printing_menu.title = TITLE_PRINTING_FR; + printing_menu.option = PRINTING_OPERATION_FR; + printing_menu.stop = PRINTING_STOP_FR; + printing_menu.pause = PRINTING_PAUSE_FR; + printing_menu.resume = PRINTING_RESUME_FR; + + // + operation_menu.title = TITLE_OPERATION_FR; + operation_menu.pause = PRINTING_PAUSE_FR; + operation_menu.stop = PRINTING_STOP_FR; + operation_menu.temp = PRINTING_TEMP_FR; + operation_menu.fan = FAN_TEXT_FR; + operation_menu.extr = PRINTING_EXTRUDER_FR; + operation_menu.speed = PRINTING_CHANGESPEED_FR; + operation_menu.filament = FILAMENT_TEXT_FR; + operation_menu.more = PRINTING_MORE_FR; + operation_menu.move = PRINTING_MOVE_FR; + operation_menu.auto_off = AUTO_SHUTDOWN_FR; + operation_menu.manual_off = MANUAL_SHUTDOWN_FR; + // + pause_menu.title = TITLE_PAUSE_FR; + pause_menu.resume = PRINTING_RESUME_FR; + pause_menu.stop = PRINTING_STOP_FR; + pause_menu.extrude = PRINTING_EXTRUDER_FR; + pause_menu.move = PRINTING_MOVE_FR; + pause_menu.filament = FILAMENT_TEXT_FR; + pause_menu.more = PRINTING_MORE_FR; + + // + speed_menu.title = PRINTING_CHANGESPEED_FR; + speed_menu.add = ADD_TEXT_FR; + speed_menu.dec = DEC_TEXT_FR; + speed_menu.move = MOVE_SPEED_FR; + speed_menu.extrude = EXTRUDER_SPEED_FR; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_FR; + speed_menu.move_speed = MOVE_SPEED_STATE_FR; + // + printing_more_menu.fan = FAN_TEXT_FR; + printing_more_menu.auto_close = AUTO_SHUTDOWN_FR; + printing_more_menu.manual = MANUAL_SHUTDOWN_FR; + printing_more_menu.speed = PRINTING_CHANGESPEED_FR; + printing_more_menu.temp = PRINTING_TEMP_FR; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_FR; + print_file_dialog_menu.cancle = DIALOG_CANCLE_FR; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_FR; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_FR; + print_file_dialog_menu.retry = DIALOG_RETRY_FR; + print_file_dialog_menu.stop = DIALOG_STOP_FR; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_FR; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_FR; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_FR; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_FR; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_FR; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_FR; + print_file_dialog_menu.reprint = DIALOG_REPRINT_FR; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_FR; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_FR; + zoffset_menu.inc = ZOFFSET_INC_FR; + zoffset_menu.dec = ZOFFSET_DEC_FR; + + pause_msg_menu.pausing = MESSEGE_PAUSING_FR; + pause_msg_menu.changing = MESSEGE_CHANGING_FR; + pause_msg_menu.unload = MESSEGE_UNLOAD_FR; + pause_msg_menu.waiting = MESSEGE_WAITING_FR; + pause_msg_menu.insert = MESSEGE_INSERT_FR; + pause_msg_menu.load = MESSEGE_LOAD_FR; + pause_msg_menu.purge = MESSEGE_PURGE_FR; + pause_msg_menu.resume = MESSEGE_RESUME_FR; + pause_msg_menu.heat = MESSEGE_HEAT_FR; + pause_msg_menu.heating = MESSEGE_HEATING_FR; + pause_msg_menu.option = MESSEGE_OPTION_FR; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_FR; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_FR; + break; + + case LANG_ITALY: + common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_IT; + common_menu.text_back = BACK_TEXT_IT; + common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_IT; + common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_IT; + common_menu.print_special_title = PRINTING_OTHER_LANGUGE; + common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; + common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; + + // + main_menu.title = TITLE_READYPRINT_IT; + main_menu.preheat = PREHEAT_TEXT_IT; + main_menu.move = MOVE_TEXT_IT; + main_menu.home = HOME_TEXT_IT; + main_menu.print = PRINT_TEXT_IT; + main_menu.extrude = EXTRUDE_TEXT_IT; + main_menu.leveling = LEVELING_TEXT_IT; + main_menu.autoleveling = AUTO_LEVELING_TEXT_IT; + main_menu.fan = FAN_TEXT_IT; + main_menu.set = SET_TEXT_IT; + main_menu.more = MORE_TEXT_IT; + main_menu.tool = TOOL_TEXT_IT; + //TOOL + tool_menu.title = TOOL_TEXT_IT; + tool_menu.preheat = TOOL_PREHEAT_IT; + tool_menu.extrude = TOOL_EXTRUDE_IT; + tool_menu.move = TOOL_MOVE_IT; + tool_menu.home = TOOL_HOME_IT; + tool_menu.leveling = TOOL_LEVELING_IT; + tool_menu.autoleveling = TOOL_AUTO_LEVELING_IT; + tool_menu.filament = TOOL_FILAMENT_IT; + tool_menu.more = TOOL_MORE_IT; + // + preheat_menu.adjust_title = TITLE_ADJUST_IT; + preheat_menu.title = TITLE_PREHEAT_IT; + preheat_menu.add = ADD_TEXT_IT; + preheat_menu.dec = DEC_TEXT_IT; + preheat_menu.ext1 = EXTRUDER_1_TEXT_IT; + preheat_menu.ext2 = EXTRUDER_2_TEXT_IT; + preheat_menu.hotbed = HEATBED_TEXT_IT; + preheat_menu.off = CLOSE_TEXT_IT; + // + move_menu.title = MOVE_TEXT_IT; + // + home_menu.title = TITLE_HOME_IT; + home_menu.stopmove = HOME_STOPMOVE_IT; + // + file_menu.title = TITLE_CHOOSEFILE_IT; + file_menu.page_up = PAGE_UP_TEXT_IT; + file_menu.page_down = PAGE_DOWN_TEXT_IT; + file_menu.file_loading = FILE_LOADING_IT; + file_menu.no_file = NO_FILE_IT; + file_menu.no_file_and_check = NO_FILE_IT;//NO_FILE_AND_CHECK_IT; + // + extrude_menu.title = TITLE_EXTRUDE_IT; + extrude_menu.in = EXTRUDER_IN_TEXT_IT; + extrude_menu.out = EXTRUDER_OUT_TEXT_IT; + extrude_menu.ext1 = EXTRUDER_1_TEXT_IT; + extrude_menu.ext2 = EXTRUDER_2_TEXT_IT; + extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_IT; + extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_IT; + extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_IT; + extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_IT; + // + leveling_menu.title = TITLE_LEVELING_IT; + leveling_menu.position1 = LEVELING_POINT1_TEXT_IT; + leveling_menu.position2 = LEVELING_POINT2_TEXT_IT; + leveling_menu.position3 = LEVELING_POINT3_TEXT_IT; + leveling_menu.position4 = LEVELING_POINT4_TEXT_IT; + leveling_menu.position5 = LEVELING_POINT5_TEXT_IT; + // + set_menu.title = TITLE_SET_IT; + set_menu.filesys = FILESYS_TEXT_IT; + set_menu.wifi = WIFI_TEXT_IT; + set_menu.about = ABOUT_TEXT_IT; + set_menu.fan = FAN_TEXT_IT; + set_menu.filament = FILAMENT_TEXT_IT; + set_menu.breakpoint = BREAK_POINT_TEXT_IT; + set_menu.motoroff = MOTOR_OFF_TEXT_IT; + set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_IT; + set_menu.language = LANGUAGE_TEXT_IT; + set_menu.shutdown = SHUTDOWN_TEXT_IT; + // + more_menu.title = TITLE_MORE_IT; + more_menu.zoffset = ZOFFSET_IT; + // + filesys_menu.title = TITLE_FILESYS_IT; + filesys_menu.sd_sys = SD_CARD_TEXT_IT; + filesys_menu.usb_sys = U_DISK_TEXT_IT; + + //WIFI + wifi_menu.title = WIFI_NAME_TEXT_IT; + //wifi_menu.key = WIFI_KEY_TEXT_IT; + //wifi_menu.ip = WIFI_IP_TEXT_IT; + //wifi_menu.state = WIFI_STA_TEXT_IT; + wifi_menu.cloud = CLOSE_TEXT_IT; + wifi_menu.reconnect = WIFI_RECONNECT_TEXT_IT; + + cloud_menu.title = TITLE_CLOUD_TEXT_IT; + cloud_menu.bind = CLOUD_BINDED_IT; + cloud_menu.binded = CLOUD_BINDED_IT; + cloud_menu.unbind = CLOUD_UNBIND_IT; + cloud_menu.unbinding = CLOUD_UNBINDED_IT; + cloud_menu.disconnected = CLOUD_DISCONNECTED_IT; + cloud_menu.disable = CLOUD_DISABLE_IT; + // + about_menu.title = ABOUT_TEXT_IT; + about_menu.type = ABOUT_TYPE_TEXT_IT; + about_menu.version = ABOUT_VERSION_TEXT_IT; + about_menu.wifi = ABOUT_WIFI_TEXT_IT; + // + fan_menu.title = FAN_TEXT_IT; + fan_menu.add = FAN_ADD_TEXT_IT; + fan_menu.dec = FAN_DEC_TEXT_IT; + fan_menu.state = FAN_TIPS1_TEXT_IT; + // + filament_menu.title = TITLE_FILAMENT_IT; + filament_menu.in = FILAMENT_IN_TEXT_IT; + filament_menu.out = FILAMENT_OUT_TEXT_IT; + filament_menu.ext1 = FILAMENT_EXT0_TEXT_IT; + filament_menu.ext2 = FILAMENT_EXT1_TEXT_IT; + filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_IT; + filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT; + filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT; + filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_IT; + filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT; + filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT; + filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT; + filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_IT; + filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT; + + // + language_menu.title = LANGUAGE_TEXT_IT; + + // + printing_menu.title = TITLE_PRINTING_IT; + printing_menu.option = PRINTING_OPERATION_IT; + printing_menu.stop = PRINTING_STOP_IT; + printing_menu.pause = PRINTING_PAUSE_IT; + printing_menu.resume = PRINTING_RESUME_IT; + + // + operation_menu.title = TITLE_OPERATION_IT; + operation_menu.pause = PRINTING_PAUSE_IT; + operation_menu.stop = PRINTING_STOP_IT; + operation_menu.temp = PRINTING_TEMP_IT; + operation_menu.fan = FAN_TEXT_IT; + operation_menu.extr = PRINTING_EXTRUDER_IT; + operation_menu.speed = PRINTING_CHANGESPEED_IT; + operation_menu.filament = FILAMENT_TEXT_IT; + operation_menu.more = PRINTING_MORE_IT; + operation_menu.move = PRINTING_MOVE_IT; + operation_menu.auto_off = AUTO_SHUTDOWN_IT; + operation_menu.manual_off = MANUAL_SHUTDOWN_IT; + // + pause_menu.title = TITLE_PAUSE_IT; + pause_menu.resume = PRINTING_RESUME_IT; + pause_menu.stop = PRINTING_STOP_IT; + pause_menu.extrude = PRINTING_EXTRUDER_IT; + pause_menu.move = PRINTING_MOVE_IT; + pause_menu.filament = FILAMENT_TEXT_IT; + pause_menu.more = PRINTING_MORE_IT; + + // + speed_menu.title = PRINTING_CHANGESPEED_IT; + speed_menu.add = ADD_TEXT_IT; + speed_menu.dec = DEC_TEXT_IT; + speed_menu.move = MOVE_SPEED_IT; + speed_menu.extrude = EXTRUDER_SPEED_IT; + speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_IT; + speed_menu.move_speed = MOVE_SPEED_STATE_IT; + // + printing_more_menu.fan = FAN_TEXT_IT; + printing_more_menu.auto_close = AUTO_SHUTDOWN_IT; + printing_more_menu.manual = MANUAL_SHUTDOWN_IT; + printing_more_menu.temp = PRINTING_TEMP_IT; + printing_more_menu.speed = PRINTING_CHANGESPEED_IT; + + //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; + print_file_dialog_menu.confirm = DIALOG_CONFIRM_IT; + print_file_dialog_menu.cancle = DIALOG_CANCLE_IT; + print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_IT; + print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_IT; + print_file_dialog_menu.retry = DIALOG_RETRY_IT; + print_file_dialog_menu.stop = DIALOG_STOP_IT; + print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_IT; + print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_IT; + print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_IT; + print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_IT; + print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_IT; + print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_IT; + print_file_dialog_menu.reprint = DIALOG_REPRINT_IT; + print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_IT; + //ZOFFSET + zoffset_menu.title = TITLE_ZOFFSET_IT; + zoffset_menu.inc = ZOFFSET_INC_IT; + zoffset_menu.dec = ZOFFSET_DEC_IT; + + pause_msg_menu.pausing = MESSEGE_PAUSING_IT; + pause_msg_menu.changing = MESSEGE_CHANGING_IT; + pause_msg_menu.unload = MESSEGE_UNLOAD_IT; + pause_msg_menu.waiting = MESSEGE_WAITING_IT; + pause_msg_menu.insert = MESSEGE_INSERT_IT; + pause_msg_menu.load = MESSEGE_LOAD_IT; + pause_msg_menu.purge = MESSEGE_PURGE_IT; + pause_msg_menu.resume = MESSEGE_RESUME_IT; + pause_msg_menu.heat = MESSEGE_HEAT_IT; + pause_msg_menu.heating = MESSEGE_HEATING_IT; + pause_msg_menu.option = MESSEGE_OPTION_IT; + pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_IT; + pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_IT; + break; + + #endif - //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_CN; - print_file_dialog_menu.confirm = DIALOG_CONFIRM_T_CN; - print_file_dialog_menu.cancle = DIALOG_CANCLE_T_CN; - print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_T_CN; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_T_CN; - print_file_dialog_menu.retry = DIALOG_RETRY_T_CN; - print_file_dialog_menu.stop = DIALOG_STOP_T_CN; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_T_CN; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_T_CN; - - print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_T_CN; - print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_T_CN; - print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_T_CN; - print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_T_CN; - print_file_dialog_menu.reprint = DIALOG_REPRINT_T_CN; - print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_T_CN; - //ZOFFSET - zoffset_menu.title = TITLE_ZOFFSET_T_CN; - zoffset_menu.inc = ZOFFSET_INC_T_CN; - zoffset_menu.dec = ZOFFSET_DEC_T_CN; - - pause_msg_menu.pausing = MESSEGE_PAUSING_T_CN; - pause_msg_menu.changing = MESSEGE_CHANGING_T_CN; - pause_msg_menu.unload = MESSEGE_UNLOAD_T_CN; - pause_msg_menu.waiting = MESSEGE_WAITING_T_CN; - pause_msg_menu.insert = MESSEGE_INSERT_T_CN; - pause_msg_menu.load = MESSEGE_LOAD_T_CN; - pause_msg_menu.purge = MESSEGE_PURGE_T_CN; - pause_msg_menu.resume = MESSEGE_RESUME_T_CN; - pause_msg_menu.heat = MESSEGE_HEAT_T_CN; - pause_msg_menu.heating = MESSEGE_HEATING_T_CN; - pause_msg_menu.option = MESSEGE_OPTION_T_CN; - pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_T_CN; - pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_T_CN; - break; - case LANG_ENGLISH: - common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_EN; - common_menu.text_back = BACK_TEXT_EN; - common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_EN; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_EN; - common_menu.print_special_title = PRINTING_OTHER_LANGUGE; - common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; - common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; - // - main_menu.title = TITLE_READYPRINT_EN; - main_menu.preheat = PREHEAT_TEXT_EN; - main_menu.move = MOVE_TEXT_EN; - main_menu.home = HOME_TEXT_EN; - main_menu.print = PRINT_TEXT_EN; - main_menu.extrude = EXTRUDE_TEXT_EN; - main_menu.leveling = LEVELING_TEXT_EN; - main_menu.autoleveling = AUTO_LEVELING_TEXT_EN; - main_menu.fan = FAN_TEXT_EN; - main_menu.set = SET_TEXT_EN; - main_menu.more = MORE_TEXT_EN; - main_menu.tool = TOOL_TEXT_EN; - //TOOL - tool_menu.title = TOOL_TEXT_EN; - tool_menu.preheat = TOOL_PREHEAT_EN; - tool_menu.extrude = TOOL_EXTRUDE_EN; - tool_menu.move = TOOL_MOVE_EN; - tool_menu.home = TOOL_HOME_EN; - tool_menu.leveling = TOOL_LEVELING_EN; - tool_menu.autoleveling = TOOL_AUTO_LEVELING_EN; - tool_menu.filament = TOOL_FILAMENT_EN; - tool_menu.more = TOOL_MORE_EN; - // - preheat_menu.adjust_title = TITLE_ADJUST_EN; - preheat_menu.title = TITLE_PREHEAT_EN; - preheat_menu.add = ADD_TEXT_EN; - preheat_menu.dec = DEC_TEXT_EN; - preheat_menu.ext1 = EXTRUDER_1_TEXT_EN; - preheat_menu.ext2 = EXTRUDER_2_TEXT_EN; - preheat_menu.hotbed = HEATBED_TEXT_EN; - preheat_menu.off = CLOSE_TEXT_EN; - // - move_menu.title = TITLE_MOVE_EN; - // - home_menu.title = TITLE_HOME_EN; - home_menu.stopmove = HOME_STOPMOVE_EN; - // - file_menu.title = TITLE_CHOOSEFILE_EN; - file_menu.page_up = PAGE_UP_TEXT_EN; - file_menu.page_down = PAGE_DOWN_TEXT_EN; - file_menu.file_loading = FILE_LOADING_EN; - file_menu.no_file = NO_FILE_EN; - file_menu.no_file_and_check = NO_FILE_EN;//NO_FILE_AND_CHECK_EN; - // - extrude_menu.title = TITLE_EXTRUDE_EN; - extrude_menu.in = EXTRUDER_IN_TEXT_EN; - extrude_menu.out = EXTRUDER_OUT_TEXT_EN; - extrude_menu.ext1 = EXTRUDER_1_TEXT_EN; - extrude_menu.ext2 = EXTRUDER_2_TEXT_EN; - extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_EN; - extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_EN; - extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_EN; - extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_EN; - // - leveling_menu.title = TITLE_LEVELING_EN; - leveling_menu.position1 = LEVELING_POINT1_TEXT_EN; - leveling_menu.position2 = LEVELING_POINT2_TEXT_EN; - leveling_menu.position3 = LEVELING_POINT3_TEXT_EN; - leveling_menu.position4 = LEVELING_POINT4_TEXT_EN; - leveling_menu.position5 = LEVELING_POINT5_TEXT_EN; - // - set_menu.title = TITLE_SET_EN; - set_menu.filesys = FILESYS_TEXT_EN; - set_menu.wifi = WIFI_TEXT_EN; - set_menu.about = ABOUT_TEXT_EN; - set_menu.fan = FAN_TEXT_EN; - set_menu.filament = FILAMENT_TEXT_EN; - set_menu.breakpoint = BREAK_POINT_TEXT_EN; - set_menu.motoroff = MOTOR_OFF_TEXT_EN; - set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_EN; - set_menu.language = LANGUAGE_TEXT_EN; - set_menu.shutdown = SHUTDOWN_TEXT_EN; - //set_menu.machine_para = MACHINE_PARA_EN; - // - more_menu.title = TITLE_MORE_EN; - more_menu.zoffset = ZOFFSET_EN; - // - filesys_menu.title = TITLE_FILESYS_EN; - filesys_menu.sd_sys = SD_CARD_TEXT_EN; - filesys_menu.usb_sys = U_DISK_TEXT_EN; - //WIFI - wifi_menu.title = WIFI_TEXT; - //wifi_menu.key = WIFI_KEY_TEXT_EN; - //wifi_menu.ip = WIFI_IP_TEXT_EN; - //wifi_menu.state = WIFI_STA_TEXT_EN; - wifi_menu.cloud = CLOUD_TEXT_EN; - wifi_menu.reconnect = WIFI_RECONNECT_TEXT_EN; - - cloud_menu.title = TITLE_CLOUD_TEXT_EN; - cloud_menu.bind = CLOUD_BINDED_EN; - cloud_menu.binded = CLOUD_BINDED_EN; - cloud_menu.unbind = CLOUD_UNBIND_EN; - cloud_menu.unbinding = CLOUD_UNBINDED_EN; - cloud_menu.disconnected = CLOUD_DISCONNECTED_EN; - cloud_menu.disable = CLOUD_DISABLE_EN; - // - about_menu.title = TITLE_ABOUT_EN; - about_menu.type = ABOUT_TYPE_TEXT_EN; - about_menu.version = ABOUT_VERSION_TEXT_EN; - about_menu.wifi = ABOUT_WIFI_TEXT_EN; - // - fan_menu.title = TITLE_FAN_EN; - fan_menu.add = FAN_ADD_TEXT_EN; - fan_menu.dec = FAN_DEC_TEXT_EN; - fan_menu.state = FAN_TIPS1_TEXT_EN; - // - filament_menu.title = TITLE_FILAMENT_EN; - filament_menu.in = FILAMENT_IN_TEXT_EN; - filament_menu.out = FILAMENT_OUT_TEXT_EN; - filament_menu.ext1 = FILAMENT_EXT0_TEXT_EN; - filament_menu.ext2 = FILAMENT_EXT1_TEXT_EN; - filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_EN; - filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN; - filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN; - filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_EN; - filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN; - filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN; - filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN; - filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_EN; - filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN; - - // - language_menu.title = TITLE_LANGUAGE_EN; - language_menu.next = PAGE_DOWN_TEXT_EN; - language_menu.up = PAGE_UP_TEXT_EN; - // - printing_menu.title = TITLE_PRINTING_EN; - printing_menu.option = PRINTING_OPERATION_EN; - printing_menu.stop = PRINTING_STOP_EN; - printing_menu.pause = PRINTING_PAUSE_EN; - printing_menu.resume = PRINTING_RESUME_EN; - - // - operation_menu.title = TITLE_OPERATION_EN; - operation_menu.pause = PRINTING_PAUSE_EN; - operation_menu.stop = PRINTING_STOP_EN; - operation_menu.temp = PRINTING_TEMP_EN; - operation_menu.fan = FAN_TEXT_EN; - operation_menu.extr = PRINTING_EXTRUDER_EN; - operation_menu.speed = PRINTING_CHANGESPEED_EN; - operation_menu.filament = FILAMENT_TEXT_EN; - operation_menu.more = PRINTING_MORE_EN; - operation_menu.move = PRINTING_MOVE_EN; - operation_menu.auto_off = AUTO_SHUTDOWN_EN; - operation_menu.manual_off = MANUAL_SHUTDOWN_EN; - // - pause_menu.title = TITLE_PAUSE_EN; - pause_menu.resume = PRINTING_RESUME_EN; - pause_menu.stop = PRINTING_STOP_EN; - pause_menu.extrude = PRINTING_EXTRUDER_EN; - pause_menu.move = PRINTING_MOVE_EN; - pause_menu.filament = FILAMENT_TEXT_EN; - pause_menu.more = PRINTING_MORE_EN; - - // - speed_menu.title = TITLE_CHANGESPEED_EN; - speed_menu.add = ADD_TEXT_EN; - speed_menu.dec = DEC_TEXT_EN; - speed_menu.move = MOVE_SPEED_EN; - speed_menu.extrude = EXTRUDER_SPEED_EN; - speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_EN; - speed_menu.move_speed = MOVE_SPEED_STATE_EN; - // - printing_more_menu.title = TITLE_MORE_EN; - printing_more_menu.fan = FAN_TEXT_EN; - printing_more_menu.auto_close = AUTO_SHUTDOWN_EN; - printing_more_menu.manual = MANUAL_SHUTDOWN_EN; - printing_more_menu.speed = PRINTING_CHANGESPEED_EN; - printing_more_menu.temp = PRINTING_TEMP_EN; - - //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_EN; - print_file_dialog_menu.confirm = DIALOG_CONFIRM_EN; - print_file_dialog_menu.cancle = DIALOG_CANCLE_EN; - print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_EN; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; - print_file_dialog_menu.retry = DIALOG_RETRY_EN; - print_file_dialog_menu.stop = DIALOG_STOP_EN; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_EN; - print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_EN; - print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_EN; - print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_EN; - print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_EN; - print_file_dialog_menu.reprint = DIALOG_REPRINT_EN; - print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_EN; - //ZOFFSET - zoffset_menu.title = TITLE_ZOFFSET_EN; - zoffset_menu.inc = ZOFFSET_INC_EN; - zoffset_menu.dec = ZOFFSET_DEC_EN; - - pause_msg_menu.pausing = MESSEGE_PAUSING_EN; - pause_msg_menu.changing = MESSEGE_CHANGING_EN; - pause_msg_menu.unload = MESSEGE_UNLOAD_EN; - pause_msg_menu.waiting = MESSEGE_WAITING_EN; - pause_msg_menu.insert = MESSEGE_INSERT_EN; - pause_msg_menu.load = MESSEGE_LOAD_EN; - pause_msg_menu.purge = MESSEGE_PURGE_EN; - pause_msg_menu.resume = MESSEGE_RESUME_EN; - pause_msg_menu.heat = MESSEGE_HEAT_EN; - pause_msg_menu.heating = MESSEGE_HEATING_EN; - pause_msg_menu.option = MESSEGE_OPTION_EN; - pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_EN; - pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_EN; - break; - case LANG_RUSSIAN: - common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_RU; - common_menu.text_back = BACK_TEXT_RU; - common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_RU; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_RU; - common_menu.print_special_title = PRINTING_OTHER_LANGUGE; - common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; - common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; - // - main_menu.title = TITLE_READYPRINT_RU; - main_menu.preheat = PREHEAT_TEXT_RU; - main_menu.move = MOVE_TEXT_RU; - main_menu.home = HOME_TEXT_RU; - main_menu.print = PRINT_TEXT_RU; - main_menu.extrude = EXTRUDE_TEXT_RU; - main_menu.leveling = LEVELING_TEXT_RU; - main_menu.autoleveling = AUTO_LEVELING_TEXT_RU; - main_menu.fan = FAN_TEXT_RU; - main_menu.set = SET_TEXT_RU; - main_menu.more = MORE_TEXT_RU; - main_menu.tool = TOOL_TEXT_RU; - //TOOL - tool_menu.title = TOOL_TEXT_RU; - tool_menu.preheat = TOOL_PREHEAT_RU; - tool_menu.extrude = TOOL_EXTRUDE_RU; - tool_menu.move = TOOL_MOVE_RU; - tool_menu.home = TOOL_HOME_RU; - tool_menu.leveling = TOOL_LEVELING_RU; - tool_menu.autoleveling = TOOL_AUTO_LEVELING_RU; - tool_menu.filament = TOOL_FILAMENT_RU; - tool_menu.more = TOOL_MORE_RU; - // - preheat_menu.adjust_title = TITLE_ADJUST_RU; - preheat_menu.title = TITLE_PREHEAT_RU; - preheat_menu.add = ADD_TEXT_RU; - preheat_menu.dec = DEC_TEXT_RU; - preheat_menu.ext1 = EXTRUDER_1_TEXT_RU; - preheat_menu.ext2 = EXTRUDER_2_TEXT_RU; - preheat_menu.hotbed = HEATBED_TEXT_RU; - preheat_menu.off = CLOSE_TEXT_RU; - // - move_menu.title = MOVE_TEXT_RU; - // - home_menu.title = TITLE_HOME_RU; - home_menu.stopmove = HOME_STOPMOVE_RU; - // - file_menu.title = TITLE_CHOOSEFILE_RU; - file_menu.page_up = PAGE_UP_TEXT_RU; - file_menu.page_down = PAGE_DOWN_TEXT_RU; - file_menu.file_loading = FILE_LOADING_RU; - file_menu.no_file = NO_FILE_RU; - file_menu.no_file_and_check = NO_FILE_RU;//NO_FILE_AND_CHECK_RU; - // - extrude_menu.title = TITLE_EXTRUDE_RU; - extrude_menu.in = EXTRUDER_IN_TEXT_RU; - extrude_menu.out = EXTRUDER_OUT_TEXT_RU; - extrude_menu.ext1 = EXTRUDER_1_TEXT_RU; - extrude_menu.ext2 = EXTRUDER_2_TEXT_RU; - extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_RU; - extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_RU; - extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_RU; - extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_RU; - // - leveling_menu.title = TITLE_LEVELING_RU; - leveling_menu.position1 = LEVELING_POINT1_TEXT_RU; - leveling_menu.position2 = LEVELING_POINT2_TEXT_RU; - leveling_menu.position3 = LEVELING_POINT3_TEXT_RU; - leveling_menu.position4 = LEVELING_POINT4_TEXT_RU; - leveling_menu.position5 = LEVELING_POINT5_TEXT_RU; - // - set_menu.title = TITLE_SET_RU; - set_menu.filesys = FILESYS_TEXT_RU; - set_menu.wifi = WIFI_TEXT_RU; - set_menu.about = ABOUT_TEXT_RU; - set_menu.fan = FAN_TEXT_RU; - set_menu.filament = FILAMENT_TEXT_RU; - set_menu.breakpoint = BREAK_POINT_TEXT_RU; - set_menu.motoroff = MOTOR_OFF_TEXT_RU; - set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_RU; - set_menu.language = LANGUAGE_TEXT_RU; - set_menu.shutdown = SHUTDOWN_TEXT_RU; - // - more_menu.title = TITLE_MORE_RU; - more_menu.zoffset = ZOFFSET_RU; - // - filesys_menu.title = TITLE_FILESYS_RU; - filesys_menu.sd_sys = SD_CARD_TEXT_RU; - filesys_menu.usb_sys = U_DISK_TEXT_RU; - //WIFI - wifi_menu.title = WIFI_TEXT; - //wifi_menu.key = WIFI_KEY_TEXT_RU; - //wifi_menu.ip = WIFI_IP_TEXT_RU; - //wifi_menu.state = WIFI_STA_TEXT_RU; - wifi_menu.cloud = CLOUD_TEXT_RU; - wifi_menu.reconnect = WIFI_RECONNECT_TEXT_RU; - - - cloud_menu.title = TITLE_CLOUD_TEXT_RU; - cloud_menu.bind = CLOUD_BINDED_RU; - cloud_menu.binded = CLOUD_BINDED_RU; - cloud_menu.unbind = CLOUD_UNBIND_RU; - cloud_menu.unbinding = CLOUD_UNBINDED_RU; - cloud_menu.disconnected = CLOUD_DISCONNECTED_RU; - cloud_menu.disable = CLOUD_DISABLE_RU; - // - about_menu.title = ABOUT_TEXT_RU; - about_menu.type = ABOUT_TYPE_TEXT_RU; - about_menu.version = ABOUT_VERSION_TEXT_RU; - about_menu.wifi = ABOUT_WIFI_TEXT_RU; - // - fan_menu.title = FAN_TEXT_RU; - fan_menu.add = FAN_ADD_TEXT_RU; - fan_menu.dec = FAN_DEC_TEXT_RU; - fan_menu.state = FAN_TIPS1_TEXT_RU; - // - filament_menu.title = TITLE_FILAMENT_RU; - filament_menu.in = FILAMENT_IN_TEXT_RU; - filament_menu.out = FILAMENT_OUT_TEXT_RU; - filament_menu.ext1 = FILAMENT_EXT0_TEXT_RU; - filament_menu.ext2 = FILAMENT_EXT1_TEXT_RU; - filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_RU; - filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU; - filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU; - filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_RU; - filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU; - filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU; - filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU; - filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_RU; - filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU; - - // - language_menu.title = LANGUAGE_TEXT_RU; - language_menu.next = PAGE_DOWN_TEXT_RU; - language_menu.up = PAGE_UP_TEXT_RU; - // - printing_menu.title = TITLE_PRINTING_RU; - printing_menu.option = PRINTING_OPERATION_RU; - printing_menu.stop = PRINTING_STOP_RU; - printing_menu.pause = PRINTING_PAUSE_RU; - printing_menu.resume = PRINTING_RESUME_RU; - - // - operation_menu.title = TITLE_OPERATION_RU; - operation_menu.pause = PRINTING_PAUSE_RU; - operation_menu.stop = PRINTING_STOP_RU; - operation_menu.temp = PRINTING_TEMP_RU; - operation_menu.fan = FAN_TEXT_RU; - operation_menu.extr = PRINTING_EXTRUDER_RU; - operation_menu.speed = PRINTING_CHANGESPEED_RU; - operation_menu.filament = FILAMENT_TEXT_RU; - operation_menu.more = PRINTING_MORE_RU; - operation_menu.move = PRINTING_MOVE_RU; - operation_menu.auto_off = AUTO_SHUTDOWN_RU; - operation_menu.manual_off = MANUAL_SHUTDOWN_RU; - // - pause_menu.title = TITLE_PAUSE_RU; - pause_menu.resume = PRINTING_RESUME_RU; - pause_menu.stop = PRINTING_STOP_RU; - pause_menu.extrude = PRINTING_EXTRUDER_RU; - pause_menu.move = PRINTING_MOVE_RU; - pause_menu.filament = FILAMENT_TEXT_RU; - pause_menu.more = PRINTING_MORE_RU; - - // - speed_menu.title = PRINTING_CHANGESPEED_RU; - speed_menu.add = ADD_TEXT_RU; - speed_menu.dec = DEC_TEXT_RU; - speed_menu.move = MOVE_SPEED_RU; - speed_menu.extrude = EXTRUDER_SPEED_RU; - speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_RU; - speed_menu.move_speed = MOVE_SPEED_STATE_RU; - // - printing_more_menu.title = TITLE_MORE_RU; - printing_more_menu.fan = FAN_TEXT_RU; - printing_more_menu.auto_close = AUTO_SHUTDOWN_RU; - printing_more_menu.manual = MANUAL_SHUTDOWN_RU; - printing_more_menu.speed = PRINTING_CHANGESPEED_RU; - printing_more_menu.temp = PRINTING_TEMP_RU; - //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_RU; - print_file_dialog_menu.confirm = DIALOG_CONFIRM_RU; - print_file_dialog_menu.cancle = DIALOG_CANCLE_RU; - print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_RU; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_RU; - print_file_dialog_menu.retry = DIALOG_RETRY_RU; - print_file_dialog_menu.stop = DIALOG_STOP_RU; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_RU; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_RU; - print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_RU; - print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_RU; - print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_RU; - print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_RU; - print_file_dialog_menu.reprint = DIALOG_REPRINT_RU; - print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_RU; - //ZOFFSET - zoffset_menu.title = TITLE_ZOFFSET_RU; - zoffset_menu.inc = ZOFFSET_INC_RU; - zoffset_menu.dec = ZOFFSET_DEC_RU; - - pause_msg_menu.pausing = MESSEGE_PAUSING_RU; - pause_msg_menu.changing = MESSEGE_CHANGING_RU; - pause_msg_menu.unload = MESSEGE_UNLOAD_RU; - pause_msg_menu.waiting = MESSEGE_WAITING_RU; - pause_msg_menu.insert = MESSEGE_INSERT_RU; - pause_msg_menu.load = MESSEGE_LOAD_RU; - pause_msg_menu.purge = MESSEGE_PURGE_RU; - pause_msg_menu.resume = MESSEGE_RESUME_RU; - pause_msg_menu.heat = MESSEGE_HEAT_RU; - pause_msg_menu.heating = MESSEGE_HEATING_RU; - pause_msg_menu.option = MESSEGE_OPTION_RU; - pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_RU; - pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_RU; - break; - case LANG_SPANISH: - common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_SP; - common_menu.text_back = BACK_TEXT_SP; - common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_SP; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_SP; - common_menu.print_special_title = PRINTING_SP; - common_menu.pause_special_title = PRINTING_PAUSAR_SP; - common_menu.operate_special_title = PRINTING_AJUSTES_SP; - // - main_menu.title = TITLE_READYPRINT_SP; - main_menu.preheat = PREHEAT_TEXT_SP; - main_menu.move = MOVE_TEXT_SP; - main_menu.home = HOME_TEXT_SP; - main_menu.print = PRINT_TEXT_SP; - main_menu.extrude = EXTRUDE_TEXT_SP; - main_menu.leveling = LEVELING_TEXT_SP; - main_menu.autoleveling = AUTO_LEVELING_TEXT_SP; - main_menu.fan = FAN_TEXT_SP; - main_menu.set = SET_TEXT_SP; - main_menu.more = MORE_TEXT_SP; - main_menu.tool = TOOL_TEXT_SP; - //TOOL - tool_menu.title = TOOL_TEXT_SP; - tool_menu.preheat = TOOL_PREHEAT_SP; - tool_menu.extrude = TOOL_EXTRUDE_SP; - tool_menu.move = TOOL_MOVE_SP; - tool_menu.home = TOOL_HOME_SP; - tool_menu.leveling = TOOL_LEVELING_SP; - tool_menu.autoleveling = TOOL_AUTO_LEVELING_SP; - tool_menu.filament = TOOL_FILAMENT_SP; - tool_menu.more = TOOL_MORE_SP; - // - preheat_menu.adjust_title = TITLE_ADJUST_SP; - preheat_menu.title = TITLE_PREHEAT_SP; - preheat_menu.add = ADD_TEXT_SP; - preheat_menu.dec = DEC_TEXT_SP; - preheat_menu.ext1 = EXTRUDER_1_TEXT_SP; - preheat_menu.ext2 = EXTRUDER_2_TEXT_SP; - preheat_menu.hotbed = HEATBED_TEXT_SP; - preheat_menu.off = CLOSE_TEXT_SP; - // - move_menu.title = MOVE_TEXT_SP; - // - home_menu.title = TITLE_HOME_SP; - home_menu.home_x = HOME_X_TEXT_SP; - home_menu.home_y = HOME_Y_TEXT_SP; - home_menu.home_z = HOME_Z_TEXT_SP; - home_menu.home_all = HOME_ALL_TEXT_SP; - home_menu.stopmove = HOME_STOPMOVE_SP; - // - file_menu.title = TITLE_CHOOSEFILE_SP; - file_menu.page_up = PAGE_UP_TEXT_SP; - file_menu.page_down = PAGE_DOWN_TEXT_SP; - file_menu.file_loading = FILE_LOADING_SP; - file_menu.no_file = NO_FILE_SP; - file_menu.no_file_and_check = NO_FILE_SP;//NO_FILE_AND_CHECK_SP; - // - extrude_menu.title = TITLE_EXTRUDE_SP; - extrude_menu.in = EXTRUDER_IN_TEXT_SP; - extrude_menu.out = EXTRUDER_OUT_TEXT_SP; - extrude_menu.ext1 = EXTRUDER_1_TEXT_SP; - extrude_menu.ext2 = EXTRUDER_2_TEXT_SP; - extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_SP; - extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_SP; - extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_SP; - extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_SP; - // - leveling_menu.title = TITLE_LEVELING_SP; - leveling_menu.position1 = LEVELING_POINT1_TEXT_SP; - leveling_menu.position2 = LEVELING_POINT2_TEXT_SP; - leveling_menu.position3 = LEVELING_POINT3_TEXT_SP; - leveling_menu.position4 = LEVELING_POINT4_TEXT_SP; - leveling_menu.position5 = LEVELING_POINT5_TEXT_SP; - // - set_menu.title = TITLE_SET_SP; - set_menu.filesys = FILESYS_TEXT_SP; - set_menu.wifi = WIFI_TEXT_SP; - set_menu.about = ABOUT_TEXT_SP; - set_menu.fan = FAN_TEXT_SP; - set_menu.filament = FILAMENT_TEXT_SP; - set_menu.breakpoint = BREAK_POINT_TEXT_SP; - set_menu.motoroff = MOTOR_OFF_TEXT_SP; - set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_SP; - set_menu.language = LANGUAGE_TEXT_SP; - set_menu.shutdown = SHUTDOWN_TEXT_SP; - // - more_menu.title = TITLE_MORE_SP; - more_menu.zoffset = ZOFFSET_SP; - // - filesys_menu.title = TITLE_FILESYS_SP; - filesys_menu.sd_sys = SD_CARD_TEXT_SP; - filesys_menu.usb_sys = U_DISK_TEXT_SP; - - //WIFI - wifi_menu.title = WIFI_TEXT; - //wifi_menu.key = WIFI_KEY_TEXT_SP; - //wifi_menu.ip = WIFI_IP_TEXT_SP; - //wifi_menu.state = WIFI_STA_TEXT_SP; - wifi_menu.cloud = CLOUD_TEXT_SP; - wifi_menu.reconnect = WIFI_RECONNECT_TEXT_SP; - - cloud_menu.title = TITLE_CLOUD_TEXT_SP; - cloud_menu.bind = CLOUD_BINDED_SP; - cloud_menu.binded = CLOUD_BINDED_SP; - cloud_menu.unbind = CLOUD_UNBIND_SP; - cloud_menu.unbinding = CLOUD_UNBINDED_SP; - cloud_menu.disconnected = CLOUD_DISCONNECTED_SP; - cloud_menu.disable = CLOUD_DISABLE_SP; - // - about_menu.title = ABOUT_TEXT_SP; - about_menu.type = ABOUT_TYPE_TEXT_SP; - about_menu.version = ABOUT_VERSION_TEXT_SP; - about_menu.wifi = ABOUT_WIFI_TEXT_SP; - // - fan_menu.title = FAN_TEXT_SP; - fan_menu.add = FAN_ADD_TEXT_SP; - fan_menu.dec = FAN_DEC_TEXT_SP; - fan_menu.state = FAN_TIPS1_TEXT_SP; - // - filament_menu.title = TITLE_FILAMENT_SP; - filament_menu.in = FILAMENT_IN_TEXT_SP; - filament_menu.out = FILAMENT_OUT_TEXT_SP; - filament_menu.ext1 = FILAMENT_EXT0_TEXT_SP; - filament_menu.ext2 = FILAMENT_EXT1_TEXT_SP; - filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_SP; - filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP; - filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP; - filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_SP; - filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP; - filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP; - filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP; - filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_SP; - filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP; - - // - language_menu.title = LANGUAGE_TEXT_SP; - language_menu.next = PAGE_DOWN_TEXT_SP; - language_menu.up = PAGE_UP_TEXT_SP; - // - printing_menu.title = TITLE_PRINTING_SP; - printing_menu.option = PRINTING_OPERATION_SP; - printing_menu.stop = PRINTING_STOP_SP; - printing_menu.pause = PRINTING_PAUSE_SP; - printing_menu.resume = PRINTING_RESUME_SP; - - // - operation_menu.title = TITLE_OPERATION_SP; - operation_menu.pause = PRINTING_PAUSE_SP; - operation_menu.stop = PRINTING_STOP_SP; - operation_menu.temp = PRINTING_TEMP_SP; - operation_menu.fan = FAN_TEXT_SP; - operation_menu.extr = PRINTING_EXTRUDER_SP; - operation_menu.speed = PRINTING_CHANGESPEED_SP; - operation_menu.filament = FILAMENT_TEXT_SP; - operation_menu.more = PRINTING_MORE_SP; - operation_menu.move = PRINTING_MOVE_SP; - operation_menu.auto_off = AUTO_SHUTDOWN_SP; - operation_menu.manual_off = MANUAL_SHUTDOWN_SP; - // - pause_menu.title = TITLE_PAUSE_RU; - pause_menu.resume = PRINTING_RESUME_SP; - pause_menu.stop = PRINTING_STOP_SP; - pause_menu.extrude = PRINTING_EXTRUDER_SP; - pause_menu.move = PRINTING_MOVE_SP; - pause_menu.filament = FILAMENT_TEXT_SP; - pause_menu.more = PRINTING_MORE_SP; - - // - speed_menu.title = PRINTING_CHANGESPEED_SP; - speed_menu.add = ADD_TEXT_SP; - speed_menu.dec = DEC_TEXT_SP; - speed_menu.move = MOVE_SPEED_SP; - speed_menu.extrude = EXTRUDER_SPEED_SP; - speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_SP; - speed_menu.move_speed = MOVE_SPEED_STATE_SP; - // - printing_more_menu.title = TITLE_MORE_SP; - printing_more_menu.fan = FAN_TEXT_SP; - printing_more_menu.auto_close = AUTO_SHUTDOWN_SP; - printing_more_menu.manual = MANUAL_SHUTDOWN_SP; - printing_more_menu.speed = PRINTING_CHANGESPEED_SP; - printing_more_menu.temp = PRINTING_TEMP_SP; - - //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; - print_file_dialog_menu.confirm = DIALOG_CONFIRM_SP; - print_file_dialog_menu.cancle = DIALOG_CANCLE_SP; - print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_SP; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_SP; - print_file_dialog_menu.retry = DIALOG_RETRY_SP; - print_file_dialog_menu.stop = DIALOG_STOP_SP; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_SP; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_SP; - print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_SP; - print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_SP; - print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_SP; - print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_SP; - print_file_dialog_menu.reprint = DIALOG_REPRINT_SP; - print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_SP; - //ZOFFSET - zoffset_menu.title = TITLE_ZOFFSET_SP; - zoffset_menu.inc = ZOFFSET_INC_SP; - zoffset_menu.dec = ZOFFSET_DEC_SP; - - pause_msg_menu.pausing = MESSEGE_PAUSING_SP; - pause_msg_menu.changing = MESSEGE_CHANGING_SP; - pause_msg_menu.unload = MESSEGE_UNLOAD_SP; - pause_msg_menu.waiting = MESSEGE_WAITING_SP; - pause_msg_menu.insert = MESSEGE_INSERT_SP; - pause_msg_menu.load = MESSEGE_LOAD_SP; - pause_msg_menu.purge = MESSEGE_PURGE_SP; - pause_msg_menu.resume = MESSEGE_RESUME_SP; - pause_msg_menu.heat = MESSEGE_HEAT_SP; - pause_msg_menu.heating = MESSEGE_HEATING_SP; - pause_msg_menu.option = MESSEGE_OPTION_SP; - pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_SP; - pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_SP; - break; - #endif - - case LANG_FRENCH: - common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_FR; - common_menu.text_back = BACK_TEXT_FR; - common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_FR; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_FR; - common_menu.print_special_title = PRINTING_OTHER_LANGUGE; - common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; - common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; - - // - main_menu.title = TITLE_READYPRINT_FR; - main_menu.preheat = PREHEAT_TEXT_FR; - main_menu.move = MOVE_TEXT_FR; - main_menu.home = HOME_TEXT_FR; - main_menu.print = PRINT_TEXT_FR; - main_menu.extrude = EXTRUDE_TEXT_FR; - main_menu.leveling = LEVELING_TEXT_FR; - main_menu.autoleveling = AUTO_LEVELING_TEXT_FR; - main_menu.fan = FAN_TEXT_FR; - main_menu.set = SET_TEXT_FR; - main_menu.more = MORE_TEXT_FR; - main_menu.tool = TOOL_TEXT_FR; - //TOOL - tool_menu.title = TOOL_TEXT_FR; - tool_menu.preheat = TOOL_PREHEAT_FR; - tool_menu.extrude = TOOL_EXTRUDE_FR; - tool_menu.move = TOOL_MOVE_FR; - tool_menu.home = TOOL_HOME_FR; - tool_menu.leveling = TOOL_LEVELING_FR; - tool_menu.autoleveling = TOOL_AUTO_LEVELING_FR; - tool_menu.filament = TOOL_FILAMENT_FR; - tool_menu.more = TOOL_MORE_FR; - // - preheat_menu.adjust_title = TITLE_ADJUST_FR; - preheat_menu.title = TITLE_PREHEAT_FR; - preheat_menu.add = ADD_TEXT_FR; - preheat_menu.dec = DEC_TEXT_FR; - preheat_menu.ext1 = EXTRUDER_1_TEXT_FR; - preheat_menu.ext2 = EXTRUDER_2_TEXT_FR; - preheat_menu.hotbed =HEATBED_TEXT_FR; - preheat_menu.off = CLOSE_TEXT_FR; - // - move_menu.title = MOVE_TEXT_FR; - // - home_menu.title = TITLE_HOME_FR; - home_menu.stopmove = HOME_STOPMOVE_FR; - // - file_menu.title = TITLE_CHOOSEFILE_FR; - file_menu.page_up = PAGE_UP_TEXT_FR; - file_menu.page_down = PAGE_DOWN_TEXT_FR; - // - extrude_menu.title = TITLE_EXTRUDE_FR; - extrude_menu.in = EXTRUDER_IN_TEXT_FR; - extrude_menu.out = EXTRUDER_OUT_TEXT_FR; - extrude_menu.ext1 = EXTRUDER_1_TEXT_FR; - extrude_menu.ext2 = EXTRUDER_2_TEXT_FR; - extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_FR; - extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_FR; - extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_FR; - extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_FR; - // - leveling_menu.title = TITLE_LEVELING_FR; - leveling_menu.position1 = LEVELING_POINT1_TEXT_FR; - leveling_menu.position2 = LEVELING_POINT2_TEXT_FR; - leveling_menu.position3 = LEVELING_POINT3_TEXT_FR; - leveling_menu.position4 = LEVELING_POINT4_TEXT_FR; - leveling_menu.position5 = LEVELING_POINT5_TEXT_FR; - // - set_menu.title = TITLE_SET_FR; - set_menu.filesys = FILESYS_TEXT_FR; - set_menu.wifi = WIFI_TEXT_FR; - set_menu.about = ABOUT_TEXT_FR; - set_menu.fan = FAN_TEXT_FR; - set_menu.filament = FILAMENT_TEXT_FR; - set_menu.breakpoint = BREAK_POINT_TEXT_FR; - set_menu.motoroff = MOTOR_OFF_TEXT_FR; - set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_FR; - set_menu.language = LANGUAGE_TEXT_FR; - set_menu.shutdown = SHUTDOWN_TEXT_FR; - // - more_menu.title = TITLE_MORE_FR; - more_menu.zoffset = ZOFFSET_FR; - // - filesys_menu.title = TITLE_FILESYS_FR; - filesys_menu.sd_sys = SD_CARD_TEXT_FR; - filesys_menu.usb_sys = U_DISK_TEXT_FR; - file_menu.file_loading = FILE_LOADING_FR; - file_menu.no_file = NO_FILE_FR; - file_menu.no_file_and_check = NO_FILE_FR;//NO_FILE_AND_CHECK_FR; - //WIFI - wifi_menu.title = WIFI_NAME_TEXT_FR; - //wifi_menu.key = WIFI_KEY_TEXT_FR; - //wifi_menu.ip = WIFI_IP_TEXT_FR; - //wifi_menu.state = WIFI_STA_TEXT_FR; - //wifi_menu.cloud = CLOSE_TEXT_FR; - wifi_menu.cloud = CLOUD_TEXT_FR; - wifi_menu.reconnect = WIFI_RECONNECT_TEXT_FR; - - cloud_menu.title = TITLE_CLOUD_TEXT_FR; - cloud_menu.bind = CLOUD_BINDED_FR; - cloud_menu.binded = CLOUD_BINDED_FR; - cloud_menu.unbind = CLOUD_UNBIND_FR; - cloud_menu.unbinding = CLOUD_UNBINDED_FR; - cloud_menu.disconnected = CLOUD_DISCONNECTED_FR; - cloud_menu.disable = CLOUD_DISABLE_FR; - // - about_menu.title = ABOUT_TEXT_FR; - about_menu.type = ABOUT_TYPE_TEXT_FR; - about_menu.version = ABOUT_VERSION_TEXT_FR; - about_menu.wifi = ABOUT_WIFI_TEXT_FR; - // - fan_menu.title = FAN_TEXT_FR; - fan_menu.add = FAN_ADD_TEXT_FR; - fan_menu.dec = FAN_DEC_TEXT_FR; - fan_menu.state = FAN_TIPS1_TEXT_FR; - // - filament_menu.title = TITLE_FILAMENT_FR; - filament_menu.in = FILAMENT_IN_TEXT_FR; - filament_menu.out = FILAMENT_OUT_TEXT_FR; - filament_menu.ext1 = FILAMENT_EXT0_TEXT_FR; - filament_menu.ext2 = FILAMENT_EXT1_TEXT_FR; - filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_FR; - filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR; - filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR; - filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_FR; - filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR; - filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR; - filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR; - filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_FR; - filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR; - - // - language_menu.title = LANGUAGE_TEXT_FR; - - // - printing_menu.title = TITLE_PRINTING_FR; - printing_menu.option = PRINTING_OPERATION_FR; - printing_menu.stop = PRINTING_STOP_FR; - printing_menu.pause = PRINTING_PAUSE_FR; - printing_menu.resume = PRINTING_RESUME_FR; - - // - operation_menu.title = TITLE_OPERATION_FR; - operation_menu.pause = PRINTING_PAUSE_FR; - operation_menu.stop = PRINTING_STOP_FR; - operation_menu.temp = PRINTING_TEMP_FR; - operation_menu.fan = FAN_TEXT_FR; - operation_menu.extr = PRINTING_EXTRUDER_FR; - operation_menu.speed = PRINTING_CHANGESPEED_FR; - operation_menu.filament = FILAMENT_TEXT_FR; - operation_menu.more = PRINTING_MORE_FR; - operation_menu.move = PRINTING_MOVE_FR; - operation_menu.auto_off = AUTO_SHUTDOWN_FR; - operation_menu.manual_off = MANUAL_SHUTDOWN_FR; - // - pause_menu.title = TITLE_PAUSE_FR; - pause_menu.resume = PRINTING_RESUME_FR; - pause_menu.stop = PRINTING_STOP_FR; - pause_menu.extrude = PRINTING_EXTRUDER_FR; - pause_menu.move = PRINTING_MOVE_FR; - pause_menu.filament = FILAMENT_TEXT_FR; - pause_menu.more = PRINTING_MORE_FR; - - // - speed_menu.title = PRINTING_CHANGESPEED_FR; - speed_menu.add = ADD_TEXT_FR; - speed_menu.dec = DEC_TEXT_FR; - speed_menu.move = MOVE_SPEED_FR; - speed_menu.extrude = EXTRUDER_SPEED_FR; - speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_FR; - speed_menu.move_speed = MOVE_SPEED_STATE_FR; - // - printing_more_menu.fan = FAN_TEXT_FR; - printing_more_menu.auto_close = AUTO_SHUTDOWN_FR; - printing_more_menu.manual = MANUAL_SHUTDOWN_FR; - printing_more_menu.speed = PRINTING_CHANGESPEED_FR; - printing_more_menu.temp = PRINTING_TEMP_FR; - - //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; - print_file_dialog_menu.confirm = DIALOG_CONFIRM_FR; - print_file_dialog_menu.cancle = DIALOG_CANCLE_FR; - print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_FR; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_FR; - print_file_dialog_menu.retry = DIALOG_RETRY_FR; - print_file_dialog_menu.stop = DIALOG_STOP_FR; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_FR; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_FR; - print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_FR; - print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_FR; - print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_FR; - print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_FR; - print_file_dialog_menu.reprint = DIALOG_REPRINT_FR; - print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_FR; - //ZOFFSET - zoffset_menu.title = TITLE_ZOFFSET_FR; - zoffset_menu.inc = ZOFFSET_INC_FR; - zoffset_menu.dec = ZOFFSET_DEC_FR; - - pause_msg_menu.pausing = MESSEGE_PAUSING_FR; - pause_msg_menu.changing = MESSEGE_CHANGING_FR; - pause_msg_menu.unload = MESSEGE_UNLOAD_FR; - pause_msg_menu.waiting = MESSEGE_WAITING_FR; - pause_msg_menu.insert = MESSEGE_INSERT_FR; - pause_msg_menu.load = MESSEGE_LOAD_FR; - pause_msg_menu.purge = MESSEGE_PURGE_FR; - pause_msg_menu.resume = MESSEGE_RESUME_FR; - pause_msg_menu.heat = MESSEGE_HEAT_FR; - pause_msg_menu.heating = MESSEGE_HEATING_FR; - pause_msg_menu.option = MESSEGE_OPTION_FR; - pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_FR; - pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_FR; - break; - - case LANG_ITALY: - common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_IT; - common_menu.text_back = BACK_TEXT_IT; - common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_IT; - common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_IT; - common_menu.print_special_title = PRINTING_OTHER_LANGUGE; - common_menu.pause_special_title = PRINTING_PAUSE_OTHER_LANGUGE; - common_menu.operate_special_title = PRINTING_OPERATION_OTHER_LANGUGE; - - // - main_menu.title = TITLE_READYPRINT_IT; - main_menu.preheat = PREHEAT_TEXT_IT; - main_menu.move = MOVE_TEXT_IT; - main_menu.home = HOME_TEXT_IT; - main_menu.print = PRINT_TEXT_IT; - main_menu.extrude = EXTRUDE_TEXT_IT; - main_menu.leveling = LEVELING_TEXT_IT; - main_menu.autoleveling = AUTO_LEVELING_TEXT_IT; - main_menu.fan = FAN_TEXT_IT; - main_menu.set = SET_TEXT_IT; - main_menu.more = MORE_TEXT_IT; - main_menu.tool = TOOL_TEXT_IT; - //TOOL - tool_menu.title = TOOL_TEXT_IT; - tool_menu.preheat = TOOL_PREHEAT_IT; - tool_menu.extrude = TOOL_EXTRUDE_IT; - tool_menu.move = TOOL_MOVE_IT; - tool_menu.home = TOOL_HOME_IT; - tool_menu.leveling = TOOL_LEVELING_IT; - tool_menu.autoleveling = TOOL_AUTO_LEVELING_IT; - tool_menu.filament = TOOL_FILAMENT_IT; - tool_menu.more = TOOL_MORE_IT; - // - preheat_menu.adjust_title = TITLE_ADJUST_IT; - preheat_menu.title = TITLE_PREHEAT_IT; - preheat_menu.add = ADD_TEXT_IT; - preheat_menu.dec = DEC_TEXT_IT; - preheat_menu.ext1 = EXTRUDER_1_TEXT_IT; - preheat_menu.ext2 = EXTRUDER_2_TEXT_IT; - preheat_menu.hotbed = HEATBED_TEXT_IT; - preheat_menu.off = CLOSE_TEXT_IT; - // - move_menu.title = MOVE_TEXT_IT; - // - home_menu.title = TITLE_HOME_IT; - home_menu.stopmove = HOME_STOPMOVE_IT; - // - file_menu.title = TITLE_CHOOSEFILE_IT; - file_menu.page_up = PAGE_UP_TEXT_IT; - file_menu.page_down = PAGE_DOWN_TEXT_IT; - file_menu.file_loading = FILE_LOADING_IT; - file_menu.no_file = NO_FILE_IT; - file_menu.no_file_and_check = NO_FILE_IT;//NO_FILE_AND_CHECK_IT; - // - extrude_menu.title = TITLE_EXTRUDE_IT; - extrude_menu.in = EXTRUDER_IN_TEXT_IT; - extrude_menu.out = EXTRUDER_OUT_TEXT_IT; - extrude_menu.ext1 = EXTRUDER_1_TEXT_IT; - extrude_menu.ext2 = EXTRUDER_2_TEXT_IT; - extrude_menu.low = EXTRUDE_LOW_SPEED_TEXT_IT; - extrude_menu.normal = EXTRUDE_MEDIUM_SPEED_TEXT_IT; - extrude_menu.high = EXTRUDE_HIGH_SPEED_TEXT_IT; - extrude_menu.temper_text = EXTRUDER_TEMP_TEXT_IT; - // - leveling_menu.title = TITLE_LEVELING_IT; - leveling_menu.position1 = LEVELING_POINT1_TEXT_IT; - leveling_menu.position2 = LEVELING_POINT2_TEXT_IT; - leveling_menu.position3 = LEVELING_POINT3_TEXT_IT; - leveling_menu.position4 = LEVELING_POINT4_TEXT_IT; - leveling_menu.position5 = LEVELING_POINT5_TEXT_IT; - // - set_menu.title = TITLE_SET_IT; - set_menu.filesys = FILESYS_TEXT_IT; - set_menu.wifi = WIFI_TEXT_IT; - set_menu.about = ABOUT_TEXT_IT; - set_menu.fan = FAN_TEXT_IT; - set_menu.filament = FILAMENT_TEXT_IT; - set_menu.breakpoint = BREAK_POINT_TEXT_IT; - set_menu.motoroff = MOTOR_OFF_TEXT_IT; - set_menu.motoroffXY = MOTOR_OFF_XY_TEXT_IT; - set_menu.language = LANGUAGE_TEXT_IT; - set_menu.shutdown = SHUTDOWN_TEXT_IT; - // - more_menu.title = TITLE_MORE_IT; - more_menu.zoffset = ZOFFSET_IT; - // - filesys_menu.title = TITLE_FILESYS_IT; - filesys_menu.sd_sys = SD_CARD_TEXT_IT; - filesys_menu.usb_sys = U_DISK_TEXT_IT; - - //WIFI - wifi_menu.title = WIFI_NAME_TEXT_IT; - //wifi_menu.key = WIFI_KEY_TEXT_IT; - //wifi_menu.ip = WIFI_IP_TEXT_IT; - //wifi_menu.state = WIFI_STA_TEXT_IT; - wifi_menu.cloud = CLOSE_TEXT_IT; - wifi_menu.reconnect = WIFI_RECONNECT_TEXT_IT; - - cloud_menu.title = TITLE_CLOUD_TEXT_IT; - cloud_menu.bind = CLOUD_BINDED_IT; - cloud_menu.binded = CLOUD_BINDED_IT; - cloud_menu.unbind = CLOUD_UNBIND_IT; - cloud_menu.unbinding = CLOUD_UNBINDED_IT; - cloud_menu.disconnected = CLOUD_DISCONNECTED_IT; - cloud_menu.disable = CLOUD_DISABLE_IT; - // - about_menu.title = ABOUT_TEXT_IT; - about_menu.type = ABOUT_TYPE_TEXT_IT; - about_menu.version = ABOUT_VERSION_TEXT_IT; - about_menu.wifi = ABOUT_WIFI_TEXT_IT; - // - fan_menu.title = FAN_TEXT_IT; - fan_menu.add = FAN_ADD_TEXT_IT; - fan_menu.dec = FAN_DEC_TEXT_IT; - fan_menu.state = FAN_TIPS1_TEXT_IT; - // - filament_menu.title = TITLE_FILAMENT_IT; - filament_menu.in = FILAMENT_IN_TEXT_IT; - filament_menu.out = FILAMENT_OUT_TEXT_IT; - filament_menu.ext1 = FILAMENT_EXT0_TEXT_IT; - filament_menu.ext2 = FILAMENT_EXT1_TEXT_IT; - filament_menu.ready_replace = FILAMENT_CHANGE_TEXT_IT; - filament_menu.filament_dialog_load_heat = FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT; - filament_menu.filament_dialog_load_heat_confirm = FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT; - filament_menu.filament_dialog_loading = FILAMENT_DIALOG_LOADING_TIPS_IT; - filament_menu.filament_dialog_load_completed = FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT; - filament_menu.filament_dialog_unload_heat = FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT; - filament_menu.filament_dialog_unload_heat_confirm = FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT; - filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_IT; - filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT; - - // - language_menu.title = LANGUAGE_TEXT_IT; - - // - printing_menu.title = TITLE_PRINTING_IT; - printing_menu.option = PRINTING_OPERATION_IT; - printing_menu.stop = PRINTING_STOP_IT; - printing_menu.pause = PRINTING_PAUSE_IT; - printing_menu.resume = PRINTING_RESUME_IT; - - // - operation_menu.title = TITLE_OPERATION_IT; - operation_menu.pause = PRINTING_PAUSE_IT; - operation_menu.stop = PRINTING_STOP_IT; - operation_menu.temp = PRINTING_TEMP_IT; - operation_menu.fan = FAN_TEXT_IT; - operation_menu.extr = PRINTING_EXTRUDER_IT; - operation_menu.speed = PRINTING_CHANGESPEED_IT; - operation_menu.filament = FILAMENT_TEXT_IT; - operation_menu.more = PRINTING_MORE_IT; - operation_menu.move = PRINTING_MOVE_IT; - operation_menu.auto_off = AUTO_SHUTDOWN_IT; - operation_menu.manual_off = MANUAL_SHUTDOWN_IT; - // - pause_menu.title = TITLE_PAUSE_IT; - pause_menu.resume = PRINTING_RESUME_IT; - pause_menu.stop = PRINTING_STOP_IT; - pause_menu.extrude = PRINTING_EXTRUDER_IT; - pause_menu.move = PRINTING_MOVE_IT; - pause_menu.filament = FILAMENT_TEXT_IT; - pause_menu.more = PRINTING_MORE_IT; - - // - speed_menu.title = PRINTING_CHANGESPEED_IT; - speed_menu.add = ADD_TEXT_IT; - speed_menu.dec = DEC_TEXT_IT; - speed_menu.move = MOVE_SPEED_IT; - speed_menu.extrude = EXTRUDER_SPEED_IT; - speed_menu.extrude_speed = EXTRUDER_SPEED_STATE_IT; - speed_menu.move_speed = MOVE_SPEED_STATE_IT; - // - printing_more_menu.fan = FAN_TEXT_IT; - printing_more_menu.auto_close = AUTO_SHUTDOWN_IT; - printing_more_menu.manual = MANUAL_SHUTDOWN_IT; - printing_more_menu.temp = PRINTING_TEMP_IT; - printing_more_menu.speed = PRINTING_CHANGESPEED_IT; - - //print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; - print_file_dialog_menu.confirm = DIALOG_CONFIRM_IT; - print_file_dialog_menu.cancle = DIALOG_CANCLE_IT; - print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_IT; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_IT; - print_file_dialog_menu.retry = DIALOG_RETRY_IT; - print_file_dialog_menu.stop = DIALOG_STOP_IT; - print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_IT; - print_file_dialog_menu.print_from_breakpoint = DIALOG_REPRINT_FROM_BREAKPOINT_IT; - print_file_dialog_menu.close_machine_error = DIALOG_ERROR_TIPS2_IT; - print_file_dialog_menu.filament_no_press = DIALOG_FILAMENT_NO_PRESS_IT; - print_file_dialog_menu.print_finish = DIALOG_PRINT_FINISH_IT; - print_file_dialog_menu.print_time = DIALOG_PRINT_TIME_IT; - print_file_dialog_menu.reprint = DIALOG_REPRINT_IT; - print_file_dialog_menu.wifi_enable_tips = DIALOG_WIFI_ENABLE_TIPS_IT; - //ZOFFSET - zoffset_menu.title = TITLE_ZOFFSET_IT; - zoffset_menu.inc = ZOFFSET_INC_IT; - zoffset_menu.dec = ZOFFSET_DEC_IT; - - pause_msg_menu.pausing = MESSEGE_PAUSING_IT; - pause_msg_menu.changing = MESSEGE_CHANGING_IT; - pause_msg_menu.unload = MESSEGE_UNLOAD_IT; - pause_msg_menu.waiting = MESSEGE_WAITING_IT; - pause_msg_menu.insert = MESSEGE_INSERT_IT; - pause_msg_menu.load = MESSEGE_LOAD_IT; - pause_msg_menu.purge = MESSEGE_PURGE_IT; - pause_msg_menu.resume = MESSEGE_RESUME_IT; - pause_msg_menu.heat = MESSEGE_HEAT_IT; - pause_msg_menu.heating = MESSEGE_HEATING_IT; - pause_msg_menu.option = MESSEGE_OPTION_IT; - pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_IT; - pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_IT; - break; - - #endif default: common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_EN; common_menu.text_back = BACK_TEXT_EN; @@ -1894,8 +1896,8 @@ void disp_language_init() { pause_msg_menu.option = MESSEGE_OPTION_EN; pause_msg_menu.purgeMore = MESSEGE_PURGE_MORE_EN; pause_msg_menu.continuePrint = MESSEGE_CONTINUE_PRINT_EN; - break; + break; } } -#endif +#endif // TFT_LITTLE_VGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h index ee08efc9c19d..2443bc7d575f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h @@ -395,7 +395,7 @@ typedef struct dialog_menu_disp { extern dialog_menu_def dialog_menu; typedef struct print_file_dialog_disp { - const char *title; + const char *title; const char *confirm; const char *cancle; const char *print_file; @@ -490,9 +490,9 @@ extern pause_msg_def pause_msg_menu; /*****************************************/ //********************************************// //#if defined(TFT70) - // +// //#elif defined(TFT35) - #define TEXT_VALUE "%d/%d" +#define TEXT_VALUE "%d/%d" //#endif #define TEXT_VALUE_T ": %d℃" diff --git a/buildroot/share/extras/uncrustify.cfg b/buildroot/share/extras/uncrustify.cfg index 3f657e34f1fd..aba09ab468d8 100644 --- a/buildroot/share/extras/uncrustify.cfg +++ b/buildroot/share/extras/uncrustify.cfg @@ -254,7 +254,7 @@ mod_add_long_ifdef_else_comment = 40 # Whether to remove blanks after '#ifxx' and '#elxx', or before '#elxx' and # '#endif'. Does not affect top-level #ifdefs. -nl_squeeze_ifdef = true +nl_squeeze_ifdef = false # # Newline adding and removing options From 5a349b66ef31c368ea67b9208240a237ab21e055 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 13 Jun 2020 18:16:32 -0500 Subject: [PATCH 14/18] Apply more formatting --- Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp | 30 +++--- .../src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 69 +++++++------- .../lcd/extui/lib/mks_ui/draw_opration.cpp | 5 +- buildroot/bin/uncrust | 2 +- buildroot/share/extras/header.h | 26 +++++ buildroot/share/extras/uncrustify.cfg | 94 +++++++++++-------- 6 files changed, 134 insertions(+), 92 deletions(-) create mode 100644 buildroot/share/extras/header.h diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp index 0beb79005608..804bc6548cad 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp @@ -49,7 +49,7 @@ #define SPI_TFT_RST_PIN PC6 #endif -//use SPI1 for the spi tft. +// use SPI1 for the spi tft. void TFT::spi_init(uint8_t spiRate) { SPI_TFT_CS_H; @@ -199,7 +199,7 @@ LCD_WR_DATA(0xa7); LCD_WR_REG(0xc5); LCD_WR_DATA(0x18); - LCD_WR_REG(0xe0); //Positive Voltage Gamma Control + LCD_WR_REG(0xe0); // Positive Voltage Gamma Control LCD_WR_DATA(0xf0); LCD_WR_DATA(0x09); LCD_WR_DATA(0x0b); @@ -214,7 +214,7 @@ LCD_WR_DATA(0x14); LCD_WR_DATA(0x18); LCD_WR_DATA(0x1b); - LCD_WR_REG(0xe1); //Negative Voltage Gamma Control + LCD_WR_REG(0xe1); // Negative Voltage Gamma Control LCD_WR_DATA(0xf0); LCD_WR_DATA(0x09); LCD_WR_DATA(0x0b); @@ -233,8 +233,8 @@ LCD_WR_DATA(0x3c); LCD_WR_REG(0xf0); LCD_WR_DATA(0x69); - delay(120); //Delay 120ms - LCD_WR_REG(0x29); //Display ON + delay(120); // Delay 120ms + LCD_WR_REG(0x29); // Display ON LCD_clear(0x0000); // SPI_TFT_BLK_H; @@ -250,22 +250,20 @@ LCD_WriteRAM_Prepare(); SPI_TFT_CS_L; SPI_TFT_DC_H; - for (i = 0; i < 960;) - { - tbuf[i] = color >> 8; + for (i = 0; i < 960;) { + tbuf[i] = color >> 8; tbuf[i + 1] = color; i += 2; } - for (i = 0; i < 320; i++) - { - //for(m=0;m<480;m++) - //{ - //LCD_WR_DATA(color>>8); - //LCD_WR_DATA(color); + for (i = 0; i < 320; i++) { + // for(m=0;m<480;m++) + // { + // LCD_WR_DATA(color>>8); + // LCD_WR_DATA(color); SPI.dmaSend(tbuf, 960, true); - //SPI_TFT_CS_H; - //} + // SPI_TFT_CS_H; + // } } SPI_TFT_CS_H; } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp index 3b813abc5ad7..5f2de33813e7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -19,6 +19,11 @@ * along with this program. If not, see . * */ + +/** + * draw_dialog.cpp + */ + #include "../../../../inc/MarlinConfigPre.h" #if ENABLED(TFT_LITTLE_VGL_UI) @@ -187,8 +192,8 @@ void lv_draw_dialog(uint8_t type) { //LV_IMG_DECLARE(bmp_pic); - static lv_style_t style_btn_rel; /*A variable to store the released style*/ - lv_style_copy(&style_btn_rel, &lv_style_plain); /*Initialize from a built-in style*/ + static lv_style_t style_btn_rel; // A variable to store the released style + lv_style_copy(&style_btn_rel, &lv_style_plain); // Initialize from a built-in style style_btn_rel.body.border.color = lv_color_hex3(0x269); style_btn_rel.body.border.width = 1; style_btn_rel.body.main_color = lv_color_hex3(0xADF); @@ -199,8 +204,8 @@ void lv_draw_dialog(uint8_t type) { style_btn_rel.text.color = lv_color_hex3(0xDEF); style_btn_rel.text.font = &gb2312_puhui32; - static lv_style_t style_btn_pr; /*A variable to store the pressed style*/ - lv_style_copy(&style_btn_pr, &style_btn_rel); /*Initialize from the released style*/ + static lv_style_t style_btn_pr; // A variable to store the pressed style + lv_style_copy(&style_btn_pr, &style_btn_rel); // Initialize from the released style style_btn_pr.body.border.color = lv_color_hex3(0x46B); style_btn_pr.body.main_color = lv_color_hex3(0x8BD); style_btn_pr.body.grad_color = lv_color_hex3(0x24A); @@ -212,26 +217,26 @@ void lv_draw_dialog(uint8_t type) { lv_obj_set_style(labelDialog, &tft_style_lable_rel); if (DialogType == DIALOG_TYPE_FINISH_PRINT || DialogType == DIALOG_PAUSE_MESSAGE_RESUME) { - lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); /*Set its position*/ - lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ + lv_obj_t * btnOk = lv_btn_create(scr, NULL); // Add a button the current screen + lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); // Set its position + lv_obj_set_size(btnOk, 100, 50); // Set its size lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ - lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ - lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ - lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); // Set the button's released style + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); // Set the button's pressed style + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); // Add a label to the button + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text } else if (DialogType == DIALOG_PAUSE_MESSAGE_WAITING || DialogType == DIALOG_PAUSE_MESSAGE_INSERT || DialogType == DIALOG_PAUSE_MESSAGE_HEAT) { - lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); /*Set its position*/ - lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ + lv_obj_t * btnOk = lv_btn_create(scr, NULL); // Add a button the current screen + lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); // Set its position + lv_obj_set_size(btnOk, 100, 50); // Set its size lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ - lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ - lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ - lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); // Set the button's released style + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); // Set the button's pressed style + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); // Add a label to the button + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text } else if (DialogType == DIALOG_PAUSE_MESSAGE_PAUSING || DialogType == DIALOG_PAUSE_MESSAGE_CHANGING @@ -243,28 +248,28 @@ void lv_draw_dialog(uint8_t type) { } else { - lv_obj_t * btnOk = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(btnOk, BTN_OK_X, BTN_OK_Y); /*Set its position*/ - lv_obj_set_size(btnOk, 100, 50); /*Set its size*/ + lv_obj_t * btnOk = lv_btn_create(scr, NULL); // Add a button the current screen + lv_obj_set_pos(btnOk, BTN_OK_X, BTN_OK_Y); // Set its position + lv_obj_set_size(btnOk, 100, 50); // Set its size lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ - lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ - lv_obj_t * labelOk = lv_label_create(btnOk, NULL); /*Add a label to the button*/ + lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); // Set the button's released style + lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); // Set the button's pressed style + lv_obj_t * labelOk = lv_label_create(btnOk, NULL); // Add a label to the button - lv_obj_t * btnCancel = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(btnCancel, BTN_CANCEL_X, BTN_CANCEL_Y); /*Set its position*/ - lv_obj_set_size(btnCancel, 100, 50); /*Set its size*/ + lv_obj_t * btnCancel = lv_btn_create(scr, NULL); // Add a button the current screen + lv_obj_set_pos(btnCancel, BTN_CANCEL_X, BTN_CANCEL_Y); // Set its position + lv_obj_set_size(btnCancel, 100, 50); // Set its size lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_set_style(btnCancel, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ - lv_btn_set_style(btnCancel, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ - lv_obj_t * labelCancel = lv_label_create(btnCancel, NULL); /*Add a label to the button*/ + lv_btn_set_style(btnCancel, LV_BTN_STYLE_REL, &style_btn_rel); // Set the button's released style + lv_btn_set_style(btnCancel, LV_BTN_STYLE_PR, &style_btn_pr); // Set the button's pressed style + lv_obj_t * labelCancel = lv_label_create(btnCancel, NULL); // Add a label to the button if (DialogType == DIALOG_PAUSE_MESSAGE_OPTION) { - lv_label_set_text(labelOk, pause_msg_menu.purgeMore); /*Set the labels text*/ + lv_label_set_text(labelOk, pause_msg_menu.purgeMore); // Set the labels text lv_label_set_text(labelCancel, pause_msg_menu.continuePrint); } else { - lv_label_set_text(labelOk, print_file_dialog_menu.confirm); /*Set the labels text*/ + lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); } } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp index 13b62a74875d..64190f27581e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp @@ -23,13 +23,14 @@ #if ENABLED(TFT_LITTLE_VGL_UI) -#include "../../../../MarlinCore.h" #include "lv_conf.h" +#include "draw_ui.h" //#include "../lvgl/src/lv_objx/lv_imgbtn.h" //#include "../lvgl/src/lv_objx/lv_img.h" //#include "../lvgl/src/lv_core/lv_disp.h" //#include "../lvgl/src/lv_core/lv_refr.h" -#include "draw_ui.h" + +#include "../../../../MarlinCore.h" static lv_obj_t * scr; diff --git a/buildroot/bin/uncrust b/buildroot/bin/uncrust index 63eb250e3b64..9893b5c380e6 100755 --- a/buildroot/bin/uncrust +++ b/buildroot/bin/uncrust @@ -6,7 +6,7 @@ TMPDIR=`mktemp -d` # Reformat a single file to tmp/ -uncrustify -c ./buildroot/share/extras/uncrustify.cfg -f "$1" >$TMPDIR/uncrustify.out +uncrustify -l CPP -c ./buildroot/share/extras/uncrustify.cfg -f "$1" >$TMPDIR/uncrustify.out # Replace the original file cp "$TMPDIR/uncrustify.out" "$1" diff --git a/buildroot/share/extras/header.h b/buildroot/share/extras/header.h new file mode 100644 index 000000000000..71338b62d6b4 --- /dev/null +++ b/buildroot/share/extras/header.h @@ -0,0 +1,26 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * $(filename) + */ + diff --git a/buildroot/share/extras/uncrustify.cfg b/buildroot/share/extras/uncrustify.cfg index aba09ab468d8..022c8099f9be 100644 --- a/buildroot/share/extras/uncrustify.cfg +++ b/buildroot/share/extras/uncrustify.cfg @@ -13,14 +13,15 @@ # Make sure to use the latest version. # -# no cr/lf +# Add a standard Marlin (c) header +cmt_insert_file_header = "./header.h" + +# Unix line endings newlines = lf -# no tabs +# indent with 2 spaces indent_with_tabs = 0 - -# no tabs -output_tab_size = 2 +input_tab_size = 2 # small indents indent_columns = 2 @@ -52,22 +53,22 @@ sp_func_proto_paren = remove sp_func_call_paren = remove # Add or remove space around arithmetic operator '+', '-', '/', '*', etc -sp_arith = force +sp_arith = add # Add or remove space around assignment operator '=', '+=', etc -sp_assign = force +sp_assign = add # Add or remove space around boolean operators '&&' and '||' -sp_bool = force +sp_bool = add # Add or remove space around compare operator '<', '>', '==', etc -sp_compare = force +sp_compare = add # Add or remove space around the ':' in 'b ? t : f' -sp_cond_colon = force +sp_cond_colon = add # Add or remove space around the '?' in 'b ? t : f' -sp_cond_question = force +sp_cond_question = add # In the abbreviated ternary form '(a ?: b)', add or remove space between '?' # and ':'. @@ -130,6 +131,9 @@ nl_after_brace_open = true # Add or remove newline between 'if' and '{' nl_if_brace = remove +# Add or remove newline between 'for' and '{' +nl_for_brace = remove + # Add or remove newline between 'else' and '{' nl_else_brace = remove @@ -209,26 +213,25 @@ pp_define_at_level = true # >0: Column at which all preprocessors will be indented pp_indent_if = 0 -# Whether to indent case statements between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the case statements -# directly inside of. -# -# Default: true -pp_indent_case = false +# Number of columns to indent preprocessors per level +# at brace level 0 (file-level). +pp_indent_count = 2 # Whether to indent the code between #if, #else and #endif. pp_if_indent_code = true -# Specifies the number of columns to indent preprocessors per level -# at brace level 0 (file-level). If pp_indent_at_level=false, also specifies -# the number of columns to indent preprocessors per level -# at brace level > 0 (function-level). -# -# Default: 1 -pp_indent_count = 2 +# Whether to indent whole function definitions between #if, #else, and #endif. +# Only applies to the indent of the preprocesser that the function definition +# is directly inside of. +# Default: true +pp_indent_func_def = true -# Whether to ignore the '#define' body while formatting. -pp_ignore_define_body = true +# Whether to indent case statements between #if, #else, and #endif. +# Only applies to the indent of the preprocesser that the case statements +# directly inside of. +# +# Default: true +pp_indent_case = true # Whether to indent extern C blocks between #if, #else, and #endif. # Only applies to the indent of the preprocesser that the extern block is @@ -244,6 +247,9 @@ pp_indent_extern = false # Default: true pp_indent_brace = false +# Whether to ignore the '#define' body while formatting. +pp_ignore_define_body = true + # If an #ifdef body exceeds the specified number of newlines and doesn't have # a comment after the #endif, a comment will be added. mod_add_long_ifdef_endif_comment = 40 @@ -262,16 +268,25 @@ nl_squeeze_ifdef = false # Whether to remove a newline in simple unbraced if statements, turning them # into one-liners, as in 'if(b)\n i++;' => 'if(b) i++;'. -nl_create_if_one_liner = true +nl_create_if_one_liner = false + +# Don't split one-line if/else statements, as in 'if(...) b++;'. +nl_if_leave_one_liners = true # Whether to remove a newline in simple unbraced for statements, turning them # into one-liners, as in 'for (...)\n stmt;' => 'for (...) stmt;'. nl_create_for_one_liner = true +# Don't split one-line for statements, as in 'for(...) b++;'. +nl_for_leave_one_liners = true + # Whether to remove a newline in simple unbraced while statements, turning # them into one-liners, as in 'while (expr)\n stmt;' => 'while (expr) stmt;'. nl_create_while_one_liner = true +# Don't split one-line while statements, as in 'while(...) b++;'. +nl_while_leave_one_liners = true + # Whether to collapse a function definition whose body (not counting braces) # is only one line so that the entire definition (prototype, braces, body) is # a single line. @@ -299,15 +314,6 @@ nl_func_leave_one_liners = true # Don't split one-line C++11 lambdas, as in '[]() { return 0; }'. nl_cpp_lambda_leave_one_liners = false -# Don't split one-line if/else statements, as in 'if(...) b++;'. -nl_if_leave_one_liners = true - -# Don't split one-line while statements, as in 'while(...) b++;'. -nl_while_leave_one_liners = true - -# Don't split one-line for statements, as in 'for(...) b++;'. -nl_for_leave_one_liners = true - # # Indentation # @@ -326,6 +332,13 @@ indent_cpp_lambda_body = true # false: indentation will be used every time (default) indent_cpp_lambda_only_once = true +# Convert CPP comments to C +cmt_cpp_to_c = false + +# Add or remove space after the opening of a C++ comment, +# i.e. '// A' vs. '//A'. +sp_cmt_cpp_start = add + # How to reflow comments. # # 0: No reflowing (apart from the line wrapping due to cmt_width) (default) @@ -333,10 +346,6 @@ indent_cpp_lambda_only_once = true # 2: Full reflow cmt_reflow_mode = 1 -# Whether to group cpp-comments that look like they are in a block. Only -# meaningful if cmt_cpp_to_c=true. -cmt_cpp_group = true - # Whether to put a star on subsequent comment lines. cmt_star_cont = true @@ -350,7 +359,6 @@ cmt_sp_after_star_cont = 1 # comments are left alone, unless used for indenting. cmt_convert_tab_to_spaces = true - # Add a newline before ')' if an if/for/while/switch condition spans multiple # lines. Overrides nl_before_if_closing_paren if both are specified. nl_multi_line_sparen_close = ignore @@ -363,5 +371,9 @@ nl_before_if_closing_paren = ignore # If set to ignore, use sp_assign. sp_assign_default = remove +# The span for aligning on '=' in assignments. +# 0: Don't align (default). +align_assign_span = 2 + # Whether to right-align numbers. align_number_right = true From 13d156012d418ae354a6b39df1ae97653f04dffc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 13 Jun 2020 18:18:30 -0500 Subject: [PATCH 15/18] Update SPI_TFT.h --- Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h index e1216097028c..7d01d7ac37c7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h @@ -37,19 +37,19 @@ class TFT { public: -void spi_init(uint8_t spiRate); -uint8_t spi_Rec(); -uint8_t spi_read_write_byte(uint8_t data); -void spi_Read(uint8_t* buf, uint16_t nbyte); -void spi_Send(uint8_t b); -void spi_SendBlock(uint8_t token, const uint8_t* buf); -void LCD_WR_REG(uint8_t cmd); -void LCD_WR_DATA(uint8_t data); -void SetCursor(uint16_t x, uint16_t y); -void SetWindows(uint16_t x, uint16_t y, uint16_t with, uint16_t height); -void LCD_init(); -void LCD_clear(uint16_t color); -void LCD_WriteRAM_Prepare(); + void spi_init(uint8_t spiRate); + uint8_t spi_Rec(); + uint8_t spi_read_write_byte(uint8_t data); + void spi_Read(uint8_t* buf, uint16_t nbyte); + void spi_Send(uint8_t b); + void spi_SendBlock(uint8_t token, const uint8_t* buf); + void LCD_WR_REG(uint8_t cmd); + void LCD_WR_DATA(uint8_t data); + void SetCursor(uint16_t x, uint16_t y); + void SetWindows(uint16_t x, uint16_t y, uint16_t with, uint16_t height); + void LCD_init(); + void LCD_clear(uint16_t color); + void LCD_WriteRAM_Prepare(); }; extern TFT SPI_TFT; From f9db5e677f1b8a8a7346048afa5e8927da364fd4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 15 Jun 2020 20:56:50 -0500 Subject: [PATCH 16/18] Formatting... --- .../src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp index 5f2de33813e7..5620af8c99fa 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -57,7 +57,7 @@ uint8_t DialogType; static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) { if (event == LV_EVENT_CLICKED) { - + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (DialogType == DIALOG_TYPE_PRINT_FILE) { @@ -133,9 +133,9 @@ static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) { } #if ENABLED(ADVANCED_PAUSE_FEATURE) else if (DialogType == DIALOG_PAUSE_MESSAGE_WAITING - || DialogType == DIALOG_PAUSE_MESSAGE_INSERT - || DialogType == DIALOG_PAUSE_MESSAGE_HEAT - ) { + || DialogType == DIALOG_PAUSE_MESSAGE_INSERT + || DialogType == DIALOG_PAUSE_MESSAGE_HEAT + ) { wait_for_user = false; } else if (DialogType == DIALOG_PAUSE_MESSAGE_OPTION) { @@ -151,7 +151,7 @@ static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) { static void btn_cancel_event_cb(lv_obj_t * btn, lv_event_t event) { if (event == LV_EVENT_CLICKED) { - + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (DialogType == DIALOG_PAUSE_MESSAGE_OPTION) { @@ -239,13 +239,14 @@ void lv_draw_dialog(uint8_t type) { lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text } else if (DialogType == DIALOG_PAUSE_MESSAGE_PAUSING - || DialogType == DIALOG_PAUSE_MESSAGE_CHANGING - || DialogType == DIALOG_PAUSE_MESSAGE_UNLOAD - || DialogType == DIALOG_PAUSE_MESSAGE_LOAD - || DialogType == DIALOG_PAUSE_MESSAGE_PURGE - || DialogType == DIALOG_PAUSE_MESSAGE_RESUME - || DialogType == DIALOG_PAUSE_MESSAGE_HEATING) { - + || DialogType == DIALOG_PAUSE_MESSAGE_CHANGING + || DialogType == DIALOG_PAUSE_MESSAGE_UNLOAD + || DialogType == DIALOG_PAUSE_MESSAGE_LOAD + || DialogType == DIALOG_PAUSE_MESSAGE_PURGE + || DialogType == DIALOG_PAUSE_MESSAGE_RESUME + || DialogType == DIALOG_PAUSE_MESSAGE_HEATING + ) { + // nothing to do } else { lv_obj_t * btnOk = lv_btn_create(scr, NULL); // Add a button the current screen From d58c6f641092e8dd1d6984a6adaddc729aa18851 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 15 Jun 2020 20:58:55 -0500 Subject: [PATCH 17/18] etc --- Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp | 5 +++++ Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp | 6 ++++++ Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp | 6 ++++++ Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp | 7 +++++++ Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp | 6 ++++++ Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp | 8 ++++++++ Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp | 8 ++++++++ Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp | 6 ++++++ Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp | 3 +++ Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp | 3 +++ Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp | 6 ++++++ Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp | 6 ++++++ 12 files changed, 70 insertions(+) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp index e2308e9463d7..6d44ecb71c1c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp @@ -52,6 +52,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_C_ADD: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (speedType == 0) { @@ -79,6 +80,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_C_DEC: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (speedType == 0) { @@ -106,6 +108,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_C_MOVE: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { speedType = 0; @@ -115,6 +118,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_C_EXT: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { speedType = 1; @@ -138,6 +142,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_C_RETURN: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { clear_cur_ui(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp index b356f5376a15..14d7ed0410ed 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp @@ -55,6 +55,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_E_ADD: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) { @@ -70,6 +71,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_E_DEC: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) { @@ -85,6 +87,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_E_TYPE: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (EXTRUDERS == 2) { @@ -108,6 +111,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_E_STEP: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { switch (abs(uiCfg.extruStep)) { @@ -121,6 +125,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_E_SPEED: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { switch (uiCfg.extruSpeed) { @@ -134,6 +139,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_E_RETURN: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { clear_cur_ui(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp index 60a9031154c4..d5bf62ab3e33 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp @@ -50,6 +50,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_F_ADD: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (fanSpeed + 1 <= 255) { @@ -62,6 +63,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_F_DEC: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (fanSpeed > 0) { @@ -75,6 +77,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_F_HIGH: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { queue.enqueue_one_now(PSTR("M106 S255")); @@ -82,6 +85,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_F_MID: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { queue.enqueue_one_now(PSTR("M106 S127")); @@ -89,6 +93,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_F_OFF: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { queue.enqueue_one_now(PSTR("M107")); @@ -96,6 +101,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_F_RETURN: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { clear_cur_ui(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp index 074a0bbc3e58..c5c77e898572 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp @@ -57,6 +57,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_CN: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language, UNSELECTED); @@ -68,6 +69,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_T_CN: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language, UNSELECTED); @@ -79,6 +81,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_EN: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language, UNSELECTED); @@ -90,6 +93,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_RU: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language, UNSELECTED); @@ -101,6 +105,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_ES: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language, UNSELECTED); @@ -112,6 +117,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_FR: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language, UNSELECTED); @@ -123,6 +129,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_IT: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language, UNSELECTED); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp index 4cc59ea5b35a..b97483ec9daa 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp @@ -47,6 +47,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_M_POINT1: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { @@ -67,6 +68,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_M_POINT2: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (queue.length == 0) { @@ -86,6 +88,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_M_POINT3: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (queue.length == 0) { @@ -106,6 +109,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_M_POINT4: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (queue.length == 0) { @@ -125,6 +129,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_M_POINT5: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (queue.length == 0) { @@ -145,6 +150,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_MANUAL_RETURN: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_clear_manualLevel(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp index 6cde142d9bf7..71d5d7427a14 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp @@ -49,6 +49,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_M_X_P: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (queue.length <= (BUFSIZE - 3)) { @@ -62,6 +63,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_M_X_N: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (queue.length <= (BUFSIZE - 3)) { @@ -75,6 +77,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_M_Y_P: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (queue.length <= (BUFSIZE - 3)) { @@ -88,6 +91,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_M_Y_N: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (queue.length <= (BUFSIZE - 3)) { @@ -101,6 +105,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_M_Z_P: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (queue.length <= (BUFSIZE - 3)) { @@ -114,6 +119,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_M_Z_N: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (queue.length <= (BUFSIZE - 3)) { @@ -127,6 +133,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_M_STEP: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (abs(10 * (int)uiCfg.move_dist) == 100) @@ -140,6 +147,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_M_RETURN: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { clear_cur_ui(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp index 64190f27581e..483de3fcc8d5 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp @@ -50,6 +50,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_O_PRE_HEAT: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_clear_opration(); @@ -58,6 +59,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_O_EXTRUCT: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_clear_opration(); @@ -66,6 +68,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_O_MOV: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_clear_opration(); @@ -74,12 +77,14 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_O_FILAMENT: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { } break; case ID_O_FAN: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_clear_opration(); @@ -88,6 +93,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_O_SPEED: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_clear_opration(); @@ -96,6 +102,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_O_RETURN: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { clear_cur_ui(); @@ -104,6 +111,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_O_POWER_OFF: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (gCfgItems.finish_power_off == 1) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp index 8aa1ed95c4c7..beea30018c3d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp @@ -50,6 +50,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_P_ADD: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (uiCfg.curTempType == 0) { @@ -86,6 +87,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_P_DEC: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (uiCfg.curTempType == 0) { @@ -116,6 +118,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_P_TYPE: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (uiCfg.curTempType == 0) { @@ -149,6 +152,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_P_STEP: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { switch (uiCfg.stepHeat) { @@ -162,6 +166,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_P_OFF: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (uiCfg.curTempType == 0) { @@ -179,6 +184,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_P_RETURN: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { clear_cur_ui(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp index 627b77e9c096..16c2f3374d03 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp @@ -66,6 +66,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_PAUSE: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (gcode_preview_over != 1) { @@ -107,6 +108,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_STOP: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (gcode_preview_over != 1) { @@ -117,6 +119,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_OPTION: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { if (gcode_preview_over != 1) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp index 442308b2cf5b..a3708ef3cc19 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp @@ -54,6 +54,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_TOOL: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { #if ENABLED(MKS_TEST) @@ -65,6 +66,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_SET: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_obj_del(scr); @@ -73,6 +75,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_PRINT: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_obj_del(scr); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp index 25932c94a36b..e41e943e8cb1 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp @@ -48,12 +48,14 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_S_WIFI: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { } break; case ID_S_FAN: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_obj_del(scr); @@ -62,6 +64,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_S_ABOUT: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_obj_del(scr); @@ -73,6 +76,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_S_MOTOR_OFF: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { #if HAS_SUICIDE @@ -84,6 +88,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_S_LANGUAGE: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_obj_del(scr); @@ -92,6 +97,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_S_RETURN: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_obj_del(scr); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp index ff801f77e933..dc87ec57173f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp @@ -52,6 +52,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_T_PRE_HEAT: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_clear_tool(); @@ -60,6 +61,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_T_EXTRUCT: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_clear_tool(); @@ -68,6 +70,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_T_MOV: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_clear_tool(); @@ -76,6 +79,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_T_HOME: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { lv_clear_tool(); @@ -84,6 +88,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { break; case ID_T_LEVELING: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) @@ -100,6 +105,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { case ID_T_MORE: break; case ID_T_RETURN: if (event == LV_EVENT_CLICKED) { + // nothing to do } else if (event == LV_EVENT_RELEASED) { TERN_(MKS_TEST, curent_disp_ui = 1); From 4ac9b040db6138e602cdebc9d90c9f2eb5dbbb45 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 15 Jun 2020 21:01:07 -0500 Subject: [PATCH 18/18] Update Configuration.h --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c0a5153d2b40..c907cc0a5240 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2117,7 +2117,7 @@ //#define FSMC_GRAPHICAL_TFT // -// TFT Little VGL UI +// TFT Little VGL UI // //#define TFT_LITTLE_VGL_UI