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


PHP Configuration::ActivityView方法代码示例

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


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

示例1: setContent

 /**
  * Set content
  */
 protected function setContent()
 {
     $showElevation = Configuration::ActivityView()->plotMode()->showCollection();
     if (Configuration::ActivityView()->plotMode()->showCollection() && Configuration::ActivityView()->mapFirst()) {
         $this->BoxedValues[] = new Box\Distance($this->Context);
         $this->BoxedValues[] = new BoxedValue($this->Context->dataview()->duration()->string(), '', __('Time'));
     }
     $this->addAveragePace();
     $this->addCalculations();
     $this->addAverageHeartrate();
     $this->addMaximalHeartrate();
     $this->addCaloriesAndTrimp();
     if ($showElevation) {
         $this->addElevation();
     }
     if (Configuration::ActivityView()->plotMode()->showCollection() && Configuration::ActivityView()->mapFirst()) {
         $this->BoxedValues[] = new BoxedValue($this->Context->dataview()->elapsedTime(), '', __('Elapsed time'));
     }
     foreach ($this->BoxedValues as &$Value) {
         $Value->defineAsFloatingBlock('w50');
     }
     if ($showElevation) {
         $this->addCourse();
     }
     $this->addVdotInfoLink();
     if ($showElevation && $this->Context->hasRoute() && $this->Context->route()->hasElevations()) {
         $this->addElevationInfoLink();
     }
 }
开发者ID:9x,项目名称:Runalyze,代码行数:32,代码来源:class.SectionCompositeRow.php

示例2: __construct

 /**
  * Construct collector
  * @param \Runalyze\Model\Trackdata\Entity $trackdata
  * @param int $key
  * @param \Runalyze\Model\Swimdata\Entity $swimdata
  * @throws \InvalidArgumentException
  */
 public function __construct(Trackdata $trackdata, $key, Swimdata $swimdata)
 {
     if (!$swimdata->has($key)) {
         throw new \InvalidArgumentException('Swimdata has no data for "' . $key . '".');
     }
     $this->Key = $key;
     $this->Precision = Configuration::ActivityView()->plotPrecision();
     $this->KnowsDistance = $trackdata->has(Trackdata::DISTANCE);
     $this->init($trackdata);
     $this->LoopSwimdata = new Loop($swimdata);
     $this->collect();
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:19,代码来源:DataCollectorWithSwimdata.php

示例3: display

 /**
  * Display
  */
 public final function display()
 {
     if (\Runalyze\Configuration::ActivityView()->showSectionsFullheight()) {
         $this->big = true;
         $this->withShadow = false;
     }
     echo '<div class="training-row">';
     if ($this->withShadow) {
         echo '<div class="training-row-info-shadow"></div>';
     }
     $this->displayInfo();
     $this->displayPlot();
     echo '</div>';
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:17,代码来源:class.TrainingViewSectionRow.php

示例4: convertData

 /**
  * Convert internal data to correct array for JSON
  */
 private function convertData()
 {
     foreach ($this->Data as $i => $Data) {
         $Points = array();
         foreach ($Data['data'] as $x => $y) {
             $Points[] = array($x, $y);
         }
         $this->Data[$i]['data'] = $Points;
     }
     if (Configuration::ActivityView()->smoothCurves() && !isset($this->Options['series']['curvedLines']['apply'])) {
         $this->Options['series']['curvedLines']['apply'] = true;
     }
     if (empty($this->Data) && strlen($this->ErrorString) == 0) {
         $this->raiseError('Es sind keine Daten vorhanden.');
     }
 }
开发者ID:rob-st,项目名称:Runalyze,代码行数:19,代码来源:class.Plot.php

示例5: initSections

 /**
  * Init sections
  */
 protected function initSections()
 {
     if (Configuration::ActivityView()->mapFirst() && Configuration::ActivityView()->plotMode()->showCollection()) {
         $this->Sections[] = new SectionComposite($this->Context);
         $this->Sections[] = new SectionLaps($this->Context);
     } else {
         $this->Sections[] = new SectionOverview($this->Context);
         if (Configuration::ActivityView()->mapFirst()) {
             $this->Sections[] = new SectionRouteOnlyMap($this->Context);
         } else {
             $this->Sections[] = new SectionLaps($this->Context);
         }
         $this->Sections[] = new SectionSwimLane($this->Context);
         if (Configuration::ActivityView()->plotMode()->showSeperated()) {
             $this->Sections[] = new SectionHeartrate($this->Context);
             $this->Sections[] = new SectionPace($this->Context);
             if (Configuration::ActivityView()->mapFirst()) {
                 $this->Sections[] = new SectionRouteOnlyElevation($this->Context);
             } else {
                 $this->Sections[] = new SectionRoute($this->Context);
             }
         } else {
             $this->Sections[] = new SectionComposite($this->Context);
             if (Configuration::ActivityView()->plotMode()->showPaceAndHR()) {
                 if (Configuration::ActivityView()->mapFirst()) {
                     $this->Sections[] = new SectionRouteOnlyElevation($this->Context);
                 } else {
                     $this->Sections[] = new SectionRoute($this->Context);
                 }
             } else {
                 if (!Configuration::ActivityView()->mapFirst()) {
                     $this->Sections[] = new SectionRouteOnlyMap($this->Context);
                 }
             }
         }
         if (Configuration::ActivityView()->mapFirst()) {
             $this->Sections[] = new SectionLaps($this->Context);
         }
     }
     if ($this->Context->trackdata()->has(\Runalyze\Model\Trackdata\Object::CADENCE) && $this->Context->sport()->id() == Configuration::General()->runningSport() || $this->Context->trackdata()->has(\Runalyze\Model\Trackdata\Object::GROUNDCONTACT) || $this->Context->trackdata()->has(\Runalyze\Model\Trackdata\Object::VERTICAL_OSCILLATION)) {
         $this->Sections[] = new SectionRunningDynamics($this->Context);
         $this->Sections[] = new SectionMiscellaneous($this->Context, false);
     } else {
         $this->Sections[] = new SectionMiscellaneous($this->Context, true);
     }
     if ($this->Context->hasHRV()) {
         $this->Sections[] = new SectionHRV($this->Context);
     }
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:52,代码来源:class.TrainingView.php

示例6: allCategories

 /**
  * All categories
  * @return ConfigurationCategory[]
  */
 private function allCategories()
 {
     return array(Configuration::General(), Configuration::Privacy(), Configuration::ActivityView(), Configuration::ActivityForm(), Configuration::Design(), Configuration::DataBrowser(), Configuration::Vdot(), Configuration::Trimp(), Configuration::BasicEndurance(), Configuration::Misc());
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:8,代码来源:class.ConfigTabGeneral.php

示例7: js

 /**
  * Get JS
  * @return string
  */
 public function js()
 {
     $scrollOnZoom = Configuration::ActivityView()->mapZoomOnScroll();
     $Code = 'RunalyzeLeaflet.setDefaultLayer("' . Configuration::ActivityView()->mapLayer() . '");';
     $Code .= 'RunalyzeLeaflet.init(\'' . $this->id . '\', { scrollWheelZoom: ' . ($scrollOnZoom ? 'true' : 'false') . '} );';
     foreach ($this->Routes as $Route) {
         $Code .= $Route->js();
     }
     if (!empty($this->Bounds)) {
         $Code .= 'RunalyzeLeaflet.map().fitBounds([[' . $this->Bounds['lat.min'] . ',' . $this->Bounds['lng.min'] . '],[' . $this->Bounds['lat.max'] . ',' . $this->Bounds['lng.max'] . ']]);';
     }
     if (!empty($this->Routes)) {
         $Code .= 'RunalyzeLeaflet.Routes.routeid="' . $this->Routes[0]->id() . '";';
     }
     return '<script>' . $Code . '</script>';
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:20,代码来源:Map.php

示例8: distance

 /**
  * Get distance
  * @return string
  */
 public function distance($decimals = null)
 {
     if (is_null($decimals)) {
         $decimals = Configuration::ActivityView()->decimals();
     }
     if ($this->Activity->distance() > 0) {
         if ($this->Activity->isTrack()) {
             return (new Distance($this->Activity->distance()))->stringMeter();
         }
         return Distance::format($this->Activity->distance(), true, $decimals);
     }
     return '';
 }
开发者ID:rob-st,项目名称:Runalyze,代码行数:17,代码来源:Dataview.php

示例9: addElevation

 /**
  * Add: elevation
  */
 protected function addElevation()
 {
     if ($this->Context->activity()->distance() > 0 || $this->Context->activity()->elevation() > 0) {
         if ($this->Context->activity()->distance() > 0 && !(Configuration::ActivityView()->plotMode()->showCollection() && Configuration::ActivityView()->mapFirst())) {
             $this->BoxedValues[] = new Box\Distance($this->Context);
         }
         $this->BoxedValues[] = new Box\Elevation($this->Context);
         // TODO: Calculated elevation?
         if ($this->Context->activity()->elevation() > 0) {
             if ($this->Context->activity()->distance() > 0) {
                 $this->BoxedValues[] = new Box\Gradient($this->Context);
             }
             $this->BoxedValues[] = new Box\ElevationUpDown($this->Context);
         }
     }
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:19,代码来源:class.SectionCompositeRow.php

示例10: checkForPause

 /**
  * Check for pause
  */
 protected function checkForPause()
 {
     if (!is_null($this->Trackdata) && $this->Trackdata->hasPauses()) {
         if ($this->PauseIndex < $this->Trackdata->pauses()->num() && $this->Trackdata->pauses()->at($this->PauseIndex)->time() <= $this->Trackdata->at($this->TrackdataLoop->index(), Trackdata\Entity::TIME)) {
             $this->addCurrentPauseIcon();
             $this->PathShouldBreak = true;
             $this->PauseIndex++;
         }
     } elseif (!Configuration::ActivityView()->routeBreak()->never() && $this->RouteLoop->calculatedStepDistance() > $this->PauseLimit) {
         $this->addCurrentSegment();
     }
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:15,代码来源:Activity.php

示例11: __construct

 /**
  * Constructor
  * 
  * If no options are set, the current configuration settings are used.
  * 
  * @param array $ElevationPoints
  * @param \Runalyze\Parameter\Application\ElevationMethod $Method [optional]
  * @param int $Threshold [optional]
  */
 public function __construct($ElevationPoints, ElevationMethod $Method = null, $Threshold = null)
 {
     $this->ElevationPoints = $ElevationPoints;
     $this->Method = !is_null($Method) ? $Method : Configuration::ActivityView()->elevationMethod();
     $this->Threshold = !is_null($Threshold) ? $Threshold : Configuration::ActivityView()->elevationMinDiff();
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:15,代码来源:Calculator.php

示例12: getDifferentAlgorithmsFor

 /**
  * Get different algorithms for
  * @param array $array
  * @return string
  */
 protected function getDifferentAlgorithmsFor($array)
 {
     $Method = new ElevationMethod();
     $Calculator = new Elevation\Calculation\Calculator($array);
     $TresholdRange = range(1, 10);
     $Algorithms = array(array(ElevationMethod::NONE, false), array(ElevationMethod::THRESHOLD, true), array(ElevationMethod::DOUGLAS_PEUCKER, true));
     $Code = '<table class="fullwidth zebra-style small">';
     $Code .= '<thead>';
     $Code .= '<tr><th class="r">' . __('Threshold') . ':</th>';
     foreach ($TresholdRange as $t) {
         $Code .= '<th>' . $t . '</th>';
     }
     $Code .= '</tr>';
     $Code .= '</thead>';
     $Code .= '<tbody>';
     foreach ($Algorithms as $Algorithm) {
         $Method->set($Algorithm[0]);
         $Calculator->setMethod($Method);
         $Code .= '<tr><td class="b">' . $Method->valueAsLongString() . '</td>';
         if ($Algorithm[1]) {
             foreach ($TresholdRange as $t) {
                 $highlight = Configuration::ActivityView()->elevationMinDiff() == $t && Configuration::ActivityView()->elevationMethod()->value() == $Algorithm[0] ? ' highlight' : '';
                 $Calculator->setThreshold($t);
                 $Calculator->calculate();
                 $Code .= '<td class="r' . $highlight . '">' . $Calculator->totalElevation() . '&nbsp;m</td>';
             }
         } else {
             $Calculator->calculate();
             $Code .= '<td class="c' . (Configuration::ActivityView()->elevationMethod()->value() == $Algorithm[0] ? ' highlight' : '') . '" colspan="' . count($TresholdRange) . '">' . $Calculator->totalElevation() . '&nbsp;m</td>';
         }
         $Code .= '</tr>';
     }
     $Code .= '</tbody>';
     $Code .= '</table>';
     return $Code;
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:41,代码来源:class.ElevationInfo.php

示例13: setGeneralInfo

 /**
  * Set general info
  */
 protected function setGeneralInfo()
 {
     $this->XML->Folder->name = $this->nameForKml();
     $this->XML->Folder->Placemark->name = $this->nameForKml();
     $this->XML->Folder->Placemark->Style->geomColor = self::rgbToKmlColor(Configuration::ActivityView()->routeColor());
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:9,代码来源:Kml.php

示例14: constructPlotDataFor

 /**
  * Construct plot data
  * @param enum $algorithm
  * @param int $treshold
  * @return array
  */
 protected function constructPlotDataFor($algorithm, $treshold = false)
 {
     $Method = new ElevationMethod();
     $Method->set($algorithm);
     if ($treshold === false) {
         $treshold = Configuration::ActivityView()->elevationMinDiff();
     }
     $Calculator = new Data\Elevation\Calculation\Calculator($this->Context->route()->elevations());
     $Calculator->setMethod($Method);
     $Calculator->setThreshold($treshold);
     $Calculator->calculate();
     $i = 0;
     $Data = array();
     $Points = $Calculator->strategy()->smoothedData();
     $Indices = $Calculator->strategy()->smoothingIndices();
     $hasDistances = $this->Context->trackdata()->get(Trackdata\Entity::DISTANCE);
     $Distances = $this->Context->trackdata()->get(Trackdata\Entity::DISTANCE);
     $Times = $this->Context->trackdata()->get(Trackdata\Entity::TIME);
     $num = $this->Context->trackdata()->num();
     foreach ($Indices as $i => $index) {
         if ($index >= $num) {
             $index = $num - 1;
         }
         if ($hasDistances) {
             $Data[(string) $Distances[$index]] = $Points[$i];
         } else {
             $Data[(string) $Times[$index] . '000'] = $Points[$i];
         }
     }
     $this->manipulateData($Data);
     return $Data;
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:38,代码来源:ElevationAlgorithms.php

示例15: defineXAxis

 /**
  * Define x-axis
  * @param \Runalyze\Model\Trackdata\Entity $trackdata
  */
 protected function defineXAxis(Trackdata $trackdata)
 {
     if (Configuration::ActivityView()->usesTimeAsXAxis() && $trackdata->has(Trackdata::TIME) && $trackdata->totalTime() > 0) {
         $this->XAxis = self::X_AXIS_TIME;
     } elseif ($trackdata->has(Trackdata::DISTANCE) && $trackdata->totalDistance() > 0) {
         $this->XAxis = self::X_AXIS_DISTANCE;
     } elseif ($trackdata->has(Trackdata::TIME) && $trackdata->totalTime() > 0) {
         $this->XAxis = self::X_AXIS_TIME;
     } else {
         $this->XAxis = self::X_AXIS_INDEX;
     }
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:16,代码来源:DataCollector.php


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