Class ExposureCommand

java.lang.Object
  |
  +--SwingWorker
        |
        +--ExposureCommand
Direct Known Subclasses:
IRExposureCommand

public class ExposureCommand
extends SwingWorker


Field Summary
protected  int byte_count
           
protected  boolean change_exposure_time
           
protected  int cols
           
protected static boolean current_shutter_position
           
protected  int deinterlace_value
           
protected  int delay
           
protected  boolean do_auto_increment
           
protected  boolean do_beep
           
protected  boolean do_deinterlacing
           
protected  boolean do_delay
           
protected  boolean do_display
           
protected  boolean do_image_save
           
protected  boolean do_multiple_exposures
           
protected  boolean do_open_shutter
           
protected  DspCommand2 dsp_cmd
           
protected  int elapsed_time
           
protected  int exposure_time
           
protected  Fits image
           
protected  java.lang.String image_filename
           
protected  java.lang.String image_filename_prefix
           
protected  int image_resolution
           
protected  int increment
           
protected  int last_increment
           
protected  int number_of_exposures
           
protected  VoodooMainWindow parent
           
protected  boolean pause
           
protected  int rows
           
protected  int start_increment
           
protected static boolean use_controller_exptime
           
 
Fields inherited from class SwingWorker
abort, thread, value
 
Constructor Summary
ExposureCommand(VoodooMainWindow parent)
          Constructor.
 
Method Summary
 void abort_exposure()
          This method aborts the current exposure.
 void abort_readout()
          This method aborts the current image readout.
 void change_exposure_time()
          This method indicates that the current exposure time should be changed to the new value.
protected  void components_enabled(boolean mode)
          This method enables/disables the components on the main window.
 java.lang.Object construct()
          This method starts the SwingWorker thread.
 java.lang.Object expose()
          This method performs the exposure sequence.
 void finished()
          This method closes the SwingWorker thread.
private  void monitor_readout()
           
 void pause_exposure(boolean pause)
          This method pauses the current exposure.
 void set_auto_increment(boolean auto_increment)
          This method specifies whether or not to auto increment the image file.
 void set_beep(boolean beep)
          This method specifies whether or not to beep when the exposure is complete.
 void set_deinterlace_value(int value)
          This method sets the deinterlace method to use.
 void set_deinterlacing(boolean deinterlacing)
          This method sets the deinterlacing control to on/off.
 void set_delay(boolean delay)
          This method specifies whether or not to delay before each exposure.
 void set_delay(java.lang.String delay_time)
          This method sets the pre-exposure delay.
 void set_display_image(boolean display)
          This method specifies whether or not to display the image after the exposure completes.
static void set_exposure_controller_mode(boolean use_controller)
          This method sets which should be used to control the exposure time count, the controller or the host CPU.
 void set_exposure_time(java.lang.String exp_time)
          This method sets the exposure time.
 void set_image_dimensions(int row_num, int col_num)
          This method sets the image dimensions.
 void set_image_filename(java.lang.String image_file)
          This method sets the image filename.
 void set_image_resolution(int resolution)
          This method sets the image resolution.
 void set_multiple_exposures(boolean multiple_exposures)
          This method specifies whether or not to do multiple images.
 void set_number_of_exposures(java.lang.String num_of_exp)
          This method sets the number of exposure to take.
 void set_open_shutter(boolean open_shutter)
          This method specifies whether or not to open the shutter during an exposure.
 void set_save_to_disk(boolean save_to_disk)
          This method specifies whether or not to save the image.
protected  int set_shutter_postion()
          This method sets the current shutter position that is to used during the exposure.
private  void updateStatus(int i)
           
 
Methods inherited from class SwingWorker
alive, get, interrupt, stop, thread_it
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

parent

protected VoodooMainWindow parent

dsp_cmd

protected DspCommand2 dsp_cmd

image

protected Fits image

byte_count

protected int byte_count

rows

protected int rows

cols

protected int cols

elapsed_time

protected int elapsed_time

start_increment

protected int start_increment

last_increment

protected int last_increment

increment

protected int increment

exposure_time

protected int exposure_time

image_resolution

protected int image_resolution

image_filename

protected java.lang.String image_filename

image_filename_prefix

protected java.lang.String image_filename_prefix

do_image_save

protected boolean do_image_save

do_multiple_exposures

protected boolean do_multiple_exposures

do_auto_increment

protected boolean do_auto_increment

do_delay

protected boolean do_delay

do_display

protected boolean do_display

do_beep

protected boolean do_beep

do_deinterlacing

protected boolean do_deinterlacing

do_open_shutter

protected boolean do_open_shutter

pause

protected boolean pause

change_exposure_time

protected boolean change_exposure_time

current_shutter_position

protected static boolean current_shutter_position

deinterlace_value

protected int deinterlace_value

number_of_exposures

protected int number_of_exposures

delay

protected int delay

use_controller_exptime

protected static boolean use_controller_exptime
Constructor Detail

ExposureCommand

public ExposureCommand(VoodooMainWindow parent)
Constructor.
See Also:
VoodooMainWindow, SwingWorker
Method Detail

abort_exposure

public void abort_exposure()
This method aborts the current exposure.
See Also:
VoodooMainWindow, SwingWorker, DspCommand2

pause_exposure

public void pause_exposure(boolean pause)
This method pauses the current exposure.
See Also:
VoodooMainWindow, SwingWorker, DspCommand2

change_exposure_time

public void change_exposure_time()
This method indicates that the current exposure time should be changed to the new value.
See Also:
VoodooMainWindow, SwingWorker, DspCommand2

abort_readout

public void abort_readout()
This method aborts the current image readout.
See Also:
VoodooMainWindow, SwingWorker, DspCommand2

set_save_to_disk

public void set_save_to_disk(boolean save_to_disk)
This method specifies whether or not to save the image.
Parameters:
save_to_disk - If true, save image to disk. If false, do not save the image.

set_multiple_exposures

public void set_multiple_exposures(boolean multiple_exposures)
This method specifies whether or not to do multiple images.
Parameters:
multiple_exposures - If true, do multiple exposures. If false, do not do multiple exposures.

set_auto_increment

public void set_auto_increment(boolean auto_increment)
This method specifies whether or not to auto increment the image file.
Parameters:
auto_increment - If true, auto increment filename. If false, do not auto increment filename.

set_delay

public void set_delay(boolean delay)
This method specifies whether or not to delay before each exposure.
Parameters:
delay - If true, delay before each exposure. If false, do not delay before each exposure.

set_beep

public void set_beep(boolean beep)
This method specifies whether or not to beep when the exposure is complete.
Parameters:
beep - If true, beep after exposure completes. If false, do not beep after exposure completes.

set_display_image

public void set_display_image(boolean display)
This method specifies whether or not to display the image after the exposure completes.
Parameters:
display - If true, display image after exposure completes. If false, do not display image after exposure completes.

set_open_shutter

public void set_open_shutter(boolean open_shutter)
This method specifies whether or not to open the shutter during an exposure.
Parameters:
display - If true, open the shutter during an exposure. If false, do not open the shutter during an exposure.

set_exposure_controller_mode

public static void set_exposure_controller_mode(boolean use_controller)
This method sets which should be used to control the exposure time count, the controller or the host CPU.
Parameters:
use_controller - True means use the controller for exposure time count. False means use the host CPU.

set_deinterlacing

public void set_deinterlacing(boolean deinterlacing)
This method sets the deinterlacing control to on/off.
Parameters:
deinterlacing - True to set the perform deinterlacing, false to not perform deinterlacing.

set_deinterlace_value

public void set_deinterlace_value(int value)
This method sets the deinterlace method to use. The methods are:
	1. Single readout from one output.
	2. Dual readout with parallel split from two outputs.
	3. Dual readout with serial split from two outputs.
	4. Quad readout from four outputs.
	
Parameters:
value - The deinterlace method.

set_exposure_time

public void set_exposure_time(java.lang.String exp_time)
                       throws java.lang.NumberFormatException
This method sets the exposure time. The input string is parsed as a float and multiplied by a 1000 to convert the exposure time to milliseconds.
Parameters:
exp_time - The exposure time (as a String).

set_delay

public void set_delay(java.lang.String delay_time)
               throws java.lang.NumberFormatException
This method sets the pre-exposure delay. The input string is parsed as an integer and specifies how many seconds to delay before starting an exposure.
Parameters:
delay_time - The pre-exposure delay time (as a String).

set_number_of_exposures

public void set_number_of_exposures(java.lang.String num_of_exp)
                             throws java.lang.NumberFormatException
This method sets the number of exposure to take. The input string is parsed as an integer.
Parameters:
num_of_exp - The number of exposures to take (as a String).

set_image_filename

public void set_image_filename(java.lang.String image_file)
                        throws java.lang.Exception
This method sets the image filename.
Parameters:
image_file - The image filename.

set_image_dimensions

public void set_image_dimensions(int row_num,
                                 int col_num)
This method sets the image dimensions.
Parameters:
row_num - The number of image rows.
col_num - The number of image columns.

set_image_resolution

public void set_image_resolution(int resolution)
This method sets the image resolution.
Parameters:
resolution - The image resolution.

construct

public java.lang.Object construct()
This method starts the SwingWorker thread.
Overrides:
construct in class SwingWorker
See Also:
SwingWorker

finished

public void finished()
This method closes the SwingWorker thread. This method overides the one in Swingworker.java.
Overrides:
finished in class SwingWorker
See Also:
SwingWorker

expose

public java.lang.Object expose()
This method performs the exposure sequence.

set_shutter_postion

protected int set_shutter_postion()
This method sets the current shutter position that is to used during the exposure. The command reads the current controller status from the timing board address X:0. If "open shutter", bit 11 of the status is set to a 1, otherwise, bit 11 is cleared (set to a 0). The entire status word is then written back to the timing board address X:0.
Returns:
Returns SUCCESS (0) if there are no problems. Otherwise, FAILURE (1) is sent back.

updateStatus

private void updateStatus(int i)

monitor_readout

private void monitor_readout()

components_enabled

protected void components_enabled(boolean mode)
This method enables/disables the components on the main window.
Parameters:
mode - True means enable the components. False means disable the components.