Dev/ctb separate dac and power (#1420)
Build and Deploy on local RHEL9 / build (push) Successful in 2m12s
Build on RHEL9 docker image / build (push) Successful in 3m33s
Build on RHEL8 docker image / build (push) Successful in 4m54s
Build and Deploy on local RHEL8 / build (push) Successful in 4m54s
Run Simulator Tests on local RHEL9 / build (push) Successful in 14m41s
Run Simulator Tests on local RHEL8 / build (push) Successful in 17m10s

* not allowing power names for dac names to prevent duplicate names

* wip

* v_abcd commands should be removed to prevent unintentional usage and throw with a suggestion command for dac and power

* binary in

* dacs with power dac names should work and do not take in dac units to avoid ambiguity, test with 0 value for power dacs should fail, to do: implement power commands

* wip: power in client, tests, and fixed server interfaces and ctb implementation, not tested

* wip. client and xilinx todo

* wip: ctb power works, tests left

* fixed some tests

* added vchip check

* python cmds still left. wip

* fixed xilinx. python left

* wip

* wip. xilinx

* fixed powerchip for ctb

* power all returns all

* configtransceiver is removed

* wip python

* wip

* wip

* wip

* wip

* wip

* wip

* wip xilinx

* wip

* wip

* wip

* pybindings

* fix getdacindex and getdacname for normal detectors to throw if random index that doesnt fit to the detector

* wip

* fixed tests

* fixes for python api

* wip

* python: moved powerlist to Ctb

* fixed tests to work for powelist in Ctb

* moved signallist, adclist, slowadc, slowadclist to Ctb

* throw approperiate error when no modules added for powers

* added dac test

* fix dac default names and test for dacs

* ctb dacs, yet to do othe rdacs

* dacs should work now even in tests

* run all tests

* DetectorPowers->NamedPowers in ctb

* comments

* removed unnecessary test code

* removed hard coded dac names in python NamedDacs and NamedPowers

* minor

* minor

* fixed error messages

* changed power to  be able to set DAC directly, using enable and disable methods with enabled to get
This commit is contained in:
2026-04-15 10:33:01 +02:00
committed by GitHub
parent 4ee61ae791
commit 5ec5d46c48
60 changed files with 42769 additions and 36358 deletions
+40 -29
View File
@@ -1549,21 +1549,46 @@ void init_det(py::module &m) {
Detector::getSYNCClock,
py::arg() = Positions{});
CppDetectorApi.def("getPowerList",
(std::vector<defs::dacIndex>(Detector::*)() const) &
(std::vector<defs::powerIndex>(Detector::*)() const) &
Detector::getPowerList);
CppDetectorApi.def("getPowerDAC",
(int (Detector::*)(defs::powerIndex) const) &
Detector::getPowerDAC,
py::arg());
CppDetectorApi.def("setPowerDAC",
(void (Detector::*)(defs::powerIndex, int)) &
Detector::setPowerDAC,
py::arg(), py::arg());
CppDetectorApi.def("isPowerEnabled",
(bool (Detector::*)(defs::powerIndex) const) &
Detector::isPowerEnabled,
py::arg());
CppDetectorApi.def(
"setPowerEnabled",
(void (Detector::*)(const std::vector<defs::powerIndex> &, bool)) &
Detector::setPowerEnabled,
py::arg(), py::arg());
CppDetectorApi.def("getMeasuredPower",
(int (Detector::*)(defs::powerIndex) const) &
Detector::getMeasuredPower,
py::arg());
CppDetectorApi.def("getMeasuredCurrent",
(int (Detector::*)(defs::powerIndex) const) &
Detector::getMeasuredCurrent,
py::arg());
CppDetectorApi.def("getVoltageLimit",
(int (Detector::*)() const) & Detector::getVoltageLimit);
CppDetectorApi.def(
"setVoltageLimit",
(void (Detector::*)(const int)) & Detector::setVoltageLimit, py::arg());
CppDetectorApi.def("getSlowADCList",
(std::vector<defs::dacIndex>(Detector::*)() const) &
Detector::getSlowADCList);
CppDetectorApi.def(
"getPower",
"getSlowADC",
(Result<int>(Detector::*)(defs::dacIndex, sls::Positions) const) &
Detector::getPower,
Detector::getSlowADC,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def(
"setPower",
(void (Detector::*)(defs::dacIndex, int, sls::Positions)) &
Detector::setPower,
py::arg(), py::arg(), py::arg() = Positions{});
CppDetectorApi.def("getADCVpp",
(Result<int>(Detector::*)(bool, sls::Positions) const) &
Detector::getADCVpp,
@@ -1629,21 +1654,6 @@ void init_det(py::module &m) {
(void (Detector::*)(int, sls::Positions)) &
Detector::setDBITClock,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def(
"getMeasuredPower",
(Result<int>(Detector::*)(defs::dacIndex, sls::Positions) const) &
Detector::getMeasuredPower,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def(
"getMeasuredCurrent",
(Result<int>(Detector::*)(defs::dacIndex, sls::Positions) const) &
Detector::getMeasuredCurrent,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def(
"getSlowADC",
(Result<int>(Detector::*)(defs::dacIndex, sls::Positions) const) &
Detector::getSlowADC,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def("getExternalSamplingSource",
(Result<int>(Detector::*)(sls::Positions) const) &
Detector::getExternalSamplingSource,
@@ -1766,18 +1776,19 @@ void init_det(py::module &m) {
Detector::getPowerNames);
CppDetectorApi.def(
"getPowerIndex",
(defs::dacIndex(Detector::*)(const std::string &) const) &
(defs::powerIndex(Detector::*)(const std::string &) const) &
Detector::getPowerIndex,
py::arg());
CppDetectorApi.def(
"setPowerName",
(void (Detector::*)(const defs::dacIndex, const std::string &)) &
(void (Detector::*)(const defs::powerIndex, const std::string &)) &
Detector::setPowerName,
py::arg(), py::arg());
CppDetectorApi.def("getPowerName",
(std::string(Detector::*)(const defs::dacIndex) const) &
Detector::getPowerName,
py::arg());
CppDetectorApi.def(
"getPowerName",
(std::string(Detector::*)(const defs::powerIndex) const) &
Detector::getPowerName,
py::arg());
CppDetectorApi.def("setSlowADCNames",
(void (Detector::*)(const std::vector<std::string>)) &
Detector::setSlowADCNames,
+20 -12
View File
@@ -29,6 +29,12 @@ void init_enums(py::module &m) {
slsDetectorDefs::detectorType::XILINX_CHIPTESTBOARD)
.export_values();
py::enum_<slsDetectorDefs::boolFormat>(Defs, "boolFormat")
.value("TrueFalse", slsDetectorDefs::boolFormat::TrueFalse)
.value("OnOff", slsDetectorDefs::boolFormat::OnOff)
.value("OneZero", slsDetectorDefs::boolFormat::OneZero)
.export_values();
py::enum_<slsDetectorDefs::runStatus>(Defs, "runStatus")
.value("IDLE", slsDetectorDefs::runStatus::IDLE)
.value("ERROR", slsDetectorDefs::runStatus::ERROR)
@@ -175,18 +181,6 @@ void init_enums(py::module &m) {
.value("TEMPERATURE_FPGA3",
slsDetectorDefs::dacIndex::TEMPERATURE_FPGA3)
.value("TRIMBIT_SCAN", slsDetectorDefs::dacIndex::TRIMBIT_SCAN)
.value("V_POWER_A", slsDetectorDefs::dacIndex::V_POWER_A)
.value("V_POWER_B", slsDetectorDefs::dacIndex::V_POWER_B)
.value("V_POWER_C", slsDetectorDefs::dacIndex::V_POWER_C)
.value("V_POWER_D", slsDetectorDefs::dacIndex::V_POWER_D)
.value("V_POWER_IO", slsDetectorDefs::dacIndex::V_POWER_IO)
.value("V_POWER_CHIP", slsDetectorDefs::dacIndex::V_POWER_CHIP)
.value("I_POWER_A", slsDetectorDefs::dacIndex::I_POWER_A)
.value("I_POWER_B", slsDetectorDefs::dacIndex::I_POWER_B)
.value("I_POWER_C", slsDetectorDefs::dacIndex::I_POWER_C)
.value("I_POWER_D", slsDetectorDefs::dacIndex::I_POWER_D)
.value("I_POWER_IO", slsDetectorDefs::dacIndex::I_POWER_IO)
.value("V_LIMIT", slsDetectorDefs::dacIndex::V_LIMIT)
.value("SLOW_ADC0", slsDetectorDefs::dacIndex::SLOW_ADC0)
.value("SLOW_ADC1", slsDetectorDefs::dacIndex::SLOW_ADC1)
.value("SLOW_ADC2", slsDetectorDefs::dacIndex::SLOW_ADC2)
@@ -198,6 +192,20 @@ void init_enums(py::module &m) {
.value("SLOW_ADC_TEMP", slsDetectorDefs::dacIndex::SLOW_ADC_TEMP)
.export_values();
py::enum_<slsDetectorDefs::powerIndex>(Defs, "powerIndex")
.value("V_POWER_A", slsDetectorDefs::powerIndex::V_POWER_A)
.value("V_POWER_B", slsDetectorDefs::powerIndex::V_POWER_B)
.value("V_POWER_C", slsDetectorDefs::powerIndex::V_POWER_C)
.value("V_POWER_D", slsDetectorDefs::powerIndex::V_POWER_D)
.value("V_POWER_IO", slsDetectorDefs::powerIndex::V_POWER_IO)
.value("V_POWER_CHIP", slsDetectorDefs::powerIndex::V_POWER_CHIP)
.value("I_POWER_A", slsDetectorDefs::powerIndex::I_POWER_A)
.value("I_POWER_B", slsDetectorDefs::powerIndex::I_POWER_B)
.value("I_POWER_C", slsDetectorDefs::powerIndex::I_POWER_C)
.value("I_POWER_D", slsDetectorDefs::powerIndex::I_POWER_D)
.value("I_POWER_IO", slsDetectorDefs::powerIndex::I_POWER_IO)
.export_values();
py::enum_<slsDetectorDefs::detectorSettings>(Defs, "detectorSettings")
.value("STANDARD", slsDetectorDefs::detectorSettings::STANDARD)
.value("FAST", slsDetectorDefs::detectorSettings::FAST)