mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-01 10:20:04 +02:00
sort and remove duplicates before sending rxdbitlist
This commit is contained in:
parent
3954913661
commit
2e4783f296
@ -1863,7 +1863,7 @@ std::vector<int> Module::getReceiverDbitList() const {
|
||||
F_GET_RECEIVER_DBIT_LIST);
|
||||
}
|
||||
|
||||
void Module::setReceiverDbitList(const std::vector<int> &list) {
|
||||
void Module::setReceiverDbitList(std::vector<int> list) {
|
||||
LOG(logDEBUG1) << "Setting Receiver Dbit List";
|
||||
if (list.size() > 64) {
|
||||
throw sls::RuntimeError("Dbit list size cannot be greater than 64\n");
|
||||
@ -1874,6 +1874,10 @@ void Module::setReceiverDbitList(const std::vector<int> &list) {
|
||||
"Dbit list value must be between 0 and 63\n");
|
||||
}
|
||||
}
|
||||
std::sort(begin(list), end(list));
|
||||
auto last = std::unique(begin(list), end(list));
|
||||
list.erase(last, list.end());
|
||||
|
||||
sls::StaticVector<int, MAX_RX_DBIT> arg = list;
|
||||
sendToReceiver(F_SET_RECEIVER_DBIT_LIST, arg, nullptr);
|
||||
}
|
||||
|
@ -442,7 +442,7 @@ class Module : public virtual slsDetectorDefs {
|
||||
bool getExternalSampling() const;
|
||||
void setExternalSampling(bool value);
|
||||
std::vector<int> getReceiverDbitList() const;
|
||||
void setReceiverDbitList(const std::vector<int> &list);
|
||||
void setReceiverDbitList(std::vector<int> list);
|
||||
int getReceiverDbitOffset() const;
|
||||
void setReceiverDbitOffset(int value);
|
||||
void setDigitalIODelay(uint64_t pinMask, int delay);
|
||||
|
Loading…
x
Reference in New Issue
Block a user