Beispiel #1
0
 /**
  * Compare distance to last set
  * @param float $currentDistance [km]
  * @param float $previousDistance [km]
  * @return string
  */
 protected function distanceComparison($currentDistance, $previousDistance)
 {
     $Percentage = $this->distanceComparisonPercentage($currentDistance, $previousDistance);
     $String = $Percentage != 0 ? sprintf("%+d", $Percentage) . ' %' : '-';
     $Stress = new Stresscolor($Percentage);
     $Stress->scale(0, 30);
     return ' <small style="display:inline-block;width:55px;color:#' . $Stress->rgb() . '">' . $String . '</small>';
 }
Beispiel #2
0
 /**
  * Get string for displaying JD points with stresscolor
  * @return string
  */
 public function jdIntensityWithStresscolor()
 {
     $Stress = new Stresscolor($this->Activity->jdIntensity());
     $Stress->scale(0, 50);
     return $Stress->string($this->Activity->jdIntensity());
 }
Beispiel #3
0
 /**
  * Compare distance to last set
  * @return string
  */
 private function distanceComparison()
 {
     if (!$this->compareKM) {
         return '';
     }
     $Percentage = $this->distanceComparisonPercentage();
     $String = $Percentage != 0 ? sprintf("%+d", $Percentage) . '&nbsp;&#37;' : '-';
     $this->kmOfLastSet = $this->Activity->distance();
     $Stress = new Stresscolor($Percentage);
     $Stress->scale(0, 30);
     return ' <small style="display:inline-block;width:55px;color:#' . $Stress->rgb() . '">' . $String . '</small>';
 }
 /**
  * Initialize line-data-array for 'TRIMP'
  * @param array $dat
  */
 private function initTRIMPData($dat)
 {
     $avg = $this->year != -1 ? 15 : 180;
     if ($dat['trimp'] == 0) {
         $text = NBSP;
     } else {
         $Stress = new Stresscolor($dat['trimp'] / $avg);
         $text = $Stress->string($dat['trimp']);
     }
     $this->TRIMPData[] = array('i' => $dat['i'], 'text' => $text);
 }