Example #1
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 #2
0
 /**
  * Update vdot shape and corrector
  */
 protected function updateVDOTshapeAndCorrector()
 {
     $timestampLimit = time() - Configuration::Vdot()->days() * DAY_IN_S;
     if ($this->hasChanged(Entity::USE_VDOT) && ($this->NewObject->timestamp() >= $timestampLimit || $this->knowsOldObject() && $this->OldObject->timestamp() > $timestampLimit) || $this->NewObject->usesVDOT() && ($this->hasChanged(Entity::VDOT) || $this->hasChanged(Entity::VDOT_WITH_ELEVATION) || $this->hasChanged(Entity::TIMESTAMP) && $this->knowsOldObject() && ($this->NewObject->timestamp() >= $timestampLimit && $this->OldObject->timestamp() < $timestampLimit || $this->NewObject->timestamp() < $timestampLimit && $this->OldObject->timestamp() >= $timestampLimit))) {
         Configuration::Data()->recalculateVDOTshape();
     }
     if (($this->NewObject->usesVDOT() || $this->hasChanged(Entity::USE_VDOT)) && ($this->NewObject->typeid() == Configuration::General()->competitionType() || $this->knowsOldObject() && $this->OldObject->typeid() == Configuration::General()->competitionType())) {
         Configuration::Data()->recalculateVDOTcorrector();
     }
 }
Example #3
0
 /**
  * VDOT icon
  * @return string
  */
 public function vdotIcon()
 {
     $value = $this->usedVdot() * Configuration::Data()->vdotFactor();
     if ($value > 0) {
         $Icon = new VdotIcon($value);
         if (!$this->Activity->usesVDOT()) {
             $Icon->setTransparent();
         }
         return $Icon->code();
     }
     return '';
 }