/** Unified enable+delay+disable to allow us to use G1 E */ public synchronized void enableMotor(long millis) throws RetryException { if (fiveD == false) { super.enableMotor(millis); } else { super.enableMotor(); double feedrate = machine.currentTool().getMotorSpeedRPM(); double distance = millis * feedrate / 60 / 1000; if (machine.currentTool().getMotorDirection() != 1) { distance *= -1; } sendCommand(_getToolCode() + "G1 E" + (ePosition.get() + distance) + " F" + feedrate); super.disableMotor(); } }
public synchronized void enableMotor() throws RetryException { String command = _getToolCode(); if (fiveD == false) { if (machine.currentTool().getMotorDirection() == ToolModel.MOTOR_CLOCKWISE) command += "M101"; else command += "M102"; sendCommand(command); } else { extrusionUpdater.setDirection( machine.currentTool().getMotorDirection() == 1 ? Direction.forward : Direction.reverse); extrusionUpdater.startExtruding(); } super.enableMotor(); }