Versioning (#568)

- removed getClientServerAPIVersion in server (not used)
- removed rxr side (clientversion compatibility check), removed enum as well as it is now done on the client side.
- versionAPI.h
   - GITBRANCH changed to RELEASE
   - dates for all API changed to "sem_version date". Scripts to compile servers modified for this. Empty "branch" name will end up with developer for sem_version.

- Version class with constructor taking in the long version (APILIB date). Other member functions including concise(to get sem_version for new releases and date for old releases), 
  
- bypassing initial tests, also now bypasses the client-rxr compatibility check (at rx_hostname command)

- previously, compatibility between client-det was ensuring both had the same detector API (eg. same APIJUNGFRAU)
   - Now, compatibility only checks APILIB (client side) and detector API(eg. APIJUNGFRAU) (detector side) have same major version. It only does backward compatibility test. Rest is upto user to ensure. 
   - If server is from an older release, it will compare dates like previous implementation (APIJUNGFRAU from both client and det)
 
- - previously, compatibility between client-rxr was ensuring both had the same APIRECEIVER
   - Now, compatibility only checks APILIB (client side) and APIRECEIVER (rxr side) have same major version. It only does backward compatibility test. Rest is upto user to ensure. 
   - If rxr is from an older release, it will compare dates like previous implementation (APIRECEIVER from both client and rxr)

- removed APIGUI, evalVersionVariables.sh, genVersionHeader.sh (not needed or not used)

- clientVersion, rxrversion and detectorserverversion all return strings and not integers (in hex) anymore. Depending if it has semantic versioning, it will print that or the date if it is too old.

- fixed in python (strings for versions)
- check_version function in detector server changed to "initial checks" as it only checks server-firmware compatibility and initial server checks. Client compatibilities are moved to client side.
- --version gives sem_version and date? Is date needed as well. The clientversion, detserverversion and rxrversion API gives only sem_version (no date)
- - formatting
This commit is contained in:
Dhanya Thattil
2022-11-09 11:13:09 +01:00
committed by GitHub
parent b150db0fb3
commit 05f657c106
56 changed files with 609 additions and 414 deletions

View File

@ -225,9 +225,9 @@ class Detector(CppDetectorApi):
Example
-------
>>> d.detectorserverversion
'0x200910'
'7.0.0'
"""
return ut.lhex(self.getDetectorServerVersion())
return self.getDetectorServerVersion()
@property
@element
@ -249,15 +249,15 @@ class Detector(CppDetectorApi):
Example
-------
>>> d.clientversion
'0x200810'
'7.0.1'
"""
return hex(self.getClientVersion())
return self.getClientVersion()
@property
@element
def rx_version(self):
"""Receiver version in format [0xYYMMDD]."""
return ut.lhex(self.getReceiverVersion())
"""Receiver version """
return self.getReceiverVersion()
@property
@element

View File

@ -55,16 +55,17 @@ void init_det(py::module &m) {
(int (Detector::*)() const) & Detector::getShmId);
CppDetectorApi.def("getPackageVersion", (std::string(Detector::*)() const) &
Detector::getPackageVersion);
CppDetectorApi.def("getClientVersion", (int64_t(Detector::*)() const) &
CppDetectorApi.def("getClientVersion", (std::string(Detector::*)() const) &
Detector::getClientVersion);
CppDetectorApi.def("getFirmwareVersion",
(Result<int64_t>(Detector::*)(sls::Positions) const) &
Detector::getFirmwareVersion,
py::arg() = Positions{});
CppDetectorApi.def("getDetectorServerVersion",
(Result<int64_t>(Detector::*)(sls::Positions) const) &
Detector::getDetectorServerVersion,
py::arg() = Positions{});
CppDetectorApi.def(
"getDetectorServerVersion",
(Result<std::string>(Detector::*)(sls::Positions) const) &
Detector::getDetectorServerVersion,
py::arg() = Positions{});
CppDetectorApi.def(
"getKernelVersion",
(Result<std::string>(Detector::*)(sls::Positions) const) &
@ -78,10 +79,11 @@ void init_det(py::module &m) {
(Result<int>(Detector::*)(sls::Positions) const) &
Detector::getModuleId,
py::arg() = Positions{});
CppDetectorApi.def("getReceiverVersion",
(Result<int64_t>(Detector::*)(sls::Positions) const) &
Detector::getReceiverVersion,
py::arg() = Positions{});
CppDetectorApi.def(
"getReceiverVersion",
(Result<std::string>(Detector::*)(sls::Positions) const) &
Detector::getReceiverVersion,
py::arg() = Positions{});
CppDetectorApi.def(
"getDetectorType",
(Result<defs::detectorType>(Detector::*)(sls::Positions) const) &
@ -202,6 +204,16 @@ void init_det(py::module &m) {
CppDetectorApi.def(
"setSynchronization",
(void (Detector::*)(bool)) & Detector::setSynchronization, py::arg());
CppDetectorApi.def(
"getBadChannels",
(void (Detector::*)(const std::string &, sls::Positions) const) &
Detector::getBadChannels,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def(
"setBadChannels",
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::setBadChannels,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def("isVirtualDetectorServer",
(Result<bool>(Detector::*)(sls::Positions) const) &
Detector::isVirtualDetectorServer,
@ -1340,16 +1352,6 @@ void init_det(py::module &m) {
(void (Detector::*)(const int, const int, const int, sls::Positions)) &
Detector::setADCConfiguration,
py::arg(), py::arg(), py::arg(), py::arg() = Positions{});
CppDetectorApi.def(
"getBadChannels",
(void (Detector::*)(const std::string &, sls::Positions) const) &
Detector::getBadChannels,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def(
"setBadChannels",
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::setBadChannels,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def("getCounterMask",
(Result<uint32_t>(Detector::*)(sls::Positions) const) &
Detector::getCounterMask,
@ -1493,6 +1495,14 @@ void init_det(py::module &m) {
(void (Detector::*)(defs::dacIndex, int, sls::Positions)) &
Detector::setVoltage,
py::arg(), py::arg(), py::arg() = Positions{});
CppDetectorApi.def("getADCVpp",
(Result<int>(Detector::*)(bool, sls::Positions) const) &
Detector::getADCVpp,
py::arg() = false, py::arg() = Positions{});
CppDetectorApi.def("setADCVpp",
(void (Detector::*)(int, bool, sls::Positions)) &
Detector::setADCVpp,
py::arg(), py::arg() = false, py::arg() = Positions{});
CppDetectorApi.def("getADCEnableMask",
(Result<uint32_t>(Detector::*)(sls::Positions) const) &
Detector::getADCEnableMask,