/* VectorNav HSI Calibration Library v1.0.0.2
 *
 * Copyright (c) 2018 VectorNav Technologies, LLC
 *
 * This source code is proprietary to and copyrighted by VectorNav Technologies, LLC and is
 * available solely under license from VectorNav. All rights reserved. If you do not have a
 * license to use this source code from VectorNav, any use hereof is strictly prohibited by
 * U.S. law and other applicable law. This source code is restricted for use solely with the
 * products of VectorNav and as otherwise set forth in any agreement with VectorNav. Any
 * disclosure of this source code to the public or to any third party is also prohibited.
 */
/** \file
*
* \section Description
* This header file contains declarations for using VectorNav HSI 3D Patch functions.
*/
#ifndef VNHSIPATCHES_H_INCLUDED
#define VNHSIPATCHES_H_INCLUDED

#include "vnhsi.h"
#include "vnhsimath.h"
 
#ifdef MAXPATCHES
 
#ifdef __cplusplus
extern "C" {
#endif

/** \brief Initialize the 3D HSI patches.
*
* \param[in] c  The configuration structure.
* \return None. */
void vnhsi_patches_init(VnHsiConfig* c);

/** \brief Determine if the current patch should be added.
*
* \param[in] c  The HSI configuration.
* \param[in] ypr The current YPR measurement vector (in degrees).
* \param[in] patchtype The patch type (East or North).
* \return VnHsiPatch Patch index and the number of data points per patch. */
VnHsiPatch vnhsi_patches_adddata(VnHsiDipole dipole, VnHsiConfig* c, union vn_vec3f ypr, int patchtype);

/** \brief Determine the filled (selected) patches.
*
* \param[in] patchtype The patch type structure.
* \return VnHsiPatchFill The selected (kept) data point per each patch. */
VnHsiPatchFill vnhsi_patches_fill(VnHsiPatchType patchType);

/** \brief Return the patch definition.
*
* \param[in] None.
* \return VnHsiPatchDef The patch vectors and cosine error angle. */
VnHsiPatchDef vnhsi_patches_def();

/** \brief Set the reference YPR vector.
*
* \param[in] ypr The reference YPR vector (in degrees).
* \return None. */
void vnhsi_patches_set_refYPR(union vn_vec3f ypr);

/** \brief Return last selected patch index.
  *
  * \param[in] None.
  * \return Last selected index. */
int vnhsi_patches_last_patch();

#ifdef __cplusplus
}
#endif 

#endif /* MAXPATCHES */

#endif /*VNHSIPATCHES_H_INCLUDED*/
