Class SetupCommand

java.lang.Object
  |
  +--SwingWorker
        |
        +--SetupCommand

public class SetupCommand
extends SwingWorker


Field Summary
private  int array_columns
           
private  int array_rows
           
private  int bits_per_pixel
           
protected  int config_word
           
private  boolean did_timing
           
private  boolean do_dimensions
           
private  boolean do_hardware_test
           
private  boolean do_pci
           
private  boolean do_pci_hardware_test
           
private  boolean do_power_on
           
private  boolean do_reset_controller
           
private  boolean do_timing
           
private  boolean do_timing_app
           
private  boolean do_timing_file
           
private  boolean do_timing_hardware_test
           
private  boolean do_utility
           
private  boolean do_utility_app
           
private  boolean do_utility_file
           
private  boolean do_utility_hardware_test
           
private  DspCommand2 dsp_cmd
           
private  LoadDspFile dsp_file
           
private  int image_bytes
           
private  int number_of_pci_tests
           
private  int number_of_timing_tests
           
private  int number_of_utility_tests
           
protected  SetupDialog parent
           
private  PCIBoot pci_boot
           
private  java.lang.String pci_filename
           
private  boolean setup_applied
           
private  int tim_app_number
           
private  int tim_done
           
private  java.lang.String timing_filename
           
private  int util_app_number
           
private  int util_done
           
private  java.lang.String utility_filename
           
 
Fields inherited from class SwingWorker
abort, thread, value
 
Constructor Summary
SetupCommand(SetupDialog parent)
          Class constructor.
 
Method Summary
(package private) static void ()
           
private  java.lang.Object apply()
          This method sends all the setup information to the PCI interface board.
static int Cdeinterlace(int rows, int cols, int image_fd, int algorithm)
           
 void clear()
          This method sets all the SetupDialog class user input components to their default values and clears all textfields.
 java.lang.Object construct()
          This method initiates the download.
 void finished()
          This method sets the "Apply" button back to "Apply".
 int get_ccd_cols()
          This method gets the number of array columns (in pixels).
 int get_ccd_rows()
          This method gets the number of array rows (in pixels).
 int get_image_bytes()
          This method gets the number of bytes in the image.
 int get_image_resolution()
          This method gets the image resolution in bits/pixel.
private  void read_controller_config()
          This method reads and sets the controller configuration.
 void set_array_cols(java.lang.String columns)
          This method sets the number of array columns (in pixels).
 void set_array_rows(java.lang.String rows)
          This method sets the number of array rows (in pixels).
 void set_dimensions(boolean dimensions)
          This method sets the array dimensions control to on/off.
 void set_hardware_test(boolean hardware_test)
          This method sets the hardware tests to on/off.
 void set_hardware_test(int board, java.lang.String number_of_tests)
          This method sets the number of hardware tests to perform.
 void set_image_bytes(int columns, int rows)
          This method sets the number of bytes in the image.
 void set_image_resolution(int bpp)
          This method sets the image resolution in bits/pixel.
 void set_pci_filename(java.lang.String pci_file)
          This method sets the PCI file to download.
 void set_pci_test(boolean do_pci_test)
          This method sets the PCI hardware tests to on/off.
 void set_pci(boolean pci)
          This method sets the PCI download to on/off.
 void set_power_on(boolean power_on)
          This method sets the power on to on/off.
 void set_reset_controller(boolean reset_controller)
          This method sets the controller reset to on/off.
 void set_timing_app(boolean timing_app)
          This method sets the Timing application download to on/off.
 void set_timing_application(java.lang.String timing_app)
          This method sets the Timing application to download.
 void set_timing_file(boolean timing_file)
          This method sets the Timing file download to on/off.
 void set_timing_filename(java.lang.String timing_file)
          This method sets the Timing file to download.
 void set_timing_test(boolean do_timing_test)
          This method sets the Timing hardware tests to on/off.
 void set_timing(boolean timing)
          This method sets the Timing download to on/off.
 void set_utility_app(boolean utility_app)
          This method sets the Utility application download to on/off.
 void set_utility_application(java.lang.String utility_app)
          This method sets the Utility application to download.
 void set_utility_file(boolean utility_file)
          This method sets the Utility file download to on/off.
 void set_utility_filename(java.lang.String utility_file)
          This method sets the Utility file to download.
 void set_utility_test(boolean do_utility_test)
          This method sets the Utility hardware tests to on/off.
 void set_utility(boolean utility)
          This method sets the Utility download to on/off.
 boolean setup_applied()
          This method checks that the apply button has been pushed and that the dimensions have been set (actually that they have been attempted to be set.
 void stop()
          This method aborts the current thread.
 
Methods inherited from class SwingWorker
alive, get, interrupt, 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 SetupDialog parent

do_reset_controller

private boolean do_reset_controller

do_power_on

private boolean do_power_on

do_hardware_test

private boolean do_hardware_test

do_pci_hardware_test

private boolean do_pci_hardware_test

do_timing_hardware_test

private boolean do_timing_hardware_test

do_utility_hardware_test

private boolean do_utility_hardware_test

do_pci

private boolean do_pci

do_timing

private boolean do_timing

do_timing_file

private boolean do_timing_file

do_timing_app

private boolean do_timing_app

do_utility

private boolean do_utility

do_utility_file

private boolean do_utility_file

do_utility_app

private boolean do_utility_app

do_dimensions

private boolean do_dimensions

did_timing

private boolean did_timing

setup_applied

private boolean setup_applied

image_bytes

private int image_bytes

pci_filename

private java.lang.String pci_filename

timing_filename

private java.lang.String timing_filename

utility_filename

private java.lang.String utility_filename

tim_app_number

private int tim_app_number

util_app_number

private int util_app_number

number_of_pci_tests

private int number_of_pci_tests

number_of_timing_tests

private int number_of_timing_tests

number_of_utility_tests

private int number_of_utility_tests

pci_boot

private PCIBoot pci_boot

dsp_file

private LoadDspFile dsp_file

dsp_cmd

private DspCommand2 dsp_cmd

tim_done

private int tim_done

util_done

private int util_done

bits_per_pixel

private int bits_per_pixel

array_columns

private int array_columns

array_rows

private int array_rows

config_word

protected int config_word
Constructor Detail

SetupCommand

public SetupCommand(SetupDialog parent)
Class constructor. The default configuration word contains: shutter.
Method Detail

Cdeinterlace

public static int Cdeinterlace(int rows,
                               int cols,
                               int image_fd,
                               int algorithm)

static void ()

construct

public java.lang.Object construct()
This method initiates the download. It is automatically called by the SwingWorker class constructor.
Overrides:
construct in class SwingWorker
See Also:
SwingWorker

finished

public void finished()
This method sets the "Apply" button back to "Apply". This method is automatically called by the SwingWorker class.
Overrides:
finished in class SwingWorker
See Also:
SwingWorker

stop

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

set_reset_controller

public void set_reset_controller(boolean reset_controller)
This method sets the controller reset to on/off.
Parameters:
reset_controller - True to reset controller, false to not reset the controller.

set_power_on

public void set_power_on(boolean power_on)
This method sets the power on to on/off.
Parameters:
power_on - True to power on the controller, false to not power on the controller.

set_hardware_test

public void set_hardware_test(boolean hardware_test)
This method sets the hardware tests to on/off. The tests consist of a series of Test Data Link commands.
Parameters:
hardware_test - True to perform the controller hardware tests, false to not perform the tests.

set_pci_test

public void set_pci_test(boolean do_pci_test)
This method sets the PCI hardware tests to on/off. The tests consist of a series of Test Data Link commands.
Parameters:
do_pci_test - True to perform the PCI hardware tests, false to not perform the tests.

set_timing_test

public void set_timing_test(boolean do_timing_test)
This method sets the Timing hardware tests to on/off. The tests consist of a series of Test Data Link commands.
Parameters:
do_timing_test - True to perform the Timing hardware tests, false to not perform the tests.

set_utility_test

public void set_utility_test(boolean do_utility_test)
This method sets the Utility hardware tests to on/off. The tests consist of a series of Test Data Link commands.
Parameters:
do_utility_test - True to perform the Utility hardware tests, false to not perform the tests.

set_pci

public void set_pci(boolean pci)
This method sets the PCI download to on/off.
Parameters:
pci - True to perform the PCI download, false to not perform the download.

set_timing

public void set_timing(boolean timing)
This method sets the Timing download to on/off.
Parameters:
timing - True to perform the Timing download, false to not perform the download.

set_timing_file

public void set_timing_file(boolean timing_file)
This method sets the Timing file download to on/off.
Parameters:
timing_file - True to perform the Timing file download, false to not perform the file download.

set_timing_app

public void set_timing_app(boolean timing_app)
This method sets the Timing application download to on/off.
Parameters:
timing_app - True to perform the Timing application download, false to not perform the application download.

set_utility

public void set_utility(boolean utility)
This method sets the Utility download to on/off.
Parameters:
utility - True to perform the Utility download, false to not perform the download.

set_utility_file

public void set_utility_file(boolean utility_file)
This method sets the Utility file download to on/off.
Parameters:
utility_file - True to perform the Utility file download, false to not perform the file download.

set_utility_app

public void set_utility_app(boolean utility_app)
This method sets the Utility application download to on/off.
Parameters:
utility_app - True to perform the Utility application download, false to not perform the application download.

set_dimensions

public void set_dimensions(boolean dimensions)
This method sets the array dimensions control to on/off.
Parameters:
dimensions - True to set the array dimensions, false to not set the array dimensions.

set_pci_filename

public void set_pci_filename(java.lang.String pci_file)
                      throws java.lang.Exception
This method sets the PCI file to download.
Parameters:
pci_file - The PCI file to download.
Throws:
java.lang.Exception - If no file is specified.

set_timing_filename

public void set_timing_filename(java.lang.String timing_file)
                         throws java.lang.Exception
This method sets the Timing file to download.
Parameters:
timing_file - The Timing file to download.
Throws:
java.lang.Exception - If no file is specified.

set_utility_filename

public void set_utility_filename(java.lang.String utility_file)
                          throws java.lang.Exception
This method sets the Utility file to download.
Parameters:
utility_file - The Utility file to download.
Throws:
java.lang.Exception - If no file is specified.

set_timing_application

public void set_timing_application(java.lang.String timing_app)
                            throws java.lang.NumberFormatException
This method sets the Timing application to download. The application number is parsed from a String to an int.
Parameters:
timing_app - The Timing application to download.
Throws:
java.lang.NumberFormatException - If textfield could not be parsed, if parsed value is out of range, or if no application was specified.

set_utility_application

public void set_utility_application(java.lang.String utility_app)
                             throws java.lang.NumberFormatException
This method sets the Utility application to download. The application number is parsed from a String to an int.
Parameters:
utility_app - The Utility application to download.
Throws:
java.lang.NumberFormatException - If textfield could not be parsed, if parsed value is out of range, or if no application was specified.

set_hardware_test

public void set_hardware_test(int board,
                              java.lang.String number_of_tests)
                       throws java.lang.NumberFormatException
This method sets the number of hardware tests to perform. The tests consist of the specified number of Test Data Link commands.
Parameters:
board - A int specifying the board to set the number of tests for. Can be 0 (VoodooConstants.PCI_ID), 1 (VoodooConstants.TIM_ID), or 2 (VoodooConstants.UTIL_ID).
number_of_tests - The number of tests to perform for the specified board.
Throws:
java.lang.NumberFormatException - If textfield could not be parsed or if the board id is invalid. Valid board id's are VoodooConstants.PCI_ID, VoodooConstants.TIM_ID, or VoodooConstants.UTIL_ID.

get_ccd_rows

public int get_ccd_rows()
This method gets the number of array rows (in pixels).
Returns:
Returns the number of array rows (in pixels).

get_ccd_cols

public int get_ccd_cols()
This method gets the number of array columns (in pixels).
Returns:
Returns the number of array columns (in pixels).

set_image_resolution

public void set_image_resolution(int bpp)
This method sets the image resolution in bits/pixel.
Parameters:
bpp - The image resolution in bits/pixel.

get_image_resolution

public int get_image_resolution()
This method gets the image resolution in bits/pixel.
Returns:
Returns the image resolution in bits/pixel.

set_image_bytes

public void set_image_bytes(int columns,
                            int rows)
This method sets the number of bytes in the image.
Parameters:
columns - The number of columns in the image (in pixels).
rows - The number of rows in the image (in pixels).

set_array_rows

public void set_array_rows(java.lang.String rows)
                    throws java.lang.NumberFormatException
This method sets the number of array rows (in pixels).
Parameters:
rows - The number of array rows (in pixels).
Throws:
java.lang.NumberFormatException - If the textfield could not be parsed.

set_array_cols

public void set_array_cols(java.lang.String columns)
                    throws java.lang.NumberFormatException
This method sets the number of array columns (in pixels).
Parameters:
columns - The number of array columns (in pixels).
Throws:
java.lang.NumberFormatException - If the textfield could not be parsed.

get_image_bytes

public int get_image_bytes()
This method gets the number of bytes in the image.
Returns:
Returns the number of bytes in the image.

setup_applied

public boolean setup_applied()
This method checks that the apply button has been pushed and that the dimensions have been set (actually that they have been attempted to be set.
Returns:
Returns true if the dimensions have been set and the apply button has been pushed. Else, returns false.

clear

public void clear()
This method sets all the SetupDialog class user input components to their default values and clears all textfields.
See Also:
SetupDialog

apply

private java.lang.Object apply()
This method sends all the setup information to the PCI interface board.

read_controller_config

private void read_controller_config()
This method reads and sets the controller configuration. The camera type (IR or CCD) is determined here along with controller settings, such as binning, subimage readout, shutter exists, etc.