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

bug fix in goniometer move

parent d2be09fb
...@@ -2609,7 +2609,7 @@ public class CalibrationHardwareInterface { ...@@ -2609,7 +2609,7 @@ public class CalibrationHardwareInterface {
nanoETA=System.nanoTime()+((long)(1E9*(Math.abs(this.targetPosition[motorNumber]-this.curpos[motorNumber])*(this.coefficientETA/this.stepsPerSecond)))); nanoETA=System.nanoTime()+((long)(1E9*(Math.abs(this.targetPosition[motorNumber]-this.curpos[motorNumber])*(this.coefficientETA/this.stepsPerSecond))));
return true; return true;
} }
/*
public boolean [] checkGotTarget(){ public boolean [] checkGotTarget(){
updateMotorsPosition(0); // no wait here updateMotorsPosition(0); // no wait here
boolean [] result=new boolean [this.curpos.length]; boolean [] result=new boolean [this.curpos.length];
...@@ -2618,6 +2618,11 @@ public class CalibrationHardwareInterface { ...@@ -2618,6 +2618,11 @@ public class CalibrationHardwareInterface {
} }
return result; 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( public boolean waitMotor(
int motorNumber, int motorNumber,
......
...@@ -476,7 +476,7 @@ horizontal axis: ...@@ -476,7 +476,7 @@ horizontal axis:
AtomicInteger stopRequested, // or null AtomicInteger stopRequested, // or null
boolean updateStatus){ boolean updateStatus){
String status; String status;
if (!this.goniometerParameters.goniometerMotors.checkGotTarget()[axialMotor]) { if (!this.goniometerParameters.goniometerMotors.checkGotTarget(axialMotor,axialMotorPosition)) {
status="Moving axial motor to "+axialMotorPosition+"..."; status="Moving axial motor to "+axialMotorPosition+"...";
if (updateStatus) IJ.showStatus(status); if (updateStatus) IJ.showStatus(status);
boolean OK= this.goniometerParameters.goniometerMotors.moveMotorSetETA(axialMotor, axialMotorPosition); boolean OK= this.goniometerParameters.goniometerMotors.moveMotorSetETA(axialMotor, axialMotorPosition);
...@@ -494,7 +494,7 @@ horizontal axis: ...@@ -494,7 +494,7 @@ horizontal axis:
return false; return false;
} }
} }
if (!this.goniometerParameters.goniometerMotors.checkGotTarget()[tiltMotor]) { if (!this.goniometerParameters.goniometerMotors.checkGotTarget(tiltMotor,tiltMotorPosition))) {
status="Moving tilt motor to "+tiltMotorPosition+"..."; status="Moving tilt motor to "+tiltMotorPosition+"...";
if (updateStatus) IJ.showStatus(status); if (updateStatus) IJ.showStatus(status);
boolean OK= this.goniometerParameters.goniometerMotors.moveMotorSetETA(tiltMotor, tiltMotorPosition); 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