public class RMIRemoteRegulatedMotor extends java.rmi.server.UnicastRemoteObject implements RMIRegulatedMotor
| Modifier | Constructor and Description |
|---|---|
protected |
RMIRemoteRegulatedMotor(java.lang.String portName,
char motorType) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(RegulatedMotorListener listener)
Adds a listener object that will be notified when rotation has started or stopped
|
void |
backward() |
void |
close() |
void |
flt(boolean immediateReturn)
Set the motor into float mode.
|
void |
forward() |
int |
getLimitAngle()
Return the limit angle (if any)
|
float |
getMaxSpeed()
Returns the maximim speed of the motor.
|
int |
getSpeed()
Returns the current motor speed.
|
int |
getTachoCount() |
boolean |
isMoving() |
boolean |
isStalled()
returns true if motor is stalled
|
RegulatedMotorListener |
removeListener()
Removes the RegulatedMotorListener from this class.
|
void |
resetTachoCount() |
void |
rotate(int angle)
Causes motor to rotate by a specified angle.
|
void |
rotate(int angle,
boolean immediateReturn)
causes motor to rotate through angle;
iff immediateReturn is true, method returns immediately and the motor stops by itself If any motor method is called before the limit is reached, the rotation is canceled. |
void |
rotateTo(int limitAngle)
Causes motor to rotate to limitAngle;
Then getTachoCount should be within +- 2 degrees of the limit angle when the method returns |
void |
rotateTo(int limitAngle,
boolean immediateReturn)
causes motor to rotate to limitAngle;
if immediateReturn is true, method returns immediately and the motor stops by itself and getTachoCount should be within +- 2 degrees if the limit angle If any motor method is called before the limit is reached, the rotation is canceled. |
void |
setAcceleration(int acceleration)
Set the required rate of acceleration degrees/s/s
|
void |
setSpeed(int speed)
Set motor speed.
|
void |
setStallThreshold(int error,
int time)
Set the parameters for detecting a stalled motor.
|
void |
stop(boolean immediateReturn)
Causes motor to stop, pretty much
instantaneously.
|
void |
waitComplete()
Wait until the current movement operation is complete (this can include
the motor stalling).
|
clone, exportObject, exportObject, exportObject, unexportObjectprotected RMIRemoteRegulatedMotor(java.lang.String portName,
char motorType)
throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic void addListener(RegulatedMotorListener listener) throws java.rmi.RemoteException
RMIRegulatedMotoraddListener in interface RMIRegulatedMotorjava.rmi.RemoteExceptionpublic RegulatedMotorListener removeListener() throws java.rmi.RemoteException
RMIRegulatedMotorremoveListener in interface RMIRegulatedMotorjava.rmi.RemoteExceptionpublic void stop(boolean immediateReturn)
throws java.rmi.RemoteException
RMIRegulatedMotorstop in interface RMIRegulatedMotorimmediateReturn - if true do not wait for the motor to actually stopjava.rmi.RemoteExceptionpublic void flt(boolean immediateReturn)
throws java.rmi.RemoteException
RMIRegulatedMotorflt in interface RMIRegulatedMotorimmediateReturn - If true do not wait for the motor to actually stopjava.rmi.RemoteExceptionpublic void waitComplete()
throws java.rmi.RemoteException
RMIRegulatedMotorwaitComplete in interface RMIRegulatedMotorjava.rmi.RemoteExceptionpublic void rotate(int angle,
boolean immediateReturn)
throws java.rmi.RemoteException
RMIRegulatedMotorrotate in interface RMIRegulatedMotorangle - through which the motor will rotateimmediateReturn - iff true, method returns immediately, thus allowing monitoring of sensors in the calling thread.java.rmi.RemoteExceptionRegulatedMotor.rotate(int, boolean)public void rotate(int angle)
throws java.rmi.RemoteException
RMIRegulatedMotorrotate in interface RMIRegulatedMotorangle - by which the motor will rotate.java.rmi.RemoteExceptionpublic void rotateTo(int limitAngle)
throws java.rmi.RemoteException
RMIRegulatedMotorrotateTo in interface RMIRegulatedMotorlimitAngle - to which the motor will rotate, and then stop (in degrees). Includes any positive or negative int, even values > 360.java.rmi.RemoteExceptionpublic void rotateTo(int limitAngle,
boolean immediateReturn)
throws java.rmi.RemoteException
RMIRegulatedMotorrotateTo in interface RMIRegulatedMotorlimitAngle - to which the motor will rotate, and then stop (in degrees). Includes any positive or negative int, even values > 360.immediateReturn - iff true, method returns immediately, thus allowing monitoring of sensors in the calling thread.java.rmi.RemoteExceptionpublic int getLimitAngle()
throws java.rmi.RemoteException
RMIRegulatedMotorgetLimitAngle in interface RMIRegulatedMotorjava.rmi.RemoteExceptionpublic void setSpeed(int speed)
throws java.rmi.RemoteException
RMIRegulatedMotorsetSpeed in interface RMIRegulatedMotorspeed - in degrees per second.java.rmi.RemoteExceptionpublic int getSpeed()
throws java.rmi.RemoteException
RMIRegulatedMotorgetSpeed in interface RMIRegulatedMotorjava.rmi.RemoteExceptionpublic float getMaxSpeed()
throws java.rmi.RemoteException
RMIRegulatedMotorgetMaxSpeed in interface RMIRegulatedMotorjava.rmi.RemoteExceptionpublic boolean isStalled()
throws java.rmi.RemoteException
RMIRegulatedMotorisStalled in interface RMIRegulatedMotorjava.rmi.RemoteExceptionpublic void setStallThreshold(int error,
int time)
throws java.rmi.RemoteException
RMIRegulatedMotorsetStallThreshold in interface RMIRegulatedMotorerror - The error thresholdtime - The time that the error threshold needs to be exceeded for.java.rmi.RemoteExceptionpublic void setAcceleration(int acceleration)
throws java.rmi.RemoteException
RMIRegulatedMotorsetAcceleration in interface RMIRegulatedMotorjava.rmi.RemoteExceptionpublic void close()
throws java.rmi.RemoteException
close in interface RMIRegulatedMotorjava.rmi.RemoteExceptionpublic void forward()
throws java.rmi.RemoteException
forward in interface RMIRegulatedMotorjava.rmi.RemoteExceptionpublic void backward()
throws java.rmi.RemoteException
backward in interface RMIRegulatedMotorjava.rmi.RemoteExceptionpublic void resetTachoCount()
throws java.rmi.RemoteException
resetTachoCount in interface RMIRegulatedMotorjava.rmi.RemoteExceptionpublic int getTachoCount()
throws java.rmi.RemoteException
getTachoCount in interface RMIRegulatedMotorjava.rmi.RemoteExceptionpublic boolean isMoving()
throws java.rmi.RemoteException
isMoving in interface RMIRegulatedMotorjava.rmi.RemoteException