mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
WIP
This commit is contained in:
parent
e0ea08332f
commit
9493ae3da9
@ -383,8 +383,8 @@ class Detector {
|
||||
Result<int> getNumberofUDPInterfaces(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau][Gotthard2] Also restarts client and receiver zmq sockets
|
||||
* [Gotthard2] second interface enabled to send veto information for
|
||||
* debugging
|
||||
* [Gotthard2] second interface enabled to send veto information via 10gbps
|
||||
* for debugging. By default it is sent via 2.5gbps if veto enabled
|
||||
* n can be 1 or 2 */
|
||||
void setNumberofUDPInterfaces(int n, Positions pos = {});
|
||||
|
||||
@ -980,6 +980,12 @@ class Detector {
|
||||
/** [Gotthard2] Options: TIMING_INTERNAL, TIMING_EXTERNAL */
|
||||
void setTimingSource(defs::timingSourceType value, Positions pos = {});
|
||||
|
||||
/** [Gotthard2] */
|
||||
Result<bool> getVeto(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard2] */
|
||||
void setVeto(const bool enable, Positions pos = {});
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
* Mythen3 Specific *
|
||||
|
@ -795,6 +795,7 @@ class CmdProxy {
|
||||
{"burstmode", &CmdProxy::BurstMode},
|
||||
{"currentsource", &CmdProxy::currentsource},
|
||||
{"timingsource", &CmdProxy::timingsource},
|
||||
{"veto", &CmdProxy::veto},
|
||||
|
||||
/* Mythen3 Specific */
|
||||
{"counters", &CmdProxy::Counters},
|
||||
@ -1522,8 +1523,10 @@ class CmdProxy {
|
||||
StringTo<int>,
|
||||
"[1, 2]\n\t[Jungfrau][Gotthard2] Number of udp interfaces to stream "
|
||||
"data from detector. Default: 1.\n\t"
|
||||
"[Gotthard2] Second interface enabled to send veto information for "
|
||||
"debugging.");
|
||||
"[Gotthard2] 2 will select 10gbps as channel for veto data streaming "
|
||||
"in detector and also enable second interface in receiver to listen to "
|
||||
"it. This is mainly for debugging purposes. By default, numinterfaces "
|
||||
"is 1 and if veto enabled, it is sent via 2.5 gbps interface");
|
||||
|
||||
INTEGER_COMMAND(
|
||||
selinterface, getSelectedUDPInterface, selectUDPInterface,
|
||||
@ -1872,6 +1875,10 @@ class CmdProxy {
|
||||
"[internal|external]\n\t[Gotthard2] Timing source. Internal is crystal "
|
||||
"and external is system timing. Default is internal.");
|
||||
|
||||
INTEGER_COMMAND(veto, getVeto, setVeto, StringTo<int>,
|
||||
"[0, 1]\n\t[Gotthard2] Enable or disable veto data "
|
||||
"streaming from detector. Default is 0.");
|
||||
|
||||
/* Mythen3 Specific */
|
||||
|
||||
/* CTB/ Moench Specific */
|
||||
|
@ -1248,6 +1248,14 @@ void Detector::setTimingSource(defs::timingSourceType value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setTimingSource, pos, value);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getVeto(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getVeto, pos);
|
||||
}
|
||||
|
||||
void Detector::setVeto(bool enable, Positions pos) {
|
||||
pimpl->Parallel(&Module::setVeto, pos, enable);
|
||||
}
|
||||
|
||||
// Mythen3 Specific
|
||||
|
||||
Result<uint32_t> Detector::getCounterMask(Positions pos) const {
|
||||
|
@ -4,8 +4,8 @@
|
||||
#include "ToString.h"
|
||||
#include "file_utils.h"
|
||||
#include "network_utils.h"
|
||||
#include "sls_detector_funcs.h"
|
||||
#include "sls_detector_exceptions.h"
|
||||
#include "sls_detector_funcs.h"
|
||||
#include "string_utils.h"
|
||||
#include "versionAPI.h"
|
||||
|
||||
@ -139,16 +139,14 @@ void Module::sendToDetector(int fnum, std::nullptr_t, Ret &retval) {
|
||||
|
||||
void Module::sendToDetector(int fnum) {
|
||||
LOG(logDEBUG1) << "Sending: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< getFunctionNameFromEnum(static_cast<detFuncs>(fnum))
|
||||
<< "]";
|
||||
sendToDetector(fnum, nullptr, 0, nullptr, 0);
|
||||
}
|
||||
|
||||
template <typename Ret> Ret Module::sendToDetector(int fnum) {
|
||||
LOG(logDEBUG1) << "Sending: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< getFunctionNameFromEnum(static_cast<detFuncs>(fnum))
|
||||
<< ", nullptr, 0, " << typeid(Ret).name() << ", "
|
||||
<< sizeof(Ret) << "]";
|
||||
Ret retval{};
|
||||
@ -160,8 +158,7 @@ template <typename Ret> Ret Module::sendToDetector(int fnum) {
|
||||
template <typename Ret, typename Arg>
|
||||
Ret Module::sendToDetector(int fnum, const Arg &args) {
|
||||
LOG(logDEBUG1) << "Sending: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< getFunctionNameFromEnum(static_cast<detFuncs>(fnum))
|
||||
<< ", " << args << ", " << sizeof(args) << ", "
|
||||
<< typeid(Ret).name() << ", " << sizeof(Ret) << "]";
|
||||
Ret retval{};
|
||||
@ -216,8 +213,7 @@ void Module::sendToDetectorStop(int fnum, std::nullptr_t, Ret &retval) const {
|
||||
|
||||
void Module::sendToDetectorStop(int fnum) {
|
||||
LOG(logDEBUG1) << "Sending to detector stop: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< getFunctionNameFromEnum(static_cast<detFuncs>(fnum))
|
||||
<< "]";
|
||||
sendToDetectorStop(fnum, nullptr, 0, nullptr, 0);
|
||||
}
|
||||
@ -237,8 +233,7 @@ void Module::sendToReceiver(int fnum, const void *args, size_t args_size,
|
||||
if (!shm()->useReceiverFlag) {
|
||||
std::ostringstream oss;
|
||||
oss << "Set rx_hostname first to use receiver parameters, ";
|
||||
oss << getFunctionNameFromEnum(
|
||||
static_cast<detFuncs>(fnum));
|
||||
oss << getFunctionNameFromEnum(static_cast<detFuncs>(fnum));
|
||||
throw RuntimeError(oss.str());
|
||||
}
|
||||
auto receiver = ReceiverSocket(shm()->rxHostname, shm()->rxTCPPort);
|
||||
@ -278,8 +273,7 @@ void Module::sendToReceiver(int fnum, std::nullptr_t, Ret &retval) const {
|
||||
|
||||
template <typename Ret> Ret Module::sendToReceiver(int fnum) {
|
||||
LOG(logDEBUG1) << "Sending: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< getFunctionNameFromEnum(static_cast<detFuncs>(fnum))
|
||||
<< ", nullptr, 0, " << typeid(Ret).name() << ", "
|
||||
<< sizeof(Ret) << "]";
|
||||
Ret retval{};
|
||||
@ -290,8 +284,7 @@ template <typename Ret> Ret Module::sendToReceiver(int fnum) {
|
||||
|
||||
template <typename Ret> Ret Module::sendToReceiver(int fnum) const {
|
||||
LOG(logDEBUG1) << "Sending: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< getFunctionNameFromEnum(static_cast<detFuncs>(fnum))
|
||||
<< ", nullptr, 0, " << typeid(Ret).name() << ", "
|
||||
<< sizeof(Ret) << "]";
|
||||
Ret retval{};
|
||||
@ -303,8 +296,7 @@ template <typename Ret> Ret Module::sendToReceiver(int fnum) const {
|
||||
template <typename Ret, typename Arg>
|
||||
Ret Module::sendToReceiver(int fnum, const Arg &args) {
|
||||
LOG(logDEBUG1) << "Sending: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< getFunctionNameFromEnum(static_cast<detFuncs>(fnum))
|
||||
<< ", " << args << ", " << sizeof(args) << ", "
|
||||
<< typeid(Ret).name() << ", " << sizeof(Ret) << "]";
|
||||
Ret retval{};
|
||||
@ -316,8 +308,7 @@ Ret Module::sendToReceiver(int fnum, const Arg &args) {
|
||||
template <typename Ret, typename Arg>
|
||||
Ret Module::sendToReceiver(int fnum, const Arg &args) const {
|
||||
LOG(logDEBUG1) << "Sending: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< getFunctionNameFromEnum(static_cast<detFuncs>(fnum))
|
||||
<< ", " << args << ", " << sizeof(args) << ", "
|
||||
<< typeid(Ret).name() << ", " << sizeof(Ret) << "]";
|
||||
Ret retval{};
|
||||
@ -2051,6 +2042,12 @@ void Module::setTimingSource(slsDetectorDefs::timingSourceType value) {
|
||||
sendToDetector(F_SET_TIMING_SOURCE, static_cast<int>(value), nullptr);
|
||||
}
|
||||
|
||||
bool Module::getVeto() { return sendToDetector<int>(F_GET_VETO); }
|
||||
|
||||
void Module::setVeto(bool enable) {
|
||||
sendToDetector(F_SET_VETO, static_cast<int>(enable), nullptr);
|
||||
}
|
||||
|
||||
int Module::setCounterBit(int cb) {
|
||||
return sendToDetector<int>(F_SET_COUNTER_BIT, cb);
|
||||
}
|
||||
|
@ -979,6 +979,12 @@ class Module : public virtual slsDetectorDefs {
|
||||
/** [Gotthard2] Options: TIMING_INTERNAL, TIMING_EXTERNAL */
|
||||
void setTimingSource(slsDetectorDefs::timingSourceType value);
|
||||
|
||||
/** [Gotthard2] */
|
||||
bool getVeto();
|
||||
|
||||
/** default disabled */
|
||||
void setVeto(bool enable);
|
||||
|
||||
/**
|
||||
* Set/get counter bit in detector (Gotthard)
|
||||
* @param i is -1 to get, 0 to reset and any other value to set the counter
|
||||
|
Loading…
x
Reference in New Issue
Block a user