1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Added additional message. Improved significant digit formatting.

This commit is contained in:
Kenz Dale 2012-08-02 11:36:36 +02:00
parent 3b9e3c0054
commit d30da01ca8
2 changed files with 7 additions and 7 deletions

View File

@ -146,15 +146,16 @@ namespace mapcontrol
//Create text lines
QString uavoInfoStrLine1, uavoInfoStrLine2;
QString uavoInfoStrLine3;
QString uavoInfoStrLine4;
QString uavoInfoStrLine3, uavoInfoStrLine4;
QString uavoInfoStrLine5;
//For whatever reason, Qt does not let QPainterPath have text wrapping. So each line of
//text has to be added to a different line.
uavoInfoStrLine1.append(QString("CAS: %1 kph").arg(CAS_mps));
uavoInfoStrLine2.append(QString("Groundspeed: %1 kph").arg(groundspeed_kph));
uavoInfoStrLine3.append(QString("Lat-Lon: %1, %2").arg(coord.Lat()).arg(coord.Lng()));
uavoInfoStrLine4.append(QString("Altitude: %1 m").arg(this->altitude));
uavoInfoStrLine2.append(QString("Groundspeed: %1 kph").arg(groundspeed_kph, 0, 'f',1));
uavoInfoStrLine3.append(QString("Lat-Lon: %1, %2").arg(coord.Lat(), 0, 'f',7).arg(coord.Lng(), 0, 'f',7));
uavoInfoStrLine4.append(QString("North-East: %1 m, %2 m").arg(NED[0], 0, 'f',1).arg(NED[1], 0, 'f',1));
uavoInfoStrLine5.append(QString("Altitude: %1 m").arg(-NED[2], 0, 'f',1));
//Add the lines of text to the path
//NOTE: We must use QPainterPath for the outlined text font. QPaint does not support this.
@ -163,6 +164,7 @@ namespace mapcontrol
path.addText(textAnchorX, textAnchorY+16*1, borderfont, uavoInfoStrLine2);
path.addText(textAnchorX, textAnchorY+16*2, borderfont, uavoInfoStrLine3);
path.addText(textAnchorX, textAnchorY+16*3, borderfont, uavoInfoStrLine4);
path.addText(textAnchorX, textAnchorY+16*4, borderfont, uavoInfoStrLine5);
//First pass is the outline...
myPen.setWidth(4);

View File

@ -581,8 +581,6 @@ void OPMapGadgetWidget::updatePosition()
gps_longitude = gpsPositionData.Longitude;
gps_altitude = gpsPositionData.Altitude;
qDebug() << "Lon: " << gps_longitude/1e7;
gps_pos = internals::PointLatLng(gps_latitude, gps_longitude);
//**********************