// 秒寻科技
// 计算各频点的最强幅度值，并按照最强幅度对载波进行倒排序
// 2023-03-12

#ifndef __BTS_AMPL_H__
#define __BTS_AMPL_H__

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

// 供外部使用接口
void bts_ampl_main(PUB_LOCATION_DATA_T *pstLocationDataList, BTS_AMPL_MIRROR_DATA_T *pstBtsAmplMirrorDataList, BTS_MAX_AMPL_DATA_T *pstBtsMaxAmplDataList);

// 内部使用接口
void bts_ampl_mirror_data(PUB_LOCATION_DATA_T *pstLocationDataList, BTS_AMPL_MIRROR_DATA_T *pstBtsAmplMirrorDataList);
void bts_ampl_check_freq_valid(PUB_LOCATION_DATA_T *pstLocationData, BTS_AMPL_MIRROR_DATA_T *pstAmplMirrorData);
void bts_ampl_save_current_ampl(BTS_AMPL_MIRROR_DATA_T *pstBtsAmplMirrorData, flt32 fMaxValue, uint16 wMaxValueIndex, flt32 fSnr);
void bts_ampl_check_current_ampl_valid(PUB_LOCATION_DATA_T *pstLocationData, BTS_AMPL_MIRROR_DATA_T *pstBtsAmplMirrorData, flt32 fMaxAmpl, uint16 wMaxValueIndex, flt32 fSnr);

void bts_ampl_cal_bts_slot_and_max_value_index(BTS_AMPL_MIRROR_DATA_T *pstBtsAmplMirrorDataList, BTS_MAX_AMPL_DATA_T *pstBtsMaxAmplDataList);
void bts_ampl_cal_max_ampl_in_slot_and_index_for_one_second_data(BTS_AMPL_MIRROR_DATA_T *pstBtsAmplMirrorDataList, BTS_MAX_AMPL_DATA_T *pstBtsMaxAmplDataList);
void bts_ampl_cal_max_ampl_in_slot_and_index_for_multi_second_data(BTS_AMPL_MIRROR_DATA_T *pstBtsAmplMirrorDataList, BTS_MAX_AMPL_DATA_T *pstBtsMaxAmplDataList);
void bts_ampl_cal_slot_and_frame_index(uint16 wMaxValueIndex, uint8 *pbySlot, uint16 *pwFrameIndex);
void bts_ampl_sort_max_ampl_list(BTS_MAX_AMPL_DATA_T *pstBtsMaxAmplDataList);

#endif