mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 04:17:15 +02:00
vetoalg: wip
This commit is contained in:
@ -11,7 +11,7 @@ import subprocess
|
||||
|
||||
from parse import remove_comments
|
||||
|
||||
allow_bitwise_op = ["EthernetInterface"]
|
||||
allow_bitwise_op = ["ethernetInterface"]
|
||||
|
||||
op_key = {"operator|": "__or__",
|
||||
"operator&" : "__and__"}
|
||||
@ -22,7 +22,7 @@ def single_line_enum(line):
|
||||
|
||||
def extract_enums(lines):
|
||||
|
||||
# deal with enum class EthernetInterface : int32_t
|
||||
# deal with enum class ethernetInterface : int32_t
|
||||
# and normal enum burstMode {
|
||||
|
||||
line_iter = iter(lines)
|
||||
@ -89,7 +89,7 @@ def generate_enum_string(enums):
|
||||
|
||||
#Here add the operators
|
||||
for op in operators:
|
||||
data.append(f"\n\t.def(\"{op_key[op]}\", py::overload_cast< const slsDetectorDefs::EthernetInterface&, const slsDetectorDefs::EthernetInterface&>(&{op}))")
|
||||
data.append(f"\n\t.def(\"{op_key[op]}\", py::overload_cast< const slsDetectorDefs::ethernetInterface&, const slsDetectorDefs::ethernetInterface&>(&{op}))")
|
||||
|
||||
|
||||
data.append(';\n\n')
|
||||
|
@ -1075,12 +1075,12 @@ void init_det(py::module &m) {
|
||||
Detector::setVeto,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getVetoStream",
|
||||
(Result<defs::EthernetInterface>(Detector::*)(sls::Positions)
|
||||
(Result<defs::ethernetInterface>(Detector::*)(sls::Positions)
|
||||
const) &
|
||||
Detector::getVetoStream,
|
||||
py::arg() = Positions{})
|
||||
.def("setVetoStream",
|
||||
(void (Detector::*)(const defs::EthernetInterface,
|
||||
(void (Detector::*)(const defs::ethernetInterface,
|
||||
sls::Positions)) &
|
||||
Detector::setVetoStream,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
|
@ -278,19 +278,19 @@ void init_enums(py::module &m) {
|
||||
slsDetectorDefs::timingSourceType::TIMING_EXTERNAL)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::EthernetInterface>(Defs, "EthernetInterface",
|
||||
py::enum_<slsDetectorDefs::ethernetInterface>(Defs, "ethernetInterface",
|
||||
py::arithmetic())
|
||||
.value("NONE", slsDetectorDefs::EthernetInterface::NONE)
|
||||
.value("I3GBE", slsDetectorDefs::EthernetInterface::I3GBE)
|
||||
.value("I10GBE", slsDetectorDefs::EthernetInterface::I10GBE)
|
||||
.value("ALL", slsDetectorDefs::EthernetInterface::ALL)
|
||||
.value("NONE", slsDetectorDefs::ethernetInterface::NONE)
|
||||
.value("I3GBE", slsDetectorDefs::ethernetInterface::I3GBE)
|
||||
.value("I10GBE", slsDetectorDefs::ethernetInterface::I10GBE)
|
||||
.value("ALL", slsDetectorDefs::ethernetInterface::ALL)
|
||||
.export_values()
|
||||
.def("__or__",
|
||||
py::overload_cast<const slsDetectorDefs::EthernetInterface &,
|
||||
const slsDetectorDefs::EthernetInterface &>(
|
||||
py::overload_cast<const slsDetectorDefs::ethernetInterface &,
|
||||
const slsDetectorDefs::ethernetInterface &>(
|
||||
&operator|))
|
||||
.def("__and__",
|
||||
py::overload_cast<const slsDetectorDefs::EthernetInterface &,
|
||||
const slsDetectorDefs::EthernetInterface &>(
|
||||
py::overload_cast<const slsDetectorDefs::ethernetInterface &,
|
||||
const slsDetectorDefs::ethernetInterface &>(
|
||||
&operator&));
|
||||
}
|
||||
|
Reference in New Issue
Block a user