Beispiel #1
0
 foreach ($Data as $dat) {
     $index = $dat['index'] + $AddDays;
     $Trimps_raw[$index] = 1 * $dat['trimp'];
     if ($dat['vdot'] != 0) {
         $VDOTs_raw[$index] = $dat['vdot'];
         // Remember: These values are already multiplied with `s`
         $Durations_raw[$index] = (double) $dat['s'];
     }
 }
 $StartDayInYear = $All || $lastHalf || $lastYear ? Time::diffInDays($StartTime, mktime(0, 0, 0, 1, 1, $StartYear)) + 1 : 0;
 $LowestIndex = $AddDays + 1;
 $HighestIndex = $AddDays + 1 + $NumberOfDays;
 $VDOTdays = Configuration::Vdot()->days();
 $ATLdays = Configuration::Trimp()->daysForATL();
 $CTLdays = Configuration::Trimp()->daysForCTL();
 $TSBModel = new Runalyze\Calculation\Performance\TSB($Trimps_raw, $CTLdays, $ATLdays);
 $TSBModel->calculate();
 if ($All) {
     $maxATL = $TSBModel->maxFatigue();
     $maxCTL = $TSBModel->maxFitness();
     if ($maxATL != Configuration::Data()->maxATL()) {
         Configuration::Data()->updateMaxATL($maxATL);
     }
     if ($maxCTL != Configuration::Data()->maxCTL()) {
         Configuration::Data()->updateMaxCTL($maxCTL);
     }
 } else {
     $maxATL = Configuration::Data()->maxATL();
     $maxCTL = Configuration::Data()->maxCTL();
 }
 if (!Configuration::Trimp()->showInPercent()) {
Beispiel #2
0
         $VDOTs_raw[$index] = $dat['vdot'];
         // Remember: These values are already multiplied with `s`
         $Durations_raw[$index] = (double) $dat['s'];
     }
 }
 $TodayIndex = Time::diffInDays($StartTime) + $AddDays;
 $StartDayInYear = $All || $lastHalf || $lastYear ? Time::diffInDays($StartTime, mktime(0, 0, 0, 1, 1, $StartYear)) + 1 + 1 * ($StartYear < $Year) : 1;
 $LowestIndex = $AddDays + 1;
 $HighestIndex = $AddDays + 1 + $NumberOfDays;
 $VDOTdays = Configuration::Vdot()->days();
 $ATLdays = Configuration::Trimp()->daysForATL();
 $CTLdays = Configuration::Trimp()->daysForCTL();
 if ($perfmodel == 'banister') {
     $performanceModel = new Runalyze\Calculation\Performance\Banister($Trimps_raw, $CTLdays, $ATLdays, 1, 3);
 } else {
     $performanceModel = new Runalyze\Calculation\Performance\TSB($Trimps_raw, $CTLdays, $ATLdays);
 }
 $performanceModel->calculate();
 if ($All) {
     $maxATL = $performanceModel->maxFatigue();
     $maxCTL = $performanceModel->maxFitness();
     if ($perfmodel == 'tsb' && $maxATL != Configuration::Data()->maxATL()) {
         Configuration::Data()->updateMaxATL($maxATL);
     }
     if ($perfmodel == 'tsb' && $maxCTL != Configuration::Data()->maxCTL()) {
         Configuration::Data()->updateMaxCTL($maxCTL);
     }
 } else {
     $maxATL = Configuration::Data()->maxATL();
     $maxCTL = Configuration::Data()->maxCTL();
 }