/* @file  pmFPAview.h
 * @brief Tools to manipulate the FPA structure elements.
 *
 * @author EAM, IfA
 *
 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
 * @date $Date: 2007-04-14 03:22:47 $
 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii
 */

#ifndef PM_FPA_FILE_IO_H
#define PM_FPA_FILE_IO_H

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

// open the real file corresponding to the given pmFPAfile appropriate to the current view
bool pmFPAfileOpen (pmFPAfile *file, const pmFPAview *view, pmConfig *config);

// read from the real file corresponding to the given pmFPAfile for the current view
bool pmFPAfileRead (pmFPAfile *file, const pmFPAview *view, pmConfig *config);

bool pmFPAfileCreate (pmFPAfile *file, const pmFPAview *view, const pmConfig *config);

// write to the real file corresponding to the given pmFPAfile for the current view
bool pmFPAfileWrite (pmFPAfile *file, const pmFPAview *view, pmConfig *config);

// close the real file corresponding to the given pmFPAfile appropriate to the current view
bool pmFPAfileClose (pmFPAfile *file, const pmFPAview *view);

// free the data at this level
bool pmFPAfileFreeData(pmFPAfile *file, const pmFPAview *view);

// set the state of the specified pmFPAfile to active (state == true) or inactive
// if name is NULL, set the state for all pmFPAfiles
bool pmFPAfileActivate (psMetadata *files, bool state, char *name);

// examine all pmFPAfiles listed in the files and perform the needed I/O operations (open,read,write,close)
bool pmFPAfileIOChecks (pmConfig *config, const pmFPAview *view, pmFPAfilePlace place);

bool pmFPAfileWritePHU(pmFPAfile *file, const pmFPAview *view, const pmConfig *config);
bool pmFPAfileReadPHU (pmFPAfile *file, const pmFPAview *view, pmConfig *config);

/// @}
# endif
