mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-19 16:27:13 +02:00
Setting dac names for CTB (C++ and Python) (#413)
# Setting DAC names for CTB * Introduced new shared memory for CTB only * Prepared for additional functionality * Works from C++ and Python Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
This commit is contained in:
31
slsDetectorSoftware/src/CtbConfig.h
Normal file
31
slsDetectorSoftware/src/CtbConfig.h
Normal file
@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <vector>
|
||||
namespace sls {
|
||||
|
||||
|
||||
class CtbConfig {
|
||||
static constexpr size_t name_length = 20;
|
||||
static constexpr size_t num_dacs = 18;
|
||||
static constexpr const char* shm_tag_ = "ctbdacs";
|
||||
char dacnames[name_length * num_dacs]{};
|
||||
|
||||
void check_index(size_t i) const;
|
||||
void check_size(const std::string &name) const;
|
||||
|
||||
public:
|
||||
CtbConfig();
|
||||
CtbConfig(const CtbConfig&) = default;
|
||||
CtbConfig(CtbConfig&&) = default;
|
||||
CtbConfig& operator=(const CtbConfig&) = default;
|
||||
~CtbConfig() = default;
|
||||
|
||||
void setDacNames(const std::vector<std::string> &names);
|
||||
void setDacName(size_t index, const std::string &name);
|
||||
std::string getDacName(size_t index) const;
|
||||
std::vector<std::string> getDacNames() const;
|
||||
static const char* shm_tag();
|
||||
};
|
||||
|
||||
|
||||
} // namespace sls
|
Reference in New Issue
Block a user