de.jaetzold.art.platform.lego
Class Mindstorms

java.lang.Object
  |
  +--de.jaetzold.art.platform.RobotInterfaceAdapter
        |
        +--de.jaetzold.art.platform.lego.RCX
              |
              +--de.jaetzold.art.platform.lego.Mindstorms
All Implemented Interfaces:
RobotInterface

public class Mindstorms
extends RCX


Inner Class Summary
protected  class Mindstorms.LightSensorValueDefinition
           
protected  class Mindstorms.MSCountSensorPeer
           
protected  class Mindstorms.MSLightSensorPeer
           
protected  class Mindstorms.RCXActuatorPeer
           
protected  class Mindstorms.RCXBooleanSensorPeer
           
protected  class Mindstorms.RCXRawSensorPeer
           
protected  class Mindstorms.RCXStateSensorPeer
           
protected  class Mindstorms.RotationSensorValueDefinition
           
 
Inner classes inherited from class de.jaetzold.art.platform.lego.RCX
RCX.AliveValueDefinition, RCX.BooleanConversionValueDefinition, RCX.CondenseEventsTask, RCX.GetSensorValueTask, RCX.MotorSensorValueDefinition, RCX.Null, RCX.PacketEvent, RCX.PollSensorValueDefinition, RCX.RawValueDefinition, RCX.ReadPacketTask, RCX.SensorValueDefinition, RCX.StateConversionValueDefinition, RCX.WritePacketTask
 
Field Summary
static int CONNECTION_ALIVE
           
static int CONNECTION_DEAD
           
protected  Map portToPeerCollection
          every Sensor gets its own Peer
 
Fields inherited from class de.jaetzold.art.platform.lego.RCX
alive, ALIVE, connected, eventQueue, filterTable, inStream, notifier, notifierQueue, outStream, packetToValueDefinitionSet, POLL, polledSensorValues, reader, readerQueue, sensorValueListeners, sensorValues, UNLOCK_FIRMWARE, writer, writerQueue, writerResultQueue
 
Method Summary
 boolean conformsTo(RobotInterfaceDefinition definition)
          Tells whether the given RobotInterfaceDefinition identifies this RobotInterface.
protected  ActuatorPeer getActuatorPeer(ActuatorPort port, Sensor sensor)
           
 ActuatorPort[] getActuatorPorts()
          Returns a description of all ActuatorPorts this Interface provides.
 int getConnectionState()
           
 RobotInterfaceDefinition getInterfaceDefinition()
          Returns a RobotInterfaceDefinition describing this instance of a RobotInterface.
static RobotInterface[] getInterfaces(RobotInterfaceDefinition[] ports)
          Scans the given Ports.
protected  SensorPeer getSensorPeer(SensorPort port, Sensor sensor)
           
 SensorPort[] getSensorPorts()
          Returns a description of all SensorPorts this Interface provides.
 boolean isConnected()
          Tells the state of the physical connection to the hardware-interface.
protected  boolean testForTower()
           
 
Methods inherited from class de.jaetzold.art.platform.lego.RCX
alive, call, call, getSensorValue, isAlive, startPolling, stopPolling, unlockFirmware
 
Methods inherited from class de.jaetzold.art.platform.RobotInterfaceAdapter
getActuatorPorts, getPort, getSensorPorts, getSerialPortNames, getSerialPortNames, getSerialPortNames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTION_ALIVE

public static final int CONNECTION_ALIVE

CONNECTION_DEAD

public static final int CONNECTION_DEAD

portToPeerCollection

protected Map portToPeerCollection
every Sensor gets its own Peer
Method Detail

getConnectionState

public int getConnectionState()

isConnected

public boolean isConnected()
Description copied from interface: RobotInterface
Tells the state of the physical connection to the hardware-interface. It may be the case that this state is not distinguishable from the one defined by isAlive().
Overrides:
isConnected in class RCX
Following copied from interface: de.jaetzold.art.RobotInterface
See Also:
RobotInterface.isAlive(), SensorPeer.isConnected(), Sensor.isConnected()

testForTower

protected boolean testForTower()

getInterfaces

public static RobotInterface[] getInterfaces(RobotInterfaceDefinition[] ports)
Scans the given Ports.

getActuatorPeer

protected ActuatorPeer getActuatorPeer(ActuatorPort port,
                                       Sensor sensor)
Overrides:
getActuatorPeer in class RCX

getSensorPeer

protected SensorPeer getSensorPeer(SensorPort port,
                                   Sensor sensor)
Overrides:
getSensorPeer in class RCX

getActuatorPorts

public ActuatorPort[] getActuatorPorts()
Returns a description of all ActuatorPorts this Interface provides. The description consists of the portnumber and a minimal pulsewidth this actuatorport can generate. (also: voltage, polarity, AC/DC, maximum number of automated pulses, granularity of voltage, excludes use of other actuators?, asf.)
Following copied from interface: de.jaetzold.art.RobotInterface
See Also:
RobotInterface.getSensorPorts(), ActuatorPort.connectWith(Actuator)

getSensorPorts

public SensorPort[] getSensorPorts()
Returns a description of all SensorPorts this Interface provides. The description consists of the portnumber and some other information describing the capabilities of the sensorport. (pollingfreq., settable pollingfreq.?, hw-events?, scaling (which voltage/resistance for which value), maximum-value/voltage?, Powered?, counting?, excludes use of other sensors?, asf.).
Following copied from interface: de.jaetzold.art.RobotInterface
See Also:
RobotInterface.getActuatorPorts(), SensorPort.connectWith(Sensor)

getInterfaceDefinition

public RobotInterfaceDefinition getInterfaceDefinition()
Description copied from interface: RobotInterface
Returns a RobotInterfaceDefinition describing this instance of a RobotInterface. It describes the RobotInterface in the sense that a call to conformsTo(RobotInterfaceDefinition) with it as a parameter will yield true as a result. There should be no other instances of RobotInterface at a time which conform to this definition. However there may other definitions possible to which more than one RobotInterface conforms to, but they shouldn't be returned by this method. The current implementations use a RobotInterfaceStringDefinition.
Following copied from interface: de.jaetzold.art.RobotInterface
See Also:
RobotInterfaceStringDefinition, RobotInterface.conformsTo(RobotInterfaceDefinition), RobotInterfaceFactory.getInterface(RobotInterfaceDefinition)

conformsTo

public boolean conformsTo(RobotInterfaceDefinition definition)
Description copied from interface: RobotInterface
Tells whether the given RobotInterfaceDefinition identifies this RobotInterface. The provided implementations for Fischertechnik and Mindstorms use Strings.
Following copied from interface: de.jaetzold.art.RobotInterface
See Also:
RobotInterfaceStringDefinition, RobotInterface.getInterfaceDefinition(), RobotInterfaceFactory.getInterface(RobotInterfaceDefinition)