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

Method GetIterations

src/GCodes/GCodeMachineState.cpp:337–347  ·  view source on GitHub ↗

Get the number of iterations of the closest enclosing loop in the current file, or -1 if there is on enclosing loop

Source from the content-addressed store, hash-verified

335
336// Get the number of iterations of the closest enclosing loop in the current file, or -1 if there is on enclosing loop
337int32_t GCodeMachineState::GetIterations() const noexcept
338{
339 for (const BlockState *_ecv_null bs = currentBlockState; bs != nullptr; bs = bs->GetPrevious())
340 {
341 if (bs->GetType() == BlockType::loop)
342 {
343 return bs->GetIterations();
344 }
345 }
346 return -1;
347}
348
349// Create a new block returning true if successful, false if maximum indent level exceeded
350void GCodeMachineState::CreateBlock(uint16_t indentLevel) noexcept

Callers 2

THROWSFunction · 0.45
FileEndedMethod · 0.45

Calls 2

GetPreviousMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected