From fcb6245a727a22a45a0edc4056801dc8cbe59c39 Mon Sep 17 00:00:00 2001 From: CChen616 <714434105@qq.com> Date: Mon, 15 Jan 2024 10:46:06 +0800 Subject: [PATCH] PLUS_V4.2.13 update --- README.md | 58 ++++++----------------- include/event.h | 2 + include/ui.h | 15 +++++- src/event.cpp | 52 +++++++++++---------- src/ui.cpp | 120 ++++++++++++++++++++++++++++++++++-------------- version | 4 +- 6 files changed, 147 insertions(+), 104 deletions(-) diff --git a/README.md b/README.md index b1e1a4f..4ba6ca7 100644 --- a/README.md +++ b/README.md @@ -2,45 +2,28 @@

GPL-V3.0 License

# Document Instructions + QIDI_PLUS3 is a server-side software that interacts with the screen in the Plus3 model system. This document contains our source code, and we provide the safer solution to update it: Download the packaged file to a USB drive and insert it into the machine for updating.
QIDI provides a packaged version file in the version bar next to it. Please download the compressed package file starting with PLUS. We have provided multiple different versions of source code. Please select the branch you want to download, and the name of the branch is the corresponding version name. -## 4.2.12 Update content - -### **FUNCTIONALITY UPDATE** - -
    -
  1. Enhanced Filament Loading/Unloading During Printing: Modified the logic for filament loading and unloading. For unloading, a prompt to cut the filament is displayed.
  2. -
  3. Modified Filament Loading Sizes: Options for filament loading sizes are now 20mm, 50mm, and 100mm.
  4. -
  5. Deletion of Previous Print Cache Files Upon Update: The update will now automatically delete previously stored print cache files.
  6. -
  7. -Updated Default Save Parameters: By default, the filament runout detection will be enabled after the update. -
  8. -
  9. Preservation of Original Offset Values: The compensation values in the klipper_config/configuration will be retained post-update. -
  10. -
  11. Removal of Last Travel Distance in Leveling Record: The leveling process now starts from zero travel distance.
  12. -
  13. Modifications to Hidden WIFI Functionality: The interface now includes an option to input a hidden WIFI network.
  14. -
+## 4.2.13 Update content -### **UI UPDATE**
    -
  1. UI Changes for Filament Runout Detection: Modified the interface icons corresponding to the enable/disable state during printing.
  2. -
  3. Memory Full Pop-Up Notification: Added a notification for when the memory is full.
  4. -
  5. Addition of an 'Updating' Interface: Introduced an interface screen that displays during updates.
  6. -
-### **BUG FIX** -
    -
  1. Fixed Leveling Completion Screen Freeze: Removed the conditional check after pressing the button, allowing for an unconditional transition to the next screen.
  2. +
  3. SOC Update: WiFi settings will be preserved after updates.
  4. +
  5. Material Handling: Improved logic for material feeding and retraction.
  6. +
  7. Heating Limit: Maximum chamber heating restricted to 65 degrees Celsius.
  8. +
  9. Factory Reset: Also clears web-based print records and accumulated time.
  10. +
  11. SSH Login: Added login info .
## Detailed update process -#### Packaged files -Note that all updates can not be updated from higher versions +#### Packaged files +Note that all updates can not be updated from higher versions 1. Select the latest version in the version release bar next to it, download the compressed file package starting with PLUS and extract it locally.Jump link @@ -50,13 +33,10 @@ Note that all updates can not be updated from higher versions 3. Insert the USB drive into the machine's USB interface, and an update prompt will appear on the version information interface. Click the update button to restart according to the prompt. - - - ## Report Issues and Make Suggestions -***You can contact [After-Sales Service](https://qidi3d.com/pages/warranty-policy-after-sales-support) to report issues and make suggestions.*** -***You can directly contact our after-sales team for any issues related to machine mechanics, slicing software, firmware, and various machine issues. They will reply to your questions within twelve hours.*** +**_You can contact [After-Sales Service](https://qidi3d.com/pages/warranty-policy-after-sales-support) to report issues and make suggestions._** +**_You can directly contact our after-sales team for any issues related to machine mechanics, slicing software, firmware, and various machine issues. They will reply to your questions within twelve hours._** ## Others @@ -64,15 +44,7 @@ Different from the usual method of directly accessing the fluid page through an The 3D printers of QIDI are based on Klipper.On the basic of Klipper open source project, we have made some modifications to it's source code to meet some of the user's needs.At the same time, we have also made modifications to Moonraker, so that the screens we set can correspond to the operations on the page. Thanks to the developers and maintainers of these open source projects.Please consider using or supporting these powerful projects. - Software | QIDI edition - ----|---- -**Klipper** | **[https://github.com/QIDITECH/klipper](https://github.com/QIDITECH/klipper)** -**Moonraker** | **[https://github.com/QIDITECH/moonrake](https://github.com/QIDITECH/moonrake)** - - - - - - - - +| Software | QIDI edition | +| ------------- | -------------------------------------------------------------------------------- | +| **Klipper** | **[https://github.com/QIDITECH/klipper](https://github.com/QIDITECH/klipper)** | +| **Moonraker** | **[https://github.com/QIDITECH/moonrake](https://github.com/QIDITECH/moonrake)** | diff --git a/include/event.h b/include/event.h index 0927d26..6112e92 100644 --- a/include/event.h +++ b/include/event.h @@ -263,4 +263,6 @@ void send_gcode(std::string command); void refresh_page_loading(); +void refresh_page_pre_heating_2(); + #endif diff --git a/include/ui.h b/include/ui.h index dd2b91a..fea432d 100644 --- a/include/ui.h +++ b/include/ui.h @@ -695,7 +695,7 @@ #define TJC_PAGE_PRINT_LOG_F 118 #define TJC_PAGE_PRINT_LOG_YES 0x00 -#define TJC_PAGE_LOADING 119 +#define TJC_PAGE_PRE_HEATING_2 119 #define TJC_PAGE_LOAD_FINISH 120 #define TJC_PAGE_LOAD_FINISH_YES 0x00 @@ -703,12 +703,25 @@ #define TJC_PAGE_PRE_UNLOAD 121 #define TJC_PAGE_PRE_UNLOAD_NEXT 0x00 +#define TJC_PAGE_PRE_UNLOAD_BACK 0x01 #define TJC_PAGE_MEMORY_WARNING 122 #define TJC_PAGE_MEMORY_WARNING_YES 0x00 #define TJC_PAGE_UPDATING 123 +#define TJC_PAGE_PRE_LOAD 124 +#define TJC_PAGE_PRE_LOAD_NEXT 0x00 +#define TJC_PAGE_PRE_LOAD_BACK 0x01 + +#define TJC_PAGE_LOADING 125 + +#define TJC_PAGE_PRE_HEATING_1 126 +#define TJC_PAGE_PRE_HEATING_1_SET_1 0x00 +#define TJC_PAGE_PRE_HEATING_1_SET_2 0x01 +#define TJC_PAGE_PRE_HEATING_1_SET_3 0x02 +#define TJC_PAGE_PRE_HEATING_1_BACK 0x04 + #endif diff --git a/src/event.cpp b/src/event.cpp index 84da316..4ed2172 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -344,6 +344,9 @@ std::string previous_zoffset; //4.2.5 CLL 新增息屏功能 extern bool previous_caselight_value; +extern int load_target; +extern bool load_mode; + /* 更新页面处理 */ void refresh_page_show() { if (current_page_id != TJC_PAGE_PRINTING) { @@ -718,6 +721,10 @@ void refresh_page_show() { refresh_page_loading(); break; + case TJC_PAGE_PRE_HEATING_2: + refresh_page_pre_heating_2(); + break; + default: break; } @@ -2973,7 +2980,7 @@ void start_retract() { send_cmd_vid(tty_fd, "gm0", "9"); // send_cmd_vid_en(tty_fd, "gm0", 1); } else if (current_page_id == TJC_PAGE_PRINT_FILAMENT) { - send_cmd_vid(tty_fd, "gm0", "2"); + // send_cmd_vid(tty_fd, "gm0", "2"); // send_cmd_vid_en(tty_fd, "gm0", 1); } } @@ -2984,7 +2991,7 @@ void start_extrude() { send_cmd_vid(tty_fd, "gm0", "10"); // send_cmd_vid_en(tty_fd, "gm0", 1); } else if (current_page_id == TJC_PAGE_PRINT_FILAMENT) { - send_cmd_vid(tty_fd, "gm0", "3"); + // send_cmd_vid(tty_fd, "gm0", "3"); } } @@ -3688,12 +3695,8 @@ void filament_unload() { // 加热到280度后自动退料 //2023.4.25-5 修改自动退料 //ep->Send(json_run_a_gcode("M84\nM109 T0 S280\nM83\nG1 E10 F300\nG1 E-90 F300\n")); // 退料先解锁电机 - if (printer_extruder_target >= 250) { - ep->Send(json_run_a_gcode("M109 S" + std::to_string(printer_extruder_target) + "\n")); - }else { - ep->Send(json_run_a_gcode("M109 S250 \n")); - } - ep->Send(json_run_a_gcode("M603")); + ep->Send(json_run_a_gcode("M109 S" + std::to_string(load_target) + "\n")); + ep->Send(json_run_a_gcode("M604\n")); //4.2.4 CLL 修复断料检测与退料冲突bug //if (previous_filament_sensor_state == true) { @@ -3703,11 +3706,7 @@ void filament_unload() { } void filament_load() { - if (printer_extruder_target >= 250) { - ep->Send(json_run_a_gcode("M109 S" + std::to_string(printer_extruder_target) + "\n")); - } else { - ep->Send(json_run_a_gcode("M109 S250\n")); - } + ep->Send(json_run_a_gcode("M109 S" + std::to_string(load_target) + "\n")); ep->Send(json_run_a_gcode("M604\n")); } @@ -4111,22 +4110,12 @@ void check_filament_type() { //2.1.2 CLL 新增退料界面 void refresh_page_unloading() { if (printer_idle_timeout_state == "Ready") { - if (printer_print_stats_state == "paused") { - send_cmd_pic(tty_fd, "unload_finish.b[0]", "441"); - } else { - send_cmd_pic(tty_fd, "unload_finish.b[0]", "443"); - } page_to(TJC_PAGE_UNLOAD_FINISH); } } void refresh_page_loading() { if (printer_idle_timeout_state == "Ready") { - if (printer_print_stats_state == "paused") { - send_cmd_pic(tty_fd, "load_finish.b[0]", "441"); - } else { - send_cmd_pic(tty_fd, "load_finish.b[0]", "443"); - } page_to(TJC_PAGE_LOAD_FINISH); } } @@ -4206,7 +4195,11 @@ void refresh_page_open_level() { //4.2.7 CLL 新增恢复出厂设置功能 void restore_config() { - system("cp /home/mks/klipper_config/config.mksini.bak /home/mks/klipper_config/config.mksini"); + system("rm /home/mks/gcode_files/.cache/*"); + system("curl -X POST http://127.0.0.1:7125/server/history/reset_totals"); + system("curl -X DELETE 'http://127.0.0.1:7125/server/history/job?all=true'"); + system("rm /home/mks/gcode_files/.cache/*\n"); + system("cp /home/mks/klipper_config/config.mksini.bak /home/mks/klipper_config/config.mksini\n"); //ep->Send(json_run_a_gcode("BED_MESH_PROFILE REMOVE=\"default\"\nSAVE_CONFIG")); //sleep(1); //page_to(TJC_PAGE_RESTORING); @@ -4244,4 +4237,15 @@ void filament_sensor_switch(bool status) { //4.2.10 CLL 新增共振补偿超时强制跳转 void send_gcode(std::string command) { ep->Send(json_run_a_gcode(command)); +} + +void refresh_page_pre_heating_2() { + send_cmd_txt(tty_fd, "t1", "(" + std::to_string(printer_extruder_temperature) + "/" + std::to_string(printer_extruder_target) + ")"); + if (printer_extruder_temperature == load_target) { + if (load_mode == true) { + page_to(TJC_PAGE_LOADING); + } else { + page_to(TJC_PAGE_UNLOADING); + } + } } \ No newline at end of file diff --git a/src/ui.cpp b/src/ui.cpp index 7760439..604f58e 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -133,6 +133,9 @@ extern float printer_caselight_value; //4.2.7 CLL 防止在预览图界面卡死 extern bool jump_to_print; +int load_target; +bool load_mode; + void parse_cmd_msg_from_tjc_screen(char *cmd) { event_id = cmd[0]; MKSLOG_BLUE("#########################%s", cmd); @@ -996,12 +999,14 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) { case TJC_PAGE_PRINT_FILAMENT_RETRACT: printer_idle_timeout_state = "Printing"; page_print_filament_extrude_restract_button = true; - start_retract(); + // start_retract(); + send_gcode("M603\n"); break; case TJC_PAGE_PRINT_FILAMENT_EXTRUDE: printer_idle_timeout_state = "Printing"; page_print_filament_extrude_restract_button = true; + set_print_filament_dist(50); start_extrude(); break; @@ -1018,17 +1023,17 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) { break; case TJC_PAGE_PRINT_FILAMENT_UNLOAD: - send_cmd_pic(tty_fd, "pre_unload.b[0]", "445"); - page_to(TJC_PAGE_PRE_UNLOAD); - send_cmd_picc(tty_fd, "b0", "445"); - send_cmd_picc2(tty_fd, "b0", "444"); + if (printer_print_stats_state == "paused") { + load_mode = false; + page_to(TJC_PAGE_PRE_HEATING_1); + } break; case TJC_PAGE_PRINT_FILAMENT_LOAD: - printer_idle_timeout_state = "Printing"; - filament_load(); - send_cmd_pic(tty_fd, "loading.b[0]", "438"); - page_to(TJC_PAGE_LOADING); + if (printer_print_stats_state == "paused") { + load_mode = true; + page_to(TJC_PAGE_PRE_HEATING_1); + } break; default: @@ -1258,17 +1263,14 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) { page_filament_unload_button = false; } */ - send_cmd_pic(tty_fd, "pre_unload.b[0]", "439"); - page_to(TJC_PAGE_PRE_UNLOAD); - send_cmd_picc(tty_fd, "b0", "439"); - send_cmd_picc2(tty_fd, "b0", "440"); + load_mode = false; + page_to(TJC_PAGE_PRE_HEATING_1); break; case TJC_PAGE_FILAMENT_LOAD: - printer_idle_timeout_state = "Printing"; - filament_load(); - send_cmd_pic(tty_fd, "loading.b[0]", "429"); - page_to(TJC_PAGE_LOADING); + move_motors_off(); + load_mode = true; + page_to(TJC_PAGE_PRE_HEATING_1); break; case TJC_PAGE_FILAMENT_BTN_RETRACT: @@ -3461,14 +3463,52 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) { case TJC_PAGE_LOAD_FINISH_RETRY: printer_idle_timeout_state = "Printing"; filament_load(); + page_to(TJC_PAGE_LOADING); + break; + + default: + break; + } + break; + + case TJC_PAGE_PRE_HEATING_1: + switch (widget_id) + { + case TJC_PAGE_PRE_HEATING_1_SET_1: + load_target = 220; + if (load_mode == true) { + page_to(TJC_PAGE_PRE_LOAD); + } else { + page_to(TJC_PAGE_PRE_UNLOAD); + } + break; + + case TJC_PAGE_PRE_HEATING_1_SET_2: + load_target = 250; + if (load_mode == true) { + page_to(TJC_PAGE_PRE_LOAD); + } else { + page_to(TJC_PAGE_PRE_UNLOAD); + } + break; + + case TJC_PAGE_PRE_HEATING_1_SET_3: + load_target = 300; + if (load_mode == true) { + page_to(TJC_PAGE_PRE_LOAD); + } else { + page_to(TJC_PAGE_PRE_UNLOAD); + } + break; + + case TJC_PAGE_PRE_HEATING_1_BACK: if (printer_print_stats_state == "paused") { - send_cmd_pic(tty_fd, "loading.b[0]", "438"); + page_to(TJC_PAGE_PRINT_FILAMENT); } else { - send_cmd_pic(tty_fd, "loading.b[0]", "429"); + page_to(TJC_PAGE_FILAMENT); } - page_to(TJC_PAGE_LOADING); break; - + default: break; } @@ -3480,12 +3520,11 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) { case TJC_PAGE_PRE_UNLOAD_NEXT: printer_idle_timeout_state = "Printing"; filament_unload(); - if (printer_print_stats_state == "paused") { - send_cmd_pic(tty_fd, "unloading.b[0]", "438"); - } else { - send_cmd_pic(tty_fd, "unloading.b[0]", "429"); - } - page_to(TJC_PAGE_UNLOADING); + page_to(TJC_PAGE_PRE_HEATING_2); + break; + + case TJC_PAGE_PRE_UNLOAD_BACK: + page_to(TJC_PAGE_PRE_HEATING_1); break; default: @@ -3505,6 +3544,24 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) { } break; + case TJC_PAGE_PRE_LOAD: + switch (widget_id) + { + case TJC_PAGE_PRE_LOAD_NEXT: + printer_idle_timeout_state = "Printing"; + filament_load(); + page_to(TJC_PAGE_PRE_HEATING_2); + break; + + case TJC_PAGE_PRE_LOAD_BACK: + page_to(TJC_PAGE_PRE_HEATING_1); + break; + + default: + break; + } + break; + case TJC_PAGE_UNLOAD_FINISH: switch (widget_id) { @@ -3519,13 +3576,8 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) { case TJC_PAGE_UNLOAD_FINISH_RELOAD: printer_idle_timeout_state = "Printing"; - filament_load(); - if (printer_print_stats_state == "paused") { - send_cmd_pic(tty_fd, "b[0]", "438"); - } else { - send_cmd_pic(tty_fd, "b[0]", "429"); - } - page_to(TJC_PAGE_LOADING); + load_mode = true; + page_to(TJC_PAGE_PRE_HEATING_1); break; default: diff --git a/version b/version index 515f2a6..18a4a35 100644 --- a/version +++ b/version @@ -1,4 +1,4 @@ [version] mcu = V0.10.0 -ui = V4.2.0 -soc = V4.2.0 \ No newline at end of file +ui = V4.2.13 +soc = V4.2.13 \ No newline at end of file