Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
cut_filament.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 "retract_from_finda.h"
8 
9 namespace logic {
10 
12 class CutFilament : public CommandBase {
13 public:
14  inline constexpr CutFilament()
15  : CommandBase()
16  , cutSlot(0)
17  , savedSelectorFeedRate_mm_s(0) {}
18 
21  bool Reset(uint8_t param) override;
22 
24  bool StepInner() override;
25 
26  ProgressCode State() const override;
27 
28  ErrorCode Error() const override;
29 
30 private:
31  UnloadFilament unl;
32  FeedToFinda feed;
33  RetractFromFinda retract;
34  uint8_t cutSlot;
35  uint16_t savedSelectorFeedRate_mm_s;
36 
37  void SelectFilamentSlot();
38  void MoveSelector(uint8_t slot);
39 };
40 
43 
44 } // 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 cutting filament.
Definition: cut_filament.h:12
ProgressCode State() const override
Definition: cut_filament.cpp:166
bool StepInner() override
Definition: cut_filament.cpp:48
ErrorCode Error() const override
Definition: cut_filament.cpp:175
bool Reset(uint8_t param) override
Definition: cut_filament.cpp:18
A high-level command state machine - wrapps the rehoming procedure to be used from a printer.
Definition: move_selector.h:16
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
CutFilament cutFilament
The one and only instance of CutFilament state machine in the FW.
Definition: cut_filament.cpp:16
ProgressCode
Definition: progress_codes.h:11
Feed filament to FINDA.
Definition: feed_to_finda.h:13
Retract filament from FINDA to PTFE.
Definition: retract_from_finda.h:14