mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-30 22:51:16 +01:00
Compare commits
No commits in common. "648f90f230da0a7b9f498aff175255a502aafcb5" and "3e1bddbcfd0f3a2a01c4b83ae030c8d77e2c89bb" have entirely different histories.
648f90f230
...
3e1bddbcfd
@ -170,7 +170,8 @@ void WaypointItem::paint(QPainter *painter,
|
|||||||
if (_font.bold())
|
if (_font.bold())
|
||||||
painter->drawPixmap(-_icon->width() * 0.625, icon.isNull()
|
painter->drawPixmap(-_icon->width() * 0.625, icon.isNull()
|
||||||
? -_icon->height() * 1.25 : -_icon->height() * 0.625,
|
? -_icon->height() * 1.25 : -_icon->height() * 0.625,
|
||||||
_icon->scaled(_icon->width() * 1.25, _icon->height() * 1.25));
|
_icon->scaled(_icon->width() * 1.25, _icon->height() * 1.25,
|
||||||
|
Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||||
else
|
else
|
||||||
painter->drawPixmap(-_icon->width()/2.0, icon.isNull()
|
painter->drawPixmap(-_icon->width()/2.0, icon.isNull()
|
||||||
? -_icon->height() : -_icon->height()/2, *_icon);
|
? -_icon->height() : -_icon->height()/2, *_icon);
|
||||||
|
@ -124,22 +124,7 @@ static QMap<int, QString> coursePointSymbolsInit()
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QMap<int, QString> locationPointSymbolsInit()
|
|
||||||
{
|
|
||||||
QMap<int, QString> map;
|
|
||||||
|
|
||||||
/* The location symbols are a typical GARMIN mess. Every GPS unit
|
|
||||||
has probably its own list, so we only add a few generic icons seen
|
|
||||||
"in the wild" most often. */
|
|
||||||
map.insert(94, "Flag, Blue");
|
|
||||||
map.insert(95, "Flag, Green");
|
|
||||||
map.insert(96, "Flag, Red");
|
|
||||||
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
static QMap<int, QString> coursePointSymbols = coursePointSymbolsInit();
|
static QMap<int, QString> coursePointSymbols = coursePointSymbolsInit();
|
||||||
static QMap<int, QString> locationPointSymbols = locationPointSymbolsInit();
|
|
||||||
|
|
||||||
|
|
||||||
bool FITParser::readData(QFile *file, char *data, size_t size)
|
bool FITParser::readData(QFile *file, char *data, size_t size)
|
||||||
@ -286,7 +271,7 @@ bool FITParser::readField(CTX &ctx, Field *field, QVariant &val, bool &valid)
|
|||||||
ctx.len -= field->size;
|
ctx.len -= field->size;
|
||||||
ret = (ba.size() == field->size);
|
ret = (ba.size() == field->size);
|
||||||
val = ret ? ba : QString();
|
val = ret ? ba : QString();
|
||||||
valid = (!ba.isEmpty() && ba.at(0) != 0);}
|
valid = !ba.isEmpty();}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = skipValue(ctx, field->size);
|
ret = skipValue(ctx, field->size);
|
||||||
@ -403,9 +388,6 @@ bool FITParser::parseData(CTX &ctx, const MessageDefinition *def)
|
|||||||
waypoint.rcoordinates().setLon(
|
waypoint.rcoordinates().setLon(
|
||||||
(val.toInt() / (double)0x7fffffff) * 180);
|
(val.toInt() / (double)0x7fffffff) * 180);
|
||||||
break;
|
break;
|
||||||
case 3:
|
|
||||||
waypoint.setSymbol(locationPointSymbols.value(val.toUInt()));
|
|
||||||
break;
|
|
||||||
case 4:
|
case 4:
|
||||||
waypoint.setElevation((val.toUInt() / 5.0) - 500);
|
waypoint.setElevation((val.toUInt() / 5.0) - 500);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user