mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 13:27:14 +02:00
Merge branch 'developer' into g225gui
This commit is contained in:
@ -1147,8 +1147,8 @@ class Detector {
|
||||
Result<bool> getDataStream(const defs::portPosition port,
|
||||
Positions pos = {}) const;
|
||||
|
||||
/** [Eiger] enable or disable data streaming from left or right of detector.
|
||||
* Default: enabled
|
||||
/** [Eiger] enable or disable data streaming from left or right of detector
|
||||
* for 10GbE. Default: enabled
|
||||
*/
|
||||
void setDataStream(const defs::portPosition port, const bool enable,
|
||||
Positions pos = {});
|
||||
|
@ -1804,7 +1804,9 @@ std::string CmdProxy::DataStream(int action) {
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[left|right] [0, 1]\n\t[Eiger] Enables or disables data "
|
||||
"streaming from left or/and right side of detector. 1 (enabled) "
|
||||
"streaming from left or/and right side of detector for 10 GbE "
|
||||
"mode. "
|
||||
"1 (enabled) "
|
||||
"by default."
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
|
@ -214,9 +214,21 @@ void Module::setThresholdEnergy(int e_eV, detectorSettings isettings,
|
||||
myMod.iodelay = myMod1.iodelay;
|
||||
myMod.tau =
|
||||
linearInterpolation(e_eV, trim1, trim2, myMod1.tau, myMod2.tau);
|
||||
// m3, reg is used for gaincaps
|
||||
if (shm()->detType == MYTHEN3) {
|
||||
if (myMod1.reg != myMod2.reg) {
|
||||
throw RuntimeError(
|
||||
"setThresholdEnergyAndSettings: gaincaps do not "
|
||||
"match between files");
|
||||
}
|
||||
myMod.reg = myMod1.reg;
|
||||
}
|
||||
}
|
||||
// m3, reg is used for gaincaps
|
||||
if (shm()->detType != MYTHEN3) {
|
||||
myMod.reg = isettings;
|
||||
}
|
||||
|
||||
myMod.reg = isettings;
|
||||
myMod.eV[0] = e_eV;
|
||||
setModule(myMod, trimbits);
|
||||
if (getSettings() != isettings) {
|
||||
@ -231,6 +243,7 @@ void Module::setThresholdEnergy(int e_eV, detectorSettings isettings,
|
||||
|
||||
void Module::setAllThresholdEnergy(std::array<int, 3> e_eV,
|
||||
detectorSettings isettings, bool trimbits) {
|
||||
// only mythen3
|
||||
if (shm()->trimEnergies.empty()) {
|
||||
throw RuntimeError(
|
||||
"Trim energies have not been defined for this module yet!");
|
||||
@ -311,6 +324,13 @@ void Module::setAllThresholdEnergy(std::array<int, 3> e_eV,
|
||||
|
||||
myMods[i] = interpolateTrim(&myMod1, &myMod2, energy[i], trim1,
|
||||
trim2, trimbits);
|
||||
// gaincaps
|
||||
if (myMod1.reg != myMod2.reg) {
|
||||
throw RuntimeError("setAllThresholdEnergy: gaincaps do not "
|
||||
"match between files for energy (eV) " +
|
||||
std::to_string(energy[i]));
|
||||
}
|
||||
myMods[i].reg = myMod1.reg;
|
||||
}
|
||||
}
|
||||
|
||||
@ -357,6 +377,11 @@ void Module::setAllThresholdEnergy(std::array<int, 3> e_eV,
|
||||
for (int i = 0; i < myMod.nchan; ++i) {
|
||||
myMod.chanregs[i] = myMods[i % 3].chanregs[i];
|
||||
}
|
||||
// gain caps
|
||||
if (myMods[0].reg != myMods[1].reg || myMods[1].reg != myMods[2].reg) {
|
||||
throw RuntimeError("setAllThresholdEnergy: gaincaps do not "
|
||||
"match between files for all energies");
|
||||
}
|
||||
}
|
||||
|
||||
myMod.reg = isettings;
|
||||
@ -3330,9 +3355,9 @@ sls_detector_module Module::interpolateTrim(sls_detector_module *a,
|
||||
dacs_to_copy.end(),
|
||||
{E_SVP, E_SVN, E_VTGSTV, E_RXB_RB, E_RXB_LB, E_VCN, E_VIS});
|
||||
// interpolate vrf, vcmp, vcp
|
||||
dacs_to_interpolate.insert(
|
||||
dacs_to_interpolate.end(),
|
||||
{E_VTR, E_VRF, E_VCMP_LL, E_VCMP_LR, E_VCMP_RL, E_VCMP_RR, E_VCP, E_VRS});
|
||||
dacs_to_interpolate.insert(dacs_to_interpolate.end(),
|
||||
{E_VTR, E_VRF, E_VCMP_LL, E_VCMP_LR,
|
||||
E_VCMP_RL, E_VCMP_RR, E_VCP, E_VRS});
|
||||
} else {
|
||||
dacs_to_copy.insert(dacs_to_copy.end(),
|
||||
{M_VCASSH, M_VRSHAPER, M_VRSHAPER_N, M_VIPRE_OUT,
|
||||
|
Reference in New Issue
Block a user