Dev/matterhornserver (#1396)
Build and Deploy on local RHEL9 / build (push) Successful in 2m0s
Build on RHEL9 docker image / build (push) Successful in 3m34s
Build on RHEL8 docker image / build (push) Successful in 4m46s
Build and Deploy on local RHEL8 / build (push) Successful in 5m3s
Run Simulator Tests on local RHEL9 / build (push) Successful in 14m43s
Run Simulator Tests on local RHEL8 / build (push) Successful in 18m15s

* added fetch fmt server library

* added first draft of matterhorn

* added enum ReturnCode

* added cpp TCP Interface to slsDetectorServer

* added fmt to workflows

* bug: added std::signal for proper handling of ctr+c

* added compile option to set log level

* WIP

* dont use c project settings when building matterhornserver

* updated logger

* WIP

* WIP

* linked fmt to slsProjectOptions

* solved merge conflict

* some refactoring

* cleaned up logs

* added fmt to workflow

* WIP

* generated register defs from csv file

* oops given in hex

* properly added fmt as a dependency

* add fmt to conda recipe

* some format changes

* dont use public headers of fmt

* WIP

* used CRTP for virtual detector

* WIP

* added udp functions to matterhornserver

* Matterhorn in tostring

* warning unused variable from other PR

* fixed build

* updated cmake

* added Server class usable for all detectors

* removed stopserver

* added some more functions

* wrong overload

* porper cleanup of matterhorn app

* PR Review

* refactored directory structure

* used pause insetad of sleep

---------

Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
This commit is contained in:
2026-05-06 13:33:35 +02:00
committed by GitHub
co-authored by maliakal_d
parent 4ffb81e7ff
commit bb1a73d718
37 changed files with 1640 additions and 97 deletions
+1
View File
@@ -3,6 +3,7 @@
#pragma once
#include "sls/TypeTraits.h"
#include "sls/logger.h"
#include <cstddef>
#include <cstdint>
#include <iostream>
@@ -3,6 +3,8 @@
#pragma once
#include "sls/DataSocket.h"
#include "sls/logger.h"
namespace sls {
class ServerInterface;
}
+2 -7
View File
@@ -27,11 +27,6 @@ enum TLogLevel {
logDEBUG5
};
// Compiler should optimize away anything below this value
#ifndef LOG_MAX_REPORTING_LEVEL
#define LOG_MAX_REPORTING_LEVEL sls::logINFO
#endif
#define __AT__ \
std::string(__FILE__) + std::string("::") + std::string(__func__) + \
std::string("(): ")
@@ -43,7 +38,7 @@ enum TLogLevel {
class Logger {
std::ostringstream os;
TLogLevel level = LOG_MAX_REPORTING_LEVEL;
TLogLevel level = ReportingLevel();
public:
Logger() = default;
@@ -55,7 +50,7 @@ class Logger {
}
static TLogLevel &ReportingLevel() { // singelton eeh
static TLogLevel reportingLevel = logINFO;
static TLogLevel reportingLevel = LOG_MAX_REPORTING_LEVEL;
return reportingLevel;
}
+18 -1
View File
@@ -46,6 +46,9 @@
#define DEFAULT_UDP_SRC_PORTNO 32410
#define DEFAULT_UDP_DST_PORTNO 50001
/** for virtual detectors */
#define LOCALHOSTIP_INT 2130706433
#define MAX_UDP_DESTINATION 32
#define SLS_DETECTOR_HEADER_VERSION 0x2
@@ -82,8 +85,13 @@
#define DEFAULT_STREAMING_TIMER_IN_MS 500
#define NUM_RX_THREAD_IDS 9
// 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
@@ -98,7 +106,9 @@ class slsDetectorDefs {
MOENCH,
MYTHEN3,
GOTTHARD2,
XILINX_CHIPTESTBOARD
XILINX_CHIPTESTBOARD,
MATTERHORN // TODO: maybe better to have it under a namespace
// slsDetectorDefs instead of grouped in a class
};
/** return values */
@@ -758,6 +768,13 @@ struct detParameters {
nChipY = 1;
nDacs = 14;
break;
case slsDetectorDefs::detectorType::MATTERHORN:
nChanX = 256;
nChanY = 256;
nChipX = 4;
nChipY = 2;
nDacs = 31;
break;
default:
throw sls::RuntimeError("Unknown detector type! " +
std::to_string(type));
+10 -9
View File
@@ -1,12 +1,13 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
/** API versions */
#define APILIB "0.0.0 0x250909"
#define APIRECEIVER "0.0.0 0x250822"
#define APICTB "0.0.0 0x260427"
#define APIGOTTHARD2 "0.0.0 0x260427"
#define APIMOENCH "0.0.0 0x260424"
#define APIEIGER "0.0.0 0x260424"
#define APIXILINXCTB "0.0.0 0x260427"
#define APIJUNGFRAU "0.0.0 0x260424"
#define APIMYTHEN3 "0.0.0 0x260427"
#define APILIB "0.0.0 0x250909"
#define APIRECEIVER "0.0.0 0x250822"
#define APICTB "0.0.0 0x260427"
#define APIGOTTHARD2 "0.0.0 0x260427"
#define APIMOENCH "0.0.0 0x260424"
#define APIEIGER "0.0.0 0x260424"
#define APIXILINXCTB "0.0.0 0x260427"
#define APIJUNGFRAU "0.0.0 0x260424"
#define APIMYTHEN3 "0.0.0 0x260427"
#define APIMATTERHORN "0.0.0 0x260212"