GCode Processor
|
Stack of GCodeLineEntry
's.
More...
#include <GCodeLineEntryStack.h>
Public Member Functions | |
GCodeLineEntryStack (TriggerParameters &&trigger_params) | |
~GCodeLineEntryStack ()=default | |
Default destructor. | |
GCodeLineEntryStack (const GCodeLineEntryStack &)=delete | |
Deleted copy constructor. | |
GCodeLineEntryStack (GCodeLineEntryStack &&)=delete | |
Deleted move constructor. | |
GCodeLineEntryStack & | operator= (const GCodeLineEntryStack &)=delete |
Deleted copy assignment operator. | |
GCodeLineEntryStack & | operator= (GCodeLineEntryStack &&)=delete |
Deleted move assignment operator. | |
std::pair< bool, GCodeLineEntry > | push (const std::pair< bool, GCodeLineEntry > &entry) |
Pushes the entry in the stack discarding the first one and, possibly, interpolates the stack entries. More... | |
decltype(auto) | getStack () const |
Returns the internal stack. | |
Private Member Functions | |
std::pair< bool, GCodeLineEntry > | interpolate () const |
Interpolates between the entries of the Stack_ . | |
Private Attributes | |
std::vector< std::pair< bool, GCodeLineEntry > > | Stack_ |
The two temporary elements to interpolate between. | |
const TriggerParameters | MinimumTriggerParameters_ |
The threshold for the parameters to trigger the interpolation. | |
Stack of GCodeLineEntry
's.
Keeps track of the last two read-in line entries and interpolates among them if necessary.
|
explicit |
Constructor.
trigger_params | Extruder parameters that will trigger the interpolation. |
std::pair< bool, GCodeLineEntry > push | ( | const std::pair< bool, GCodeLineEntry > & | entry | ) |
Pushes the entry in the stack discarding the first one and, possibly, interpolates the stack entries.
entry | The enry to push in the stack. |
pair.first
tells whether the stack entries have been interpolated;pair.second
the interpolated GCodeLineEntry
. If an interpolation didn't take place, this is just a dummy value and must be ignored.