예제 #1
0
 public function testSetHRmax()
 {
     Intensity::setHRmax(100);
     $value1 = $this->object->calculateByHeartrateAverage(75, 3600);
     Intensity::setHRmax(200);
     $value2 = $this->object->calculateByHeartrateAverage(150, 3600);
     $this->assertEquals($value1, $value2);
 }
예제 #2
0
 /**
  * Calculate JD intensity
  * @return int
  */
 public function calculateJDintensity()
 {
     JD\Intensity::setVDOTshape(Configuration::Data()->vdot());
     JD\Intensity::setHRmax(Configuration::Data()->HRmax());
     $Intensity = new JD\Intensity();
     if ($this->knowsTrackdata() && $this->Trackdata->has(Model\Trackdata\Object::HEARTRATE) && $this->Trackdata->has(Model\Trackdata\Object::TIME)) {
         return $Intensity->calculateByHeartrate(new TimeSeries($this->Trackdata->heartRate(), $this->Trackdata->time()));
     } elseif ($this->Activity->hrAvg() > 0) {
         return $Intensity->calculateByHeartrateAverage($this->Activity->hrAvg(), $this->Activity->duration());
     } else {
         return $Intensity->calculateByPace($this->Activity->distance(), $this->Activity->duration());
     }
 }