My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

menu_info.cpp 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. //
  23. // Info Menu
  24. //
  25. #include "../../inc/MarlinConfigPre.h"
  26. #if HAS_LCD_MENU && ENABLED(LCD_INFO_MENU)
  27. #include "menu.h"
  28. // #include "../../module/motion.h"
  29. // #include "../../module/planner.h"
  30. // #include "../../module/temperature.h"
  31. // #include "../../Marlin.h"
  32. // #if HAS_LEVELING
  33. // #include "../../feature/bedlevel/bedlevel.h"
  34. // #endif
  35. #if ENABLED(PRINTCOUNTER)
  36. #include "../../module/printcounter.h"
  37. //
  38. // About Printer > Printer Stats
  39. //
  40. void menu_info_stats() {
  41. if (ui.use_click()) return ui.goto_previous_screen();
  42. char buffer[21];
  43. printStatistics stats = print_job_timer.getStats();
  44. START_SCREEN(); // 12345678901234567890
  45. STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, i16tostr3left(stats.totalPrints)); // Print Count: 999
  46. STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS": ", false, false, i16tostr3left(stats.finishedPrints)); // Completed : 666
  47. duration_t elapsed = stats.printTime;
  48. elapsed.toString(buffer);
  49. STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false); // Total print Time:
  50. STATIC_ITEM("", false, false, buffer); // 99y 364d 23h 59m 59s
  51. elapsed = stats.longestPrint;
  52. elapsed.toString(buffer);
  53. STATIC_ITEM(MSG_INFO_PRINT_LONGEST ": ", false, false); // Longest job time:
  54. STATIC_ITEM("", false, false, buffer); // 99y 364d 23h 59m 59s
  55. sprintf_P(buffer, PSTR("%ld.%im"), long(stats.filamentUsed / 1000), int16_t(stats.filamentUsed / 100) % 10);
  56. STATIC_ITEM(MSG_INFO_PRINT_FILAMENT ": ", false, false); // Extruded total:
  57. STATIC_ITEM("", false, false, buffer); // 125m
  58. END_SCREEN();
  59. }
  60. #endif
  61. //
  62. // About Printer > Thermistors
  63. //
  64. void menu_info_thermistors() {
  65. if (ui.use_click()) return ui.goto_previous_screen();
  66. START_SCREEN();
  67. #define THERMISTOR_ID TEMP_SENSOR_0
  68. #include "../thermistornames.h"
  69. STATIC_ITEM("T0: " THERMISTOR_NAME, false, true);
  70. STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_0_MINTEMP), false);
  71. STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_0_MAXTEMP), false);
  72. #if TEMP_SENSOR_1 != 0
  73. #undef THERMISTOR_ID
  74. #define THERMISTOR_ID TEMP_SENSOR_1
  75. #include "../thermistornames.h"
  76. STATIC_ITEM("T1: " THERMISTOR_NAME, false, true);
  77. STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_1_MINTEMP), false);
  78. STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_1_MAXTEMP), false);
  79. #endif
  80. #if TEMP_SENSOR_2 != 0
  81. #undef THERMISTOR_ID
  82. #define THERMISTOR_ID TEMP_SENSOR_2
  83. #include "../thermistornames.h"
  84. STATIC_ITEM("T2: " THERMISTOR_NAME, false, true);
  85. STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_2_MINTEMP), false);
  86. STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_2_MAXTEMP), false);
  87. #endif
  88. #if TEMP_SENSOR_3 != 0
  89. #undef THERMISTOR_ID
  90. #define THERMISTOR_ID TEMP_SENSOR_3
  91. #include "../thermistornames.h"
  92. STATIC_ITEM("T3: " THERMISTOR_NAME, false, true);
  93. STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_3_MINTEMP), false);
  94. STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_3_MAXTEMP), false);
  95. #endif
  96. #if TEMP_SENSOR_4 != 0
  97. #undef THERMISTOR_ID
  98. #define THERMISTOR_ID TEMP_SENSOR_4
  99. #include "../thermistornames.h"
  100. STATIC_ITEM("T4: " THERMISTOR_NAME, false, true);
  101. STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_4_MINTEMP), false);
  102. STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_4_MAXTEMP), false);
  103. #endif
  104. #if HAS_HEATED_BED
  105. #undef THERMISTOR_ID
  106. #define THERMISTOR_ID TEMP_SENSOR_BED
  107. #include "../thermistornames.h"
  108. STATIC_ITEM("TBed:" THERMISTOR_NAME, false, true);
  109. STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(BED_MINTEMP), false);
  110. STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(BED_MAXTEMP), false);
  111. #endif
  112. END_SCREEN();
  113. }
  114. //
  115. // About Printer > Board Info
  116. //
  117. void menu_info_board() {
  118. if (ui.use_click()) return ui.goto_previous_screen();
  119. START_SCREEN();
  120. STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController
  121. STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000
  122. STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION, true); // Protocol: 1.0
  123. #if POWER_SUPPLY == 0
  124. STATIC_ITEM(MSG_INFO_PSU ": Generic", true);
  125. #elif POWER_SUPPLY == 1
  126. STATIC_ITEM(MSG_INFO_PSU ": ATX", true); // Power Supply: ATX
  127. #elif POWER_SUPPLY == 2
  128. STATIC_ITEM(MSG_INFO_PSU ": XBox", true); // Power Supply: XBox
  129. #endif
  130. END_SCREEN();
  131. }
  132. //
  133. // About Printer > Printer Info
  134. //
  135. void menu_info_printer() {
  136. if (ui.use_click()) return ui.goto_previous_screen();
  137. START_SCREEN();
  138. STATIC_ITEM(MSG_MARLIN, true, true); // Marlin
  139. STATIC_ITEM(SHORT_BUILD_VERSION, true); // x.x.x-Branch
  140. STATIC_ITEM(STRING_DISTRIBUTION_DATE, true); // YYYY-MM-DD HH:MM
  141. STATIC_ITEM(MACHINE_NAME, true); // My3DPrinter
  142. STATIC_ITEM(WEBSITE_URL, true); // www.my3dprinter.com
  143. STATIC_ITEM(MSG_INFO_EXTRUDERS ": " STRINGIFY(EXTRUDERS), true); // Extruders: 2
  144. #if ENABLED(AUTO_BED_LEVELING_3POINT)
  145. STATIC_ITEM(MSG_3POINT_LEVELING, true); // 3-Point Leveling
  146. #elif ENABLED(AUTO_BED_LEVELING_LINEAR)
  147. STATIC_ITEM(MSG_LINEAR_LEVELING, true); // Linear Leveling
  148. #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
  149. STATIC_ITEM(MSG_BILINEAR_LEVELING, true); // Bi-linear Leveling
  150. #elif ENABLED(AUTO_BED_LEVELING_UBL)
  151. STATIC_ITEM(MSG_UBL_LEVELING, true); // Unified Bed Leveling
  152. #elif ENABLED(MESH_BED_LEVELING)
  153. STATIC_ITEM(MSG_MESH_LEVELING, true); // Mesh Leveling
  154. #endif
  155. END_SCREEN();
  156. }
  157. //
  158. // "About Printer" submenu
  159. //
  160. void menu_info() {
  161. START_MENU();
  162. MENU_BACK(MSG_MAIN);
  163. MENU_ITEM(submenu, MSG_INFO_PRINTER_MENU, menu_info_printer); // Printer Info >
  164. MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, menu_info_board); // Board Info >
  165. MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, menu_info_thermistors); // Thermistors >
  166. #if ENABLED(PRINTCOUNTER)
  167. MENU_ITEM(submenu, MSG_INFO_STATS_MENU, menu_info_stats); // Printer Stats >
  168. #endif
  169. END_MENU();
  170. }
  171. #endif // HAS_LCD_MENU && LCD_INFO_MENU