mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-16 06:47:14 +02:00
clang format
This commit is contained in:
@ -1209,10 +1209,10 @@ class CmdProxy {
|
||||
"\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][CTB][Moench]"
|
||||
"Serial number of detector.");
|
||||
|
||||
GET_COMMAND(
|
||||
moduleid, getModuleId,
|
||||
"\n\t[Gotthard2][Eiger][Mythen3] 16 bit value (ideally unique) "
|
||||
"that is streamed out in the UDP header of the detector. Picked up from a file on the module.");
|
||||
GET_COMMAND(moduleid, getModuleId,
|
||||
"\n\t[Gotthard2][Eiger][Mythen3] 16 bit value (ideally unique) "
|
||||
"that is streamed out in the UDP header of the detector. "
|
||||
"Picked up from a file on the module.");
|
||||
|
||||
GET_COMMAND(type, getDetectorType,
|
||||
"\n\tReturns detector type. Can be Eiger, Jungfrau, Gotthard, "
|
||||
@ -1332,9 +1332,9 @@ class CmdProxy {
|
||||
GET_COMMAND_NOID(timinglist, getTimingModeList,
|
||||
"\n\tGets the list of timing modes for this detector.");
|
||||
|
||||
GET_COMMAND_NOID(readoutspeedlist, getReadoutSpeedList,
|
||||
"\n\tList of readout speed levels implemented for this detector.");
|
||||
|
||||
GET_COMMAND_NOID(
|
||||
readoutspeedlist, getReadoutSpeedList,
|
||||
"\n\tList of readout speed levels implemented for this detector.");
|
||||
|
||||
GET_COMMAND(maxadcphaseshift, getMaxADCPhaseShift,
|
||||
"\n\t[Jungfrau][CTB][Moench] Absolute maximum Phase shift of "
|
||||
@ -1357,7 +1357,8 @@ class CmdProxy {
|
||||
"the chip. \n\t[Moench] Default is 0. \n\t[Jungfrau] Default is 0. Get "
|
||||
"will return power status. Can be off if temperature event occured "
|
||||
"(temperature over temp_threshold with temp_control "
|
||||
"enabled. Will configure chip (only chip v1.1)\n\t[Mythen3][Gotthard2] Default is 1. If module not "
|
||||
"enabled. Will configure chip (only chip v1.1)\n\t[Mythen3][Gotthard2] "
|
||||
"Default is 1. If module not "
|
||||
"connected or wrong module, powerchip will fail.");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
@ -1390,7 +1391,10 @@ class CmdProxy {
|
||||
readnrows, getReadNRows, setReadNRows, StringTo<int>,
|
||||
"\n\t[1-256]\n\t\t[Eiger] Number of rows to readout per half module "
|
||||
"starting from the centre. Options: 0 - 256. 256 is default. The "
|
||||
"permissible values depend on dynamic range and 10Gbe enabled.\n\t[8-512 (multiple of 8)]\n\t\t[Jungfrau] Number of rows per module starting from the centre. Options: 8 - 512, must be multiples of 8. Default is 512.");
|
||||
"permissible values depend on dynamic range and 10Gbe "
|
||||
"enabled.\n\t[8-512 (multiple of 8)]\n\t\t[Jungfrau] Number of rows "
|
||||
"per module starting from the centre. Options: 8 - 512, must be "
|
||||
"multiples of 8. Default is 512.");
|
||||
|
||||
/** temperature */
|
||||
GET_COMMAND_NOID(
|
||||
@ -1545,10 +1549,11 @@ class CmdProxy {
|
||||
"[0, 1]\n\t[Jungfrau] The udp interface to stream data from detector. "
|
||||
"Effective only when number of interfaces is 1. Default: 0 (outer)");
|
||||
|
||||
GET_COMMAND(udp_numdst, getNumberofUDPDestinations,
|
||||
"\n\t[Jungfrau][Eiger] One can enter upto 32 "
|
||||
"destinations that the detector will stream images "
|
||||
"out in a round robin fashion. This is get only command. Default: 1");
|
||||
GET_COMMAND(
|
||||
udp_numdst, getNumberofUDPDestinations,
|
||||
"\n\t[Jungfrau][Eiger] One can enter upto 32 "
|
||||
"destinations that the detector will stream images "
|
||||
"out in a round robin fashion. This is get only command. Default: 1");
|
||||
|
||||
EXECUTE_SET_COMMAND(udp_cleardst, clearUDPDestinations,
|
||||
"\n\tClears udp destination details on the detector.");
|
||||
@ -1556,7 +1561,8 @@ class CmdProxy {
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
udp_firstdst, getFirstUDPDestination, setFirstUDPDestination,
|
||||
StringTo<int>,
|
||||
"[0 - 31 (or number of udp destinations)]\n\t[Jungfrau] One can set which is the first "
|
||||
"[0 - 31 (or number of udp destinations)]\n\t[Jungfrau] One can set "
|
||||
"which is the first "
|
||||
"destination that the detector will stream images "
|
||||
"out from in a round robin fashion. The entry must not have been "
|
||||
"empty. Default: 0");
|
||||
@ -1864,10 +1870,9 @@ class CmdProxy {
|
||||
"[(optional unit) ns|us|ms|s]\n\t[Eiger] Measured sub "
|
||||
"frame period between last sub frame and previous one.");
|
||||
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
activate, getActive, setActive, StringTo<int>,
|
||||
"[0, 1] \n\t[Eiger] 1 is default. 0 deactivates readout and does not send data.");
|
||||
INTEGER_COMMAND_VEC_ID(activate, getActive, setActive, StringTo<int>,
|
||||
"[0, 1] \n\t[Eiger] 1 is default. 0 deactivates "
|
||||
"readout and does not send data.");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
partialreset, getPartialReset, setPartialReset, StringTo<int>,
|
||||
@ -1920,7 +1925,8 @@ class CmdProxy {
|
||||
INTEGER_COMMAND_SET_NOID_GET_ID(
|
||||
storagecells, getNumberOfAdditionalStorageCells,
|
||||
setNumberOfAdditionalStorageCells, StringTo<int>,
|
||||
"[0-15]\n\t[Jungfrau] Only for chipv1.0. Number of additional storage cells. Default is "
|
||||
"[0-15]\n\t[Jungfrau] Only for chipv1.0. Number of additional storage "
|
||||
"cells. Default is "
|
||||
"0. For advanced users only. \n\tThe #images = #frames x #triggers x "
|
||||
"(#storagecells + 1).");
|
||||
|
||||
@ -1928,13 +1934,15 @@ class CmdProxy {
|
||||
storagecell_start, getStorageCellStart, setStorageCellStart,
|
||||
StringTo<int>,
|
||||
"[0-max]\n\t[Jungfrau] Storage cell that stores the first acquisition "
|
||||
"of the series. max is 15 (default) for chipv1.0 and 3 (default) for chipv1.1. For advanced users only.");
|
||||
"of the series. max is 15 (default) for chipv1.0 and 3 (default) for "
|
||||
"chipv1.1. For advanced users only.");
|
||||
|
||||
TIME_COMMAND(
|
||||
storagecell_delay, getStorageCellDelay, setStorageCellDelay,
|
||||
"[duration (0-1638375 ns)] [(optional unit) ns|us|ms|s]\n\t[Jungfrau] "
|
||||
"Additional time delay between 2 consecutive exposures in burst mode "
|
||||
"(resolution of 25ns). Only applicable for chipv1.0. For advanced users only.");
|
||||
"(resolution of 25ns). Only applicable for chipv1.0. For advanced "
|
||||
"users only.");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
gainmode, getGainMode, setGainMode,
|
||||
@ -1943,9 +1951,10 @@ class CmdProxy {
|
||||
"Jungfrau] Gain mode.\n\tCAUTION: Do not use fixg0 without caution, "
|
||||
"you can damage the detector!!!");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
filtercell, getFilterCell, setFilterCell, sls::StringTo<int>,
|
||||
"[0-12]\n\t[Jungfrau] Set Filter Cell. Only for chipv1.1. Advanced user Command");
|
||||
INTEGER_COMMAND_VEC_ID(filtercell, getFilterCell, setFilterCell,
|
||||
sls::StringTo<int>,
|
||||
"[0-12]\n\t[Jungfrau] Set Filter Cell. Only for "
|
||||
"chipv1.1. Advanced user Command");
|
||||
|
||||
/* Gotthard Specific */
|
||||
TIME_GET_COMMAND(exptimel, getExptimeLeft,
|
||||
|
@ -422,23 +422,19 @@ void Detector::setReadoutSpeed(defs::speedLevel value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setReadoutSpeed, pos, value);
|
||||
}
|
||||
|
||||
|
||||
std::vector<defs::speedLevel> Detector::getReadoutSpeedList() const {
|
||||
switch (getDetectorType().squash()) {
|
||||
case defs::EIGER:
|
||||
case defs::JUNGFRAU:
|
||||
return std::vector<defs::speedLevel>{defs::FULL_SPEED,
|
||||
defs::HALF_SPEED,
|
||||
return std::vector<defs::speedLevel>{defs::FULL_SPEED, defs::HALF_SPEED,
|
||||
defs::QUARTER_SPEED};
|
||||
case defs::GOTTHARD2:
|
||||
return std::vector<defs::speedLevel>{defs::G2_108MHZ,
|
||||
defs::G2_144MHZ};
|
||||
return std::vector<defs::speedLevel>{defs::G2_108MHZ, defs::G2_144MHZ};
|
||||
default:
|
||||
throw RuntimeError("Readout speed not implemented for this detector");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Result<int> Detector::getADCPhase(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getClockPhase, pos, defs::ADC_CLOCK, false);
|
||||
}
|
||||
@ -670,10 +666,6 @@ void Detector::setDefaultDac(defs::dacIndex index, int defaultValue,
|
||||
pimpl->setDefaultDac(index, defaultValue, sett, pos);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void Detector::resetToDefaultDacs(const bool hardReset, Positions pos) {
|
||||
pimpl->Parallel(&Module::resetToDefaultDacs, pos, hardReset);
|
||||
}
|
||||
@ -1439,7 +1431,6 @@ void Detector::setActive(const bool active, Positions pos) {
|
||||
pimpl->Parallel(&Module::setActivate, pos, active);
|
||||
}
|
||||
|
||||
|
||||
Result<bool> Detector::getPartialReset(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getCounterBit, pos);
|
||||
}
|
||||
@ -1554,12 +1545,9 @@ void Detector::setStorageCellDelay(ns value, Positions pos) {
|
||||
std::vector<defs::gainMode> Detector::getGainModeList() const {
|
||||
switch (getDetectorType().squash()) {
|
||||
case defs::JUNGFRAU:
|
||||
return std::vector<defs::gainMode>{defs::DYNAMIC,
|
||||
defs::FORCE_SWITCH_G1,
|
||||
defs::FORCE_SWITCH_G2,
|
||||
defs::FIX_G1,
|
||||
defs::FIX_G2,
|
||||
defs::FIX_G0};
|
||||
return std::vector<defs::gainMode>{
|
||||
defs::DYNAMIC, defs::FORCE_SWITCH_G1, defs::FORCE_SWITCH_G2,
|
||||
defs::FIX_G1, defs::FIX_G2, defs::FIX_G0};
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Gain mode is not implemented for this detector.");
|
||||
@ -1706,19 +1694,22 @@ Result<defs::streamingInterface> Detector::getVetoStream(Positions pos) const {
|
||||
return res;
|
||||
}
|
||||
|
||||
void Detector::setVetoStream(defs::streamingInterface interface, Positions pos) {
|
||||
void Detector::setVetoStream(defs::streamingInterface interface,
|
||||
Positions pos) {
|
||||
// 3gbe
|
||||
bool LOW_LATENCY_LINK = ((interface & defs::streamingInterface::LOW_LATENCY_LINK) ==
|
||||
defs::streamingInterface::LOW_LATENCY_LINK);
|
||||
bool LOW_LATENCY_LINK =
|
||||
((interface & defs::streamingInterface::LOW_LATENCY_LINK) ==
|
||||
defs::streamingInterface::LOW_LATENCY_LINK);
|
||||
pimpl->Parallel(&Module::setVetoStream, pos, LOW_LATENCY_LINK);
|
||||
|
||||
// 10gbe (debugging interface) opens 2nd udp interface in receiver
|
||||
int old_numinterfaces = pimpl->getNumberofUDPInterfaces(pos).tsquash(
|
||||
"retrieved inconsistent number of udp interfaces");
|
||||
int numinterfaces = (((interface & defs::streamingInterface::ETHERNET_10GB) ==
|
||||
defs::streamingInterface::ETHERNET_10GB)
|
||||
? 2
|
||||
: 1);
|
||||
int numinterfaces =
|
||||
(((interface & defs::streamingInterface::ETHERNET_10GB) ==
|
||||
defs::streamingInterface::ETHERNET_10GB)
|
||||
? 2
|
||||
: 1);
|
||||
if (numinterfaces != old_numinterfaces) {
|
||||
setNumberofUDPInterfaces_(numinterfaces, pos);
|
||||
}
|
||||
|
@ -291,7 +291,9 @@ void DetectorImpl::updateDetectorSize() {
|
||||
const slsDetectorDefs::xy det_size = modules[0]->getNumberOfChannels();
|
||||
|
||||
if (det_size.x == 0 || det_size.y == 0) {
|
||||
throw sls::RuntimeError("Module size for x or y dimensions is 0. Unable to proceed in updating detector size. ");
|
||||
throw sls::RuntimeError(
|
||||
"Module size for x or y dimensions is 0. Unable to proceed in "
|
||||
"updating detector size. ");
|
||||
}
|
||||
|
||||
int maxx = shm()->numberOfChannels.x;
|
||||
@ -1094,13 +1096,13 @@ int DetectorImpl::acquire() {
|
||||
// start and read all
|
||||
try {
|
||||
if (detector_type == defs::MYTHEN3 && modules.size() > 1) {
|
||||
//Multi module mythen
|
||||
// Multi module mythen
|
||||
std::vector<int> master;
|
||||
std::vector<int> slaves;
|
||||
auto is_master = Parallel(&Module::isMaster, {});
|
||||
slaves.reserve(modules.size() - 1); // check this one!!
|
||||
for (size_t i = 0; i < modules.size(); ++i) {
|
||||
if(is_master[i])
|
||||
if (is_master[i])
|
||||
master.push_back(i);
|
||||
else
|
||||
slaves.push_back(i);
|
||||
@ -1108,7 +1110,7 @@ int DetectorImpl::acquire() {
|
||||
Parallel(&Module::startAcquisition, slaves);
|
||||
Parallel(&Module::startAndReadAll, master);
|
||||
} else {
|
||||
//Normal acquire
|
||||
// Normal acquire
|
||||
Parallel(&Module::startAndReadAll, {});
|
||||
}
|
||||
|
||||
@ -1360,7 +1362,7 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
|
||||
LOG(logINFOBLUE) << "File has been converted to " << destfname;
|
||||
|
||||
// loading dst file to memory
|
||||
// FILE *fp = fopen("/tmp/SLS_DET_MCB.tzgmUT", "r");
|
||||
// FILE *fp = fopen("/tmp/SLS_DET_MCB.tzgmUT", "r");
|
||||
FILE *fp = fopen(destfname, "r");
|
||||
if (fp == nullptr) {
|
||||
throw RuntimeError("Program FPGA: Could not open rawbin file");
|
||||
@ -1384,7 +1386,7 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
|
||||
"Program FPGA: Could not close destination file after converting");
|
||||
}
|
||||
|
||||
//unlink(destfname); // delete temporary file
|
||||
// unlink(destfname); // delete temporary file
|
||||
LOG(logDEBUG1) << "Successfully loaded the rawbin file to program memory";
|
||||
LOG(logDEBUG1) << "Read file into memory";
|
||||
return buffer;
|
||||
|
@ -19,7 +19,7 @@ class detectorData;
|
||||
|
||||
#define DETECTOR_SHMAPIVERSION 0x190809
|
||||
#define DETECTOR_SHMVERSION 0x201007
|
||||
#define SHORT_STRING_LENGTH 50
|
||||
#define SHORT_STRING_LENGTH 50
|
||||
|
||||
#include <future>
|
||||
#include <numeric>
|
||||
|
@ -389,7 +389,7 @@ class Module : public virtual slsDetectorDefs {
|
||||
void setGainMode(const gainMode mode);
|
||||
int getFilterCell() const;
|
||||
void setFilterCell(int value);
|
||||
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
* Gotthard Specific *
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
#define SHM_DETECTOR_PREFIX "/slsDetectorPackage_detector_"
|
||||
#define SHM_MODULE_PREFIX "_module_"
|
||||
#define SHM_ENV_NAME "SLSDETNAME"
|
||||
#define SHM_ENV_NAME "SLSDETNAME"
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
Reference in New Issue
Block a user