/**
  * Add cadence and power
  */
 protected function addCadenceAndStrideLength()
 {
     if ($this->Context->activity()->cadence() > 0 || $this->Context->activity()->strideLength() > 0) {
         $Cadence = new BoxedValue(Helper::Unknown($this->Context->dataview()->cadence()->value(), '-'), $this->Context->dataview()->cadence()->unitAsString(), $this->Context->dataview()->cadence()->label());
         $Cadence->defineAsFloatingBlock('w50');
         $StrideLength = new Activity\Box\StrideLength($this->Context);
         $StrideLength->defineAsFloatingBlock('w50');
         $this->BoxedValues[] = $Cadence;
         $this->BoxedValues[] = $StrideLength;
     }
 }
Ejemplo n.º 2
0
 /**
  * Add cadence and power
  */
 protected function addCadenceAndPower()
 {
     if ($this->showCadence && ($this->Context->activity()->cadence() > 0 || $this->Context->activity()->power() > 0)) {
         $Cadence = new BoxedValue(Helper::Unknown($this->Context->dataview()->cadence()->value(), '-'), $this->Context->dataview()->cadence()->unitAsString(), $this->Context->dataview()->cadence()->label());
         $Cadence->defineAsFloatingBlock('w50');
         if ($this->Context->activity()->strideLength() > 0) {
             $Power = new Activity\Box\StrideLength($this->Context);
             $Power->defineAsFloatingBlock('w50');
         } else {
             $Power = new BoxedValue(Helper::Unknown($this->Context->activity()->power(), '-'), 'W', __('Power'));
             $Power->defineAsFloatingBlock('w50');
         }
         $this->BoxedValues[] = $Cadence;
         $this->BoxedValues[] = $Power;
     } elseif (!$this->showCadence && $this->Context->activity()->power() > 0) {
         $Power = new BoxedValue(Helper::Unknown($this->Context->activity()->power(), '-'), 'W', __('Power'));
         $Power->defineAsFloatingBlock('w100');
         $this->BoxedValues[] = $Power;
     }
 }