mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-06-30 02:26:12 +02:00
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
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:
@@ -819,6 +819,50 @@ void Module::setPowerChip(bool on) {
|
||||
sendToDetector<int>(F_POWER_CHIP, static_cast<int>(on));
|
||||
}
|
||||
|
||||
int Module::getPowerDAC(defs::powerIndex index) const {
|
||||
return sendToDetector<int>(F_GET_POWER_DAC, static_cast<int>(index));
|
||||
}
|
||||
|
||||
void Module::setPowerDAC(defs::powerIndex index, int value) {
|
||||
int args[]{static_cast<int>(index), value};
|
||||
sendToDetector(F_SET_POWER_DAC, args, nullptr);
|
||||
}
|
||||
|
||||
bool Module::isPowerEnabled(defs::powerIndex index) const {
|
||||
return sendToDetector<int>(F_GET_POWER, static_cast<int>(index));
|
||||
}
|
||||
|
||||
void Module::setPowerEnabled(const std::vector<defs::powerIndex> &indices,
|
||||
bool enable) {
|
||||
auto client = DetectorSocket(shm()->hostname, shm()->controlPort);
|
||||
client.Send(F_SET_POWER);
|
||||
client.setFnum(F_SET_POWER);
|
||||
int count = indices.size();
|
||||
client.Send(count);
|
||||
std::vector<int> indices_int(count);
|
||||
for (size_t i = 0; i < indices.size(); ++i) {
|
||||
indices_int[i] = static_cast<int>(indices[i]);
|
||||
}
|
||||
client.Send(indices_int);
|
||||
client.Send(static_cast<int>(enable));
|
||||
if (client.Receive<int>() == FAIL) {
|
||||
throw DetectorError("Detector " + std::to_string(moduleIndex) +
|
||||
" returned error: " + client.readErrorMessage());
|
||||
}
|
||||
}
|
||||
|
||||
int Module::getPowerADC(defs::powerIndex index) const {
|
||||
return sendToDetector<int>(F_GET_POWER_ADC, static_cast<int>(index));
|
||||
}
|
||||
|
||||
int Module::getVoltageLimit() const {
|
||||
return sendToDetector<int>(F_GET_VOLTAGE_LIMIT);
|
||||
}
|
||||
|
||||
void Module::setVoltageLimit(const int limit_in_mV) {
|
||||
sendToDetector(F_SET_VOLTAGE_LIMIT, limit_in_mV, nullptr);
|
||||
}
|
||||
|
||||
int Module::getImageTestMode() const {
|
||||
return sendToDetector<int>(F_GET_IMAGE_TEST_MODE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user