stella.adapter
Class SpillageGuider.GuiderLoop

java.lang.Object
  extended by java.util.TimerTask
      extended by stella.adapter.SpillageGuider.GuiderLoop
All Implemented Interfaces:
Runnable
Enclosing class:
SpillageGuider

private class SpillageGuider.GuiderLoop
extends TimerTask

The timer task that does the actual guiding. If the guider mode was automatic, we are allowed to send back guider-mode change request, which are normal error events. The master mind will as a response stop the guiding in the master mind, thus we do not stop the guiding in this case.


Field Summary
private  boolean cancel
          If cancel was called lately.
private  long lastsent
          The time of the last PID query.
private  long start
          The starting time of the guider loop.
 
Constructor Summary
protected SpillageGuider.GuiderLoop()
          Start a new guider loop and records the start time.
 
Method Summary
private  Vector2D averageAzAltShift(List shifts)
          Averages a list of az/alt offsets stored as two-dimensional vectors.
 boolean cancel()
          Also allow immediate exits in our loop.
private  boolean check(Value v, double above)
          Check, if the value is non-null, its value is non-null and if this value is higher than the supplied double.
 void run()
          First, check if we are running.
private  void writeRecord(DataOutputStream record, double az, double alt)
          If the record file is non null, write the two doubles as floats into it.
 
Methods inherited from class java.util.TimerTask
scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

start

private long start
The starting time of the guider loop.


lastsent

private long lastsent
The time of the last PID query.


cancel

private boolean cancel
If cancel was called lately.

Constructor Detail

SpillageGuider.GuiderLoop

protected SpillageGuider.GuiderLoop()
Start a new guider loop and records the start time.

Method Detail

cancel

public boolean cancel()
Also allow immediate exits in our loop.

Overrides:
cancel in class TimerTask

run

public void run()
First, check if we are running. In that case exit immediately. Otherwise take a guider frame, interpret it and apply an offset.

Specified by:
run in interface Runnable
Specified by:
run in class TimerTask

check

private final boolean check(Value v,
                            double above)
Check, if the value is non-null, its value is non-null and if this value is higher than the supplied double.


averageAzAltShift

private Vector2D averageAzAltShift(List shifts)
Averages a list of az/alt offsets stored as two-dimensional vectors.


writeRecord

private void writeRecord(DataOutputStream record,
                         double az,
                         double alt)
If the record file is non null, write the two doubles as floats into it.