当前位置: 首页>>代码示例>>PHP>>正文


PHP Runalyze\Configuration类代码示例

本文整理汇总了PHP中Runalyze\Configuration的典型用法代码示例。如果您正苦于以下问题:PHP Configuration类的具体用法?PHP Configuration怎么用?PHP Configuration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Configuration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: column

 /**
  * Database key
  * @return string
  */
 public function column()
 {
     if (\Runalyze\Configuration::Vdot()->useElevationCorrection()) {
         return 'vdot_with_elevation';
     }
     return 'vdot';
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:11,代码来源:VdotIcon.php

示例2: testStaticMethod

 public function testStaticMethod()
 {
     Configuration::General()->temperatureUnit()->set(TemperatureUnit::CELSIUS);
     $unit = ' ' . Configuration::General()->TemperatureUnit()->unit();
     $this->assertEquals('10.0' . $unit, Temperature::format(10, true, 1));
     $this->assertEquals('12.35' . $unit, Temperature::format(12.3456, true, 2));
 }
开发者ID:Nugman,项目名称:Runalyze,代码行数:7,代码来源:TemperatureTest.php

示例3: initInternalObjects

 /**
  * Init pointer to DB/Error-object
  */
 protected function initInternalObjects()
 {
     parent::initInternalObjects();
     if (!\Runalyze\Configuration::Privacy()->showPrivateActivitiesInList()) {
         $this->DatasetQuery->showOnlyPublicActivities();
     }
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:10,代码来源:class.DataBrowserShared.php

示例4: 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'];
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:11,代码来源:Context.php

示例5: addTo

 /**
  * Add to plot
  * @param \Plot $Plot
  * @param int $yAxis
  * @param boolean $addAnnotations [optional]
  */
 public function addTo(Plot &$Plot, $yAxis, $addAnnotations = true)
 {
     if (empty($this->Data)) {
         return;
     }
     parent::addTo($Plot, $yAxis, $addAnnotations);
     switch ($this->XAxis) {
         case DataCollector::X_AXIS_DISTANCE:
             $Plot->setXUnitFactor(Configuration::General()->distanceUnitSystem()->distanceToPreferredUnitFactor(), Configuration::General()->distanceUnitSystem()->distanceUnit());
             $stepSize = Configuration::General()->distanceUnitSystem()->distanceToKmFactor();
             if ($stepSize != round($stepSize)) {
                 end($this->Data);
                 $totalDistanceInKm = key($this->Data);
                 while ($totalDistanceInKm / $stepSize > 15) {
                     $stepSize *= 2;
                 }
                 while ($totalDistanceInKm / $stepSize < 4) {
                     $stepSize /= 2;
                 }
                 $Plot->Options['xaxis']['tickSize'] = $stepSize;
             }
             break;
         case DataCollector::X_AXIS_TIME:
             $Plot->setXAxisAsTime();
             $Plot->setXAxisTimeFormat("%h:%M:%S");
             $Plot->Options['xaxis']['ticks'] = 5;
             break;
         case DataCollector::X_AXIS_INDEX:
             $Plot->hideXLabels();
     }
 }
开发者ID:rob-st,项目名称:Runalyze,代码行数:37,代码来源:ActivitySeries.php

示例6: nextDistance

 /**
  * Move Distance
  * @return bool
  */
 public function nextDistance()
 {
     if (Configuration::General()->distanceUnitSystem()->isImperial()) {
         return $this->nextMile();
     }
     return $this->nextKilometer();
 }
开发者ID:rob-st,项目名称:Runalyze,代码行数:11,代码来源:Loop.php

示例7: parseGeneralValues

 /**
  * Parse general values
  */
 protected function parseGeneralValues()
 {
     $this->TrainingObject->setTimestamp(strtotime((string) $this->XML['StartTime']));
     if (!empty($this->XML['categoryName'])) {
         $this->guessSportID((string) $this->XML['categoryName']);
     } else {
         $this->TrainingObject->setSportid(Configuration::General()->mainSport());
     }
     if (!empty($this->XML->Duration['TotalSeconds'])) {
         $this->TrainingObject->setTimeInSeconds(round((double) $this->XML->Duration['TotalSeconds']));
     }
     if (!empty($this->XML->Distance['TotalMeters'])) {
         $this->TrainingObject->setDistance(round((double) $this->XML->Distance['TotalMeters']) / 1000);
     }
     if (!empty($this->XML->Calories['TotalCal'])) {
         $this->TrainingObject->setCalories((int) $this->XML->Calories['TotalCal']);
     }
     if (!empty($this->XML->Location['Name'])) {
         $this->TrainingObject->setRoute((string) $this->XML->Location['Name']);
     }
     if (!empty($this->XML->Weather['Temp'])) {
         $this->TrainingObject->setTemperature((int) $this->XML->Weather['Temp']);
     }
     if (!empty($this->XML->HeartRateMaximumBPM)) {
         $this->TrainingObject->setPulseMax((int) $this->XML->HeartRateMaximumBPM);
     }
     if (!empty($this->XML->HeartRateAverageBPM)) {
         $this->TrainingObject->setPulseAvg((int) $this->XML->HeartRateAverageBPM);
     }
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:33,代码来源:class.ParserFITLOGSingle.php

示例8: parseGeneralValues

 /**
  * Parse general values
  */
 protected function parseGeneralValues()
 {
     $this->TrainingObject->setTimestamp(strtotime((string) $this->XML->GeneralInformation->startDate));
     $this->TrainingObject->setCalories((int) $this->XML->GeneralInformation->calories);
     $this->TrainingObject->setSportid(Configuration::General()->mainSport());
     $this->TrainingObject->setCreatorDetails($this->findCreator());
     $this->TrainingObject->setComment((string) $this->XML->GeneralInformation->name);
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:11,代码来源:class.ParserSLF4Single.php

示例9: prepare

 /**
  * Prepare summary
  */
 protected function prepare()
 {
     $this->Title = __('All years');
     $this->Timerange = 366 * DAY_IN_S;
     $this->TimeEnd = mktime(23, 59, 59, 12, 31, date('Y'));
     $this->TimeStart = mktime(0, 0, 1, 1, 1, date('Y', START_TIME));
     $this->AdditionalColumns = 1 * ($this->Sportid == Configuration::General()->runningSport());
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:11,代码来源:class.SummaryTableAllYears.php

示例10: testStaticMethod

 public function testStaticMethod()
 {
     Configuration::General()->weightUnit()->set(WeightUnit::KG);
     $unit = '&nbsp;' . Configuration::General()->weightUnit()->unit();
     $this->assertEquals('10.0' . $unit, Weight::format(10, true, 1));
     $this->assertEquals('12.346' . $unit, Weight::format(12.3456, true, 3));
     $this->assertEquals('12.3', Weight::format(12.3456, false, 1));
 }
开发者ID:9x,项目名称:Runalyze,代码行数:8,代码来源:WeightTest.php

示例11: parseGeneralValues

 /**
  * Parse general values
  */
 protected function parseGeneralValues()
 {
     $this->TrainingObject->setTimestamp(strtotime((string) $this->XML->DeviceLog->Header->DateTime));
     if (!empty($this->XML->DeviceLog->Header->Activity)) {
         $this->guessSportID((string) $this->XML->DeviceLog->Header->Activity);
     } else {
         $this->TrainingObject->setSportid(Configuration::General()->runningSport());
     }
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:12,代码来源:class.ParserSMLsuuntoSingle.php

示例12: before

 /**
  * Tasks before insertion
  */
 protected function before()
 {
     parent::before();
     $Calculator = new Calculator($this->Object);
     if (Configuration::ActivityForm()->correctElevation() && !$this->Object->hasCorrectedElevations()) {
         $Calculator->tryToCorrectElevation();
     }
     $Calculator->calculateElevation();
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:12,代码来源:Inserter.php

示例13: manipulateData

 /**
  * Manipulate data
  */
 protected function manipulateData()
 {
     $UnitSystem = Configuration::General()->distanceUnitSystem();
     if ($UnitSystem->isImperial()) {
         $this->Data = array_map(function ($value) {
             return $value * DistanceUnitSystem::FEET_MULTIPLIER / 1000 / 100;
         }, $this->Data);
     }
 }
开发者ID:9x,项目名称:Runalyze,代码行数:12,代码来源:StrideLength.php

示例14: __construct

 /**
  * Create series
  * @var \Runalyze\View\Activity\Context $context
  */
 public function __construct(Activity\Context $context)
 {
     $this->isRunning = $context->activity()->sportid() == Configuration::General()->runningSport();
     $cadence = $this->isRunning ? new CadenceUnitRunning(0) : new CadenceUnit(0);
     $this->initOptions();
     $this->initData($context->trackdata(), Trackdata::CADENCE);
     $this->initStrings($cadence);
     $this->manipulateData($cadence);
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:13,代码来源:Cadence.php

示例15: initAllSports

 /**
  * Initialize internal sports-array from database
  */
 private static function initAllSports()
 {
     self::$AllSports = array();
     $sports = self::cacheAllSports();
     foreach ($sports as $sport) {
         self::$AllSports[(string) $sport['id']] = $sport;
     }
     Configuration::ActivityForm()->orderSports()->sort(self::$AllSports);
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:12,代码来源:class.SportFactory.php


注:本文中的Runalyze\Configuration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。