summaryrefslogtreecommitdiffstats
path: root/src/Detector
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-08-06 20:20:46 +0200
committerSuren A. Chilingaryan <csa@suren.me>2018-08-06 20:20:46 +0200
commit254f1dc9e629e9de818672174a6614c6595fb11a (patch)
tree39786da7f579f3098c5a79fe9c129dae2fd3ef5c /src/Detector
parent7ae5d89c48bd3982626afe03891eab2e2d31e746 (diff)
downloadods-254f1dc9e629e9de818672174a6614c6595fb11a.tar.gz
ods-254f1dc9e629e9de818672174a6614c6595fb11a.tar.bz2
ods-254f1dc9e629e9de818672174a6614c6595fb11a.tar.xz
ods-254f1dc9e629e9de818672174a6614c6595fb11a.zip
Support arbitrary ports and port-range splitting
Diffstat (limited to 'src/Detector')
-rw-r--r--src/Detector/Detector.cpp6
-rw-r--r--src/Detector/Detector.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/Detector/Detector.cpp b/src/Detector/Detector.cpp
index 5dde6d1..43402ee 100644
--- a/src/Detector/Detector.cpp
+++ b/src/Detector/Detector.cpp
@@ -10,12 +10,12 @@
#include "Detector.h"
-Detector::Detector(const std::string& address, const std::string& configPath, const unsigned int timeIntervall) :
+Detector::Detector(const std::string& address, const std::string& configPath, const int firstPort, const int numPorts, const unsigned int timeIntervall) :
timeIntervall_{timeIntervall},
- numberOfDetectorModules_{27} {
+ numberOfDetectorModules_{numPorts} {
modules_.reserve(numberOfDetectorModules_);
for(auto i = 0; i < numberOfDetectorModules_; i++){
- modules_.emplace_back(i, address, configPath);
+ modules_.emplace_back(i, address, firstPort + i, configPath);
}
}
diff --git a/src/Detector/Detector.h b/src/Detector/Detector.h
index 1969dbd..4295e63 100644
--- a/src/Detector/Detector.h
+++ b/src/Detector/Detector.h
@@ -17,7 +17,7 @@
class Detector {
public:
- Detector(const std::string& address, const std::string& configPath, const unsigned int timeIntervall);
+ Detector(const std::string& address, const std::string& configPath, const int firstPort, const int numPorts, const unsigned int timeIntervall);
auto run() -> void;
private: