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.

DGUSDisplayDefinitionFYSETC.cpp 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 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. /* DGUS VPs changed by George Fu in 2019 for Marlin */
  23. #include "../../../../inc/MarlinConfigPre.h"
  24. #if ENABLED(DGUS_LCD_UI_FYSETC)
  25. #include "DGUSDisplayDefinition.h"
  26. #include "DGUSDisplay.h"
  27. #include "../../../../module/temperature.h"
  28. #include "../../../../module/motion.h"
  29. #include "../../../../module/planner.h"
  30. #include "../../ui_api.h"
  31. #include "../../../ultralcd.h"
  32. #if ENABLED(DUGS_UI_MOVE_DIS_OPTION)
  33. uint16_t distanceToMove = 0.1;
  34. #endif
  35. const uint16_t VPList_Boot[] PROGMEM = {
  36. VP_MARLIN_VERSION,
  37. 0x0000
  38. };
  39. const uint16_t VPList_Main[] PROGMEM = {
  40. /* VP_M117, for completeness, but it cannot be auto-uploaded. */
  41. #if HOTENDS >= 1
  42. VP_T_E0_Is, VP_T_E0_Set, VP_E0_STATUS,
  43. #endif
  44. #if HOTENDS >= 2
  45. VP_T_E1_Is, VP_T_E1_Set,
  46. #endif
  47. #if HAS_HEATED_BED
  48. VP_T_Bed_Is, VP_T_Bed_Set, VP_BED_STATUS,
  49. #endif
  50. #if FAN_COUNT > 0
  51. VP_Fan0_Percentage, VP_FAN0_STATUS,
  52. #endif
  53. VP_XPos, VP_YPos, VP_ZPos,
  54. VP_Fan0_Percentage,
  55. VP_Feedrate_Percentage,
  56. #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
  57. VP_PrintProgress_Percentage,
  58. #endif
  59. 0x0000
  60. };
  61. const uint16_t VPList_Temp[] PROGMEM = {
  62. #if HOTENDS >= 1
  63. VP_T_E0_Is, VP_T_E0_Set,
  64. #endif
  65. #if HOTENDS >= 2
  66. VP_T_E1_Is, VP_T_E1_Set,
  67. #endif
  68. #if HAS_HEATED_BED
  69. VP_T_Bed_Is, VP_T_Bed_Set,
  70. #endif
  71. 0x0000
  72. };
  73. const uint16_t VPList_Status[] PROGMEM = {
  74. /* VP_M117, for completeness, but it cannot be auto-uploaded */
  75. #if HOTENDS >= 1
  76. VP_T_E0_Is, VP_T_E0_Set,
  77. #endif
  78. #if HOTENDS >= 2
  79. VP_T_E1_Is, VP_T_E1_Set,
  80. #endif
  81. #if HAS_HEATED_BED
  82. VP_T_Bed_Is, VP_T_Bed_Set,
  83. #endif
  84. #if FAN_COUNT > 0
  85. VP_Fan0_Percentage,
  86. #endif
  87. VP_XPos, VP_YPos, VP_ZPos,
  88. VP_Fan0_Percentage,
  89. VP_Feedrate_Percentage,
  90. VP_PrintProgress_Percentage,
  91. 0x0000
  92. };
  93. const uint16_t VPList_Status2[] PROGMEM = {
  94. /* VP_M117, for completeness, but it cannot be auto-uploaded */
  95. #if HOTENDS >= 1
  96. VP_Flowrate_E0,
  97. #endif
  98. #if HOTENDS >= 2
  99. VP_Flowrate_E1,
  100. #endif
  101. VP_PrintProgress_Percentage,
  102. VP_PrintTime,
  103. 0x0000
  104. };
  105. const uint16_t VPList_Preheat[] PROGMEM = {
  106. #if HOTENDS >= 1
  107. VP_T_E0_Is, VP_T_E0_Set,
  108. #endif
  109. #if HOTENDS >= 2
  110. VP_T_E1_Is, VP_T_E1_Set,
  111. #endif
  112. #if HAS_HEATED_BED
  113. VP_T_Bed_Is, VP_T_Bed_Set,
  114. #endif
  115. 0x0000
  116. };
  117. const uint16_t VPList_ManualMove[] PROGMEM = {
  118. VP_XPos, VP_YPos, VP_ZPos,
  119. 0x0000
  120. };
  121. const uint16_t VPList_ManualExtrude[] PROGMEM = {
  122. #if HOTENDS >= 1
  123. VP_T_E0_Is, VP_T_E0_Set,
  124. #endif
  125. #if HOTENDS >= 2
  126. VP_T_E1_Is, VP_T_E1_Set,
  127. #endif
  128. VP_EPos,
  129. 0x0000
  130. };
  131. const uint16_t VPList_FanAndFeedrate[] PROGMEM = {
  132. VP_Feedrate_Percentage, VP_Fan0_Percentage,
  133. 0x0000
  134. };
  135. const uint16_t VPList_SD_FlowRates[] PROGMEM = {
  136. VP_Flowrate_E0, VP_Flowrate_E1,
  137. 0x0000
  138. };
  139. const uint16_t VPList_Filament_heating[] PROGMEM = {
  140. #if HOTENDS >= 1
  141. VP_T_E0_Is, VP_T_E0_Set,
  142. VP_E0_FILAMENT_LOAD_UNLOAD,
  143. #endif
  144. #if HOTENDS >= 2
  145. VP_T_E1_Is, VP_T_E1_Set,
  146. VP_E1_FILAMENT_LOAD_UNLOAD,
  147. #endif
  148. 0x0000
  149. };
  150. const uint16_t VPList_Filament_load_unload[] PROGMEM = {
  151. #if HOTENDS >= 1
  152. VP_E0_FILAMENT_LOAD_UNLOAD,
  153. #endif
  154. #if HOTENDS >= 2
  155. VP_E1_FILAMENT_LOAD_UNLOAD,
  156. #endif
  157. 0x0000
  158. };
  159. const uint16_t VPList_SDFileList[] PROGMEM = {
  160. VP_SD_FileName0, VP_SD_FileName1, VP_SD_FileName2, VP_SD_FileName3, VP_SD_FileName4,
  161. 0x0000
  162. };
  163. const uint16_t VPList_SD_PrintManipulation[] PROGMEM = {
  164. VP_PrintProgress_Percentage, VP_PrintTime,
  165. #if HOTENDS >= 1
  166. VP_T_E0_Is, VP_T_E0_Set,
  167. #endif
  168. #if HOTENDS >= 2
  169. VP_T_E1_Is, VP_T_E1_Set,
  170. #endif
  171. #if HAS_HEATED_BED
  172. VP_T_Bed_Is, VP_T_Bed_Set,
  173. #endif
  174. #if FAN_COUNT > 0
  175. VP_Fan0_Percentage,
  176. #if FAN_COUNT > 1
  177. VP_Fan1_Percentage,
  178. #endif
  179. #endif
  180. VP_Flowrate_E0,
  181. 0x0000
  182. };
  183. const uint16_t VPList_SDPrintTune[] PROGMEM = {
  184. #if HOTENDS >= 1
  185. VP_T_E0_Is, VP_T_E0_Set, VP_Flowrate_E0,
  186. #endif
  187. #if HOTENDS >= 2
  188. VP_T_E1_Is, VP_T_E1_Set, VP_Flowrate_E1,
  189. #endif
  190. #if HAS_HEATED_BED
  191. VP_T_Bed_Is, VP_T_Bed_Set,
  192. #endif
  193. VP_Feedrate_Percentage,
  194. VP_SD_Print_ProbeOffsetZ,
  195. 0x0000
  196. };
  197. const uint16_t VPList_StepPerMM[] PROGMEM = {
  198. VP_X_STEP_PER_MM,
  199. VP_Y_STEP_PER_MM,
  200. VP_Z_STEP_PER_MM,
  201. #if HOTENDS >= 1
  202. VP_E0_STEP_PER_MM,
  203. #endif
  204. #if HOTENDS >= 2
  205. VP_E1_STEP_PER_MM,
  206. #endif
  207. 0x0000
  208. };
  209. const uint16_t VPList_PIDE0[] PROGMEM = {
  210. #if ENABLED(PIDTEMP)
  211. VP_E0_PID_P,
  212. VP_E0_PID_I,
  213. VP_E0_PID_D,
  214. #endif
  215. 0x0000
  216. };
  217. const uint16_t VPList_PIDBED[] PROGMEM = {
  218. #if ENABLED(PIDTEMP)
  219. VP_BED_PID_P,
  220. VP_BED_PID_I,
  221. VP_BED_PID_D,
  222. #endif
  223. 0x0000
  224. };
  225. const uint16_t VPList_Infos[] PROGMEM = {
  226. VP_MARLIN_VERSION,
  227. VP_PrintTime,
  228. #if ENABLED(PRINTCOUNTER)
  229. VP_PrintAccTime,
  230. VP_PrintsTotal,
  231. #endif
  232. 0x0000
  233. };
  234. const uint16_t VPList_PIDTuningWaiting[] PROGMEM = {
  235. VP_WAITING_STATUS,
  236. 0x0000
  237. };
  238. const uint16_t VPList_FLCPreheat[] PROGMEM = {
  239. #if HOTENDS >= 1
  240. VP_T_E0_Is, VP_T_E0_Set,
  241. #endif
  242. #if HAS_HEATED_BED
  243. VP_T_Bed_Is, VP_T_Bed_Set,
  244. #endif
  245. 0x0000
  246. };
  247. const uint16_t VPList_FLCPrinting[] PROGMEM = {
  248. #if HOTENDS >= 1
  249. VP_SD_Print_ProbeOffsetZ,
  250. #endif
  251. 0x0000
  252. };
  253. const uint16_t VPList_Z_Offset[] PROGMEM = {
  254. #if HOTENDS >= 1
  255. VP_SD_Print_ProbeOffsetZ,
  256. #endif
  257. 0x0000
  258. };
  259. const struct VPMapping VPMap[] PROGMEM = {
  260. { DGUSLCD_SCREEN_BOOT, VPList_Boot },
  261. { DGUSLCD_SCREEN_MAIN, VPList_Main },
  262. { DGUSLCD_SCREEN_TEMPERATURE, VPList_Temp },
  263. { DGUSLCD_SCREEN_STATUS, VPList_Status },
  264. { DGUSLCD_SCREEN_STATUS2, VPList_Status2 },
  265. { DGUSLCD_SCREEN_PREHEAT, VPList_Preheat },
  266. { DGUSLCD_SCREEN_MANUALMOVE, VPList_ManualMove },
  267. { DGUSLCD_SCREEN_MANUALEXTRUDE, VPList_ManualExtrude },
  268. { DGUSLCD_SCREEN_FILAMENT_HEATING, VPList_Filament_heating },
  269. { DGUSLCD_SCREEN_FILAMENT_LOADING, VPList_Filament_load_unload },
  270. { DGUSLCD_SCREEN_FILAMENT_UNLOADING, VPList_Filament_load_unload },
  271. { DGUSLCD_SCREEN_SDPRINTMANIPULATION, VPList_SD_PrintManipulation },
  272. { DGUSLCD_SCREEN_SDFILELIST, VPList_SDFileList },
  273. { DGUSLCD_SCREEN_SDPRINTTUNE, VPList_SDPrintTune },
  274. { DGUSLCD_SCREEN_WAITING, VPList_PIDTuningWaiting },
  275. { DGUSLCD_SCREEN_FLC_PREHEAT, VPList_FLCPreheat },
  276. { DGUSLCD_SCREEN_FLC_PRINTING, VPList_FLCPrinting },
  277. { DGUSLCD_SCREEN_Z_OFFSET, VPList_Z_Offset },
  278. { DGUSLCD_SCREEN_STEPPERMM, VPList_StepPerMM },
  279. { DGUSLCD_SCREEN_PID_E, VPList_PIDE0 },
  280. { DGUSLCD_SCREEN_PID_BED, VPList_PIDBED },
  281. { DGUSLCD_SCREEN_INFOS, VPList_Infos },
  282. { 0 , nullptr } // List is terminated with an nullptr as table entry.
  283. };
  284. const char MarlinVersion[] PROGMEM = SHORT_BUILD_VERSION;
  285. // Helper to define a DGUS_VP_Variable for common use cases.
  286. #define VPHELPER(VPADR, VPADRVAR, RXFPTR, TXFPTR ) { .VP=VPADR, .memadr=VPADRVAR, .size=sizeof(VPADRVAR), \
  287. .set_by_display_handler = RXFPTR, .send_to_display_handler = TXFPTR }
  288. // Helper to define a DGUS_VP_Variable when the sizeo of the var cannot be determined automaticalyl (eg. a string)
  289. #define VPHELPER_STR(VPADR, VPADRVAR, STRLEN, RXFPTR, TXFPTR ) { .VP=VPADR, .memadr=VPADRVAR, .size=STRLEN, \
  290. .set_by_display_handler = RXFPTR, .send_to_display_handler = TXFPTR }
  291. const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
  292. // Helper to detect touch events
  293. VPHELPER(VP_SCREENCHANGE, nullptr, DGUSScreenVariableHandler::ScreenChangeHook, nullptr),
  294. VPHELPER(VP_SCREENCHANGE_ASK, nullptr, DGUSScreenVariableHandler::ScreenChangeHookIfIdle, nullptr),
  295. VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, DGUSScreenVariableHandler::ScreenChangeHookIfSD, nullptr),
  296. VPHELPER(VP_CONFIRMED, nullptr, DGUSScreenVariableHandler::ScreenConfirmedOK, nullptr),
  297. VPHELPER(VP_TEMP_ALL_OFF, nullptr, &DGUSScreenVariableHandler::HandleAllHeatersOff, nullptr),
  298. #if ENABLED(DUGS_UI_MOVE_DIS_OPTION)
  299. VPHELPER(VP_MOVE_OPTION, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMoveOption, nullptr),
  300. #endif
  301. #if ENABLED(DUGS_UI_MOVE_DIS_OPTION)
  302. VPHELPER(VP_MOVE_X, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr),
  303. VPHELPER(VP_MOVE_Y, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr),
  304. VPHELPER(VP_MOVE_Z, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr),
  305. VPHELPER(VP_HOME_ALL, &distanceToMove, &DGUSScreenVariableHandler::HandleManualMove, nullptr),
  306. #else
  307. VPHELPER(VP_MOVE_X, nullptr, &DGUSScreenVariableHandler::HandleManualMove, nullptr),
  308. VPHELPER(VP_MOVE_Y, nullptr, &DGUSScreenVariableHandler::HandleManualMove, nullptr),
  309. VPHELPER(VP_MOVE_Z, nullptr, &DGUSScreenVariableHandler::HandleManualMove, nullptr),
  310. VPHELPER(VP_HOME_ALL, nullptr, &DGUSScreenVariableHandler::HandleManualMove, nullptr),
  311. #endif
  312. VPHELPER(VP_MOTOR_LOCK_UNLOK, nullptr, &DGUSScreenVariableHandler::HandleMotorLockUnlock, nullptr),
  313. #if ENABLED(POWER_LOSS_RECOVERY)
  314. VPHELPER(VP_POWER_LOSS_RECOVERY, nullptr, &DGUSScreenVariableHandler::HandlePowerLossRecovery, nullptr),
  315. #endif
  316. VPHELPER(VP_SETTINGS, nullptr, &DGUSScreenVariableHandler::HandleSettings, nullptr),
  317. #if ENABLED(SINGLE_Z_CALIBRATION)
  318. VPHELPER(VP_Z_CALIBRATE, nullptr, &DGUSScreenVariableHandler::HandleZCalibration, nullptr),
  319. #endif
  320. #if ENABLED(FIRST_LAYER_CAL)
  321. VPHELPER(VP_Z_FIRST_LAYER_CAL, nullptr, &DGUSScreenVariableHandler::HandleFirstLayerCal, nullptr),
  322. #endif
  323. { .VP = VP_MARLIN_VERSION, .memadr = (void*)MarlinVersion, .size = VP_MARLIN_VERSION_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM },
  324. // M117 LCD String (We don't need the string in memory but "just" push it to the display on demand, hence the nullptr
  325. { .VP = VP_M117, .memadr = nullptr, .size = VP_M117_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplay },
  326. // Temperature Data
  327. #if HOTENDS >= 1
  328. VPHELPER(VP_T_E0_Is, &thermalManager.temp_hotend[0].celsius, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>),
  329. VPHELPER(VP_T_E0_Set, &thermalManager.temp_hotend[0].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
  330. VPHELPER(VP_Flowrate_E0, &planner.flow_percentage[ExtUI::extruder_t::E0], DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
  331. VPHELPER(VP_EPos, &destination.e, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>),
  332. VPHELPER(VP_MOVE_E0, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr),
  333. VPHELPER(VP_E0_CONTROL, &thermalManager.temp_hotend[0].target, &DGUSScreenVariableHandler::HandleHeaterControl, nullptr),
  334. VPHELPER(VP_E0_STATUS, &thermalManager.temp_hotend[0].target, nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay),
  335. #if ENABLED(DGUS_PREHEAT_UI)
  336. VPHELPER(VP_E0_BED_PREHEAT, nullptr, &DGUSScreenVariableHandler::HandlePreheat, nullptr),
  337. #endif
  338. #if ENABLED(PIDTEMP)
  339. VPHELPER(VP_E0_PID_P, &thermalManager.temp_hotend[0].pid.Kp, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID),
  340. VPHELPER(VP_E0_PID_I, &thermalManager.temp_hotend[0].pid.Ki, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID),
  341. VPHELPER(VP_E0_PID_D, &thermalManager.temp_hotend[0].pid.Kd, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID),
  342. VPHELPER(VP_PID_AUTOTUNE_E0, nullptr, &DGUSScreenVariableHandler::HandlePIDAutotune, nullptr),
  343. #endif
  344. #if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
  345. VPHELPER(VP_E0_FILAMENT_LOAD_UNLOAD, nullptr, &DGUSScreenVariableHandler::HandleFilamentOption, &DGUSScreenVariableHandler::HandleFilamentLoadUnload),
  346. #endif
  347. #endif
  348. #if HOTENDS >= 2
  349. VPHELPER(VP_T_E1_Is, &thermalManager.temp_hotend[1].celsius, nullptr, DGUSLCD_SendFloatAsLongValueToDisplay<0>),
  350. VPHELPER(VP_T_E1_Set, &thermalManager.temp_hotend[1].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
  351. VPHELPER(VP_Flowrate_E1, &planner.flow_percentage[ExtUI::extruder_t::E1], DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
  352. VPHELPER(VP_MOVE_E1, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr),
  353. VPHELPER(VP_E1_CONTROL, &thermalManager.temp_hotend[1].target, &DGUSScreenVariableHandler::HandleHeaterControl, nullptr),
  354. VPHELPER(VP_E1_STATUS, &thermalManager.temp_hotend[1].target, nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay),
  355. #if ENABLED(PIDTEMP)
  356. VPHELPER(VP_PID_AUTOTUNE_E1, nullptr, &DGUSScreenVariableHandler::HandlePIDAutotune, nullptr),
  357. #endif
  358. VPHELPER(VP_E1_FILAMENT_LOAD_UNLOAD, nullptr, &DGUSScreenVariableHandler::HandleFilamentOption, &DGUSScreenVariableHandler::HandleFilamentLoadUnload),
  359. #endif
  360. #if HAS_HEATED_BED
  361. VPHELPER(VP_T_Bed_Is, &thermalManager.temp_bed.celsius, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>),
  362. VPHELPER(VP_T_Bed_Set, &thermalManager.temp_bed.target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
  363. VPHELPER(VP_BED_CONTROL, &thermalManager.temp_bed.target, &DGUSScreenVariableHandler::HandleHeaterControl, nullptr),
  364. VPHELPER(VP_BED_STATUS, &thermalManager.temp_bed.target, nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay),
  365. #if ENABLED(PIDTEMPBED)
  366. VPHELPER(VP_BED_PID_P, &thermalManager.temp_bed.pid.Kp, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID),
  367. VPHELPER(VP_BED_PID_I, &thermalManager.temp_bed.pid.Ki, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID),
  368. VPHELPER(VP_BED_PID_D, &thermalManager.temp_bed.pid.Kd, DGUSScreenVariableHandler::HandleTemperaturePIDChanged, DGUSScreenVariableHandler::DGUSLCD_SendTemperaturePID),
  369. VPHELPER(VP_PID_AUTOTUNE_BED, nullptr, &DGUSScreenVariableHandler::HandlePIDAutotune, nullptr),
  370. #endif
  371. #endif
  372. // Fan Data
  373. #if FAN_COUNT
  374. #define FAN_VPHELPER(N) \
  375. VPHELPER(VP_Fan##N##_Percentage, &thermalManager.fan_speed[N], DGUSScreenVariableHandler::DGUSLCD_PercentageToUint8, &DGUSScreenVariableHandler::DGUSLCD_SendPercentageToDisplay), \
  376. VPHELPER(VP_FAN##N##_CONTROL, &thermalManager.fan_speed[N], &DGUSScreenVariableHandler::HandleFanControl, nullptr), \
  377. VPHELPER(VP_FAN##N##_STATUS, &thermalManager.fan_speed[N], nullptr, &DGUSScreenVariableHandler::DGUSLCD_SendFanStatusToDisplay),
  378. REPEAT(FAN_COUNT, FAN_VPHELPER)
  379. #endif
  380. // Feedrate
  381. VPHELPER(VP_Feedrate_Percentage, &feedrate_percentage, DGUSScreenVariableHandler::DGUSLCD_SetValueDirectly<int16_t>, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay ),
  382. // Position Data
  383. VPHELPER(VP_XPos, &current_position.x, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>),
  384. VPHELPER(VP_YPos, &current_position.y, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>),
  385. VPHELPER(VP_ZPos, &current_position.z, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>),
  386. // Print Progress
  387. VPHELPER(VP_PrintProgress_Percentage, nullptr, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintProgressToDisplay ),
  388. // Print Time
  389. VPHELPER_STR(VP_PrintTime, nullptr, VP_PrintTime_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintTimeToDisplay),
  390. #if ENABLED(PRINTCOUNTER)
  391. VPHELPER_STR(VP_PrintAccTime, nullptr, VP_PrintAccTime_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintAccTimeToDisplay),
  392. VPHELPER_STR(VP_PrintsTotal, nullptr, VP_PrintsTotal_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintsTotalToDisplay),
  393. #endif
  394. VPHELPER(VP_X_STEP_PER_MM, &planner.settings.axis_steps_per_mm[X_AXIS], DGUSScreenVariableHandler::HandleStepPerMMChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>),
  395. VPHELPER(VP_Y_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Y_AXIS], DGUSScreenVariableHandler::HandleStepPerMMChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>),
  396. VPHELPER(VP_Z_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Z_AXIS], DGUSScreenVariableHandler::HandleStepPerMMChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>),
  397. #if HOTENDS >= 1
  398. VPHELPER(VP_E0_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(0)], DGUSScreenVariableHandler::HandleStepPerMMExtruderChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>),
  399. #endif
  400. #if HOTENDS >= 2
  401. VPHELPER(VP_E1_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(1)], DGUSScreenVariableHandler::HandleStepPerMMExtruderChanged, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<1>),
  402. #endif
  403. // SDCard File listing.
  404. #if ENABLED(SDSUPPORT)
  405. VPHELPER(VP_SD_ScrollEvent, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_ScrollFilelist, nullptr),
  406. VPHELPER(VP_SD_FileSelected, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_FileSelected, nullptr),
  407. VPHELPER(VP_SD_FileSelectConfirm, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_StartPrint, nullptr),
  408. VPHELPER_STR(VP_SD_FileName0, nullptr, VP_SD_FileName_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_SendFilename),
  409. VPHELPER_STR(VP_SD_FileName1, nullptr, VP_SD_FileName_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_SendFilename),
  410. VPHELPER_STR(VP_SD_FileName2, nullptr, VP_SD_FileName_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_SendFilename),
  411. VPHELPER_STR(VP_SD_FileName3, nullptr, VP_SD_FileName_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_SendFilename),
  412. VPHELPER_STR(VP_SD_FileName4, nullptr, VP_SD_FileName_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_SendFilename),
  413. VPHELPER(VP_SD_ResumePauseAbort, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_ResumePauseAbort, nullptr),
  414. VPHELPER(VP_SD_AbortPrintConfirmed, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_ReallyAbort, nullptr),
  415. VPHELPER(VP_SD_Print_Setting, nullptr, DGUSScreenVariableHandler::DGUSLCD_SD_PrintTune, nullptr),
  416. #if HAS_BED_PROBE
  417. VPHELPER(VP_SD_Print_ProbeOffsetZ, &probe.offset.z, DGUSScreenVariableHandler::HandleProbeOffsetZChanged, &DGUSScreenVariableHandler::DGUSLCD_SendFloatAsIntValueToDisplay<2>),
  418. #if ENABLED(BABYSTEPPING)
  419. VPHELPER(VP_SD_Print_LiveAdjustZ, nullptr, DGUSScreenVariableHandler::HandleLiveAdjustZ, nullptr),
  420. #endif
  421. #endif
  422. #endif
  423. #if ENABLED(DGUS_UI_WAITING)
  424. VPHELPER(VP_WAITING_STATUS, nullptr, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendWaitingStatusToDisplay),
  425. #endif
  426. // Messages for the User, shared by the popup and the kill screen. They cant be autouploaded as we do not buffer content.
  427. { .VP = VP_MSGSTR1, .memadr = nullptr, .size = VP_MSGSTR1_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM },
  428. { .VP = VP_MSGSTR2, .memadr = nullptr, .size = VP_MSGSTR2_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM },
  429. { .VP = VP_MSGSTR3, .memadr = nullptr, .size = VP_MSGSTR3_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM },
  430. { .VP = VP_MSGSTR4, .memadr = nullptr, .size = VP_MSGSTR4_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM },
  431. VPHELPER(0, 0, 0, 0) // must be last entry.
  432. };
  433. #endif // DGUS_LCD_UI_FYSETC