mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-04 00:50:42 +02:00
bitwise operators for gain caps
This commit is contained in:
parent
6793f5e530
commit
6c662b1370
@ -13,8 +13,8 @@ import subprocess
|
||||
|
||||
from parse import remove_comments
|
||||
|
||||
allow_bitwise_op = ["M3_GainCaps"]
|
||||
allow_bitwise_op = ["streamingInterface"]
|
||||
|
||||
allow_bitwise_op = ["streamingInterface", "M3_GainCaps"]
|
||||
|
||||
op_key = {"operator|": "|",
|
||||
"operator&" : "&"}
|
||||
|
@ -273,14 +273,17 @@ void init_enums(py::module &m) {
|
||||
slsDetectorDefs::timingSourceType::TIMING_EXTERNAL)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::M3_GainCaps>(Defs, "M3_GainCaps")
|
||||
py::enum_<slsDetectorDefs::M3_GainCaps>(Defs, "M3_GainCaps",
|
||||
py::arithmetic())
|
||||
.value("M3_C10pre", slsDetectorDefs::M3_GainCaps::M3_C10pre)
|
||||
.value("M3_C15sh", slsDetectorDefs::M3_GainCaps::M3_C15sh)
|
||||
.value("M3_C30sh", slsDetectorDefs::M3_GainCaps::M3_C30sh)
|
||||
.value("M3_C50sh", slsDetectorDefs::M3_GainCaps::M3_C50sh)
|
||||
.value("M3_C225ACsh", slsDetectorDefs::M3_GainCaps::M3_C225ACsh)
|
||||
.value("M3_C15pre", slsDetectorDefs::M3_GainCaps::M3_C15pre)
|
||||
.export_values();
|
||||
.export_values()
|
||||
.def(py::self | slsDetectorDefs::M3_GainCaps())
|
||||
.def(py::self & slsDetectorDefs::M3_GainCaps());
|
||||
|
||||
py::enum_<slsDetectorDefs::portPosition>(Defs, "portPosition")
|
||||
.value("LEFT", slsDetectorDefs::portPosition::LEFT)
|
||||
|
@ -576,6 +576,21 @@ operator&(const slsDetectorDefs::streamingInterface &a,
|
||||
return slsDetectorDefs::streamingInterface(static_cast<int32_t>(a) &
|
||||
static_cast<int32_t>(b));
|
||||
};
|
||||
|
||||
inline slsDetectorDefs::M3_GainCaps
|
||||
operator|(const slsDetectorDefs::M3_GainCaps &a,
|
||||
const slsDetectorDefs::M3_GainCaps &b) {
|
||||
return slsDetectorDefs::M3_GainCaps(static_cast<int32_t>(a) |
|
||||
static_cast<int32_t>(b));
|
||||
};
|
||||
|
||||
inline slsDetectorDefs::M3_GainCaps
|
||||
operator&(const slsDetectorDefs::M3_GainCaps &a,
|
||||
const slsDetectorDefs::M3_GainCaps &b) {
|
||||
return slsDetectorDefs::M3_GainCaps(static_cast<int32_t>(a) &
|
||||
static_cast<int32_t>(b));
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Loading…
x
Reference in New Issue
Block a user