|
|
@ -26,6 +26,8 @@ public class DiActMotor extends DiActuatorBase { |
|
|
|
protected Integer stepMotorIHold; |
|
|
|
// look zero edge pulse |
|
|
|
protected Integer stepMotorIRun; |
|
|
|
// offset |
|
|
|
protected Integer moveOffset = 0; |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void onEnable() { |
|
|
@ -88,8 +90,15 @@ public class DiActMotor extends DiActuatorBase { |
|
|
|
this.waitForFinish(); |
|
|
|
} |
|
|
|
|
|
|
|
// set move offset |
|
|
|
public void setMoveOffset( String name ) { |
|
|
|
this.moveOffset = this.getLocationValue(name); |
|
|
|
this.log("setMoveOffset #{}={}", name, this.moveOffset); |
|
|
|
} |
|
|
|
|
|
|
|
// move to position |
|
|
|
public void moveTo( Integer pos ) { |
|
|
|
pos += this.moveOffset; |
|
|
|
this.log("moveTo {}", pos); |
|
|
|
this.call(DiCommand.MOTOR_EASY_MOVE_TO, pos); |
|
|
|
this.waitForFinish(); |
|
|
@ -99,6 +108,7 @@ public class DiActMotor extends DiActuatorBase { |
|
|
|
public void moveTo( String key, Object ... args ) { |
|
|
|
Integer pos = this.getLocationValue(key, args); |
|
|
|
this.log("moveTo #{}={}", key, pos); |
|
|
|
pos += this.moveOffset; |
|
|
|
this.call(DiCommand.MOTOR_EASY_MOVE_TO, pos); |
|
|
|
this.waitForFinish(); |
|
|
|
} |
|
|
|