Merge branch 'developer' into pydoc

This commit is contained in:
maliakal_d 2020-09-10 12:01:38 +02:00
commit 11e7d89da3
13 changed files with 33 additions and 29 deletions

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "sls_detector_defs.h" #include "sls_detector_defs.h"
#define REQUIRED_FIRMWARE_VERSION (26) #define REQUIRED_FIRMWARE_VERSION (27)
#define IDFILECOMMAND "more /home/root/executables/detid.txt" #define IDFILECOMMAND "more /home/root/executables/detid.txt"
#define CONFIG_FILE ("config_eiger.txt") #define CONFIG_FILE ("config_eiger.txt")
#define WAIT_STOP_SERVER_START (1 * 1000 * 1000) #define WAIT_STOP_SERVER_START (1 * 1000 * 1000)

View File

@ -354,12 +354,13 @@ class Detector {
/** /**
* (Degrees) * (Degrees)
* [Gotthard] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA * [Gotthard] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA \n
* [Jungfrau] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA * [Jungfrau] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA \n
* [Eiger] Options: TEMPERATURE_FPGA, TEMPERATURE_FPGAEXT, TEMPERATURE_10GE, * [Eiger] Options: TEMPERATURE_FPGA, TEMPERATURE_FPGAEXT, TEMPERATURE_10GE,
* TEMPERATURE_DCDC, TEMPERATURE_SODL, TEMPERATURE_SODR, TEMPERATURE_FPGA2, * TEMPERATURE_DCDC, TEMPERATURE_SODL, TEMPERATURE_SODR, TEMPERATURE_FPGA2,
* TEMPERATURE_FPGA3 * TEMPERATURE_FPGA3 \n
* [CTB] Options: SLOW_ADC_TEMP * Cannot call TEMPERATURE_FPGA2 and TEMPERATURE_FPGA3 when blocking acquire
* in progress \n [CTB] Options: SLOW_ADC_TEMP
*/ */
Result<int> getTemperature(defs::dacIndex index, Positions pos = {}) const; Result<int> getTemperature(defs::dacIndex index, Positions pos = {}) const;

View File

@ -1957,29 +1957,25 @@ std::string CmdProxy::SlowAdc(int action) {
std::ostringstream os; std::ostringstream os;
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[n_channel (0-7 for channel|8 for temperature)]\n\t[Ctb] Slow " os << "[n_channel (0-7 for channel]\n\t[Ctb] Slow "
"ADC channel in mV or °C." "ADC channel in mV"
<< '\n'; << '\n';
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {
if (args.size() != 1) { if (args.size() != 1) {
WrongNumberOfParameters(0); WrongNumberOfParameters(0);
} }
int nchan = StringTo<int>(args[0]); int nchan = StringTo<int>(args[0]);
if (nchan < 0 || nchan > defs::SLOW_ADC_TEMP - defs::SLOW_ADC0) { if (nchan < 0 || nchan > 7) {
throw sls::RuntimeError("Unknown adc argument " + args[0]); throw sls::RuntimeError("Unknown adc argument " + args[0]);
} }
if (nchan == 8) { auto t = det->getSlowADC(
auto t = det->getTemperature(defs::SLOW_ADC_TEMP, {det_id}); static_cast<defs::dacIndex>(nchan + defs::SLOW_ADC0), {det_id});
os << OutString(t) << " °C\n"; Result<double> result(t.size());
} else { for (unsigned int i = 0; i < t.size(); ++i) {
auto t = det->getSlowADC( result[i] = t[i] / 1000.00;
static_cast<defs::dacIndex>(nchan + defs::SLOW_ADC0), {det_id});
Result<double> result(t.size());
for (unsigned int i = 0; i < t.size(); ++i) {
result[i] = t[i] / 1000.00;
}
os << OutString(result) << " mV\n";
} }
os << OutString(result) << " mV\n";
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
throw sls::RuntimeError("cannot put"); throw sls::RuntimeError("cannot put");
} else { } else {

View File

@ -614,6 +614,7 @@ class CmdProxy {
/* Gotthard2 Specific */ /* Gotthard2 Specific */
/* Mythen3 Specific */ /* Mythen3 Specific */
/* CTB Specific */ /* CTB Specific */
{"adc", "slowadc"},
{"flags", "romode"}, {"flags", "romode"},
{"i_a", "im_a"}, {"i_a", "im_a"},
{"i_b", "im_b"}, {"i_b", "im_b"},
@ -938,7 +939,7 @@ class CmdProxy {
{"im_c", &CmdProxy::im_c}, {"im_c", &CmdProxy::im_c},
{"im_d", &CmdProxy::im_d}, {"im_d", &CmdProxy::im_d},
{"im_io", &CmdProxy::im_io}, {"im_io", &CmdProxy::im_io},
{"adc", &CmdProxy::SlowAdc}, {"slowadc", &CmdProxy::SlowAdc},
{"extsampling", &CmdProxy::extsampling}, {"extsampling", &CmdProxy::extsampling},
{"extsamplingsrc", &CmdProxy::extsamplingsrc}, {"extsamplingsrc", &CmdProxy::extsamplingsrc},
{"rx_dbitlist", &CmdProxy::ReceiverDbitList}, {"rx_dbitlist", &CmdProxy::ReceiverDbitList},
@ -1282,11 +1283,13 @@ class CmdProxy {
GET_IND_COMMAND( GET_IND_COMMAND(
temp_fpgafl, getTemperature, slsDetectorDefs::TEMPERATURE_FPGA2, " °C", temp_fpgafl, getTemperature, slsDetectorDefs::TEMPERATURE_FPGA2, " °C",
"[n_value]\n\t[Eiger]Temperature of the left front end board fpga"); "[n_value]\n\t[Eiger]Temperature of the left front end board fpga. "
"Cannot call this while blocking acquire is going on.");
GET_IND_COMMAND( GET_IND_COMMAND(
temp_fpgafr, getTemperature, slsDetectorDefs::TEMPERATURE_FPGA3, " °C", temp_fpgafr, getTemperature, slsDetectorDefs::TEMPERATURE_FPGA3, " °C",
"[n_value]\n\t[Eiger]Temperature of the left front end board fpga"); "[n_value]\n\t[Eiger]Temperature of the left front end board fpga. "
"Cannot call this while blocking acquire is going on.");
GET_IND_COMMAND(temp_slowadc, getTemperature, GET_IND_COMMAND(temp_slowadc, getTemperature,
slsDetectorDefs::SLOW_ADC_TEMP, " °C", slsDetectorDefs::SLOW_ADC_TEMP, " °C",

View File

@ -357,6 +357,10 @@ void Module::setImageTestMode(const int value) {
} }
int Module::getADC(dacIndex index) const { int Module::getADC(dacIndex index) const {
// cannot access fpga links simultaneously (eiger) temp fix
if (index == TEMPERATURE_FPGA2 || index == TEMPERATURE_FPGA3) {
return sendToDetector<int>(F_GET_ADC, index);
}
return sendToDetectorStop<int>(F_GET_ADC, index); return sendToDetectorStop<int>(F_GET_ADC, index);
} }

View File

@ -4,10 +4,10 @@
#define APIRECEIVER 0x200810 #define APIRECEIVER 0x200810
#define APIGUI 0x200804 #define APIGUI 0x200804
#define APICTB 0x200909 #define APICTB 0x200910
#define APIGOTTHARD 0x200909 #define APIGOTTHARD 0x200910
#define APIGOTTHARD2 0x200909 #define APIGOTTHARD2 0x200910
#define APIJUNGFRAU 0x200909 #define APIJUNGFRAU 0x200910
#define APIMYTHEN3 0x200909 #define APIMYTHEN3 0x200910
#define APIMOENCH 0x200909 #define APIMOENCH 0x200910
#define APIEIGER 0x200909 #define APIEIGER 0x200910