/** * 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; }
/** * 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); }