Commit 28673df9 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

bug fix in goniometer move

parent d2be09fb
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2609,7 +2609,7 @@ public class CalibrationHardwareInterface {
			nanoETA=System.nanoTime()+((long)(1E9*(Math.abs(this.targetPosition[motorNumber]-this.curpos[motorNumber])*(this.coefficientETA/this.stepsPerSecond))));
			return true;
        }
        
/*        
        public boolean [] checkGotTarget(){
    		updateMotorsPosition(0); // no wait here
    		boolean [] result=new boolean [this.curpos.length];
@@ -2618,6 +2618,11 @@ public class CalibrationHardwareInterface {
    		}
    		return result;
        }
*/
        public boolean checkGotTarget(int motorNumber, int position){
    		updateMotorsPosition(0); // no wait here
    		return Math.abs(position-this.curpos[motorNumber])<this.motorTolerance;
        }

        public boolean waitMotor(
        		int motorNumber,
+2 −2
Original line number Diff line number Diff line
@@ -476,7 +476,7 @@ horizontal axis:
			AtomicInteger stopRequested, // or null
			boolean updateStatus){
		String status;
		if (!this.goniometerParameters.goniometerMotors.checkGotTarget()[axialMotor]) {
		if (!this.goniometerParameters.goniometerMotors.checkGotTarget(axialMotor,axialMotorPosition)) {
			status="Moving axial motor to "+axialMotorPosition+"...";
			if (updateStatus) IJ.showStatus(status);
			boolean OK= this.goniometerParameters.goniometerMotors.moveMotorSetETA(axialMotor, axialMotorPosition);
@@ -494,7 +494,7 @@ horizontal axis:
				return false;
			}
		}
		if (!this.goniometerParameters.goniometerMotors.checkGotTarget()[tiltMotor]) {
		if (!this.goniometerParameters.goniometerMotors.checkGotTarget(tiltMotor,tiltMotorPosition))) {
			status="Moving tilt motor to "+tiltMotorPosition+"...";
			if (updateStatus) IJ.showStatus(status);
			boolean OK= this.goniometerParameters.goniometerMotors.moveMotorSetETA(tiltMotor, tiltMotorPosition);