Merge branch 'm3' into eiger

This commit is contained in:
maliakal_d 2020-07-30 11:31:55 +02:00
commit 7899c5faef
2 changed files with 6 additions and 4 deletions

View File

@ -1392,8 +1392,8 @@ void Module::setInjectChannel(const int offsetChannel,
sendToDetector(F_SET_INJECT_CHANNEL, args, nullptr);
}
void Module::sendVetoPhoton(const int chipIndex, std::vector<int> gainIndices,
std::vector<int> values) {
void Module::sendVetoPhoton(const int chipIndex, const std::vector<int>& gainIndices,
const std::vector<int>& values) {
const int nch = gainIndices.size();
if (gainIndices.size() != values.size()) {
throw RuntimeError("Number of Gain Indices and values do not match! "
@ -1409,6 +1409,8 @@ void Module::sendVetoPhoton(const int chipIndex, std::vector<int> gainIndices,
auto client = DetectorSocket(shm()->hostname, shm()->controlPort);
client.Send(&fnum, sizeof(fnum));
client.Send(args, sizeof(args));
client.Send(gainIndices.data(), sizeof(decltype(gainIndices[0])) * nch);
client.Send(values.data(), sizeof(decltype(values[0])) * nch);
client.Send(gainIndices.data(), sizeof(int) * nch);
client.Send(values.data(), sizeof(int) * nch);
client.Receive(&ret, sizeof(ret));

View File

@ -371,8 +371,8 @@ class Module : public virtual slsDetectorDefs {
void setBurstPeriod(int64_t value);
std::array<int, 2> getInjectChannel() const;
void setInjectChannel(const int offsetChannel, const int incrementChannel);
void sendVetoPhoton(const int chipIndex, std::vector<int> gainIndices,
std::vector<int> values);
void sendVetoPhoton(const int chipIndex, const std::vector<int>& gainIndices,
const std::vector<int>& values);
void getVetoPhoton(const int chipIndex, const std::string &fname) const;
void setVetoPhoton(const int chipIndex, const int numPhotons,
const int energy, const std::string &fname);