Beispiel #1
0
 /**
  * Find limit for pauses
  */
 protected function findLimitForPauses()
 {
     if (!is_null($this->Trackdata) && $this->Trackdata->has(Trackdata\Entity::DISTANCE)) {
         $SecondsForDist = (int) Configuration::ActivityView()->routeBreak()->value();
         $AveragePace = $this->Trackdata->totalDistance() > 0 ? $this->Trackdata->totalTime() / $this->Trackdata->totalDistance() : 0;
         if ($AveragePace > 0) {
             $this->PauseLimit = max($this->PauseLimit, $SecondsForDist / $AveragePace);
         }
     }
     $this->PauseLimit *= (int) Configuration::ActivityView()->routePrecision()->value();
 }
Beispiel #2
0
 /**
  * Define x-axis
  * @param \Runalyze\Model\Trackdata\Entity $trackdata
  */
 protected function defineXAxis(Trackdata $trackdata)
 {
     if (Configuration::ActivityView()->usesTimeAsXAxis() && $trackdata->has(Trackdata::TIME) && $trackdata->totalTime() > 0) {
         $this->XAxis = self::X_AXIS_TIME;
     } elseif ($trackdata->has(Trackdata::DISTANCE) && $trackdata->totalDistance() > 0) {
         $this->XAxis = self::X_AXIS_DISTANCE;
     } elseif ($trackdata->has(Trackdata::TIME) && $trackdata->totalTime() > 0) {
         $this->XAxis = self::X_AXIS_TIME;
     } else {
         $this->XAxis = self::X_AXIS_INDEX;
     }
 }