org.robokind.impl.motion.serial
Class SerialServoControllerConfig<Id,SC extends 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, PropertyChangeSource, ServoControllerConfig<Id,SC>

public class SerialServoControllerConfig<Id,SC extends ServoConfig<Id>>
extends PropertyChangeNotifier
implements 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.
 VersionProperty getControllerTypeVersion()
          Returns the controller type VersionProperty.
 String getPortName()
          Returns the port identifier.
 Map<Id,SC> getServoConfigs()
           
 ServoController.Id getServoControllerId()
           
 int getServoCount()
           
 void propertyChange(PropertyChangeEvent evt)
           
 void removeServoConfig(SC config)
           
 void setBaudRate(BaudRate rate)
          Sets port baud rate.
 void setControllerTypeVersion(VersionProperty version)
          Sets the controller type VersionProperty.
 void setPortName(String port)
          Sets port identifier.
 void setServoControllerId(ServoController.Id scId)
           
 
Methods inherited from class org.robokind.api.common.property.PropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, clearAllListeners, clearListeners, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, 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 VersionProperty getControllerTypeVersion()
Returns the controller type VersionProperty.

Specified by:
getControllerTypeVersion in interface ServoControllerConfig<Id,SC extends ServoConfig<Id>>
Returns:
controller type VersionProperty

setControllerTypeVersion

public void setControllerTypeVersion(VersionProperty version)
Sets the controller type VersionProperty.

Specified by:
setControllerTypeVersion in interface ServoControllerConfig<Id,SC extends ServoConfig<Id>>
Parameters:
version - controller type to set

getPortName

public String getPortName()
Returns the port identifier.

Returns:
port identifier

setPortName

public 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

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

Parameters:
rate - BaudRate to set

addServoConfig

public void addServoConfig(SC config)
Specified by:
addServoConfig in interface ServoControllerConfig<Id,SC extends ServoConfig<Id>>

removeServoConfig

public void removeServoConfig(SC config)
Specified by:
removeServoConfig in interface ServoControllerConfig<Id,SC extends ServoConfig<Id>>

getServoCount

public int getServoCount()
Specified by:
getServoCount in interface ServoControllerConfig<Id,SC extends ServoConfig<Id>>

getServoConfigs

public Map<Id,SC> getServoConfigs()
Specified by:
getServoConfigs in interface ServoControllerConfig<Id,SC extends ServoConfig<Id>>

propertyChange

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

getServoControllerId

public ServoController.Id getServoControllerId()
Specified by:
getServoControllerId in interface ServoControllerConfig<Id,SC extends ServoConfig<Id>>

setServoControllerId

public void setServoControllerId(ServoController.Id scId)


Copyright © 2011-2012. All Rights Reserved.