summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Frust <tobiasfrust@gmail.com>2016-07-21 09:50:16 +0200
committerTobias Frust <tobiasfrust@gmail.com>2016-07-21 09:50:16 +0200
commit8940620375c3bd9fef263fe9352c22384215cb13 (patch)
tree0cfe19427f42ba11d7051c054435e16379a82f32
parentcdf8aac7e3a88df0fb93586bbf47b17c192ae2fc (diff)
downloadods-8940620375c3bd9fef263fe9352c22384215cb13.tar.gz
ods-8940620375c3bd9fef263fe9352c22384215cb13.tar.bz2
ods-8940620375c3bd9fef263fe9352c22384215cb13.tar.xz
ods-8940620375c3bd9fef263fe9352c22384215cb13.zip
sending out always the same packet
-rw-r--r--src/DetectorModule/DetectorModule.cpp6
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_;
}