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

bug fix in goniometer move

parent d2be09fb
......@@ -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,
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment