mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-06-10 03:26:09 +02:00
Merge branch 'developer' into add-rx-header
This commit is contained in:
@@ -58,7 +58,7 @@ jobs:
|
||||
version: 1.0
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: 3.12
|
||||
cache: 'pip'
|
||||
|
||||
@@ -20,12 +20,12 @@ jobs:
|
||||
os: [ubuntu-latest,]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Build wheels
|
||||
run: pipx run cibuildwheel==3.2.1
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
|
||||
path: ./wheelhouse/*.whl
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
|
||||
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v7
|
||||
with:
|
||||
# unpacks all CIBW artifacts into dist/
|
||||
pattern: cibw-*
|
||||
|
||||
+1
-12
@@ -209,22 +209,11 @@ else()
|
||||
URL ${CMAKE_CURRENT_SOURCE_DIR}/libs/fmt/fmt-12.1.0.tar.gz
|
||||
# Compute hash: md5sum fmt-12.1.0.tar.gz
|
||||
URL_HASH MD5=92eb6f492e4838e5f024ce5207beafc7)
|
||||
set(FMT_INSTALL ON CACHE BOOL "")
|
||||
FetchContent_MakeAvailable(fmt)
|
||||
set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
# Export fmt
|
||||
if(SLS_MASTER_PROJECT)
|
||||
install(TARGETS fmt
|
||||
EXPORT ${TARGETS_EXPORT_NAME}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
option(SLS_USE_HDF5 "HDF5 File format" OFF)
|
||||
option(SLS_BUILD_SHARED_LIBRARIES "Build shared libaries" OFF)
|
||||
option(SLS_USE_TEXTCLIENT "Text Client" ON)
|
||||
|
||||
@@ -6,7 +6,7 @@ mkdir -p $PREFIX/bin
|
||||
mkdir -p $PREFIX/include/sls
|
||||
|
||||
#Shared and static libraries
|
||||
cp build/install/lib/* $PREFIX/lib/
|
||||
cp -r build/install/lib/* $PREFIX/lib/
|
||||
|
||||
#Binaries
|
||||
cp build/install/bin/sls_detector_acquire $PREFIX/bin/.
|
||||
|
||||
@@ -827,16 +827,21 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def txdelay(self):
|
||||
"""
|
||||
r"""
|
||||
[Eiger][Jungfrau][Moench][Mythen3] Set transmission delay for all modules in the detector using the step size provided.
|
||||
|
||||
Note
|
||||
----
|
||||
Sets up the following for every module:\n
|
||||
\t\t[Eiger] txdelay_left to (2 \* mod_index \* n_delay), \n
|
||||
\t\t[Eiger] txdelay_right to ((2 \* mod_index + 1) \* n_delay) and \n
|
||||
\t\t[Eiger] txdelay_frame to (2 \* num_modules \* n_delay) \n
|
||||
\t\t[Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules \* n_delay)\n\n
|
||||
Sets up the following for every module:
|
||||
|
||||
[Eiger] txdelay_left to (2 \* mod_index \* n_delay),
|
||||
|
||||
[Eiger] txdelay_right to ((2 \* mod_index + 1) \* n_delay) and
|
||||
|
||||
[Eiger] txdelay_frame to (2 \* num_modules \* n_delay)
|
||||
|
||||
[Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules \* n_delay)
|
||||
|
||||
Please refer txdelay_left, txdelay_right and txdelay_frame for details.
|
||||
"""
|
||||
return self.getTransmissionDelay()
|
||||
|
||||
@@ -27,6 +27,12 @@ void init_enums(py::module &m) {
|
||||
.value("GOTTHARD2", slsDetectorDefs::detectorType::GOTTHARD2)
|
||||
.value("XILINX_CHIPTESTBOARD",
|
||||
slsDetectorDefs::detectorType::XILINX_CHIPTESTBOARD)
|
||||
.value("MATTERHORN", slsDetectorDefs::detectorType::MATTERHORN)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::ReturnCode>(Defs, "ReturnCode")
|
||||
.value("OK", slsDetectorDefs::ReturnCode::OK)
|
||||
.value("FAIL", slsDetectorDefs::ReturnCode::FAIL)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::boolFormat>(Defs, "boolFormat")
|
||||
@@ -50,6 +56,12 @@ void init_enums(py::module &m) {
|
||||
.value("Y", slsDetectorDefs::dimension::Y)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::FrequencyUnit>(Defs, "FrequencyUnit")
|
||||
.value("Hz", slsDetectorDefs::FrequencyUnit::Hz)
|
||||
.value("kHz", slsDetectorDefs::FrequencyUnit::kHz)
|
||||
.value("MHz", slsDetectorDefs::FrequencyUnit::MHz)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::frameDiscardPolicy>(Defs, "frameDiscardPolicy")
|
||||
.value("NO_DISCARD", slsDetectorDefs::frameDiscardPolicy::NO_DISCARD)
|
||||
.value("DISCARD_EMPTY_FRAMES",
|
||||
|
||||
@@ -25,6 +25,8 @@ struct UDPInfo {
|
||||
uint32_t dstip{};
|
||||
};
|
||||
|
||||
using ReturnCode = slsDetectorDefs::ReturnCode;
|
||||
|
||||
template <typename DerivedDetectorServer> class DetectorServer {
|
||||
|
||||
public:
|
||||
|
||||
@@ -19,8 +19,8 @@ class TCPInterface {
|
||||
public:
|
||||
~TCPInterface();
|
||||
|
||||
TCPInterface(std::function<ReturnCode(const detFuncs &, ServerInterface &)>
|
||||
&processFunction_,
|
||||
TCPInterface(std::function<slsDetectorDefs::ReturnCode(
|
||||
const detFuncs &, ServerInterface &)> &processFunction_,
|
||||
const uint16_t portNumber = DEFAULT_TCP_CNTRL_PORTNO);
|
||||
|
||||
/// @brief creates tcp thread
|
||||
@@ -40,11 +40,12 @@ class TCPInterface {
|
||||
* @param function_id The ID of the function recived by the server and to
|
||||
* be executed
|
||||
*/
|
||||
ReturnCode processReceivedData(const detFuncs function_id,
|
||||
ServerInterface &socket);
|
||||
slsDetectorDefs::ReturnCode processReceivedData(const detFuncs function_id,
|
||||
ServerInterface &socket);
|
||||
|
||||
/// @brief map of function IDs and corresponding functions
|
||||
std::function<ReturnCode(const detFuncs &, ServerInterface &)>
|
||||
std::function<slsDetectorDefs::ReturnCode(const detFuncs &,
|
||||
ServerInterface &)>
|
||||
processFunction;
|
||||
|
||||
/// @brief TCP/IP port number for the detector server
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
namespace sls {
|
||||
|
||||
TCPInterface::TCPInterface(
|
||||
std::function<ReturnCode(const detFuncs &, ServerInterface &)>
|
||||
&processFunction_,
|
||||
std::function<slsDetectorDefs::ReturnCode(
|
||||
const detFuncs &, ServerInterface &)> &processFunction_,
|
||||
const uint16_t portNumber_)
|
||||
: processFunction(processFunction_), portNumber(portNumber_),
|
||||
server(portNumber_) {
|
||||
@@ -53,7 +53,7 @@ void TCPInterface::startTCPServerClientConnection() {
|
||||
auto returncode = processReceivedData(
|
||||
static_cast<detFuncs>(function_id), socket);
|
||||
|
||||
if (returncode == FAIL) {
|
||||
if (returncode == slsDetectorDefs::ReturnCode::FAIL) {
|
||||
throw RuntimeError(fmt::format(
|
||||
"Error processing command with fnum: {}",
|
||||
getFunctionNameFromEnum((enum detFuncs)function_id)));
|
||||
@@ -76,14 +76,16 @@ void TCPInterface::startTCPServerClientConnection() {
|
||||
LOG(logINFOBLUE) << "Exiting TCP Server";
|
||||
}
|
||||
|
||||
ReturnCode TCPInterface::processReceivedData(const detFuncs function_id,
|
||||
ServerInterface &socket) {
|
||||
slsDetectorDefs::ReturnCode
|
||||
TCPInterface::processReceivedData(const detFuncs function_id,
|
||||
ServerInterface &socket) {
|
||||
|
||||
LOG(logDEBUG1) << "calling function fnum: " << function_id << " ("
|
||||
<< getFunctionNameFromEnum((enum detFuncs)function_id)
|
||||
<< ")";
|
||||
|
||||
ReturnCode returncode = processFunction(function_id, socket);
|
||||
slsDetectorDefs::ReturnCode returncode =
|
||||
processFunction(function_id, socket);
|
||||
|
||||
LOG(logDEBUG1) << "Function "
|
||||
<< getFunctionNameFromEnum((enum detFuncs)function_id)
|
||||
|
||||
@@ -89,9 +89,6 @@
|
||||
// NOLINTEND(cppcoreguidelines-macro-usage)
|
||||
#ifdef __cplusplus
|
||||
|
||||
// TODO: why are all these defs inside a class? - why not static
|
||||
enum ReturnCode { OK = 0, FAIL = 1 };
|
||||
|
||||
class slsDetectorDefs {
|
||||
public:
|
||||
#endif
|
||||
@@ -111,8 +108,7 @@ class slsDetectorDefs {
|
||||
// slsDetectorDefs instead of grouped in a class
|
||||
};
|
||||
|
||||
/** return values */
|
||||
enum { OK, FAIL };
|
||||
enum ReturnCode { OK, FAIL };
|
||||
|
||||
enum boolFormat { TrueFalse, OnOff, OneZero };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user