/*  @file pmFPAFlags.h
 *  @brief Functions for setting and checking the status flags within the FPA hierarchy
 * 
 *  @author George Gusciora, MHPCC
 *  @author Paul Price, IfA
 *  @author Eugene Magnier, IfA
 * 
 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
 *  @date $Date: 2007-01-24 02:54:14 $
 *  Copyright 2005-2006 Institute for Astronomy, University of Hawaii
 */

#ifndef PM_FPA_FLAGS_H
#define PM_FPA_FLAGS_H

/// @addtogroup Camera Camera Layout
/// @{

#include "pmFPA.h"


// Functions to turn on/off the file_exists flags

/// Set the file_exists flag for an FPA and components
bool pmFPASetFileStatus(pmFPA *fpa,     ///< FPA for which to set status
                        bool status     ///< Status to set
                       );

/// Set the file_exists flag for a chip and components
bool pmChipSetFileStatus(pmChip *chip,  ///< Chip for which to set status
                         bool status    ///< Status to set
                        );

/// Set the file_exists flag for a cell and components
bool pmCellSetFileStatus(pmCell *cell,  ///< Cell for which to set status
                         bool status    ///< Status to set
                        );

// Functions to check the file_exists flags

/// Return the file_exists status for an FPA and components
bool pmFPACheckFileStatus(const pmFPA *fpa ///< FPA for which to check status
                         );

/// Return the file_exists status for a chip and components
bool pmChipCheckFileStatus(const pmChip *chip ///< Chip for which to check status
                          );

/// Return the file_exists status for a chip and components
bool pmCellCheckFileStatus(const pmCell *cell ///< Cell for which to check status
                          );

// Functions to turn on/off the data_exists flags

/// Set the data_exists flag for an FPA and components
bool pmFPASetDataStatus(pmFPA *fpa,     ///< FPA for which to set status
                        bool status     ///< Status to set
                       );

/// Set the data_exists flag for a chip and components
bool pmChipSetDataStatus(pmChip *chip,  ///< Chip for which to set status
                         bool status    ///< Status to set
                        );

/// Set the data_exists flag for a cell and components
bool pmCellSetDataStatus(pmCell *cell,  ///< Cell for which to set status
                         bool status    ///< Status to set
                        );

// Functions to set the process flags

/// Select a chip within an FPA for processing
///
/// If exclusive is true, the specified chip is the only chip to be processed.  A negative value for chipNum
/// is valid and, in combinations with exclusive, de-selects all chips.
bool pmFPASelectChip(pmFPA *fpa,        ///< FPA containing the chip of interest
                     int chipNum,       ///< Chip number to select
                     bool exclusive     ///< Process this chip exclusive of the others?
                    );

/// Select a chip within a chip for processing
///
/// If exclusive is true, the specified cell is the only chip to be processed.  A negative value for cellNum
/// is valid and, in combinations with exclusive, de-selects all chips.
bool pmChipSelectCell(pmChip *chip,     ///< Chip containing the cell of interest
                      int cellNum,      ///< Cell number to select
                      bool exclusive    ///< Process this cell exclusive of the others?
                     );

/// Exclude a chip within an FPA from processing
int pmFPAExcludeChip(pmFPA *fpa,        ///< FPA containing the chip of interest
                     int chipNum        ///< Chip number to exclude
                    );

/// Exclude a cell within a chip from processing
int pmChipExcludeCell(pmChip *chip,     ///< Chip containing the chip of interest
                      int cellNum       ///< Cell number to exclude
                     );
/// @}
#endif
