Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
Public Member Functions | List of all members
logic::CutFilament Class Reference

A high-level command state machine - handles the complex logic of cutting filament. More...

#include <cut_filament.h>

Inheritance diagram for logic::CutFilament:
Inheritance graph
[legend]
Collaboration diagram for logic::CutFilament:
Collaboration graph
[legend]

Public Member Functions

bool Reset (uint8_t param) override
 
bool StepInner () override
 
ProgressCode State () const override
 
ErrorCode Error () const override
 
- Public Member Functions inherited from logic::CommandBase
bool Step ()
 
ProgressCode TopLevelState () const
 
virtual ResultCode Result () const
 
void Panic (ErrorCode ec)
 

Additional Inherited Members

- Static Public Member Functions inherited from logic::CommandBase
static void InvalidateHoming ()
 Invalidates homing state on Idler and Selector - doesn't change anything about filament load status.
 
static void InvalidateHomingAndFilamentState ()
 
static void HoldIdlerSelector ()
 Put Idler and Selector on-hold - they shall not move (not even home) until ResumeIdlerSelector is called.
 
static void ResumeIdlerSelector ()
 Allow Idler and Selector to move/home again. Any move needs to be newly planned.
 
- Protected Member Functions inherited from logic::CommandBase
bool CheckToolIndex (uint8_t index)
 
bool WaitForModulesErrorRecovery ()
 
bool WaitForOneModuleErrorRecovery (ErrorCode iState, modules::motion::MovableBase &m, uint8_t axisMask)
 
void ErrDisengagingIdler ()
 Perform disengaging idler in ErrDisengagingIdler state.
 
void GoToErrDisengagingIdler (ErrorCode deferredEC)
 Transit the state machine into ErrDisengagingIdler.
 
void GoToErrEngagingIdler ()
 Transit the state machine into ErrEngagingIdler.
 
void FinishedOK ()
 Process end of command which finished OK.
 
- Protected Attributes inherited from logic::CommandBase
ProgressCode state
 current progress state of the state machine
 
ErrorCode error
 current error code
 
ErrorCode deferredErrorCode
 planned error code - occurs when doing GoToErrDisengagingIdler - after the idler disengaged, the error is set (not before)
 
ProgressCode stateBeforeModuleFailed
 saved state of the state machine before a common error happened
 
ErrorCode errorBeforeModuleFailed
 saved error of the state machine before a common error happened
 
uint8_t recoveringMovableErrorAxisMask
 

Detailed Description

A high-level command state machine - handles the complex logic of cutting filament.

Member Function Documentation

◆ Error()

ErrorCode logic::CutFilament::Error ( ) const
overridevirtual
Returns
status of the operation - e.g. RUNNING, OK, or an error code if the operation failed.

Beware - the same rule about composite operations as with State() applies to Error() as well. Please see ErrorCode for more details

Reimplemented from logic::CommandBase.

◆ Reset()

bool logic::CutFilament::Reset ( uint8_t  param)
overridevirtual

Restart the automaton

Parameters
paramindex of filament slot to perform cut onto

Implements logic::CommandBase.

◆ State()

ProgressCode logic::CutFilament::State ( ) const
overridevirtual
Returns
progress of operation - each automaton consists of several internal states which should be reported to the user via the printer's LCD E.g. Tool change: first tries to unload filament, then selects another slot and then tries to load filament

Beware - derived automata report detailed states of underlying state machines if any E.g. Eject filament first tries to unload filament, which is a standalone automaton. Therefore until the unload is finished, this method will report the internal state of Unload filament. The reason for this is to be able to report exactly what is happening to the printer, especially loading and unloading sequences (and errors)

Reimplemented from logic::CommandBase.

◆ StepInner()

bool logic::CutFilament::StepInner ( )
overridevirtual
Returns
true if the state machine finished its job, false otherwise

Implements logic::CommandBase.


The documentation for this class was generated from the following files: