diff options
Diffstat (limited to 'src/DetectorModule/DetectorModule.cpp')
-rw-r--r-- | src/DetectorModule/DetectorModule.cpp | 6 |
1 files 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<int*>(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_; } |