org.robokind.impl.motion.serial
Class SerialServoControllerConfig<Id,SC extends org.robokind.api.motion.servos.config.ServoConfig<Id>>

java.lang.Object
  extended by org.robokind.api.common.property.PropertyChangeNotifier
      extended by org.robokind.impl.motion.serial.SerialServoControllerConfig<Id,SC>
All Implemented Interfaces:
PropertyChangeListener, EventListener, org.robokind.api.common.property.PropertyChangeSource, org.robokind.api.motion.servos.config.ServoControllerConfig<Id,SC>

public class SerialServoControllerConfig<Id,SC extends org.robokind.api.motion.servos.config.ServoConfig<Id>>
extends org.robokind.api.common.property.PropertyChangeNotifier
implements org.robokind.api.motion.servos.config.ServoControllerConfig<Id,SC>, PropertyChangeListener

Author:
Matthew Stevenson

Field Summary
static String PROP_BAUD_RATE
          Property string for SerialServoControllerConfig baud rate.
static String PROP_PORT_NAME
          Property string for SerialServoControllerConfig port name.
 
Fields inherited from interface org.robokind.api.motion.servos.config.ServoControllerConfig
PROP_CONTROLLER_TYPE, PROP_SERVO_ADD, PROP_SERVO_REMOVE, PROP_SERVOS
 
Constructor Summary
protected SerialServoControllerConfig()
          Creates an empty SerialServoControllerConfig.
  SerialServoControllerConfig(String portName, BaudRate baud)
          Creates a new SerialServoControllerConfig with the given port name and baud rate.
 
Method Summary
 void addServoConfig(SC config)
           
 BaudRate getBaudRate()
          Returns port baud rate.
 org.robokind.api.common.config.VersionProperty getControllerTypeVersion()
          Returns the controller type VersionProperty.
 String getPortName()
          Returns the port identifier.
 Map<Id,SC> getServoConfigs()
           
 org.robokind.api.motion.servos.ServoController.Id getServoControllerId()
           
 int getServoCount()
           
 void propertyChange(PropertyChangeEvent evt)
           
 void removeServoConfig(SC config)
           
protected  void setBaudRate(BaudRate rate)
          Sets port baud rate.
 void setControllerTypeVersion(org.robokind.api.common.config.VersionProperty version)
          Sets the controller type VersionProperty.
protected  void setPortName(String port)
          Sets port identifier.
 void setServoControllerId(org.robokind.api.motion.servos.ServoController.Id scId)
           
 
Methods inherited from class org.robokind.api.common.property.PropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.robokind.api.common.property.PropertyChangeSource
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Field Detail

PROP_PORT_NAME

public static final String PROP_PORT_NAME
Property string for SerialServoControllerConfig port name.

See Also:
Constant Field Values

PROP_BAUD_RATE

public static final String PROP_BAUD_RATE
Property string for SerialServoControllerConfig baud rate.

See Also:
Constant Field Values
Constructor Detail

SerialServoControllerConfig

public SerialServoControllerConfig(String portName,
                                   BaudRate baud)
Creates a new SerialServoControllerConfig with the given port name and baud rate.

Parameters:
portName - port identifier
baud - baud rate

SerialServoControllerConfig

protected SerialServoControllerConfig()
Creates an empty SerialServoControllerConfig.

Method Detail

getControllerTypeVersion

public org.robokind.api.common.config.VersionProperty getControllerTypeVersion()
Returns the controller type VersionProperty.

Specified by:
getControllerTypeVersion in interface org.robokind.api.motion.servos.config.ServoControllerConfig<Id,SC extends org.robokind.api.motion.servos.config.ServoConfig<Id>>
Returns:
controller type VersionProperty

setControllerTypeVersion

public void setControllerTypeVersion(org.robokind.api.common.config.VersionProperty version)
Sets the controller type VersionProperty.

Specified by:
setControllerTypeVersion in interface org.robokind.api.motion.servos.config.ServoControllerConfig<Id,SC extends org.robokind.api.motion.servos.config.ServoConfig<Id>>
Parameters:
version - controller type to set

getPortName

public String getPortName()
Returns the port identifier.

Returns:
port identifier

setPortName

protected void setPortName(String port)
Sets port identifier.

Parameters:
port - port identifier to set

getBaudRate

public BaudRate getBaudRate()
Returns port baud rate.

Returns:
port baud rate

setBaudRate

protected void setBaudRate(BaudRate rate)
Sets port baud rate.

Parameters:
rate - BaudRate to set

addServoConfig

public void addServoConfig(SC config)
Specified by:
addServoConfig in interface org.robokind.api.motion.servos.config.ServoControllerConfig<Id,SC extends org.robokind.api.motion.servos.config.ServoConfig<Id>>

removeServoConfig

public void removeServoConfig(SC config)
Specified by:
removeServoConfig in interface org.robokind.api.motion.servos.config.ServoControllerConfig<Id,SC extends org.robokind.api.motion.servos.config.ServoConfig<Id>>

getServoCount

public int getServoCount()
Specified by:
getServoCount in interface org.robokind.api.motion.servos.config.ServoControllerConfig<Id,SC extends org.robokind.api.motion.servos.config.ServoConfig<Id>>

getServoConfigs

public Map<Id,SC> getServoConfigs()
Specified by:
getServoConfigs in interface org.robokind.api.motion.servos.config.ServoControllerConfig<Id,SC extends org.robokind.api.motion.servos.config.ServoConfig<Id>>

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

getServoControllerId

public org.robokind.api.motion.servos.ServoController.Id getServoControllerId()
Specified by:
getServoControllerId in interface org.robokind.api.motion.servos.config.ServoControllerConfig<Id,SC extends org.robokind.api.motion.servos.config.ServoConfig<Id>>

setServoControllerId

public void setServoControllerId(org.robokind.api.motion.servos.ServoController.Id scId)


Copyright © 2011. All Rights Reserved.