gov.nasa.gsfc.drl.rtstps.core.fs
Class Flywheeler

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.core.fs.Flywheeler

 class Flywheeler
extends java.lang.Object

This class handles flywheeling for the Frame Synchronizer.


Field Summary
private  Buffer crossover
           
private  int flywheelBytesToFill
           
private  int flywheelDuration
           
private  LongStatusItem flywheels
           
private  int flywheelsCompleted
           
private  FrameClock frameClock
           
private  int frameLength
           
private  Frames frameList
           
private static boolean INVERT_OPTION
           
private  boolean isSendingFlywheels
           
 
Constructor Summary
Flywheeler(FsSetup setup, Buffer crossover, Frames frames, FrameClock frameClock, LongStatusItem flywheels)
          Create a flywheel object.
 
Method Summary
private  boolean discard(Buffer buffer)
          Discard flywheel frames found in the buffer.
(package private)  boolean next(Buffer buffer)
          Continue a flywheel scenario.
(package private)  boolean start(Buffer buffer)
          Begin a flywheel scenario.
private  boolean transmit(Buffer buffer)
          Transmit flywheel frames, which are found in the buffer, as if they were lock frames.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVERT_OPTION

private static final boolean INVERT_OPTION
See Also:
Constant Field Values

flywheelsCompleted

private int flywheelsCompleted

flywheelBytesToFill

private int flywheelBytesToFill

isSendingFlywheels

private boolean isSendingFlywheels

flywheelDuration

private int flywheelDuration

frameLength

private int frameLength

crossover

private Buffer crossover

frameList

private Frames frameList

frameClock

private FrameClock frameClock

flywheels

private LongStatusItem flywheels
Constructor Detail

Flywheeler

Flywheeler(FsSetup setup,
           Buffer crossover,
           Frames frames,
           FrameClock frameClock,
           LongStatusItem flywheels)
Create a flywheel object.

Parameters:
setup - A configuration. You should not create Flywheeler if the flywheel duration in setup is zero.
crossover - A buffer used to handle buffer straddle problems.
frames - A list of output frames.
frameClock - A clock to track annotation timestamps
Method Detail

start

boolean start(Buffer buffer)
Begin a flywheel scenario.

Returns:
True if the flywheel scenario finishes.

next

boolean next(Buffer buffer)
Continue a flywheel scenario.

Returns:
True if the flywheel scenario finishes.

discard

private boolean discard(Buffer buffer)
Discard flywheel frames found in the buffer.

Returns:
True if the flywheel scenario finishes.

transmit

private boolean transmit(Buffer buffer)
Transmit flywheel frames, which are found in the buffer, as if they were lock frames. Note that I set the annotation of completed frames to flywheel (not lock). The other flags have no meaning, except that I turn off the inverted frame bit so that I don't trigger an unnecessary frame inversion somewhere else in the code. When I copy the buffer, I turn off data inversion since I have no idea if the data is inverted or not. (I never look at the sync pattern, which may not even exist.)

Returns:
True if the flywheel scenario finishes.