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

Method ListObjects

src/GCodes/ObjectTracker.cpp:150–173  ·  view source on GitHub ↗

List the objects on the build plate

Source from the content-addressed store, hash-verified

148
149// List the objects on the build plate
150void ObjectTracker::ListObjects(OutputBuffer *buf) noexcept
151{
152 if (numObjects == 0)
153 {
154 buf->copy("No known objects on build plate");
155 }
156 else
157 {
158 for (size_t i = 0; i < min<unsigned int>(numObjects, MaxTrackedObjects); ++i)
159 {
160 const ObjectDirectoryEntry& obj = objectDirectory[i];
161 buf->lcatf("%2u%s: X %d to %dmm, Y %d to %dmm, %s",
162 i,
163 (objectsCancelled.IsBitSet(i) ? " (cancelled)" : ""),
164 (int)obj.x[0], (int)obj.x[1],
165 (int)obj.y[0], (int)obj.y[1],
166 obj.name.Get().Ptr());
167 }
168 if (numObjects > MaxTrackedObjects)
169 {
170 buf->lcatf("%u more objects", numObjects - MaxTrackedObjects);
171 }
172 }
173}
174
175#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE
176

Callers 1

THROWSFunction · 0.80

Calls 3

copyMethod · 0.80
lcatfMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected