// 秒寻科技
// 计算定位坐标(1维和0维)
// zt
// 2023-03-25

#ifndef __LCT_COORDCAL_ONE_H__
#define __LCT_COORDCAL_ONE_H__

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

// 一维定位
void lct_coordcal_one_dimension_location(PUB_LOCATION_DATA_T *pstLctDataList, uint8 byPredictionFlag, COORD_T stPredictionCoord, LCT_FIRSTPATH_T *pstValidBtsList, uint8 byValidBtsListLen, uint8 byTrackCoordFlag, LCT_MINIMUM_VALUE_GROUP_T *pstMinmumValueList);
void lct_coordcal_organize_one_dimension_bts_duad(uint8 byFirstPathType, LCT_FIRSTPATH_T *pstValidBtsList, uint8 byValidBtsListLen, LCT_COORDCAL_ONE_DIMENSION_BTS_DUAD_LIST_T *pstBtsDuadList);
void lct_coordcal_check_one_dimension_bts_firstpath_valid(uint8 byPredictionFlag, COORD_T stPredictionCoord, PUB_LOCATION_DATA_T *pstLctDataList, uint8 byFirstpathFlag, LCT_FIRSTPATH_T *pstValidBtsList, uint8 *pbyValidBtsCounter);
uint8 lct_coordcal_check_one_dimension_inside(COORD_T stBts1Coord, COORD_T stBts2Coord, COORD_T stPredictionCoord);
void lct_coordcal_build_linear_func(COORD_T stBts1Coord, COORD_T stBts2Coord, LCT_COORDCAL_LINEAR_FUNC_T *pstLinearFunc);
void lct_coordcal_build_linear_ref_point(uint8 byPredictionFlag, COORD_T stPredictionCoord, COORD_T stFirstCoord, COORD_T stSecondCoord, LCT_COORDCAL_LINEAR_FUNC_T *pstLinearFunc, COORD_T *pstRefPoint, uint16 *pwMatrixRow, uint16 *pwMatrixCol);
void lct_coordcal_sel_linear_ref_point(COORD_T *pstRefPointMatrix, flt32 *pfDelayDeviationSumMatrix, uint16 wMatrixRow, uint16 wMatrixCol, LCT_COORDCAL_LINEAR_FUNC_T *pstLinearFunc, COORD_T *pstLctCoord, flt32 *pfDelayDeviation);
void lct_coordcal_check_linear_lct_coord_valid(uint8 byMinmumValueType, LCT_LINEAR_MINIMUM_LIST_T *pstLinearMinmumList);
void lct_coordcal_recal_linear_ref_point(LCT_COORDCAL_LINEAR_FUNC_T *pstLinearFunc, COORD_T *pstCoord);
uint8 lct_coordcal_zero_dimension_location(PUB_LOCATION_DATA_T *pstLctDataList, LCT_FIRSTPATH_T *pstValidBtsData, uint8 byFirstPathFlag, LCT_COORDCAL_LINEAR_FUNC_T *pstLinearFunc, COORD_T *pstRefPoint);
void lct_coordcal_adjust_first_path_index(PUB_LOCATION_DATA_T *pstLctDataList, uint8 byFirstPathFlag, COORD_T *pstLctCoord, LCT_FIRSTPATH_T *pstMainBtsFirstPath, LCT_FIRSTPATH_T *pstSlaveBtsFirstPath);
uint8 lct_coordcal_single_bts_location(PUB_LOCATION_DATA_T *pstLctDataList, LCT_FIRSTPATH_T *pstValidBtsData, uint8 byFirstPathFlag, COORD_T *pstRefPoint);

#endif