mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 16:20:03 +02:00
new version of send to detector
This commit is contained in:
parent
f940397e3a
commit
81911fae3c
@ -164,6 +164,17 @@ void Module::sendToDetector(int fnum) {
|
|||||||
sendToDetector(fnum, nullptr, 0, nullptr, 0);
|
sendToDetector(fnum, nullptr, 0, nullptr, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename Ret>
|
||||||
|
Ret Module::sendToDetector(int fnum){
|
||||||
|
LOG(logDEBUG1) << "Sending: ["
|
||||||
|
<< getFunctionNameFromEnum(static_cast<slsDetectorDefs::detFuncs>(fnum))
|
||||||
|
<< ", nullptr, 0, " << typeid(Ret).name() << ", " << sizeof(Ret) << "]";
|
||||||
|
Ret retval{};
|
||||||
|
sendToDetector(fnum, nullptr, 0, &retval, sizeof(retval));
|
||||||
|
LOG(logDEBUG1) << "Got back: " << retval;
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
void Module::sendToDetectorStop(int fnum, const void *args,
|
void Module::sendToDetectorStop(int fnum, const void *args,
|
||||||
size_t args_size, void *retval,
|
size_t args_size, void *retval,
|
||||||
size_t retval_size) {
|
size_t retval_size) {
|
||||||
@ -1277,10 +1288,7 @@ void Module::setNumberOfDigitalSamples(int value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t Module::getExptime() {
|
int64_t Module::getExptime() {
|
||||||
int64_t retval = -1;
|
return sendToDetector<int64_t>(F_GET_EXPTIME);
|
||||||
sendToDetector(F_GET_EXPTIME, nullptr, retval);
|
|
||||||
LOG(logDEBUG1) << "exptime :" << retval << "ns";
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::setExptime(int64_t value) {
|
void Module::setExptime(int64_t value) {
|
||||||
@ -1303,10 +1311,7 @@ void Module::setExptime(int64_t value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t Module::getPeriod() {
|
int64_t Module::getPeriod() {
|
||||||
int64_t retval = -1;
|
return sendToDetector<int64_t>(F_GET_PERIOD);
|
||||||
sendToDetector(F_GET_PERIOD, nullptr, retval);
|
|
||||||
LOG(logDEBUG1) << "period :" << retval << "ns";
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::setPeriod(int64_t value) {
|
void Module::setPeriod(int64_t value) {
|
||||||
@ -1319,10 +1324,7 @@ void Module::setPeriod(int64_t value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t Module::getDelayAfterTrigger() {
|
int64_t Module::getDelayAfterTrigger() {
|
||||||
int64_t retval = -1;
|
return sendToDetector<int64_t>(F_GET_DELAY_AFTER_TRIGGER);
|
||||||
sendToDetector(F_GET_DELAY_AFTER_TRIGGER, nullptr, retval);
|
|
||||||
LOG(logDEBUG1) << "delay after trigger :" << retval << "ns";
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::setDelayAfterTrigger(int64_t value) {
|
void Module::setDelayAfterTrigger(int64_t value) {
|
||||||
@ -1331,10 +1333,7 @@ void Module::setDelayAfterTrigger(int64_t value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t Module::getBurstPeriod() {
|
int64_t Module::getBurstPeriod() {
|
||||||
int64_t retval = -1;
|
return sendToDetector<int64_t>(F_GET_BURST_PERIOD);
|
||||||
sendToDetector(F_GET_BURST_PERIOD, nullptr, retval);
|
|
||||||
LOG(logDEBUG1) << "burst period :" << retval << "ns";
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::setBurstPeriod(int64_t value) {
|
void Module::setBurstPeriod(int64_t value) {
|
||||||
@ -1343,10 +1342,7 @@ void Module::setBurstPeriod(int64_t value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t Module::getSubExptime() {
|
int64_t Module::getSubExptime() {
|
||||||
int64_t retval = -1;
|
return sendToDetector<int64_t>(F_GET_SUB_EXPTIME);
|
||||||
sendToDetector(F_GET_SUB_EXPTIME, nullptr, retval);
|
|
||||||
LOG(logDEBUG1) << "sub exptime :" << retval << "ns";
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::setSubExptime(int64_t value) {
|
void Module::setSubExptime(int64_t value) {
|
||||||
@ -1369,10 +1365,7 @@ void Module::setSubExptime(int64_t value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t Module::getSubDeadTime() {
|
int64_t Module::getSubDeadTime() {
|
||||||
int64_t retval = -1;
|
return sendToDetector<int64_t>(F_GET_SUB_DEADTIME);
|
||||||
sendToDetector(F_GET_SUB_DEADTIME, nullptr, retval);
|
|
||||||
LOG(logDEBUG1) << "sub deadtime :" << retval << "ns";
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::setSubDeadTime(int64_t value) {
|
void Module::setSubDeadTime(int64_t value) {
|
||||||
|
@ -1915,6 +1915,9 @@ class Module : public virtual slsDetectorDefs {
|
|||||||
void sendToDetector(int fnum, std::nullptr_t, Ret &retval);
|
void sendToDetector(int fnum, std::nullptr_t, Ret &retval);
|
||||||
void sendToDetector(int fnum);
|
void sendToDetector(int fnum);
|
||||||
|
|
||||||
|
template <typename Ret>
|
||||||
|
Ret sendToDetector(int fnum);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send function parameters to detector (stop server)
|
* Send function parameters to detector (stop server)
|
||||||
* @param fnum function enum
|
* @param fnum function enum
|
||||||
|
Loading…
x
Reference in New Issue
Block a user