mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
Compare commits
27 Commits
khalil
...
moench8.0.
Author | SHA1 | Date | |
---|---|---|---|
e575fc0933 | |||
cc233686f1 | |||
64d489f1e6 | |||
56abf82d92 | |||
3d21bb64c4 | |||
f6b0ba9703 | |||
e5bea401a0 | |||
ecda5db97e | |||
d17bc5da62 | |||
a884db0e2c | |||
5e9fd43d49 | |||
8bce89d5dc | |||
aa40128965 | |||
7d9bc6d6eb | |||
a03780718e | |||
bd1a125154 | |||
ffe7728966 | |||
b69e053bb4 | |||
daec0dc389 | |||
c8bb70f876 | |||
9a08ecc5a5 | |||
664de6b204 | |||
8ab2aa589d | |||
b4e06eb62b | |||
c7c672ccde | |||
18cdd6a2f7 | |||
799903dddb |
@ -33,7 +33,7 @@ else()
|
||||
# Standard behaviour use libzmq included in this repo (libs/libzmq)
|
||||
FetchContent_Declare(
|
||||
libzmq
|
||||
URL ${CMAKE_SOURCE_DIR}/libs/libzmq/libzmq-4.3.4.tar.gz
|
||||
URL ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq-4.3.4.tar.gz
|
||||
URL_HASH MD5=cc20b769ac10afa352e5ed2769bb23b3
|
||||
)
|
||||
endif()
|
||||
@ -232,6 +232,8 @@ if (NOT TARGET slsProjectCSettings)
|
||||
-Wredundant-decls
|
||||
-Wdouble-promotion
|
||||
-Werror=return-type
|
||||
-Wno-format-overflow
|
||||
-Wno-format-truncation
|
||||
)
|
||||
sls_disable_c_warning("-Wstringop-truncation")
|
||||
endif()
|
||||
|
22
examples/rawdata.config
Normal file
22
examples/rawdata.config
Normal file
@ -0,0 +1,22 @@
|
||||
numfiles 1
|
||||
nthreads 5,
|
||||
fifosize 5000
|
||||
nsigma 5
|
||||
gainfile none
|
||||
detectorMode counting
|
||||
threshold 0
|
||||
pedestalfile none
|
||||
nframes 0
|
||||
xMin 0
|
||||
xMax 400
|
||||
yMin 0
|
||||
yMax 400
|
||||
outdir ./
|
||||
indir ./
|
||||
flist none
|
||||
fformat none
|
||||
runmin 0
|
||||
runmax -1
|
||||
readnrows 400
|
||||
eMin 0
|
||||
eMax 16000
|
16
examples/zmq.config
Normal file
16
examples/zmq.config
Normal file
@ -0,0 +1,16 @@
|
||||
numinterfaces 1
|
||||
rx_zmqip 10.1.2.102
|
||||
rx_zmqport 1978
|
||||
zmqip 129.129.202.57
|
||||
zmqport 1979
|
||||
nthreads 6
|
||||
fifosize 5000
|
||||
nsigma 5
|
||||
gainfile none
|
||||
nbinsx 5
|
||||
nbinsy 5
|
||||
etafile none
|
||||
etabinsx 1000
|
||||
etabinsy 1000
|
||||
etamin -1
|
||||
etamax 2
|
@ -3,3 +3,10 @@ slsDetectorPackage/7.0.1_rh7 stable cmake/3.15.5 zeromq/4.3.4 Qt/5.12.10
|
||||
slsDetectorPackage/7.0.1_rh8 stable cmake/3.15.5 zeromq/4.3.4 Qt/5.12.10
|
||||
slsDetectorPackage/7.0.2_rh7 stable cmake/3.15.5 zeromq/4.3.4 Qt/5.12.10
|
||||
slsDetectorPackage/7.0.2_rh8 stable cmake/3.15.5 zeromq/4.3.4 Qt/5.12.10
|
||||
slsDetectorPackage/7.0.3_rh7 stable cmake/3.15.5 zeromq/4.3.4 Qt/5.12.10
|
||||
slsDetectorPackage/7.0.3_rh8 stable cmake/3.15.5 zeromq/4.3.4 Qt/5.12.10
|
||||
slsDetectorPackage/8.0.0_rh7 stable cmake/3.15.5 Qt/5.12.10
|
||||
slsDetectorPackage/8.0.0_rh8 stable cmake/3.15.5 Qt/5.12.10
|
||||
slsDetectorPackage/8.0.1_rh7 stable cmake/3.15.5 Qt/5.12.10
|
||||
slsDetectorPackage/8.0.1_rh8 stable cmake/3.15.5 Qt/5.12.10
|
||||
|
||||
|
@ -232,7 +232,7 @@ class Detector(CppDetectorApi):
|
||||
@element
|
||||
def hardwareversion(self):
|
||||
"""
|
||||
[Jungfrau][Moench][Gotthard2][Myhten3][Gotthard][Ctb] Hardware version of detector. \n
|
||||
Hardware version of detector. \n
|
||||
[Eiger] Hardware version of front FPGA on detector.
|
||||
"""
|
||||
return self.getHardwareVersion()
|
||||
@ -308,7 +308,7 @@ class Detector(CppDetectorApi):
|
||||
-----
|
||||
[Eiger] Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2 (quarter speed), else to 0 (full speed)\n
|
||||
[Mythen3] Options: 8, 16, 32 \n
|
||||
[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2] 16
|
||||
[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2][Xilinx Ctb] 16
|
||||
"""
|
||||
return self.getDynamicRange()
|
||||
|
||||
@ -400,7 +400,7 @@ class Detector(CppDetectorApi):
|
||||
@element
|
||||
def framesl(self):
|
||||
"""
|
||||
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] Number of frames left in acquisition.\n
|
||||
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB][Xilinx CTB] Number of frames left in acquisition.\n
|
||||
|
||||
Note
|
||||
----
|
||||
@ -414,7 +414,7 @@ class Detector(CppDetectorApi):
|
||||
@element
|
||||
def framecounter(self):
|
||||
"""
|
||||
[Jungfrau][Moench][Mythen3][Gotthard2][CTB] Number of frames from start run control.
|
||||
[Jungfrau][Moench][Mythen3][Gotthard2][CTB][Xilinx Ctb] Number of frames from start run control.
|
||||
|
||||
Note
|
||||
-----
|
||||
@ -443,12 +443,13 @@ class Detector(CppDetectorApi):
|
||||
@element
|
||||
def powerchip(self):
|
||||
"""
|
||||
[Jungfrau][Moench][Mythen3][Gotthard2] Power the chip.
|
||||
[Jungfrau][Moench][Mythen3][Gotthard2][Xilinx Ctb] Power the chip.
|
||||
|
||||
Note
|
||||
----
|
||||
[Jungfrau][Moench] Default is disabled. Get will return power status. Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled. Will configure chip (only chip v1.1).\n
|
||||
[Mythen3][Gotthard2] Default is 1. If module not connected or wrong module, powerchip will fail.
|
||||
[Xilinx Ctb] Default is 0. Also configures the chip if powered on.
|
||||
"""
|
||||
return self.getPowerChip()
|
||||
|
||||
@ -456,6 +457,16 @@ class Detector(CppDetectorApi):
|
||||
def powerchip(self, value):
|
||||
ut.set_using_dict(self.setPowerChip, value)
|
||||
|
||||
def configtransceiver(self):
|
||||
"""
|
||||
[Xilinx Ctb] Waits for transceiver to be aligned.
|
||||
|
||||
Note
|
||||
----
|
||||
Chip had to be configured (powered on) before this.
|
||||
"""
|
||||
self.configureTransceiver()
|
||||
|
||||
@property
|
||||
@element
|
||||
def triggers(self):
|
||||
@ -620,7 +631,7 @@ class Detector(CppDetectorApi):
|
||||
@element
|
||||
def periodl(self):
|
||||
"""
|
||||
[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] Period left for current frame.
|
||||
[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx Ctb] Period left for current frame.
|
||||
|
||||
Note
|
||||
-----
|
||||
@ -642,7 +653,7 @@ class Detector(CppDetectorApi):
|
||||
@element
|
||||
def delay(self):
|
||||
"""
|
||||
[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] Delay after trigger, accepts either a value in seconds, DurationWrapper or datetime.timedelta
|
||||
[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx Ctb] Delay after trigger, accepts either a value in seconds, DurationWrapper or datetime.timedelta
|
||||
|
||||
:getter: always returns in seconds. To get in DurationWrapper, use getDelayAfterTrigger
|
||||
|
||||
@ -684,7 +695,7 @@ class Detector(CppDetectorApi):
|
||||
@element
|
||||
def delayl(self):
|
||||
"""
|
||||
[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] Delay left after trigger during acquisition, accepts either a value in seconds, datetime.timedelta or DurationWrapper
|
||||
[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx Ctb] Delay left after trigger during acquisition, accepts either a value in seconds, datetime.timedelta or DurationWrapper
|
||||
|
||||
Note
|
||||
-----
|
||||
@ -732,7 +743,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def nextframenumber(self):
|
||||
"""[Eiger][Jungfrau][Moench][CTB] Next frame number. Stopping acquisition might result in different frame numbers for different modules. """
|
||||
"""[Eiger][Jungfrau][Moench][CTB][Xilinx CTB] Next frame number. Stopping acquisition might result in different frame numbers for different modules. """
|
||||
return self.getNextFrameNumber()
|
||||
|
||||
@nextframenumber.setter
|
||||
@ -1951,7 +1962,7 @@ class Detector(CppDetectorApi):
|
||||
@element
|
||||
def triggersl(self):
|
||||
"""
|
||||
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] Number of triggers left in acquisition.\n
|
||||
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB][Xilinx CTB] Number of triggers left in acquisition.\n
|
||||
|
||||
Note
|
||||
----
|
||||
@ -1964,7 +1975,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def frametime(self):
|
||||
"""[Jungfrau][Moench][Mythen3][Gotthard2][CTB] Timestamp at a frame start.
|
||||
"""[Jungfrau][Moench][Mythen3][Gotthard2][CTB][Xilinx Ctb] Timestamp at a frame start.
|
||||
|
||||
Note
|
||||
----
|
||||
@ -2180,7 +2191,7 @@ class Detector(CppDetectorApi):
|
||||
Note
|
||||
-----
|
||||
Default: AUTO_TIMING \n
|
||||
[Jungfrau][Moench][Gotthard][Ctb][Gotthard2] AUTO_TIMING, TRIGGER_EXPOSURE \n
|
||||
[Jungfrau][Moench][Gotthard][Ctb][Gotthard2][Xilinx Ctb] AUTO_TIMING, TRIGGER_EXPOSURE \n
|
||||
[Mythen3] AUTO_TIMING, TRIGGER_EXPOSURE, GATED, TRIGGER_GATED \n
|
||||
[Eiger] AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER
|
||||
"""
|
||||
@ -2602,7 +2613,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def runtime(self):
|
||||
"""[Jungfrau][Moench][Mythen3][Gotthard2][CTB] Time from detector start up.
|
||||
"""[Jungfrau][Moench][Mythen3][Gotthard2][CTB][Xilinx Ctb] Time from detector start up.
|
||||
|
||||
Note
|
||||
-----
|
||||
@ -3237,7 +3248,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def transceiverenable(self):
|
||||
"""[Ctb] Transceiver Enable Mask. Enable for each 4 transceiver channel."""
|
||||
"""[CTB][Xilinx CTB] Transceiver Enable Mask. Enable for each 4 transceiver channel."""
|
||||
return self.getTransceiverEnableMask()
|
||||
|
||||
@transceiverenable.setter
|
||||
@ -3276,8 +3287,10 @@ class Detector(CppDetectorApi):
|
||||
|
||||
Note
|
||||
------
|
||||
Options: ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL, TRANSCEIVER_ONLY, DIGITAL_AND_TRANSCEIVER
|
||||
Default: ANALOG_ONLY
|
||||
[CTB] Options: ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL, TRANSCEIVER_ONLY, DIGITAL_AND_TRANSCEIVER
|
||||
[CTB] Default: ANALOG_ONLY
|
||||
[Xilinx CTB] Options: TRANSCEIVER_ONLY
|
||||
[Xilinx CTB] Default: TRANSCEIVER_ONLY
|
||||
|
||||
Example
|
||||
--------
|
||||
@ -3314,7 +3327,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def tsamples(self):
|
||||
"""[CTB] Number of transceiver samples expected. """
|
||||
"""[CTB][Xilinx CTB] Number of transceiver samples expected. """
|
||||
return self.getNumberOfTransceiverSamples()
|
||||
|
||||
@tsamples.setter
|
||||
@ -3477,7 +3490,7 @@ class Detector(CppDetectorApi):
|
||||
|
||||
@property
|
||||
def pattern(self):
|
||||
"""[Mythen3][Ctb] Loads ASCII pattern file directly to server (instead of executing line by line).
|
||||
"""[Mythen3][Ctb][Xilinx Ctb] Loads ASCII pattern file directly to server (instead of executing line by line).
|
||||
|
||||
:getter: Not Implemented
|
||||
|
||||
@ -3495,7 +3508,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
def patfname(self):
|
||||
"""
|
||||
[Ctb][Mythen3] Gets the pattern file name including path of the last pattern uploaded. Returns an empty if nothing was uploaded or via a server default
|
||||
[Ctb][Mythen3][Xilinx Ctb] Gets the pattern file name including path of the last pattern uploaded. Returns an empty if nothing was uploaded or via a server default
|
||||
file
|
||||
"""
|
||||
return self.getPatterFileName()
|
||||
@ -3520,7 +3533,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patlimits(self):
|
||||
"""[Ctb][Mythen3] Limits (start and stop address) of complete pattern.
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Limits (start and stop address) of complete pattern.
|
||||
|
||||
Example
|
||||
---------
|
||||
@ -3540,7 +3553,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patsetbit(self):
|
||||
"""[Ctb][Mythen3] Sets the mask applied to every pattern to the selected bits.
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Sets the mask applied to every pattern to the selected bits.
|
||||
|
||||
Example
|
||||
--------
|
||||
@ -3557,7 +3570,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patmask(self):
|
||||
"""[Ctb][Mythen3] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern.
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern.
|
||||
|
||||
Example
|
||||
--------
|
||||
@ -3575,7 +3588,7 @@ class Detector(CppDetectorApi):
|
||||
# @element
|
||||
def patwait(self):
|
||||
"""
|
||||
[Ctb][Mythen3] Wait address of loop level provided.
|
||||
[Ctb][Mythen3][Xilinx Ctb] Wait address of loop level provided.
|
||||
|
||||
Example
|
||||
-------
|
||||
@ -3592,7 +3605,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patwait0(self):
|
||||
"""[Ctb][Mythen3] Wait 0 address.
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Wait 0 address.
|
||||
|
||||
Example
|
||||
--------
|
||||
@ -3612,7 +3625,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patwait1(self):
|
||||
"""[Ctb][Mythen3] Wait 1 address.
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Wait 1 address.
|
||||
|
||||
Example
|
||||
--------
|
||||
@ -3632,7 +3645,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patwait2(self):
|
||||
"""[Ctb][Mythen3] Wait 2 address.
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Wait 2 address.
|
||||
|
||||
Example
|
||||
--------
|
||||
@ -3652,7 +3665,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
def patwaittime(self):
|
||||
"""
|
||||
[Ctb][Mythen3] Wait time in clock cycles of loop level provided.
|
||||
[Ctb][Mythen3][Xilinx Ctb] Wait time in clock cycles of loop level provided.
|
||||
|
||||
Example
|
||||
-------
|
||||
@ -3669,7 +3682,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patwaittime0(self):
|
||||
"""[Ctb][Mythen3] Wait 0 time in clock cycles."""
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Wait 0 time in clock cycles."""
|
||||
return self.getPatternWaitTime(0)
|
||||
|
||||
@patwaittime0.setter
|
||||
@ -3680,7 +3693,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patwaittime1(self):
|
||||
"""[Ctb][Mythen3] Wait 1 time in clock cycles."""
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Wait 1 time in clock cycles."""
|
||||
return self.getPatternWaitTime(1)
|
||||
|
||||
@patwaittime1.setter
|
||||
@ -3691,7 +3704,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patwaittime2(self):
|
||||
"""[Ctb][Mythen3] Wait 2 time in clock cycles."""
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Wait 2 time in clock cycles."""
|
||||
return self.getPatternWaitTime(2)
|
||||
|
||||
@patwaittime2.setter
|
||||
@ -3703,7 +3716,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
def patloop(self):
|
||||
"""
|
||||
[Ctb][Mythen3] Limits (start and stop address) of the loop provided.
|
||||
[Ctb][Mythen3][Xilinx Ctb] Limits (start and stop address) of the loop provided.
|
||||
|
||||
Example
|
||||
-------
|
||||
@ -3720,7 +3733,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patloop0(self):
|
||||
"""[Ctb][Mythen3] Limits (start and stop address) of loop 0.
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Limits (start and stop address) of loop 0.
|
||||
|
||||
Example
|
||||
---------
|
||||
@ -3740,7 +3753,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patloop1(self):
|
||||
"""[Ctb][Mythen3] Limits (start and stop address) of loop 1.
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Limits (start and stop address) of loop 1.
|
||||
|
||||
Example
|
||||
---------
|
||||
@ -3761,7 +3774,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patloop2(self):
|
||||
"""[Ctb][Mythen3] Limits (start and stop address) of loop 2.
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Limits (start and stop address) of loop 2.
|
||||
|
||||
Example
|
||||
---------
|
||||
@ -3783,7 +3796,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
def patnloop(self):
|
||||
"""
|
||||
[Ctb][Mythen3] Number of cycles of the loop provided.
|
||||
[Ctb][Mythen3][Xilinx Ctb] Number of cycles of the loop provided.
|
||||
|
||||
Example
|
||||
-------
|
||||
@ -3800,7 +3813,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patnloop0(self):
|
||||
"""[Ctb][Mythen3] Number of cycles of loop 0."""
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Number of cycles of loop 0."""
|
||||
return self.getPatternLoopCycles(0)
|
||||
|
||||
@patnloop0.setter
|
||||
@ -3811,7 +3824,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patnloop1(self):
|
||||
"""[Ctb][Mythen3] Number of cycles of loop 1."""
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Number of cycles of loop 1."""
|
||||
return self.getPatternLoopCycles(1)
|
||||
|
||||
@patnloop1.setter
|
||||
@ -3822,7 +3835,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def patnloop2(self):
|
||||
"""[Ctb][Mythen3] Number of cycles of loop 2."""
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Number of cycles of loop 2."""
|
||||
return self.getPatternLoopCycles(2)
|
||||
|
||||
@patnloop2.setter
|
||||
@ -3833,7 +3846,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def v_a(self):
|
||||
"""[Ctb] Power supply a in mV."""
|
||||
"""[Ctb][Xilinx Ctb] Power supply a in mV."""
|
||||
return self.getPower(dacIndex.V_POWER_A)
|
||||
|
||||
@v_a.setter
|
||||
@ -3844,7 +3857,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def v_b(self):
|
||||
"""[Ctb] Power supply b in mV."""
|
||||
"""[Ctb][Xilinx Ctb] Power supply b in mV."""
|
||||
return self.getPower(dacIndex.V_POWER_B)
|
||||
|
||||
@v_b.setter
|
||||
@ -3855,7 +3868,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def v_c(self):
|
||||
"""[Ctb] Power supply c in mV."""
|
||||
"""[Ctb][Xilinx Ctb] Power supply c in mV."""
|
||||
return self.getPower(dacIndex.V_POWER_C)
|
||||
|
||||
@v_c.setter
|
||||
@ -3866,7 +3879,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def v_d(self):
|
||||
"""[Ctb] Power supply d in mV."""
|
||||
"""[Ctb][Xilinx Ctb] Power supply d in mV."""
|
||||
return self.getPower(dacIndex.V_POWER_D)
|
||||
|
||||
@v_d.setter
|
||||
@ -3877,7 +3890,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def v_io(self):
|
||||
"""[Ctb] Power supply io in mV. Minimum 1200 mV.
|
||||
"""[Ctb][Xilinx Ctb] Power supply io in mV. Minimum 1200 mV.
|
||||
|
||||
Note
|
||||
----
|
||||
@ -3893,7 +3906,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def v_limit(self):
|
||||
"""[Ctb] Soft limit for power supplies (ctb only) and DACS in mV."""
|
||||
"""[Ctb][Xilinx Ctb] Soft limit for power supplies (ctb only) and DACS in mV."""
|
||||
return self.getPower(dacIndex.V_LIMIT)
|
||||
|
||||
@v_limit.setter
|
||||
|
@ -1778,6 +1778,10 @@ void init_det(py::module &m) {
|
||||
(std::string(Detector::*)(const defs::dacIndex) const) &
|
||||
Detector::getSlowADCName,
|
||||
py::arg());
|
||||
CppDetectorApi.def("configureTransceiver",
|
||||
(void (Detector::*)(sls::Positions)) &
|
||||
Detector::configureTransceiver,
|
||||
py::arg() = Positions{});
|
||||
CppDetectorApi.def(
|
||||
"getPatterFileName",
|
||||
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
||||
|
@ -25,6 +25,8 @@ void init_enums(py::module &m) {
|
||||
.value("MOENCH", slsDetectorDefs::detectorType::MOENCH)
|
||||
.value("MYTHEN3", slsDetectorDefs::detectorType::MYTHEN3)
|
||||
.value("GOTTHARD2", slsDetectorDefs::detectorType::GOTTHARD2)
|
||||
.value("XILINX_CHIPTESTBOARD",
|
||||
slsDetectorDefs::detectorType::XILINX_CHIPTESTBOARD)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::runStatus>(Defs, "runStatus")
|
||||
|
240
slsDetectorCalibration/dataStructures/moench03v2Data.h
Normal file
240
slsDetectorCalibration/dataStructures/moench03v2Data.h
Normal file
@ -0,0 +1,240 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#ifndef MOENCH03v2DATA_H
|
||||
#define MOENCH03v2DATA_H
|
||||
//#define MYROOT
|
||||
|
||||
#ifndef MYROOT
|
||||
#include "sls/sls_detector_defs.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef MYROOT
|
||||
|
||||
typedef struct {
|
||||
uint64_t frameNumber;
|
||||
uint32_t expLength;
|
||||
uint32_t packetNumber;
|
||||
uint64_t bunchId;
|
||||
uint64_t timestamp;
|
||||
uint16_t modId;
|
||||
uint16_t row;
|
||||
uint16_t column;
|
||||
uint16_t reserved;
|
||||
uint32_t debug;
|
||||
uint16_t roundRNumber;
|
||||
uint8_t detType;
|
||||
uint8_t version;
|
||||
} sls_detector_header;
|
||||
#define MAX_NUM_PACKETS 512
|
||||
// using sls_bitset = std::bitset<MAX_NUM_PACKETS>;
|
||||
// using bitset_storage = uint8_t[MAX_NUM_PACKETS / 8];
|
||||
struct sls_receiver_header {
|
||||
sls_detector_header detHeader; /**< is the detector header */
|
||||
uint8_t packetsMask[64]; /**< is the packets caught bit mask */
|
||||
};
|
||||
#endif
|
||||
|
||||
#include "slsDetectorData.h"
|
||||
#ifdef RAWDATA
|
||||
#define DATA_OFFSET sizeof(header)
|
||||
#endif
|
||||
#ifndef RAWDATA
|
||||
#define DATA_OFFSET 0
|
||||
#endif
|
||||
|
||||
|
||||
class moench03v2Data : public slsDetectorData<uint16_t> {
|
||||
|
||||
private:
|
||||
int iframe;
|
||||
const int nRows;
|
||||
|
||||
|
||||
|
||||
double ghost[200][25];
|
||||
|
||||
// Single point of definition if we need to customize
|
||||
#ifndef MYROOT
|
||||
using header = sls::defs::sls_receiver_header;
|
||||
#endif
|
||||
#ifdef MYROOT
|
||||
sls_receiver_header header;
|
||||
#endif
|
||||
public:
|
||||
/**
|
||||
Implements the slsReceiverData structure for the moench02 prototype read
|
||||
out by a module i.e. using the slsReceiver (160x160 pixels, 40 packets
|
||||
1286 large etc.) \param c crosstalk parameter for the output buffer
|
||||
|
||||
*/
|
||||
moench03v2Data(int nrows = 200)
|
||||
: slsDetectorData<uint16_t>(400, nrows*2,2* 400*nrows*2 + DATA_OFFSET),
|
||||
nRows(nrows) {
|
||||
|
||||
std::cout << "MOENCH width new firmware " << dataSize << std::endl;
|
||||
|
||||
int off=DATA_OFFSET;
|
||||
for (int ix = 0; ix < 400; ix++) {
|
||||
for (int iy = 0; iy < nRows*2; iy++) {
|
||||
dataMap[iy][ix]=off+2*(iy*400+ix);
|
||||
}
|
||||
}
|
||||
|
||||
iframe = 0;
|
||||
// cout << "data struct created" << endl;
|
||||
};
|
||||
|
||||
/**
|
||||
Returns the value of the selected channel for the given dataset as
|
||||
double. \param data pointer to the dataset (including headers etc) \param
|
||||
ix pixel number in the x direction \param iy pixel number in the y
|
||||
direction \returns data for the selected channel, with inversion if
|
||||
required as double
|
||||
|
||||
*/
|
||||
double getValue(char *data, int ix, int iy = 0) override {
|
||||
uint16_t val = getChannel(data, ix, iy) & 0x3fff;
|
||||
return val;
|
||||
};
|
||||
|
||||
virtual void calcGhost(char *data, int ix, int iy) {
|
||||
double val = 0;
|
||||
/* for (int ix=0; ix<25; ix++){ */
|
||||
/* for (int iy=0; iy<200; iy++) { */
|
||||
val = 0;
|
||||
// cout << "** ";
|
||||
for (int isc = 0; isc < 16; isc++) {
|
||||
// for (int ii=0; ii<2; ii++) {
|
||||
val += getChannel(data, ix + 25 * isc, iy);
|
||||
// cout << "(" << isc << "," << val << " " ;
|
||||
val += getChannel(data, ix + 25 * isc, 399 - iy);
|
||||
// cout << val << " " ;
|
||||
// }
|
||||
}
|
||||
ghost[iy][ix] = val; //-6224;
|
||||
// cout << " --"<< endl;
|
||||
/* } */
|
||||
/* } */
|
||||
// cout << "*" << endl;
|
||||
}
|
||||
|
||||
virtual void calcGhost(char *data) {
|
||||
for (int ix = 0; ix < 25; ix++) {
|
||||
for (int iy = 0; iy < 200; iy++) {
|
||||
calcGhost(data, ix, iy);
|
||||
}
|
||||
}
|
||||
// cout << "*" << endl;
|
||||
}
|
||||
|
||||
double getGhost(int ix, int iy) {
|
||||
if (iy < 200)
|
||||
return ghost[iy][ix % 25];
|
||||
if (iy < 400)
|
||||
return ghost[399 - iy][ix % 25];
|
||||
return 0;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Returns the frame number for the given dataset. Purely virtual func.
|
||||
\param buff pointer to the dataset
|
||||
\returns frame number
|
||||
|
||||
*/
|
||||
|
||||
int getFrameNumber(char *buff) {
|
||||
#ifdef RAWDATA
|
||||
return ((sls::defs::sls_receiver_header *)buff)->detHeader.frameNumber;
|
||||
#endif
|
||||
#ifndef RAWDATA
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Returns the packet number for the given dataset. purely virtual func
|
||||
\param buff pointer to the dataset
|
||||
\returns packet number number
|
||||
|
||||
|
||||
|
||||
*/
|
||||
int getPacketNumber(char *buff) {
|
||||
#ifdef RAWDATA
|
||||
return ((sls::defs::sls_receiver_header *)buff)->detHeader.packetNumber;
|
||||
#endif
|
||||
#ifndef RAWDATA
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
char *readNextFrame(std::ifstream &filebin) override {
|
||||
int ff = -1, np = -1;
|
||||
return readNextFrame(filebin, ff, np);
|
||||
}
|
||||
|
||||
// not present in base class
|
||||
virtual char *readNextFrame(std::ifstream &filebin, int &ff) {
|
||||
int np = -1;
|
||||
return readNextFrame(filebin, ff, np);
|
||||
};
|
||||
|
||||
// not present in base class
|
||||
virtual char *readNextFrame(std::ifstream &filebin, int &ff, int &np) {
|
||||
char *data = new char[dataSize];
|
||||
char *d = readNextFrame(filebin, ff, np, data);
|
||||
if (d == NULL) {
|
||||
delete[] data;
|
||||
data = NULL;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
// not present in base class
|
||||
virtual char *readNextFrame(std::ifstream &filebin, int &ff, int &np,
|
||||
char *data) {
|
||||
np = 0;
|
||||
if (filebin.is_open()) {
|
||||
if (filebin.read(data, dataSize)) {
|
||||
ff = getFrameNumber(data);
|
||||
np = getPacketNumber(data);
|
||||
// std::cout << "**" << ff << " " << dataSize << " " << ff << " " << np << std::endl;
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
std::cout << "**" << ff << " " << dataSize << " " << ff << " " << np << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loops over a memory slot until a complete frame is found (i.e. all
|
||||
packets 0 to nPackets, same frame number). purely virtual func \param
|
||||
data pointer to the memory to be analyzed \param ndata reference to the
|
||||
amount of data found for the frame, in case the frame is incomplete at
|
||||
the end of the memory slot \param dsize size of the memory slot to be
|
||||
analyzed \returns pointer to the beginning of the last good frame (might
|
||||
be incomplete if ndata smaller than dataSize), or NULL if no frame is
|
||||
found
|
||||
|
||||
*/
|
||||
char *findNextFrame(char *data, int &ndata, int dsize) override {
|
||||
if (dsize < dataSize)
|
||||
ndata = dsize;
|
||||
else
|
||||
ndata = dataSize;
|
||||
return data;
|
||||
}
|
||||
|
||||
// int getPacketNumber(int x, int y) {return dataMap[y][x]/packetSize;};
|
||||
};
|
||||
|
||||
#endif
|
240
slsDetectorCalibration/dataStructures/moench03v2HalfData.h
Normal file
240
slsDetectorCalibration/dataStructures/moench03v2HalfData.h
Normal file
@ -0,0 +1,240 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#ifndef MOENCH03v2DATA_H
|
||||
#define MOENCH03v2DATA_H
|
||||
//#define MYROOT
|
||||
|
||||
#ifndef MYROOT
|
||||
#include "sls/sls_detector_defs.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef MYROOT
|
||||
|
||||
typedef struct {
|
||||
uint64_t frameNumber;
|
||||
uint32_t expLength;
|
||||
uint32_t packetNumber;
|
||||
uint64_t bunchId;
|
||||
uint64_t timestamp;
|
||||
uint16_t modId;
|
||||
uint16_t row;
|
||||
uint16_t column;
|
||||
uint16_t reserved;
|
||||
uint32_t debug;
|
||||
uint16_t roundRNumber;
|
||||
uint8_t detType;
|
||||
uint8_t version;
|
||||
} sls_detector_header;
|
||||
#define MAX_NUM_PACKETS 512
|
||||
// using sls_bitset = std::bitset<MAX_NUM_PACKETS>;
|
||||
// using bitset_storage = uint8_t[MAX_NUM_PACKETS / 8];
|
||||
struct sls_receiver_header {
|
||||
sls_detector_header detHeader; /**< is the detector header */
|
||||
uint8_t packetsMask[64]; /**< is the packets caught bit mask */
|
||||
};
|
||||
#endif
|
||||
|
||||
#include "slsDetectorData.h"
|
||||
#ifdef RAWDATA
|
||||
#define DATA_OFFSET sizeof(header)
|
||||
#endif
|
||||
#ifndef RAWDATA
|
||||
#define DATA_OFFSET 0
|
||||
#endif
|
||||
|
||||
|
||||
class moench03v2Data : public slsDetectorData<uint16_t> {
|
||||
|
||||
private:
|
||||
int iframe;
|
||||
const int nRows;
|
||||
|
||||
|
||||
|
||||
double ghost[200][25];
|
||||
|
||||
// Single point of definition if we need to customize
|
||||
#ifndef MYROOT
|
||||
using header = sls::defs::sls_receiver_header;
|
||||
#endif
|
||||
#ifdef MYROOT
|
||||
sls_receiver_header header;
|
||||
#endif
|
||||
public:
|
||||
/**
|
||||
Implements the slsReceiverData structure for the moench02 prototype read
|
||||
out by a module i.e. using the slsReceiver (160x160 pixels, 40 packets
|
||||
1286 large etc.) \param c crosstalk parameter for the output buffer
|
||||
|
||||
*/
|
||||
moench03v2Data(int nrows = 200)
|
||||
: slsDetectorData<uint16_t>(400, nrows*2,2* 400*nrows*2 + DATA_OFFSET),
|
||||
nRows(nrows) {
|
||||
|
||||
std::cout << "MOENCH width new firmware " << dataSize << std::endl;
|
||||
|
||||
int off=DATA_OFFSET;
|
||||
for (int ix = 0; ix < 400; ix++) {
|
||||
for (int iy = 0; iy < nRows*2; iy++) {
|
||||
dataMap[iy][ix]=off+2*(iy*400+ix);
|
||||
}
|
||||
}
|
||||
|
||||
iframe = 0;
|
||||
// cout << "data struct created" << endl;
|
||||
};
|
||||
|
||||
/**
|
||||
Returns the value of the selected channel for the given dataset as
|
||||
double. \param data pointer to the dataset (including headers etc) \param
|
||||
ix pixel number in the x direction \param iy pixel number in the y
|
||||
direction \returns data for the selected channel, with inversion if
|
||||
required as double
|
||||
|
||||
*/
|
||||
double getValue(char *data, int ix, int iy = 0) override {
|
||||
uint16_t val = getChannel(data, ix, iy) & 0x3fff;
|
||||
return val;
|
||||
};
|
||||
|
||||
virtual void calcGhost(char *data, int ix, int iy) {
|
||||
double val = 0;
|
||||
/* for (int ix=0; ix<25; ix++){ */
|
||||
/* for (int iy=0; iy<200; iy++) { */
|
||||
val = 0;
|
||||
// cout << "** ";
|
||||
for (int isc = 0; isc < 16; isc++) {
|
||||
// for (int ii=0; ii<2; ii++) {
|
||||
val += getChannel(data, ix + 25 * isc, iy);
|
||||
// cout << "(" << isc << "," << val << " " ;
|
||||
val += getChannel(data, ix + 25 * isc, 399 - iy);
|
||||
// cout << val << " " ;
|
||||
// }
|
||||
}
|
||||
ghost[iy][ix] = val; //-6224;
|
||||
// cout << " --"<< endl;
|
||||
/* } */
|
||||
/* } */
|
||||
// cout << "*" << endl;
|
||||
}
|
||||
|
||||
virtual void calcGhost(char *data) {
|
||||
for (int ix = 0; ix < 25; ix++) {
|
||||
for (int iy = 0; iy < 200; iy++) {
|
||||
calcGhost(data, ix, iy);
|
||||
}
|
||||
}
|
||||
// cout << "*" << endl;
|
||||
}
|
||||
|
||||
double getGhost(int ix, int iy) {
|
||||
if (iy < 200)
|
||||
return ghost[iy][ix % 25];
|
||||
if (iy < 400)
|
||||
return ghost[399 - iy][ix % 25];
|
||||
return 0;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Returns the frame number for the given dataset. Purely virtual func.
|
||||
\param buff pointer to the dataset
|
||||
\returns frame number
|
||||
|
||||
*/
|
||||
|
||||
int getFrameNumber(char *buff) {
|
||||
#ifdef RAWDATA
|
||||
return ((sls::defs::sls_receiver_header *)buff)->detHeader.frameNumber;
|
||||
#endif
|
||||
#ifndef RAWDATA
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Returns the packet number for the given dataset. purely virtual func
|
||||
\param buff pointer to the dataset
|
||||
\returns packet number number
|
||||
|
||||
|
||||
|
||||
*/
|
||||
int getPacketNumber(char *buff) {
|
||||
#ifdef RAWDATA
|
||||
return ((sls::defs::sls_receiver_header *)buff)->detHeader.packetNumber;
|
||||
#endif
|
||||
#ifndef RAWDATA
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
char *readNextFrame(std::ifstream &filebin) override {
|
||||
int ff = -1, np = -1;
|
||||
return readNextFrame(filebin, ff, np);
|
||||
}
|
||||
|
||||
// not present in base class
|
||||
virtual char *readNextFrame(std::ifstream &filebin, int &ff) {
|
||||
int np = -1;
|
||||
return readNextFrame(filebin, ff, np);
|
||||
};
|
||||
|
||||
// not present in base class
|
||||
virtual char *readNextFrame(std::ifstream &filebin, int &ff, int &np) {
|
||||
char *data = new char[dataSize];
|
||||
char *d = readNextFrame(filebin, ff, np, data);
|
||||
if (d == NULL) {
|
||||
delete[] data;
|
||||
data = NULL;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
// not present in base class
|
||||
virtual char *readNextFrame(std::ifstream &filebin, int &ff, int &np,
|
||||
char *data) {
|
||||
np = 0;
|
||||
if (filebin.is_open()) {
|
||||
if (filebin.read(data, dataSize)) {
|
||||
ff = getFrameNumber(data);
|
||||
np = getPacketNumber(data);
|
||||
std::cout << "**" << ff << " " << dataSize << " " << ff << " " << np << std::endl;
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
std::cout << "**" << ff << " " << dataSize << " " << ff << " " << np << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loops over a memory slot until a complete frame is found (i.e. all
|
||||
packets 0 to nPackets, same frame number). purely virtual func \param
|
||||
data pointer to the memory to be analyzed \param ndata reference to the
|
||||
amount of data found for the frame, in case the frame is incomplete at
|
||||
the end of the memory slot \param dsize size of the memory slot to be
|
||||
analyzed \returns pointer to the beginning of the last good frame (might
|
||||
be incomplete if ndata smaller than dataSize), or NULL if no frame is
|
||||
found
|
||||
|
||||
*/
|
||||
char *findNextFrame(char *data, int &ndata, int dsize) override {
|
||||
if (dsize < dataSize)
|
||||
ndata = dsize;
|
||||
else
|
||||
ndata = dataSize;
|
||||
return data;
|
||||
}
|
||||
|
||||
// int getPacketNumber(int x, int y) {return dataMap[y][x]/packetSize;};
|
||||
};
|
||||
|
||||
#endif
|
@ -33,7 +33,7 @@ int main(int argc, char *argv[]) {
|
||||
#ifndef FF
|
||||
if (argc < 9) {
|
||||
cout << "Wrong usage! Should be: " << argv[0]
|
||||
<< " infile etafile outfile runmin runmax ns cmin cmax" << endl;
|
||||
<< " infile etafile outfile runmin runmax ns [cmin cmax xmin xmax ymin ymax]" << endl;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
@ -41,7 +41,7 @@ int main(int argc, char *argv[]) {
|
||||
#ifdef FF
|
||||
if (argc < 7) {
|
||||
cout << "Wrong usage! Should be: " << argv[0]
|
||||
<< " infile etafile runmin runmax cmin cmax" << endl;
|
||||
<< " infile etafile runmin runmax [cmin cmax xmin xmax ymin ymax]" << endl;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
@ -65,13 +65,30 @@ int main(int argc, char *argv[]) {
|
||||
nsubpix = atoi(argv[iarg++]);
|
||||
cout << "Subpix: " << nsubpix << endl;
|
||||
#endif
|
||||
float cmin = atof(argv[iarg++]);
|
||||
float cmax = atof(argv[iarg++]);
|
||||
|
||||
float cmin = 0;
|
||||
float cmax=1000000;
|
||||
if (argc>iarg)
|
||||
cmin=atof(argv[iarg++]);
|
||||
if (argc>iarg)
|
||||
cmax= atof(argv[iarg++]);
|
||||
cout << "Energy min: " << cmin << endl;
|
||||
cout << "Energy max: " << cmax << endl;
|
||||
int xmin=0, xmax=NC, ymin=0, ymax=NR;
|
||||
|
||||
if (argc>iarg)
|
||||
xmin=atof(argv[iarg++]);
|
||||
if (argc>iarg)
|
||||
xmax= atof(argv[iarg++]);
|
||||
|
||||
if (argc>iarg)
|
||||
ymin=atof(argv[iarg++]);
|
||||
if (argc>iarg)
|
||||
ymax= atof(argv[iarg++]);
|
||||
|
||||
// int etabins=500;
|
||||
int etabins = 1000; // nsubpix*2*100;
|
||||
double etamin = -1, etamax = 2;
|
||||
double etamin = -0.25, etamax = 1.25;
|
||||
// double etamin=-0.1, etamax=1.1;
|
||||
// double eta3min = -2, eta3max = 2;
|
||||
double sum, totquad;
|
||||
@ -80,7 +97,7 @@ int main(int argc, char *argv[]) {
|
||||
// double eta3x, eta3y, int3_x, int3_y, noint_x, noint_y;
|
||||
|
||||
int ix, iy, isx, isy;
|
||||
int nframes = 0, lastframe = -1;
|
||||
int nframes = 0, lastframe = -1, iframe, nphFrame;
|
||||
//double d_x, d_y, res = 5, xx, yy;
|
||||
int nph = 0, totph = 0;
|
||||
//badph = 0,
|
||||
@ -98,7 +115,7 @@ int main(int argc, char *argv[]) {
|
||||
// int nSubPixels = nsubpix;
|
||||
#ifndef NOINTERPOLATION
|
||||
eta2InterpolationPosXY *interp =
|
||||
new eta2InterpolationPosXY(NC, NR, nsubpix, nsubpix,etabins,etabins, etamin, etamax);
|
||||
new eta2InterpolationPosXY(NC, NR, nsubpix, nsubpix, etabins, etabins, etamin, etamax);
|
||||
// eta2InterpolationCleverAdaptiveBins *interp=new
|
||||
// eta2InterpolationCleverAdaptiveBins(NC, NR, nsubpix, etabins, etamin,
|
||||
// etamax);
|
||||
@ -107,8 +124,8 @@ int main(int argc, char *argv[]) {
|
||||
noInterpolation *interp = new noInterpolation(NC, NR, nsubpix);
|
||||
#endif
|
||||
|
||||
#ifndef FF
|
||||
int quad;
|
||||
#ifndef FF
|
||||
#ifndef NOINTERPOLATION
|
||||
char fname[10000];
|
||||
int ok;
|
||||
@ -142,19 +159,26 @@ int main(int argc, char *argv[]) {
|
||||
#endif
|
||||
|
||||
int irun;
|
||||
for (irun = runmin; irun < runmax; irun++) {
|
||||
for (irun = runmin; irun <= runmax; irun++) {
|
||||
sprintf(infname, argv[1], irun);
|
||||
#ifndef FF
|
||||
sprintf(outfname, argv[3], irun);
|
||||
#endif
|
||||
|
||||
|
||||
f = fopen(infname, "r");
|
||||
if (f) {
|
||||
cout << infname << endl;
|
||||
nframes = 0;
|
||||
//f0 = -1;
|
||||
|
||||
while (cl.read(f)) {
|
||||
//iff=0;
|
||||
while (fread((void*)&iframe, 1, sizeof(int), f)) {
|
||||
//n=0;
|
||||
if (fread((void*)&nphFrame, 1, sizeof(int), f)) {
|
||||
for (int iph=0; iph<nphFrame; iph++) {
|
||||
//while (cl.read(f)) {
|
||||
if (cl.read(f)) {
|
||||
totph++;
|
||||
if (lastframe != cl.iframe) {
|
||||
lastframe = cl.iframe;
|
||||
@ -165,18 +189,28 @@ int main(int argc, char *argv[]) {
|
||||
nframes++;
|
||||
}
|
||||
// quad=interp->calcQuad(cl.get_cluster(), sum, totquad, sDum);
|
||||
#ifndef FF
|
||||
// #ifndef FF
|
||||
// quad = interp->calcEta(cl.get_cluster(), etax, etay, sum,
|
||||
// totquad, sDum);
|
||||
// #endif
|
||||
// #ifdef FF
|
||||
|
||||
quad = interp->calcEta(cl.get_cluster(), etax, etay, sum,
|
||||
totquad, sDum);
|
||||
#endif
|
||||
#ifdef FF
|
||||
interp->calcEta(cl.get_cluster(), etax, etay, sum,
|
||||
totquad, sDum);
|
||||
#endif
|
||||
|
||||
if (sum > cmin && totquad / sum > 0.8 && totquad / sum < 1.2 &&
|
||||
sum < cmax) {
|
||||
nph++;
|
||||
|
||||
/* cl.print();
|
||||
cout << "(" << etax <<","<< etay <<")"<< quad<< endl;
|
||||
*/
|
||||
//#endif
|
||||
|
||||
if (totquad > cmin && cl.x >= xmin && cl.x <= xmax &&
|
||||
cl.y >= ymin && cl.y <= ymax &&
|
||||
totquad < cmax) {
|
||||
|
||||
// if (sum > cmin && totquad / sum > 0.8 && totquad / sum < 1.2 &&
|
||||
// sum < cmax) {
|
||||
nph++;
|
||||
// if (sum>200 && sum<580) {
|
||||
// interp->getInterpolatedPosition(cl.x,cl.y,
|
||||
// totquad,quad,cl.get_cluster(),int_x, int_y);
|
||||
@ -227,9 +261,12 @@ int main(int argc, char *argv[]) {
|
||||
#ifdef FF
|
||||
interp->writeFlatField(outfname);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
#ifdef FF
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#ifndef MOENCH04
|
||||
#ifndef RECT
|
||||
#include "moench03T1ReceiverDataNew.h"
|
||||
#include "moench03v2Data.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -41,34 +41,148 @@ using namespace std;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
if (argc < 4) {
|
||||
std::map<std::string, std::string> args = {
|
||||
{"numfiles","1"},
|
||||
{"nthreads","5"},
|
||||
{"fifosize","5000"},
|
||||
{"nsigma","5"},
|
||||
{"gainfile","none"},
|
||||
{"detectorMode","counting"},
|
||||
{"threshold","0"},
|
||||
{"pedestalfile","none"},
|
||||
{"nframes","0"},
|
||||
{"xMin","0"},
|
||||
{"xMax","400"},
|
||||
{"yMin","0"},
|
||||
{"yMax","400"},
|
||||
{"eMin","0"},
|
||||
{"eMax","16000"},
|
||||
{"outdir","./"},
|
||||
{"indir","./"},
|
||||
{"flist","none"},
|
||||
{"fformat","none"},
|
||||
{"runmin","0"},
|
||||
{"runmax","-1"},
|
||||
{"readnrows","400"}
|
||||
};
|
||||
//float *gm;
|
||||
|
||||
int ff, np;
|
||||
// cout << " data size is " << dsize;
|
||||
|
||||
ifstream filebin;
|
||||
if (argc < 4) {
|
||||
std::string name, value,sline;
|
||||
int ic=0;
|
||||
ifstream flist;
|
||||
flist.open (argv[1], std::ifstream::in);
|
||||
if (flist.is_open()) {
|
||||
cout << "Using config file " <<argv[1] << endl;
|
||||
while (std::getline(flist,sline)){
|
||||
if (sline.at(0)!='#') {
|
||||
ic=sline.find(' ');
|
||||
name = sline.substr(0,ic);
|
||||
value = sline.substr(ic+1,sline.size()-ic);
|
||||
args[name]=value;
|
||||
}
|
||||
|
||||
}
|
||||
flist.close();
|
||||
} else {
|
||||
cout << "Usage is " << argv[0]
|
||||
<< "indir outdir fname(no extension) [runmin] [runmax] [pedfile (raw or tiff)] [threshold] "
|
||||
"[nframes] [xmin xmax ymin ymax] [gainmap]"
|
||||
"[nframes] [xmin xmax ymin ymax] [gainmap]"
|
||||
<< endl;
|
||||
cout << "threshold <0 means analog; threshold=0 means cluster finder; "
|
||||
"threshold>0 means photon counting"
|
||||
"threshold>0 means photon counting"
|
||||
<< endl;
|
||||
cout << "nframes <0 means sum everything; nframes=0 means one file per "
|
||||
"run; nframes>0 means one file every nframes"
|
||||
"run; nframes>0 means one file every nframes"
|
||||
<< endl;
|
||||
return 1;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
} else {
|
||||
args["indir"]=argv[1];
|
||||
args["outdir"]=argv[1];
|
||||
args["fformat"]=argv[3];
|
||||
if (argc >= 5) {
|
||||
args["runmin"] = argv[4];
|
||||
}
|
||||
args["runmax"] = args["runmin"];
|
||||
|
||||
if (argc >= 6) {
|
||||
args["runmax"] = argv[5];
|
||||
}
|
||||
if (argc >= 7) {
|
||||
args["pedestalfile"] = argv[6];
|
||||
}
|
||||
if (argc >= 8) {
|
||||
args["threshold"] = argv[7];
|
||||
}
|
||||
if (argc >= 9) {
|
||||
args["nframes"] = argv[8];
|
||||
}
|
||||
if (argc >= 13) {
|
||||
args["xMin"] = argv[9];
|
||||
args["xMax"] = argv[10];
|
||||
args["yMin"] = argv[11];
|
||||
args["yMax"] = argv[12];
|
||||
}
|
||||
if (argc > 13) {
|
||||
args["gainfile"] = argv[13];
|
||||
}
|
||||
|
||||
if (atof(args["threshold"].c_str())<0) {
|
||||
args["detectorMode"]="analog";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int fifosize = 1000;
|
||||
int nthreads = 10;
|
||||
|
||||
|
||||
for (auto const& x : args)
|
||||
{
|
||||
std::cout << x.first // string (key)
|
||||
<< ':'
|
||||
<< x.second // string's value
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
|
||||
string indir=args["indir"];
|
||||
string outdir = args["outdir"];
|
||||
string fformat= args["fformat"];
|
||||
int runmin = atoi(args["runmin"].c_str());
|
||||
int runmax = atoi(args["runmin"].c_str());
|
||||
string pedfile =args["pedestalfile"];
|
||||
double thr = atof(args["threshold"].c_str());
|
||||
double thr1 = 1;
|
||||
|
||||
int nframes = atoi(args["nframes"].c_str());
|
||||
|
||||
int xmin = atoi(args["xMin"].c_str()), xmax = atoi(args["xMax"].c_str()), ymin = atoi(args["yMin"].c_str()), ymax = atoi(args["yMax"].c_str());
|
||||
|
||||
string gainfname=args["gainfile"];
|
||||
|
||||
int fifosize = atoi(args["fifosize"].c_str());
|
||||
int nthreads = atoi(args["nthreads"].c_str());
|
||||
int nsigma = atoi(args["nsigma"].c_str());
|
||||
int nrows = atoi(args["readnrows"].c_str());
|
||||
float eMin = atof(args["eMin"].c_str());
|
||||
float eMax = atof(args["eMax"].c_str());
|
||||
int csize = 3;
|
||||
int nsigma = 5;
|
||||
int nped = 10000;
|
||||
int nped = 1000;
|
||||
|
||||
int cf = 0;
|
||||
int numberOfPackets=40;
|
||||
|
||||
int numberOfPackets=nrows/8;
|
||||
|
||||
#ifdef RECT
|
||||
cout << "Should be rectangular but now it will crash! No data structure defined!" << endl;
|
||||
#endif
|
||||
|
||||
#ifndef MOENCH04
|
||||
moench03T1ReceiverDataNew *decoder = new moench03T1ReceiverDataNew();
|
||||
moench03v2Data *decoder = new moench03v2Data(100);
|
||||
cout << "MOENCH03!" << endl;
|
||||
#endif
|
||||
|
||||
@ -86,62 +200,10 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
#endif
|
||||
|
||||
//Read detector size from decoder
|
||||
int nx , ny;
|
||||
decoder->getDetectorSize(nx, ny);
|
||||
|
||||
//float *gm;
|
||||
|
||||
int ff, np;
|
||||
// cout << " data size is " << dsize;
|
||||
|
||||
ifstream filebin;
|
||||
char *indir = argv[1];
|
||||
char *outdir = argv[2];
|
||||
char *fformat = argv[3];
|
||||
int runmin = 0;
|
||||
|
||||
// cout << "argc is " << argc << endl;
|
||||
if (argc >= 5) {
|
||||
runmin = atoi(argv[4]);
|
||||
}
|
||||
|
||||
int runmax = runmin;
|
||||
|
||||
if (argc >= 6) {
|
||||
runmax = atoi(argv[5]);
|
||||
}
|
||||
|
||||
char *pedfile = NULL;
|
||||
if (argc >= 7) {
|
||||
pedfile = argv[6];
|
||||
}
|
||||
double thr = 0;
|
||||
double thr1 = 1;
|
||||
|
||||
if (argc >= 8) {
|
||||
thr = atof(argv[7]);
|
||||
}
|
||||
|
||||
int nframes = 0;
|
||||
|
||||
if (argc >= 9) {
|
||||
nframes = atoi(argv[8]);
|
||||
}
|
||||
|
||||
int xmin = 0, xmax = nx, ymin = 0, ymax = ny;
|
||||
if (argc >= 13) {
|
||||
xmin = atoi(argv[9]);
|
||||
xmax = atoi(argv[10]);
|
||||
ymin = atoi(argv[11]);
|
||||
ymax = atoi(argv[12]);
|
||||
}
|
||||
|
||||
char *gainfname = NULL;
|
||||
if (argc > 13) {
|
||||
gainfname = argv[13];
|
||||
cout << "Gain map file name is: " << gainfname << endl;
|
||||
}
|
||||
//Read detector size from decoder
|
||||
|
||||
char ffname[10000];
|
||||
char fname[10000];
|
||||
@ -151,17 +213,6 @@ int main(int argc, char *argv[]) {
|
||||
std::time_t end_time;
|
||||
|
||||
FILE *of = NULL;
|
||||
cout << "input directory is " << indir << endl;
|
||||
cout << "output directory is " << outdir << endl;
|
||||
cout << "input file is " << fformat << endl;
|
||||
cout << "runmin is " << runmin << endl;
|
||||
cout << "runmax is " << runmax << endl;
|
||||
if (pedfile)
|
||||
cout << "pedestal file is " << pedfile << endl;
|
||||
if (thr > 0)
|
||||
cout << "threshold is " << thr << endl;
|
||||
cout << "Nframes is " << nframes << endl;
|
||||
|
||||
uint32_t nnx, nny;
|
||||
|
||||
|
||||
@ -182,26 +233,26 @@ int main(int argc, char *argv[]) {
|
||||
singlePhotonDetector *filter = new singlePhotonDetector(
|
||||
decoder, csize, nsigma, 1, cm, nped, 200, -1, -1, gainmap, gs);
|
||||
|
||||
if (gainfname) {
|
||||
//if (gainfname) {
|
||||
|
||||
if (filter->readGainMap(gainfname))
|
||||
if (filter->readGainMap(gainfname.c_str()))
|
||||
cout << "using gain map " << gainfname << endl;
|
||||
else
|
||||
cout << "Could not open gain map " << gainfname << endl;
|
||||
} else
|
||||
thr = 0.15 * thr;
|
||||
// } else
|
||||
thr = 0.15 * thr;
|
||||
filter->newDataSet();
|
||||
//int dsize = decoder->getDataSize();
|
||||
|
||||
if (thr > 0) {
|
||||
cout << "threshold is " << thr << endl;
|
||||
filter->setThreshold(thr);
|
||||
cf = 0;
|
||||
|
||||
cout << "threshold is " << thr << endl;
|
||||
filter->setThreshold(thr);
|
||||
cf = 0;
|
||||
} else
|
||||
cf = 1;
|
||||
cf = 1;
|
||||
|
||||
filter->setROI(xmin, xmax, ymin, ymax);
|
||||
filter->setEnergyRange(eMin, eMax);
|
||||
std::time(&end_time);
|
||||
cout << std::ctime(&end_time) << endl;
|
||||
|
||||
@ -211,21 +262,33 @@ int main(int argc, char *argv[]) {
|
||||
// multiThreadedAnalogDetector(filter,nthreads,fifosize);
|
||||
multiThreadedCountingDetector *mt =
|
||||
new multiThreadedCountingDetector(filter, nthreads, fifosize);
|
||||
#ifndef ANALOG
|
||||
mt->setDetectorMode(ePhotonCounting);
|
||||
cout << "Counting!" << endl;
|
||||
if (thr > 0) {
|
||||
|
||||
if (args["detectorMode"]=="counting") {
|
||||
mt->setDetectorMode(ePhotonCounting);
|
||||
if (thr > 0) {
|
||||
cf = 0;
|
||||
}
|
||||
} else {
|
||||
mt->setDetectorMode(eAnalog);
|
||||
cf = 0;
|
||||
}
|
||||
#endif
|
||||
//{
|
||||
#ifdef ANALOG
|
||||
mt->setDetectorMode(eAnalog);
|
||||
cout << "Analog!" << endl;
|
||||
cf = 0;
|
||||
// thr1=thr;
|
||||
#endif
|
||||
// }
|
||||
|
||||
|
||||
// #ifndef ANALOG
|
||||
// mt->setDetectorMode(ePhotonCounting);
|
||||
// cout << "Counting!" << endl;
|
||||
// if (thr > 0) {
|
||||
// cf = 0;
|
||||
// }
|
||||
// #endif
|
||||
// //{
|
||||
// #ifdef ANALOG
|
||||
// mt->setDetectorMode(eAnalog);
|
||||
// cout << "Analog!" << endl;
|
||||
// cf = 0;
|
||||
// // thr1=thr;
|
||||
// #endif
|
||||
// // }
|
||||
|
||||
mt->StartThreads();
|
||||
mt->popFree(buff);
|
||||
@ -236,18 +299,19 @@ int main(int argc, char *argv[]) {
|
||||
char froot[1000];
|
||||
double *ped=new double[nx * ny];//, *ped1;
|
||||
int pos,pos1;
|
||||
//return 0;
|
||||
|
||||
if (pedfile) {
|
||||
if (string(pedfile).find(".raw") != std::string::npos) {
|
||||
pos1=string(pedfile).rfind("/");
|
||||
strcpy(froot,pedfile+pos1);
|
||||
pos=string(froot).find(".raw");
|
||||
froot[pos]='\0';
|
||||
}
|
||||
if (pedfile.find(".raw") != std::string::npos) {
|
||||
pos1=pedfile.rfind("/");
|
||||
strcpy(froot,pedfile.substr(pos1).c_str());
|
||||
pos=string(froot).find(".raw");
|
||||
froot[pos]='\0';
|
||||
}
|
||||
|
||||
cout << "PEDESTAL " << endl;
|
||||
if (pedfile.find(".tif") == std::string::npos) {
|
||||
sprintf(fname, "%s", pedfile.c_str());
|
||||
|
||||
cout << "PEDESTAL " << endl;
|
||||
if (string(pedfile).find(".tif") == std::string::npos) {
|
||||
sprintf(fname, "%s", pedfile);
|
||||
cout << fname << endl;
|
||||
std::time(&end_time);
|
||||
//cout << "aaa" << std::ctime(&end_time) << endl;
|
||||
@ -257,63 +321,100 @@ int main(int argc, char *argv[]) {
|
||||
filebin.open((const char *)(fname), ios::in | ios::binary);
|
||||
// //open file
|
||||
if (filebin.is_open()) {
|
||||
ff = -1;
|
||||
ff = -1;
|
||||
while (decoder->readNextFrame(filebin, ff, np, buff)) {
|
||||
if (np == numberOfPackets) {
|
||||
mt->pushData(buff);
|
||||
|
||||
if (np == numberOfPackets) {
|
||||
mt->pushData(buff);
|
||||
mt->nextThread();
|
||||
mt->popFree(buff);
|
||||
ifr++;
|
||||
if (ifr % 100 == 0)
|
||||
cout << ifr << " " << ff << " " << np << endl;
|
||||
} else
|
||||
cout << ifr << " " << ff << " " << np << endl;
|
||||
if (ifr % 100 == 0)
|
||||
|
||||
cout << ifr << " " << ff << " " << np << endl;
|
||||
// break;
|
||||
} else {
|
||||
cout << ifr << " " << ff << " " << np << endl;
|
||||
break;
|
||||
}
|
||||
ff = -1;
|
||||
}
|
||||
filebin.close();
|
||||
while (mt->isBusy()) {
|
||||
;
|
||||
}
|
||||
|
||||
sprintf(imgfname, "%s/%s_ped.tiff", outdir,froot);
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
sprintf(imgfname, "%s/%s_ped.tiff", outdir.c_str(),froot);
|
||||
mt->writePedestal(imgfname);
|
||||
sprintf(imgfname, "%s/%s_var.tiff", outdir,froot);
|
||||
sprintf(imgfname, "%s/%s_var.tiff", outdir.c_str(),froot);
|
||||
mt->writePedestalRMS(imgfname);
|
||||
} else
|
||||
cout << "Could not open pedestal file " << fname
|
||||
<< " for reading " << endl;
|
||||
} else {
|
||||
float *pp = ReadFromTiff(pedfile, nny, nnx);
|
||||
if (pp && (int)nnx == nx && (int)nny == ny) {
|
||||
for (int i = 0; i < nx * ny; i++) {
|
||||
cout << "Could not open pedestal file " << fname
|
||||
<< " for reading " << endl;
|
||||
} else {
|
||||
float *pp = ReadFromTiff(pedfile.c_str(), nny, nnx);
|
||||
if (pp && (int)nnx == nx && (int)nny == ny) {
|
||||
for (int i = 0; i < nx * ny; i++) {
|
||||
ped[i] = pp[i];
|
||||
}
|
||||
delete[] pp;
|
||||
mt->setPedestal(ped);
|
||||
cout << "Pedestal set from tiff file " << pedfile << endl;
|
||||
} else {
|
||||
cout << "Could not open pedestal tiff file " << pedfile
|
||||
}
|
||||
delete[] pp;
|
||||
mt->setPedestal(ped);
|
||||
cout << "Pedestal set from tiff file " << pedfile << endl;
|
||||
} else {
|
||||
cout << "Could not open pedestal tiff file " << pedfile
|
||||
<< " for reading " << endl;
|
||||
}
|
||||
}
|
||||
std::time(&end_time);
|
||||
cout << std::ctime(&end_time) << endl;
|
||||
}
|
||||
}
|
||||
std::time(&end_time);
|
||||
cout << std::ctime(&end_time) << endl;
|
||||
|
||||
|
||||
ifr = 0;
|
||||
int ifile = 0;
|
||||
|
||||
mt->setFrameMode(eFrame);
|
||||
//t filelist=0;
|
||||
ifstream flist;
|
||||
flist.open (args["flist"].c_str(), std::ifstream::in);
|
||||
if (flist.is_open()) {
|
||||
cout << "Using file list" << endl;
|
||||
runmin=0;
|
||||
runmax=0;
|
||||
while (flist.getline(ffname,10000)){
|
||||
cout << ffname << endl;
|
||||
runmax++;
|
||||
}
|
||||
runmax--;
|
||||
flist.close();
|
||||
cout << "Found " << runmax << " files " << endl;
|
||||
flist.open (fformat, std::ifstream::in);
|
||||
}
|
||||
|
||||
for (int irun = runmin; irun <= runmax; irun++) {
|
||||
cout << "DATA ";
|
||||
// sprintf(fn,fformat,irun);
|
||||
sprintf(ffname, "%s/%s.raw", indir, fformat);
|
||||
sprintf(fname, (const char*)ffname, irun);
|
||||
sprintf(ffname, "%s/%s.tiff", outdir, fformat);
|
||||
sprintf(imgfname, (const char*)ffname, irun);
|
||||
sprintf(ffname, "%s/%s.clust", outdir, fformat);
|
||||
sprintf(cfname, (const char*)ffname, irun);
|
||||
// sprintf(ffname, "%s/%s.raw", indir, fformat);
|
||||
// sprintf(fname, (const char*)ffname, irun);
|
||||
// sprintf(ffname, "%s/%s.tiff", outdir, fformat);
|
||||
// sprintf(imgfname, (const char*)ffname, irun);
|
||||
// sprintf(ffname, "%s/%s.clust", outdir, fformat);
|
||||
// sprintf(cfname, (const char*)ffname, irun);
|
||||
if (flist.is_open()) {
|
||||
flist.getline(ffname,10000);
|
||||
cout << "file list " << ffname << endl;
|
||||
} else {
|
||||
//sprintf(ffname,(const char*)fformat,irun);
|
||||
sprintf(ffname,args["fformat"].c_str(),irun);
|
||||
cout << "loop " << ffname << endl;
|
||||
}
|
||||
cout << "ffname "<< ffname << endl;
|
||||
sprintf(fname, "%s/%s.raw",indir.c_str(),ffname);
|
||||
sprintf(imgfname, "%s/%s.tiff",outdir.c_str(),ffname);
|
||||
sprintf(cfname, "%s/%s.clust",outdir.c_str(),ffname);
|
||||
|
||||
|
||||
cout << fname << " ";
|
||||
cout << imgfname << endl;
|
||||
std::time(&end_time);
|
||||
@ -323,7 +424,7 @@ int main(int argc, char *argv[]) {
|
||||
// //open file
|
||||
ifile = 0;
|
||||
if (filebin.is_open()) {
|
||||
if (thr <= 0 && cf != 0) { // cluster finder
|
||||
if (cf != 0) { // cluster finder
|
||||
if (of == NULL) {
|
||||
of = fopen(cfname, "w");
|
||||
if (of) {
|
||||
@ -341,7 +442,8 @@ int main(int argc, char *argv[]) {
|
||||
ff = -1;
|
||||
ifr = 0;
|
||||
while (decoder->readNextFrame(filebin, ff, np, buff)) {
|
||||
if (np == numberOfPackets) {
|
||||
|
||||
if (np == numberOfPackets) {
|
||||
// //push
|
||||
mt->pushData(buff);
|
||||
// // //pop
|
||||
@ -350,21 +452,27 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
ifr++;
|
||||
if (ifr % 100 == 0)
|
||||
cout << ifr << " " << ff << endl;
|
||||
cout << ifr << " " << ff << " " << np << endl;
|
||||
//break;
|
||||
if (nframes > 0) {
|
||||
if (ifr % nframes == 0) {
|
||||
sprintf(ffname, "%s/%s_f%05d.tiff", outdir, fformat,
|
||||
ifile);
|
||||
sprintf(imgfname, (const char*)ffname, irun);
|
||||
// sprintf(ffname, "%s/%s_f%05d.tiff", outdir, fformat,
|
||||
// ifile);
|
||||
// sprintf(imgfname, (const char*)ffname, irun);
|
||||
sprintf(imgfname, "%s/%s_f%05d.tiff",outdir.c_str(),ffname,ifile);
|
||||
while (mt->isBusy())
|
||||
;
|
||||
|
||||
mt->writeImage(imgfname, thr1);
|
||||
mt->clearImage();
|
||||
ifile++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cout << "bp " << ifr << " " << ff << " " << np << endl;
|
||||
//break;
|
||||
}
|
||||
} else {
|
||||
cout << "bp " << ifr << " " << ff << " " << np << endl;
|
||||
|
||||
//break;
|
||||
}
|
||||
ff = -1;
|
||||
}
|
||||
cout << "--" << endl;
|
||||
@ -374,13 +482,17 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
if (nframes >= 0) {
|
||||
if (nframes > 0) {
|
||||
sprintf(ffname, "%s/%s_f%05d.tiff", outdir, fformat, ifile);
|
||||
sprintf(imgfname, (const char*)ffname, irun);
|
||||
sprintf(imgfname, "%s/%s_f%05d.tiff",outdir.c_str(),ffname,ifile);
|
||||
// sprintf(ffname, "%s/%s_f%05d.tiff", outdir, fformat, ifile);
|
||||
//sprintf(imgfname, (const char*)ffname, irun);
|
||||
} else {
|
||||
sprintf(ffname, "%s/%s.tiff", outdir, fformat);
|
||||
sprintf(imgfname, (const char*)ffname, irun);
|
||||
sprintf(imgfname, "%s/%s.tiff",outdir.c_str(),ffname);
|
||||
// sprintf(ffname, "%s/%s.tiff", outdir, fformat);
|
||||
// sprintf(imgfname, (const char*)ffname, irun);
|
||||
}
|
||||
cout << "Writing tiff to " << imgfname << " " << thr1 << endl;
|
||||
while (mt->isBusy())
|
||||
;
|
||||
mt->writeImage(imgfname, thr1);
|
||||
mt->clearImage();
|
||||
if (of) {
|
||||
@ -395,11 +507,16 @@ int main(int argc, char *argv[]) {
|
||||
cout << "Could not open " << fname << " for reading " << endl;
|
||||
}
|
||||
if (nframes < 0) {
|
||||
sprintf(ffname, "%s/%s.tiff", outdir, fformat);
|
||||
strcpy(imgfname, ffname);
|
||||
cout << "Writing tiff to " << imgfname << " " << thr1 << endl;
|
||||
mt->writeImage(imgfname, thr1);
|
||||
//sprintf(ffname, "%s/%s.tiff", outdir, fformat);
|
||||
// strcpy(imgfname, ffname);
|
||||
sprintf(imgfname, "%s/%s_tot.tiff",outdir.c_str(),ffname);
|
||||
cout << "Writing tiff to " << imgfname << " " << thr1 << endl;
|
||||
while (mt->isBusy())
|
||||
;
|
||||
mt->writeImage(imgfname, thr1);
|
||||
}
|
||||
if (flist.is_open()) {
|
||||
flist.close();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -13,7 +13,8 @@
|
||||
#include "sls/sls_detector_defs.h"
|
||||
#ifndef MOENCH04
|
||||
//#ifndef RECT
|
||||
#include "moench03T1ZmqDataNew.h"
|
||||
#include "moench03v2Data.h"
|
||||
//#include "moench03T1ZmqDataNew.h"
|
||||
//#endif
|
||||
//#ifdef RECT
|
||||
//#include "moench03T1ZmqDataNewRect.h"
|
||||
@ -31,6 +32,7 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include <rapidjson/document.h> //json header in zmq stream
|
||||
|
||||
@ -64,35 +66,47 @@ int main(int argc, char *argv[]) {
|
||||
* number]
|
||||
*
|
||||
*/
|
||||
FILE *of = NULL;
|
||||
int fifosize = 5000;
|
||||
std::map<std::string, std::string> args = {
|
||||
{"numinterfaces","1"},
|
||||
{"rx_zmqip","10.1.2.102"},
|
||||
{"rx_zmqport","7770"},
|
||||
{"zmqip","129.129.202.153"},
|
||||
{"zmqport","7780"},
|
||||
{"nthreads","5"},
|
||||
{"fifosize","5000"},
|
||||
{"nsigma","5"},
|
||||
{"gainfile","none"},
|
||||
{"nbinsx","5"},
|
||||
{"nbinsy","5"},
|
||||
{"etafile","none"},
|
||||
{"etabinsx","1000"},
|
||||
{"etamin","-1"},
|
||||
{"etamax","2"} };
|
||||
FILE *of = NULL;
|
||||
int etabins = 1000, etabinsy = 1000; // nsubpix*2*100;
|
||||
double etamin = -1, etamax = 2;
|
||||
int nSubPixelsX = 2;
|
||||
int emin, emax;
|
||||
int nSubPixelsY = 2;
|
||||
int nthreads = 5;
|
||||
int fifosize = 5000;
|
||||
uint32_t nSigma = 5;
|
||||
|
||||
// help
|
||||
if (argc < 3) {
|
||||
cprintf(RED, "Help: ./trial [receive socket ip] [receive starting port "
|
||||
"number] [send_socket ip] [send starting port number] "
|
||||
"[nthreads] [nsubpix] [gainmap] [etafile]\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
string etafname;// = NULL;
|
||||
string gainfname;// = NULL;
|
||||
|
||||
// receive parameters
|
||||
bool send = false;
|
||||
char *socketip = argv[1];
|
||||
uint32_t portnum = atoi(argv[2]);
|
||||
// send parameters if any
|
||||
char *socketip2 = 0;
|
||||
string socketip2;// = 0;
|
||||
uint32_t portnum2 = 0;
|
||||
string socketip;// = 0;
|
||||
uint32_t portnum = 0;
|
||||
|
||||
sls::zmqHeader zHeader, outHeader;
|
||||
zHeader.jsonversion = SLS_DETECTOR_JSON_HEADER_VERSION;
|
||||
outHeader.jsonversion = SLS_DETECTOR_JSON_HEADER_VERSION;
|
||||
|
||||
uint32_t nSigma = 5;
|
||||
|
||||
int ok;
|
||||
|
||||
@ -102,48 +116,85 @@ int main(int argc, char *argv[]) {
|
||||
// time_t begin,end,finished;
|
||||
int rms = 0;
|
||||
|
||||
if (argc > 4) {
|
||||
socketip2 = argv[3];
|
||||
portnum2 = atoi(argv[4]);
|
||||
if (portnum2 > 0)
|
||||
send = true;
|
||||
}
|
||||
cout << "\nrx socket ip : " << socketip << "\nrx port num : " << portnum;
|
||||
if (send) {
|
||||
cout << "\ntx socket ip : " << socketip2
|
||||
<< "\ntx port num : " << portnum2;
|
||||
}
|
||||
int nthreads = 5;
|
||||
if (argc > 5)
|
||||
nthreads = atoi(argv[5]);
|
||||
send = true;
|
||||
// help
|
||||
if (argc < 5) {
|
||||
std::string name, value,sline;
|
||||
int ic=0;
|
||||
ifstream flist;
|
||||
flist.open (argv[1], std::ifstream::in);
|
||||
if (flist.is_open()) {
|
||||
cout << "Using config file " <<argv[1] << endl;
|
||||
while (std::getline(flist,sline)){
|
||||
if (sline.at(0)!='#') {
|
||||
ic=sline.find(' ');
|
||||
name = sline.substr(0,ic);
|
||||
value = sline.substr(ic+1,sline.size()-ic);
|
||||
args[name]=value;
|
||||
}
|
||||
|
||||
cout << "Number of threads is: " << nthreads << endl;
|
||||
if (argc > 6) {
|
||||
nSubPixelsX = atoi(argv[6]);
|
||||
nSubPixelsY = nSubPixelsX;
|
||||
#ifdef RECT
|
||||
nSubPixelsX = 2;
|
||||
#endif
|
||||
}
|
||||
cout << "Number of subpixels is: " << nSubPixelsX << " " << nSubPixelsY
|
||||
<< endl;
|
||||
}
|
||||
flist.close();
|
||||
} else {
|
||||
cprintf(RED, "Arguments are either: \n [config file] \n or the following list (deprecated): [receive socket ip] [receive starting port "
|
||||
"number] [send_socket ip] [send starting port number] "
|
||||
"[nthreads] [nsubpix] [gainmap] [etafile]\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
} else {
|
||||
args["rx_zmqip"]=argv[1];
|
||||
args["rx_zmqport"]=argv[2];
|
||||
|
||||
args["zmqip"]=argv[3];
|
||||
args["zmqport"]=argv[4];
|
||||
if (argc > 5)
|
||||
args["nthreads"] = argv[5];
|
||||
if (argc > 6) {
|
||||
args["nbinsx"]=argv[6];
|
||||
args["nbinsy"]=argv[6];
|
||||
}
|
||||
|
||||
if (argc > 7) {
|
||||
args["gainfile"]=argv[7];
|
||||
}
|
||||
if (argc > 8) {
|
||||
args["etafilefile"]=argv[8];
|
||||
}
|
||||
|
||||
char *gainfname = NULL;
|
||||
if (argc > 7) {
|
||||
gainfname = argv[7];
|
||||
cout << "Gain map file name is: " << gainfname << endl;
|
||||
}
|
||||
|
||||
char *etafname = NULL;
|
||||
if (argc > 8) {
|
||||
etafname = argv[8];
|
||||
cout << "Eta file name is: " << etafname << endl;
|
||||
for (auto const& x : args)
|
||||
{
|
||||
std::cout << x.first // string (key)
|
||||
<< ':'
|
||||
<< x.second // string's value
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
socketip = args["rx_zmqip"];
|
||||
portnum = atoi(args["rx_zmqport"].c_str());
|
||||
|
||||
socketip2 = args["zmqip"];
|
||||
portnum2 = atoi(args["zmqport"].c_str());
|
||||
|
||||
nthreads = atoi(args["nthreads"].c_str());
|
||||
nSubPixelsX =atoi(args["nbinsx"].c_str());
|
||||
nSubPixelsY =atoi(args["nbinsy"].c_str());
|
||||
gainfname = args["gainfile"];
|
||||
etafname = args["etafilefile"];
|
||||
|
||||
if (atoi(args["nuninterfaces"].c_str())>1){
|
||||
cprintf(RED, "Sorry, at the moment only a single interface is supported instead of %d\n",atoi(args["nuninterfaces"].c_str()));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
// slsDetectorData *det=new moench03T1ZmqDataNew();
|
||||
#ifndef MOENCH04
|
||||
cout << "This is a Moench03" << endl;
|
||||
moench03T1ZmqDataNew *det = new moench03T1ZmqDataNew();
|
||||
cout << "This is a Moench03 v2" << endl;
|
||||
//moench03T1ZmqDataNew *det = new moench03T1ZmqDataNew();
|
||||
moench03v2Data *det = new moench03v2Data();
|
||||
cout << "MOENCH03!" << endl;
|
||||
#endif
|
||||
#ifdef MOENCH04
|
||||
cout << "This is a Moench04" << endl;
|
||||
@ -177,8 +228,8 @@ int main(int argc, char *argv[]) {
|
||||
double *gmap = NULL;
|
||||
|
||||
uint32_t nnnx, nnny;
|
||||
if (gainfname) {
|
||||
gm = ReadFromTiff(gainfname, nnny, nnnx);
|
||||
//if (gainfname) {
|
||||
gm = ReadFromTiff(gainfname.c_str(), nnny, nnnx);
|
||||
if (gm && nnnx == (uint)npx && nnny == (uint)npy) {
|
||||
gmap = new double[npx * npy];
|
||||
for (int i = 0; i < npx * npy; i++) {
|
||||
@ -187,7 +238,7 @@ int main(int argc, char *argv[]) {
|
||||
delete[] gm;
|
||||
} else
|
||||
cout << "Could not open gain map " << gainfname << endl;
|
||||
}
|
||||
//}
|
||||
|
||||
// analogDetector<uint16_t> *filter=new
|
||||
// analogDetector<uint16_t>(det,1,NULL,1000);
|
||||
@ -205,8 +256,8 @@ int main(int argc, char *argv[]) {
|
||||
eta2InterpolationPosXY *interp = new eta2InterpolationPosXY(
|
||||
npx, npy, nSubPixelsX, nSubPixelsY, etabins, etabinsy, etamin, etamax);
|
||||
|
||||
if (etafname)
|
||||
interp->readFlatField(etafname);
|
||||
//if (etafname)
|
||||
interp->readFlatField(etafname.c_str());
|
||||
|
||||
interpolatingDetector *filter = new interpolatingDetector(
|
||||
det, interp, nSigma, 1, cm, 1000, 10, -1, -1, gainmap, gs);
|
||||
@ -226,13 +277,13 @@ int main(int argc, char *argv[]) {
|
||||
try {
|
||||
#endif
|
||||
|
||||
zmqsocket = new sls::ZmqSocket(socketip, portnum);
|
||||
zmqsocket = new sls::ZmqSocket(socketip.c_str(), portnum);
|
||||
|
||||
#ifdef NEWZMQ
|
||||
} catch (...) {
|
||||
cprintf(RED,
|
||||
"Error: Could not create Zmq socket on port %d with ip %s\n",
|
||||
portnum, socketip);
|
||||
portnum, socketip.c_str());
|
||||
delete zmqsocket;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
@ -242,7 +293,7 @@ int main(int argc, char *argv[]) {
|
||||
if (zmqsocket->IsError()) {
|
||||
cprintf(RED,
|
||||
"Error: Could not create Zmq socket on port %d with ip %s\n",
|
||||
portnum, socketip);
|
||||
portnum, socketip.c_str());
|
||||
delete zmqsocket;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
@ -263,14 +314,14 @@ int main(int argc, char *argv[]) {
|
||||
// receive socket
|
||||
try {
|
||||
#endif
|
||||
zmqsocket2 = new sls::ZmqSocket(portnum2, socketip2);
|
||||
zmqsocket2 = new sls::ZmqSocket(portnum2, socketip2.c_str());
|
||||
|
||||
#ifdef NEWZMQ
|
||||
} catch (...) {
|
||||
cprintf(RED,
|
||||
"Error: Could not create Zmq socket server on port %d and "
|
||||
"ip %s\n",
|
||||
portnum2, socketip2);
|
||||
portnum2, socketip2.c_str());
|
||||
// delete zmqsocket2;
|
||||
// zmqsocket2=NULL;
|
||||
// delete zmqsocket;
|
||||
@ -284,7 +335,7 @@ int main(int argc, char *argv[]) {
|
||||
cprintf(RED,
|
||||
"AAA Error: Could not create Zmq socket server on port %d "
|
||||
"and ip %s\n",
|
||||
portnum2, socketip2);
|
||||
portnum2, socketip2.c_str());
|
||||
// delete zmqsocket2;
|
||||
// delete zmqsocket;
|
||||
// return EXIT_FAILURE;
|
||||
@ -722,6 +773,25 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
cprintf(MAGENTA, "%d %d %d %d\n", xmin, xmax, ymin, ymax);
|
||||
mt->setROI(xmin, xmax, ymin, ymax);
|
||||
|
||||
if (addJsonHeader.find("xMin") != addJsonHeader.end()) {
|
||||
istringstream(addJsonHeader.at("xMin")) >> xmin;
|
||||
}
|
||||
|
||||
if (addJsonHeader.find("yMin") != addJsonHeader.end()) {
|
||||
istringstream(addJsonHeader.at("yMin")) >> ymin;
|
||||
}
|
||||
|
||||
if (addJsonHeader.find("xMax") != addJsonHeader.end()) {
|
||||
istringstream(addJsonHeader.at("xMax")) >> xmax;
|
||||
}
|
||||
|
||||
if (addJsonHeader.find("yMax") != addJsonHeader.end()) {
|
||||
istringstream(addJsonHeader.at("yMax")) >> ymax;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (addJsonHeader.find("dynamicRange") != addJsonHeader.end()) {
|
||||
istringstream(addJsonHeader.at("dynamicRange")) >> dr;
|
||||
dr = 32;
|
||||
@ -821,7 +891,7 @@ int main(int argc, char *argv[]) {
|
||||
// cout << acqIndex << " " << frameIndex << " " << subFrameIndex << "
|
||||
// "<< detSpec1 << " " << timestamp << " " << packetNumber << endl;
|
||||
// cprintf(GREEN, "frame\n");
|
||||
if (packetNumber >= 40) {
|
||||
if (packetNumber <= 50) {
|
||||
//*((int*)buff)=frameIndex;
|
||||
if (insubframe == 0)
|
||||
f0 = frameIndex;
|
||||
|
@ -8,7 +8,8 @@ det_list=("ctbDetectorServer
|
||||
gotthard2DetectorServer
|
||||
jungfrauDetectorServer
|
||||
mythen3DetectorServer
|
||||
moenchDetectorServer"
|
||||
moenchDetectorServer
|
||||
xilinx_ctbDetectorServer"
|
||||
)
|
||||
usage="\nUsage: compileAllServers.sh [server|all(opt)] [branch(opt)]. \n\tNo arguments mean all servers with 'developer' branch. \n\tNo 'branch' input means 'developer branch'"
|
||||
|
||||
|
@ -9,6 +9,7 @@ det_list=("ctbDetectorServer"
|
||||
"jungfrauDetectorServer"
|
||||
"mythen3DetectorServer"
|
||||
"moenchDetectorServer"
|
||||
"xilinx_ctbDetectorServer"
|
||||
)
|
||||
usage="\nUsage: compileAllServers.sh [server|all(opt)] [branch(opt)]. \n\tNo arguments mean all servers with 'developer' branch. \n\tNo 'branch' input means 'developer branch'"
|
||||
|
||||
|
@ -37,8 +37,7 @@ target_compile_definitions(ctbDetectorServer_virtual
|
||||
)
|
||||
|
||||
target_link_libraries(ctbDetectorServer_virtual
|
||||
PUBLIC pthread rt slsProjectCSettings
|
||||
m
|
||||
PUBLIC pthread rt m slsProjectCSettings
|
||||
)
|
||||
|
||||
set_target_properties(ctbDetectorServer_virtual PROPERTIES
|
||||
|
Binary file not shown.
@ -55,7 +55,9 @@
|
||||
#define DEFAULT_SYNC_CLK (40) // 20
|
||||
#define DEFAULT_DBIT_CLK (200)
|
||||
#define DEFAULT_TRANSCEIVER_MASK (0x3)
|
||||
#define MAX_TRANSCEIVER_MASK (0xF)
|
||||
|
||||
#define MAX_TRANSCEIVER_MASK (0xF)
|
||||
#define MAX_TRANSCEIVER_SAMPLES (0xFFFF)
|
||||
|
||||
#define UDP_HEADER_MAX_FRAME_VALUE (0xFFFFFFFFFFFF)
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@ -471,7 +471,8 @@ void setupDetector() {
|
||||
// hv
|
||||
DAC6571_SetDefines(HV_HARD_MAX_VOLTAGE, HV_DRIVER_FILE_NAME);
|
||||
// dacs
|
||||
LTC2620_D_SetDefines(DAC_MAX_MV, DAC_DRIVER_FILE_NAME, NDAC);
|
||||
LTC2620_D_SetDefines(DAC_MIN_MV, DAC_MAX_MV, DAC_DRIVER_FILE_NAME, NDAC, 1,
|
||||
0, "");
|
||||
// on chip dacs
|
||||
ASIC_Driver_SetDefines(ONCHIP_DAC_DRIVER_FILE_NAME);
|
||||
setTimingSource(DEFAULT_TIMING_SOURCE);
|
||||
|
@ -35,6 +35,7 @@
|
||||
#define TEMPERATURE_FILE_NAME ("/sys/class/hwmon/hwmon0/temp1_input")
|
||||
#endif
|
||||
#define CONFIG_FILE ("config_gotthard2.txt")
|
||||
#define DAC_MIN_MV (0)
|
||||
#define DAC_MAX_MV (2048)
|
||||
#define ONCHIP_DAC_MAX_VAL (0x3FF)
|
||||
#define ADU_MAX_VAL (0xFFF)
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -482,7 +482,6 @@ void setupDetector() {
|
||||
return;
|
||||
}
|
||||
|
||||
setReadoutSpeed(DEFAULT_SPEED);
|
||||
cleanFifos();
|
||||
resetCore();
|
||||
|
||||
@ -496,6 +495,7 @@ void setupDetector() {
|
||||
initReadoutConfiguration();
|
||||
|
||||
// Initialization of acquistion parameters
|
||||
setReadoutSpeed(DEFAULT_SPEED);
|
||||
setSettings(DEFAULT_SETTINGS);
|
||||
setNumFrames(DEFAULT_NUM_FRAMES);
|
||||
setNumTriggers(DEFAULT_NUM_CYCLES);
|
||||
|
@ -61,7 +61,7 @@
|
||||
#define ASIC_FILTER_MAX_RES_VALUE (1)
|
||||
#define MAX_SELECT_CHIP10_VAL (63)
|
||||
|
||||
#define MAX_PHASE_SHIFTS (240)
|
||||
#define MAX_PHASE_SHIFTS (200)
|
||||
#define BIT16_MASK (0xFFFF)
|
||||
|
||||
#define ADC_DECMT_QUARTER_SPEED (0x3)
|
||||
|
Binary file not shown.
@ -483,7 +483,8 @@ void setupDetector() {
|
||||
// hv
|
||||
DAC6571_SetDefines(HV_HARD_MAX_VOLTAGE, HV_DRIVER_FILE_NAME);
|
||||
// dac
|
||||
LTC2620_D_SetDefines(DAC_MAX_MV, DAC_DRIVER_FILE_NAME, NDAC);
|
||||
LTC2620_D_SetDefines(DAC_MIN_MV, DAC_MAX_MV, DAC_DRIVER_FILE_NAME, NDAC, 1,
|
||||
0, "");
|
||||
|
||||
resetCore();
|
||||
resetPeripheral();
|
||||
|
@ -34,6 +34,7 @@
|
||||
#else
|
||||
#define TEMPERATURE_FILE_NAME ("/sys/class/hwmon/hwmon0/temp1_input")
|
||||
#endif
|
||||
#define DAC_MIN_MV (0)
|
||||
#define DAC_MAX_MV (2048)
|
||||
#define TYPE_MYTHEN3_MODULE_VAL (93)
|
||||
#define TYPE_TOLERANCE (5)
|
||||
|
@ -4,18 +4,11 @@
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
/**
|
||||
* Set Defines
|
||||
* @param hardMaxV maximum hardware limit
|
||||
* @param driverfname driver file name
|
||||
* @param numdacs number of dacs
|
||||
*/
|
||||
void LTC2620_D_SetDefines(int hardMaxV, char *driverfname, int numdacs);
|
||||
|
||||
/**
|
||||
* Get max number of steps
|
||||
*/
|
||||
void LTC2620_D_SetDefines(int hardMinV, int hardMaxV, char *driverfname,
|
||||
int numdacs, int numdevices, int startingDeviceIndex,
|
||||
char *powerdownDriverfname);
|
||||
int LTC2620_D_GetMaxNumSteps();
|
||||
int LTC2620_D_GetPowerDownValue();
|
||||
|
||||
/**
|
||||
* Convert voltage to dac units
|
||||
|
@ -5,6 +5,11 @@
|
||||
#include <inttypes.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
int mapCSP0(void);
|
||||
void bus_w(u_int32_t offset, u_int32_t data);
|
||||
u_int32_t bus_r(u_int32_t offset);
|
||||
uint64_t getU64BitReg(int aLSB, int aMSB);
|
||||
void setU64BitReg(uint64_t value, int aLSB, int aMSB);
|
||||
u_int32_t readRegister(u_int32_t offset);
|
||||
u_int32_t writeRegister(u_int32_t offset, u_int32_t data);
|
||||
int mapCSP0(void);
|
||||
u_int32_t *Arm_getUDPBaseAddress();
|
||||
|
@ -6,10 +6,12 @@
|
||||
#include "clogger.h"
|
||||
|
||||
void initializePatternAddresses();
|
||||
#ifdef CHIPTESTBOARDD
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
#ifdef VIRTUAL
|
||||
void initializePatternWord();
|
||||
#endif
|
||||
#endif
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
uint64_t validate_readPatternIOControl();
|
||||
int validate_writePatternIOControl(char *message, uint64_t arg);
|
||||
void writePatternIOControl(uint64_t word);
|
||||
|
12
slsDetectorServers/slsDetectorServer/include/programViaArm.h
Normal file
12
slsDetectorServers/slsDetectorServer/include/programViaArm.h
Normal file
@ -0,0 +1,12 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#pragma once
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
int resetFPGA(char *mess);
|
||||
int loadDeviceTree(char *mess, int *adcDeviceIndex, int *dacDeviceIndex);
|
||||
|
||||
int checksBeforeCreatingDeviceTree(char *mess);
|
||||
int createDeviceTree(char *mess);
|
||||
int verifyDeviceTree(char *mess, int *adcDeviceIndex, int *dacDeviceIndex);
|
@ -27,6 +27,7 @@
|
||||
|
||||
#ifdef ARMPROCESSOR
|
||||
#include "arm64.h"
|
||||
#include "programViaArm.h"
|
||||
#endif
|
||||
|
||||
#ifdef MYTHEN3D
|
||||
@ -65,13 +66,15 @@ typedef struct udpStruct_s {
|
||||
int isInitCheckDone();
|
||||
int getInitResult(char **mess);
|
||||
void basictests();
|
||||
#if !defined(EIGERD)
|
||||
int checkType();
|
||||
|
||||
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MOENCHD) || \
|
||||
defined(CHIPTESTBOARDD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||
int testFpga();
|
||||
#ifdef XILINX_CHIPTESTBOARDD
|
||||
int testFixedFPGAPattern();
|
||||
#else
|
||||
int testBus();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(GOTTHARDD) || \
|
||||
((defined(EIGERD) || defined(JUNGFRAUD) || defined(MOENCHD)) && \
|
||||
@ -86,10 +89,8 @@ u_int64_t getFirmwareVersion();
|
||||
#ifdef EIGERD
|
||||
uint64_t getFrontEndFirmwareVersion(enum fpgaPosition fpgaPosition);
|
||||
#endif
|
||||
#ifndef XILINX_CHIPTESTBOARDD
|
||||
u_int64_t getFirmwareAPIVersion();
|
||||
void getHardwareVersion(char *version);
|
||||
#endif
|
||||
#ifdef EIGERD
|
||||
int getHardwareVersionNumber();
|
||||
#else
|
||||
@ -180,6 +181,22 @@ uint32_t readRegister16And32(uint32_t offset);
|
||||
#endif
|
||||
|
||||
// firmware functions (resets)
|
||||
#if defined(XILINX_CHIPTESTBOARDD)
|
||||
void cleanFifos();
|
||||
void resetFlow();
|
||||
int waitTranseiverReset(char *mess);
|
||||
#ifdef VIRTUAL
|
||||
void setTransceiverAlignment(int align);
|
||||
#endif
|
||||
int isTransceiverAligned();
|
||||
int waitTransceiverAligned(char *mess);
|
||||
int configureTransceiver(char *mess);
|
||||
int isChipConfigured();
|
||||
int powerChip(int on, char *mess);
|
||||
int getPowerChip();
|
||||
int configureChip(char *mess);
|
||||
void startPeriphery();
|
||||
#endif
|
||||
#if defined(JUNGFRAUD) || defined(MOENCHD) || defined(CHIPTESTBOARDD) || \
|
||||
defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||
void cleanFifos();
|
||||
@ -199,10 +216,8 @@ void setMasterSlaveConfiguration();
|
||||
#endif
|
||||
|
||||
// parameters - dr, roi
|
||||
#ifndef XILINX_CHIPTESTBOARDD
|
||||
int setDynamicRange(int dr);
|
||||
int getDynamicRange(int *retval);
|
||||
#endif
|
||||
#ifdef GOTTHARDD
|
||||
int setROI(ROI arg);
|
||||
ROI getROI();
|
||||
@ -221,6 +236,12 @@ uint32_t getTransceiverEnableMask();
|
||||
void setADCInvertRegister(uint32_t val);
|
||||
uint32_t getADCInvertRegister();
|
||||
#endif
|
||||
#ifdef XILINX_CHIPTESTBOARDD
|
||||
void setADCEnableMask_10G(uint32_t mask);
|
||||
uint32_t getADCEnableMask_10G();
|
||||
int setTransceiverEnableMask(uint32_t mask);
|
||||
uint32_t getTransceiverEnableMask();
|
||||
#endif
|
||||
#if defined(CHIPTESTBOARDD)
|
||||
int setExternalSamplingSource(int val);
|
||||
int setExternalSampling(int val);
|
||||
@ -236,7 +257,7 @@ int getParallelMode();
|
||||
int setOverFlowMode(int mode);
|
||||
int getOverFlowMode();
|
||||
#endif
|
||||
#ifdef CHIPTESTBOARDD
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
int setReadoutMode(enum readoutMode mode);
|
||||
int getReadoutMode();
|
||||
#endif
|
||||
@ -247,11 +268,10 @@ int selectStoragecellStart(int pos);
|
||||
int getMaxStoragecellStart();
|
||||
#endif
|
||||
#if defined(JUNGFRAUD) || defined(MOENCHD) || defined(EIGERD) || \
|
||||
defined(CHIPTESTBOARDD)
|
||||
defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
int setNextFrameNumber(uint64_t value);
|
||||
int getNextFrameNumber(uint64_t *value);
|
||||
#endif
|
||||
#ifndef XILINX_CHIPTESTBOARDD
|
||||
void setNumFrames(int64_t val);
|
||||
int64_t getNumFrames();
|
||||
void setNumTriggers(int64_t val);
|
||||
@ -262,7 +282,6 @@ int64_t getExpTime();
|
||||
#endif
|
||||
int setPeriod(int64_t val);
|
||||
int64_t getPeriod();
|
||||
#endif
|
||||
#ifdef MYTHEN3D
|
||||
void setNumIntGates(int val);
|
||||
void setNumGates(int val);
|
||||
@ -294,11 +313,9 @@ int getNumAdditionalStorageCells();
|
||||
int setStorageCellDelay(int64_t val);
|
||||
int64_t getStorageCellDelay();
|
||||
#endif
|
||||
#if defined(CHIPTESTBOARDD)
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
int setNumAnalogSamples(int val);
|
||||
int getNumAnalogSamples();
|
||||
#endif
|
||||
#ifdef CHIPTESTBOARDD
|
||||
int setNumDigitalSamples(int val);
|
||||
int getNumDigitalSamples();
|
||||
int setNumTransceiverSamples(int val);
|
||||
@ -311,12 +328,15 @@ uint32_t getCounterMask();
|
||||
void updatePacketizing();
|
||||
#endif
|
||||
|
||||
#if defined(JUNGFRAUD) || defined(MOENCHD) || defined(GOTTHARDD) || \
|
||||
defined(CHIPTESTBOARDD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||
int setDelayAfterTrigger(int64_t val);
|
||||
int64_t getDelayAfterTrigger();
|
||||
#ifndef EIGERD
|
||||
int64_t getNumFramesLeft();
|
||||
int64_t getNumTriggersLeft();
|
||||
#endif
|
||||
#if defined(JUNGFRAUD) || defined(MOENCHD) || defined(GOTTHARDD) || \
|
||||
defined(CHIPTESTBOARDD) || defined(MYTHEN3D) || defined(GOTTHARD2D) || \
|
||||
defined(XILINX_CHIPTESTBOARDD)
|
||||
int setDelayAfterTrigger(int64_t val);
|
||||
int64_t getDelayAfterTrigger();
|
||||
int64_t getDelayAfterTriggerLeft();
|
||||
int64_t getPeriodLeft();
|
||||
#endif
|
||||
@ -327,7 +347,7 @@ int64_t getNumBurstsLeft();
|
||||
int64_t getExpTimeLeft();
|
||||
#endif
|
||||
#if defined(JUNGFRAUD) || defined(MOENCHD) || defined(CHIPTESTBOARDD) || \
|
||||
defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||
defined(MYTHEN3D) || defined(GOTTHARD2D) || defined(XILINX_CHIPTESTBOARDD)
|
||||
int64_t getFramesFromStart();
|
||||
int64_t getActualTime();
|
||||
int64_t getMeasurementTime();
|
||||
@ -380,15 +400,11 @@ void setDAC(enum DACINDEX ind, int val, int mV, int counterEnableCheck);
|
||||
void setGeneralDAC(enum DACINDEX ind, int val, int mV);
|
||||
void setVthDac(int index, int enable);
|
||||
#else
|
||||
#ifndef XILINX_CHIPTESTBOARDD
|
||||
void setDAC(enum DACINDEX ind, int val, int mV);
|
||||
#endif
|
||||
#endif
|
||||
#ifndef XILINX_CHIPTESTBOARDD
|
||||
int getDAC(enum DACINDEX ind, int mV);
|
||||
int getMaxDacSteps();
|
||||
#endif
|
||||
#if defined(CHIPTESTBOARDD)
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
int dacToVoltage(int dac);
|
||||
int checkVLimitCompliant(int mV);
|
||||
int checkVLimitDacCompliant(int dac);
|
||||
@ -407,20 +423,24 @@ int isPowerValid(enum DACINDEX ind, int val);
|
||||
int getPower();
|
||||
void setPower(enum DACINDEX ind, int val);
|
||||
void powerOff();
|
||||
#elif XILINX_CHIPTESTBOARDD
|
||||
int getPower();
|
||||
void setPower(enum DACINDEX ind, int val);
|
||||
#endif
|
||||
|
||||
#if defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||
#if defined(MYTHEN3D) || defined(GOTTHARD2D) || defined(XILINX_CHIPTESTBOARDD)
|
||||
int getADC(enum ADCINDEX ind, int *value);
|
||||
#else
|
||||
#ifndef XILINX_CHIPTESTBOARDD
|
||||
int getADC(enum ADCINDEX ind);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef CHIPTESTBOARDD
|
||||
int getSlowADC(int ichan);
|
||||
int getSlowADCTemperature();
|
||||
#endif
|
||||
#ifndef XILINX_CHIPTESTBOARDD
|
||||
#ifdef XILINX_CHIPTESTBOARDD
|
||||
int getSlowADC(int ichan, int *retval);
|
||||
int getTemperature(int *retval);
|
||||
#else
|
||||
int setHighVoltage(int val);
|
||||
#endif
|
||||
|
||||
@ -447,10 +467,8 @@ void setSynchronization(int enable);
|
||||
void updatingRegisters();
|
||||
int updateClockDivs();
|
||||
#endif
|
||||
#ifndef XILINX_CHIPTESTBOARDD
|
||||
void setTiming(enum timingMode arg);
|
||||
enum timingMode getTiming();
|
||||
#endif
|
||||
#ifdef MYTHEN3D
|
||||
void setInitialExtSignals();
|
||||
int setChipStatusRegister(int csr);
|
||||
@ -494,16 +512,15 @@ void setupHeader(int iRxEntry, enum interfaceType type, uint32_t destip,
|
||||
uint32_t sourceip, uint16_t sourceport);
|
||||
#endif
|
||||
#if defined(JUNGFRAUD) || defined(MOENCHD) || defined(GOTTHARD2D) || \
|
||||
defined(MYTHEN3D) || defined(CHIPTESTBOARDD)
|
||||
defined(MYTHEN3D) || defined(CHIPTESTBOARDD) || \
|
||||
defined(XILINX_CHIPTESTBOARDD)
|
||||
void calcChecksum(udp_header *udp);
|
||||
#endif
|
||||
#ifdef GOTTHARDD
|
||||
int getAdcConfigured();
|
||||
#endif
|
||||
|
||||
#ifndef XILINX_CHIPTESTBOARDD
|
||||
int configureMAC();
|
||||
#endif
|
||||
int setDetectorPosition(int pos[]);
|
||||
int *getDetectorPosition();
|
||||
|
||||
@ -699,32 +716,27 @@ int setTransmissionDelayRight(int value);
|
||||
#endif
|
||||
|
||||
// aquisition
|
||||
#ifndef XILINX_CHIPTESTBOARDD
|
||||
int startStateMachine();
|
||||
#ifdef VIRTUAL
|
||||
void *start_timer(void *arg);
|
||||
#endif
|
||||
int stopStateMachine();
|
||||
#endif
|
||||
#ifdef MYTHEN3D
|
||||
#if defined(MYTHEN3D) || defined(XILINX_CHIPTESTBOARDD)
|
||||
int softwareTrigger();
|
||||
#endif
|
||||
#if defined(EIGERD) || defined(JUNGFRAUD) || defined(MOENCHD)
|
||||
int softwareTrigger(int block);
|
||||
#endif
|
||||
#if defined(EIGERD) || defined(MYTHEN3D) || defined(CHIPTESTBOARDD)
|
||||
#if defined(EIGERD) || defined(MYTHEN3D) || defined(CHIPTESTBOARDD) || \
|
||||
defined(XILINX_CHIPTESTBOARDD)
|
||||
int startReadOut();
|
||||
#endif
|
||||
#ifndef XILINX_CHIPTESTBOARDD
|
||||
enum runStatus getRunStatus();
|
||||
#endif
|
||||
#ifdef EIGERD
|
||||
void waitForAcquisitionEnd(int *ret, char *mess);
|
||||
#else
|
||||
#ifndef XILINX_CHIPTESTBOARDD
|
||||
void waitForAcquisitionEnd();
|
||||
#endif
|
||||
#endif
|
||||
#if defined(CHIPTESTBOARDD)
|
||||
int validateUDPSocket();
|
||||
void readandSendUDPFrames();
|
||||
@ -736,7 +748,8 @@ int readFrameFromFifo();
|
||||
#endif
|
||||
|
||||
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MOENCHD) || \
|
||||
defined(CHIPTESTBOARDD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||
defined(CHIPTESTBOARDD) || defined(MYTHEN3D) || defined(GOTTHARD2D) || \
|
||||
defined(XILINX_CHIPTESTBOARDD)
|
||||
u_int32_t runBusy();
|
||||
#endif
|
||||
|
||||
@ -745,13 +758,11 @@ u_int32_t runState(enum TLogLevel lev);
|
||||
#endif
|
||||
|
||||
// common
|
||||
#ifndef XILINX_CHIPTESTBOARDD
|
||||
int calculateDataBytes();
|
||||
int getTotalNumberOfChannels();
|
||||
#if defined(CHIPTESTBOARDD)
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
void getNumberOfChannels(int *nchanx, int *nchany);
|
||||
#endif
|
||||
int getNumberOfChips();
|
||||
int getNumberOfDACs();
|
||||
int getNumberOfChannelsPerChip();
|
||||
#endif
|
@ -329,3 +329,4 @@ int getColumn();
|
||||
int setColumn(int);
|
||||
int get_pedestal_mode(int);
|
||||
int set_pedestal_mode(int);
|
||||
int config_transceiver(int);
|
||||
|
@ -13,35 +13,54 @@
|
||||
#define LTC2620_D_MAX_STEPS (LTC2620_D_MAX_DAC_VAL + 1)
|
||||
|
||||
// defines from the fpga
|
||||
int LTC2620_D_HardMinVoltage = 0;
|
||||
int LTC2620_D_HardMaxVoltage = 0;
|
||||
char LTC2620_D_DriverFileName[MAX_STR_LENGTH];
|
||||
char LTC2620_D_PowerDownDriverFileName[MAX_STR_LENGTH];
|
||||
int LTC2620_D_NumDacs = 0;
|
||||
int LTC2620_D_NumDevices = 0;
|
||||
int LTC2620_D_NumChannelsPerDevice = 0;
|
||||
int LTC2620_D_DacDriverStartingDeviceIndex = 0;
|
||||
|
||||
void LTC2620_D_SetDefines(int hardMaxV, char *driverfname, int numdacs) {
|
||||
void LTC2620_D_SetDefines(int hardMinV, int hardMaxV, char *driverfname,
|
||||
int numdacs, int numdevices, int startingDeviceIndex,
|
||||
char *powerdownDriverfname) {
|
||||
LOG(logINFOBLUE,
|
||||
("Configuring DACs (LTC2620) to %s (numdacs:%d, hard max: %dmV)\n",
|
||||
driverfname, numdacs, hardMaxV));
|
||||
("Configuring DACs (LTC2620) to %s\n\t (numdacs:%d, hard min:%d, hard "
|
||||
"max: %dmV, idev:%d)\n",
|
||||
driverfname, numdacs, hardMinV, hardMaxV, startingDeviceIndex));
|
||||
LTC2620_D_HardMinVoltage = hardMinV;
|
||||
LTC2620_D_HardMaxVoltage = hardMaxV;
|
||||
memset(LTC2620_D_DriverFileName, 0, MAX_STR_LENGTH);
|
||||
strcpy(LTC2620_D_DriverFileName, driverfname);
|
||||
memset(LTC2620_D_PowerDownDriverFileName, 0, MAX_STR_LENGTH);
|
||||
strcpy(LTC2620_D_PowerDownDriverFileName, powerdownDriverfname);
|
||||
LTC2620_D_NumDacs = numdacs;
|
||||
LTC2620_D_NumDevices = numdevices;
|
||||
LTC2620_D_NumChannelsPerDevice = LTC2620_D_NumDacs / LTC2620_D_NumDevices;
|
||||
LTC2620_D_DacDriverStartingDeviceIndex = startingDeviceIndex;
|
||||
}
|
||||
|
||||
int LTC2620_D_GetMaxNumSteps() { return LTC2620_D_MAX_STEPS; }
|
||||
|
||||
int LTC2620_D_GetPowerDownValue() { return LTC2620_D_PWR_DOWN_VAL; }
|
||||
|
||||
int LTC2620_D_VoltageToDac(int voltage, int *dacval) {
|
||||
return ConvertToDifferentRange(0, LTC2620_D_HardMaxVoltage, 0,
|
||||
return ConvertToDifferentRange(LTC2620_D_HardMinVoltage,
|
||||
LTC2620_D_HardMaxVoltage, 0,
|
||||
LTC2620_D_MAX_DAC_VAL, voltage, dacval);
|
||||
}
|
||||
|
||||
int LTC2620_D_DacToVoltage(int dacval, int *voltage) {
|
||||
return ConvertToDifferentRange(0, LTC2620_D_MAX_DAC_VAL, 0,
|
||||
return ConvertToDifferentRange(0, LTC2620_D_MAX_DAC_VAL,
|
||||
LTC2620_D_HardMinVoltage,
|
||||
LTC2620_D_HardMaxVoltage, dacval, voltage);
|
||||
}
|
||||
|
||||
int LTC2620_D_SetDACValue(int dacnum, int val, int mV, char *dacname,
|
||||
int *dacval) {
|
||||
LOG(logDEBUG1, ("dacnum:%d, val:%d, ismV:%d\n", dacnum, val, mV));
|
||||
|
||||
// validate index
|
||||
if (dacnum < 0 || dacnum >= LTC2620_D_NumDacs) {
|
||||
LOG(logERROR, ("Dac index %d is out of bounds (0 to %d)\n", dacnum,
|
||||
@ -49,53 +68,90 @@ int LTC2620_D_SetDACValue(int dacnum, int val, int mV, char *dacname,
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
// get
|
||||
// validate set
|
||||
if (val < 0 && val != LTC2620_D_PWR_DOWN_VAL)
|
||||
return FAIL;
|
||||
|
||||
// convert to dac or get mV value
|
||||
*dacval = val;
|
||||
int dacmV = val;
|
||||
int ret = OK;
|
||||
if (mV) {
|
||||
ret = LTC2620_D_VoltageToDac(val, dacval);
|
||||
} else if (val >= 0) {
|
||||
// do not convert power down dac val
|
||||
ret = LTC2620_D_DacToVoltage(val, &dacmV);
|
||||
}
|
||||
|
||||
// conversion out of bounds
|
||||
if (ret == FAIL) {
|
||||
LOG(logERROR, ("Setting Dac %d %s is out of bounds\n", dacnum,
|
||||
(mV ? "mV" : "dac units")));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
// set
|
||||
if ((*dacval >= 0) || (*dacval == LTC2620_D_PWR_DOWN_VAL)) {
|
||||
LOG(logINFO, ("Setting DAC %2d [%-12s] : %d dac (%d mV)\n", dacnum,
|
||||
dacname, *dacval, dacmV));
|
||||
|
||||
*dacval = val;
|
||||
#ifndef VIRTUAL
|
||||
char fname[MAX_STR_LENGTH];
|
||||
strcpy(fname, LTC2620_D_DriverFileName);
|
||||
char temp[20];
|
||||
memset(temp, 0, sizeof(temp));
|
||||
sprintf(temp, "%d", dacnum);
|
||||
strcat(fname, temp);
|
||||
LOG(logDEBUG1, ("fname %s\n", fname));
|
||||
char fnameFormat[MAX_STR_LENGTH];
|
||||
memset(fnameFormat, 0, MAX_STR_LENGTH);
|
||||
strcpy(fnameFormat, LTC2620_D_DriverFileName);
|
||||
#endif
|
||||
|
||||
// open file
|
||||
FILE *fd = fopen(fname, "w");
|
||||
if (fd == NULL) {
|
||||
LOG(logERROR, ("Could not open file %s for writing to set dac %d\n",
|
||||
fname, dacnum));
|
||||
return FAIL;
|
||||
}
|
||||
// convert to string, add 0 and write to file
|
||||
fprintf(fd, "%d\n", *dacval);
|
||||
fclose(fd);
|
||||
// power down dac (different file name)
|
||||
if (val == LTC2620_D_PWR_DOWN_VAL) {
|
||||
#if defined(XILINX_CHIPTESTBOARDD) && !defined(VIRTUAL)
|
||||
LOG(logINFO, ("Powering down DAC %2d [%-6s] \n", dacnum, dacname));
|
||||
strcpy(fnameFormat, LTC2620_D_PowerDownDriverFileName);
|
||||
#endif
|
||||
}
|
||||
|
||||
// proper value to set
|
||||
else {
|
||||
// convert to dac or get mV value
|
||||
int dacmV = val;
|
||||
if (mV) {
|
||||
ret = LTC2620_D_VoltageToDac(val, dacval);
|
||||
} else if (val >= 0) {
|
||||
// do not convert power down dac val
|
||||
ret = LTC2620_D_DacToVoltage(val, &dacmV);
|
||||
}
|
||||
|
||||
// conversion out of bounds
|
||||
if (ret == FAIL) {
|
||||
LOG(logERROR, ("Setting Dac %d %s is out of bounds\n", dacnum,
|
||||
(mV ? "mV" : "dac units")));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
// print and set
|
||||
#ifdef XILINX_CHIPTESTBOARDD
|
||||
if (*dacval >= 0) {
|
||||
LOG(logINFO, ("Setting DAC %2d [%-6s] : %d dac (%d mV)\n", dacnum,
|
||||
dacname, *dacval, dacmV));
|
||||
}
|
||||
#else
|
||||
if ((*dacval >= 0) || (*dacval == LTC2620_D_PWR_DOWN_VAL)) {
|
||||
LOG(logINFO, ("Setting DAC %2d [%-12s] : %d dac (%d mV)\n", dacnum,
|
||||
dacname, *dacval, dacmV));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// set in file
|
||||
#ifndef VIRTUAL
|
||||
char fname[MAX_STR_LENGTH];
|
||||
memset(fname, 0, MAX_STR_LENGTH);
|
||||
#ifdef XILINX_CHIPTESTBOARDD
|
||||
int idev = LTC2620_D_DacDriverStartingDeviceIndex +
|
||||
(dacnum / LTC2620_D_NumChannelsPerDevice);
|
||||
int idac = dacnum % LTC2620_D_NumChannelsPerDevice;
|
||||
sprintf(fname, fnameFormat, idev, idac);
|
||||
#else
|
||||
sprintf(fname, "%s%d", fnameFormat, dacnum);
|
||||
#endif
|
||||
LOG(logDEBUG1, ("fname %s\n", fname));
|
||||
|
||||
// open file
|
||||
FILE *fd = fopen(fname, "w");
|
||||
if (fd == NULL) {
|
||||
LOG(logERROR, ("Could not open file %s for writing to set dac %d\n",
|
||||
fname, dacnum));
|
||||
return FAIL;
|
||||
}
|
||||
// convert to string, add 0 and write to file
|
||||
#ifdef XILINX_CHIPTESTBOARDD
|
||||
// not changing *dacval from -100 (cant write -100 to file: invalid arg)
|
||||
int writeValue = *dacval;
|
||||
if (writeValue == LTC2620_D_PWR_DOWN_VAL)
|
||||
writeValue = 1;
|
||||
fprintf(fd, "%d\n", writeValue);
|
||||
#else
|
||||
fprintf(fd, "%d\n", *dacval);
|
||||
#endif
|
||||
fclose(fd);
|
||||
#endif
|
||||
return OK;
|
||||
}
|
||||
|
@ -10,12 +10,14 @@
|
||||
#include <fcntl.h> // open
|
||||
#include <sys/mman.h> // mmap
|
||||
|
||||
|
||||
/* global variables */
|
||||
#define CSP0 (0xB0010000)/// 0xB008_0000
|
||||
#define MEM_SIZE 0x100000
|
||||
|
||||
#define CSP0 (0xB0080000)
|
||||
#define CSP1 (0xB0050000) // udp
|
||||
#define MEM_SIZE (0x10000)
|
||||
//#define MEM_SIZE_CSP0 (4096)
|
||||
//#define MEM_SIZE_CSP1 (2 * 4096)
|
||||
u_int32_t *csp0base = 0;
|
||||
u_int32_t *csp1base = 0;
|
||||
|
||||
void bus_w(u_int32_t offset, u_int32_t data) {
|
||||
volatile u_int32_t *ptr1;
|
||||
@ -40,36 +42,53 @@ void setU64BitReg(uint64_t value, int aLSB, int aMSB) {
|
||||
bus_w(aMSB, (value >> 32) & (0xffffffff));
|
||||
}
|
||||
|
||||
u_int32_t readRegister(u_int32_t offset) { return bus_r(offset); }
|
||||
|
||||
u_int32_t writeRegister(u_int32_t offset, u_int32_t data) {
|
||||
bus_w(offset, data);
|
||||
return readRegister(offset);
|
||||
}
|
||||
|
||||
int mapCSP0(void) {
|
||||
// if not mapped
|
||||
if (csp0base == 0) {
|
||||
LOG(logINFO, ("Mapping memory\n"));
|
||||
u_int32_t csps[2] = {CSP0, CSP1};
|
||||
u_int32_t **cspbases[2] = {&csp0base, &csp1base};
|
||||
char names[2][10] = {"csp0base", "csp1base"};
|
||||
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
// if not mapped
|
||||
if (*cspbases[i] == 0) {
|
||||
LOG(logINFO, ("Mapping memory for %s\n", names[i]));
|
||||
#ifdef VIRTUAL
|
||||
csp0base = malloc(MEM_SIZE);
|
||||
if (csp0base == NULL) {
|
||||
LOG(logERROR, ("Could not allocate virtual memory.\n"));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("memory allocated\n"));
|
||||
*cspbases[i] = malloc(MEM_SIZE);
|
||||
if (*cspbases[i] == NULL) {
|
||||
LOG(logERROR,
|
||||
("Could not allocate virtual memory for %s.\n", names[i]));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("memory allocated for %s\n", names[i]));
|
||||
#else
|
||||
int fd;
|
||||
fd = open("/dev/mem", O_RDWR | O_SYNC, 0);
|
||||
if (fd == -1) {
|
||||
LOG(logERROR, ("Can't find /dev/mem\n"));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logDEBUG1, ("/dev/mem opened\n"));
|
||||
csp0base = (u_int32_t*)mmap(0, MEM_SIZE, PROT_READ | PROT_WRITE,
|
||||
MAP_FILE | MAP_SHARED, fd, CSP0);
|
||||
if (csp0base == MAP_FAILED) {
|
||||
LOG(logERROR, ("Can't map memmory area\n"));
|
||||
return FAIL;
|
||||
}
|
||||
int fd = open("/dev/mem", O_RDWR | O_SYNC, 0);
|
||||
if (fd == -1) {
|
||||
LOG(logERROR, ("Can't find /dev/mem for %s\n", names[i]));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logDEBUG1,
|
||||
("/dev/mem opened for %s, (CSP:0x%x)\n", names[i], csps[i]));
|
||||
*cspbases[i] =
|
||||
(u_int32_t *)mmap(0, MEM_SIZE, PROT_READ | PROT_WRITE,
|
||||
MAP_FILE | MAP_SHARED, fd, csps[i]);
|
||||
if (*cspbases[i] == MAP_FAILED) {
|
||||
LOG(logERROR, ("Can't map memmory area for %s\n", names[i]));
|
||||
return FAIL;
|
||||
}
|
||||
#endif
|
||||
LOG(logINFO, ("csp0base mapped from %p to %p\n", csp0base,
|
||||
(csp0base + MEM_SIZE)));
|
||||
} else
|
||||
LOG(logINFO, ("Memory already mapped before\n"));
|
||||
LOG(logINFO, ("%s mapped from %p to %p,(CSP:0x%x) \n", names[i],
|
||||
*cspbases[i], *cspbases[i] + MEM_SIZE, csps[i]));
|
||||
// LOG(logINFO, ("Status Register: %08x\n", bus_r(STATUS_REG)));
|
||||
} else
|
||||
LOG(logINFO, ("Memory %s already mapped before\n", names[i]));
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
u_int32_t *Arm_getUDPBaseAddress() { return csp1base; }
|
||||
|
@ -114,10 +114,11 @@ int getTimeFromString(char *buf, time_t *result) {
|
||||
t.tm_mday, t.tm_mon, t.tm_year + 1900, t.tm_hour, t.tm_min, t.tm_sec));
|
||||
|
||||
*result = mktime(&t);
|
||||
if (*result == -1) {
|
||||
/* Do not check as it fails with nios
|
||||
if (*result == (time_t)-1) {
|
||||
LOG(logERROR, ("Could not convert time structure to time_t\n"));
|
||||
return FAIL;
|
||||
}
|
||||
}*/
|
||||
return OK;
|
||||
}
|
||||
|
||||
@ -134,7 +135,6 @@ int getKernelVersion(char *retvals) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
int validateKernelVersion(char *expectedVersion) {
|
||||
// extract kernel date string
|
||||
char version[255] = {0};
|
||||
@ -752,13 +752,17 @@ int readADCFromFile(char *fname, int *value) {
|
||||
|
||||
*value = -1;
|
||||
if (sscanf(line, "%d", value) != 1) {
|
||||
#ifdef XILINX_CHIPTESTBOARDD
|
||||
LOG(logERROR, ("Could not scan adc from %s\n", line));
|
||||
#else
|
||||
LOG(logERROR, ("Could not scan temperature from %s\n", line));
|
||||
#endif
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
#ifdef EIGERD
|
||||
*value /= 10;
|
||||
#else
|
||||
#elif !defined(XILINX_CHIPTESTBOARDD)
|
||||
LOG(logINFO, ("Temperature: %.2f °C\n", (double)(*value) / 1000.00));
|
||||
#endif
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
extern enum TLogLevel trimmingPrint;
|
||||
#endif
|
||||
|
||||
#ifdef CHIPTESTBOARDD
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
#ifdef VIRTUAL
|
||||
uint64_t virtual_pattern[MAX_PATTERN_LENGTH];
|
||||
#endif
|
||||
@ -21,8 +21,8 @@ uint64_t virtual_pattern[MAX_PATTERN_LENGTH];
|
||||
|
||||
extern void bus_w(u_int32_t offset, u_int32_t data);
|
||||
extern u_int32_t bus_r(u_int32_t offset);
|
||||
extern int64_t get64BitReg(int aLSB, int aMSB);
|
||||
extern int64_t set64BitReg(int64_t value, int aLSB, int aMSB);
|
||||
// extern int64_t get64BitReg(int aLSB, int aMSB); TODO for all servers (only
|
||||
// uint64_t) extern int64_t set64BitReg(int64_t value, int aLSB, int aMSB);
|
||||
extern uint64_t getU64BitReg(int aLSB, int aMSB);
|
||||
extern void setU64BitReg(uint64_t value, int aLSB, int aMSB);
|
||||
|
||||
@ -44,18 +44,34 @@ void initializePatternAddresses() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CHIPTESTBOARDD
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
#ifdef VIRTUAL
|
||||
void initializePatternWord() {
|
||||
memset(virtual_pattern, 0, sizeof(virtual_pattern));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
uint64_t validate_readPatternIOControl() {
|
||||
#if defined(CHIPTESTBOARDD)
|
||||
return getU64BitReg(PATTERN_IO_CNTRL_LSB_REG, PATTERN_IO_CNTRL_MSB_REG);
|
||||
#elif defined(XILINX_CHIPTESTBOARDD)
|
||||
return (uint64_t)(bus_r(PINIOCTRLREG));
|
||||
#endif
|
||||
}
|
||||
|
||||
int validate_writePatternIOControl(char *message, uint64_t arg) {
|
||||
// validate input
|
||||
#ifdef XILINX_CHIPTESTBOARDD
|
||||
if (arg > BIT32_MSK) {
|
||||
strcpy(message, "Could not set pattern IO Control. Must be 32 bit for "
|
||||
"this detector\n");
|
||||
LOG(logERROR, (message));
|
||||
return FAIL;
|
||||
}
|
||||
#endif
|
||||
|
||||
writePatternIOControl(arg);
|
||||
|
||||
// validate result
|
||||
@ -75,9 +91,15 @@ int validate_writePatternIOControl(char *message, uint64_t arg) {
|
||||
}
|
||||
|
||||
void writePatternIOControl(uint64_t word) {
|
||||
#ifdef CHIPTESTBOARDD
|
||||
LOG(logINFO,
|
||||
("Setting Pattern I/O Control: 0x%llx\n", (long long int)word));
|
||||
setU64BitReg(word, PATTERN_IO_CNTRL_LSB_REG, PATTERN_IO_CNTRL_MSB_REG);
|
||||
#elif defined(XILINX_CHIPTESTBOARDD)
|
||||
uint32_t val = (uint32_t)word;
|
||||
LOG(logINFO, ("Setting Pattern I/O Control: 0x%x\n", val));
|
||||
bus_w(PINIOCTRLREG, val);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -101,7 +123,7 @@ uint64_t readPatternWord(int addr) {
|
||||
// the first word in RAM as base plus the offset of the word to write (addr)
|
||||
uint32_t reg_lsb = PATTERN_STEP0_LSB_REG + addr * REG_OFFSET * 2;
|
||||
uint32_t reg_msb = PATTERN_STEP0_MSB_REG + addr * REG_OFFSET * 2;
|
||||
return get64BitReg(reg_lsb, reg_msb);
|
||||
return getU64BitReg(reg_lsb, reg_msb);
|
||||
#else
|
||||
LOG(logDEBUG1, (" Reading (Executing) Pattern Word (addr:0x%x)\n", addr));
|
||||
uint32_t reg = PATTERN_CNTRL_REG;
|
||||
@ -118,7 +140,7 @@ uint64_t readPatternWord(int addr) {
|
||||
|
||||
// read value
|
||||
#ifndef VIRTUAL
|
||||
return get64BitReg(PATTERN_OUT_LSB_REG, PATTERN_OUT_MSB_REG);
|
||||
return getU64BitReg(PATTERN_OUT_LSB_REG, PATTERN_OUT_MSB_REG);
|
||||
#else
|
||||
return virtual_pattern[addr];
|
||||
#endif
|
||||
@ -160,7 +182,7 @@ void writePatternWord(int addr, uint64_t word) {
|
||||
uint32_t reg = PATTERN_CNTRL_REG;
|
||||
|
||||
// write word
|
||||
set64BitReg(word, PATTERN_IN_LSB_REG, PATTERN_IN_MSB_REG);
|
||||
setU64BitReg(word, PATTERN_IN_LSB_REG, PATTERN_IN_MSB_REG);
|
||||
|
||||
// overwrite with only addr
|
||||
bus_w(reg, ((addr << PATTERN_CNTRL_ADDR_OFST) & PATTERN_CNTRL_ADDR_MSK));
|
||||
@ -178,7 +200,7 @@ void writePatternWord(int addr, uint64_t word) {
|
||||
// the first word in RAM as base plus the offset of the word to write (addr)
|
||||
uint32_t reg_lsb = PATTERN_STEP0_LSB_REG + addr * REG_OFFSET * 2;
|
||||
uint32_t reg_msb = PATTERN_STEP0_MSB_REG + addr * REG_OFFSET * 2;
|
||||
set64BitReg(word, reg_lsb, reg_msb);
|
||||
setU64BitReg(word, reg_lsb, reg_msb);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -311,24 +333,24 @@ int validate_getPatternWaitTime(char *message, int level, uint64_t *waittime) {
|
||||
uint64_t getPatternWaitTime(int level) {
|
||||
switch (level) {
|
||||
case 0:
|
||||
return get64BitReg(PATTERN_WAIT_TIMER_0_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_0_MSB_REG);
|
||||
return getU64BitReg(PATTERN_WAIT_TIMER_0_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_0_MSB_REG);
|
||||
case 1:
|
||||
return get64BitReg(PATTERN_WAIT_TIMER_1_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_1_MSB_REG);
|
||||
return getU64BitReg(PATTERN_WAIT_TIMER_1_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_1_MSB_REG);
|
||||
case 2:
|
||||
return get64BitReg(PATTERN_WAIT_TIMER_2_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_2_MSB_REG);
|
||||
return getU64BitReg(PATTERN_WAIT_TIMER_2_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_2_MSB_REG);
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
return get64BitReg(PATTERN_WAIT_TIMER_3_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_3_MSB_REG);
|
||||
return getU64BitReg(PATTERN_WAIT_TIMER_3_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_3_MSB_REG);
|
||||
case 4:
|
||||
return get64BitReg(PATTERN_WAIT_TIMER_4_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_4_MSB_REG);
|
||||
return getU64BitReg(PATTERN_WAIT_TIMER_4_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_4_MSB_REG);
|
||||
case 5:
|
||||
return get64BitReg(PATTERN_WAIT_TIMER_5_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_5_MSB_REG);
|
||||
return getU64BitReg(PATTERN_WAIT_TIMER_5_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_5_MSB_REG);
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
@ -369,29 +391,29 @@ void setPatternWaitTime(int level, uint64_t t) {
|
||||
(long long int)t));
|
||||
switch (level) {
|
||||
case 0:
|
||||
set64BitReg(t, PATTERN_WAIT_TIMER_0_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_0_MSB_REG);
|
||||
setU64BitReg(t, PATTERN_WAIT_TIMER_0_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_0_MSB_REG);
|
||||
break;
|
||||
case 1:
|
||||
set64BitReg(t, PATTERN_WAIT_TIMER_1_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_1_MSB_REG);
|
||||
setU64BitReg(t, PATTERN_WAIT_TIMER_1_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_1_MSB_REG);
|
||||
break;
|
||||
case 2:
|
||||
set64BitReg(t, PATTERN_WAIT_TIMER_2_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_2_MSB_REG);
|
||||
setU64BitReg(t, PATTERN_WAIT_TIMER_2_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_2_MSB_REG);
|
||||
break;
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
set64BitReg(t, PATTERN_WAIT_TIMER_3_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_3_MSB_REG);
|
||||
setU64BitReg(t, PATTERN_WAIT_TIMER_3_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_3_MSB_REG);
|
||||
break;
|
||||
case 4:
|
||||
set64BitReg(t, PATTERN_WAIT_TIMER_4_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_4_MSB_REG);
|
||||
setU64BitReg(t, PATTERN_WAIT_TIMER_4_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_4_MSB_REG);
|
||||
break;
|
||||
case 5:
|
||||
set64BitReg(t, PATTERN_WAIT_TIMER_5_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_5_MSB_REG);
|
||||
setU64BitReg(t, PATTERN_WAIT_TIMER_5_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_5_MSB_REG);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
@ -775,7 +797,7 @@ int loadPattern(char *message, enum TLogLevel printLevel,
|
||||
}
|
||||
}
|
||||
// iocontrol
|
||||
#ifndef MYTHEN3D
|
||||
#if !defined(MYTHEN3D) && !defined(XILINX_CHIPTESTBOARDD) // TODO
|
||||
if (ret == OK) {
|
||||
ret = validate_writePatternIOControl(message, pat->ioctrl);
|
||||
}
|
||||
@ -835,7 +857,7 @@ int getPattern(char *message, patternParameters *pat) {
|
||||
pat->word[i] = retval64;
|
||||
}
|
||||
// iocontrol
|
||||
#ifndef MYTHEN3D
|
||||
#if !defined(MYTHEN3D) && !defined(XILINX_CHIPTESTBOARDD) // TODO
|
||||
if (ret == OK) {
|
||||
validate_readPatternIOControl();
|
||||
}
|
||||
@ -956,7 +978,7 @@ int loadPatternFile(char *patFname, char *errMessage) {
|
||||
uint64_t word = 0;
|
||||
|
||||
// cannot scan values
|
||||
#ifdef VIRTUAL
|
||||
#if defined(VIRTUAL) || defined(XILINX_CHIPTESTBOARDD)
|
||||
if (sscanf(line, "%s 0x%x 0x%lx", command, &addr, &word) != 3) {
|
||||
#else
|
||||
if (sscanf(line, "%s 0x%x 0x%llx", command, &addr, &word) != 3) {
|
||||
@ -971,7 +993,7 @@ int loadPatternFile(char *patFname, char *errMessage) {
|
||||
}
|
||||
|
||||
// patioctrl
|
||||
#ifndef MYTHEN3D
|
||||
#if !defined(MYTHEN3D) && !defined(XILINX_CHIPTESTBOARDD) // TODO
|
||||
if (!strncmp(line, "patioctrl", strlen("patioctrl"))) {
|
||||
uint64_t arg = 0;
|
||||
|
||||
@ -1063,7 +1085,7 @@ int loadPatternFile(char *patFname, char *errMessage) {
|
||||
uint64_t waittime = 0;
|
||||
|
||||
// cannot scan values
|
||||
#ifdef VIRTUAL
|
||||
#if defined(VIRTUAL) || defined(XILINX_CHIPTESTBOARDD)
|
||||
if (sscanf(line, "%s %d %ld", command, &level, &waittime) != 3) {
|
||||
#else
|
||||
if (sscanf(line, "%s %d %lld", command, &level, &waittime) != 3) {
|
||||
|
196
slsDetectorServers/slsDetectorServer/src/programViaArm.c
Normal file
196
slsDetectorServers/slsDetectorServer/src/programViaArm.c
Normal file
@ -0,0 +1,196 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#include "programViaArm.h"
|
||||
#include "clogger.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
|
||||
#include <string.h> //memset
|
||||
#include <unistd.h> // access
|
||||
|
||||
#define CMD_ARM_LOAD_BIT_FILE \
|
||||
"~/fpgautil/fpgautil -b /root/apps/xilinx-ctb/XilinxCTB.bit -f Full"
|
||||
#define CMD_ARM_DEVICE_TREE_API_FOLDER \
|
||||
"/sys/kernel/config/device-tree/overlays/spidr"
|
||||
#define CMD_ARM_DEVICE_TREE_OVERLAY_FILE "/root/apps/xilinx-ctb/pl.dtbo"
|
||||
#define CMD_ARM_LOAD_DEVICE_TREE_FORMAT "cat %s > %s/dtbo"
|
||||
#define CMD_ARM_DEVICE_TREE_DST "/sys/bus/iio/devices/iio:device"
|
||||
#define CMD_ARM_DEVICE_NAME "xilinx-ams", "ad7689", "dac@0", "dac@1", "dac@2"
|
||||
#define TIME_LOAD_DEVICE_TREE_MS (500)
|
||||
|
||||
extern int executeCommand(char *command, char *result, enum TLogLevel level);
|
||||
|
||||
int resetFPGA(char *mess) {
|
||||
LOG(logINFOBLUE, ("Reseting FPGA...\n"));
|
||||
#ifndef VIRTUAL
|
||||
char retvals[MAX_STR_LENGTH] = {0};
|
||||
if (executeCommand(CMD_ARM_LOAD_BIT_FILE, retvals, logDEBUG1) == FAIL) {
|
||||
snprintf(mess, MAX_STR_LENGTH,
|
||||
"Could not reset fpga. Command to load bit file failed (%s)\n",
|
||||
retvals);
|
||||
LOG(logERROR, (mess));
|
||||
return FAIL;
|
||||
}
|
||||
#endif
|
||||
LOG(logINFOBLUE, ("FPGA reset successfully\n"))
|
||||
return OK;
|
||||
}
|
||||
|
||||
int loadDeviceTree(char *mess, int *adcDeviceIndex, int *dacDeviceIndex) {
|
||||
if (verifyDeviceTree(mess, adcDeviceIndex, dacDeviceIndex) == OK)
|
||||
return OK;
|
||||
|
||||
if (checksBeforeCreatingDeviceTree(mess) == FAIL)
|
||||
return FAIL;
|
||||
|
||||
if (createDeviceTree(mess) == FAIL)
|
||||
return FAIL;
|
||||
|
||||
if (verifyDeviceTree(mess, adcDeviceIndex, dacDeviceIndex) == FAIL) {
|
||||
LOG(logERROR, ("Device tree loading failed at verification\n"));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
LOG(logINFOBLUE, ("Device tree loaded successfully\n"))
|
||||
return OK;
|
||||
}
|
||||
|
||||
int checksBeforeCreatingDeviceTree(char *mess) {
|
||||
// check if device tree overlay file exists
|
||||
if (access(CMD_ARM_DEVICE_TREE_OVERLAY_FILE, F_OK) != 0) {
|
||||
snprintf(mess, MAX_STR_LENGTH,
|
||||
"Device tree overlay file (%s) does not exist\n",
|
||||
CMD_ARM_DEVICE_TREE_OVERLAY_FILE);
|
||||
LOG(logERROR, (mess));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("\tDevice tree overlay file exists (%s)\n",
|
||||
CMD_ARM_DEVICE_TREE_OVERLAY_FILE));
|
||||
|
||||
// check if device tree folder exists. If it does, remove it
|
||||
if (access(CMD_ARM_DEVICE_TREE_API_FOLDER, F_OK) == 0) {
|
||||
// remove it
|
||||
char cmd[MAX_STR_LENGTH] = {0};
|
||||
memset(cmd, 0, MAX_STR_LENGTH);
|
||||
sprintf(cmd, "rmdir %s", CMD_ARM_DEVICE_TREE_API_FOLDER);
|
||||
char retvals[MAX_STR_LENGTH] = {0};
|
||||
memset(retvals, 0, MAX_STR_LENGTH);
|
||||
if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) {
|
||||
snprintf(mess, MAX_STR_LENGTH,
|
||||
"Could not unload device tree overlay api with %s (%s)\n",
|
||||
cmd, retvals);
|
||||
LOG(logWARNING, (mess));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("\tUnloaded existing device tree overlay api (%s)\n",
|
||||
CMD_ARM_DEVICE_TREE_API_FOLDER));
|
||||
} else {
|
||||
LOG(logINFO, ("\tNo existing device tree overlay api found(%s)\n",
|
||||
CMD_ARM_DEVICE_TREE_API_FOLDER));
|
||||
}
|
||||
|
||||
// create device tree overlay folder
|
||||
{
|
||||
char cmd[MAX_STR_LENGTH] = {0};
|
||||
memset(cmd, 0, MAX_STR_LENGTH);
|
||||
sprintf(cmd, "mkdir %s", CMD_ARM_DEVICE_TREE_API_FOLDER);
|
||||
char retvals[MAX_STR_LENGTH] = {0};
|
||||
memset(retvals, 0, MAX_STR_LENGTH);
|
||||
if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) {
|
||||
snprintf(mess, MAX_STR_LENGTH,
|
||||
"Could not create device tree overlay api with %s (%s)\n",
|
||||
cmd, retvals);
|
||||
LOG(logWARNING, (mess));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("\tDevice tree overlay api created (%s)\n",
|
||||
CMD_ARM_DEVICE_TREE_API_FOLDER));
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int createDeviceTree(char *mess) {
|
||||
char cmd[MAX_STR_LENGTH] = {0};
|
||||
memset(cmd, 0, MAX_STR_LENGTH);
|
||||
sprintf(cmd, CMD_ARM_LOAD_DEVICE_TREE_FORMAT,
|
||||
CMD_ARM_DEVICE_TREE_OVERLAY_FILE, CMD_ARM_DEVICE_TREE_API_FOLDER);
|
||||
char retvals[MAX_STR_LENGTH] = {0};
|
||||
memset(retvals, 0, MAX_STR_LENGTH);
|
||||
if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) {
|
||||
snprintf(mess, MAX_STR_LENGTH,
|
||||
"Could not load device tree overlay with %s (%s)\n", cmd,
|
||||
retvals);
|
||||
LOG(logWARNING, (mess));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("\tDevice tree overlay created (cmd: %s)\n", cmd));
|
||||
|
||||
usleep(TIME_LOAD_DEVICE_TREE_MS * 1000);
|
||||
return OK;
|
||||
}
|
||||
|
||||
int verifyDeviceTree(char *mess, int *adcDeviceIndex, int *dacDeviceIndex) {
|
||||
LOG(logINFOBLUE, ("Verifying Device Tree...\n"));
|
||||
*adcDeviceIndex = 1;
|
||||
*dacDeviceIndex = 2;
|
||||
#ifndef VIRTUAL
|
||||
|
||||
// check if iio:device0-4 exists in device tree destination
|
||||
int hardcodedDeviceIndex = 0;
|
||||
for (int i = 0; i != 5; ++i) {
|
||||
char deviceName[MAX_STR_LENGTH] = {0};
|
||||
memset(deviceName, 0, MAX_STR_LENGTH);
|
||||
sprintf(deviceName, "%s%d/name", CMD_ARM_DEVICE_TREE_DST, i);
|
||||
// check if device exist
|
||||
if (access(deviceName, F_OK) != 0) {
|
||||
snprintf(mess, MAX_STR_LENGTH,
|
||||
"Could not verify device tree. Device %s does not exist\n",
|
||||
deviceName);
|
||||
LOG(logWARNING, (mess));
|
||||
return FAIL;
|
||||
}
|
||||
// find name
|
||||
char cmd[MAX_STR_LENGTH] = {0};
|
||||
memset(cmd, 0, MAX_STR_LENGTH);
|
||||
sprintf(cmd, "cat %s", deviceName);
|
||||
char retvals[MAX_STR_LENGTH] = {0};
|
||||
memset(retvals, 0, MAX_STR_LENGTH);
|
||||
if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) {
|
||||
snprintf(mess, MAX_STR_LENGTH,
|
||||
"Could not retrieve device name from device %s (%s)\n",
|
||||
deviceName, retvals);
|
||||
LOG(logWARNING, (mess));
|
||||
return FAIL;
|
||||
}
|
||||
// verify name
|
||||
char *deviceNames[] = {CMD_ARM_DEVICE_NAME};
|
||||
if (strstr(retvals, deviceNames[hardcodedDeviceIndex]) == NULL) {
|
||||
// dacs got loaded first
|
||||
if (i == 1 &&
|
||||
strstr(retvals, deviceNames[hardcodedDeviceIndex + 1]) !=
|
||||
NULL) {
|
||||
++hardcodedDeviceIndex;
|
||||
*adcDeviceIndex = 4;
|
||||
*dacDeviceIndex = 1;
|
||||
} else {
|
||||
snprintf(
|
||||
mess, MAX_STR_LENGTH,
|
||||
"Could not verify device tree. Device %s expected %s but "
|
||||
"got %s\n",
|
||||
deviceName, deviceNames[i], retvals);
|
||||
LOG(logWARNING, (mess));
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
++hardcodedDeviceIndex;
|
||||
// in case dacs were loaded first
|
||||
if (hardcodedDeviceIndex == 5)
|
||||
hardcodedDeviceIndex = 1;
|
||||
}
|
||||
#endif
|
||||
LOG(logINFOBLUE, ("Device tree verified successfully [temp: 0, adc:%d, "
|
||||
"dac:%d, %d, %d]\n",
|
||||
*adcDeviceIndex, *dacDeviceIndex, *dacDeviceIndex + 1,
|
||||
*dacDeviceIndex + 2));
|
||||
return OK;
|
||||
}
|
@ -79,7 +79,7 @@ int main(int argc, char *argv[]) {
|
||||
"\t-v, --version : Software version\n"
|
||||
"\t-p, --port <port> : TCP communication port with client. "
|
||||
"\n"
|
||||
"\t-g, --nomodule : [Mythen3][Gotthard2] \n"
|
||||
"\t-g, --nomodule : [Mythen3][Gotthard2][Xilinx Ctb] \n"
|
||||
"\t Generic or No Module mode. Skips "
|
||||
"detector type checks. \n"
|
||||
"\t-f, --phaseshift <value> : [Gotthard] only. Sets phase shift. \n"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,11 @@ add_executable(xilinx_ctbDetectorServer_virtual
|
||||
../slsDetectorServer/src/arm64.c
|
||||
../slsDetectorServer/src/common.c
|
||||
../slsDetectorServer/src/sharedMemory.c
|
||||
../slsDetectorServer/src/loadPattern.c
|
||||
../slsDetectorServer/src/programViaArm.c
|
||||
../slsDetectorServer/src/communication_funcs_UDP.c
|
||||
../../slsSupportLib/src/md5.c
|
||||
../slsDetectorServer/src/LTC2620_Driver.c
|
||||
)
|
||||
|
||||
include_directories(
|
||||
@ -26,7 +30,7 @@ target_compile_definitions(xilinx_ctbDetectorServer_virtual
|
||||
)
|
||||
|
||||
target_link_libraries(xilinx_ctbDetectorServer_virtual
|
||||
PUBLIC pthread rt slsProjectCSettings
|
||||
PUBLIC pthread rt m slsProjectCSettings
|
||||
)
|
||||
|
||||
set_target_properties(xilinx_ctbDetectorServer_virtual PROPERTIES
|
||||
|
@ -18,7 +18,7 @@ DESTDIR ?= bin
|
||||
INSTMODE = 0777
|
||||
|
||||
SRCS = slsDetectorFunctionList.c
|
||||
SRCS += $(main_src)slsDetectorServer.c $(main_src)slsDetectorServer_funcs.c $(main_src)communication_funcs.c $(main_src)arm64.c $(main_src)common.c $(main_src)/sharedMemory.c $(md5_dir)md5.c
|
||||
SRCS += $(main_src)slsDetectorServer.c $(main_src)slsDetectorServer_funcs.c $(main_src)communication_funcs.c $(main_src)arm64.c $(main_src)common.c $(main_src)/sharedMemory.c $(main_src)/loadPattern.c $(md5_dir)md5.c $(main_src)programViaArm.c $(main_src)LTC2620_Driver.c
|
||||
|
||||
OBJS = $(SRCS:.c=.o)
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,7 @@
|
||||
#include "RegisterDefs.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
|
||||
#define REQRD_FRMWRE_VRSN (0x230000)
|
||||
#define REQRD_FRMWRE_VRSN (0x230710)
|
||||
#define KERNEL_DATE_VRSN "Wed Nov 29 17:32:14 CET 2023"
|
||||
|
||||
#define LINKED_SERVER_NAME "xilinx_ctbDetectorServer"
|
||||
@ -12,7 +12,134 @@
|
||||
#define CTRL_SRVR_INIT_TIME_US (2 * 1000 * 1000)
|
||||
|
||||
/* Hardware Definitions */
|
||||
#define NCHAN (1)
|
||||
#define NCHAN (40)
|
||||
#define NCHAN_ANALOG (32)
|
||||
#define NCHAN_DIGITAL (64)
|
||||
#define NCHAN_TRANSCEIVER (4)
|
||||
#define NBITS_PER_TRANSCEIVER (64)
|
||||
#define NCHIP (1)
|
||||
#define NDAC (24)
|
||||
#define NPWR (6)
|
||||
#define NDAC_ONLY (NDAC - NPWR)
|
||||
|
||||
enum ADCINDEX { V_PWR_IO };
|
||||
enum DACINDEX { D0 };
|
||||
#define DYNAMIC_RANGE (16)
|
||||
#define NUM_BYTES_PER_PIXEL (DYNAMIC_RANGE / 8)
|
||||
|
||||
#define DAC_DRIVER_NUM_DEVICES (3)
|
||||
#define DAC_DRIVER_FILE_NAME \
|
||||
("/sys/bus/iio/devices/iio:device%d/out_voltage%d_raw")
|
||||
#define DAC_POWERDOWN_DRIVER_FILE_NAME \
|
||||
("/sys/bus/iio/devices/iio:device%d/out_voltage%d_powerdown")
|
||||
|
||||
#define SLOWADC_DRIVER_FILE_NAME \
|
||||
("/sys/bus/iio/devices/iio:device%d/in_voltage%d_raw")
|
||||
//#define SLOWDAC_CONVERTION_FACTOR_TO_UV (62.500953)
|
||||
|
||||
#define TEMP_DRIVER_FILE_NAME \
|
||||
("/sys/bus/iio/devices/iio:device0/in_temp7_input")
|
||||
|
||||
/** Default Parameters */
|
||||
#define DEFAULT_NUM_FRAMES (1)
|
||||
#define DEFAULT_NUM_CYCLES (1)
|
||||
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
||||
#define DEFAULT_EXPTIME (0)
|
||||
#define DEFAULT_PERIOD (300 * 1000) // 300us
|
||||
#define DEFAULT_READOUT_MODE (TRANSCEIVER_ONLY)
|
||||
#define DEFAULT_READOUT_MODE_STR "transceiver_only"
|
||||
#define DEFAULT_TRANSCEIVER_MASK (0x3) // TODO: check
|
||||
#define DEFAULT_NUM_ASAMPLES (1)
|
||||
#define DEFAULT_NUM_DSAMPLES (1)
|
||||
#define DEFAULT_NUM_TSAMPLES (200)
|
||||
#define DEFAULT_STARTING_FRAME_NUMBER (1)
|
||||
#define DEFAULT_VLIMIT (-100)
|
||||
#define DEFAULT_DELAY (0)
|
||||
|
||||
#define MAX_TRANSCEIVER_MASK (0xF)
|
||||
#define MAX_TRANSCEIVER_SAMPLES (0x1FFF)
|
||||
|
||||
#define MAX_ANALOG_SAMPLES (0x3FFF)
|
||||
#define MAX_DIGITAL_SAMPLES (0x3FFF)
|
||||
|
||||
#define DAC_MIN_MV (0)
|
||||
#define DAC_MAX_MV (2500)
|
||||
|
||||
#define TICK_CLK (20) // MHz (trig_timeFromStart, frametime, timeFromStart)
|
||||
#define RUN_CLK \
|
||||
(100) // MHz (framesFromStart, c_swTrigger, run, waitForTrigger, starting,
|
||||
// acquiring, waitForPeriod, internalStop, c_framesFromSTart_reset,
|
||||
// s_start, c_stop, triggerEnable, period, frames, cycles, delay)
|
||||
|
||||
/* Defines in the Firmware */
|
||||
#define WAIT_TIME_PATTERN_READ (10)
|
||||
#define WAIT_TIME_OUT_0US_TIMES (35000) // 2s
|
||||
|
||||
#define BIT32_MSK (0xFFFFFFFF)
|
||||
#define BIT16_MASK (0xFFFF)
|
||||
|
||||
#define MAX_DATA_SIZE_IN_PACKET (8144)
|
||||
|
||||
/* Enum Definitions */
|
||||
enum ADCINDEX {
|
||||
S_ADC0,
|
||||
S_ADC1,
|
||||
S_ADC2,
|
||||
S_ADC3,
|
||||
S_ADC4,
|
||||
S_ADC5,
|
||||
S_ADC6,
|
||||
S_ADC7,
|
||||
TEMP_FPGA
|
||||
};
|
||||
enum DACINDEX {
|
||||
D0,
|
||||
D1,
|
||||
D2,
|
||||
D3,
|
||||
D4,
|
||||
D5,
|
||||
D6,
|
||||
D7,
|
||||
D8,
|
||||
D9,
|
||||
D10,
|
||||
D11,
|
||||
D12,
|
||||
D13,
|
||||
D14,
|
||||
D15,
|
||||
D16,
|
||||
D17,
|
||||
D_PWR_D,
|
||||
D_PWR_EMPTY,
|
||||
D_PWR_IO,
|
||||
D_PWR_A,
|
||||
D_PWR_B,
|
||||
D_PWR_C
|
||||
};
|
||||
|
||||
/* Struct Definitions */
|
||||
typedef struct udp_header_struct {
|
||||
uint32_t udp_destmac_msb;
|
||||
uint16_t udp_srcmac_msb;
|
||||
uint16_t udp_destmac_lsb;
|
||||
uint32_t udp_srcmac_lsb;
|
||||
uint8_t ip_tos;
|
||||
uint8_t ip_ihl : 4, ip_ver : 4;
|
||||
uint16_t udp_ethertype;
|
||||
uint16_t ip_identification;
|
||||
uint16_t ip_totallength;
|
||||
uint8_t ip_protocol;
|
||||
uint8_t ip_ttl;
|
||||
uint16_t ip_fragmentoffset : 13, ip_flags : 3;
|
||||
uint16_t ip_srcip_msb;
|
||||
uint16_t ip_checksum;
|
||||
uint16_t ip_destip_msb;
|
||||
uint16_t ip_srcip_lsb;
|
||||
uint16_t udp_srcport;
|
||||
uint16_t ip_destip_lsb;
|
||||
uint16_t udp_checksum;
|
||||
uint16_t udp_destport;
|
||||
} udp_header;
|
||||
|
||||
#define IP_HEADER_SIZE (20)
|
||||
#define UDP_IP_HEADER_LENGTH_BYTES (28)
|
||||
|
@ -80,7 +80,7 @@ _sd() {
|
||||
local IS_PATH=0
|
||||
|
||||
|
||||
local SLS_COMMANDS=" acquire activate adcclk adcenable adcenable10g adcindex adcinvert adclist adcname adcphase adcpipeline adcreg adcvpp apulse asamples autocompdisable badchannels blockingtrigger burstmode burstperiod bursts burstsl bustest cdsgain chipversion clearbit clearbusy clearroi clientversion clkdiv clkfreq clkphase column compdisabletime confadc config counters currentsource dac dacindex daclist dacname dacvalues datastream dbitclk dbitphase dbitpipeline defaultdac defaultpattern delay delayl detectorserverversion detsize diodelay dpulse dr drlist dsamples execcommand exptime exptime1 exptime2 exptime3 exptimel extrastoragecells extsampling extsamplingsrc extsig fformat filtercells filterresistor findex firmwaretest firmwareversion fliprows flowcontrol10g fmaster fname foverwrite fpath framecounter frames framesl frametime free fwrite gaincaps gainmode gappixels gatedelay gatedelay1 gatedelay2 gatedelay3 gates getbit hardwareversion highvoltage hostname im_a im_b im_c im_d im_io imagetest initialchecks inj_ch interpolation interruptsubframe kernelversion lastclient led lock master maxadcphaseshift maxclkphaseshift maxdbitphaseshift measuredperiod measuredsubperiod moduleid nextframenumber nmod numinterfaces overflow packageversion parallel parameters partialreset patfname patioctrl patlimits patloop patloop0 patloop1 patloop2 patmask patnloop patnloop0 patnloop1 patnloop2 patsetbit patternX patternstart patwait patwait0 patwait1 patwait2 patwaittime patwaittime0 patwaittime1 patwaittime2 patword pedestalmode period periodl polarity port powerchip powerindex powerlist powername powervalues programfpga pulse pulsechip pulsenmove pumpprobe quad ratecorr readnrows readout readoutspeed readoutspeedlist rebootcontroller reg resetdacs resetfpga roi romode row runclk runtime rx_arping rx_clearroi rx_dbitlist rx_dbitoffset rx_discardpolicy rx_fifodepth rx_frameindex rx_framescaught rx_framesperfile rx_hostname rx_jsonaddheader rx_jsonpara rx_lastclient rx_lock rx_missingpackets rx_padding rx_printconfig rx_realudpsocksize rx_roi rx_silent rx_start rx_status rx_stop rx_tcpport rx_threads rx_udpsocksize rx_version rx_zmqfreq rx_zmqhwm rx_zmqip rx_zmqport rx_zmqstartfnum rx_zmqstream samples savepattern scan scanerrmsg selinterface serialnumber setbit settings settingslist settingspath signalindex signallist signalname slowadc slowadcindex slowadclist slowadcname slowadcvalues start status stop stopport storagecell_delay storagecell_start subdeadtime subexptime sync syncclk temp_10ge temp_adc temp_control temp_dcdc temp_event temp_fpga temp_fpgaext temp_fpgafl temp_fpgafr temp_slowadc temp_sodl temp_sodr temp_threshold templist tempvalues tengiga threshold thresholdnotb timing timinglist timingsource top transceiverenable trigger triggers triggersl trimbits trimen trimval tsamples txdelay txdelay_frame txdelay_left txdelay_right type udp_cleardst udp_dstip udp_dstip2 udp_dstlist udp_dstmac udp_dstmac2 udp_dstport udp_dstport2 udp_firstdst udp_numdst udp_reconfigure udp_srcip udp_srcip2 udp_srcmac udp_srcmac2 udp_validate update updatedetectorserver updatekernel updatemode user v_a v_b v_c v_chip v_d v_io v_limit vchip_comp_adc vchip_comp_fe vchip_cs vchip_opa_1st vchip_opa_fd vchip_ref_comp_fe versions veto vetoalg vetofile vetophoton vetoref vetostream virtual vm_a vm_b vm_c vm_d vm_io zmqhwm zmqip zmqport "
|
||||
local SLS_COMMANDS=" acquire activate adcclk adcenable adcenable10g adcindex adcinvert adclist adcname adcphase adcpipeline adcreg adcvpp apulse asamples autocompdisable badchannels blockingtrigger burstmode burstperiod bursts burstsl bustest cdsgain chipversion clearbit clearbusy clearroi clientversion clkdiv clkfreq clkphase column compdisabletime confadc config configtransceiver counters currentsource dac dacindex daclist dacname dacvalues datastream dbitclk dbitphase dbitpipeline defaultdac defaultpattern delay delayl detectorserverversion detsize diodelay dpulse dr drlist dsamples execcommand exptime exptime1 exptime2 exptime3 exptimel extrastoragecells extsampling extsamplingsrc extsig fformat filtercells filterresistor findex firmwaretest firmwareversion fliprows flowcontrol10g fmaster fname foverwrite fpath framecounter frames framesl frametime free fwrite gaincaps gainmode gappixels gatedelay gatedelay1 gatedelay2 gatedelay3 gates getbit hardwareversion highvoltage hostname im_a im_b im_c im_d im_io imagetest initialchecks inj_ch interpolation interruptsubframe kernelversion lastclient led lock master maxadcphaseshift maxclkphaseshift maxdbitphaseshift measuredperiod measuredsubperiod moduleid nextframenumber nmod numinterfaces overflow packageversion parallel parameters partialreset patfname patioctrl patlimits patloop patloop0 patloop1 patloop2 patmask patnloop patnloop0 patnloop1 patnloop2 patsetbit patternX patternstart patwait patwait0 patwait1 patwait2 patwaittime patwaittime0 patwaittime1 patwaittime2 patword pedestalmode period periodl polarity port powerchip powerindex powerlist powername powervalues programfpga pulse pulsechip pulsenmove pumpprobe quad ratecorr readnrows readout readoutspeed readoutspeedlist rebootcontroller reg resetdacs resetfpga roi romode row runclk runtime rx_arping rx_clearroi rx_dbitlist rx_dbitoffset rx_discardpolicy rx_fifodepth rx_frameindex rx_framescaught rx_framesperfile rx_hostname rx_jsonaddheader rx_jsonpara rx_lastclient rx_lock rx_missingpackets rx_padding rx_printconfig rx_realudpsocksize rx_roi rx_silent rx_start rx_status rx_stop rx_tcpport rx_threads rx_udpsocksize rx_version rx_zmqfreq rx_zmqhwm rx_zmqip rx_zmqport rx_zmqstartfnum rx_zmqstream samples savepattern scan scanerrmsg selinterface serialnumber setbit settings settingslist settingspath signalindex signallist signalname slowadc slowadcindex slowadclist slowadcname slowadcvalues start status stop stopport storagecell_delay storagecell_start subdeadtime subexptime sync syncclk temp_10ge temp_adc temp_control temp_dcdc temp_event temp_fpga temp_fpgaext temp_fpgafl temp_fpgafr temp_slowadc temp_sodl temp_sodr temp_threshold templist tempvalues tengiga threshold thresholdnotb timing timinglist timingsource top transceiverenable trigger triggers triggersl trimbits trimen trimval tsamples txdelay txdelay_frame txdelay_left txdelay_right type udp_cleardst udp_dstip udp_dstip2 udp_dstlist udp_dstmac udp_dstmac2 udp_dstport udp_dstport2 udp_firstdst udp_numdst udp_reconfigure udp_srcip udp_srcip2 udp_srcmac udp_srcmac2 udp_validate update updatedetectorserver updatekernel updatemode user v_a v_b v_c v_chip v_d v_io v_limit vchip_comp_adc vchip_comp_fe vchip_cs vchip_opa_1st vchip_opa_fd vchip_ref_comp_fe versions veto vetoalg vetofile vetophoton vetoref vetostream virtual vm_a vm_b vm_c vm_d vm_io zmqhwm zmqip zmqport "
|
||||
__acquire() {
|
||||
FCN_RETURN=""
|
||||
return 0
|
||||
@ -477,6 +477,16 @@ fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__configtransceiver() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 1 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
IS_PATH=1
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__counters() {
|
||||
FCN_RETURN=""
|
||||
return 0
|
||||
|
@ -4,7 +4,7 @@
|
||||
_sd() {
|
||||
|
||||
|
||||
local SLS_COMMANDS=" acquire activate adcclk adcenable adcenable10g adcindex adcinvert adclist adcname adcphase adcpipeline adcreg adcvpp apulse asamples autocompdisable badchannels blockingtrigger burstmode burstperiod bursts burstsl bustest cdsgain chipversion clearbit clearbusy clearroi clientversion clkdiv clkfreq clkphase column compdisabletime confadc config counters currentsource dac dacindex daclist dacname dacvalues datastream dbitclk dbitphase dbitpipeline defaultdac defaultpattern delay delayl detectorserverversion detsize diodelay dpulse dr drlist dsamples execcommand exptime exptime1 exptime2 exptime3 exptimel extrastoragecells extsampling extsamplingsrc extsig fformat filtercells filterresistor findex firmwaretest firmwareversion fliprows flowcontrol10g fmaster fname foverwrite fpath framecounter frames framesl frametime free fwrite gaincaps gainmode gappixels gatedelay gatedelay1 gatedelay2 gatedelay3 gates getbit hardwareversion highvoltage hostname im_a im_b im_c im_d im_io imagetest initialchecks inj_ch interpolation interruptsubframe kernelversion lastclient led lock master maxadcphaseshift maxclkphaseshift maxdbitphaseshift measuredperiod measuredsubperiod moduleid nextframenumber nmod numinterfaces overflow packageversion parallel parameters partialreset patfname patioctrl patlimits patloop patloop0 patloop1 patloop2 patmask patnloop patnloop0 patnloop1 patnloop2 patsetbit patternX patternstart patwait patwait0 patwait1 patwait2 patwaittime patwaittime0 patwaittime1 patwaittime2 patword pedestalmode period periodl polarity port powerchip powerindex powerlist powername powervalues programfpga pulse pulsechip pulsenmove pumpprobe quad ratecorr readnrows readout readoutspeed readoutspeedlist rebootcontroller reg resetdacs resetfpga roi romode row runclk runtime rx_arping rx_clearroi rx_dbitlist rx_dbitoffset rx_discardpolicy rx_fifodepth rx_frameindex rx_framescaught rx_framesperfile rx_hostname rx_jsonaddheader rx_jsonpara rx_lastclient rx_lock rx_missingpackets rx_padding rx_printconfig rx_realudpsocksize rx_roi rx_silent rx_start rx_status rx_stop rx_tcpport rx_threads rx_udpsocksize rx_version rx_zmqfreq rx_zmqhwm rx_zmqip rx_zmqport rx_zmqstartfnum rx_zmqstream samples savepattern scan scanerrmsg selinterface serialnumber setbit settings settingslist settingspath signalindex signallist signalname slowadc slowadcindex slowadclist slowadcname slowadcvalues start status stop stopport storagecell_delay storagecell_start subdeadtime subexptime sync syncclk temp_10ge temp_adc temp_control temp_dcdc temp_event temp_fpga temp_fpgaext temp_fpgafl temp_fpgafr temp_slowadc temp_sodl temp_sodr temp_threshold templist tempvalues tengiga threshold thresholdnotb timing timinglist timingsource top transceiverenable trigger triggers triggersl trimbits trimen trimval tsamples txdelay txdelay_frame txdelay_left txdelay_right type udp_cleardst udp_dstip udp_dstip2 udp_dstlist udp_dstmac udp_dstmac2 udp_dstport udp_dstport2 udp_firstdst udp_numdst udp_reconfigure udp_srcip udp_srcip2 udp_srcmac udp_srcmac2 udp_validate update updatedetectorserver updatekernel updatemode user v_a v_b v_c v_chip v_d v_io v_limit vchip_comp_adc vchip_comp_fe vchip_cs vchip_opa_1st vchip_opa_fd vchip_ref_comp_fe versions veto vetoalg vetofile vetophoton vetoref vetostream virtual vm_a vm_b vm_c vm_d vm_io zmqhwm zmqip zmqport "
|
||||
local SLS_COMMANDS=" acquire activate adcclk adcenable adcenable10g adcindex adcinvert adclist adcname adcphase adcpipeline adcreg adcvpp apulse asamples autocompdisable badchannels blockingtrigger burstmode burstperiod bursts burstsl bustest cdsgain chipversion clearbit clearbusy clearroi clientversion clkdiv clkfreq clkphase column compdisabletime confadc config configtransceiver counters currentsource dac dacindex daclist dacname dacvalues datastream dbitclk dbitphase dbitpipeline defaultdac defaultpattern delay delayl detectorserverversion detsize diodelay dpulse dr drlist dsamples execcommand exptime exptime1 exptime2 exptime3 exptimel extrastoragecells extsampling extsamplingsrc extsig fformat filtercells filterresistor findex firmwaretest firmwareversion fliprows flowcontrol10g fmaster fname foverwrite fpath framecounter frames framesl frametime free fwrite gaincaps gainmode gappixels gatedelay gatedelay1 gatedelay2 gatedelay3 gates getbit hardwareversion highvoltage hostname im_a im_b im_c im_d im_io imagetest initialchecks inj_ch interpolation interruptsubframe kernelversion lastclient led lock master maxadcphaseshift maxclkphaseshift maxdbitphaseshift measuredperiod measuredsubperiod moduleid nextframenumber nmod numinterfaces overflow packageversion parallel parameters partialreset patfname patioctrl patlimits patloop patloop0 patloop1 patloop2 patmask patnloop patnloop0 patnloop1 patnloop2 patsetbit patternX patternstart patwait patwait0 patwait1 patwait2 patwaittime patwaittime0 patwaittime1 patwaittime2 patword pedestalmode period periodl polarity port powerchip powerindex powerlist powername powervalues programfpga pulse pulsechip pulsenmove pumpprobe quad ratecorr readnrows readout readoutspeed readoutspeedlist rebootcontroller reg resetdacs resetfpga roi romode row runclk runtime rx_arping rx_clearroi rx_dbitlist rx_dbitoffset rx_discardpolicy rx_fifodepth rx_frameindex rx_framescaught rx_framesperfile rx_hostname rx_jsonaddheader rx_jsonpara rx_lastclient rx_lock rx_missingpackets rx_padding rx_printconfig rx_realudpsocksize rx_roi rx_silent rx_start rx_status rx_stop rx_tcpport rx_threads rx_udpsocksize rx_version rx_zmqfreq rx_zmqhwm rx_zmqip rx_zmqport rx_zmqstartfnum rx_zmqstream samples savepattern scan scanerrmsg selinterface serialnumber setbit settings settingslist settingspath signalindex signallist signalname slowadc slowadcindex slowadclist slowadcname slowadcvalues start status stop stopport storagecell_delay storagecell_start subdeadtime subexptime sync syncclk temp_10ge temp_adc temp_control temp_dcdc temp_event temp_fpga temp_fpgaext temp_fpgafl temp_fpgafr temp_slowadc temp_sodl temp_sodr temp_threshold templist tempvalues tengiga threshold thresholdnotb timing timinglist timingsource top transceiverenable trigger triggers triggersl trimbits trimen trimval tsamples txdelay txdelay_frame txdelay_left txdelay_right type udp_cleardst udp_dstip udp_dstip2 udp_dstlist udp_dstmac udp_dstmac2 udp_dstport udp_dstport2 udp_firstdst udp_numdst udp_reconfigure udp_srcip udp_srcip2 udp_srcmac udp_srcmac2 udp_validate update updatedetectorserver updatekernel updatemode user v_a v_b v_c v_chip v_d v_io v_limit vchip_comp_adc vchip_comp_fe vchip_cs vchip_opa_1st vchip_opa_fd vchip_ref_comp_fe versions veto vetoalg vetofile vetophoton vetoref vetostream virtual vm_a vm_b vm_c vm_d vm_io zmqhwm zmqip zmqport "
|
||||
__acquire() {
|
||||
FCN_RETURN=""
|
||||
return 0
|
||||
@ -401,6 +401,16 @@ fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__configtransceiver() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 1 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
IS_PATH=1
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__counters() {
|
||||
FCN_RETURN=""
|
||||
return 0
|
||||
|
@ -441,7 +441,7 @@ period:
|
||||
function: setPeriod
|
||||
|
||||
delay:
|
||||
help: "[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb][Moench] Delay after trigger"
|
||||
help: "[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb][Moench][Xilinx Ctb] Delay after trigger"
|
||||
inherit_actions: TIME_COMMAND
|
||||
actions:
|
||||
GET:
|
||||
@ -496,14 +496,14 @@ burstperiod:
|
||||
|
||||
################# TIME_GET_COMMAND #############
|
||||
delayl:
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Delay Left in Acquisition. \n\t[Gotthard2] only in continuous mode."
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Delay Left in Acquisition. \n\t[Gotthard2] only in continuous mode."
|
||||
inherit_actions: TIME_GET_COMMAND
|
||||
actions:
|
||||
GET:
|
||||
function: getDelayAfterTriggerLeft
|
||||
|
||||
periodl:
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Ctb][Mythen3][Gotthard2] Period left for current frame. \n\t[Gotthard2] only in continuous mode."
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Ctb][Mythen3][Gotthard2][Xilinx Ctb] Period left for current frame. \n\t[Gotthard2] only in continuous mode."
|
||||
inherit_actions: TIME_GET_COMMAND
|
||||
actions:
|
||||
GET:
|
||||
@ -531,14 +531,14 @@ exptimel:
|
||||
function: getExptimeLeft
|
||||
|
||||
runtime:
|
||||
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Time from detector start up.\n\t[Gotthard2] not in burst and auto mode."
|
||||
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Time from detector start up.\n\t[Gotthard2] not in burst and auto mode."
|
||||
inherit_actions: TIME_GET_COMMAND
|
||||
actions:
|
||||
GET:
|
||||
function: getActualTime
|
||||
|
||||
frametime:
|
||||
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Timestamp at a frame start.\n\t[Gotthard2] not in burst and auto mode."
|
||||
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Timestamp at a frame start.\n\t[Gotthard2] not in burst and auto mode."
|
||||
inherit_actions: TIME_GET_COMMAND
|
||||
actions:
|
||||
GET:
|
||||
@ -585,7 +585,7 @@ patioctrl:
|
||||
function: setPatternIOControl
|
||||
|
||||
patmask:
|
||||
help: "[64 bit mask]\n\t[Ctb][Mythen3] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern."
|
||||
help: "[64 bit mask]\n\t[Ctb][Mythen3][Xilinx Ctb] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern."
|
||||
inherit_actions: INTEGER_COMMAND_HEX_WIDTH16
|
||||
actions:
|
||||
GET:
|
||||
@ -594,7 +594,7 @@ patmask:
|
||||
function: setPatternMask
|
||||
|
||||
patsetbit:
|
||||
help: "[64 bit mask]\n\t[Ctb][Mythen3] Sets the mask applied to every pattern to the selected bits."
|
||||
help: "[64 bit mask]\n\t[Ctb][Mythen3][Xilinx Ctb] Sets the mask applied to every pattern to the selected bits."
|
||||
inherit_actions: INTEGER_COMMAND_HEX_WIDTH16
|
||||
actions:
|
||||
GET:
|
||||
@ -622,7 +622,7 @@ adcenable10g:
|
||||
function: setTenGigaADCEnableMask
|
||||
|
||||
transceiverenable:
|
||||
help: "[bitmask]\n\t[Ctb] Transceiver Enable Mask. Enable for each 4 Transceiver channel."
|
||||
help: "[bitmask]\n\t[Ctb][Xilinx Ctb] Transceiver Enable Mask. Enable for each 4 Transceiver channel."
|
||||
inherit_actions: INTEGER_COMMAND_HEX
|
||||
actions:
|
||||
GET:
|
||||
@ -688,7 +688,7 @@ column:
|
||||
function: setColumn
|
||||
|
||||
timing:
|
||||
help: "[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Moench][Gotthard][Ctb][Gotthard2] [auto|trigger]\n\t[Mythen3] [auto|trigger|gating|trigger_gating]\n\t[Eiger] [auto|trigger|gating|burst_trigger]"
|
||||
help: "[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Moench][Gotthard][Ctb][Gotthard2][Xilinx Ctb] [auto|trigger]\n\t[Mythen3] [auto|trigger|gating|trigger_gating]\n\t[Eiger] [auto|trigger|gating|burst_trigger]"
|
||||
inherit_actions: INTEGER_COMMAND_VEC_ID
|
||||
actions:
|
||||
GET:
|
||||
@ -707,7 +707,7 @@ highvoltage:
|
||||
function: setHighVoltage
|
||||
|
||||
powerchip:
|
||||
help: "[0, 1]\n\t[Jungfrau][Moench][Mythen3][Gotthard2] Power the chip. \n\t[Jungfrau][Moench] Default is 0. Get will return power status. Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled. Will configure chip (only chip v1.1)\n\t[Mythen3][Gotthard2] Default is 1. If module not connected or wrong module, powerchip will fail."
|
||||
help: "[0, 1]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Xilinx Ctb] Power the chip. \n\t[Jungfrau][Moench] Default is 0. Get will return power status. Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled. Will configure chip (only chip v1.1)\n\t[Mythen3][Gotthard2] Default is 1. If module not connected or wrong module, powerchip will fail.\n\t[Xilinx Ctb] Default is 0. Also configures the chip if powered on."
|
||||
inherit_actions: INTEGER_COMMAND_VEC_ID
|
||||
actions:
|
||||
GET:
|
||||
@ -764,7 +764,7 @@ readnrows:
|
||||
function: setReadNRows
|
||||
|
||||
nextframenumber:
|
||||
help: "[n_value]\n\t[Eiger][Jungfrau][Moench][Ctb] Next frame number. Stopping acquisition might result in different frame numbers for different modules."
|
||||
help: "[n_value]\n\t[Eiger][Jungfrau][Moench][Ctb][Xilinx Ctb] Next frame number. Stopping acquisition might result in different frame numbers for different modules."
|
||||
inherit_actions: INTEGER_COMMAND_VEC_ID
|
||||
actions:
|
||||
GET:
|
||||
@ -1298,7 +1298,7 @@ dsamples:
|
||||
function: setNumberOfDigitalSamples
|
||||
|
||||
tsamples:
|
||||
help: "[n_value]\n\t[Ctb] Number of transceiver samples expected."
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Number of transceiver samples expected."
|
||||
inherit_actions: INTEGER_COMMAND_VEC_ID
|
||||
actions:
|
||||
GET:
|
||||
@ -1307,7 +1307,7 @@ tsamples:
|
||||
function: setNumberOfTransceiverSamples
|
||||
|
||||
romode:
|
||||
help: "[analog|digital|analog_digital|transceiver|digital_transceiver]\n\t[Ctb] Readout mode. Default is analog."
|
||||
help: "[analog|digital|analog_digital|transceiver|digital_transceiver]\n\t[Ctb][xilinx Ctb] Readout mode. [Ctb] Default is analog. [Xilinx Ctb] Default is Transceiver (only one implemented so far)"
|
||||
inherit_actions: INTEGER_COMMAND_VEC_ID
|
||||
actions:
|
||||
GET:
|
||||
@ -1506,7 +1506,7 @@ triggers:
|
||||
|
||||
dr:
|
||||
inherit_actions: INTEGER_COMMAND_SET_NOID_GET_ID
|
||||
help: "[value]\n\tDynamic Range or number of bits per pixel in detector.\n\t[Eiger] Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2, else to 0.\n\t[Mythen3] Options: 8, 16, 32\n\t[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2] 16"
|
||||
help: "[value]\n\tDynamic Range or number of bits per pixel in detector.\n\t[Eiger] Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2, else to 0.\n\t[Mythen3] Options: 8, 16, 32\n\t[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2][Xilinx Ctb] 16"
|
||||
actions:
|
||||
GET:
|
||||
function: getDynamicRange
|
||||
@ -1555,7 +1555,7 @@ fmaster:
|
||||
################# INTEGER_IND_COMMAND #######################
|
||||
v_limit:
|
||||
inherit_actions: INTEGER_IND_COMMAND
|
||||
help: "[n_value]\n\t[Ctb] Soft limit for power supplies (ctb only) and DACS in mV."
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Soft limit for power supplies (ctb only) and DACS in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getPower
|
||||
@ -1566,7 +1566,7 @@ v_limit:
|
||||
|
||||
v_a:
|
||||
inherit_actions: INTEGER_IND_COMMAND
|
||||
help: "[n_value]\n\t[Ctb] Power supply a in mV."
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply a in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getPower
|
||||
@ -1577,7 +1577,7 @@ v_a:
|
||||
|
||||
v_b:
|
||||
inherit_actions: INTEGER_IND_COMMAND
|
||||
help: "[n_value]\n\t[Ctb] Power supply b in mV."
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply b in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getPower
|
||||
@ -1588,7 +1588,7 @@ v_b:
|
||||
|
||||
v_c:
|
||||
inherit_actions: INTEGER_IND_COMMAND
|
||||
help: "[n_value]\n\t[Ctb] Power supply c in mV."
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply c in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getPower
|
||||
@ -1599,7 +1599,7 @@ v_c:
|
||||
|
||||
v_d:
|
||||
inherit_actions: INTEGER_IND_COMMAND
|
||||
help: "[n_value]\n\t[Ctb] Power supply d in mV."
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply d in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getPower
|
||||
@ -1610,7 +1610,7 @@ v_d:
|
||||
|
||||
v_io:
|
||||
inherit_actions: INTEGER_IND_COMMAND
|
||||
help: "[n_value]\n\t[Ctb] Power supply io in mV. Minimum 1200 mV. Must be the first power regulator to be set after fpga reset (on-board detector server start up)."
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply io in mV. Minimum 1200 mV. Must be the first power regulator to be set after fpga reset (on-board detector server start up)."
|
||||
actions:
|
||||
GET:
|
||||
function: getPower
|
||||
@ -1792,21 +1792,21 @@ patternstart:
|
||||
|
||||
resetfpga:
|
||||
inherit_actions: EXECUTE_SET_COMMAND
|
||||
help: "\n\t[Jungfrau][Moench][Ctb] Reset FPGA."
|
||||
help: "\n\t[Jungfrau][Moench][Ctb][Xilinx Ctb] Reset FPGA."
|
||||
actions:
|
||||
PUT:
|
||||
function: resetFPGA
|
||||
|
||||
rebootcontroller:
|
||||
inherit_actions: EXECUTE_SET_COMMAND
|
||||
help: "\n\t[Jungfrau][Moench][Ctb][Gotthard][Mythen3][Gotthard2] Reboot controller of detector."
|
||||
help: "\n\t[Jungfrau][Moench][Ctb][Gotthard][Mythen3][Gotthard2][Xilinx Ctb] Reboot controller of detector."
|
||||
actions:
|
||||
PUT:
|
||||
function: rebootController
|
||||
|
||||
firmwaretest:
|
||||
inherit_actions: EXECUTE_SET_COMMAND
|
||||
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb] Firmware test, ie. reads a read fixed pattern from a register."
|
||||
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Firmware test, ie. reads a read fixed pattern from a register."
|
||||
actions:
|
||||
PUT:
|
||||
function: executeFirmwareTest
|
||||
@ -1818,6 +1818,13 @@ bustest:
|
||||
PUT:
|
||||
function: executeBusTest
|
||||
|
||||
configtransceiver:
|
||||
inherit_actions: EXECUTE_SET_COMMAND
|
||||
help: "\n\t[Xilinx Ctb] Waits for transceiver to be aligned. Chip had to be configured (powered on) before this."
|
||||
actions:
|
||||
PUT:
|
||||
function: configureTransceiver
|
||||
|
||||
################# EXECUTE_SET_COMMAND_NOID_1ARG ##############
|
||||
config:
|
||||
inherit_actions: EXECUTE_SET_COMMAND_NOID_1ARG
|
||||
@ -1835,7 +1842,7 @@ parameters:
|
||||
|
||||
savepattern:
|
||||
inherit_actions: EXECUTE_SET_COMMAND_NOID_1ARG
|
||||
help: "\n\t[Ctb][Mythen3] Saves pattern to file (ascii). \n\t[Ctb] Also executes pattern."
|
||||
help: "\n\t[Ctb][Mythen3][Xilinx Ctb] Saves pattern to file (ascii). \n\t[Ctb] Also executes pattern."
|
||||
actions:
|
||||
PUT:
|
||||
function: savePattern
|
||||
@ -1850,7 +1857,7 @@ detectorserverversion:
|
||||
|
||||
hardwareversion:
|
||||
inherit_actions: GET_COMMAND
|
||||
help: "\n\t[Jungfrau][Gotthard2][Myhten3][Gotthard][Ctb][Moench] Hardware version of detector. \n\t[Eiger] Hardware version of front FPGA on detector."
|
||||
help: "\n\tHardware version of detector. \n\t[Eiger] Hardware version of front FPGA on detector."
|
||||
actions:
|
||||
GET:
|
||||
function: getHardwareVersion
|
||||
@ -1885,14 +1892,14 @@ type:
|
||||
|
||||
framesl:
|
||||
inherit_actions: GET_COMMAND
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of frames left in acquisition. \n\t[Gotthard2] only in continuous auto mode."
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number of frames left in acquisition. \n\t[Gotthard2] only in continuous auto mode."
|
||||
actions:
|
||||
GET:
|
||||
function: getNumberOfFramesLeft
|
||||
|
||||
triggersl:
|
||||
inherit_actions: GET_COMMAND
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of triggers left in acquisition. Only when external trigger used."
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number of triggers left in acquisition. Only when external trigger used."
|
||||
actions:
|
||||
GET:
|
||||
function: getNumberOfTriggersLeft
|
||||
@ -1997,7 +2004,7 @@ syncclk:
|
||||
|
||||
patfname:
|
||||
inherit_actions: GET_COMMAND
|
||||
help: "\n\t[Ctb][Mythen3] Gets the pattern file name including path of the last pattern uploaded. Returns an empty if nothing was uploaded or via a server default file"
|
||||
help: "\n\t[Ctb][Mythen3][Xilinx Ctb] Gets the pattern file name including path of the last pattern uploaded. Returns an empty if nothing was uploaded or via a server default file"
|
||||
actions:
|
||||
GET:
|
||||
function: getPatterFileName
|
||||
@ -2011,7 +2018,7 @@ lastclient:
|
||||
|
||||
framecounter:
|
||||
inherit_actions: GET_COMMAND
|
||||
help: "\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of frames from start run control.\n\t[Gotthard2] only in continuous mode."
|
||||
help: "\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number of frames from start run control.\n\t[Gotthard2] only in continuous mode."
|
||||
actions:
|
||||
GET:
|
||||
function: getNumberOfFramesFromStart
|
||||
@ -2080,7 +2087,7 @@ temp_adc:
|
||||
|
||||
temp_fpga:
|
||||
inherit_actions: GET_IND_COMMAND
|
||||
help: "[n_value]\n\t[Eiger][Jungfrau][Moench][Gotthard][Mythen3][Gotthard2] FPGA Temperature"
|
||||
help: "[n_value]\n\t[Eiger][Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Xilinx CTB] FPGA Temperature"
|
||||
actions:
|
||||
GET:
|
||||
function: getTemperature
|
||||
@ -2307,7 +2314,7 @@ slowadcvalues:
|
||||
GETFCNLIST: getSlowADCList
|
||||
GETFCNNAME: getSlowADCNames
|
||||
GETFCN: getSlowADC
|
||||
suffix: "mV"
|
||||
suffix: "uV"
|
||||
printable_name: "*name_it++"
|
||||
|
||||
tempvalues:
|
||||
@ -2818,7 +2825,7 @@ Exptime:
|
||||
|
||||
exptime:
|
||||
inherit_actions: Exptime
|
||||
help: "[duration] [(optional unit) ns|us|ms|s]\n\t[Eiger][Jungfrau][Moench][Gotthard][Gotthard2][Ctb] Exposure time\n\t[Mythen3] Exposure time of all gate signals in auto and trigger mode (internal gating). To specify gate index, use exptime1, exptime2, exptime3."
|
||||
help: "[duration] [(optional unit) ns|us|ms|s]\n\t[Eiger][Jungfrau][Moench][Gotthard][Gotthard2][Ctb][Xilinx Ctb] Exposure time\n\t[Mythen3] Exposure time of all gate signals in auto and trigger mode (internal gating). To specify gate index, use exptime1, exptime2, exptime3."
|
||||
actions:
|
||||
GET:
|
||||
function: getExptime
|
||||
@ -3842,7 +3849,7 @@ diodelay:
|
||||
|
||||
# pattern is a keyword in yaml, so patternX is used to avoid it
|
||||
patternX:
|
||||
help: "[fname]\n\t[Mythen3][Ctb] Loads ASCII pattern file directly to server (instead of executing line by line)"
|
||||
help: "[fname]\n\t[Mythen3][Ctb][Xilinx Ctb] Loads ASCII pattern file directly to server (instead of executing line by line)"
|
||||
command_name: "pattern"
|
||||
actions:
|
||||
PUT:
|
||||
@ -3855,7 +3862,7 @@ patternX:
|
||||
output: [ 'args.front()' ]
|
||||
|
||||
patword:
|
||||
help: "[step or address] [64 bit mask]\n\t[Ctb][Mythen3] 64 bit pattern at address of pattern memory.\n\t[Ctb] read is same as executing pattern"
|
||||
help: "[step or address] [64 bit mask]\n\t[Ctb][Mythen3][Xilinx Ctb] 64 bit pattern at address of pattern memory.\n\t[Ctb] read is same as executing pattern"
|
||||
actions:
|
||||
GET:
|
||||
argc: 1
|
||||
@ -3875,7 +3882,7 @@ patword:
|
||||
output: [ "'['", "ToStringHex(arg0, 4)", '", "', "ToStringHex(arg1, 16)", '"]"' ]
|
||||
|
||||
patlimits:
|
||||
help: "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of complete pattern"
|
||||
help: "[start addr] [stop addr] \n\t[Ctb][Mythen3][Xilinx Ctb] Limits of complete pattern"
|
||||
actions:
|
||||
GET:
|
||||
argc: -1
|
||||
@ -3895,7 +3902,7 @@ patlimits:
|
||||
output: [ "'['" , "ToStringHex(arg1, 4)" , '", "' , "ToStringHex(arg2, 4)", "']'" ]
|
||||
|
||||
patloop:
|
||||
help: "[0-6] [start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of the loop level provided.\n\t[Mythen3] Level options: 0-3 only."
|
||||
help: "[0-6] [start addr] [stop addr] \n\t[Ctb][Mythen3][Xilinx Ctb] Limits of the loop level provided.\n\t[Mythen3] Level options: 0-3 only."
|
||||
actions:
|
||||
GET:
|
||||
argc: -1
|
||||
@ -3944,7 +3951,7 @@ patloop2:
|
||||
inherit_actions: patloop0
|
||||
|
||||
patnloop:
|
||||
help: "[0-6] [n_cycles] \n\t[Ctb][Mythen3] Number of cycles of the loop level provided.\n\t[Mythen3] Level options: 0-3 only."
|
||||
help: "[0-6] [n_cycles] \n\t[Ctb][Mythen3][Xilinx Ctb] Number of cycles of the loop level provided.\n\t[Mythen3] Level options: 0-3 only."
|
||||
actions:
|
||||
GET:
|
||||
argc: -1
|
||||
@ -3991,7 +3998,7 @@ patnloop2:
|
||||
inherit_actions: patnloop0
|
||||
|
||||
patwait:
|
||||
help: "[0-6] [addr] \n\t[Ctb][Mythen3] Wait address for loop level provided. \n\t[Mythen3] Level options: 0-3 only."
|
||||
help: "[0-6] [addr] \n\t[Ctb][Mythen3][Xilinx Ctb] Wait address for loop level provided. \n\t[Mythen3] Level options: 0-3 only."
|
||||
actions:
|
||||
GET:
|
||||
argc: -1
|
||||
@ -4037,7 +4044,7 @@ patwait2:
|
||||
inherit_actions: patwait0
|
||||
|
||||
patwaittime:
|
||||
help: "[0-6] [n_clk] \n\t[Ctb][Mythen3] Wait time in clock cycles for the loop provided.\n\t[Mythen3] Level options: 0-3 only."
|
||||
help: "[0-6] [n_clk] \n\t[Ctb][Mythen3][Xilinx Ctb] Wait time in clock cycles for the loop provided.\n\t[Mythen3] Level options: 0-3 only."
|
||||
actions:
|
||||
GET:
|
||||
argc: -1
|
||||
|
@ -1615,6 +1615,28 @@ config:
|
||||
help: "\n\tFrees shared memory before loading configuration file. Set up once."
|
||||
infer_action: true
|
||||
template: true
|
||||
configtransceiver:
|
||||
actions:
|
||||
PUT:
|
||||
args:
|
||||
- arg_types: []
|
||||
argc: 0
|
||||
cast_input: []
|
||||
check_det_id: false
|
||||
convert_det_id: true
|
||||
function: configureTransceiver
|
||||
input: []
|
||||
input_types: []
|
||||
output:
|
||||
- '"successful"'
|
||||
require_det_id: true
|
||||
store_result_in_t: false
|
||||
command_name: configtransceiver
|
||||
function_alias: configtransceiver
|
||||
help: "\n\t[Xilinx Ctb] Waits for transceiver to be aligned. Chip had to be configured\
|
||||
\ (powered on) before this."
|
||||
infer_action: true
|
||||
template: true
|
||||
counters:
|
||||
actions:
|
||||
GET:
|
||||
@ -2495,8 +2517,8 @@ delay:
|
||||
store_result_in_t: false
|
||||
command_name: delay
|
||||
function_alias: delay
|
||||
help: "[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb][Moench]\
|
||||
\ Delay after trigger"
|
||||
help: "[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb][Moench][Xilinx\
|
||||
\ Ctb] Delay after trigger"
|
||||
infer_action: true
|
||||
template: true
|
||||
delayl:
|
||||
@ -2530,8 +2552,8 @@ delayl:
|
||||
store_result_in_t: true
|
||||
command_name: delayl
|
||||
function_alias: delayl
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Delay Left in Acquisition.\
|
||||
\ \n\t[Gotthard2] only in continuous mode."
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Delay\
|
||||
\ Left in Acquisition. \n\t[Gotthard2] only in continuous mode."
|
||||
infer_action: true
|
||||
template: true
|
||||
detectorserverversion:
|
||||
@ -2703,8 +2725,8 @@ dr:
|
||||
function_alias: dr
|
||||
help: "[value]\n\tDynamic Range or number of bits per pixel in detector.\n\t[Eiger]\
|
||||
\ Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2, else to\
|
||||
\ 0.\n\t[Mythen3] Options: 8, 16, 32\n\t[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2]\
|
||||
\ 16"
|
||||
\ 0.\n\t[Mythen3] Options: 8, 16, 32\n\t[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2][Xilinx\
|
||||
\ Ctb] 16"
|
||||
infer_action: true
|
||||
template: true
|
||||
drlist:
|
||||
@ -2891,9 +2913,10 @@ exptime:
|
||||
store_result_in_t: false
|
||||
command_name: exptime
|
||||
function_alias: exptime
|
||||
help: "[duration] [(optional unit) ns|us|ms|s]\n\t[Eiger][Jungfrau][Moench][Gotthard][Gotthard2][Ctb]\
|
||||
\ Exposure time\n\t[Mythen3] Exposure time of all gate signals in auto and trigger\
|
||||
\ mode (internal gating). To specify gate index, use exptime1, exptime2, exptime3."
|
||||
help: "[duration] [(optional unit) ns|us|ms|s]\n\t[Eiger][Jungfrau][Moench][Gotthard][Gotthard2][Ctb][Xilinx\
|
||||
\ Ctb] Exposure time\n\t[Mythen3] Exposure time of all gate signals in auto and\
|
||||
\ trigger mode (internal gating). To specify gate index, use exptime1, exptime2,\
|
||||
\ exptime3."
|
||||
infer_action: true
|
||||
template: true
|
||||
exptime1:
|
||||
@ -3610,8 +3633,8 @@ firmwaretest:
|
||||
store_result_in_t: false
|
||||
command_name: firmwaretest
|
||||
function_alias: firmwaretest
|
||||
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb] Firmware test,\
|
||||
\ ie. reads a read fixed pattern from a register."
|
||||
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Firmware\
|
||||
\ test, ie. reads a read fixed pattern from a register."
|
||||
infer_action: true
|
||||
template: true
|
||||
firmwareversion:
|
||||
@ -3906,8 +3929,8 @@ framecounter:
|
||||
store_result_in_t: true
|
||||
command_name: framecounter
|
||||
function_alias: framecounter
|
||||
help: "\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of frames from start\
|
||||
\ run control.\n\t[Gotthard2] only in continuous mode."
|
||||
help: "\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number of frames\
|
||||
\ from start run control.\n\t[Gotthard2] only in continuous mode."
|
||||
infer_action: true
|
||||
template: true
|
||||
frames:
|
||||
@ -3970,8 +3993,8 @@ framesl:
|
||||
store_result_in_t: true
|
||||
command_name: framesl
|
||||
function_alias: framesl
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of frames\
|
||||
\ left in acquisition. \n\t[Gotthard2] only in continuous auto mode."
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number\
|
||||
\ of frames left in acquisition. \n\t[Gotthard2] only in continuous auto mode."
|
||||
infer_action: true
|
||||
template: true
|
||||
frametime:
|
||||
@ -4005,8 +4028,8 @@ frametime:
|
||||
store_result_in_t: true
|
||||
command_name: frametime
|
||||
function_alias: frametime
|
||||
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb]\
|
||||
\ Timestamp at a frame start.\n\t[Gotthard2] not in burst and auto mode."
|
||||
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx\
|
||||
\ Ctb] Timestamp at a frame start.\n\t[Gotthard2] not in burst and auto mode."
|
||||
infer_action: true
|
||||
template: true
|
||||
free:
|
||||
@ -4703,8 +4726,8 @@ hardwareversion:
|
||||
store_result_in_t: true
|
||||
command_name: hardwareversion
|
||||
function_alias: hardwareversion
|
||||
help: "\n\t[Jungfrau][Gotthard2][Myhten3][Gotthard][Ctb][Moench] Hardware version\
|
||||
\ of detector. \n\t[Eiger] Hardware version of front FPGA on detector."
|
||||
help: "\n\tHardware version of detector. \n\t[Eiger] Hardware version of front FPGA\
|
||||
\ on detector."
|
||||
infer_action: true
|
||||
template: true
|
||||
highvoltage:
|
||||
@ -5474,8 +5497,8 @@ nextframenumber:
|
||||
store_result_in_t: false
|
||||
command_name: nextframenumber
|
||||
function_alias: nextframenumber
|
||||
help: "[n_value]\n\t[Eiger][Jungfrau][Moench][Ctb] Next frame number. Stopping acquisition\
|
||||
\ might result in different frame numbers for different modules."
|
||||
help: "[n_value]\n\t[Eiger][Jungfrau][Moench][Ctb][Xilinx Ctb] Next frame number.\
|
||||
\ Stopping acquisition might result in different frame numbers for different modules."
|
||||
infer_action: true
|
||||
template: true
|
||||
nmod:
|
||||
@ -5730,9 +5753,9 @@ patfname:
|
||||
store_result_in_t: true
|
||||
command_name: patfname
|
||||
function_alias: patfname
|
||||
help: "\n\t[Ctb][Mythen3] Gets the pattern file name including path of the last\
|
||||
\ pattern uploaded. Returns an empty if nothing was uploaded or via a server default\
|
||||
\ file"
|
||||
help: "\n\t[Ctb][Mythen3][Xilinx Ctb] Gets the pattern file name including path\
|
||||
\ of the last pattern uploaded. Returns an empty if nothing was uploaded or via\
|
||||
\ a server default file"
|
||||
infer_action: true
|
||||
template: true
|
||||
patioctrl:
|
||||
@ -5826,7 +5849,8 @@ patlimits:
|
||||
store_result_in_t: false
|
||||
command_name: patlimits
|
||||
function_alias: patlimits
|
||||
help: "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of complete pattern"
|
||||
help: "[start addr] [stop addr] \n\t[Ctb][Mythen3][Xilinx Ctb] Limits of complete\
|
||||
\ pattern"
|
||||
infer_action: true
|
||||
patloop:
|
||||
actions:
|
||||
@ -5899,8 +5923,8 @@ patloop:
|
||||
store_result_in_t: false
|
||||
command_name: patloop
|
||||
function_alias: patloop
|
||||
help: "[0-6] [start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of the loop level\
|
||||
\ provided.\n\t[Mythen3] Level options: 0-3 only."
|
||||
help: "[0-6] [start addr] [stop addr] \n\t[Ctb][Mythen3][Xilinx Ctb] Limits of the\
|
||||
\ loop level provided.\n\t[Mythen3] Level options: 0-3 only."
|
||||
infer_action: true
|
||||
patloop0:
|
||||
actions:
|
||||
@ -6145,8 +6169,8 @@ patmask:
|
||||
store_result_in_t: false
|
||||
command_name: patmask
|
||||
function_alias: patmask
|
||||
help: "[64 bit mask]\n\t[Ctb][Mythen3] Selects the bits that will have a pattern\
|
||||
\ mask applied to the selected patmask for every pattern."
|
||||
help: "[64 bit mask]\n\t[Ctb][Mythen3][Xilinx Ctb] Selects the bits that will have\
|
||||
\ a pattern mask applied to the selected patmask for every pattern."
|
||||
infer_action: true
|
||||
template: true
|
||||
patnloop:
|
||||
@ -6209,8 +6233,8 @@ patnloop:
|
||||
store_result_in_t: false
|
||||
command_name: patnloop
|
||||
function_alias: patnloop
|
||||
help: "[0-6] [n_cycles] \n\t[Ctb][Mythen3] Number of cycles of the loop level provided.\n\
|
||||
\t[Mythen3] Level options: 0-3 only."
|
||||
help: "[0-6] [n_cycles] \n\t[Ctb][Mythen3][Xilinx Ctb] Number of cycles of the loop\
|
||||
\ level provided.\n\t[Mythen3] Level options: 0-3 only."
|
||||
infer_action: true
|
||||
patnloop0:
|
||||
actions:
|
||||
@ -6422,8 +6446,8 @@ patsetbit:
|
||||
store_result_in_t: false
|
||||
command_name: patsetbit
|
||||
function_alias: patsetbit
|
||||
help: "[64 bit mask]\n\t[Ctb][Mythen3] Sets the mask applied to every pattern to\
|
||||
\ the selected bits."
|
||||
help: "[64 bit mask]\n\t[Ctb][Mythen3][Xilinx Ctb] Sets the mask applied to every\
|
||||
\ pattern to the selected bits."
|
||||
infer_action: true
|
||||
template: true
|
||||
patternX:
|
||||
@ -6448,8 +6472,8 @@ patternX:
|
||||
store_result_in_t: false
|
||||
command_name: pattern
|
||||
function_alias: pattern
|
||||
help: "[fname]\n\t[Mythen3][Ctb] Loads ASCII pattern file directly to server (instead\
|
||||
\ of executing line by line)"
|
||||
help: "[fname]\n\t[Mythen3][Ctb][Xilinx Ctb] Loads ASCII pattern file directly to\
|
||||
\ server (instead of executing line by line)"
|
||||
infer_action: true
|
||||
patternstart:
|
||||
actions:
|
||||
@ -6532,8 +6556,8 @@ patwait:
|
||||
store_result_in_t: false
|
||||
command_name: patwait
|
||||
function_alias: patwait
|
||||
help: "[0-6] [addr] \n\t[Ctb][Mythen3] Wait address for loop level provided. \n\t\
|
||||
[Mythen3] Level options: 0-3 only."
|
||||
help: "[0-6] [addr] \n\t[Ctb][Mythen3][Xilinx Ctb] Wait address for loop level provided.\
|
||||
\ \n\t[Mythen3] Level options: 0-3 only."
|
||||
infer_action: true
|
||||
patwait0:
|
||||
actions:
|
||||
@ -6769,8 +6793,8 @@ patwaittime:
|
||||
store_result_in_t: false
|
||||
command_name: patwaittime
|
||||
function_alias: patwaittime
|
||||
help: "[0-6] [n_clk] \n\t[Ctb][Mythen3] Wait time in clock cycles for the loop provided.\n\
|
||||
\t[Mythen3] Level options: 0-3 only."
|
||||
help: "[0-6] [n_clk] \n\t[Ctb][Mythen3][Xilinx Ctb] Wait time in clock cycles for\
|
||||
\ the loop provided.\n\t[Mythen3] Level options: 0-3 only."
|
||||
infer_action: true
|
||||
patwaittime0:
|
||||
actions:
|
||||
@ -6998,8 +7022,8 @@ patword:
|
||||
store_result_in_t: false
|
||||
command_name: patword
|
||||
function_alias: patword
|
||||
help: "[step or address] [64 bit mask]\n\t[Ctb][Mythen3] 64 bit pattern at address\
|
||||
\ of pattern memory.\n\t[Ctb] read is same as executing pattern"
|
||||
help: "[step or address] [64 bit mask]\n\t[Ctb][Mythen3][Xilinx Ctb] 64 bit pattern\
|
||||
\ at address of pattern memory.\n\t[Ctb] read is same as executing pattern"
|
||||
infer_action: true
|
||||
pedestalmode:
|
||||
actions:
|
||||
@ -7178,8 +7202,8 @@ periodl:
|
||||
store_result_in_t: true
|
||||
command_name: periodl
|
||||
function_alias: periodl
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Ctb][Mythen3][Gotthard2] Period left for\
|
||||
\ current frame. \n\t[Gotthard2] only in continuous mode."
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Ctb][Mythen3][Gotthard2][Xilinx Ctb] Period\
|
||||
\ left for current frame. \n\t[Gotthard2] only in continuous mode."
|
||||
infer_action: true
|
||||
template: true
|
||||
polarity:
|
||||
@ -7298,11 +7322,12 @@ powerchip:
|
||||
store_result_in_t: false
|
||||
command_name: powerchip
|
||||
function_alias: powerchip
|
||||
help: "[0, 1]\n\t[Jungfrau][Moench][Mythen3][Gotthard2] Power the chip. \n\t[Jungfrau][Moench]\
|
||||
\ Default is 0. Get will return power status. Can be off if temperature event\
|
||||
\ occured (temperature over temp_threshold with temp_control enabled. Will configure\
|
||||
\ chip (only chip v1.1)\n\t[Mythen3][Gotthard2] Default is 1. If module not connected\
|
||||
\ or wrong module, powerchip will fail."
|
||||
help: "[0, 1]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Xilinx Ctb] Power the chip.\
|
||||
\ \n\t[Jungfrau][Moench] Default is 0. Get will return power status. Can be off\
|
||||
\ if temperature event occured (temperature over temp_threshold with temp_control\
|
||||
\ enabled. Will configure chip (only chip v1.1)\n\t[Mythen3][Gotthard2] Default\
|
||||
\ is 1. If module not connected or wrong module, powerchip will fail.\n\t[Xilinx\
|
||||
\ Ctb] Default is 0. Also configures the chip if powered on."
|
||||
infer_action: true
|
||||
template: true
|
||||
powerindex:
|
||||
@ -7914,8 +7939,8 @@ rebootcontroller:
|
||||
store_result_in_t: false
|
||||
command_name: rebootcontroller
|
||||
function_alias: rebootcontroller
|
||||
help: "\n\t[Jungfrau][Moench][Ctb][Gotthard][Mythen3][Gotthard2] Reboot controller\
|
||||
\ of detector."
|
||||
help: "\n\t[Jungfrau][Moench][Ctb][Gotthard][Mythen3][Gotthard2][Xilinx Ctb] Reboot\
|
||||
\ controller of detector."
|
||||
infer_action: true
|
||||
template: true
|
||||
reg:
|
||||
@ -8029,7 +8054,7 @@ resetfpga:
|
||||
store_result_in_t: false
|
||||
command_name: resetfpga
|
||||
function_alias: resetfpga
|
||||
help: "\n\t[Jungfrau][Moench][Ctb] Reset FPGA."
|
||||
help: "\n\t[Jungfrau][Moench][Ctb][Xilinx Ctb] Reset FPGA."
|
||||
infer_action: true
|
||||
template: true
|
||||
roi:
|
||||
@ -8116,8 +8141,9 @@ romode:
|
||||
store_result_in_t: false
|
||||
command_name: romode
|
||||
function_alias: romode
|
||||
help: "[analog|digital|analog_digital|transceiver|digital_transceiver]\n\t[Ctb]\
|
||||
\ Readout mode. Default is analog."
|
||||
help: "[analog|digital|analog_digital|transceiver|digital_transceiver]\n\t[Ctb][xilinx\
|
||||
\ Ctb] Readout mode. [Ctb] Default is analog. [Xilinx Ctb] Default is Transceiver\
|
||||
\ (only one implemented so far)"
|
||||
infer_action: true
|
||||
template: true
|
||||
row:
|
||||
@ -8230,8 +8256,8 @@ runtime:
|
||||
store_result_in_t: true
|
||||
command_name: runtime
|
||||
function_alias: runtime
|
||||
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb]\
|
||||
\ Time from detector start up.\n\t[Gotthard2] not in burst and auto mode."
|
||||
help: "[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx\
|
||||
\ Ctb] Time from detector start up.\n\t[Gotthard2] not in burst and auto mode."
|
||||
infer_action: true
|
||||
template: true
|
||||
rx_arping:
|
||||
@ -9438,8 +9464,8 @@ savepattern:
|
||||
store_result_in_t: false
|
||||
command_name: savepattern
|
||||
function_alias: savepattern
|
||||
help: "\n\t[Ctb][Mythen3] Saves pattern to file (ascii). \n\t[Ctb] Also executes\
|
||||
\ pattern."
|
||||
help: "\n\t[Ctb][Mythen3][Xilinx Ctb] Saves pattern to file (ascii). \n\t[Ctb] Also\
|
||||
\ executes pattern."
|
||||
infer_action: true
|
||||
template: true
|
||||
scan:
|
||||
@ -10095,7 +10121,7 @@ slowadcvalues:
|
||||
GETFCNLIST: getSlowADCList
|
||||
GETFCNNAME: getSlowADCNames
|
||||
printable_name: '*name_it++'
|
||||
suffix: mV
|
||||
suffix: uV
|
||||
function: ''
|
||||
input: []
|
||||
input_types: []
|
||||
@ -10758,8 +10784,8 @@ temp_fpga:
|
||||
store_result_in_t: true
|
||||
command_name: temp_fpga
|
||||
function_alias: temp_fpga
|
||||
help: "[n_value]\n\t[Eiger][Jungfrau][Moench][Gotthard][Mythen3][Gotthard2] FPGA\
|
||||
\ Temperature"
|
||||
help: "[n_value]\n\t[Eiger][Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Xilinx\
|
||||
\ CTB] FPGA Temperature"
|
||||
infer_action: true
|
||||
template: true
|
||||
temp_fpgaext:
|
||||
@ -11229,8 +11255,8 @@ timing:
|
||||
store_result_in_t: false
|
||||
command_name: timing
|
||||
function_alias: timing
|
||||
help: "[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Moench][Gotthard][Ctb][Gotthard2]\
|
||||
\ [auto|trigger]\n\t[Mythen3] [auto|trigger|gating|trigger_gating]\n\t[Eiger]\
|
||||
help: "[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Moench][Gotthard][Ctb][Gotthard2][Xilinx\
|
||||
\ Ctb] [auto|trigger]\n\t[Mythen3] [auto|trigger|gating|trigger_gating]\n\t[Eiger]\
|
||||
\ [auto|trigger|gating|burst_trigger]"
|
||||
infer_action: true
|
||||
template: true
|
||||
@ -11370,8 +11396,8 @@ transceiverenable:
|
||||
store_result_in_t: false
|
||||
command_name: transceiverenable
|
||||
function_alias: transceiverenable
|
||||
help: "[bitmask]\n\t[Ctb] Transceiver Enable Mask. Enable for each 4 Transceiver\
|
||||
\ channel."
|
||||
help: "[bitmask]\n\t[Ctb][Xilinx Ctb] Transceiver Enable Mask. Enable for each 4\
|
||||
\ Transceiver channel."
|
||||
infer_action: true
|
||||
template: true
|
||||
trigger:
|
||||
@ -11459,8 +11485,8 @@ triggersl:
|
||||
store_result_in_t: true
|
||||
command_name: triggersl
|
||||
function_alias: triggersl
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of triggers\
|
||||
\ left in acquisition. Only when external trigger used."
|
||||
help: "\n\t[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number\
|
||||
\ of triggers left in acquisition. Only when external trigger used."
|
||||
infer_action: true
|
||||
template: true
|
||||
trimbits:
|
||||
@ -11616,7 +11642,7 @@ tsamples:
|
||||
store_result_in_t: false
|
||||
command_name: tsamples
|
||||
function_alias: tsamples
|
||||
help: "[n_value]\n\t[Ctb] Number of transceiver samples expected."
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Number of transceiver samples expected."
|
||||
infer_action: true
|
||||
template: true
|
||||
txdelay:
|
||||
@ -12577,7 +12603,7 @@ v_a:
|
||||
store_result_in_t: false
|
||||
command_name: v_a
|
||||
function_alias: v_a
|
||||
help: "[n_value]\n\t[Ctb] Power supply a in mV."
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply a in mV."
|
||||
infer_action: true
|
||||
template: true
|
||||
v_b:
|
||||
@ -12623,7 +12649,7 @@ v_b:
|
||||
store_result_in_t: false
|
||||
command_name: v_b
|
||||
function_alias: v_b
|
||||
help: "[n_value]\n\t[Ctb] Power supply b in mV."
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply b in mV."
|
||||
infer_action: true
|
||||
template: true
|
||||
v_c:
|
||||
@ -12669,7 +12695,7 @@ v_c:
|
||||
store_result_in_t: false
|
||||
command_name: v_c
|
||||
function_alias: v_c
|
||||
help: "[n_value]\n\t[Ctb] Power supply c in mV."
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply c in mV."
|
||||
infer_action: true
|
||||
template: true
|
||||
v_chip:
|
||||
@ -12762,7 +12788,7 @@ v_d:
|
||||
store_result_in_t: false
|
||||
command_name: v_d
|
||||
function_alias: v_d
|
||||
help: "[n_value]\n\t[Ctb] Power supply d in mV."
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply d in mV."
|
||||
infer_action: true
|
||||
template: true
|
||||
v_io:
|
||||
@ -12808,8 +12834,9 @@ v_io:
|
||||
store_result_in_t: false
|
||||
command_name: v_io
|
||||
function_alias: v_io
|
||||
help: "[n_value]\n\t[Ctb] Power supply io in mV. Minimum 1200 mV. Must be the first\
|
||||
\ power regulator to be set after fpga reset (on-board detector server start up)."
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply io in mV. Minimum 1200 mV. Must\
|
||||
\ be the first power regulator to be set after fpga reset (on-board detector server\
|
||||
\ start up)."
|
||||
infer_action: true
|
||||
template: true
|
||||
v_limit:
|
||||
@ -12855,7 +12882,8 @@ v_limit:
|
||||
store_result_in_t: false
|
||||
command_name: v_limit
|
||||
function_alias: v_limit
|
||||
help: "[n_value]\n\t[Ctb] Soft limit for power supplies (ctb only) and DACS in mV."
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Soft limit for power supplies (ctb only) and\
|
||||
\ DACS in mV."
|
||||
infer_action: true
|
||||
template: true
|
||||
vchip_comp_adc:
|
||||
|
@ -303,11 +303,11 @@ class Detector {
|
||||
|
||||
void setNumberOfTriggers(int64_t value);
|
||||
|
||||
/** [Gotthard][Jungfrau][Moench][Eiger][CTB][Gotthard2] \n
|
||||
/** [Gotthard][Jungfrau][Moench][Eiger][CTB][Xilinx CTB][Gotthard2] \n
|
||||
* [Mythen3] use function with gate index **/
|
||||
Result<ns> getExptime(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard][Jungfrau][Moench][Eiger][CTB][Gotthard2] \n
|
||||
/** [Gotthard][Jungfrau][Moench][Eiger][CTB][Xilinx CTB][Gotthard2] \n
|
||||
* [Mythen3] sets exptime for all gate signals. To specify gate index, use
|
||||
* function with gate index **/
|
||||
void setExptime(ns t, Positions pos = {});
|
||||
@ -316,25 +316,25 @@ class Detector {
|
||||
|
||||
void setPeriod(ns t, Positions pos = {});
|
||||
|
||||
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] */
|
||||
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx CTB] */
|
||||
Result<ns> getDelayAfterTrigger(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] */
|
||||
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx CTB] */
|
||||
void setDelayAfterTrigger(ns value, Positions pos = {});
|
||||
|
||||
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3]
|
||||
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Xilinx CTB]
|
||||
* [Gotthard2] only in continuous auto mode */
|
||||
Result<int64_t> getNumberOfFramesLeft(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3]
|
||||
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Xilinx CTB]
|
||||
* Only when external trigger used */
|
||||
Result<int64_t> getNumberOfTriggersLeft(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2]
|
||||
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx CTB]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
Result<ns> getPeriodLeft(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3]
|
||||
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Xilinx CTB]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
Result<ns> getDelayAfterTriggerLeft(Positions pos = {}) const;
|
||||
|
||||
@ -343,7 +343,7 @@ class Detector {
|
||||
/**
|
||||
* [Eiger] Options: 4, 8, 12, 16, 32. If i is 32, also sets clkdivider to 2,
|
||||
* else sets clkdivider to 1 \n [Mythen3] Options: 8, 16, 32 \n
|
||||
* [Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2] 16
|
||||
* [Jungfrau][Moench][Gotthard][CTB][Mythen3][Gotthard2][Xilinx CTB] 16
|
||||
*/
|
||||
void setDynamicRange(int value);
|
||||
|
||||
@ -353,10 +353,10 @@ class Detector {
|
||||
Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* [Gotthard][Jungfrau][Moench][Gotthard][CTB][Gotthard2] Options:
|
||||
* AUTO_TIMING, TRIGGER_EXPOSURE \n
|
||||
* [Mythen3] Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, TRIGGER_GATED \n
|
||||
* [Eiger] Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER
|
||||
* [Gotthard][Jungfrau][Moench][Gotthard][CTB][Gotthard2][Xilinx CTB]
|
||||
* Options: AUTO_TIMING, TRIGGER_EXPOSURE \n [Mythen3] Options: AUTO_TIMING,
|
||||
* TRIGGER_EXPOSURE, GATED, TRIGGER_GATED \n [Eiger] Options: AUTO_TIMING,
|
||||
* TRIGGER_EXPOSURE, GATED, BURST_TRIGGER
|
||||
*/
|
||||
void setTimingMode(defs::timingMode value, Positions pos = {});
|
||||
|
||||
@ -456,16 +456,17 @@ class Detector {
|
||||
*/
|
||||
void setHighVoltage(int value, Positions pos = {});
|
||||
|
||||
/** [Jungfrau][Moench][Mythen3][Gotthard2] */
|
||||
/** [Jungfrau][Moench][Mythen3][Gotthard2][Xilinx Ctb] */
|
||||
Result<bool> getPowerChip(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau][Moench][Mythen3][Gotthard2] Power the chip. \n
|
||||
/** [Jungfrau][Moench][Mythen3][Gotthard2][Xilinx Ctb] Power the chip. \n
|
||||
* Default is disabled. \n
|
||||
* [Jungfrau][Moench] Default is disabled. Get will return power status. Can
|
||||
* be off if temperature event occured (temperature over temp_threshold with
|
||||
* temp_control enabled. Will configure chip (only chip v1.1)\n
|
||||
* [Mythen3][Gotthard2] Default is 1. If module not connected or wrong
|
||||
* module, powerchip will fail.
|
||||
* module, powerchip will fail.\n
|
||||
* [Xilinx CTB] Default is 0. Also configures chip if powered on.
|
||||
*/
|
||||
void setPowerChip(bool on, Positions pos = {});
|
||||
|
||||
@ -483,7 +484,7 @@ class Detector {
|
||||
|
||||
/**
|
||||
* (Degrees)
|
||||
* [Mythen3][Gotthard2] Options: TEMPERATURE_FPGA
|
||||
* [Mythen3][Gotthard2][Xilinx Ctb] Options: TEMPERATURE_FPGA
|
||||
* [Gotthard] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA \n
|
||||
* [Jungfrau][Moench] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA \n
|
||||
* [Eiger] Options: TEMPERATURE_FPGA, TEMPERATURE_FPGAEXT, TEMPERATURE_10GE,
|
||||
@ -657,11 +658,11 @@ class Detector {
|
||||
Result<std::vector<int64_t>>
|
||||
getRxCurrentFrameIndex(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger][Jungfrau][Moench][CTB] */
|
||||
/** [Eiger][Jungfrau][Moench][CTB][Xilinx CTB] */
|
||||
Result<uint64_t> getNextFrameNumber(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger][Jungfrau][Moench][CTB] Stopping acquisition might result in
|
||||
* different frame numbers for different modules.*/
|
||||
/** [Eiger][Jungfrau][Moench][CTB][Xilinx CTB] Stopping acquisition might
|
||||
* result in different frame numbers for different modules.*/
|
||||
void setNextFrameNumber(uint64_t value, Positions pos = {});
|
||||
|
||||
/** [Eiger][Mythen3][Jungfrau][Moench] Sends an internal software trigger to
|
||||
@ -1607,7 +1608,7 @@ class Detector {
|
||||
///@{
|
||||
/**************************************************
|
||||
* *
|
||||
* CTB Specific *
|
||||
* CTB / Xilinx CTB Specific *
|
||||
* *
|
||||
* ************************************************/
|
||||
/** [CTB] */
|
||||
@ -1637,12 +1638,12 @@ class Detector {
|
||||
/** gets list of slow adc enums */
|
||||
std::vector<defs::dacIndex> getSlowADCList() const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
Result<int> getPower(defs::dacIndex index, Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* [CTB] mV
|
||||
* [Ctb] Options: V_LIMIT, V_POWER_A, V_POWER_B, V_POWER_C,
|
||||
* [CTB][Xilinx CTB] mV
|
||||
* [Ctb][Xilinx CTB] Options: V_LIMIT, V_POWER_A, V_POWER_B, V_POWER_C,
|
||||
* V_POWER_D, V_POWER_IO, V_POWER_CHIP
|
||||
*/
|
||||
void setPower(defs::dacIndex index, int value, Positions pos = {});
|
||||
@ -1668,39 +1669,30 @@ class Detector {
|
||||
"complete 4 bits are enabled */
|
||||
void setTenGigaADCEnableMask(uint32_t mask, Positions pos = {});
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
Result<uint32_t> getTransceiverEnableMask(Positions pos = {}) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
void setTransceiverEnableMask(uint32_t mask, Positions pos = {});
|
||||
|
||||
///@}
|
||||
|
||||
/** @name CTB Specific */
|
||||
///@{
|
||||
/**************************************************
|
||||
* *
|
||||
* CTB Specific *
|
||||
* *
|
||||
* ************************************************/
|
||||
|
||||
/** [CTB] */
|
||||
Result<int> getNumberOfDigitalSamples(Positions pos = {}) const;
|
||||
|
||||
/** [CTB] */
|
||||
void setNumberOfDigitalSamples(int value, Positions pos = {});
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
Result<int> getNumberOfTransceiverSamples(Positions pos = {}) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
void setNumberOfTransceiverSamples(int value, Positions pos = {});
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
Result<defs::readoutMode> getReadoutMode(Positions pos = {}) const;
|
||||
|
||||
/** [CTB] Options: ANALOG_ONLY (default), DIGITAL_ONLY, ANALOG_AND_DIGITAL,
|
||||
* TRANSCEIVER_ONLY, DIGITAL_AND_TRANSCEIVER
|
||||
* [Xilinx CTB] Options: TRANSCEIVER_ONLY (default)
|
||||
*/
|
||||
void setReadoutMode(defs::readoutMode value, Positions pos = {});
|
||||
|
||||
@ -1722,7 +1714,7 @@ class Detector {
|
||||
Result<int> getMeasuredCurrent(defs::dacIndex index,
|
||||
Positions pos = {}) const;
|
||||
|
||||
/** [CTB] Options: SLOW_ADC0 - SLOW_ADC7 in uV */
|
||||
/** [CTB][Xilinx CTB] Options: SLOW_ADC0 - SLOW_ADC7 in uV */
|
||||
Result<int> getSlowADC(defs::dacIndex index, Positions pos = {}) const;
|
||||
|
||||
/** [CTB] */
|
||||
@ -1764,81 +1756,95 @@ class Detector {
|
||||
/** [CTB] Default is enabled. */
|
||||
void setLEDEnable(bool enable, Positions pos = {});
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
void setDacNames(const std::vector<std::string> names);
|
||||
|
||||
/** [CTB][Xilinx CTB] */
|
||||
std::vector<std::string> getDacNames() const;
|
||||
|
||||
/** [CTB][Xilinx CTB] */
|
||||
defs::dacIndex getDacIndex(const std::string &name) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
void setDacName(const defs::dacIndex i, const std::string &name);
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
std::string getDacName(const defs::dacIndex i) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
void setAdcNames(const std::vector<std::string> names);
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
std::vector<std::string> getAdcNames() const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
int getAdcIndex(const std::string &name) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
void setAdcName(const int i, const std::string &name);
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
std::string getAdcName(const int i) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
void setSignalNames(const std::vector<std::string> names);
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
std::vector<std::string> getSignalNames() const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
int getSignalIndex(const std::string &name) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
void setSignalName(const int i, const std::string &name);
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
std::string getSignalName(const int i) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
void setPowerNames(const std::vector<std::string> names);
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
std::vector<std::string> getPowerNames() const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
defs::dacIndex getPowerIndex(const std::string &name) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
void setPowerName(const defs::dacIndex i, const std::string &name);
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
std::string getPowerName(const defs::dacIndex i) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
void setSlowADCNames(const std::vector<std::string> names);
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
std::vector<std::string> getSlowADCNames() const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
defs::dacIndex getSlowADCIndex(const std::string &name) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
void setSlowADCName(const defs::dacIndex i, const std::string &name);
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Xilinx CTB] */
|
||||
std::string getSlowADCName(const defs::dacIndex i) const;
|
||||
|
||||
///@}
|
||||
|
||||
/** @name Xilinx CTB Specific */
|
||||
///@{
|
||||
/**************************************************
|
||||
* *
|
||||
* Xilinx CTB Specific *
|
||||
* *
|
||||
* ************************************************/
|
||||
///@}
|
||||
|
||||
/** [Xilinx Ctb] */
|
||||
void configureTransceiver(Positions pos = {});
|
||||
|
||||
/** @name Pattern */
|
||||
///@{
|
||||
/**************************************************
|
||||
@ -1846,20 +1852,20 @@ class Detector {
|
||||
* Pattern *
|
||||
* *
|
||||
* ************************************************/
|
||||
/** [CTB][Mythen3] Gets the pattern file name including path of the last
|
||||
* pattern uploaded. \n Returns an empty if nothing was uploaded or via a
|
||||
* server default file*/
|
||||
/** [CTB][Mythen3][Xilinx CTB] Gets the pattern file name including path of
|
||||
* the last pattern uploaded. \n Returns an empty if nothing was uploaded or
|
||||
* via a server default file*/
|
||||
Result<std::string> getPatterFileName(Positions pos = {}) const;
|
||||
|
||||
/** [CTB][Mythen3] Loads ASCII pattern file directly to server
|
||||
/** [CTB][Mythen3][Xilinx CTB] Loads ASCII pattern file directly to server
|
||||
* (instead of executing line by line)*/
|
||||
void setPattern(const std::string &fname, Positions pos = {});
|
||||
|
||||
/** [CTB][Mythen3] Loads pattern parameters structure directly to
|
||||
* server */
|
||||
/** [CTB][Mythen3][Xilinx CTB] Loads pattern parameters structure directly
|
||||
* to server */
|
||||
void setPattern(const Pattern &pat, Positions pos = {});
|
||||
|
||||
/** [CTB][Mythen3] [Ctb][Mythen3] Saves pattern to file
|
||||
/** [CTB][Mythen3][Xilinx CTB] Saves pattern to file
|
||||
* (ascii). \n [Ctb] Also executes pattern.*/
|
||||
void savePattern(const std::string &fname);
|
||||
|
||||
@ -1872,57 +1878,57 @@ class Detector {
|
||||
/** [CTB] */
|
||||
void setPatternIOControl(uint64_t word, Positions pos = {});
|
||||
|
||||
/** [CTB][Mythen3] same as executing for ctb */
|
||||
/** [CTB][Mythen3][Xilinx CTB] same as executing for ctb */
|
||||
Result<uint64_t> getPatternWord(int addr, Positions pos = {});
|
||||
|
||||
/** [CTB] Caution: If word is -1 reads the addr (same as
|
||||
/** [CTB][Xilinx CTB] Caution: If word is -1 reads the addr (same as
|
||||
* executing the pattern)
|
||||
* [Mythen3] */
|
||||
void setPatternWord(int addr, uint64_t word, Positions pos = {});
|
||||
|
||||
/**[CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2
|
||||
/**[CTB][Mythen3][Xilinx CTB] Options: level: -1 (complete pattern) and 0-2
|
||||
* levels
|
||||
* @returns array of start address and stop address
|
||||
*/
|
||||
Result<std::array<int, 2>>
|
||||
getPatternLoopAddresses(int level, Positions pos = {}) const;
|
||||
|
||||
/** [CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2
|
||||
/** [CTB][Mythen3][Xilinx CTB] Options: level: -1 (complete pattern) and 0-2
|
||||
* levels */
|
||||
void setPatternLoopAddresses(int level, int start, int stop,
|
||||
Positions pos = {});
|
||||
|
||||
/**[CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2
|
||||
/**[CTB][Mythen3][Xilinx CTB] Options: level: -1 (complete pattern) and 0-2
|
||||
* levels */
|
||||
Result<int> getPatternLoopCycles(int level, Positions pos = {}) const;
|
||||
|
||||
/** [CTB][Mythen3] n: 0-2, level: -1 (complete pattern) and 0-2
|
||||
/** [CTB][Mythen3][Xilinx CTB] n: 0-2, level: -1 (complete pattern) and 0-2
|
||||
* levels */
|
||||
void setPatternLoopCycles(int level, int n, Positions pos = {});
|
||||
|
||||
/**[CTB][Mythen3] */
|
||||
/**[CTB][Mythen3][Xilinx CTB] */
|
||||
Result<int> getPatternWaitAddr(int level, Positions pos = {}) const;
|
||||
|
||||
/** [CTB][Mythen3] Options: level 0-2 */
|
||||
/** [CTB][Mythen3][Xilinx CTB] Options: level 0-2 */
|
||||
void setPatternWaitAddr(int level, int addr, Positions pos = {});
|
||||
|
||||
/** [CTB][Mythen3] */
|
||||
/** [CTB][Mythen3][Xilinx CTB] */
|
||||
Result<uint64_t> getPatternWaitTime(int level, Positions pos = {}) const;
|
||||
|
||||
/** [CTB][Mythen3] Options: level 0-2 */
|
||||
/** [CTB][Mythen3][Xilinx CTB] Options: level 0-2 */
|
||||
void setPatternWaitTime(int level, uint64_t t, Positions pos = {});
|
||||
|
||||
/** [CTB][Mythen3] */
|
||||
/** [CTB][Mythen3][Xilinx CTB] */
|
||||
Result<uint64_t> getPatternMask(Positions pos = {});
|
||||
|
||||
/** [CTB][Mythen3] Selects the bits that will have a pattern mask
|
||||
* applied to the selected patmask for every pattern. */
|
||||
/** [CTB][Mythen3][Xilinx CTB] Selects the bits that will have a pattern
|
||||
* mask applied to the selected patmask for every pattern. */
|
||||
void setPatternMask(uint64_t mask, Positions pos = {});
|
||||
|
||||
/** [CTB][Mythen3] */
|
||||
/** [CTB][Mythen3][Xilinx CTB] */
|
||||
Result<uint64_t> getPatternBitMask(Positions pos = {}) const;
|
||||
|
||||
/** [CTB][Mythen3] Sets the mask applied to every pattern to the
|
||||
/** [CTB][Mythen3][Xilinx CTB] Sets the mask applied to every pattern to the
|
||||
* selected bits */
|
||||
void setPatternBitMask(uint64_t mask, Positions pos = {});
|
||||
|
||||
@ -1986,7 +1992,7 @@ class Detector {
|
||||
void programFPGA(const std::string &fname, const bool forceDeleteNormalFile,
|
||||
Positions pos = {});
|
||||
|
||||
/** [Jungfrau][Moench][CTB] Advanced user Function! */
|
||||
/** [Jungfrau][Moench][CTB][Xilinx CTB] Advanced user Function! */
|
||||
void resetFPGA(Positions pos = {});
|
||||
|
||||
/** [Jungfrau][Moench][Eiger][Ctb][Mythen3][Gotthard2] Copies detector
|
||||
@ -2004,8 +2010,8 @@ class Detector {
|
||||
*/
|
||||
void updateKernel(const std::string &fname, Positions pos = {});
|
||||
|
||||
/** [Jungfrau][Moench][Gotthard][CTB][Mythen3][Gotthard2] Advanced user
|
||||
* Function! */
|
||||
/** [Jungfrau][Moench][Gotthard][CTB][Mythen3][Gotthard2][Xilinx CTB]
|
||||
* Advanced user Function! */
|
||||
void rebootController(Positions pos = {});
|
||||
|
||||
/**
|
||||
@ -2109,16 +2115,16 @@ class Detector {
|
||||
Result<std::string> executeCommand(const std::string &value,
|
||||
Positions pos = {});
|
||||
|
||||
/** [Jungfrau][Moench][Mythen3][CTB]
|
||||
/** [Jungfrau][Moench][Mythen3][CTB][Xilinx CTB]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
Result<int64_t> getNumberOfFramesFromStart(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau][Moench][Mythen3][CTB] Get time from detector start
|
||||
* [Gotthard2] not in burst and auto mode */
|
||||
/** [Jungfrau][Moench][Mythen3][CTB][Xilinx CTB] Get time from detector
|
||||
* start [Gotthard2] not in burst and auto mode */
|
||||
Result<ns> getActualTime(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau][Moench][Mythen3][CTB] Get timestamp at a frame start
|
||||
* [Gotthard2] not in burst and auto mode */
|
||||
/** [Jungfrau][Moench][Mythen3][CTB][Xilinx CTB] Get timestamp at a frame
|
||||
* start [Gotthard2] not in burst and auto mode */
|
||||
Result<ns> getMeasurementTime(Positions pos = {}) const;
|
||||
|
||||
/** get user details from shared memory (hostname, type, PID, User, Date)
|
||||
|
@ -2247,6 +2247,46 @@ std::string Caller::config(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string Caller::configtransceiver(int action) {
|
||||
|
||||
std::ostringstream os;
|
||||
// print help
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: configtransceiver" << std::endl;
|
||||
os << R"V0G0N(
|
||||
[Xilinx Ctb] Waits for transceiver to be aligned. Chip had to be configured (powered on) before this. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
|
||||
// check if action and arguments are valid
|
||||
if (action == slsDetectorDefs::PUT_ACTION) {
|
||||
if (1 && args.size() != 0) {
|
||||
throw RuntimeError("Wrong number of arguments for action PUT");
|
||||
}
|
||||
|
||||
if (args.size() == 0) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
throw RuntimeError(
|
||||
"INTERNAL ERROR: Invalid action: supported actions are ['PUT']");
|
||||
}
|
||||
|
||||
// generate code for each action
|
||||
if (action == slsDetectorDefs::PUT_ACTION) {
|
||||
if (args.size() == 0) {
|
||||
det->configureTransceiver(std::vector<int>{det_id});
|
||||
os << "successful" << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string Caller::dac(int action) {
|
||||
|
||||
std::ostringstream os;
|
||||
@ -3161,7 +3201,7 @@ std::string Caller::delay(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: delay" << std::endl;
|
||||
os << R"V0G0N([duration] [(optional unit) ns|us|ms|s]
|
||||
[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb][Moench] Delay after trigger )V0G0N"
|
||||
[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb][Moench][Xilinx Ctb] Delay after trigger )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -3250,7 +3290,7 @@ std::string Caller::delayl(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: delayl" << std::endl;
|
||||
os << R"V0G0N(
|
||||
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Delay Left in Acquisition.
|
||||
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Delay Left in Acquisition.
|
||||
[Gotthard2] only in continuous mode. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
@ -3516,7 +3556,7 @@ std::string Caller::dr(int action) {
|
||||
Dynamic Range or number of bits per pixel in detector.
|
||||
[Eiger] Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2, else to 0.
|
||||
[Mythen3] Options: 8, 16, 32
|
||||
[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2] 16 )V0G0N"
|
||||
[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2][Xilinx Ctb] 16 )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -3685,7 +3725,7 @@ std::string Caller::exptime(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: exptime" << std::endl;
|
||||
os << R"V0G0N([duration] [(optional unit) ns|us|ms|s]
|
||||
[Eiger][Jungfrau][Moench][Gotthard][Gotthard2][Ctb] Exposure time
|
||||
[Eiger][Jungfrau][Moench][Gotthard][Gotthard2][Ctb][Xilinx Ctb] Exposure time
|
||||
[Mythen3] Exposure time of all gate signals in auto and trigger mode (internal gating). To specify gate index, use exptime1, exptime2, exptime3. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
@ -4666,7 +4706,7 @@ std::string Caller::firmwaretest(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: firmwaretest" << std::endl;
|
||||
os << R"V0G0N(
|
||||
[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb] Firmware test, ie. reads a read fixed pattern from a register. )V0G0N"
|
||||
[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Firmware test, ie. reads a read fixed pattern from a register. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -5132,7 +5172,7 @@ std::string Caller::framecounter(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: framecounter" << std::endl;
|
||||
os << R"V0G0N(
|
||||
[Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of frames from start run control.
|
||||
[Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number of frames from start run control.
|
||||
[Gotthard2] only in continuous mode. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
@ -5242,7 +5282,7 @@ std::string Caller::framesl(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: framesl" << std::endl;
|
||||
os << R"V0G0N(
|
||||
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of frames left in acquisition.
|
||||
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number of frames left in acquisition.
|
||||
[Gotthard2] only in continuous auto mode. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
@ -5283,7 +5323,7 @@ std::string Caller::frametime(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: frametime" << std::endl;
|
||||
os << R"V0G0N([(optional unit) ns|us|ms|s]
|
||||
[Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Timestamp at a frame start.
|
||||
[Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Timestamp at a frame start.
|
||||
[Gotthard2] not in burst and auto mode. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
@ -6039,7 +6079,7 @@ std::string Caller::hardwareversion(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: hardwareversion" << std::endl;
|
||||
os << R"V0G0N(
|
||||
[Jungfrau][Gotthard2][Myhten3][Gotthard][Ctb][Moench] Hardware version of detector.
|
||||
Hardware version of detector.
|
||||
[Eiger] Hardware version of front FPGA on detector. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
@ -7224,7 +7264,7 @@ std::string Caller::nextframenumber(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: nextframenumber" << std::endl;
|
||||
os << R"V0G0N([n_value]
|
||||
[Eiger][Jungfrau][Moench][Ctb] Next frame number. Stopping acquisition might result in different frame numbers for different modules. )V0G0N"
|
||||
[Eiger][Jungfrau][Moench][Ctb][Xilinx Ctb] Next frame number. Stopping acquisition might result in different frame numbers for different modules. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -7668,7 +7708,7 @@ std::string Caller::patfname(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: patfname" << std::endl;
|
||||
os << R"V0G0N(
|
||||
[Ctb][Mythen3] Gets the pattern file name including path of the last pattern uploaded. Returns an empty if nothing was uploaded or via a server default file )V0G0N"
|
||||
[Ctb][Mythen3][Xilinx Ctb] Gets the pattern file name including path of the last pattern uploaded. Returns an empty if nothing was uploaded or via a server default file )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -7771,7 +7811,7 @@ std::string Caller::patlimits(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: patlimits" << std::endl;
|
||||
os << R"V0G0N([start addr] [stop addr]
|
||||
[Ctb][Mythen3] Limits of complete pattern )V0G0N"
|
||||
[Ctb][Mythen3][Xilinx Ctb] Limits of complete pattern )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -7824,7 +7864,7 @@ std::string Caller::patloop(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: patloop" << std::endl;
|
||||
os << R"V0G0N([0-6] [start addr] [stop addr]
|
||||
[Ctb][Mythen3] Limits of the loop level provided.
|
||||
[Ctb][Mythen3][Xilinx Ctb] Limits of the loop level provided.
|
||||
[Mythen3] Level options: 0-3 only. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
@ -8047,7 +8087,7 @@ std::string Caller::patmask(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: patmask" << std::endl;
|
||||
os << R"V0G0N([64 bit mask]
|
||||
[Ctb][Mythen3] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern. )V0G0N"
|
||||
[Ctb][Mythen3][Xilinx Ctb] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -8110,7 +8150,7 @@ std::string Caller::patnloop(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: patnloop" << std::endl;
|
||||
os << R"V0G0N([0-6] [n_cycles]
|
||||
[Ctb][Mythen3] Number of cycles of the loop level provided.
|
||||
[Ctb][Mythen3][Xilinx Ctb] Number of cycles of the loop level provided.
|
||||
[Mythen3] Level options: 0-3 only. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
@ -8325,7 +8365,7 @@ std::string Caller::patsetbit(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: patsetbit" << std::endl;
|
||||
os << R"V0G0N([64 bit mask]
|
||||
[Ctb][Mythen3] Sets the mask applied to every pattern to the selected bits. )V0G0N"
|
||||
[Ctb][Mythen3][Xilinx Ctb] Sets the mask applied to every pattern to the selected bits. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -8388,7 +8428,7 @@ std::string Caller::pattern(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: patternX" << std::endl;
|
||||
os << R"V0G0N([fname]
|
||||
[Mythen3][Ctb] Loads ASCII pattern file directly to server (instead of executing line by line) )V0G0N"
|
||||
[Mythen3][Ctb][Xilinx Ctb] Loads ASCII pattern file directly to server (instead of executing line by line) )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -8468,7 +8508,7 @@ std::string Caller::patwait(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: patwait" << std::endl;
|
||||
os << R"V0G0N([0-6] [addr]
|
||||
[Ctb][Mythen3] Wait address for loop level provided.
|
||||
[Ctb][Mythen3][Xilinx Ctb] Wait address for loop level provided.
|
||||
[Mythen3] Level options: 0-3 only. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
@ -8679,7 +8719,7 @@ std::string Caller::patwaittime(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: patwaittime" << std::endl;
|
||||
os << R"V0G0N([0-6] [n_clk]
|
||||
[Ctb][Mythen3] Wait time in clock cycles for the loop provided.
|
||||
[Ctb][Mythen3][Xilinx Ctb] Wait time in clock cycles for the loop provided.
|
||||
[Mythen3] Level options: 0-3 only. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
@ -8893,7 +8933,7 @@ std::string Caller::patword(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: patword" << std::endl;
|
||||
os << R"V0G0N([step or address] [64 bit mask]
|
||||
[Ctb][Mythen3] 64 bit pattern at address of pattern memory.
|
||||
[Ctb][Mythen3][Xilinx Ctb] 64 bit pattern at address of pattern memory.
|
||||
[Ctb] read is same as executing pattern )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
@ -9141,7 +9181,7 @@ std::string Caller::periodl(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: periodl" << std::endl;
|
||||
os << R"V0G0N(
|
||||
[Gotthard][Jungfrau][Moench][Ctb][Mythen3][Gotthard2] Period left for current frame.
|
||||
[Gotthard][Jungfrau][Moench][Ctb][Mythen3][Gotthard2][Xilinx Ctb] Period left for current frame.
|
||||
[Gotthard2] only in continuous mode. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
@ -9317,9 +9357,10 @@ std::string Caller::powerchip(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: powerchip" << std::endl;
|
||||
os << R"V0G0N([0, 1]
|
||||
[Jungfrau][Moench][Mythen3][Gotthard2] Power the chip.
|
||||
[Jungfrau][Moench][Mythen3][Gotthard2][Xilinx Ctb] Power the chip.
|
||||
[Jungfrau][Moench] Default is 0. Get will return power status. Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled. Will configure chip (only chip v1.1)
|
||||
[Mythen3][Gotthard2] Default is 1. If module not connected or wrong module, powerchip will fail. )V0G0N"
|
||||
[Mythen3][Gotthard2] Default is 1. If module not connected or wrong module, powerchip will fail.
|
||||
[Xilinx Ctb] Default is 0. Also configures the chip if powered on. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -10230,7 +10271,7 @@ std::string Caller::rebootcontroller(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: rebootcontroller" << std::endl;
|
||||
os << R"V0G0N(
|
||||
[Jungfrau][Moench][Ctb][Gotthard][Mythen3][Gotthard2] Reboot controller of detector. )V0G0N"
|
||||
[Jungfrau][Moench][Ctb][Gotthard][Mythen3][Gotthard2][Xilinx Ctb] Reboot controller of detector. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -10399,7 +10440,7 @@ std::string Caller::resetfpga(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: resetfpga" << std::endl;
|
||||
os << R"V0G0N(
|
||||
[Jungfrau][Moench][Ctb] Reset FPGA. )V0G0N"
|
||||
[Jungfrau][Moench][Ctb][Xilinx Ctb] Reset FPGA. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -10505,7 +10546,7 @@ std::string Caller::romode(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: romode" << std::endl;
|
||||
os << R"V0G0N([analog|digital|analog_digital|transceiver|digital_transceiver]
|
||||
[Ctb] Readout mode. Default is analog. )V0G0N"
|
||||
[Ctb][xilinx Ctb] Readout mode. [Ctb] Default is analog. [Xilinx Ctb] Default is Transceiver (only one implemented so far) )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -10696,7 +10737,7 @@ std::string Caller::runtime(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: runtime" << std::endl;
|
||||
os << R"V0G0N([(optional unit) ns|us|ms|s]
|
||||
[Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Time from detector start up.
|
||||
[Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Time from detector start up.
|
||||
[Gotthard2] not in burst and auto mode. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
@ -12328,7 +12369,7 @@ std::string Caller::savepattern(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: savepattern" << std::endl;
|
||||
os << R"V0G0N(
|
||||
[Ctb][Mythen3] Saves pattern to file (ascii).
|
||||
[Ctb][Mythen3][Xilinx Ctb] Saves pattern to file (ascii).
|
||||
[Ctb] Also executes pattern. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
@ -13298,7 +13339,7 @@ std::string Caller::slowadcvalues(int action) {
|
||||
if (action == slsDetectorDefs::GET_ACTION) {
|
||||
if (args.size() == 0) {
|
||||
|
||||
std::string suffix = " mV";
|
||||
std::string suffix = " uV";
|
||||
auto t = det->getSlowADCList();
|
||||
|
||||
auto names = det->getSlowADCNames();
|
||||
@ -14215,7 +14256,7 @@ std::string Caller::temp_fpga(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: temp_fpga" << std::endl;
|
||||
os << R"V0G0N([n_value]
|
||||
[Eiger][Jungfrau][Moench][Gotthard][Mythen3][Gotthard2] FPGA Temperature )V0G0N"
|
||||
[Eiger][Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Xilinx CTB] FPGA Temperature )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -14727,7 +14768,7 @@ std::string Caller::timing(int action) {
|
||||
os << "Command: timing" << std::endl;
|
||||
os << R"V0G0N([auto|trigger|gating|burst_trigger]
|
||||
Timing Mode of detector.
|
||||
[Jungfrau][Moench][Gotthard][Ctb][Gotthard2] [auto|trigger]
|
||||
[Jungfrau][Moench][Gotthard][Ctb][Gotthard2][Xilinx Ctb] [auto|trigger]
|
||||
[Mythen3] [auto|trigger|gating|trigger_gating]
|
||||
[Eiger] [auto|trigger|gating|burst_trigger] )V0G0N"
|
||||
<< std::endl;
|
||||
@ -14960,7 +15001,7 @@ std::string Caller::transceiverenable(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: transceiverenable" << std::endl;
|
||||
os << R"V0G0N([bitmask]
|
||||
[Ctb] Transceiver Enable Mask. Enable for each 4 Transceiver channel. )V0G0N"
|
||||
[Ctb][Xilinx Ctb] Transceiver Enable Mask. Enable for each 4 Transceiver channel. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -15134,7 +15175,7 @@ std::string Caller::triggersl(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: triggersl" << std::endl;
|
||||
os << R"V0G0N(
|
||||
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb] Number of triggers left in acquisition. Only when external trigger used. )V0G0N"
|
||||
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][Ctb][Xilinx Ctb] Number of triggers left in acquisition. Only when external trigger used. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -15294,7 +15335,7 @@ std::string Caller::tsamples(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: tsamples" << std::endl;
|
||||
os << R"V0G0N([n_value]
|
||||
[Ctb] Number of transceiver samples expected. )V0G0N"
|
||||
[Ctb][Xilinx Ctb] Number of transceiver samples expected. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -16568,7 +16609,7 @@ std::string Caller::v_a(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: v_a" << std::endl;
|
||||
os << R"V0G0N([n_value]
|
||||
[Ctb] Power supply a in mV. )V0G0N"
|
||||
[Ctb][Xilinx Ctb] Power supply a in mV. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -16631,7 +16672,7 @@ std::string Caller::v_b(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: v_b" << std::endl;
|
||||
os << R"V0G0N([n_value]
|
||||
[Ctb] Power supply b in mV. )V0G0N"
|
||||
[Ctb][Xilinx Ctb] Power supply b in mV. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -16694,7 +16735,7 @@ std::string Caller::v_c(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: v_c" << std::endl;
|
||||
os << R"V0G0N([n_value]
|
||||
[Ctb] Power supply c in mV. )V0G0N"
|
||||
[Ctb][Xilinx Ctb] Power supply c in mV. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -16821,7 +16862,7 @@ std::string Caller::v_d(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: v_d" << std::endl;
|
||||
os << R"V0G0N([n_value]
|
||||
[Ctb] Power supply d in mV. )V0G0N"
|
||||
[Ctb][Xilinx Ctb] Power supply d in mV. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -16884,7 +16925,7 @@ std::string Caller::v_io(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: v_io" << std::endl;
|
||||
os << R"V0G0N([n_value]
|
||||
[Ctb] Power supply io in mV. Minimum 1200 mV. Must be the first power regulator to be set after fpga reset (on-board detector server start up). )V0G0N"
|
||||
[Ctb][Xilinx Ctb] Power supply io in mV. Minimum 1200 mV. Must be the first power regulator to be set after fpga reset (on-board detector server start up). )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@ -16947,7 +16988,7 @@ std::string Caller::v_limit(int action) {
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << "Command: v_limit" << std::endl;
|
||||
os << R"V0G0N([n_value]
|
||||
[Ctb] Soft limit for power supplies (ctb only) and DACS in mV. )V0G0N"
|
||||
[Ctb][Xilinx Ctb] Soft limit for power supplies (ctb only) and DACS in mV. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
|
@ -93,6 +93,7 @@ class Caller {
|
||||
std::string compdisabletime(int action);
|
||||
std::string confadc(int action);
|
||||
std::string config(int action);
|
||||
std::string configtransceiver(int action);
|
||||
std::string counters(int action);
|
||||
std::string currentsource(int action);
|
||||
std::string dac(int action);
|
||||
@ -435,6 +436,7 @@ class Caller {
|
||||
{"compdisabletime", &Caller::compdisabletime},
|
||||
{"confadc", &Caller::confadc},
|
||||
{"config", &Caller::config},
|
||||
{"configtransceiver", &Caller::configtransceiver},
|
||||
{"counters", &Caller::counters},
|
||||
{"currentsource", &Caller::currentsource},
|
||||
{"dac", &Caller::dac},
|
||||
|
@ -232,7 +232,6 @@ std::string Caller::acquire(int action) {
|
||||
if (det_id >= 0) {
|
||||
throw RuntimeError("Individual detectors not allowed for readout.");
|
||||
}
|
||||
|
||||
det->acquire();
|
||||
|
||||
if (det->getUseReceiverFlag().squash(false)) {
|
||||
|
@ -653,7 +653,6 @@ std::vector<defs::dacIndex> Detector::getTemperatureList() const {
|
||||
std::vector<defs::dacIndex> retval;
|
||||
switch (getDetectorType().squash()) {
|
||||
case defs::CHIPTESTBOARD:
|
||||
case defs::XILINX_CHIPTESTBOARD:
|
||||
return std::vector<defs::dacIndex>{defs::SLOW_ADC_TEMP};
|
||||
case defs::JUNGFRAU:
|
||||
case defs::MOENCH:
|
||||
@ -668,6 +667,7 @@ std::vector<defs::dacIndex> Detector::getTemperatureList() const {
|
||||
defs::TEMPERATURE_FPGA2, defs::TEMPERATURE_FPGA3};
|
||||
case defs::MYTHEN3:
|
||||
case defs::GOTTHARD2:
|
||||
case defs::XILINX_CHIPTESTBOARD:
|
||||
return std::vector<defs::dacIndex>{defs::TEMPERATURE_FPGA};
|
||||
default:
|
||||
return std::vector<defs::dacIndex>{};
|
||||
@ -698,6 +698,7 @@ Result<int> Detector::getTemperature(defs::dacIndex index,
|
||||
case defs::MOENCH:
|
||||
case defs::MYTHEN3:
|
||||
case defs::GOTTHARD2:
|
||||
case defs::XILINX_CHIPTESTBOARD:
|
||||
for (auto &it : res) {
|
||||
it /= 1000;
|
||||
}
|
||||
@ -2487,6 +2488,12 @@ std::string Detector::getSlowADCName(const defs::dacIndex i) const {
|
||||
return pimpl->getCtbSlowADCName(i);
|
||||
}
|
||||
|
||||
// Xilinx Ctb Specific
|
||||
|
||||
void Detector::configureTransceiver(Positions pos) {
|
||||
pimpl->Parallel(&Module::configureTransceiver, pos);
|
||||
}
|
||||
|
||||
// Pattern
|
||||
|
||||
Result<std::string> Detector::getPatterFileName(Positions pos) const {
|
||||
|
@ -1375,7 +1375,7 @@ void DetectorImpl::stopDetector(Positions pos) {
|
||||
|
||||
void DetectorImpl::printProgress(double progress) {
|
||||
// spaces for python printout
|
||||
std::cout << " " << std::fixed << std::setprecision(2) << std::setw(6)
|
||||
std::cout << " " << std::fixed << std::setprecision(2) << std::setw(10)
|
||||
<< progress << " \%";
|
||||
std::cout << '\r' << std::flush;
|
||||
}
|
||||
|
@ -2383,6 +2383,7 @@ void Module::setNumberOfAnalogSamples(int value) {
|
||||
// update #nchan, as it depends on #samples, adcmask
|
||||
updateNumberOfChannels();
|
||||
if (shm()->useReceiverFlag) {
|
||||
LOG(logINFORED) << "receiver up!";
|
||||
sendToReceiver(F_RECEIVER_SET_NUM_ANALOG_SAMPLES, value, nullptr);
|
||||
}
|
||||
}
|
||||
@ -2531,6 +2532,13 @@ void Module::setLEDEnable(bool enable) {
|
||||
sendToDetector<int>(F_LED, static_cast<int>(enable));
|
||||
}
|
||||
|
||||
// Xilinx Ctb Specific
|
||||
void Module::configureTransceiver() {
|
||||
sendToDetector(F_CONFIG_TRANSCEIVER);
|
||||
LOG(logINFO) << "Module " << moduleIndex << " (" << shm()->hostname
|
||||
<< "): Transceiver configured successfully!";
|
||||
}
|
||||
|
||||
// Pattern
|
||||
std::string Module::getPatterFileName() const {
|
||||
char retval[MAX_STR_LENGTH]{};
|
||||
@ -3334,7 +3342,13 @@ void Module::initializeModuleStructure(detectorType type) {
|
||||
shm()->numberOfModule.y = 0;
|
||||
shm()->controlPort = DEFAULT_TCP_CNTRL_PORTNO;
|
||||
shm()->stopPort = DEFAULT_TCP_STOP_PORTNO;
|
||||
strcpy_safe(shm()->settingsDir, getenv("HOME"));
|
||||
char *home_directory = getenv("HOME");
|
||||
if (home_directory != nullptr)
|
||||
strcpy_safe(shm()->settingsDir, home_directory);
|
||||
else {
|
||||
strcpy_safe(shm()->settingsDir, "");
|
||||
LOG(logWARNING) << "HOME directory not set";
|
||||
}
|
||||
strcpy_safe(shm()->rxHostname, "none");
|
||||
shm()->rxTCPPort = DEFAULT_TCP_RX_PORTNO + moduleIndex;
|
||||
shm()->useReceiverFlag = false;
|
||||
|
@ -528,6 +528,13 @@ class Module : public virtual slsDetectorDefs {
|
||||
bool getLEDEnable() const;
|
||||
void setLEDEnable(bool enable);
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
* Xilinx Ctb Specific *
|
||||
* *
|
||||
* ************************************************/
|
||||
void configureTransceiver();
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
* Pattern *
|
||||
|
@ -562,6 +562,18 @@ int InferAction::config() {
|
||||
}
|
||||
}
|
||||
|
||||
int InferAction::configtransceiver() {
|
||||
|
||||
if (args.size() == 0) {
|
||||
return slsDetectorDefs::PUT_ACTION;
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
throw RuntimeError("Could not infer action: Wrong number of arguments");
|
||||
}
|
||||
}
|
||||
|
||||
int InferAction::counters() {
|
||||
|
||||
throw RuntimeError("sls_detector is disabled for command: counters. Use "
|
||||
|
@ -48,6 +48,7 @@ class InferAction {
|
||||
int compdisabletime();
|
||||
int confadc();
|
||||
int config();
|
||||
int configtransceiver();
|
||||
int counters();
|
||||
int currentsource();
|
||||
int dac();
|
||||
@ -381,6 +382,7 @@ class InferAction {
|
||||
{"compdisabletime", &InferAction::compdisabletime},
|
||||
{"confadc", &InferAction::confadc},
|
||||
{"config", &InferAction::config},
|
||||
{"configtransceiver", &InferAction::configtransceiver},
|
||||
{"counters", &InferAction::counters},
|
||||
{"currentsource", &InferAction::currentsource},
|
||||
{"dac", &InferAction::dac},
|
||||
|
@ -15,6 +15,7 @@ target_sources(tests PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-gotthard2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-gotthard.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-chiptestboard.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-xilinx-chiptestboard.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-moench.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-global.cpp
|
||||
|
||||
|
@ -24,7 +24,8 @@ TEST_CASE("CALLER::dacname", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
defs::dacIndex ind = static_cast<defs::dacIndex>(2);
|
||||
std::string str_dac_index = "2";
|
||||
auto prev = det.getDacName(ind);
|
||||
@ -58,7 +59,8 @@ TEST_CASE("CALLER::dacindex", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
defs::dacIndex ind = static_cast<defs::dacIndex>(2);
|
||||
std::string str_dac_index = "2";
|
||||
|
||||
@ -83,7 +85,8 @@ TEST_CASE("CALLER::adclist", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev = det.getAdcNames();
|
||||
|
||||
REQUIRE_THROWS(caller.call("adclist", {"a", "s", "d"}, -1, PUT));
|
||||
@ -115,7 +118,8 @@ TEST_CASE("CALLER::adcname", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
int ind = 2;
|
||||
std::string str_adc_index = "2";
|
||||
auto prev = det.getAdcName(ind);
|
||||
@ -149,7 +153,8 @@ TEST_CASE("CALLER::adcindex", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
int ind = 2;
|
||||
std::string str_adc_index = "2";
|
||||
|
||||
@ -174,7 +179,8 @@ TEST_CASE("CALLER::signallist", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev = det.getSignalNames();
|
||||
|
||||
REQUIRE_THROWS(caller.call("signallist", {"a", "s", "d"}, -1, PUT));
|
||||
@ -206,7 +212,8 @@ TEST_CASE("CALLER::signalname", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
int ind = 2;
|
||||
std::string str_signal_index = "2";
|
||||
auto prev = det.getSignalName(ind);
|
||||
@ -240,7 +247,8 @@ TEST_CASE("CALLER::signalindex", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
int ind = 2;
|
||||
std::string str_signal_index = "2";
|
||||
|
||||
@ -266,7 +274,8 @@ TEST_CASE("CALLER::powerlist", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev = det.getPowerNames();
|
||||
|
||||
REQUIRE_THROWS(caller.call("powerlist", {"a", "s", "d"}, -1, PUT));
|
||||
@ -298,7 +307,8 @@ TEST_CASE("CALLER::powername", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::V_POWER_A);
|
||||
std::string str_power_index = "2";
|
||||
auto prev = det.getPowerName(ind);
|
||||
@ -332,7 +342,8 @@ TEST_CASE("CALLER::powerindex", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::V_POWER_A);
|
||||
std::string str_power_index = "2";
|
||||
|
||||
@ -357,7 +368,8 @@ TEST_CASE("CALLER::powervalues", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_NOTHROW(caller.call("powervalues", {}, -1, GET));
|
||||
REQUIRE_THROWS(caller.call("powervalues", {}, -1, PUT));
|
||||
} else {
|
||||
@ -369,7 +381,8 @@ TEST_CASE("CALLER::slowadcvalues", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_NOTHROW(caller.call("slowadcvalues", {}, -1, GET));
|
||||
REQUIRE_THROWS(caller.call("slowadcvalues", {}, -1, PUT));
|
||||
} else {
|
||||
@ -382,7 +395,8 @@ TEST_CASE("CALLER::slowadclist", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev = det.getSlowADCNames();
|
||||
|
||||
REQUIRE_THROWS(caller.call("slowadclist", {"a", "s", "d"}, -1, PUT));
|
||||
@ -414,7 +428,8 @@ TEST_CASE("CALLER::slowadcname", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::SLOW_ADC0);
|
||||
std::string str_slowadc_index = "2";
|
||||
auto prev = det.getSlowADCName(ind);
|
||||
@ -449,7 +464,8 @@ TEST_CASE("CALLER::slowadcindex", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::SLOW_ADC0);
|
||||
std::string str_slowadc_index = "2";
|
||||
|
||||
@ -478,12 +494,14 @@ TEST_CASE("CALLER::dac", "[.cmdcall][.dacs]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
for (int i = 0; i < 18; ++i) {
|
||||
SECTION("dac " + std::to_string(i)) {
|
||||
test_dac_caller(static_cast<defs::dacIndex>(i), "dac", 0);
|
||||
}
|
||||
}
|
||||
|
||||
// eiger
|
||||
// REQUIRE_THROWS(caller.call("dac", {"vthreshold"}, -1, GET));
|
||||
// REQUIRE_THROWS(caller.call("dac", {"vsvp"}, -1, GET));
|
||||
@ -592,12 +610,10 @@ TEST_CASE("CALLER::samples", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_asamples = det.getNumberOfAnalogSamples();
|
||||
Result<int> prev_dsamples = 0;
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
prev_dsamples = det.getNumberOfDigitalSamples();
|
||||
}
|
||||
auto prev_dsamples = det.getNumberOfDigitalSamples();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("samples", {"25"}, -1, PUT, oss);
|
||||
@ -618,16 +634,15 @@ TEST_CASE("CALLER::samples", "[.cmdcall]") {
|
||||
caller.call("asamples", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "asamples 450\n");
|
||||
}
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
std::ostringstream oss;
|
||||
caller.call("dsamples", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "dsamples 450\n");
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setNumberOfAnalogSamples(prev_asamples[i], {i});
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
det.setNumberOfDigitalSamples(prev_dsamples[i], {i});
|
||||
}
|
||||
det.setNumberOfDigitalSamples(prev_dsamples[i], {i});
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("samples", {}, -1, GET));
|
||||
@ -639,7 +654,8 @@ TEST_CASE("CALLER::asamples", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getNumberOfAnalogSamples();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -743,7 +759,8 @@ TEST_CASE("CALLER::v_limit", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_LIMIT);
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -811,7 +828,8 @@ TEST_CASE("CALLER::adcenable10g", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getTenGigaADCEnableMask();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -841,7 +859,8 @@ TEST_CASE("CALLER::transceiverenable", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getTransceiverEnableMask();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -873,7 +892,8 @@ TEST_CASE("CALLER::dsamples", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getNumberOfDigitalSamples();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -903,7 +923,8 @@ TEST_CASE("CALLER::tsamples", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getNumberOfTransceiverSamples();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -932,7 +953,8 @@ TEST_CASE("CALLER::romode", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_romode = det.getReadoutMode();
|
||||
auto prev_asamples = det.getNumberOfAnalogSamples();
|
||||
auto prev_dsamples = det.getNumberOfDigitalSamples();
|
||||
@ -1016,7 +1038,8 @@ TEST_CASE("CALLER::v_a", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_POWER_A);
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
@ -1037,7 +1060,8 @@ TEST_CASE("CALLER::v_b", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_POWER_B);
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
@ -1058,7 +1082,8 @@ TEST_CASE("CALLER::v_c", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_POWER_C);
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
@ -1079,7 +1104,8 @@ TEST_CASE("CALLER::v_d", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_POWER_D);
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
@ -1100,7 +1126,8 @@ TEST_CASE("CALLER::v_io", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
// better not to play with setting it
|
||||
REQUIRE_NOTHROW(caller.call("v_io", {}, -1, GET));
|
||||
} else {
|
||||
@ -1230,11 +1257,12 @@ TEST_CASE("CALLER::im_io", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("CALLER::adc", "[.cmdcall]") {
|
||||
TEST_CASE("CALLER::slowadc", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
for (int i = 0; i <= 7; ++i) {
|
||||
REQUIRE_NOTHROW(
|
||||
caller.call("slowadc", {std::to_string(i)}, -1, GET));
|
||||
|
@ -23,7 +23,8 @@ TEST_CASE("Caller::patfname", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
REQUIRE_THROWS(caller.call("patfname", {}, -1, PUT));
|
||||
REQUIRE_NOTHROW(caller.call("patfname", {}, -1, GET));
|
||||
} else {
|
||||
@ -35,7 +36,8 @@ TEST_CASE("Caller::pattern", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
// no proper test for put
|
||||
REQUIRE_THROWS(caller.call("pattern", {}, -1, GET));
|
||||
} else {
|
||||
@ -47,7 +49,8 @@ TEST_CASE("Caller::savepattern", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
REQUIRE_THROWS(
|
||||
caller.call("savepattern", {"/tmp/pattern.txt"}, -1, GET));
|
||||
if (det.size() == 1) {
|
||||
@ -78,9 +81,10 @@ TEST_CASE("Caller::patioctrl", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPatternIOControl();
|
||||
{
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
std::ostringstream oss;
|
||||
caller.call("patioctrl", {"0xc15004808d0a21a4"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "patioctrl 0xc15004808d0a21a4\n");
|
||||
@ -108,7 +112,8 @@ TEST_CASE("Caller::patword", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
int addr = 0x23;
|
||||
std::string saddr = ToStringHex(addr, 4);
|
||||
auto prev_val = det.getPatternWord(addr);
|
||||
@ -118,6 +123,12 @@ TEST_CASE("Caller::patword", "[.cmdcall]") {
|
||||
REQUIRE(oss.str() ==
|
||||
"patword [" + saddr + ", 0xc15004808d0a21a4]\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("patword", {saddr, "0x815004808d0a21a4"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() ==
|
||||
"patword [" + saddr + ", 0x815004808d0a21a4]\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("patword", {saddr, "0xaadf0"}, -1, PUT, oss);
|
||||
@ -143,7 +154,8 @@ TEST_CASE("Caller::patlimits", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
auto prev_val = det.getPatternLoopAddresses(-1);
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -169,7 +181,8 @@ TEST_CASE("Caller::patloop", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
|
||||
// m3 only has 3 levels
|
||||
if (det_type == defs::MYTHEN3 && iLoop >= 3) {
|
||||
@ -217,7 +230,8 @@ TEST_CASE("Caller::patnloop", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
|
||||
// m3 only has 3 levels
|
||||
if (det_type == defs::MYTHEN3 && iLoop >= 3) {
|
||||
@ -262,7 +276,8 @@ TEST_CASE("Caller::patwait", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
|
||||
// m3 only has 3 levels
|
||||
if (det_type == defs::MYTHEN3 && iLoop >= 3) {
|
||||
@ -307,7 +322,8 @@ TEST_CASE("Caller::patwaittime", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
for (int iLoop = 0; iLoop != MAX_PATTERN_LEVELS; ++iLoop) {
|
||||
// m3 only has 3 levels
|
||||
if (det_type == defs::MYTHEN3 && iLoop >= 3) {
|
||||
@ -352,7 +368,8 @@ TEST_CASE("Caller::patmask", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
auto prev_val = det.getPatternMask();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -377,7 +394,8 @@ TEST_CASE("Caller::patsetbit", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD || det_type == defs::MYTHEN3) {
|
||||
auto prev_val = det.getPatternBitMask();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
|
@ -75,8 +75,8 @@ TEST_CASE("Caller::rx_stop", "[.cmdcall][.rx]") {
|
||||
|
||||
TEST_CASE("Caller::rx_status", "[.cmdcall][.rx]") {
|
||||
Detector det;
|
||||
det.setFileWrite(false); // avoid writing or error on file creation
|
||||
Caller caller(&det);
|
||||
det.setFileWrite(false); // avoid writing or error on file creation
|
||||
det.startReceiver();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -94,7 +94,6 @@ TEST_CASE("Caller::rx_status", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("Caller::rx_framescaught", "[.cmdcall][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
|
||||
// This ensures 0 caught frames
|
||||
auto prev_val = det.getFileWrite();
|
||||
det.setFileWrite(false); // avoid writing or error on file creation
|
||||
@ -128,9 +127,9 @@ TEST_CASE("Caller::rx_framescaught", "[.cmdcall][.rx]") {
|
||||
|
||||
TEST_CASE("Caller::rx_missingpackets", "[.cmdcall][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getFileWrite();
|
||||
det.setFileWrite(false); // avoid writing or error on file creation
|
||||
Caller caller(&det);
|
||||
auto prev_frames =
|
||||
det.getNumberOfFrames().tsquash("inconsistent #frames in test");
|
||||
det.setNumberOfFrames(100);
|
||||
@ -148,8 +147,10 @@ TEST_CASE("Caller::rx_missingpackets", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type != defs::CHIPTESTBOARD && det_type != defs::MOENCH) {
|
||||
// 0 missing packets (takes into account that acquisition is stopped)
|
||||
if (det_type != defs::CHIPTESTBOARD &&
|
||||
det_type != defs::XILINX_CHIPTESTBOARD) {
|
||||
// 0 missing packets (takes into account that acquisition is
|
||||
// stopped)
|
||||
det.startReceiver();
|
||||
det.startDetector();
|
||||
det.stopDetector();
|
||||
@ -193,8 +194,8 @@ TEST_CASE("Caller::rx_hostname", "[.cmdcall][.rx]") {
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getRxHostname();
|
||||
|
||||
// Cannot set rx_hostname (will reset parameters in rxr and no shm variables
|
||||
// to update)
|
||||
// Cannot set rx_hostname (will reset parameters in rxr and no shm
|
||||
// variables to update)
|
||||
// {
|
||||
// // disable receiver
|
||||
// std::ostringstream oss;
|
||||
@ -468,8 +469,8 @@ TEST_CASE("Caller::rx_roi", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(caller.call("rx_roi", {"5", "10"}, -1, PUT));
|
||||
} else {
|
||||
auto prev_val = det.getRxROI();
|
||||
@ -530,8 +531,8 @@ TEST_CASE("Caller::rx_clearroi", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(caller.call("rx_clearroi", {}, -1, PUT));
|
||||
} else {
|
||||
auto prev_val = det.getRxROI();
|
||||
@ -914,7 +915,8 @@ TEST_CASE("Caller::rx_dbitlist", "[.cmdcall][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getRxDbitList();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -943,7 +945,8 @@ TEST_CASE("Caller::rx_dbitoffset", "[.cmdcall][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getRxDbitOffset();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
|
@ -0,0 +1,35 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#include "Caller.h"
|
||||
#include "catch.hpp"
|
||||
#include "sls/Detector.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
#include <sstream>
|
||||
|
||||
#include "sls/Result.h"
|
||||
#include "sls/ToString.h"
|
||||
#include "sls/versionAPI.h"
|
||||
#include "test-Caller-global.h"
|
||||
#include "tests/globals.h"
|
||||
|
||||
namespace sls {
|
||||
|
||||
using test::GET;
|
||||
using test::PUT;
|
||||
|
||||
/* dacs */
|
||||
|
||||
TEST_CASE("CALLER::configtransceiver", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(caller.call("configtransceiver", {}, -1, GET));
|
||||
REQUIRE_NOTHROW(caller.call("configtransceiver", {}, -1, PUT));
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("configtransceiver", {}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("configtransceiver", {}, -1, GET));
|
||||
}
|
||||
}
|
||||
} // namespace sls
|
@ -27,30 +27,6 @@ TEST_CASE("CALLER::Caller::Calling help doesn't throw or cause segfault") {
|
||||
caller.call(cmd, {}, -1, slsDetectorDefs::HELP_ACTION, os));
|
||||
}
|
||||
|
||||
TEST_CASE("CALLER::Caller::period", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getPeriod();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("period", {"1.25s"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "period 1.25s\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("period", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "period 1.25s\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("period", {"0"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "period 0\n");
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setPeriod(prev_val[i], {i});
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("CALLER::Unknown command", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
@ -161,7 +137,7 @@ TEST_CASE("CALLER::serialnumber", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::EIGER) {
|
||||
if (det_type == defs::EIGER || det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(caller.call("serialnumber", {}, -1, GET));
|
||||
} else {
|
||||
REQUIRE_NOTHROW(caller.call("serialnumber", {}, -1, GET));
|
||||
@ -203,7 +179,8 @@ TEST_CASE("CALLER::settingslist", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(caller.call("settingslist", {}, -1, GET));
|
||||
} else {
|
||||
REQUIRE_NOTHROW(caller.call("settingslist", {}, -1, GET));
|
||||
@ -979,9 +956,6 @@ TEST_CASE("CALLER::delayl", "[.cmdcall]") {
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
switch (det_type) {
|
||||
case defs::EIGER:
|
||||
case defs::CHIPTESTBOARD:
|
||||
case defs::GOTTHARD2:
|
||||
case defs::MYTHEN3:
|
||||
REQUIRE_THROWS(caller.call("delayl", {}, -1, GET));
|
||||
break;
|
||||
default:
|
||||
@ -996,9 +970,6 @@ TEST_CASE("CALLER::periodl", "[.cmdcall]") {
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
switch (det_type) {
|
||||
case defs::EIGER:
|
||||
case defs::CHIPTESTBOARD:
|
||||
case defs::GOTTHARD2:
|
||||
case defs::MYTHEN3:
|
||||
REQUIRE_THROWS(caller.call("periodl", {}, -1, GET));
|
||||
break;
|
||||
default:
|
||||
@ -1059,6 +1030,7 @@ TEST_CASE("CALLER::drlist", "[.cmdcall]") {
|
||||
TEST_CASE("CALLER::timing", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
auto prev_val = det.getTimingMode();
|
||||
det.setTimingMode(defs::AUTO_TIMING);
|
||||
{
|
||||
@ -1075,7 +1047,6 @@ TEST_CASE("CALLER::timing", "[.cmdcall]") {
|
||||
caller.call("timing", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "timing trigger\n");
|
||||
}
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::EIGER) {
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
@ -1417,97 +1388,102 @@ TEST_CASE("CALLER::highvoltage", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
auto prev_val = det.getHighVoltage();
|
||||
// selected values
|
||||
if (det_type == defs::GOTTHARD) {
|
||||
REQUIRE_THROWS(caller.call("highvoltage", {"50"}, -1, PUT));
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"90"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 90\n");
|
||||
caller.call("highvoltage", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 90\n");
|
||||
if (det_type != defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getHighVoltage();
|
||||
// selected values
|
||||
if (det_type == defs::GOTTHARD) {
|
||||
REQUIRE_THROWS(caller.call("highvoltage", {"50"}, -1, PUT));
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"90"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 90\n");
|
||||
caller.call("highvoltage", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 90\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"0"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 0\n");
|
||||
caller.call("highvoltage", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 0\n");
|
||||
}
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"0"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 0\n");
|
||||
caller.call("highvoltage", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 0\n");
|
||||
// range 0, 60 - 200
|
||||
else if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
|
||||
det_type == defs::CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(caller.call("highvoltage", {"50"}, -1, PUT));
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"90"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 90\n");
|
||||
caller.call("highvoltage", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 90\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"0"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 0\n");
|
||||
caller.call("highvoltage", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 0\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
// range 0, 60 - 200
|
||||
else if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
|
||||
det_type == defs::CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(caller.call("highvoltage", {"50"}, -1, PUT));
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"90"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 90\n");
|
||||
caller.call("highvoltage", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 90\n");
|
||||
// full range 0 - 200 (get needs to wait)
|
||||
else if (det_type == defs::EIGER) {
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"50"}, 0, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 50\n");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
caller.call("highvoltage", {}, 0, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 50\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"120"}, 0, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 120\n");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
caller.call("highvoltage", {}, 0, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 120\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"0"}, 0, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 0\n");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
caller.call("highvoltage", {}, 0, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 0\n");
|
||||
}
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"0"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 0\n");
|
||||
caller.call("highvoltage", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 0\n");
|
||||
// full range 0 - 200
|
||||
else {
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"50"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 50\n");
|
||||
caller.call("highvoltage", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 50\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"120"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 120\n");
|
||||
caller.call("highvoltage", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 120\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"0"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 0\n");
|
||||
caller.call("highvoltage", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 0\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
// full range 0 - 200 (get needs to wait)
|
||||
else if (det_type == defs::EIGER) {
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"50"}, 0, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 50\n");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
caller.call("highvoltage", {}, 0, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 50\n");
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setHighVoltage(prev_val[i], {i});
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"120"}, 0, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 120\n");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
caller.call("highvoltage", {}, 0, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 120\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"0"}, 0, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 0\n");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
caller.call("highvoltage", {}, 0, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 0\n");
|
||||
}
|
||||
}
|
||||
// full range 0 - 200
|
||||
else {
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"50"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 50\n");
|
||||
caller.call("highvoltage", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 50\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"120"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 120\n");
|
||||
caller.call("highvoltage", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 120\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("highvoltage", {"0"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "highvoltage 0\n");
|
||||
caller.call("highvoltage", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "highvoltage 0\n");
|
||||
}
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setHighVoltage(prev_val[i], {i});
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("highvoltage", {"0"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("highvoltage", {}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1517,7 +1493,8 @@ TEST_CASE("CALLER::powerchip", "[.cmdcall]") {
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
|
||||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
|
||||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2 ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPowerChip();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -1536,6 +1513,9 @@ TEST_CASE("CALLER::powerchip", "[.cmdcall]") {
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setPowerChip(prev_val[i], {i});
|
||||
if (det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
det.configureTransceiver();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("powerchip", {}, -1, GET));
|
||||
@ -2023,7 +2003,8 @@ TEST_CASE("CALLER::daclist", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_NOTHROW(caller.call("daclist", {}, -1, GET));
|
||||
|
||||
auto prev = det.getDacNames();
|
||||
@ -2064,7 +2045,8 @@ TEST_CASE("CALLER::defaultdac", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type != defs::CHIPTESTBOARD) {
|
||||
if (det_type != defs::CHIPTESTBOARD &&
|
||||
det_type != defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(caller.call("defaultdac", {}, -1, GET));
|
||||
REQUIRE_THROWS(caller.call("defaultdac", {"blabla"}, -1, PUT));
|
||||
auto daclist = det.getDacList();
|
||||
@ -2123,7 +2105,8 @@ TEST_CASE("CALLER::resetdacs", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type != defs::CHIPTESTBOARD) {
|
||||
if (det_type != defs::CHIPTESTBOARD &&
|
||||
det_type != defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getSettings();
|
||||
|
||||
REQUIRE_THROWS(caller.call("resetdacs", {}, -1, GET));
|
||||
@ -2366,7 +2349,8 @@ TEST_CASE("CALLER::nextframenumber", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU ||
|
||||
det_type == defs::MOENCH || det_type == defs::CHIPTESTBOARD) {
|
||||
det_type == defs::MOENCH || det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_sfnum = det.getNextFrameNumber();
|
||||
REQUIRE_THROWS(caller.call("nextframenumber", {"0"}, -1, PUT));
|
||||
{
|
||||
@ -2435,6 +2419,7 @@ TEST_CASE("CALLER::scan", "[.cmdcall]") {
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
switch (det_type) {
|
||||
case defs::CHIPTESTBOARD:
|
||||
case defs::XILINX_CHIPTESTBOARD:
|
||||
ind = defs::DAC_0;
|
||||
notImplementedInd = defs::VSVP;
|
||||
break;
|
||||
@ -2550,8 +2535,8 @@ TEST_CASE("CALLER::scan", "[.cmdcall]") {
|
||||
// Reset all dacs to previous value
|
||||
// for (int i = 0; i != det.size(); ++i) {
|
||||
// det.setDAC(ind, previous[i], false, {i});
|
||||
// det.setDAC(notImplementedInd, notImplementedPrevious[i], false,
|
||||
// {i});
|
||||
// det.setDAC(notImplementedInd, notImplementedPrevious[i],
|
||||
// false, {i});
|
||||
// }
|
||||
}
|
||||
}
|
||||
@ -3170,7 +3155,7 @@ TEST_CASE("CALLER::resetfpga", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::MOENCH) {
|
||||
det_type == defs::MOENCH || det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
// reset will also reset udp info from config file (comment out for
|
||||
// invdividual tests) std::ostringstream oss; caller.call("resetfpga",
|
||||
// {}, -1, PUT, oss); REQUIRE(oss.str() == "resetfpga successful\n");
|
||||
@ -3206,7 +3191,8 @@ TEST_CASE("CALLER::rebootcontroller", "[.cmdcall]") {
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
|
||||
det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3 ||
|
||||
det_type == defs::GOTTHARD2 || det_type == defs::GOTTHARD) {
|
||||
det_type == defs::GOTTHARD2 || det_type == defs::GOTTHARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
// TODO: reboot real server?
|
||||
// REQUIRE_NOTHROW(caller.call("rebootcontroller", {}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("rebootcontroller", {}, -1, GET));
|
||||
@ -3351,7 +3337,8 @@ TEST_CASE("CALLER::firmwaretest", "[.cmdcall]") {
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
|
||||
det_type == defs::CHIPTESTBOARD || det_type == defs::GOTTHARD ||
|
||||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
|
||||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2 ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
std::ostringstream oss;
|
||||
caller.call("firmwaretest", {}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "firmwaretest successful\n");
|
||||
@ -3513,7 +3500,7 @@ TEST_CASE("CALLER::framecounter", "[.cmdcall]") {
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
|
||||
det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3 ||
|
||||
det_type == defs::GOTTHARD2) {
|
||||
det_type == defs::GOTTHARD2 || det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto framecounter = det.getNumberOfFramesFromStart().squash();
|
||||
std::ostringstream oss;
|
||||
caller.call("framecounter", {}, -1, GET, oss);
|
||||
@ -3532,7 +3519,7 @@ TEST_CASE("CALLER::runtime", "[.cmdcall]") {
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
|
||||
det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3 ||
|
||||
det_type == defs::GOTTHARD2) {
|
||||
det_type == defs::GOTTHARD2 || det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
std::ostringstream oss;
|
||||
caller.call("runtime", {}, -1, GET, oss);
|
||||
// Get only
|
||||
@ -3550,7 +3537,7 @@ TEST_CASE("CALLER::frametime", "[.cmdcall]") {
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
|
||||
det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3 ||
|
||||
det_type == defs::GOTTHARD2) {
|
||||
det_type == defs::GOTTHARD2 || det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
std::ostringstream oss;
|
||||
caller.call("frametime", {}, -1, GET, oss);
|
||||
// Get only
|
||||
|
@ -372,7 +372,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
|
||||
arg.additionalStorageCells);
|
||||
}
|
||||
|
||||
if (detType == CHIPTESTBOARD) {
|
||||
if (detType == CHIPTESTBOARD || detType == XILINX_CHIPTESTBOARD) {
|
||||
impl()->setNumberofAnalogSamples(arg.analogSamples);
|
||||
impl()->setNumberofDigitalSamples(arg.digitalSamples);
|
||||
impl()->setNumberofTransceiverSamples(arg.transceiverSamples);
|
||||
@ -409,12 +409,14 @@ int ClientInterface::setup_receiver(Interface &socket) {
|
||||
detType == MYTHEN3) {
|
||||
impl()->setTenGigaEnable(arg.tenGiga);
|
||||
}
|
||||
if (detType == CHIPTESTBOARD) {
|
||||
if (detType == CHIPTESTBOARD || detType == XILINX_CHIPTESTBOARD) {
|
||||
impl()->setReadoutMode(arg.roMode);
|
||||
impl()->setADCEnableMask(arg.adcMask);
|
||||
impl()->setTenGigaADCEnableMask(arg.adc10gMask);
|
||||
impl()->setTransceiverEnableMask(arg.transceiverMask);
|
||||
}
|
||||
if (detType == CHIPTESTBOARD) {
|
||||
impl()->setADCEnableMask(arg.adcMask);
|
||||
}
|
||||
if (detType == GOTTHARD) {
|
||||
impl()->setDetectorROI(arg.roi);
|
||||
}
|
||||
@ -448,6 +450,7 @@ void ClientInterface::setDetectorType(detectorType arg) {
|
||||
case GOTTHARD:
|
||||
case EIGER:
|
||||
case CHIPTESTBOARD:
|
||||
case XILINX_CHIPTESTBOARD:
|
||||
case JUNGFRAU:
|
||||
case MOENCH:
|
||||
case MYTHEN3:
|
||||
@ -568,7 +571,7 @@ int ClientInterface::set_burst_mode(Interface &socket) {
|
||||
int ClientInterface::set_num_analog_samples(Interface &socket) {
|
||||
auto value = socket.Receive<int>();
|
||||
LOG(logDEBUG1) << "Setting num analog samples to " << value;
|
||||
if (detType != CHIPTESTBOARD) {
|
||||
if (detType != CHIPTESTBOARD && detType != XILINX_CHIPTESTBOARD) {
|
||||
functionNotImplemented();
|
||||
}
|
||||
try {
|
||||
@ -584,7 +587,7 @@ int ClientInterface::set_num_analog_samples(Interface &socket) {
|
||||
int ClientInterface::set_num_digital_samples(Interface &socket) {
|
||||
auto value = socket.Receive<int>();
|
||||
LOG(logDEBUG1) << "Setting num digital samples to " << value;
|
||||
if (detType != CHIPTESTBOARD) {
|
||||
if (detType != CHIPTESTBOARD && detType != XILINX_CHIPTESTBOARD) {
|
||||
functionNotImplemented();
|
||||
}
|
||||
try {
|
||||
@ -1249,7 +1252,7 @@ int ClientInterface::get_padding_enable(Interface &socket) {
|
||||
int ClientInterface::set_readout_mode(Interface &socket) {
|
||||
auto arg = socket.Receive<readoutMode>();
|
||||
|
||||
if (detType != CHIPTESTBOARD)
|
||||
if (detType != CHIPTESTBOARD && detType != XILINX_CHIPTESTBOARD)
|
||||
functionNotImplemented();
|
||||
|
||||
if (arg >= 0) {
|
||||
@ -1294,7 +1297,7 @@ int ClientInterface::set_adc_mask(Interface &socket) {
|
||||
int ClientInterface::set_dbit_list(Interface &socket) {
|
||||
StaticVector<int, MAX_RX_DBIT> args;
|
||||
socket.Receive(args);
|
||||
if (detType != CHIPTESTBOARD)
|
||||
if (detType != CHIPTESTBOARD && detType != XILINX_CHIPTESTBOARD)
|
||||
functionNotImplemented();
|
||||
LOG(logDEBUG1) << "Setting DBIT list";
|
||||
for (auto &it : args) {
|
||||
@ -1307,7 +1310,7 @@ int ClientInterface::set_dbit_list(Interface &socket) {
|
||||
}
|
||||
|
||||
int ClientInterface::get_dbit_list(Interface &socket) {
|
||||
if (detType != CHIPTESTBOARD)
|
||||
if (detType != CHIPTESTBOARD && detType != XILINX_CHIPTESTBOARD)
|
||||
functionNotImplemented();
|
||||
StaticVector<int, MAX_RX_DBIT> retval;
|
||||
retval = impl()->getDbitList();
|
||||
@ -1317,7 +1320,7 @@ int ClientInterface::get_dbit_list(Interface &socket) {
|
||||
|
||||
int ClientInterface::set_dbit_offset(Interface &socket) {
|
||||
auto arg = socket.Receive<int>();
|
||||
if (detType != CHIPTESTBOARD)
|
||||
if (detType != CHIPTESTBOARD && detType != XILINX_CHIPTESTBOARD)
|
||||
functionNotImplemented();
|
||||
if (arg < 0) {
|
||||
throw RuntimeError("Invalid dbit offset: " + std::to_string(arg));
|
||||
@ -1329,7 +1332,7 @@ int ClientInterface::set_dbit_offset(Interface &socket) {
|
||||
}
|
||||
|
||||
int ClientInterface::get_dbit_offset(Interface &socket) {
|
||||
if (detType != CHIPTESTBOARD)
|
||||
if (detType != CHIPTESTBOARD && detType != XILINX_CHIPTESTBOARD)
|
||||
functionNotImplemented();
|
||||
int retval = impl()->getDbitOffset();
|
||||
LOG(logDEBUG1) << "Dbit offset retval: " << retval;
|
||||
@ -1735,7 +1738,7 @@ int ClientInterface::get_receiver_roi(Interface &socket) {
|
||||
|
||||
int ClientInterface::set_receiver_roi(Interface &socket) {
|
||||
auto arg = socket.Receive<ROI>();
|
||||
if (detType == CHIPTESTBOARD)
|
||||
if (detType == CHIPTESTBOARD || detType == XILINX_CHIPTESTBOARD)
|
||||
functionNotImplemented();
|
||||
LOG(logDEBUG1) << "Set Receiver ROI: " << ToString(arg);
|
||||
verifyIdle(socket);
|
||||
@ -1751,7 +1754,7 @@ int ClientInterface::set_receiver_roi(Interface &socket) {
|
||||
|
||||
int ClientInterface::set_receiver_roi_metadata(Interface &socket) {
|
||||
auto arg = socket.Receive<ROI>();
|
||||
if (detType == CHIPTESTBOARD)
|
||||
if (detType == CHIPTESTBOARD || detType == XILINX_CHIPTESTBOARD)
|
||||
functionNotImplemented();
|
||||
LOG(logDEBUG1) << "Set Receiver ROI Metadata: " << ToString(arg);
|
||||
verifyIdle(socket);
|
||||
@ -1768,7 +1771,7 @@ int ClientInterface::set_receiver_roi_metadata(Interface &socket) {
|
||||
int ClientInterface::set_num_transceiver_samples(Interface &socket) {
|
||||
auto value = socket.Receive<int>();
|
||||
LOG(logDEBUG1) << "Setting num transceiver samples to " << value;
|
||||
if (detType != CHIPTESTBOARD) {
|
||||
if (detType != CHIPTESTBOARD && detType != XILINX_CHIPTESTBOARD) {
|
||||
functionNotImplemented();
|
||||
}
|
||||
try {
|
||||
|
@ -480,6 +480,7 @@ void DataProcessor::PadMissingPackets(sls_receiver_header header, char *data) {
|
||||
memset(data + (pnum * dsize), 0xFF, dsize + 2);
|
||||
break;
|
||||
case CHIPTESTBOARD:
|
||||
case XILINX_CHIPTESTBOARD:
|
||||
if (pnum == (pperFrame - 1))
|
||||
memset(data + (pnum * dsize), 0xFF, corrected_dsize);
|
||||
else
|
||||
|
@ -648,4 +648,122 @@ class ChipTestBoardData : public GeneralData {
|
||||
};
|
||||
};
|
||||
|
||||
class XilinxChipTestBoardData : public GeneralData {
|
||||
private:
|
||||
const int NCHAN_DIGITAL = 64;
|
||||
const int NUM_BYTES_PER_ANALOG_CHANNEL = 2;
|
||||
const int NUM_BYTES_PER_TRANSCEIVER_CHANNEL = 8;
|
||||
int nAnalogBytes = 0;
|
||||
int nDigitalBytes = 0;
|
||||
int nTransceiverBytes = 0;
|
||||
|
||||
public:
|
||||
/** Constructor */
|
||||
XilinxChipTestBoardData() {
|
||||
detType = slsDetectorDefs::XILINX_CHIPTESTBOARD;
|
||||
nPixelsY = 1; // number of samples
|
||||
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
|
||||
frameIndexMask = 0xFFFFFF; // 10g
|
||||
frameIndexOffset = 8; // 10g
|
||||
packetIndexMask = 0xFF; // 10g
|
||||
framesPerFile = XILINX_CTB_MAX_FRAMES_PER_FILE;
|
||||
fifoDepth = 2500;
|
||||
standardheader = true;
|
||||
dataSize = 8144;
|
||||
packetSize = headerSizeinPacket + dataSize;
|
||||
tengigaEnable = true;
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
public:
|
||||
int GetNumberOfAnalogDatabytes() { return nAnalogBytes; };
|
||||
|
||||
int GetNumberOfDigitalDatabytes() { return nDigitalBytes; };
|
||||
|
||||
int GetNumberOfTransceiverDatabytes() { return nTransceiverBytes; };
|
||||
|
||||
void SetNumberOfAnalogSamples(int n) {
|
||||
nAnalogSamples = n;
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
void SetNumberOfDigitalSamples(int n) {
|
||||
nDigitalSamples = n;
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
void SetNumberOfTransceiverSamples(int n) {
|
||||
nTransceiverSamples = n;
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
void SetOneGigaAdcEnableMask(int n) {
|
||||
adcEnableMaskOneGiga = n;
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
void SetTenGigaAdcEnableMask(int n) {
|
||||
adcEnableMaskTenGiga = n;
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
void SetTransceiverEnableMask(int n) {
|
||||
transceiverMask = n;
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
void SetReadoutMode(slsDetectorDefs::readoutMode r) {
|
||||
readoutType = r;
|
||||
UpdateImageSize();
|
||||
};
|
||||
|
||||
private:
|
||||
void UpdateImageSize() {
|
||||
nAnalogBytes = 0;
|
||||
nDigitalBytes = 0;
|
||||
nTransceiverBytes = 0;
|
||||
int nAnalogChans = 0, nDigitalChans = 0, nTransceiverChans = 0;
|
||||
|
||||
// analog channels (normal, analog/digital readout)
|
||||
if (readoutType == slsDetectorDefs::ANALOG_ONLY ||
|
||||
readoutType == slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||
uint32_t adcEnableMask = adcEnableMaskTenGiga;
|
||||
nAnalogChans = __builtin_popcount(adcEnableMask);
|
||||
|
||||
nAnalogBytes =
|
||||
nAnalogChans * NUM_BYTES_PER_ANALOG_CHANNEL * nAnalogSamples;
|
||||
LOG(logDEBUG1) << " Number of Analog Channels:" << nAnalogChans
|
||||
<< " Databytes: " << nAnalogBytes;
|
||||
}
|
||||
// digital channels
|
||||
if (readoutType == slsDetectorDefs::DIGITAL_ONLY ||
|
||||
readoutType == slsDetectorDefs::ANALOG_AND_DIGITAL ||
|
||||
readoutType == slsDetectorDefs::DIGITAL_AND_TRANSCEIVER) {
|
||||
nDigitalChans = NCHAN_DIGITAL;
|
||||
nDigitalBytes = (sizeof(uint64_t) * nDigitalSamples);
|
||||
LOG(logDEBUG1) << "Number of Digital Channels:" << nDigitalChans
|
||||
<< " Databytes: " << nDigitalBytes;
|
||||
}
|
||||
// transceiver channels
|
||||
if (readoutType == slsDetectorDefs::TRANSCEIVER_ONLY ||
|
||||
readoutType == slsDetectorDefs::DIGITAL_AND_TRANSCEIVER) {
|
||||
nTransceiverChans = __builtin_popcount(transceiverMask);
|
||||
;
|
||||
nTransceiverBytes = nTransceiverChans *
|
||||
NUM_BYTES_PER_TRANSCEIVER_CHANNEL *
|
||||
nTransceiverSamples;
|
||||
LOG(logDEBUG1) << "Number of Transceiver Channels:"
|
||||
<< nTransceiverChans
|
||||
<< " Databytes: " << nTransceiverBytes;
|
||||
}
|
||||
nPixelsX = nAnalogChans + nDigitalChans + nTransceiverChans;
|
||||
|
||||
imageSize = nAnalogBytes + nDigitalBytes + nTransceiverBytes;
|
||||
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
|
||||
|
||||
LOG(logDEBUG1) << "Total Number of Channels:" << nPixelsX
|
||||
<< " Databytes: " << imageSize;
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -116,6 +116,7 @@ void Implementation::setDetectorType(const detectorType d) {
|
||||
case JUNGFRAU:
|
||||
case MOENCH:
|
||||
case CHIPTESTBOARD:
|
||||
case XILINX_CHIPTESTBOARD:
|
||||
case MYTHEN3:
|
||||
case GOTTHARD2:
|
||||
LOG(logINFO) << " ***** " << ToString(d) << " Receiver *****";
|
||||
@ -145,6 +146,9 @@ void Implementation::setDetectorType(const detectorType d) {
|
||||
case CHIPTESTBOARD:
|
||||
generalData = new ChipTestBoardData();
|
||||
break;
|
||||
case XILINX_CHIPTESTBOARD:
|
||||
generalData = new XilinxChipTestBoardData();
|
||||
break;
|
||||
case MYTHEN3:
|
||||
generalData = new Mythen3Data();
|
||||
break;
|
||||
|
@ -471,6 +471,7 @@ void Listener::CopyPacket(char *dst, char *src, uint32_t dataSize,
|
||||
memcpy(dst + dataSize - 2, &src[detHeaderSize], dataSize + 2);
|
||||
break;
|
||||
case CHIPTESTBOARD:
|
||||
case XILINX_CHIPTESTBOARD:
|
||||
if (pnum == (generalData->packetsPerFrame - 1))
|
||||
memcpy(dst + (pnum * dataSize), &src[detHeaderSize],
|
||||
correctedDataSize);
|
||||
|
@ -31,6 +31,9 @@ void MasterAttributes::GetBinaryAttributes(
|
||||
case slsDetectorDefs::CHIPTESTBOARD:
|
||||
GetCtbBinaryAttributes(w);
|
||||
break;
|
||||
case slsDetectorDefs::XILINX_CHIPTESTBOARD:
|
||||
GetXilinxCtbBinaryAttributes(w);
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Unknown Detector type to get master attributes");
|
||||
}
|
||||
@ -63,6 +66,9 @@ void MasterAttributes::WriteHDF5Attributes(H5::H5File *fd, H5::Group *group) {
|
||||
case slsDetectorDefs::CHIPTESTBOARD:
|
||||
WriteCtbHDF5Attributes(fd, group);
|
||||
break;
|
||||
case slsDetectorDefs::XILINX_CHIPTESTBOARD:
|
||||
WriteXilinxCtbHDF5Attributes(fd, group);
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Unknown Detector type to get master attributes");
|
||||
}
|
||||
@ -814,4 +820,49 @@ void MasterAttributes::WriteCtbHDF5Attributes(H5::H5File *fd,
|
||||
}
|
||||
#endif
|
||||
|
||||
void MasterAttributes::GetXilinxCtbBinaryAttributes(
|
||||
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
|
||||
w->Key("Exptime");
|
||||
w->String(ToString(exptime).c_str());
|
||||
w->Key("Period");
|
||||
w->String(ToString(period).c_str());
|
||||
w->Key("ADC Mask");
|
||||
w->String(ToStringHex(adcmask).c_str());
|
||||
w->Key("Analog Flag");
|
||||
w->Uint(analog);
|
||||
w->Key("Analog Samples");
|
||||
w->Uint(analogSamples);
|
||||
w->Key("Digital Flag");
|
||||
w->Uint(digital);
|
||||
w->Key("Digital Samples");
|
||||
w->Uint(digitalSamples);
|
||||
w->Key("Dbit Offset");
|
||||
w->Uint(dbitoffset);
|
||||
w->Key("Dbit Bitset");
|
||||
w->Uint64(dbitlist);
|
||||
w->Key("Transceiver Mask");
|
||||
w->String(ToStringHex(transceiverMask).c_str());
|
||||
w->Key("Transceiver Flag");
|
||||
w->Uint(transceiver);
|
||||
w->Key("Transceiver Samples");
|
||||
w->Uint(transceiverSamples);
|
||||
}
|
||||
|
||||
#ifdef HDF5C
|
||||
void MasterAttributes::WriteXilinxCtbHDF5Attributes(H5::H5File *fd,
|
||||
H5::Group *group) {
|
||||
MasterAttributes::WriteHDF5Exptime(fd, group);
|
||||
MasterAttributes::WriteHDF5Period(fd, group);
|
||||
MasterAttributes::WriteHDF5AdcMask(fd, group);
|
||||
MasterAttributes::WriteHDF5AnalogFlag(fd, group);
|
||||
MasterAttributes::WriteHDF5AnalogSamples(fd, group);
|
||||
MasterAttributes::WriteHDF5DigitalFlag(fd, group);
|
||||
MasterAttributes::WriteHDF5DigitalSamples(fd, group);
|
||||
MasterAttributes::WriteHDF5DbitOffset(fd, group);
|
||||
MasterAttributes::WriteHDF5DbitList(fd, group);
|
||||
MasterAttributes::WriteHDF5TransceiverMask(fd, group);
|
||||
MasterAttributes::WriteHDF5TransceiverFlag(fd, group);
|
||||
MasterAttributes::WriteHDF5TransceiverSamples(fd, group);
|
||||
}
|
||||
#endif
|
||||
} // namespace sls
|
||||
|
@ -152,6 +152,12 @@ class MasterAttributes {
|
||||
#ifdef HDF5C
|
||||
void WriteCtbHDF5Attributes(H5::H5File *fd, H5::Group *group);
|
||||
#endif
|
||||
|
||||
void GetXilinxCtbBinaryAttributes(
|
||||
rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
|
||||
#ifdef HDF5C
|
||||
void WriteXilinxCtbHDF5Attributes(H5::H5File *fd, H5::Group *group);
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -22,14 +22,15 @@ namespace sls {
|
||||
#define HDF5_WRITER_VERSION (6.6) // 1 decimal places
|
||||
#define BINARY_WRITER_VERSION (7.2) // 1 decimal places
|
||||
|
||||
#define MAX_FRAMES_PER_FILE 20000
|
||||
#define SHORT_MAX_FRAMES_PER_FILE 100000
|
||||
#define EIGER_MAX_FRAMES_PER_FILE 10000
|
||||
#define JFRAU_MAX_FRAMES_PER_FILE 10000
|
||||
#define MOENCH_MAX_FRAMES_PER_FILE 100000
|
||||
#define CTB_MAX_FRAMES_PER_FILE 20000
|
||||
#define MYTHEN3_MAX_FRAMES_PER_FILE 10000
|
||||
#define GOTTHARD2_MAX_FRAMES_PER_FILE 20000
|
||||
#define MAX_FRAMES_PER_FILE 20000
|
||||
#define SHORT_MAX_FRAMES_PER_FILE 100000
|
||||
#define EIGER_MAX_FRAMES_PER_FILE 10000
|
||||
#define JFRAU_MAX_FRAMES_PER_FILE 10000
|
||||
#define MOENCH_MAX_FRAMES_PER_FILE 100000
|
||||
#define CTB_MAX_FRAMES_PER_FILE 20000
|
||||
#define XILINX_CTB_MAX_FRAMES_PER_FILE 20000
|
||||
#define MYTHEN3_MAX_FRAMES_PER_FILE 10000
|
||||
#define GOTTHARD2_MAX_FRAMES_PER_FILE 20000
|
||||
|
||||
#define STATISTIC_FRAMENUMBER_INFINITE (20000)
|
||||
|
||||
|
@ -292,6 +292,7 @@ enum detFuncs {
|
||||
F_SET_COLUMN,
|
||||
F_GET_PEDESTAL_MODE,
|
||||
F_SET_PEDESTAL_MODE,
|
||||
F_CONFIG_TRANSCEIVER,
|
||||
|
||||
NUM_DET_FUNCTIONS,
|
||||
RECEIVER_ENUM_START = 512, /**< detector function should not exceed this
|
||||
@ -691,6 +692,7 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_SET_COLUMN: return "F_SET_COLUMN";
|
||||
case F_GET_PEDESTAL_MODE: return "F_GET_PEDESTAL_MODE";
|
||||
case F_SET_PEDESTAL_MODE: return "F_SET_PEDESTAL_MODE";
|
||||
case F_CONFIG_TRANSCEIVER: return "F_CONFIG_TRANSCEIVER";
|
||||
|
||||
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
||||
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
||||
|
@ -20,6 +20,7 @@ Still this is better than strcpy and a buffer overflow...
|
||||
*/
|
||||
template <size_t array_size>
|
||||
void strcpy_safe(char (&destination)[array_size], const char *source) {
|
||||
assert(source != nullptr);
|
||||
assert(array_size > strlen(source));
|
||||
strncpy(destination, source, array_size - 1);
|
||||
destination[array_size - 1] = '\0';
|
||||
|
@ -4,11 +4,11 @@
|
||||
#define RELEASE "developer"
|
||||
#define APILIB "developer 0x230224"
|
||||
#define APIRECEIVER "developer 0x230224"
|
||||
#define APIXILINXCTB "developer 0x240104"
|
||||
#define APICTB "developer 0x240104"
|
||||
#define APIGOTTHARD "developer 0x240104"
|
||||
#define APIGOTTHARD2 "developer 0x240104"
|
||||
#define APIJUNGFRAU "developer 0x240104"
|
||||
#define APIMYTHEN3 "developer 0x240104"
|
||||
#define APIMOENCH "developer 0x240104"
|
||||
#define APIEIGER "developer 0x240104"
|
||||
#define APICTB "developer 0x240207"
|
||||
#define APIGOTTHARD "developer 0x240207"
|
||||
#define APIGOTTHARD2 "developer 0x240207"
|
||||
#define APIJUNGFRAU "developer 0x240207"
|
||||
#define APIMYTHEN3 "developer 0x240207"
|
||||
#define APIMOENCH "developer 0x240207"
|
||||
#define APIXILINXCTB "developer 0x240207"
|
||||
#define APIEIGER "developer 0x240207"
|
||||
|
@ -118,8 +118,10 @@ def loadConfig(name, rx_hostname, settingsdir):
|
||||
d.udp_srcip = d.udp_dstip
|
||||
else:
|
||||
d.udp_srcip = 'auto'
|
||||
if d.type == detectorType.JUNGFRAU or d.type == detectorType.MOENCH:
|
||||
if d.type == detectorType.JUNGFRAU or d.type == detectorType.MOENCH or d.type == detectorType.XILINX_CHIPTESTBOARD:
|
||||
d.powerchip = 1
|
||||
if d.type == detectorType.XILINX_CHIPTESTBOARD:
|
||||
d.configureTransceiver()
|
||||
except:
|
||||
Log(Fore.RED, 'Could not load config for ' + name)
|
||||
raise
|
||||
@ -174,6 +176,7 @@ if args.servers is None:
|
||||
'gotthard',
|
||||
'ctb',
|
||||
'moench',
|
||||
'xilinx_ctb'
|
||||
]
|
||||
else:
|
||||
servers = args.servers
|
||||
@ -218,7 +221,7 @@ with open(fname, 'w') as fp:
|
||||
startCmdTests(server, fp, file_results)
|
||||
cleanup(server)
|
||||
except:
|
||||
Log(log.RED, 'Exception caught. Cleaning up.')
|
||||
Log(Fore.RED, 'Exception caught. Cleaning up.')
|
||||
cleanup(server)
|
||||
sys.stdout = original_stdout
|
||||
sys.stderr = original_stderr
|
||||
|
Reference in New Issue
Block a user