Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
tool_change.h
Go to the documentation of this file.
1 #pragma once
3 #include <stdint.h>
4 #include "command_base.h"
5 #include "unload_filament.h"
6 #include "feed_to_finda.h"
7 #include "feed_to_bondtech.h"
8 
9 namespace logic {
10 
12 class ToolChange : public CommandBase {
13 public:
14  inline constexpr ToolChange()
15  : CommandBase()
16  , plannedSlot(-1) {}
17 
20  bool Reset(uint8_t param) override;
21 
23  bool StepInner() override;
24 
25  ProgressCode State() const override;
26 
27  ErrorCode Error() const override;
28 
29 #ifndef UNITTEST
30 private:
31 #endif
32  void GoToFeedingToBondtech();
33  void GoToFeedingToFinda();
34 
36  void ToolChangeFinishedCorrectly();
37 
38  UnloadFilament unl;
39  FeedToFinda feed;
40  FeedToBondtech james; // bond ;)
41  uint8_t plannedSlot;
42 };
43 
45 extern ToolChange toolChange;
46 
47 } // namespace logic
Base class defining common API for high-level operations/commands/state machines.
Definition: command_base.h:29
A high-level command state machine - handles the complex logic of tool change - which is basically a ...
Definition: tool_change.h:12
bool Reset(uint8_t param) override
Definition: tool_change.cpp:20
bool StepInner() override
Definition: tool_change.cpp:79
ProgressCode State() const override
Definition: tool_change.cpp:178
ErrorCode Error() const override
Definition: tool_change.cpp:198
A high-level command state machine - handles the complex logic of unloading filament.
Definition: unload_filament.h:12
ErrorCode
Definition: error_codes.h:17
The logic namespace handles the application logic on top of the modules.
Definition: application.h:8
ToolChange toolChange
The one and only instance of ToolChange state machine in the FW.
Definition: tool_change.cpp:18
ProgressCode
Definition: progress_codes.h:11
Feed filament to Bondtech gears of the printer.
Definition: feed_to_bondtech.h:18
Feed filament to FINDA.
Definition: feed_to_finda.h:13