Class ControllerConfigCommand

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

public class ControllerConfigCommand
extends SwingWorker


Field Summary
private  int amp
           
private  int binning_parameters_bx
           
private  int binning_parameters_by
           
private  boolean binning_selected
           
private  boolean coadder_selected
           
private  boolean do_all
           
private  boolean do_binning
           
private  boolean do_both_readouts
           
private  boolean do_coadd_download
           
private  boolean do_coadder
           
private  boolean do_gain
           
private  boolean do_mpp
           
private  boolean do_number_of_coadds
           
private  boolean do_readout
           
private  boolean do_serial_readout
           
private  boolean do_temperature
           
private  boolean do_video_offsets
           
private  DspCommand2 dsp_cmd
           
private  boolean gain_selected
           
private  ManualCommand manual_cmd
           
private  boolean mpp_selected
           
private  int mpp_value
           
private  int number_of_coadds
           
protected  ControllerConfigDialog parent
           
private  boolean readout_selected
           
private  double temperature
           
private  boolean temperature_selected
           
private  int[] user_input
           
private  int value_of_gain
           
private  int value_of_speed
           
private  boolean video_offsets_selected
           
 
Fields inherited from class SwingWorker
abort, thread, value
 
Constructor Summary
ControllerConfigCommand(ControllerConfigDialog parent)
          Class constructor.
 
Method Summary
 java.lang.Object apply()
          This method sends all the ControllerConfig information to the PCI interface board.
 java.lang.Object construct()
          This method initiates the download.
 void finished()
          This method sets the "Apply" button back to "Apply".
 void select_binning(boolean binning)
          This method selects binning for current command issue.
 void select_coadder(boolean coadd)
          This method selects coadder for current command issue.
 void select_gain(boolean gain)
          This method selects gain for current command issue.
 void select_mpp(boolean mpp)
          This method selects MPP for current command issue.
 void select_readout(boolean readout)
          This method selects readout for current command issue.
 void select_temperature(boolean temperature)
          This method selects temperature for current command issue.
 void select_video_offsets(boolean video_offsets)
          This method selects video offsets for current command issue.
 void set_all(boolean all_on)
          This method sets the apply() method to apply all configurations.
 void set_amplifier(int amp)
          This method sets the amplifier(s) to use for readout.
 void set_binning_cols(int bx)
          This method sets the value for binning_cols according to what the user chooses.
 void set_binning_rows(int by)
          This method sets the value for binning_rows according to what the user chooses.
 void set_binning(boolean binning_on)
          This method sets the binning to on/off.
 void set_both_readouts(boolean both_readouts)
          This method sets the split_parallel commmand to on/off.
 void set_coadd_download(boolean coadd_download)
          This method sets the coadder download to on/off.
 void set_coadder(boolean coadd)
          This method sets the coadder to on/off.
 void set_gain(boolean gain_on)
          This method sets the gain to on/off.
 void set_gain(int gain)
          This method sets the video gain.
 void set_mpp_value(int mpp_value)
          This method sets the MPP value.
 void set_mpp(boolean mpp_on)
          This method sets the MPP to on/off.
 void set_number_of_coadds(boolean do_number_of_coadds)
          This method sets the number of coadds to perform.
 void set_number_of_coadds(java.lang.String coadds_num)
          This method parses and sets the number of coadds to perform.
 void set_readout(boolean readout)
          This method specifies whether or not any readout commands are implemented.
 void set_serial_readout(boolean serial_readout)
          This method sets the split_serial commmand to on/off.
 void set_speed(int speed)
          This method sets the integrator speed.
 void set_temperature(boolean temperature_on)
          This method sets the temperature to on/off.
 void set_temperature(java.lang.String desired_temperature)
          This method parses and sets the array temperature.
 void set_video_offsets(boolean video_offsets_on)
          This method sets the video offsets to on/off.
 void set_video_offsets(int index, java.lang.String video_offset)
          This method parses and sets the video offsets.
 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 ControllerConfigDialog parent

dsp_cmd

private DspCommand2 dsp_cmd

manual_cmd

private ManualCommand manual_cmd

do_binning

private boolean do_binning

do_readout

private boolean do_readout

do_serial_readout

private boolean do_serial_readout

do_both_readouts

private boolean do_both_readouts

do_mpp

private boolean do_mpp

do_coadder

private boolean do_coadder

do_coadd_download

private boolean do_coadd_download

do_number_of_coadds

private boolean do_number_of_coadds

do_gain

private boolean do_gain

do_video_offsets

private boolean do_video_offsets

do_temperature

private boolean do_temperature

do_all

private boolean do_all

binning_selected

private boolean binning_selected

readout_selected

private boolean readout_selected

mpp_selected

private boolean mpp_selected

coadder_selected

private boolean coadder_selected

gain_selected

private boolean gain_selected

video_offsets_selected

private boolean video_offsets_selected

temperature_selected

private boolean temperature_selected

temperature

private double temperature

mpp_value

private int mpp_value

amp

private int amp

value_of_gain

private int value_of_gain

value_of_speed

private int value_of_speed

number_of_coadds

private int number_of_coadds

binning_parameters_bx

private int binning_parameters_bx

binning_parameters_by

private int binning_parameters_by

user_input

private int[] user_input
Constructor Detail

ControllerConfigCommand

public ControllerConfigCommand(ControllerConfigDialog parent)
Class constructor. No object is instantiated.
Method Detail

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, DspCommand2

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_binning

public void set_binning(boolean binning_on)
This method sets the binning to on/off.
Parameters:
binning_on - True to perform the binning on the controller, false to not perform the binning on the controller.

set_coadder

public void set_coadder(boolean coadd)
This method sets the coadder to on/off.
Parameters:
coadder_on - True to perform the coadder on the controller, false to not perform the coadder on the controller.

set_coadd_download

public void set_coadd_download(boolean coadd_download)
This method sets the coadder download to on/off.
Parameters:
coadder_on - True to download the coadder DSP code to the controller, false to not download the code.

set_number_of_coadds

public void set_number_of_coadds(boolean do_number_of_coadds)
This method sets the number of coadds to perform.

set_gain

public void set_gain(boolean gain_on)
This method sets the gain to on/off.
Parameters:
gain_on - True to perform the gain on the controller, false to not perform the gain on the controller.

set_video_offsets

public void set_video_offsets(boolean video_offsets_on)
This method sets the video offsets to on/off.
Parameters:
video_offsets_on - True to perform the video offsets on the controller, false to not perform the video offsets on the controller.

set_readout

public void set_readout(boolean readout)
This method specifies whether or not any readout commands are implemented.
Parameters:
readout - True if set readout mode is implemented, false if it is not.

set_serial_readout

public void set_serial_readout(boolean serial_readout)
This method sets the split_serial commmand to on/off.
Parameters:
split_serial_on - True to perform the split_serial on the controller, false to not perform the split_serial on the controller.

set_both_readouts

public void set_both_readouts(boolean both_readouts)
This method sets the split_parallel commmand to on/off.
Parameters:
split_parellel_on - True to perform the split_parallel on the controller, false to not perform the split_parallel on the controller.

set_mpp

public void set_mpp(boolean mpp_on)
This method sets the MPP to on/off.
Parameters:
mpp_on - True to use MPP, False to not use MPP.

set_temperature

public void set_temperature(boolean temperature_on)
This method sets the temperature to on/off.
Parameters:
temperature_on - True to perform the temperature on the controller, false to not perform the temperature on the controller.

select_binning

public void select_binning(boolean binning)
This method selects binning for current command issue.
Parameters:
binning - True to send the binning to the controller, false to not send the binning to the controller.

select_coadder

public void select_coadder(boolean coadd)
This method selects coadder for current command issue.
Parameters:
coadder - True to send the coadder to the controller, false to not send the coadder to the controller.

select_gain

public void select_gain(boolean gain)
This method selects gain for current command issue.
Parameters:
gain - True to send the gain to the controller, false to not send the gain to the controller.

select_video_offsets

public void select_video_offsets(boolean video_offsets)
This method selects video offsets for current command issue.
Parameters:
video_offsets - True to send the video offsets to the controller, false to not send the video offsets to the controller.

select_readout

public void select_readout(boolean readout)
This method selects readout for current command issue.
Parameters:
readout - True to send readout info to the controller, false to not send any readout info the controller.

select_mpp

public void select_mpp(boolean mpp)
This method selects MPP for current command issue.
Parameters:
temperature - True to send the MPP to the controller, false to not send the MPP to the controller.

select_temperature

public void select_temperature(boolean temperature)
This method selects temperature for current command issue.
Parameters:
temperature - True to send the temperature to the controller, false to not send the temperature to the controller.

set_all

public void set_all(boolean all_on)
This method sets the apply() method to apply all configurations.
Parameters:
all_on - True to apply all configurations, False to apply only a specific one.

set_amplifier

public void set_amplifier(int amp)
This method sets the amplifier(s) to use for readout.
Parameters:
amp - The amplifier to use. Depending on the mode, may be one of the following ascii strings: "__A", "__B", "__C", "__D", "_AB", "_CD", "__L", "__R", "_LR", or "ALL".

set_mpp_value

public void set_mpp_value(int mpp_value)
This method sets the MPP value.
Parameters:
mpp_value - The MPP value. May be 0 for no MPP mode or 1 for MPP.

set_binning_cols

public void set_binning_cols(int bx)
This method sets the value for binning_cols according to what the user chooses.
Parameters:
bx - binning parameters columns.

set_binning_rows

public void set_binning_rows(int by)
This method sets the value for binning_rows according to what the user chooses.
Parameters:
by - binning paremeters rows.

set_gain

public void set_gain(int gain)
This method sets the video gain.
Parameters:
gain - The gain value.

set_speed

public void set_speed(int speed)
This method sets the integrator speed.
Parameters:
speed - The integrator speed.

set_video_offsets

public void set_video_offsets(int index,
                              java.lang.String video_offset)
                       throws java.lang.NumberFormatException
This method parses and sets the video offsets. The input strings are converted to integers.
Parameters:
video_offset - The video offset value.
index - The video offset number.
Throws:
java.lang.NumberFormatException - If the video offset value is out of range or could not be parsed.

set_number_of_coadds

public void set_number_of_coadds(java.lang.String coadds_num)
                          throws java.lang.NumberFormatException
This method parses and sets the number of coadds to perform. The input string is converted to an integer.
Parameters:
coadds_num - The number of coadds to perform.
Throws:
java.lang.NumberFormatException - If the number of coadds is out of range or could not be parsed.

set_temperature

public void set_temperature(java.lang.String desired_temperature)
                     throws java.lang.NumberFormatException
This method parses and sets the array temperature. The input string is converted to an double precision value.
Parameters:
desired_temperature - The lower limit of the array temperature.
Throws:
java.lang.NumberFormatException - If the temperature could not be parsed.

apply

public java.lang.Object apply()
This method sends all the ControllerConfig information to the PCI interface board. IMPORTANT NOTE: The ManualCommand Class is NOT called through the thread_it() method on purpose. It is less time costly and more code compact to NOT instantiate a new thread for every configuration. Instead the ManualCommand apply() method is called directly. Also, this command class is already in a thread. If, however, one should decide differently later, here is a useful wait method: private void thread_wait() { while(manual_cmd.alive()) { try Thread.sleep(5); catch (InterruptedException ie) {} } }
See Also:
SwingWorker, DspCommand2