|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.jaetzold.art.RawSensor | +--de.jaetzold.art.RawActuator | +--de.jaetzold.art.Motor
A class which represents a simple Motor. It can be switched on or off and the direction, as well as the level of the power supplied to the motor can be set. This particular implementation can just be used as some kind of Actuator-frontend, because it can give access to all of its abilities when only connected to a simple ActuatorPeer. This class provides some State and Methods which are more convenient to deal with, than with only a single value. However, an Interface can provide a special MotorPeer for this type of Motor, but a normal ActuatorPeer should be sufficient.
ActuatorPeer
,
MotorPeer
,
Actuator
Inner classes inherited from class de.jaetzold.art.RawSensor |
RawSensor.ValueSensorPort |
Field Summary | |
protected boolean |
backward
Whether the output should reverse its polarity when supplying power to the motor. |
protected boolean |
on
Whether the output should be supplied with any power at all. |
protected double |
power
The power that the output should supply to the motor if it is on. |
Fields inherited from class de.jaetzold.art.RawActuator |
localReturn, vetos, waitForCompletion |
Fields inherited from class de.jaetzold.art.RawSensor |
changes, precision, precisionSet, propertyChangeEventDescriptor |
Constructor Summary | |
Motor()
|
Method Summary | |
void |
backward()
Sets the direction of the motor to the opposite of its default-direction. |
void |
connectWith(ActuatorPort port)
Connects this Object with the given Port. |
void |
disconnect()
Disconnects this Sensor from it's Peer and it's Port. |
void |
forward()
Sets the direction of the motor to its default-direction. |
boolean |
getBackward()
Returns whether the polarity the output does or should supply to the motor will or should be reversed or not. |
double |
getPower()
Returns the power the output does or should supply to the motor. |
boolean |
isOn()
Returns whether the motor should be or is supplied with power. |
void |
off()
Switches the Motor off. |
void |
on()
Switches the Motor on. |
void |
reverse()
Reverse the actual direction of the motor, whatever it is now. |
void |
setBackward(boolean backward)
Controls whether the output should reverse its default polarity. |
void |
setOn(boolean on)
Turns the motor on or of depending on the given value. |
void |
setPower(double power)
Sets the power the output should supply to the motor to the given value. |
void |
setValue(double value)
Computes the power, direction and the on/off state from the given value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.jaetzold.art.Sensor |
addPropertyChangeListener, addSensorListener, connectWith, getIntValue, getPort, getPrecision, getSensorPort, isConnected, processEvent, propertyChange, removePropertyChangeListener, removeSensorListener, update |
Field Detail |
protected double power
protected boolean backward
protected boolean on
Constructor Detail |
public Motor()
Method Detail |
public void setValue(double value)
setValue
in class RawActuator
setPower(double)
,
setBackward(boolean)
,
setOn(boolean)
public void connectWith(ActuatorPort port)
connectWith
in class RawActuator
public void disconnect()
Sensor
disconnect
in class RawActuator
de.jaetzold.art.Sensor
Sensor.connectWith(Port)
public double getPower()
localReturnMode
.RawActuator.localReturn
public void setPower(double power)
waitForCompletion
this Method returns immediately after it has been registerd that this is now the state the motor should have, or it returns after the state has been set.RawActuator.waitForCompletion
public boolean getBackward()
localReturnMode
.RawActuator.localReturn
public void setBackward(boolean backward)
waitMode
this Method returns
immediately after it has been registerd that this is now the state the
motor should have, or it returns after the state has been set.RawActuator.waitForCompletion
public boolean isOn()
localReturnMode
.RawActuator.localReturn
public void setOn(boolean on)
waitMode
this Method returns
immediately after it has been registerd that this is now the state the
motor should have, or it returns after the state has been set.RawActuator.waitForCompletion
public void backward()
setBackward(boolean)
public void forward()
setBackward(boolean)
public void on()
setOn(boolean)
public void off()
setOn(boolean)
public void reverse()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |