进程模式 距离、速度、方位 中程模式 距离 方位 Signed-off-by: Yang Jianchao <yangjianchao999@126.com>
150 lines
5.3 KiB
C++
150 lines
5.3 KiB
C++
#include "dot_coh.h"
|
|
#include <qmath.h>
|
|
#include"memory.h"
|
|
#include <QVector>
|
|
using namespace std;
|
|
|
|
|
|
int Dot_Coh::dot_coh_process(QVector <PointRecv> *data_input,
|
|
int beam_input[3],
|
|
QVector <QVector<PointRecv>> *point_recv,
|
|
struct RadarPara Work_Parameter)
|
|
{
|
|
|
|
//数据移动一位
|
|
for (int i=0;i<data_buffer_2.size();i++) //data_buffer_2 ---> point_recv
|
|
{
|
|
(*point_recv)[floor(data_buffer_2[i].beam_index/BEAM_NUM_DOT_SECTION)].push_back(data_buffer_2[i]);
|
|
}
|
|
QVector<PointRecv>().swap(data_buffer_2);
|
|
|
|
|
|
|
|
for (int i=0;i<data_buffer_1.size();i++) //data_buffer_1 ---> data_buffer_2
|
|
{
|
|
data_buffer_2.push_back(data_buffer_1[i]);
|
|
}
|
|
QVector<PointRecv>().swap(data_buffer_1);
|
|
|
|
|
|
|
|
for (int i=0;i<data_input->size();i++) //data_input ---> data_buffer_1
|
|
{
|
|
data_buffer_1.push_back((*data_input)[i]);
|
|
}
|
|
|
|
|
|
//凝聚data_buffer_1 data_buffer_2中的数据
|
|
QVector <PointRecv> data_buffer;
|
|
|
|
for (int i=0;i<data_buffer_1.size();i++)
|
|
data_buffer.push_back(data_buffer_1[i]);
|
|
|
|
for (int i=0;i<data_buffer_2.size();i++)
|
|
data_buffer.push_back(data_buffer_2[i]);
|
|
|
|
QVector<PointRecv>().swap(data_buffer_1);
|
|
QVector<PointRecv>().swap(data_buffer_2);
|
|
|
|
|
|
if(data_buffer.size()>1)
|
|
{
|
|
|
|
for (unsigned int loop_of_point=0; loop_of_point<data_buffer.size()-1;loop_of_point++ )
|
|
{
|
|
if( data_buffer[loop_of_point].Use_Flag!=1)
|
|
{
|
|
float point_0_R=data_buffer[loop_of_point].Range;
|
|
float point_0_V=data_buffer[loop_of_point].Velocity;
|
|
float point_0_F=data_buffer[loop_of_point].Azimuth;
|
|
float point_0_A=data_buffer[loop_of_point].Amplitude;
|
|
for (unsigned int i=loop_of_point+1;i<data_buffer.size();i++)
|
|
{
|
|
if(data_buffer[loop_of_point].Use_Flag!=1)
|
|
{
|
|
float point_1_R=data_buffer[i].Range;
|
|
float point_1_V=data_buffer[i].Velocity;
|
|
float point_1_F=data_buffer[i].Azimuth;
|
|
float point_1_A=data_buffer[i].Amplitude;
|
|
|
|
//凝聚条件: 距离、方位接近
|
|
if(Work_Parameter.work_mode == 0)
|
|
{
|
|
if( (fabs(point_0_R-point_1_R)<=DOT_COH_RANGE && fabs(point_0_F-point_1_F) <=DOT_COH_AZI/180.0*PI && fabs(point_0_V-point_1_V)<=DOT_COH_V)//
|
|
&& point_0_A <point_1_A )//
|
|
{
|
|
point_0_R=data_buffer[i].Range;
|
|
point_0_V=data_buffer[i].Velocity;
|
|
point_0_A=data_buffer[i].Amplitude;
|
|
point_0_F=data_buffer[i].Azimuth;
|
|
data_buffer[loop_of_point].Use_Flag=1;
|
|
}
|
|
else if( (fabs(point_0_R-point_1_R)<=DOT_COH_RANGE && fabs(point_0_F-point_1_F) <=DOT_COH_AZI/180.0*PI && fabs(point_0_V-point_1_V)<=DOT_COH_V)//
|
|
&& point_0_A >= point_1_A)//
|
|
{
|
|
data_buffer[i].Use_Flag=1;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if( (fabs(point_0_R-point_1_R)<=DOT_COH_RANGE && fabs(point_0_F-point_1_F) <=DOT_COH_AZI/180.0*PI )//
|
|
&& point_0_A <point_1_A )//
|
|
{
|
|
point_0_R=data_buffer[i].Range;
|
|
point_0_V=data_buffer[i].Velocity;
|
|
point_0_A=data_buffer[i].Amplitude;
|
|
point_0_F=data_buffer[i].Azimuth;
|
|
data_buffer[loop_of_point].Use_Flag=1;
|
|
}
|
|
else if( (fabs(point_0_R-point_1_R)<=DOT_COH_RANGE && fabs(point_0_F-point_1_F) <=DOT_COH_AZI/180.0*PI )//
|
|
&& point_0_A >= point_1_A)//
|
|
{
|
|
data_buffer[i].Use_Flag=1;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
//删除凝聚点 和 量程范围外点
|
|
QVector <PointRecv>::iterator Iter;
|
|
for (Iter=data_buffer.begin(); Iter!=data_buffer.end();)
|
|
{
|
|
if((*Iter).Use_Flag==1 || (*Iter).Range <R_MIN || (*Iter).Range > R_MAX )
|
|
{
|
|
data_buffer.erase(Iter);
|
|
Iter=data_buffer.begin();
|
|
}
|
|
else
|
|
{
|
|
Iter++;
|
|
}
|
|
}
|
|
|
|
//凝聚后的数据分别存入data_buffer_1 data_buffer_2
|
|
for(int i=0;i<data_buffer.size();i++)
|
|
{
|
|
if(data_buffer[i].beam_index == beam_input[0]
|
|
|| data_buffer[i].beam_index == beam_input[1]
|
|
|| data_buffer[i].beam_index == beam_input[2])
|
|
data_buffer_1.push_back(data_buffer[i]);
|
|
else
|
|
data_buffer_2.push_back(data_buffer[i]);
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
Dot_Coh::Dot_Coh(void)
|
|
{
|
|
|
|
}
|