stella.adapter
Class BeamSplitterGuider.GuiderLoop

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

private class BeamSplitterGuider.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  long lastsent
          The time of the last PID query.
private  long start
          The starting time of the guider loop.
 
Constructor Summary
protected BeamSplitterGuider.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.
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
cancel, 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.

Constructor Detail

BeamSplitterGuider.GuiderLoop

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

Method Detail

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.