{
if(SVL)
{
[B] This is used to draw old data in different colors and delete them once age is reached[/B]
if(plotdetails.isEmpty() == false)
{
if(ncm_received == 1) //Data received from Tcp Socket, used to update the age
{
for(int i=0;i<plotdetails.size();i++)
{
tempplot = plotdetails.at(i);
if(tempplot.age==1)
{
tempplot.scan = 1;
}
else if(tempplot.age==2)
{
tempplot.scan = 2;
}
plotdetails.replace(i,tempplot);
}
ncm_received = 0;
}
for(int i=0;i<plotdetails.size();i++)
{
tempplot = plotdetails.at(i);
if(ncm_received == 0)
{
if(tempplot.tazimuth == 0)
{
if(tempplot.scan == 1)
{
tempplot.age=2;
plotdetails.replace(i,tempplot);
}
else if(tempplot.scan == 2)
{
tempplot.age=3;
plotdetails.replace(i,tempplot);
//plotdetails.remove(i);
}
}
if((tempplot.tazimuth >= capminutes) && (tempplot.tazimuth <= (capminutes + 2731u) )
||
(capminutes >= 62500))
{
if(tempplot.scan == 1)
{
tempplot.age=2;
plotdetails.replace(i,tempplot);
}
else if(tempplot.scan == 2)
{
tempplot.age=3;
plotdetails.replace(i,tempplot);
}
}
}
if(tempplot.age==1 && plotenabled == true)
{
painter->rotate(180 + (tempplot.tazimuth/182.047222265));
painter
->drawPixmap
(QRectF(-(plocntpix.
width()/(2)),
(((1.8 *tempplot.
trange)/1000)*(side
-50)/(ppi_defaults.
max_range*2))-(plocntpix.
height()/(2)),plocntpix.
width(),plocntpix.
height()),plocntpix,
QRectF(0,
0,plocntpix.
width(),plocntpix.
height()));
painter->rotate(-(180 + (tempplot.tazimuth/182.047222265)));
}
else if(tempplot.age==2 && plotenabled == true && preplotenabled == true)
{
painter->rotate(180 + (tempplot.tazimuth/182.047222265));
painter
->drawPixmap
(QRectF(-plotgraypix.
width()/(2),
(((1.8 *tempplot.
trange)/1000)*(side
-50)/(ppi_defaults.
max_range*2))-(plotgraypix.
height()/(2)),plotgraypix.
width(),plotgraypix.
height()),plotgraypix,
QRectF(0,
0,plotgraypix.
width(),plotgraypix.
height()));
painter->rotate(-(180 + (tempplot.tazimuth/182.047222265)));
}
else if(tempplot.age == 3)
{
plotdetails.remove(i);
i--;
//printf("REMOVED THE ELEMENT FROM QUEUE\n");
}
}
}
[B] //Start drawing the plot, after receiving from the network[/B]
if(m_vplot.isEmpty() == false)
{
for(int i = 0; i<m_vplot.size();i++)
{
templot.trange = m_vplot.at(i).range;
templot.tazimuth= m_vplot.at(i).azimuth;
templot.elevation= m_vplot.at(i).elevation;
templot.tazimuthextn= m_vplot.at(i).azimuthextn;
azimthext = (templot.tazimuthextn/182.047222265);
templot.age=1;
templot.scan =0;
if(plotenabled == true)
{
plotminutes =((m_vplot.at(i)).azimuth)/182.047222265;
temp1= 180 + plotminutes;
painter->rotate(temp1);
painter
->drawPixmap
(QRectF(-(plocntpix.
width()/(2)),
(((1.8 *m_vplot.
at(i
).
range)/1000)*(side
-50)/(ppi_defaults.
max_range*2))-(plocntpix.
height()/(2)),plocntpix.
width(),plocntpix.
height()),plocntpix,
QRectF(0,
0,plocntpix.
width(),plocntpix.
height()));
painter->rotate(-temp1);
if(!plotdetails.contains(templot))
{
plotdetails.append(templot);
}
painter->save();
int startAngle = 0;/*(90-15) * 16*/;
int spanAngle = 0;/*30 * 16;*/
float rangepixel = (((1.8 * m_vplot.at(i).range)/1000)*(side-50)/(ppi_defaults.max_range*2));
rangepixel = fabs(rangepixel);
QRectF rectangle
(-(rangepixel
),
-(rangepixel
),
(rangepixel
*2),
(2*rangepixel
));
painter->restore();
}
}
m_vplot.clear();
}
}
else
{
if(plotdetails.isEmpty() == false)
plotdetails.clear();
if(m_vplot.isEmpty() == false)
m_vplot.clear();
}
#endif
}
{
if(SVL)
{
[B] This is used to draw old data in different colors and delete them once age is reached[/B]
if(plotdetails.isEmpty() == false)
{
if(ncm_received == 1) //Data received from Tcp Socket, used to update the age
{
for(int i=0;i<plotdetails.size();i++)
{
tempplot = plotdetails.at(i);
if(tempplot.age==1)
{
tempplot.scan = 1;
}
else if(tempplot.age==2)
{
tempplot.scan = 2;
}
plotdetails.replace(i,tempplot);
}
ncm_received = 0;
}
for(int i=0;i<plotdetails.size();i++)
{
tempplot = plotdetails.at(i);
if(ncm_received == 0)
{
if(tempplot.tazimuth == 0)
{
if(tempplot.scan == 1)
{
tempplot.age=2;
plotdetails.replace(i,tempplot);
}
else if(tempplot.scan == 2)
{
tempplot.age=3;
plotdetails.replace(i,tempplot);
//plotdetails.remove(i);
}
}
if((tempplot.tazimuth >= capminutes) && (tempplot.tazimuth <= (capminutes + 2731u) )
||
(capminutes >= 62500))
{
if(tempplot.scan == 1)
{
tempplot.age=2;
plotdetails.replace(i,tempplot);
}
else if(tempplot.scan == 2)
{
tempplot.age=3;
plotdetails.replace(i,tempplot);
}
}
}
if(tempplot.age==1 && plotenabled == true)
{
painter->rotate(180 + (tempplot.tazimuth/182.047222265));
painter->drawPixmap(QRectF(-(plocntpix.width()/(2)),(((1.8 *
tempplot.trange)/1000)*(side-50)/(ppi_defaults.max_range*2))-(plocntpix.height()/(2)),plocntpix.width(),plocntpix.height()),plocntpix,QRectF(0,0,plocntpix.width(),plocntpix.height()));
painter->rotate(-(180 + (tempplot.tazimuth/182.047222265)));
}
else if(tempplot.age==2 && plotenabled == true && preplotenabled == true)
{
painter->rotate(180 + (tempplot.tazimuth/182.047222265));
painter->drawPixmap(QRectF(-plotgraypix.width()/(2),(((1.8 *
tempplot.trange)/1000)*(side-50)/(ppi_defaults.max_range*2))-(plotgraypix.height()/(2)),plotgraypix.width(),plotgraypix.height()),plotgraypix,QRectF(0,0,plotgraypix.width(),plotgraypix.height()));
painter->rotate(-(180 + (tempplot.tazimuth/182.047222265)));
}
else if(tempplot.age == 3)
{
plotdetails.remove(i);
i--;
//printf("REMOVED THE ELEMENT FROM QUEUE\n");
}
}
}
[B] //Start drawing the plot, after receiving from the network[/B]
if(m_vplot.isEmpty() == false)
{
for(int i = 0; i<m_vplot.size();i++)
{
templot.trange = m_vplot.at(i).range;
templot.tazimuth= m_vplot.at(i).azimuth;
templot.elevation= m_vplot.at(i).elevation;
templot.tazimuthextn= m_vplot.at(i).azimuthextn;
azimthext = (templot.tazimuthextn/182.047222265);
templot.age=1;
templot.scan =0;
if(plotenabled == true)
{
plotminutes =((m_vplot.at(i)).azimuth)/182.047222265;
temp1= 180 + plotminutes;
painter->rotate(temp1);
painter->drawPixmap(QRectF(-(plocntpix.width()/(2)),(((1.8 *
m_vplot.at(i).range)/1000)*(side-50)/(ppi_defaults.max_range*2))-(plocntpix.height()/(2)),plocntpix.width(),plocntpix.height()),plocntpix,QRectF(0,0,plocntpix.width(),plocntpix.height()));
painter->rotate(-temp1);
if(!plotdetails.contains(templot))
{
plotdetails.append(templot);
}
painter->save();
int startAngle = 0;/*(90-15) * 16*/;
int spanAngle = 0;/*30 * 16;*/
float rangepixel = (((1.8 * m_vplot.at(i).range)/1000)*(side-50)/(ppi_defaults.max_range*2));
rangepixel = fabs(rangepixel);
QRectF rectangle(-(rangepixel), -(rangepixel), (rangepixel*2), (2*rangepixel));
painter->restore();
}
}
m_vplot.clear();
}
}
else
{
if(plotdetails.isEmpty() == false)
plotdetails.clear();
if(m_vplot.isEmpty() == false)
m_vplot.clear();
}
#endif
}
To copy to clipboard, switch view to plain text mode
Bookmarks