mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-19 00:07:13 +02:00
Compare commits
84 Commits
2020.09.09
...
2020.09.17
Author | SHA1 | Date | |
---|---|---|---|
d945f39142 | |||
ac1e9569b5 | |||
ea1b41c84a | |||
b0dd82c667 | |||
bf69951456 | |||
2d2e80469c | |||
5d648443fa | |||
1fb7352378 | |||
511c206787 | |||
74edb6a1c1 | |||
3376f7fa37 | |||
bfe36085f2 | |||
f061d2273a | |||
b12ae5d929 | |||
2285061623 | |||
e10ebe33d7 | |||
01921bc016 | |||
aa10c4665f | |||
f644cba244 | |||
884da7197e | |||
8ae0659478 | |||
ad95f729dc | |||
3b071cc43f | |||
2805359cd0 | |||
1515b79c97 | |||
2ab4bb1c04 | |||
5214c0f1a4 | |||
60bc3a8fa7 | |||
00f780665f | |||
ab738790e0 | |||
d4cff5b99c | |||
84f49a9b27 | |||
a4926e6ae1 | |||
cf8785ad2e | |||
be8284f5c2 | |||
3fd32b2c9c | |||
d70090967d | |||
88fe306902 | |||
d931416def | |||
6cfaa92b61 | |||
c94dfde17c | |||
b879a377ba | |||
d420451751 | |||
2bc33ad34a | |||
cb23e827bf | |||
a0f915316e | |||
2733bc5320 | |||
3b82e9fcc1 | |||
a95d8f664a | |||
11e7d89da3 | |||
34043c358f | |||
da9c7c354e | |||
4d499e231d | |||
0a7809286b | |||
00abb5e14b | |||
22c2bb0258 | |||
9d1cd09fd4 | |||
80b053eb10 | |||
3cd4f3897b | |||
d011186b9a | |||
669c14d6d5 | |||
ecabc94ade | |||
c58a2d957d | |||
1b214778a5 | |||
d5f6cbc075 | |||
52303daffd | |||
02d4769f6a | |||
a9d1a78662 | |||
3cf2160a2d | |||
4917812bb0 | |||
a0f9c6fe8c | |||
82e978e901 | |||
04bf2aca6d | |||
97687f0f6d | |||
bfbfe204f4 | |||
67d57eb5cd | |||
f940c09290 | |||
30293b1d36 | |||
87bad38f80 | |||
67f1f9924a | |||
e1e04ee755 | |||
6e06d4307d | |||
20a959bf61 | |||
8e49a114db |
@ -38,6 +38,7 @@ set(SPHINX_SOURCE_FILES
|
|||||||
src/pydetector.rst
|
src/pydetector.rst
|
||||||
src/pyenums.rst
|
src/pyenums.rst
|
||||||
src/pyexamples.rst
|
src/pyexamples.rst
|
||||||
|
src/servers.rst
|
||||||
src/receiver.rst
|
src/receiver.rst
|
||||||
src/result.rst
|
src/result.rst
|
||||||
src/type_traits.rst
|
src/type_traits.rst
|
||||||
@ -57,8 +58,21 @@ configure_file(
|
|||||||
"${SPHINX_BUILD}/conf.py"
|
"${SPHINX_BUILD}/conf.py"
|
||||||
@ONLY)
|
@ONLY)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/gen_server_doc.py.in"
|
||||||
|
"${SPHINX_BUILD}/gen_server_doc.py"
|
||||||
|
@ONLY)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/static/extra.css"
|
||||||
|
"${SPHINX_BUILD}/static/css/extra.css"
|
||||||
|
@ONLY)
|
||||||
|
|
||||||
|
add_custom_target(server_rst python gen_server_doc.py)
|
||||||
|
|
||||||
add_custom_target(docs
|
add_custom_target(docs
|
||||||
gendoc
|
gendoc
|
||||||
|
COMMAND python gen_server_doc.py
|
||||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
||||||
COMMAND ${SPHINX_EXECUTABLE} -a -b html
|
COMMAND ${SPHINX_EXECUTABLE} -a -b html
|
||||||
-Dbreathe_projects.slsDetectorPackage=${CMAKE_CURRENT_BINARY_DIR}/xml
|
-Dbreathe_projects.slsDetectorPackage=${CMAKE_CURRENT_BINARY_DIR}/xml
|
||||||
@ -74,3 +88,4 @@ add_custom_target(rst
|
|||||||
${SPHINX_BUILD}/src
|
${SPHINX_BUILD}/src
|
||||||
${SPHINX_BUILD}/html
|
${SPHINX_BUILD}/html
|
||||||
COMMENT "Generating documentation with Sphinx")
|
COMMENT "Generating documentation with Sphinx")
|
||||||
|
|
||||||
|
@ -59,4 +59,8 @@ html_theme = "sphinx_rtd_theme"
|
|||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
#html_static_path = ['_static']
|
html_static_path = ['static']
|
||||||
|
|
||||||
|
|
||||||
|
def setup(app):
|
||||||
|
app.add_stylesheet('css/extra.css') # may also be an URL
|
53
docs/gen_server_doc.py.in
Normal file
53
docs/gen_server_doc.py.in
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import os
|
||||||
|
import re
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# @CMAKE_CURRENT_BINARY_DIR@
|
||||||
|
|
||||||
|
print('\n\n\n\n SERVER CSV')
|
||||||
|
|
||||||
|
src = Path('@CMAKE_SOURCE_DIR@')/'slsDetectorServers/'
|
||||||
|
detectors = ['Mythen3', 'Gotthard2', 'Eiger',
|
||||||
|
'Jungfrau', 'Moench', 'Gotthard', 'Ctb']
|
||||||
|
|
||||||
|
|
||||||
|
for det in detectors:
|
||||||
|
in_fname = src/f'{det.lower()}DetectorServer/slsDetectorServer_defs.h'
|
||||||
|
print(f'Reading: {in_fname}')
|
||||||
|
with open(in_fname) 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/'
|
||||||
|
|
||||||
|
out_fname = Path.cwd()/f'src/{det.lower()}.csv'
|
||||||
|
print(f'Writing: {out_fname}')
|
||||||
|
with open(out_fname, 'w') as f:
|
||||||
|
f.writelines(output)
|
||||||
|
|
||||||
|
print('END\n\n\n\n')
|
@ -50,6 +50,11 @@ Welcome to slsDetectorPackage's documentation!
|
|||||||
type_traits
|
type_traits
|
||||||
ToString
|
ToString
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:caption: Servers
|
||||||
|
|
||||||
|
servers
|
||||||
|
|
||||||
.. Indices and tables
|
.. Indices and tables
|
||||||
.. ==================
|
.. ==================
|
||||||
|
|
||||||
|
60
docs/src/servers.rst
Normal file
60
docs/src/servers.rst
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
Default values
|
||||||
|
==============================================
|
||||||
|
|
||||||
|
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: moench.csv
|
||||||
|
:widths: 35, 35
|
||||||
|
:header-rows: 1
|
||||||
|
|
||||||
|
Ctb
|
||||||
|
-------------
|
||||||
|
|
||||||
|
.. csv-table:: Default values
|
||||||
|
:file: ctb.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
|
4
docs/static/extra.css
vendored
Normal file
4
docs/static/extra.css
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/* override table no-wrap */
|
||||||
|
.wy-table-responsive table td, .wy-table-responsive table th {
|
||||||
|
white-space: normal;
|
||||||
|
}
|
@ -41,11 +41,11 @@ hostname bchip074+bchip075+
|
|||||||
|
|
||||||
|
|
||||||
r_readfreq 1
|
r_readfreq 1
|
||||||
rx_datastream 1
|
rx_zmqstream 1
|
||||||
|
|
||||||
#replace my_receiver_hostname with the hostname of 1Gb IP of the machine where the receiver runs
|
#replace my_receiver_hostname with the hostname of 1Gb IP of the machine where the receiver runs
|
||||||
rx_hostname my_receiver_hostname
|
rx_hostname my_receiver_hostname
|
||||||
rx_datastream 1
|
rx_zmqstream 1
|
||||||
outdir /tmp/
|
outdir /tmp/
|
||||||
|
|
||||||
|
|
||||||
|
@ -459,8 +459,8 @@ rx_hostname mpc2011
|
|||||||
|
|
||||||
tengiga 1
|
tengiga 1
|
||||||
|
|
||||||
rx_datastream 1
|
rx_zmqstream 1
|
||||||
rx_readfreq 1
|
rx_zmqfreq 1
|
||||||
|
|
||||||
|
|
||||||
dac 6 800
|
dac 6 800
|
||||||
|
@ -35,7 +35,7 @@ zmqport 50001
|
|||||||
|
|
||||||
|
|
||||||
tengiga 1
|
tengiga 1
|
||||||
rx_datastream 1
|
rx_zmqstream 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ period 0.0006
|
|||||||
############################################
|
############################################
|
||||||
fpath /mnt/moench_data/scratch/
|
fpath /mnt/moench_data/scratch/
|
||||||
fwrite 0
|
fwrite 0
|
||||||
rx_datastream 1
|
rx_zmqstream 1
|
||||||
|
|
||||||
rx_jsonpara frameMode frame
|
rx_jsonpara frameMode frame
|
||||||
rx_jsonpara detectorMode counting
|
rx_jsonpara detectorMode counting
|
||||||
|
@ -35,7 +35,7 @@ set( PYTHON_FILES
|
|||||||
gotthard.py
|
gotthard.py
|
||||||
gotthard2.py
|
gotthard2.py
|
||||||
moench.py
|
moench.py
|
||||||
jsonproxy.py
|
proxy.py
|
||||||
ctb.py
|
ctb.py
|
||||||
jungfrau.py
|
jungfrau.py
|
||||||
mythen3.py
|
mythen3.py
|
||||||
|
@ -1,98 +0,0 @@
|
|||||||
import subprocess
|
|
||||||
import locale
|
|
||||||
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
|
|
||||||
cmd = out.stdout.splitlines()
|
|
||||||
cmd.pop(0)
|
|
||||||
|
|
||||||
from slsdet import Detector, Eiger, Ctb
|
|
||||||
|
|
||||||
pycmd = dir(Detector)+dir(Eiger)+dir(Ctb)
|
|
||||||
|
|
||||||
#Add commands that we should not expect as direct commands in python
|
|
||||||
pycmd += ['vrf', 'vtr', 'vrs', 'vtgstv', 'vsvn', 'vtrim',
|
|
||||||
'vsvp', 'vth1', 'vth2', 'vth3', 'vshaper', 'vshaperneg', 'rxb_rb',
|
|
||||||
'rxb_lb', 'vref_prech', 'vref_rstore', 'vref_cds',
|
|
||||||
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
|
|
||||||
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
|
|
||||||
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
|
|
||||||
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
# dacs are in general not included in the python commands and we expect to
|
|
||||||
# set them from the specialized class or using an enum
|
|
||||||
dacs = [
|
|
||||||
'vicin',
|
|
||||||
'vcassh',
|
|
||||||
'vcal_n',
|
|
||||||
'vcal_p'
|
|
||||||
'vipre_out',
|
|
||||||
'vipre_cds',
|
|
||||||
'vdd_prot',
|
|
||||||
'vcmp_rl',
|
|
||||||
'vcmp_rr',
|
|
||||||
'vcal', 'vcas',
|
|
||||||
'vipre',
|
|
||||||
'vin_com',
|
|
||||||
'vin_cm',
|
|
||||||
'vrshaper',
|
|
||||||
'vrshaper_n',
|
|
||||||
'vrpreamp',
|
|
||||||
'vishaper',
|
|
||||||
'vipre_out',
|
|
||||||
'vcom_adc1',
|
|
||||||
'vcom_adc2',
|
|
||||||
'vcom_cds',
|
|
||||||
'vdcsh',
|
|
||||||
'v_chip',
|
|
||||||
'vb_comp',
|
|
||||||
'vb_comp_adc',
|
|
||||||
'vb_comp_fe',
|
|
||||||
'vb_cs',
|
|
||||||
'vb_ds',
|
|
||||||
'vb_opa_1st',
|
|
||||||
'vb_opa_fd',
|
|
||||||
'vb_pixbuf',
|
|
||||||
'vb_sda',
|
|
||||||
'vbp_colbuf',
|
|
||||||
'vcal_p',
|
|
||||||
'vcasc_out',
|
|
||||||
'vcasc_sfp',
|
|
||||||
'vcascn_pb',
|
|
||||||
'vcascp_pb',
|
|
||||||
'vchip_comp_adc',
|
|
||||||
'vchip_comp_fe',
|
|
||||||
'vchip_cs',
|
|
||||||
'vchip_opa_1st',
|
|
||||||
'vchip_opa_fd',
|
|
||||||
'vchip_ref_comp_fe',
|
|
||||||
|
|
||||||
]
|
|
||||||
|
|
||||||
intentionally_missing = [
|
|
||||||
'temp_10ge', #temperatures already available from enum or specialized class
|
|
||||||
'temp_adc',
|
|
||||||
'temp_dcdc',
|
|
||||||
'temp_fpga',
|
|
||||||
'temp_fpgaext',
|
|
||||||
'temp_fpgafl',
|
|
||||||
'temp_fpgafr',
|
|
||||||
'temp_slowadc',
|
|
||||||
'temp_sodl',
|
|
||||||
'temp_sodr',
|
|
||||||
'trigger', #use sendSoftwareTrigger
|
|
||||||
'update', #use updateServerAndFirmare
|
|
||||||
'udp_validate', #use validateUdpConfiguration
|
|
||||||
'udp_reconfigure', #use reconfigureUdpDestination
|
|
||||||
'emin', #use rx_jsonpara
|
|
||||||
]
|
|
||||||
|
|
||||||
pycmd += intentionally_missing
|
|
||||||
pycmd += dacs
|
|
||||||
missing = []
|
|
||||||
for c in cmd:
|
|
||||||
if c not in pycmd:
|
|
||||||
print(c)
|
|
||||||
missing.append(c)
|
|
||||||
|
|
||||||
print(f'Missing: {len(missing)} commands')
|
|
132
python/scripts/compare_with_commandline.py
Normal file
132
python/scripts/compare_with_commandline.py
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
import subprocess
|
||||||
|
import locale
|
||||||
|
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
|
||||||
|
cmd = out.stdout.splitlines()
|
||||||
|
cmd.pop(0)
|
||||||
|
|
||||||
|
from slsdet import Detector
|
||||||
|
|
||||||
|
pycmd = dir(Detector)
|
||||||
|
|
||||||
|
|
||||||
|
# dacs are in general not included in the python commands and we expect to
|
||||||
|
# set them from the specialized class or using an enum
|
||||||
|
dacs = [
|
||||||
|
'adcvpp',
|
||||||
|
'iodelay',
|
||||||
|
'list',
|
||||||
|
'rxb_lb',
|
||||||
|
'rxb_rb',
|
||||||
|
'v_chip',
|
||||||
|
'vb_comp',
|
||||||
|
'vb_comp_adc',
|
||||||
|
'vb_comp_fe',
|
||||||
|
'vb_cs',
|
||||||
|
'vb_ds',
|
||||||
|
'vb_opa_1st',
|
||||||
|
'vb_opa_fd',
|
||||||
|
'vb_pixbuf',
|
||||||
|
'vb_sda',
|
||||||
|
'vbp_colbuf',
|
||||||
|
'vcal',
|
||||||
|
'vcal_n',
|
||||||
|
'vcal_p',
|
||||||
|
'vipre_out',
|
||||||
|
'vcas',
|
||||||
|
'vcasc_out',
|
||||||
|
'vcasc_sfp',
|
||||||
|
'vcascn_pb',
|
||||||
|
'vcascp_pb',
|
||||||
|
'vcassh',
|
||||||
|
'vchip_comp_adc',
|
||||||
|
'vchip_comp_fe',
|
||||||
|
'vchip_cs',
|
||||||
|
'vchip_opa_1st',
|
||||||
|
'vchip_opa_fd',
|
||||||
|
'vchip_ref_comp_fe',
|
||||||
|
'vcmp_ll',
|
||||||
|
'vcmp_lr',
|
||||||
|
'vcmp_rl',
|
||||||
|
'vcmp_rr',
|
||||||
|
'vcn',
|
||||||
|
'vcom_adc1',
|
||||||
|
'vcom_adc2',
|
||||||
|
'vcom_cds',
|
||||||
|
'vcp',
|
||||||
|
'vdcsh',
|
||||||
|
'vdd_prot',
|
||||||
|
'vicin',
|
||||||
|
'vin_cm',
|
||||||
|
'vin_com',
|
||||||
|
'vipre',
|
||||||
|
'vipre_cds',
|
||||||
|
'vipre_out',
|
||||||
|
'vishaper',
|
||||||
|
'vout_cm',
|
||||||
|
'vref_cds',
|
||||||
|
'vref_comp',
|
||||||
|
'vref_comp_fe',
|
||||||
|
'vref_ds',
|
||||||
|
'vref_h_adc',
|
||||||
|
'vref_l_adc',
|
||||||
|
'vref_prech',
|
||||||
|
'vref_rstore',
|
||||||
|
'vrpreamp',
|
||||||
|
'vrshaper',
|
||||||
|
'vrshaper_n',
|
||||||
|
'vsvn',
|
||||||
|
'vsvp',
|
||||||
|
'vtgstv',
|
||||||
|
'vth1',
|
||||||
|
'vth2',
|
||||||
|
'vth3',
|
||||||
|
'vtrim'
|
||||||
|
]
|
||||||
|
|
||||||
|
intentionally_missing = [
|
||||||
|
'activate', #use getActive and getRxPadDeactivatedMode syntax is not a good fit for python
|
||||||
|
'temp_10ge', #temperatures already available from enum or specialized class
|
||||||
|
'temp_adc',
|
||||||
|
'temp_dcdc',
|
||||||
|
'temp_fpga',
|
||||||
|
'temp_fpgaext',
|
||||||
|
'temp_fpgafl',
|
||||||
|
'temp_fpgafr',
|
||||||
|
'temp_slowadc',
|
||||||
|
'temp_sodl',
|
||||||
|
'temp_sodr',
|
||||||
|
'trigger', #use sendSoftwareTrigger
|
||||||
|
'update', #use updateServerAndFirmare
|
||||||
|
'udp_validate', #use validateUdpConfiguration
|
||||||
|
'udp_reconfigure', #use reconfigureUdpDestination
|
||||||
|
'pulse', # use pulseChip pulsePixel pulsePixelNmove
|
||||||
|
'pulsechip',
|
||||||
|
'pulsenmove',
|
||||||
|
]
|
||||||
|
|
||||||
|
pycmd += intentionally_missing
|
||||||
|
pycmd += dacs
|
||||||
|
missing = []
|
||||||
|
for c in cmd:
|
||||||
|
if c not in pycmd:
|
||||||
|
print(c)
|
||||||
|
missing.append(c)
|
||||||
|
|
||||||
|
print(f'\nMissing: {len(missing)} commands')
|
||||||
|
print(f'Excluded: {len(dacs)} dacs')
|
||||||
|
print(f'Excluded: {len(intentionally_missing)} other commands')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
not_in_cmd = []
|
||||||
|
for c in pycmd:
|
||||||
|
if c.islower() and not c.startswith('_'):
|
||||||
|
if c not in cmd:
|
||||||
|
not_in_cmd.append(c)
|
||||||
|
print(f'\nCommands in Python and NOT in command line: {len(not_in_cmd)}')
|
||||||
|
for c in not_in_cmd:
|
||||||
|
print(c)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# print(',\n'.join([f'\'{d}\'' for d in sorted(dacs)]))
|
@ -60,6 +60,23 @@ def get_arguments(node):
|
|||||||
args = f", {args}"
|
args = f", {args}"
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
def get_arguments_with_default(node):
|
||||||
|
args = []
|
||||||
|
for arg in node.get_arguments():
|
||||||
|
tokens = [t.spelling for t in arg.get_tokens()]
|
||||||
|
print(tokens)
|
||||||
|
if '=' in tokens:
|
||||||
|
if arg.type.spelling == "sls::Positions": #TODO! automate
|
||||||
|
args.append("py::arg() = Positions{}")
|
||||||
|
else:
|
||||||
|
args.append('py::arg()' + ''.join(tokens[tokens.index('='):]))
|
||||||
|
else:
|
||||||
|
args.append('py::arg()')
|
||||||
|
args = ", ".join(args)
|
||||||
|
if args:
|
||||||
|
args = f", {args}"
|
||||||
|
return args
|
||||||
|
|
||||||
|
|
||||||
def get_fdec(node):
|
def get_fdec(node):
|
||||||
args = [a.type.spelling for a in node.get_arguments()]
|
args = [a.type.spelling for a in node.get_arguments()]
|
||||||
@ -86,7 +103,8 @@ def visit(node):
|
|||||||
and child.access_specifier == cindex.AccessSpecifier.PUBLIC
|
and child.access_specifier == cindex.AccessSpecifier.PUBLIC
|
||||||
):
|
):
|
||||||
m.append(child)
|
m.append(child)
|
||||||
args = get_arguments(child)
|
# args = get_arguments(child)
|
||||||
|
args = get_arguments_with_default(child)
|
||||||
fs = get_fdec(child)
|
fs = get_fdec(child)
|
||||||
lines.append(
|
lines.append(
|
||||||
f'.def("{child.spelling}",{fs} &Detector::{child.spelling}{args})'
|
f'.def("{child.spelling}",{fs} &Detector::{child.spelling}{args})'
|
||||||
|
@ -8,31 +8,12 @@ from .mythen3 import Mythen3
|
|||||||
from .gotthard2 import Gotthard2
|
from .gotthard2 import Gotthard2
|
||||||
from .gotthard import Gotthard
|
from .gotthard import Gotthard
|
||||||
from .moench import Moench
|
from .moench import Moench
|
||||||
# from .jungfrau_ctb import JungfrauCTB
|
|
||||||
# from _slsdet import DetectorApi
|
|
||||||
|
|
||||||
import _slsdet
|
import _slsdet
|
||||||
|
|
||||||
defs = _slsdet.slsDetectorDefs
|
defs = _slsdet.slsDetectorDefs
|
||||||
|
|
||||||
from .enums import *
|
from .enums import *
|
||||||
# runStatus = _slsdet.slsDetectorDefs.runStatus
|
|
||||||
# speedLevel = _slsdet.slsDetectorDefs.speedLevel
|
|
||||||
# detectorType = _slsdet.slsDetectorDefs.detectorType
|
|
||||||
# frameDiscardPolicy = _slsdet.slsDetectorDefs.frameDiscardPolicy
|
|
||||||
# fileFormat = _slsdet.slsDetectorDefs.fileFormat
|
|
||||||
# dimension = _slsdet.slsDetectorDefs.dimension
|
|
||||||
# externalSignalFlag = _slsdet.slsDetectorDefs.externalSignalFlag
|
|
||||||
# timingMode = _slsdet.slsDetectorDefs.timingMode
|
|
||||||
# dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
|
||||||
# detectorSettings = _slsdet.slsDetectorDefs.detectorSettings
|
|
||||||
# clockIndex = _slsdet.slsDetectorDefs.clockIndex
|
|
||||||
# readoutMode = _slsdet.slsDetectorDefs.readoutMode
|
|
||||||
# masterFlags = _slsdet.slsDetectorDefs.masterFlags
|
|
||||||
# frameModeType = _slsdet.slsDetectorDefs.frameModeType
|
|
||||||
# detectorModeType = _slsdet.slsDetectorDefs.detectorModeType
|
|
||||||
# burstMode = _slsdet.slsDetectorDefs.burstMode
|
|
||||||
# timingSourceType = _slsdet.slsDetectorDefs.timingSourceType
|
|
||||||
|
|
||||||
|
|
||||||
IpAddr = _slsdet.IpAddr
|
IpAddr = _slsdet.IpAddr
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -13,7 +13,5 @@ detectorSettings = _slsdet.slsDetectorDefs.detectorSettings
|
|||||||
clockIndex = _slsdet.slsDetectorDefs.clockIndex
|
clockIndex = _slsdet.slsDetectorDefs.clockIndex
|
||||||
readoutMode = _slsdet.slsDetectorDefs.readoutMode
|
readoutMode = _slsdet.slsDetectorDefs.readoutMode
|
||||||
masterFlags = _slsdet.slsDetectorDefs.masterFlags
|
masterFlags = _slsdet.slsDetectorDefs.masterFlags
|
||||||
frameModeType = _slsdet.slsDetectorDefs.frameModeType
|
|
||||||
detectorModeType = _slsdet.slsDetectorDefs.detectorModeType
|
|
||||||
burstMode = _slsdet.slsDetectorDefs.burstMode
|
burstMode = _slsdet.slsDetectorDefs.burstMode
|
||||||
timingSourceType = _slsdet.slsDetectorDefs.timingSourceType
|
timingSourceType = _slsdet.slsDetectorDefs.timingSourceType
|
@ -1,30 +0,0 @@
|
|||||||
from .utils import element_if_equal
|
|
||||||
|
|
||||||
class JsonProxy:
|
|
||||||
"""
|
|
||||||
Proxy class to allow for intuitive setting and getting of rx_jsonpara
|
|
||||||
This class is returned by Detectr.rx_jsonpara
|
|
||||||
"""
|
|
||||||
def __init__(self, det):
|
|
||||||
self.det = det
|
|
||||||
|
|
||||||
def __getitem__(self, key):
|
|
||||||
return element_if_equal(self.det.getAdditionalJsonParameter(key))
|
|
||||||
|
|
||||||
def __setitem__(self, key, value):
|
|
||||||
self.det.setAdditionalJsonParameter(key, str(value))
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
r = element_if_equal(self.det.getAdditionalJsonHeader())
|
|
||||||
if isinstance(r, list):
|
|
||||||
rstr = ''
|
|
||||||
for i, list_item in enumerate(r):
|
|
||||||
list_item = dict(list_item)
|
|
||||||
rstr += ''.join([f'{i}:{key}: {value}\n' for key, value in list_item.items()])
|
|
||||||
|
|
||||||
return rstr.strip('\n')
|
|
||||||
else:
|
|
||||||
r = dict(r)
|
|
||||||
return '\n'.join([f'{key}: {value}' for key, value in r.items()])
|
|
||||||
|
|
||||||
|
|
85
python/slsdet/proxy.py
Normal file
85
python/slsdet/proxy.py
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
from .utils import element_if_equal
|
||||||
|
from .enums import dacIndex
|
||||||
|
|
||||||
|
|
||||||
|
def set_proxy_using_dict(func, key, value):
|
||||||
|
if isinstance(value, dict) and all(isinstance(k, int) for k in value.keys()):
|
||||||
|
for dkey, dvalue in value.items():
|
||||||
|
func(key, dvalue, [dkey])
|
||||||
|
else:
|
||||||
|
func(key, value)
|
||||||
|
|
||||||
|
class JsonProxy:
|
||||||
|
"""
|
||||||
|
Proxy class to allow for intuitive setting and getting of rx_jsonpara
|
||||||
|
This class is returned by Detectr.rx_jsonpara
|
||||||
|
"""
|
||||||
|
def __init__(self, det):
|
||||||
|
self.det = det
|
||||||
|
|
||||||
|
def __getitem__(self, key):
|
||||||
|
return element_if_equal(self.det.getAdditionalJsonParameter(key))
|
||||||
|
|
||||||
|
def __setitem__(self, key, value):
|
||||||
|
self.det.setAdditionalJsonParameter(key, str(value))
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
r = element_if_equal(self.det.getAdditionalJsonHeader())
|
||||||
|
if isinstance(r, list):
|
||||||
|
rstr = ''
|
||||||
|
for i, list_item in enumerate(r):
|
||||||
|
list_item = dict(list_item)
|
||||||
|
rstr += ''.join([f'{i}:{key}: {value}\n' for key, value in list_item.items()])
|
||||||
|
|
||||||
|
return rstr.strip('\n')
|
||||||
|
else:
|
||||||
|
r = dict(r)
|
||||||
|
return '\n'.join([f'{key}: {value}' for key, value in r.items()])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class SlowAdcProxy:
|
||||||
|
"""
|
||||||
|
Proxy class to allow for more intuitive reading the slow ADCs
|
||||||
|
"""
|
||||||
|
def __init__(self, det):
|
||||||
|
self.det = det
|
||||||
|
|
||||||
|
def __getitem__(self, key):
|
||||||
|
dac_index = dacIndex(int(dacIndex.SLOW_ADC0)+key)
|
||||||
|
return element_if_equal(self.det.getSlowADC(dac_index))
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
rstr = ''
|
||||||
|
for i in range(7):
|
||||||
|
r = element_if_equal(self.__getitem__(i))
|
||||||
|
if isinstance(r, list):
|
||||||
|
rstr += ' '.join(f'{item} mV' for item in r)
|
||||||
|
else:
|
||||||
|
rstr += f'{i}: {r} mV\n'
|
||||||
|
|
||||||
|
return rstr.strip('\n')
|
||||||
|
|
||||||
|
class ClkDivProxy:
|
||||||
|
"""
|
||||||
|
Proxy class to allow for more intuitive reading clockdivider
|
||||||
|
"""
|
||||||
|
def __init__(self, det):
|
||||||
|
self.det = det
|
||||||
|
|
||||||
|
def __getitem__(self, key):
|
||||||
|
return element_if_equal(self.det.getClockDivider(key))
|
||||||
|
|
||||||
|
def __setitem__(self, key, value):
|
||||||
|
set_proxy_using_dict(self.det.setClockDivider, key, value)
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
rstr = ''
|
||||||
|
for i in range(6):
|
||||||
|
r = element_if_equal(self.__getitem__(i))
|
||||||
|
if isinstance(r, list):
|
||||||
|
rstr += ' '.join(f'{item}' for item in r)
|
||||||
|
else:
|
||||||
|
rstr += f'{i}: {r}\n'
|
||||||
|
|
||||||
|
return rstr.strip('\n')
|
@ -111,14 +111,14 @@ def make_string_path(path):
|
|||||||
|
|
||||||
|
|
||||||
def set_using_dict(func, args):
|
def set_using_dict(func, args):
|
||||||
if isinstance(args, dict):
|
if isinstance(args, dict) and all(isinstance(k, int) for k in args.keys()):
|
||||||
for key, value in args.items():
|
for key, value in args.items():
|
||||||
func(value, [key])
|
func(value, [key])
|
||||||
else:
|
else:
|
||||||
func(args)
|
func(args)
|
||||||
|
|
||||||
def set_time_using_dict(func, args):
|
def set_time_using_dict(func, args):
|
||||||
if isinstance(args, dict):
|
if isinstance(args, dict) and all(isinstance(k, int) for k in args.keys()):
|
||||||
for key, value in args.items():
|
for key, value in args.items():
|
||||||
if isinstance(value, int):
|
if isinstance(value, int):
|
||||||
value = float(value)
|
value = float(value)
|
||||||
|
@ -322,11 +322,11 @@ void init_det(py::module &m) {
|
|||||||
(Result<int>(Detector::*)(defs::dacIndex, bool, sls::Positions)
|
(Result<int>(Detector::*)(defs::dacIndex, bool, sls::Positions)
|
||||||
const) &
|
const) &
|
||||||
Detector::getDAC,
|
Detector::getDAC,
|
||||||
py::arg(), py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg() = false, py::arg() = Positions{})
|
||||||
.def("setDAC",
|
.def("setDAC",
|
||||||
(void (Detector::*)(defs::dacIndex, int, bool, sls::Positions)) &
|
(void (Detector::*)(defs::dacIndex, int, bool, sls::Positions)) &
|
||||||
Detector::setDAC,
|
Detector::setDAC,
|
||||||
py::arg(), py::arg(), py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{})
|
||||||
.def("getOnChipDAC",
|
.def("getOnChipDAC",
|
||||||
(Result<int>(Detector::*)(defs::dacIndex, int, sls::Positions)
|
(Result<int>(Detector::*)(defs::dacIndex, int, sls::Positions)
|
||||||
const) &
|
const) &
|
||||||
@ -346,6 +346,14 @@ void init_det(py::module &m) {
|
|||||||
sls::Positions)) &
|
sls::Positions)) &
|
||||||
Detector::setExternalSignalFlags,
|
Detector::setExternalSignalFlags,
|
||||||
py::arg(), py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg(), py::arg() = Positions{})
|
||||||
|
.def("getParallelMode",
|
||||||
|
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||||
|
Detector::getParallelMode,
|
||||||
|
py::arg() = Positions{})
|
||||||
|
.def("setParallelMode",
|
||||||
|
(void (Detector::*)(bool, sls::Positions)) &
|
||||||
|
Detector::setParallelMode,
|
||||||
|
py::arg(), py::arg() = Positions{})
|
||||||
.def("acquire", (void (Detector::*)()) & Detector::acquire)
|
.def("acquire", (void (Detector::*)()) & Detector::acquire)
|
||||||
.def("clearAcquiringFlag",
|
.def("clearAcquiringFlag",
|
||||||
(void (Detector::*)()) & Detector::clearAcquiringFlag)
|
(void (Detector::*)()) & Detector::clearAcquiringFlag)
|
||||||
@ -480,14 +488,14 @@ void init_det(py::module &m) {
|
|||||||
py::arg() = Positions{})
|
py::arg() = Positions{})
|
||||||
.def("setDestinationUDPPort",
|
.def("setDestinationUDPPort",
|
||||||
(void (Detector::*)(int, int)) & Detector::setDestinationUDPPort,
|
(void (Detector::*)(int, int)) & Detector::setDestinationUDPPort,
|
||||||
py::arg(), py::arg())
|
py::arg(), py::arg() = -1)
|
||||||
.def("getDestinationUDPPort2",
|
.def("getDestinationUDPPort2",
|
||||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getDestinationUDPPort2,
|
Detector::getDestinationUDPPort2,
|
||||||
py::arg() = Positions{})
|
py::arg() = Positions{})
|
||||||
.def("setDestinationUDPPort2",
|
.def("setDestinationUDPPort2",
|
||||||
(void (Detector::*)(int, int)) & Detector::setDestinationUDPPort2,
|
(void (Detector::*)(int, int)) & Detector::setDestinationUDPPort2,
|
||||||
py::arg(), py::arg())
|
py::arg(), py::arg() = -1)
|
||||||
.def("reconfigureUDPDestination",
|
.def("reconfigureUDPDestination",
|
||||||
(void (Detector::*)(sls::Positions)) &
|
(void (Detector::*)(sls::Positions)) &
|
||||||
Detector::reconfigureUDPDestination,
|
Detector::reconfigureUDPDestination,
|
||||||
@ -560,7 +568,7 @@ void init_det(py::module &m) {
|
|||||||
Detector::getRxPort,
|
Detector::getRxPort,
|
||||||
py::arg() = Positions{})
|
py::arg() = Positions{})
|
||||||
.def("setRxPort", (void (Detector::*)(int, int)) & Detector::setRxPort,
|
.def("setRxPort", (void (Detector::*)(int, int)) & Detector::setRxPort,
|
||||||
py::arg(), py::arg())
|
py::arg(), py::arg() = -1)
|
||||||
.def("getRxFifoDepth",
|
.def("getRxFifoDepth",
|
||||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getRxFifoDepth,
|
Detector::getRxFifoDepth,
|
||||||
@ -722,7 +730,7 @@ void init_det(py::module &m) {
|
|||||||
py::arg() = Positions{})
|
py::arg() = Positions{})
|
||||||
.def("setRxZmqPort",
|
.def("setRxZmqPort",
|
||||||
(void (Detector::*)(int, int)) & Detector::setRxZmqPort, py::arg(),
|
(void (Detector::*)(int, int)) & Detector::setRxZmqPort, py::arg(),
|
||||||
py::arg())
|
py::arg() = -1)
|
||||||
.def("getRxZmqIP",
|
.def("getRxZmqIP",
|
||||||
(Result<sls::IpAddr>(Detector::*)(sls::Positions) const) &
|
(Result<sls::IpAddr>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getRxZmqIP,
|
Detector::getRxZmqIP,
|
||||||
@ -737,7 +745,7 @@ void init_det(py::module &m) {
|
|||||||
py::arg() = Positions{})
|
py::arg() = Positions{})
|
||||||
.def("setClientZmqPort",
|
.def("setClientZmqPort",
|
||||||
(void (Detector::*)(int, int)) & Detector::setClientZmqPort,
|
(void (Detector::*)(int, int)) & Detector::setClientZmqPort,
|
||||||
py::arg(), py::arg())
|
py::arg(), py::arg() = -1)
|
||||||
.def("getClientZmqIp",
|
.def("getClientZmqIp",
|
||||||
(Result<sls::IpAddr>(Detector::*)(sls::Positions) const) &
|
(Result<sls::IpAddr>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getClientZmqIp,
|
Detector::getClientZmqIp,
|
||||||
@ -770,7 +778,8 @@ void init_det(py::module &m) {
|
|||||||
(void (Detector::*)(int, defs::detectorSettings, bool,
|
(void (Detector::*)(int, defs::detectorSettings, bool,
|
||||||
sls::Positions)) &
|
sls::Positions)) &
|
||||||
Detector::setThresholdEnergy,
|
Detector::setThresholdEnergy,
|
||||||
py::arg(), py::arg(), py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg() = defs::STANDARD, py::arg() = true,
|
||||||
|
py::arg() = Positions{})
|
||||||
.def("getSettingsPath",
|
.def("getSettingsPath",
|
||||||
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getSettingsPath,
|
Detector::getSettingsPath,
|
||||||
@ -779,14 +788,6 @@ void init_det(py::module &m) {
|
|||||||
(void (Detector::*)(const std::string &, sls::Positions)) &
|
(void (Detector::*)(const std::string &, sls::Positions)) &
|
||||||
Detector::setSettingsPath,
|
Detector::setSettingsPath,
|
||||||
py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg() = Positions{})
|
||||||
.def("getParallelMode",
|
|
||||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
|
||||||
Detector::getParallelMode,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setParallelMode",
|
|
||||||
(void (Detector::*)(bool, sls::Positions)) &
|
|
||||||
Detector::setParallelMode,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getOverFlowMode",
|
.def("getOverFlowMode",
|
||||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getOverFlowMode,
|
Detector::getOverFlowMode,
|
||||||
@ -1344,31 +1345,6 @@ void init_det(py::module &m) {
|
|||||||
sls::Positions)) &
|
sls::Positions)) &
|
||||||
Detector::setAdditionalJsonParameter,
|
Detector::setAdditionalJsonParameter,
|
||||||
py::arg(), py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg(), py::arg() = Positions{})
|
||||||
.def("getDetectorMinMaxEnergyThreshold",
|
|
||||||
(Result<int>(Detector::*)(const bool, sls::Positions) const) &
|
|
||||||
Detector::getDetectorMinMaxEnergyThreshold,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("setDetectorMinMaxEnergyThreshold",
|
|
||||||
(void (Detector::*)(const bool, const int, sls::Positions)) &
|
|
||||||
Detector::setDetectorMinMaxEnergyThreshold,
|
|
||||||
py::arg(), py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getFrameMode",
|
|
||||||
(Result<defs::frameModeType>(Detector::*)(sls::Positions) const) &
|
|
||||||
Detector::getFrameMode,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setFrameMode",
|
|
||||||
(void (Detector::*)(defs::frameModeType, sls::Positions)) &
|
|
||||||
Detector::setFrameMode,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getDetectorMode",
|
|
||||||
(Result<defs::detectorModeType>(Detector::*)(sls::Positions)
|
|
||||||
const) &
|
|
||||||
Detector::getDetectorMode,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setDetectorMode",
|
|
||||||
(void (Detector::*)(defs::detectorModeType, sls::Positions)) &
|
|
||||||
Detector::setDetectorMode,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("programFPGA",
|
.def("programFPGA",
|
||||||
(void (Detector::*)(const std::string &, sls::Positions)) &
|
(void (Detector::*)(const std::string &, sls::Positions)) &
|
||||||
Detector::programFPGA,
|
Detector::programFPGA,
|
||||||
|
@ -259,20 +259,6 @@ void init_enums(py::module &m) {
|
|||||||
.value("IS_SLAVE", slsDetectorDefs::masterFlags::IS_SLAVE)
|
.value("IS_SLAVE", slsDetectorDefs::masterFlags::IS_SLAVE)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::frameModeType>(Defs, "frameModeType")
|
|
||||||
.value("PEDESTAL", slsDetectorDefs::frameModeType::PEDESTAL)
|
|
||||||
.value("NEW_PEDESTAL", slsDetectorDefs::frameModeType::NEW_PEDESTAL)
|
|
||||||
.value("FLATFIELD", slsDetectorDefs::frameModeType::FLATFIELD)
|
|
||||||
.value("NEW_FLATFIELD", slsDetectorDefs::frameModeType::NEW_FLATFIELD)
|
|
||||||
.export_values();
|
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::detectorModeType>(Defs, "detectorModeType")
|
|
||||||
.value("COUNTING", slsDetectorDefs::detectorModeType::COUNTING)
|
|
||||||
.value("INTERPOLATING",
|
|
||||||
slsDetectorDefs::detectorModeType::INTERPOLATING)
|
|
||||||
.value("ANALOG", slsDetectorDefs::detectorModeType::ANALOG)
|
|
||||||
.export_values();
|
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::burstMode>(Defs, "burstMode")
|
py::enum_<slsDetectorDefs::burstMode>(Defs, "burstMode")
|
||||||
.value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL)
|
.value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL)
|
||||||
.value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL)
|
.value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL)
|
||||||
|
@ -379,15 +379,15 @@ def test_set_readout_clock_3(d, mocker):
|
|||||||
d.readout_clock = 'Super Slow Speed'
|
d.readout_clock = 'Super Slow Speed'
|
||||||
m.assert_called_once_with(3)
|
m.assert_called_once_with(3)
|
||||||
|
|
||||||
#----------------------------------------------------------------rx_datastream
|
#----------------------------------------------------------------rx_zmqstream
|
||||||
def test_get_rx_datastream(d, mocker):
|
def test_get_rx_zmqstream(d, mocker):
|
||||||
m = mocker.patch('_slsdet.DetectorApi.getRxDataStreamStatus')
|
m = mocker.patch('_slsdet.DetectorApi.getRxDataStreamStatus')
|
||||||
m.return_value = False
|
m.return_value = False
|
||||||
assert d.rx_datastream == False
|
assert d.rx_zmqstream == False
|
||||||
|
|
||||||
def test_set_rx_datastream(d, mocker):
|
def test_set_rx_zmqstream(d, mocker):
|
||||||
m = mocker.patch('_slsdet.DetectorApi.setRxDataStreamStatus')
|
m = mocker.patch('_slsdet.DetectorApi.setRxDataStreamStatus')
|
||||||
d.rx_datastream = True
|
d.rx_zmqstream = True
|
||||||
m.assert_called_once_with(True)
|
m.assert_called_once_with(True)
|
||||||
|
|
||||||
def test_get_rx_zmqip(d, mocker):
|
def test_get_rx_zmqip(d, mocker):
|
||||||
|
@ -412,15 +412,15 @@ def test_set_counters_single(d, mocker):
|
|||||||
# d.readout_clock = 'Super Slow Speed'
|
# d.readout_clock = 'Super Slow Speed'
|
||||||
# m.assert_called_once_with(3)
|
# m.assert_called_once_with(3)
|
||||||
|
|
||||||
# #----------------------------------------------------------------rx_datastream
|
# #----------------------------------------------------------------rx_zmqstream
|
||||||
# def test_get_rx_datastream(d, mocker):
|
# def test_get_rx_zmqstream(d, mocker):
|
||||||
# m = mocker.patch('_slsdet.DetectorApi.getRxDataStreamStatus')
|
# m = mocker.patch('_slsdet.DetectorApi.getRxDataStreamStatus')
|
||||||
# m.return_value = False
|
# m.return_value = False
|
||||||
# assert d.rx_datastream == False
|
# assert d.rx_zmqstream == False
|
||||||
|
|
||||||
# def test_set_rx_datastream(d, mocker):
|
# def test_set_rx_zmqstream(d, mocker):
|
||||||
# m = mocker.patch('_slsdet.DetectorApi.setRxDataStreamStatus')
|
# m = mocker.patch('_slsdet.DetectorApi.setRxDataStreamStatus')
|
||||||
# d.rx_datastream = True
|
# d.rx_zmqstream = True
|
||||||
# m.assert_called_once_with(True)
|
# m.assert_called_once_with(True)
|
||||||
|
|
||||||
# def test_get_rx_zmqip(d, mocker):
|
# def test_get_rx_zmqip(d, mocker):
|
||||||
|
Binary file not shown.
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
// Global variable from slsDetectorServer_funcs
|
// Global variable from slsDetectorServer_funcs
|
||||||
extern int debugflag;
|
extern int debugflag;
|
||||||
|
extern int updateFlag;
|
||||||
extern udpStruct udpDetails;
|
extern udpStruct udpDetails;
|
||||||
extern const enum detectorType myDetectorType;
|
extern const enum detectorType myDetectorType;
|
||||||
|
|
||||||
@ -105,7 +106,8 @@ void basictests() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// does check only if flag is 0 (by default), set by command line
|
// does check only if flag is 0 (by default), set by command line
|
||||||
if ((!debugflag) && ((checkType() == FAIL) || (testFpga() == FAIL) ||
|
if ((!debugflag) && (!updateFlag) &&
|
||||||
|
((checkType() == FAIL) || (testFpga() == FAIL) ||
|
||||||
(testBus() == FAIL))) {
|
(testBus() == FAIL))) {
|
||||||
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
|
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
|
||||||
"Dangerous to continue.\n");
|
"Dangerous to continue.\n");
|
||||||
@ -145,7 +147,7 @@ void basictests() {
|
|||||||
(long long int)client_sw_apiversion));
|
(long long int)client_sw_apiversion));
|
||||||
|
|
||||||
// return if flag is not zero, debug mode
|
// return if flag is not zero, debug mode
|
||||||
if (debugflag) {
|
if (debugflag || updateFlag) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,7 +419,7 @@ uint32_t getDetectorIP() {
|
|||||||
/* initialization */
|
/* initialization */
|
||||||
|
|
||||||
void initControlServer() {
|
void initControlServer() {
|
||||||
if (initError == OK) {
|
if (!updateFlag && initError == OK) {
|
||||||
setupDetector();
|
setupDetector();
|
||||||
}
|
}
|
||||||
initCheckDone = 1;
|
initCheckDone = 1;
|
||||||
|
@ -95,7 +95,7 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS };
|
|||||||
#define NDAC_ONLY (NDAC - NPWR)
|
#define NDAC_ONLY (NDAC - NPWR)
|
||||||
#define DYNAMIC_RANGE (16)
|
#define DYNAMIC_RANGE (16)
|
||||||
#define NUM_BYTES_PER_PIXEL (DYNAMIC_RANGE / 8)
|
#define NUM_BYTES_PER_PIXEL (DYNAMIC_RANGE / 8)
|
||||||
#define CLK_FREQ (156.25) /* MHz */
|
#define CLK_FREQ (156.25) // MHz
|
||||||
#define I2C_POWER_VIO_DEVICE_ID (0x40)
|
#define I2C_POWER_VIO_DEVICE_ID (0x40)
|
||||||
#define I2C_POWER_VA_DEVICE_ID (0x41)
|
#define I2C_POWER_VA_DEVICE_ID (0x41)
|
||||||
#define I2C_POWER_VB_DEVICE_ID (0x42)
|
#define I2C_POWER_VB_DEVICE_ID (0x42)
|
||||||
|
Binary file not shown.
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
// Global variable from slsDetectorServer_funcs
|
// Global variable from slsDetectorServer_funcs
|
||||||
extern int debugflag;
|
extern int debugflag;
|
||||||
|
extern int updateFlag;
|
||||||
extern udpStruct udpDetails;
|
extern udpStruct udpDetails;
|
||||||
extern const enum detectorType myDetectorType;
|
extern const enum detectorType myDetectorType;
|
||||||
|
|
||||||
@ -140,7 +141,7 @@ void basictests() {
|
|||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
// return if debugflag is not zero, debug mode
|
// return if debugflag is not zero, debug mode
|
||||||
if (debugflag) {
|
if (debugflag || updateFlag) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,7 +320,7 @@ u_int32_t getDetectorIP() {
|
|||||||
|
|
||||||
void initControlServer() {
|
void initControlServer() {
|
||||||
LOG(logINFOBLUE, ("Configuring Control server\n"));
|
LOG(logINFOBLUE, ("Configuring Control server\n"));
|
||||||
if (initError == OK) {
|
if (!updateFlag && initError == OK) {
|
||||||
readDetectorNumber();
|
readDetectorNumber();
|
||||||
getModuleConfiguration();
|
getModuleConfiguration();
|
||||||
#ifndef VIRTUAL
|
#ifndef VIRTUAL
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
|
||||||
#define REQUIRED_FIRMWARE_VERSION (26)
|
#define REQUIRED_FIRMWARE_VERSION (27)
|
||||||
#define IDFILECOMMAND "more /home/root/executables/detid.txt"
|
#define IDFILECOMMAND "more /home/root/executables/detid.txt"
|
||||||
#define CONFIG_FILE ("config_eiger.txt")
|
#define CONFIG_FILE ("config_eiger.txt")
|
||||||
#define WAIT_STOP_SERVER_START (1 * 1000 * 1000)
|
#define WAIT_STOP_SERVER_START (1 * 1000 * 1000)
|
||||||
@ -130,7 +130,7 @@ enum MASTERINDEX { MASTER_HARDWARE, OW_MASTER, OW_SLAVE };
|
|||||||
#define DAC_MAX_STEPS (4096)
|
#define DAC_MAX_STEPS (4096)
|
||||||
|
|
||||||
#define MAX_SUBFRAME_EXPOSURE_VAL_IN_10NS \
|
#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 SLAVE_HIGH_VOLTAGE_READ_VAL (-999)
|
||||||
#define HIGH_VOLTAGE_TOLERANCE (5)
|
#define HIGH_VOLTAGE_TOLERANCE (5)
|
||||||
|
Binary file not shown.
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
// Global variable from slsDetectorServer_funcs
|
// Global variable from slsDetectorServer_funcs
|
||||||
extern int debugflag;
|
extern int debugflag;
|
||||||
|
extern int updateFlag;
|
||||||
extern int checkModuleFlag;
|
extern int checkModuleFlag;
|
||||||
extern udpStruct udpDetails;
|
extern udpStruct udpDetails;
|
||||||
extern const enum detectorType myDetectorType;
|
extern const enum detectorType myDetectorType;
|
||||||
@ -92,8 +93,9 @@ void basictests() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// does check only if flag is 0 (by default), set by command line
|
// does check only if flag is 0 (by default), set by command line
|
||||||
if ((!debugflag) && ((checkType() == FAIL) || (testFpga() == FAIL) ||
|
if ((!debugflag) && (!updateFlag) &&
|
||||||
(testBus() == FAIL))) {
|
((checkKernelVersion() == FAIL) || (checkType() == FAIL) ||
|
||||||
|
(testFpga() == FAIL) || (testBus() == FAIL))) {
|
||||||
sprintf(initErrorMessage,
|
sprintf(initErrorMessage,
|
||||||
"Could not pass basic tests of FPGA and bus. Dangerous to "
|
"Could not pass basic tests of FPGA and bus. Dangerous to "
|
||||||
"continue. (Firmware version:0x%llx) \n",
|
"continue. (Firmware version:0x%llx) \n",
|
||||||
@ -131,7 +133,7 @@ void basictests() {
|
|||||||
(long long int)client_sw_apiversion));
|
(long long int)client_sw_apiversion));
|
||||||
|
|
||||||
// return if flag is not zero, debug mode
|
// return if flag is not zero, debug mode
|
||||||
if (debugflag) {
|
if (debugflag || updateFlag) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,6 +177,13 @@ void basictests() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int checkKernelVersion() {
|
||||||
|
#ifdef VIRTUAL
|
||||||
|
return OK;
|
||||||
|
#endif
|
||||||
|
return Nios_checkKernelVersion(KERNEL_DATE_VRSN);
|
||||||
|
}
|
||||||
|
|
||||||
int checkType() {
|
int checkType() {
|
||||||
#ifdef VIRTUAL
|
#ifdef VIRTUAL
|
||||||
return OK;
|
return OK;
|
||||||
@ -326,7 +335,7 @@ u_int32_t getDetectorIP() {
|
|||||||
/* initialization */
|
/* initialization */
|
||||||
|
|
||||||
void initControlServer() {
|
void initControlServer() {
|
||||||
if (initError == OK) {
|
if (!updateFlag && initError == OK) {
|
||||||
setupDetector();
|
setupDetector();
|
||||||
}
|
}
|
||||||
initCheckDone = 1;
|
initCheckDone = 1;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
|
||||||
#define REQRD_FRMWRE_VRSN (0x200707)
|
#define REQRD_FRMWRE_VRSN (0x200707)
|
||||||
|
#define KERNEL_DATE_VRSN "Wed May 20 13:58:38 CEST 2020"
|
||||||
|
|
||||||
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
||||||
|
|
||||||
|
Binary file not shown.
@ -18,6 +18,9 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Global variable from slsDetectorServer_funcs
|
||||||
|
extern int debugflag;
|
||||||
|
extern int updateFlag;
|
||||||
extern udpStruct udpDetails;
|
extern udpStruct udpDetails;
|
||||||
extern const enum detectorType myDetectorType;
|
extern const enum detectorType myDetectorType;
|
||||||
|
|
||||||
@ -91,7 +94,8 @@ void basictests() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// does check only if flag is 0 (by default), set by command line
|
// does check only if flag is 0 (by default), set by command line
|
||||||
if (((checkType() == FAIL) || (testFpga() == FAIL) ||
|
if ((!debugflag) && (!updateFlag) &&
|
||||||
|
((checkType() == FAIL) || (testFpga() == FAIL) ||
|
||||||
(testBus() == FAIL))) {
|
(testBus() == FAIL))) {
|
||||||
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
|
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
|
||||||
"Dangerous to continue.\n");
|
"Dangerous to continue.\n");
|
||||||
@ -125,7 +129,9 @@ void basictests() {
|
|||||||
(long long int)fwversion, (long long int)swversion,
|
(long long int)fwversion, (long long int)swversion,
|
||||||
(long long int)client_sw_apiversion));
|
(long long int)client_sw_apiversion));
|
||||||
|
|
||||||
|
if (!debugflag || updateFlag) {
|
||||||
LOG(logINFO, ("Basic Tests - success\n"));
|
LOG(logINFO, ("Basic Tests - success\n"));
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,7 +349,7 @@ u_int32_t getBoardRevision() {
|
|||||||
/* initialization */
|
/* initialization */
|
||||||
|
|
||||||
void initControlServer() {
|
void initControlServer() {
|
||||||
if (initError == OK) {
|
if (!updateFlag && initError == OK) {
|
||||||
setupDetector();
|
setupDetector();
|
||||||
}
|
}
|
||||||
initCheckDone = 1;
|
initCheckDone = 1;
|
||||||
|
@ -41,7 +41,7 @@ enum CLKINDEX { ADC_CLK, NUM_CLOCKS };
|
|||||||
#define DYNAMIC_RANGE (16)
|
#define DYNAMIC_RANGE (16)
|
||||||
#define NUM_BITS_PER_PIXEL (DYNAMIC_RANGE / 8)
|
#define NUM_BITS_PER_PIXEL (DYNAMIC_RANGE / 8)
|
||||||
#define DATA_BYTES (NCHIP * NCHAN * NUM_BITS_PER_PIXEL)
|
#define DATA_BYTES (NCHIP * NCHAN * NUM_BITS_PER_PIXEL)
|
||||||
#define CLK_FREQ (32007729) /* Hz */
|
#define CLK_FREQ (32007729) // Hz
|
||||||
#define MAX_EXT_SIGNALS (1)
|
#define MAX_EXT_SIGNALS (1)
|
||||||
|
|
||||||
/** Firmware Definitions */
|
/** Firmware Definitions */
|
||||||
|
Binary file not shown.
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
// Global variable from slsDetectorServer_funcs
|
// Global variable from slsDetectorServer_funcs
|
||||||
extern int debugflag;
|
extern int debugflag;
|
||||||
|
extern int updateFlag;
|
||||||
extern udpStruct udpDetails;
|
extern udpStruct udpDetails;
|
||||||
extern const enum detectorType myDetectorType;
|
extern const enum detectorType myDetectorType;
|
||||||
|
|
||||||
@ -77,7 +78,8 @@ void basictests() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// does check only if flag is 0 (by default), set by command line
|
// does check only if flag is 0 (by default), set by command line
|
||||||
if ((!debugflag) && ((checkType() == FAIL) || (testFpga() == FAIL) ||
|
if ((!debugflag) && (!updateFlag) &&
|
||||||
|
((checkType() == FAIL) || (testFpga() == FAIL) ||
|
||||||
(testBus() == FAIL))) {
|
(testBus() == FAIL))) {
|
||||||
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
|
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
|
||||||
"Dangerous to continue.\n");
|
"Dangerous to continue.\n");
|
||||||
@ -119,7 +121,7 @@ void basictests() {
|
|||||||
(long long int)client_sw_apiversion));
|
(long long int)client_sw_apiversion));
|
||||||
|
|
||||||
// return if flag is not zero, debug mode
|
// return if flag is not zero, debug mode
|
||||||
if (debugflag) {
|
if (debugflag || updateFlag) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,7 +349,7 @@ u_int32_t getDetectorIP() {
|
|||||||
/* initialization */
|
/* initialization */
|
||||||
|
|
||||||
void initControlServer() {
|
void initControlServer() {
|
||||||
if (initError == OK) {
|
if (!updateFlag && initError == OK) {
|
||||||
setupDetector();
|
setupDetector();
|
||||||
}
|
}
|
||||||
initCheckDone = 1;
|
initCheckDone = 1;
|
||||||
|
@ -69,8 +69,8 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS };
|
|||||||
#define DYNAMIC_RANGE (16)
|
#define DYNAMIC_RANGE (16)
|
||||||
#define NUM_BYTES_PER_PIXEL (DYNAMIC_RANGE / 8)
|
#define NUM_BYTES_PER_PIXEL (DYNAMIC_RANGE / 8)
|
||||||
#define DATA_BYTES (NCHIP * NCHAN * NUM_BYTES_PER_PIXEL)
|
#define DATA_BYTES (NCHIP * NCHAN * NUM_BYTES_PER_PIXEL)
|
||||||
#define CLK_RUN (40) /* MHz */
|
#define CLK_RUN (40) // MHz
|
||||||
#define CLK_SYNC (20) /* MHz */
|
#define CLK_SYNC (20) // MHz
|
||||||
#define ADC_CLK_INDEX (1)
|
#define ADC_CLK_INDEX (1)
|
||||||
#define DBIT_CLK_INDEX (0)
|
#define DBIT_CLK_INDEX (0)
|
||||||
|
|
||||||
|
Binary file not shown.
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
// Global variable from slsDetectorServer_funcs
|
// Global variable from slsDetectorServer_funcs
|
||||||
extern int debugflag;
|
extern int debugflag;
|
||||||
|
extern int updateFlag;
|
||||||
extern udpStruct udpDetails;
|
extern udpStruct udpDetails;
|
||||||
extern const enum detectorType myDetectorType;
|
extern const enum detectorType myDetectorType;
|
||||||
|
|
||||||
@ -101,7 +102,8 @@ void basictests() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// does check only if flag is 0 (by default), set by command line
|
// does check only if flag is 0 (by default), set by command line
|
||||||
if ((!debugflag) && ((checkType() == FAIL) || (testFpga() == FAIL) ||
|
if ((!debugflag) && (!updateFlag) &&
|
||||||
|
((checkType() == FAIL) || (testFpga() == FAIL) ||
|
||||||
(testBus() == FAIL))) {
|
(testBus() == FAIL))) {
|
||||||
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
|
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
|
||||||
"Dangerous to continue.\n");
|
"Dangerous to continue.\n");
|
||||||
@ -141,7 +143,7 @@ void basictests() {
|
|||||||
(long long int)client_sw_apiversion));
|
(long long int)client_sw_apiversion));
|
||||||
|
|
||||||
// return if flag is not zero, debug mode
|
// return if flag is not zero, debug mode
|
||||||
if (debugflag) {
|
if (debugflag || updateFlag) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,7 +415,7 @@ uint32_t getDetectorIP() {
|
|||||||
/* initialization */
|
/* initialization */
|
||||||
|
|
||||||
void initControlServer() {
|
void initControlServer() {
|
||||||
if (initError == OK) {
|
if (!updateFlag && initError == OK) {
|
||||||
setupDetector();
|
setupDetector();
|
||||||
}
|
}
|
||||||
initCheckDone = 1;
|
initCheckDone = 1;
|
||||||
|
@ -129,6 +129,10 @@
|
|||||||
#define CONTROL_STP_ACQSTN_MSK (0x00000001 << CONTROL_STP_ACQSTN_OFST)
|
#define CONTROL_STP_ACQSTN_MSK (0x00000001 << CONTROL_STP_ACQSTN_OFST)
|
||||||
#define CONTROL_STRT_PATTERN_OFST (2)
|
#define CONTROL_STRT_PATTERN_OFST (2)
|
||||||
#define CONTROL_STRT_PATTERN_MSK (0x00000001 << CONTROL_STRT_PATTERN_OFST)
|
#define CONTROL_STRT_PATTERN_MSK (0x00000001 << CONTROL_STRT_PATTERN_OFST)
|
||||||
|
#define CONTROL_STRT_READOUT_OFST (3) // not connected in software yet
|
||||||
|
#define CONTROL_STRT_READOUT_MSK (0x00000001 << CONTROL_STRT_READOUT_OFST)
|
||||||
|
#define CONTROL_STRT_SW_TRIGGER_OFST (4)
|
||||||
|
#define CONTROL_STRT_SW_TRIGGER_MSK (0x00000001 << CONTROL_STRT_SW_TRIGGER_OFST)
|
||||||
#define CONTROL_CRE_RST_OFST (10)
|
#define CONTROL_CRE_RST_OFST (10)
|
||||||
#define CONTROL_CRE_RST_MSK (0x00000001 << CONTROL_CRE_RST_OFST)
|
#define CONTROL_CRE_RST_MSK (0x00000001 << CONTROL_CRE_RST_OFST)
|
||||||
#define CONTROL_PRPHRL_RST_OFST (11) // Only GBE10?
|
#define CONTROL_PRPHRL_RST_OFST (11) // Only GBE10?
|
||||||
|
Binary file not shown.
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
// Global variable from slsDetectorServer_funcs
|
// Global variable from slsDetectorServer_funcs
|
||||||
extern int debugflag;
|
extern int debugflag;
|
||||||
|
extern int updateFlag;
|
||||||
extern int checkModuleFlag;
|
extern int checkModuleFlag;
|
||||||
extern udpStruct udpDetails;
|
extern udpStruct udpDetails;
|
||||||
extern const enum detectorType myDetectorType;
|
extern const enum detectorType myDetectorType;
|
||||||
@ -80,8 +81,9 @@ void basictests() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// does check only if flag is 0 (by default), set by command line
|
// does check only if flag is 0 (by default), set by command line
|
||||||
if ((!debugflag) && ((checkType() == FAIL) || (testFpga() == FAIL) ||
|
if ((!debugflag) && (!updateFlag) &&
|
||||||
(testBus() == FAIL))) {
|
((checkKernelVersion() == FAIL) || (checkType() == FAIL) ||
|
||||||
|
(testFpga() == FAIL) || (testBus() == FAIL))) {
|
||||||
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
|
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
|
||||||
"Dangerous to continue.\n");
|
"Dangerous to continue.\n");
|
||||||
LOG(logERROR, ("%s\n\n", initErrorMessage));
|
LOG(logERROR, ("%s\n\n", initErrorMessage));
|
||||||
@ -117,7 +119,7 @@ void basictests() {
|
|||||||
(long long int)client_sw_apiversion));
|
(long long int)client_sw_apiversion));
|
||||||
|
|
||||||
// return if flag is not zero, debug mode
|
// return if flag is not zero, debug mode
|
||||||
if (debugflag) {
|
if (debugflag || updateFlag) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,6 +163,13 @@ void basictests() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int checkKernelVersion() {
|
||||||
|
#ifdef VIRTUAL
|
||||||
|
return OK;
|
||||||
|
#endif
|
||||||
|
return Nios_checkKernelVersion(KERNEL_DATE_VRSN);
|
||||||
|
}
|
||||||
|
|
||||||
int checkType() {
|
int checkType() {
|
||||||
#ifdef VIRTUAL
|
#ifdef VIRTUAL
|
||||||
return OK;
|
return OK;
|
||||||
@ -313,7 +322,7 @@ u_int32_t getDetectorIP() {
|
|||||||
/* initialization */
|
/* initialization */
|
||||||
|
|
||||||
void initControlServer() {
|
void initControlServer() {
|
||||||
if (initError == OK) {
|
if (!updateFlag && initError == OK) {
|
||||||
setupDetector();
|
setupDetector();
|
||||||
}
|
}
|
||||||
initCheckDone = 1;
|
initCheckDone = 1;
|
||||||
@ -2297,6 +2306,12 @@ int stopStateMachine() {
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int softwareTrigger() {
|
||||||
|
LOG(logINFO, ("Sending Software Trigger\n"));
|
||||||
|
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_STRT_SW_TRIGGER_MSK);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
enum runStatus getRunStatus() {
|
enum runStatus getRunStatus() {
|
||||||
LOG(logDEBUG1, ("Getting status\n"));
|
LOG(logDEBUG1, ("Getting status\n"));
|
||||||
// scan error or running
|
// scan error or running
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
|
||||||
#define REQRD_FRMWRE_VRSN 0x190000
|
#define REQRD_FRMWRE_VRSN 0x190000
|
||||||
|
#define KERNEL_DATE_VRSN "Wed May 20 13:58:38 CEST 2020"
|
||||||
|
|
||||||
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
||||||
|
|
||||||
@ -36,12 +37,14 @@
|
|||||||
#define DEFAULT_DELAY_AFTER_TRIGGER (0)
|
#define DEFAULT_DELAY_AFTER_TRIGGER (0)
|
||||||
#define DEFAULT_HIGH_VOLTAGE (0)
|
#define DEFAULT_HIGH_VOLTAGE (0)
|
||||||
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
||||||
#define DEFAULT_READOUT_C0 (8) //(125000000) // rdo_clk, 125 MHz
|
#define DEFAULT_READOUT_C0 (10) //(100000000) // rdo_clk, 100 MHz
|
||||||
#define DEFAULT_READOUT_C1 (8) //(125000000) // rdo_x2_clk, 125 MHz
|
#define DEFAULT_READOUT_C1 (10) //(100000000) // smp sample clk (x2), 100 MHz
|
||||||
#define DEFAULT_SYSTEM_C0 (4) //(250000000) // run_clk, 250 MHz
|
#define DEFAULT_SYSTEM_C0 (20) // (50000000) // run_clk, 50 MHz
|
||||||
#define DEFAULT_SYSTEM_C1 (8) //(125000000) // sync_clk, 125 MHz
|
#define DEFAULT_SYSTEM_C1 (10) //(100000000) // sync_clk, 100 MHz
|
||||||
#define DEFAULT_SYSTEM_C2 (8) //(125000000) // str_clk, 125 MHz
|
#define DEFAULT_SYSTEM_C2 (10) //(100000000) // str_clk, 100 MHz
|
||||||
#define DEFAULT_SYSTEM_C3 (5) //(200000000) // smp_clk, 200 MHz (only for timing receiver)
|
#define DEFAULT_SYSTEM_C3 (5) //(200000000) // smp_clk, 200 MHz
|
||||||
|
// (DEFAULT_SYSTEM_C3 only for timing receiver) should not be changed
|
||||||
|
|
||||||
#define DEFAULT_ASIC_LATCHING_NUM_PULSES (10)
|
#define DEFAULT_ASIC_LATCHING_NUM_PULSES (10)
|
||||||
#define DEFAULT_MSTR_OTPT_P1_NUM_PULSES (20)
|
#define DEFAULT_MSTR_OTPT_P1_NUM_PULSES (20)
|
||||||
|
|
||||||
@ -110,7 +113,8 @@ enum CLKINDEX {
|
|||||||
NUM_CLOCKS
|
NUM_CLOCKS
|
||||||
};
|
};
|
||||||
#define CLK_NAMES \
|
#define CLK_NAMES \
|
||||||
"READOUT_C0", "READOUT_C1", "SYSTEM_C0", "SYSTEM_C1", "SYSTEM_C2", "SYSTEM_C3"
|
"READOUT_C0", "READOUT_C1", "SYSTEM_C0", "SYSTEM_C1", "SYSTEM_C2", \
|
||||||
|
"SYSTEM_C3"
|
||||||
enum PLLINDEX { READOUT_PLL, SYSTEM_PLL };
|
enum PLLINDEX { READOUT_PLL, SYSTEM_PLL };
|
||||||
|
|
||||||
/* Struct Definitions */
|
/* Struct Definitions */
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a value from a range to a different range (eg voltage to dac or vice
|
* Convert a value from a range to a different range (eg voltage to dac or vice
|
||||||
@ -17,3 +18,5 @@ int ConvertToDifferentRange(int inputMin, int inputMax, int outputMin,
|
|||||||
int outputMax, int inputValue, int *outputValue);
|
int outputMax, int inputValue, int *outputValue);
|
||||||
|
|
||||||
int getAbsPath(char *buf, size_t bufSize, char *fname);
|
int getAbsPath(char *buf, size_t bufSize, char *fname);
|
||||||
|
|
||||||
|
int GetTimeFromString(char *buf, time_t *result);
|
@ -87,3 +87,7 @@ int mapCSP0(void);
|
|||||||
* Get Nios base address
|
* Get Nios base address
|
||||||
*/
|
*/
|
||||||
u_int32_t *Nios_getBaseAddress();
|
u_int32_t *Nios_getBaseAddress();
|
||||||
|
|
||||||
|
/** check kernel version against expected version string (complain if too old)
|
||||||
|
* @returns OK or FAIL */
|
||||||
|
int Nios_checkKernelVersion(char *expectedVersion);
|
@ -56,6 +56,9 @@ typedef struct udpStruct_s {
|
|||||||
int isInitCheckDone();
|
int isInitCheckDone();
|
||||||
int getInitResult(char **mess);
|
int getInitResult(char **mess);
|
||||||
void basictests();
|
void basictests();
|
||||||
|
#if defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||||
|
int checkKernelVersion();
|
||||||
|
#endif
|
||||||
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || \
|
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || \
|
||||||
defined(MOENCHD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
|
defined(MOENCHD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||||
int checkType();
|
int checkType();
|
||||||
@ -554,7 +557,7 @@ int startStateMachine();
|
|||||||
void *start_timer(void *arg);
|
void *start_timer(void *arg);
|
||||||
#endif
|
#endif
|
||||||
int stopStateMachine();
|
int stopStateMachine();
|
||||||
#ifdef EIGERD
|
#if defined(EIGERD) || defined(MYTHEN3D)
|
||||||
int softwareTrigger();
|
int softwareTrigger();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#define _GNU_SOURCE // needed for strptime to be at the top
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "clogger.h"
|
#include "clogger.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
@ -60,3 +61,12 @@ int getAbsPath(char *buf, size_t bufSize, char *fname) {
|
|||||||
LOG(logDEBUG1, ("full path for %s: %s\n", fname, buf));
|
LOG(logDEBUG1, ("full path for %s: %s\n", fname, buf));
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int GetTimeFromString(char *buf, time_t *result) {
|
||||||
|
struct tm t;
|
||||||
|
if (NULL == strptime(buf, "%a %b %d %H:%M:%S %Z %Y", &t)) {
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
*result = mktime(&t);
|
||||||
|
return OK;
|
||||||
|
}
|
@ -2,10 +2,13 @@
|
|||||||
#include "RegisterDefs.h"
|
#include "RegisterDefs.h"
|
||||||
#include "ansi.h"
|
#include "ansi.h"
|
||||||
#include "clogger.h"
|
#include "clogger.h"
|
||||||
|
#include "common.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
|
||||||
#include <fcntl.h> // open
|
#include <fcntl.h> // open
|
||||||
|
#include <string.h>
|
||||||
#include <sys/mman.h> // mmap
|
#include <sys/mman.h> // mmap
|
||||||
|
#include <sys/utsname.h> // uname
|
||||||
|
|
||||||
/* global variables */
|
/* global variables */
|
||||||
u_int32_t *csp0base = 0;
|
u_int32_t *csp0base = 0;
|
||||||
@ -127,3 +130,49 @@ int mapCSP0(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
u_int32_t *Nios_getBaseAddress() { return csp0base; }
|
u_int32_t *Nios_getBaseAddress() { return csp0base; }
|
||||||
|
|
||||||
|
int Nios_checkKernelVersion(char *expectedVersion) {
|
||||||
|
// extract kernel date string
|
||||||
|
struct utsname buf;
|
||||||
|
if (uname(&buf) == -1) {
|
||||||
|
LOG(logERROR, ("Could not get kernel version\n"));
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove first word (#version number)
|
||||||
|
const char *ptr = strchr(buf.version, ' ');
|
||||||
|
if (ptr == NULL) {
|
||||||
|
LOG(logERROR, ("Could not parse kernel version\n"));
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
char output[256];
|
||||||
|
memset(output, 0, 256);
|
||||||
|
strcpy(output, buf.version + (ptr - buf.version + 1));
|
||||||
|
|
||||||
|
// convert kernel date string into time
|
||||||
|
time_t kernelDate;
|
||||||
|
if (GetTimeFromString(output, &kernelDate) == FAIL) {
|
||||||
|
LOG(logERROR, ("Could not parse retrieved kernel date, %s\n", output));
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// convert expected date into time
|
||||||
|
time_t expDate;
|
||||||
|
if (GetTimeFromString(expectedVersion, &expDate) == FAIL) {
|
||||||
|
LOG(logERROR,
|
||||||
|
("Could not parse expected kernel date, %s\n", expectedVersion));
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// compare if kernel time is older than expected time
|
||||||
|
if (kernelDate < expDate) {
|
||||||
|
LOG(logERROR, ("Kernel Version Incompatible (too old)! Expected: [%s], "
|
||||||
|
"Got [%s]\n",
|
||||||
|
expectedVersion, output));
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG(logINFOBLUE, ("Kernel Version Compatible: %s [min.: %s]\n", output,
|
||||||
|
expectedVersion));
|
||||||
|
return OK;
|
||||||
|
}
|
@ -21,6 +21,7 @@ extern int ret;
|
|||||||
// Global variables from slsDetectorServer_funcs
|
// Global variables from slsDetectorServer_funcs
|
||||||
extern int sockfd;
|
extern int sockfd;
|
||||||
extern int debugflag;
|
extern int debugflag;
|
||||||
|
extern int updateFlag;
|
||||||
extern int checkModuleFlag;
|
extern int checkModuleFlag;
|
||||||
|
|
||||||
// Global variables from slsDetectorFunctionList
|
// Global variables from slsDetectorFunctionList
|
||||||
@ -41,6 +42,7 @@ int main(int argc, char *argv[]) {
|
|||||||
int portno = DEFAULT_PORTNO;
|
int portno = DEFAULT_PORTNO;
|
||||||
isControlServer = 1;
|
isControlServer = 1;
|
||||||
debugflag = 0;
|
debugflag = 0;
|
||||||
|
updateFlag = 0;
|
||||||
checkModuleFlag = 1;
|
checkModuleFlag = 1;
|
||||||
int version = 0;
|
int version = 0;
|
||||||
|
|
||||||
@ -53,10 +55,12 @@ int main(int argc, char *argv[]) {
|
|||||||
"Possible arguments are:\n"
|
"Possible arguments are:\n"
|
||||||
"\t-v, --version : Software version\n"
|
"\t-v, --version : Software version\n"
|
||||||
"\t-p, --port <port> : TCP communication port with client. \n"
|
"\t-p, --port <port> : TCP communication port with client. \n"
|
||||||
"\t-d, --devel : Developer mode. Skips firmware checks. \n"
|
|
||||||
"\t-g, --nomodule : [Mythen3][Gotthard2] Generic or No "
|
"\t-g, --nomodule : [Mythen3][Gotthard2] Generic or No "
|
||||||
"Module mode. Skips detector type checks. \n"
|
"Module mode. Skips detector type checks. \n"
|
||||||
"\t-f, --phaseshift <value> : [Gotthard] only. Sets phase shift. \n"
|
"\t-f, --phaseshift <value> : [Gotthard] only. Sets phase shift. \n"
|
||||||
|
"\t-d, --devel : Developer mode. Skips firmware checks. \n"
|
||||||
|
"\t-u, --update : Update mode. Skips firmware checks and "
|
||||||
|
"initial detector setup. \n"
|
||||||
"\t-s, --stopserver : Stop server. Do not use as created by "
|
"\t-s, --stopserver : Stop server. Do not use as created by "
|
||||||
"control server \n\n",
|
"control server \n\n",
|
||||||
argv[0]);
|
argv[0]);
|
||||||
@ -68,9 +72,10 @@ int main(int argc, char *argv[]) {
|
|||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"version", no_argument, NULL, 'v'},
|
{"version", no_argument, NULL, 'v'},
|
||||||
{"port", required_argument, NULL, 'p'},
|
{"port", required_argument, NULL, 'p'},
|
||||||
{"devel", no_argument, NULL, 'd'},
|
|
||||||
{"phaseshift", required_argument, NULL, 'f'},
|
{"phaseshift", required_argument, NULL, 'f'},
|
||||||
{"nomodule", no_argument, NULL, 'g'}, // generic
|
{"nomodule", no_argument, NULL, 'g'}, // generic
|
||||||
|
{"devel", no_argument, NULL, 'd'},
|
||||||
|
{"update", no_argument, NULL, 'u'},
|
||||||
{"stopserver", no_argument, NULL, 's'},
|
{"stopserver", no_argument, NULL, 's'},
|
||||||
{NULL, 0, NULL, 0}};
|
{NULL, 0, NULL, 0}};
|
||||||
|
|
||||||
@ -80,7 +85,7 @@ int main(int argc, char *argv[]) {
|
|||||||
int c = 0;
|
int c = 0;
|
||||||
|
|
||||||
while (c != -1) {
|
while (c != -1) {
|
||||||
c = getopt_long(argc, argv, "hvp:df:gs", long_options, &option_index);
|
c = getopt_long(argc, argv, "hvp:f:gdus", long_options, &option_index);
|
||||||
|
|
||||||
// Detect the end of the options
|
// Detect the end of the options
|
||||||
if (c == -1)
|
if (c == -1)
|
||||||
@ -116,11 +121,6 @@ int main(int argc, char *argv[]) {
|
|||||||
LOG(logINFO, ("Detected port: %d\n", portno));
|
LOG(logINFO, ("Detected port: %d\n", portno));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
|
||||||
LOG(logINFO, ("Detected developer mode\n"));
|
|
||||||
debugflag = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
#ifndef GOTTHARDD
|
#ifndef GOTTHARDD
|
||||||
LOG(logERROR,
|
LOG(logERROR,
|
||||||
@ -141,6 +141,16 @@ int main(int argc, char *argv[]) {
|
|||||||
checkModuleFlag = 0;
|
checkModuleFlag = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'd':
|
||||||
|
LOG(logINFO, ("Detected developer mode\n"));
|
||||||
|
debugflag = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'u':
|
||||||
|
LOG(logINFO, ("Detected update mode\n"));
|
||||||
|
updateFlag = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
LOG(logINFO, ("Detected stop server\n"));
|
LOG(logINFO, ("Detected stop server\n"));
|
||||||
isControlServer = 0;
|
isControlServer = 0;
|
||||||
|
@ -42,6 +42,7 @@ extern char mess[MAX_STR_LENGTH];
|
|||||||
// Variables that will be exported
|
// Variables that will be exported
|
||||||
int sockfd = 0;
|
int sockfd = 0;
|
||||||
int debugflag = 0;
|
int debugflag = 0;
|
||||||
|
int updateFlag = 0;
|
||||||
int checkModuleFlag = 1;
|
int checkModuleFlag = 1;
|
||||||
udpStruct udpDetails = {32410, 32411, 50001, 50002, 0, 0, 0, 0, 0, 0, 0, 0};
|
udpStruct udpDetails = {32410, 32411, 50001, 50002, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||||
int configured = FAIL;
|
int configured = FAIL;
|
||||||
@ -4106,7 +4107,7 @@ int software_trigger(int file_des) {
|
|||||||
memset(mess, 0, sizeof(mess));
|
memset(mess, 0, sizeof(mess));
|
||||||
|
|
||||||
LOG(logDEBUG1, ("Software Trigger\n"));
|
LOG(logDEBUG1, ("Software Trigger\n"));
|
||||||
#ifndef EIGERD
|
#if !defined(EIGERD) && !defined(MYTHEN3D)
|
||||||
functionNotImplemented();
|
functionNotImplemented();
|
||||||
#else
|
#else
|
||||||
// only set
|
// only set
|
||||||
|
@ -35,19 +35,20 @@ class Detector {
|
|||||||
*/
|
*/
|
||||||
Detector(int shm_id = 0);
|
Detector(int shm_id = 0);
|
||||||
~Detector();
|
~Detector();
|
||||||
|
/** @name Configuration */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Configuration *
|
* Configuration *
|
||||||
* *
|
* *
|
||||||
* ************************************************/
|
* ************************************************/
|
||||||
|
|
||||||
/* Free the shared memory of this detector and all modules
|
/** Free the shared memory of this detector and all modules
|
||||||
* belonging to it */
|
belonging to it */
|
||||||
void freeSharedMemory();
|
void freeSharedMemory();
|
||||||
|
|
||||||
/** Frees shared memory before loading configuration file. Set up once
|
/** Frees shared memory before loading configuration file. Set up once
|
||||||
* normally */
|
normally */
|
||||||
void loadConfig(const std::string &fname);
|
void loadConfig(const std::string &fname);
|
||||||
|
|
||||||
/** Shared memory not freed prior. Set up per measurement. */
|
/** Shared memory not freed prior. Set up per measurement. */
|
||||||
@ -57,7 +58,7 @@ class Detector {
|
|||||||
|
|
||||||
Result<std::string> getHostname(Positions pos = {}) const;
|
Result<std::string> getHostname(Positions pos = {}) const;
|
||||||
|
|
||||||
/* Frees shared memory, adds detectors to the list */
|
/**Frees shared memory, adds detectors to the list */
|
||||||
void setHostname(const std::vector<std::string> &hostname);
|
void setHostname(const std::vector<std::string> &hostname);
|
||||||
|
|
||||||
/** connects to n servers at local host starting at specific control port */
|
/** connects to n servers at local host starting at specific control port */
|
||||||
@ -79,6 +80,8 @@ class Detector {
|
|||||||
|
|
||||||
Result<int64_t> getReceiverVersion(Positions pos = {}) const;
|
Result<int64_t> getReceiverVersion(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** Options: EIGER, JUNGFRAU, GOTTHARD, MOENCH, MYTHEN3, GOTTHARD2,
|
||||||
|
* CHIPTESTBOARD */
|
||||||
Result<defs::detectorType> getDetectorType(Positions pos = {}) const;
|
Result<defs::detectorType> getDetectorType(Positions pos = {}) const;
|
||||||
|
|
||||||
/** Gets the total number of detectors */
|
/** Gets the total number of detectors */
|
||||||
@ -95,7 +98,7 @@ class Detector {
|
|||||||
defs::xy getDetectorSize() const;
|
defs::xy getDetectorSize() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the detector size in both dimensions.
|
* Sets the detector size in both dimensions. \n
|
||||||
* This value is used to calculate row and column positions for each module.
|
* This value is used to calculate row and column positions for each module.
|
||||||
*/
|
*/
|
||||||
void setDetectorSize(const defs::xy value);
|
void setDetectorSize(const defs::xy value);
|
||||||
@ -107,17 +110,18 @@ class Detector {
|
|||||||
Result<defs::detectorSettings> getSettings(Positions pos = {}) const;
|
Result<defs::detectorSettings> getSettings(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau] DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2,
|
/** [Jungfrau] DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2,
|
||||||
* FORCESWITCHG1, FORCESWITCHG2 [Gotthard] \n DYNAMICGAIN, HIGHGAIN,
|
* FORCESWITCHG1, FORCESWITCHG2 \n [Gotthard] DYNAMICGAIN, HIGHGAIN,
|
||||||
* LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN [Gotthard2] \n DYNAMICGAIN,
|
* LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n [Gotthard2] DYNAMICGAIN,
|
||||||
* FIXGAIN1, FIXGAIN2 [Moench] \n G1_HIGHGAIN, G1_LOWGAIN,
|
* FIXGAIN1, FIXGAIN2 \n [Moench] G1_HIGHGAIN, G1_LOWGAIN,
|
||||||
* G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN,
|
* G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN,
|
||||||
* G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN \n [Eiger] Use threshold
|
* G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN \n [Eiger] Use threshold
|
||||||
* command \n [Eiger settings loaded from file found in
|
* command. Settings loaded from file found in
|
||||||
* settingspath
|
* settingspath
|
||||||
*/
|
*/
|
||||||
void setSettings(defs::detectorSettings value, Positions pos = {});
|
void setSettings(defs::detectorSettings value, Positions pos = {});
|
||||||
|
|
||||||
/** [Eiger][Mythen3] */
|
/** [Eiger][Mythen3] If no extension specified, serial number of each module
|
||||||
|
* is attached. */
|
||||||
void loadTrimbits(const std::string &fname, Positions pos = {});
|
void loadTrimbits(const std::string &fname, Positions pos = {});
|
||||||
|
|
||||||
/** [Eiger][Mythen3] -1 if they are all different */
|
/** [Eiger][Mythen3] -1 if they are all different */
|
||||||
@ -135,15 +139,17 @@ class Detector {
|
|||||||
* streaming, receiver file or streaming. Default is disabled.
|
* streaming, receiver file or streaming. Default is disabled.
|
||||||
*/
|
*/
|
||||||
void setGapPixelsinCallback(const bool enable);
|
void setGapPixelsinCallback(const bool enable);
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name Callbacks */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Callbacks *
|
* Callbacks *
|
||||||
* *
|
* *
|
||||||
* ************************************************/
|
* ************************************************/
|
||||||
|
|
||||||
/**
|
/** register callback for end of acquisition
|
||||||
* register callback for end of acquisition
|
|
||||||
* @param func function to be called with parameters:
|
* @param func function to be called with parameters:
|
||||||
* current progress in percentage, detector status, pArg pointer
|
* current progress in percentage, detector status, pArg pointer
|
||||||
* @param pArg pointer that is returned in call back
|
* @param pArg pointer that is returned in call back
|
||||||
@ -164,7 +170,10 @@ class Detector {
|
|||||||
void registerDataCallback(void (*func)(detectorData *, uint64_t, uint32_t,
|
void registerDataCallback(void (*func)(detectorData *, uint64_t, uint32_t,
|
||||||
void *),
|
void *),
|
||||||
void *pArg);
|
void *pArg);
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name Acquisition Parameters */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Acquisition Parameters *
|
* Acquisition Parameters *
|
||||||
@ -231,9 +240,9 @@ class Detector {
|
|||||||
Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
|
Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [Gotthard][Jungfrau][CTB][Moench][Mythen3] Options:
|
* [Gotthard][Jungfrau][Gotthard][CTB][Moench][Gotthard2] Options:
|
||||||
* AUTO_TIMING, TRIGGER_EXPOSURE
|
* AUTO_TIMING, TRIGGER_EXPOSURE \n
|
||||||
* [Gotthard2] Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, TRIGGER_GATED
|
* [Mythen3] Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, TRIGGER_GATED \n
|
||||||
* [Eiger] Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER
|
* [Eiger] Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER
|
||||||
*/
|
*/
|
||||||
void setTimingMode(defs::timingMode value, Positions pos = {});
|
void setTimingMode(defs::timingMode value, Positions pos = {});
|
||||||
@ -354,27 +363,30 @@ class Detector {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* (Degrees)
|
* (Degrees)
|
||||||
* [Gotthard] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA
|
* [Gotthard] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA \n
|
||||||
* [Jungfrau] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA
|
* [Jungfrau] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA \n
|
||||||
* [Eiger] Options: TEMPERATURE_FPGA, TEMPERATURE_FPGAEXT, TEMPERATURE_10GE,
|
* [Eiger] Options: TEMPERATURE_FPGA, TEMPERATURE_FPGAEXT, TEMPERATURE_10GE,
|
||||||
* TEMPERATURE_DCDC, TEMPERATURE_SODL, TEMPERATURE_SODR, TEMPERATURE_FPGA2,
|
* TEMPERATURE_DCDC, TEMPERATURE_SODL, TEMPERATURE_SODR, TEMPERATURE_FPGA2,
|
||||||
* TEMPERATURE_FPGA3
|
* TEMPERATURE_FPGA3 \n
|
||||||
* [CTB] Options: SLOW_ADC_TEMP
|
* Cannot call TEMPERATURE_FPGA2 and TEMPERATURE_FPGA3 when blocking acquire
|
||||||
|
* in progress \n [CTB] Options: SLOW_ADC_TEMP
|
||||||
*/
|
*/
|
||||||
Result<int> getTemperature(defs::dacIndex index, Positions pos = {}) const;
|
Result<int> getTemperature(defs::dacIndex index, Positions pos = {}) const;
|
||||||
|
|
||||||
/** gets list of dac enums for this detector */
|
/** gets list of dac enums for this detector */
|
||||||
std::vector<defs::dacIndex> getDacList() const;
|
std::vector<defs::dacIndex> getDacList() const;
|
||||||
|
|
||||||
Result<int> getDAC(defs::dacIndex index, bool mV, Positions pos = {}) const;
|
Result<int> getDAC(defs::dacIndex index, bool mV = false,
|
||||||
|
Positions pos = {}) const;
|
||||||
|
|
||||||
void setDAC(defs::dacIndex index, int value, bool mV, Positions pos = {});
|
void setDAC(defs::dacIndex index, int value, bool mV = false,
|
||||||
|
Positions pos = {});
|
||||||
|
|
||||||
/* [Gotthard2] */
|
/**[Gotthard2] */
|
||||||
Result<int> getOnChipDAC(defs::dacIndex index, int chipIndex,
|
Result<int> getOnChipDAC(defs::dacIndex index, int chipIndex,
|
||||||
Positions pos = {}) const;
|
Positions pos = {}) const;
|
||||||
|
|
||||||
/* [Gotthard2] */
|
/**[Gotthard2] */
|
||||||
void setOnChipDAC(defs::dacIndex index, int chipIndex, int value,
|
void setOnChipDAC(defs::dacIndex index, int chipIndex, int value,
|
||||||
Positions pos = {});
|
Positions pos = {});
|
||||||
|
|
||||||
@ -400,7 +412,10 @@ class Detector {
|
|||||||
* [Mythen3] If exposure time is too short, acquisition will return with an
|
* [Mythen3] If exposure time is too short, acquisition will return with an
|
||||||
* ERROR and take fewer frames than expected */
|
* ERROR and take fewer frames than expected */
|
||||||
void setParallelMode(bool value, Positions pos = {});
|
void setParallelMode(bool value, Positions pos = {});
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name Acquisition */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Acquisition *
|
* Acquisition *
|
||||||
@ -409,12 +424,14 @@ class Detector {
|
|||||||
/**
|
/**
|
||||||
* Blocking call: Acquire the number of frames set
|
* Blocking call: Acquire the number of frames set
|
||||||
* - sets acquiring flag
|
* - sets acquiring flag
|
||||||
* - starts the receiver listener
|
* - starts the receiver listener (if enabled)
|
||||||
* - starts detector acquisition for number of frames set
|
* - starts detector acquisition for number of frames set
|
||||||
* - monitors detector status from running to idle
|
* - monitors detector status from running to idle
|
||||||
* - stops the receiver listener
|
* - stops the receiver listener (if enabled)
|
||||||
* - increments file index if file write enabled
|
* - increments file index if file write enabled
|
||||||
* - resets acquiring flag
|
* - resets acquiring flag
|
||||||
|
* Control server is blocked and cannot accept other commands until
|
||||||
|
* acquisition is done.
|
||||||
*/
|
*/
|
||||||
void acquire();
|
void acquire();
|
||||||
|
|
||||||
@ -457,7 +474,7 @@ class Detector {
|
|||||||
* numbers for different modules.*/
|
* numbers for different modules.*/
|
||||||
void setStartingFrameNumber(uint64_t value, Positions pos = {});
|
void setStartingFrameNumber(uint64_t value, Positions pos = {});
|
||||||
|
|
||||||
/** [Eiger] Sends an internal software trigger to the detector */
|
/** [Eiger][Mythen3] Sends an internal software trigger to the detector */
|
||||||
void sendSoftwareTrigger(Positions pos = {});
|
void sendSoftwareTrigger(Positions pos = {});
|
||||||
|
|
||||||
Result<defs::scanParameters> getScan(Positions pos = {}) const;
|
Result<defs::scanParameters> getScan(Positions pos = {}) const;
|
||||||
@ -470,7 +487,10 @@ class Detector {
|
|||||||
/** gets scan error message in case of error during scan in case of non
|
/** gets scan error message in case of error during scan in case of non
|
||||||
* blocking acquisition (startDetector, not acquire) */
|
* blocking acquisition (startDetector, not acquire) */
|
||||||
Result<std::string> getScanErrorMessage(Positions pos = {}) const;
|
Result<std::string> getScanErrorMessage(Positions pos = {}) const;
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name Network Configuration (Detector<->Receiver) */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Network Configuration (Detector<->Receiver) *
|
* Network Configuration (Detector<->Receiver) *
|
||||||
@ -501,31 +521,31 @@ class Detector {
|
|||||||
|
|
||||||
Result<IpAddr> getSourceUDPIP(Positions pos = {}) const;
|
Result<IpAddr> getSourceUDPIP(Positions pos = {}) const;
|
||||||
|
|
||||||
/* For Eiger 1G, the detector will replace with its own DHCP IP
|
/**For Eiger 1G, the detector will replace with its own DHCP IP
|
||||||
* 10G Eiger and other detectors, the source UDP IP must be in the
|
* 10G Eiger and other detectors. The source UDP IP must be in the
|
||||||
* same subnet of the destination UDP IP
|
* same subnet of the destination UDP IP
|
||||||
*/
|
*/
|
||||||
void setSourceUDPIP(const IpAddr ip, Positions pos = {});
|
void setSourceUDPIP(const IpAddr ip, Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau] bottom half */
|
/** [Jungfrau] bottom half [Gotthard2] veto debugging */
|
||||||
Result<IpAddr> getSourceUDPIP2(Positions pos = {}) const;
|
Result<IpAddr> getSourceUDPIP2(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau] bottom half */
|
/** [Jungfrau] bottom half [Gotthard2] veto debugging. \n The source UDP IP
|
||||||
|
* must be in the same subnet of the destination UDP IP2 */
|
||||||
void setSourceUDPIP2(const IpAddr ip, Positions pos = {});
|
void setSourceUDPIP2(const IpAddr ip, Positions pos = {});
|
||||||
|
|
||||||
Result<MacAddr> getSourceUDPMAC(Positions pos = {}) const;
|
Result<MacAddr> getSourceUDPMAC(Positions pos = {}) const;
|
||||||
|
|
||||||
/* For Eiger 1G, the detector will replace with its own DHCP MAC
|
/**For Eiger 1G, the detector will replace with its own DHCP MAC
|
||||||
* For Eiger 10G, the detector will replace with its own DHCP MAC + 1
|
* For Eiger 10G, the detector will replace with its own DHCP MAC + 1
|
||||||
* Others can be anything (beware of certain bits)
|
* Others can be anything (beware of certain bits)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void setSourceUDPMAC(const MacAddr mac, Positions pos = {});
|
void setSourceUDPMAC(const MacAddr mac, Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau] bottom half */
|
/** [Jungfrau] bottom half [Gotthard2] veto debugging */
|
||||||
Result<MacAddr> getSourceUDPMAC2(Positions pos = {}) const;
|
Result<MacAddr> getSourceUDPMAC2(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau] bottom half */
|
/** [Jungfrau] bottom half [Gotthard2] veto debugging */
|
||||||
void setSourceUDPMAC2(const MacAddr mac, Positions pos = {});
|
void setSourceUDPMAC2(const MacAddr mac, Positions pos = {});
|
||||||
|
|
||||||
Result<IpAddr> getDestinationUDPIP(Positions pos = {}) const;
|
Result<IpAddr> getDestinationUDPIP(Positions pos = {}) const;
|
||||||
@ -533,39 +553,42 @@ class Detector {
|
|||||||
/** IP of the interface in receiver that the detector sends data to */
|
/** IP of the interface in receiver that the detector sends data to */
|
||||||
void setDestinationUDPIP(const IpAddr ip, Positions pos = {});
|
void setDestinationUDPIP(const IpAddr ip, Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau bottom half] */
|
/** [Jungfrau] bottom half \n [Gotthard2] veto debugging */
|
||||||
Result<IpAddr> getDestinationUDPIP2(Positions pos = {}) const;
|
Result<IpAddr> getDestinationUDPIP2(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau bottom half] */
|
/** [Jungfrau] bottom half \n [Gotthard2] veto debugging */
|
||||||
void setDestinationUDPIP2(const IpAddr ip, Positions pos = {});
|
void setDestinationUDPIP2(const IpAddr ip, Positions pos = {});
|
||||||
|
|
||||||
Result<MacAddr> getDestinationUDPMAC(Positions pos = {}) const;
|
Result<MacAddr> getDestinationUDPMAC(Positions pos = {}) const;
|
||||||
|
|
||||||
/** MAC of the interface in receiver that the detector sends data to
|
/** Mac address of the receiver (destination) udp interface. Not mandatory
|
||||||
* Only needed if you use a custom receiver (not slsReceiver)
|
* to set as setDestinationUDPIP (udp_dstip) retrieves it from slsReceiver
|
||||||
* Must be followed by configuremac.
|
* process but must be set if you use a custom receiver (not slsReceiver).
|
||||||
*/
|
*/
|
||||||
void setDestinationUDPMAC(const MacAddr mac, Positions pos = {});
|
void setDestinationUDPMAC(const MacAddr mac, Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau bottom half] */
|
/** [Jungfrau] bottom half \n [Gotthard2] veto debugging */
|
||||||
Result<MacAddr> getDestinationUDPMAC2(Positions pos = {}) const;
|
Result<MacAddr> getDestinationUDPMAC2(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau bottom half] */
|
/* [Jungfrau][Gotthard2] Mac address of the receiver (destination) udp
|
||||||
|
interface 2. \n Not mandatory to set as udp_dstip2 retrieves it from
|
||||||
|
slsReceiver process but must be set if you use a custom receiver (not
|
||||||
|
slsReceiver). \n [Jungfrau] bottom half \n [Gotthard2] veto debugging \n
|
||||||
|
*/
|
||||||
void setDestinationUDPMAC2(const MacAddr mac, Positions pos = {});
|
void setDestinationUDPMAC2(const MacAddr mac, Positions pos = {});
|
||||||
|
|
||||||
Result<int> getDestinationUDPPort(Positions pos = {}) const;
|
Result<int> getDestinationUDPPort(Positions pos = {}) const;
|
||||||
|
|
||||||
/** module_id is -1 for all detectors, ports for each module is calculated
|
/** Default is 50001. \n If module_id is -1, ports for each module is
|
||||||
* (increments) */
|
* calculated (incremented by 1 if no 2nd interface) */
|
||||||
void setDestinationUDPPort(int port, int module_id = -1);
|
void setDestinationUDPPort(int port, int module_id = -1);
|
||||||
|
|
||||||
/** [Eiger right port][Jungfrau bottom half] */
|
/** [Eiger] right port[Jungfrau] bottom half [Gotthard2] veto debugging */
|
||||||
Result<int> getDestinationUDPPort2(Positions pos = {}) const;
|
Result<int> getDestinationUDPPort2(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger right port][Jungfrau bottom half]
|
/** [Eiger] right port[Jungfrau] bottom half [Gotthard2] veto debugging \n
|
||||||
* module_id is -1 for all detectors, ports for each module is calculated
|
* Default is 50002. \n If module_id is -1, ports for each module is
|
||||||
* (increments)
|
* calculated (incremented by 1 if no 2nd interface)*/
|
||||||
*/
|
|
||||||
void setDestinationUDPPort2(int port, int module_id = -1);
|
void setDestinationUDPPort2(int port, int module_id = -1);
|
||||||
|
|
||||||
void reconfigureUDPDestination(Positions pos = {});
|
void reconfigureUDPDestination(Positions pos = {});
|
||||||
@ -618,10 +641,13 @@ class Detector {
|
|||||||
* port
|
* port
|
||||||
*/
|
*/
|
||||||
void setTransmissionDelayRight(int value, Positions pos = {});
|
void setTransmissionDelayRight(int value, Positions pos = {});
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name Receiver Configuration */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Receiver Config *
|
* Receiver Configuration *
|
||||||
* *
|
* *
|
||||||
* ************************************************/
|
* ************************************************/
|
||||||
|
|
||||||
@ -700,7 +726,10 @@ class Detector {
|
|||||||
|
|
||||||
Result<std::array<pid_t, NUM_RX_THREAD_IDS>>
|
Result<std::array<pid_t, NUM_RX_THREAD_IDS>>
|
||||||
getRxThreadIds(Positions pos = {}) const;
|
getRxThreadIds(Positions pos = {}) const;
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name File */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* File *
|
* File *
|
||||||
@ -737,7 +766,7 @@ class Detector {
|
|||||||
|
|
||||||
Result<bool> getMasterFileWrite(Positions pos = {}) const;
|
Result<bool> getMasterFileWrite(Positions pos = {}) const;
|
||||||
|
|
||||||
/* default enabled */
|
/**default enabled */
|
||||||
void setMasterFileWrite(bool value, Positions pos = {});
|
void setMasterFileWrite(bool value, Positions pos = {});
|
||||||
|
|
||||||
Result<bool> getFileOverWrite(Positions pos = {}) const;
|
Result<bool> getFileOverWrite(Positions pos = {}) const;
|
||||||
@ -750,7 +779,10 @@ class Detector {
|
|||||||
/** Default depends on detector type. \n 0 will set frames per file to
|
/** Default depends on detector type. \n 0 will set frames per file to
|
||||||
* unlimited */
|
* unlimited */
|
||||||
void setFramesPerFile(int n, Positions pos = {});
|
void setFramesPerFile(int n, Positions pos = {});
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name ZMQ Streaming Parameters (Receiver<->Client) */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* ZMQ Streaming Parameters (Receiver<->Client)*
|
* ZMQ Streaming Parameters (Receiver<->Client)*
|
||||||
@ -800,10 +832,10 @@ class Detector {
|
|||||||
|
|
||||||
/** Zmq port for data to be streamed out of the receiver. \n
|
/** Zmq port for data to be streamed out of the receiver. \n
|
||||||
* Also restarts receiver zmq streaming if enabled. \n Default is 30001. \n
|
* Also restarts receiver zmq streaming if enabled. \n Default is 30001. \n
|
||||||
* Modified only when using an intermediate process after receiver. \n Must
|
* Must be different for every detector (and udp port). \n module_id is -1
|
||||||
* be different for every detector (and udp port). \n module_id is -1 for
|
* for all detectors, ports for each module is calculated (increment by 1 if
|
||||||
* all detectors, ports for each module is calculated (increments) Restarts
|
* no 2nd interface). \n Restarts receiver zmq sockets only if it was
|
||||||
* receiver zmq sockets only if it was already enabled
|
* already enabled
|
||||||
*/
|
*/
|
||||||
void setRxZmqPort(int port, int module_id = -1);
|
void setRxZmqPort(int port, int module_id = -1);
|
||||||
|
|
||||||
@ -817,18 +849,27 @@ class Detector {
|
|||||||
|
|
||||||
Result<int> getClientZmqPort(Positions pos = {}) const;
|
Result<int> getClientZmqPort(Positions pos = {}) const;
|
||||||
|
|
||||||
/**
|
/** Port number to listen to zmq data streamed out from receiver or
|
||||||
* Modified only when using an intermediate process between receiver and
|
* intermediate process. \n Must be different for every detector (and udp
|
||||||
* gui/client. Module_id is -1 for all detectors, ports for each module is
|
* port). \n Module_id is -1 for all detectors, ports for each module is
|
||||||
* calculated (increments) Restarts client zmq sockets only if it was
|
* calculated (increment by 1 if no 2nd interface). \n Restarts client zmq
|
||||||
* already enabled
|
* sockets only if it was already enabled \n Default connects to receiver
|
||||||
|
* zmq streaming out port (30001).
|
||||||
*/
|
*/
|
||||||
void setClientZmqPort(int port, int module_id = -1);
|
void setClientZmqPort(int port, int module_id = -1);
|
||||||
|
|
||||||
Result<IpAddr> getClientZmqIp(Positions pos = {}) const;
|
Result<IpAddr> getClientZmqIp(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** Ip Address to listen to zmq data streamed out from receiver or
|
||||||
|
* intermediate process. Default connects to receiver zmq Ip Address (from
|
||||||
|
* rx_hostname). Modified only when using an intermediate process between
|
||||||
|
* receiver and client(gui). Also restarts client zmq streaming if enabled.
|
||||||
|
*/
|
||||||
void setClientZmqIp(const IpAddr ip, Positions pos = {});
|
void setClientZmqIp(const IpAddr ip, Positions pos = {});
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name Eiger Specific */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Eiger Specific *
|
* Eiger Specific *
|
||||||
@ -850,7 +891,7 @@ class Detector {
|
|||||||
/** [Eiger] */
|
/** [Eiger] */
|
||||||
Result<int> getThresholdEnergy(Positions pos = {}) const;
|
Result<int> getThresholdEnergy(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger] */
|
/** [Eiger] It loads trim files from settingspath */
|
||||||
void setThresholdEnergy(int threshold_ev,
|
void setThresholdEnergy(int threshold_ev,
|
||||||
defs::detectorSettings settings = defs::STANDARD,
|
defs::detectorSettings settings = defs::STANDARD,
|
||||||
bool trimbits = true, Positions pos = {});
|
bool trimbits = true, Positions pos = {});
|
||||||
@ -876,7 +917,8 @@ class Detector {
|
|||||||
/**[Eiger] Returns energies in eV where the module is trimmed */
|
/**[Eiger] Returns energies in eV where the module is trimmed */
|
||||||
Result<std::vector<int>> getTrimEnergies(Positions pos = {}) const;
|
Result<std::vector<int>> getTrimEnergies(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger] Set the energies where the detector is trimmed */
|
/** [Eiger] List of trim energies, where corresponding default trim files
|
||||||
|
* exist in corresponding trim folders */
|
||||||
void setTrimEnergies(std::vector<int> energies, Positions pos = {});
|
void setTrimEnergies(std::vector<int> energies, Positions pos = {});
|
||||||
|
|
||||||
/** [Eiger] deadtime in ns, 0 = disabled */
|
/** [Eiger] deadtime in ns, 0 = disabled */
|
||||||
@ -950,7 +992,10 @@ class Detector {
|
|||||||
|
|
||||||
/** [Eiger] with specific quad hardware */
|
/** [Eiger] with specific quad hardware */
|
||||||
void setQuad(const bool enable);
|
void setQuad(const bool enable);
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name Jungfrau Specific */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Jungfrau Specific *
|
* Jungfrau Specific *
|
||||||
@ -963,23 +1008,24 @@ class Detector {
|
|||||||
/**
|
/**
|
||||||
* [Jungfrau]Set threshold temperature
|
* [Jungfrau]Set threshold temperature
|
||||||
* If temperature crosses threshold temperature
|
* If temperature crosses threshold temperature
|
||||||
* and temperature control is enabled,
|
* and temperature control is enabled (default is disabled), power to chip
|
||||||
* power to chip will be switched off and
|
* will be switched off and temperature event will be set. \n To power on
|
||||||
* temperature event will be set
|
* chip again, temperature has to be less than threshold temperature and
|
||||||
* val is value in degrees
|
* temperature event has to be cleared. val is value in degrees
|
||||||
*/
|
*/
|
||||||
void setThresholdTemperature(int temp, Positions pos = {});
|
void setThresholdTemperature(int temp, Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau] */
|
/** [Jungfrau] */
|
||||||
Result<bool> getTemperatureControl(Positions pos = {}) const;
|
Result<bool> getTemperatureControl(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau] */
|
/** [Jungfrau] refer to setThresholdTemperature
|
||||||
|
* Default is disabled */
|
||||||
void setTemperatureControl(bool enable, Positions pos = {});
|
void setTemperatureControl(bool enable, Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau] */
|
/** [Jungfrau] refer to setThresdholdTemperature */
|
||||||
Result<int> getTemperatureEvent(Positions pos = {}) const;
|
Result<int> getTemperatureEvent(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau] */
|
/** [Jungfrau] refer to setThresdholdTemperature */
|
||||||
void resetTemperatureEvent(Positions pos = {});
|
void resetTemperatureEvent(Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau] */
|
/** [Jungfrau] */
|
||||||
@ -1018,7 +1064,10 @@ class Detector {
|
|||||||
/** [Jungfrau] Advanced \n
|
/** [Jungfrau] Advanced \n
|
||||||
* Options: (0-1638375 ns (resolution of 25ns) */
|
* Options: (0-1638375 ns (resolution of 25ns) */
|
||||||
void setStorageCellDelay(ns value, Positions pos = {});
|
void setStorageCellDelay(ns value, Positions pos = {});
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name Gotthard Specific */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Gotthard Specific *
|
* Gotthard Specific *
|
||||||
@ -1041,7 +1090,10 @@ class Detector {
|
|||||||
|
|
||||||
/** [Gotthard] */
|
/** [Gotthard] */
|
||||||
Result<ns> getExptimeLeft(Positions pos = {}) const;
|
Result<ns> getExptimeLeft(Positions pos = {}) const;
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name Gotthard2 Specific */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Gotthard2 Specific *
|
* Gotthard2 Specific *
|
||||||
@ -1120,7 +1172,7 @@ class Detector {
|
|||||||
/** [Gotthard2] */
|
/** [Gotthard2] */
|
||||||
Result<bool> getVeto(Positions pos = {}) const;
|
Result<bool> getVeto(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Gotthard2] */
|
/** [Gotthard2] Default disabled */
|
||||||
void setVeto(const bool enable, Positions pos = {});
|
void setVeto(const bool enable, Positions pos = {});
|
||||||
|
|
||||||
/** [Gotthard2] */
|
/** [Gotthard2] */
|
||||||
@ -1136,7 +1188,10 @@ class Detector {
|
|||||||
|
|
||||||
/** [Gotthard2] */
|
/** [Gotthard2] */
|
||||||
void setBadChannels(const std::string &fname, Positions pos = {});
|
void setBadChannels(const std::string &fname, Positions pos = {});
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name Mythen3 Specific */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Mythen3 Specific *
|
* Mythen3 Specific *
|
||||||
@ -1177,7 +1232,10 @@ class Detector {
|
|||||||
/** [Mythen3] gate delay for all gates in auto or trigger timing mode
|
/** [Mythen3] gate delay for all gates in auto or trigger timing mode
|
||||||
* (internal gating). Gate index: 0-2, -1 for all */
|
* (internal gating). Gate index: 0-2, -1 for all */
|
||||||
Result<std::array<ns, 3>> getGateDelayForAllGates(Positions pos = {}) const;
|
Result<std::array<ns, 3>> getGateDelayForAllGates(Positions pos = {}) const;
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name CTB / Moench Specific */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* CTB / Moench Specific *
|
* CTB / Moench Specific *
|
||||||
@ -1201,7 +1259,7 @@ class Detector {
|
|||||||
/** [CTB][Moench] */
|
/** [CTB][Moench] */
|
||||||
void setRUNClock(int value_in_MHz, Positions pos = {});
|
void setRUNClock(int value_in_MHz, Positions pos = {});
|
||||||
|
|
||||||
/** [CTB][Moench] */
|
/** [CTB][Moench] in MHZ */
|
||||||
Result<int> getSYNCClock(Positions pos = {}) const;
|
Result<int> getSYNCClock(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [CTB][Moench] */
|
/** [CTB][Moench] */
|
||||||
@ -1232,7 +1290,10 @@ class Detector {
|
|||||||
|
|
||||||
/** [CTB][Moench] */
|
/** [CTB][Moench] */
|
||||||
void setTenGigaADCEnableMask(uint32_t mask, Positions pos = {});
|
void setTenGigaADCEnableMask(uint32_t mask, Positions pos = {});
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name CTB Specific */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* CTB Specific *
|
* CTB Specific *
|
||||||
@ -1316,7 +1377,10 @@ class Detector {
|
|||||||
|
|
||||||
/** [CTB] Default is enabled. */
|
/** [CTB] Default is enabled. */
|
||||||
void setLEDEnable(bool enable, Positions pos = {});
|
void setLEDEnable(bool enable, Positions pos = {});
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name Pattern */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Pattern *
|
* Pattern *
|
||||||
@ -1365,7 +1429,7 @@ class Detector {
|
|||||||
* levels */
|
* levels */
|
||||||
void setPatternLoopCycles(int level, int n, Positions pos = {});
|
void setPatternLoopCycles(int level, int n, Positions pos = {});
|
||||||
|
|
||||||
/* [CTB][Moench][Mythen3] */
|
/**[CTB][Moench][Mythen3] */
|
||||||
Result<int> getPatternWaitAddr(int level, Positions pos = {}) const;
|
Result<int> getPatternWaitAddr(int level, Positions pos = {}) const;
|
||||||
|
|
||||||
/** [CTB][Moench][Mythen3] Options: level 0-2 */
|
/** [CTB][Moench][Mythen3] Options: level 0-2 */
|
||||||
@ -1393,10 +1457,13 @@ class Detector {
|
|||||||
|
|
||||||
/** [Mythen3] */
|
/** [Mythen3] */
|
||||||
void startPattern(Positions pos = {});
|
void startPattern(Positions pos = {});
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name Moench specific */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Moench *
|
* Moench specific *
|
||||||
* *
|
* *
|
||||||
* ************************************************/
|
* ************************************************/
|
||||||
|
|
||||||
@ -1422,30 +1489,10 @@ class Detector {
|
|||||||
void setAdditionalJsonParameter(const std::string &key,
|
void setAdditionalJsonParameter(const std::string &key,
|
||||||
const std::string &value,
|
const std::string &value,
|
||||||
Positions pos = {});
|
Positions pos = {});
|
||||||
|
///@{
|
||||||
|
|
||||||
/** [Moench] TODO! How do we do this best??? Can be refactored to something
|
/** @name Advanced */
|
||||||
* else? Use a generic zmq message passing system...
|
///@{
|
||||||
* For now limiting to all detectors working the same*/
|
|
||||||
/** [Moench: -1 if not found or cannot convert to int] */
|
|
||||||
Result<int> getDetectorMinMaxEnergyThreshold(const bool isEmax,
|
|
||||||
Positions pos = {}) const;
|
|
||||||
|
|
||||||
/** [Moench] */
|
|
||||||
void setDetectorMinMaxEnergyThreshold(const bool isEmax, const int value,
|
|
||||||
Positions pos = {});
|
|
||||||
|
|
||||||
/** [Moench: -1 if unknown mode] */
|
|
||||||
Result<defs::frameModeType> getFrameMode(Positions pos = {}) const;
|
|
||||||
|
|
||||||
/** [Moench] */
|
|
||||||
void setFrameMode(defs::frameModeType value, Positions pos = {});
|
|
||||||
|
|
||||||
/** [Moench: -1 if unknown mode] */
|
|
||||||
Result<defs::detectorModeType> getDetectorMode(Positions pos = {}) const;
|
|
||||||
|
|
||||||
/** [Moench] */
|
|
||||||
void setDetectorMode(defs::detectorModeType value, Positions pos = {});
|
|
||||||
|
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Advanced *
|
* Advanced *
|
||||||
@ -1525,7 +1572,10 @@ class Detector {
|
|||||||
|
|
||||||
/** [CTB][Moench][Jungfrau] Advanced user Function! */
|
/** [CTB][Moench][Jungfrau] Advanced user Function! */
|
||||||
void setADCInvert(uint32_t value, Positions pos = {});
|
void setADCInvert(uint32_t value, Positions pos = {});
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/** @name Insignificant */
|
||||||
|
///@{
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Insignificant *
|
* Insignificant *
|
||||||
@ -1568,9 +1618,12 @@ class Detector {
|
|||||||
* [Gotthard2] only in continuous mode */
|
* [Gotthard2] only in continuous mode */
|
||||||
Result<ns> getMeasurementTime(Positions pos = {}) const;
|
Result<ns> getMeasurementTime(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** get user details from shared memory (hostname, type, PID, User, Date)
|
||||||
|
*/
|
||||||
std::string getUserDetails() const;
|
std::string getUserDetails() const;
|
||||||
|
|
||||||
Result<uint64_t> getRxCurrentFrameIndex(Positions pos = {}) const;
|
Result<uint64_t> getRxCurrentFrameIndex(Positions pos = {}) const;
|
||||||
|
///@{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<int> getPortNumbers(int start_port);
|
std::vector<int> getPortNumbers(int start_port);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -24,7 +24,7 @@
|
|||||||
if (action == slsDetectorDefs::HELP_ACTION) \
|
if (action == slsDetectorDefs::HELP_ACTION) \
|
||||||
os << HLPSTR << '\n'; \
|
os << HLPSTR << '\n'; \
|
||||||
else if (action == slsDetectorDefs::GET_ACTION) { \
|
else if (action == slsDetectorDefs::GET_ACTION) { \
|
||||||
auto t = det->GETFCN({det_id}); \
|
auto t = det->GETFCN(std::vector<int>{det_id}); \
|
||||||
if (args.empty()) { \
|
if (args.empty()) { \
|
||||||
os << OutString(t) << '\n'; \
|
os << OutString(t) << '\n'; \
|
||||||
} else if (args.size() == 1) { \
|
} else if (args.size() == 1) { \
|
||||||
@ -37,10 +37,10 @@
|
|||||||
std::string time_str(args[0]); \
|
std::string time_str(args[0]); \
|
||||||
std::string unit = RemoveUnit(time_str); \
|
std::string unit = RemoveUnit(time_str); \
|
||||||
auto t = StringTo<time::ns>(time_str, unit); \
|
auto t = StringTo<time::ns>(time_str, unit); \
|
||||||
det->SETFCN(t, {det_id}); \
|
det->SETFCN(t, std::vector<int>{det_id}); \
|
||||||
} else if (args.size() == 2) { \
|
} else if (args.size() == 2) { \
|
||||||
auto t = StringTo<time::ns>(args[0], args[1]); \
|
auto t = StringTo<time::ns>(args[0], args[1]); \
|
||||||
det->SETFCN(t, {det_id}); \
|
det->SETFCN(t, std::vector<int>{det_id}); \
|
||||||
} else { \
|
} else { \
|
||||||
WrongNumberOfParameters(2); \
|
WrongNumberOfParameters(2); \
|
||||||
} \
|
} \
|
||||||
@ -64,7 +64,7 @@
|
|||||||
if (action == slsDetectorDefs::HELP_ACTION) \
|
if (action == slsDetectorDefs::HELP_ACTION) \
|
||||||
os << HLPSTR << '\n'; \
|
os << HLPSTR << '\n'; \
|
||||||
else if (action == slsDetectorDefs::GET_ACTION) { \
|
else if (action == slsDetectorDefs::GET_ACTION) { \
|
||||||
auto t = det->GETFCN({det_id}); \
|
auto t = det->GETFCN(std::vector<int>{det_id}); \
|
||||||
if (args.empty()) { \
|
if (args.empty()) { \
|
||||||
os << OutString(t) << '\n'; \
|
os << OutString(t) << '\n'; \
|
||||||
} else if (args.size() == 1) { \
|
} else if (args.size() == 1) { \
|
||||||
@ -91,13 +91,13 @@
|
|||||||
if (!args.empty()) { \
|
if (!args.empty()) { \
|
||||||
WrongNumberOfParameters(0); \
|
WrongNumberOfParameters(0); \
|
||||||
} \
|
} \
|
||||||
auto t = det->GETFCN({det_id}); \
|
auto t = det->GETFCN(std::vector<int>{det_id}); \
|
||||||
os << OutString(t) << '\n'; \
|
os << OutString(t) << '\n'; \
|
||||||
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
if (args.size() != 1) { \
|
if (args.size() != 1) { \
|
||||||
WrongNumberOfParameters(1); \
|
WrongNumberOfParameters(1); \
|
||||||
} \
|
} \
|
||||||
det->SETFCN(args[0], {det_id}); \
|
det->SETFCN(args[0], std::vector<int>{det_id}); \
|
||||||
os << args.front() << '\n'; \
|
os << args.front() << '\n'; \
|
||||||
} else { \
|
} else { \
|
||||||
throw sls::RuntimeError("Unknown action"); \
|
throw sls::RuntimeError("Unknown action"); \
|
||||||
@ -116,14 +116,14 @@
|
|||||||
if (!args.empty()) { \
|
if (!args.empty()) { \
|
||||||
WrongNumberOfParameters(0); \
|
WrongNumberOfParameters(0); \
|
||||||
} \
|
} \
|
||||||
auto t = det->GETFCN({det_id}); \
|
auto t = det->GETFCN(std::vector<int>{det_id}); \
|
||||||
os << OutStringHex(t, 16) << '\n'; \
|
os << OutStringHex(t, 16) << '\n'; \
|
||||||
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
if (args.size() != 1) { \
|
if (args.size() != 1) { \
|
||||||
WrongNumberOfParameters(1); \
|
WrongNumberOfParameters(1); \
|
||||||
} \
|
} \
|
||||||
auto val = CONV(args[0]); \
|
auto val = CONV(args[0]); \
|
||||||
det->SETFCN(val, {det_id}); \
|
det->SETFCN(val, std::vector<int>{det_id}); \
|
||||||
os << ToStringHex(val, 16) << '\n'; \
|
os << ToStringHex(val, 16) << '\n'; \
|
||||||
} else { \
|
} else { \
|
||||||
throw sls::RuntimeError("Unknown action"); \
|
throw sls::RuntimeError("Unknown action"); \
|
||||||
@ -142,14 +142,14 @@
|
|||||||
if (!args.empty()) { \
|
if (!args.empty()) { \
|
||||||
WrongNumberOfParameters(0); \
|
WrongNumberOfParameters(0); \
|
||||||
} \
|
} \
|
||||||
auto t = det->GETFCN({det_id}); \
|
auto t = det->GETFCN(std::vector<int>{det_id}); \
|
||||||
os << OutStringHex(t) << '\n'; \
|
os << OutStringHex(t) << '\n'; \
|
||||||
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
if (args.size() != 1) { \
|
if (args.size() != 1) { \
|
||||||
WrongNumberOfParameters(1); \
|
WrongNumberOfParameters(1); \
|
||||||
} \
|
} \
|
||||||
auto val = CONV(args[0]); \
|
auto val = CONV(args[0]); \
|
||||||
det->SETFCN(val, {det_id}); \
|
det->SETFCN(val, std::vector<int>{det_id}); \
|
||||||
os << args.front() << '\n'; \
|
os << args.front() << '\n'; \
|
||||||
} else { \
|
} else { \
|
||||||
throw sls::RuntimeError("Unknown action"); \
|
throw sls::RuntimeError("Unknown action"); \
|
||||||
@ -158,7 +158,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** int or enum */
|
/** int or enum */
|
||||||
#define INTEGER_COMMAND(CMDNAME, GETFCN, SETFCN, CONV, HLPSTR) \
|
#define INTEGER_COMMAND_VEC_ID(CMDNAME, GETFCN, SETFCN, CONV, HLPSTR) \
|
||||||
std::string CMDNAME(const int action) { \
|
std::string CMDNAME(const int action) { \
|
||||||
std::ostringstream os; \
|
std::ostringstream os; \
|
||||||
os << cmd << ' '; \
|
os << cmd << ' '; \
|
||||||
@ -168,14 +168,66 @@
|
|||||||
if (!args.empty()) { \
|
if (!args.empty()) { \
|
||||||
WrongNumberOfParameters(0); \
|
WrongNumberOfParameters(0); \
|
||||||
} \
|
} \
|
||||||
auto t = det->GETFCN({det_id}); \
|
auto t = det->GETFCN(std::vector<int>{det_id}); \
|
||||||
os << OutString(t) << '\n'; \
|
os << OutString(t) << '\n'; \
|
||||||
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
if (args.size() != 1) { \
|
if (args.size() != 1) { \
|
||||||
WrongNumberOfParameters(1); \
|
WrongNumberOfParameters(1); \
|
||||||
} \
|
} \
|
||||||
auto val = CONV(args[0]); \
|
auto val = CONV(args[0]); \
|
||||||
det->SETFCN(val, {det_id}); \
|
det->SETFCN(val, std::vector<int>{det_id}); \
|
||||||
|
os << args.front() << '\n'; \
|
||||||
|
} else { \
|
||||||
|
throw sls::RuntimeError("Unknown action"); \
|
||||||
|
} \
|
||||||
|
return os.str(); \
|
||||||
|
}
|
||||||
|
|
||||||
|
/** int or enum */
|
||||||
|
#define INTEGER_COMMAND_VEC_ID_GET(CMDNAME, GETFCN, SETFCN, CONV, HLPSTR) \
|
||||||
|
std::string CMDNAME(const int action) { \
|
||||||
|
std::ostringstream os; \
|
||||||
|
os << cmd << ' '; \
|
||||||
|
if (action == slsDetectorDefs::HELP_ACTION) \
|
||||||
|
os << HLPSTR << '\n'; \
|
||||||
|
else if (action == slsDetectorDefs::GET_ACTION) { \
|
||||||
|
if (!args.empty()) { \
|
||||||
|
WrongNumberOfParameters(0); \
|
||||||
|
} \
|
||||||
|
auto t = det->GETFCN(std::vector<int>{det_id}); \
|
||||||
|
os << OutString(t) << '\n'; \
|
||||||
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
|
if (args.size() != 1) { \
|
||||||
|
WrongNumberOfParameters(1); \
|
||||||
|
} \
|
||||||
|
auto val = CONV(args[0]); \
|
||||||
|
det->SETFCN(val, det_id); \
|
||||||
|
os << args.front() << '\n'; \
|
||||||
|
} else { \
|
||||||
|
throw sls::RuntimeError("Unknown action"); \
|
||||||
|
} \
|
||||||
|
return os.str(); \
|
||||||
|
}
|
||||||
|
|
||||||
|
/** int or enum */
|
||||||
|
#define INTEGER_COMMAND_SINGLE_ID(CMDNAME, GETFCN, SETFCN, CONV, HLPSTR) \
|
||||||
|
std::string CMDNAME(const int action) { \
|
||||||
|
std::ostringstream os; \
|
||||||
|
os << cmd << ' '; \
|
||||||
|
if (action == slsDetectorDefs::HELP_ACTION) \
|
||||||
|
os << HLPSTR << '\n'; \
|
||||||
|
else if (action == slsDetectorDefs::GET_ACTION) { \
|
||||||
|
if (!args.empty()) { \
|
||||||
|
WrongNumberOfParameters(0); \
|
||||||
|
} \
|
||||||
|
auto t = det->GETFCN(det_id); \
|
||||||
|
os << OutString(t) << '\n'; \
|
||||||
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
|
if (args.size() != 1) { \
|
||||||
|
WrongNumberOfParameters(1); \
|
||||||
|
} \
|
||||||
|
auto val = CONV(args[0]); \
|
||||||
|
det->SETFCN(val, det_id); \
|
||||||
os << args.front() << '\n'; \
|
os << args.front() << '\n'; \
|
||||||
} else { \
|
} else { \
|
||||||
throw sls::RuntimeError("Unknown action"); \
|
throw sls::RuntimeError("Unknown action"); \
|
||||||
@ -223,14 +275,14 @@
|
|||||||
if (!args.empty()) { \
|
if (!args.empty()) { \
|
||||||
WrongNumberOfParameters(0); \
|
WrongNumberOfParameters(0); \
|
||||||
} \
|
} \
|
||||||
auto t = det->GETFCN(INDEX, {det_id}); \
|
auto t = det->GETFCN(INDEX, std::vector<int>{det_id}); \
|
||||||
os << OutString(t) << '\n'; \
|
os << OutString(t) << '\n'; \
|
||||||
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
if (args.size() != 1) { \
|
if (args.size() != 1) { \
|
||||||
WrongNumberOfParameters(1); \
|
WrongNumberOfParameters(1); \
|
||||||
} \
|
} \
|
||||||
auto val = CONV(args[0]); \
|
auto val = CONV(args[0]); \
|
||||||
det->SETFCN(INDEX, val, {det_id}); \
|
det->SETFCN(INDEX, val, std::vector<int>{det_id}); \
|
||||||
os << args.front() << '\n'; \
|
os << args.front() << '\n'; \
|
||||||
} else { \
|
} else { \
|
||||||
throw sls::RuntimeError("Unknown action"); \
|
throw sls::RuntimeError("Unknown action"); \
|
||||||
@ -249,14 +301,16 @@
|
|||||||
if (args.size() != 1) { \
|
if (args.size() != 1) { \
|
||||||
WrongNumberOfParameters(1); \
|
WrongNumberOfParameters(1); \
|
||||||
} \
|
} \
|
||||||
auto t = det->GETFCN(INDEX, StringTo<int>(args[0]), {det_id}); \
|
auto t = det->GETFCN(INDEX, StringTo<int>(args[0]), \
|
||||||
|
std::vector<int>{det_id}); \
|
||||||
os << args[0] << ' ' << OutStringHex(t) << '\n'; \
|
os << args[0] << ' ' << OutStringHex(t) << '\n'; \
|
||||||
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
if (args.size() != 2) { \
|
if (args.size() != 2) { \
|
||||||
WrongNumberOfParameters(2); \
|
WrongNumberOfParameters(2); \
|
||||||
} \
|
} \
|
||||||
auto val = CONV(args[1]); \
|
auto val = CONV(args[1]); \
|
||||||
det->SETFCN(INDEX, StringTo<int>(args[0]), val, {det_id}); \
|
det->SETFCN(INDEX, StringTo<int>(args[0]), val, \
|
||||||
|
std::vector<int>{det_id}); \
|
||||||
os << args[0] << ' ' << args[1] << '\n'; \
|
os << args[0] << ' ' << args[1] << '\n'; \
|
||||||
} else { \
|
} else { \
|
||||||
throw sls::RuntimeError("Unknown action"); \
|
throw sls::RuntimeError("Unknown action"); \
|
||||||
@ -282,7 +336,7 @@
|
|||||||
} else if (args.size() > 1) { \
|
} else if (args.size() > 1) { \
|
||||||
WrongNumberOfParameters(0); \
|
WrongNumberOfParameters(0); \
|
||||||
} \
|
} \
|
||||||
auto t = det->GETFCN(DAC_INDEX, mv, {det_id}); \
|
auto t = det->GETFCN(DAC_INDEX, mv, std::vector<int>{det_id}); \
|
||||||
os << OutString(t) << (!args.empty() ? " mV\n" : "\n"); \
|
os << OutString(t) << (!args.empty() ? " mV\n" : "\n"); \
|
||||||
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
bool mv = false; \
|
bool mv = false; \
|
||||||
@ -295,7 +349,8 @@
|
|||||||
} else if (args.size() > 2 || args.empty()) { \
|
} else if (args.size() > 2 || args.empty()) { \
|
||||||
WrongNumberOfParameters(1); \
|
WrongNumberOfParameters(1); \
|
||||||
} \
|
} \
|
||||||
det->SETFCN(DAC_INDEX, StringTo<int>(args[0]), mv, {det_id}); \
|
det->SETFCN(DAC_INDEX, StringTo<int>(args[0]), mv, \
|
||||||
|
std::vector<int>{det_id}); \
|
||||||
os << args.front() << (args.size() > 1 ? " mV\n" : "\n"); \
|
os << args.front() << (args.size() > 1 ? " mV\n" : "\n"); \
|
||||||
} else { \
|
} else { \
|
||||||
throw sls::RuntimeError("Unknown action"); \
|
throw sls::RuntimeError("Unknown action"); \
|
||||||
@ -340,7 +395,7 @@
|
|||||||
if (!args.empty()) { \
|
if (!args.empty()) { \
|
||||||
WrongNumberOfParameters(0); \
|
WrongNumberOfParameters(0); \
|
||||||
} \
|
} \
|
||||||
det->SETFCN({det_id}); \
|
det->SETFCN(std::vector<int>{det_id}); \
|
||||||
os << "successful\n"; \
|
os << "successful\n"; \
|
||||||
} else { \
|
} else { \
|
||||||
throw sls::RuntimeError("Unknown action"); \
|
throw sls::RuntimeError("Unknown action"); \
|
||||||
@ -385,7 +440,7 @@
|
|||||||
if (args.size() != 1) { \
|
if (args.size() != 1) { \
|
||||||
WrongNumberOfParameters(1); \
|
WrongNumberOfParameters(1); \
|
||||||
} \
|
} \
|
||||||
det->SETFCN(args[0], {det_id}); \
|
det->SETFCN(args[0], std::vector<int>{det_id}); \
|
||||||
os << args.front() << '\n'; \
|
os << args.front() << '\n'; \
|
||||||
} else { \
|
} else { \
|
||||||
throw sls::RuntimeError("Unknown action"); \
|
throw sls::RuntimeError("Unknown action"); \
|
||||||
@ -404,7 +459,7 @@
|
|||||||
if (!args.empty()) { \
|
if (!args.empty()) { \
|
||||||
WrongNumberOfParameters(0); \
|
WrongNumberOfParameters(0); \
|
||||||
} \
|
} \
|
||||||
auto t = det->GETFCN({det_id}); \
|
auto t = det->GETFCN(std::vector<int>{det_id}); \
|
||||||
os << OutString(t) << '\n'; \
|
os << OutString(t) << '\n'; \
|
||||||
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
throw sls::RuntimeError("Cannot put"); \
|
throw sls::RuntimeError("Cannot put"); \
|
||||||
@ -446,7 +501,7 @@
|
|||||||
if (!args.empty()) { \
|
if (!args.empty()) { \
|
||||||
WrongNumberOfParameters(0); \
|
WrongNumberOfParameters(0); \
|
||||||
} \
|
} \
|
||||||
auto t = det->GETFCN({det_id}); \
|
auto t = det->GETFCN(std::vector<int>{det_id}); \
|
||||||
os << OutStringHex(t) << '\n'; \
|
os << OutStringHex(t) << '\n'; \
|
||||||
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
throw sls::RuntimeError("Cannot put"); \
|
throw sls::RuntimeError("Cannot put"); \
|
||||||
@ -466,7 +521,7 @@
|
|||||||
if (!args.empty()) { \
|
if (!args.empty()) { \
|
||||||
WrongNumberOfParameters(0); \
|
WrongNumberOfParameters(0); \
|
||||||
} \
|
} \
|
||||||
auto t = det->GETFCN(VAL, {det_id}); \
|
auto t = det->GETFCN(VAL, std::vector<int>{det_id}); \
|
||||||
os << OutString(t) << APPEND << '\n'; \
|
os << OutString(t) << APPEND << '\n'; \
|
||||||
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
throw sls::RuntimeError("Cannot put"); \
|
throw sls::RuntimeError("Cannot put"); \
|
||||||
@ -602,7 +657,9 @@ class CmdProxy {
|
|||||||
{"r_framesperfile", "rx_framesperfile"},
|
{"r_framesperfile", "rx_framesperfile"},
|
||||||
|
|
||||||
/* ZMQ Streaming Parameters (Receiver<->Client) */
|
/* ZMQ Streaming Parameters (Receiver<->Client) */
|
||||||
{"r_readfreq", "rx_readfreq"},
|
{"r_readfreq", "rx_zmqfreq"},
|
||||||
|
{"rx_readfreq", "rx_zmqfreq"},
|
||||||
|
{"rx_datastream", "rx_zmqstream"},
|
||||||
|
|
||||||
/* Eiger Specific */
|
/* Eiger Specific */
|
||||||
{"trimdir", "settingspath"},
|
{"trimdir", "settingspath"},
|
||||||
@ -614,6 +671,7 @@ class CmdProxy {
|
|||||||
/* Gotthard2 Specific */
|
/* Gotthard2 Specific */
|
||||||
/* Mythen3 Specific */
|
/* Mythen3 Specific */
|
||||||
/* CTB Specific */
|
/* CTB Specific */
|
||||||
|
{"adc", "slowadc"},
|
||||||
{"flags", "romode"},
|
{"flags", "romode"},
|
||||||
{"i_a", "im_a"},
|
{"i_a", "im_a"},
|
||||||
{"i_b", "im_b"},
|
{"i_b", "im_b"},
|
||||||
@ -647,6 +705,7 @@ class CmdProxy {
|
|||||||
{"rx_version", &CmdProxy::rx_version},
|
{"rx_version", &CmdProxy::rx_version},
|
||||||
{"detectornumber", &CmdProxy::detectornumber},
|
{"detectornumber", &CmdProxy::detectornumber},
|
||||||
{"type", &CmdProxy::type},
|
{"type", &CmdProxy::type},
|
||||||
|
{"nmod", &CmdProxy::nmod},
|
||||||
{"detsize", &CmdProxy::DetectorSize},
|
{"detsize", &CmdProxy::DetectorSize},
|
||||||
{"settingslist", &CmdProxy::settingslist},
|
{"settingslist", &CmdProxy::settingslist},
|
||||||
{"settings", &CmdProxy::settings},
|
{"settings", &CmdProxy::settings},
|
||||||
@ -836,8 +895,8 @@ class CmdProxy {
|
|||||||
{"rx_framesperfile", &CmdProxy::rx_framesperfile},
|
{"rx_framesperfile", &CmdProxy::rx_framesperfile},
|
||||||
|
|
||||||
/* ZMQ Streaming Parameters (Receiver<->Client) */
|
/* ZMQ Streaming Parameters (Receiver<->Client) */
|
||||||
{"rx_datastream", &CmdProxy::rx_datastream},
|
{"rx_zmqstream", &CmdProxy::rx_zmqstream},
|
||||||
{"rx_readfreq", &CmdProxy::rx_readfreq},
|
{"rx_zmqfreq", &CmdProxy::rx_zmqfreq},
|
||||||
{"rx_zmqstartfnum", &CmdProxy::rx_zmqstartfnum},
|
{"rx_zmqstartfnum", &CmdProxy::rx_zmqstartfnum},
|
||||||
{"rx_zmqport", &CmdProxy::rx_zmqport},
|
{"rx_zmqport", &CmdProxy::rx_zmqport},
|
||||||
{"zmqport", &CmdProxy::zmqport},
|
{"zmqport", &CmdProxy::zmqport},
|
||||||
@ -938,7 +997,7 @@ class CmdProxy {
|
|||||||
{"im_c", &CmdProxy::im_c},
|
{"im_c", &CmdProxy::im_c},
|
||||||
{"im_d", &CmdProxy::im_d},
|
{"im_d", &CmdProxy::im_d},
|
||||||
{"im_io", &CmdProxy::im_io},
|
{"im_io", &CmdProxy::im_io},
|
||||||
{"adc", &CmdProxy::SlowAdc},
|
{"slowadc", &CmdProxy::SlowAdc},
|
||||||
{"extsampling", &CmdProxy::extsampling},
|
{"extsampling", &CmdProxy::extsampling},
|
||||||
{"extsamplingsrc", &CmdProxy::extsamplingsrc},
|
{"extsamplingsrc", &CmdProxy::extsamplingsrc},
|
||||||
{"rx_dbitlist", &CmdProxy::ReceiverDbitList},
|
{"rx_dbitlist", &CmdProxy::ReceiverDbitList},
|
||||||
@ -971,10 +1030,6 @@ class CmdProxy {
|
|||||||
/* Moench */
|
/* Moench */
|
||||||
{"rx_jsonaddheader", &CmdProxy::AdditionalJsonHeader},
|
{"rx_jsonaddheader", &CmdProxy::AdditionalJsonHeader},
|
||||||
{"rx_jsonpara", &CmdProxy::JsonParameter},
|
{"rx_jsonpara", &CmdProxy::JsonParameter},
|
||||||
{"emin", &CmdProxy::MinMaxEnergyThreshold},
|
|
||||||
{"emax", &CmdProxy::MinMaxEnergyThreshold},
|
|
||||||
{"framemode", &CmdProxy::framemode},
|
|
||||||
{"detectormode", &CmdProxy::detectormode},
|
|
||||||
|
|
||||||
/* Advanced */
|
/* Advanced */
|
||||||
{"programfpga", &CmdProxy::ProgramFpga},
|
{"programfpga", &CmdProxy::ProgramFpga},
|
||||||
@ -1091,7 +1146,6 @@ class CmdProxy {
|
|||||||
/* Moench */
|
/* Moench */
|
||||||
std::string AdditionalJsonHeader(int action);
|
std::string AdditionalJsonHeader(int action);
|
||||||
std::string JsonParameter(int action);
|
std::string JsonParameter(int action);
|
||||||
std::string MinMaxEnergyThreshold(int action);
|
|
||||||
/* Advanced */
|
/* Advanced */
|
||||||
std::string ProgramFpga(int action);
|
std::string ProgramFpga(int action);
|
||||||
std::string CopyDetectorServer(int action);
|
std::string CopyDetectorServer(int action);
|
||||||
@ -1126,12 +1180,16 @@ class CmdProxy {
|
|||||||
"\n\tReceiver version in format [0xYYMMDD].");
|
"\n\tReceiver version in format [0xYYMMDD].");
|
||||||
|
|
||||||
GET_COMMAND(type, getDetectorType,
|
GET_COMMAND(type, getDetectorType,
|
||||||
"\n\tSerial number or MAC of detector (hex).");
|
"\n\tReturns detector type. Can be Eiger, Jungfrau, Gotthard, "
|
||||||
|
"Moench, Mythen3, Gotthard2, ChipTestBoard");
|
||||||
|
|
||||||
|
GET_COMMAND_NOID(nmod, size, "\n\tNumber of modules in shared memory.");
|
||||||
|
|
||||||
GET_COMMAND_NOID(settingslist, getSettingsList,
|
GET_COMMAND_NOID(settingslist, getSettingsList,
|
||||||
"\n\tList of settings implemented for this detector.");
|
"\n\tList of settings implemented for this detector.");
|
||||||
|
|
||||||
INTEGER_COMMAND(settings, getSettings, setSettings,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
settings, getSettings, setSettings,
|
||||||
sls::StringTo<slsDetectorDefs::detectorSettings>,
|
sls::StringTo<slsDetectorDefs::detectorSettings>,
|
||||||
"[standard, fast, highgain, dynamicgain, lowgain, "
|
"[standard, fast, highgain, dynamicgain, lowgain, "
|
||||||
"mediumgain, veryhighgain, dynamichg0, "
|
"mediumgain, veryhighgain, dynamichg0, "
|
||||||
@ -1154,7 +1212,8 @@ class CmdProxy {
|
|||||||
"[fname]\n\t[Eiger][Mythen3] Loads the trimbit file to detector. If no "
|
"[fname]\n\t[Eiger][Mythen3] Loads the trimbit file to detector. If no "
|
||||||
"extension specified, serial number of each module is attached.");
|
"extension specified, serial number of each module is attached.");
|
||||||
|
|
||||||
INTEGER_COMMAND(trimval, getAllTrimbits, setAllTrimbits, StringTo<int>,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
trimval, getAllTrimbits, setAllTrimbits, StringTo<int>,
|
||||||
"[n_trimval]\n\t[Eiger][Mythen3] All trimbits set to this "
|
"[n_trimval]\n\t[Eiger][Mythen3] All trimbits set to this "
|
||||||
"value. Returns -1 if all trimbits are different values.");
|
"value. Returns -1 if all trimbits are different values.");
|
||||||
|
|
||||||
@ -1169,8 +1228,8 @@ class CmdProxy {
|
|||||||
|
|
||||||
INTEGER_COMMAND_NOID(triggers, getNumberOfTriggers, setNumberOfTriggers,
|
INTEGER_COMMAND_NOID(triggers, getNumberOfTriggers, setNumberOfTriggers,
|
||||||
StringTo<int64_t>,
|
StringTo<int64_t>,
|
||||||
"[n_triggers]\n\tNumber of triggers per aquire. Use "
|
"[n_triggers]\n\tNumber of triggers per aquire. Set "
|
||||||
"timing command to set timing mode.");
|
"timing mode to use triggers.");
|
||||||
|
|
||||||
TIME_COMMAND(
|
TIME_COMMAND(
|
||||||
period, getPeriod, setPeriod,
|
period, getPeriod, setPeriod,
|
||||||
@ -1204,11 +1263,12 @@ class CmdProxy {
|
|||||||
GET_COMMAND_NOID(drlist, getDynamicRangeList,
|
GET_COMMAND_NOID(drlist, getDynamicRangeList,
|
||||||
"\n\tGets the list of dynamic ranges for this detector.");
|
"\n\tGets the list of dynamic ranges for this detector.");
|
||||||
|
|
||||||
INTEGER_COMMAND(timing, getTimingMode, setTimingMode,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
timing, getTimingMode, setTimingMode,
|
||||||
sls::StringTo<slsDetectorDefs::timingMode>,
|
sls::StringTo<slsDetectorDefs::timingMode>,
|
||||||
"[auto|trigger|gating|burst_trigger]\n\tTiming Mode of "
|
"[auto|trigger|gating|burst_trigger]\n\tTiming Mode of "
|
||||||
"detector.\n\t[Jungfrau][Gotthard][Mythen3][Ctb][Moench] "
|
"detector.\n\t[Jungfrau][Gotthard][Ctb][Moench][Gotthard2] "
|
||||||
"[auto|trigger]\n\t[Gotthard2] "
|
"[auto|trigger]\n\t[Mythen3] "
|
||||||
"[auto|trigger|gating|trigger_gating]\n\t[Eiger] "
|
"[auto|trigger|gating|trigger_gating]\n\t[Eiger] "
|
||||||
"[auto|trigger|gating|burst_trigger]");
|
"[auto|trigger|gating|burst_trigger]");
|
||||||
|
|
||||||
@ -1223,13 +1283,15 @@ class CmdProxy {
|
|||||||
"\n\t[CTB][Jungfrau] Absolute maximum Phase shift of of the "
|
"\n\t[CTB][Jungfrau] Absolute maximum Phase shift of of the "
|
||||||
"clock to latch digital bits.");
|
"clock to latch digital bits.");
|
||||||
|
|
||||||
INTEGER_COMMAND(highvoltage, getHighVoltage, setHighVoltage, StringTo<int>,
|
INTEGER_COMMAND_VEC_ID(highvoltage, getHighVoltage, setHighVoltage,
|
||||||
|
StringTo<int>,
|
||||||
"[n_value]\n\tHigh voltage to the sensor in Voltage."
|
"[n_value]\n\tHigh voltage to the sensor in Voltage."
|
||||||
"\n\t[Gotthard] [0|90|110|120|150|180|200]"
|
"\n\t[Gotthard] [0|90|110|120|150|180|200]"
|
||||||
"\n\t[Eiger][Mythen3][Gotthard2] 0-200"
|
"\n\t[Eiger][Mythen3][Gotthard2] 0-200"
|
||||||
"\n\t[Jungfrau][Ctb][Moench] [0|60-200]");
|
"\n\t[Jungfrau][Ctb][Moench] [0|60-200]");
|
||||||
|
|
||||||
INTEGER_COMMAND(powerchip, getPowerChip, setPowerChip, StringTo<int>,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
powerchip, getPowerChip, setPowerChip, StringTo<int>,
|
||||||
"[0, 1]\n\t[Jungfrau][Mythen3][Gotthard2][Moench] Power "
|
"[0, 1]\n\t[Jungfrau][Mythen3][Gotthard2][Moench] Power "
|
||||||
"the chip. Default 0."
|
"the chip. Default 0."
|
||||||
"\n\t[Jungfrau] Get will return power status."
|
"\n\t[Jungfrau] Get will return power status."
|
||||||
@ -1240,14 +1302,15 @@ class CmdProxy {
|
|||||||
"\n\t[Gotthard2] If module not connected or wrong module, "
|
"\n\t[Gotthard2] If module not connected or wrong module, "
|
||||||
"1 will fail. By default, powered on at server start up.");
|
"1 will fail. By default, powered on at server start up.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
imagetest, getImageTestMode, setImageTestMode, StringTo<int>,
|
imagetest, getImageTestMode, setImageTestMode, StringTo<int>,
|
||||||
"[0, 1]\n\t[Gotthard] 1 adds channel intensity with precalculated "
|
"[0, 1]\n\t[Gotthard] 1 adds channel intensity with precalculated "
|
||||||
"values when taking an acquisition. Default is 0."
|
"values when taking an acquisition. Default is 0."
|
||||||
"\n\t[Eiger][Jungfrau] Only for Virtual servers. If 0, each pixel "
|
"\n\t[Eiger][Jungfrau] Only for Virtual servers. If 0, each pixel "
|
||||||
"intensity incremented by 1. If 1, all pixels almost saturated.");
|
"intensity incremented by 1. If 1, all pixels almost saturated.");
|
||||||
|
|
||||||
INTEGER_COMMAND(parallel, getParallelMode, setParallelMode, StringTo<int>,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
parallel, getParallelMode, setParallelMode, StringTo<int>,
|
||||||
"[0, 1]\n\t[Eiger][Mythen3] Enable or disable parallel "
|
"[0, 1]\n\t[Eiger][Mythen3] Enable or disable parallel "
|
||||||
"mode.\n\t[Mythen3] If exptime is too short, the "
|
"mode.\n\t[Mythen3] If exptime is too short, the "
|
||||||
"acquisition will return ERROR status and take fewer "
|
"acquisition will return ERROR status and take fewer "
|
||||||
@ -1287,11 +1350,13 @@ class CmdProxy {
|
|||||||
|
|
||||||
GET_IND_COMMAND(
|
GET_IND_COMMAND(
|
||||||
temp_fpgafl, getTemperature, slsDetectorDefs::TEMPERATURE_FPGA2, " °C",
|
temp_fpgafl, getTemperature, slsDetectorDefs::TEMPERATURE_FPGA2, " °C",
|
||||||
"[n_value]\n\t[Eiger]Temperature of the left front end board fpga");
|
"[n_value]\n\t[Eiger]Temperature of the left front end board fpga. "
|
||||||
|
"Cannot call this while blocking acquire is going on.");
|
||||||
|
|
||||||
GET_IND_COMMAND(
|
GET_IND_COMMAND(
|
||||||
temp_fpgafr, getTemperature, slsDetectorDefs::TEMPERATURE_FPGA3, " °C",
|
temp_fpgafr, getTemperature, slsDetectorDefs::TEMPERATURE_FPGA3, " °C",
|
||||||
"[n_value]\n\t[Eiger]Temperature of the left front end board fpga");
|
"[n_value]\n\t[Eiger]Temperature of the left front end board fpga. "
|
||||||
|
"Cannot call this while blocking acquire is going on.");
|
||||||
|
|
||||||
GET_IND_COMMAND(temp_slowadc, getTemperature,
|
GET_IND_COMMAND(temp_slowadc, getTemperature,
|
||||||
slsDetectorDefs::SLOW_ADC_TEMP, " °C",
|
slsDetectorDefs::SLOW_ADC_TEMP, " °C",
|
||||||
@ -1299,9 +1364,12 @@ class CmdProxy {
|
|||||||
|
|
||||||
/* dacs */
|
/* dacs */
|
||||||
|
|
||||||
DAC_COMMAND(vthreshold, getDAC, setDAC, defs::VTHRESHOLD,
|
DAC_COMMAND(
|
||||||
|
vthreshold, getDAC, setDAC, defs::VTHRESHOLD,
|
||||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger][Mythen3] "
|
"[dac or mV value][(optional unit) mV] \n\t[Eiger][Mythen3] "
|
||||||
"Detector threshold voltage for single photon counters.");
|
"Detector threshold voltage for single photon counters.\n\t[Eiger] "
|
||||||
|
"Sets vcmp_ll, vcmp_lr, vcmp_rl, vcmp_rr and vcp to the same value. "
|
||||||
|
"\n\t[Mythen3] Sets vth1, vth2 and vth3 to the same value.");
|
||||||
|
|
||||||
DAC_COMMAND(vsvp, getDAC, setDAC, defs::VSVP,
|
DAC_COMMAND(vsvp, getDAC, setDAC, defs::VSVP,
|
||||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||||
@ -1630,15 +1698,16 @@ class CmdProxy {
|
|||||||
GET_COMMAND(rx_missingpackets, getNumMissingPackets,
|
GET_COMMAND(rx_missingpackets, getNumMissingPackets,
|
||||||
"\n\tNumber of missing packets for each port in receiver.");
|
"\n\tNumber of missing packets for each port in receiver.");
|
||||||
|
|
||||||
INTEGER_COMMAND(startingfnum, getStartingFrameNumber,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
setStartingFrameNumber, StringTo<uint64_t>,
|
startingfnum, getStartingFrameNumber, setStartingFrameNumber,
|
||||||
|
StringTo<uint64_t>,
|
||||||
"[n_value]\n\t[Eiger][Jungfrau] Starting frame number for "
|
"[n_value]\n\t[Eiger][Jungfrau] Starting frame number for "
|
||||||
"next acquisition. Stopping acquiistion might result in "
|
"next acquisition. Stopping acquiistion might result in "
|
||||||
"different frame numbers for different modules.");
|
"different frame numbers for different modules.");
|
||||||
|
|
||||||
EXECUTE_SET_COMMAND(
|
EXECUTE_SET_COMMAND(
|
||||||
trigger, sendSoftwareTrigger,
|
trigger, sendSoftwareTrigger,
|
||||||
"\n\t[Eiger] Sends software trigger signal to detector.");
|
"\n\t[Eiger][Mythen3] Sends software trigger signal to detector.");
|
||||||
|
|
||||||
GET_COMMAND(scanerrmsg, getScanErrorMessage,
|
GET_COMMAND(scanerrmsg, getScanErrorMessage,
|
||||||
"\n\tGets Scan error message if scan ended in error for non "
|
"\n\tGets Scan error message if scan ended in error for non "
|
||||||
@ -1646,7 +1715,7 @@ class CmdProxy {
|
|||||||
|
|
||||||
/* Network Configuration (Detector<->Receiver) */
|
/* Network Configuration (Detector<->Receiver) */
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
numinterfaces, getNumberofUDPInterfaces, setNumberofUDPInterfaces,
|
numinterfaces, getNumberofUDPInterfaces, setNumberofUDPInterfaces,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[1, 2]\n\t[Jungfrau][Gotthard2] Number of udp interfaces to stream "
|
"[1, 2]\n\t[Jungfrau][Gotthard2] Number of udp interfaces to stream "
|
||||||
@ -1657,52 +1726,66 @@ class CmdProxy {
|
|||||||
"veto information via 10Gbps for debugging. By default, if veto "
|
"veto information via 10Gbps for debugging. By default, if veto "
|
||||||
"enabled, it is sent via 2.5 gbps interface.");
|
"enabled, it is sent via 2.5 gbps interface.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
selinterface, getSelectedUDPInterface, selectUDPInterface,
|
selinterface, getSelectedUDPInterface, selectUDPInterface,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[0, 1]\n\t[Jungfrau] The udp interface to stream data from detector. "
|
"[0, 1]\n\t[Jungfrau] The udp interface to stream data from detector. "
|
||||||
"Effective only when number of interfaces is 1. Default: 0 (outer)");
|
"Effective only when number of interfaces is 1. Default: 0 (outer)");
|
||||||
|
|
||||||
INTEGER_COMMAND(udp_srcip, getSourceUDPIP, setSourceUDPIP, IpAddr,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
udp_srcip, getSourceUDPIP, setSourceUDPIP, IpAddr,
|
||||||
"[x.x.x.x]\n\tIp address of the detector (source) udp "
|
"[x.x.x.x]\n\tIp address of the detector (source) udp "
|
||||||
"interface. Must be same subnet as destination udp ip.");
|
"interface. Must be same subnet as destination udp "
|
||||||
|
"ip.\n\t[Eiger] Set only for 10G. For 1G, detector will "
|
||||||
|
"replace with its own DHCP IP address.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
udp_srcip2, getSourceUDPIP2, setSourceUDPIP2, IpAddr,
|
udp_srcip2, getSourceUDPIP2, setSourceUDPIP2, IpAddr,
|
||||||
"[x.x.x.x]\n\t[Jungfrau] Ip address of the bottom half of detector "
|
"[x.x.x.x]\n\t[Jungfrau][Gotthard2] Ip address of the detector "
|
||||||
"(source) udp interface. Must be same subnet as destination udp ip2.");
|
"(source) udp interface 2. Must be same subnet as destination udp "
|
||||||
|
"ip2.\n\t [Jungfrau] bottom half \n\t [Gotthard2] veto debugging.");
|
||||||
|
|
||||||
INTEGER_COMMAND(udp_srcmac, getSourceUDPMAC, setSourceUDPMAC, MacAddr,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
udp_srcmac, getSourceUDPMAC, setSourceUDPMAC, MacAddr,
|
||||||
"[x:x:x:x:x:x]\n\tMac address of the detector (source) udp "
|
"[x:x:x:x:x:x]\n\tMac address of the detector (source) udp "
|
||||||
"interface. ");
|
"interface. \n\t[Eiger] Do not set as detector will replace with its "
|
||||||
|
"own DHCP Mac (1G) or DHCP Mac + 1 (10G).");
|
||||||
|
|
||||||
INTEGER_COMMAND(udp_srcmac2, getSourceUDPMAC2, setSourceUDPMAC2, MacAddr,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
udp_srcmac2, getSourceUDPMAC2, setSourceUDPMAC2, MacAddr,
|
||||||
"[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the bottom "
|
"[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the bottom "
|
||||||
"half of detector (source) udp interface. ");
|
"half of detector (source) udp interface. ");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
udp_dstmac, getDestinationUDPMAC, setDestinationUDPMAC, MacAddr,
|
udp_dstmac, getDestinationUDPMAC, setDestinationUDPMAC, MacAddr,
|
||||||
"[x:x:x:x:x:x]\n\tMac address of the receiver (destination) udp "
|
"[x:x:x:x:x:x]\n\tMac address of the receiver (destination) udp "
|
||||||
"interface. Can be unused as udp_dstip retrieves it.");
|
"interface. Not mandatory to set as udp_dstip retrieves it from "
|
||||||
|
"slsReceiver process, but must be set if you use a custom receiver "
|
||||||
|
"(not slsReceiver).");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
udp_dstmac2, getDestinationUDPMAC2, setDestinationUDPMAC2, MacAddr,
|
udp_dstmac2, getDestinationUDPMAC2, setDestinationUDPMAC2, MacAddr,
|
||||||
"[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the receiver (destination) "
|
"[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the receiver (destination) "
|
||||||
"udp interface where the second half of detector data is sent to. Can "
|
"udp interface 2. Not mandatory to set as udp_dstip2 retrieves it from "
|
||||||
"be unused as udp_dstip2 retrieves it.");
|
"slsReceiver process but must be set if you use a custom receiver (not "
|
||||||
|
"slsReceiver). \n\t [Jungfrau] bottom half \n\t [Gotthard2] veto "
|
||||||
|
"debugging.");
|
||||||
|
|
||||||
INTEGER_COMMAND(udp_dstport, getDestinationUDPPort, setDestinationUDPPort,
|
INTEGER_COMMAND_VEC_ID_GET(
|
||||||
|
udp_dstport, getDestinationUDPPort, setDestinationUDPPort,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[n]\n\tPort number of the receiver (destination) udp "
|
"[n]\n\tPort number of the receiver (destination) udp "
|
||||||
"interface. Default is 50001.");
|
"interface. Default is 50001. \n\tIf multi command, ports for each "
|
||||||
|
"module is calculated (incremented by 1 if no 2nd interface)");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID_GET(
|
||||||
udp_dstport2, getDestinationUDPPort2, setDestinationUDPPort2,
|
udp_dstport2, getDestinationUDPPort2, setDestinationUDPPort2,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[n]\n\tDefault is 50002.\n\t[Jungfrau] Port number of the receiver "
|
"[n]\n\t[Jungfrau][Eiger][Gotthard2] Port number of the "
|
||||||
"(destination) udp interface where the second half of detector data is "
|
"receiver (destination) udp interface 2. Default is 50002. "
|
||||||
"sent to. \n\t[Eiger] Port number of the reciever (desintation) udp "
|
"\n\tIf multi command, ports for each module is calculated "
|
||||||
"interface where the right half of the detector data is sent to.");
|
"(incremented by 2) \n\t[Jungfrau] bottom half \n\t[Eiger] "
|
||||||
|
"right half \n\t[Gotthard2] veto debugging");
|
||||||
|
|
||||||
EXECUTE_SET_COMMAND(
|
EXECUTE_SET_COMMAND(
|
||||||
udp_reconfigure, reconfigureUDPDestination,
|
udp_reconfigure, reconfigureUDPDestination,
|
||||||
@ -1719,14 +1802,15 @@ class CmdProxy {
|
|||||||
GET_COMMAND(rx_printconfig, printRxConfiguration,
|
GET_COMMAND(rx_printconfig, printRxConfiguration,
|
||||||
"\n\tPrints the receiver configuration.");
|
"\n\tPrints the receiver configuration.");
|
||||||
|
|
||||||
INTEGER_COMMAND(tengiga, getTenGiga, setTenGiga, StringTo<int>,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
tengiga, getTenGiga, setTenGiga, StringTo<int>,
|
||||||
"[0, 1]\n\t[Eiger][Ctb][Moench][Mythen3] 10GbE Enable.");
|
"[0, 1]\n\t[Eiger][Ctb][Moench][Mythen3] 10GbE Enable.");
|
||||||
|
|
||||||
INTEGER_COMMAND(flowcontrol10g, getTenGigaFlowControl,
|
INTEGER_COMMAND_VEC_ID(flowcontrol10g, getTenGigaFlowControl,
|
||||||
setTenGigaFlowControl, StringTo<int>,
|
setTenGigaFlowControl, StringTo<int>,
|
||||||
"[0, 1]\n\t[Eiger][Jungfrau] 10GbE Flow Control.");
|
"[0, 1]\n\t[Eiger][Jungfrau] 10GbE Flow Control.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
txndelay_frame, getTransmissionDelayFrame, setTransmissionDelayFrame,
|
txndelay_frame, getTransmissionDelayFrame, setTransmissionDelayFrame,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[n_delay]\n\t[Eiger][Jungfrau][Mythen3] Transmission delay of each "
|
"[n_delay]\n\t[Eiger][Jungfrau][Mythen3] Transmission delay of each "
|
||||||
@ -1737,14 +1821,14 @@ class CmdProxy {
|
|||||||
"50000.\n\t[Mythen3] [0-16777215] Each value represents 8 ns (125 MHz "
|
"50000.\n\t[Mythen3] [0-16777215] Each value represents 8 ns (125 MHz "
|
||||||
"clock), max is 134 ms.");
|
"clock), max is 134 ms.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
txndelay_left, getTransmissionDelayLeft, setTransmissionDelayLeft,
|
txndelay_left, getTransmissionDelayLeft, setTransmissionDelayLeft,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[n_delay]\n\t[Eiger] Transmission delay of first packet in an image "
|
"[n_delay]\n\t[Eiger] Transmission delay of first packet in an image "
|
||||||
"being streamed out of the module's left UDP port. Each value "
|
"being streamed out of the module's left UDP port. Each value "
|
||||||
"represents 10ns. Typical value is 50000.");
|
"represents 10ns. Typical value is 50000.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
txndelay_right, getTransmissionDelayRight, setTransmissionDelayRight,
|
txndelay_right, getTransmissionDelayRight, setTransmissionDelayRight,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[n_delay]\n\t[Eiger] Transmission delay of first packet in an image "
|
"[n_delay]\n\t[Eiger] Transmission delay of first packet in an image "
|
||||||
@ -1753,22 +1837,23 @@ class CmdProxy {
|
|||||||
|
|
||||||
/* Receiver Config */
|
/* Receiver Config */
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID_GET(
|
||||||
rx_tcpport, getRxPort, setRxPort, StringTo<int>,
|
rx_tcpport, getRxPort, setRxPort, StringTo<int>,
|
||||||
"[port]\n\tTCP port for client-receiver communication. Default is "
|
"[port]\n\tTCP port for client-receiver communication. Default is "
|
||||||
"1954. Must be different if multiple receivers on same pc. Must be "
|
"1954. Must be different if multiple receivers on same pc. Must be "
|
||||||
"first command to set a receiver parameter. Multi command will "
|
"first command to set a receiver parameter. Multi command will "
|
||||||
"automatically increment for individual modules.");
|
"automatically increment for individual modules.");
|
||||||
|
|
||||||
INTEGER_COMMAND(rx_fifodepth, getRxFifoDepth, setRxFifoDepth, StringTo<int>,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
rx_fifodepth, getRxFifoDepth, setRxFifoDepth, StringTo<int>,
|
||||||
"[n_frames]\n\tSet the number of frames in the receiver "
|
"[n_frames]\n\tSet the number of frames in the receiver "
|
||||||
"fifo depth (buffer between listener and writer threads).");
|
"fifo depth (buffer between listener and writer threads).");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
rx_silent, getRxSilentMode, setRxSilentMode, StringTo<int>,
|
rx_silent, getRxSilentMode, setRxSilentMode, StringTo<int>,
|
||||||
"[0, 1]\n\tSwitch on or off receiver text output during acquisition.");
|
"[0, 1]\n\tSwitch on or off receiver text output during acquisition.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
rx_discardpolicy, getRxFrameDiscardPolicy, setRxFrameDiscardPolicy,
|
rx_discardpolicy, getRxFrameDiscardPolicy, setRxFrameDiscardPolicy,
|
||||||
sls::StringTo<slsDetectorDefs::frameDiscardPolicy>,
|
sls::StringTo<slsDetectorDefs::frameDiscardPolicy>,
|
||||||
"[nodiscard (default)|discardempty|discardpartial(fastest)]\n\tFrame "
|
"[nodiscard (default)|discardempty|discardpartial(fastest)]\n\tFrame "
|
||||||
@ -1776,12 +1861,12 @@ class CmdProxy {
|
|||||||
"discardempty discards empty frames, discardpartial discards partial "
|
"discardempty discards empty frames, discardpartial discards partial "
|
||||||
"frames.");
|
"frames.");
|
||||||
|
|
||||||
INTEGER_COMMAND(rx_padding, getPartialFramesPadding,
|
INTEGER_COMMAND_VEC_ID(rx_padding, getPartialFramesPadding,
|
||||||
setPartialFramesPadding, StringTo<int>,
|
setPartialFramesPadding, StringTo<int>,
|
||||||
"[0, 1]\n\tPartial frames padding enable in the "
|
"[0, 1]\n\tPartial frames padding enable in the "
|
||||||
"receiver. Default: enabled. Disabling is fastest.");
|
"receiver. Default: enabled. Disabling is fastest.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
rx_udpsocksize, getRxUDPSocketBufferSize, setRxUDPSocketBufferSize,
|
rx_udpsocksize, getRxUDPSocketBufferSize, setRxUDPSocketBufferSize,
|
||||||
StringTo<int64_t>,
|
StringTo<int64_t>,
|
||||||
"[n_size]\n\tUDP socket buffer size in receiver. Tune rmem_default and "
|
"[n_size]\n\tUDP socket buffer size in receiver. Tune rmem_default and "
|
||||||
@ -1791,7 +1876,8 @@ class CmdProxy {
|
|||||||
"\n\tActual udp socket buffer size. Double the size of "
|
"\n\tActual udp socket buffer size. Double the size of "
|
||||||
"rx_udpsocksize due to kernel bookkeeping.");
|
"rx_udpsocksize due to kernel bookkeeping.");
|
||||||
|
|
||||||
INTEGER_COMMAND(rx_lock, getRxLock, setRxLock, StringTo<int>,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
rx_lock, getRxLock, setRxLock, StringTo<int>,
|
||||||
"[0, 1]\n\tLock receiver to one client IP, 1 locks, 0 "
|
"[0, 1]\n\tLock receiver to one client IP, 1 locks, 0 "
|
||||||
"unlocks. Default is unlocked. 1: locks");
|
"unlocks. Default is unlocked. 1: locks");
|
||||||
|
|
||||||
@ -1809,7 +1895,7 @@ class CmdProxy {
|
|||||||
|
|
||||||
/* File */
|
/* File */
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
fformat, getFileFormat, setFileFormat,
|
fformat, getFileFormat, setFileFormat,
|
||||||
sls::StringTo<slsDetectorDefs::fileFormat>,
|
sls::StringTo<slsDetectorDefs::fileFormat>,
|
||||||
"[binary|hdf5]\n\tFile format of data file. For HDF5, package must be "
|
"[binary|hdf5]\n\tFile format of data file. For HDF5, package must be "
|
||||||
@ -1825,11 +1911,11 @@ class CmdProxy {
|
|||||||
"is run. File name: [file name prefix]_d[detector "
|
"is run. File name: [file name prefix]_d[detector "
|
||||||
"index]_f[sub file index]_[acquisition/file index].raw.");
|
"index]_f[sub file index]_[acquisition/file index].raw.");
|
||||||
|
|
||||||
INTEGER_COMMAND(findex, getAcquisitionIndex, setAcquisitionIndex,
|
INTEGER_COMMAND_VEC_ID(findex, getAcquisitionIndex, setAcquisitionIndex,
|
||||||
StringTo<int64_t>,
|
StringTo<int64_t>,
|
||||||
"[n_value]\n\tFile or Acquisition index.");
|
"[n_value]\n\tFile or Acquisition index.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
fwrite, getFileWrite, setFileWrite, StringTo<int>,
|
fwrite, getFileWrite, setFileWrite, StringTo<int>,
|
||||||
"[0, 1]\n\tEnable or disable receiver file write. Default is 1.");
|
"[0, 1]\n\tEnable or disable receiver file write. Default is 1.");
|
||||||
|
|
||||||
@ -1837,19 +1923,19 @@ class CmdProxy {
|
|||||||
fmaster, getMasterFileWrite, setMasterFileWrite, StringTo<int>,
|
fmaster, getMasterFileWrite, setMasterFileWrite, StringTo<int>,
|
||||||
"[0, 1]\n\tEnable or disable receiver master file. Default is 1.");
|
"[0, 1]\n\tEnable or disable receiver master file. Default is 1.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
foverwrite, getFileOverWrite, setFileOverWrite, StringTo<int>,
|
foverwrite, getFileOverWrite, setFileOverWrite, StringTo<int>,
|
||||||
"[0, 1]\n\tEnable or disable file overwriting. Default is 1.");
|
"[0, 1]\n\tEnable or disable file overwriting. Default is 1.");
|
||||||
|
|
||||||
INTEGER_COMMAND(rx_framesperfile, getFramesPerFile, setFramesPerFile,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
StringTo<int>,
|
rx_framesperfile, getFramesPerFile, setFramesPerFile, StringTo<int>,
|
||||||
"[n_frames]\n\tNumber of frames per file in receiver. 0 is "
|
"[n_frames]\n\tNumber of frames per file in receiver. 0 is "
|
||||||
"infinite or all frames in single file.");
|
"infinite or all frames in single file.");
|
||||||
|
|
||||||
/* ZMQ Streaming Parameters (Receiver<->Client) */
|
/* ZMQ Streaming Parameters (Receiver<->Client) */
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
rx_datastream, getRxZmqDataStream, setRxZmqDataStream, StringTo<int>,
|
rx_zmqstream, getRxZmqDataStream, setRxZmqDataStream, StringTo<int>,
|
||||||
"[0, 1]\n\tEnable/ disable data streaming from receiver via zmq (eg. "
|
"[0, 1]\n\tEnable/ disable data streaming from receiver via zmq (eg. "
|
||||||
"to GUI or to another process for further processing). This creates/ "
|
"to GUI or to another process for further processing). This creates/ "
|
||||||
"destroys zmq streamer threads in receiver. \n\tSwitching to Gui "
|
"destroys zmq streamer threads in receiver. \n\tSwitching to Gui "
|
||||||
@ -1857,21 +1943,22 @@ class CmdProxy {
|
|||||||
"to command line acquire will require disabling data streaming in "
|
"to command line acquire will require disabling data streaming in "
|
||||||
"receiver for fast applications. ");
|
"receiver for fast applications. ");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
rx_readfreq, getRxZmqFrequency, setRxZmqFrequency, StringTo<int>,
|
rx_zmqfreq, getRxZmqFrequency, setRxZmqFrequency, StringTo<int>,
|
||||||
"[nth frame]\n\tFrequency of frames streamed out from receiver via "
|
"[nth frame]\n\tFrequency of frames streamed out from receiver via "
|
||||||
"zmq\n\tDefault: 1, Means every frame is streamed out. \n\tIf 2, every "
|
"zmq\n\tDefault: 1, Means every frame is streamed out. \n\tIf 2, every "
|
||||||
"second frame is streamed out. \n\tIf 0, streaming timer is the "
|
"second frame is streamed out. \n\tIf 0, streaming timer is the "
|
||||||
"timeout, after which current frame is sent out. (default timeout is "
|
"timeout, after which current frame is sent out. (default timeout is "
|
||||||
"200 ms). Usually used for gui purposes.");
|
"200 ms). Usually used for gui purposes.");
|
||||||
|
|
||||||
INTEGER_COMMAND(rx_zmqstartfnum, getRxZmqStartingFrame,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
setRxZmqStartingFrame, StringTo<int>,
|
rx_zmqstartfnum, getRxZmqStartingFrame, setRxZmqStartingFrame,
|
||||||
|
StringTo<int>,
|
||||||
"[fnum]\n\tThe starting frame index to stream out. 0 by "
|
"[fnum]\n\tThe starting frame index to stream out. 0 by "
|
||||||
"default, which streams the first frame in an acquisition, "
|
"default, which streams the first frame in an acquisition, "
|
||||||
"and then depending on the rx zmq frequency/ timer");
|
"and then depending on the rx zmq frequency/ timer");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID_GET(
|
||||||
rx_zmqport, getRxZmqPort, setRxZmqPort, StringTo<int>,
|
rx_zmqport, getRxZmqPort, setRxZmqPort, StringTo<int>,
|
||||||
"[port]\n\tZmq port for data to be streamed out of the receiver. Also "
|
"[port]\n\tZmq port for data to be streamed out of the receiver. Also "
|
||||||
"restarts receiver zmq streaming if enabled. Default is 30001. "
|
"restarts receiver zmq streaming if enabled. Default is 30001. "
|
||||||
@ -1879,27 +1966,27 @@ class CmdProxy {
|
|||||||
"client(gui). Must be different for every detector (and udp port). "
|
"client(gui). Must be different for every detector (and udp port). "
|
||||||
"Multi command will automatically increment for individual modules.");
|
"Multi command will automatically increment for individual modules.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID_GET(
|
||||||
zmqport, getClientZmqPort, setClientZmqPort, StringTo<int>,
|
zmqport, getClientZmqPort, setClientZmqPort, StringTo<int>,
|
||||||
"[port]\n\tZmq port in client(gui) or intermediate process for data to "
|
"[port]\n\tZmq port in client(gui) or intermediate process for data to "
|
||||||
"be streamed to from receiver. efault connects to receiver zmq "
|
"be streamed to from receiver. Default connects to receiver zmq "
|
||||||
"streaming out port (30001). Modified only when using an intermediate "
|
"streaming out port (30001). Modified only when using an intermediate "
|
||||||
"process between receiver and client(gui). Also restarts client zmq "
|
"process between receiver and client(gui). Also restarts client zmq "
|
||||||
"streaming if enabled. Must be different for every detector (and udp "
|
"streaming if enabled. Must be different for every detector (and udp "
|
||||||
"port). Multi command will automatically increment for individual "
|
"port). Multi command will automatically increment for individual "
|
||||||
"modules.");
|
"modules.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
rx_zmqip, getRxZmqIP, setRxZmqIP, IpAddr,
|
rx_zmqip, getRxZmqIP, setRxZmqIP, IpAddr,
|
||||||
"[x.x.x.x]\n\tZmq Ip Address from which data is to be streamed out of "
|
"[x.x.x.x]\n\tZmq Ip Address from which data is to be streamed out of "
|
||||||
"the receiver. Also restarts receiver zmq streaming if enabled. "
|
"the receiver. Also restarts receiver zmq streaming if enabled. "
|
||||||
"Default is from rx_hostname. Modified only when using an intermediate "
|
"Default is from rx_hostname. Modified only when using an intermediate "
|
||||||
"process between receiver.");
|
"process between receiver.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
zmqip, getClientZmqIp, setClientZmqIp, IpAddr,
|
zmqip, getClientZmqIp, setClientZmqIp, IpAddr,
|
||||||
"[x.x.x.x]\n\tZmq IP Address in client(gui) or intermediate process "
|
"[x.x.x.x]\n\tIp Address to listen to zmq data streamed out from "
|
||||||
"for data to be streamed to from receiver. Default connects to "
|
"receiver or intermediate process. Default connects to "
|
||||||
"receiver zmq Ip Address (from rx_hostname). Modified only when using "
|
"receiver zmq Ip Address (from rx_hostname). Modified only when using "
|
||||||
"an intermediate process between receiver and client(gui). Also "
|
"an intermediate process between receiver and client(gui). Also "
|
||||||
"restarts client zmq streaming if enabled.");
|
"restarts client zmq streaming if enabled.");
|
||||||
@ -1919,24 +2006,26 @@ class CmdProxy {
|
|||||||
settingspath, getSettingsPath, setSettingsPath,
|
settingspath, getSettingsPath, setSettingsPath,
|
||||||
"[path]\n\t[Eiger] Directory where settings files are loaded from/to.");
|
"[path]\n\t[Eiger] Directory where settings files are loaded from/to.");
|
||||||
|
|
||||||
INTEGER_COMMAND(overflow, getOverFlowMode, setOverFlowMode, StringTo<int>,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
overflow, getOverFlowMode, setOverFlowMode, StringTo<int>,
|
||||||
"[0, 1]\n\t[Eiger] Enable or disable show overflow flag in "
|
"[0, 1]\n\t[Eiger] Enable or disable show overflow flag in "
|
||||||
"32 bit mode. Default is disabled.");
|
"32 bit mode. Default is disabled.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
flippeddatax, getBottom, setBottom, StringTo<int>,
|
flippeddatax, getBottom, setBottom, StringTo<int>,
|
||||||
"[0, 1]\n\t[Eiger] Top or Bottom Half of Eiger module. 1 is bottom, 0 "
|
"[0, 1]\n\t[Eiger] Top or Bottom Half of Eiger module. 1 is bottom, 0 "
|
||||||
"is top. Used to let Receivers and Gui know to flip the bottom image "
|
"is top. Used to let Receivers and Gui know to flip the bottom image "
|
||||||
"over the x axis. Files are not written without the flip however.");
|
"over the x axis. Files are not written without the flip however.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
readnlines, getPartialReadout, setPartialReadout, StringTo<int>,
|
readnlines, getPartialReadout, setPartialReadout, StringTo<int>,
|
||||||
"[1 - 256]\n\t[Eiger] Number of rows to readout per half module "
|
"[1 - 256]\n\t[Eiger] Number of rows to readout per half module "
|
||||||
"starting from the centre. 256 is default. The permissible values "
|
"starting from the centre. 256 is default. The permissible values "
|
||||||
"depend on dynamic range and 10Gbe enabled.");
|
"depend on dynamic range and 10Gbe enabled.");
|
||||||
|
|
||||||
INTEGER_COMMAND(interruptsubframe, getInterruptSubframe,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
setInterruptSubframe, StringTo<int>,
|
interruptsubframe, getInterruptSubframe, setInterruptSubframe,
|
||||||
|
StringTo<int>,
|
||||||
"[0, 1]\n\t[Eiger] 1 interrupts last subframe at required "
|
"[0, 1]\n\t[Eiger] 1 interrupts last subframe at required "
|
||||||
"exposure time. 0 will wait for last sub frame to finish "
|
"exposure time. 0 will wait for last sub frame to finish "
|
||||||
"exposing. 0 is default.");
|
"exposing. 0 is default.");
|
||||||
@ -1950,7 +2039,7 @@ class CmdProxy {
|
|||||||
"[(optional unit) ns|us|ms|s]\n\t[Eiger] Measured sub "
|
"[(optional unit) ns|us|ms|s]\n\t[Eiger] Measured sub "
|
||||||
"frame period between last sub frame and previous one.");
|
"frame period between last sub frame and previous one.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
partialreset, getPartialReset, setPartialReset, StringTo<int>,
|
partialreset, getPartialReset, setPartialReset, StringTo<int>,
|
||||||
"[0, 1]\n\t[Eiger] Sets up detector to do partial or complete reset at "
|
"[0, 1]\n\t[Eiger] Sets up detector to do partial or complete reset at "
|
||||||
"start of acquisition. 0 complete reset, 1 partial reset. Default is "
|
"start of acquisition. 0 complete reset, 1 partial reset. Default is "
|
||||||
@ -1958,7 +2047,7 @@ class CmdProxy {
|
|||||||
|
|
||||||
/* Jungfrau Specific */
|
/* Jungfrau Specific */
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
temp_threshold, getThresholdTemperature, setThresholdTemperature,
|
temp_threshold, getThresholdTemperature, setThresholdTemperature,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[n_temp (in degrees)]\n\t[Jungfrau] Threshold temperature in degrees. "
|
"[n_temp (in degrees)]\n\t[Jungfrau] Threshold temperature in degrees. "
|
||||||
@ -1967,7 +2056,7 @@ class CmdProxy {
|
|||||||
"occurs. To power on chip again, temperature has to be less than "
|
"occurs. To power on chip again, temperature has to be less than "
|
||||||
"threshold temperature and temperature event has to be cleared.");
|
"threshold temperature and temperature event has to be cleared.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
temp_control, getTemperatureControl, setTemperatureControl,
|
temp_control, getTemperatureControl, setTemperatureControl,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[0, 1]\n\t[Jungfrau] Temperature control enable. Default is 0 "
|
"[0, 1]\n\t[Jungfrau] Temperature control enable. Default is 0 "
|
||||||
@ -1977,7 +2066,7 @@ class CmdProxy {
|
|||||||
"to be less than threshold temperature and temperature event has to be "
|
"to be less than threshold temperature and temperature event has to be "
|
||||||
"cleared.");
|
"cleared.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
auto_comp_disable, getAutoCompDisable, setAutoCompDisable,
|
auto_comp_disable, getAutoCompDisable, setAutoCompDisable,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[0, 1]\n\t[Jungfrau] Auto comparator disable mode. By default, the "
|
"[0, 1]\n\t[Jungfrau] Auto comparator disable mode. By default, the "
|
||||||
@ -1994,7 +2083,7 @@ class CmdProxy {
|
|||||||
"0. For advanced users only. \n\tThe #images = #frames x #triggers x "
|
"0. For advanced users only. \n\tThe #images = #frames x #triggers x "
|
||||||
"(#storagecells + 1).");
|
"(#storagecells + 1).");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
storagecell_start, getStorageCellStart, setStorageCellStart,
|
storagecell_start, getStorageCellStart, setStorageCellStart,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[0-15]\n\t[Jungfrau] Storage cell that stores the first acquisition "
|
"[0-15]\n\t[Jungfrau] Storage cell that stores the first acquisition "
|
||||||
@ -2022,59 +2111,62 @@ class CmdProxy {
|
|||||||
"[duration] [(optional unit) ns|us|ms|s]\n\t[Gotthard2] Burst "
|
"[duration] [(optional unit) ns|us|ms|s]\n\t[Gotthard2] Burst "
|
||||||
"period. Only in burst mode and auto timing mode.");
|
"period. Only in burst mode and auto timing mode.");
|
||||||
|
|
||||||
INTEGER_COMMAND(cdsgain, getCDSGain, setCDSGain, StringTo<bool>,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
cdsgain, getCDSGain, setCDSGain, StringTo<bool>,
|
||||||
"[0, 1]\n\t[Gotthard2] Enable or disable CDS gain. Default "
|
"[0, 1]\n\t[Gotthard2] Enable or disable CDS gain. Default "
|
||||||
"is disabled.");
|
"is disabled.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
filter, getFilter, setFilter, StringTo<int>,
|
filter, getFilter, setFilter, StringTo<int>,
|
||||||
"[0|1|2|3]\n\t[Gotthard2] Set filter resistor. Default is 0.");
|
"[0|1|2|3]\n\t[Gotthard2] Set filter resistor. Default is 0.");
|
||||||
|
|
||||||
INTEGER_COMMAND(currentsource, getCurrentSource, setCurrentSource,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
StringTo<int>,
|
currentsource, getCurrentSource, setCurrentSource, StringTo<int>,
|
||||||
"[0, 1]\n\t[Gotthard2] Enable or disable current source. "
|
"[0, 1]\n\t[Gotthard2] Enable or disable current source. "
|
||||||
"Default is disabled.");
|
"Default is disabled.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
timingsource, getTimingSource, setTimingSource,
|
timingsource, getTimingSource, setTimingSource,
|
||||||
sls::StringTo<slsDetectorDefs::timingSourceType>,
|
sls::StringTo<slsDetectorDefs::timingSourceType>,
|
||||||
"[internal|external]\n\t[Gotthard2] Timing source. Internal is crystal "
|
"[internal|external]\n\t[Gotthard2] Timing source. Internal is crystal "
|
||||||
"and external is system timing. Default is internal.");
|
"and external is system timing. Default is internal.");
|
||||||
|
|
||||||
INTEGER_COMMAND(veto, getVeto, setVeto, StringTo<int>,
|
INTEGER_COMMAND_VEC_ID(veto, getVeto, setVeto, StringTo<int>,
|
||||||
"[0, 1]\n\t[Gotthard2] Enable or disable veto data "
|
"[0, 1]\n\t[Gotthard2] Enable or disable veto data "
|
||||||
"streaming from detector. Default is 0.");
|
"streaming from detector. Default is 0.");
|
||||||
|
|
||||||
/* Mythen3 Specific */
|
/* Mythen3 Specific */
|
||||||
|
|
||||||
INTEGER_COMMAND(gates, getNumberOfGates, setNumberOfGates, StringTo<int>,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
gates, getNumberOfGates, setNumberOfGates, StringTo<int>,
|
||||||
"[n_gates]\n\t[Mythen3] Number of external gates in gating "
|
"[n_gates]\n\t[Mythen3] Number of external gates in gating "
|
||||||
"or trigger_gating mode (external gating).");
|
"or trigger_gating mode (external gating).");
|
||||||
|
|
||||||
/* CTB/ Moench Specific */
|
/* CTB/ Moench Specific */
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
asamples, getNumberOfAnalogSamples, setNumberOfAnalogSamples,
|
asamples, getNumberOfAnalogSamples, setNumberOfAnalogSamples,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[n_samples]\n\t[CTB][Moench] Number of analog samples expected.");
|
"[n_samples]\n\t[CTB][Moench] Number of analog samples expected.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
adcclk, getADCClock, setADCClock, StringTo<int>,
|
adcclk, getADCClock, setADCClock, StringTo<int>,
|
||||||
"[n_clk in MHz]\n\t[Ctb][Moench] ADC clock frequency in MHz.");
|
"[n_clk in MHz]\n\t[Ctb][Moench] ADC clock frequency in MHz.");
|
||||||
|
|
||||||
INTEGER_COMMAND(runclk, getRUNClock, setRUNClock, StringTo<int>,
|
INTEGER_COMMAND_VEC_ID(runclk, getRUNClock, setRUNClock, StringTo<int>,
|
||||||
"[n_clk in MHz]\n\t[Ctb][Moench] Run clock in MHz.");
|
"[n_clk in MHz]\n\t[Ctb][Moench] Run clock in MHz.");
|
||||||
|
|
||||||
GET_COMMAND(syncclk, getSYNCClock,
|
GET_COMMAND(syncclk, getSYNCClock,
|
||||||
"[n_clk in MHz]\n\t[Ctb][Moench] Sync clock in MHz.");
|
"[n_clk in MHz]\n\t[Ctb][Moench] Sync clock in MHz.");
|
||||||
|
|
||||||
INTEGER_COMMAND(adcpipeline, getADCPipeline, setADCPipeline, StringTo<int>,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
adcpipeline, getADCPipeline, setADCPipeline, StringTo<int>,
|
||||||
"[n_value]\n\t[Ctb][Moench] Pipeline for ADC clock.");
|
"[n_value]\n\t[Ctb][Moench] Pipeline for ADC clock.");
|
||||||
|
|
||||||
INTEGER_IND_COMMAND(v_limit, getVoltage, setVoltage, StringTo<int>,
|
INTEGER_IND_COMMAND(v_limit, getVoltage, setVoltage, StringTo<int>,
|
||||||
defs::V_LIMIT,
|
defs::V_LIMIT,
|
||||||
"[n_value]\n\t[Ctb][Moench] Soft limit for power "
|
"[n_value]\n\t[Ctb][Moench] Soft limit for power "
|
||||||
"supplies(ctb only) and DACS in mV.");
|
"supplies (ctb only) and DACS in mV.");
|
||||||
|
|
||||||
INTEGER_COMMAND_HEX(adcenable, getADCEnableMask, setADCEnableMask,
|
INTEGER_COMMAND_HEX(adcenable, getADCEnableMask, setADCEnableMask,
|
||||||
StringTo<uint32_t>,
|
StringTo<uint32_t>,
|
||||||
@ -2090,20 +2182,22 @@ class CmdProxy {
|
|||||||
|
|
||||||
/* CTB Specific */
|
/* CTB Specific */
|
||||||
|
|
||||||
INTEGER_COMMAND(dsamples, getNumberOfDigitalSamples,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
setNumberOfDigitalSamples, StringTo<int>,
|
dsamples, getNumberOfDigitalSamples, setNumberOfDigitalSamples,
|
||||||
|
StringTo<int>,
|
||||||
"[n_value]\n\t[CTB] Number of digital samples expected.");
|
"[n_value]\n\t[CTB] Number of digital samples expected.");
|
||||||
|
|
||||||
INTEGER_COMMAND(romode, getReadoutMode, setReadoutMode,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
|
romode, getReadoutMode, setReadoutMode,
|
||||||
sls::StringTo<slsDetectorDefs::readoutMode>,
|
sls::StringTo<slsDetectorDefs::readoutMode>,
|
||||||
"[analog|digital|analog_digital]\n\t[CTB] Readout mode. "
|
"[analog|digital|analog_digital]\n\t[CTB] Readout mode. "
|
||||||
"Default is analog.");
|
"Default is analog.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
dbitclk, getDBITClock, setDBITClock, StringTo<int>,
|
dbitclk, getDBITClock, setDBITClock, StringTo<int>,
|
||||||
"[n_clk in MHz]\n\t[Ctb] Clock for latching the digital bits in MHz.");
|
"[n_clk in MHz]\n\t[Ctb] Clock for latching the digital bits in MHz.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
dbitpipeline, getDBITPipeline, setDBITPipeline, StringTo<int>,
|
dbitpipeline, getDBITPipeline, setDBITPipeline, StringTo<int>,
|
||||||
"[n_value]\n\t[Ctb] Pipeline of the clock for latching digital bits.");
|
"[n_value]\n\t[Ctb] Pipeline of the clock for latching digital bits.");
|
||||||
|
|
||||||
@ -2164,22 +2258,23 @@ class CmdProxy {
|
|||||||
GET_IND_COMMAND(im_io, getMeasuredCurrent, defs::I_POWER_IO, "",
|
GET_IND_COMMAND(im_io, getMeasuredCurrent, defs::I_POWER_IO, "",
|
||||||
"\n\t[Ctb] Measured current of power supply io in mA.");
|
"\n\t[Ctb] Measured current of power supply io in mA.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
extsampling, getExternalSampling, setExternalSampling, StringTo<int>,
|
extsampling, getExternalSampling, setExternalSampling, StringTo<int>,
|
||||||
"[0, 1]\n\t[Ctb] Enable for external sampling signal to extsamplingsrc "
|
"[0, 1]\n\t[Ctb] Enable for external sampling signal to extsamplingsrc "
|
||||||
"signal for digital data. For advanced users only.");
|
"signal for digital data. For advanced users only.");
|
||||||
|
|
||||||
INTEGER_COMMAND(extsamplingsrc, getExternalSamplingSource,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
setExternalSamplingSource, StringTo<int>,
|
extsamplingsrc, getExternalSamplingSource, setExternalSamplingSource,
|
||||||
|
StringTo<int>,
|
||||||
"[0-63]\n\t[Ctb] Sampling source signal for digital data. "
|
"[0-63]\n\t[Ctb] Sampling source signal for digital data. "
|
||||||
"For advanced users only.");
|
"For advanced users only.");
|
||||||
|
|
||||||
INTEGER_COMMAND(rx_dbitoffset, getRxDbitOffset, setRxDbitOffset,
|
INTEGER_COMMAND_VEC_ID(
|
||||||
StringTo<int>,
|
rx_dbitoffset, getRxDbitOffset, setRxDbitOffset, StringTo<int>,
|
||||||
"[n_bytes]\n\t[Ctb] Offset in bytes in digital data to "
|
"[n_bytes]\n\t[Ctb] Offset in bytes in digital data to "
|
||||||
"skip in receiver.");
|
"skip in receiver.");
|
||||||
|
|
||||||
INTEGER_COMMAND(led, getLEDEnable, setLEDEnable, StringTo<int>,
|
INTEGER_COMMAND_VEC_ID(led, getLEDEnable, setLEDEnable, StringTo<int>,
|
||||||
"[0, 1]\n\t[Ctb] Switches on/off all LEDs.");
|
"[0, 1]\n\t[Ctb] Switches on/off all LEDs.");
|
||||||
|
|
||||||
/* Pattern */
|
/* Pattern */
|
||||||
@ -2209,17 +2304,6 @@ class CmdProxy {
|
|||||||
"\n\t[Mythen3] Starts Pattern");
|
"\n\t[Mythen3] Starts Pattern");
|
||||||
|
|
||||||
/* Moench */
|
/* Moench */
|
||||||
|
|
||||||
INTEGER_COMMAND(framemode, getFrameMode, setFrameMode,
|
|
||||||
sls::StringTo<slsDetectorDefs::frameModeType>,
|
|
||||||
"[pedestal|newpedestal|flatfield|newflatfield]\n\t[Moench] "
|
|
||||||
"Frame mode (soft setting) in processor.");
|
|
||||||
|
|
||||||
INTEGER_COMMAND(detectormode, getDetectorMode, setDetectorMode,
|
|
||||||
sls::StringTo<slsDetectorDefs::detectorModeType>,
|
|
||||||
"[counting|interpolating|analog]\n\t[Moench] Detector mode "
|
|
||||||
"(soft setting) in processor.");
|
|
||||||
|
|
||||||
/* Advanced */
|
/* Advanced */
|
||||||
|
|
||||||
EXECUTE_SET_COMMAND(resetfpga, resetFPGA,
|
EXECUTE_SET_COMMAND(resetfpga, resetFPGA,
|
||||||
@ -2246,17 +2330,18 @@ class CmdProxy {
|
|||||||
|
|
||||||
/* Insignificant */
|
/* Insignificant */
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
port, getControlPort, setControlPort, StringTo<int>,
|
port, getControlPort, setControlPort, StringTo<int>,
|
||||||
"[n]\n\tPort number of the control server on detector for "
|
"[n]\n\tPort number of the control server on detector for "
|
||||||
"detector-client tcp interface. Default is 1952. Normally unchanged.");
|
"detector-client tcp interface. Default is 1952. Normally unchanged.");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
stopport, getStopPort, setStopPort, StringTo<int>,
|
stopport, getStopPort, setStopPort, StringTo<int>,
|
||||||
"[n]\n\tPort number of the stop server on detector for detector-client "
|
"[n]\n\tPort number of the stop server on detector for detector-client "
|
||||||
"tcp interface. Default is 1953. Normally unchanged.");
|
"tcp interface. Default is 1953. Normally unchanged.");
|
||||||
|
|
||||||
INTEGER_COMMAND(lock, getDetectorLock, setDetectorLock, StringTo<int>,
|
INTEGER_COMMAND_VEC_ID(lock, getDetectorLock, setDetectorLock,
|
||||||
|
StringTo<int>,
|
||||||
"[0, 1]\n\tLock detector to one IP, 1: locks");
|
"[0, 1]\n\tLock detector to one IP, 1: locks");
|
||||||
|
|
||||||
GET_COMMAND(
|
GET_COMMAND(
|
||||||
|
@ -1840,71 +1840,6 @@ void Detector::setAdditionalJsonParameter(const std::string &key,
|
|||||||
pimpl->Parallel(&Module::setAdditionalJsonParameter, pos, key, value);
|
pimpl->Parallel(&Module::setAdditionalJsonParameter, pos, key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int> Detector::getDetectorMinMaxEnergyThreshold(const bool isEmax,
|
|
||||||
Positions pos) const {
|
|
||||||
auto res = pimpl->Parallel(&Module::getAdditionalJsonParameter, pos,
|
|
||||||
isEmax ? "emax" : "emin");
|
|
||||||
Result<int> intResult(res.size());
|
|
||||||
try {
|
|
||||||
for (unsigned int i = 0; i < res.size(); ++i) {
|
|
||||||
intResult[i] = stoi(res[i]);
|
|
||||||
}
|
|
||||||
} catch (...) {
|
|
||||||
throw RuntimeError(
|
|
||||||
"Cannot find or convert emin/emax string to integer");
|
|
||||||
}
|
|
||||||
return intResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Detector::setDetectorMinMaxEnergyThreshold(const bool isEmax,
|
|
||||||
const int value,
|
|
||||||
Positions pos) {
|
|
||||||
pimpl->Parallel(&Module::setAdditionalJsonParameter, pos,
|
|
||||||
isEmax ? "emax" : "emin", std::to_string(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<defs::frameModeType> Detector::getFrameMode(Positions pos) const {
|
|
||||||
auto res =
|
|
||||||
pimpl->Parallel(&Module::getAdditionalJsonParameter, pos, "frameMode");
|
|
||||||
Result<defs::frameModeType> intResult(res.size());
|
|
||||||
try {
|
|
||||||
for (unsigned int i = 0; i < res.size(); ++i) {
|
|
||||||
intResult[i] =
|
|
||||||
sls::StringTo<slsDetectorDefs::frameModeType>(res[i]);
|
|
||||||
}
|
|
||||||
} catch (...) {
|
|
||||||
throw RuntimeError(
|
|
||||||
"Cannot find or convert frameMode string to integer");
|
|
||||||
}
|
|
||||||
return intResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Detector::setFrameMode(defs::frameModeType value, Positions pos) {
|
|
||||||
pimpl->Parallel(&Module::setAdditionalJsonParameter, pos, "frameMode",
|
|
||||||
sls::ToString(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<defs::detectorModeType> Detector::getDetectorMode(Positions pos) const {
|
|
||||||
auto res = pimpl->Parallel(&Module::getAdditionalJsonParameter, pos,
|
|
||||||
"detectorMode");
|
|
||||||
Result<defs::detectorModeType> intResult(res.size());
|
|
||||||
try {
|
|
||||||
for (unsigned int i = 0; i < res.size(); ++i) {
|
|
||||||
intResult[i] =
|
|
||||||
sls::StringTo<slsDetectorDefs::detectorModeType>(res[i]);
|
|
||||||
}
|
|
||||||
} catch (...) {
|
|
||||||
throw RuntimeError(
|
|
||||||
"Cannot find or convert detectorMode string to integer");
|
|
||||||
}
|
|
||||||
return intResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Detector::setDetectorMode(defs::detectorModeType value, Positions pos) {
|
|
||||||
pimpl->Parallel(&Module::setAdditionalJsonParameter, pos, "detectorMode",
|
|
||||||
sls::ToString(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Advanced
|
// Advanced
|
||||||
|
|
||||||
void Detector::programFPGA(const std::string &fname, Positions pos) {
|
void Detector::programFPGA(const std::string &fname, Positions pos) {
|
||||||
|
@ -435,7 +435,6 @@ void DetectorImpl::readFrameFromReceiver() {
|
|||||||
|
|
||||||
bool gapPixels = multi_shm()->gapPixels;
|
bool gapPixels = multi_shm()->gapPixels;
|
||||||
LOG(logDEBUG) << "Gap pixels: " << gapPixels;
|
LOG(logDEBUG) << "Gap pixels: " << gapPixels;
|
||||||
|
|
||||||
int nX = 0;
|
int nX = 0;
|
||||||
int nY = 0;
|
int nY = 0;
|
||||||
int nDetPixelsX = 0;
|
int nDetPixelsX = 0;
|
||||||
@ -464,7 +463,6 @@ void DetectorImpl::readFrameFromReceiver() {
|
|||||||
runningList[i] = false;
|
runningList[i] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int numConnected = numRunning;
|
|
||||||
bool data = false;
|
bool data = false;
|
||||||
bool completeImage = false;
|
bool completeImage = false;
|
||||||
char *image = nullptr;
|
char *image = nullptr;
|
||||||
@ -482,14 +480,7 @@ void DetectorImpl::readFrameFromReceiver() {
|
|||||||
uint32_t currentSubFrameIndex = -1, coordX = -1, coordY = -1,
|
uint32_t currentSubFrameIndex = -1, coordX = -1, coordY = -1,
|
||||||
flippedDataX = -1;
|
flippedDataX = -1;
|
||||||
|
|
||||||
// wait for real time acquisition to start
|
while (numRunning != 0) {
|
||||||
bool running = true;
|
|
||||||
sem_wait(&sem_newRTAcquisition);
|
|
||||||
if (getJoinThreadFlag()) {
|
|
||||||
running = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (running) {
|
|
||||||
// reset data
|
// reset data
|
||||||
data = false;
|
data = false;
|
||||||
if (multiframe != nullptr) {
|
if (multiframe != nullptr) {
|
||||||
@ -658,26 +649,6 @@ void DetectorImpl::readFrameFromReceiver() {
|
|||||||
pCallbackArg);
|
pCallbackArg);
|
||||||
delete thisData;
|
delete thisData;
|
||||||
}
|
}
|
||||||
|
|
||||||
// all done
|
|
||||||
if (numRunning == 0) {
|
|
||||||
// let main thread know that all dummy packets have been received
|
|
||||||
//(also from external process),
|
|
||||||
// main thread can now proceed to measurement finished call back
|
|
||||||
sem_post(&sem_endRTAcquisition);
|
|
||||||
// wait for next scan/measurement, else join thread
|
|
||||||
sem_wait(&sem_newRTAcquisition);
|
|
||||||
// done with complete acquisition
|
|
||||||
if (getJoinThreadFlag()) {
|
|
||||||
running = false;
|
|
||||||
} else {
|
|
||||||
// starting a new scan/measurement (got dummy data)
|
|
||||||
for (size_t i = 0; i < zmqSocket.size(); ++i) {
|
|
||||||
runningList[i] = connectList[i];
|
|
||||||
}
|
|
||||||
numRunning = numConnected;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disconnect resources
|
// Disconnect resources
|
||||||
@ -1030,17 +1001,11 @@ int DetectorImpl::acquire() {
|
|||||||
struct timespec begin, end;
|
struct timespec begin, end;
|
||||||
clock_gettime(CLOCK_REALTIME, &begin);
|
clock_gettime(CLOCK_REALTIME, &begin);
|
||||||
|
|
||||||
// in the real time acquisition loop, processing thread will wait for a
|
|
||||||
// post each time
|
|
||||||
sem_init(&sem_newRTAcquisition, 1, 0);
|
|
||||||
// in the real time acquistion loop, main thread will wait for
|
|
||||||
// processing thread to be done each time (which in turn waits for
|
|
||||||
// receiver/ext process)
|
|
||||||
sem_init(&sem_endRTAcquisition, 1, 0);
|
|
||||||
|
|
||||||
bool receiver = Parallel(&Module::getUseReceiverFlag, {}).squash(false);
|
bool receiver = Parallel(&Module::getUseReceiverFlag, {}).squash(false);
|
||||||
|
|
||||||
|
if (dataReady == nullptr) {
|
||||||
setJoinThreadFlag(false);
|
setJoinThreadFlag(false);
|
||||||
|
}
|
||||||
|
|
||||||
// verify receiver is idle
|
// verify receiver is idle
|
||||||
if (receiver) {
|
if (receiver) {
|
||||||
@ -1050,13 +1015,11 @@ int DetectorImpl::acquire() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
startProcessingThread();
|
startProcessingThread(receiver);
|
||||||
|
|
||||||
// start receiver
|
// start receiver
|
||||||
if (receiver) {
|
if (receiver) {
|
||||||
Parallel(&Module::startReceiver, {});
|
Parallel(&Module::startReceiver, {});
|
||||||
// let processing thread listen to these packets
|
|
||||||
sem_post(&sem_newRTAcquisition);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// start and read all
|
// start and read all
|
||||||
@ -1071,18 +1034,13 @@ int DetectorImpl::acquire() {
|
|||||||
// stop receiver
|
// stop receiver
|
||||||
if (receiver) {
|
if (receiver) {
|
||||||
Parallel(&Module::stopReceiver, {});
|
Parallel(&Module::stopReceiver, {});
|
||||||
if (dataReady != nullptr) {
|
|
||||||
sem_wait(&sem_endRTAcquisition); // waits for receiver's
|
|
||||||
}
|
|
||||||
// external process to be
|
|
||||||
// done sending data to gui
|
|
||||||
|
|
||||||
Parallel(&Module::incrementFileIndex, {});
|
Parallel(&Module::incrementFileIndex, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
// waiting for the data processing thread to finish!
|
// let the progress thread (no callback) know acquisition is done
|
||||||
|
if (dataReady == nullptr) {
|
||||||
setJoinThreadFlag(true);
|
setJoinThreadFlag(true);
|
||||||
sem_post(&sem_newRTAcquisition);
|
}
|
||||||
dataProcessingThread.join();
|
dataProcessingThread.join();
|
||||||
|
|
||||||
if (acquisition_finished != nullptr) {
|
if (acquisition_finished != nullptr) {
|
||||||
@ -1092,9 +1050,6 @@ int DetectorImpl::acquire() {
|
|||||||
acquisition_finished(progress, status, acqFinished_p);
|
acquisition_finished(progress, status, acqFinished_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
sem_destroy(&sem_newRTAcquisition);
|
|
||||||
sem_destroy(&sem_endRTAcquisition);
|
|
||||||
|
|
||||||
clock_gettime(CLOCK_REALTIME, &end);
|
clock_gettime(CLOCK_REALTIME, &end);
|
||||||
LOG(logDEBUG1) << "Elapsed time for acquisition:"
|
LOG(logDEBUG1) << "Elapsed time for acquisition:"
|
||||||
<< ((end.tv_sec - begin.tv_sec) +
|
<< ((end.tv_sec - begin.tv_sec) +
|
||||||
@ -1115,12 +1070,13 @@ void DetectorImpl::printProgress(double progress) {
|
|||||||
std::cout << '\r' << std::flush;
|
std::cout << '\r' << std::flush;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DetectorImpl::startProcessingThread() {
|
void DetectorImpl::startProcessingThread(bool receiver) {
|
||||||
dataProcessingThread = std::thread(&DetectorImpl::processData, this);
|
dataProcessingThread =
|
||||||
|
std::thread(&DetectorImpl::processData, this, receiver);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DetectorImpl::processData() {
|
void DetectorImpl::processData(bool receiver) {
|
||||||
if (Parallel(&Module::getUseReceiverFlag, {}).squash(false)) {
|
if (receiver) {
|
||||||
if (dataReady != nullptr) {
|
if (dataReady != nullptr) {
|
||||||
readFrameFromReceiver();
|
readFrameFromReceiver();
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ class DetectorImpl : public virtual slsDetectorDefs {
|
|||||||
* Combines data from all readouts and gives it to the gui
|
* Combines data from all readouts and gives it to the gui
|
||||||
* or just gives progress of acquisition by polling receivers
|
* or just gives progress of acquisition by polling receivers
|
||||||
*/
|
*/
|
||||||
void processData();
|
void processData(bool receiver);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert raw file
|
* Convert raw file
|
||||||
@ -352,7 +352,7 @@ class DetectorImpl : public virtual slsDetectorDefs {
|
|||||||
|
|
||||||
void printProgress(double progress);
|
void printProgress(double progress);
|
||||||
|
|
||||||
void startProcessingThread();
|
void startProcessingThread(bool receiver);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if processing thread is ready to join main thread
|
* Check if processing thread is ready to join main thread
|
||||||
@ -387,14 +387,6 @@ class DetectorImpl : public virtual slsDetectorDefs {
|
|||||||
/** ZMQ Socket - Receiver to Client */
|
/** ZMQ Socket - Receiver to Client */
|
||||||
std::vector<std::unique_ptr<ZmqSocket>> zmqSocket;
|
std::vector<std::unique_ptr<ZmqSocket>> zmqSocket;
|
||||||
|
|
||||||
/** semaphore to let postprocessing thread continue for next
|
|
||||||
* scan/measurement */
|
|
||||||
sem_t sem_newRTAcquisition;
|
|
||||||
|
|
||||||
/** semaphore to let main thread know it got all the dummy packets (also
|
|
||||||
* from ext. process) */
|
|
||||||
sem_t sem_endRTAcquisition;
|
|
||||||
|
|
||||||
/** mutex to synchronize main and data processing threads */
|
/** mutex to synchronize main and data processing threads */
|
||||||
mutable std::mutex mp;
|
mutable std::mutex mp;
|
||||||
|
|
||||||
|
@ -357,6 +357,10 @@ void Module::setImageTestMode(const int value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Module::getADC(dacIndex index) const {
|
int Module::getADC(dacIndex index) const {
|
||||||
|
// cannot access fpga links simultaneously (eiger) temp fix
|
||||||
|
if (index == TEMPERATURE_FPGA2 || index == TEMPERATURE_FPGA3) {
|
||||||
|
return sendToDetector<int>(F_GET_ADC, index);
|
||||||
|
}
|
||||||
return sendToDetectorStop<int>(F_GET_ADC, index);
|
return sendToDetectorStop<int>(F_GET_ADC, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -792,13 +796,6 @@ void Module::setReceiverHostname(const std::string &receiverIP) {
|
|||||||
|
|
||||||
shm()->numUDPInterfaces = retval.udpInterfaces;
|
shm()->numUDPInterfaces = retval.udpInterfaces;
|
||||||
|
|
||||||
if (shm()->myDetectorType == MOENCH) {
|
|
||||||
setAdditionalJsonParameter("adcmask_1g",
|
|
||||||
std::to_string(retval.adcMask));
|
|
||||||
setAdditionalJsonParameter("adcmask_10g",
|
|
||||||
std::to_string(retval.adc10gMask));
|
|
||||||
}
|
|
||||||
|
|
||||||
// to use rx_hostname if empty and also update client zmqip
|
// to use rx_hostname if empty and also update client zmqip
|
||||||
updateReceiverStreamingIP();
|
updateReceiverStreamingIP();
|
||||||
}
|
}
|
||||||
@ -1073,19 +1070,6 @@ void Module::setSubDeadTime(int64_t value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Module::getThresholdEnergy() const {
|
int Module::getThresholdEnergy() const {
|
||||||
// moench - get threshold energy from json header
|
|
||||||
if (shm()->myDetectorType == MOENCH) {
|
|
||||||
getAdditionalJsonHeader();
|
|
||||||
std::string result = getAdditionalJsonParameter("threshold");
|
|
||||||
// convert to integer
|
|
||||||
try {
|
|
||||||
return std::stoi(result);
|
|
||||||
}
|
|
||||||
// not found or cannot scan integer
|
|
||||||
catch (...) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sendToDetector<int>(F_GET_THRESHOLD_ENERGY);
|
return sendToDetector<int>(F_GET_THRESHOLD_ENERGY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1097,10 +1081,6 @@ void Module::setThresholdEnergy(int e_eV, detectorSettings isettings,
|
|||||||
if (shm()->useReceiverFlag) {
|
if (shm()->useReceiverFlag) {
|
||||||
sendToReceiver(F_RECEIVER_SET_THRESHOLD, e_eV, nullptr);
|
sendToReceiver(F_RECEIVER_SET_THRESHOLD, e_eV, nullptr);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// moench - send threshold energy to processor
|
|
||||||
else if (shm()->myDetectorType == MOENCH) {
|
|
||||||
setAdditionalJsonParameter("threshold", std::to_string(e_eV));
|
|
||||||
} else {
|
} else {
|
||||||
throw RuntimeError(
|
throw RuntimeError(
|
||||||
"Set threshold energy not implemented for this detector");
|
"Set threshold energy not implemented for this detector");
|
||||||
@ -1789,10 +1769,6 @@ void Module::setADCEnableMask(uint32_t mask) {
|
|||||||
// update #nchan, as it depends on #samples, adcmask,
|
// update #nchan, as it depends on #samples, adcmask,
|
||||||
updateNumberOfChannels();
|
updateNumberOfChannels();
|
||||||
|
|
||||||
// send to processor
|
|
||||||
if (shm()->myDetectorType == MOENCH)
|
|
||||||
setAdditionalJsonParameter("adcmask_1g", std::to_string(mask));
|
|
||||||
|
|
||||||
if (shm()->useReceiverFlag) {
|
if (shm()->useReceiverFlag) {
|
||||||
sendToReceiver<int>(F_RECEIVER_SET_ADC_MASK, mask);
|
sendToReceiver<int>(F_RECEIVER_SET_ADC_MASK, mask);
|
||||||
}
|
}
|
||||||
@ -1806,10 +1782,6 @@ void Module::setTenGigaADCEnableMask(uint32_t mask) {
|
|||||||
sendToDetector(F_SET_ADC_ENABLE_MASK_10G, mask, nullptr);
|
sendToDetector(F_SET_ADC_ENABLE_MASK_10G, mask, nullptr);
|
||||||
updateNumberOfChannels(); // depends on samples and adcmask
|
updateNumberOfChannels(); // depends on samples and adcmask
|
||||||
|
|
||||||
// send to processor
|
|
||||||
if (shm()->myDetectorType == MOENCH)
|
|
||||||
setAdditionalJsonParameter("adcmask_10g", std::to_string(mask));
|
|
||||||
|
|
||||||
if (shm()->useReceiverFlag) {
|
if (shm()->useReceiverFlag) {
|
||||||
sendToReceiver<int>(F_RECEIVER_SET_ADC_MASK_10G, mask);
|
sendToReceiver<int>(F_RECEIVER_SET_ADC_MASK_10G, mask);
|
||||||
}
|
}
|
||||||
|
@ -574,25 +574,25 @@ TEST_CASE("rx_framesperfile", "[.cmd][.rx][.new]") {
|
|||||||
|
|
||||||
/* ZMQ Streaming Parameters (Receiver<->Client) */
|
/* ZMQ Streaming Parameters (Receiver<->Client) */
|
||||||
|
|
||||||
TEST_CASE("rx_datastream", "[.cmd][.rx][.new]") {
|
TEST_CASE("rx_zmqstream", "[.cmd][.rx][.new]") {
|
||||||
Detector det;
|
Detector det;
|
||||||
CmdProxy proxy(&det);
|
CmdProxy proxy(&det);
|
||||||
auto prev_val = det.getRxZmqDataStream();
|
auto prev_val = det.getRxZmqDataStream();
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
proxy.Call("rx_datastream", {"1"}, -1, PUT, oss);
|
proxy.Call("rx_zmqstream", {"1"}, -1, PUT, oss);
|
||||||
REQUIRE(oss.str() == "rx_datastream 1\n");
|
REQUIRE(oss.str() == "rx_zmqstream 1\n");
|
||||||
REQUIRE(det.getRxZmqDataStream().squash() == true);
|
REQUIRE(det.getRxZmqDataStream().squash() == true);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
proxy.Call("rx_datastream", {}, -1, GET, oss);
|
proxy.Call("rx_zmqstream", {}, -1, GET, oss);
|
||||||
REQUIRE(oss.str() == "rx_datastream 1\n");
|
REQUIRE(oss.str() == "rx_zmqstream 1\n");
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
proxy.Call("rx_datastream", {"0"}, -1, PUT, oss);
|
proxy.Call("rx_zmqstream", {"0"}, -1, PUT, oss);
|
||||||
REQUIRE(oss.str() == "rx_datastream 0\n");
|
REQUIRE(oss.str() == "rx_zmqstream 0\n");
|
||||||
REQUIRE(det.getRxZmqDataStream().squash() == false);
|
REQUIRE(det.getRxZmqDataStream().squash() == false);
|
||||||
}
|
}
|
||||||
for (int i = 0; i != det.size(); ++i) {
|
for (int i = 0; i != det.size(); ++i) {
|
||||||
@ -600,24 +600,24 @@ TEST_CASE("rx_datastream", "[.cmd][.rx][.new]") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("rx_readfreq", "[.cmd][.rx][.new]") {
|
TEST_CASE("rx_zmqfreq", "[.cmd][.rx][.new]") {
|
||||||
Detector det;
|
Detector det;
|
||||||
CmdProxy proxy(&det);
|
CmdProxy proxy(&det);
|
||||||
auto prev_val = det.getRxZmqFrequency();
|
auto prev_val = det.getRxZmqFrequency();
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
proxy.Call("rx_readfreq", {"1"}, -1, PUT, oss);
|
proxy.Call("rx_zmqfreq", {"1"}, -1, PUT, oss);
|
||||||
REQUIRE(oss.str() == "rx_readfreq 1\n");
|
REQUIRE(oss.str() == "rx_zmqfreq 1\n");
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
proxy.Call("rx_readfreq", {}, -1, GET, oss);
|
proxy.Call("rx_zmqfreq", {}, -1, GET, oss);
|
||||||
REQUIRE(oss.str() == "rx_readfreq 1\n");
|
REQUIRE(oss.str() == "rx_zmqfreq 1\n");
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
proxy.Call("rx_readfreq", {"0"}, -1, PUT, oss);
|
proxy.Call("rx_zmqfreq", {"0"}, -1, PUT, oss);
|
||||||
REQUIRE(oss.str() == "rx_readfreq 0\n");
|
REQUIRE(oss.str() == "rx_zmqfreq 0\n");
|
||||||
}
|
}
|
||||||
for (int i = 0; i != det.size(); ++i) {
|
for (int i = 0; i != det.size(); ++i) {
|
||||||
det.setRxZmqFrequency(prev_val[i], {i});
|
det.setRxZmqFrequency(prev_val[i], {i});
|
||||||
|
@ -298,7 +298,7 @@ TEST_CASE("triggers", "[.cmd][.new]") {
|
|||||||
det.setNumberOfTriggers(prev_val);
|
det.setNumberOfTriggers(prev_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("exptime", "[.cmd][.new]") {
|
TEST_CASE("exptime", "[.cmd][.time]") {
|
||||||
Detector det;
|
Detector det;
|
||||||
CmdProxy proxy(&det);
|
CmdProxy proxy(&det);
|
||||||
auto det_type = det.getDetectorType().squash();
|
auto det_type = det.getDetectorType().squash();
|
||||||
@ -333,6 +333,12 @@ TEST_CASE("exptime", "[.cmd][.new]") {
|
|||||||
proxy.Call("exptime", {"0"}, -1, PUT, oss);
|
proxy.Call("exptime", {"0"}, -1, PUT, oss);
|
||||||
REQUIRE(oss.str() == "exptime 0\n");
|
REQUIRE(oss.str() == "exptime 0\n");
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
//Get exptime of single module
|
||||||
|
std::ostringstream oss;
|
||||||
|
proxy.Call("exptime", {}, 0, GET, oss);
|
||||||
|
REQUIRE(oss.str() == "exptime 0ns\n");
|
||||||
|
}
|
||||||
det.setExptime(-1, prev_val);
|
det.setExptime(-1, prev_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,16 +24,16 @@ const std::string DataProcessor::TypeName = "DataProcessor";
|
|||||||
|
|
||||||
DataProcessor::DataProcessor(int ind, detectorType dtype, Fifo *f,
|
DataProcessor::DataProcessor(int ind, detectorType dtype, Fifo *f,
|
||||||
fileFormat *ftype, bool fwenable, bool *mfwenable,
|
fileFormat *ftype, bool fwenable, bool *mfwenable,
|
||||||
bool *dsEnable, uint32_t *dr, uint32_t *freq,
|
bool *dsEnable, uint32_t *freq,
|
||||||
uint32_t *timer, uint32_t *sfnum, bool *fp,
|
uint32_t *timer, uint32_t *sfnum, bool *fp,
|
||||||
bool *act, bool *depaden, bool *sm, bool *qe,
|
bool *act, bool *depaden, bool *sm,
|
||||||
std::vector<int> *cdl, int *cdo, int *cad)
|
std::vector<int> *cdl, int *cdo, int *cad)
|
||||||
: ThreadObject(ind, TypeName), fifo(f), myDetectorType(dtype),
|
: ThreadObject(ind, TypeName), fifo(f), myDetectorType(dtype),
|
||||||
dataStreamEnable(dsEnable), fileFormatType(ftype),
|
dataStreamEnable(dsEnable), fileFormatType(ftype),
|
||||||
fileWriteEnable(fwenable), masterFileWriteEnable(mfwenable),
|
fileWriteEnable(fwenable), masterFileWriteEnable(mfwenable),
|
||||||
dynamicRange(dr), streamingFrequency(freq), streamingTimerInMs(timer),
|
streamingFrequency(freq), streamingTimerInMs(timer),
|
||||||
streamingStartFnum(sfnum), activated(act),
|
streamingStartFnum(sfnum), activated(act),
|
||||||
deactivatedPaddingEnable(depaden), silentMode(sm), quadEnable(qe),
|
deactivatedPaddingEnable(depaden), silentMode(sm),
|
||||||
framePadding(fp), ctbDbitList(cdl), ctbDbitOffset(cdo),
|
framePadding(fp), ctbDbitList(cdl), ctbDbitOffset(cdo),
|
||||||
ctbAnalogDataBytes(cad), firstStreamerFrame(false) {
|
ctbAnalogDataBytes(cad), firstStreamerFrame(false) {
|
||||||
LOG(logDEBUG) << "DataProcessor " << ind << " created";
|
LOG(logDEBUG) << "DataProcessor " << ind << " created";
|
||||||
|
@ -49,9 +49,9 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
* @param cad pointer to ctb analog databytes
|
* @param cad pointer to ctb analog databytes
|
||||||
*/
|
*/
|
||||||
DataProcessor(int ind, detectorType dtype, Fifo *f, fileFormat *ftype,
|
DataProcessor(int ind, detectorType dtype, Fifo *f, fileFormat *ftype,
|
||||||
bool fwenable, bool *mfwenable, bool *dsEnable, uint32_t *dr,
|
bool fwenable, bool *mfwenable, bool *dsEnable,
|
||||||
uint32_t *freq, uint32_t *timer, uint32_t *sfnum, bool *fp,
|
uint32_t *freq, uint32_t *timer, uint32_t *sfnum, bool *fp,
|
||||||
bool *act, bool *depaden, bool *sm, bool *qe,
|
bool *act, bool *depaden, bool *sm,
|
||||||
std::vector<int> *cdl, int *cdo, int *cad);
|
std::vector<int> *cdl, int *cdo, int *cad);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -268,9 +268,6 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
/** Master File Write Enable */
|
/** Master File Write Enable */
|
||||||
bool *masterFileWriteEnable;
|
bool *masterFileWriteEnable;
|
||||||
|
|
||||||
/** Dynamic Range */
|
|
||||||
uint32_t *dynamicRange;
|
|
||||||
|
|
||||||
/** Pointer to Streaming frequency, if 0, sending random images with a timer
|
/** Pointer to Streaming frequency, if 0, sending random images with a timer
|
||||||
*/
|
*/
|
||||||
uint32_t *streamingFrequency;
|
uint32_t *streamingFrequency;
|
||||||
@ -296,9 +293,6 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
/** Silent Mode */
|
/** Silent Mode */
|
||||||
bool *silentMode;
|
bool *silentMode;
|
||||||
|
|
||||||
/** quad enable */
|
|
||||||
bool *quadEnable;
|
|
||||||
|
|
||||||
/** frame padding */
|
/** frame padding */
|
||||||
bool *framePadding;
|
bool *framePadding;
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ class DataStreamer : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
std::map<std::string, std::string> localAdditionalJsonHeader;
|
std::map<std::string, std::string> localAdditionalJsonHeader;
|
||||||
|
|
||||||
/** Aquisition Started flag */
|
/** Aquisition Started flag */
|
||||||
bool startedFlag{nullptr};
|
bool startedFlag{false};
|
||||||
|
|
||||||
/** Frame Number of First Frame */
|
/** Frame Number of First Frame */
|
||||||
uint64_t firstIndex{0};
|
uint64_t firstIndex{0};
|
||||||
|
@ -168,7 +168,6 @@ class GeneralData {
|
|||||||
class GotthardData : public GeneralData {
|
class GotthardData : public GeneralData {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const int nChip = 10;
|
|
||||||
const int nChan = 128;
|
const int nChan = 128;
|
||||||
const int nChipsPerAdc = 2;
|
const int nChipsPerAdc = 2;
|
||||||
|
|
||||||
@ -532,8 +531,6 @@ class Gotthard2Data : public GeneralData {
|
|||||||
|
|
||||||
class ChipTestBoardData : public GeneralData {
|
class ChipTestBoardData : public GeneralData {
|
||||||
private:
|
private:
|
||||||
/** Number of analog channels */
|
|
||||||
const int NCHAN_ANALOG = 32;
|
|
||||||
/** Number of digital channels */
|
/** Number of digital channels */
|
||||||
const int NCHAN_DIGITAL = 64;
|
const int NCHAN_DIGITAL = 64;
|
||||||
/** Number of bytes per analog channel */
|
/** Number of bytes per analog channel */
|
||||||
@ -579,14 +576,8 @@ class ChipTestBoardData : public GeneralData {
|
|||||||
// analog channels (normal, analog/digital readout)
|
// analog channels (normal, analog/digital readout)
|
||||||
if (f == slsDetectorDefs::ANALOG_ONLY ||
|
if (f == slsDetectorDefs::ANALOG_ONLY ||
|
||||||
f == slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
f == slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||||
if (a == BIT32_MASK) {
|
nachans = __builtin_popcount(a);
|
||||||
nachans = 32;
|
|
||||||
} else {
|
|
||||||
for (int ich = 0; ich < 32; ++ich) {
|
|
||||||
if (a & (1 << ich))
|
|
||||||
++nachans;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
adatabytes = nachans * NUM_BYTES_PER_ANALOG_CHANNEL * as;
|
adatabytes = nachans * NUM_BYTES_PER_ANALOG_CHANNEL * as;
|
||||||
LOG(logDEBUG1) << " Number of Analog Channels:" << nachans
|
LOG(logDEBUG1) << " Number of Analog Channels:" << nachans
|
||||||
<< " Databytes: " << adatabytes;
|
<< " Databytes: " << adatabytes;
|
||||||
|
@ -162,15 +162,15 @@ void Implementation::setDetectorType(const detectorType d) {
|
|||||||
auto fifo_ptr = fifo[i].get();
|
auto fifo_ptr = fifo[i].get();
|
||||||
listener.push_back(sls::make_unique<Listener>(
|
listener.push_back(sls::make_unique<Listener>(
|
||||||
i, myDetectorType, fifo_ptr, &status, &udpPortNum[i], ð[i],
|
i, myDetectorType, fifo_ptr, &status, &udpPortNum[i], ð[i],
|
||||||
&numberOfTotalFrames, &dynamicRange, &udpSocketBufferSize,
|
&numberOfTotalFrames, &udpSocketBufferSize,
|
||||||
&actualUDPSocketBufferSize, &framesPerFile, &frameDiscardMode,
|
&actualUDPSocketBufferSize, &framesPerFile, &frameDiscardMode,
|
||||||
&activated, &deactivatedPaddingEnable, &silentMode));
|
&activated, &deactivatedPaddingEnable, &silentMode));
|
||||||
dataProcessor.push_back(sls::make_unique<DataProcessor>(
|
dataProcessor.push_back(sls::make_unique<DataProcessor>(
|
||||||
i, myDetectorType, fifo_ptr, &fileFormatType, fileWriteEnable,
|
i, myDetectorType, fifo_ptr, &fileFormatType, fileWriteEnable,
|
||||||
&masterFileWriteEnable, &dataStreamEnable, &dynamicRange,
|
&masterFileWriteEnable, &dataStreamEnable,
|
||||||
&streamingFrequency, &streamingTimerInMs, &streamingStartFnum,
|
&streamingFrequency, &streamingTimerInMs, &streamingStartFnum,
|
||||||
&framePadding, &activated, &deactivatedPaddingEnable,
|
&framePadding, &activated, &deactivatedPaddingEnable,
|
||||||
&silentMode, &quadEnable, &ctbDbitList, &ctbDbitOffset,
|
&silentMode, &ctbDbitList, &ctbDbitOffset,
|
||||||
&ctbAnalogDataBytes));
|
&ctbAnalogDataBytes));
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
listener.clear();
|
listener.clear();
|
||||||
@ -841,7 +841,7 @@ void Implementation::setNumberofUDPInterfaces(const int n) {
|
|||||||
auto fifo_ptr = fifo[i].get();
|
auto fifo_ptr = fifo[i].get();
|
||||||
listener.push_back(sls::make_unique<Listener>(
|
listener.push_back(sls::make_unique<Listener>(
|
||||||
i, myDetectorType, fifo_ptr, &status, &udpPortNum[i],
|
i, myDetectorType, fifo_ptr, &status, &udpPortNum[i],
|
||||||
ð[i], &numberOfTotalFrames, &dynamicRange,
|
ð[i], &numberOfTotalFrames,
|
||||||
&udpSocketBufferSize, &actualUDPSocketBufferSize,
|
&udpSocketBufferSize, &actualUDPSocketBufferSize,
|
||||||
&framesPerFile, &frameDiscardMode, &activated,
|
&framesPerFile, &frameDiscardMode, &activated,
|
||||||
&deactivatedPaddingEnable, &silentMode));
|
&deactivatedPaddingEnable, &silentMode));
|
||||||
@ -850,9 +850,9 @@ void Implementation::setNumberofUDPInterfaces(const int n) {
|
|||||||
dataProcessor.push_back(sls::make_unique<DataProcessor>(
|
dataProcessor.push_back(sls::make_unique<DataProcessor>(
|
||||||
i, myDetectorType, fifo_ptr, &fileFormatType,
|
i, myDetectorType, fifo_ptr, &fileFormatType,
|
||||||
fileWriteEnable, &masterFileWriteEnable, &dataStreamEnable,
|
fileWriteEnable, &masterFileWriteEnable, &dataStreamEnable,
|
||||||
&dynamicRange, &streamingFrequency, &streamingTimerInMs,
|
&streamingFrequency, &streamingTimerInMs,
|
||||||
&streamingStartFnum, &framePadding, &activated,
|
&streamingStartFnum, &framePadding, &activated,
|
||||||
&deactivatedPaddingEnable, &silentMode, &quadEnable,
|
&deactivatedPaddingEnable, &silentMode,
|
||||||
&ctbDbitList, &ctbDbitOffset, &ctbAnalogDataBytes));
|
&ctbDbitList, &ctbDbitOffset, &ctbAnalogDataBytes));
|
||||||
dataProcessor[i]->SetGeneralData(generalData);
|
dataProcessor[i]->SetGeneralData(generalData);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
@ -21,11 +21,11 @@ const std::string Listener::TypeName = "Listener";
|
|||||||
|
|
||||||
Listener::Listener(int ind, detectorType dtype, Fifo *f,
|
Listener::Listener(int ind, detectorType dtype, Fifo *f,
|
||||||
std::atomic<runStatus> *s, uint32_t *portno, std::string *e,
|
std::atomic<runStatus> *s, uint32_t *portno, std::string *e,
|
||||||
uint64_t *nf, uint32_t *dr, int64_t *us, int64_t *as,
|
uint64_t *nf, int64_t *us, int64_t *as,
|
||||||
uint32_t *fpf, frameDiscardPolicy *fdp, bool *act,
|
uint32_t *fpf, frameDiscardPolicy *fdp, bool *act,
|
||||||
bool *depaden, bool *sm)
|
bool *depaden, bool *sm)
|
||||||
: ThreadObject(ind, TypeName), fifo(f), myDetectorType(dtype), status(s),
|
: ThreadObject(ind, TypeName), fifo(f), myDetectorType(dtype), status(s),
|
||||||
udpPortNumber(portno), eth(e), numImages(nf), dynamicRange(dr),
|
udpPortNumber(portno), eth(e), numImages(nf),
|
||||||
udpSocketBufferSize(us), actualUDPSocketBufferSize(as),
|
udpSocketBufferSize(us), actualUDPSocketBufferSize(as),
|
||||||
framesPerFile(fpf), frameDiscardMode(fdp), activated(act),
|
framesPerFile(fpf), frameDiscardMode(fdp), activated(act),
|
||||||
deactivatedPaddingEnable(depaden), silentMode(sm) {
|
deactivatedPaddingEnable(depaden), silentMode(sm) {
|
||||||
|
@ -41,7 +41,7 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
* @param sm pointer to silent mode
|
* @param sm pointer to silent mode
|
||||||
*/
|
*/
|
||||||
Listener(int ind, detectorType dtype, Fifo *f, std::atomic<runStatus> *s,
|
Listener(int ind, detectorType dtype, Fifo *f, std::atomic<runStatus> *s,
|
||||||
uint32_t *portno, std::string *e, uint64_t *nf, uint32_t *dr,
|
uint32_t *portno, std::string *e, uint64_t *nf,
|
||||||
int64_t *us, int64_t *as, uint32_t *fpf, frameDiscardPolicy *fdp,
|
int64_t *us, int64_t *as, uint32_t *fpf, frameDiscardPolicy *fdp,
|
||||||
bool *act, bool *depaden, bool *sm);
|
bool *act, bool *depaden, bool *sm);
|
||||||
|
|
||||||
@ -172,9 +172,6 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
/** Number of Images to catch */
|
/** Number of Images to catch */
|
||||||
uint64_t *numImages;
|
uint64_t *numImages;
|
||||||
|
|
||||||
/** Dynamic Range */
|
|
||||||
uint32_t *dynamicRange;
|
|
||||||
|
|
||||||
/** UDP Socket Buffer Size */
|
/** UDP Socket Buffer Size */
|
||||||
int64_t *udpSocketBufferSize;
|
int64_t *udpSocketBufferSize;
|
||||||
|
|
||||||
|
@ -32,8 +32,6 @@ std::string ToString(const defs::frameDiscardPolicy s);
|
|||||||
std::string ToString(const defs::fileFormat s);
|
std::string ToString(const defs::fileFormat s);
|
||||||
std::string ToString(const defs::externalSignalFlag s);
|
std::string ToString(const defs::externalSignalFlag s);
|
||||||
std::string ToString(const defs::readoutMode s);
|
std::string ToString(const defs::readoutMode s);
|
||||||
std::string ToString(const defs::frameModeType s);
|
|
||||||
std::string ToString(const defs::detectorModeType s);
|
|
||||||
std::string ToString(const defs::dacIndex s);
|
std::string ToString(const defs::dacIndex s);
|
||||||
std::string ToString(const std::vector<defs::dacIndex> &vec);
|
std::string ToString(const std::vector<defs::dacIndex> &vec);
|
||||||
std::string ToString(const defs::burstMode s);
|
std::string ToString(const defs::burstMode s);
|
||||||
@ -283,8 +281,6 @@ template <> defs::frameDiscardPolicy StringTo(const std::string &s);
|
|||||||
template <> defs::fileFormat StringTo(const std::string &s);
|
template <> defs::fileFormat StringTo(const std::string &s);
|
||||||
template <> defs::externalSignalFlag StringTo(const std::string &s);
|
template <> defs::externalSignalFlag StringTo(const std::string &s);
|
||||||
template <> defs::readoutMode StringTo(const std::string &s);
|
template <> defs::readoutMode StringTo(const std::string &s);
|
||||||
template <> defs::frameModeType StringTo(const std::string &s);
|
|
||||||
template <> defs::detectorModeType StringTo(const std::string &s);
|
|
||||||
template <> defs::dacIndex StringTo(const std::string &s);
|
template <> defs::dacIndex StringTo(const std::string &s);
|
||||||
template <> defs::burstMode StringTo(const std::string &s);
|
template <> defs::burstMode StringTo(const std::string &s);
|
||||||
template <> defs::timingSourceType StringTo(const std::string &s);
|
template <> defs::timingSourceType StringTo(const std::string &s);
|
||||||
|
@ -377,16 +377,6 @@ typedef struct {
|
|||||||
/** hierarchy in multi-detector structure, if any */
|
/** hierarchy in multi-detector structure, if any */
|
||||||
enum masterFlags { NO_MASTER, IS_MASTER, IS_SLAVE };
|
enum masterFlags { NO_MASTER, IS_MASTER, IS_SLAVE };
|
||||||
|
|
||||||
/**
|
|
||||||
* frame mode for processor
|
|
||||||
*/
|
|
||||||
enum frameModeType { PEDESTAL, NEW_PEDESTAL, FLATFIELD, NEW_FLATFIELD };
|
|
||||||
|
|
||||||
/**
|
|
||||||
* detector mode for processor
|
|
||||||
*/
|
|
||||||
enum detectorModeType { COUNTING, INTERPOLATING, ANALOG };
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* burst mode for gotthard2
|
* burst mode for gotthard2
|
||||||
*/
|
*/
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
#define APILIB 0x200810
|
#define APILIB 0x200810
|
||||||
#define APIRECEIVER 0x200810
|
#define APIRECEIVER 0x200810
|
||||||
#define APIGUI 0x200804
|
#define APIGUI 0x200804
|
||||||
#define APICTB 0x200909
|
|
||||||
#define APIGOTTHARD 0x200909
|
|
||||||
#define APIGOTTHARD2 0x200909
|
|
||||||
#define APIJUNGFRAU 0x200909
|
|
||||||
#define APIMOENCH 0x200909
|
|
||||||
#define APIEIGER 0x200909
|
|
||||||
|
|
||||||
#define APIMYTHEN3 0x200909
|
#define APICTB 0x200910
|
||||||
|
#define APIGOTTHARD 0x200910
|
||||||
|
#define APIJUNGFRAU 0x200910
|
||||||
|
#define APIMOENCH 0x200910
|
||||||
|
#define APIEIGER 0x200910
|
||||||
|
#define APIGOTTHARD2 0x200910
|
||||||
|
#define APIMYTHEN3 0x200910
|
||||||
|
@ -325,34 +325,6 @@ std::string ToString(const defs::readoutMode s) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ToString(const defs::frameModeType s) {
|
|
||||||
switch (s) {
|
|
||||||
case defs::PEDESTAL:
|
|
||||||
return std::string("pedestal");
|
|
||||||
case defs::NEW_PEDESTAL:
|
|
||||||
return std::string("newpedestal");
|
|
||||||
case defs::FLATFIELD:
|
|
||||||
return std::string("flatfield");
|
|
||||||
case defs::NEW_FLATFIELD:
|
|
||||||
return std::string("newflatfield");
|
|
||||||
default:
|
|
||||||
return std::string("Unknown");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string ToString(const defs::detectorModeType s) {
|
|
||||||
switch (s) {
|
|
||||||
case defs::COUNTING:
|
|
||||||
return std::string("counting");
|
|
||||||
case defs::INTERPOLATING:
|
|
||||||
return std::string("interpolating");
|
|
||||||
case defs::ANALOG:
|
|
||||||
return std::string("analog");
|
|
||||||
default:
|
|
||||||
return std::string("Unknown");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string ToString(const defs::dacIndex s) {
|
std::string ToString(const defs::dacIndex s) {
|
||||||
switch (s) {
|
switch (s) {
|
||||||
case defs::DAC_0:
|
case defs::DAC_0:
|
||||||
@ -713,28 +685,6 @@ template <> defs::readoutMode StringTo(const std::string &s) {
|
|||||||
throw sls::RuntimeError("Unknown readout mode " + s);
|
throw sls::RuntimeError("Unknown readout mode " + s);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <> defs::frameModeType StringTo(const std::string &s) {
|
|
||||||
if (s == "pedestal")
|
|
||||||
return defs::PEDESTAL;
|
|
||||||
if (s == "newpedestal")
|
|
||||||
return defs::NEW_PEDESTAL;
|
|
||||||
if (s == "flatfield")
|
|
||||||
return defs::FLATFIELD;
|
|
||||||
if (s == "newflatfield")
|
|
||||||
return defs::NEW_FLATFIELD;
|
|
||||||
throw sls::RuntimeError("Unknown frame mode " + s);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <> defs::detectorModeType StringTo(const std::string &s) {
|
|
||||||
if (s == "counting")
|
|
||||||
return defs::COUNTING;
|
|
||||||
if (s == "interpolating")
|
|
||||||
return defs::INTERPOLATING;
|
|
||||||
if (s == "analog")
|
|
||||||
return defs::ANALOG;
|
|
||||||
throw sls::RuntimeError("Unknown detector mode " + s);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <> defs::dacIndex StringTo(const std::string &s) {
|
template <> defs::dacIndex StringTo(const std::string &s) {
|
||||||
if (s == "dac 0")
|
if (s == "dac 0")
|
||||||
return defs::DAC_0;
|
return defs::DAC_0;
|
||||||
|
Reference in New Issue
Block a user