예제 #1
0
 /**
  * Tasks before insertion
  */
 protected function before()
 {
     parent::before();
     $Calculator = new Calculator($this->Object);
     if (Configuration::ActivityForm()->correctElevation() && !$this->Object->hasCorrectedElevations()) {
         $Calculator->tryToCorrectElevation();
     }
     $Calculator->calculateElevation();
 }
예제 #2
0
 /**
  * Tasks before insertion
  */
 protected function before()
 {
     parent::before();
     $this->Object->set(Object::TIMESTAMP_CREATED, time());
     $this->removeDataIfInside();
     $this->calculateCaloriesIfZero();
     $this->calculateVDOTAndIntensityAndTrimp();
     $this->calculatePower();
     $this->calculateStrideLength();
 }
예제 #3
0
 /**
  * Tasks before insertion
  */
 protected function before()
 {
     parent::before();
     $Calculator = new Calculator($this->Object);
     if (Configuration::ActivityForm()->correctElevation() && !$this->Object->hasCorrectedElevations()) {
         try {
             $Calculator->tryToCorrectElevation();
         } catch (NoValidStrategyException $e) {
             // Well, obviously that did not work. Probably all API limits have been reached.
         }
     }
     $Calculator->calculateElevation();
 }
예제 #4
0
 /**
  * Tasks before insertion
  */
 protected function before()
 {
     $this->calculateIfActivityWasAtNight();
     parent::before();
     $this->Object->set(Entity::TIMESTAMP_CREATED, time());
     $this->setSportIdIfEmpty();
     $this->removeDataIfInside();
     $this->calculateCaloriesIfZero();
     $this->calculateVDOTAndIntensityAndTrimp();
     $this->calculatePower();
     $this->calculateStrideLength();
     $this->calculateVerticalRatio();
     $this->calculateSwimValues();
 }