documentation and examples

This commit is contained in:
2023-11-12 15:11:36 +01:00
parent e2d7af28dc
commit 4198db8365
17 changed files with 111 additions and 81 deletions

View File

@ -19,7 +19,7 @@ A minimal CMakeLists.txt could look like this:
.. code-block:: cmake
project(myDetectorIntegration)
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.14)
add_subdirectory(slsDetectorPackage)
#Add your executable
@ -43,7 +43,7 @@ should be needed, otherwise specify cmake prefix path.
.. code-block:: cmake
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.14)
project(myintegration)
find_package(slsDetectorPackage 5.0 REQUIRED)

View File

@ -13,7 +13,7 @@ To use the basic building blocks, meaning sls_detector_get/put and
the shared libraries these are needed:
* Linux, preferably recent kernel (currently no cross platform support)
* CMake > 3.14
* CMake >= 3.14
* C++11 compatible compiler. (We test with gcc and clang)
-----------------------

View File

@ -1,16 +1,19 @@
Detector
==============================================
The sls::Detector is the new public API to control
The sls::Detector is the public API to control
detectors from C++. This API is also used internally
for the Python bindings and the command line interface.
If a receiver has been configured this is also controlled
If a receiver has been configured, this is also controlled
through this class.
Most, if not all, functions are called in parallel
and the return value is a thin std::vector wrapper
containing results from all modules. (Result<T>)
containing results from all modules. (:ref:`Result class<Result Class>`)
Here are some :ref:`examples <Cplusplus Api Examples>` on how to use the API.
.. _Cplusplus Api Examples:
.. doxygenclass:: sls::Detector
:members:
:undoc-members:

View File

@ -1,3 +1,4 @@
.. _Cplusplus Api Examples:
@ -53,8 +54,8 @@ then set up the detector.
jungfrauDetectorServer_virtual
This launches a virtual Jungfrau detector server. As default is uses port 1952 and 1953
for communication over TCP. Most commands go on 1952 and only stop and status on 1953.
This launches a virtual Jungfrau detector server. As default it uses port 1952 and 1953
for communication over TCP. Most commands go on 1952 and only a few such as stop and status on 1953.
**Run example to configure**
@ -90,7 +91,10 @@ std::vector.
sls::Result<int> res1{1, 1, 1};
std::cout << "res1: " << res1 << '\n';
res1.squash();
# return -1 if different
res1.squash(-1);
# throw exception with custom message if different
res1.tsquash("Values are different);

View File

@ -120,7 +120,7 @@ Program from console
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update jungfrauDetectorServervxxx pcxxx xx.pof
# v6.1.1 - present (copies server from the full path provided)
@ -190,7 +190,7 @@ Program from console
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update mythen3DetectorServervxxx pcxxx xxx.rbf
# v6.1.1 - present (copies server from the full path provided)
@ -224,7 +224,7 @@ Program from console
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update gotthard2DetectorServervxxx pcxxx xxx.rbf
# v6.1.1 - present (copies server from the full path provided)
@ -275,7 +275,7 @@ Program from console
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update moenchDetectorServervxxx pcxxx xx.pof
# v6.1.1 - present (copies server from the full path provided)
@ -310,7 +310,7 @@ Program from console
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update ctbDetectorServervxxx pcxxx xx.pof
# v6.1.1 - present (copies server from the full path provided)

View File

@ -8,8 +8,8 @@ Welcome to slsDetectorPackage's documentation!
.. note ::
This is the documentation for the latest development version of slsDetectorPackage
For documentation on current and previous releases visit the official page: https://www.psi.ch/en/detectors/documentation
This is the documentation for the latest development version of slsDetectorPackage.
For further documentation, visit the official page: https://www.psi.ch/en/detectors/documentation
.. toctree::
:maxdepth: 1

View File

@ -113,6 +113,8 @@ Example cmake options Comment
-DSLS_USE_PYTHON=ON Python
-DPython_FIND_VIRTUALENV=ONLY Python from the conda env
-DSLS_USE_GUI=ON GUI
-DSLS_USE_HDF5=ON HDF5
-DSLS_USE_SIMULATOR=ON Simulator
=============================== ===============================
.. note ::
@ -255,7 +257,7 @@ is to use conda
.. code-block:: bash
conda create -n myenv python sphinx_rtd_theme breathe
conda create -n myenv python=3.12 sphinx sphinx_rtd_theme breathe doxygen numpy
.. code-block:: bash
@ -279,7 +281,7 @@ Pybind and Zeromq
| v8.0.0+:
| pybind11 (v2.11.0) is built
| * by default from tar file in repo (libs/pybind/v2.11.0.tar.gz)
| * or use option SLS_FETCH_PYBIND11_FROM_GITHUB `[link] <https://github.com/pybind/pybind11>`__.
| * or use advanced option SLS_FETCH_PYBIND11_FROM_GITHUB [`link <https://github.com/pybind/pybind11>`__].
|
| v7.x.x:
| pybind11 packaged into 'libs/pybind'. No longer a submodule. No need for "recursive" or "submodule update".
@ -307,11 +309,11 @@ Pybind and Zeromq
| v8.0.0+:
| zeromq (v4.3.4) is built
| * by default from tar file in repo (libs/libzmq/libzmq-4.3.4.tar.gz)
| * or use option SLS_FETCH_ZMQ_FROM_GITHUB `[link] <https://github.com/zeromq/libzmq.git>`__.
| * or use advanced option SLS_FETCH_ZMQ_FROM_GITHUB [`link <https://github.com/zeromq/libzmq.git>`__].
|
| v7.x.x and older:
| zeromq must be installed and one can hint its location using
| * cmake option:'-DZeroMQ_HINT=/usr/lib64' or
| * option '-q' in cmk.sh script: : ./cmk.sh -cbj5 -q /usr/lib64
| * 'zeromq' dependencies when installing using conda
| * 'zeromq' dependency added when installing using conda

View File

@ -109,12 +109,14 @@ For Multiple Modules
# connects to mulitple modules
hostname bchipxxx+bchipyyy+
# connects to receivers at ports 2012 and 2014
rx_hostname mpc1922:2012+mpc1922:2013+
# tcp port increases for each module (multi detector command)
rx_tcpport 2012
# sets differernt destination udp ports
0:udp_dstport 50012
1:udp_dstport 50014
# connects to receivers at ports 2012 and 2014
rx_hostname mpc1922
# increasing udp ports (multi detector command)
udp_dstport 50012
# source udp ips must be same subnet at destintaion udp ips
0:udp_srcip 192.168.1.112

View File

@ -1,3 +1,5 @@
.. _Result Class:
Result
==============================================

View File

@ -52,8 +52,13 @@ Client Commands
# multi modules with custom ports
rx_hostname xxx:1955+xxx:1956+
# multi modules using increasing tcp ports when using multi detector command
rx_tcpport 1955
rx_hostname xxx
# multi modules with custom ports on same rxr pc
# or specify multi modules with custom ports on same rxr pc
0:rx_tcpport 1954
1:rx_tcpport 1955
2:rx_tcpport 1956

View File

@ -86,7 +86,8 @@ For a Single Module (With Options)
udp_dstport 50012
# source udp ips must be same subnet at destintaion udp ips
udp_srcip 192.168.1.112
# takes the same ip as hostname
udp_srcip auto
# destination udp ip picked up from rx_hostname (if auto)
udp_dstip auto
@ -101,12 +102,14 @@ For Multiple Modules
virtual 2 1912
# or hostname localhost:1912+localhost:1914+
# connects to receivers at ports 2012 and 2014
rx_hostname mpc1922:2012+mpc1922:2013+
# increasing receiver tcp ports (multi detector command)
rx_tcpport 2012
# sets differernt destination udp ports
0:udp_dstport 50012
1:udp_dstport 50014
# connects to reciever at port 2012 and 2013
rx_hostname mpc1922
# sets increasing destination udp ports
udp_dstport 50012
# source udp ips must be same subnet at destintaion udp ips
0:udp_srcip 192.168.1.112