mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-01 00:51:18 +01:00
Dev/define cmd tie bit to reg (#1328)
* strong type wip * moved everythign to bit_utils class * wip, still on testing in ctb reg * passed tests for define
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "sls/Detector.h"
|
||||
#include "sls/TimeHelper.h"
|
||||
#include "sls/ToString.h"
|
||||
#include "sls/bit_utils.h"
|
||||
#include "sls/network_utils.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
|
||||
@@ -1795,6 +1796,78 @@ void init_det(py::module &m) {
|
||||
(std::string(Detector::*)(const defs::dacIndex) const) &
|
||||
Detector::getSlowADCName,
|
||||
py::arg());
|
||||
CppDetectorApi.def("getRegisterDefinitionsCount",
|
||||
(int (Detector::*)() const) &
|
||||
Detector::getRegisterDefinitionsCount);
|
||||
CppDetectorApi.def(
|
||||
"setRegisterDefinition",
|
||||
(void (Detector::*)(const std::string &, sls::RegisterAddress)) &
|
||||
Detector::setRegisterDefinition,
|
||||
py::arg(), py::arg());
|
||||
CppDetectorApi.def("hasRegisterDefinition",
|
||||
(bool (Detector::*)(const std::string &) const) &
|
||||
Detector::hasRegisterDefinition,
|
||||
py::arg());
|
||||
CppDetectorApi.def("hasRegisterDefinition",
|
||||
(bool (Detector::*)(sls::RegisterAddress) const) &
|
||||
Detector::hasRegisterDefinition,
|
||||
py::arg());
|
||||
CppDetectorApi.def(
|
||||
"getRegisterDefinition",
|
||||
(sls::RegisterAddress(Detector::*)(const std::string &) const) &
|
||||
Detector::getRegisterDefinition,
|
||||
py::arg());
|
||||
CppDetectorApi.def("getRegisterDefinition",
|
||||
(std::string(Detector::*)(sls::RegisterAddress) const) &
|
||||
Detector::getRegisterDefinition,
|
||||
py::arg());
|
||||
CppDetectorApi.def("clearRegisterDefinitions",
|
||||
(void (Detector::*)()) &
|
||||
Detector::clearRegisterDefinitions);
|
||||
CppDetectorApi.def(
|
||||
"setRegisterDefinitions",
|
||||
(void (Detector::*)(const std::map<std::string, RegisterAddress> &)) &
|
||||
Detector::setRegisterDefinitions,
|
||||
py::arg());
|
||||
CppDetectorApi.def(
|
||||
"getRegisterDefinitions",
|
||||
(std::map<std::string, RegisterAddress>(Detector::*)() const) &
|
||||
Detector::getRegisterDefinitions);
|
||||
CppDetectorApi.def("getBitDefinitionsCount",
|
||||
(int (Detector::*)() const) &
|
||||
Detector::getBitDefinitionsCount);
|
||||
CppDetectorApi.def(
|
||||
"setBitDefinition",
|
||||
(void (Detector::*)(const std::string &, sls::BitPosition)) &
|
||||
Detector::setBitDefinition,
|
||||
py::arg(), py::arg());
|
||||
CppDetectorApi.def("hasBitDefinition",
|
||||
(bool (Detector::*)(const std::string &) const) &
|
||||
Detector::hasBitDefinition,
|
||||
py::arg());
|
||||
CppDetectorApi.def("hasBitDefinition",
|
||||
(bool (Detector::*)(sls::BitPosition) const) &
|
||||
Detector::hasBitDefinition,
|
||||
py::arg());
|
||||
CppDetectorApi.def(
|
||||
"getBitDefinition",
|
||||
(sls::BitPosition(Detector::*)(const std::string &) const) &
|
||||
Detector::getBitDefinition,
|
||||
py::arg());
|
||||
CppDetectorApi.def("getBitDefinition",
|
||||
(std::string(Detector::*)(sls::BitPosition) const) &
|
||||
Detector::getBitDefinition,
|
||||
py::arg());
|
||||
CppDetectorApi.def("clearBitDefinitions",
|
||||
(void (Detector::*)()) & Detector::clearBitDefinitions);
|
||||
CppDetectorApi.def(
|
||||
"setBitDefinitions",
|
||||
(void (Detector::*)(const std::map<std::string, BitPosition> &)) &
|
||||
Detector::setBitDefinitions,
|
||||
py::arg());
|
||||
CppDetectorApi.def("getBitDefinitions", (std::map<std::string, BitPosition>(
|
||||
Detector::*)() const) &
|
||||
Detector::getBitDefinitions);
|
||||
CppDetectorApi.def("configureTransceiver",
|
||||
(void (Detector::*)(sls::Positions)) &
|
||||
Detector::configureTransceiver,
|
||||
@@ -1968,21 +2041,42 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const bool, sls::Positions)) &
|
||||
Detector::setUpdateMode,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def("readRegister",
|
||||
(Result<sls::RegisterValue>(Detector::*)(
|
||||
sls::RegisterAddress, sls::Positions) const) &
|
||||
Detector::readRegister,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def(
|
||||
"readRegister",
|
||||
(Result<uint32_t>(Detector::*)(uint32_t, sls::Positions) const) &
|
||||
Detector::readRegister,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def(
|
||||
"writeRegister",
|
||||
(void (Detector::*)(sls::RegisterAddress, sls::RegisterValue, bool,
|
||||
sls::Positions)) &
|
||||
Detector::writeRegister,
|
||||
py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{});
|
||||
CppDetectorApi.def(
|
||||
"writeRegister",
|
||||
(void (Detector::*)(uint32_t, uint32_t, bool, sls::Positions)) &
|
||||
Detector::writeRegister,
|
||||
py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{});
|
||||
CppDetectorApi.def(
|
||||
"setBit",
|
||||
(void (Detector::*)(sls::BitPosition, bool, sls::Positions)) &
|
||||
Detector::setBit,
|
||||
py::arg(), py::arg() = false, py::arg() = Positions{});
|
||||
CppDetectorApi.def(
|
||||
"setBit",
|
||||
(void (Detector::*)(uint32_t, int, bool, sls::Positions)) &
|
||||
Detector::setBit,
|
||||
py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{});
|
||||
CppDetectorApi.def(
|
||||
"clearBit",
|
||||
(void (Detector::*)(sls::BitPosition, bool, sls::Positions)) &
|
||||
Detector::clearBit,
|
||||
py::arg(), py::arg() = false, py::arg() = Positions{});
|
||||
CppDetectorApi.def(
|
||||
"clearBit",
|
||||
(void (Detector::*)(uint32_t, int, bool, sls::Positions)) &
|
||||
@@ -1990,7 +2084,12 @@ void init_det(py::module &m) {
|
||||
py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{});
|
||||
CppDetectorApi.def(
|
||||
"getBit",
|
||||
(Result<int>(Detector::*)(uint32_t, int, sls::Positions)) &
|
||||
(Result<int>(Detector::*)(sls::BitPosition, sls::Positions) const) &
|
||||
Detector::getBit,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def(
|
||||
"getBit",
|
||||
(Result<int>(Detector::*)(uint32_t, int, sls::Positions) const) &
|
||||
Detector::getBit,
|
||||
py::arg(), py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def("executeFirmwareTest",
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "sls/Detector.h"
|
||||
#include "sls/ToString.h"
|
||||
#include "sls/network_utils.h"
|
||||
#include "sls/bit_utils.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
#include "sls/TimeHelper.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user