mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 04:17:15 +02:00
binaries in, merge fix
This commit is contained in:
@ -12,7 +12,7 @@ import subprocess
|
||||
from parse import remove_comments
|
||||
|
||||
allow_bitwise_op = ["M3_GainCaps"]
|
||||
allow_bitwise_op = ["ethernetInterface"]
|
||||
allow_bitwise_op = ["streamingInterface"]
|
||||
|
||||
op_key = {"operator|": "__or__",
|
||||
"operator&" : "__and__"}
|
||||
@ -23,7 +23,7 @@ def single_line_enum(line):
|
||||
|
||||
def extract_enums(lines):
|
||||
|
||||
# deal with enum class ethernetInterface : int32_t
|
||||
# deal with enum class streamingInterface : int32_t
|
||||
# and normal enum burstMode {
|
||||
|
||||
line_iter = iter(lines)
|
||||
@ -90,7 +90,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::streamingInterface&, const slsDetectorDefs::streamingInterface&>(&{op}))")
|
||||
|
||||
|
||||
data.append(';\n\n')
|
||||
|
@ -7,7 +7,7 @@ timingMode = slsDetectorDefs.timingMode
|
||||
speedLevel = slsDetectorDefs.speedLevel
|
||||
dacIndex = slsDetectorDefs.dacIndex
|
||||
detectorType = slsDetectorDefs.detectorType
|
||||
ethernetInterface = slsDetectorDefs.ethernetInterface
|
||||
streamingInterface = slsDetectorDefs.streamingInterface
|
||||
|
||||
defs = slsDetectorDefs
|
||||
|
||||
@ -2433,7 +2433,7 @@ class Detector(CppDetectorApi):
|
||||
Note
|
||||
----
|
||||
Default: both off
|
||||
Options: NONE, I3GBE, 10GBE (debugging)
|
||||
Options: NONE, LOW_LATENCY_LINK, 10GBE (debugging)
|
||||
Debugging interface also enables second interface in receiver (separate file), which also restarts zmq streaming if enabled.
|
||||
"""
|
||||
return self.getVetoStream()
|
||||
@ -2449,10 +2449,10 @@ class Detector(CppDetectorApi):
|
||||
"""[Gotthard2] Algorithm used for veto
|
||||
Example
|
||||
----------
|
||||
>>> d.vetoalg = defs.DEFAULT_ALGORITHM, defs.I10GBE
|
||||
>>> d.vetoalg = defs.DEFAULT_ALGORITHM, defs.ETHERNET_10GB
|
||||
"""
|
||||
result = {}
|
||||
interface = [ethernetInterface.I3GBE, ethernetInterface.I10GBE]
|
||||
interface = [streamingInterface.LOW_LATENCY_LINK, streamingInterface.ETHERNET_10GB]
|
||||
for eth in interface:
|
||||
result[eth] = element_if_equal(self.getVetoAlgorithm(eth))
|
||||
return result
|
||||
|
@ -1137,23 +1137,23 @@ void init_det(py::module &m) {
|
||||
Detector::setVeto,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getVetoStream",
|
||||
(Result<defs::ethernetInterface>(Detector::*)(sls::Positions)
|
||||
(Result<defs::streamingInterface>(Detector::*)(sls::Positions)
|
||||
const) &
|
||||
Detector::getVetoStream,
|
||||
py::arg() = Positions{})
|
||||
.def("setVetoStream",
|
||||
(void (Detector::*)(const defs::ethernetInterface,
|
||||
(void (Detector::*)(const defs::streamingInterface,
|
||||
sls::Positions)) &
|
||||
Detector::setVetoStream,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getVetoAlgorithm",
|
||||
(Result<defs::vetoAlgorithm>(Detector::*)(
|
||||
const defs::ethernetInterface, sls::Positions) const) &
|
||||
const defs::streamingInterface, sls::Positions) const) &
|
||||
Detector::getVetoAlgorithm,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("setVetoAlgorithm",
|
||||
(void (Detector::*)(const defs::vetoAlgorithm,
|
||||
const defs::ethernetInterface,
|
||||
const defs::streamingInterface,
|
||||
sls::Positions)) &
|
||||
Detector::setVetoAlgorithm,
|
||||
py::arg(), py::arg(), py::arg() = Positions{})
|
||||
|
@ -286,20 +286,20 @@ void init_enums(py::module &m) {
|
||||
.value("BOTTOM", slsDetectorDefs::portPosition::BOTTOM)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::ethernetInterface>(Defs, "ethernetInterface",
|
||||
py::enum_<slsDetectorDefs::streamingInterface>(Defs, "streamingInterface",
|
||||
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::streamingInterface::NONE)
|
||||
.value("LOW_LATENCY_LINK", slsDetectorDefs::streamingInterface::LOW_LATENCY_LINK)
|
||||
.value("ETHERNET_10GB", slsDetectorDefs::streamingInterface::ETHERNET_10GB)
|
||||
.value("ALL", slsDetectorDefs::streamingInterface::ALL)
|
||||
.export_values()
|
||||
.def("__or__",
|
||||
py::overload_cast<const slsDetectorDefs::ethernetInterface &,
|
||||
const slsDetectorDefs::ethernetInterface &>(
|
||||
py::overload_cast<const slsDetectorDefs::streamingInterface &,
|
||||
const slsDetectorDefs::streamingInterface &>(
|
||||
&operator|))
|
||||
.def("__and__",
|
||||
py::overload_cast<const slsDetectorDefs::ethernetInterface &,
|
||||
const slsDetectorDefs::ethernetInterface &>(
|
||||
py::overload_cast<const slsDetectorDefs::streamingInterface &,
|
||||
const slsDetectorDefs::streamingInterface &>(
|
||||
&operator&));
|
||||
|
||||
py::enum_<slsDetectorDefs::vetoAlgorithm>(Defs, "vetoAlgorithm")
|
||||
|
Reference in New Issue
Block a user