mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-10 14:50:02 +02:00
docs
This commit is contained in:
parent
3b071cc43f
commit
8ae0659478
@ -38,6 +38,7 @@ set(SPHINX_SOURCE_FILES
|
||||
src/pydetector.rst
|
||||
src/pyenums.rst
|
||||
src/pyexamples.rst
|
||||
src/servers.rst
|
||||
src/receiver.rst
|
||||
src/result.rst
|
||||
src/type_traits.rst
|
||||
@ -57,6 +58,11 @@ configure_file(
|
||||
"${SPHINX_BUILD}/conf.py"
|
||||
@ONLY)
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/gen_server_doc.py.in"
|
||||
"${SPHINX_BUILD}/gen_server_doc.py"
|
||||
@ONLY)
|
||||
|
||||
add_custom_target(docs
|
||||
gendoc
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
||||
@ -74,3 +80,6 @@ add_custom_target(rst
|
||||
${SPHINX_BUILD}/src
|
||||
${SPHINX_BUILD}/html
|
||||
COMMENT "Generating documentation with Sphinx")
|
||||
|
||||
add_custom_target(hej
|
||||
python gen_server_doc.py)
|
43
docs/gen_server_doc.py.in
Normal file
43
docs/gen_server_doc.py.in
Normal file
@ -0,0 +1,43 @@
|
||||
import os
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
# @CMAKE_CURRENT_BINARY_DIR@
|
||||
|
||||
src = Path('@CMAKE_SOURCE_DIR@')/'slsDetectorServers/'
|
||||
|
||||
detectors = ['Mythen3', 'Gotthard2', 'Eiger', 'Jungfrau', 'Moench', 'Gotthard']
|
||||
|
||||
|
||||
for det in detectors:
|
||||
with open(src/f'{det.lower()}DetectorServer/slsDetectorServer_defs.h') as f:
|
||||
lines = f.read().replace('\\\n', '')
|
||||
lines = lines.splitlines(keepends = True)
|
||||
|
||||
lines = [l.strip('#define').strip(' ') for l in lines if l.startswith('#define')]
|
||||
output = []
|
||||
signals = []
|
||||
fields = ['Name,', 'Value', 'Comment']
|
||||
excluded = ['DAC_NAMES', 'DEFAULT_DAC_VALS', 'CLK_NAMES', 'ONCHIP_DAC_NAMES']
|
||||
header = f'{fields[0]:35}{fields[1]:35}\n'
|
||||
output.append(header)
|
||||
signals.append(header)
|
||||
for line in lines:
|
||||
name, *parts = line.split()
|
||||
arg = ' '.join(parts)
|
||||
value, *comments = arg.split('//')
|
||||
value = value.strip('() ')
|
||||
# value = value.replace(', ', ' ')
|
||||
value = value.replace('\"', '')
|
||||
if name not in excluded:
|
||||
name += ','
|
||||
if name.startswith('SIGNAL_'):
|
||||
signals.append(f'{name:35}{value}\n')
|
||||
else:
|
||||
output.append(f'{name:35}\"{value}\"\n')
|
||||
|
||||
|
||||
rstpath = Path('@CMAKE_SOURCE_DIR@')/'docs/src/'
|
||||
with open(f'src/{det.lower()}.csv', 'w') as f:
|
||||
f.writelines(output)
|
||||
|
@ -50,6 +50,11 @@ Welcome to slsDetectorPackage's documentation!
|
||||
type_traits
|
||||
ToString
|
||||
|
||||
.. toctree::
|
||||
:caption: Servers
|
||||
|
||||
servers
|
||||
|
||||
.. Indices and tables
|
||||
.. ==================
|
||||
|
||||
|
52
docs/src/servers.rst
Normal file
52
docs/src/servers.rst
Normal file
@ -0,0 +1,52 @@
|
||||
Detector Servers
|
||||
==============================================
|
||||
|
||||
Some general intro
|
||||
|
||||
Mythen3
|
||||
-------------
|
||||
|
||||
.. csv-table:: Default values
|
||||
:file: mythen3.csv
|
||||
:widths: 35, 35
|
||||
:header-rows: 1
|
||||
|
||||
Gotthard2
|
||||
-------------
|
||||
|
||||
.. csv-table:: Default values
|
||||
:file: gotthard2.csv
|
||||
:widths: 35, 35
|
||||
:header-rows: 1
|
||||
|
||||
Moench
|
||||
-------------
|
||||
|
||||
.. csv-table:: Default values
|
||||
:file: moech.csv
|
||||
:widths: 35, 35
|
||||
:header-rows: 1
|
||||
|
||||
Eiger
|
||||
-------------
|
||||
|
||||
.. csv-table:: Default values
|
||||
:file: eiger.csv
|
||||
:widths: 35, 35
|
||||
:header-rows: 1
|
||||
|
||||
Jungfrau
|
||||
-------------
|
||||
|
||||
.. csv-table:: Default values
|
||||
:file: jungfrau.csv
|
||||
:widths: 35, 35
|
||||
:header-rows: 1
|
||||
|
||||
Gotthard
|
||||
-------------
|
||||
|
||||
.. csv-table:: Default values
|
||||
:file: gotthard.csv
|
||||
:widths: 35, 35
|
||||
:header-rows: 1
|
@ -130,7 +130,7 @@ enum MASTERINDEX { MASTER_HARDWARE, OW_MASTER, OW_SLAVE };
|
||||
#define DAC_MAX_STEPS (4096)
|
||||
|
||||
#define MAX_SUBFRAME_EXPOSURE_VAL_IN_10NS \
|
||||
(0x1FFFFFFF) /** 29 bit register for max subframe exposure value */
|
||||
(0x1FFFFFFF) // 29 bit register for max subframe exposure value
|
||||
|
||||
#define SLAVE_HIGH_VOLTAGE_READ_VAL (-999)
|
||||
#define HIGH_VOLTAGE_TOLERANCE (5)
|
||||
|
@ -41,7 +41,7 @@ enum CLKINDEX { ADC_CLK, NUM_CLOCKS };
|
||||
#define DYNAMIC_RANGE (16)
|
||||
#define NUM_BITS_PER_PIXEL (DYNAMIC_RANGE / 8)
|
||||
#define DATA_BYTES (NCHIP * NCHAN * NUM_BITS_PER_PIXEL)
|
||||
#define CLK_FREQ (32007729) /* Hz */
|
||||
#define CLK_FREQ (32007729) // Hz
|
||||
#define MAX_EXT_SIGNALS (1)
|
||||
|
||||
/** Firmware Definitions */
|
||||
|
@ -69,8 +69,8 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS };
|
||||
#define DYNAMIC_RANGE (16)
|
||||
#define NUM_BYTES_PER_PIXEL (DYNAMIC_RANGE / 8)
|
||||
#define DATA_BYTES (NCHIP * NCHAN * NUM_BYTES_PER_PIXEL)
|
||||
#define CLK_RUN (40) /* MHz */
|
||||
#define CLK_SYNC (20) /* MHz */
|
||||
#define CLK_RUN (40) // MHz
|
||||
#define CLK_SYNC (20) // MHz
|
||||
#define ADC_CLK_INDEX (1)
|
||||
#define DBIT_CLK_INDEX (0)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user