mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
New profile: small cleanup of heartrate code
Remove unused variable and correct comment. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2b4bce8ef9
commit
eb5cbf64eb
1 changed files with 2 additions and 3 deletions
|
@ -227,20 +227,19 @@ DiveHeartrateItem::DiveHeartrateItem()
|
||||||
|
|
||||||
void DiveHeartrateItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
|
void DiveHeartrateItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
|
||||||
{
|
{
|
||||||
int last = -300, last_printed_hr = 0, sec = 0, last_valid_hr = 0;
|
int last = -300, last_printed_hr = 0, sec = 0;
|
||||||
// We don't have enougth data to calculate things, quit.
|
// We don't have enougth data to calculate things, quit.
|
||||||
if (!shouldCalculateStuff(topLeft, bottomRight))
|
if (!shouldCalculateStuff(topLeft, bottomRight))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
qDeleteAll(texts);
|
qDeleteAll(texts);
|
||||||
texts.clear();
|
texts.clear();
|
||||||
// Ignore empty values. things do not look good with '0' as temperature in kelvin...
|
// Ignore empty values. a heartrate of 0 would be a bad sign.
|
||||||
QPolygonF poly;
|
QPolygonF poly;
|
||||||
for (int i = 0, modelDataCount = dataModel->rowCount(); i < modelDataCount; i++) {
|
for (int i = 0, modelDataCount = dataModel->rowCount(); i < modelDataCount; i++) {
|
||||||
int hr = dataModel->index(i, vDataColumn).data().toInt();
|
int hr = dataModel->index(i, vDataColumn).data().toInt();
|
||||||
if (!hr)
|
if (!hr)
|
||||||
continue;
|
continue;
|
||||||
last_valid_hr = hr;
|
|
||||||
sec = dataModel->index(i, hDataColumn).data().toInt();
|
sec = dataModel->index(i, hDataColumn).data().toInt();
|
||||||
QPointF point( hAxis->posAtValue(sec), vAxis->posAtValue(hr));
|
QPointF point( hAxis->posAtValue(sec), vAxis->posAtValue(hr));
|
||||||
poly.append(point);
|
poly.append(point);
|
||||||
|
|
Loading…
Add table
Reference in a new issue