Use temperature_t for temperatures in struct stats_t

Use struct temperature_t for temperatures in struct stats_t and
use get_temperature_string() when printing these temperatures for
statistics and HTML export.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
Stefan Fuchs 2018-02-18 21:55:57 +01:00 committed by Dirk Hohndel
parent 928e7ed869
commit 95a23cf470
8 changed files with 48 additions and 49 deletions

View file

@ -591,16 +591,15 @@ void DiveTemperatureItem::modelDataChanged(const QModelIndex &topLeft, const QMo
void DiveTemperatureItem::createTextItem(int sec, int mkelvin)
{
double deg;
const char *unit;
deg = get_temp_units(mkelvin, &unit);
temperature_t temp;
temp.mkelvin = mkelvin;
DiveTextItem *text = new DiveTextItem(this);
text->setAlignment(Qt::AlignRight | Qt::AlignBottom);
text->setBrush(getColor(TEMP_TEXT));
text->setPos(QPointF(hAxis->posAtValue(sec), vAxis->posAtValue(mkelvin)));
text->setScale(0.8); // need to call this BEFORE setText()
text->setText(QString("%1%2").arg(deg, 0, 'f', 1).arg(unit));
text->setText(get_temperature_string(temp, true));
texts.append(text);
}