// 秒寻科技
// 选择定位坐标
// zt
// 2023-03-30

#ifndef __LCT_COORDSEL_H__
#define __LCT_COORDSEL_H__

#include "../../sysdefine/sysdef.h"

// 供外部使用接口
void lct_coordsel_init(LCT_COORDSEL_PARAM_T stInitParam);
void lct_coordsel_main(LCT_MINIMUM_VALUE_GROUP_T *pstMinimumValueGroup, uint8 byPredictionFlag, COORD_T stPredictionCoord, LCT_COORDSEL_OPTIMUM_COORD_T *pstOptimumCoord);

// 内部使用接口
void lct_coordsel_sel_optimum_coord_by_prediction_coord(LCT_MINIMUM_VALUE_GROUP_T *pstMinimumValueGroup, COORD_T stPredictionCoord, LCT_COORDSEL_OPTIMUM_COORD_T *pstOptimumCoord);
void lct_coordsel_select_final_coord_by_variance(LCT_COORDSEL_OPTIMUM_COORD_T *pstMinimumValueList, uint8 byMinimumValueListLen, COORD_T stPredictionCoord, LCT_COORDSEL_OPTIMUM_COORD_T *pstOptimumCoord, uint8 *pbyResult);

void lct_coordsel_sel_optimum_coord_by_minimum_value(LCT_MINIMUM_VALUE_GROUP_T *pstMinimumValueGroup, LCT_COORDSEL_OPTIMUM_COORD_T *pstOptimumCoord);
void lct_coordsel_select_final_coord_by_distance(LCT_COORDSEL_OPTIMUM_COORD_T *pstMinimumValueList, uint8 byMinimumValueListLen, LCT_COORDSEL_OPTIMUM_COORD_T *pstOptimumCoord, uint8 *pbyResult);

void lct_coordsel_organization_minimum_value_list(uint8 byLctType, LCT_MINIMUM_VALUE_GROUP_T *pstMinimumValueGroup, LCT_COORDSEL_OPTIMUM_COORD_T *pstMinimumValueList, uint8 *pbyMinimumValueListLen);
void lct_coordsel_filter_jump_coord(LCT_COORDSEL_OPTIMUM_COORD_T *pstMinimumValueList, uint8 *pbyMinimumValueListLen, uint8 byPredictionFlag);

void lct_coordsel_sel_optimum_coord(COORD_T stPredicCoord, LCT_COORDSEL_OPTIMUM_COORD_T *pstMinimumValueList, uint8 byMinimumValueListLen, LCT_COORDSEL_OPTIMUM_COORD_T *pstOptimumCoord);
void lct_coordsel_cal_p2p_distance(COORD_T stMainPoint, LCT_COORDSEL_OPTIMUM_COORD_T *pstMinimumValueList, uint8 byMinimumValueListLen);
void lct_coordsel_cal_p2p_distance_variance(COORD_T stMainPoint, LCT_COORDSEL_OPTIMUM_COORD_T *pstMinimumValueList, uint8 byMinimumValueListLen);

#endif