mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 01:50:40 +02:00
m3 rxr: inconsistent generaldata default (#435)
* inconsistent copy with generalData and implementation members, especially for m3 (non default rxr generic values), issue caught on second configure with non m3 default values, eg tengiga 0 * removing test
This commit is contained in:
parent
e1642cf37c
commit
2db2694660
@ -66,6 +66,8 @@ This document describes the differences between v7.0.0 and v6.x.x
|
||||
- registerCallBackRawDataReady and registerCallBackRawDataModifyReady now gives a sls_receiver_header* instead of a char*, and uint32_t to size_t
|
||||
- registerCallBackStartAcquisition gave incorrect imagesize (+120 bytes). corrected.
|
||||
- registerCallBackStartAcquisition parameter is a const string reference
|
||||
- m3 (runnig config second time with tengiga 0, dr !=32, counters !=0x7) calculated incorrect image size expected
|
||||
|
||||
|
||||
2. Resolved Issues
|
||||
==================
|
||||
|
@ -62,6 +62,7 @@ class GeneralData {
|
||||
uint32_t adcEnableMaskOneGiga{BIT32_MASK};
|
||||
uint32_t adcEnableMaskTenGiga{BIT32_MASK};
|
||||
slsDetectorDefs::ROI roi{};
|
||||
uint32_t counterMask{0};
|
||||
|
||||
GeneralData(){};
|
||||
virtual ~GeneralData(){};
|
||||
@ -122,8 +123,8 @@ class GeneralData {
|
||||
ThrowGenericError("SetNumberofInterfaces");
|
||||
};
|
||||
|
||||
virtual void SetNumberofCounters(const int n) {
|
||||
ThrowGenericError("SetNumberofCounters");
|
||||
virtual void SetCounterMask(const int n) {
|
||||
ThrowGenericError("setCounterMask");
|
||||
};
|
||||
|
||||
virtual int GetNumberOfAnalogDatabytes() {
|
||||
@ -359,13 +360,12 @@ class JungfrauData : public GeneralData {
|
||||
|
||||
class Mythen3Data : public GeneralData {
|
||||
private:
|
||||
int ncounters;
|
||||
int ncounters{0};
|
||||
const int NCHAN = 1280;
|
||||
|
||||
public:
|
||||
Mythen3Data() {
|
||||
myDetectorType = slsDetectorDefs::MYTHEN3;
|
||||
ncounters = 3;
|
||||
nPixelsY = 1;
|
||||
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
|
||||
maxFramesPerFile = MYTHEN3_MAX_FRAMES_PER_FILE;
|
||||
@ -376,6 +376,7 @@ class Mythen3Data : public GeneralData {
|
||||
defaultUdpSocketBufferSize = (1000 * 1024 * 1024);
|
||||
dynamicRange = 32;
|
||||
tengigaEnable = true;
|
||||
SetCounterMask(0x7);
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
@ -389,7 +390,13 @@ class Mythen3Data : public GeneralData {
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
virtual void SetNumberofCounters(const int n) {
|
||||
virtual void SetCounterMask(const int mask) {
|
||||
int n = __builtin_popcount(mask);
|
||||
if (n < 1 || n > 3) {
|
||||
throw sls::RuntimeError("Invalid number of counters " +
|
||||
std::to_string(n) + ". Expected 1-3.");
|
||||
}
|
||||
counterMask = mask;
|
||||
ncounters = n;
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
@ -153,10 +153,20 @@ void Implementation::setDetectorType(const detectorType d) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
numUDPInterfaces = generalData->numUDPInterfaces;
|
||||
fifoDepth = generalData->defaultFifoDepth;
|
||||
udpSocketBufferSize = generalData->defaultUdpSocketBufferSize;
|
||||
|
||||
framesPerFile = generalData->maxFramesPerFile;
|
||||
fifoDepth = generalData->defaultFifoDepth;
|
||||
numUDPInterfaces = generalData->numUDPInterfaces;
|
||||
udpSocketBufferSize = generalData->defaultUdpSocketBufferSize;
|
||||
dynamicRange = generalData->dynamicRange;
|
||||
tengigaEnable = generalData->tengigaEnable;
|
||||
numberOfAnalogSamples = generalData->nAnalogSamples;
|
||||
numberOfDigitalSamples = generalData->nDigitalSamples;
|
||||
readoutType = generalData->readoutType;
|
||||
adcEnableMaskOneGiga = generalData->adcEnableMaskOneGiga;
|
||||
adcEnableMaskTenGiga = generalData->adcEnableMaskTenGiga;
|
||||
roi = generalData->roi;
|
||||
counterMask = generalData->counterMask;
|
||||
|
||||
SetLocalNetworkParameters();
|
||||
SetupFifoStructure();
|
||||
@ -523,10 +533,10 @@ void Implementation::startReceiver() {
|
||||
// callbacks
|
||||
if (startAcquisitionCallBack) {
|
||||
try {
|
||||
std::size_t imageSize = static_cast<uint32_t>(generalData->imageSize);
|
||||
startAcquisitionCallBack(
|
||||
filePath, fileName, fileIndex, imageSize,
|
||||
pStartAcquisition);
|
||||
std::size_t imageSize =
|
||||
static_cast<uint32_t>(generalData->imageSize);
|
||||
startAcquisitionCallBack(filePath, fileName, fileIndex, imageSize,
|
||||
pStartAcquisition);
|
||||
} catch (const std::exception &e) {
|
||||
throw sls::RuntimeError("Start Acquisition Callback Error: " +
|
||||
std::string(e.what()));
|
||||
@ -1395,14 +1405,8 @@ uint32_t Implementation::getCounterMask() const { return counterMask; }
|
||||
|
||||
void Implementation::setCounterMask(const uint32_t i) {
|
||||
if (counterMask != i) {
|
||||
int ncounters = __builtin_popcount(i);
|
||||
if (ncounters < 1 || ncounters > 3) {
|
||||
throw sls::RuntimeError("Invalid number of counters " +
|
||||
std::to_string(ncounters) +
|
||||
". Expected 1-3.");
|
||||
}
|
||||
generalData->SetCounterMask(i);
|
||||
counterMask = i;
|
||||
generalData->SetNumberofCounters(ncounters);
|
||||
SetupFifoStructure();
|
||||
}
|
||||
LOG(logINFO) << "Counter mask: " << sls::ToStringHex(counterMask);
|
||||
@ -1627,7 +1631,8 @@ void Implementation::setDbitOffset(const int s) { ctbDbitOffset = s; }
|
||||
* *
|
||||
* ************************************************/
|
||||
void Implementation::registerCallBackStartAcquisition(
|
||||
int (*func)(const std::string &, const std::string &, uint64_t, size_t, void *),
|
||||
int (*func)(const std::string &, const std::string &, uint64_t, size_t,
|
||||
void *),
|
||||
void *arg) {
|
||||
startAcquisitionCallBack = func;
|
||||
pStartAcquisition = arg;
|
||||
|
Loading…
x
Reference in New Issue
Block a user