mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-05 02:41:19 +01:00
Compare commits
17 Commits
dev/genera
...
rosenblatt
| Author | SHA1 | Date | |
|---|---|---|---|
| eff4e7ee29 | |||
| 2aa05716e2 | |||
| af0c5892fb | |||
| 8f8801a67b | |||
| 9fea6b74e4 | |||
| b7a29dff8d | |||
| e575fc0933 | |||
| cc233686f1 | |||
| e5bea401a0 | |||
| ecda5db97e | |||
| 7d9bc6d6eb | |||
| 664de6b204 | |||
| 8ab2aa589d | |||
| b4e06eb62b | |||
| c7c672ccde | |||
| 18cdd6a2f7 | |||
| 799903dddb |
@@ -21,9 +21,9 @@ jobs:
|
|||||||
- name: Build library
|
- name: Build library
|
||||||
run: |
|
run: |
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON -DSLS_USE_SIMULATOR=ON
|
cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON
|
||||||
make -j 2
|
make -j 2
|
||||||
|
|
||||||
- name: C++ unit tests
|
- name: C++ unit tests
|
||||||
working-directory: ${{gitea.workspace}}/build
|
working-directory: ${{gitea.workspace}}/build
|
||||||
run: ctest -j1 --rerun-failed --output-on-failure
|
run: ctest
|
||||||
@@ -19,9 +19,9 @@ jobs:
|
|||||||
- name: Build library
|
- name: Build library
|
||||||
run: |
|
run: |
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON -DSLS_USE_SIMULATOR=ON
|
cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON
|
||||||
make -j 2
|
make -j 2
|
||||||
|
|
||||||
- name: C++ unit tests
|
- name: C++ unit tests
|
||||||
working-directory: ${{gitea.workspace}}/build
|
working-directory: ${{gitea.workspace}}/build
|
||||||
run: ctest -j1 --rerun-failed --output-on-failure
|
run: ctest
|
||||||
2
.github/workflows/cmake.yaml
vendored
2
.github/workflows/cmake.yaml
vendored
@@ -37,7 +37,7 @@ jobs:
|
|||||||
|
|
||||||
- name: C++ unit tests
|
- name: C++ unit tests
|
||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{github.workspace}}/build
|
||||||
run: ctest -C ${{env.BUILD_TYPE}} -j1 --rerun-failed --output-on-failure
|
run: ctest -C ${{env.BUILD_TYPE}} -j1
|
||||||
|
|
||||||
- name: Python unit tests
|
- name: Python unit tests
|
||||||
working-directory: ${{github.workspace}}/build/bin
|
working-directory: ${{github.workspace}}/build/bin
|
||||||
|
|||||||
@@ -24,15 +24,6 @@ include(cmake/SlsAddFlag.cmake)
|
|||||||
include(cmake/helpers.cmake)
|
include(cmake/helpers.cmake)
|
||||||
|
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
|
||||||
|
|
||||||
# POSIX threads are required for the moment but we use CMake to find them
|
|
||||||
# Once migrated to std::thread this can be removed
|
|
||||||
if(NOT CMAKE_USE_PTHREADS_INIT)
|
|
||||||
message(FATAL_ERROR "A POSIX threads (pthread) implementation is required, but was not found.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
option(SLS_USE_SYSTEM_ZMQ "Use system installed libzmq" OFF)
|
option(SLS_USE_SYSTEM_ZMQ "Use system installed libzmq" OFF)
|
||||||
|
|
||||||
# Using FetchContent to get libzmq
|
# Using FetchContent to get libzmq
|
||||||
@@ -341,9 +332,6 @@ if (NOT TARGET slsProjectCSettings)
|
|||||||
-Wno-format-truncation
|
-Wno-format-truncation
|
||||||
)
|
)
|
||||||
sls_disable_c_warning("-Wstringop-truncation")
|
sls_disable_c_warning("-Wstringop-truncation")
|
||||||
target_link_libraries(slsProjectCSettings INTERFACE
|
|
||||||
Threads::Threads
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ cmake .. -G Ninja \
|
|||||||
-DSLS_USE_PYTHON=OFF \
|
-DSLS_USE_PYTHON=OFF \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DSLS_USE_HDF5=OFF \
|
-DSLS_USE_HDF5=OFF \
|
||||||
-DSLS_USE_SYSTEM_ZMQ=ON \
|
|
||||||
|
|
||||||
NCORES=$(getconf _NPROCESSORS_ONLN)
|
NCORES=$(getconf _NPROCESSORS_ONLN)
|
||||||
echo "Building using: ${NCORES} cores"
|
echo "Building using: ${NCORES} cores"
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ requirements:
|
|||||||
- libtiff
|
- libtiff
|
||||||
- zlib
|
- zlib
|
||||||
- expat
|
- expat
|
||||||
- zeromq
|
|
||||||
|
|
||||||
run:
|
run:
|
||||||
- libstdcxx-ng
|
- libstdcxx-ng
|
||||||
|
|||||||
@@ -5,18 +5,18 @@ nsigma 5
|
|||||||
gainfile none
|
gainfile none
|
||||||
detectorMode counting
|
detectorMode counting
|
||||||
threshold 0
|
threshold 0
|
||||||
pedestalfile none
|
pedestalfile /mnt/sls_det_storage/moench_data/testNewFW20230714/cu_half_speed_d0_f0_4.raw
|
||||||
nframes 0
|
nframes 0
|
||||||
xMin 0
|
xMin 0
|
||||||
xMax 400
|
xMax 400
|
||||||
yMin 0
|
yMin 0
|
||||||
yMax 400
|
yMax 400
|
||||||
outdir ./
|
outdir /mnt/sls_det_storage/moench_data/testNewFW20230714/clustNew/
|
||||||
indir ./
|
indir /mnt/sls_det_storage/moench_data/testNewFW20230714/
|
||||||
flist none
|
flist none
|
||||||
fformat none
|
fformat cu_half_speed_d0_f0_4
|
||||||
runmin 0
|
runmin 0
|
||||||
runmax -1
|
runmax 0
|
||||||
readnrows 400
|
readnrows 400
|
||||||
eMin 0
|
eMin 0
|
||||||
eMax 16000
|
eMax 16000
|
||||||
|
|||||||
@@ -33,31 +33,6 @@ def green(msg):
|
|||||||
return f"{GREENC}{msg}{ENDC}"
|
return f"{GREENC}{msg}{ENDC}"
|
||||||
|
|
||||||
|
|
||||||
QUALIFY_KINDS = {
|
|
||||||
cindex.CursorKind.NAMESPACE,
|
|
||||||
cindex.CursorKind.CLASS_DECL,
|
|
||||||
cindex.CursorKind.STRUCT_DECL,
|
|
||||||
cindex.CursorKind.CLASS_TEMPLATE,
|
|
||||||
cindex.CursorKind.ENUM_DECL,
|
|
||||||
cindex.CursorKind.UNION_DECL,
|
|
||||||
cindex.CursorKind.TYPE_ALIAS_DECL,
|
|
||||||
}
|
|
||||||
|
|
||||||
def qualified_name(cur: cindex.Cursor, include_leaf: bool = True) -> str:
|
|
||||||
"""
|
|
||||||
Build a fully-qualified name by following semantic_parent up to the TU.
|
|
||||||
If include_leaf is False, returns just the enclosing scope (namespaces, classes).
|
|
||||||
"""
|
|
||||||
parts = []
|
|
||||||
c = cur if include_leaf else cur.semantic_parent
|
|
||||||
while c and c.kind != cindex.CursorKind.TRANSLATION_UNIT:
|
|
||||||
name = c.spelling or c.displayname # displayname helps for anonymous namespaces
|
|
||||||
if name and (c.kind in QUALIFY_KINDS or c is cur):
|
|
||||||
parts.append(name)
|
|
||||||
c = c.semantic_parent
|
|
||||||
return "::".join(reversed(parts))
|
|
||||||
|
|
||||||
|
|
||||||
def check_libclang_version(required="12"):
|
def check_libclang_version(required="12"):
|
||||||
# Use already-loaded libclang, or let cindex resolve it
|
# Use already-loaded libclang, or let cindex resolve it
|
||||||
lib = ctypes.CDLL(cindex.Config.library_file or ctypes.util.find_library("clang"))
|
lib = ctypes.CDLL(cindex.Config.library_file or ctypes.util.find_library("clang"))
|
||||||
@@ -101,8 +76,8 @@ def check_for_compile_commands_json(path):
|
|||||||
print(msg)
|
print(msg)
|
||||||
|
|
||||||
|
|
||||||
default_build_path = Path("../../build/")
|
default_build_path = "/home/l_frojdh/sls/build/"
|
||||||
fpath = Path("../../slsDetectorSoftware/src/Detector.cpp")
|
fpath = "../../slsDetectorSoftware/src/Detector.cpp"
|
||||||
|
|
||||||
|
|
||||||
m = []
|
m = []
|
||||||
@@ -112,14 +87,25 @@ ag2 = []
|
|||||||
cn = []
|
cn = []
|
||||||
|
|
||||||
|
|
||||||
|
def get_arguments(node):
|
||||||
|
args = [a.type.spelling for a in node.get_arguments()]
|
||||||
|
args = [
|
||||||
|
"py::arg() = Positions{}" if item == "sls::Positions" else "py::arg()"
|
||||||
|
for item in args
|
||||||
|
]
|
||||||
|
args = ", ".join(args)
|
||||||
|
if args:
|
||||||
|
args = f", {args}"
|
||||||
|
return args
|
||||||
|
|
||||||
|
|
||||||
def get_arguments_with_default(node):
|
def get_arguments_with_default(node):
|
||||||
args = []
|
args = []
|
||||||
for arg in node.get_arguments():
|
for arg in node.get_arguments():
|
||||||
tokens = [t.spelling for t in arg.get_tokens()]
|
tokens = [t.spelling for t in arg.get_tokens()]
|
||||||
|
# print(tokens)
|
||||||
if "=" in tokens:
|
if "=" in tokens:
|
||||||
# if arg.type.spelling == "sls::Positions": # TODO! automate+
|
if arg.type.spelling == "sls::Positions": # TODO! automate
|
||||||
if arg.type.spelling == "Positions": # TODO! automate
|
|
||||||
args.append("py::arg() = Positions{}")
|
args.append("py::arg() = Positions{}")
|
||||||
else:
|
else:
|
||||||
args.append("py::arg()" + "".join(tokens[tokens.index("=") :]))
|
args.append("py::arg()" + "".join(tokens[tokens.index("=") :]))
|
||||||
@@ -188,10 +174,6 @@ def visit(node):
|
|||||||
m.append(child)
|
m.append(child)
|
||||||
args = get_arguments_with_default(child)
|
args = get_arguments_with_default(child)
|
||||||
fs = get_fdec(child)
|
fs = get_fdec(child)
|
||||||
qualified_class = qualified_name(child.semantic_parent) # "ns1::ns2::Detector"
|
|
||||||
# lines.append(
|
|
||||||
# f'CppDetectorApi.def("{child.spelling}", {fs} &{qualified_class}::{child.spelling}{args});'
|
|
||||||
# )
|
|
||||||
lines.append(
|
lines.append(
|
||||||
f'CppDetectorApi.def("{child.spelling}",{fs} &Detector::{child.spelling}{args});'
|
f'CppDetectorApi.def("{child.spelling}",{fs} &Detector::{child.spelling}{args});'
|
||||||
)
|
)
|
||||||
@@ -220,11 +202,8 @@ if __name__ == "__main__":
|
|||||||
)
|
)
|
||||||
cargs = parser.parse_args()
|
cargs = parser.parse_args()
|
||||||
|
|
||||||
# check_libclang_version("12")
|
check_libclang_version("12")
|
||||||
# check_clang_format_version(12)
|
check_clang_format_version(12)
|
||||||
cargs.build_path = cargs.build_path.resolve()
|
|
||||||
print(f'Using build path: {cargs.build_path}')
|
|
||||||
|
|
||||||
check_for_compile_commands_json(cargs.build_path)
|
check_for_compile_commands_json(cargs.build_path)
|
||||||
|
|
||||||
print("Parsing functions in Detector.h - ", end="", flush=True)
|
print("Parsing functions in Detector.h - ", end="", flush=True)
|
||||||
@@ -233,17 +212,11 @@ if __name__ == "__main__":
|
|||||||
db = cindex.CompilationDatabase.fromDirectory(cargs.build_path)
|
db = cindex.CompilationDatabase.fromDirectory(cargs.build_path)
|
||||||
index = cindex.Index.create()
|
index = cindex.Index.create()
|
||||||
args = db.getCompileCommands(fpath)
|
args = db.getCompileCommands(fpath)
|
||||||
|
|
||||||
|
|
||||||
args = list(iter(args).__next__().arguments)[0:-1]
|
args = list(iter(args).__next__().arguments)[0:-1]
|
||||||
# print('\n\nUsing compile commands:', args)
|
args = args + "-x c++ --std=c++11".split()
|
||||||
# args = args + "-x c++ --std=c++17".split()
|
|
||||||
syspath = system_include_paths("clang++")
|
syspath = system_include_paths("clang++")
|
||||||
incargs = ["-I" + inc for inc in syspath]
|
incargs = ["-I" + inc for inc in syspath]
|
||||||
args = args + incargs
|
args = args + incargs
|
||||||
args = [arg for arg in args if arg.startswith("-I") or arg.startswith("-D")]
|
|
||||||
# args = incargs
|
|
||||||
# print(f"\n\nUsing compile args: {' '.join(args)}")
|
|
||||||
tu = index.parse(fpath, args=args)
|
tu = index.parse(fpath, args=args)
|
||||||
visit(tu.cursor)
|
visit(tu.cursor)
|
||||||
print(green("OK"))
|
print(green("OK"))
|
||||||
@@ -268,5 +241,5 @@ if __name__ == "__main__":
|
|||||||
subprocess.run(["clang-format", "../src/detector.cpp", "-i"])
|
subprocess.run(["clang-format", "../src/detector.cpp", "-i"])
|
||||||
print(green(" OK"))
|
print(green(" OK"))
|
||||||
|
|
||||||
# print("Changes since last commit:")
|
print("Changes since last commit:")
|
||||||
# subprocess.run(["git", "diff", "../src/detector.cpp"])
|
subprocess.run(["git", "diff", "../src/detector.cpp"])
|
||||||
|
|||||||
@@ -79,10 +79,4 @@ def system_include_paths(compiler, cpp=True):
|
|||||||
line = line.strip()
|
line = line.strip()
|
||||||
paths.append(line)
|
paths.append(line)
|
||||||
paths = [p.decode('utf-8') for p in paths]
|
paths = [p.decode('utf-8') for p in paths]
|
||||||
|
|
||||||
# Only keep include paths from the conda prefix
|
|
||||||
# remove anything pointing to gcc
|
|
||||||
prefix = os.environ['CONDA_PREFIX']
|
|
||||||
paths = [p for p in paths if prefix in p]
|
|
||||||
paths = [p for p in paths if 'gcc' not in p]
|
|
||||||
return paths
|
return paths
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,11 @@
|
|||||||
#include <chrono>
|
#include <chrono>
|
||||||
namespace py = pybind11;
|
namespace py = pybind11;
|
||||||
void init_det(py::module &m) {
|
void init_det(py::module &m) {
|
||||||
using namespace sls; //TODO! qualify arguments and return types to avoid this
|
using sls::defs;
|
||||||
|
using sls::Detector;
|
||||||
|
using sls::ns;
|
||||||
|
using sls::Positions;
|
||||||
|
using sls::Result;
|
||||||
|
|
||||||
m.def("freeSharedMemory", (void (*)(const int, const int)) &sls::freeSharedMemory, py::arg() = 0, py::arg() = -1);
|
m.def("freeSharedMemory", (void (*)(const int, const int)) &sls::freeSharedMemory, py::arg() = 0, py::arg() = -1);
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
add_executable(using_logger using_logger.cpp)
|
add_executable(using_logger using_logger.cpp)
|
||||||
target_link_libraries(using_logger
|
target_link_libraries(using_logger
|
||||||
slsSupportShared
|
slsSupportShared
|
||||||
|
pthread
|
||||||
|
rt
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(using_logger PROPERTIES
|
set_target_properties(using_logger PROPERTIES
|
||||||
|
|||||||
@@ -200,6 +200,9 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
// virtual void prepareInterpolation(int &ok)=0;
|
// virtual void prepareInterpolation(int &ok)=0;
|
||||||
|
|
||||||
void debugSaveAll(int ind = 0) {
|
void debugSaveAll(int ind = 0) {
|
||||||
|
|
||||||
|
std::cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++SAVING ETAS"<< std::endl;
|
||||||
|
|
||||||
int ibx, iby;
|
int ibx, iby;
|
||||||
char tit[10000];
|
char tit[10000];
|
||||||
|
|
||||||
@@ -214,21 +217,21 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
etah[ii] = heta[ii];
|
etah[ii] = heta[ii];
|
||||||
tot_eta += heta[ii];
|
tot_eta += heta[ii];
|
||||||
}
|
}
|
||||||
sprintf(tit, "/scratch/eta_%d.tiff", ind);
|
sprintf(tit, "eta_%d.tiff", ind);
|
||||||
WriteToTiff(etah, tit, nbetaX, nbetaY);
|
WriteToTiff(etah, tit, nbetaX, nbetaY);
|
||||||
|
|
||||||
for (int ii = 0; ii < nbetaX * nbetaY; ii++) {
|
for (int ii = 0; ii < nbetaX * nbetaY; ii++) {
|
||||||
ibb = (hhx[ii] * nSubPixelsX);
|
ibb = (hhx[ii] * nSubPixelsX);
|
||||||
etah[ii] = ibb;
|
etah[ii] = ibb;
|
||||||
}
|
}
|
||||||
sprintf(tit, "/scratch/eta_hhx_%d.tiff", ind);
|
sprintf(tit, "eta_hhx_%d.tiff", ind);
|
||||||
WriteToTiff(etah, tit, nbetaX, nbetaY);
|
WriteToTiff(etah, tit, nbetaX, nbetaY);
|
||||||
|
|
||||||
for (int ii = 0; ii < nbetaX * nbetaY; ii++) {
|
for (int ii = 0; ii < nbetaX * nbetaY; ii++) {
|
||||||
ibb = hhy[ii] * nSubPixelsY;
|
ibb = hhy[ii] * nSubPixelsY;
|
||||||
etah[ii] = ibb;
|
etah[ii] = ibb;
|
||||||
}
|
}
|
||||||
sprintf(tit, "/scratch/eta_hhy_%d.tiff", ind);
|
sprintf(tit, "eta_hhy_%d.tiff", ind);
|
||||||
WriteToTiff(etah, tit, nbetaX, nbetaY);
|
WriteToTiff(etah, tit, nbetaX, nbetaY);
|
||||||
|
|
||||||
float *ftest = new float[nSubPixelsX * nSubPixelsY];
|
float *ftest = new float[nSubPixelsX * nSubPixelsY];
|
||||||
@@ -262,7 +265,7 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(tit, "/scratch/ftest_%d.tiff", ind);
|
sprintf(tit, "./ftest_%d.tiff", ind);
|
||||||
WriteToTiff(ftest, tit, nSubPixelsX, nSubPixelsY);
|
WriteToTiff(ftest, tit, nSubPixelsX, nSubPixelsY);
|
||||||
|
|
||||||
// int ibx=0, iby=0;
|
// int ibx=0, iby=0;
|
||||||
@@ -280,7 +283,7 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
} else
|
} else
|
||||||
etah[ii] = 0;
|
etah[ii] = 0;
|
||||||
}
|
}
|
||||||
sprintf(tit, "/scratch/eta_bad_%d.tiff", ind);
|
sprintf(tit, "./eta_bad_%d.tiff", ind);
|
||||||
WriteToTiff(etah, tit, nbetaX, nbetaY);
|
WriteToTiff(etah, tit, nbetaX, nbetaY);
|
||||||
// std::cout << "Index: " << ind << "\t Bad bins: "<< nbad << std::endl;
|
// std::cout << "Index: " << ind << "\t Bad bins: "<< nbad << std::endl;
|
||||||
// int ibx=0, iby=0;
|
// int ibx=0, iby=0;
|
||||||
|
|||||||
@@ -0,0 +1,232 @@
|
|||||||
|
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||||
|
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||||
|
#ifndef ETA_INTERPOLATION_POSXY_H
|
||||||
|
#define ETA_INTERPOLATION_POSXY_H
|
||||||
|
//#define SAVE_ALL
|
||||||
|
//#include "sls/tiffIO.h"
|
||||||
|
#include "eta2InterpolationBase.h"
|
||||||
|
#include "eta3InterpolationBase.h"
|
||||||
|
#include "etaInterpolationBase.h"
|
||||||
|
|
||||||
|
|
||||||
|
class etaInterpolationRosenblatt : public virtual etaInterpolationBase {
|
||||||
|
public:
|
||||||
|
etaInterpolationRosenblatt(int nx = 400, int ny = 400, int ns = 25, int nsy = 25,
|
||||||
|
int nb = -1, int nby = -1, double emin = 1,
|
||||||
|
double emax = 0)
|
||||||
|
: etaInterpolationBase(nx, ny, ns, nsy, nb, nby, emin, emax){
|
||||||
|
// std::cout << "epxy " << nb << " " << emin << " " << emax << std::endl;
|
||||||
|
// std::cout << nbeta << " " << etamin << " " << etamax << std::endl;
|
||||||
|
};
|
||||||
|
|
||||||
|
etaInterpolationRosenblatt(etaInterpolationRosenblatt *orig)
|
||||||
|
: etaInterpolationBase(orig){};
|
||||||
|
|
||||||
|
virtual etaInterpolationRosenblatt *Clone() = 0; /* { */
|
||||||
|
|
||||||
|
/* return new etaInterpolationPosXY(this); */
|
||||||
|
|
||||||
|
/* }; */
|
||||||
|
|
||||||
|
virtual void prepareInterpolation(int &ok) {
|
||||||
|
ok = 1;
|
||||||
|
|
||||||
|
///*Eta Distribution Rebinning*///
|
||||||
|
// double bsize=1./nSubPixels; //precision
|
||||||
|
// std::cout<<"nPixelsX = "<<nPixelsX<<" nPixelsY = "<<nPixelsY<<" nSubPixels
|
||||||
|
// = "<<nSubPixels<<endl;
|
||||||
|
double tot_eta = 0;
|
||||||
|
double tot_eta_x = 0;
|
||||||
|
double tot_eta_y = 0;
|
||||||
|
for (int ip = 0; ip < nbetaX * nbetaY; ip++)
|
||||||
|
tot_eta += heta[ip];
|
||||||
|
std::cout << "total eta entries is :" << tot_eta << std::endl;
|
||||||
|
if (tot_eta <= 0) {
|
||||||
|
ok = 0;
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
double *hx = new double[nbetaX]; // profile x
|
||||||
|
double *hy = new double[nbetaY]; // profile y
|
||||||
|
double *hix = new double[nbetaX]; // integral of projection x
|
||||||
|
double *hiy = new double[nbetaY]; // integral of projection y
|
||||||
|
// int ii=0;
|
||||||
|
double etax, etay;
|
||||||
|
for (int ib = 0; ib < nbetaX; ib++) {
|
||||||
|
|
||||||
|
// tot_eta_y=0;
|
||||||
|
|
||||||
|
for (int iby = 0; iby < nbetaY; iby++) {
|
||||||
|
etay = etamin + iby * etastepY;
|
||||||
|
// std::cout << etax << std::endl;
|
||||||
|
|
||||||
|
// tot_eta_x+=hx[iby];
|
||||||
|
if (etay >= 0 && etay <= 1)
|
||||||
|
hy[iby] = heta[ib + iby * nbetaX];
|
||||||
|
else
|
||||||
|
hy[iby] = 0;
|
||||||
|
// tot_eta_y+=hy[iby];
|
||||||
|
}
|
||||||
|
|
||||||
|
hiy[0] = hy[0];
|
||||||
|
|
||||||
|
for (int iby = 1; iby < nbetaY; iby++) {
|
||||||
|
hiy[iby] = hiy[iby - 1] + hy[iby];
|
||||||
|
}
|
||||||
|
|
||||||
|
tot_eta_y = hiy[nbetaY - 1] + 1;
|
||||||
|
|
||||||
|
for (int iby = 0; iby < nbetaY; iby++) {
|
||||||
|
if (tot_eta_y <= 0) {
|
||||||
|
hhy[ib + iby * nbetaX] = -1;
|
||||||
|
// ii=(ibx*nSubPixels)/nbeta;
|
||||||
|
} else {
|
||||||
|
// if (hiy[ibx]>tot_eta_y*(ii+1)/nSubPixels) ii++;
|
||||||
|
hhy[ib + iby * nbetaX] = hiy[iby] / tot_eta_y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int ib = 0; ib < nbetaY; ib++) {
|
||||||
|
|
||||||
|
for (int ibx = 0; ibx < nbetaX; ibx++) {
|
||||||
|
etax = etamin + ibx * etastepX;
|
||||||
|
// std::cout << etax << std::endl;
|
||||||
|
if (etax >= 0 && etax <= 1)
|
||||||
|
hx[ibx] = heta[ibx + ib * nbetaX];
|
||||||
|
else {
|
||||||
|
hx[ibx] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hix[0] = hx[0];
|
||||||
|
|
||||||
|
for (int ibx = 1; ibx < nbetaX; ibx++) {
|
||||||
|
hix[ibx] = hix[ibx - 1] + hx[ibx];
|
||||||
|
}
|
||||||
|
|
||||||
|
// tot_eta_x = hix[nbetaX - 1] + 1;
|
||||||
|
|
||||||
|
for (int ibx = 0; ibx < nbetaX; ibx++) {
|
||||||
|
//if (tot_eta_x <= 0) {
|
||||||
|
// hhx[ibx + ib * nbetaX] = -1;
|
||||||
|
// } else {
|
||||||
|
hhx[ibx + ib * nbetaX] = hix[ibx];// / tot_eta_x;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for (int ibx = 0; ibx < nbetaX; ibx++) {
|
||||||
|
int val=0;
|
||||||
|
for (int ib = 0; ib < nbetaY; ib++) {
|
||||||
|
val+=hhx[ibx + ib * nbetaX];
|
||||||
|
}
|
||||||
|
// for (int ibx = 0; ibx < nbetaX; ibx++) {
|
||||||
|
for (int ib = 0; ib < nbetaY; ib++) {
|
||||||
|
hhx[ibx + ib * nbetaX]=val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tot_eta_x = hhx[nbetaX - 1] + 1;
|
||||||
|
for (int ib = 0; ib < nbetaY; ib++) {
|
||||||
|
|
||||||
|
//tot_eta_x = hix[nbetaX - 1] + 1;
|
||||||
|
|
||||||
|
for (int ibx = 0; ibx < nbetaX; ibx++) {
|
||||||
|
if (tot_eta_x <= 0) {
|
||||||
|
hhx[ibx + ib * nbetaX] = -1;
|
||||||
|
} else {
|
||||||
|
hhx[ibx + ib * nbetaX] = hhx[ibx + ib * nbetaX] / tot_eta_x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
int ibx, iby, ib;
|
||||||
|
|
||||||
|
iby = 0;
|
||||||
|
while (hhx[iby * nbetaY + nbetaY / 2] < 0)
|
||||||
|
iby++;
|
||||||
|
for (ib = 0; ib < iby; ib++) {
|
||||||
|
for (ibx = 0; ibx < nbetaX; ibx++)
|
||||||
|
hhx[ibx + nbetaX * ib] = hhx[ibx + nbetaX * iby];
|
||||||
|
}
|
||||||
|
iby = nbetaY - 1;
|
||||||
|
|
||||||
|
while (hhx[iby * nbetaY + nbetaY / 2] < 0)
|
||||||
|
iby--;
|
||||||
|
for (ib = iby + 1; ib < nbetaY; ib++) {
|
||||||
|
for (ibx = 0; ibx < nbetaX; ibx++)
|
||||||
|
hhx[ibx + nbetaX * ib] = hhx[ibx + nbetaX * iby];
|
||||||
|
}
|
||||||
|
|
||||||
|
iby = 0;
|
||||||
|
while (hhy[nbetaX / 2 * nbetaX + iby] < 0)
|
||||||
|
iby++;
|
||||||
|
for (ib = 0; ib < iby; ib++) {
|
||||||
|
for (ibx = 0; ibx < nbetaY; ibx++)
|
||||||
|
hhy[ib + nbetaX * ibx] = hhy[iby + nbetaX * ibx];
|
||||||
|
}
|
||||||
|
iby = nbetaX - 1;
|
||||||
|
|
||||||
|
while (hhy[nbetaX / 2 * nbetaX + iby] < 0)
|
||||||
|
iby--;
|
||||||
|
for (ib = iby + 1; ib < nbetaX; ib++) {
|
||||||
|
for (ibx = 0; ibx < nbetaY; ibx++)
|
||||||
|
hhy[ib + nbetaX * ibx] = hhy[iby + nbetaX * ibx];
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
//#ifdef SAVE_ALL
|
||||||
|
debugSaveAll();
|
||||||
|
//#endif
|
||||||
|
delete[] hx;
|
||||||
|
delete[] hy;
|
||||||
|
delete[] hix;
|
||||||
|
delete[] hiy;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class eta2InterpolationRosenblatt : public virtual eta2InterpolationBase,
|
||||||
|
public virtual etaInterpolationRosenblatt {
|
||||||
|
public:
|
||||||
|
eta2InterpolationRosenblatt(int nx = 400, int ny = 400, int ns = 25,
|
||||||
|
int nsy = 25, int nb = -1, int nby = -1,
|
||||||
|
double emin = 1, double emax = 0)
|
||||||
|
: etaInterpolationBase(nx, ny, ns, nsy, nb, nby, emin, emax),
|
||||||
|
eta2InterpolationBase(nx, ny, ns, nsy, nb, nby, emin, emax),
|
||||||
|
etaInterpolationRosenblatt(nx, ny, ns, nsy, nb, nby, emin, emax){
|
||||||
|
// std::cout << "e2pxy " << nb << " " << emin << " " << emax << std::endl;
|
||||||
|
};
|
||||||
|
|
||||||
|
eta2InterpolationRosenblatt(eta2InterpolationRosenblatt *orig)
|
||||||
|
: etaInterpolationBase(orig), etaInterpolationRosenblatt(orig){};
|
||||||
|
|
||||||
|
virtual eta2InterpolationRosenblatt *Clone() {
|
||||||
|
return new eta2InterpolationRosenblatt(this);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class eta3InterpolationRosenblatt : public virtual eta3InterpolationBase,
|
||||||
|
public virtual etaInterpolationRosenblatt {
|
||||||
|
public:
|
||||||
|
eta3InterpolationRosenblatt(int nx = 400, int ny = 400, int ns = 25,
|
||||||
|
int nsy = 25, int nb = -1, int nby = -1,
|
||||||
|
double emin = 1, double emax = 0)
|
||||||
|
: etaInterpolationBase(nx, ny, ns, nsy, nb, nby, emin, emax),
|
||||||
|
eta3InterpolationBase(nx, ny, ns, nsy, nb, nby, emin, emax),
|
||||||
|
etaInterpolationRosenblatt(nx, ny, ns, nsy, nb, nby, emin, emax){
|
||||||
|
// std::cout << "e3pxy " << nbeta << " " << etamin << " " << etamax
|
||||||
|
// << " " << nSubPixels<< std::endl;
|
||||||
|
};
|
||||||
|
|
||||||
|
eta3InterpolationRosenblatt(eta3InterpolationRosenblatt *orig)
|
||||||
|
: etaInterpolationBase(orig), etaInterpolationRosenblatt(orig){};
|
||||||
|
|
||||||
|
virtual eta3InterpolationRosenblatt *Clone() {
|
||||||
|
return new eta3InterpolationRosenblatt(this);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -76,8 +76,11 @@ foreach(exe ${JUNGFRAU_EXECUTABLES})
|
|||||||
target_link_libraries(${exe}
|
target_link_libraries(${exe}
|
||||||
PUBLIC
|
PUBLIC
|
||||||
slsSupportStatic
|
slsSupportStatic
|
||||||
|
pthread
|
||||||
tiffio
|
tiffio
|
||||||
fmt::fmt
|
fmt::fmt
|
||||||
|
#-L/usr/lib64/
|
||||||
|
#-lm -lstdc++ -lrt
|
||||||
|
|
||||||
PRIVATE
|
PRIVATE
|
||||||
slsProjectWarnings
|
slsProjectWarnings
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ foreach(exe ${MOENCH_EXECUTABLES})
|
|||||||
PUBLIC
|
PUBLIC
|
||||||
slsSupportStatic
|
slsSupportStatic
|
||||||
${ZeroMQ_LIBRARIES}
|
${ZeroMQ_LIBRARIES}
|
||||||
|
pthread
|
||||||
tiffio
|
tiffio
|
||||||
|
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#include "etaInterpolationPosXY.h"
|
//#include "etaInterpolationPosXY.h"
|
||||||
#include "etaInterpolationPosXY.h"
|
#include "etaInterpolationRosenblatt.h"
|
||||||
#include "noInterpolation.h"
|
#include "noInterpolation.h"
|
||||||
//#include "etaInterpolationCleverAdaptiveBins.h"
|
//#include "etaInterpolationCleverAdaptiveBins.h"
|
||||||
//#include "etaInterpolationRandomBins.h"
|
//#include "etaInterpolationRandomBins.h"
|
||||||
@@ -114,8 +114,8 @@ int main(int argc, char *argv[]) {
|
|||||||
//int f0 = -1;
|
//int f0 = -1;
|
||||||
// int nSubPixels = nsubpix;
|
// int nSubPixels = nsubpix;
|
||||||
#ifndef NOINTERPOLATION
|
#ifndef NOINTERPOLATION
|
||||||
eta2InterpolationPosXY *interp =
|
eta2InterpolationRosenblatt *interp =
|
||||||
new eta2InterpolationPosXY(NC, NR, nsubpix, nsubpix, etabins, etabins, etamin, etamax);
|
new eta2InterpolationRosenblatt(NC, NR, nsubpix, nsubpix, etabins, etabins, etamin, etamax);
|
||||||
// eta2InterpolationCleverAdaptiveBins *interp=new
|
// eta2InterpolationCleverAdaptiveBins *interp=new
|
||||||
// eta2InterpolationCleverAdaptiveBins(NC, NR, nsubpix, etabins, etamin,
|
// eta2InterpolationCleverAdaptiveBins(NC, NR, nsubpix, etabins, etamin,
|
||||||
// etamax);
|
// etamax);
|
||||||
@@ -134,6 +134,7 @@ int main(int argc, char *argv[]) {
|
|||||||
cout << "read ff " << argv[2] << endl;
|
cout << "read ff " << argv[2] << endl;
|
||||||
sprintf(fname, "%s", argv[2]);
|
sprintf(fname, "%s", argv[2]);
|
||||||
interp->readFlatField(fname);
|
interp->readFlatField(fname);
|
||||||
|
|
||||||
interp->prepareInterpolation(ok); //, MAX_ITERATIONS);
|
interp->prepareInterpolation(ok); //, MAX_ITERATIONS);
|
||||||
#endif
|
#endif
|
||||||
// return 0;
|
// return 0;
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ int main(int argc, char *argv[]) {
|
|||||||
int nped = 1000;
|
int nped = 1000;
|
||||||
|
|
||||||
int cf = 0;
|
int cf = 0;
|
||||||
|
|
||||||
int numberOfPackets=nrows/8;
|
int numberOfPackets=nrows/8;
|
||||||
#ifdef RECT
|
#ifdef RECT
|
||||||
cout << "Should be rectangular but now it will crash! No data structure defined!" << endl;
|
cout << "Should be rectangular but now it will crash! No data structure defined!" << endl;
|
||||||
@@ -181,7 +182,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
#ifndef MOENCH04
|
#ifndef MOENCH04
|
||||||
moench03v2Data *decoder = new moench03v2Data(nrows/2);
|
moench03v2Data *decoder = new moench03v2Data(nrows/2);
|
||||||
cout << "MOENCH03!" << endl;
|
cout << "MOENCH03 V2!" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOENCH04
|
#ifdef MOENCH04
|
||||||
@@ -298,7 +299,7 @@ int main(int argc, char *argv[]) {
|
|||||||
double *ped=new double[nx * ny];//, *ped1;
|
double *ped=new double[nx * ny];//, *ped1;
|
||||||
int pos,pos1;
|
int pos,pos1;
|
||||||
//return 0;
|
//return 0;
|
||||||
|
|
||||||
if (pedfile.find(".raw") != std::string::npos) {
|
if (pedfile.find(".raw") != std::string::npos) {
|
||||||
pos1=pedfile.rfind("/");
|
pos1=pedfile.rfind("/");
|
||||||
strcpy(froot,pedfile.substr(pos1).c_str());
|
strcpy(froot,pedfile.substr(pos1).c_str());
|
||||||
@@ -309,6 +310,7 @@ int main(int argc, char *argv[]) {
|
|||||||
cout << "PEDESTAL " << endl;
|
cout << "PEDESTAL " << endl;
|
||||||
if (pedfile.find(".tif") == std::string::npos) {
|
if (pedfile.find(".tif") == std::string::npos) {
|
||||||
sprintf(fname, "%s", pedfile.c_str());
|
sprintf(fname, "%s", pedfile.c_str());
|
||||||
|
|
||||||
cout << fname << endl;
|
cout << fname << endl;
|
||||||
std::time(&end_time);
|
std::time(&end_time);
|
||||||
//cout << "aaa" << std::ctime(&end_time) << endl;
|
//cout << "aaa" << std::ctime(&end_time) << endl;
|
||||||
@@ -320,24 +322,28 @@ int main(int argc, char *argv[]) {
|
|||||||
if (filebin.is_open()) {
|
if (filebin.is_open()) {
|
||||||
ff = -1;
|
ff = -1;
|
||||||
while (decoder->readNextFrame(filebin, ff, np, buff)) {
|
while (decoder->readNextFrame(filebin, ff, np, buff)) {
|
||||||
|
|
||||||
if (np == numberOfPackets) {
|
if (np == numberOfPackets) {
|
||||||
mt->pushData(buff);
|
mt->pushData(buff);
|
||||||
mt->nextThread();
|
mt->nextThread();
|
||||||
mt->popFree(buff);
|
mt->popFree(buff);
|
||||||
ifr++;
|
ifr++;
|
||||||
if (ifr % 100 == 0)
|
if (ifr % 100 == 0)
|
||||||
|
|
||||||
cout << ifr << " " << ff << " " << np << endl;
|
cout << ifr << " " << ff << " " << np << endl;
|
||||||
// break;
|
// break;
|
||||||
} else {
|
} else {
|
||||||
cout << ifr << " " << ff << " " << np << endl;
|
cout << "bp "<< ifr << " " << ff << " " << np << endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ff = -1;
|
ff = -1;
|
||||||
}
|
}
|
||||||
filebin.close();
|
filebin.close();
|
||||||
while (mt->isBusy()) {
|
while (mt->isBusy()) {
|
||||||
;
|
|
||||||
}
|
;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
sprintf(imgfname, "%s/%s_ped.tiff", outdir.c_str(),froot);
|
sprintf(imgfname, "%s/%s_ped.tiff", outdir.c_str(),froot);
|
||||||
mt->writePedestal(imgfname);
|
mt->writePedestal(imgfname);
|
||||||
@@ -382,7 +388,7 @@ int main(int argc, char *argv[]) {
|
|||||||
runmax--;
|
runmax--;
|
||||||
flist.close();
|
flist.close();
|
||||||
cout << "Found " << runmax << " files " << endl;
|
cout << "Found " << runmax << " files " << endl;
|
||||||
flist.open (fformat, std::ifstream::in);
|
flist.open (args["flist"].c_str(), std::ifstream::in);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int irun = runmin; irun <= runmax; irun++) {
|
for (int irun = runmin; irun <= runmax; irun++) {
|
||||||
@@ -435,6 +441,7 @@ int main(int argc, char *argv[]) {
|
|||||||
ff = -1;
|
ff = -1;
|
||||||
ifr = 0;
|
ifr = 0;
|
||||||
while (decoder->readNextFrame(filebin, ff, np, buff)) {
|
while (decoder->readNextFrame(filebin, ff, np, buff)) {
|
||||||
|
|
||||||
if (np == numberOfPackets) {
|
if (np == numberOfPackets) {
|
||||||
// //push
|
// //push
|
||||||
mt->pushData(buff);
|
mt->pushData(buff);
|
||||||
@@ -462,8 +469,19 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cout << "bp " << ifr << " " << ff << " " << np << endl;
|
cout << "bp " << ifr << " " << ff << " " << np << endl;
|
||||||
|
|
||||||
}
|
}
|
||||||
ff = -1;
|
ff = -1;
|
||||||
|
|
||||||
|
|
||||||
|
if (ifr % 100 == 0){
|
||||||
|
sprintf(imgfname, "%s/%s_f%05d_ped.tiff", outdir.c_str(),froot, ifile++);
|
||||||
|
while (mt->isBusy()) {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
mt->writePedestal(imgfname);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
cout << "--" << endl;
|
cout << "--" << endl;
|
||||||
filebin.close();
|
filebin.close();
|
||||||
|
|||||||
@@ -37,9 +37,7 @@ target_compile_definitions(ctbDetectorServer_virtual
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(ctbDetectorServer_virtual
|
target_link_libraries(ctbDetectorServer_virtual
|
||||||
PUBLIC
|
PUBLIC pthread rt m slsProjectCSettings
|
||||||
m
|
|
||||||
slsProjectCSettings
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(ctbDetectorServer_virtual PROPERTIES
|
set_target_properties(ctbDetectorServer_virtual PROPERTIES
|
||||||
|
|||||||
@@ -30,8 +30,7 @@ target_compile_definitions(eigerDetectorServer_virtual
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(eigerDetectorServer_virtual
|
target_link_libraries(eigerDetectorServer_virtual
|
||||||
PUBLIC
|
PUBLIC pthread rt slsProjectCSettings
|
||||||
slsProjectCSettings
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(eigerDetectorServer_virtual PROPERTIES
|
set_target_properties(eigerDetectorServer_virtual PROPERTIES
|
||||||
|
|||||||
@@ -31,8 +31,7 @@ target_compile_definitions(gotthard2DetectorServer_virtual
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(gotthard2DetectorServer_virtual
|
target_link_libraries(gotthard2DetectorServer_virtual
|
||||||
PUBLIC
|
PUBLIC pthread rt slsProjectCSettings
|
||||||
slsProjectCSettings
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(gotthard2DetectorServer_virtual PROPERTIES
|
set_target_properties(gotthard2DetectorServer_virtual PROPERTIES
|
||||||
|
|||||||
@@ -29,8 +29,7 @@ target_compile_definitions(jungfrauDetectorServer_virtual
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(jungfrauDetectorServer_virtual
|
target_link_libraries(jungfrauDetectorServer_virtual
|
||||||
PUBLIC
|
PUBLIC pthread rt slsProjectCSettings
|
||||||
slsProjectCSettings
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(jungfrauDetectorServer_virtual PROPERTIES
|
set_target_properties(jungfrauDetectorServer_virtual PROPERTIES
|
||||||
|
|||||||
@@ -29,8 +29,7 @@ target_compile_definitions(moenchDetectorServer_virtual
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(moenchDetectorServer_virtual
|
target_link_libraries(moenchDetectorServer_virtual
|
||||||
PUBLIC
|
PUBLIC pthread rt slsProjectCSettings
|
||||||
slsProjectCSettings
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(moenchDetectorServer_virtual PROPERTIES
|
set_target_properties(moenchDetectorServer_virtual PROPERTIES
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ target_compile_definitions(mythen3DetectorServer_virtual
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(mythen3DetectorServer_virtual
|
target_link_libraries(mythen3DetectorServer_virtual
|
||||||
PUBLIC
|
PUBLIC pthread rt slsProjectCSettings
|
||||||
slsProjectCSettings
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(mythen3DetectorServer_virtual PROPERTIES
|
set_target_properties(mythen3DetectorServer_virtual PROPERTIES
|
||||||
|
|||||||
@@ -31,9 +31,7 @@ target_compile_definitions(xilinx_ctbDetectorServer_virtual
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(xilinx_ctbDetectorServer_virtual
|
target_link_libraries(xilinx_ctbDetectorServer_virtual
|
||||||
PUBLIC
|
PUBLIC pthread rt m slsProjectCSettings
|
||||||
m
|
|
||||||
slsProjectCSettings
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(xilinx_ctbDetectorServer_virtual PROPERTIES
|
set_target_properties(xilinx_ctbDetectorServer_virtual PROPERTIES
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ target_link_libraries(slsDetectorObject
|
|||||||
PUBLIC
|
PUBLIC
|
||||||
slsProjectOptions
|
slsProjectOptions
|
||||||
slsSupportStatic
|
slsSupportStatic
|
||||||
|
pthread
|
||||||
PRIVATE
|
PRIVATE
|
||||||
slsProjectWarnings
|
slsProjectWarnings
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
set(DETECTOR_LIBRARY_TARGETS slsDetectorObject)
|
set(DETECTOR_LIBRARY_TARGETS slsDetectorObject)
|
||||||
|
|
||||||
|
|
||||||
@@ -97,7 +97,8 @@ if(SLS_USE_TEXTCLIENT)
|
|||||||
add_executable(${val1} src/CmdApp.cpp)
|
add_executable(${val1} src/CmdApp.cpp)
|
||||||
|
|
||||||
target_link_libraries(${val1}
|
target_link_libraries(${val1}
|
||||||
slsDetectorStatic
|
slsDetectorStatic
|
||||||
|
pthread
|
||||||
)
|
)
|
||||||
SET_SOURCE_FILES_PROPERTIES( src/Caller.cpp PROPERTIES COMPILE_FLAGS "-Wno-unused-variable -Wno-unused-but-set-variable")
|
SET_SOURCE_FILES_PROPERTIES( src/Caller.cpp PROPERTIES COMPILE_FLAGS "-Wno-unused-variable -Wno-unused-but-set-variable")
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ target_link_libraries(slsReceiverObject
|
|||||||
slsProjectOptions
|
slsProjectOptions
|
||||||
slsSupportStatic
|
slsSupportStatic
|
||||||
PRIVATE
|
PRIVATE
|
||||||
slsProjectWarnings #don't propagate warnings
|
slsProjectWarnings #don't propagate warnigns
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_definitions(slsReceiverObject
|
target_compile_definitions(slsReceiverObject
|
||||||
@@ -118,6 +118,8 @@ if (SLS_USE_RECEIVER_BINARIES)
|
|||||||
target_link_libraries(slsReceiver PUBLIC
|
target_link_libraries(slsReceiver PUBLIC
|
||||||
PUBLIC
|
PUBLIC
|
||||||
slsReceiverStatic
|
slsReceiverStatic
|
||||||
|
pthread
|
||||||
|
rt
|
||||||
PRIVATE
|
PRIVATE
|
||||||
slsProjectWarnings
|
slsProjectWarnings
|
||||||
)
|
)
|
||||||
@@ -136,6 +138,8 @@ if (SLS_USE_RECEIVER_BINARIES)
|
|||||||
target_link_libraries(slsMultiReceiver
|
target_link_libraries(slsMultiReceiver
|
||||||
PUBLIC
|
PUBLIC
|
||||||
slsReceiverStatic
|
slsReceiverStatic
|
||||||
|
pthread
|
||||||
|
rt
|
||||||
PRIVATE
|
PRIVATE
|
||||||
slsProjectWarnings
|
slsProjectWarnings
|
||||||
)
|
)
|
||||||
@@ -154,6 +158,8 @@ if (SLS_USE_RECEIVER_BINARIES)
|
|||||||
target_link_libraries(slsFrameSynchronizer
|
target_link_libraries(slsFrameSynchronizer
|
||||||
PUBLIC
|
PUBLIC
|
||||||
slsReceiverStatic
|
slsReceiverStatic
|
||||||
|
pthread
|
||||||
|
rt
|
||||||
PRIVATE
|
PRIVATE
|
||||||
slsProjectWarnings
|
slsProjectWarnings
|
||||||
|
|
||||||
|
|||||||
@@ -147,12 +147,8 @@ TEST_CASE("Parse port and uid", "[detector]") {
|
|||||||
for (auto app : {AppType::SingleReceiver, AppType::MultiReceiver,
|
for (auto app : {AppType::SingleReceiver, AppType::MultiReceiver,
|
||||||
AppType::FrameSynchronizer}) {
|
AppType::FrameSynchronizer}) {
|
||||||
CommandLineOptions s(app);
|
CommandLineOptions s(app);
|
||||||
|
REQUIRE_THROWS(
|
||||||
// TODO! This test fails on gitea CI probably because the user can set the uid
|
s.parse({"", "-p", "1234", "-u", invalidUidStr})); // invalid uid
|
||||||
// commenting it out for now. Revisit later.
|
|
||||||
// REQUIRE_THROWS(
|
|
||||||
// s.parse({"", "-p", "1234", "-u", invalidUidStr})); // invalid uid
|
|
||||||
|
|
||||||
REQUIRE_THROWS(s.parse({"", "-p", "500"})); // invalid port
|
REQUIRE_THROWS(s.parse({"", "-p", "500"})); // invalid port
|
||||||
|
|
||||||
auto opts = s.parse({"", "-p", "1234", "-u", uidStr});
|
auto opts = s.parse({"", "-p", "1234", "-u", uidStr});
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
# SPDX-License-Identifier: LGPL-3.0-or-other
|
||||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
src/string_utils.cpp
|
src/string_utils.cpp
|
||||||
src/file_utils.cpp
|
src/file_utils.cpp
|
||||||
@@ -92,17 +89,12 @@ target_link_libraries(slsSupportObject
|
|||||||
PUBLIC
|
PUBLIC
|
||||||
slsProjectOptions
|
slsProjectOptions
|
||||||
${STD_FS_LIB} # from helpers.cmake
|
${STD_FS_LIB} # from helpers.cmake
|
||||||
Threads::Threads # slsDetector and Receiver need this
|
|
||||||
|
|
||||||
PRIVATE
|
PRIVATE
|
||||||
slsProjectWarnings
|
slsProjectWarnings
|
||||||
md5sls
|
md5sls
|
||||||
)
|
)
|
||||||
|
|
||||||
#RH8 glibc 2.28, RH9 glibc 2.34 linking rt is only needed with glibc < 2.34
|
|
||||||
#but we do it for all Linux builds to avoid too many conditionals
|
|
||||||
target_link_libraries (slsSupportObject PUBLIC $<$<PLATFORM_ID:Linux>:rt>)
|
|
||||||
|
|
||||||
#Treat both vendored and system zmq as interface for receiver binaries
|
#Treat both vendored and system zmq as interface for receiver binaries
|
||||||
if(SLS_USE_SYSTEM_ZMQ)
|
if(SLS_USE_SYSTEM_ZMQ)
|
||||||
message(STATUS "slsSupportLib using ZEROMQ_TARGET=${ZEROMQ_TARGET}")
|
message(STATUS "slsSupportLib using ZEROMQ_TARGET=${ZEROMQ_TARGET}")
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ target_link_libraries(tests
|
|||||||
PUBLIC
|
PUBLIC
|
||||||
slsProjectOptions
|
slsProjectOptions
|
||||||
slsSupportStatic
|
slsSupportStatic
|
||||||
|
pthread
|
||||||
PRIVATE
|
PRIVATE
|
||||||
slsProjectWarnings
|
slsProjectWarnings
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user