コード例 #1
0
ファイル: Inserter.php プロジェクト: guancio/Runalyze
 /**
  * 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
ファイル: Loop.php プロジェクト: guancio/Runalyze
 /**
  * @return array
  */
 public function sliceElevation()
 {
     if ($this->Object->hasCorrectedElevations()) {
         return $this->slice(Entity::ELEVATIONS_CORRECTED);
     } elseif ($this->Object->hasOriginalElevations()) {
         return $this->slice(Entity::ELEVATIONS_ORIGINAL);
     }
     return array();
 }
コード例 #3
0
ファイル: Inserter.php プロジェクト: aschix/Runalyze
 /**
  * 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();
 }