MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / PurgeEntries

Method PurgeEntries

src/GCodes/GCodeQueue.cpp:179–208  ·  view source on GitHub ↗

Because some moves may end before the print is actually paused, we need a method to remove all the entries that will not be executed after the print has finally paused

Source from the content-addressed store, hash-verified

177// Because some moves may end before the print is actually paused, we need a method to
178// remove all the entries that will not be executed after the print has finally paused
179void GCodeQueue::PurgeEntries() noexcept
180{
181 QueuedCode *_ecv_null item = queuedItems, *_ecv_null lastItem = nullptr;
182 while (item != nullptr)
183 {
184 if (item->executeAtMove > reprap.GetMove().GetScheduledMoves())
185 {
186 // Release this item
187 QueuedCode *_ecv_null nextItem = item->Next();
188 item->next = freeItems;
189 freeItems = item;
190
191 // Unlink it from the list
192 if (lastItem == nullptr)
193 {
194 queuedItems = nextItem;
195 }
196 else
197 {
198 lastItem->next = nextItem;
199 }
200 item = nextItem;
201 }
202 else
203 {
204 lastItem = item;
205 item = item->Next();
206 }
207 }
208}
209
210void GCodeQueue::Clear() noexcept
211{

Callers 2

Calls 2

GetScheduledMovesMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected