1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

Improved static and update behavior.

This commit is contained in:
Laura Sebesta 2012-08-02 20:21:29 +02:00
parent 3e4f2e21ce
commit 3e23163dde
3 changed files with 8 additions and 9 deletions

View File

@ -28,6 +28,7 @@
#include "uavitem.h"
const qreal Pi = 3.14;
static double groundspeed_mps_filt;
namespace mapcontrol
{
@ -123,8 +124,8 @@ namespace mapcontrol
double groundspeed_mps=groundspeed_kph/3.6;
radius=fabs(groundspeed_mps/(yawRate_dps*Pi/180))*meters2pixels;
qDebug() << "Scale: " << meters2pixels;
qDebug() << "Zoom: " << map->ZoomTotal();
// qDebug() << "Scale: " << meters2pixels;
// qDebug() << "Zoom: " << map->ZoomTotal();
// qDebug()<< "Radius:" << radius;
// qDebug()<< "Span angle:" << spanAngle;
@ -144,15 +145,13 @@ namespace mapcontrol
}
//*********** Create time rings
double ringTime=0;
double ringTime=10*pow(2,17-map->ZoomTotal()); //Basic ring is 10 seconds wide at zoom level 17
double alpha= .05;
groundspeed_mps_filt= (1-alpha)*groundspeed_mps_filt + alpha*groundspeed_mps;
if(groundspeed_mps > 0){ //Don't clutter the display with rings that are only one pixel wide
myPen.setWidth(2);
double alpha= .1;
groundspeed_mps_filt= (1-alpha)*groundspeed_mps_filt + alpha*groundspeed_mps;
ringTime=10*pow(2,17-map->ZoomTotal());
myPen.setColor(QColor(0, 0, 0, 100));
painter->setPen(myPen);
painter->drawEllipse(QPointF(0,0),groundspeed_mps_filt*ringTime*1*meters2pixels,groundspeed_mps_filt*ringTime*1*meters2pixels);

View File

@ -247,7 +247,6 @@ namespace mapcontrol
bool autosetreached;
double Distance3D(internals::PointLatLng const& coord, int const& altitude);
double autosetdistance;
double groundspeed_mps_filt;
bool showUAVInfo;
// QRectF rect;

View File

@ -1555,6 +1555,7 @@ void OPMapGadgetWidget::onShowUAVInfo_toggled(bool show)
return;
m_map->UAV->SetShowUAVInfo(show);
update();
}
void OPMapGadgetWidget::onShowHomeAct_toggled(bool show)