Exemplo n.º 1
0
	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();
	}
Exemplo n.º 2
0
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;
}
Exemplo n.º 3
0
	string ConsoleHistory::getPrevious() 
	{
		if (pointer > 0) pointer--;     
		return getCurrentCommand();
	}