mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 19:30:03 +02:00
bugfix from earlier commit: dr in readfromreceiver commented out
This commit is contained in:
parent
247d40f5a6
commit
f4b922165f
@ -486,19 +486,16 @@ void DetectorImpl::readFrameFromReceiver() {
|
|||||||
if (image == nullptr) {
|
if (image == nullptr) {
|
||||||
// allocate
|
// allocate
|
||||||
size = doc["size"].GetUint();
|
size = doc["size"].GetUint();
|
||||||
//std::cout << "SIZE: "<< size << std::endl;
|
|
||||||
multisize = size * zmqSocket.size();
|
multisize = size * zmqSocket.size();
|
||||||
image = new char[size];
|
image = new char[size];
|
||||||
multiframe = new char[multisize];
|
multiframe = new char[multisize];
|
||||||
memset(multiframe, 0xFF, multisize);
|
memset(multiframe, 0xFF, multisize);
|
||||||
// dynamic range
|
// dynamic range
|
||||||
// dynamicRange = doc["bitmode"].GetUint();
|
dynamicRange = doc["bitmode"].GetUint();
|
||||||
bytesPerPixel = (float)dynamicRange / 8;
|
bytesPerPixel = (float)dynamicRange / 8;
|
||||||
// std::cout << "DR: "<< dynamicRange << std::endl;
|
|
||||||
// shape
|
// shape
|
||||||
nPixelsX = doc["shape"][0].GetUint();
|
nPixelsX = doc["shape"][0].GetUint();
|
||||||
nPixelsY = doc["shape"][1].GetUint();
|
nPixelsY = doc["shape"][1].GetUint();
|
||||||
// std::cout << "shape: "<< nPixelsX << " "<< nPixelsY << std::endl;
|
|
||||||
// detector shape
|
// detector shape
|
||||||
nX = doc["detshape"][0].GetUint();
|
nX = doc["detshape"][0].GetUint();
|
||||||
nY = doc["detshape"][1].GetUint();
|
nY = doc["detshape"][1].GetUint();
|
||||||
@ -515,9 +512,9 @@ void DetectorImpl::readFrameFromReceiver() {
|
|||||||
(doc["gappixels"].GetUint() == 0) ? false : true;
|
(doc["gappixels"].GetUint() == 0) ? false : true;
|
||||||
quadEnable =
|
quadEnable =
|
||||||
(doc["quad"].GetUint() == 0) ? false : true;
|
(doc["quad"].GetUint() == 0) ? false : true;
|
||||||
FILE_LOG(logDEBUG1)
|
FILE_LOG(logDEBUG1)
|
||||||
<< "One Time Header Info:"
|
<< "One Time Header Info:"
|
||||||
"\n\tsize: "
|
"\n\tsize: "
|
||||||
<< size << "\n\tmultisize: " << multisize
|
<< size << "\n\tmultisize: " << multisize
|
||||||
<< "\n\tdynamicRange: " << dynamicRange
|
<< "\n\tdynamicRange: " << dynamicRange
|
||||||
<< "\n\tbytesPerPixel: " << bytesPerPixel
|
<< "\n\tbytesPerPixel: " << bytesPerPixel
|
||||||
@ -525,7 +522,7 @@ void DetectorImpl::readFrameFromReceiver() {
|
|||||||
<< "\n\tnPixelsY: " << nPixelsY << "\n\tnX: " << nX
|
<< "\n\tnPixelsY: " << nPixelsY << "\n\tnX: " << nX
|
||||||
<< "\n\tnY: " << nY << "\n\teiger: " << eiger
|
<< "\n\tnY: " << nY << "\n\teiger: " << eiger
|
||||||
<< "\n\tgappixelsenable: " << gappixelsenable
|
<< "\n\tgappixelsenable: " << gappixelsenable
|
||||||
<< "\n\tquadEnable: " << quadEnable;
|
<< "\n\tquadEnable: " << quadEnable;
|
||||||
}
|
}
|
||||||
// each time, parse rest of header
|
// each time, parse rest of header
|
||||||
currentFileName = doc["fname"].GetString();
|
currentFileName = doc["fname"].GetString();
|
||||||
@ -539,9 +536,9 @@ void DetectorImpl::readFrameFromReceiver() {
|
|||||||
coordY = (nY - 1) - coordY;
|
coordY = (nY - 1) - coordY;
|
||||||
}
|
}
|
||||||
flippedDataX = doc["flippedDataX"].GetUint();
|
flippedDataX = doc["flippedDataX"].GetUint();
|
||||||
FILE_LOG(logDEBUG1)
|
FILE_LOG(logDEBUG1)
|
||||||
<< "Header Info:"
|
<< "Header Info:"
|
||||||
"\n\tcurrentFileName: "
|
"\n\tcurrentFileName: "
|
||||||
<< currentFileName << "\n\tcurrentAcquisitionIndex: "
|
<< currentFileName << "\n\tcurrentAcquisitionIndex: "
|
||||||
<< currentAcquisitionIndex
|
<< currentAcquisitionIndex
|
||||||
<< "\n\tcurrentFrameIndex: " << currentFrameIndex
|
<< "\n\tcurrentFrameIndex: " << currentFrameIndex
|
||||||
@ -560,16 +557,14 @@ void DetectorImpl::readFrameFromReceiver() {
|
|||||||
uint32_t yoffset = coordY * nPixelsY;
|
uint32_t yoffset = coordY * nPixelsY;
|
||||||
uint32_t singledetrowoffset = nPixelsX * bytesPerPixel;
|
uint32_t singledetrowoffset = nPixelsX * bytesPerPixel;
|
||||||
uint32_t rowoffset = nX * singledetrowoffset;
|
uint32_t rowoffset = nX * singledetrowoffset;
|
||||||
if (multi_shm()->multiDetectorType == CHIPTESTBOARD) {
|
if (multi_shm()->multiDetectorType == CHIPTESTBOARD) {
|
||||||
singledetrowoffset = size;
|
singledetrowoffset = size;
|
||||||
nPixelsY=1;
|
nPixelsY = 1; // TODO: nDetPixelsY is not updated.
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
FILE_LOG(logDEBUG1)
|
||||||
FILE_LOG(logDEBUG1)
|
<< "Multi Image Info:"
|
||||||
<< "Multi Image Info:"
|
"\n\txoffset: "
|
||||||
"\n\txoffset: "
|
|
||||||
<< xoffset << "\n\tyoffset: " << yoffset
|
<< xoffset << "\n\tyoffset: " << yoffset
|
||||||
<< "\n\tsingledetrowoffset: " << singledetrowoffset
|
<< "\n\tsingledetrowoffset: " << singledetrowoffset
|
||||||
<< "\n\trowoffset: " << rowoffset;
|
<< "\n\trowoffset: " << rowoffset;
|
||||||
@ -585,7 +580,6 @@ void DetectorImpl::readFrameFromReceiver() {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (uint32_t i = 0; i < nPixelsY; ++i) {
|
for (uint32_t i = 0; i < nPixelsY; ++i) {
|
||||||
|
|
||||||
memcpy((multiframe) + ((yoffset + i) * rowoffset) +
|
memcpy((multiframe) + ((yoffset + i) * rowoffset) +
|
||||||
xoffset,
|
xoffset,
|
||||||
image + (i * singledetrowoffset),
|
image + (i * singledetrowoffset),
|
||||||
@ -595,11 +589,11 @@ void DetectorImpl::readFrameFromReceiver() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FILE_LOG(logDEBUG)<< "Call Back Info:"
|
FILE_LOG(logDEBUG)<< "Call Back Info:"
|
||||||
<< "\n\t nDetPixelsX: " << nDetPixelsX
|
<< "\n\t nDetPixelsX: " << nDetPixelsX
|
||||||
<< "\n\t nDetPixelsY: " << nDetPixelsY
|
<< "\n\t nDetPixelsY: " << nDetPixelsY
|
||||||
<< "\n\t databytes: " << multisize
|
<< "\n\t databytes: " << multisize
|
||||||
<< "\n\t dynamicRange: " << dynamicRange ;
|
<< "\n\t dynamicRange: " << dynamicRange ;
|
||||||
|
|
||||||
// send data to callback
|
// send data to callback
|
||||||
if (data) {
|
if (data) {
|
||||||
@ -616,10 +610,10 @@ void DetectorImpl::readFrameFromReceiver() {
|
|||||||
int n = processImageWithGapPixels(multiframe, multigappixels,
|
int n = processImageWithGapPixels(multiframe, multigappixels,
|
||||||
quadEnable);
|
quadEnable);
|
||||||
FILE_LOG(logDEBUG)
|
FILE_LOG(logDEBUG)
|
||||||
<< "Call Back Info Recalculated:"
|
<< "Call Back Info Recalculated:"
|
||||||
<< "\n\t nDetPixelsX: " << nDetPixelsX
|
<< "\n\t nDetPixelsX: " << nDetPixelsX
|
||||||
<< "\n\t nDetPixelsY: " << nDetPixelsY
|
<< "\n\t nDetPixelsY: " << nDetPixelsY
|
||||||
<< "\n\t databytes: " << n;
|
<< "\n\t databytes: " << n;
|
||||||
thisData =
|
thisData =
|
||||||
new detectorData(getCurrentProgress(), currentFileName,
|
new detectorData(getCurrentProgress(), currentFileName,
|
||||||
nDetPixelsX, nDetPixelsY, multigappixels,
|
nDetPixelsX, nDetPixelsY, multigappixels,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user