Example #1
0
 /**
  * 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();
 }
Example #2
0
 /**
  * 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();
         }
     }
 }
Example #3
0
 /**
  * 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 '-';
 }
Example #4
0
 /**
  * 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;
     }
 }