void ScalePrefs::zoomOutSLOT( double fac ) { double size = (double)ui_winSize->value() * fac; double winSec = (double)windowSeconds() * fac; double totalSec = (double)totalSeconds(); if (winSec <= totalSec) { switch (sizeUnit->currentItem()) { case 0: if (size > 600) { size /= 60.0; sizeUnit->setCurrentItem( 1 ); } break; case 1: if (size > 300) { size /= 60.0; sizeUnit->setCurrentItem( 2 ); } break; case 2: if (size > 48) { size /= 24.0; sizeUnit->setCurrentItem( 3 ); } break; } ui_winSize->setValue( (int)size ); } else // clamp to total length { ui_winSize->setValue( winLength->value() ); sizeUnit->setCurrentItem( lengthUnit->currentItem() ); } /* double val = ui_winSize->value(); if (val > 10) { val *= fac; } else { val *= 2.; } val = QMAX( 2, val ); ui_winSize->setValue( (int)val ); */ }
QString Lap::toString() const { QString str = QString("Total Time %1, Distance %2, Calories %3, Heartbeat %4, Max HeartBeat %5, Cadence %6\n") .arg(totalSeconds()) .arg(length()) .arg(calories()) .arg(heartBeats()) .arg(maximumHeartBeats()) .arg(cadence()); foreach ( TrackPointPtr tp, m_Points ) { str += "\t" + tp->toString() + "\n"; }
/// entire time in minutes double Time::totalMinutes() const { return MINUTES_PER_SECOND*totalSeconds(); }
/// entire time in hours double Time::totalHours() const { return HOURS_PER_SECOND*totalSeconds(); }
/// entire time in days double Time::totalDays() const { return DAYS_PER_SECOND*totalSeconds(); }
/// greater than equals operator bool Time::operator>= (const Time& rhs) const { return totalSeconds() >= rhs.totalSeconds(); }
/// less than operator bool Time::operator< (const Time& rhs) const { return totalSeconds() < rhs.totalSeconds(); }
/// non-equality operator bool Time::operator!= (const Time& other) const { return totalSeconds() != other.totalSeconds(); }