From 8940620375c3bd9fef263fe9352c22384215cb13 Mon Sep 17 00:00:00 2001 From: Tobias Frust Date: Thu, 21 Jul 2016 09:50:16 +0200 Subject: sending out always the same packet --- src/DetectorModule/DetectorModule.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/DetectorModule/DetectorModule.cpp b/src/DetectorModule/DetectorModule.cpp index 9c3d98f..c98a3e2 100644 --- a/src/DetectorModule/DetectorModule.cpp +++ b/src/DetectorModule/DetectorModule.cpp @@ -41,6 +41,8 @@ DetectorModule::DetectorModule(const int detectorID, const std::string& address, //read the input data from the file corresponding to the detectorModuleID readInput(); + unsigned int sinoSize = numberOfDetectorsPerModule_*numberOfProjections_; + std::copy(((char*)buffer_.data()), ((char*)buffer_.data())+sinoSize*sizeof(unsigned short), sendBuffer_.begin()+sizeof(std::size_t)); printf("Created %d\n", detectorID); } @@ -57,8 +59,8 @@ auto DetectorModule::send() -> void{ unsigned int bufferSizeIndex = index_ % 1000; unsigned int sinoSize = numberOfDetectorsPerModule_*numberOfProjections_; *reinterpret_cast(sendBuffer_.data()) = index_; - std::copy(((char*)buffer_.data())+sinoSize*bufferSizeIndex*sizeof(unsigned short), ((char*)buffer_.data())+(sinoSize*(1+bufferSizeIndex))*sizeof(unsigned short), sendBuffer_.begin()+sizeof(std::size_t)); - client_.send(sendBuffer_.data(), sizeof(unsigned short)*numberOfDetectorsPerModule_*numberOfProjections_+sizeof(std::size_t)); + //std::copy(((char*)buffer_.data())+sinoSize*bufferSizeIndex*sizeof(unsigned short), ((char*)buffer_.data())+(sinoSize*(1+bufferSizeIndex))*sizeof(unsigned short), sendBuffer_.begin()+sizeof(std::size_t)); + client_.send(sendBuffer_.data(), sizeof(unsigned short)*sinoSize+sizeof(std::size_t)); ++index_; } -- cgit v1.2.3