// 秒寻科技
// 定位主控模块
// zt
// 2023-03-25

#ifndef __LCT_MAIN_H__
#define __LCT_MAIN_H__

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

// 供外部使用接口
void lct_main_init(LCT_FIRSTPATH_PARAM_T stFirstPathParam, LCT_COORDCAL_PARAM_T stLctCoordcalParam, LCT_COORDSEL_PARAM_T stLctCoordselParam);
void lct_main_reset();
void lct_main(PUB_LCT_BTS_LIST_T *pstLctBtsList, PUB_LOCATION_DATA_T *pstLctDataList, PUB_CURRENT_LCT_RESULT_T *pstCurrentLctResult);

// 内部接口
int32 lct_main_gen_rand_num(int32 dwBaseData, uint16 wOffset);
void lct_main_update_bts_firstpath_trace_index(uint8 byLctSourceFlag, LCT_FIRSTPATH_LIST_T *pstBtsFirstPathList, PUB_LOCATION_DATA_T *pstLctDataList);
void lct_main_find_main_bts(LCT_FIRSTPATH_LIST_T *pstFirstPathList, uint32 *pdwBtsId, int32 *pwBuildId, int32 *pdwLayerId);
void lct_main_save_original_coord(int32 dwBuildId, int32 dwLayerId, COORD_T stCoord, LCT_COORDSEL_ORIGINAL_COORD_T *pstOriginalLctCoordList);
void lct_main_mean_original_coord(LCT_COORDSEL_ORIGINAL_COORD_T *pstOriginalLctCoordList, flt32 *pfMeanWeightList, LCT_COORDSEL_MEAN_COORD_T *pstMeanCoordList, COORD_T *pstMeanCoord);
void lct_main_update_phone_tendency(LCT_COORDSEL_MEAN_COORD_T *pstMeanLctCoordList, LCT_FIRSTPATH_PREDICTION_DIRECTION_DATA_T *pstPredictionDirectionDataList);
void lct_main_organize_lct_result(int32 dwBuildId, int32 dwLayerId, LCT_FIRSTPATH_LIST_T *pstFirstPathList, COORD_T *pstMeanCoord, COORD_T *pstInsertPoint, uint32 dwImuMoveFlag, PUB_CURRENT_LCT_RESULT_T *pstCurrentLctResult);
COORD_T lct_main_cal_bezier_curve_insert_point(COORD_T p0, COORD_T p1, COORD_T p2, COORD_T p3, flt32 t);
void lct_main_insert_point_to_bezier_curve(LCT_COORDSEL_MEAN_COORD_T *pstMeanLctCoordList, COORD_T *pstCoordList, COORD_T stLctCoord);

void lct_main_write_text_file(LCT_FIRSTPATH_LIST_T *pstFirstPahtGroup);
#endif