mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
OP-52 Ground/GPS Display: More tweaks
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1533 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
d457781173
commit
2283e2e9ad
@ -72,12 +72,15 @@ void GpsDisplayWidget::setSpeedHeading(double speed, double heading)
|
|||||||
|
|
||||||
void GpsDisplayWidget::setDateTime(double date, double time)
|
void GpsDisplayWidget::setDateTime(double date, double time)
|
||||||
{
|
{
|
||||||
QString dstring = QString::number(date,'g',10);
|
// QString dstring = QString::number(date,'g',10);
|
||||||
dstring.insert(6,".");
|
QString dstring;
|
||||||
dstring.insert(4,".");
|
dstring.sprintf("%06.0f",date);
|
||||||
|
dstring.insert(dstring.length()-2,".");
|
||||||
|
dstring.insert(dstring.length()-5,".");
|
||||||
gdate_value->setText(dstring);
|
gdate_value->setText(dstring);
|
||||||
gdate_value->adjustSize();
|
gdate_value->adjustSize();
|
||||||
dstring = QString::number(time,'g',10);
|
//dstring = QString::number(time,'g',10);
|
||||||
|
dstring.sprintf("%06.0f",time);
|
||||||
dstring.insert(dstring.length()-2,":");
|
dstring.insert(dstring.length()-2,":");
|
||||||
dstring.insert(dstring.length()-5,":");
|
dstring.insert(dstring.length()-5,":");
|
||||||
gtime_value->setText(dstring + " GMT");
|
gtime_value->setText(dstring + " GMT");
|
||||||
@ -105,8 +108,6 @@ void GpsDisplayWidget::setSVs(int sv)
|
|||||||
|
|
||||||
void GpsDisplayWidget::setPosition(double lat, double lon, double alt)
|
void GpsDisplayWidget::setPosition(double lat, double lon, double alt)
|
||||||
{
|
{
|
||||||
//lat *= 1E-7;
|
|
||||||
//lon *= 1E-7;
|
|
||||||
double deg = (lat>0) ? floor(lat):ceil(lat);
|
double deg = (lat>0) ? floor(lat):ceil(lat);
|
||||||
double min = fabs(lat-deg)*60;
|
double min = fabs(lat-deg)*60;
|
||||||
QString str;
|
QString str;
|
||||||
|
@ -73,6 +73,8 @@ void TelemetryParser::updateGPS( UAVObject* object1) {
|
|||||||
double lat = object1->getField(QString("Latitude"))->getDouble();
|
double lat = object1->getField(QString("Latitude"))->getDouble();
|
||||||
double lon = object1->getField(QString("Longitude"))->getDouble();
|
double lon = object1->getField(QString("Longitude"))->getDouble();
|
||||||
double alt = object1->getField(QString("Altitude"))->getDouble();
|
double alt = object1->getField(QString("Altitude"))->getDouble();
|
||||||
|
lat *= 1E-7;
|
||||||
|
lon *= 1E-7;
|
||||||
emit position(lat,lon,alt);
|
emit position(lat,lon,alt);
|
||||||
|
|
||||||
double hdg = object1->getField(QString("Heading"))->getDouble();
|
double hdg = object1->getField(QString("Heading"))->getDouble();
|
||||||
|
Loading…
Reference in New Issue
Block a user