/**
  * Construct collector
  * @param \Runalyze\Model\Trackdata\Entity $trackdata
  * @param int $key
  * @param \Runalyze\Model\Route\Entity $route
  * @throws \InvalidArgumentException
  */
 public function __construct(Trackdata $trackdata, $key, Route $route)
 {
     if (!$route->has($key)) {
         throw new \InvalidArgumentException('Route has no data for "' . $key . '".');
     }
     $this->Key = $key;
     $this->Precision = Configuration::ActivityView()->plotPrecision();
     $this->KnowsDistance = $trackdata->has(Trackdata::DISTANCE);
     $this->init($trackdata);
     $this->LoopRoute = new Loop($route);
     $this->collect();
 }