Merge branch 'apidhanya' of github.com:slsdetectorgroup/slsDetectorPackage into apidhanya

This commit is contained in:
Erik Frojdh
2019-08-09 16:35:33 +02:00
6 changed files with 240 additions and 54 deletions

View File

@ -558,6 +558,146 @@ void Detector::setDBITPipeline(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PIPELINE, value, 0);
}
Result<int> Detector::getDynamicRange(Positions pos) const {
return pimpl->Parallel(&slsDetector::setDynamicRange, pos, -1);
}
void Detector::setDynamicRange(int value) { pimpl->setDynamicRange(value); }
Result<int> Detector::getHighVoltage(Positions pos) const {
return pimpl->Parallel(&slsDetector::setDAC, pos, -1, defs::HIGH_VOLTAGE,
0);
}
void Detector::setHighVoltage(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setDAC, pos, value, defs::HIGH_VOLTAGE, 0);
}
Result<int> Detector::getIODelay(Positions pos) const {
return pimpl->Parallel(&slsDetector::setDAC, pos, -1, defs::IO_DELAY, 0);
}
void Detector::setIODelay(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setDAC, pos, value, defs::IO_DELAY, 0);
}
Result<int> Detector::getTemp(defs::dacIndex index, Positions pos) const {
switch (index) {
case defs::TEMPERATURE_ADC:
case defs::TEMPERATURE_FPGA:
case defs::TEMPERATURE_FPGAEXT:
case defs::TEMPERATURE_10GE:
case defs::TEMPERATURE_DCDC:
case defs::TEMPERATURE_SODL:
case defs::TEMPERATURE_SODR:
case defs::TEMPERATURE_FPGA2:
case defs::TEMPERATURE_FPGA3:
case defs::SLOW_ADC_TEMP:
break;
default:
throw RuntimeError("Unknown Temperature Index");
}
auto res = pimpl->Parallel(&slsDetector::getADC, pos, index);
switch (getDetectorType()) {
case defs::EIGER:
case defs::JUNGFRAU:
for (auto it : pos) {
it /= 1000;
}
break;
default:
break;
}
return res;
}
Result<int> Detector::getVrefVoltage(bool mV, Positions pos) const {
return pimpl->Parallel(&slsDetector::setDAC, pos, -1, defs::ADC_VPP, mV);
}
void Detector::setVrefVoltage(int value, bool mV, Positions pos) {
pimpl->Parallel(&slsDetector::setDAC, pos, value, defs::ADC_VPP, mV);
}
Result<int> Detector::getVoltage(defs::dacIndex index, Positions pos) const {
switch (index) {
case defs::V_LIMIT:
case defs::V_POWER_A:
case defs::V_POWER_B:
case defs::V_POWER_C:
case defs::V_POWER_D:
case defs::V_POWER_IO:
case defs::V_POWER_CHIP:
break;
default:
throw RuntimeError("Unknown Voltage Index");
}
return pimpl->Parallel(&slsDetector::setDAC, pos, -1, index, 1);
}
void Detector::setVoltage(int value, defs::dacIndex index, Positions pos) {
switch (index) {
case defs::V_LIMIT:
case defs::V_POWER_A:
case defs::V_POWER_B:
case defs::V_POWER_C:
case defs::V_POWER_D:
case defs::V_POWER_IO:
case defs::V_POWER_CHIP:
break;
default:
throw RuntimeError("Unknown Voltage Index");
}
pimpl->Parallel(&slsDetector::setDAC, pos, value, index, 1);
}
Result<int> Detector::getMeasuredVoltage(defs::dacIndex index,
Positions pos) const {
switch (index) {
case defs::V_POWER_A:
case defs::V_POWER_B:
case defs::V_POWER_C:
case defs::V_POWER_D:
case defs::V_POWER_IO:
case defs::V_POWER_CHIP:
break;
default:
throw RuntimeError("Unknown Voltage Index");
}
return pimpl->Parallel(&slsDetector::getADC, pos, index);
}
Result<int> Detector::getMeasuredCurrent(defs::dacIndex index,
Positions pos) const {
switch (index) {
case defs::I_POWER_A:
case defs::I_POWER_B:
case defs::I_POWER_C:
case defs::I_POWER_D:
case defs::I_POWER_IO:
break;
default:
throw RuntimeError("Unknown Current Index");
}
return pimpl->Parallel(&slsDetector::getADC, pos, index);
}
Result<int> Detector::getSlowADC(defs::dacIndex index, Positions pos) const {
if (index < defs::SLOW_ADC0 || index > defs::SLOW_ADC7) {
throw RuntimeError("Unknown Slow ADC Index");
}
return pimpl->Parallel(&slsDetector::getADC, pos, index);
}
Result<int> Detector::getDAC(defs::dacIndex index, bool mV,
Positions pos) const {
return pimpl->Parallel(&slsDetector::setDAC, pos, -1, index, mV);
}
void Detector::setDAC(int value, defs::dacIndex index, bool mV, Positions pos) {
pimpl->Parallel(&slsDetector::setDAC, pos, value, index, mV);
}
// Erik
Result<int> Detector::getFramesCaughtByReceiver(Positions pos) const {
return pimpl->Parallel(&slsDetector::getFramesCaughtByReceiver, pos);