Beispiel #1
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if (!$context->activity()->weather()->condition()->isUnknown() && ($context->hasSport() || $context->sport()->isOutside())) {
         return $context->activity()->weather()->condition()->icon()->code();
     }
     return '';
 }
Beispiel #2
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if (!$context->activity()->weather()->pressure()->isUnknown() && !($context->hasSport() && !$context->sport()->isOutside())) {
         return $context->activity()->weather()->pressure()->string();
     }
     return '';
 }
Beispiel #3
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->hasSport()) {
         return $context->sport()->icon()->code();
     }
     return '';
 }
Beispiel #4
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if (!$context->activity()->weather()->temperature()->isUnknown() && !$context->activity()->weather()->windSpeed()->isUnknown() && !($context->hasSport() && !$context->sport()->isOutside())) {
         return $context->dataview()->windChillFactor()->string();
     }
     return '';
 }
Beispiel #5
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if (!$context->activity()->weather()->temperature()->isUnknown() && !($context->hasSport() && !$context->sport()->isOutside())) {
         return \Runalyze\Activity\Temperature::format($context->activity()->weather()->temperature()->value(), true, false);
     }
     return '';
 }
Beispiel #6
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     $weather = $context->activity()->weather();
     if ((!$weather->windSpeed()->isUnknown() || !$weather->windDegree()->isUnknown()) && !($context->hasSport() && !$context->sport()->isOutside())) {
         return (new WindIcon($weather->windSpeed(), $weather->windDegree()))->code();
     }
     return '';
 }
Beispiel #7
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->activity()->distance() > 0) {
         if ($context->hasData(self::DURATION_SUM_WITH_DISTANCE_KEY)) {
             if ($context->data(self::DURATION_SUM_WITH_DISTANCE_KEY) > 0) {
                 $Pace = new Activity\Pace($context->data(self::DURATION_SUM_WITH_DISTANCE_KEY), $context->activity()->distance(), $context->hasSport() ? $context->sport()->paceUnitEnum() : Activity\Pace::STANDARD);
                 return $Pace->valueWithAppendix();
             }
             return '';
         }
         return $context->dataview()->pace()->valueWithAppendix();
     }
     return '';
 }
Beispiel #8
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->hasData(parent::CONCAT_EQUIPMENT_KEY) && $context->data(parent::CONCAT_EQUIPMENT_KEY) != '') {
         $ids = explode(',', $context->data(parent::CONCAT_EQUIPMENT_KEY));
         $Factory = new \Runalyze\Model\Factory(\SessionAccountHandler::getId());
         $mainTypeID = $context->sport()->mainEquipmentTypeID();
         $names = array();
         foreach (array_unique($ids) as $id) {
             $Equipment = $Factory->equipment($id);
             if ($Equipment->typeid() == $mainTypeID) {
                 $names[] = $Factory->equipment($id)->name();
             }
         }
         return implode(', ', $names);
     }
     return '';
 }