summaryrefslogtreecommitdiffstats
path: root/src/DetectorModule/DetectorModule.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/DetectorModule/DetectorModule.h')
-rw-r--r--src/DetectorModule/DetectorModule.h39
1 files changed, 37 insertions, 2 deletions
diff --git a/src/DetectorModule/DetectorModule.h b/src/DetectorModule/DetectorModule.h
index aa63d82..de259fa 100644
--- a/src/DetectorModule/DetectorModule.h
+++ b/src/DetectorModule/DetectorModule.h
@@ -10,15 +10,50 @@
#ifndef DETECTORMODULE_H_
#define DETECTORMODULE_H_
+#include "../UDPClient/UDPClient.h"
+
#include <vector>
+#include <iostream>
+#include <chrono>
+#include <thread>
+#include <functional>
+
+void timer_start(std::function<void(void)> func, unsigned int interval){
+ std::thread([func, interval]() {
+ while (true)
+ {
+ func();
+ std::this_thread::sleep_for(std::chrono::milliseconds(interval));
+ }
+ }).detach();
+}
+
template <typename T>
class DetectorModule {
public:
- DetectorModule();
+ DetectorModule(const int detectorID, const std::string& address, const std::string& configPath);
+
+ auto sendPeriodically(unsigned int timeIntervall) -> void;
private:
- std::vector<std::vector<T>> buffer_;
+ std::vector<T> buffer_;
+
+ int detectorID_;
+ UDPClient client_;
+
+ int numberOfDetectors_;
+ int numberOfPlanes_;
+ int numberOfProjections_;
+ int numberOfDetectorsPerModule_;
+ std::size_t numberOfFrames_;
+ std::string path_, fileName_, fileEnding_;
+
+ std::size_t index_;
+
+ auto readConfig(const std::string& configFile) -> bool;
+ auto readInput() -> void;
+
};
#endif