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

#ifndef __LCT_COORDCAL_TWO_H__
#define __LCT_COORDCAL_TWO_H__

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

// 二维定位
void lct_coordcal_two_dimension_location(PUB_LCT_BTS_LIST_T *pstLctBtsList, LCT_FIRSTPATH_T *pstFirstPathList, uint8 byFirstPathListLen, uint8 byPredictionFlag, COORD_T stPredictionCoord, uint8 byFirstPathFlag, LCT_MINIMUM_VALUE_GROUP_T *pstMinmumValueList);
void lct_coordcal_cal_rectangle_end_point_by_bts_coord(PUB_LCT_BTS_LIST_T *pstLctBtsList, COORD_T *pstLeftBottom, COORD_T *pstRightTop);
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, PUB_LCT_BTS_LIST_T *pstLctBtsList, LCT_MINIMUM_VALUE_GROUP_T *pstMinimumValueList);
void lct_coordcal_two_dimension_check(LCT_MINIMUM_VALUE_GROUP_T *pstMinmumValueGroup, COORD_T *pstPredictionCoord, COORD_T *pstAheadCoord, uint8 byChangeXY, int8 byDirectionX, int8 byDirectionY);
#endif