de.jaetzold.art.platform.lego
Class Mindstorms.RCXActuatorPeer
java.lang.Object
|
+--de.jaetzold.art.platform.BaseSensorPeer
|
+--de.jaetzold.art.platform.lego.Mindstorms.RCXRawSensorPeer
|
+--de.jaetzold.art.platform.lego.Mindstorms.RCXActuatorPeer
- All Implemented Interfaces:
- ActuatorPeer, SensorPeer
- Enclosing class:
- Mindstorms
- protected class Mindstorms.RCXActuatorPeer
- extends Mindstorms.RCXRawSensorPeer
- implements ActuatorPeer
Method Summary |
boolean |
getDeliversFloatingPoint()
Tells whether this SensorPeer delivers discrete values or not. |
double |
getPrecision()
Returns the maximum of the expectable error in the value. |
void |
processEvent(SensorEvent se)
Deliver the given SensorEvent to all Listeners. |
void |
setValue(double newValue)
Set the actuator to the value given as a parameter. |
void |
setValue(double newValue,
boolean waitToComplete)
Set the actuator to the value given as a parameter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Mindstorms.RCXActuatorPeer
protected Mindstorms.RCXActuatorPeer(byte outputID,
RCX.SensorValueDefinition valueDefinition)
Mindstorms.RCXActuatorPeer
protected Mindstorms.RCXActuatorPeer(byte outputID)
setValue
public void setValue(double newValue)
- Description copied from interface:
ActuatorPeer
- Set the actuator to the value given as a parameter.
- Specified by:
setValue
in interface ActuatorPeer
- Following copied from interface:
de.jaetzold.art.platform.ActuatorPeer
- See Also:
ActuatorPeer.setValue(double,boolean)
setValue
public void setValue(double newValue,
boolean waitToComplete)
- Description copied from interface:
ActuatorPeer
- Set the actuator to the value given as a parameter.
If waitForCompletion is false this method may return before the new value has been sent to the hardware. This way the method could return almost immediatly and informing the peer and thus the hardware may happen asynchronous.
If for some reason the value is not o.k. for this Peer it is not required to accept the value and it is also not required to report that through an Exception.
- Specified by:
setValue
in interface ActuatorPeer
- Following copied from interface:
de.jaetzold.art.platform.ActuatorPeer
- Parameters:
value
- the value this Actuator should have.waitForCompletion
- whether this method may set the value asynchronous.- See Also:
ActuatorPeer.setValue(double)
processEvent
public void processEvent(SensorEvent se)
- Description copied from interface:
SensorPeer
- Deliver the given
SensorEvent
to all Listeners. Maybe update internal cache of the value.
- Specified by:
processEvent
in interface SensorPeer
- Overrides:
processEvent
in class BaseSensorPeer
- Following copied from interface:
de.jaetzold.art.platform.SensorPeer
- See Also:
SensorPeer.addPropertyChangeListener(PropertyChangeListener)
getDeliversFloatingPoint
public boolean getDeliversFloatingPoint()
- Description copied from interface:
SensorPeer
- Tells whether this SensorPeer delivers discrete values or not. A result of false means that the result of a getValue() can be cast to int without a loss of precision.
- Specified by:
getDeliversFloatingPoint
in interface SensorPeer
- Overrides:
getDeliversFloatingPoint
in class Mindstorms.RCXRawSensorPeer
getPrecision
public double getPrecision()
- Description copied from interface:
SensorPeer
- Returns the maximum of the expectable error in the value.
This is just a guess, what means that nothing really important should depend on it. It is meant to give an algorithm using a Sensor connected to this SensorPeer an idea of how precise the value is so that it either can refuse to use it or try to compensate if necessary.
- Specified by:
getPrecision
in interface SensorPeer
- Overrides:
getPrecision
in class BaseSensorPeer