/* @file  pmConceptsWrite.h
 * @brief Writing concepts to a variety of sources.
 *
 * @author Paul Price, IfA
 *
 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
 * @date $Date: 2008-06-17 22:16:38 $
 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii
 */

#ifndef PM_CONCEPTS_WRITE_H
#define PM_CONCEPTS_WRITE_H

/// @addtogroup Concepts Data Abstraction Concepts
/// @{

/// "Write" concepts to (actually, check against) the camera format file's CELLS.
///
/// Examines the CELLS metadata in the camera format file for the current type of cell, and checks that the
/// concepts as defined there match the ones defined in the cell.  A warning is produced if the concepts do
/// not match.
bool p_pmConceptsWriteToCells(const psMetadata *specs, ///< The concept specifications
                              const pmCell *cell, ///< The cell
                              const psMetadata *concepts ///< The concepts
                             );

/// "Write" concepts to (actually, check against) the camera format file's DEFAULTS.
///
/// Examines the DEFAULTS metadata in the camera format file, and checks that the concepts as defined there
/// match the ones defined in the cell.  A warning is produced if the concepts do not match.
bool p_pmConceptsWriteToDefaults(const psMetadata *specs, ///< The concept specifications
                                 const pmFPA *fpa, ///< The FPA
                                 const pmChip *chip, ///< The chip
                                 const pmCell *cell, ///< The cell
                                 const psMetadata *concepts ///< The concepts
                                );

/// "Write" concepts to (actually, add to, pending a later write) the FITS header.
///
/// Examines the FITS header TRANSLATION metadata in the camera format file, and writes concepts to the
/// appropriate FITS headers in the HDU, in preparation for a future write of the HDU.
bool p_pmConceptsWriteToHeader(const psMetadata *specs, ///< The concept specifications
                               const pmFPA *fpa, ///< The FPA
                               const pmChip *chip, ///< The chip
                               const pmCell *cell, ///< The cell
                               const psMetadata *concepts ///< The concepts
                              );

/// Write concepts to the database.
///
/// Examines the DATABASE metadata in the camera format file, and writes concepts to the database.
/// Warning: This function has not been tested; use at your own risk.
bool p_pmConceptsWriteToDatabase(const psMetadata *specs, ///< The concept specifications
                                 const pmFPA *fpa, ///< The FPA
                                 const pmChip *chip, ///< The chip
                                 const pmCell *cell, ///< The cell
                                 pmConfig *config,///< Configuration
                                 const psMetadata *concepts ///< The concepts
                                );
/// @}
#endif
