mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 03:10:02 +02:00
dev:Eiger febl febr (#601)
* eiger: get febl and febr versions in versions command, also added in python
This commit is contained in:
parent
276dc52196
commit
48a684b95f
@ -27,6 +27,7 @@ This document describes the differences between v7.0.0.rc1 and v6.1.2
|
||||
==========================
|
||||
|
||||
- moench being made compatible with jungfrau 2.0 boards (jungfrau structure, away from ctb)
|
||||
- eiger febl and feb in versions
|
||||
|
||||
|
||||
2. On-board Detector Server Compatibility
|
||||
|
@ -1797,6 +1797,17 @@ class Detector(CppDetectorApi):
|
||||
|
||||
@property
|
||||
def versions(self):
|
||||
if self.type == detectorType.EIGER:
|
||||
return {'type': self.type,
|
||||
'package': self.packageversion,
|
||||
'client': self.clientversion,
|
||||
'firmware (Beb)': self.firmwareversion,
|
||||
'firmware(Febl)': self.getFrontEndFirmwareVersion(slsDetectorDefs.fpgaPosition.FRONT_LEFT),
|
||||
'firmware (Febr)': self.getFrontEndFirmwareVersion(slsDetectorDefs.fpgaPosition.FRONT_RIGHT),
|
||||
'detectorserver': self.detectorserverversion,
|
||||
'kernel': self.kernelversion,
|
||||
'receiver': self.rx_version}
|
||||
|
||||
return {'type': self.type,
|
||||
'package': self.packageversion,
|
||||
'client': self.clientversion,
|
||||
|
@ -61,6 +61,11 @@ void init_det(py::module &m) {
|
||||
(Result<int64_t>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getFirmwareVersion,
|
||||
py::arg() = Positions{});
|
||||
CppDetectorApi.def("getFrontEndFirmwareVersion",
|
||||
(Result<int64_t>(Detector::*)(const defs::fpgaPosition,
|
||||
sls::Positions) const) &
|
||||
Detector::getFrontEndFirmwareVersion,
|
||||
py::arg(), py::arg() = Positions{});
|
||||
CppDetectorApi.def(
|
||||
"getDetectorServerVersion",
|
||||
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
||||
|
@ -286,6 +286,11 @@ void init_enums(py::module &m) {
|
||||
.value("BOTTOM", slsDetectorDefs::portPosition::BOTTOM)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::fpgaPosition>(Defs, "fpgaPosition")
|
||||
.value("FRONT_LEFT", slsDetectorDefs::fpgaPosition::FRONT_LEFT)
|
||||
.value("FRONT_RIGHT", slsDetectorDefs::fpgaPosition::FRONT_RIGHT)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::streamingInterface>(Defs, "streamingInterface",
|
||||
py::arithmetic())
|
||||
.value("NONE", slsDetectorDefs::streamingInterface::NONE)
|
||||
|
Binary file not shown.
@ -2180,6 +2180,36 @@ int Feb_Control_GetRightFPGATemp() {
|
||||
return (int)temperature;
|
||||
}
|
||||
|
||||
int64_t Feb_Control_GetFrontLeftFirmwareVersion() {
|
||||
if (!Feb_Control_activated) {
|
||||
return 0;
|
||||
}
|
||||
unsigned int value = 0;
|
||||
if (!Feb_Interface_ReadRegister(Feb_Control_leftAddress, FEB_REG_STATUS,
|
||||
&value)) {
|
||||
LOG(logERROR, ("Trouble reading FEB_REG_STATUS reg to get left feb "
|
||||
"fw version\n"));
|
||||
return 0;
|
||||
}
|
||||
return ((value & FEB_REG_STATUS_FW_VERSION_MSK) >>
|
||||
FEB_REG_STATUS_FW_VERSION_OFST);
|
||||
}
|
||||
|
||||
int64_t Feb_Control_GetFrontRightFirmwareVersion() {
|
||||
if (!Feb_Control_activated) {
|
||||
return 0;
|
||||
}
|
||||
unsigned int value = 0;
|
||||
if (!Feb_Interface_ReadRegister(Feb_Control_rightAddress, FEB_REG_STATUS,
|
||||
&value)) {
|
||||
LOG(logERROR, ("Trouble reading FEB_REG_STATUS reg to get right feb "
|
||||
"fw version\n"));
|
||||
return 0;
|
||||
}
|
||||
return ((value & FEB_REG_STATUS_FW_VERSION_MSK) >>
|
||||
FEB_REG_STATUS_FW_VERSION_OFST);
|
||||
}
|
||||
|
||||
int64_t Feb_Control_GetMeasuredPeriod() {
|
||||
if (!Feb_Control_activated) {
|
||||
return 0;
|
||||
|
@ -116,5 +116,7 @@ int Feb_Control_PrintCorrectedValues();
|
||||
// adcs
|
||||
int Feb_Control_GetLeftFPGATemp();
|
||||
int Feb_Control_GetRightFPGATemp();
|
||||
int64_t Feb_Control_GetFrontLeftFirmwareVersion();
|
||||
int64_t Feb_Control_GetFrontRightFirmwareVersion();
|
||||
int64_t Feb_Control_GetMeasuredPeriod();
|
||||
int64_t Feb_Control_GetSubMeasuredPeriod();
|
||||
|
@ -46,6 +46,8 @@
|
||||
#define FEB_REG_STATUS_WAIT_FOR_TRGGR_MSK (0x00000001 << FEB_REG_STATUS_WAIT_FOR_TRGGR_OFST)
|
||||
#define FEB_REG_STATUS_ACQ_DONE_OFST (6)
|
||||
#define FEB_REG_STATUS_ACQ_DONE_MSK (0x00000001 << FEB_REG_STATUS_ACQ_DONE_OFST)
|
||||
#define FEB_REG_STATUS_FW_VERSION_OFST (8)
|
||||
#define FEB_REG_STATUS_FW_VERSION_MSK (0x000000FF << FEB_REG_STATUS_FW_VERSION_OFST)
|
||||
#define FEB_REG_STATUS_TEMP_OFST (16)
|
||||
#define FEB_REG_STATUS_TEMP_MSK (0x0000FFFF << FEB_REG_STATUS_TEMP_OFST)
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@ -216,6 +216,27 @@ u_int64_t getFirmwareVersion() {
|
||||
#endif
|
||||
}
|
||||
|
||||
uint64_t getFrontEndFirmwareVersion(enum fpgaPosition fpgaPosition) {
|
||||
uint64_t retval = 0;
|
||||
#ifndef VIRTUAL
|
||||
sharedMemory_lockLocalLink();
|
||||
switch (fpgaPosition) {
|
||||
case FRONT_LEFT:
|
||||
retval = Feb_Control_GetFrontLeftFirmwareVersion(fpgaPosition);
|
||||
break;
|
||||
case FRONT_RIGHT:
|
||||
retval = Feb_Control_GetFrontRightFirmwareVersion(fpgaPosition);
|
||||
break;
|
||||
default:
|
||||
LOG(logERROR,
|
||||
("unknown index for fpga position to read firmware version\n"));
|
||||
retval = -1;
|
||||
}
|
||||
sharedMemory_unlockLocalLink();
|
||||
#endif
|
||||
return retval;
|
||||
}
|
||||
|
||||
u_int64_t getFirmwareAPIVersion() {
|
||||
#ifdef VIRTUAL
|
||||
return 0;
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -78,6 +78,9 @@ int getTestImageMode();
|
||||
// Ids
|
||||
void getServerVersion(char *version);
|
||||
u_int64_t getFirmwareVersion();
|
||||
#ifdef EIGERD
|
||||
uint64_t getFrontEndFirmwareVersion(enum fpgaPosition fpgaPosition);
|
||||
#endif
|
||||
u_int64_t getFirmwareAPIVersion();
|
||||
#ifndef EIGERD
|
||||
void getHardwareVersion(char *version);
|
||||
|
@ -306,3 +306,4 @@ int get_module(int);
|
||||
int get_synchronization(int);
|
||||
int set_synchronization(int);
|
||||
int get_hardware_version(int);
|
||||
int get_frontend_firmware_version(int);
|
||||
|
@ -471,6 +471,7 @@ void function_table() {
|
||||
flist[F_GET_SYNCHRONIZATION] = &get_synchronization;
|
||||
flist[F_SET_SYNCHRONIZATION] = &set_synchronization;
|
||||
flist[F_GET_HARDWARE_VERSION] = &get_hardware_version;
|
||||
flist[F_GET_FRONTEND_FIRMWARE_VERSION] = &get_frontend_firmware_version;
|
||||
|
||||
// check
|
||||
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
|
||||
@ -10136,3 +10137,35 @@ int get_hardware_version(int file_des) {
|
||||
#endif
|
||||
return Server_SendResult(file_des, OTHER, retvals, sizeof(retvals));
|
||||
}
|
||||
|
||||
int get_frontend_firmware_version(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
enum fpgaPosition arg = FRONT_LEFT;
|
||||
int64_t retval = -1;
|
||||
|
||||
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||
return printSocketReadError();
|
||||
LOG(logDEBUG1, ("Getting front end firmware version: %s\n",
|
||||
(arg == FRONT_LEFT ? "left" : "right")));
|
||||
|
||||
#if !defined(EIGERD)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
switch (arg) {
|
||||
case FRONT_LEFT:
|
||||
case FRONT_RIGHT:
|
||||
break;
|
||||
default:
|
||||
modeNotImplemented("Fpga position Index", (int)arg);
|
||||
break;
|
||||
}
|
||||
if (ret == OK) {
|
||||
retval = getFrontEndFirmwareVersion(arg);
|
||||
LOG(logDEBUG1,
|
||||
("Front %s version retval: 0x%llx\n",
|
||||
(arg == FRONT_LEFT ? "left" : "right"), (long long int)retval));
|
||||
}
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT64, &retval, sizeof(retval));
|
||||
}
|
@ -78,6 +78,11 @@ class Detector {
|
||||
|
||||
Result<int64_t> getFirmwareVersion(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger] Options: FRONT_LEFT, FRONT_RIGHT */
|
||||
Result<int64_t>
|
||||
getFrontEndFirmwareVersion(const defs::fpgaPosition fpgaPosition,
|
||||
Positions pos = {}) const;
|
||||
|
||||
Result<std::string> getDetectorServerVersion(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau][Moench][Gotthard2][Myhten3][Gotthard][Ctb] */
|
||||
|
@ -276,25 +276,33 @@ std::string CmdProxy::Versions(int action) {
|
||||
}
|
||||
bool eiger = (det->getDetectorType().squash() == defs::EIGER);
|
||||
auto t = det->getFirmwareVersion(std::vector<int>{det_id});
|
||||
os << "\nType : " << OutString(det->getDetectorType())
|
||||
<< "\nRelease : " << det->getPackageVersion() << std::hex
|
||||
<< "\nClient : " << det->getClientVersion();
|
||||
os << "\nFirmware : ";
|
||||
os << "\nType : " << OutString(det->getDetectorType())
|
||||
<< "\nRelease : " << det->getPackageVersion() << std::hex
|
||||
<< "\nClient : " << det->getClientVersion();
|
||||
if (eiger) {
|
||||
os << OutString(t);
|
||||
os << "\nFirmware (Beb) : "
|
||||
<< OutString(det->getFirmwareVersion(std::vector<int>{det_id}));
|
||||
os << "\nFirmware (Febl) : "
|
||||
<< OutString(det->getFrontEndFirmwareVersion(
|
||||
defs::FRONT_LEFT, std::vector<int>{det_id}));
|
||||
os << "\nFirmware (Febr) : "
|
||||
<< OutString(det->getFrontEndFirmwareVersion(
|
||||
defs::FRONT_RIGHT, std::vector<int>{det_id}));
|
||||
} else {
|
||||
os << OutStringHex(t);
|
||||
os << "\nFirmware : "
|
||||
<< OutStringHex(
|
||||
det->getFirmwareVersion(std::vector<int>{det_id}));
|
||||
}
|
||||
os << "\nServer : "
|
||||
os << "\nServer : "
|
||||
<< OutString(
|
||||
det->getDetectorServerVersion(std::vector<int>{det_id}));
|
||||
if (!eiger)
|
||||
os << "\nHardware : "
|
||||
os << "\nHardware : "
|
||||
<< OutString(det->getHardwareVersion(std::vector<int>{det_id}));
|
||||
os << "\nKernel : "
|
||||
os << "\nKernel : "
|
||||
<< OutString(det->getKernelVersion({std::vector<int>{det_id}}));
|
||||
if (det->getUseReceiverFlag().squash(true)) {
|
||||
os << "\nReceiver : "
|
||||
os << "\nReceiver : "
|
||||
<< OutString(det->getReceiverVersion(std::vector<int>{det_id}));
|
||||
}
|
||||
os << std::dec << '\n';
|
||||
|
@ -124,6 +124,13 @@ Result<int64_t> Detector::getFirmwareVersion(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getFirmwareVersion, pos);
|
||||
}
|
||||
|
||||
Result<int64_t>
|
||||
Detector::getFrontEndFirmwareVersion(const defs::fpgaPosition fpgaPosition,
|
||||
Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getFrontEndFirmwareVersion, pos,
|
||||
fpgaPosition);
|
||||
}
|
||||
|
||||
Result<std::string> Detector::getDetectorServerVersion(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getDetectorServerVersion, pos);
|
||||
}
|
||||
|
@ -92,6 +92,12 @@ int64_t Module::getFirmwareVersion() const {
|
||||
return sendToDetector<int64_t>(F_GET_FIRMWARE_VERSION);
|
||||
}
|
||||
|
||||
int64_t
|
||||
Module::getFrontEndFirmwareVersion(const fpgaPosition fpgaPosition) const {
|
||||
return sendToDetector<int64_t>(F_GET_FRONTEND_FIRMWARE_VERSION,
|
||||
fpgaPosition);
|
||||
}
|
||||
|
||||
std::string Module::getControlServerLongVersion() const {
|
||||
char retval[MAX_STR_LENGTH]{};
|
||||
sendToDetector(F_GET_SERVER_VERSION, nullptr, retval);
|
||||
|
@ -90,6 +90,7 @@ class Module : public virtual slsDetectorDefs {
|
||||
void setHostname(const std::string &hostname, const bool initialChecks);
|
||||
|
||||
int64_t getFirmwareVersion() const;
|
||||
int64_t getFrontEndFirmwareVersion(const fpgaPosition fpgaPosition) const;
|
||||
std::string getControlServerLongVersion() const;
|
||||
std::string getStopServerLongVersion() const;
|
||||
std::string getDetectorServerVersion() const;
|
||||
|
@ -445,6 +445,11 @@ typedef struct {
|
||||
|
||||
enum portPosition { LEFT, RIGHT, TOP, BOTTOM };
|
||||
|
||||
/**
|
||||
* eiger fpga position
|
||||
*/
|
||||
enum fpgaPosition { FRONT_LEFT, FRONT_RIGHT };
|
||||
|
||||
#ifdef __cplusplus
|
||||
enum class streamingInterface {
|
||||
#else
|
||||
|
@ -274,6 +274,7 @@ enum detFuncs {
|
||||
F_GET_SYNCHRONIZATION,
|
||||
F_SET_SYNCHRONIZATION,
|
||||
F_GET_HARDWARE_VERSION,
|
||||
F_GET_FRONTEND_FIRMWARE_VERSION,
|
||||
|
||||
NUM_DET_FUNCTIONS,
|
||||
RECEIVER_ENUM_START = 512, /**< detector function should not exceed this
|
||||
@ -653,6 +654,7 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_GET_SYNCHRONIZATION: return "F_GET_SYNCHRONIZATION";
|
||||
case F_SET_SYNCHRONIZATION: return "F_SET_SYNCHRONIZATION";
|
||||
case F_GET_HARDWARE_VERSION: return "F_GET_HARDWARE_VERSION";
|
||||
case F_GET_FRONTEND_FIRMWARE_VERSION: return "F_GET_FRONTEND_FIRMWARE_VERSION";
|
||||
|
||||
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
||||
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
||||
|
@ -7,7 +7,7 @@
|
||||
#define APICTB "developer 0x221213"
|
||||
#define APIGOTTHARD2 "developer 0x221213"
|
||||
#define APIJUNGFRAU "developer 0x221213"
|
||||
#define APIEIGER "developer 0x221213"
|
||||
#define APIEIGER "developer 0x221215"
|
||||
#define APIMOENCH "developer 0x221215"
|
||||
#define APIGOTTHARD "developer 0x230117"
|
||||
#define APIMYTHEN3 "developer 0x230117"
|
Loading…
x
Reference in New Issue
Block a user