/*
 * Copyright 2016 Tobias Frust
 *
 * Detector.cpp
 *
 *  Created on: 30.06.2016
 *      Author: Tobias Frust
 */


#include "Detector.h"

Detector::Detector(const std::string& address, const std::string& configPath, const unsigned int timeIntervall, const int packetSize) :
   timeIntervall_{timeIntervall},
   numberOfDetectorModules_{27} {
   modules_.reserve(numberOfDetectorModules_);
   for(auto i = 0; i < numberOfDetectorModules_; i++){
      modules_.emplace_back(i, address, configPath, packetSize);
   }
}

auto Detector::run() -> void {
   for(auto i = 0; i < numberOfDetectorModules_; i++)
      modules_[i].sendPeriodically(timeIntervall_);
}