本文整理汇总了PHP中Runalyze\Configuration::Data方法的典型用法代码示例。如果您正苦于以下问题:PHP Configuration::Data方法的具体用法?PHP Configuration::Data怎么用?PHP Configuration::Data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Runalyze\Configuration
的用法示例。
在下文中一共展示了Configuration::Data方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Athlete
/**
* Athlete
* @return \Runalyze\Athlete
*/
public static function Athlete()
{
if (!isset(self::$Objects['athlete'])) {
self::$Objects['athlete'] = new Athlete(Configuration::General()->gender(), Configuration::Data()->HRmax(), Configuration::Data()->HRrest(), null, null, Configuration::Data()->vdot());
}
return self::$Objects['athlete'];
}
示例2: setManipulationFactor
/**
* Set manipulation facotr
*/
protected function setManipulationFactor()
{
$this->Factor = 1;
$this->HRmax = Configuration::Data()->HRmax();
$this->HRrest = Configuration::Data()->HRrest();
if (\Runalyze\Context::Athlete()->knowsMaximalHeartRate() && !Configuration::General()->heartRateUnit()->isBPM()) {
if (\Runalyze\Context::Athlete()->knowsRestingHeartRate() && Configuration::General()->heartRateUnit()->isHRreserve()) {
$this->Factor = false;
} else {
$this->Factor = 100 / Configuration::Data()->HRmax();
}
}
}
示例3: setDirectionBasedOn
/**
* Set direction
* @param float $vdotValue
* @param float $currentShape
*/
protected function setDirectionBasedOn($vdotValue, $currentShape)
{
// TODO
if (is_null($currentShape)) {
$currentShape = Configuration::Data()->vdot();
}
$diff = $vdotValue - $currentShape;
if ($diff > 3) {
$this->setUp();
} elseif ($diff > 1) {
$this->setUpHalf();
} elseif ($diff > -1) {
$this->setRight();
} elseif ($diff > -3) {
$this->setDownHalf();
} else {
$this->setDown();
}
}
示例4: getFieldsetPaces
/**
* Get fieldset for paces
* @return \FormularFieldset
*/
public function getFieldsetPaces()
{
$Table = '<table class="fullwidth zebra-style">
<thead>
<tr>
<th>' . __('Name') . '</th>
<th class="small">' . __('Pace') . '</th>
<th class="small">' . __('Description') . '</th>
</tr>
</thead>
<tbody>';
$VDOT = new VDOT(Configuration::Data()->vdot());
foreach ($this->getArrayForPaces() as $Pace) {
$Table .= '<tr>
<td class="b">' . $Pace['short'] . '</td>
<td class=""><em>' . Duration::format($VDOT->paceAt($Pace['limit-low'] / 100)) . '</em> - <em>' . Duration::format($VDOT->paceAt($Pace['limit-high'] / 100)) . '</em>/km</td>
<td class="">' . $Pace['description'] . '</td>
</tr>';
}
$Table .= '
</tbody>
</table>';
$Fieldset = new FormularFieldset(__('Training paces'));
$Fieldset->addBlock($Table);
$Fieldset->addInfo(__('These paces are based on Jack Daniels\' recommendation.'));
return $Fieldset;
}
示例5: Plot
$index = Plot::dayOfYearToJStime($StartYear, $d - $AddDays + $StartDayInYear + 1);
$ATLs[$index] = 100 * $TSBModel->fatigueAt($d - 1) / $maxATL;
$CTLs[$index] = 100 * $TSBModel->fitnessAt($d - 1) / $maxCTL;
$TRIMPs[$index] = $Trimps_raw[$d];
if ($maxTrimp < $Trimps_raw[$d]) {
$maxTrimp = $Trimps_raw[$d];
}
$VDOT_slice = array_slice($VDOTs_raw, $d - $VDOTdays, $VDOTdays);
$Durations_slice = array_slice($Durations_raw, $d - $VDOTdays, $VDOTdays);
$VDOT_sum = array_sum($VDOT_slice);
$Durations_sum = array_sum($Durations_slice);
if (count($VDOT_slice) != 0 && $Durations_sum != 0) {
$VDOTs[$index] = Configuration::Data()->vdotFactor() * ($VDOT_sum / $Durations_sum);
}
if ($VDOTs_raw[$d]) {
$VDOTsday[$index] = Configuration::Data()->vdotFactor() * ($VDOTs_raw[$d] / $Durations_raw[$d]);
}
}
} else {
$DataFailed = true;
}
$Plot = new Plot("form" . $_GET['y'], 800, 450);
$Plot->Data[] = array('label' => __('Fitness (CTL)'), 'color' => '#008800', 'data' => $CTLs);
//if (count($ATLs) < $MaxATLPoints)
$Plot->Data[] = array('label' => __('Fatigue (ATL)'), 'color' => '#CC2222', 'data' => $ATLs);
$Plot->Data[] = array('label' => __('avg VDOT'), 'color' => '#000000', 'data' => $VDOTs, 'yaxis' => 2);
$Plot->Data[] = array('label' => 'TRIMP', 'color' => '#5555FF', 'data' => $TRIMPs, 'yaxis' => 3);
$Plot->Data[] = array('label' => __('day VDOT'), 'color' => '#444444', 'data' => $VDOTsday, 'yaxis' => 2);
$Plot->setMarginForGrid(5);
$Plot->setLinesFilled(array(0));
$Plot->setLinesFilled(array(1), 0.3);
示例6: prognosisByHRafterCorrection
/**
* Prognosis time by heart rate after correction
* @return string
*/
public function prognosisByHRafterCorrection()
{
if (Configuration::Vdot()->useCorrectionFactor()) {
$Prognosis = new Daniels();
$Prognosis->adjustVDOT(false);
$Prognosis->setVDOT(Configuration::Data()->vdotFactor() * $this->Activity->vdotByHeartRate());
return $this->formatTime($Prognosis->inSeconds($this->Activity->distance()));
}
return '-';
}
示例7: getExampleTraining
/**
* Get array for exemplary training data
* @return array
*/
protected function getExampleTraining()
{
$ClothesID = $this->getRandIdFor('clothes');
$ShoeID = $this->getRandIdFor('shoe');
$Data = array('id' => DataObject::$DEFAULT_ID, 'sportid' => Configuration::General()->runningSport(), 'typeid' => Configuration::General()->competitionType(), 'time' => time(), 'created' => time(), 'edited' => time(), 'is_public' => 1, 'is_track' => 1, 'distance' => 10, 's' => 51 * 60 + 27, 'elevation' => 57, 'kcal' => 691, 'pulse_avg' => 186, 'pulse_max' => 193, 'vdot_with_elevation' => Configuration::Data()->vdot() + 1, 'vdot' => Configuration::Data()->vdot() + 2, 'use_vdot' => 0, 'jd_intensity' => 27, 'trimp' => 121, 'cadence' => 90, 'stride_length' => 108, 'groundcontact' => 220, 'vertical_oscillation' => 76, 'power' => 520, 'temperature' => 17, 'weatherid' => 5, 'clothes' => $ClothesID, 'splits' => '5|26:51-5|24:36', 'comment' => str_replace(' ', ' ', __('Test activity')), 'partner' => 'Peter', 'abc' => 1, 'shoeid' => $ShoeID, 'notes' => str_replace(' ', ' ', __('Great run!')), 'accountid' => SessionAccountHandler::getId(), 'creator' => '', 'creator_details' => '', 'activity_id' => '', 'elevation_corrected' => 1);
return $Data;
}
示例8: foreach
$withElevation = Configuration::Vdot()->useElevationCorrection();
$Data = DB::getInstance()->query('
SELECT
YEAR(FROM_UNIXTIME(`time`)) as `y`,
MONTH(FROM_UNIXTIME(`time`)) as `m`,
SUM(' . JD\Shape::mysqlVDOTsum($withElevation) . ')/SUM(' . JD\Shape::mysqlVDOTsumTime($withElevation) . ') as `vdot`
FROM `' . PREFIX . 'training`
WHERE
`vdot`>0 AND use_vdot<>0
GROUP BY `y`, `m`
ORDER BY `y` ASC, `m` ASC')->fetchAll();
Cache::set('prognosePlotData', $Data, '300');
}
foreach ($Data as $dat) {
// TODO: use correct GA
$Strategy->setVDOT(Configuration::Data()->vdotFactor() * $dat['vdot']);
$index = mktime(1, 0, 0, $dat['m'], 15, $dat['y']);
$Prognosis[$index . '000'] = $PrognosisObj->inSeconds($distance) * 1000;
}
$ResultsData = Cache::get('prognosePlotDistanceData' . $distance);
if (is_null($ResultsData)) {
$ResultsData = DB::getInstance()->query('
SELECT
`time`,
`id`,
`s`
FROM `' . PREFIX . 'training`
WHERE
`typeid`="' . Configuration::General()->competitionType() . '"
AND `distance`="' . $distance . '"
ORDER BY
示例9: updateVDOTshapeAndCorrector
/**
* Update vdot shape and corrector
*/
protected function updateVDOTshapeAndCorrector()
{
$timestampLimit = time() - Configuration::Vdot()->days() * DAY_IN_S;
if ($this->Object->usesVDOT() && $this->Object->vdotByHeartRate() > 0 && $this->Object->timestamp() > $timestampLimit) {
Configuration::Data()->recalculateVDOTshape();
if ($this->Object->typeid() == Configuration::General()->competitionType()) {
Configuration::Data()->recalculateVDOTcorrector();
}
}
}
示例10: getFieldsetPaces
/**
* Get fieldset for paces
* @return \FormularFieldset
*/
public function getFieldsetPaces()
{
$Table = '<table class="fullwidth zebra-style">
<thead>
<tr>
<th>' . __('Name') . '</th>
<th class="small">' . __('Pace') . '</th>
<th class="small">' . __('Description') . '</th>
</tr>
</thead>
<tbody>';
$VDOT = new VDOT(Configuration::Data()->vdot());
$PaceObject = new Runalyze\Activity\Pace(0, 1, SportFactory::getSpeedUnitFor(Configuration::General()->runningSport()));
foreach ($this->getArrayForPaces() as $Pace) {
$Table .= '<tr>
<td class="b">' . $Pace['short'] . '</td>
<td class=""><em>' . $PaceObject->setTime($VDOT->paceAt($Pace['limit-high'] / 100))->value() . '</em> - <em>' . $PaceObject->setTime($VDOT->paceAt($Pace['limit-low'] / 100))->value() . '</em>' . $PaceObject->appendix() . '</td>
<td class="">' . $Pace['description'] . '</td>
</tr>';
}
$Table .= '
</tbody>
</table>';
$Fieldset = new FormularFieldset(__('Training paces'));
$Fieldset->addBlock($Table);
$Fieldset->addInfo(__('These paces are based on Jack Daniels\' recommendation.'));
return $Fieldset;
}
示例11: recalculateHFrest
/**
* Recalculate HF_REST
*/
public static function recalculateHFrest()
{
$HF_REST = self::calculateHFrest();
Configuration::Data()->updateHRrest($HF_REST);
return $HF_REST;
}
示例12: if
</td>
<?php
}
?>
<?php
}
?>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
echo Ajax::wrapJS('$("#jd-tables-prognosis td.b").each(function(){ if ($(this).text() == \'' . round(Configuration::Data()->vdot()) . '\') $(this).parent().addClass("highlight"); });');
?>
<p class="info">
<?php
_e('This table is computed by some formulas, derived from the tables in Jack Daniels\' Running formula.');
?>
<?php
_e('These values do not fit the original table one hundred percent.');
?>
</p>
<p class="info">
<?php
_e('This table does <strong>not</strong> use a correction based on your current basic endurance.');
?>
示例13: setupFromDatabase
/**
* Running setup from database
*/
public function setupFromDatabase()
{
$this->setVDOT(Configuration::Data()->vdot());
$this->adjustVDOT(true);
$this->setBasicEnduranceForAdjustment(BasicEndurance::getConst());
}
示例14: initVDOTData
/**
* Initialize line-data-array for 'VDOT'
* @param array $dat
*/
private function initVDOTData($dat)
{
$VDOT = isset($dat['vdot']) ? Configuration::Data()->vdotFactor() * $dat['vdot'] : 0;
$text = $VDOT == 0 ? NBSP : number_format($VDOT, 1);
$this->VDOTData[] = array('i' => $dat['i'], 'text' => $text);
}
示例15: defineConsts
/**
* Init constants
*/
private function defineConsts()
{
require_once FRONTEND_PATH . 'system/define.consts.php';
Configuration::loadAll();
\Runalyze\Calculation\JD\VDOTCorrector::setGlobalFactor(Configuration::Data()->vdotFactor());
require_once FRONTEND_PATH . 'class.Helper.php';
}