This repository has been archived by the owner on Oct 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy pathadvi3pp_.h
1291 lines (1056 loc) · 33.7 KB
/
advi3pp_.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Marlin 3D Printer Firmware For Wanhao Duplicator i3 Plus (ADVi3++)
*
* Copyright (C) 2017-2019 Sebastien Andrivet [https://github.com/andrivet/]
*
* 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 <http://www.gnu.org/licenses/>.
*
*/
#ifndef ADV_I3_PLUS_PLUS_PRIVATE_H
#define ADV_I3_PLUS_PLUS_PRIVATE_H
// This is only to ensure that Jetbrains CLion is parsing code properly inside the IDE
#ifdef __CLION_IDE__
#define HAS_BED_PROBE 1
#define ADVi3PP_PROBE
#endif
#include "Marlin.h"
#include "temperature.h"
#include "printcounter.h"
#include "planner.h"
#include "point_t.h"
#include "advi3pp_versions.h"
#include "advi3pp_bitmasks.h"
#include "advi3pp_enums.h"
#include "advi3pp.h"
#include "advi3pp_stack.h"
#include "advi3pp_dgus.h"
#include "ADVcallback.h"
#include "ADVcrtp.h"
#include "advi3pp_bitmasks.h"
// From Marlin
extern bool pause_print(const float &retract, const point_t &park_point, const float &unload_length=0, bool show_lcd=false);
extern void resume_print(const float &slow_load_length=0, const float &fast_load_length=0, const float &purge_length=ADVANCED_PAUSE_PURGE_LENGTH, int8_t max_beep_count=0);
extern bool ensure_safe_temperature(AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT);
namespace advi3pp {
const size_t message_length = 48; //!< Size of messages to be displayed on the LCD Panel
const size_t progress_name_length = 44; //!< Size of the progress name (i.e. filename) to be displayed on the LCD Panel
const size_t progress_length = 48; //!< Size of the progress message (filename and percent) to be displayed on the LCD Panel
const uint8_t sd_file_length = 26; //!< This is the maximum length handled by the SD layer (FILENAME_LENGTH)
const uint16_t default_bed_temperature = 50; //!< Default target temperature for the bed
const uint16_t default_hotend_temperature = 200; //!< Default target temperature for the hotend
using adv::Callback;
using BackgroundTask = Callback<void(*)()>;
using WaitCallback = Callback<bool(*)()>;
//! Hotend, bed temperature and fan speed preset.
struct Preset
{
uint16_t hotend;
uint8_t bed;
uint8_t fan;
};
//! Position of a sensor.
struct SensorPosition { int16_t x, y; };
// --------------------------------------------------------------------
//! Transform a value from a scale to another one.
//! @param value Value to be transformed
//! @param valueScale Current scale of the value (maximal)
//! @param targetScale Target scale
//! @return The scaled value
inline int16_t scale(int16_t value, int16_t valueScale, int16_t targetScale) { return value * targetScale / valueScale; }
// --------------------------------------------------------------------
// EEPROM Data Read & Write
// --------------------------------------------------------------------
//! EEPROM writer: utility class to write values into EEPROM
struct EepromWrite
{
EepromWrite(eeprom_write write, int& eeprom_index, uint16_t& working_crc);
template <typename T> void write(const T& data);
private:
eeprom_write write_;
int& eeprom_index_;
uint16_t& working_crc_;
};
//! EEPROM reader: utility class to read values from EEPROM
struct EepromRead
{
EepromRead(eeprom_read read, int& eeprom_index, uint16_t& working_crc);
template <typename T> inline void read(T& data);
private:
eeprom_read read_;
int& eeprom_index_;
uint16_t& working_crc_;
};
// --------------------------------------------------------------------
// Pages - Display a page on top of the others; display back and forward pages
// --------------------------------------------------------------------
//! Options when pushing a page onto the stack
enum class ShowOptions: uint8_t
{
None = 0x00, //!< No option
SaveBack = 0x01 //!< Save the current page onto the stack of back pages
};
ENABLE_BITMASK_OPERATOR(ShowOptions);
//! Display a page on top of the others; display back and forward pages
struct Pages
{
void show_page(Page page, ShowOptions options = ShowOptions::SaveBack);
Page get_current_page();
void save_forward_page();
void show_back_page();
void show_forward_page();
private:
Stack<Page, 8> back_pages_{};
Page forward_page_ = Page::None;
Page current_page_ = Page::Main;
};
// --------------------------------------------------------------------
// Handler - Handle inputs from the LCD Panel
// --------------------------------------------------------------------
//! Handle inputs from the LCD Panel
template<typename Self>
struct Handler: adv::Crtp<Self, Handler>
{
public:
void handle(KeyValue value);
void show(ShowOptions options);
bool dispatch(KeyValue value) { return this->self().do_dispatch(value); }
void show_command() { this->self().do_show_command(); }
void save_command() { this->self().do_save_command(); }
void back_command() { this->self().do_back_command(); }
Page prepare_page() { return this->self().do_prepare_page(); }
void write(EepromWrite& eeprom) const { this->self().do_write(eeprom); }
void read(EepromRead& eeprom) { this->self().do_read(eeprom); }
void reset() { this->self().do_reset(); }
uint16_t size_of() const { return this->self().do_size_of(); }
protected:
Page do_prepare_page();
bool do_dispatch(KeyValue value);
void do_show_command();
void do_save_command();
void do_back_command();
void invalid(KeyValue value);
void save_settings() const;
private:
void do_write(EepromWrite& eeprom) const {}
void do_read(EepromRead& eeprom) {}
void do_reset() {}
uint16_t do_size_of() const { return 0; }
};
// --------------------------------------------------------------------
// Screens
// --------------------------------------------------------------------
//! Handle Temperature, SD card and Print screens
struct Screens: Handler<Screens>
{
private:
bool do_dispatch(KeyValue value);
void show_temps();
void show_print();
void show_sd_or_temp_page();
void show_print_settings();
friend Parent;
};
// --------------------------------------------------------------------
// Wait Messages
// --------------------------------------------------------------------
//! Display wait page and messages
struct Wait: Handler<Wait>
{
void show(const FlashChar* message, ShowOptions options = ShowOptions::SaveBack);
void show(const FlashChar* message, const WaitCallback& back, ShowOptions options = ShowOptions::SaveBack);
void show(const FlashChar* message, const WaitCallback& back, const WaitCallback& cont, ShowOptions options = ShowOptions::SaveBack);
void show_continue(const FlashChar* message, const WaitCallback& cont, ShowOptions options = ShowOptions::SaveBack);
void show_continue(const FlashChar* message, ShowOptions options = ShowOptions::SaveBack);
void show_continue(ShowOptions options = ShowOptions::SaveBack);
private:
Page do_prepare_page();
void do_save_command();
void do_back_command();
bool on_continue();
WaitCallback back_;
WaitCallback continue_;
friend Parent;
};
// --------------------------------------------------------------------
// Temperatures Graph
// --------------------------------------------------------------------
//! Temperatures Graph
struct Temperatures: Handler<Temperatures>
{
void show(const WaitCallback& back);
void show(ShowOptions options = ShowOptions::SaveBack);
private:
Page do_prepare_page();
void do_back_command();
WaitCallback back_;
friend Parent;
};
// --------------------------------------------------------------------
// Load and Unload Page
// --------------------------------------------------------------------
//! Load and Unload Page
struct LoadUnload: Handler<LoadUnload>
{
private:
bool do_dispatch(KeyValue key_value);
Page do_prepare_page();
void prepare(const BackgroundTask& background);
void load_command();
void unload_command();
bool stop();
void stop_task();
void load_start_task();
void load_task();
void unload_start_task();
void unload_task();
void start_task(const char* command, const BackgroundTask& back_task);
friend Parent;
};
// --------------------------------------------------------------------
// Preheat Page
// --------------------------------------------------------------------
//! Preheat Page
struct Preheat: Handler<Preheat>
{
static const size_t NB_PRESETS = 5;
private:
bool do_dispatch(KeyValue key_value);
Page do_prepare_page();
void do_save_command();
void do_write(EepromWrite& eeprom) const;
void do_read(EepromRead& eeprom);
void do_reset();
uint16_t do_size_of() const;
void send_presets();
void retrieve_presets();
void previous_command();
void next_command();
void cooldown_command();
private:
Preset presets_[NB_PRESETS] = {};
size_t index_ = 0;
friend Parent;
};
// --------------------------------------------------------------------
// Move Page
// --------------------------------------------------------------------
//! Move Page
struct Move: Handler<Move>
{
void x_plus_command();
void x_minus_command();
void x_home_command();
void y_plus_command();
void y_minus_command();
void y_home_command();
void z_plus_command();
void z_minus_command();
void z_home_command();
void e_plus_command();
void e_minus_command();
void all_home_command();
void disable_motors_command();
private:
bool do_dispatch(KeyValue key_value);
Page do_prepare_page();
void move(const char* command, millis_t delay);
private:
millis_t last_move_time_ = 0;
friend Parent;
};
// --------------------------------------------------------------------
// Sensor Tuning Page
// --------------------------------------------------------------------
#ifdef ADVi3PP_PROBE
//! Sensor Tuning Page
struct SensorTuning: Handler<SensorTuning>
{
private:
bool do_dispatch(KeyValue key_value);
Page do_prepare_page();
void self_test_command();
void reset_command();
void deploy_command();
void stow_command();
private:
friend Parent;
};
#else
//! Sensor Tuning Page
struct SensorTuning: Handler<SensorTuning>
{
private:
Page do_prepare_page();
friend Parent;
};
#endif
// --------------------------------------------------------------------
// Automatic Leveling Page
// --------------------------------------------------------------------
#ifdef ADVi3PP_PROBE
//! Automatic Leveling Page
struct AutomaticLeveling: Handler<AutomaticLeveling>
{
void g29_leveling_finished(bool success);
private:
Page do_prepare_page();
bool g29_leveling_failed();
private:
bool sensor_interactive_leveling_ = false;
friend Parent;
};
#else
//! Automatic Leveling Page
struct AutomaticLeveling: Handler<AutomaticLeveling>
{
void g29_leveling_finished(bool) {}
private:
Page do_prepare_page();
friend Parent;
};
#endif
// --------------------------------------------------------------------
// Leveling Grid Page
// --------------------------------------------------------------------
#ifdef ADVi3PP_PROBE
//! Leveling Grid Page
struct LevelingGrid: Handler<LevelingGrid>
{
private:
Page do_prepare_page();
void do_save_command();
friend Parent;
};
#else
//! Leveling Grid Page
struct LevelingGrid: Handler<LevelingGrid>
{
private:
Page do_prepare_page();
friend Parent;
};
#endif
// --------------------------------------------------------------------
// Manual Leveling Page
// --------------------------------------------------------------------
//! Manual Leveling Page
struct ManualLeveling: Handler<ManualLeveling>
{
private:
bool do_dispatch(KeyValue value);
Page do_prepare_page();
void do_back_command();
void point1_command();
void point2_command();
void point3_command();
void point4_command();
void point5_command();
void pointA_command();
void pointB_command();
void pointC_command();
void pointD_command();
void leveling_task();
friend Parent;
};
// --------------------------------------------------------------------
// SD Card Page
// --------------------------------------------------------------------
//! SD Card Page
struct SdCard: Handler<SdCard>
{
void show_first_page();
private:
bool do_dispatch(KeyValue value);
Page do_prepare_page();
void show_current_page();
void get_file_name(uint8_t index_in_page, ADVString<sd_file_length>& name);
void up_command();
void down_command();
void select_file_command(uint16_t file_index);
private:
static constexpr uint16_t nb_visible_sd_files = 5; //!< Number of files per page on the SD screen
uint16_t nb_files_ = 0;
uint16_t last_file_index_ = 0;
uint16_t page_index_ = 0;
friend Parent;
};
// --------------------------------------------------------------------
// Printing Page
// --------------------------------------------------------------------
//! Printing Page
struct Print: Handler<Print>
{
void process_pause_code();
void process_stop_code();
void pause_finished(bool success);
bool is_printing() const;
bool is_usb_printing() const;
void send_stop_usb_print();
private:
bool do_dispatch(KeyValue value);
Page do_prepare_page();
void stop_command();
void pause_command();
void advanced_pause_command();
friend Parent;
};
// --------------------------------------------------------------------
// Advanced Pause Page
// --------------------------------------------------------------------
//! Advanced Pause Page
struct AdvancedPause: Handler<AdvancedPause>
{
void advanced_pause_show_message(AdvancedPauseMessage message);
private:
void insert_filament();
bool filament_inserted();
private:
AdvancedPauseMessage last_advanced_pause_message_ = static_cast<AdvancedPauseMessage>(-1);
friend Parent;
};
// --------------------------------------------------------------------
// Sensor Z Height Tuning Page
// --------------------------------------------------------------------
#ifdef ADVi3PP_PROBE
//! Sensor Z Height Tuning Page
struct SensorZHeight: Handler<SensorZHeight>
{
void minus();
void plus();
enum class Multiplier: uint8_t
{
M1 = 0,
M2 = 1,
M3 = 2
};
private:
bool do_dispatch(KeyValue key_value);
Page do_prepare_page();
void do_save_command();
void do_back_command();
void post_home_task();
void multiplier1_command();
void multiplier2_command();
void multiplier3_command();
double get_multiplier_value() const;
void adjust_height(double offset);
void send_data() const;
void reset();
private:
Multiplier multiplier_ = Multiplier::M1;
friend Parent;
};
#else
//! Sensor Z Height Tuning Page
struct SensorZHeight: Handler<SensorZHeight>
{
void minus() {}
void plus() {}
private:
Page do_prepare_page();
friend Parent;
};
#endif
// --------------------------------------------------------------------
// Extruder Tuning Page
// --------------------------------------------------------------------
//! Extruder Tuning Page
struct ExtruderTuning: Handler<ExtruderTuning>
{
private:
bool do_dispatch(KeyValue value);
Page do_prepare_page();
void do_back_command();
void start_command();
void settings_command();
void heating_task();
void extruding_task();
void finished();
bool cancel();
private:
static constexpr uint16_t tuning_extruder_filament = 100; //!< Filament to extrude (10 cm)
static constexpr uint16_t tuning_extruder_delta = 20; //!< Amount of filament supposes tp remain after extruding (2 cm)
float extruded_ = 0.0;
friend Parent;
};
// --------------------------------------------------------------------
// PID Tuning Page
// --------------------------------------------------------------------
//! PID Tuning Page
struct PidTuning: Handler<PidTuning>
{
void finished(bool success);
void send_data();
private:
bool do_dispatch(KeyValue value);
Page do_prepare_page();
void step2_command();
bool cancel_pid();
void hotend_command();
void bed_command();
private:
uint16_t temperature_ = 0;
TemperatureKind kind_ = TemperatureKind::Hotend;
bool inTuning_ = false;
friend Parent;
};
// --------------------------------------------------------------------
// Linear Advance Tuning Page
// --------------------------------------------------------------------
//! Linear Advance Tuning Page
//! Note: Not fully implemented
struct LinearAdvanceTuning: Handler<LinearAdvanceTuning>
{
private:
Page do_prepare_page();
friend Parent;
};
// --------------------------------------------------------------------
// Diagnosis Page
// --------------------------------------------------------------------
//! Diagnosis Page
struct Diagnosis: Handler<Diagnosis>
{
enum class State: uint8_t { Off = 0, On = 1, Output = 2};
private:
Page do_prepare_page();
void do_back_command();
State get_pin_state(uint8_t pin);
void send_data();
friend Parent;
};
// --------------------------------------------------------------------
// Sensor Settings Page
// --------------------------------------------------------------------
#ifdef ADVi3PP_PROBE
//! Sensor Settings Page
struct SensorSettings: Handler<SensorSettings>
{
static const size_t NB_SENSOR_POSITIONS = 3;
SensorSettings();
int x_probe_offset_from_extruder() const;
int y_probe_offset_from_extruder() const;
int left_probe_bed_position();
int right_probe_bed_position();
int front_probe_bed_position();
int back_probe_bed_position();
private:
bool do_dispatch(KeyValue value);
Page do_prepare_page();
void do_save_command();
void do_write(EepromWrite& eeprom) const;
void do_read(EepromRead& eeprom);
void do_reset();
uint16_t do_size_of() const;
void previous_command();
void next_command();
void send_data() const;
void get_data();
private:
uint16_t index_ = 0;
SensorPosition positions_[NB_SENSOR_POSITIONS];
friend Parent;
};
#else
//! Sensor Settings Page
struct SensorSettings: Handler<SensorSettings>
{
void send_z_height_to_lcd(double) {}
void save_lcd_z_height() {}
private:
Page do_prepare_page();
friend Parent;
};
#endif
// --------------------------------------------------------------------
// Firmware Setting Page
// --------------------------------------------------------------------
//! Firmware Setting Page
struct FirmwareSettings: Handler<FirmwareSettings>
{
private:
bool do_dispatch(KeyValue key_value);
Page do_prepare_page();
void do_save_command();
void thermal_protection_command();
void runout_sensor_command();
void send_usb_baudrate() const;
void send_features() const;
void baudrate_minus_command();
void baudrate_plus_command();
size_t usb_baudrate_index(uint32_t baudrate);
uint32_t usb_baudrate_ = BAUDRATE;
Feature features_ = Feature::BuzzOnPress | Feature::Dimming | Feature::ThermalProtection;
friend Parent;
};
// --------------------------------------------------------------------
// LCD Setting Page
// --------------------------------------------------------------------
//! LCD Setting Page
struct LcdSettings: Handler<LcdSettings>
{
void change_brightness(uint16_t brightness);
private:
bool do_dispatch(KeyValue key_value);
Page do_prepare_page();
void dimming_command();
void buzz_on_action_command();
void buzz_on_press_command();
void send_data() const;
Feature features_ = Feature::None;
friend Parent;
};
// --------------------------------------------------------------------
// Print Settings Page
// --------------------------------------------------------------------
//! Print Settings Page
struct PrintSettings: Handler<PrintSettings>
{
void feedrate_minus_command();
void feedrate_plus_command();
void fan_minus_command();
void fan_plus_command();
void hotend_minus_command();
void hotend_plus_command();
void bed_minus_command();
void bed_plus_command();
void baby_minus_command();
void baby_plus_command();
enum class Multiplier: uint8_t { M1 = 0, M2 = 1, M3 = 2 };
protected:
bool do_dispatch(KeyValue value);
private:
Page do_prepare_page();
void send_data() const;
double get_multiplier_value() const;
private:
Multiplier multiplier_ = Multiplier::M1;
friend Parent;
};
// --------------------------------------------------------------------
// PID Settings Page
// --------------------------------------------------------------------
//! PID Settings Page
struct Pid
{
float Kp_, Ki_, Kd_;
uint16_t temperature_;
};
struct PidSettings: Handler<PidSettings>
{
PidSettings();
void add_pid(TemperatureKind kind, uint16_t temperature);
void set_best_pid(TemperatureKind kind, uint16_t temperature);
private:
bool do_dispatch(KeyValue key_value);
Page do_prepare_page();
void do_write(EepromWrite& eeprom) const;
void do_read(EepromRead& eeprom);
void do_reset();
uint16_t do_size_of() const;
void do_save_command();
void do_back_command();
void hotend_command();
void bed_command();
void previous_command();
void next_command();
void set_current_pid() const;
void get_current_pid();
void send_data() const;
void save_data();
private:
static const size_t NB_PIDs = 3;
Pid hotend_pid_[NB_PIDs] = {};
Pid bed_pid_[NB_PIDs] = {};
TemperatureKind kind_ = TemperatureKind::Hotend;
size_t index_ = 0;
friend Parent;
};
// --------------------------------------------------------------------
// Step Settings Page
// --------------------------------------------------------------------
//! Step Settings Page
struct StepSettings: Handler<StepSettings>
{
private:
Page do_prepare_page();
void do_save_command();
friend Parent;
};
// --------------------------------------------------------------------
// Feedrate Settings Page
// --------------------------------------------------------------------
//! Feedrate Settings Page
struct FeedrateSettings: Handler<FeedrateSettings>
{
private:
Page do_prepare_page();
void do_save_command();
friend Parent;
};
// --------------------------------------------------------------------
// Acceleration Settings Page
// --------------------------------------------------------------------
//! Acceleration Settings Page
struct AccelerationSettings: Handler<AccelerationSettings>
{
private:
Page do_prepare_page();
void do_save_command();
friend Parent;
};
// --------------------------------------------------------------------
// Jerk Settings Page
// --------------------------------------------------------------------
//! Jerk Settings Page
struct JerkSettings: Handler<JerkSettings>
{
private:
Page do_prepare_page();
void do_save_command();
friend Parent;
};
// --------------------------------------------------------------------
// Linear Advance Settings Page
// --------------------------------------------------------------------
//! Linear Advance Settings Page
struct LinearAdvanceSettings: Handler<LinearAdvanceSettings>
{
private:
Page do_prepare_page();
void do_save_command();
friend Parent;
};
// --------------------------------------------------------------------
// Factory Reset Page
// --------------------------------------------------------------------
//! Factory Reset Page
struct FactoryReset: Handler<FactoryReset>
{
private:
Page do_prepare_page();
void do_save_command();
friend Parent;
};
// --------------------------------------------------------------------
// Statistics Page
// --------------------------------------------------------------------
//! Statistics Page
struct Statistics: Handler<Statistics>
{
private:
Page do_prepare_page();
void send_stats();
friend Parent;
};
// --------------------------------------------------------------------
// Versions Page
// --------------------------------------------------------------------
//! Versions Page
struct Versions: Handler<Versions>
{
bool check();
private:
Page do_prepare_page();
void get_version_from_lcd();
bool is_lcd_version_valid();
void send_versions() const;
uint16_t lcd_version_ = 0x0000;
friend Parent;
};
// --------------------------------------------------------------------
// Sponsors Page
// --------------------------------------------------------------------
//! Sponsors Page
struct Sponsors: Handler<Sponsors>
{
private:
Page do_prepare_page();
friend Parent;
};
// --------------------------------------------------------------------
// Copyrights Page
// --------------------------------------------------------------------
//! Copyrights Page
struct Copyrights: Handler<Copyrights>
{
private:
Page do_prepare_page();
friend Parent;
};
// --------------------------------------------------------------------
// Change Filament Page
// --------------------------------------------------------------------
//! Change Filament Page
struct ChangeFilament: Handler<ChangeFilament>
{
private:
Page do_prepare_page();
friend Parent;
};
// --------------------------------------------------------------------
// EEPROM Mismatch Page
// --------------------------------------------------------------------
//! EEPROM Mismatch Page
struct EepromMismatch: Handler<EepromMismatch>
{
bool check();
void set_mismatch();
void reset_mismatch();
private:
bool does_mismatch() const;
Page do_prepare_page();
void do_save_command();
bool mismatch_ = false;
friend Parent;
};
// --------------------------------------------------------------------
// Versions Mismatch Page
// --------------------------------------------------------------------