// 秒寻科技
// 计算定位坐标
// zt
// 2023-03-25

#ifndef __LCT_COORDCAL_H__
#define __LCT_COORDCAL_H__

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

// 供外部使用接口
void lct_coordcal_init(LCT_COORDCAL_PARAM_T stLctCoordcalParam);
void lct_coordcal_main(PUB_LCT_BTS_LIST_T *pstLctBtsList, PUB_LOCATION_DATA_T *pstLctDataList, LCT_FIRSTPATH_LIST_T *pstFirstPathList, uint8 *pbyPredictionFlag, COORD_T *pstPredictionCoord, LCT_MINIMUM_VALUE_GROUP_T *pstMinimumValueGroup, uint16 *pwMinmumValueNum);

// 内部使用接口
void lct_coordcal_select_valid_bts_by_fp_and_ampl(PUB_LOCATION_DATA_T *pstLctDataList, LCT_FIRSTPATH_T *pstFirstPathList, uint8 byFirstPathListLen, LCT_FIRSTPATH_T *pstValidCalBtsList, uint8 *pbyValidCalBtsListLen, LCT_FIRSTPATH_T *pstValidTrackBtsList, uint8 *pbyValidTrackBtsListLen, int32 *pdwBulidId, int32 *pdwLayerId);
void lct_coordcal_check_valid_bts_by_move_direction(uint8 byFirstPathType, LCT_FIRSTPATH_T *pstValidBtsList, uint8 byValidBtsListLen, PUB_LOCATION_DATA_T *pstLctDataList, COORD_T *pstAheadCoord, uint8 byChangeXY, int8 byDirectionX, int8 byDirectionY, uint8 *pbyValidBtsListLen);
void lct_coordcal_check_move_tendency(LCT_FIRSTPATH_T *pstFirstPathList, uint8 byFirstPathListLen, LCT_FIRSTPATH_PREDICTION_DIRECTION_DATA_T *pstPredictionDirectionDataList, COORD_T *pstPredictionCoord, COORD_T *pstAheadCoord);
void lct_coordcal_prediction_x_y_move_direction(LCT_FIRSTPATH_T *pstFirstPathList, uint8 byFirstPathListLen, LCT_FIRSTPATH_PREDICTION_DIRECTION_DATA_T *pstPredictionDirectionDataList, COORD_T *pstAheadCoord, uint8 byChangeXY, int8 *pbyDirectionX, int8 *pbyDirectionY);
void lct_coordcal_cal_bts_move_direction(uint8 byDirectionTendency, int32 dwBtsCoordX, int32 dwBtsCoordY, COORD_T *pstAheadCoord, int8 *pbyDirectionX, int8 *pbyDirectionY);
void lct_coordcal_prediction_coord(COORD_T *pstPredictionCoord, uint8 *pbyPredictionFlag, COORD_T *pstAheadPointCoord, int32 dwBulidId, int32 dwLayerId);
void lct_coordcal_check_prediction_coord_by_xy_move_tendency(COORD_T *pstPredictionCoord, COORD_T *pstAheadCoord, int8 byDirectionX, int8 byDirectionY, int32 dwSpeedX, int32 dwSpeedY);
void lct_coordcal_check_prediction_coord_by_bts_coord(COORD_T *pstPredicCoord, LCT_FIRSTPATH_T *pstCalBtsList, uint8 byCalBtsListLen, LCT_FIRSTPATH_T *pstTrackBtsList, uint8 byTrackBtsListLen);

// 二维定位
// void lct_coordcal_cal_rectangle_two_end_point_by_coord(COORD_T stPredictionCoord, COORD_T *pstLeftBottom, COORD_T *pstRightTop);
// void lct_coordcal_gen_location_ref_point(COORD_T stLeftBottom, COORD_T stRightTop, uint8 byTrackFlag, COORD_T *pstLocationRefPoint, uint16 *pwMatrixRow, uint16 *pwMatrixCol);
// void lct_coordcal_cal_coord_points(LCT_FIRSTPATH_T *pstFirstPathList, uint8 byFirstPathListLen, COORD_T *pstLocationRefPoint, uint16 wMatrixRow, uint16 wMatrixCol, uint8 byFirstPathFlag, LCT_MINIMUM_VALUE_GROUP_T *pstMinmumValueGroup);
// void lct_coordcal_cal_ref_point_delay(COORD_T *pstRefPointMatrix, uint16 wMatrixRow, uint16 wMatrixCol, LCT_FIRSTPATH_T *pstFirstPathList, uint8 byFirstPathListLen, uint8 byFirstPathFlag, flt32 *pfDelayDeviationMatrix);
// void lct_coordcal_cal_two_point_transmit_times_by_coord(COORD_T stFirstPoint, COORD_T stSecondPoint, flt32 *pfTimes);
// void lct_coordcal_cal_delay_by_first_path_index(uint32 dwMainBtsIndex, uint32 dwSlaveBtsIndex, flt32 *pfTwoBtsDelay);
// void lct_coordcal_sel_minimum_value(flt32 *pfDelayDeviationSumMatrix, uint16 wMatrixRow, uint16 wMatrixCol, COORD_T *pstRefPointMatrix, uint8 byFirstPathFlag, LCT_MINIMUM_VALUE_GROUP_T *pstMinimumValueList);
// void lct_coordcal_dbcheck_minimum_value(uint8 byFirstPathFlag, LCT_FIRSTPATH_T *pstFirstPathList, uint8 byFirstPathListLen, LCT_MINIMUM_VALUE_GROUP_T *pstMinimumValueList);
#endif