string ConsoleHistory::getNext() { // Make sure that we dont point beyond the list // ... and make sure we dont point beyond the number added (for length smaller than size) if (pointer < size && pointer < added-1) pointer++; return getCurrentCommand(); }
void DifferentialStepper::stop() { // recalc current block to stop ASAP Command *c = getCurrentCommand(); if (c == NULL) return; // recalc minimum deceleration distance c->decelerateAfter = max(c->totalSteps - _stepsCompleted, c->totalSteps - _accelDist); // make sure the queue is cleared _qSize = 1; // if already deaccelerating, then just clear the rest of the queue if (_stepsCompleted > c->decelerateAfter) { return; } // force immediate deacceleration _stepsCompleted = c->decelerateAfter; }
string ConsoleHistory::getPrevious() { if (pointer > 0) pointer--; return getCurrentCommand(); }