MobileDive::MobileDive(dive *d) { m_thisDive = d; setDiveNumber(QString::number(d->number)); setDiveId(QString::number(d->id)); dive_trip *trip = d->divetrip; if(trip) { //trip is valid setTrip(trip->location); } setDate(get_dive_date_string(d->when)); setDepth(get_depth_string(d->maxdepth)); setDuration(get_dive_duration_string(d->duration.seconds, "h:","min")); setupDiveTempDetails(); weight_t tw = { total_weight(d) }; setWeight(weight_string(tw.grams)); setSuit(QString(d->suit)); setCylinder(QString(d->cylinder[0].type.description)); setSac(QString::number(d->sac)); setLocation(get_dive_location(d)); setNotes(d->notes); setBuddy(d->buddy); setDivemaster(d->divemaster); }
/** * @brief */ void trip() override { setTrip(true); m_first_trip = true; m_noise.play(); m_current_state = TRIP; m_animator.playAnimation(TRIP); }