# :warning: :construction: Under Construction :construction: :warning:
An application to simulate the setup of the Rutherford Experiment Advanced Lab Course (F-Praktikum Versuch 311) at the Faculty of Physics and Astronomy at Ruhr-Universität Bochum is constructed here.
The project is in its early stages right now, so please come back later...
# Fp311Online Common Library
## About
Submodule for the [Fp311Online Client](https://gitlab.ep1.rub.de/fp311online/fp311online-client) and [Fp311Online Server](https://gitlab.ep1.rub.de/fp311online/fp311online-server) Applications to host code common to both projects. (The server part may be inaccessible to you.)
The overall project aims to simulate the setup of the Advanced Lab Course for Physics Students on the Rutherford Experiment (F-Praktikum Physik Versuch 311 – Rutherford-Experiment) at the [Faculty of Physics and Astronomy](https://www.physik.ruhr-uni-bochum.de/) at [Ruhr-Universität Bochum](https://www.ruhr-uni-bochum.de/).
Using this software, students can still complete this lab course despite of the Covid-19 pandemic which makes working on the physical setup at the university impossible.
## License
This library is free software, it is licensed under the terms and conditions of the [GNU General Public License (GPL) as published by the Free Software Foundation, either version 3](https://www.gnu.org/licenses/gpl-3.0.html) of the GPL or — at your option — any later version.
## Build Requirements
* GNU C and C++ Compiler, version 8 or higher
* Alternatively, Clang version 7 or higher should work, but has not been tested
* GNU Toolchain or compatible (`ld`, `make`, etc.)
* CMake, version 3.13 or higher
* Qt 5.12 or higher, including header files and tools
* ROOT version 6.16 or higher, if host ROOT installation is used
* Dependencies for ROOT, if the ROOT submodule is built (see https://root.cern/install/dependencies/) for details:
*`libX11` and development headers
*`libxpm` and development headers
*`libxft` and development headers
*`libxext` and development headers
*`libpng` and development headers
*`libjpeg` and development headers
* Python, version 2.7 or higher
*`libssl` and development headers
## Build Instructions
The common library is integrated into the client and server applications as Git submodule and CMake subdirectory.
A stand-alone build is possible, but does not yield a usable application.
To compile the library, first clone the Git repository:
Fp311Online uses C++17 by default, but you may have to change it to the C++ standard your ROOT installation was compiled with, otherwise you may get compilation errors.
The libfp311online repository contains a modified ROOT version as a submodule. To compile this version of ROOT and libfp311online based on it, execute:
In both cases, after CMake has sucessfully prepared the build system, run
```bash
make
```
to do the actual compilation.
Please be advised that compiling ROOT from scratch can take a lot of time depending on the speed of the machine.
You can add the parameter `-jN` with `N` being a natural number to run `N` compilation steps in parallel.
## Open Source Frameworks used by this Library
This project uses code from other open source projects.
Under their respective licenses, you have the right to access their source code and distribute unmodified as well as modified versions of them.
### Qt
[Qt](https://qt.io) is a cross-platform C++ framework developed by “The Qt Company” to build graphical applications.
It is used in this software to create the user interface and to handle the client/server communication via the websockets protocol.
This library uses the modules “Core“, “Gui“, “Widgets“, “Network”, and “WebSockets“ from Qt. All of them are licensend under the [GNU Lesser General Public License (LGPL), version 3](https://www.gnu.org/licenses/lgpl-3.0.html).
If you use the Flatpak build containing this library, Qt is not shipped with the Flatpak bundle, but is part of the Flatpak runtime environment `org.kde.Platform`, see [the Flatpak webpage](https://docs.flatpak.org/en/latest/available-runtimes.html) for details.
The source code can be accessed on the GitLab installation of the KDE Project:
If you compiled this application from source, the Qt libraries and header files installed on your computer are used.
Please consult your distributor for access to the source code of these libraries.
### ROOT
[ROOT](https://root.cern) is a data analysis framework developed by [CERN](https://home.cern).
It is used in Fp311Online to generate the events on the server and display and fit the histogram on the client.
ROOT is licensed under the terms of the [GNU Lesser General Public License (LGPL), version 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html) or later.
This project has a modified version of ROOT to make it run (better) inside the Flatpak sandbox.
The source code of this modified version is available on the GitLab of Institut für Experimentalphysik I:
https://gitlab.ep1.rub.de/fp311online/cern-root
The source code of the original ROOT project can be found on GitHub: https://github.com/root-project/root
When run outside of the Flatpak sandbox, this library can also use the unmodified version of ROOT. Inside the sanbox, unmodified versions should work, but the startup performance may be reduced.