Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
28673df9
Commit
28673df9
authored
Oct 20, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix in goniometer move
parent
d2be09fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
CalibrationHardwareInterface.java
src/main/java/CalibrationHardwareInterface.java
+6
-1
Goniometer.java
src/main/java/Goniometer.java
+2
-2
No files found.
src/main/java/CalibrationHardwareInterface.java
View file @
28673df9
...
@@ -2609,7 +2609,7 @@ public class CalibrationHardwareInterface {
...
@@ -2609,7 +2609,7 @@ public class CalibrationHardwareInterface {
nanoETA
=
System
.
nanoTime
()+((
long
)(
1
E9
*(
Math
.
abs
(
this
.
targetPosition
[
motorNumber
]-
this
.
curpos
[
motorNumber
])*(
this
.
coefficientETA
/
this
.
stepsPerSecond
))));
nanoETA
=
System
.
nanoTime
()+((
long
)(
1
E9
*(
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
,
...
...
src/main/java/Goniometer.java
View file @
28673df9
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment