/** * Value of used VDOT (uncorrected) * @return float */ public function usedVdot() { if (Configuration::Vdot()->useElevationCorrection()) { if ($this->Activity->vdotWithElevation() > 0) { return $this->Activity->vdotWithElevation(); } } return $this->Activity->vdotByHeartRate(); }
/** * Update vdot shape and corrector */ protected function updateVDOTshapeAndCorrector() { $timestampLimit = time() - Configuration::Vdot()->days() * DAY_IN_S; if ($this->Object->usesVDOT() && $this->Object->vdotByHeartRate() > 0 && $this->Object->timestamp() > $timestampLimit) { Configuration::Data()->recalculateVDOTshape(); if ($this->Object->typeid() == Configuration::General()->competitionType()) { Configuration::Data()->recalculateVDOTcorrector(); } } }
/** * Prognosis time by heart rate after correction * @return string */ public function prognosisByHRafterCorrection() { if (Configuration::Vdot()->useCorrectionFactor()) { $Prognosis = new Daniels(); $Prognosis->adjustVDOT(false); $Prognosis->setVDOT(Configuration::Data()->vdotFactor() * $this->Activity->vdotByHeartRate()); return $this->formatTime($Prognosis->inSeconds($this->Activity->distance())); } return '-'; }
/** * Calculate factor from activity * * Simply calculates the ratio of vdot by time and by heart rate. * This method does not regard any other correction (e.g. elevation, ...). * * @param \Runalyze\Model\Activity\Entity $activity */ public function fromActivity(Activity\Entity $activity) { if ($activity->vdotByHeartRate() > 0) { $this->Factor = $activity->vdotByTime() / $activity->vdotByHeartRate(); } else { $this->Factor = 1; } }