Example #1
0
 /**
  * Calculate stride length
  */
 protected function calculateStrideLength()
 {
     if ($this->Object->sportid() == Configuration::General()->runningSport()) {
         if (null !== $this->Trackdata && $this->Trackdata->has(Model\Trackdata\Object::CADENCE)) {
             $Calculator = new \Runalyze\Calculation\StrideLength\Calculator($this->Trackdata);
             $Calculator->calculate();
             $this->Object->set(Object::STRIDE_LENGTH, $Calculator->average());
         } elseif ($this->Object->cadence() > 0) {
             $this->Object->set(Object::STRIDE_LENGTH, \Runalyze\Calculation\StrideLength\Calculator::forActivity($this->Object));
         }
     }
 }
Example #2
0
 /**
  * Update stride length
  */
 protected function updateStrideLength()
 {
     if ($this->hasChanged(Entity::SPORTID) || $this->hasChanged(Entity::VERTICAL_OSCILLATION) || $this->hasChanged(Entity::STRIDE_LENGTH)) {
         if ($this->NewObject->sportid() == Configuration::General()->runningSport()) {
             $this->NewObject->set(Entity::STRIDE_LENGTH, \Runalyze\Calculation\StrideLength\Calculator::forActivity($this->NewObject));
         } else {
             $this->NewObject->set(Entity::STRIDE_LENGTH, 0);
         }
     }
 }
Example #3
0
 /**
  * Calculate stride length
  */
 protected function calculateStrideLength()
 {
     if ($this->Object->sportid() == Configuration::General()->runningSport()) {
         $this->Object->set(Entity::STRIDE_LENGTH, \Runalyze\Calculation\StrideLength\Calculator::forActivity($this->Object));
     }
 }