@Override protected ServoConfig<Id> newServoConfig( Id id, String name, int minPos, int maxPos, int defPos) { return new DefaultServoConfig<MaestroServo.Id>( id, name, minPos, maxPos, defPos); }
/** * Sets the Servo name. * @param name new Servo name */ @Override public void setName(String name){ String oldName = myName; myName = name; firePropertyChange(ServoConfig.PROP_NAME, oldName, name); }
/** * Sets the Servo default position. * @param pos new Servo default position */ @Override public void setDefaultPosition(Integer pos){ if(pos == null){ throw new NullPointerException("Cannot set null position."); } checkAbsPosition(pos); Integer oldPos = myDefaultPosition; myDefaultPosition = pos; firePropertyChange(ServoConfig.PROP_DEF_POSITION, oldPos, pos); }
/** * Creates a new ServoConfig with the given parameters. * @param servoId The Servo's Id with respect to the ServoController * @param name Servo name (used for display purposes) * @param minPos minimum position in absolute terms for the ServoController * @param maxPos maximum position in absolute terms for the ServoController * @param defPos default position in absolute terms for the ServoController */ public DefaultServoConfig(Id servoId, String name, int minPos, int maxPos, int defPos){ myServoId = servoId; myName = name; myMinPosition = minPos; myMaxPosition = maxPos; checkAbsPosition(defPos); myDefaultPosition = defPos; }
@Override protected ServoConfig<OpenServo.Id> newServoConfig( OpenServo.Id id, String name, int minPos, int maxPos, int defPos) { return new DefaultServoConfig<OpenServo.Id>( id, name, minPos, maxPos, defPos); }
/** * Sets the Servo minimum position. * @param pos new Servo minimum position */ @Override public void setMinPosition(Integer pos){ if(pos == null){ throw new NullPointerException("Cannot set null position."); } Integer oldPos = myMinPosition; myMinPosition = pos; firePropertyChange(ServoConfig.PROP_MIN_POSITION, oldPos, pos); }
@Override protected ServoConfig<DynamixelServo.Id> newServoConfig( Id id, String name, int minPos, int maxPos, int defPos) { return new DefaultServoConfig<DynamixelServo.Id>( id, name, minPos, maxPos, defPos); }
/** * Sets the Servo id. * @param id new Servo id */ @Override public void setServoId(Id id){ if(id == null){ throw new NullPointerException("Cannot set null Servo id."); } Id oldId = myServoId; myServoId = id; firePropertyChange(ServoConfig.PROP_ID, oldId, id); }
/** * Sets the Servo maximum position. * @param pos new Servo maximum position */ @Override public void setMaxPosition(Integer pos){ if(pos == null){ throw new NullPointerException("Cannot set null position."); } Integer oldPos = myMaxPosition; myMaxPosition = pos; firePropertyChange(ServoConfig.PROP_MAX_POSITION, oldPos, pos); }