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

Method PrepareScanningProbeDataCollection

src/Movement/Move.cpp:1484–1509  ·  view source on GitHub ↗

This is called by DDA::Prepare when committing a scanning probe reading. The first reading has already been taken and axis0index has been incremented or decremented to account for this.

Source from the content-addressed store, hash-verified

1482// This is called by DDA::Prepare when committing a scanning probe reading.
1483// The first reading has already been taken and axis0index has been incremented or decremented to account for this.
1484void Move::PrepareScanningProbeDataCollection(const DDA& dda, const PrepParams& params) noexcept
1485{
1486 probeControl.numReadingsNeeded = reprap.GetGCodes().GetNumScanningProbeReadingsLeftToTake();
1487 probeControl.nextReadingNeeded = 1; // we already took the first reading
1488 if (probeControl.numReadingsNeeded != 0)
1489 {
1490 probeControl.accelClocks = params.TotalAccelClocks();
1491 probeControl.acceleration = params.acceleration;
1492 probeControl.deceleration = params.deceleration;
1493 probeControl.initialSpeed = dda.startSpeed;
1494 probeControl.topSpeed = dda.topSpeed;
1495 probeControl.steadyClocks = params.steadyClocks;
1496 probeControl.distancePerReading = params.totalDistance/(float)probeControl.numReadingsNeeded;
1497 probeControl.accelDistance = params.accelDistance;
1498 probeControl.decelStartDistance = params.decelStartDistance;
1499 probeControl.startTime = dda.afterPrepare.moveStartTime;
1500 probeControl.timer.SetCallback(ScanningProbeGlobalTimerCallback, CallbackParameter(this));
1501#if 0
1502 debugPrintf("nrn=%u ac=%" PRIu32 " sc=%" PRIu32 " is=%.3e ts=%.3e a=%.3e d=%.3e dpr=%.3f ad=%.3f dsd=%.3f\n",
1503 probeControl.numReadingsNeeded, probeControl.accelClocks, probeControl.steadyClocks,
1504 (double)probeControl.initialSpeed, (double)probeControl.topSpeed, (double)probeControl.acceleration, (double)probeControl.deceleration,
1505 (double)probeControl.distancePerReading, (double)probeControl.accelDistance, (double)probeControl.decelStartDistance);
1506#endif
1507 SetupNextScanningProbeReading();
1508 }
1509}
1510
1511inline float fastLimSqrtf(float f) noexcept
1512{

Callers 1

PrepareMethod · 0.80

Calls 3

debugPrintfFunction · 0.85
TotalAccelClocksMethod · 0.80
SetCallbackMethod · 0.80

Tested by

no test coverage detected