mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 19:30:03 +02:00
Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer
This commit is contained in:
commit
1a90c58d9e
@ -6938,6 +6938,16 @@ int get_receiver_parameters(int file_des) {
|
|||||||
if (n < 0)
|
if (n < 0)
|
||||||
return printSocketReadError();
|
return printSocketReadError();
|
||||||
|
|
||||||
|
// additional storage cells
|
||||||
|
#ifdef JUNGFRAUD
|
||||||
|
i32 = getNumAdditionalStorageCells();
|
||||||
|
#else
|
||||||
|
i32 = 0;
|
||||||
|
#endif
|
||||||
|
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
||||||
|
if (n < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
|
||||||
// analog samples
|
// analog samples
|
||||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||||
i32 = getNumAnalogSamples();
|
i32 = getNumAnalogSamples();
|
||||||
@ -7015,6 +7025,26 @@ int get_receiver_parameters(int file_des) {
|
|||||||
if (n < 0)
|
if (n < 0)
|
||||||
return printSocketReadError();
|
return printSocketReadError();
|
||||||
|
|
||||||
|
// readnlines
|
||||||
|
#ifdef EIGERD
|
||||||
|
i32 = getReadNLines();
|
||||||
|
#else
|
||||||
|
i32 = 0;
|
||||||
|
#endif
|
||||||
|
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
||||||
|
if (n < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
|
||||||
|
// threshold ev
|
||||||
|
#ifdef EIGERD
|
||||||
|
i32 = getThresholdEnergy();
|
||||||
|
#else
|
||||||
|
i32 = 0;
|
||||||
|
#endif
|
||||||
|
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
||||||
|
if (n < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
|
||||||
// dynamic range
|
// dynamic range
|
||||||
i32 = setDynamicRange(GET_FLAG);
|
i32 = setDynamicRange(GET_FLAG);
|
||||||
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
||||||
@ -7175,6 +7205,26 @@ int get_receiver_parameters(int file_des) {
|
|||||||
if (n < 0)
|
if (n < 0)
|
||||||
return printSocketReadError();
|
return printSocketReadError();
|
||||||
|
|
||||||
|
// scan parameters
|
||||||
|
// scan enable, dac, start, stop, step
|
||||||
|
// scan dac settle time
|
||||||
|
int i32s[5] = {0, 0, 0, 0, 0};
|
||||||
|
i64 = 0;
|
||||||
|
i32s[0] = scan;
|
||||||
|
if (scan) {
|
||||||
|
i32s[1] = scanGlobalIndex;
|
||||||
|
i32s[2] = scanSteps[0];
|
||||||
|
i32s[3] = scanSteps[numScanSteps - 1];
|
||||||
|
i32s[4] = scanSteps[1] - scanSteps[0];
|
||||||
|
i64 = scanSettleTime_ns;
|
||||||
|
}
|
||||||
|
n += sendData(file_des, i32s, sizeof(i32s), INT32);
|
||||||
|
if (n < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
n += sendData(file_des, &i64, sizeof(i64), INT64);
|
||||||
|
if (n < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
|
||||||
LOG(logINFO, ("Sent %d bytes for receiver parameters\n", n));
|
LOG(logINFO, ("Sent %d bytes for receiver parameters\n", n));
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
|
@ -474,6 +474,9 @@ defs::scanParameters Module::getScan() const {
|
|||||||
|
|
||||||
void Module::setScan(const defs::scanParameters t) {
|
void Module::setScan(const defs::scanParameters t) {
|
||||||
auto retval = sendToDetector<int64_t>(F_SET_SCAN, t);
|
auto retval = sendToDetector<int64_t>(F_SET_SCAN, t);
|
||||||
|
if (shm()->useReceiverFlag) {
|
||||||
|
sendToReceiver(F_SET_RECEIVER_SCAN, t, nullptr);
|
||||||
|
}
|
||||||
// if disabled, retval is 1, else its number of steps
|
// if disabled, retval is 1, else its number of steps
|
||||||
setNumberOfFrames(retval);
|
setNumberOfFrames(retval);
|
||||||
}
|
}
|
||||||
@ -1083,6 +1086,9 @@ void Module::setThresholdEnergy(int e_eV, detectorSettings isettings,
|
|||||||
// check as there is client processing
|
// check as there is client processing
|
||||||
if (shm()->myDetectorType == EIGER) {
|
if (shm()->myDetectorType == EIGER) {
|
||||||
setThresholdEnergyAndSettings(e_eV, isettings, trimbits);
|
setThresholdEnergyAndSettings(e_eV, isettings, trimbits);
|
||||||
|
if (shm()->useReceiverFlag) {
|
||||||
|
sendToReceiver(F_RECEIVER_SET_THRESHOLD, e_eV, nullptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// moench - send threshold energy to processor
|
// moench - send threshold energy to processor
|
||||||
else if (shm()->myDetectorType == MOENCH) {
|
else if (shm()->myDetectorType == MOENCH) {
|
||||||
|
@ -83,7 +83,8 @@ void ClientInterface::startTCPServer() {
|
|||||||
try {
|
try {
|
||||||
auto socket = server.accept();
|
auto socket = server.accept();
|
||||||
try {
|
try {
|
||||||
verifyLock();
|
verifyLock(); // lock should be checked only for set (not get),
|
||||||
|
// Move it back?
|
||||||
ret = decodeFunction(socket);
|
ret = decodeFunction(socket);
|
||||||
} catch (const RuntimeError &e) {
|
} catch (const RuntimeError &e) {
|
||||||
// We had an error needs to be sent to client
|
// We had an error needs to be sent to client
|
||||||
@ -202,6 +203,8 @@ int ClientInterface::functionTable(){
|
|||||||
flist[F_GET_RECEIVER_STREAMING_START_FNUM] = &ClientInterface::get_streaming_start_fnum;
|
flist[F_GET_RECEIVER_STREAMING_START_FNUM] = &ClientInterface::get_streaming_start_fnum;
|
||||||
flist[F_SET_RECEIVER_STREAMING_START_FNUM] = &ClientInterface::set_streaming_start_fnum;
|
flist[F_SET_RECEIVER_STREAMING_START_FNUM] = &ClientInterface::set_streaming_start_fnum;
|
||||||
flist[F_SET_RECEIVER_RATE_CORRECT] = &ClientInterface::set_rate_correct;
|
flist[F_SET_RECEIVER_RATE_CORRECT] = &ClientInterface::set_rate_correct;
|
||||||
|
flist[F_SET_RECEIVER_SCAN] = &ClientInterface::set_scan;
|
||||||
|
flist[F_RECEIVER_SET_THRESHOLD] = &ClientInterface::set_threshold;
|
||||||
|
|
||||||
for (int i = NUM_DET_FUNCTIONS + 1; i < NUM_REC_FUNCTIONS ; i++) {
|
for (int i = NUM_DET_FUNCTIONS + 1; i < NUM_REC_FUNCTIONS ; i++) {
|
||||||
LOG(logDEBUG1) << "function fnum: " << i << " (" <<
|
LOG(logDEBUG1) << "function fnum: " << i << " (" <<
|
||||||
@ -364,6 +367,9 @@ int ClientInterface::setup_receiver(Interface &socket) {
|
|||||||
if (myDetectorType == GOTTHARD2) {
|
if (myDetectorType == GOTTHARD2) {
|
||||||
impl()->setNumberOfBursts(arg.bursts);
|
impl()->setNumberOfBursts(arg.bursts);
|
||||||
}
|
}
|
||||||
|
if (myDetectorType == JUNGFRAU) {
|
||||||
|
impl()->setNumberOfAdditionalStorageCells(arg.additionalStorageCells);
|
||||||
|
}
|
||||||
if (myDetectorType == MOENCH || myDetectorType == CHIPTESTBOARD) {
|
if (myDetectorType == MOENCH || myDetectorType == CHIPTESTBOARD) {
|
||||||
try {
|
try {
|
||||||
impl()->setNumberofAnalogSamples(arg.analogSamples);
|
impl()->setNumberofAnalogSamples(arg.analogSamples);
|
||||||
@ -398,6 +404,8 @@ int ClientInterface::setup_receiver(Interface &socket) {
|
|||||||
std::to_string(arg.quad) +
|
std::to_string(arg.quad) +
|
||||||
" due to fifo strucutre memory allocation");
|
" due to fifo strucutre memory allocation");
|
||||||
}
|
}
|
||||||
|
impl()->setReadNLines(arg.numLinesReadout);
|
||||||
|
impl()->setThresholdEnergy(arg.thresholdEnergyeV);
|
||||||
}
|
}
|
||||||
if (myDetectorType == EIGER || myDetectorType == MYTHEN3) {
|
if (myDetectorType == EIGER || myDetectorType == MYTHEN3) {
|
||||||
try {
|
try {
|
||||||
@ -459,6 +467,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
|
|||||||
if (myDetectorType == GOTTHARD2) {
|
if (myDetectorType == GOTTHARD2) {
|
||||||
impl()->setBurstMode(arg.burstType);
|
impl()->setBurstMode(arg.burstType);
|
||||||
}
|
}
|
||||||
|
impl()->setScan(arg.scanParams);
|
||||||
|
|
||||||
return socket.sendResult(retvals);
|
return socket.sendResult(retvals);
|
||||||
}
|
}
|
||||||
@ -1107,7 +1116,7 @@ int ClientInterface::set_additional_json_header(Interface &socket) {
|
|||||||
json[key] = value;
|
json[key] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
verifyIdle(socket);
|
// verifyIdle(socket); allowing it to be set on the fly
|
||||||
LOG(logDEBUG1) << "Setting additional json header: " << sls::ToString(json);
|
LOG(logDEBUG1) << "Setting additional json header: " << sls::ToString(json);
|
||||||
impl()->setAdditionalJsonHeader(json);
|
impl()->setAdditionalJsonHeader(json);
|
||||||
return socket.Send(OK);
|
return socket.Send(OK);
|
||||||
@ -1523,7 +1532,7 @@ int ClientInterface::increment_file_index(Interface &socket) {
|
|||||||
int ClientInterface::set_additional_json_parameter(Interface &socket) {
|
int ClientInterface::set_additional_json_parameter(Interface &socket) {
|
||||||
char args[2][SHORT_STR_LENGTH]{};
|
char args[2][SHORT_STR_LENGTH]{};
|
||||||
socket.Receive(args);
|
socket.Receive(args);
|
||||||
verifyIdle(socket);
|
// verifyIdle(socket); allowing it to be set on the fly
|
||||||
LOG(logDEBUG1) << "Setting additional json parameter (" << args[0]
|
LOG(logDEBUG1) << "Setting additional json parameter (" << args[0]
|
||||||
<< "): " << args[1];
|
<< "): " << args[1];
|
||||||
impl()->setAdditionalJsonParameter(args[0], args[1]);
|
impl()->setAdditionalJsonParameter(args[0], args[1]);
|
||||||
@ -1623,3 +1632,21 @@ int ClientInterface::set_rate_correct(Interface &socket) {
|
|||||||
impl()->setRateCorrections(t);
|
impl()->setRateCorrections(t);
|
||||||
return socket.Send(OK);
|
return socket.Send(OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ClientInterface::set_scan(Interface &socket) {
|
||||||
|
auto arg = socket.Receive<scanParameters>();
|
||||||
|
LOG(logDEBUG) << "Scan Mode: " << sls::ToString(arg);
|
||||||
|
verifyIdle(socket);
|
||||||
|
impl()->setScan(arg);
|
||||||
|
return socket.Send(OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ClientInterface::set_threshold(Interface &socket) {
|
||||||
|
auto arg = socket.Receive<int>();
|
||||||
|
LOG(logDEBUG) << "Threshold: " << arg << " eV";
|
||||||
|
if (myDetectorType != EIGER)
|
||||||
|
functionNotImplemented();
|
||||||
|
verifyIdle(socket);
|
||||||
|
impl()->setThresholdEnergy(arg);
|
||||||
|
return socket.Send(OK);
|
||||||
|
}
|
@ -157,6 +157,8 @@ class ClientInterface : private virtual slsDetectorDefs {
|
|||||||
int get_streaming_start_fnum(sls::ServerInterface &socket);
|
int get_streaming_start_fnum(sls::ServerInterface &socket);
|
||||||
int set_streaming_start_fnum(sls::ServerInterface &socket);
|
int set_streaming_start_fnum(sls::ServerInterface &socket);
|
||||||
int set_rate_correct(sls::ServerInterface &socket);
|
int set_rate_correct(sls::ServerInterface &socket);
|
||||||
|
int set_scan(sls::ServerInterface &socket);
|
||||||
|
int set_threshold(sls::ServerInterface &socket);
|
||||||
|
|
||||||
Implementation *impl() {
|
Implementation *impl() {
|
||||||
if (receiver != nullptr) {
|
if (receiver != nullptr) {
|
||||||
|
@ -69,7 +69,9 @@ void DataStreamer::SetFlippedDataX(int fd) { flippedDataX = fd; }
|
|||||||
|
|
||||||
void DataStreamer::SetAdditionalJsonHeader(
|
void DataStreamer::SetAdditionalJsonHeader(
|
||||||
const std::map<std::string, std::string> &json) {
|
const std::map<std::string, std::string> &json) {
|
||||||
additionJsonHeader = json;
|
std::lock_guard<std::mutex> lock(additionalJsonMutex);
|
||||||
|
additionalJsonHeader = json;
|
||||||
|
isAdditionalJsonUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataStreamer::CreateZmqSockets(int *nunits, uint32_t port,
|
void DataStreamer::CreateZmqSockets(int *nunits, uint32_t port,
|
||||||
@ -232,7 +234,14 @@ int DataStreamer::SendHeader(sls_receiver_header *rheader, uint32_t size,
|
|||||||
zHeader.quad = *quadEnable;
|
zHeader.quad = *quadEnable;
|
||||||
zHeader.completeImage =
|
zHeader.completeImage =
|
||||||
(header.packetNumber < generalData->packetsPerFrame ? false : true);
|
(header.packetNumber < generalData->packetsPerFrame ? false : true);
|
||||||
zHeader.addJsonHeader = additionJsonHeader;
|
|
||||||
|
// update local copy only if it was updated (to prevent locking each time)
|
||||||
|
if (isAdditionalJsonUpdated) {
|
||||||
|
std::lock_guard<std::mutex> lock(additionalJsonMutex);
|
||||||
|
localAdditionalJsonHeader = additionalJsonHeader;
|
||||||
|
isAdditionalJsonUpdated = false;
|
||||||
|
}
|
||||||
|
zHeader.addJsonHeader = localAdditionalJsonHeader;
|
||||||
|
|
||||||
return zmqSocket->SendHeader(index, zHeader);
|
return zmqSocket->SendHeader(index, zHeader);
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ class DataStreamer;
|
|||||||
class ZmqSocket;
|
class ZmqSocket;
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
class DataStreamer : private virtual slsDetectorDefs, public ThreadObject {
|
class DataStreamer : private virtual slsDetectorDefs, public ThreadObject {
|
||||||
|
|
||||||
@ -166,7 +167,17 @@ class DataStreamer : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
int flippedDataX;
|
int flippedDataX;
|
||||||
|
|
||||||
/** additional json header */
|
/** additional json header */
|
||||||
std::map<std::string, std::string> additionJsonHeader;
|
std::map<std::string, std::string> additionalJsonHeader;
|
||||||
|
|
||||||
|
/** Used by streamer thread to update local copy (reduce number of locks
|
||||||
|
* during streaming) */
|
||||||
|
std::atomic<bool> isAdditionalJsonUpdated{false};
|
||||||
|
|
||||||
|
/** mutex to update json and to read and update local copy */
|
||||||
|
mutable std::mutex additionalJsonMutex;
|
||||||
|
|
||||||
|
/** local copy of additional json header (it can be update on the fly) */
|
||||||
|
std::map<std::string, std::string> localAdditionalJsonHeader;
|
||||||
|
|
||||||
/** Aquisition Started flag */
|
/** Aquisition Started flag */
|
||||||
bool startedFlag{nullptr};
|
bool startedFlag{nullptr};
|
||||||
|
@ -483,6 +483,11 @@ std::vector<uint64_t> Implementation::getNumMissingPackets() const {
|
|||||||
return mp;
|
return mp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Implementation::setScan(slsDetectorDefs::scanParameters s) {
|
||||||
|
scanParams = s;
|
||||||
|
LOG(logINFO) << "Scan parameters: " << sls::ToString(scanParams);
|
||||||
|
}
|
||||||
|
|
||||||
void Implementation::startReceiver() {
|
void Implementation::startReceiver() {
|
||||||
LOG(logINFO) << "Starting Receiver";
|
LOG(logINFO) << "Starting Receiver";
|
||||||
stoppedFlag = false;
|
stoppedFlag = false;
|
||||||
@ -719,27 +724,37 @@ void Implementation::SetupWriter() {
|
|||||||
"Unknown detector type to set up master file attributes");
|
"Unknown detector type to set up master file attributes");
|
||||||
}
|
}
|
||||||
masterAttributes->detType = myDetectorType;
|
masterAttributes->detType = myDetectorType;
|
||||||
|
masterAttributes->timingMode = timingMode;
|
||||||
masterAttributes->imageSize = generalData->imageSize;
|
masterAttributes->imageSize = generalData->imageSize;
|
||||||
masterAttributes->nPixels =
|
masterAttributes->nPixels =
|
||||||
xy(generalData->nPixelsX, generalData->nPixelsY);
|
xy(generalData->nPixelsX, generalData->nPixelsY);
|
||||||
masterAttributes->maxFramesPerFile = framesPerFile;
|
masterAttributes->maxFramesPerFile = framesPerFile;
|
||||||
|
masterAttributes->frameDiscardMode = frameDiscardMode;
|
||||||
|
masterAttributes->framePadding = framePadding;
|
||||||
|
masterAttributes->scanParams = scanParams;
|
||||||
masterAttributes->totalFrames = numberOfTotalFrames;
|
masterAttributes->totalFrames = numberOfTotalFrames;
|
||||||
masterAttributes->exptime = acquisitionTime;
|
masterAttributes->exptime = acquisitionTime;
|
||||||
masterAttributes->period = acquisitionPeriod;
|
masterAttributes->period = acquisitionPeriod;
|
||||||
|
masterAttributes->burstMode = burstMode;
|
||||||
|
masterAttributes->numUDPInterfaces = numUDPInterfaces;
|
||||||
masterAttributes->dynamicRange = dynamicRange;
|
masterAttributes->dynamicRange = dynamicRange;
|
||||||
masterAttributes->tenGiga = tengigaEnable;
|
masterAttributes->tenGiga = tengigaEnable;
|
||||||
|
masterAttributes->thresholdEnergyeV = thresholdEnergyeV;
|
||||||
masterAttributes->subExptime = subExpTime;
|
masterAttributes->subExptime = subExpTime;
|
||||||
masterAttributes->subPeriod = subPeriod;
|
masterAttributes->subPeriod = subPeriod;
|
||||||
masterAttributes->quad = quadEnable;
|
masterAttributes->quad = quadEnable;
|
||||||
|
masterAttributes->numLinesReadout = numLinesReadout;
|
||||||
masterAttributes->ratecorr = rateCorrections;
|
masterAttributes->ratecorr = rateCorrections;
|
||||||
masterAttributes->adcmask =
|
masterAttributes->adcmask =
|
||||||
tengigaEnable ? adcEnableMaskTenGiga : adcEnableMaskOneGiga;
|
tengigaEnable ? adcEnableMaskTenGiga : adcEnableMaskOneGiga;
|
||||||
masterAttributes->analog =
|
masterAttributes->analog =
|
||||||
(readoutType == ANALOG_ONLY || readoutType == ANALOG_AND_DIGITAL) ? 1
|
(readoutType == ANALOG_ONLY || readoutType == ANALOG_AND_DIGITAL) ? 1
|
||||||
: 0;
|
: 0;
|
||||||
|
masterAttributes->analogSamples = numberOfAnalogSamples;
|
||||||
masterAttributes->digital =
|
masterAttributes->digital =
|
||||||
(readoutType == DIGITAL_ONLY || readoutType == ANALOG_AND_DIGITAL) ? 1
|
(readoutType == DIGITAL_ONLY || readoutType == ANALOG_AND_DIGITAL) ? 1
|
||||||
: 0;
|
: 0;
|
||||||
|
masterAttributes->digitalSamples = numberOfDigitalSamples;
|
||||||
masterAttributes->dbitoffset = ctbDbitOffset;
|
masterAttributes->dbitoffset = ctbDbitOffset;
|
||||||
masterAttributes->dbitlist = 0;
|
masterAttributes->dbitlist = 0;
|
||||||
for (auto &i : ctbDbitList) {
|
for (auto &i : ctbDbitList) {
|
||||||
@ -754,6 +769,7 @@ void Implementation::SetupWriter() {
|
|||||||
masterAttributes->gateDelay2 = gateDelay2;
|
masterAttributes->gateDelay2 = gateDelay2;
|
||||||
masterAttributes->gateDelay3 = gateDelay3;
|
masterAttributes->gateDelay3 = gateDelay3;
|
||||||
masterAttributes->gates = numberOfGates;
|
masterAttributes->gates = numberOfGates;
|
||||||
|
masterAttributes->additionalJsonHeader = additionalJsonHeader;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (unsigned int i = 0; i < dataProcessor.size(); ++i) {
|
for (unsigned int i = 0; i < dataProcessor.size(); ++i) {
|
||||||
@ -1464,6 +1480,11 @@ void Implementation::setReadNLines(const int value) {
|
|||||||
LOG(logINFO) << "Number of Lines to readout: " << numLinesReadout;
|
LOG(logINFO) << "Number of Lines to readout: " << numLinesReadout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Implementation::setThresholdEnergy(const int value) {
|
||||||
|
thresholdEnergyeV = value;
|
||||||
|
LOG(logINFO) << "Threshold Energy: " << thresholdEnergyeV << " eV";
|
||||||
|
}
|
||||||
|
|
||||||
void Implementation::setRateCorrections(const std::vector<int64_t> &t) {
|
void Implementation::setRateCorrections(const std::vector<int64_t> &t) {
|
||||||
rateCorrections = t;
|
rateCorrections = t;
|
||||||
LOG(logINFO) << "Rate Corrections: " << sls::ToString(rateCorrections);
|
LOG(logINFO) << "Rate Corrections: " << sls::ToString(rateCorrections);
|
||||||
|
@ -81,6 +81,7 @@ class Implementation : private virtual slsDetectorDefs {
|
|||||||
uint64_t getAcquisitionIndex() const;
|
uint64_t getAcquisitionIndex() const;
|
||||||
double getProgress() const;
|
double getProgress() const;
|
||||||
std::vector<uint64_t> getNumMissingPackets() const;
|
std::vector<uint64_t> getNumMissingPackets() const;
|
||||||
|
void setScan(slsDetectorDefs::scanParameters s);
|
||||||
void startReceiver();
|
void startReceiver();
|
||||||
void setStoppedFlag(bool stopped);
|
void setStoppedFlag(bool stopped);
|
||||||
void stopReceiver();
|
void stopReceiver();
|
||||||
@ -214,6 +215,8 @@ class Implementation : private virtual slsDetectorDefs {
|
|||||||
int getReadNLines() const;
|
int getReadNLines() const;
|
||||||
/* [Eiger] */
|
/* [Eiger] */
|
||||||
void setReadNLines(const int value);
|
void setReadNLines(const int value);
|
||||||
|
/** [Eiger] */
|
||||||
|
void setThresholdEnergy(const int value);
|
||||||
/* [Eiger] */
|
/* [Eiger] */
|
||||||
void setRateCorrections(const std::vector<int64_t> &t);
|
void setRateCorrections(const std::vector<int64_t> &t);
|
||||||
readoutMode getReadoutMode() const;
|
readoutMode getReadoutMode() const;
|
||||||
@ -292,6 +295,7 @@ class Implementation : private virtual slsDetectorDefs {
|
|||||||
// acquisition
|
// acquisition
|
||||||
std::atomic<runStatus> status{IDLE};
|
std::atomic<runStatus> status{IDLE};
|
||||||
bool stoppedFlag{false};
|
bool stoppedFlag{false};
|
||||||
|
scanParameters scanParams{};
|
||||||
|
|
||||||
// network configuration (UDP)
|
// network configuration (UDP)
|
||||||
int numUDPInterfaces{1};
|
int numUDPInterfaces{1};
|
||||||
@ -340,6 +344,7 @@ class Implementation : private virtual slsDetectorDefs {
|
|||||||
bool activated{true};
|
bool activated{true};
|
||||||
bool deactivatedPaddingEnable{true};
|
bool deactivatedPaddingEnable{true};
|
||||||
int numLinesReadout{MAX_EIGER_ROWS_PER_READOUT};
|
int numLinesReadout{MAX_EIGER_ROWS_PER_READOUT};
|
||||||
|
int thresholdEnergyeV{-1};
|
||||||
std::vector<int64_t> rateCorrections;
|
std::vector<int64_t> rateCorrections;
|
||||||
readoutMode readoutType{ANALOG_ONLY};
|
readoutMode readoutType{ANALOG_ONLY};
|
||||||
uint32_t adcEnableMaskOneGiga{BIT32_MASK};
|
uint32_t adcEnableMaskOneGiga{BIT32_MASK};
|
||||||
|
@ -15,8 +15,8 @@ using namespace H5;
|
|||||||
using ns = std::chrono::nanoseconds;
|
using ns = std::chrono::nanoseconds;
|
||||||
|
|
||||||
// versions
|
// versions
|
||||||
#define HDF5_WRITER_VERSION (6.1) // 1 decimal places
|
#define HDF5_WRITER_VERSION (6.2) // 1 decimal places
|
||||||
#define BINARY_WRITER_VERSION (6.1) // 1 decimal places
|
#define BINARY_WRITER_VERSION (6.2) // 1 decimal places
|
||||||
|
|
||||||
struct MasterAttributes {
|
struct MasterAttributes {
|
||||||
slsDetectorDefs::detectorType detType{slsDetectorDefs::GENERIC};
|
slsDetectorDefs::detectorType detType{slsDetectorDefs::GENERIC};
|
||||||
@ -24,19 +24,28 @@ struct MasterAttributes {
|
|||||||
uint32_t imageSize{0};
|
uint32_t imageSize{0};
|
||||||
slsDetectorDefs::xy nPixels{};
|
slsDetectorDefs::xy nPixels{};
|
||||||
uint32_t maxFramesPerFile{0};
|
uint32_t maxFramesPerFile{0};
|
||||||
|
slsDetectorDefs::frameDiscardPolicy frameDiscardMode{
|
||||||
|
slsDetectorDefs::NO_DISCARD};
|
||||||
|
int framePadding{1};
|
||||||
|
slsDetectorDefs::scanParameters scanParams{};
|
||||||
uint64_t totalFrames{0};
|
uint64_t totalFrames{0};
|
||||||
ns exptime{0};
|
ns exptime{0};
|
||||||
ns period{0};
|
ns period{0};
|
||||||
|
slsDetectorDefs::burstMode burstMode{slsDetectorDefs::BURST_INTERNAL};
|
||||||
|
int numUDPInterfaces{0};
|
||||||
uint32_t dynamicRange{0};
|
uint32_t dynamicRange{0};
|
||||||
uint32_t tenGiga{0};
|
uint32_t tenGiga{0};
|
||||||
int threshold{0};
|
int thresholdEnergyeV{0};
|
||||||
ns subExptime{0};
|
ns subExptime{0};
|
||||||
ns subPeriod{0};
|
ns subPeriod{0};
|
||||||
uint32_t quad{0};
|
uint32_t quad{0};
|
||||||
|
uint32_t numLinesReadout;
|
||||||
std::vector<int64_t> ratecorr;
|
std::vector<int64_t> ratecorr;
|
||||||
uint32_t adcmask{0};
|
uint32_t adcmask{0};
|
||||||
uint32_t analog{0};
|
uint32_t analog{0};
|
||||||
|
uint32_t analogSamples{0};
|
||||||
uint32_t digital{0};
|
uint32_t digital{0};
|
||||||
|
uint32_t digitalSamples{0};
|
||||||
uint32_t dbitoffset{0};
|
uint32_t dbitoffset{0};
|
||||||
uint64_t dbitlist{0};
|
uint64_t dbitlist{0};
|
||||||
slsDetectorDefs::ROI roi{};
|
slsDetectorDefs::ROI roi{};
|
||||||
@ -48,6 +57,7 @@ struct MasterAttributes {
|
|||||||
ns gateDelay2{0};
|
ns gateDelay2{0};
|
||||||
ns gateDelay3{0};
|
ns gateDelay3{0};
|
||||||
uint32_t gates;
|
uint32_t gates;
|
||||||
|
std::map<std::string, std::string> additionalJsonHeader;
|
||||||
|
|
||||||
MasterAttributes(){};
|
MasterAttributes(){};
|
||||||
virtual ~MasterAttributes(){};
|
virtual ~MasterAttributes(){};
|
||||||
@ -69,11 +79,25 @@ struct MasterAttributes {
|
|||||||
<< "Image Size : " << imageSize << " bytes" << '\n'
|
<< "Image Size : " << imageSize << " bytes" << '\n'
|
||||||
<< "Pixels : " << sls::ToString(nPixels) << '\n'
|
<< "Pixels : " << sls::ToString(nPixels) << '\n'
|
||||||
<< "Max Frames Per File : " << maxFramesPerFile << '\n'
|
<< "Max Frames Per File : " << maxFramesPerFile << '\n'
|
||||||
|
<< "Frame Discard Policy : "
|
||||||
|
<< sls::ToString(frameDiscardMode) << '\n'
|
||||||
|
<< "Frame Padding : " << framePadding << '\n'
|
||||||
|
<< "Scan Parameters : " << sls::ToString(scanParams)
|
||||||
|
<< '\n'
|
||||||
<< "Total Frames : " << totalFrames << '\n';
|
<< "Total Frames : " << totalFrames << '\n';
|
||||||
return oss.str();
|
return oss.str();
|
||||||
};
|
};
|
||||||
|
|
||||||
void WriteBinaryAttributes(FILE *fd, std::string message) {
|
void WriteBinaryAttributes(FILE *fd, std::string message) {
|
||||||
|
// adding few common parameters to the end
|
||||||
|
if (!additionalJsonHeader.empty()) {
|
||||||
|
std::ostringstream oss;
|
||||||
|
oss << "Additional Json Header : "
|
||||||
|
<< sls::ToString(additionalJsonHeader) << '\n';
|
||||||
|
message += oss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
// adding sls_receiver header format
|
||||||
message += std::string("\n#Frame Header\n"
|
message += std::string("\n#Frame Header\n"
|
||||||
"Frame Number : 8 bytes\n"
|
"Frame Number : 8 bytes\n"
|
||||||
"SubFrame Number/ExpLength : 4 bytes\n"
|
"SubFrame Number/ExpLength : 4 bytes\n"
|
||||||
@ -90,6 +114,7 @@ struct MasterAttributes {
|
|||||||
"Header Version : 1 byte\n"
|
"Header Version : 1 byte\n"
|
||||||
"Packets Caught Mask : 64 bytes\n");
|
"Packets Caught Mask : 64 bytes\n");
|
||||||
|
|
||||||
|
// writing to file
|
||||||
if (fwrite((void *)message.c_str(), 1, message.length(), fd) !=
|
if (fwrite((void *)message.c_str(), 1, message.length(), fd) !=
|
||||||
message.length()) {
|
message.length()) {
|
||||||
throw sls::RuntimeError(
|
throw sls::RuntimeError(
|
||||||
@ -110,7 +135,7 @@ struct MasterAttributes {
|
|||||||
double version = BINARY_WRITER_VERSION;
|
double version = BINARY_WRITER_VERSION;
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
Attribute attribute = fd->createAttribute(
|
Attribute attribute = fd->createAttribute(
|
||||||
"version", PredType::NATIVE_DOUBLE, dataspace);
|
"Version", PredType::NATIVE_DOUBLE, dataspace);
|
||||||
attribute.write(PredType::NATIVE_DOUBLE, &version);
|
attribute.write(PredType::NATIVE_DOUBLE, &version);
|
||||||
}
|
}
|
||||||
// timestamp
|
// timestamp
|
||||||
@ -119,7 +144,7 @@ struct MasterAttributes {
|
|||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset =
|
DataSet dataset =
|
||||||
group->createDataSet("timestamp", strdatatype, dataspace);
|
group->createDataSet("Timestamp", strdatatype, dataspace);
|
||||||
dataset.write(std::string(ctime(&t)), strdatatype);
|
dataset.write(std::string(ctime(&t)), strdatatype);
|
||||||
}
|
}
|
||||||
// detector type
|
// detector type
|
||||||
@ -127,7 +152,7 @@ struct MasterAttributes {
|
|||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
DataSet dataset =
|
DataSet dataset =
|
||||||
group->createDataSet("detector type", strdatatype, dataspace);
|
group->createDataSet("Detector Type", strdatatype, dataspace);
|
||||||
dataset.write(sls::ToString(detType), strdatatype);
|
dataset.write(sls::ToString(detType), strdatatype);
|
||||||
}
|
}
|
||||||
// timing mode
|
// timing mode
|
||||||
@ -135,19 +160,19 @@ struct MasterAttributes {
|
|||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
DataSet dataset =
|
DataSet dataset =
|
||||||
group->createDataSet("timing mode", strdatatype, dataspace);
|
group->createDataSet("Timing Mode", strdatatype, dataspace);
|
||||||
dataset.write(sls::ToString(timingMode), strdatatype);
|
dataset.write(sls::ToString(timingMode), strdatatype);
|
||||||
}
|
}
|
||||||
// Image Size
|
// Image Size
|
||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"image size", PredType::NATIVE_INT, dataspace);
|
"Image Size", PredType::NATIVE_INT, dataspace);
|
||||||
dataset.write(&imageSize, PredType::NATIVE_INT);
|
dataset.write(&imageSize, PredType::NATIVE_INT);
|
||||||
DataSpace dataspaceAttr = DataSpace(H5S_SCALAR);
|
DataSpace dataspaceAttr = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
Attribute attribute =
|
Attribute attribute =
|
||||||
dataset.createAttribute("unit", strdatatype, dataspaceAttr);
|
dataset.createAttribute("Unit", strdatatype, dataspaceAttr);
|
||||||
attribute.write(strdatatype, std::string("bytes"));
|
attribute.write(strdatatype, std::string("bytes"));
|
||||||
}
|
}
|
||||||
//TODO: make this into an array?
|
//TODO: make this into an array?
|
||||||
@ -155,37 +180,69 @@ struct MasterAttributes {
|
|||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"number of pixels in x axis", PredType::NATIVE_INT, dataspace);
|
"Number of pixels in x axis", PredType::NATIVE_INT, dataspace);
|
||||||
dataset.write(&nPixels.x, PredType::NATIVE_INT);
|
dataset.write(&nPixels.x, PredType::NATIVE_INT);
|
||||||
}
|
}
|
||||||
// y
|
// y
|
||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"number of pixels in y axis", PredType::NATIVE_INT, dataspace);
|
"Number of pixels in y axis", PredType::NATIVE_INT, dataspace);
|
||||||
dataset.write(&nPixels.y, PredType::NATIVE_INT);
|
dataset.write(&nPixels.y, PredType::NATIVE_INT);
|
||||||
}
|
}
|
||||||
// Maximum frames per file
|
// Maximum frames per file
|
||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"maximum frames per file", PredType::NATIVE_INT, dataspace);
|
"Maximum frames per file", PredType::NATIVE_INT, dataspace);
|
||||||
dataset.write(&maxFramesPerFile, PredType::NATIVE_INT);
|
dataset.write(&maxFramesPerFile, PredType::NATIVE_INT);
|
||||||
}
|
}
|
||||||
|
// Frame Discard Policy
|
||||||
|
{
|
||||||
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
|
DataSet dataset =
|
||||||
|
group->createDataSet("Frame Discard Policy", strdatatype, dataspace);
|
||||||
|
dataset.write(sls::ToString(frameDiscardMode), strdatatype);
|
||||||
|
}
|
||||||
|
// Frame Padding
|
||||||
|
{
|
||||||
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
|
DataSet dataset = group->createDataSet(
|
||||||
|
"Frame Padding", PredType::NATIVE_INT, dataspace);
|
||||||
|
dataset.write(&framePadding, PredType::NATIVE_INT);
|
||||||
|
}
|
||||||
|
// Scan Parameters
|
||||||
|
{
|
||||||
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
|
DataSet dataset =
|
||||||
|
group->createDataSet("Scan Parameters", strdatatype, dataspace);
|
||||||
|
dataset.write(sls::ToString(scanParams), strdatatype);
|
||||||
|
}
|
||||||
// Total Frames
|
// Total Frames
|
||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"total frames", PredType::STD_U64LE, dataspace);
|
"Total Frames", PredType::STD_U64LE, dataspace);
|
||||||
dataset.write(&totalFrames, PredType::STD_U64LE);
|
dataset.write(&totalFrames, PredType::STD_U64LE);
|
||||||
}
|
}
|
||||||
|
// additional json header
|
||||||
|
if (!additionalJsonHeader.empty()) {
|
||||||
|
std::string json = sls::ToString(additionalJsonHeader);
|
||||||
|
StrType strdatatype(PredType::C_S1, json.length());
|
||||||
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
|
DataSet dataset =
|
||||||
|
group->createDataSet("Additional JSON Header", strdatatype, dataspace);
|
||||||
|
dataset.write(sls::ToString(additionalJsonHeader), strdatatype);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void WriteHDF5Exptime(H5File *fd, Group *group) {
|
void WriteHDF5Exptime(H5File *fd, Group *group) {
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
DataSet dataset =
|
DataSet dataset =
|
||||||
group->createDataSet("exposure time", strdatatype, dataspace);
|
group->createDataSet("Exposure Time", strdatatype, dataspace);
|
||||||
dataset.write(sls::ToString(exptime), strdatatype);
|
dataset.write(sls::ToString(exptime), strdatatype);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -193,26 +250,26 @@ struct MasterAttributes {
|
|||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
DataSet dataset =
|
DataSet dataset =
|
||||||
group->createDataSet("acquisition period", strdatatype, dataspace);
|
group->createDataSet("Acquisition Period", strdatatype, dataspace);
|
||||||
dataset.write(sls::ToString(period), strdatatype);
|
dataset.write(sls::ToString(period), strdatatype);
|
||||||
};
|
};
|
||||||
|
|
||||||
void WriteHDF5DynamicRange(H5File *fd, Group *group) {
|
void WriteHDF5DynamicRange(H5File *fd, Group *group) {
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"dynamic range", PredType::NATIVE_INT, dataspace);
|
"Dynamic Range", PredType::NATIVE_INT, dataspace);
|
||||||
dataset.write(&dynamicRange, PredType::NATIVE_INT);
|
dataset.write(&dynamicRange, PredType::NATIVE_INT);
|
||||||
DataSpace dataspaceAttr = DataSpace(H5S_SCALAR);
|
DataSpace dataspaceAttr = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
Attribute attribute =
|
Attribute attribute =
|
||||||
dataset.createAttribute("unit", strdatatype, dataspaceAttr);
|
dataset.createAttribute("Unit", strdatatype, dataspaceAttr);
|
||||||
attribute.write(strdatatype, std::string("bits"));
|
attribute.write(strdatatype, std::string("bits"));
|
||||||
};
|
};
|
||||||
|
|
||||||
void WriteHDF5TenGiga(H5File *fd, Group *group) {
|
void WriteHDF5TenGiga(H5File *fd, Group *group) {
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"ten giga enable", PredType::NATIVE_INT, dataspace);
|
"Ten Giga Enable", PredType::NATIVE_INT, dataspace);
|
||||||
dataset.write(&tenGiga, PredType::NATIVE_INT);
|
dataset.write(&tenGiga, PredType::NATIVE_INT);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
@ -264,7 +321,8 @@ class JungfrauMasterAttributes : public MasterAttributes {
|
|||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << MasterAttributes::GetBinaryMasterAttributes()
|
oss << MasterAttributes::GetBinaryMasterAttributes()
|
||||||
<< "Exptime : " << sls::ToString(exptime) << '\n'
|
<< "Exptime : " << sls::ToString(exptime) << '\n'
|
||||||
<< "Period : " << sls::ToString(period) << '\n';
|
<< "Period : " << sls::ToString(period) << '\n'
|
||||||
|
<< "Number of UDP Interfaces : " << numUDPInterfaces << '\n';
|
||||||
std::string message = oss.str();
|
std::string message = oss.str();
|
||||||
MasterAttributes::WriteBinaryAttributes(fd, message);
|
MasterAttributes::WriteBinaryAttributes(fd, message);
|
||||||
};
|
};
|
||||||
@ -274,6 +332,12 @@ class JungfrauMasterAttributes : public MasterAttributes {
|
|||||||
MasterAttributes::WriteHDF5Attributes(fd, group);
|
MasterAttributes::WriteHDF5Attributes(fd, group);
|
||||||
MasterAttributes::WriteHDF5Exptime(fd, group);
|
MasterAttributes::WriteHDF5Exptime(fd, group);
|
||||||
MasterAttributes::WriteHDF5Period(fd, group);
|
MasterAttributes::WriteHDF5Period(fd, group);
|
||||||
|
{
|
||||||
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
|
DataSet dataset = group->createDataSet(
|
||||||
|
"Number of UDP Interfaces", PredType::NATIVE_INT, dataspace);
|
||||||
|
dataset.write(&numUDPInterfaces, PredType::NATIVE_INT);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
@ -294,6 +358,7 @@ class EigerMasterAttributes : public MasterAttributes {
|
|||||||
<< "SubPeriod : " << sls::ToString(subPeriod)
|
<< "SubPeriod : " << sls::ToString(subPeriod)
|
||||||
<< '\n'
|
<< '\n'
|
||||||
<< "Quad : " << quad << '\n'
|
<< "Quad : " << quad << '\n'
|
||||||
|
<< "Number of Lines read out : " << numLinesReadout << '\n'
|
||||||
<< "Rate Corrections : " << sls::ToString(ratecorr)
|
<< "Rate Corrections : " << sls::ToString(ratecorr)
|
||||||
<< '\n';
|
<< '\n';
|
||||||
std::string message = oss.str();
|
std::string message = oss.str();
|
||||||
@ -311,19 +376,19 @@ class EigerMasterAttributes : public MasterAttributes {
|
|||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"threshold", PredType::NATIVE_INT, dataspace);
|
"Threshold Energy", PredType::NATIVE_INT, dataspace);
|
||||||
dataset.write(&threshold, PredType::NATIVE_INT);
|
dataset.write(&threshold, PredType::NATIVE_INT);
|
||||||
DataSpace dataspaceAttr = DataSpace(H5S_SCALAR);
|
DataSpace dataspaceAttr = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
Attribute attribute =
|
Attribute attribute =
|
||||||
dataset.createAttribute("unit", strdatatype, dataspaceAttr);
|
dataset.createAttribute("Unit", strdatatype, dataspaceAttr);
|
||||||
attribute.write(strdatatype, std::string("eV"));
|
attribute.write(strdatatype, std::string("eV"));
|
||||||
}
|
}
|
||||||
// SubExptime
|
// SubExptime
|
||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
DataSet dataset = group->createDataSet("sub exposure time",
|
DataSet dataset = group->createDataSet("Sub Exposure Time",
|
||||||
strdatatype, dataspace);
|
strdatatype, dataspace);
|
||||||
dataset.write(sls::ToString(subExptime), strdatatype);
|
dataset.write(sls::ToString(subExptime), strdatatype);
|
||||||
}
|
}
|
||||||
@ -332,21 +397,28 @@ class EigerMasterAttributes : public MasterAttributes {
|
|||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
DataSet dataset =
|
DataSet dataset =
|
||||||
group->createDataSet("sub period", strdatatype, dataspace);
|
group->createDataSet("Sub Period", strdatatype, dataspace);
|
||||||
dataset.write(sls::ToString(subPeriod), strdatatype);
|
dataset.write(sls::ToString(subPeriod), strdatatype);
|
||||||
}
|
}
|
||||||
// Quad
|
// Quad
|
||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset =
|
DataSet dataset =
|
||||||
group->createDataSet("quad", PredType::NATIVE_INT, dataspace);
|
group->createDataSet("Quad", PredType::NATIVE_INT, dataspace);
|
||||||
dataset.write(&quad, PredType::NATIVE_INT);
|
dataset.write(&quad, PredType::NATIVE_INT);
|
||||||
}
|
}
|
||||||
|
// numLinesReadout
|
||||||
|
{
|
||||||
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
|
DataSet dataset = group->createDataSet(
|
||||||
|
"Number of Lines read out", PredType::NATIVE_INT, dataspace);
|
||||||
|
dataset.write(&numLinesReadout, PredType::NATIVE_INT);
|
||||||
|
}
|
||||||
// Rate corrections
|
// Rate corrections
|
||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 1024);
|
StrType strdatatype(PredType::C_S1, 1024);
|
||||||
DataSet dataset = group->createDataSet("rate corrections",
|
DataSet dataset = group->createDataSet("Rate Corrections",
|
||||||
strdatatype, dataspace);
|
strdatatype, dataspace);
|
||||||
dataset.write(sls::ToString(ratecorr), strdatatype);
|
dataset.write(sls::ToString(ratecorr), strdatatype);
|
||||||
}
|
}
|
||||||
@ -393,7 +465,7 @@ class Mythen3MasterAttributes : public MasterAttributes {
|
|||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"counter mask", PredType::STD_U32LE, dataspace);
|
"Counter Mask", PredType::STD_U32LE, dataspace);
|
||||||
dataset.write(&counterMask, PredType::STD_U32LE);
|
dataset.write(&counterMask, PredType::STD_U32LE);
|
||||||
}
|
}
|
||||||
// Exptime1
|
// Exptime1
|
||||||
@ -401,7 +473,7 @@ class Mythen3MasterAttributes : public MasterAttributes {
|
|||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
DataSet dataset =
|
DataSet dataset =
|
||||||
group->createDataSet("exposure time1", strdatatype, dataspace);
|
group->createDataSet("Exposure Time1", strdatatype, dataspace);
|
||||||
dataset.write(sls::ToString(exptime1), strdatatype);
|
dataset.write(sls::ToString(exptime1), strdatatype);
|
||||||
}
|
}
|
||||||
// Exptime2
|
// Exptime2
|
||||||
@ -409,7 +481,7 @@ class Mythen3MasterAttributes : public MasterAttributes {
|
|||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
DataSet dataset =
|
DataSet dataset =
|
||||||
group->createDataSet("exposure time2", strdatatype, dataspace);
|
group->createDataSet("Exposure Time2", strdatatype, dataspace);
|
||||||
dataset.write(sls::ToString(exptime2), strdatatype);
|
dataset.write(sls::ToString(exptime2), strdatatype);
|
||||||
}
|
}
|
||||||
// Exptime3
|
// Exptime3
|
||||||
@ -417,7 +489,7 @@ class Mythen3MasterAttributes : public MasterAttributes {
|
|||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
DataSet dataset =
|
DataSet dataset =
|
||||||
group->createDataSet("exposure time3", strdatatype, dataspace);
|
group->createDataSet("Exposure Time3", strdatatype, dataspace);
|
||||||
dataset.write(sls::ToString(exptime3), strdatatype);
|
dataset.write(sls::ToString(exptime3), strdatatype);
|
||||||
}
|
}
|
||||||
// GateDelay1
|
// GateDelay1
|
||||||
@ -425,7 +497,7 @@ class Mythen3MasterAttributes : public MasterAttributes {
|
|||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
DataSet dataset =
|
DataSet dataset =
|
||||||
group->createDataSet("gate delay1", strdatatype, dataspace);
|
group->createDataSet("Gate Delay1", strdatatype, dataspace);
|
||||||
dataset.write(sls::ToString(gateDelay1), strdatatype);
|
dataset.write(sls::ToString(gateDelay1), strdatatype);
|
||||||
}
|
}
|
||||||
// GateDelay2
|
// GateDelay2
|
||||||
@ -433,7 +505,7 @@ class Mythen3MasterAttributes : public MasterAttributes {
|
|||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
DataSet dataset =
|
DataSet dataset =
|
||||||
group->createDataSet("gate delay2", strdatatype, dataspace);
|
group->createDataSet("Gate Delay2", strdatatype, dataspace);
|
||||||
dataset.write(sls::ToString(gateDelay2), strdatatype);
|
dataset.write(sls::ToString(gateDelay2), strdatatype);
|
||||||
}
|
}
|
||||||
// GateDelay3
|
// GateDelay3
|
||||||
@ -441,14 +513,14 @@ class Mythen3MasterAttributes : public MasterAttributes {
|
|||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
StrType strdatatype(PredType::C_S1, 256);
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
DataSet dataset =
|
DataSet dataset =
|
||||||
group->createDataSet("gate delay3", strdatatype, dataspace);
|
group->createDataSet("Gate Delay3", strdatatype, dataspace);
|
||||||
dataset.write(sls::ToString(gateDelay3), strdatatype);
|
dataset.write(sls::ToString(gateDelay3), strdatatype);
|
||||||
}
|
}
|
||||||
// Gates
|
// Gates
|
||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset =
|
DataSet dataset =
|
||||||
group->createDataSet("gates", PredType::STD_U32LE, dataspace);
|
group->createDataSet("Gates", PredType::STD_U32LE, dataspace);
|
||||||
dataset.write(&gates, PredType::STD_U32LE);
|
dataset.write(&gates, PredType::STD_U32LE);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -463,7 +535,9 @@ class Gotthard2MasterAttributes : public MasterAttributes {
|
|||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << MasterAttributes::GetBinaryMasterAttributes()
|
oss << MasterAttributes::GetBinaryMasterAttributes()
|
||||||
<< "Exptime : " << sls::ToString(exptime) << '\n'
|
<< "Exptime : " << sls::ToString(exptime) << '\n'
|
||||||
<< "Period : " << sls::ToString(period) << '\n';
|
<< "Period : " << sls::ToString(period) << '\n'
|
||||||
|
<< "Burst Mode : " << sls::ToString(burstMode)
|
||||||
|
<< '\n';
|
||||||
std::string message = oss.str();
|
std::string message = oss.str();
|
||||||
MasterAttributes::WriteBinaryAttributes(fd, message);
|
MasterAttributes::WriteBinaryAttributes(fd, message);
|
||||||
};
|
};
|
||||||
@ -473,6 +547,14 @@ class Gotthard2MasterAttributes : public MasterAttributes {
|
|||||||
MasterAttributes::WriteHDF5Attributes(fd, group);
|
MasterAttributes::WriteHDF5Attributes(fd, group);
|
||||||
MasterAttributes::WriteHDF5Exptime(fd, group);
|
MasterAttributes::WriteHDF5Exptime(fd, group);
|
||||||
MasterAttributes::WriteHDF5Period(fd, group);
|
MasterAttributes::WriteHDF5Period(fd, group);
|
||||||
|
// burst mode
|
||||||
|
{
|
||||||
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
|
StrType strdatatype(PredType::C_S1, 256);
|
||||||
|
DataSet dataset =
|
||||||
|
group->createDataSet("Burst Mode", strdatatype, dataspace);
|
||||||
|
dataset.write(sls::ToString(burstMode), strdatatype);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
@ -488,7 +570,8 @@ class MoenchMasterAttributes : public MasterAttributes {
|
|||||||
<< "Period : " << sls::ToString(period) << '\n'
|
<< "Period : " << sls::ToString(period) << '\n'
|
||||||
<< "Ten Giga : " << tenGiga << '\n'
|
<< "Ten Giga : " << tenGiga << '\n'
|
||||||
<< "ADC Mask : " << sls::ToStringHex(adcmask)
|
<< "ADC Mask : " << sls::ToStringHex(adcmask)
|
||||||
<< '\n';
|
<< '\n'
|
||||||
|
<< "Analog Samples : " << analogSamples << '\n';
|
||||||
std::string message = oss.str();
|
std::string message = oss.str();
|
||||||
MasterAttributes::WriteBinaryAttributes(fd, message);
|
MasterAttributes::WriteBinaryAttributes(fd, message);
|
||||||
};
|
};
|
||||||
@ -503,9 +586,16 @@ class MoenchMasterAttributes : public MasterAttributes {
|
|||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"adc mask", PredType::NATIVE_INT, dataspace);
|
"ADC Mask", PredType::NATIVE_INT, dataspace);
|
||||||
dataset.write(&adcmask, PredType::NATIVE_INT);
|
dataset.write(&adcmask, PredType::NATIVE_INT);
|
||||||
}
|
}
|
||||||
|
// Analog Samples
|
||||||
|
{
|
||||||
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
|
DataSet dataset = group->createDataSet(
|
||||||
|
"Analog Samples", PredType::NATIVE_INT, dataspace);
|
||||||
|
dataset.write(&analogSamples, PredType::NATIVE_INT);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
@ -523,7 +613,9 @@ class CtbMasterAttributes : public MasterAttributes {
|
|||||||
<< "ADC Mask : " << sls::ToStringHex(adcmask)
|
<< "ADC Mask : " << sls::ToStringHex(adcmask)
|
||||||
<< '\n'
|
<< '\n'
|
||||||
<< "Analog Flag : " << analog << '\n'
|
<< "Analog Flag : " << analog << '\n'
|
||||||
|
<< "Analog Samples : " << analogSamples << '\n'
|
||||||
<< "Digital Flag : " << digital << '\n'
|
<< "Digital Flag : " << digital << '\n'
|
||||||
|
<< "Digital Samples : " << digitalSamples << '\n'
|
||||||
<< "Dbit Offset : " << dbitoffset << '\n'
|
<< "Dbit Offset : " << dbitoffset << '\n'
|
||||||
<< "Dbit Bitset : " << dbitlist << '\n';
|
<< "Dbit Bitset : " << dbitlist << '\n';
|
||||||
std::string message = oss.str();
|
std::string message = oss.str();
|
||||||
@ -540,35 +632,49 @@ class CtbMasterAttributes : public MasterAttributes {
|
|||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"adc mask", PredType::NATIVE_INT, dataspace);
|
"ADC mMsk", PredType::NATIVE_INT, dataspace);
|
||||||
dataset.write(&adcmask, PredType::NATIVE_INT);
|
dataset.write(&adcmask, PredType::NATIVE_INT);
|
||||||
}
|
}
|
||||||
// Analog Flag
|
// Analog Flag
|
||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"analog flag", PredType::NATIVE_INT, dataspace);
|
"Analog Flag", PredType::NATIVE_INT, dataspace);
|
||||||
dataset.write(&analog, PredType::NATIVE_INT);
|
dataset.write(&analog, PredType::NATIVE_INT);
|
||||||
}
|
}
|
||||||
|
// Analog Samples
|
||||||
|
{
|
||||||
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
|
DataSet dataset = group->createDataSet(
|
||||||
|
"Analog Samples", PredType::NATIVE_INT, dataspace);
|
||||||
|
dataset.write(&analogSamples, PredType::NATIVE_INT);
|
||||||
|
}
|
||||||
// Digital Flag
|
// Digital Flag
|
||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"digital flag", PredType::NATIVE_INT, dataspace);
|
"Digital Flag", PredType::NATIVE_INT, dataspace);
|
||||||
dataset.write(&digital, PredType::NATIVE_INT);
|
dataset.write(&digital, PredType::NATIVE_INT);
|
||||||
}
|
}
|
||||||
|
// Digital Samples
|
||||||
|
{
|
||||||
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
|
DataSet dataset = group->createDataSet(
|
||||||
|
"Digital Samples", PredType::NATIVE_INT, dataspace);
|
||||||
|
dataset.write(&digitalSamples, PredType::NATIVE_INT);
|
||||||
|
}
|
||||||
// Dbit Offset
|
// Dbit Offset
|
||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"dbit offset", PredType::NATIVE_INT, dataspace);
|
"Dbit Offset", PredType::NATIVE_INT, dataspace);
|
||||||
dataset.write(&dbitoffset, PredType::NATIVE_INT);
|
dataset.write(&dbitoffset, PredType::NATIVE_INT);
|
||||||
}
|
}
|
||||||
// Dbit List
|
// Dbit List
|
||||||
{
|
{
|
||||||
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
DataSpace dataspace = DataSpace(H5S_SCALAR);
|
||||||
DataSet dataset = group->createDataSet(
|
DataSet dataset = group->createDataSet(
|
||||||
"dbit bitset list", PredType::STD_U64LE, dataspace);
|
"Dbit Bitset List", PredType::STD_U64LE, dataspace);
|
||||||
dataset.write(&dbitlist, PredType::STD_U64LE);
|
dataset.write(&dbitlist, PredType::STD_U64LE);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -403,60 +403,6 @@ typedef struct {
|
|||||||
enum timingSourceType { TIMING_INTERNAL, TIMING_EXTERNAL };
|
enum timingSourceType { TIMING_INTERNAL, TIMING_EXTERNAL };
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
/**
|
|
||||||
* structure to udpate receiver
|
|
||||||
*/
|
|
||||||
struct rxParameters {
|
|
||||||
detectorType detType{GENERIC};
|
|
||||||
xy numberOfDetector;
|
|
||||||
int moduleId{0};
|
|
||||||
char hostname[MAX_STR_LENGTH];
|
|
||||||
int udpInterfaces{1};
|
|
||||||
int udp_dstport{0};
|
|
||||||
uint32_t udp_dstip{0U};
|
|
||||||
uint64_t udp_dstmac{0LU};
|
|
||||||
int udp_dstport2{0};
|
|
||||||
uint32_t udp_dstip2{0U};
|
|
||||||
uint64_t udp_dstmac2{0LU};
|
|
||||||
int64_t frames{0};
|
|
||||||
int64_t triggers{0};
|
|
||||||
int64_t bursts{0};
|
|
||||||
int analogSamples{0};
|
|
||||||
int digitalSamples{0};
|
|
||||||
int64_t expTimeNs{0};
|
|
||||||
int64_t periodNs{0};
|
|
||||||
int64_t subExpTimeNs{0};
|
|
||||||
int64_t subDeadTimeNs{0};
|
|
||||||
int activate{0};
|
|
||||||
int quad{0};
|
|
||||||
int dynamicRange{16};
|
|
||||||
timingMode timMode{AUTO_TIMING};
|
|
||||||
int tenGiga{0};
|
|
||||||
readoutMode roMode{ANALOG_ONLY};
|
|
||||||
uint32_t adcMask{0};
|
|
||||||
uint32_t adc10gMask{0};
|
|
||||||
ROI roi;
|
|
||||||
uint32_t countermask{0};
|
|
||||||
burstMode burstType{BURST_OFF};
|
|
||||||
int64_t expTime1Ns{0};
|
|
||||||
int64_t expTime2Ns{0};
|
|
||||||
int64_t expTime3Ns{0};
|
|
||||||
int64_t gateDelay1Ns{0};
|
|
||||||
int64_t gateDelay2Ns{0};
|
|
||||||
int64_t gateDelay3Ns{0};
|
|
||||||
int gates{0};
|
|
||||||
} __attribute__((packed));
|
|
||||||
|
|
||||||
/** pattern structure */
|
|
||||||
struct patternParameters {
|
|
||||||
uint64_t word[MAX_PATTERN_LENGTH]{};
|
|
||||||
uint64_t patioctrl{0};
|
|
||||||
uint32_t patlimits[2]{};
|
|
||||||
uint32_t patloop[6]{};
|
|
||||||
uint32_t patnloop[3]{};
|
|
||||||
uint32_t patwait[3]{};
|
|
||||||
uint64_t patwaittime[3]{};
|
|
||||||
} __attribute__((packed));
|
|
||||||
|
|
||||||
/** scan structure */
|
/** scan structure */
|
||||||
struct scanParameters {
|
struct scanParameters {
|
||||||
@ -487,6 +433,66 @@ typedef struct {
|
|||||||
(dacSettleTime_ns == other.dacSettleTime_ns));
|
(dacSettleTime_ns == other.dacSettleTime_ns));
|
||||||
}
|
}
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* structure to udpate receiver
|
||||||
|
*/
|
||||||
|
struct rxParameters {
|
||||||
|
detectorType detType{GENERIC};
|
||||||
|
xy numberOfDetector;
|
||||||
|
int moduleId{0};
|
||||||
|
char hostname[MAX_STR_LENGTH];
|
||||||
|
int udpInterfaces{1};
|
||||||
|
int udp_dstport{0};
|
||||||
|
uint32_t udp_dstip{0U};
|
||||||
|
uint64_t udp_dstmac{0LU};
|
||||||
|
int udp_dstport2{0};
|
||||||
|
uint32_t udp_dstip2{0U};
|
||||||
|
uint64_t udp_dstmac2{0LU};
|
||||||
|
int64_t frames{0};
|
||||||
|
int64_t triggers{0};
|
||||||
|
int64_t bursts{0};
|
||||||
|
int additionalStorageCells{0};
|
||||||
|
int analogSamples{0};
|
||||||
|
int digitalSamples{0};
|
||||||
|
int64_t expTimeNs{0};
|
||||||
|
int64_t periodNs{0};
|
||||||
|
int64_t subExpTimeNs{0};
|
||||||
|
int64_t subDeadTimeNs{0};
|
||||||
|
int activate{0};
|
||||||
|
int quad{0};
|
||||||
|
int numLinesReadout{0};
|
||||||
|
int thresholdEnergyeV{0};
|
||||||
|
int dynamicRange{16};
|
||||||
|
timingMode timMode{AUTO_TIMING};
|
||||||
|
int tenGiga{0};
|
||||||
|
readoutMode roMode{ANALOG_ONLY};
|
||||||
|
uint32_t adcMask{0};
|
||||||
|
uint32_t adc10gMask{0};
|
||||||
|
ROI roi;
|
||||||
|
uint32_t countermask{0};
|
||||||
|
burstMode burstType{BURST_OFF};
|
||||||
|
int64_t expTime1Ns{0};
|
||||||
|
int64_t expTime2Ns{0};
|
||||||
|
int64_t expTime3Ns{0};
|
||||||
|
int64_t gateDelay1Ns{0};
|
||||||
|
int64_t gateDelay2Ns{0};
|
||||||
|
int64_t gateDelay3Ns{0};
|
||||||
|
int gates{0};
|
||||||
|
scanParameters scanParams{};
|
||||||
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
/** pattern structure */
|
||||||
|
struct patternParameters {
|
||||||
|
uint64_t word[MAX_PATTERN_LENGTH]{};
|
||||||
|
uint64_t patioctrl{0};
|
||||||
|
uint32_t patlimits[2]{};
|
||||||
|
uint32_t patloop[6]{};
|
||||||
|
uint32_t patnloop[3]{};
|
||||||
|
uint32_t patwait[3]{};
|
||||||
|
uint64_t patwaittime[3]{};
|
||||||
|
} __attribute__((packed));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -312,6 +312,8 @@ enum detFuncs {
|
|||||||
F_GET_RECEIVER_STREAMING_START_FNUM,
|
F_GET_RECEIVER_STREAMING_START_FNUM,
|
||||||
F_SET_RECEIVER_STREAMING_START_FNUM,
|
F_SET_RECEIVER_STREAMING_START_FNUM,
|
||||||
F_SET_RECEIVER_RATE_CORRECT,
|
F_SET_RECEIVER_RATE_CORRECT,
|
||||||
|
F_SET_RECEIVER_SCAN,
|
||||||
|
F_RECEIVER_SET_THRESHOLD,
|
||||||
|
|
||||||
NUM_REC_FUNCTIONS
|
NUM_REC_FUNCTIONS
|
||||||
};
|
};
|
||||||
@ -625,6 +627,8 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
|||||||
case F_GET_RECEIVER_STREAMING_START_FNUM: return "F_GET_RECEIVER_STREAMING_START_FNUM";
|
case F_GET_RECEIVER_STREAMING_START_FNUM: return "F_GET_RECEIVER_STREAMING_START_FNUM";
|
||||||
case F_SET_RECEIVER_STREAMING_START_FNUM: return "F_SET_RECEIVER_STREAMING_START_FNUM";
|
case F_SET_RECEIVER_STREAMING_START_FNUM: return "F_SET_RECEIVER_STREAMING_START_FNUM";
|
||||||
case F_SET_RECEIVER_RATE_CORRECT: return "F_SET_RECEIVER_RATE_CORRECT";
|
case F_SET_RECEIVER_RATE_CORRECT: return "F_SET_RECEIVER_RATE_CORRECT";
|
||||||
|
case F_SET_RECEIVER_SCAN: return "F_SET_RECEIVER_SCAN";
|
||||||
|
case F_RECEIVER_SET_THRESHOLD: return "F_RECEIVER_SET_THRESHOLD";
|
||||||
|
|
||||||
case NUM_REC_FUNCTIONS: return "NUM_REC_FUNCTIONS";
|
case NUM_REC_FUNCTIONS: return "NUM_REC_FUNCTIONS";
|
||||||
default: return "Unknown Function";
|
default: return "Unknown Function";
|
||||||
|
@ -40,6 +40,7 @@ std::string ToString(const slsDetectorDefs::rxParameters &r) {
|
|||||||
<< "frames:" << r.frames << std::endl
|
<< "frames:" << r.frames << std::endl
|
||||||
<< "triggers:" << r.triggers << std::endl
|
<< "triggers:" << r.triggers << std::endl
|
||||||
<< "bursts:" << r.bursts << std::endl
|
<< "bursts:" << r.bursts << std::endl
|
||||||
|
<< "additionalStorageCells:" << r.additionalStorageCells << std::endl
|
||||||
<< "analogSamples:" << r.analogSamples << std::endl
|
<< "analogSamples:" << r.analogSamples << std::endl
|
||||||
<< "digitalSamples:" << r.digitalSamples << std::endl
|
<< "digitalSamples:" << r.digitalSamples << std::endl
|
||||||
<< "expTime:" << ToString(std::chrono::nanoseconds(r.expTimeNs))
|
<< "expTime:" << ToString(std::chrono::nanoseconds(r.expTimeNs))
|
||||||
@ -52,6 +53,8 @@ std::string ToString(const slsDetectorDefs::rxParameters &r) {
|
|||||||
<< std::endl
|
<< std::endl
|
||||||
<< "activate:" << r.activate << std::endl
|
<< "activate:" << r.activate << std::endl
|
||||||
<< "quad:" << r.quad << std::endl
|
<< "quad:" << r.quad << std::endl
|
||||||
|
<< "numLinesReadout:" << r.numLinesReadout << std::endl
|
||||||
|
<< "thresholdEnergyeV:" << r.thresholdEnergyeV << std::endl
|
||||||
<< "dynamicRange:" << r.dynamicRange << std::endl
|
<< "dynamicRange:" << r.dynamicRange << std::endl
|
||||||
<< "timMode:" << r.timMode << std::endl
|
<< "timMode:" << r.timMode << std::endl
|
||||||
<< "tenGiga:" << r.tenGiga << std::endl
|
<< "tenGiga:" << r.tenGiga << std::endl
|
||||||
@ -75,6 +78,7 @@ std::string ToString(const slsDetectorDefs::rxParameters &r) {
|
|||||||
<< "gateDelay3:" << ToString(std::chrono::nanoseconds(r.gateDelay3Ns))
|
<< "gateDelay3:" << ToString(std::chrono::nanoseconds(r.gateDelay3Ns))
|
||||||
<< std::endl
|
<< std::endl
|
||||||
<< "gates:" << r.gates << std::endl
|
<< "gates:" << r.gates << std::endl
|
||||||
|
<< "scanParams:" << sls::ToString(r.scanParams) << std::endl
|
||||||
<< ']';
|
<< ']';
|
||||||
return oss.str();
|
return oss.str();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user