Code organisation¶
The software is stored in CPUsoftware/
with the following file structure:
The source code:
src/
: main source codeinc/
: include headerslib/
: libraries required to run the software
Build dirs:
obj/
: objects files produced on makebin/
: executable
Configuration and logs:
log/
: log files written hereconfig/
: configuration files sotred here
NB: The data format headers are stored outside the main code as they need to be accessed by other software The data format headers are stored in the highlest level directory of the GitHub repository
minieuso_data_format/
: the header files describing the data format from Zynq and the CPUminieuso_data_format.h
- CPU data filesminieuso_pdmdata.h
- structures defined in the Zynq board software
The code can be compiled using the Makefile by running make
in CPUsoftware/
. First, the libraries must be compiled by running make
in CPUsoftware/lib
.
When compiled, the software produces the mecontrol executable which is symlinked to /usr/local/bin
by the Makefile. This command runs the mecontrol.cpp
program and accepts a wide range of command line arguments, which are detailed in the usage documentation, and can also be checked by running mecontrol -help
.
In more detail¶
Inside the src/
directory, the main source code is organised by functionality as follows:
main/
: the main programmecontrol.cpp
mecontrol.h
instrument/
: the RunInstrument class to control the whole instrumentRunInstrument.cpp
- control of instrument and mode switchingRunInstrument.h
operations/
: OperationMode base class and two daughter classesOperationMode.cpp
- base class for an operational modeOperationMode.h
DataAcquisition.cpp
- data acquisition (NIGHT mode)DataAcquisition.h
DataReduction.cpp
- data reduction (DAY mode)DataReduction.h
subsystems/
: Manager classes to control all the necessary subsystemsAnalogManager.cpp
- analog acquisition using the DM75xx boardAnalogManager.h
(photodiodes, SiPMs)CamManager.cpp
- interface to the camera softwareCamManager.h
LvpsManager.cpp
- powering of subsystems using the LVPSLvpsManager.h
ThermManager.cpp
- thermistor acquisitionThermManager.h
UsbManager.cpp
- usb storage and data backupUsbManager.h
ZynqManager.cpp
- Zynq board interface via telnetZynqManager.h
tools/
: useful tools used throughout the softwareConfigManager.cpp
- parsing the configuration fileConfigManager.h
CpuTools.cpp
- useful functionsCpuTools.h
InputParser.cpp
- parsing command line inputInputParser.h
SynchronisedFile.cpp
- safe asynchronous file writingSynchronisedFile.h
log.cpp
- logginglog.h
This is just intended to give an overview and further details are provided in the class documentation in the development section.