|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
stella.roof.DomeReceiver.Slew
private class DomeReceiver.Slew
This thread never switches motors on or off!
This class acts as a thread to slew to a desired position. It returns
if this position is reached within the provided offset, or if canceled
or the motor is stopped.
Successful execution return true on a call to isAt(), successful
meaning that the desired position was reached. The anticipated use of
this class is to construct it supplying the desired position and the
allowed offset, then starting it and joining on it for a certain
timeout. If the thread did not finish successfully, it should be
canceled.
Remember: This thread never switches motors on or off!
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private boolean |
cancel
Signals a cancel issued from the outside. |
private double |
nominal
The requested nominal position in degrees. |
private double |
offset
The allowed offset. |
private boolean |
success
If the position is reached, this boolean get true and we die. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
protected |
DomeReceiver.Slew(double to,
double off)
Constructs a new slewing thread to watch the movement of the dome to the desired position, required accuracy given. |
| Method Summary | |
|---|---|
protected void |
cancel()
Cancels this thread. |
boolean |
isAt()
Returns true, if the desired position is reached. |
void |
run()
We constantly query the current position of the dome at a cycle of DomeReceiver.KEY_SLEWSLEEP until the required position is reached within
the required offset. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private double nominal
private double offset
private boolean cancel
private boolean success
| Constructor Detail |
|---|
protected DomeReceiver.Slew(double to,
double off)
| Method Detail |
|---|
public void run()
DomeReceiver.KEY_SLEWSLEEP until the required position is reached within
the required offset. If the motors are off, i.e. the dome is not
moving, or if we are canceled from the outside, the success
flag is set to false and we return. Otherwise we return when the
position is reached.
Remember: This thread never switches motors on or off!
run in interface Runnablerun in class Threadpublic boolean isAt()
protected void cancel()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||