diff --git a/src/src/main/java/com/my/graphiteDigesterBg/diframe/actuator/DiActMotor.java b/src/src/main/java/com/my/graphiteDigesterBg/diframe/actuator/DiActMotor.java index 438abf7..f11bd9e 100644 --- a/src/src/main/java/com/my/graphiteDigesterBg/diframe/actuator/DiActMotor.java +++ b/src/src/main/java/com/my/graphiteDigesterBg/diframe/actuator/DiActMotor.java @@ -29,42 +29,18 @@ public class DiActMotor extends DiActuatorBase { @Override protected void onEnable() { - if ( null != this.shaft ) { - this.call(DiCommand.MODULE_SET_REG,1051, this.shaft); - } - if ( null != this.oneCirclePulse ) { - this.call(DiCommand.MODULE_SET_REG, 1052, this.oneCirclePulse); - } - if ( null != this.oneCirclePulseDenominator ) { - this.call(DiCommand.MODULE_SET_REG, 1053, this.oneCirclePulseDenominator); - } - if ( null != this.defaultVelocity ) { - this.call(DiCommand.MODULE_SET_REG, 1054, this.defaultVelocity); - } - if ( null != this.defaultAcc ) { - this.call(DiCommand.MODULE_SET_REG, 1055, this.defaultAcc); - } - if ( null != this.defaultDec ) { - this.call(DiCommand.MODULE_SET_REG, 1056, this.defaultDec); - } - if ( null != this.stepMotorIHold ) { - this.call(DiCommand.MODULE_SET_REG, 1058, this.stepMotorIHold); - } - if ( null != this.stepMotorIRun ) { - this.call(DiCommand.MODULE_SET_REG, 1059, this.stepMotorIRun); - } - if ( null != this.runToZeroSpeed ) { - this.call(DiCommand.MODULE_SET_REG, 1073, this.runToZeroSpeed); - } - if ( null != this.runToZeroDec ) { - this.call(DiCommand.MODULE_SET_REG, 1074, this.runToZeroDec); - } - if ( null != this.lookZeroEdgeSpeed ) { - this.call(DiCommand.MODULE_SET_REG, 1075, this.lookZeroEdgeSpeed); - } - if ( null != this.lookZeroEdgeDec ) { - this.call(DiCommand.MODULE_SET_REG, 1076, this.lookZeroEdgeDec); - } + this.setRegValue(1051, this.shaft); + this.setRegValue(1052, this.oneCirclePulse); + this.setRegValue(1053, this.oneCirclePulseDenominator); + this.setRegValue(1054, this.defaultVelocity); + this.setRegValue(1055, this.defaultAcc); + this.setRegValue(1056, this.defaultDec); + this.setRegValue(1058, this.stepMotorIHold); + this.setRegValue(1059, this.stepMotorIRun); + this.setRegValue(1073, this.runToZeroSpeed); + this.setRegValue(1074, this.runToZeroDec); + this.setRegValue(1075, this.lookZeroEdgeSpeed); + this.setRegValue(1076, this.lookZeroEdgeDec); this.activeConfig(); }