Compare commits

..

433 Commits

Author SHA1 Message Date
dae88ad689 geometry and pixels =>tostring
All checks were successful
Build on RHEL9 / build (push) Successful in 3m33s
Build on RHEL8 / build (push) Successful in 4m48s
2025-06-13 14:28:10 +02:00
7c232cbd48 made all the string datatype size to 1024. was using size 256 even for sizes that could be longer 2025-06-13 14:23:15 +02:00
f4219ac879 roi to string and change hdf5 version 2025-06-13 14:09:28 +02:00
e54ffa9904 remove binary version from hdf5 file
All checks were successful
Build on RHEL9 / build (push) Successful in 2m50s
Build on RHEL8 / build (push) Successful in 4m46s
2025-06-13 13:08:14 +02:00
d174d9a2ec fix the master hdf5 file for m3. it used to fail because it could not set exptiem and gate delay arrays 2025-06-11 13:50:51 +02:00
c92830f854 updates files/variants for pmods for 9.2.0 (#1233)
All checks were successful
Build on RHEL9 / build (push) Successful in 3m59s
Build on RHEL8 / build (push) Successful in 4m56s
2025-06-02 15:16:39 +02:00
e77fd8d85d Dev/add numpy (#1227)
All checks were successful
Build on RHEL9 / build (push) Successful in 3m25s
Build on RHEL8 / build (push) Successful in 4m54s
* added numpy dependency
* added build specifications for python version and platform
2025-05-30 08:17:45 +02:00
cd0fb1b7bb Merge pull request #1224 from slsdetectorgroup/dev/920/doc
All checks were successful
Build on RHEL9 / build (push) Successful in 3m18s
Build on RHEL8 / build (push) Successful in 4m52s
Dev: documentaion for pip
2025-05-28 15:22:00 +02:00
50ab20317d updated documentation for pip installation as well 2025-05-28 10:25:07 +02:00
d0a946a919 Merge pull request #1209 from slsdetectorgroup/dev/automate_version_part2
All checks were successful
Build on RHEL9 / build (push) Successful in 2m49s
Build on RHEL8 / build (push) Successful in 4m50s
Dev/automate version part2
2025-05-27 10:17:17 +02:00
ed142aa34e added expat to host section 2025-05-27 09:10:03 +02:00
1227574590 Merge branch 'developer' into dev/automate_version_part2
All checks were successful
Build on RHEL9 / build (push) Successful in 3m15s
Build on RHEL8 / build (push) Successful in 4m56s
2025-05-26 11:08:42 +02:00
3ac7b579a0 formatted and updated versionAPI.h 2025-05-26 11:01:49 +02:00
feb1b0868e dummy commit for versionAPI 2025-05-26 09:13:45 +02:00
6d2f34ef1d adresses review comments 2025-05-23 11:41:56 +02:00
b36a5b9933 updating pmods
All checks were successful
Build on RHEL9 / build (push) Successful in 2m50s
Build on RHEL8 / build (push) Successful in 4m54s
2025-05-22 13:50:26 +02:00
d8ce5eabb8 and now with link
All checks were successful
Build on RHEL9 / build (push) Successful in 2m48s
Build on RHEL8 / build (push) Successful in 4m56s
2025-05-22 10:39:32 +02:00
ceecb0ca27 added extra fs link and fixed execute_program warning
Some checks failed
Build on RHEL9 / build (push) Successful in 2m52s
Build on RHEL8 / build (push) Failing after 4m51s
2025-05-22 10:20:16 +02:00
ac3670dcd2 Merge pull request #1215 from slsdetectorgroup/dev/doc_frame_sync
Dev//documentation for slsFrameSynchronizer
2025-05-22 08:43:53 +02:00
1c7bc61531 minor 2025-05-21 17:27:50 +02:00
58245a62a4 minor aesthetics 2025-05-21 17:06:08 +02:00
a464262558 typo 2025-05-21 16:47:15 +02:00
995d3e0034 rearranged receiver topics, differentiated btween receiver variants and added info about slsFrameSynchronizer 2025-05-21 16:47:07 +02:00
90d57cb6a9 Merge pull request #1214 from slsdetectorgroup/dev/fixStaticVector
Some checks failed
Build on RHEL9 / build (push) Successful in 3m18s
Build on RHEL8 / build (push) Failing after 4m48s
dev: rewrote end() for StaticVector
2025-05-21 16:34:49 +02:00
30eab42294 rewrote end() for StaticVector 2025-05-21 16:26:32 +02:00
1d0eeea7ee Merge pull request #1207 from slsdetectorgroup/fix_blackfin_read_access
Some checks failed
Build on RHEL9 / build (push) Successful in 2m58s
Build on RHEL8 / build (push) Failing after 4m51s
ctb: fix bug in blackfin read access to firmware registers
2025-05-19 16:18:24 +02:00
d7c012d306 formatting 2025-05-19 13:20:03 +02:00
1665937540 refactoring code and compiling binary 2025-05-19 13:19:32 +02:00
9343e3c667 merged developer
Some checks failed
Build on RHEL9 / build (push) Successful in 2m51s
Build on RHEL8 / build (push) Failing after 4m48s
2025-05-15 17:20:52 +02:00
b4c8fc1765 updated all makefiles 2025-05-15 17:08:27 +02:00
3ad4e01a5d updates api version based on version file & converted shell script files to python 2025-05-15 16:35:09 +02:00
015b4add65 Merge pull request #1206 from slsdetectorgroup/dev/fix_frame_sync
Some checks failed
Build on RHEL9 / build (push) Successful in 2m48s
Build on RHEL8 / build (push) Failing after 4m54s
dev/fix_frame_sync
2025-05-12 01:00:08 +02:00
9051dae787 fix bug in blackfin read access to firmware registers 2025-05-08 15:40:13 +02:00
68bdd75c9c moving the erasure of the fnum to after sending the zmg packets and also deleteing all old frames when end of acquisition 2025-05-07 16:33:50 +02:00
a53873b695 typo 2025-05-07 16:04:12 +02:00
77a39b4ef2 minor 2025-05-07 15:58:28 +02:00
64be8b1e89 better error messageS 2025-05-07 15:56:41 +02:00
68bd9fb4f7 frame synchonrizer fixes: typo of iterator for loop and zmg_msg_t list cleaned up before sending multi part zmq; test written for the frame synchronizer, test_simulator.py rewritten for more robustness and refactoring commonality between both scripts 2025-05-07 15:44:32 +02:00
0d5d851585 Merge pull request #1199 from slsdetectorgroup/dev/test_all_acquire_file
Some checks failed
Build on RHEL9 / build (push) Successful in 4m0s
Build on RHEL8 / build (push) Failing after 4m45s
Dev/test all acquire file
2025-05-02 16:17:59 +02:00
eb3d51d20c removed -9 to kill with cleanup
Some checks failed
Build on RHEL9 / build (push) Successful in 4m4s
Build on RHEL8 / build (push) Failing after 4m46s
2025-05-02 15:40:10 +02:00
9f4298ac15 check if process running for kill -9 slsReceiver fail 2025-05-02 13:55:44 +02:00
fb79ba768c fixed bug found by @AliceMazzoleni99 that for ctb server is still shown in pgrep -f if xilinx server running, so now the pid is killed and looking for any DetectorServer_virtual instead. also reset color coding after Log 2025-05-02 11:30:08 +02:00
7bc48e3111 fix for slsreceiver killed but complaining for virtual tests with script
Some checks failed
Build on RHEL8 / build (push) Failing after 3m0s
Build on RHEL9 / build (push) Successful in 4m58s
2025-05-01 16:55:09 +02:00
53b90d92d7 typo 2025-05-01 16:46:23 +02:00
fb6ef8b818 alloweing all tests 2025-05-01 16:43:00 +02:00
8bb9de0de1 Merge branch 'developer' into dev/test_all_acquire_file 2025-05-01 16:42:39 +02:00
451b50dfed fix for xilinx ctb virtual 2025-05-01 16:42:11 +02:00
22f2662e3b trying to fix acquire for xilinx 2025-05-01 16:19:25 +02:00
ce3f555c08 Merge pull request #1202 from slsdetectorgroup/dev/fix/reorder_only_if_digitalmode
All checks were successful
Build on RHEL8 / build (push) Successful in 4m37s
Build on RHEL9 / build (push) Successful in 5m5s
only reorder bits if some sort of digital readout mode enabled
2025-05-01 16:01:01 +02:00
dedab6010d only reorder bits if some sort of digital readout mode enabled 2025-05-01 15:53:37 +02:00
62a5fda33f fixed ctb tests, need to fix in develoepr (if digital modfe not enabled, should not take into accoutn dbitlist or dbitoffset or dbitreorder 2025-05-01 15:45:14 +02:00
5073769403 fixed hardcoded values of nchip nchan etc from detPArameters 2025-05-01 12:41:05 +02:00
aabec193ff fix 10g adc enable mask, switched with 1g 2025-05-01 12:10:33 +02:00
d4a1044fce incorrect counter mask tested 2025-05-01 12:08:29 +02:00
dca0edcfcc removed minor printout 2025-05-01 11:28:19 +02:00
5a24a79bf7 typo fixed 2025-05-01 11:26:38 +02:00
91f9c4fa83 minor printout removed 2025-05-01 11:25:34 +02:00
3940d6f56e Merge branch 'developer' into dev/test_all_acquire_file
Some checks failed
Build on RHEL8 / build (push) Failing after 4m48s
Build on RHEL9 / build (push) Successful in 5m10s
2025-04-30 15:00:41 +02:00
f09879a46c added tests to check file size and frames caught with an acquire (virtual) for every detector 2025-04-30 15:00:00 +02:00
1b0e891912 Merge pull request #1200 from slsdetectorgroup/fix/dbitreorder_should_only_be_defined_for_chip_and_xilinx
All checks were successful
Build on RHEL8 / build (push) Successful in 4m38s
Build on RHEL9 / build (push) Successful in 5m26s
Fix/dbitreorder should only be defined for chip and xilinx
2025-04-30 13:38:19 +02:00
292d65491a Merge branch 'developer' into fix/dbitreorder_should_only_be_defined_for_chip_and_xilinx 2025-04-30 12:17:46 +02:00
36faec6ad3 removed log as error already printed 2025-04-30 12:17:16 +02:00
062002243e added error message on receiver side, throw error 2025-04-30 10:54:34 +02:00
98b1e287a4 moved dbitoffset, dbitreorder and dbitlist to GeneralData
All checks were successful
Build on RHEL9 / build (push) Successful in 3m25s
Build on RHEL8 / build (push) Successful in 4m48s
2025-04-30 09:08:07 +02:00
adf0124ea3 rough draft of test acquire of all detectors for frames caught and file size. ctb not included yet 2025-04-29 17:35:55 +02:00
e1f46d4747 Merge pull request #1193 from slsdetectorgroup/dev/automate_version_number
All checks were successful
Build on RHEL9 / build (push) Successful in 4m4s
Build on RHEL8 / build (push) Successful in 4m46s
Dev/automate version number
2025-04-29 12:01:06 +02:00
d8c3fa0df3 Merge branch 'dev/automate_version_number' of github.com:slsdetectorgroup/slsDetectorPackage into dev/automate_version_number 2025-04-29 11:15:56 +02:00
27530fca31 version now supports . before postfix 2025-04-29 11:14:52 +02:00
cc7f13a10e Merge branch 'developer' into dev/automate_version_number
All checks were successful
Build on RHEL9 / build (push) Successful in 3m35s
Build on RHEL8 / build (push) Successful in 5m3s
2025-04-25 13:49:33 +02:00
625f4353fb Dev/gitea docker (#1194)
All checks were successful
Build on RHEL9 / build (push) Successful in 3m36s
Build on RHEL8 / build (push) Successful in 5m3s
* gitea workflows for RH8 and RH9
* using our docker images
2025-04-25 12:04:45 +02:00
2815913d10 added regex pattern matching to version in toml file 2025-04-25 10:48:16 +02:00
5fa2402ec5 Dev/allow localhost for virtual tests (#1190)
* remove the check for localhost being used in rx_hostname for python test for simulators, run rx_arping test only if hostname is not 'localhost'

* fix tests for fpath: cannot set back to empty anymore (empty is default)

* default rx_hostname arg = localhost, and default settings path =../../settingsdir

* changed virtual tests script for better printout on exceptions

* fix for catching generaltests exceptions and exiting instead of continuing

* fix minor

* fixed shared memeory tests to include current env and fixed prints for errors

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2025-04-25 10:14:15 +02:00
4d7d3c9138 upgrading to c++17 from c++11 and patch command has to be found before applying patch on libzmq (#1195) 2025-04-25 09:09:49 +02:00
c3f1d05033 bug did not support version 0.0.0
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 3s
2025-04-24 09:16:32 +02:00
0e4cb7cbcd normalized version to PEP 440 specification in update_version.py 2025-04-24 08:45:18 +02:00
bace9edf89 updatet regex pattern to support postfix
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 3s
2025-04-23 17:09:06 +02:00
99735c3ee5 got typo in github workflow
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 3s
2025-04-23 14:46:12 +02:00
2571397c70 saving changes in git workflow failed 2025-04-23 14:38:51 +02:00
497c3abfc2 managed to load VERSION file in yaml file - simplifies things 2025-04-23 14:26:26 +02:00
fca31cc432 updated github workflow scripts to support automatic version numbering with environment variable
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 24s
2025-04-22 17:05:06 +02:00
8fe4a78feb mistakenly set version back to 0.0.0 2025-04-22 15:43:01 +02:00
ee170fa2e0 Merge branch 'developer' into dev/automate_version_number 2025-04-22 14:06:22 +02:00
da760b2b93 version number automated for python build 2025-04-22 14:00:45 +02:00
2c8c2a46ea Merge pull request #1159 from slsdetectorgroup/dev/issue_dont_reorder_digital_data
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 11s
Dev/issue dont reorder digital data
2025-04-11 14:48:02 +02:00
9625a8058c Merge branch 'developer' into dev/issue_dont_reorder_digital_data 2025-04-11 14:30:11 +02:00
4d8bdae836 updated update_image_size in xilinx 2025-04-11 12:38:28 +02:00
3297707ab7 clang-format with clang-format version 17 2025-04-11 11:38:56 +02:00
598154645c changed font size in GUI 2025-04-11 11:03:52 +02:00
9d8f9a9ba9 autogenerated commands and make format 2025-04-11 10:45:02 +02:00
68f163b757 Merge pull request #1186 from slsdetectorgroup/dev/911/fix_m3_trimbits_badchannels
dev: m3: fix trimbits and badchannels
2025-04-11 10:40:46 +02:00
b8c5bb2045 Merge branch 'developer' into dev/911/fix_m3_trimbits_badchannels 2025-04-11 10:39:37 +02:00
b45df191e5 Merge pull request #1189 from slsdetectorgroup/dev/911/slsmultireceiver_verbose_size
dev: multi receiver: verbose option
2025-04-11 10:38:44 +02:00
01cc745787 update the comment about how to modify data on a data call back from the receiver 2025-04-11 10:38:17 +02:00
f9bc2eb126 removed Gotthard stuff 2025-04-11 10:32:31 +02:00
4c86ad3198 added sanity check to only enable for chipttestboard and xilinx 2025-04-11 10:27:26 +02:00
5be0724f82 got rid of Reorder function 2025-04-10 17:52:16 +02:00
7c652498e4 got rid of cast to uint64 2025-04-10 17:34:39 +02:00
721d536350 fixed warnings
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 13s
2025-04-10 13:31:47 +02:00
361437428d commenting out the example in receiver data call back changing size as it affects users using debugging mode to print out headers 2025-04-10 13:13:23 +02:00
aadbfeaf2d Merge branch 'developer' into dev/issue_dont_reorder_digital_data 2025-04-10 12:16:29 +02:00
f119d14e7c added check for proper memory allocation 2025-04-10 11:29:01 +02:00
f8b12201f8 binary in 2025-04-09 18:21:54 +02:00
585c92be66 Merge branch 'developer' into dev/911/fix_m3_trimbits_badchannels 2025-04-09 18:21:19 +02:00
7c8639b8ae formatting
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 12s
2025-04-09 18:20:58 +02:00
a138b5b365 m3 server fix for trimbits and badchannels that are shifted by 1 2025-04-09 18:10:01 +02:00
9fde62ae30 merged developer into feature and solved merge conflicts 2025-04-09 09:39:47 +02:00
29fe988583 imagedata is now allocated on the heap 2025-04-09 09:31:38 +02:00
6740d9b363 alignedData now uses std::align_alloc 2025-04-09 09:20:05 +02:00
1d1b55b864 changed documentation 2025-04-08 15:57:11 +02:00
c32732b22e Merge pull request #1177 from slsdetectorgroup/pattern_docu
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 14s
Pattern documentation
2025-04-08 11:29:20 +02:00
1e6b6fef0a Merge branch 'developer' into pattern_docu 2025-04-08 10:46:14 +02:00
5ab2c1693e Fixed broken import in typecaster.h (#1181)
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 28s
- Fixed the broken import _slsdet --> slsdet._slsdet caused by a previous upgrade
- Added tests that exercises the conversion from python to C++ and from C++ to python
- Python unit tests now run in CI (!)
2025-04-03 12:00:57 +02:00
0b3cd499a8 Dhanya's comments
Some checks failed
CMake / Configure and build using cmake (push) Failing after 11s
2025-04-02 10:18:57 +02:00
884e17f0c4 Merge pull request #1164 from slsdetectorgroup/dev/scikitbuild
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 10s
Dev/scikitbuild
2025-04-01 17:27:10 +02:00
d0ccf236c0 added sync, renamed action 2025-04-01 17:20:35 +02:00
396b955db7 Merge branch 'dev/scikitbuild' of github.com:slsdetectorgroup/slsDetectorPackage into dev/scikitbuild 2025-04-01 16:58:14 +02:00
5f14eb32aa added sls_detector bin 2025-04-01 16:57:47 +02:00
cfec7c18ec Merge branch 'developer' into dev/scikitbuild 2025-04-01 14:38:06 +02:00
04583acb21 reverted to scikit-build in pyproject.toml 2025-04-01 14:17:07 +02:00
95e11d668a switched patch tool
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 9s
2025-03-28 18:26:45 +01:00
772e58c743 Merge pull request #1179 from slsdetectorgroup/dev/pmod_910
Some checks failed
CMake / Configure and build using cmake (push) Failing after 9s
adding pmodules for 9.1.0 rhl8
2025-03-28 17:20:28 +01:00
470e2633c3 adding pmodules for 9.1.0 rhl8 2025-03-28 16:32:37 +01:00
3312adddd1 removed compiler version
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 9s
2025-03-28 15:43:09 +01:00
46152d2419 added mythen3 pattern word table
Some checks failed
CMake / Configure and build using cmake (push) Failing after 9s
2025-03-28 09:35:25 +01:00
b5c82783d6 patching libzmq and cleaned up cmake
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 9s
2025-03-28 09:26:55 +01:00
dc85a48864 update xilinxCtb pattern bit mapping
Some checks failed
CMake / Configure and build using cmake (push) Failing after 9s
2025-03-27 18:03:02 +01:00
dc8a34592a started pattern docu 2025-03-27 17:03:36 +01:00
96ae1a1cca found bug needed to refresh member variables
Some checks failed
CMake / Configure and build using cmake (push) Failing after 9s
2025-03-20 16:47:42 +01:00
3793e7b7d4 solved merge conflict 2025-03-20 16:16:35 +01:00
713e4f6822 added dbitreorder flag to chip test board gui 2025-03-20 16:12:01 +01:00
fada23365e added workflow for python lib
Some checks failed
Native CMake Build / Configure and build using cmake (push) Failing after 8s
2025-03-20 13:56:46 +01:00
6dd0a5b0dd added zlib 2025-03-20 13:39:51 +01:00
c3b197f209 removed conda build pin 2025-03-20 13:28:46 +01:00
9f49ac6457 fixed typo 2025-03-20 13:12:42 +01:00
0b3ead6353 conda build of main library 2025-03-20 13:10:27 +01:00
8b3625fc01 added dbitreorder flag to chip test board gui
Some checks failed
CMake / Configure and build using cmake (push) Failing after 7s
2025-03-20 11:00:40 +01:00
0da508a8b7 added back some python versions
Some checks failed
CMake / Configure and build using cmake (push) Failing after 9s
2025-03-19 22:05:19 +01:00
608eb1a436 cleaned meta yaml 2025-03-19 22:03:22 +01:00
c0bc6fe25a Merge branch 'dev/scikitbuild' of github.com:slsdetectorgroup/slsDetectorPackage into dev/scikitbuild 2025-03-19 22:00:00 +01:00
a0d540fd72 restored comments, cleanup 2025-03-19 21:59:30 +01:00
46a46b65e5 Merge branch 'developer' into dev/scikitbuild 2025-03-19 21:53:29 +01:00
4f62b1a05c separated the recipes 2025-03-19 21:49:12 +01:00
45dadf8b90 Merge pull request #1163 from slsdetectorgroup/dev/fix_tests_real_g2
Some checks failed
CMake / Configure and build using cmake (push) Failing after 8s
dev: fixed tests for real gotthard2. change in reg address to test
2025-03-19 17:16:00 +01:00
e8e84a4e72 fixed tests for real gotthard2. change in reg address to test 2025-03-19 17:12:21 +01:00
2f390971e6 WI{ 2025-03-19 16:37:37 +01:00
b7e17d1320 added reorder to documentation, added flag to master binary and hdf5 file
Some checks failed
CMake / Configure and build using cmake (push) Failing after 11s
2025-03-19 11:51:28 +01:00
c54b1cb6af clang format 2025-03-19 08:37:07 +01:00
ddb89bce34 Merge branch 'dev/issue_dont_reorder_digital_data' of github.com:slsdetectorgroup/slsDetectorPackage into dev/issue_dont_reorder_digital_data 2025-03-19 08:24:33 +01:00
f056f9d31b reserved enough size in the fifo buffer to reorder all added proper 4 byte alignment 2025-03-18 21:42:34 +01:00
d9a50ad9f4 WIP 2025-03-18 13:21:46 +01:00
ce0450d498 Merge pull request #1158 from slsdetectorgroup/dev/jf_timing_decoder_only_hw2.0
Some checks failed
CMake / Configure and build using cmake (push) Failing after 10s
get timin g info decoder not supported for jf 2.0
2025-03-18 12:35:23 +01:00
7b531059a0 even get is not supported for timing info decoder for jungfrau hw v1.0. only hw v2.0 is uspported 2025-03-18 12:33:07 +01:00
bc187bb198 moved compiled extension into slsdet 2025-03-18 10:56:03 +01:00
eb8c34f53b skeleton pyproject.toml 2025-03-18 10:33:51 +01:00
d9a50705e4 Merge pull request #1148 from slsdetectorgroup/dev/cmd_for_ctb_reorder
Some checks failed
CMake / Configure and build using cmake (push) Failing after 1m19s
Dev/cmd for ctb reorder
2025-03-17 17:10:52 +01:00
f4626c2c81 fix tests from merge 2025-03-17 15:45:59 +01:00
e0a48e1e75 implemented proper alignment in reorder function before casting to uint64_t ptr 2025-03-17 15:39:31 +01:00
ec4eb1978e merge fix from dev/issue_dont_reorder_digital_data 2025-03-17 15:28:22 +01:00
842b376801 fixed rx_dbitreorder cmd line tests 2025-03-17 15:23:02 +01:00
13b2cada66 ctb reorder default being true in dataprocessor 2025-03-17 15:20:40 +01:00
3c2f149c22 Adding patterntools to slsdet (#1142)
* added patterntools from mythen3tools
* refactored do use implementation from slsSupportLib
2025-03-17 08:46:26 +01:00
0a5b5aac4b added unit tests for dataprocessor rearranging functions 2025-03-14 14:04:55 +01:00
6e5b058fc1 merge fix 2025-03-13 13:17:54 +01:00
ace2b3a938 Merge branch 'dev/issue_dont_reorder_digital_data' into dev/cmd_for_ctb_reorder 2025-03-13 13:16:29 +01:00
5a8213024e Merge pull request #1145 from slsdetectorgroup/dev/xilinx_ctb_api
add xilinx ctb api to --versions command
2025-03-13 13:15:04 +01:00
bd66228b30 minor to check workflow 2025-03-13 11:14:01 +01:00
e1c9754cd2 Added test for rx_dbitreorder command 2025-03-12 17:31:37 +01:00
ff101e19cd added pybind for it 2025-03-12 17:31:33 +01:00
e8ac048114 ctb: added command 'rx_dbitreorder' that sets a flag in the receiver to set the reorder flag. By default it is 1. Setting to false means 'do not reorder' and to keep what the board spits out, which is that all signals in a sample are grouped together 2025-03-12 17:31:20 +01:00
3c79e8d7b2 trailing bits are removed even if reorder false and bitlist empty 2025-03-12 16:38:18 +01:00
a74fb2bcd1 added function Reorder 2025-03-12 16:12:00 +01:00
63bb79d727 added first rather generic test for Rearrange Function, could be changed to a parametrized test 2025-03-12 10:51:18 +01:00
8d87a6ee4e used clang-formating 2025-03-11 16:32:31 +01:00
ab01940769 add xilinx ctb api to --versions command 2025-03-11 15:51:46 +01:00
23aa9c2814 added reorder variable, changed function ArrangeDBitData to support reordering and no reordering. Moved transceiver data such that it is contiguous with rearranged digital data 2025-03-11 12:07:10 +01:00
010f736e80 Merge pull request #1141 from slsdetectorgroup/dev/jf_firmware_dates_1.6_2.6
Dev/jf firmware dates 1.6 2.6
2025-03-11 09:35:39 +01:00
4dcbcad435 jungfrau server binary for fw 1.6 and 2.6 2025-03-11 09:34:37 +01:00
8f8a92b9c5 jungfrau firmware dates for fw v 1.6 and fw2.6 2025-03-11 09:32:44 +01:00
684eee984d removed CMakeFiles folder. mistakenly added to repo (#1137) 2025-03-10 14:27:08 +01:00
297c3752e3 Dev/remove gotthard i (#1108)
* slsSupportLib done, at receiver rooting out in implementation

* removed from receiver and client

* removed everywhere except gui, python and client(commands.yaml and Detector.h)

* updated python

* fixed autocomplete to print what the issue is if there is one with ToString when running the autocomplete script to generate fixed.json. updated readme.md in generator folder

* formatting

* removed enums for dacs

* udpating autocomplete and generating commands

* removed gotthard from docs and release notes

* removed dac test

* bug from removing g1

* fixed virtual test for xilinx, was minor. so in this PR

* gui done

* binary in merge fix

* formatting and removing enums

* updated fixed and dump.json

* bash autocomplete

* updated doc on command line generation

* removing increments in dac enums for backward compatibility. Not required

* removed ROI from rxParameters  (only in g1), not needed to be backward compatible

* removed the phase shift option from det server staruip
2025-03-10 14:24:33 +01:00
fa504e6675 default filepath is now an empty string, SetupWriter will throw an error if path not set (#1133)
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2025-03-10 12:00:22 +01:00
b9b4f1ae35 changed line 66 in docs/conf.py.in to app.add_css_file(filename) (#1131)
Co-authored-by: AliceMazzoleni99 <l_mazzol_a@pc17378.psi.ch>
2025-03-06 14:42:17 +01:00
3c2062f23e Dev/m3 default period 0 (#1127)
* m3: default period 0, merge fix from 9.1.0

* from previous commit
2025-03-04 16:07:28 +01:00
e7247f1fee formatting 2025-03-04 10:48:13 +01:00
905a509a17 update xilinx regs (#1123)
Co-authored-by: Martin Mueller <martin.mueller@psi.ch>
2025-03-04 10:38:14 +01:00
b4dc1dde6c patternX to pattern (#1120)
* pattern is not an issue for yaml. changing patternX to pattern everywhere

* added patternX to deprecated
2025-02-27 10:42:21 +01:00
964ab19b42 Dev/multi id ignored in config (#1115)
* warn that the multi id is ignored in config file? or throw?

* throw and not just warn with printouts as that could be silent as well

* throw for any multi id command in the file.
2025-02-27 10:41:17 +01:00
ce8911de10 when creating the python bindings for Detector class, it should ignore the assignment operators (#1107) 2025-02-26 12:21:06 +01:00
d1e5b0bc42 Dev: udpated help on multi module and multi command help (#1119)
* udpated help on multi module and multi command help

* fixed issues with empty lines and other syntax with docuemntation

* fixed some warningsin documentation

* some changes to documentation about command line usage

* minor
2025-02-26 11:14:15 +01:00
4b3ed22f76 jf binary in, jf: removed check to allow chipv1.0 also to set comp disable time (#1118) 2025-02-24 09:39:19 +01:00
aad1ab0cf4 file from Anna: could be reduce print out in zmq processing when using energy threshold (#1113) 2025-02-21 12:49:33 +01:00
117637863d Xilinxctb/update reg (#1084)
* updated RegisterDefs.h from firmware update

* Revert "updated RegisterDefs.h from firmware update"

This reverts commit 64f1b2546e.

* updated registers and had it formatted

* Revert "updated registers and had it formatted"

This reverts commit 1641b705b0.

* udpated registers from firmware, reading config file in server (chip config, reset chip, enable_clock_pattern) specific for matterhorn,this is done when powering on chip, removed startreadout, fixed status register bits, updated firmware version

* fix for patioctrl allowed for zxilinx and adding readout pattern for scientists that like to push the acquire button

* fixing default enable clock and readout pattern for xilinx (patioctrl has to be 32 bit)

* Xilinxctb/first image (#1094)

* reduce xilinxCTB readout done checks to single register, increased clockEna pattern limits, clear FPGA FiFos and counters on powerchip, disable counters 1-3 in matterhorn configuration

* change print of xilinxctb server

* remove acquisition done check

---------

Co-authored-by: Martin Mueller <martin.mueller@psi.ch>

* binary xilinx in

* formatting

* added reset of udp buffer FIFO to xilinxCTB

---------

Co-authored-by: Martin Mueller <72937414+mmarti04@users.noreply.github.com>
Co-authored-by: Martin Mueller <martin.mueller@psi.ch>
2025-02-18 11:30:51 +01:00
e933a25453 Dev/frame synchronizer (#968)
* skeleton of structure for callbacks and funcitons updated

* updated callback header structures and implemented in receiver

* fixed bugs

* minor

* formatting

* wip: draft of frame synchronizer, semaphores not done yet

* signal handler not affecting semaphore inside lambda function

* finally works with sem

* install targets cmake error fix

* removed modified callback and instead passing by reference instead of value to the oriignal receiver data callback

* reducing the number of data call backs. incoming from developer

* added json header to receiver start acquiistion call back

* WIP: of synchronisation (#969)

* WIP of synchronisation

* working so far if everything goes right

* added all information into json headers

* valid json

* allow frame synchronizer to have access to static libzmq when compiling on conda (libzeromq-devel not installed by default

* upto date with multirecieverapp for invalid arguments and help

* formatting

* remove warnings

* changes to print

* removed prints

* no need for print frames to be called

* minor

* commnet

* adding json header in start callback, imagesize in data callback and formatted

* startcallback returns an unused int (changed to exceptions and forgotten in last modification to callbacks likely)

* fixed sanitizer issues. 1 left for ctrl+C
- zmq_msg_t should be deleted, not freed. Same with the char arrays and semaphores.

* fixed sanitizer issues and made it more readable

* moving clearing old frames to new startacq just in case it has to process soem frames before the callback

* fix cherry-pick merge of fixing sanitizer thread issues but has start callbacks signature change.fixed

---------

Co-authored-by: Felix Engelmann <felix-github@nlogn.org>
2025-02-18 11:28:21 +01:00
f1f369b48c dev jf : bunch id decoder and auto comp disable (#1097)
* jf wip: bunch id decoder only in pcb v2.0 check and comments

* auto comp disable the same way for both chip versions. compdisabletime also available for 1.1 now

* fixed tests

* formatting

* binary in
2025-02-18 11:17:38 +01:00
6b149244d3 added documentation of order in hostname command in quick start guide, udp header format for row and column values and in command line hostname (#1099) 2025-02-18 11:11:33 +01:00
436d180e93 dont usleep if no transmission delay (#1101) 2025-02-18 11:10:06 +01:00
c43a4030a5 removed .str().c_str() (#1090) 2025-02-11 09:14:56 +01:00
6e826d2840 Pyctbgui/taborder pattern (#1082)
* tab order for pattern tab
2025-01-31 17:05:58 +01:00
315d49f8df ctb: patwaittime and exptime (#1076)
* cli: patwaittime also takes time argument, api: patwaitclocks and patwaitinterval, tcp: patwaitinterval is 2 functions for set and get, patwaitclocks remains a single for backward compatibility with -1 for get, server (loadpattern): clks using member names (needs to be refactored). needs tobe discussed what to do with pattern files.

* all tests passed

* fixed test 
* exptime deprecated for ctb and xilinx

* pyctbgui..not there yet

* fixed in pyctbgui

* removed redundant warning for ctb and xilinx exptime in Detector class (already in module class handling all exptime signatures), patwait, patloop and patnloop have to be non inferrable commands because of support for old commands (level as suffix)

* fix formatting error from command line parsing

* fix tests for patwaittime
2025-01-31 16:48:32 +01:00
e92578f89d formatting 2025-01-31 12:27:35 +01:00
0e45ae189d allowing pyctbgui to work for xilinx ctb (#1079)
* allowing pyctbgui to work for xilinx ctb

* slowadc and adc enable (only 10g) allowed for xilinx ctb
2025-01-31 12:24:05 +01:00
e6e260d8ca remove cross-compiler option in the case of compiling the detector server on the detector module CPU (#1078)
Co-authored-by: Martin Mueller <martin.mueller@psi.ch>
2025-01-30 09:44:36 +01:00
fcc9b6ad54 added sls_detector_acquire_zmq binary in conda (#1074) 2025-01-14 15:43:11 +01:00
0771461c01 CLI: added empty dbit list option 'none' (#1069)
* cli: added 'none' to the rx_dbitlist command to be able to set the dbit list to an empty list
2025-01-13 16:46:01 +01:00
ed6686d4a7 Dev/workflow build fix png and tiff (#1071)
* installing png on github workflow actions for the build fail on github due to latest ubuntu

* installing tiff on github workflow
2025-01-13 16:07:34 +01:00
ec3d3e38a6 minor to test 2025-01-13 14:44:28 +01:00
e47d3d4d15 documentation for moenchzmq conda 2024-12-05 10:50:52 +01:00
f9dbffcb6e documentation: added moenchzmq conda info in installation page (#1066) 2024-12-05 10:39:43 +01:00
e83527adee ctb: make patternX path autocomplete (#1065) 2024-11-29 15:02:29 +01:00
dee86c63eb back to getting version for conda from tag (#1060) 2024-11-26 14:35:38 +01:00
ce41e8aa34 adding pmodules variant for 9.0.0_rh8 2024-11-26 11:41:16 +01:00
7e2c8a37dc Dev/900/docs (#1057)
* minimum python is 3.8, so >=

* removed ctb frame documentation. should be in internal wiki

* minor doc change
2024-11-26 10:48:58 +01:00
aeb59364c5 dev: pybind 2.13.6 and python 3.8 (#1055)
* changed pybind 2.13.0 to 2.13.6, kept conda at min 2.13.0

* changed min python version from 3.6 to 3.8
2024-11-25 15:01:18 +01:00
1f16f84fed dev cmake_source_dir (#1052)
* when package used as subdirectory (cmake-subfolder-example) it fails when python is used because the cmake_source_dir is now the one above package.

* changed cmake_current_list_dir to cmake_current_source_dir

* removing the unnecessary VERSION file installed in the root directory (from PR #1020)
2024-11-25 14:55:22 +01:00
0123169e35 dev/ bumped pybind11 version and added setuptools on host (#1049)
* bumped pybind11 version and added setuptools on host

* updated pybind11 tarball to 2.13 and in cmakefile to get 2.13 frpm github, also updated documentation about pybind 2.13

* updated client versioing, doc

* updating readme

---------

Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2024-11-22 14:32:39 +01:00
ffd7cd1070 fix cmake (cannot find VERSION file) when using package as subfolder as cmake_source_dir is not same anymore, add troubleshooting doc for m3 regarding loose control board for waiting status in auto timing mode, fix m3 tests to test register write (previously was read only) (#1048) 2024-11-21 16:44:09 +01:00
c6c7632ef7 updated m3 fw version (#1045) 2024-11-21 12:18:59 +01:00
b79759bcff formatting 2024-11-21 11:09:38 +01:00
d9e8e1c1c2 dev: version from file to cmake and python (#1025)
- renamed conda-recipe folder
- added a check to see if build and install folder exists in build.sh (conda recipe)
- created VERSION file that has '0.0.0'for developer but can be updated using update_version.py that takes in a version. The script checks for semantic versioning and updates VERSION file
- VERSION file also copied along with py files to slsdet in python cmakelist and build_pylib.sh (for conda), also copied in root folder for installations (for no coding purpose)
- init.py and setup.py reads this file to get the version (a bit differently to find the VERSION file)
- VERSION file read into cmake to get the version and also added to compile definition. So RELEASE removed from versionAPI.h (using SLS_DET_VERSION compile definiton instead) and also removed updateRelease script.
- conda getting project version from environment variable SLS_DET_VERSION that is set in build_pylib.sh prior.
- added 3.13 python to conda build
- anything related to ctb removed from release notes as users will always use developer
- sets 0.0.0 to VERSION file by running update_version.py without an argument
2024-11-21 10:46:20 +01:00
c57e835a41 dev: fixed invalid arguments to slsmultireceiver (#1040)
* wasnt showing error message for invalid arguments to slsmultireceiver

* allow 0 arguments to act like an slsReceiver with start tcp port 1954 and just 1 receiver
2024-11-21 10:40:03 +01:00
b3d9af29fc Dev/jungfrau temp control default enable (#1042)
* jungfrau: enabling temp control by default at server startup
2024-11-21 10:28:41 +01:00
4829429abd dev: legal gain values in jungfrau simulator (#1044)
* legal gain values in jungfrau simulator

* typo
2024-11-20 16:59:28 +01:00
f1ffc6057a fixed cli documentation (#1038) 2024-11-20 11:14:50 +01:00
8f51215cb3 fixed typo in python for vb_pixbuf Jungfrau dac (#1031) 2024-11-18 09:54:05 +01:00
7b21ce34d6 Dev/document json ctb file format (#1029)
* docs receiver formats rewrite

* added documentation for all the receiver files, updated release notes, udpated help in commands help for timing, fixed by throwing exception for aa dividy by 0 error caused by not freeing memory (detsize) when switching between 1d and 2d detectors, removed unnecessary 'recevier up' printout, fixed dbit list 64 bit mask error in master json file (was not 64 bit before), fixed bug in reading gotthard1 data (needs to be tested)

* generating commands help and formatting, also fix help for trimen command line

* added ctb frame format documentation, added some links to some commands, added documentation about adding expat-devel in installation for rhel8 gui, fixed some indentation issues that screwed up command line help documentation

* added ctb frame format documentation

* updated documentation about zeromq-devel for <8.0.0 versions
2024-11-18 09:52:24 +01:00
e1497f9cb9 Dev/server malloc check (#1023)
* usleep in communication to actually relay the err message of memory allocation to the client (weird but test for now), function in server to handle memory allcoation issues (updates mess, ret and sendsit to the client and returns prior from function implementatin, setting fnum in client for the speicific functions that send to detector each argument separtely, they need to remember the fnum else they throw with the incorrect fnum
* server: every malloc must check if it succeeded, rearranging so that the free is clear as well (only in funcs so far)
* fixed malloc checks in other places other than funcs.c
2024-11-18 09:46:21 +01:00
5088e5a205 Dev/detach pthreads not joining (#1019)
* detach the pthreads that are not joining else memory leak

* removed the clean up comment, also refactored the pthread join/detach for ctb 1g
2024-11-07 11:24:46 +01:00
06266f3905 gui: hide 'complete image' and just show 'missing packets' when there are missing packets in that image form the receiver (#1014) 2024-10-28 09:39:40 +01:00
5f805f8789 Dev/jf firmware rollback (#1011)
* jf: rolling back firmware required to v1.5 and 2.5, updated release notes, fixed a bug when updating server (when server name same as link name:throws with no message, pedestal mode check changed for the time being for loops to be 0xFF size

* compensating for jf fw bug for pedestalmode where loops should be 16 bit, but is 8 bit in fw. to be fixed in next version

* formatting

* formatting, merge fix

* fixed python test simulator to kill previous servers

* rmeoved merge binary
2024-10-24 15:53:49 +02:00
60868ae74e Dev/rm volatile (#1007)
* Removing volatile and replacing with atomic to ensure atomicity

* compiling header include issue
2024-10-23 12:39:03 +02:00
37e65634d4 Dev/g2 fix configure chip startup (#1009)
* g2: chip reconfigure variable not set when powering on at startup because readconfig is the one configuring the chip the first time to default chip settings

* cleaning up code
2024-10-22 17:19:28 +02:00
6fcdba56a4 Dev/document autocomplete (#1004)
* fixed the gendoc to reflect the new parser, updated documentation to include info about autocomplete in the command line part, error in createing docs

* fixed list deprecated, fixed command help (to show properly on a html, fixed other help warnings

* minor indents

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2024-10-21 16:39:50 +02:00
0b9fd0664e setting detsize after hostname should throw also for single module for consistency (#1000)
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2024-10-21 16:33:13 +02:00
6add9aad5d Dev/proper free (#1005)
* first draft of fixing the free function available within the class

* removed class member function freeSharedmemory for both Detector and Module; made the free function freeSharedmemory accessible to python interface; setHostname if there is already a module in shm will recreate the Detector object while freeing shm completely and keeping detsize and intitialchecks (previous commit), sethostname called from DetectorClass in virtual command to have one point of entry (previous commit), testing Module class frees shared memory using free function

* Detector class: added copy and move constructor and assignmentoperators due to explicit destructor (DetectorImpl fwd declared), DetectorImpl class: included ZmqSocket to remove destructor (should not be virtual in any case), Module class: removed explciit destructor to allow compiler generated constructor and operators

* formatting

* minor fix for readme autocomplete

* updated client version date
2024-10-21 16:25:07 +02:00
76ab0228ac formatting and moench fw release update 2024-10-16 11:30:04 +02:00
a1e69bba37 updating release notes (superficial), package release version (superficial), client and receiver version (too old) 2024-10-16 11:18:03 +02:00
270ee48148 formatting 2024-10-11 15:44:59 +02:00
c679135138 Dev/g2 fix next frame number (#996)
* binaries in
2024-10-07 17:09:00 +02:00
0f88617477 first draft at fixing nextframenumber properly with firmware (#995)
* fixing nextframenumber properly with firmware

* updated firmware to have getnextframenumber and fixed setnextframenumber to reset also the header fifo when stopping

* fix tests for gotthard2
2024-10-04 16:53:14 +02:00
04eed990c7 fix the command help in the command help generator for Gotthard2 about nextframenumber (#994) 2024-10-03 11:50:42 +02:00
d2bfb91a16 formatting 2024-10-02 16:45:10 +02:00
5e024153bc Dev/g2 stop frame number (#980)
* get/set next frame number in G2 (firmware only has set, no get)
* firmware has issues: each stop keeps 2 frame header in fifo and the resetting frame number happens after that
* removed the option to set burstmode to burst external or continuwous internal
* needs to be revisited before 9.0.0
2024-10-02 15:26:06 +02:00
e59de85a33 formatting 2024-10-01 14:44:59 +02:00
fd010b9aa5 removed 'Caller/CALLER' from test names as there is only one command line now (#993) 2024-10-01 12:25:05 +02:00
45957391a6 minor. removed warning print at startup for empty eth udp to listen to (#992) 2024-10-01 12:05:00 +02:00
f2f3817a7f updated jungfrau timing info decoder mask (#991) 2024-10-01 11:29:48 +02:00
f43bb8eea4 jf: timing info decoder (#987)
* timing_info_decoder command with options swissfel (default) and shine. added to python, command line generation, autocomplete, tostring, tests.
2024-10-01 11:17:35 +02:00
8a7ed30676 Dev/m3 readout speed (#985)
* added readoutspeed command to m3 (fullspeed - 10, half speed - 20, quarter speed - 40), removed reaodut pll, moved up system pll clock indices, leaving pll index in common altera code, default speed is half speed, allow only system_c0 to be set, the others can be obtained, same for clkphase, maxclkphaseshift, clkfreq. added to readoutspeedlist commands, updated help and updated tests

* updated readoutspeedlist command
2024-09-30 17:22:24 +02:00
5b832cb6aa Jf: Electron collection mode (#983)
* electron collection mode for jungfrau. also removing the config chip when using register command
* collectionMode: HOLE/ELECTRON (enum)
2024-09-30 17:15:22 +02:00
7fa5b5d70a fixing python version. allowing versions to execute even if no detector connected or in shared memory (#990) 2024-09-30 17:10:20 +02:00
6348ccd05b change gain mode help from dynamicgain to dynamic (#988) 2024-09-30 17:04:15 +02:00
8144397b2c sleep implemented for command line, mainly for config files for firmware developers (#982) 2024-09-30 16:57:53 +02:00
2dc0963c56 Dev/reg bit change no validate (#970)
- do not validate write reg, setbit and clearbit by default anymore
- --validate will force validation on the bitmask or entire reg
- remove return value for write reg (across server to client, but thankfully not in the Detector class)
- extend validation into writereg, setbit and clearbit for Eiger (always special)
-  need to check python (TODO)
- missed the rx_zmqip implementations in detector.h and python bindings
2024-09-30 16:54:12 +02:00
a44ba4dc35 Dev/rx callbacks (#966)
* changed rxr callback signatures to all include structs
* removed datamodify call back as size can be changed in the original data call back now
* bringing some parameters (set functions) to dataProcessor class for its callback (namely udpport, quad, fliprows, totalframes, jsonheader), resulting in also removing totalframes from 2 other function signatures

* updated MultiReceiverApp to reflect the new callback signatures
2024-09-30 16:30:13 +02:00
007330caa7 format 2024-09-26 15:39:49 +02:00
492b4815a6 rx_zmqip has been removed. Remove it also for pyctbgui (#979) 2024-09-26 10:43:16 +02:00
33b8e0817e missed the rx_zmqip implementations in detector.h and python bindings (#975) 2024-09-18 13:41:58 +02:00
ab7425a9d3 8.0.2 psi modules 2024-09-17 12:20:36 +02:00
d8f925520e dont build doc for Tobi Schluter from libzmq, which uses iso-8859-1 and the umlaut cause compilation to fail on some machines (#973) 2024-09-16 17:26:31 +02:00
9f079b17a2 Dev/xilinx mat update (#959)
* put back code to obtain adc and dac device indexafter loading device tree and then create folder iio_device_links and create symbolic links there according to device indices found. ln -sf operation not permitted, so folder has to be deleted and created everytime. Also refactored definitions to have all the xilinx name or detector specific stuff out of programbyArm.c

* uncommented waittransceiverreset at startup (should work now) and return of powering off chip at startup (error for transceiver alignment reset)

* updated registerdefs from firmware

* minor prints and updating names from registerdefs

* waittransceiverreset has been fixed in firmware and removing warnign for that, transceiver alignment check for powering off chip is not done in fw (giving a warning and returning ok for now)

* fixing ipchecksum (not done), removed startperiphery, allowing readout command to be allowed for xilinx when acquiring
2024-09-10 16:19:03 +02:00
5b61ff24bb Dev/pyctbgui merge (#960)
* added empty c extension

* added rotation to the decoding

* added color map, options and findex

* minor

* move checks to before acquisition

* added pixel map based decoder

* cleanup

* no thread creation for single thread processing

* added rotation and test to compare

* allow high and low water mark for zmq (also buffer size) for fast readouts

* removed roatation during decoding

* added Transpose to image and invert Y False to invert it

* retains the zoomed state after the first image of gui, catch and display exception if no detector connected

* moved start frame to dockable widget, removed extra frame number label, moved current measurement also to dockable widget, hide frame plot entirely when showing patternviewer

* first image dependin on which plot

* remember settings of main window size and position, dockewidget if docked, its size and posisiotn as well, then update it next time the gui is opened

* change in comment

* using c decoder for moench 04 and matterhorn

* catch exception from invalid image from decoder

* clean up

* update row and col when choosing image type, neeeded to show values

* fix for previous PR

* disable resetting colormap values
keep the range selected for every new acquisition

* fix typos + tested on virtual matterhorn

* minor print

* refactored Slow ADCs Tab

* refactored DAC tab

* refactored power supplies

* refactored signals tab

* refactored transceiver tab

* fix typo

* fix typo2

* remove commented code

* delete commented code

* delete commented code

* delete commented signals code

* remove commented code for transceiver tab

* refactor adc tab

* refactor Pattern Tab

* Refactor transceivers tab (PR#5) (#118)

* refactored transceiver tab

* remove commented code for transceiver tab

---------

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>

* refactor adc tab (PR#6) (#119)


* refactor adc tab

* refactored Plot and Acquisition Tabs

* fix the regression issue

* restructure project files

* applying singleton and renaming tabs to services

* working install using pip

* applies singleton to tab classes and remove CI erros

* added pyzmq and pillow

* remove the singleton implementation and keep changes

* fix merge errors in mainWindow

* moved misplaced init file

* rename service to tab

* reorganize imports

* iterate over tabs

* reorder tabs

* add slowadc to the list

* saving changes (buggy)
power supply ui not showing in the gui

* split power supply tab

* fixed tests

* add hardcoded values to defines file

* fix error

* separate power supply

* fix errors for powerSuppliesTab

* split dacs

* split slow adcs

* split signals tab

* added tests for bit_utils

* add slowAdc class to defines

* split transceiver ui file

* split adc.ui

* split pattern ui file

* split plot and acquisition ui file

* added basic test for parsing bit names

* removed redundant code in read_alias_file

* fix dacs ui position

* testing for correct exception

* cmd and args at split

* group radio buttons

* fix comments from PR#1

* show legend

* added python version and dev requirements to setup.py

* fix dac issue

* moved _decoder into pkg

* added inplace build

* removed clear

* fixed dependencies

* make tests run without slsdet

* updated name of action

* define colcount

* fixed loading of alias file

* add yapf and ruff

* apply formatting

* fix E and F rules

* add more ruff rules

* change variable name

* squashing gh debugging commits and add pre-commit

* update label values to mv units

* add hook for yapf

* reconfigure yapf precommit hook

* add format and check_format to makefile

* change gh actions

* update readme

* added check_format

* WIP

* added linting in github action

* updated readme]

* add more control for color choice

* remove useless file

* fix un-updated line after refactoring Defines
BIT0_31_MASK is not found in Defines.signals

* visually improve the interface

* fix last commit

* add only selected plots for legend

* add hide legend button

* change hide legend to show legend
checkbox show legend is checked by default

* add support for saving in numpy

* solve conversations

* fix acq index offset

* fix browse button in pattern error

* fix other browse button errors

* finish tests and add usage.md

* remove buffer

* add file,numpy-like interface and tests

* remove useless .npy files

* subscriptible npz files

* remove useless files

* remove repetetive tests

* save changes

* add mode r+, add with support,remove logging

* remove offset of acqIndex between raw and numpy saving

* fix only saving last frame

* save signals of multiple devices

* add comments and move condition for clearer code

* fix bug when vieweing pattern file

* iterate over enabled and plotted plots

* add padestal substraction to transceiver and analog data

* init pedestal frames to detector.frames

* restore old exception

* add pedestal substraction for digital signals

* remove frames spinbox from plotTab

* remove comments and use str instead of Path

* avoid saving all frames

* correct exception and log error's trace

* add gui tests

* add waveform test

* add pedestal test

* refactor by using fixtures

* add tests for moench analog and pattern

* add pytest-qt to dependencies

* add save and load gui parameters

* remove nohup file

* fix old bug IndexError

* save plot type

* a

* handle canceling load, loading matterhorn pedestal for moench

* remove comparing .png files for pattern test

* save plot type

* red error on status bar when shape mismatch for loaded pedestal

* fix makefile and docstrings

* fix PRs conversation

* move code into different function

* fix wrong function names for power supply

* removed old ctbgui

* removed unnecessary files

---------

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
Co-authored-by: Braham Bechir <braham_b@pc11979.psi.ch>
Co-authored-by: Bechir <bechir.braham@psi.ch>
Co-authored-by: Bechir <bechir.brahem420@gmail.com>
2024-09-10 16:00:04 +02:00
c6477e0ed6 fixed stop server not starting up with setup variables (#949)
* m3: fixed stop server not starting up with setup variables

* all servers except eiger fixed for virtual stop server to start up with setupDetector function called

* virtual tests work

* eiger: versions print neednt be in stop server

* jungfrau: stop server (not virtual) also needs to read config file

* ensuring master is setup for virtual and real servers
2024-09-10 15:24:51 +02:00
38d7fb0c38 fixed a warning about narrowing conversion from size_t to int (#963) 2024-09-10 15:23:15 +02:00
e848293916 Dev/zmq stream all ipv6 adn remove rx_zmqip (#958)
* enable ipv6 in zmq socket

* removed rx_zmqip API and field in gui, changed client updaterxrzip to updateclientzmqip to have the rx_hostname ip if 0. 

* updated command line for rx_zmqip to give a warning. 

* Replaced 'depreciated' to 'deprecated' everywhere

* switching from * to 0.0.0.0 works for rebinding zmq sockets

* fixed help in command line for rx_zmqip * to 0.0.0.0 and removed cmd in python

* remove publisher zmq socket ip also for moench post processing

* fixed tests

* publisher zmq ip macros to be reused
2024-09-10 15:19:08 +02:00
15e8c0d9f1 Moench mess from developer (#953)
* new moench data structure for offline processing
2024-09-05 15:32:20 +02:00
588d11dedf added keepalive zmq socket option (after 60s of idle time, 10 probes every sec. Mainly because an issue at Max IV (#956) 2024-09-03 17:37:00 +02:00
782c8abd9a rx: moved creating fpath (if it doesnt exist) from setting file path to at the start of acquisition when creating file. This is done here so that it does not fail if fwrite is disabled anyway. Also fixed it in documentation. Changed in documentation that the default for fwrite is disabled (#957) 2024-09-03 17:32:01 +02:00
1d4a5d6d29 dev: jungfrau HW 1.0: adc output clock phase to 120 (#952)
* jungfrau: change adc output clock phase from 180 to 120 for v1.0 boards for reliable readout of adc #2

* versioning

* formatting
2024-08-22 15:45:41 +02:00
9c57571a41 formatting 2024-08-20 16:28:09 +02:00
b4533ac11f Dev/xilinx ctb test (#942)
* voltage regulators only looks at dac and not at ctrl_reg

* xilinx: change dac max to 2048, setting dac ist not inverse conversion from dac to voltage anymore, but setting power is inverse, also there is max and min to power, a different min for vio and this is checked at funcs interface, not printign or converting to mv in dac for power regulators (as its conversion max and min are different)

* Use links for dacs/adc and adapt power rglt thresholds

* Remove wait for transceiver reset

* adc and dac device not used anymore and hence removed

* udp restucturing: arm has to be multiple of 16 and no byteswap in udp_gen, option to compile locally in arm architecture, memsize of the second udp memory has to be limited

---------

Co-authored-by: Martin Brückner <martin.brueckner@psi.ch>
2024-08-20 14:33:18 +02:00
991a4115d4 updated documentation from martin (#948) 2024-08-19 16:50:24 +02:00
ff107faae6 bug fixes related to file saving (#931) (#946)
* fix the file path resetting issue of GUI in the case where different modules have different fpath setting.

* fix stack-buffer-overflow issue when using HDF5 HDF5DataFile::parameterDataTypes have 64bit type (i.e. STD_U64LE), the size of fill_value should be at least 8 bytes.

* change the type of fill_value to uint64_t

Co-authored-by: Z.H. Li <zhenghenge@gmail.com>
2024-08-19 13:45:25 +02:00
d57643434d dev: client: status for blocking acquire stop with slave temporarily in waiting (#944)
* acq finish call back gets status squashed with default error but before that need to wait for gotthard slaves to catch up from waiting to stopped
2024-08-15 17:09:36 +02:00
de33aff077 developer: moench empty data callback (#936)
* moench (feature to wait for post processing to be done in new sls_detector_acquire_zmq executable)

READOUT_ACTION_ZMQ added to action enums
sls_detector_acquire_zmq added to executables
empty data call back so that client listens to last dummy zmq packet from moench post processor
processor: remove NEWZMQ ifdefs and remove connect for zmq publisher socket

* fix to compile

* cmds generated and parsed
2024-08-13 11:27:06 +02:00
c13049f144 G2: reconfigure chip (#927)
* changed common.c readADCFromFile to make it more general and move temperature calculation for Eiger out of this function and inside whereever it is called.
* g2 and m2: gethighvoltage was just a variable set in server, it is now moved to a get inside DAC5671 implementation (but not reading a measured value, instead what is set from a file), high voltage variable used inside DAC5671 for virtual servers
* g2: switching off hv (ifrom non zero to zero value) will wait for 10s; powering on chip reconfigures chip; powering off chip unconfigures chip; powering off chip also includes check if hv = 0, if not throw exception; chip configuration checked before acquring; at start up: hv switched off and chip powered on, so does not wait 10s to switch off hv;
* included test to check powering off chip when hv is on should throw an exception
* g2:  check if chip configured before acquiring

* nios: read hv value set from file and virtual still goes into DAC5671 for conversions to and fro dac to V, change common readadc to readparameter to generalize, make sethighvoltage into a get and set to catch errors in get as well, g2: if not at startup, remmeber hv value before setting it and after check if value was being switched off (from a non zero value) and wait 10s if it was (10s wait only for switching off from non zero and not at startup)
2024-08-02 12:46:39 +02:00
ce7f01bdc4 Dev: m3 clkdiv0 20 (#924)
* m3: clk 0 changed from 10 to 20 (100MHz to 50MHz)

* g2: startup clk div back to 10 as in firmware but setting in software startup to 20

* m3: minor print error if clk divider > max
2024-07-25 17:18:45 +02:00
bf523c0c5e fix to rapidjson for build with gcc 14 (#929) 2024-07-25 17:15:14 +02:00
1efd106c6a developer: blocking acquire stop with slave temporarily in waiting (#926)
* client: stopping a blocking acquire of multi modules checks status to catch slaves that might still be in waiting. Problem is (gotthard2 25um at least) slave is in waiting only temporarily before going go idle/stopped. So a 50ms sleep is necessary ot not throw an unnecessary error

* client: when stopping blocking acquire, wait up to 1s in 50ms increments for slave to stop waiting temporarily
2024-07-16 15:43:31 +02:00
08dc8e3cbb client bug fix: m3 multi module bad channel file throws bad allocation when modules skipped, needed to add vectors in 2d vector of bad channel list (#920)
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2024-07-16 11:59:17 +02:00
96f7a1ecfb moench server: changed default values of adcphase for full speed from 300 to 150 and dac vipre_cds from 800 to 1280 (#922) 2024-07-15 12:31:53 +02:00
64d489f1e6 formatting 2024-02-07 13:25:11 +01:00
56abf82d92 updated binaries 2024-02-07 13:23:58 +01:00
3d21bb64c4 Dev/xilinx acq (#901)
* period and exptime(patternwaittime level 0)

* added new regsieterdefs and updated api version and fixedpattern reg

* autogenerate commands

* formatting

* minor

* wip resetflow, readout mode, transceiver mask, transceiver enable

* acquisition, but streaming done bit and busy (exposing + read chip to fifo) not known yet from fw

* programming fpga and device tree done

* most configuration done, need to connect configuretransceiver to client

* stuck at resetting transciever timed out

* minor

* fixed virtual, added chip busyto fifo, streaming busy, set/getnext framenumber

* configuretransceiver from client, added help in client

* make formatt and command generation

* tests for xilinx ctb works

* command generation

* dacs added and tested, power not done

* power added

* added temp_fpga

* binaries in

* ctrlreg is 0 to enable chip=fixed, high dac val = min val= fixed, power regulators in weird order=fixed, device tree could be loaded with dacs before adcs=fixed

* start works

* virtual server sends

* receiver works

* tests

* python function and enum generation, commands generatorn and autocomplete, formatting, tests

* tests fail at start(transceiver not aligned)

* tests passed

* all binaries compiled

* eiger binary in

* added --nomodule cehck for xilinx
2024-02-07 13:23:08 +01:00
f6b0ba9703 Protect from getenv("HOME") returning nullptr (#907) (#908)
* Protect from getenv("HOME") returning nullptr (e.g., in case running in systemd)

* Write proper warning in Module.cpp

Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
2024-02-07 10:27:03 +01:00
d17bc5da62 moench: changed max shifts of adc clk from 240 to 200 (#900) 2024-01-30 09:58:53 +01:00
a884db0e2c m3 fix to get kernel version properly on nios without an incorrect error msg (#898) 2024-01-26 10:41:24 +01:00
5e9fd43d49 updated pmod 8.0.1 for rh7 and rh8 2024-01-16 17:05:07 +01:00
8bce89d5dc pmod for 7.0.3 and 8.0.0 from previous releases 2024-01-16 16:11:59 +01:00
aa40128965 Moench v8 (#892)
* new rct structure for moench03

* new moench data structure for offline processing

* meonch raw data and zmq process files updated to 7.0.3 version

* implemented config file for Zmq file

* raw data and zmq work with config file, but only with one file/interface

* zmq config change

* added config examples for zmq and rawdata
2024-01-12 14:01:06 +01:00
a03780718e Fixed path when building as submodule 2024-01-12 09:17:14 +01:00
bd1a125154 moench default speed set to after init readout configuration (half speed) (#886) 2024-01-11 18:07:34 +01:00
ffe7728966 formatting 2024-01-11 18:04:19 +01:00
b69e053bb4 updated commands generation 2024-01-11 18:03:34 +01:00
daec0dc389 minor 2024-01-11 18:02:30 +01:00
c8bb70f876 Dev/xilinx defaults and pattern (#888)
* implemented testbus, testfpga, set/get #frames, triggers, allowed that and for connection to client, also allowed, getnumchannels, configuremac, getrunstatus, setdetectorposition with dummy values

* connected kernelversion, hardwareversion, versions, framesl, triggersl, dr, timingmode, pattern (except patioctrl) thats there for altera ctb

* replaced set/get64Bit to set/getU64bit in all loadpattern.c for (ctb and m3 also)
2024-01-11 18:01:08 +01:00
9a08ecc5a5 Xilinx client tests (#887)
* implemented testbus, testfpga, set/get #frames, triggers, allowed that and for connection to client, also allowed, getnumchannels, configuremac, getrunstatus, setdetectorposition with dummy values

* allowing tests for xilinx

* binaries in
2024-01-10 16:23:52 +01:00
9738cb7d74 Xilinx ctb (#884)
* updated registers, arm64

* compiler set to aarch64 for xilinx server

* updated RegisterDefs.h

* merge into generate branch and resolving conflicts and adding the xilinx changes to callerspecial and commands.yaml

* compiles and can print firmware version (using a different csp0 address)

* fixing other servers (gotthard, jungfrau, moench, mythen3) that it returns in case of mapping failure, xilinxctb: added that it checks type, prints proper fw version, checks kernel date, added armprocessor define to use in common places, added specifiers to supress overflow and truncation warnings

* added detector ip and mac adddress to the printout

* fixed tests and recompiled servers
2024-01-04 17:10:16 +01:00
4f4125a3b2 Generate commands/fix detp detg command rename (#882)
* replacing detp with sls_Detector_put and detg with sls_detector_get

* sls_detector_not implemented, but extended message to ask user to use sls_detector_get or sls_detector_put

* autocompletion also for sls_detector or det
2023-12-13 17:01:10 +01:00
51412f40cf Generate commands/fix det command rename (#881)
* made a link to bash autocompletion script in main folder, and replaced all references to 'det' command with 'sls_detector'
2023-12-13 15:38:10 +01:00
ce7270e8a2 commands code generation (#871)
* commands code generation  (#803)

* commands code generation for only frames command

* fix cmake file and add Caller files

* working exptime, fully extended commands file and its variants

* start adding template commands

* add INT_CMD_VEC_ID template

* add list command, generate multiple bins, format code

* reach 208 commands using the cpp macros

* add tests for command parser

* start adding tests for commands parser

* fix typo to use commands.yaml

* add more tests for command_parser

* add all template functions (up to 218 commands)

* finish template functions and add more CmdProxy.cpp functions (250+)

* 257 commands

* 300 commands the rest are very special commands

* add special commands without generation

* separate special functions from generated c++ file

* implementing one command for put and get (buggy)

* add infer action in a separate file

* generate header for special commands from yaml

* allow only 0 or 1 for bool inputs

* group all commands in gen_commands.py

* add help to gen_commands.py

* add autocomplete bash script

* autocompletion: add support for module levels and help

* remove debugging line

* add autocompletion, help to commands, change int [0,1] to bool

* copy tests for Caller.cpp. Tests pass

* update with the new developer branch changes

* fix errors after merging (there is problems with tests)

* fixed port/stopport in yaml (intput typo), added '_caller' to the test dac and test on chip dac command in global test for cmdcaller

* undo previous test simulator debug change

* add documentation for the generated code

* reducing the comment to be replaced in length so formatting does not split into 2 lines

* removed formatting specific style of C++11 in gen_commands.py to keep with the top level clang format of the project
* regeneratign code for commands

* automation generated

* Redirect deprecated commands (#872)

* working implementation, need to fix dac

* fixed deprecation redirect for dac command

* Detector specific autocomplete (#873)

* working implementation, need to fix dac

* fixed deprecation redirect for dac command

* detector specific completion for dac

* added autocomplete using detector specific

* fixed error when autocompleting partial words

* Generate commands/fix commands (#875)

* fix vm_a, im_a etc have deg Celsius suffix, also help missing or changed in some places

* dac: require det id for all, arg0 to be printed at output, help for onchip dac and dac, onchipdac: spacing

* getscan detid and blocking trigger help

* udp_Dstlist det_id fixed, but rx_id invalid

* cmdApp in line with cmdLineApp (missing version, receiver_id, not creating det object in help action

* added set_command to differentiate between check_det_id and require_det_id (mixed up), args: -1 needs to check for at least one argument

* reordering

* reordering and checked till integer_command_hex

* fixed a lot more commands

* fix caller tests for eiger

* changes to tests after Bechir left

* changing .cmd to .cmdcall for the caller commands

* fixed tests for caller, still warning for setexptime about cast input

* autocomplete ran

* add moench test

* regenerating autocomplete and commands

* fixing other things from merge conflicts (renaming slsDetectorDefs to defs in commands.yaml)

* formatting

* added code injection to help (#876)

* updated 3 commands to have get output that can be put into put (#877)

* updated some commands to have get output that can be put into put

* fix tests for clkdiv

* adding help to free (#878)

* removing old commands and renaming them, (also making it work for parameters command as it was still calling cmdproxy) (#879)

* More helpful error messages for unsupported actions (#880)

* removing old commands and renaming them, (also making it work for parameters command as it was still calling cmdproxy)

* Added specific help for unsupported actions

* fixed a vetofile get special exception message. more specific warning for special exception message instead of no function warning

* added condition checking true in exceptions for special message

---------
Co-authored-by: Bechir Brahem <bachbrahem@gmail.com>
Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2023-12-13 14:43:38 +01:00
d72c9e29a4 dev: moench: min exptime (#865)
* moench: remove min clock cycles for setting exptime (had been ported from jf)
2023-11-27 15:22:16 +01:00
62dc0e1a34 removed zmq as dependency for slsdet (#870) 2023-11-24 09:09:29 +01:00
d7aa3305d1 forward declare zmq_msg_t and moved include (#869)
* forward declare zmq_msg_t and moved include

* removed zmq from pkg list
2023-11-20 11:43:30 +01:00
96ed74c47c formatting 2023-11-12 15:35:05 +01:00
4198db8365 documentation and examples 2023-11-12 15:34:58 +01:00
e2d7af28dc added python 3.12 to the conda build variants 2023-11-10 17:34:39 +01:00
66d57c1852 fixed doc 2023-11-10 17:34:32 +01:00
aa4bf6e7f9 updating docs 2023-11-10 17:34:28 +01:00
7f0868f344 minor fix for test_simulator 2023-11-10 11:39:03 +01:00
e57cf49c49 Dev: trigger signal issues handled at acquire (#864)
* if blocking and handling sync, only master gets blocking acq, slaves get non blocking as they are first and so dont get status or error caught when slaves dont get trigger (due to not connected etc) and acq returns with slaves still in waiting status. so check status of all in blocking acq

* for all dets with sync, ensure atleast one master when starting acq

* docs updated about sync
2023-11-10 11:38:06 +01:00
66baaf1ebd dev: fix server logic in checking detector idle (#861)
* fix buggy logic in checking detector idle and an argument check
2023-11-09 15:07:34 +01:00
7d7ac26c30 execute command inside server fixed (from fix simulator tests and exec command PR) (#857) 2023-11-08 09:26:11 +01:00
1a7c74fe4e tests for jf (#835) 2023-11-07 15:01:22 +01:00
01e4bcb47e formatting 2023-11-07 14:52:14 +01:00
397e846509 Dev: fix py virtual test (#846)
* draft to fix virtual test when it fails

* catching errors in tests and removing sigchild ignore so servers (process in background) executing commands will not fail (pclose no child processes, if sigchld is ignored) fixed

* uncommented python loading config

* somehow killal slsReciever in second detector test fails even though no receiver running

* fixing script for virtual simlator test:fixed issue with check if process running, fixed moench tests
2023-11-07 09:30:46 +01:00
314a8a0daa handling inconsistent fnums to be -1 in gui, so when one sets 0 (change of value) will also give an exception (#854) 2023-11-06 16:11:52 +01:00
ebb352b13a Dev: : gui acq finished callback for different status (#850)
* fix acquisition finished status to have different status for different modules, but does not have to be error. for eg. jf sync fw (2.4.1 gives idle for master and stopped for slaves when stopping acquiistion)
2023-11-06 16:08:07 +01:00
9b5d44f0b3 fix warning for prev_val (variable size array) in tests (#838) 2023-10-23 15:56:22 +02:00
1892963fcb eiger required fw version to 32: fix for blocking trigger in quad (#834) 2023-10-18 17:04:39 +02:00
62f45b15d2 dev jf: reconfigure chip when touching electron collection mode bit (#831)
* jf: if bit 14 in reg 0x5d (electron mode collection bit) is changed, configure chip if v1.1 and powered on. so touch writeregister (setbit/clearbit also calls write register in the end). replace when electroncollectionmode command introduced
2023-10-18 10:52:22 +02:00
82ac45873c dev jf: change status reg bits (#829)
* jf: rewrite of status reg bits, waiting state includes both wati for trigger and start frame, blocking trigger only waits if its not in waiting for trigger and run busy enabled, error state connected in firmware
2023-10-18 10:47:52 +02:00
2b2e50916c dev: jf sync: stopping master gives idle (#824)
* jf sync mode master could return idle when stopped and so not all modules return the same value and must check for 'stopped or idle', Also must throw if any of the module gives an error

* added contains_only to sls::Result (#827)

* added variadic template for checking if a result contains only specified values

* fix for gcc4.8

* renamed to Result::contains_only

* updated condition in Detector.cpp

* stop on only the positions

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-10-13 15:25:41 +02:00
d34f396ef8 Dev/jf/fix pedestal (#821)
* jf pedestal fix: touch enable bit last
2023-10-05 10:29:33 +02:00
f9c4405da6 dev: update 2d gain plot color map (if no x and ymin/max changes or window resizing): setFixedWidth was updating for window resize, updated virtual servers for g2 and jungfrau to keep changing gain and data for every frame. the data value (#819) 2023-10-03 17:22:32 +02:00
dad3dc3e46 3. Dev/voltage to power (#816)
* getVoltageList, getVoltage /set, getMeasuredVoltage, getVoltageNames /set, getVoltageIndex moved to 'Power' as its misleading

* added cstdint and names slowadc,  added division to mV

* changed uV to mV in command line slow adc help. removed all python slowadcs (as it was already implemented as slowadc

---------

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2023-10-02 11:11:28 +02:00
d003a6d8e0 2. Dev/add jf pedestal feature (#807) 2023-09-29 11:25:58 +02:00
72bec5d62e 1. Dev/update python bindings for port pr (#813)
* updated python bindings for port update from int to uint16_t

* user friendly error message for exception when python arg does not match uint16_t for ports
2023-09-29 11:12:02 +02:00
88c39ba702 removing the misleading word 'Simulating' when programmig fpga (#815) 2023-09-28 16:21:31 +02:00
9834b07b47 Dev/fix port size (#805)
* port datatype changing from int to uint16_t
* throwing for -1 given for uint16_t ports
2023-09-28 09:36:39 +02:00
77d13f0794 updated all servers as my3 was not updated and had api issues 2023-08-29 11:11:19 +02:00
dd1690d7a1 typo for slow adc list (#794) 2023-08-17 12:28:58 +02:00
1873cc9310 Moench dacs defaults (#788)
* merge fix from 7.0.2: new jungfrau fw versions, incremented binary, hdf5 and json versions

* moench: changed dac names and default values to old moench values

* moench: remove interface clk polarity at start up

* moench: default speed is half speed, default values for adc offset and adc phase for different speeds (only half speed confirmed), adc vref voltage to 2.0 like G1

* moench: connected adc pipeline to client

* moench: receiver- default frames per file is 100k and discard partial frames as default

* moench binary in

* using tostring in gui for dacs

* moved frame discard policy as a parameter to be configured with a default depending on detector

* moench: 300 degrees for adc phase in full speed
2023-07-31 14:02:30 +02:00
565858b6c6 Explicit constructors for exceptions (#791)
* silence warnings

* making constructors explicit to avoid unintended conversions

* changed struct to class since we already have public:

---------

Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2023-07-26 16:35:52 +02:00
7383b13f16 silence warnings (#790) 2023-07-26 15:54:51 +02:00
d5ce03918c ctb: allowing adc enable for 10g to be 0, romode changing bit from disable analog to enable analog, removing matterhorn specific (#789) 2023-07-25 10:33:18 +02:00
c9dfa408db Fix strixel mapping and interpolation (#787) 2023-07-20 16:49:31 +02:00
36a9bafbde merge fix from 7.0.2: new jungfrau fw versions, incremented binary, hdf5 and json versions (#786) 2023-07-20 09:30:42 +02:00
15643c2320 adding 7.0.2 to pmodules (#784) 2023-07-20 09:02:50 +02:00
71489b7106 2. Set row col (#779)
* set row and column
2023-07-18 15:51:22 +02:00
7394833710 fixing python get slow adc names typo 2023-07-18 14:41:22 +02:00
9c50a3ee1e Internalpybind (#782)
* using fetchcontent to get zmq

* local copy of libzmq

* added guard for policy setting

* removed the need to export by using build interface

* moved pybind11 to FetchContent

* removed zmq hint from cmk script

* Fixed comments

---------
authored-by: froejdh_e <erik.frojdh@psi.ch>
2023-07-17 14:38:39 +02:00
fd79d59f4e Internal zmq using FetchContent (#780)
* using fetchcontent to get zmq
* local copy of libzmq
* added guard for policy setting
* removed the need to export by using build interface
* removed zmq hint from cmk script
---------

Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
Co-authored-by: froejdh_e <erik.frojdh@psi.ch>
2023-07-17 14:20:22 +02:00
c628ae2192 1. Ctb transceiver ro (#773)
*  transceiverenable, tsamples, romode for tranceiver and digital_transceiver

* 202 spec instr only for transceiver mode

* removed check for empty in trans readout and clean memory before reading from fifo

* ctb read fifo strobe for all after reading all channels, adding 1us after selecting channel, changing fw date

* updated 10gb transceiver enable

----
* added transceiver (tsamples, romode(transceiver, digital_transceiver), transceiverenable (mask)

* clean memory before reading from fifo (for analog and digital as well)

* read fifo then read strobe (also corresp fw) fixes number of reads (also for analg and digital)-> increases all pipelines by 1

* fixed bug in rearranging digital data in receiver

* fixed bug in streaming size of data after rearranging

* fixed bug in setbit, clearbit,and getbit

* status checks fifo before returning idle (transmitting if data in fifo if transceiver more enabled)

* soem matterhorn specifics that will need to be put into pattern in a month or two. this is temporary.

* NOTE: breaking api. rxParameters struct has transceiverenabel and tsamples given from det to receiver
2023-07-14 16:29:21 +02:00
a56be25500 Pmodules (#777)
* Add pmodules build files for PSI

* Modified gitignore to accept build-file

* Fix error of not building virtual servers

* make everything stable
2023-07-14 16:11:14 +02:00
d74661a375 updated fw versions for moench 2023-07-10 16:15:28 +02:00
054e733cd5 Voltage and slow adc naming (#772)
* voltages in python 

* added voltage values in cmd line, added voltagelist in detector class

* voltage values in python

* slow adc list
2023-07-10 16:10:23 +02:00
fe4db54eb6 moench settings (#774)
* moench settings

* default value for asic ctrl reg for moench
2023-07-10 15:21:48 +02:00
5be503c1bd moench speeds (#776)
* added other speeds and updated readoutspeedlist, test, gui
2023-07-10 15:09:51 +02:00
58cdb5bd20 added patfname command to save the file the last pttern was loaded from (#770)
* added patfname command to save the file the last pttern was loaded from
2023-06-22 09:08:48 +02:00
e18c191247 Added pyat files as input, auto legend bug without wait and loop fixed (#769) 2023-06-20 12:28:14 +02:00
1a338346d5 2. Ctb fname voltage (#768)
* power and sense returning dac indices instead of int in Detector class

* power -> voltage, sense -> slowadc
2023-06-19 16:05:30 +02:00
d3d98db7e9 1. Ctb powerindices (#767)
* power and sense returning dac indices instead of int in Detector class
2023-06-19 15:19:50 +02:00
3f9ec695db 2. Patioctrl uint64 t (#766)
* when dbit list is enabled, the size of data in zmq stream is changed to only the digital bits enabled size. now fixed to also include analog size

* allowing to set 0xffffffffffffffff to pat io control. prevously was used to do a get. fixed also for pat bit mask and pat mask
2023-06-15 09:30:52 +02:00
6f50707cfb when dbit list is enabled, the size of data in zmq stream is changed to only the digital bits enabled size. now fixed to also include analog size (#764)
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-06-15 09:19:01 +02:00
a5f26252b8 ctb v_limit dac tristate (#761)
* ctb: allowing dac to tristate (-100) even if v_limit is set

* binary in

* formatting
2023-06-15 08:42:42 +02:00
d032f43f11 fixing tests to work and powername change bug fix from before 2023-06-14 17:19:37 +02:00
0d53f83a2f backward compatibility of alias file 2023-06-14 11:40:30 +02:00
a7dcfe4b31 Ctb sense power signal names (#759)
*  adc names

* added python functions in src

*  signal, power, sense names

* fix tests
2023-06-07 17:06:41 +02:00
b9a346a396 ctb adc names (#757)
* first draft of adc names

* fixed tests

* formatting

* added python functions in src

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-05-31 21:07:07 +02:00
225e5490d2 formatting 2023-05-30 15:46:30 +02:00
95d89522d8 formatting 2023-05-25 12:10:46 +02:00
6fcb880538 Merge fix from 7.0.2 (#756)
- start acq list: mixup with master pos #743 : fix that only master starts second and not all (for start acq), typo with pos and masters list
- synced master status running when setting to slave  #747: synced master status running when setting to slave
2023-05-25 11:20:41 +02:00
65b8c9c5c1 Moench rw3 (#745)
* moench, removed chip version, filter resistor, filter cells, currentsoures, gain mode, setttings(modes), dbitphase, maxdbitphase, autocompdisable, comparatordisabletime, made acq start and stop a pulse, removed unused registers

* added parallel command

* remove gain plot for moench

* moench: updated adc invert val

* moench: update adcoffset to 0xf and adcphase to 140 degrees

* removed sync clock in moench

* updated min fw version

* removing config file in moench server
2023-05-25 11:00:23 +02:00
0a7fd0a51a set bit and clear bit only verifies that bit (#746) 2023-05-25 10:35:17 +02:00
6834294437 2. Fix ctb ro to receiver (#755)
* fix for incorrect readout mode from detector to updating receiver (rx_hostname command)
2023-05-25 08:55:36 +02:00
afee45790f 1. allow 1gbe non blocking acquire by creating another thread (#753)
* allow 1gbe non blocking acquire by creating another thread

* removed unnnecessary print out in ctb
2023-05-24 13:39:40 +02:00
f0c789dc91 Revert "Ctb: allow adc mask enable to be 0 for 1 and 10GbE", and better error message (#751)
* Revert "Ctb: allow adc mask enable to be 0 for 1 and 10GbE (#750)"

This reverts commit a0f250a487.

* better error message about setting adc mask to 0. Cannot set it to 0 due to ram allocation
2023-05-22 12:26:07 +02:00
a0f250a487 Ctb: allow adc mask enable to be 0 for 1 and 10GbE (#750)
* ctb: allow adc mask enable to be 0 for 1 and 10GbE
2023-05-22 11:26:57 +02:00
fb25a01db5 Automate virtual test (#714)
* using argparse for parsing command line arguments

* added command line option to specify which servers to run

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-05-11 12:15:22 +02:00
da4dd0df7e Formatting (#742) 2023-05-11 10:17:24 +02:00
4c6be26846 Jf rawdataprocess txtfile (#732)
* Fix ROI mapping

* Formatting

* Minor edit

* intial draft of cmake for jungfrau executables Makefile.rawdataprocess

* added the cmake file

* missed Makefile

* added libfmt

* Fix some compiler warnings

* Fix some compiler warnings

* Create filename usining fmt::format

* Rewrite command line parsing with std::string and fmt::format

* Fix file reading

* Fix root string extraction

* Fix ifstream file reading

* Clean up comments

* Add version of rawdataprocess with bash wildcards

* Add version of rawdataprocess that reads inputs from txt-file, still buggy

* intermediate

* fix file loop

* fix const

* Circumevent bug with stuck threads

* Fix mutex bug

* cleanup

---------

Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-05-08 16:30:37 +02:00
74acbb15f5 enable fix g0 when in expert mode (when gain mode enabled and not just visible) (#736) (#741) 2023-05-08 16:13:09 +02:00
d65825e9ef Rx roi zmq (#726) (#740)
adding rx_roi also in the zmq header for external guis to put the "yellow box".. sending full roi instead of -1, and sending for each zmq port. "(multiple yellow boxes)".
2023-05-08 16:03:48 +02:00
e757e25fa1 merge fix #721 PR (sync 7.0.2.rc) to developer (#739)
* merge fix from #721 PR (sync) 7.0.2.rc -> developer
* row and column for jungfrau mixed up

* multi module jungfrau sync must do slaves first then master for start acquisition and send software trigger, and master first and then slaves for stopacquisition

* non blocking to slaves first and only then blocking/nonblocking to the master for sending software trigger(jungfrau multi mod sync)

* fixed get/set timing jungfrau when sync enabled, getsync during blocking acquire (for trigger or stop) will get stuck as it should ask the stop server

* switching between 1 and 2 interfaces did not set gui/client zmq port properly. Resulted in dummy streaming forever. fixed

* formatting, refactoring: const & for positions, multi mod M3 stop first master first

* adding missing cstdint for gcc 13

* Refactoring handle sync out, handling synchronization also for softwaretrigger for m3, for start/sync/stop for g2/g1

---------

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>

* fixed row and col for moench 2 interfaces

* fix moench getTiming and also allow moench to handle sync

---------

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2023-05-08 15:58:19 +02:00
14ec4cf1da added missing initialization of pthread_mutex (#728)
* added missing initialization of pthread_mutex

* fixed cut and past error
2023-05-05 14:45:56 +02:00
ea4aaf743f modified struct (#729) 2023-05-05 14:09:13 +02:00
61f290441e Local loop indicies in analogDetector (#709)
* making ix and iy local variables in analogDetector
2023-05-03 09:18:09 +02:00
80fc7eb220 3 - Jf rawdataprocess wildcards (#723)
* Fix ROI mapping

* Formatting

* Minor edit

* intial draft of cmake for jungfrau executables Makefile.rawdataprocess

* added the cmake file

* missed Makefile

* added libfmt

* Fix some compiler warnings

* Fix some compiler warnings

* Create filename usining fmt::format

* Rewrite command line parsing with std::string and fmt::format

* Fix file reading

* Fix root string extraction

* Fix ifstream file reading

* Clean up comments

* Add version of rawdataprocess with bash wildcards

* Add version of rawdataprocess that reads inputs from txt-file, still buggy

* fixing missing cstdint

---------

Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-05-03 09:10:53 +02:00
73a9c42f62 2 - Jf rawdataprocess makefile (#724)
* Fix ROI mapping

* Formatting

* Minor edit

* intial draft of cmake for jungfrau executables Makefile.rawdataprocess

* added the cmake file

* missed Makefile

* added libfmt

* Fix some compiler warnings

* Fix some compiler warnings

* Fix MAkefile for conda env pyclang_fmt

---------

Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-05-03 08:50:24 +02:00
72c992bc74 2 - Jf rawdataprocess fmt (#725)
* Fix ROI mapping

* Formatting

* Minor edit

* intial draft of cmake for jungfrau executables Makefile.rawdataprocess

* added the cmake file

* missed Makefile

* added libfmt

* Fix some compiler warnings

* Fix some compiler warnings

* Create filename usining fmt::format

* Rewrite command line parsing with std::string and fmt::format

* Fix file reading

* Fix root string extraction

* Fix ifstream file reading

* Clean up comments

* Add requested changes to helper functions

* fix const&

---------

Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2023-05-03 08:43:45 +02:00
f4e05f7a01 1 - Add cmake for jungfrauExecutables rawdataprocess (#717)
* Fix ROI mapping

* intial draft of cmake for jungfrau executables Makefile.rawdataprocess

* added the cmake file

* missed Makefile

* added libfmt

* Fix some compiler warnings


---------

Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2023-04-27 13:59:13 +02:00
cb4f733350 formatting (#716)
* formatting
2023-04-12 15:30:34 +02:00
a5022ff0ee Jf strixelmap with roi (#715)
* Fix ROI mapping, Formatting, Minor edit
---------

Co-authored-by: vhinger182 <viktoria.hinger@psi.ch>
Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain>
2023-04-12 14:03:04 +02:00
cab2b335dc Fix ctb slow adc fw (#713)
Firmware updated. spi moved to firmware. In Software, configuring, then a pulse to start, wait for done bit and convert the values read from a regiter.
2023-04-12 11:25:41 +02:00
b442b17415 Implement automatic strixel mapping according to rx_roi (#710)
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-03-31 17:14:35 +02:00
37e7471dc4 minor fixes (#708) 2023-03-31 11:56:09 +02:00
3b8c612103 Fixed build of the moenchZmqExecutables (#706)
* changed to pure virtual methods for Clone and setClusterSize

* added std::

* added moench to the github actions build
2023-03-29 15:01:22 +02:00
08c0c59a28 Added github actions for build and run unit tests (#705) 2023-03-28 16:27:01 +02:00
7e01095684 Fix tests (#698)
* fix firmwareversion to reqd version as fw version cannot be 0 for virtual
2023-03-28 15:22:36 +02:00
500442fd6b modified ZMQonline display for stripsel usage. (#699)
* modified ZMQonline display for stripsel usage. modified dataprocessor to overwrite header.detspec1 with ROI in case of ROI.
* Removing changes to the slsReceiver, moved to branch jf_zeromq_display_rxroi
2023-03-22 14:25:02 +01:00
b67c6dea08 ensuring no duplicate rx hostname port combo (#604)
* rx_hostname and port combo to one, or hostname to all, or a vector of hostnames and ports, ignoring none or empty, then verifying no duplicates for the host port combo including from shared memory

* extracted function for rx_hostname (#694)

* c++14 revert

* unique hostname-port combo for port, hostname, rx_tcpport (#696)

* verify unique combo for rx_port as well

* check unique hostname-port combo also when setting control port, hostname, rx_hostname and rx_tcpport

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
Co-authored-by: Erik Frojdh <erik.frojdh@psi.ch>
2023-03-20 12:30:12 +01:00
c9215a6d9b fix old server version in 64 bits (#697)
* check server version before initial checks, catch old server version exception, get old server version as 64 bit and print it alon gwith exception
2023-03-20 10:31:27 +01:00
1bdf83e101 Resolve merge conflict in jungfrauExecutables 2023-03-17 16:43:08 +01:00
1bd813d620 Fix bug to allow larger clusters 2023-03-17 15:34:08 +01:00
943a85cbd5 Update data structures and eta functions for JF strixels 2023-03-17 15:33:01 +01:00
fc24558314 formatting 2023-03-17 14:42:11 +01:00
d23722a4b7 Eiger: add hardware version (#688)
* eiger: hardwareversion, fix firmware version unable to read version scenarios, check to see if febl, febr and beb have same fw version

* feb versions can be picked up only after feb initialization
2023-03-16 11:59:06 +01:00
bc46d0f6ab rx_arping handle sigchld (#691)
* rx_arping pclose gave -1 due to sigchld being ignored, fixed with sig handler doing a wait
2023-03-16 11:57:30 +01:00
532f76ed4f fix hdf5 compilation using det spec fields in header (#693)
* fix hdf5 compilation using det spec fields in header
2023-03-16 09:23:27 +01:00
21db57dd89 binaries in 2023-02-24 10:44:17 +01:00
dc5db905d4 merge from 7.0.0 2023-02-24 10:39:51 +01:00
48a684b95f dev:Eiger febl febr (#601)
* eiger: get febl and febr versions in versions command, also added in python
2023-02-24 10:06:11 +01:00
276dc52196 dev:removed storage cells for moench (#603)
* removed storage cells for moench
* rxr: also setting moench like jungfrau in implementation of ports
2023-02-24 10:00:31 +01:00
eb025b54ef Merge branch '7.0.0.rc' into developer 2023-01-18 13:59:04 +01:00
3bf6be41b4 merge from 7.0.0.rc 2023-01-17 09:48:59 +01:00
7729e47685 also for rx_hostname 2023-01-16 13:34:07 +01:00
f31fa92516 fixed hostname not split (+) in python 2023-01-16 13:34:01 +01:00
39b1f5bbf2 Moench rewrite (#597)
* copied jungfrau server to moench and adapted

* fixed image size and num packets

* read n rows allows 16

* commneted out configure_asic_timer at server startup. To be removed later the ASIC_CTRL_REG and storage cell options

* moench:removing the decrement (which was in jf)  in read n rows to register

* removed lblsamples from gui
2022-12-15 09:16:51 +01:00
7ab3b25f87 formatting 2022-12-13 10:07:13 +01:00
0f6f20a720 merge from 7.0.0.rc1 2022-12-13 10:03:57 +01:00
1340408c2d Merge branch '7.0.0.rc' into developer 2022-12-13 09:58:55 +01:00
7b7c4a2b86 Merge branch '7.0.0.rc' into developer 2022-12-08 09:01:03 +01:00
8fc45676b9 Merge branch '7.0.0.rc' into developer 2022-12-07 16:22:30 +01:00
53fe5f5116 Merge branch '7.0.0.rc' into developer 2022-12-07 11:14:02 +01:00
50f2165c55 Merge branch '7.0.0.rc' into developer 2022-12-06 11:30:14 +01:00
056f650b92 Test for moench done 2022-12-06 11:15:53 +01:00
3d54a4aa26 fix for tests ctb 2022-12-06 11:15:45 +01:00
3a89c2a61e fix tests for gottthard1 2022-12-06 11:15:31 +01:00
570a567a8c fix m3 tests 2022-12-06 11:15:22 +01:00
9874f596f6 fix to tests m3 2022-12-06 10:35:00 +01:00
984a59a9d7 fix tests to not allow setting veto stream at a single module level 2022-12-06 10:34:52 +01:00
e02b11fd1e fix tests to not allow setting udp interfaces at a single module level 2022-12-06 10:08:53 +01:00
68beba732e tests: transmission delay cannot be got for a single module for jf and m3, resetting fpga is not an option to test others 2022-12-05 17:45:00 +01:00
104bc6f619 fixed tests to get headwareversion number instead of serial number to know ic 2.0 jf boards nd also the set master fail only if more than 1 detector (fix intests only) 2022-12-05 17:44:54 +01:00
66cf1825ea fixed tests 2022-12-05 17:44:48 +01:00
d8e497dbb3 fix for changing udp socket buffer size 2022-12-05 17:44:42 +01:00
60502cfa8f datastream help, versions fix for eiger (hardwareversion not impl), fix for tests 2022-12-05 17:44:33 +01:00
b089dc90cd fix for changing udp socket buffer size 2022-12-05 16:34:13 +01:00
4caf10c12b datastream help, versions fix for eiger (hardwareversion not impl), fix for tests 2022-12-05 16:33:59 +01:00
32cbb11bb6 Corrected typo 2022-12-05 12:49:04 +01:00
339cb925c7 removed decrement for sls detector header version number for virtual servers for ctb moench jungfrau g2 and m3 2022-12-02 12:13:13 +01:00
f8a29c3000 reverted versions as the firmware dont increment (#590) 2022-11-29 16:37:28 +01:00
d431443dda allowing jungfrau to continue with just a waning if detid.txt file not found (#589) 2022-11-29 16:28:55 +01:00
748 changed files with 245928 additions and 91247 deletions

View File

@ -1,16 +1,24 @@
---
Checks: '*,
-altera-*,
-android-cloexec-fopen,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-fuchsia*,
-readability-else-after-return,
-readability-avoid-const-params-in-decls,
-readability-identifier-length,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-type-reinterpret-cast,
-llvm-header-guard,
-modernize-use-nodiscard,
-misc-non-private-member-variables-in-classes,
-readability-static-accessed-through-instance,
-readability-braces-around-statements,
-readability-isolate-declaration,
-readability-implicit-bool-conversion,
-readability-identifier-length,
-readability-identifier-naming,
-hicpp-signed-bitwise,
-hicpp-no-array-decay,
-hicpp-braces-around-statements,
@ -18,8 +26,6 @@ Checks: '*,
-google-readability-todo,
-google-readability-braces-around-statements,
-modernize-use-trailing-return-type,
-readability-isolate-declaration,
-readability-implicit-bool-conversion,
-llvmlibc-*'
HeaderFilterRegex: \.h

View File

@ -0,0 +1,29 @@
name: Build on RHEL8
on:
push:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: "ubuntu-latest"
container:
image: gitea.psi.ch/detectors/rhel8-detectors-dev
steps:
- name: Clone repository
run: |
echo Cloning ${{ github.ref_name }}
git clone https://${{secrets.GITHUB_TOKEN}}@gitea.psi.ch/${{ github.repository }}.git --branch=${{ github.ref_name }} .
- name: Build library
run: |
mkdir build && cd build
cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON
make -j 2
- name: C++ unit tests
working-directory: ${{gitea.workspace}}/build
run: ctest

View File

@ -0,0 +1,27 @@
name: Build on RHEL9
on:
push:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: "ubuntu-latest"
container:
image: gitea.psi.ch/detectors/rhel9-detectors-dev
steps:
- uses: actions/checkout@v4
- name: Build library
run: |
mkdir build && cd build
cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON
make -j 2
- name: C++ unit tests
working-directory: ${{gitea.workspace}}/build
run: ctest

47
.github/workflows/cmake.yaml vendored Normal file
View File

@ -0,0 +1,47 @@
name: Native CMake Build
on: [push, pull_request]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
name: Configure and build using cmake
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
cache: 'pip'
- run: pip install pytest numpy
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libhdf5-dev qtbase5-dev qt5-qmake libqt5svg5-dev libpng-dev libtiff-dev
version: 1.0
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSLS_USE_TESTS=ON -DSLS_USE_HDF5=ON -DSLS_USE_GUI=ON -DSLS_USE_MOENCH=ON -DSLS_USE_PYTHON=ON
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build -j4 --config ${{env.BUILD_TYPE}}
- name: C++ unit tests
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} -j1
- name: Python unit tests
working-directory: ${{github.workspace}}/build/bin
run: |
python -m pytest ${{github.workspace}}/python/tests

42
.github/workflows/conda_library.yaml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Build slsdetlib
on: [pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, ] # macos-12, windows-2019]
python-version: ["3.12",]
runs-on: ${{ matrix.platform }}
# The setup-miniconda action needs this to activate miniconda
defaults:
run:
shell: "bash -l {0}"
steps:
- uses: actions/checkout@v4
- name: Get conda
uses: conda-incubator/setup-miniconda@v3.0.4
with:
python-version: ${{ matrix.python-version }}
channels: conda-forge
- name: Prepare
run: conda install conda-build conda-verify pytest anaconda-client
- name: Disable upload
run: conda config --set anaconda_upload no
- name: Build
run: conda build conda-recipes/main-library --output-folder build_output
- name: Upload all Conda packages
uses: actions/upload-artifact@v4
with:
name: conda-packages
path: build_output/** # Uploads all packages

42
.github/workflows/conda_python.yaml vendored Normal file
View File

@ -0,0 +1,42 @@
name: slsdet
on: [pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, ] # macos-12, windows-2019]
python-version: ["3.12",]
runs-on: ${{ matrix.platform }}
# The setup-miniconda action needs this to activate miniconda
defaults:
run:
shell: "bash -l {0}"
steps:
- uses: actions/checkout@v4
- name: Get conda
uses: conda-incubator/setup-miniconda@v3.0.4
with:
python-version: ${{ matrix.python-version }}
channels: conda-forge
- name: Prepare
run: conda install conda-build conda-verify pytest anaconda-client
- name: Disable upload
run: conda config --set anaconda_upload no
- name: Build
run: conda build conda-recipes/python-client --output-folder build_output
- name: Upload all Conda packages
uses: actions/upload-artifact@v4
with:
name: conda-packages
path: build_output/** # Uploads all packages

2
.gitignore vendored
View File

@ -9,7 +9,7 @@ bin/
*.o
*.so
.*
build
build/
RELEASE.txt
Testing/

View File

@ -1,15 +1,100 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.15)
project(slsDetectorPackage)
set(PROJECT_VERSION 7.0.3)
# Read VERSION file into project version
set(VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/VERSION")
file(READ "${VERSION_FILE}" VERSION_CONTENT)
string(STRIP "${VERSION_CONTENT}" PROJECT_VERSION_STRING)
set(PROJECT_VERSION ${PROJECT_VERSION_STRING})
# Pass it to the compiler
add_compile_definitions(SLS_DET_VERSION="${PROJECT_VERSION}")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
cmake_policy(SET CMP0074 NEW)
if (${CMAKE_VERSION} VERSION_GREATER "3.24")
cmake_policy(SET CMP0135 NEW) #Fetch content download timestamp
endif()
include(cmake/project_version.cmake)
include(cmake/SlsAddFlag.cmake)
include(cmake/SlsFindZeroMQ.cmake)
include(cmake/helpers.cmake)
# Using FetchContent to get libzmq
include(FetchContent)
option(SLS_FETCH_ZMQ_FROM_GITHUB "Fetch zmq from github" OFF)
option(SLS_FETCH_PYBIND11_FROM_GITHUB "Fetch pybind11 from github" OFF)
# Allow FetchContent_Populate to be called with a single argument
# otherwise deprecated warning is issued
# Note: From cmake 3.28 we can pass EXCLUDE_FROM_ALL to FetchContent_Declare
# and avoid direct use of Populate
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.30")
cmake_policy(SET CMP0169 OLD)
endif()
# Patch libzmq to set minimum cmake version to 3.15 to avoid warnings
# with newer cmake versions
# Patch is applied in the FetchContent_Declare
set(SLS_LIBZMQ_VERSION "4.3.4")
find_program(PATCH_EXECUTABLE patch)
if(NOT PATCH_EXECUTABLE)
message(FATAL_ERROR "The 'patch' tool is required for patching lib zeromq. Please install it.")
endif()
if(SLS_FETCH_ZMQ_FROM_GITHUB)
# Opt in to pull down a zmq version from github instead of
# using the bundled version
FetchContent_Declare(
libzmq
GIT_REPOSITORY https://github.com/zeromq/libzmq.git
GIT_TAG v${SLS_LIBZMQ_VERSION}
PATCH_COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq_cmake_version.patch
UPDATE_DISCONNECTED 1
)
else()
# Standard behaviour use libzmq included in this repo (libs/libzmq)
FetchContent_Declare(
libzmq
URL ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq-${SLS_LIBZMQ_VERSION}.tar.gz
URL_HASH MD5=cc20b769ac10afa352e5ed2769bb23b3
PATCH_COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq_cmake_version.patch
UPDATE_DISCONNECTED 1
)
endif()
# Disable unwanted options from libzmq
set(BUILD_TESTS OFF CACHE BOOL "Switch off libzmq test build")
set(BUILD_SHARED OFF CACHE BOOL "Switch off libzmq shared libs")
set(WITH_PERF_TOOL OFF CACHE BOOL "")
set(ENABLE_CPACK OFF CACHE BOOL "")
set(ENABLE_CLANG OFF CACHE BOOL "")
set(ENABLE_CURVE OFF CACHE BOOL "")
set(ENABLE_DRAFTS OFF CACHE BOOL "")
set(ENABLE_PRECOMPILED OFF CACHE BOOL "")
set(WITH_DOC OFF CACHE BOOL "")
set(WITH_DOCS OFF CACHE BOOL "")
# Using GetProperties and Populate to be able to exclude zmq
# from install (not possible with FetchContent_MakeAvailable(libzmq))
FetchContent_GetProperties(libzmq)
if(NOT libzmq_POPULATED)
FetchContent_Populate(libzmq)
add_subdirectory(${libzmq_SOURCE_DIR} ${libzmq_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
include(GNUInstallDirs)
# If conda build, always set lib dir to 'lib'
@ -55,6 +140,7 @@ option(SLS_BUILD_EXAMPLES "examples" OFF)
option(SLS_TUNE_LOCAL "tune to local machine" OFF)
option(SLS_DEVEL_HEADERS "install headers for devel" OFF)
option(SLS_USE_MOENCH "compile zmq and post processing for Moench" OFF)
option(SLS_USE_JUNGFRAU "compile post processing for Jungfrau" OFF)
#Convenience option to switch off defaults when building Moench binaries only
option(SLS_BUILD_ONLY_MOENCH "compile only Moench" OFF)
@ -68,6 +154,18 @@ if(SLS_BUILD_ONLY_MOENCH)
set(SLS_USE_MOENCH ON CACHE BOOL "Enable" FORCE)
endif()
#Convenience option to switch off defaults when building Jungfrau binaries only
option(SLS_BUILD_ONLY_JUNGFRAU "compile only Jungfrau" OFF)
if(SLS_BUILD_ONLY_JUNGFRAU)
message(STATUS "Build JUNGFRAU binaries only!")
set(SLS_BUILD_SHARED_LIBRARIES OFF CACHE BOOL "Disabled for JUNGFRAU_ONLY" FORCE)
set(SLS_USE_TEXTCLIENT OFF CACHE BOOL "Disabled for JUNGFRAU_ONLY" FORCE)
set(SLS_USE_DETECTOR OFF CACHE BOOL "Disabled for JUNGFRAU_ONLY" FORCE)
set(SLS_USE_RECEIVER OFF CACHE BOOL "Disabled for JUNGFRAU_ONLY" FORCE)
set(SLS_USE_RECEIVER_BINARIES OFF CACHE BOOL "Disabled for JUNGFRAU_ONLY" FORCE)
set(SLS_USE_JUNGFRAU ON CACHE BOOL "Enable" FORCE)
endif()
option(SLS_EXT_BUILD "external build of part of the project" OFF)
if(SLS_EXT_BUILD)
@ -88,7 +186,6 @@ set(SLS_INTERNAL_QWT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/qwt-6.1.5)
set(ClangFormat_EXCLUDE_PATTERNS "build/"
"libs/"
"slsDetectorCalibration/"
"ctbGui/"
"manual/"
"python/"
"sample/"
@ -97,11 +194,9 @@ find_package(ClangFormat)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)" FORCE)
endif()
default_build_type("Release")
set_std_fs_lib()
message(STATUS "Extra linking to fs lib:${STD_FS_LIB}")
#Enable LTO if available
include(CheckIPOSupported)
@ -124,7 +219,7 @@ endif()
# to control options for the libraries
if(NOT TARGET slsProjectOptions)
add_library(slsProjectOptions INTERFACE)
target_compile_features(slsProjectOptions INTERFACE cxx_std_11)
target_compile_features(slsProjectOptions INTERFACE cxx_std_17)
endif()
if (NOT TARGET slsProjectWarnings)
@ -172,6 +267,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()
@ -180,10 +277,11 @@ endif()
if(SLS_USE_SANITIZER)
target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined -fno-omit-frame-pointer)
target_link_libraries(slsProjectOptions INTERFACE -fsanitize=address,undefined)
# target_compile_options(slsProjectOptions INTERFACE -fsanitize=thread)
# target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread)
#target_compile_options(slsProjectOptions INTERFACE -fsanitize=thread -fno-omit-frame-pointer)
#target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread)
endif()
if(SLS_TUNE_LOCAL)
target_compile_options(slsProjectOptions INTERFACE -mtune=native -march=native)
endif()
@ -202,10 +300,6 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INSTALL_RPATH $ORIGIN)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
custom_find_zmq()
if (SLS_USE_TESTS)
enable_testing()
add_subdirectory(tests)
@ -238,18 +332,41 @@ if (SLS_USE_INTEGRATION_TESTS)
endif (SLS_USE_INTEGRATION_TESTS)
if (SLS_USE_PYTHON)
find_package (Python 3.6 COMPONENTS Interpreter Development)
add_subdirectory(libs/pybind ${CMAKE_BINARY_DIR}/bin/)
find_package (Python 3.8 COMPONENTS Interpreter Development.Module REQUIRED)
set(PYBIND11_FINDPYTHON ON) # Needed for RH8
if(SLS_FETCH_PYBIND11_FROM_GITHUB)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v2.13.6
)
else()
# https://github.com/pybind/pybind11/releases
FetchContent_Declare(
pybind11
URL ${CMAKE_CURRENT_SOURCE_DIR}/libs/pybind11/v2.13.6.tar.gz
URL_HASH MD5=a04dead9c83edae6d84e2e343da7feeb
)
endif()
FetchContent_MakeAvailable(pybind11)
add_subdirectory(python)
endif(SLS_USE_PYTHON)
if (SLS_USE_CTBGUI)
add_subdirectory(ctbGui)
add_subdirectory(pyctbgui)
endif(SLS_USE_CTBGUI)
configure_file( .clang-tidy
${CMAKE_BINARY_DIR}/.clang-tidy
)
# Workaround for file note being copied to build directory
# when issuing a python -m build
# TODO! Proper fix
if(EXISTS ".clang-tidy")
configure_file(.clang-tidy
${CMAKE_BINARY_DIR}/.clang-tidy
)
endif()
if (SLS_BUILD_EXAMPLES)
add_subdirectory(sample)
@ -264,8 +381,13 @@ if(SLS_USE_MOENCH)
add_subdirectory(slsDetectorCalibration/moenchExecutables)
endif(SLS_USE_MOENCH)
if(SLS_USE_JUNGFRAU)
add_subdirectory(slsDetectorCalibration/tiffio)
add_subdirectory(slsDetectorCalibration/jungfrauExecutables)
endif(SLS_USE_JUNGFRAU)
if(SLS_MASTER_PROJECT)
set(CMAKE_INSTALL_DIR "share/cmake/${PROJECT_NAME}")
set(PROJECT_LIBRARIES slsSupportShared slsDetectorShared slsReceiverShared)
include(cmake/package_config.cmake)
endif()
endif()

124
README.md
View File

@ -2,7 +2,11 @@
Before building from source make sure that you have the [software wiki](https://slsdetectorgroup.github.io/devdoc/dependencies.html) installed. If installing using conda, conda will manage the dependencies. Avoid also installing packages with pip.
## Documentaion
Detailed documentation can be found in the [software wiki](https://slsdetectorgroup.github.io/devdoc/index.html) and on the [official site](https://www.psi.ch/en/detectors/software).
Detailed documentation including installation can be found in the [software wiki](https://slsdetectorgroup.github.io/devdoc/index.html).
Different releases can be found on the [official site](https://www.psi.ch/en/lxn/software-releases).
Firmware compatiblity can be found in [firmware page](https://github.com/slsdetectorgroup/slsDetectorFirmware)
## Installation
@ -42,33 +46,20 @@ conda search slsdet
conda search slsdetgui
```
### 2. Build from source
## 2. Build from source
##### 2.1 Download Source Code from github
### 2.1 Download Source Code from github
```
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git --branch 7.0.0
```
**Pybind for Python**<br>
* **v7.0.0+**:
pybind11 packaged into 'libs/pybind'. No longer a submodule. No need for "recursive" or "submodule update".
* **Older versions**:
pybind11 is a submodule. Must be cloned using "recursive" and updated when switching between versions using the following commands.
```
# clone using recursive to get pybind11 submodule
git clone --recursive https://github.com/slsdetectorgroup/slsDetectorPackage.git
# update submodule when switching between releases
cd slsDetectorPackage
git submodule update --init
```
##### 2.2 Build from source
> **Note:** For v6.x.x of slsDetectorPackage and older, refer [pybind11 notes on cloning](#Pybind-and-Zeromq).
###### Build using CMake
### 2.2 Build from source
### Build using CMake
```
# outside slsDetecorPackage folder
@ -94,26 +85,28 @@ Instead of the cmake command, one can use ccmake to get a list of options to con
ccmake ..
# choose the options
# first press [c] - configure
# first press [c] - configure (unil you see [g])
# then press [g] - generate
```
|Example cmake options|Comment|
|---|---|
| -DSLS_USE_PYTHON=ON | Python |
| -DPython_FIND_VIRTUALENV=ONLY | Python from only the conda environment |
| -DZeroMQ_HINT=/usr/lib64 | Use system zmq instead |
| -DPython_FIND_VIRTUALENV=ONLY | Python from only the conda env |
| -DSLS_USE_GUI=ON | GUI |
| -DSLS_USE_HDF5=ON | HDF5 |
| -DSLS_USE_SIMULATOR=ON | Simulator |
> **Note:** For v7.x.x of slsDetectorPackage and older, refer [zeromq notes for cmake option to hint library location](#Pybind-and-Zeromq).
###### Build using in-built cmk.sh script
### Build using in-built cmk.sh script
```
The binaries are generated in slsDetectorPackage/build/bin directory.
Usage: ./cmk.sh [-b] [-c] [-d <HDF5 directory>] [e] [g] [-h] [i] [-j <Number of threads>]
[-k <CMake command>] [-l <Install directory>] [m] [n] [-p] [-q <Zmq hint directory>]
[r] [s] [t] [u] [z]
Usage: $0 [-b] [-c] [-d <HDF5 directory>] [-e] [-g] [-h] [-i]
[-j <Number of threads>] [-k <CMake command>] [-l <Install directory>]
[-m] [-n] [-p] [-r] [-s] [-t] [-u] [-z]
-[no option]: only make
-b: Builds/Rebuilds CMake files normal mode
-c: Clean
@ -128,14 +121,13 @@ Usage: ./cmk.sh [-b] [-c] [-d <HDF5 directory>] [e] [g] [-h] [i] [-j <Number of
-m: Manuals
-n: Manuals without compiling doxygen (only rst)
-p: Builds/Rebuilds Python API
-q: Zmq hint directory
-r: Build/Rebuilds only receiver
-s: Simulator
-t: Build/Rebuilds only text client
-u: Chip Test Gui
-z: Moench zmq processor
# display all options
./cmk.sh -?
@ -145,11 +137,14 @@ Usage: ./cmk.sh [-b] [-c] [-d <HDF5 directory>] [e] [g] [-h] [i] [-j <Number of
# new build, python and compile in parallel:
./cmk.sh -cbpj5
#To use the system zmq (/usr/lib64) instead
./cmk.sh -cbj5 -q /usr/lib64
#For rebuilding only certain sections
./cmk.sh -tg #only text client and gui
./cmk.sh -r #only receiver
```
###### Build on old distributions
> **Note:** For v7.x.x of slsDetectorPackage and older, refer [zeromq notes for cmk script option to hint library location](#Pybind-and-Zeromq).
### Build on old distributions
If your linux distribution doesn't come with a C++11 compiler (gcc>4.8) then
it's possible to install a newer gcc using conda and build the slsDetectorPackage
@ -166,7 +161,10 @@ cmake ../slsDetectorPackage -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
make -j12
```
###### Build slsDetectorGui (Qt5)
> **Note:** For v7.x.x of slsDetectorPackage and older, refer [zeromq notes for dependencies for conda](#Pybind-and-Zeromq).
### Build slsDetectorGui (Qt5)
1. Using pre-built binary on conda
```
@ -180,7 +178,14 @@ yum install qt5-qtbase-devel.x86_64
yum install qt5-qtsvg-devel.x86_64
```
3. Using conda
3. Using system installation on RHEL8
```
yum install qt5-qtbase-devel.x86_64
yum install qt5-qtsvg-devel.x86_64
yum install expat-devel.x86_64
```
4. Using conda
```
#Add channels for dependencies and our library
conda config --add channels conda-forge
@ -208,13 +213,15 @@ cd slsDetectorPackage
./cmk.sh -cbgj9
```
###### Build documentation from package
> **Note:** For v7.x.x of slsDetectorPackage and older, refer [zeromq notes for dependencies for conda](#Pybind-and-Zeromq).
### Build documentation from package
The documentation for the slsDetectorPackage is build using a combination
of Doxygen, Sphinx and Breathe. The easiest way to install the dependencies
is to use conda
```
conda create -n myenv python sphinx_rtd_theme breathe
conda create -n myenv python=3.12 sphinx sphinx_rtd_theme breathe doxygen numpy
```
```
@ -228,6 +235,47 @@ make rst # rst only, saves time in case the API did not change
```
## Pybind and Zeromq
### Pybind11 for Python
**v8.0.0+**:
pybind11 is built
* by default from tar file in repo (libs/pybind/v2.1x.0.tar.gz)
* or use advanced option SLS_FETCH_PYBIND11_FROM_GITHUB [link].
* v9.0.0+: pybind11 (v2.13.6)
* v8.x.x : pybind11 (v2.11.0)
**v7.x.x**:
pybind11 packaged into libs/pybind. No longer a submodule. No need for “recursive” or “submodule update”.
**Older versions**:
pybind11 is a submodule. Must be cloned using “recursive” and updated when switching between versions using the following commands.
```
# Note: Only for v6.x.x versions and older
# clone using recursive to get pybind11 submodule
git clone --recursive https://github.com/slsdetectorgroup/slsDetectorPackage.git
# update submodule when switching between releases
cd slsDetectorPackage
git submodule update --init
```
### Zeromq
**v8.0.0+**:
zeromq (v4.3.4) is built
* by default from tar file in repo (libs/libzmq/libzmq-4.3.4.tar.gz)
* or use advanced option SLS_FETCH_ZMQ_FROM_GITHUB [link].
**v7.x.x and older**:
zeromq-devel must be installed and one can hint its location using
* cmake option:-DZeroMQ_HINT=/usr/lib64 or
* option -q in cmk.sh script: : ./cmk.sh -cbj5 -q /usr/lib64
* zeromq dependency added when installing using conda
## Support
dhanya.thattil@psi.ch
erik.frojdh@psi.ch
erik.frojdh@psi.ch

View File

@ -1,148 +1,57 @@
SLS Detector Package Major Release 7.0.3 released on 14.11.2023
SLS Detector Package Major Release x.x.x released on xx.xx.202x
===============================================================
This document describes the differences between v7.0.3 and v7.0.2
This document describes the differences between vx.x.x and vx.0.2
CONTENTS
--------
1 Resolved Issues
2 On-board Detector Server Compatibility
3 Firmware Requirements
4 Kernel Requirements
5 Download, Documentation & Support
1 New, Changed or Resolved Features
1.1 Compilation
1.2 Callback
1.3 Python
1.4 Client
1.5 Detector Server
1.6 Simulator
1.7 Receiver
1.8 Gui
2 On-board Detector Server Compatibility
3 Firmware Requirements
4 Kernel Requirements
5 Download, Documentation & Support
1 Resolved Issues
=================
Firmware
--------
* [Eiger] Blocking trigger on quad
Previously, blocking software trigger on a quad was not blocking. Fixed
with firmware v32.
Client
------
* Limit port number max to 65535
Previously, one could set the port numbers (TCP, UDP, ZMQ) to values
higher than 65535 and also to 0. However, it was truncated to 16 bit
in the background, but not relayed to the user.
Now, it will throw if it is 0 or greater than 65535 (16 bit).
* Stopping acqusition for a single or subset of modules
The Detector API previously stopped all modules.
Now, it takes into account which modules the user wanted to stop.
* [Jungfrau] Stop in sync mode
When stopping acquisition in sync mode, only the master module sometimes
returns 'Idle' state instead of 'Stopped'. The software threw an
exception for the different states then.
Now, it does not throw and a fix will be added to the next firmware
release for the different states (with SW release: v8.0.0).
* [Eiger] Incorrect error message in Stop
When stopping acquisition, if a half module were to give an error in a
rare case while the others succeeded, this would result in an re-attempt
to stop 9 more times before throwing an incorrect exception messsage that
it could not stop.
Now, it is handled and will throw an exception of the error status
immediately.
Receiver
--------
* Limit TCP port number (command line) to max of 65535
Refer issue under 'Client'.
Detector Simulator
------------------
* Limit TCP port number (command line) to max of 65535
Refer issue under 'Client'.
* Some commands such as 'readnrows' would complain that it cannot be set
because the detector is not idle, but was setting it anyway. Fixed.
Gui/ Client Callback
--------------------
* [Jungfrau] Gui: corrected color map of gain plot
Previously, color on the gain plot did not update after the first image,
unless there were x/y min/max changes or window resizing. Fixed.
* [Jungfrau] Acquisition finished callback error status in sync mode
When stopping acquisition in multi module Jungfrau sync mode,
different status (master 'idle' and slaves 'stopped' in
firmware 2.4.1 or 1.4.1) show as 'error' in acquisition finished call
back (mainly used for gui). This is fixed.
* [Jungfrau] Gui: Next frame number shown as 0 for inconsistency
When stopping an acquisition in a multi module Jungfrau, the next
frame numbers might be different, for which the Gui shows an error message
but keeps the number as 0. Now, it is fixed to show -1 for inconsistency
and error message shown. So, setting 0 will also prompt an error message
that 0 is an invalid input.
Data Processing
---------------
* [Moench] Segmentation fault with moench03RawDataPrcess
Previously, it crashed when nframes > 0. Fixed.
* [Moench] Interpolation issues fixed.
* [Moench] When receiver in discard_partial mode and gets an empty frame,
it sends a zmq packet with header and no data. This is handled in post
processing as a temporary solution.
1 New, Changed or Resolved Features
=====================================
2 On-board Detector Server Compatibility
==========================================
Eiger 7.0.3
Jungfrau 7.0.3
Mythen3 7.0.3
Gotthard2 7.0.3
Gotthard 7.0.3
Moench 7.0.3
Ctb 7.0.3
Eiger 9.0.0
Jungfrau 9.0.0
Mythen3 9.0.0
Gotthard2 9.0.0
Moench 9.0.0
On-board Detector Server Upgrade
--------------------------------
From v6.1.0 (without tftp):
Using command 'updatedetectorserver'
From 5.0.0 (with tftp):
Using command 'copydetectorserver'
update only on-board detector server
Using command 'updatedetectorserver'
udpate both on-board detector server and firmware simultaneously
Using command 'update'
Instructions available at
https://slsdetectorgroup.github.io/devdoc/serverupgrade.html
@ -156,19 +65,14 @@ This document describes the differences between v7.0.3 and v7.0.2
Eiger 02.10.2023 (v32) (updated in 7.0.3)
Jungfrau 16.05.2023 (v1.4.1, HW v1.0) (updated in 7.0.2)
15.05.2023 (v2.4.1, HW v2.0) (updated in 7.0.2)
Jungfrau 20.09.2023 (v1.5, HW v1.0) (updated in 8.0.0)
21.09.2023 (v2.5, HW v2.0) (updated in 8.0.0)
Mythen3 24.01.2023 (v1.4) (updated in 7.0.0)
Mythen3 11.10.2024 (v1.5) (updated in 9.0.0)
Gotthard2 23.11.2022 (v0.3) (updated in 7.0.0)
Gotthard2 03.10.2024 (v1.0) (updated in 9.0.0)
Gotthard 08.02.2018 (50um and 25um Master)
09.02.2018 (25 um Slave)
Moench 05.12.2022 (v0.3) (updated in 7.0.0)
Ctb 05.12.2022 (v1.1) (updated in 7.0.0)
Moench 26.10.2023 (v2.0) (updated in 9.0.0)
Detector Upgrade
@ -181,15 +85,12 @@ This document describes the differences between v7.0.3 and v7.0.2
Mythen3 via command <.rbf>
Gotthard2 via command <.rbf>
Moench via command <.pof>
Ctb via command <.pof>
Gotthard cannot be upgraded remotely
Except Eiger,
upgrade
Using command 'programfpga' or
udpate both server and firmware simultaneously
udpate both on-board detector server and firmware simultaneously
Using command 'update'
@ -202,6 +103,7 @@ This document describes the differences between v7.0.3 and v7.0.2
4 Kernel Requirements
======================
Blackfin
--------
Latest version: Fri Oct 29 00:00:00 2021
@ -209,10 +111,12 @@ This document describes the differences between v7.0.3 and v7.0.2
Older ones will work, but might have issues with programming firmware via
the package.
Nios
-----
Compatible version: Mon May 10 18:00:21 CEST 2021
Kernel Upgrade
---------------
Eiger via bit files
@ -302,4 +206,3 @@ This document describes the differences between v7.0.3 and v7.0.2
dhanya.thattil@psi.ch
erik.frojdh@psi.ch

1
VERSION Normal file
View File

@ -0,0 +1 @@
0.0.0

1
bash_autocomplete.sh Symbolic link
View File

@ -0,0 +1 @@
slsDetectorSoftware/generator/autocomplete/bash_autocomplete.sh

View File

@ -25,7 +25,9 @@ mark_as_advanced(
ClangFormat_BIN)
if(ClangFormat_FOUND)
exec_program(${ClangFormat_BIN} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE CLANG_VERSION_TEXT)
execute_process(COMMAND ${ClangFormat_BIN} --version
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE CLANG_VERSION_TEXT)
string(REGEX MATCH "([0-9]+)\\.[0-9]+\\.[0-9]+" CLANG_VERSION ${CLANG_VERSION_TEXT})
if((${CLANG_VERSION} GREATER "9") OR (${CLANG_VERSION} EQUAL "9"))
# A CMake script to find all source files and setup clang-format targets for them

View File

@ -1,38 +0,0 @@
function(custom_find_zmq)
set(ZeroMQ_HINT "" CACHE STRING "Hint where ZeroMQ could be found")
#Adapted from: https://github.com/zeromq/cppzmq/
if (NOT TARGET libzmq)
if(ZeroMQ_HINT)
message(STATUS "Looking for ZeroMQ in: ${ZeroMQ_HINT}")
find_package(ZeroMQ 4
NO_DEFAULT_PATH
HINTS ${ZeroMQ_HINT}
)
else()
find_package(ZeroMQ 4 QUIET)
endif()
# libzmq autotools install: fallback to pkg-config
if(ZeroMQ_FOUND)
message(STATUS "Found libzmq using find_package")
else()
message(STATUS "CMake libzmq package not found, trying again with pkg-config (normal install of zeromq)")
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake/libzmq-pkg-config)
find_package(ZeroMQ 4 REQUIRED)
endif()
# TODO "REQUIRED" above should already cause a fatal failure if not found, but this doesn't seem to work
if(NOT ZeroMQ_FOUND)
message(FATAL_ERROR "ZeroMQ was not found, neither as a CMake package nor via pkg-config")
endif()
if (ZeroMQ_FOUND AND NOT TARGET libzmq)
message(FATAL_ERROR "ZeroMQ version not supported!")
endif()
endif()
get_target_property(VAR libzmq IMPORTED_LOCATION)
message(STATUS "Using libzmq: ${VAR}")
endfunction()

46
cmake/helpers.cmake Normal file
View File

@ -0,0 +1,46 @@
function(default_build_type val)
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE ${val} CACHE STRING "Build type (default ${val})" FORCE)
endif()
endfunction()
function(set_std_fs_lib)
# from pybind11
# Check if we need to add -lstdc++fs or -lc++fs or nothing
if(DEFINED CMAKE_CXX_STANDARD AND CMAKE_CXX_STANDARD LESS 17)
set(STD_FS_NO_LIB_NEEDED TRUE)
elseif(MSVC)
set(STD_FS_NO_LIB_NEEDED TRUE)
else()
file(
WRITE ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
"#include <filesystem>\nint main(int argc, char ** argv) {\n std::filesystem::path p(argv[0]);\n return p.string().length();\n}"
)
try_compile(
STD_FS_NO_LIB_NEEDED ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
COMPILE_DEFINITIONS -std=c++17)
try_compile(
STD_FS_NEEDS_STDCXXFS ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
COMPILE_DEFINITIONS -std=c++17
LINK_LIBRARIES stdc++fs)
try_compile(
STD_FS_NEEDS_CXXFS ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
COMPILE_DEFINITIONS -std=c++17
LINK_LIBRARIES c++fs)
endif()
if(${STD_FS_NEEDS_STDCXXFS})
set(STD_FS_LIB stdc++fs PARENT_SCOPE)
elseif(${STD_FS_NEEDS_CXXFS})
set(STD_FS_LIB c++fs PARENT_SCOPE)
elseif(${STD_FS_NO_LIB_NEEDED})
set(STD_FS_LIB "" PARENT_SCOPE)
else()
message(WARNING "Unknown C++17 compiler - not passing -lstdc++fs")
set(STD_FS_LIB "")
endif()
endfunction()

View File

@ -1,36 +0,0 @@
#From: https://github.com/zeromq/cppzmq/
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
find_package(PkgConfig)
pkg_check_modules(PC_LIBZMQ QUIET libzmq)
set(ZeroMQ_VERSION ${PC_LIBZMQ_VERSION})
find_path(ZeroMQ_INCLUDE_DIR zmq.h
PATHS ${ZeroMQ_DIR}/include
${PC_LIBZMQ_INCLUDE_DIRS}
)
find_library(ZeroMQ_LIBRARY
NAMES zmq
PATHS ${ZeroMQ_DIR}/lib
${PC_LIBZMQ_LIBDIR}
${PC_LIBZMQ_LIBRARY_DIRS}
)
if(ZeroMQ_LIBRARY OR ZeroMQ_STATIC_LIBRARY)
set(ZeroMQ_FOUND ON)
message(STATUS "Found libzmq using PkgConfig")
endif()
set ( ZeroMQ_LIBRARIES ${ZeroMQ_LIBRARY} )
set ( ZeroMQ_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIR} )
if (NOT TARGET libzmq)
add_library(libzmq UNKNOWN IMPORTED)
set_target_properties(libzmq PROPERTIES
IMPORTED_LOCATION ${ZeroMQ_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${ZeroMQ_INCLUDE_DIRS})
endif()
include ( FindPackageHandleStandardArgs )
find_package_handle_standard_args ( ZeroMQ DEFAULT_MSG ZeroMQ_LIBRARIES ZeroMQ_INCLUDE_DIRS )

View File

@ -25,11 +25,6 @@ install(FILES
DESTINATION ${CMAKE_INSTALL_DIR}
)
install(FILES
"${CMAKE_SOURCE_DIR}/cmake/libzmq-pkg-config/FindZeroMQ.cmake"
COMPONENT devel
DESTINATION ${CMAKE_INSTALL_DIR}/libzmq-pkg-config
)
if (PROJECT_LIBRARIES OR PROJECT_STATIC_LIBRARIES)
install(

View File

@ -13,17 +13,6 @@ include(CMakeFindDependencyMacro)
set(SLS_USE_HDF5 "@SLS_USE_HDF5@")
find_package(ZeroMQ 4 QUIET)
# libzmq autotools install: fallback to pkg-config
if(NOT ZeroMQ_FOUND)
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/libzmq-pkg-config)
find_package(ZeroMQ 4 REQUIRED)
endif()
if(NOT ZeroMQ_FOUND)
message(FATAL_ERROR "ZeroMQ was NOT found!")
endif()
find_dependency(Threads)
# Add optional dependencies here

15
cmk.sh
View File

@ -18,7 +18,6 @@ CTBGUI=0
MANUALS=0
MANUALS_ONLY_RST=0
MOENCHZMQ=0
ZMQ_HINT_DIR=""
CLEAN=0
@ -27,7 +26,7 @@ CMAKE_PRE=""
CMAKE_POST=""
usage() { echo -e "
Usage: $0 [-b] [-c] [-d <HDF5 directory>] [e] [g] [-h] [i] [-j <Number of threads>] [-k <CMake command>] [-l <Install directory>] [m] [n] [-p] [-q <Zmq hint directory>] [r] [s] [t] [u] [z]
Usage: $0 [-b] [-c] [-d <HDF5 directory>] [-e] [-g] [-h] [-i] [-j <Number of threads>] [-k <CMake command>] [-l <Install directory>] [-m] [-n] [-p] [-r] [-s] [-t] [-u] [-z]
-[no option]: only make
-b: Builds/Rebuilds CMake files normal mode
-c: Clean
@ -42,7 +41,6 @@ Usage: $0 [-b] [-c] [-d <HDF5 directory>] [e] [g] [-h] [i] [-j <Number of thread
-m: Manuals
-n: Manuals without compiling doxygen (only rst)
-p: Builds/Rebuilds Python API
-q: Zmq hint directory
-r: Build/Rebuilds only receiver
-s: Simulator
-t: Build/Rebuilds only text client
@ -140,10 +138,6 @@ while getopts ":bcd:eghij:k:l:mnpq:rstuz" opt ; do
PYTHON=1
REBUILD=1
;;
q)
echo "Zmq hint directory: $OPTARG"
ZMQ_HINT_DIR=$OPTARG
;;
r)
echo "Compiling Options: Receiver"
RECEIVER=1
@ -260,13 +254,6 @@ if [ $TESTS -eq 1 ]; then
echo "Tests Option enabled"
fi
#zmq hint dir
if [ -n "$ZMQ_HINT_DIR" ]; then
CMAKE_POST+=" -DZeroMQ_HINT="$ZMQ_HINT_DIR
CMAKE_POST+=" -DZeroMQ_DIR="
# echo "Enabling Zmq Hint Directory: $ZMQ_HINT_DIR"
fi
#hdf5 rebuild
if [ $HDF5 -eq 1 ]; then
# CMAKE_PRE+="HDF5_ROOT="$HDF5DIR

View File

@ -1,6 +0,0 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
echo "|<-------- starting python build"
cd python
${PYTHON} setup.py install

View File

@ -1,7 +0,0 @@
python:
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12

View File

@ -1,11 +0,0 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
mkdir $PREFIX/lib
mkdir $PREFIX/bin
mkdir $PREFIX/include
cp build/bin/ctbGui $PREFIX/bin/.
cp build/bin/libctbRootLib.so $PREFIX/lib/.

View File

@ -1,131 +0,0 @@
package:
name: sls_detector_software
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
source:
- path: ..
build:
number: 0
binary_relocation: True
rpaths:
- lib/
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- cmake
- qt 5.*
- zeromq
- xorg-libx11
- xorg-libice
- xorg-libxext
- xorg-libsm
- xorg-libxau
- xorg-libxrender
- xorg-libxfixes
- {{ cdt('mesa-libgl-devel') }} # [linux]
- {{ cdt('mesa-libegl-devel') }} # [linux]
- {{ cdt('mesa-dri-drivers') }} # [linux]
- {{ cdt('libselinux') }} # [linux]
- {{ cdt('libxdamage') }} # [linux]
- {{ cdt('libxxf86vm') }} # [linux]
- expat
host:
- libstdcxx-ng
- libgcc-ng
- zeromq
- xorg-libx11
- xorg-libice
- xorg-libxext
- xorg-libsm
- xorg-libxau
- xorg-libxrender
- xorg-libxfixes
- expat
run:
- zeromq
- libstdcxx-ng
- libgcc-ng
outputs:
- name: slsdetlib
script: copy_lib.sh
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- libstdcxx-ng
- libgcc-ng
- zeromq
host:
- zeromq
run:
- libstdcxx-ng
- libgcc-ng
- zeromq
- name: slsdet
script: build_pylib.sh
requirements:
build:
- python
- {{ compiler('c') }}
- {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }}
- setuptools
host:
- python
- {{ pin_subpackage('slsdetlib', exact=True) }}
run:
- libstdcxx-ng
- libgcc-ng
- python
- numpy
- {{ pin_subpackage('slsdetlib', exact=True) }}
test:
imports:
- slsdet
- name: slsdetgui
script: copy_gui.sh
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }}
run:
- {{ pin_subpackage('slsdetlib', exact=True) }}
- qt 5.*
- expat
- name: moenchzmq
script: copy_moench.sh
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }}
run:
- {{ pin_subpackage('slsdetlib', exact=True) }}
- expat

View File

@ -1,3 +0,0 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
ctest -j2

View File

@ -1,10 +1,14 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
mkdir build
mkdir install
if [ ! -d "build" ]; then
mkdir build
fi
if [ ! -d "install" ]; then
mkdir install
fi
cd build
cmake .. \
cmake .. -G Ninja \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
-DCMAKE_INSTALL_PREFIX=install \
-DSLS_USE_TEXTCLIENT=ON \
@ -14,7 +18,7 @@ cmake .. \
-DSLS_USE_TESTS=ON \
-DSLS_USE_PYTHON=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DSLS_USE_HDF5=OFF\
-DSLS_USE_HDF5=OFF \
NCORES=$(getconf _NPROCESSORS_ONLN)
echo "Building using: ${NCORES} cores"

View File

@ -0,0 +1,13 @@
c_compiler:
- gcc # [linux]
c_stdlib:
- sysroot # [linux]
cxx_compiler:
- gxx # [linux]
c_stdlib_version: # [linux]
- 2.17 # [linux]

View File

@ -4,18 +4,20 @@
mkdir -p $PREFIX/lib
mkdir -p $PREFIX/bin
mkdir -p $PREFIX/include/sls
# mkdir $PREFIX/include/slsDetectorPackage
#Shared and static libraries
cp build/install/lib/* $PREFIX/lib/
#Binaries
cp build/install/bin/sls_detector_acquire $PREFIX/bin/.
cp build/install/bin/sls_detector_acquire_zmq $PREFIX/bin/.
cp build/install/bin/sls_detector_get $PREFIX/bin/.
cp build/install/bin/sls_detector_put $PREFIX/bin/.
cp build/install/bin/sls_detector_help $PREFIX/bin/.
cp build/install/bin/sls_detector $PREFIX/bin/.
cp build/install/bin/slsReceiver $PREFIX/bin/.
cp build/install/bin/slsMultiReceiver $PREFIX/bin/.
cp build/install/bin/slsFrameSynchronizer $PREFIX/bin/.
cp build/install/include/sls/* $PREFIX/include/sls

View File

@ -0,0 +1,79 @@
source:
path: ../..
{% set version = load_file_regex(load_file = 'VERSION', regex_pattern = '(\d+(?:\.\d+)*(?:[\+\w\.]+))').group(1) %}
package:
name: sls_detector_software
version: {{ version }}
build:
number: 0
binary_relocation: True
rpaths:
- lib/
requirements:
build:
- {{ compiler('c') }}
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
- git
- cmake
- ninja
- qt 5.*
host:
- libstdcxx-ng
- libgcc-ng
- libgl-devel # [linux]
- libtiff
- zlib
- expat
run:
- libstdcxx-ng
- libgcc-ng
outputs:
- name: slsdetlib
script: copy_lib.sh
requirements:
build:
- {{ compiler('c') }}
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
run:
- libstdcxx-ng
- libgcc-ng
- name: slsdetgui
script: copy_gui.sh
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }}
run:
- {{ pin_subpackage('slsdetlib', exact=True) }}
- qt 5.*
- name: moenchzmq
script: copy_moench.sh
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }}
run:
- {{ pin_subpackage('slsdetlib', exact=True) }}

View File

@ -0,0 +1,16 @@
python:
- 3.11
- 3.12
- 3.13
c_compiler:
- gcc # [linux]
c_stdlib:
- sysroot # [linux]
cxx_compiler:
- gxx # [linux]
c_stdlib_version: # [linux]
- 2.17 # [linux]

View File

@ -0,0 +1,45 @@
source:
path: ../..
{% set version = load_file_regex(load_file = 'VERSION', regex_pattern = '(\d+(?:\.\d+)*(?:[\+\w\.]+))').group(1) %}
package:
name: slsdet
version: {{ version }}
build:
number: 0
script:
- unset CMAKE_GENERATOR && {{ PYTHON }} -m pip install . -vv # [not win]
requirements:
build:
- python {{python}}
- {{ compiler('c') }}
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
host:
- cmake
- ninja
- python {{python}}
- pip
- scikit-build-core
- pybind11 >=2.13.0
- fmt
- zeromq
- nlohmann_json
- catch2
run:
- python {{python}}
- numpy
test:
imports:
- slsdet
about:
summary: An example project built with pybind11 and scikit-build.
# license_file: LICENSE

View File

@ -1,90 +0,0 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
find_package(ROOT CONFIG REQUIRED COMPONENTS Core Gui)
find_package(TIFF REQUIRED)
target_include_directories(ROOT::Core INTERFACE "${ROOT_INCLUDE_DIRS}")
add_library(ROOT::Flags_CXX IMPORTED INTERFACE)
separate_arguments(ROOT_CXX_FLAGS)
target_compile_options(ROOT::Flags_CXX INTERFACE ${ROOT_CXX_FLAGS})
separate_arguments(ROOT_DEFINITIONS)
target_compile_definitions(ROOT::Flags_CXX INTERFACE ${ROOT_DEFINITIONS})
# This fixes a bug in the linker flags
string(REPLACE "-L " "-L" ROOT_EXE_LINKER_FLAGS "${ROOT_EXE_LINKER_FLAGS}")
separate_arguments(ROOT_EXE_LINKER_FLAGS)
# Stuck into using old property method due to separate -L and -l arguments
# (A full path to -l is better!)
set_property(TARGET ROOT::Flags_CXX PROPERTY
INTERFACE_LINK_LIBRARIES ${ROOT_EXE_LINKER_FLAGS})
set_property(TARGET ROOT::Core PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "${ROOT_INCLUDE_DIRS}")
add_executable(ctbGui
ctbGui.cpp
ctbMain.cpp
ctbDacs.cpp
ctbPowers.cpp
ctbSlowAdcs.cpp
ctbSignals.cpp
ctbAdcs.cpp
ctbPattern.cpp
ctbAcquisition.cpp
${CMAKE_SOURCE_DIR}/slsDetectorCalibration/tiffio/src/tiffIO.cpp
)
#TODO! Replace with target
target_include_directories(ctbGui PRIVATE
${CMAKE_SOURCE_DIR}/slsDetectorCalibration/dataStructures
${CMAKE_SOURCE_DIR}/slsDetectorCalibration/interpolations
${CMAKE_SOURCE_DIR}/slsDetectorCalibration/
${CMAKE_SOURCE_DIR}/slsDetectorCalibration/tiffio/include/
)
# Headders needed for ROOT dictionary generation
set( HEADERS
ctbDefs.h
ctbMain.h
ctbDacs.h
ctbPattern.h
ctbSignals.h
ctbAdcs.h
ctbAcquisition.h
ctbPowers.h
ctbSlowAdcs.h
)
#set(ROOT_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
# ROOT dictionary generation
root_generate_dictionary(ctbDict ${HEADERS} LINKDEF ctbLinkDef.h)
add_library(ctbRootLib SHARED ctbDict.cxx)
target_include_directories(ctbRootLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(ctbRootLib PUBLIC
ROOT::Core
slsDetectorShared
${ROOT_LIBRARIES}
${ROOT_EXE_LINKER_FLAGS}
)
set_target_properties(
ctbRootLib PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
target_link_libraries(ctbGui PUBLIC
slsDetectorShared
ctbRootLib
${TIFF_LIBRARIES}
)
set_target_properties(ctbGui PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)

View File

@ -1,46 +0,0 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
INCS=ctbMain.h ctbDacs.h ctbPattern.h ctbSignals.h ctbAdcs.h ctbAcquisition.h ctbPowers.h ctbSlowAdcs.h
SRC= $(INCS:.h=.cpp) ctbDict.cpp
LINKDEF=ctbLinkDef.h
ZMQLIB=../slsReceiverSoftware/include
LIBRARYCBF=$(CBFLIBDIR)/lib/*.o
INCDIR=-I../slsReceiverSoftware/include/ -I../slsDetectorSoftware/include/ -I../slsSupportLib/include/ -I../slsDetectorCalibration -I../slsDetectorCalibration/dataStructures -I$(CBFLIBDIR)/include -I../slsDetectorCalibration/interpolations
LDFLAG=-L../build/bin -lSlsDetector -lSlsSupport -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -L$(ZMQLIB) -L$(CBFLIBDIR)/lib/ -std=c++11
#
MAIN=ctbGui.cpp
DESTDIR?=../build/bin
OBJS = $(SRC:.cpp=.o) $(MAIN:.cpp=.o)
all: $(DESTDIR)/ctbGui
doc:
cd manual && make DESTDIR=$(DESTDIR)
htmldoc:
cd manual && make html DESTDIR=$(DESTDIR)
ctbDict.cpp: $(INCS) $(LINKDEF)
rootcint -f ctbDict.cpp -c $(INCS) $(LINKDEF)
%.o : %.cpp
echo $@
g++ -DMYROOT `root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o $@ -c $< $(INCDIR)
#$(CXX) -o $@ -c $< $(INCLUDES) $(DFLAGS) -fPIC $(EPICSFLAGS) -lpthread #$(FLAGS)
$(DESTDIR)/ctbGui: $(OBJS) $(LINKDEF)
g++ -DMYROOT `root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o ctbGui $(INCDIR) $(OBJS) ../slsDetectorCalibration/tiffIO.cpp
mv ctbGui $(DESTDIR)
clean:
rm -f $(DESTDIR)/ctbGui *.o ctbDict.* $(OBJS)

View File

@ -1,48 +0,0 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
INCS=ctbMain.h ctbDacs.h ctbPattern.h ctbSignals.h ctbAdcs.h ctbAcquisition.h ctbPowers.h ctbSlowAdcs.h
SRC= $(INCS:.h=.cpp) ctbDict.cpp
LINKDEF=ctbLinkDef.h
#ctbActions.h
ZMQLIB=../slsReceiverSoftware/include
LIBRARYCBF=$(CBFLIBDIR)/lib/*.o
INCDIR=-I../slsReceiverSoftware/include/ -I../slsDetectorSoftware/include/ -I../slsSupportLib/include/ -I../slsDetectorCalibration -I../slsDetectorCalibration/dataStructures -I$(CBFLIBDIR)/include -I../slsDetectorCalibration/interpolations
LDFLAG=-L../build/bin -lSlsDetector -lSlsSupport -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -L$(ZMQLIB) -L$(CBFLIBDIR)/lib/ -std=c++11
#
MAIN=ctbGui.cpp
DESTDIR?=../build/bin
OBJS = $(SRC:.cpp=.o) $(MAIN:.cpp=.o)
all: $(DESTDIR)/ctbGui
doc:
cd manual && make DESTDIR=$(DESTDIR)
htmldoc:
cd manual && make html DESTDIR=$(DESTDIR)
ctbDict.cpp: $(INCS) $(LINKDEF)
rootcling -f ctbDict.cpp -c $(INCS) $(LINKDEF)
%.o : %.cpp
echo $@
g++ -DMYROOT `source root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o $@ -c $< $(INCDIR)
#$(CXX) -o $@ -c $< $(INCLUDES) $(DFLAGS) -fPIC $(EPICSFLAGS) -lpthread #$(FLAGS)
$(DESTDIR)/ctbGui: $(OBJS) $(LINKDEF)
g++ -DMYROOT `source root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o ctbGui $(INCDIR) $(OBJS) ../slsDetectorCalibration/tiffIO.cpp
mv ctbGui $(DESTDIR)
clean:
rm -f $(DESTDIR)/ctbGui *.o ctbDict.* $(OBJS)

File diff suppressed because it is too large Load Diff

View File

@ -1,248 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef CTBACQUISITION_H
#define CTBACQUISITION_H
#include <TGFrame.h>
#include "ctbAdcs.h"
#include "ctbSignals.h"
#include "ctbPattern.h"
class TGTextEntry;
class TGLabel;
class TGNumberEntry;
class TGCheckButton;
class TThread;
class TGraph;
class TMultiGraph;
class THStack;
class TGButtonGroup;
class TGRadioButton;
class TGComboBox;
class TTimer;
class TCanvas;
class TH2F;
class TH1F;
class TGLabel;
class TGTextButton;
namespace sls
{
class Detector;
class detectorData;
};
template <class dataType> class slsDetectorData;
class singlePhotonDetector;
//class singlePhotonDetector;
class commonModeSubtraction;
#include <string>
#include <stdint.h>
using namespace std;
class ctbAcquisition : public TGGroupFrame {
enum {DESERIALIZER, MOENCH04, MOENCH02, MOENCH03, IMAGE32B, IMAGE16B, ADCSAR2, MYTHEN301, MYTHEN302};
private:
TGTextEntry *eOutdir;
TGTextEntry *eFname;
TGNumberEntry *eFindex;
TGCheckButton *cFileSave;
TGNumberEntry *eSerOff;
TGNumberEntry *eDynRange;
TGNumberEntry *eNumCount;
TGNumberEntry *ePixX;
TGNumberEntry *ePixY;
TGNumberEntry *eFitADC;
TGNumberEntry *eBitPlot;
TGNumberEntry *eMinRaw;
TGNumberEntry *eMaxRaw;
TGNumberEntry *eMinPedSub;
TGNumberEntry *eMaxPedSub;
TGCheckButton *cMinMaxRaw;
TGCheckButton *cMinMaxPedSub;
TGNumberEntry *eMeasurements;
TGTextButton *bStatus;
// TGTextButton
TGCheckButton *cCompile;
TGTextButton *cLoad;
// TGCheckButton *cRun;
TThread *acqThread;
THStack *adcStack;
THStack *bitStack;
THStack *countsStack;
TH1F *adcHisto[NADCS];
TH1F *countsHisto[NADCS];
TH1F *bitHisto[NSIGNALS];
float bitOffset[NSIGNALS];
// int enableFlag[NADCS+4];
int roMode;
int dBitOffset;
TH1F *adcFit;
TH1F *bitPlot;
TH1F *countsFit;
TH2F *h2DMapAn; // for 2D detectors
TH2F *h2DMapDig; // for 2D detectors
TH1F *h1DMap; //for 1D detectors
// TH2F *h2Scan; // for 2D detectors
// TMultiGraph *mgAdcs;
// TH1I *plotAdc[NADCS];
sls::Detector* myDet;
int plotFlag[NADCS];
int bitPlotFlag[NSIGNALS];
int ip;
// int nChannels;
// int chanEnable;
//int nADCs;
std::vector <int> dbitlist;
std::vector <int> adclist;
TGButtonGroup *bgPlot;// = new TGVButtonGroup(main_frame);
TGRadioButton *rbPlotOff;
TGRadioButton *rbWaveform;
TGRadioButton *rbDistribution;
TGRadioButton *rb2D;
// TGRadioButton *rbScan;
TGComboBox *cbDetType;
TGCheckButton *cbGetPedestal;
TGCheckButton *cbSubtractPedestal;
TGCheckButton *cbCommonMode;
TGTextButton *bResetPedestal;
TGLabel *lClickX;
TGLabel *lClickY;
TGLabel *lClickValue;
TCanvas *myCanvas;
TTimer *plotTimer;
char patternFile[10000];
char patternCompiler[10000];
int globalPlot;
int adcPlot;
int dbitPlot;
int tenG;
int nAnalogSamples, nDigitalSamples;
// int iScanStep;
slsDetectorData<uint16_t> *dataStructure;
singlePhotonDetector *photonFinder;
//singlePhotonDetector *photonFinder;
commonModeSubtraction *commonMode;
int cmSub;
int stop;
uint64_t dBitMask;
int deserializer;
public:
ctbAcquisition(TGVerticalFrame*, sls::Detector*);
void setOutdir();
void setFname();
void setMeasurements();
void setFsave(Bool_t);
void changePlot(Int_t);
void changeDetector(Int_t);
void changePlot();
void changeDetector();
void setFindex();
void Draw();
void setCanvas(TCanvas*);
void toggleAcquisition();
void loadPattern();
static void* ThreadHandle(void *arg);
void update();
void acquisitionFinished();
// string getParameters();
void setGraph (int i ,int en, Pixel_t col);
void setBitGraph (int i ,int en, Pixel_t col);
void startAcquisition();
static void progressCallback(double,void*);
static void dataCallback(sls::detectorData*, long unsigned int, unsigned int, void*);
int StopFlag;
int plotData(sls::detectorData*, int);
void setPatternFile(const char* t);
void setPatternCompiler(const char* t);
void setAnalogSamples(int);
void setDigitalSamples(int);
void setADCEnable(Int_t);
void setDbitEnable(Int_t);
void setReadoutMode(int);
void updateChans();
void resetPedestal();
void ToggleCommonMode(Bool_t);
void TogglePedSub(Bool_t);
void ChangeHistoLimitsPedSub(Long_t );
void ChangeHistoLimitsRaw(Long_t);
void ChangeHistoLimitsPedSub( );
void ChangeHistoLimitsRaw();
void ChangeHistoLimitsPedSub(Bool_t );
void ChangeHistoLimitsRaw(Bool_t);
void ChangeSerialOffset();
void ChangeSerialOffset(Long_t);
void ChangeNumberOfChannels();
void ChangeNumberOfChannels(Long_t);
void ChangeDynamicRange();
void ChangeDynamicRange(Long_t);
void ChangeImagePixels();
void ChangeImagePixels(Long_t);
void canvasClicked();
void FitADC();
void plotBit();
ClassDef(ctbAcquisition,0)
};
#endif

View File

@ -1,616 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include <TApplication.h>
#include <TGClient.h>
#include <TCanvas.h>
#include <TF1.h>
#include <TRandom.h>
#include <TGButton.h>
#include <TRootEmbeddedCanvas.h>
#include <TGButtonGroup.h>
#include <TGNumberEntry.h>
#include <TGLabel.h>
#include <TList.h>
#include <TGFileDialog.h>
#include <TGComboBox.h>
#include <TH2F.h>
#include <TColor.h>
#include <TH1F.h>
#include <TGraphErrors.h>
#include <TGColorSelect.h>
#include <THStack.h>
#include <TGTab.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include "ctbAdcs.h"
#include "ctbDefs.h"
#include "sls/Detector.h"
using namespace std;
ctbAdc::ctbAdc(TGVerticalFrame *page, int i, sls::Detector *det)
: TGHorizontalFrame(page, 800,800), id(i), myDet(det) {
TGHorizontalFrame *hframe=this;
char tit[100];
page->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
hframe->MapWindow();
sprintf(tit, "ADC%d", id);
sAdcLabel= new TGLabel(hframe, tit);
hframe->AddFrame(sAdcLabel,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
sAdcLabel->MapWindow();
sAdcLabel->SetTextJustify(kTextLeft);
sAdcInvert= new TGCheckButton(hframe, "Inv");
hframe->AddFrame( sAdcInvert,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
sAdcInvert->MapWindow();
sAdcInvert->Connect("Toggled(Bool_t)","ctbAdc",this,"ToggledInvert(Bool_t)");
sAdcEnable= new TGCheckButton(hframe, "En");
hframe->AddFrame( sAdcEnable,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
sAdcEnable->MapWindow();
// sAdcEnable->SetOn(kTRUE);
// sAdcEnable->SetEnabled(kFALSE);
sAdcEnable->Connect("Toggled(Bool_t)","ctbAdc",this,"ToggledEnable(Bool_t)");
sAdcPlot= new TGCheckButton(hframe, "Plot");
hframe->AddFrame( sAdcPlot,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
sAdcPlot->MapWindow();
sAdcPlot->Connect("Toggled(Bool_t)","ctbAdc",this,"ToggledPlot(Bool_t)");
fColorSel = new TGColorSelect(hframe, id+1, 0);
fColorSel->Connect("ColorSelected(Pixel_t)","ctbAdc",this,"ColorChanged(Pixel_t)");
hframe->AddFrame(fColorSel, new TGLayoutHints(kLHintsTop |
kLHintsLeft, 2, 0, 2, 2));
fColorSel->SetColor(TColor::Number2Pixel(id+1));
// sprintf(tit,"adc%d",id);
// gADC=new TGraph();
// gADC->SetName(tit);
// gADC->SetLineColor(id+1);
// gADC->SetMarkerColor(id+1);
};
Pixel_t ctbAdc::getColor(){
return fColorSel->GetColor();
}
Bool_t ctbAdc::getEnabled(){
return getPlot();
}
Bool_t ctbAdc::getPlot(){
return sAdcPlot->IsOn();
}
Bool_t ctbAdc::getInverted(){
return sAdcInvert->IsOn();
}
Bool_t ctbAdc::getEnable(){
return sAdcEnable->IsOn();
}
void ctbAdc::setInverted(Bool_t b){
// cout << id << "set enabled " << b << endl;
if (b)
sAdcInvert->SetOn(kTRUE,kTRUE);
else
sAdcInvert->SetOn(kFALSE,kTRUE);
}
void ctbAdc::setEnable(Bool_t b){
// cout << id << "set enabled " << b << endl;
if (b)
sAdcEnable->SetOn(kTRUE,kFALSE);
else
sAdcEnable->SetOn(kFALSE,kFALSE);
}
void ctbAdc::setAdcAlias(char *tit, int plot, int color) {
if (tit)
sAdcLabel->SetText(tit);
if (plot>0)
sAdcPlot->SetOn(kTRUE,kTRUE);
else if (plot==0)
sAdcPlot->SetOn(kFALSE,kTRUE);
if (color>=0)
fColorSel->SetColor(color);
fColorSel->SetEnabled(sAdcPlot->IsOn());
}
string ctbAdc::getAdcAlias() {
char line[1000];
sprintf(line,"ADC%d %s %d %lx\n",id,sAdcLabel->GetText()->Data(),sAdcPlot->IsOn(),fColorSel->GetColor());
return string(line);
}
void ctbAdc::update() {
//Emit("ToggledAdcEnable(Int_t)", id);
}
void ctbAdc::ToggledPlot(Bool_t b){
// Long_t mask=b<<id;
// ToggledAdcPlot(mask);
cout << "Colsel " << id << " enable " << b << endl;
if (b)
fColorSel->SetEnabled(kTRUE);
else
fColorSel->SetEnabled(kFALSE);
// fColorSel->SetEnabled(sAdcPlot->IsOn());
Emit("ToggledAdcPlot(Int_t)", id);
}
void ctbAdc::ToggledInvert(Bool_t b){
// fColorSel->SetEnabled(sAdcPlot->IsOn());
Emit("ToggledAdcInvert(Int_t)", id);
}
void ctbAdc::ToggledEnable(Bool_t b){
fColorSel->SetEnabled(sAdcPlot->IsOn());
Emit("ToggledAdcEnable(Int_t)", id);
}
void ctbAdc::ColorChanged(Pixel_t) {
Emit("ToggledAdcPlot(Int_t)", id);
}
void ctbAdc::ToggledAdcPlot(Int_t b){
Emit("ToggledAdcPlot(Int_t)", id);
}
void ctbAdc::ToggledAdcInvert(Int_t b){
Emit("ToggledAdcInvert(Int_t)", id);
}
void ctbAdc::ToggledAdcEnable(Int_t b){
Emit("ToggledAdcEnable(Int_t)", id);
}
void ctbAdc::setEnabled(Bool_t b){
// cout << id << "set enabled " << b << endl;
if (b)
sAdcPlot->SetOn(kTRUE,kFALSE);
else
sAdcPlot->SetOn(kFALSE,kFALSE);
}
void ctbAdc::setPlot(Bool_t b){
// cout << id << "set enabled " << b << endl;
if (b)
sAdcPlot->SetOn(kTRUE,kTRUE);
else
sAdcPlot->SetOn(kFALSE,kTRUE);
}
ctbAdcs::ctbAdcs(TGVerticalFrame *page, sls::Detector *det)
: TGGroupFrame(page,"Adcs",kVerticalFrame), myDet(det) {
SetTitlePos(TGGroupFrame::kLeft);
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
MapWindow();
TGHorizontalFrame* hframe=new TGHorizontalFrame(this, 800,800);
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
hframe->MapWindow();
int idac=0;
TGHorizontalFrame* hhframe=new TGHorizontalFrame(this, 800,800);
AddFrame(hhframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
hhframe->MapWindow();
TGVerticalFrame *vframe;
for (idac=0; idac<NADCS; idac++) {
if (idac%16==0) {
vframe=new TGVerticalFrame(hhframe, 400,800);
hhframe->AddFrame(vframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
vframe->MapWindow();
}
sAdc[idac]=new ctbAdc(vframe,idac,myDet);
sAdc[idac]->Connect("ToggledAdcPlot(Int_t)","ctbAdcs",this,"ToggledAdcPlot(Int_t)");
sAdc[idac]->Connect("ToggledAdcInvert(Int_t)","ctbAdcs",this,"ToggledAdcInvert(Int_t)");
sAdc[idac]->Connect("ToggledAdcEnable(Int_t)","ctbAdcs",this,"ToggledAdcEnable(Int_t)");
}
hframe=new TGHorizontalFrame(this, 800,800);
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
hframe->MapWindow();
bCheckHalf[0]=new TGTextButton(hframe, "All 0-15");
hframe->AddFrame(bCheckHalf[0],new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
bCheckHalf[0]->MapWindow();
bCheckHalf[0]->Connect("Clicked()","ctbAdcs",this,"CheckHalf0()");
bRemoveHalf[0]=new TGTextButton(hframe, "None 0-15");
hframe->AddFrame(bRemoveHalf[0],new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 5, 5, 5, 5));
bRemoveHalf[0]->MapWindow();
bRemoveHalf[0]->Connect("Clicked()","ctbAdcs",this,"RemoveHalf0()");
bCheckHalf[1]=new TGTextButton(hframe, "All 16-23");
hframe->AddFrame(bCheckHalf[1],new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
bCheckHalf[1]->MapWindow();
bCheckHalf[1]->Connect("Clicked()","ctbAdcs",this,"CheckHalf1()");
// bCheckAll->Connect("Clicked()","ctbAdcs",this,"CheckAll()");
bRemoveHalf[1]=new TGTextButton(hframe, "None 16-23");
hframe->AddFrame(bRemoveHalf[1],new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 5, 5, 5, 5));
bRemoveHalf[1]->MapWindow();
bRemoveHalf[1]->Connect("Clicked()","ctbAdcs",this,"RemoveHalf1()");
// bRemoveAll->Connect("Clicked()","ctbAdcs",this,"RemoveAll()");
hframe=new TGHorizontalFrame(this, 800,800);
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
hframe->MapWindow();
bCheckAll=new TGTextButton(hframe, "All");
hframe->AddFrame(bCheckAll,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
bCheckAll->MapWindow();
bCheckAll->Connect("Clicked()","ctbAdcs",this,"CheckAll()");
bRemoveAll=new TGTextButton(hframe, "None");
hframe->AddFrame(bRemoveAll,new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 5, 5, 5, 5));
bRemoveAll->MapWindow();
bRemoveAll->Connect("Clicked()","ctbAdcs",this,"RemoveAll()");
hframe=new TGHorizontalFrame(this, 800,50);
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
hframe->MapWindow();
TGLabel *label= new TGLabel(hframe, "Inversion mask: ");
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
label->MapWindow();
label->SetTextJustify(kTextLeft);
eInversionMask = new TGNumberEntry(hframe, 0, 16,999, TGNumberFormat::kNESHex,
TGNumberFormat::kNEANonNegative,
TGNumberFormat::kNELNoLimits);
hframe->AddFrame(eInversionMask,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
eInversionMask->MapWindow();
eInversionMask->Resize(150,30);
eInversionMask->SetState(kFALSE);
hframe=new TGHorizontalFrame(this, 800,50);
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
hframe->MapWindow();
label= new TGLabel(hframe, "Enable mask: ");
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
label->MapWindow();
label->SetTextJustify(kTextLeft);
eEnableMask = new TGNumberEntry(hframe, 0, 16,999, TGNumberFormat::kNESHex,
TGNumberFormat::kNEANonNegative,
TGNumberFormat::kNELNoLimits);
hframe->AddFrame(eEnableMask,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
eEnableMask->MapWindow();
eEnableMask->Resize(150,30);
eEnableMask->SetState(kFALSE);
}
int ctbAdcs::setEnable(int reg) {
try {
if (reg > -1) {
myDet->setADCEnableMask(reg);
}
auto retval = myDet->getADCEnableMask().tsquash("Different values");
eEnableMask->SetHexNumber(retval);
return retval;
} CATCH_DISPLAY ("Could not set/get adc enablemask.", "ctbAdcs::setEnable")
return -1;
}
int ctbAdcs::setInvert(int reg) {
try {
if (reg > -1) {
myDet->setADCInvert(reg);
}
auto retval = myDet->getADCInvert().tsquash("Different values");
eInversionMask->SetHexNumber(retval);
return retval;
} CATCH_DISPLAY ("Could not set/get adc enablemask.", "ctbAdcs::setEnable")
return -1;
}
void ctbAdcs::update() {
Int_t invreg;
Int_t disreg;
disreg=setEnable();
invreg=setInvert();
for (int is=0; is<NADCS; is++) {
sAdc[is]->setAdcAlias(NULL,-1,-1);
if (invreg & (1<<is) )
sAdc[is]->setInverted(kTRUE);
else
sAdc[is]->setInverted(kFALSE);
if (disreg & (1<<is) )
sAdc[is]->setEnable(kTRUE);
else
sAdc[is]->setEnable(kFALSE);
}
Emit("AdcEnable(Int_t)", disreg);
}
string ctbAdcs::getAdcParameters() {
ostringstream line;
line << "reg "<< hex << setInvert() << "# ADC invert reg" << dec << endl;
line << "reg "<< hex << setEnable() << " # ADC enable reg"<< dec << endl;
return line.str();
}
void ctbAdcs::CheckAll() {
for (int is=0; is<NADCS; is++){
sAdc[is]->setPlot(kTRUE);
}
}
void ctbAdcs::RemoveAll() {
for (int is=0; is<NADCS; is++) {
sAdc[is]->setPlot(kFALSE);
}
}
void ctbAdcs::CheckHalf0() {
for (int is=0; is<NADCS/2; is++) {
sAdc[is]->setPlot(kTRUE);
}
}
void ctbAdcs::RemoveHalf0() {
for (int is=0; is<NADCS/2; is++){
sAdc[is]->setPlot(kFALSE);
}
}
void ctbAdcs::CheckHalf1() {
for (int is=NADCS/2; is<NADCS; is++){
sAdc[is]->setPlot(kTRUE);
}
}
void ctbAdcs::RemoveHalf1() {
for (int is=NADCS/2; is<NADCS; is++){
sAdc[is]->setPlot(kFALSE);
}
}
int ctbAdcs::setAdcAlias(string line) {
int is=-1, plot=0, color=-1;
char tit[100];
int narg=sscanf(line.c_str(),"ADC%d %s %d %x",&is,tit,&plot, &color);
if (narg<2)
return -1;
if (narg!=3)
color=-1;
if (is>=0 && is<NADCS) {
sAdc[is]->setAdcAlias(tit,plot,color);
}
return is;
}
string ctbAdcs::getAdcAlias() {
ostringstream line;
for (int is=0; is<NADCS; is++)
line << sAdc[is]->getAdcAlias();
return line.str();
}
void ctbAdcs::ToggledAdcPlot(Int_t b){
Emit("ToggledAdcPlot(Int_t)", b);
}
void ctbAdcs::AdcEnable(Int_t b){
Emit("AdcEnable(Int_t)", b);
}
void ctbAdcs::ToggledAdcEnable(Int_t b){
Int_t oreg=setEnable();
Int_t m=1<<b;
if (sAdc[b]->getEnable())
oreg|=m;
else
oreg&=~m;
setEnable(oreg);
Emit("AdcEnable(Int_t)", oreg);
}
void ctbAdcs::ToggledAdcInvert(Int_t b){
Int_t oreg=setInvert();
Int_t m=1<<b;
if (sAdc[b]->getInverted())
oreg|=m;
else
oreg&=~m;
setInvert(oreg);
}
Pixel_t ctbAdcs::getColor(int i){
if (i>=0 && i<NADCS)
return sAdc[i]->getColor();
return static_cast<Pixel_t>(-1);
}
Bool_t ctbAdcs::getEnabled(int i){
if (i>=0 && i<NADCS)
return sAdc[i]->getEnabled();
return static_cast<Bool_t>(-1);
}
Bool_t ctbAdcs::getEnable(int i){
if (i>=0 && i<NADCS)
return sAdc[i]->getEnable();
return static_cast<Bool_t>(-1);
}
Bool_t ctbAdcs::getPlot(int i){
if (i>=0 && i<NADCS)
return sAdc[i]->getPlot();
return static_cast<Bool_t>(-1);
}

View File

@ -1,157 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef CTBADCS_H
#define CTBADCS_H
#include <TGFrame.h>
#define NADCS 32
class TRootEmbeddedCanvas;
class TGButtonGroup;
class TGVerticalFrame;
class TGHorizontalFrame;
class TGTextEntry;
class TGLabel;
class TGNumberEntry;
class TH2F;
class TGComboBox;
class TGCheckButton;
class TGColorSelect;
class TColor;
class THStack;
class TGraphErrors;
class TGTextButton;
class TGTab;
class TGraph;
namespace sls
{
class Detector;
};
#include <string>
using namespace std;
class ctbAdc : public TGHorizontalFrame {
private:
TGLabel *sAdcLabel;
TGCheckButton *sAdcEnable;
TGCheckButton *sAdcPlot;
TGCheckButton *sAdcInvert;
TGColorSelect *fColorSel;
// TGraph *gADC;
int id;
sls::Detector *myDet;
public:
ctbAdc(TGVerticalFrame *page, int i, sls::Detector *det);
void setAdcAlias(char *tit, int plot, int color);
string getAdcAlias();
void ToggledAdcPlot(Int_t b);
void ToggledAdcEnable(Int_t b);
void ToggledAdcInvert(Int_t b);
void ToggledPlot(Bool_t b);
void ToggledEnable(Bool_t b);
void ToggledInvert(Bool_t b);
void ColorChanged(Pixel_t);
void setEnabled(Bool_t b);
Bool_t getEnabled();
// TGraph *getGraph();
void update();
Pixel_t getColor();
Bool_t getEnable();
void setEnable(Bool_t);
void setPlot(Bool_t);
Bool_t getInverted();
Bool_t getPlot();
void setInverted(Bool_t);
ClassDef(ctbAdc,0)
};
class ctbAdcs : public TGGroupFrame {
private:
ctbAdc *sAdc[NADCS];
sls::Detector *myDet;
TGTextButton *bCheckAll;
TGTextButton *bRemoveAll;
TGTextButton *bCheckHalf[2];
TGTextButton *bRemoveHalf[2];
TGNumberEntry *eInversionMask;
TGNumberEntry *eEnableMask;
/* TGTextButton *bPlotSelected; */
/* TGNumberEntry *eMinX; */
/* TGNumberEntry *eMaxX; */
/* TGNumberEntry *eMinY; */
/* TGNumberEntry *eMaxY; */
/* TGTextButton *bGetPixel; */
/* TGNumberEntry *ePixelX; */
/* TGNumberEntry *ePixelY; */
/* TGLabel *lPixelValue; */
public:
ctbAdcs(TGVerticalFrame *page, sls::Detector *det);
int setAdcAlias(string line);
string getAdcAlias();
string getAdcParameters();
void ToggledAdcPlot(Int_t);
void ToggledAdcInvert(Int_t);
void ToggledAdcEnable(Int_t);
void AdcEnable(Int_t b);
// TGraph *getGraph(int i);
void CheckAll();
void RemoveAll();
void update();
int setInvert(int reg=-1);
int setEnable(int reg=-1);
Pixel_t getColor(int i);
Bool_t getEnabled(int i);
Bool_t getPlot(int i);
Bool_t getEnable(int i);
void CheckHalf0();
void RemoveHalf0();
void CheckHalf1();
void RemoveHalf1();
ClassDef(ctbAdcs,0)
};
#endif

View File

@ -1,235 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <TGTextEntry.h>
#include <TGLabel.h>
#include <TGNumberEntry.h>
#include <TGButton.h>
#include "ctbDacs.h"
#include "ctbDefs.h"
#include "sls/Detector.h"
#include "sls/sls_detector_defs.h"
using namespace std;
ctbDac::ctbDac(TGGroupFrame *page, int idac, sls::Detector *det) : TGHorizontalFrame(page, 800,50) , id(idac), myDet(det) {
TGHorizontalFrame *hframe=this;
page->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
MapWindow();
char tit[100];
sprintf(tit, "DAC %d:",idac);
dacsLabel= new TGCheckButton(hframe, tit);// new TGLabel(hframe, tit);
dacsLabel->SetOn(kTRUE, kTRUE);
dacsLabel->Connect("Toggled(Bool_t)","ctbDac",this,"setOn(Bool_t)");
hframe->AddFrame(dacsLabel,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
dacsLabel->MapWindow();
dacsLabel->SetTextJustify(kTextLeft);
dacsEntry = new TGNumberEntry(hframe, 0, 9,999, TGNumberFormat::kNESInteger,
TGNumberFormat::kNEANonNegative,
TGNumberFormat::kNELLimitMinMax,
0, 65535);
hframe->AddFrame(dacsEntry,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
dacsEntry->MapWindow();
dacsEntry->Resize(150,30);
dacsUnit= new TGCheckButton(hframe, "mV");
// if (idac!=slsDetectorDefs::ADC_VPP) {
hframe->AddFrame( dacsUnit,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
dacsUnit->MapWindow();
if (idac==slsDetectorDefs::ADC_VPP) {
dacsUnit->SetEnabled(kFALSE);
hframe->HideFrame(dacsUnit);
dacsUnit->MapWindow();
cout << "hiding!" << endl;
}
if (idac==slsDetectorDefs::HIGH_VOLTAGE) {
dacsUnit->SetText("V");
dacsUnit->SetOn(kTRUE,kTRUE);
dacsUnit->SetEnabled(kFALSE);
}
//}
sprintf(tit, "xxx");
dacsValue= new TGLabel(hframe, tit);
hframe->AddFrame( dacsValue,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
dacsValue->MapWindow();
dacsValue->SetTextJustify(kTextLeft);
TGTextEntry *e=dacsEntry->TGNumberEntry::GetNumberEntry();
e->Connect("ReturnPressed()","ctbDac",this,"setValue()");
// e->Connect("ValueSet(Long_t)","ctbDac",this,"setValue(Long_t)");
dacsEntry->Connect("ValueSet(Long_t)","ctbDac",this,"setValue(Long_t)");
// cout << "(((((((((((((((((((((((((((((((" << dacsEntry->GetListOfSignals()->At(0)->IsA() << endl;
}
int ctbDac::setLabel(char *tit, int mv) {
if(tit)
dacsLabel->SetText(tit);
if (mv==1)
dacsUnit->SetOn(kTRUE,kTRUE);
else if (mv==0)
dacsUnit->SetOn(kFALSE,kTRUE);
// else if (mv==2) {
// ;}
// else if (mv==3)
// ;
return id;
}
string ctbDac::getLabel() {
ostringstream line;
line << dacsLabel->GetText() << " " << dacsUnit->IsOn() << endl;
// line << "DAC" << dec << id << " " << dacsUnit->IsOn() << endl;
return line.str();
}
int ctbDac::getMoenchDacId() {
slsDetectorDefs::dacIndex moenchDacIndices[8] = {slsDetectorDefs::VBP_COLBUF, slsDetectorDefs::VIPRE, slsDetectorDefs::VIN_CM, slsDetectorDefs::VB_SDA, slsDetectorDefs::VCASC_SFP, slsDetectorDefs::VOUT_CM, slsDetectorDefs::VIPRE_CDS, slsDetectorDefs::IBIAS_SFP};
if (id >= 8) {
return id;
}
return static_cast<int>(moenchDacIndices[id]);
}
void ctbDac::setValue(Long_t a) {setValue();}
void ctbDac::setValue() {
cout << "setting dac! "<< id << " value " << dacsEntry->GetIntNumber() << " units " << dacsUnit->IsOn() << endl;
try {
int sid = id;
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
sid = getMoenchDacId();
}
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(sid), dacsEntry->GetIntNumber(), dacsUnit->IsOn());
} CATCH_DISPLAY ("Could not set dac " + to_string(id) + ".", "ctbDac::setValue")
getValue();
}
void ctbDac::setOn(Bool_t b) {
// cout << "setting dac! "<< id << endl;
if ( dacsLabel->IsOn()) {
setValue();
} else {
try {
int sid = id;
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
sid = getMoenchDacId();
}
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(sid), -100, false);
} CATCH_DISPLAY ("Could not power off dac " + to_string(id) + ".", "ctbDac::setOn")
}
getValue();
}
int ctbDac::getValue() {
try {
int sid = id;
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
sid = getMoenchDacId();
}
int val = myDet->getDAC(static_cast<slsDetectorDefs::dacIndex>(sid), dacsUnit->IsOn()).tsquash("Different values");
cout << "dac " << id << " " << val << endl;
dacsValue->SetText(to_string(val).c_str());
if (val >= 0) {
dacsLabel->SetOn(kTRUE);
} else {
dacsLabel->SetOn(kFALSE);
}
return val;
} CATCH_DISPLAY ("Could not get dac " + to_string(id) + ".", "ctbDac::getValue")
return -1;
}
ctbDacs::ctbDacs(TGVerticalFrame *page, sls::Detector *det) : TGGroupFrame(page,"DACs",kVerticalFrame) , myDet(det){
SetTitlePos(TGGroupFrame::kLeft);
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
MapWindow();
// cout << "window mapped " << endl;
for (int idac=0; idac<NDACS; idac++) {
dacs[idac]=new ctbDac(this, idac, myDet);
}
dacs[NDACS]=new ctbDac(this, slsDetectorDefs::ADC_VPP, myDet);
dacs[NDACS+1]=new ctbDac(this, slsDetectorDefs::HIGH_VOLTAGE, myDet);
dacs[NDACS]->setLabel((char*)"ADC Vpp",2);
dacs[NDACS+1]->setLabel((char*)"High Voltage",3);
}
int ctbDacs::setDacAlias(string line) {
int is=-1, mv=0;
char tit[100];
int narg=sscanf(line.c_str(),"DAC%d %s %d",&is,tit,&mv);
if (narg<2)
return -1;
if (is>=0 && is<NDACS)
dacs[is]->setLabel(tit,mv);
return is;
}
string ctbDacs::getDacAlias() {
ostringstream line;
for (int i=0; i<NDACS; i++)
line << dacs[i]->getLabel() << endl;
return line.str();
}
string ctbDacs::getDacParameters() {
ostringstream line;
for (int i=0; i<NDACS; i++) {
//line << "dacs:" << i << " " << dacs[i]->getValue << endl;
line << "dac:" << i << " " << dacs[i]->getValue() << endl;
}
return line.str();
}
void ctbDacs::update() {
for (int idac=0; idac<NDACS+1; idac++) {
dacs[idac]->getValue();
}
}

View File

@ -1,77 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef CTBDACS_H
#define CTBDACS_H
#include <TGFrame.h>
#define NDACS 18
//#define NDACS 16
class TGTextEntry;
class TGLabel;
class TGNumberEntry;
class TGCheckButton;
namespace sls
{
class Detector;
};
#include <string>
using namespace std;
class ctbDac : public TGHorizontalFrame {
protected:
// TGLabel *dacsLabel;
TGNumberEntry *dacsEntry;
TGCheckButton *dacsUnit;
TGCheckButton *dacsLabel;
TGLabel *dacsValue;
int id;
sls::Detector* myDet;
public:
ctbDac(TGGroupFrame*, int , sls::Detector*);
void setValue();
void setValue(Long_t);
int getValue();
void setOn(Bool_t);
int setLabel(char *tit, int mv);
string getLabel();
int getMoenchDacId();
ClassDef(ctbDac,0)
};
class ctbDacs : public TGGroupFrame {
private:
ctbDac *dacs[NDACS+2];
sls::Detector* myDet;
public:
ctbDacs(TGVerticalFrame *page, sls::Detector*);
int setDacAlias(string line);
// int setDacAlias(string line);
string getDacAlias();
string getDacParameters();
void update();
ClassDef(ctbDacs,0)
};
#endif

View File

@ -1,86 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#pragma once
#include <string>
#include <stdexcept>
#include <chrono>
//#include "sls/sls_detector_exceptions.h"
//#include "sls/ansi.h"
#define RED "\x1b[31m"
#define RESET "\x1b[0m"
#define BOLD "\x1b[1m"
#define cprintf(code, format, ...) printf(code format RESET, ##__VA_ARGS__)
#define CATCH_DISPLAY(m, s) catch(...) { ctbDefs::DisplayExceptions(m, s); }
#define CATCH_HANDLE(...) catch(...) { ctbDefs::HandleExceptions(__VA_ARGS__); }
class ctbDefs {
public:
/**
* Empty Constructor
*/
ctbDefs(){};
// convert double seconds to chrono ns
static std::chrono::nanoseconds ConvertDoubleStoChronoNS(double timeS) {
using std::chrono::duration;
using std::chrono::duration_cast;
using std::chrono::nanoseconds;
return duration_cast<nanoseconds>(duration<double>(timeS));
}
// convert chrono ns to doubel s
static double ConvertChronoNStoDoubleS(std::chrono::nanoseconds timeNs) {
using std::chrono::duration;
using std::chrono::duration_cast;
return duration_cast<duration<double>>(timeNs).count();
}
static void DisplayExceptions(std::string emsg, std::string src) {
try {
throw;
} /* catch (const sls::SocketError &e) {
throw;
} catch (const sls::SharedMemoryError &e) {
throw;
} */catch (const std::exception &e) {
ExceptionMessage(emsg, e.what(), src);
}
};
template <class CT> struct NonDeduced { using type = CT; };
template <class S, typename RT, typename... CT>
static void HandleExceptions(const std::string emsg, const std::string src, S* s,
RT (S::*somefunc)(CT...),
typename NonDeduced<CT>::type... Args) {
try {
throw;
} /*catch (const sls::SocketError &e) {
throw;
} catch (const sls::SharedMemoryError &e) {
throw;
} */catch (const std::exception &e) {
ExceptionMessage(emsg, e.what(), src);
(s->*somefunc)(Args...);
}
};
static void ExceptionMessage(std::string message,
std::string exceptionMessage,
std::string source) {
// because sls_detector_exceptions cannot be included
if (exceptionMessage.find("hared memory") != std::string::npos) {
throw;
}
if (exceptionMessage.find("annot connect") != std::string::npos) {
throw;
}
cprintf(RED, "Warning (%s): %s [Caught Exception: %s]\n", source.c_str(), message.c_str(), exceptionMessage.c_str());
//return Message(qDefs::WARNING, message + std::string("\nCaught exception:\n") + exceptionMessage, source);
};
};

View File

@ -1,159 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include <TApplication.h>
#include <TColor.h>
#include <TStyle.h>
#include <TROOT.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include "sls/Detector.h"
#include "sls/sls_detector_defs.h"
//#include "sls_receiver_defs.h"
#include "ctbMain.h"
#include "ctbDefs.h"
using namespace std;
int main(int argc, char **argv) {
string afname, cfname, pfname;
int id=0;
int af=0, cf=0, pf=0;
cout << " *** " << argc << endl;
for (int ia=0; ia<argc; ia++) {
if (strcmp(argv[ia],"-alias")==0) {
if (ia+1<argc) {
afname=argv[ia+1];
ia++;
af=1;
}
} else if (strcmp(argv[ia],"-config")==0) {
if (ia+1<argc) {
cfname=argv[ia+1];
ia++;
cf=1;
}
} else if (strcmp(argv[ia],"-par")==0) {
if (ia+1<argc) {
pfname=argv[ia+1];
ia++;
pf=1;
}
} else if (strcmp(argv[ia],"-id")==0) {
if (ia+1<argc) {
id=atoi(argv[ia+1]);
ia++;
}
}
}
cout << " *** " << endl;
sls::Detector *myDet = nullptr;
try {
/****** Create detector ****************/
myDet=new sls::Detector(id);
cout << "Created multi detector id " << id << endl;
if (cf) {
myDet->loadConfig(cfname);
cout << "Config file loaded successfully" << endl;
} else {
cout << "No config file specified" << endl;
}
cout << "hostname " << myDet->getHostname() << endl;
if (pf) {
myDet->loadParameters(pfname);
cout << "Loaded parameter file successfully" << endl;
} else{
cout << "No parameter file specified" << endl;
}
} CATCH_DISPLAY ("Could not create detector/ load config/parameters.", "ctbGui::main")
/***********Create GUI stuff *******************/
TApplication theApp("App",&argc,argv);
gStyle->SetDrawBorder(0);
gStyle->SetCanvasColor(kWhite);
gStyle->SetCanvasDefH(800);
gStyle->SetCanvasDefW(800);
gStyle->SetCanvasBorderMode(0);
gStyle->SetPadBorderMode(0);
gStyle->SetPaintTextFormat("5.2f");
gStyle->SetLineWidth(2);
gStyle->SetTextSize(1.1);
gStyle->SetLabelSize(0.04,"xy");
gStyle->SetTitleSize(0.05,"xy");
gStyle->SetTitleOffset(1.0,"x");
gStyle->SetTitleOffset(1.1,"y");
gStyle->SetPadTopMargin(0.15);
gStyle->SetPadRightMargin(0.15);
gStyle->SetPadBottomMargin(0.15);
gStyle->SetPadLeftMargin(0.15);
gStyle->SetLegendBorderSize(1);
gStyle->SetFrameBorderMode(0);
gStyle->SetFrameFillColor(kWhite);
// gStyle->SetLegendFillColor(kWhite);
gStyle->SetTitleFillColor(kWhite);
gStyle->SetFillColor(kWhite);
gStyle->SetStatFontSize(0.03);
gStyle->SetStatBorderSize(1);
gStyle->SetStatFormat("6.4g");
gStyle->SetStatX(0.95);
gStyle->SetStatY(0.95);
gStyle->SetStatW(0.2);
gStyle->SetStatH(0.2);
gStyle->SetTitleX(0.1);
gStyle->SetTitleY(0.95);
gStyle->SetTitleBorderSize(0);
gStyle->SetTitleFontSize(0.05);
gROOT->SetStyle("Default");
TColor::InitializeColors();
const Int_t NRGBs = 5;
const Int_t NCont = 90;
Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
gStyle->SetNumberContours(NCont);
gROOT->ForceStyle();
ctbMain *mf=new ctbMain(gClient->GetRoot(), myDet);
cout << " *** " << argc << endl;
for (int ia=0; ia<argc; ia++)
cout << argv[ia] << endl;
cout << " *** " << endl;
if (af)
mf->loadAlias(afname);
else
cout << "no alias specified" << endl;
theApp.Run();
return 0;
}

View File

@ -1,17 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#pragma link C++ class ctbMain;
#pragma link C++ class ctbDacs;
#pragma link C++ class ctbDac;
#pragma link C++ class ctbSignals;
#pragma link C++ class ctbSignal;
#pragma link C++ class ctbAdc;
#pragma link C++ class ctbAdcs;
#pragma link C++ class ctbLoop;
#pragma link C++ class ctbWait;
#pragma link C++ class ctbPattern;
#pragma link C++ class ctbAcquisition;
#pragma link C++ class ctbPower;
#pragma link C++ class ctbPowers;
#pragma link C++ class ctbSlowAdc;
#pragma link C++ class ctbSlowAdcs;

View File

@ -1,588 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include <TApplication.h>
#include <TGClient.h>
#include <TCanvas.h>
#include <TF1.h>
#include <TRandom.h>
#include <TGButton.h>
#include <TRootEmbeddedCanvas.h>
#include <TGButtonGroup.h>
#include <TGNumberEntry.h>
#include <TGLabel.h>
#include <TList.h>
#include <TGFileDialog.h>
#include <TGComboBox.h>
#include <TH2F.h>
#include <TColor.h>
#include <TH1F.h>
#include <TGraphErrors.h>
#include <THStack.h>
#include <TGTab.h>
#include <TApplication.h>
#include <TGCanvas.h>
#include <stdlib.h>
#include <TGMenu.h>
#include <TGDockableFrame.h>
//#include <TGMenuBar.h>
//#include <TGPopupMenu.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include "sls/Detector.h"
#include "ctbDefs.h"
#include "ctbMain.h"
#include "ctbDacs.h"
#include "ctbSlowAdcs.h"
#include "ctbPowers.h"
#include "ctbSignals.h"
#include "ctbPattern.h"
#include "ctbAdcs.h"
#include "ctbAcquisition.h"
//#include "ctbActions.h"
using namespace std;
ctbMain::ctbMain(const TGWindow *p, sls::Detector *det)
: TGMainFrame(p,800,800), pwrs(NULL), senses(NULL) {
myDet=det;
Connect("CloseWindow()", "ctbMain", this, "CloseWindow()");
// fMenuDock = new TGDockableFrame(this);
// AddFrame(fMenuDock, new TGLayoutHints(kLHintsExpandX, 0, 0, 1, 0));
// fMenuDock->SetWindowName("GuiTest Menu");
fMenuBarLayout = new TGLayoutHints(kLHintsTop | kLHintsExpandX);
fMenuBarItemLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
fMenuBarHelpLayout = new TGLayoutHints(kLHintsTop | kLHintsRight);
fMenuFile = new TGPopupMenu(gClient->GetRoot());
int im=0;
fMenuFile->AddEntry("Open Alias", im++);
fMenuFile->AddEntry("Save Alias", im++);
fMenuFile->AddSeparator();
fMenuFile->AddEntry("Open Parameters", im++);
fMenuFile->AddEntry("Save Parameters", im++);
fMenuFile->AddSeparator();
fMenuFile->AddEntry("Open Configuration", im++);
fMenuFile->AddEntry("Save Configuration", im++);
fMenuFile->AddSeparator();
fMenuFile->AddEntry("Open Pattern", im++);
fMenuFile->AddEntry("Save Pattern", im++);
fMenuFile->AddSeparator();
fMenuFile->AddEntry("Exit", im++);
fMenuFile->Connect("Activated(Int_t)", "ctbMain", this,
"HandleMenu(Int_t)");
i_dacs=-1;
i_pwrs=-1;
i_senses=-1;
i_sig=-1;
i_adcs=-1;
i_pat=-1;
i_acq=-1;
int i_page=0;
TGVerticalFrame *vframe=new TGVerticalFrame(this, 800,1200); //main frame
fMenuBar = new TGMenuBar(vframe, 1, 1, kHorizontalFrame);
fMenuBar->AddPopup("&File", fMenuFile, fMenuBarItemLayout);
// fMenuBar->AddPopup("&Test", fMenuTest, fMenuBarItemLayout);
// fMenuBar->AddPopup("&View", fMenuView, fMenuBarItemLayout);
// fMenuBar->AddPopup("&Help", fMenuHelp, fMenuBarHelpLayout);
vframe->AddFrame(fMenuBar, fMenuBarLayout);
TGHorizontalFrame* hpage=new TGHorizontalFrame(vframe, 800,1200); //horizontal frame. Inside there should be the tab and the canvas
mtab=new TGTab(hpage, 1500, 1200); //tab!
// page=new TGVerticalFrame(mtab, 1500,1200);
cout << "DACS" << endl;
TGCompositeFrame *tf = mtab->AddTab("DACs");
TGVerticalFrame *page=new TGVerticalFrame(tf, 1500,1200);
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
dacs=new ctbDacs(page, myDet);
i_dacs=i_page++;
cout << "power " << endl;
tf = mtab->AddTab("Power Supplies");
page=new TGVerticalFrame(tf, 1500,1200);
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
pwrs=new ctbPowers(page, myDet);
i_pwrs=i_page++;
cout << "sense " << endl;
tf = mtab->AddTab("Sense");
page=new TGVerticalFrame(tf, 1500,1200);
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
senses=new ctbSlowAdcs(page, myDet);
i_senses=i_page++;
cout << "signals " << endl;
tf = mtab->AddTab("Signals");
page=new TGVerticalFrame(tf, 1500,1200);
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
sig=new ctbSignals(page, myDet);
sig->Connect("ToggledSignalPlot(Int_t)","ctbMain",this,"setSignalPlot(Int_t)");
i_sig=i_page++;
cout << "adcs " << endl;
tf = mtab->AddTab("ADCs");
page=new TGVerticalFrame(tf, 1500,1200);
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
adcs=new ctbAdcs(page, myDet);
adcs->Connect("ToggledAdcPlot(Int_t)","ctbMain",this,"setADCPlot(Int_t)");
adcs->Connect("AdcEnable(Int_t)","ctbMain",this,"setADCEnable(Int_t)");
i_adcs=i_page++;
cout << "pattern" << endl;
tf = mtab->AddTab("Pattern");
page=new TGVerticalFrame(tf, 1500,1200);
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
pat=new ctbPattern(page, myDet);
pat->Connect("patternFileChanged(const char*)","ctbMain",this,"setPatternFile(const char*)");
pat->Connect("patternCompilerChanged(const char*)","ctbMain",this,"setPatternCompiler(const char*)");
pat->Connect("analogSamplesChanged(const int)","ctbMain",this,"setAnalogSamples(int)");
pat->Connect("digitalSamplesChanged(const int)","ctbMain",this,"setDigitalSamples(int)");
pat->Connect("readoutModeChanged(int)","ctbMain",this,"setReadoutMode(int)");
i_pat=i_page++;
cout << "acquisition" << endl;
tf = mtab->AddTab("Acquisition");
page=new TGVerticalFrame(tf, 1500,1200);
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
acq=new ctbAcquisition(page, myDet);
i_acq=i_page++;
// cout << "actions" << endl;
// tf = mtab->AddTab("Actions");
// page=new TGVerticalFrame(tf, 1500,1200);
// tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
// actions=new ctbActions(page, myDet);
// i_actions=i_page++;
cout << "tabs finished" << endl;
hpage->AddFrame(mtab,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
vframe->AddFrame(hpage,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
AddFrame(vframe,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
vframe->MapWindow();
hpage->MapWindow();
mtab->MapWindow();
page->MapWindow();
// Sets window name and shows the main frame
cout << "dockabel" << endl;
TGDockableFrame *fdock=new TGDockableFrame(hpage);
hpage->AddFrame(fdock, new TGLayoutHints(kLHintsBottom | kLHintsCenterX | kLHintsExpandX | kLHintsExpandY, 10,10,10,10));
fdock->MapWindow();
cout << "canvas" << endl;
// // Creates widgets of the example
fEcanvas = new TRootEmbeddedCanvas ("Ecanvas",fdock,800,800);//hpage,800,800);
//fEcanvas = new TRootEmbeddedCanvas ("Ecanvas",this,800,800);//hpage,800,800);
// fEcanvas->Resize();
// fEcanvas->GetCanvas()->Update();
//AddFrame(fEcanvas, new TGLayoutHints(kLHintsBottom | kLHintsCenterX | kLHintsExpandX | kLHintsExpandY, 10,10,10,10));
// // hpage->
fdock->AddFrame(fEcanvas, new TGLayoutHints(kLHintsBottom | kLHintsCenterX | kLHintsExpandX | kLHintsExpandY, 10,10,10,10));
fEcanvas->MapWindow();
acq->setCanvas(getCanvas());
hpage->MapSubwindows();
mtab->Connect("Selected(Int_t)","ctbMain",this,"tabSelected(Int_t)");
cout << "connect mtab" << endl;
try{
setReadoutMode(pat->getReadoutMode());
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
setADCEnable(adcs->setEnable());
setAnalogSamples(pat->getAnalogSamples());
setDigitalSamples(pat->getDigitalSamples());
tabSelected(0);
SetWindowName("CTB Gui");
MapSubwindows();
Resize(1500,1200);
MapWindow();
}
void ctbMain::CloseWindow() {
gApplication->Terminate();
}
TCanvas* ctbMain::getCanvas() {
return fEcanvas->GetCanvas();
}
void ctbMain::HandleMenu(Int_t id)
{
// Handle menu items.
switch (id) {
case 0: // fMenuFile->AddEntry("Open Alias", im++);
cout << "Open Alias" << endl;
{
static TString dir(".");
TGFileInfo fi;
//fi.fFileTypes = filetypes;
fi.fIniDir = StrDup(dir);
printf("fIniDir = %s\n", fi.fIniDir);
new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
// dir = fi.fIniDir;
if (fi.fFilename)
loadAlias(fi.fFilename);
}
break;
case 1: // fMenuFile->AddEntry("Save Alias", im++);
cout << "Save Alias" << endl;
{
static TString dir(".");
TGFileInfo fi;
//fi.fFileTypes = filetypes;
fi.fIniDir = StrDup(dir);
printf("fIniDir = %s\n", fi.fIniDir);
new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
printf("Save file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
// dir = fi.fIniDir;
if (fi.fFilename)
saveAlias(fi.fFilename);
}
break;
case 2: //fMenuFile->AddEntry("Open Parameters", im++);
cout << "Open Parameters" << endl;
{
static TString dir(".");
TGFileInfo fi;
//fi.fFileTypes = filetypes;
fi.fIniDir = StrDup(dir);
printf("fIniDir = %s\n", fi.fIniDir);
new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
// dir = fi.fIniDir;
if (fi.fFilename)
loadParameters(fi.fFilename);
}
break;
case 3: // fMenuFile->AddEntry("Open Configuration", im++);
cout << "Open configuration" << endl;
{
static TString dir(".");
TGFileInfo fi;
//fi.fFileTypes = filetypes;
fi.fIniDir = StrDup(dir);
printf("fIniDir = %s\n", fi.fIniDir);
new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
// dir = fi.fIniDir;
if (fi.fFilename)
loadConfiguration(fi.fFilename);
}
break;
case 4: //fMenuFile->AddEntry("Open Pattern", im++);
cout << "Open pattern" << endl;
{
static TString dir(".");
TGFileInfo fi;
//fi.fFileTypes = filetypes;
fi.fIniDir = StrDup(dir);
printf("fIniDir = %s\n", fi.fIniDir);
new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
// dir = fi.fIniDir;
if (fi.fFilename)
loadParameters(fi.fFilename);
}
break;
case 5: //fMenuFile->AddEntry("Save Pattern", im++);
cout << "Save pattern" << endl;
{
static TString dir(".");
TGFileInfo fi;
//fi.fFileTypes = filetypes;
fi.fIniDir = StrDup(dir);
printf("fIniDir = %s\n", fi.fIniDir);
new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
// dir = fi.fIniDir;
if (fi.fFilename)
savePattern(fi.fFilename);
}
break;
case 6: // fMenuFile->AddEntry("Exit", im++);
CloseWindow();
default:
printf("Menu item %d selected\n", id);
break;
}
}
int ctbMain::setADCPlot(Int_t i) {
// cout << "ADC " << i << " plot or color toggled" << endl;
// acq->setGraph(i,adcs->getGraph(i));
acq->setGraph(i,adcs->getEnabled(i),adcs->getColor(i));
return -1;
}
int ctbMain::setSignalPlot(Int_t i) {
// cout << "ADC " << i << " plot or color toggled" << endl;
// acq->setGraph(i,adcs->getGraph(i));
acq->setBitGraph(i,sig->getPlot(i),sig->getColor(i));
return -1;
}
void ctbMain::loadConfiguration(string fname) {
try{
myDet->loadConfig(fname);
} CATCH_DISPLAY ("Could not load config.", "ctbMain::loadConfiguration")
}
void ctbMain::loadParameters(string fname) {
try{
myDet->loadParameters(fname);
} CATCH_DISPLAY ("Could not load parameters.", "ctbMain::loadParameters")
}
void ctbMain::savePattern(string fname) {
try{
myDet->savePattern(fname);
} CATCH_DISPLAY ("Could not save pattern.", "ctbMain::savePattern")
}
int ctbMain::loadAlias(string fname) {
string line;
char aaaa[1000];
int i;
ifstream myfile (fname.c_str());
if (myfile.is_open())
{
while ( getline (myfile,line) )
{
// cout << line ;
if (sscanf(line.c_str(),"BIT%d",&i)>0) {
//cout << "*******" << line<< endl;
sig->setSignalAlias(line);
// cout << line ;
} else if (sscanf(line.c_str(),"DAC%d",&i)>0) {
dacs->setDacAlias(line);
// cout << "+++++++++" << line<< endl;
} else if (sscanf(line.c_str(),"ADC%d",&i)>0) {
adcs->setAdcAlias(line);
// cout << "---------" << line<< endl;
} // else
// cout << "<<<<<<<" << line << endl;
else if (sscanf(line.c_str(),"PAT%s",aaaa)>0) {
pat->setPatternAlias(line);
// cout << "---------" << line<< endl;
} else if (sscanf(line.c_str(),"V%s",aaaa)>0) {
if (pwrs) pwrs->setPwrAlias(line);
// cout << "+++++++++" << line<< endl;
} else if (sscanf(line.c_str(),"SENSE%d",&i)>0) {
if (senses) senses->setSlowAdcAlias(line);
// cout << "+++++++++" << line<< endl;
}
}
myfile.close();
}
else cout << "Unable to open file";
return 0;
}
int ctbMain::saveAlias(string fname) {
string line;
ofstream myfile (fname.c_str());
if (myfile.is_open())
{
//while ( getline (myfile,line) )
// {
// cout << line ;
//if (sscanf(line.c_str(),"BIT%d",&i)>0) {
//cout << "*******" << line<< endl;
myfile << sig->getSignalAlias();
// cout << line ;
// } else if (sscanf(line.c_str(),"DAC%d",&i)>0) {
myfile << dacs->getDacAlias();
if (pwrs) myfile << pwrs->getPwrAlias();
if (senses) myfile << senses->getSlowAdcAlias();
// cout << "+++++++++" << line<< endl;
// } else if (sscanf(line.c_str(),"ADC%d",&i)>0) {
myfile << adcs->getAdcAlias();
// cout << "---------" << line<< endl;
// } // else
// cout << "<<<<<<<" << line << endl;
myfile << pat->getPatternAlias();
//}
myfile.close();
}
else cout << "Unable to open file";
return 0;
}
void ctbMain::tabSelected(Int_t i) {
// cout << "Selected tab " << i << endl;
// cout << "Current tab is " << mtab->GetCurrent() << endl;
if (i==i_dacs) dacs->update();
else if (i==i_pwrs) pwrs->update();
else if (i==i_senses) ;//senses->update();
else if (i==i_sig) sig->update();
else if (i==i_adcs) adcs->update();
else if (i==i_pat) pat->update();
else if (i==i_acq) acq->update();
else if (i==i_acq) acq->update();
// else if (i==i_actions) actions->update();
else cout << "Unknown tab " << i << endl;
}
void ctbMain::setPatternFile(const char* t) {
acq->setPatternFile(t);
}
void ctbMain::setPatternCompiler(const char* t) {
acq->setPatternCompiler(t);
}
void ctbMain::setAnalogSamples(const int n) {
acq->setAnalogSamples(n);
}
void ctbMain::setDigitalSamples(const int n) {
acq->setDigitalSamples(n);
}
void ctbMain::setReadoutMode(int flags) {
acq->setReadoutMode(flags);
}
void ctbMain::setADCEnable(Int_t reg){
acq->setADCEnable(reg);
}

View File

@ -1,130 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef CTBMAIN_H
#define CTBMAIN_H
#include <TGFrame.h>
class TRootEmbeddedCanvas;
class TGButtonGroup;
class TGVerticalFrame;
class TGHorizontalFrame;
class TGTextEntry;
class TGLabel;
class TGNumberEntry;
class TH2F;
class TGComboBox;
class TGCheckButton;
class THStack;
class TGraphErrors;
class TGTextButton;
class TGTab;
class TGMenuBar;
class TGPopupMenu;
class TGDockableFrame;
class TGLayoutHints;
class TGCanvas;
class TCanvas;
class ctbDacs;
class ctbSlowAdcs;
class ctbPowers;
class ctbSignals;
namespace sls
{
class Detector;
};
class ctbPattern;
class ctbAdcs;
class ctbAcquisition;
//class ctbActions;
#include <string>
using namespace std;
class ctbMain : public TGMainFrame {
private:
sls::Detector *myDet;
TRootEmbeddedCanvas *fEcanvas;
TRootEmbeddedCanvas *fModulecanvas;
TGButtonGroup *br;
TGTab *mtab;
ctbDacs *dacs;
int i_dacs;
ctbPowers *pwrs;
int i_pwrs;
ctbSlowAdcs *senses;
int i_senses;
ctbSignals *sig;
int i_sig;
ctbAdcs *adcs;
int i_adcs;
ctbPattern *pat;
int i_pat;
ctbAcquisition *acq;
int i_acq;
// ctbActions *actions;
int i_actions;
TGDockableFrame *fMenuDock;
TGMenuBar *fMenuBar;
TGPopupMenu *fMenuFile, *fMenuTest, *fMenuView, *fMenuHelp;
TGPopupMenu *fCascadeMenu, *fCascade1Menu, *fCascade2Menu;
TGPopupMenu *fMenuNew1, *fMenuNew2;
TGLayoutHints *fMenuBarLayout, *fMenuBarItemLayout, *fMenuBarHelpLayout;
TGCanvas *myCanvas;
public:
ctbMain(const TGWindow *p, sls::Detector *det);
int loadAlias(string fname);
int saveAlias(string fname);
void loadParameters(string fname);
void savePattern(string fname);
void loadConfiguration(string fname);
void tabSelected(Int_t);
int setADCPlot(Int_t);
int setSignalPlot(Int_t);
void CloseWindow();
void setPatternFile(const char* t);
void setPatternCompiler(const char* t);
void setAnalogSamples(const int);
void setDigitalSamples(const int);
void setReadoutMode(int);
void setADCEnable(Int_t);
void HandleMenu(Int_t);
TCanvas* getCanvas();
ClassDef(ctbMain,0)
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,181 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef CTBPATTERN_H
#define CTBPATTERN_H
#include <TGFrame.h>
#define NLOOPS 3
#define NWAITS 3
#define NADCS 32
#define PATLEN 1024
class TRootEmbeddedCanvas;
class TGButtonGroup;
class TGVerticalFrame;
class TGHorizontalFrame;
class TGTextEntry;
class TGLabel;
class TGNumberEntry;
class TH2F;
class TGComboBox;
class TGCheckButton;
class TGTextEntry;
class TGCheckButton;
class THStack;
class TGraphErrors;
class energyCalibration;
class TGTextButton;
class TGTab;
namespace sls
{
class Detector;
};
#include <string>
using namespace std;
class ctbLoop : public TGHorizontalFrame {
private:
TGNumberEntry *eLoopStartAddr;
TGNumberEntry *eLoopStopAddr;
TGNumberEntry *eLoopNumber;
int id;
sls::Detector *myDet;
public:
ctbLoop(TGGroupFrame *page, int i,sls::Detector *det);
void setNLoops();
void update();
ClassDef(ctbLoop,0)
};
class ctbWait : public TGHorizontalFrame {
private:
TGNumberEntry *eWaitAddr;
TGNumberEntry *eWaitTime;
int id;
sls::Detector *myDet;
public:
ctbWait(TGGroupFrame *page, int i,sls::Detector *det);
void setWaitTime();
void update();
ClassDef(ctbWait,0)
};
class ctbPattern : public TGGroupFrame {
private:
TGNumberEntry *eAdcClkFreq;
TGNumberEntry *eRunClkFreq;
TGNumberEntry *eDBitClkFreq;
TGNumberEntry *eAdcClkPhase;
TGNumberEntry *eDBitClkPhase;
//TGNumberEntry *eRunClkPhase;
TGNumberEntry *eStartAddr;
TGNumberEntry *eStopAddr;
TGNumberEntry *eFrames;
TGNumberEntry *ePeriod;
TGNumberEntry *eTriggers;
// TGNumberEntry *eMeasurements;
TGNumberEntry *eAdcPipeline;
TGNumberEntry *eDBitPipeline;
ctbLoop *eLoop[NLOOPS];
ctbWait *eWait[NWAITS];
TGTextEntry *patternCompiler;
TGTextEntry *patternFile;
TGTextButton *browseCompiler;
TGTextButton *browseFile;
TGNumberEntry *eAnalogSamples;
TGNumberEntry *eDigitalSamples;
TGCheckButton *cbAnalog;
TGCheckButton *cbDigital;
char pat[PATLEN*8];
sls::Detector *myDet;
public:
ctbPattern(TGVerticalFrame *page, sls::Detector *det);
void update();
void setAdcFreq();
void setRunFreq();
void setDBitFreq();
void setAdcPhase();
void setDBitPhase();
// void setRunPhase();
void setAdcPipeline();
void setDBitPipeline();
void setFrames();
void setTriggers();
// void setMeasurements();
void setPeriod();
void chooseCompiler();
void choosePattern();
string getCompiler();
string getPatternFile();
void setPatternAlias(string);
string getPatternAlias();
int getAnalogSamples();
void setAnalogSamples();
int getDigitalSamples();
void setDigitalSamples();
void setReadoutMode(Bool_t);
int getReadoutMode();
void setFile();
void setCompiler();
void patternFileChanged(const char*);
void patternCompilerChanged(const char*);
void analogSamplesChanged(const int t);
void digitalSamplesChanged(const int t);
void readoutModeChanged(int);
ClassDef(ctbPattern,0)
};
#endif

View File

@ -1,225 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include <TGFrame.h>
#include <TGButtonGroup.h>
#include <TGNumberEntry.h>
#include <TGLabel.h>
#include <TList.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include "ctbDefs.h"
#include "ctbDacs.h"
#include "ctbPowers.h"
#include "sls/Detector.h"
#include "sls/sls_detector_defs.h"
using namespace std;
ctbPower::ctbPower(TGGroupFrame* f, int i, sls::Detector* d)
: ctbDac(f, i, d)
{
cout << "****************************************************************power " << i << endl;
dacsUnit->SetOn(kTRUE);
dacsUnit->SetEnabled(kFALSE);
switch(i) {
case slsDetectorDefs::V_POWER_IO:
dacsLabel->SetText("VIO");
break;
case slsDetectorDefs::V_POWER_A:
dacsLabel->SetText("VA");
break;
case slsDetectorDefs::V_POWER_B:
dacsLabel->SetText("VB");
break;
case slsDetectorDefs::V_POWER_C:
dacsLabel->SetText("VC");
break;
case slsDetectorDefs::V_POWER_D:
dacsLabel->SetText("VD");
break;
case slsDetectorDefs::V_POWER_CHIP:
dacsLabel->SetText("VCHIP");
dacsLabel->SetEnabled(kFALSE);
break;
default:
dacsLabel->SetText("Bad index");
break;
};
TGTextEntry *e=dacsEntry->TGNumberEntry::GetNumberEntry();
e->Disconnect ("ReturnPressed()");
e->Disconnect ("ValueSet(Long_t)");
e->Connect("ReturnPressed()","ctbPower",this,"setValue()");
dacsEntry->Connect("ValueSet(Long_t)","ctbPower",this,"setValue(Long_t)");
};
string ctbPower::getLabel() {
ostringstream line;
switch (id) {
case slsDetectorDefs::V_POWER_IO:
line << "VIO";
break;
case slsDetectorDefs::V_POWER_A:
line << "VA";
break;
case slsDetectorDefs::V_POWER_B:
line << "VB";
break;
case slsDetectorDefs::V_POWER_C:
line << "VC";
break;
case slsDetectorDefs::V_POWER_D:
line << "VD";
break;
case slsDetectorDefs::V_POWER_CHIP:
line << "VCHIP";
break;
default:
line << "VBAD";
break;
}
line << " " << dacsLabel->GetText() << endl;
return line.str();
}
void ctbPower::setValue(Long_t a) {ctbPower::setValue();}
void ctbPower::setValue() {
cout << "***************************Setting power " << dacsEntry->GetIntNumber() << " " << id << " " << 1 << endl;
try {
myDet->setVoltage(static_cast<slsDetectorDefs::dacIndex>(id), dacsEntry->GetIntNumber());
} CATCH_DISPLAY ("Could not set power " + to_string(id) + ".", "ctbPower::setValue")
getValue();
}
int ctbPower::getValue() {
try {
int val = myDet->getVoltage(static_cast<slsDetectorDefs::dacIndex>(id)).tsquash("Different values");
cout << "****************************Getting power " << val << " " << id << " " << 1 << endl;
dacsValue->SetText(to_string(val).c_str());
if (val > 0) {
if (id != static_cast<int>(slsDetectorDefs::V_POWER_CHIP))
dacsLabel->SetOn(kTRUE);
} else {
dacsLabel->SetOn(kFALSE);
}
return val;
} CATCH_DISPLAY ("Could not get power " + to_string(id) + ".", "ctbPower::getValue")
return -1;
}
ctbPowers::ctbPowers(TGVerticalFrame* page, sls::Detector* det) : TGGroupFrame(page,"Power Supplies",kVerticalFrame) , myDet(det){
SetTitlePos(TGGroupFrame::kLeft);
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
MapWindow();
// cout << "window mapped " << endl;
for (int idac=0; idac<NPOWERS; idac++) {
dacs[idac]=new ctbPower(this, slsDetectorDefs::V_POWER_A+idac, myDet);
}
}
int ctbPowers::setPwrAlias(string line) {
int is=-1;
char tit[100];
if (sscanf(line.c_str(),"VA %s",tit)) {
dacs[0]->setLabel(tit,1);
is=0;
}
if (sscanf(line.c_str(),"VB %s",tit)) {
dacs[1]->setLabel(tit,1);
is=1;
}
if (sscanf(line.c_str(),"VC %s",tit)) {
dacs[2]->setLabel(tit,1);
is=2;
}
if (sscanf(line.c_str(),"VD %s",tit)) {
dacs[3]->setLabel(tit,1);
is=3;
}
if (sscanf(line.c_str(),"VIO %s",tit)) {
dacs[4]->setLabel(tit,1);
is=4;
}
if (sscanf(line.c_str(),"VCHIP %s",tit)) {
dacs[5]->setLabel(tit,1);
is=5;
}
return is;
}
string ctbPowers::getPwrAlias() {
ostringstream line;
for (int i=0; i<NPOWERS; i++)
line << dacs[i]->getLabel() << endl;
return line.str();
}
string ctbPowers::getPwrParameters() {
ostringstream line;
line << "v_a" << " " << dacs[0]->getValue() << " mv" << endl;
line << "v_b" << " " << dacs[1]->getValue() << " mv" << endl;
line << "v_c" << " " << dacs[2]->getValue() << " mv" << endl;
line << "v_d" << " " << dacs[3]->getValue() << " mv" << endl;
line << "v_io" << " " << dacs[4]->getValue() << " mv" << endl;
line << "v_chip" << " " << dacs[5]->getValue() << " mv" << endl;
// for (int i=0; i<POWERS; i++) {
// //line << "dacs:" << i << " " << dacs[i]->getValue << endl;
// line << "dac:" << i << " " << dacs[i]->getValue() << endl;
// }
return line.str();
}
void ctbPowers::update() {
for (int idac=0; idac<NPOWERS; idac++) {
dacs[idac]->getValue();
}
}

View File

@ -1,69 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef CTBPOWERS_H
#define CTBPOWERS_H
#include <TGFrame.h>
#define NPOWERS 6
class TGTextEntry;
class TGLabel;
class TGNumberEntry;
class TGCheckButton;
namespace sls
{
class Detector;
};
#include <string>
using namespace std;
class ctbPower : public ctbDac {
public:
ctbPower(TGGroupFrame* f, int i, sls::Detector* d);
string getLabel();
int getValue();
void setValue();
void setValue(Long_t);
ClassDef(ctbPower,0)
};
class ctbPowers : public TGGroupFrame
{
private:
ctbPower *dacs[NPOWERS];
sls::Detector* myDet;
public:
//ctbPowers();
ctbPowers(TGVerticalFrame*, sls::Detector*);
int setPwrAlias(string);
string getPwrAlias();
string getPwrParameters();
void update();
ClassDef(ctbPowers,0)
};
#endif

View File

@ -1,543 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include <TApplication.h>
#include <TGClient.h>
#include <TCanvas.h>
#include <TF1.h>
#include <TRandom.h>
#include <TGButton.h>
#include <TRootEmbeddedCanvas.h>
#include <TGButtonGroup.h>
#include <TGNumberEntry.h>
#include <TGLabel.h>
#include <TList.h>
#include <TGFileDialog.h>
#include <TGComboBox.h>
#include <TH2F.h>
#include <TColor.h>
#include <TH1F.h>
#include <TGraphErrors.h>
#include <THStack.h>
#include <TGTab.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <TGButton.h>
#include <TRootEmbeddedCanvas.h>
#include <TGButtonGroup.h>
#include <TGNumberEntry.h>
#include <TGLabel.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <TColor.h>
#include <TGColorSelect.h>
#include "ctbSignals.h"
#include "ctbDefs.h"
#include "sls/Detector.h"
using namespace std;
//#define DEFAULTFN "run_0.encal"
ctbSignal::ctbSignal(TGFrame *page, int i, sls::Detector *det)
: TGHorizontalFrame(page, 800,50), myDet(det), id(i), hsig(NULL) {
TGHorizontalFrame *hframe=this;
char tit[100];
sprintf(tit, "BIT%d ",id);
sLabel= new TGLabel(hframe, tit);
hframe->AddFrame( sLabel,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
sLabel->MapWindow();
sLabel->SetTextJustify(kTextLeft);
sOutput= new TGCheckButton(hframe, "Out");
hframe->AddFrame( sOutput,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
sOutput->MapWindow();
sOutput->Connect("Toggled(Bool_t)","ctbSignal",this,"ToggledOutput(Bool_t)");
sDbitList= new TGCheckButton(hframe, "DB List");
hframe->AddFrame( sDbitList,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
sDbitList->MapWindow();
sDbitList->Connect("Toggled(Bool_t)","ctbSignal",this,"ToggledDbitList(Bool_t)");
sPlot= new TGCheckButton(hframe, "Plot");
hframe->AddFrame( sPlot,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
sPlot->MapWindow();
sPlot->Connect("Toggled(Bool_t)","ctbSignal",this,"ToggledPlot(Bool_t)");
fColorSel = new TGColorSelect(hframe, id+1, 0);
fColorSel->Connect("ColorSelected(Pixel_t)","ctbSignal",this,"ColorChanged(Pixel_t)");
hframe->AddFrame(fColorSel, new TGLayoutHints(kLHintsTop |
kLHintsLeft, 2, 0, 2, 2));
fColorSel->SetColor(TColor::Number2Pixel(id+1));
ToggledOutput(kFALSE);
ToggledPlot(kFALSE);
// if (id==63) {
// sOutput->SetOn(kTRUE);
// sOutput->SetEnabled(kFALSE);
// }
// #ifdef CTB
// if (id==62) {
// sOutput->SetOn(kTRUE);
// sOutput->SetEnabled(kFALSE);
// }
// // if (id>=32 && id<48)
// // fixOutput(1);
// // else if (id>=48 && id<64)
// // fixOutput(0);
// #endif
}
int ctbSignal::setSignalAlias(char *tit, int plot, int col) {
if (tit)
sLabel->SetText(tit);
if (plot>0) {
sPlot->SetOn(kTRUE,kTRUE);
} else if (plot==0)
sPlot->SetOn(kFALSE,kTRUE);
if (col>=0)
fColorSel->SetColor(col);//TColor::Number2Pixel(col+1));
fColorSel->SetEnabled(sPlot->IsOn());
return 0;
}
string ctbSignal::getSignalAlias() {
ostringstream oss;
oss << "BIT" << dec << id << " " << sLabel->GetText()->Data() << " " << sPlot->IsOn() << hex << " " << fColorSel->GetColor() << endl;
return oss.str();
}
int ctbSignal::setOutput(Long64_t r) {
// cout << hex << r << dec <<endl;
Long64_t mask=((Long64_t)1<<id);
if (r&mask)
sOutput->SetOn(kTRUE,kTRUE);
else
sOutput->SetOn(kFALSE,kTRUE);
return sOutput->IsOn();
}
int ctbSignal::fixOutput(int i) {
if (i) {
sPlot->SetOn(kFALSE);
//sClock->SetOn(kFALSE,kTRUE);
sOutput->SetOn(kTRUE);
// sPlot->SetEnabled(kFALSE);
// sClock->SetEnabled(kTRUE);
} else {
sOutput->SetOn(kFALSE,kTRUE);
// sClock->SetOn(kFALSE);
// sClock->SetEnabled(kFALSE);
sPlot->SetEnabled(kTRUE);
}
sOutput->SetEnabled(kFALSE);
return 0;
}
int ctbSignal::setDbitList(Long64_t r) {
if (r)
sDbitList->SetOn(kTRUE,kFALSE);
else
sDbitList->SetOn(kFALSE,kFALSE);
return sDbitList->IsOn();
}
int ctbSignal::isDbitList() { return sDbitList->IsOn();}
int ctbSignal::isOutput() { return sOutput->IsOn();}
int ctbSignal::isPlot() { return sPlot->IsOn();}
Pixel_t ctbSignal::getColor(){return fColorSel->GetColor();}
void ctbSignal::ToggledOutput(Bool_t b) {
ToggledSignalOutput(id);
if (b) {
// sClock->SetEnabled(kTRUE);
sPlot->SetOn(kFALSE);
// sPlot->SetEnabled(kFALSE);
fColorSel->SetEnabled(kFALSE);
} else {
// sClock->SetEnabled(kFALSE);
// sClock->SetOn(kFALSE);
sPlot->SetEnabled(kTRUE);
if ( sPlot->IsOn())
fColorSel->SetEnabled(kFALSE);
else
fColorSel->SetEnabled(kTRUE);
}
}
void ctbSignal::ToggledDbitList(Bool_t b){
Long_t mask=id;
ToggledSignalDbitList(mask);
}
void ctbSignal::ToggledPlot(Bool_t b){
Long_t mask=b<<id;
ToggledSignalPlot(mask);
fColorSel->SetEnabled(b);
}
void ctbSignal::ColorChanged(Pixel_t p){
ToggledSignalPlot(id);
}
void ctbSignal::ToggledSignalOutput(Int_t b) {
cout << "Toggle signal " << id << " " << b << " " << sOutput->IsOn() <<endl;;
Emit("ToggledSignalOutput(Int_t)", id);
}
void ctbSignal::ToggledSignalDbitList(Int_t b){
cout << "Toggle dbitlist " << id << " " << b << endl;;
Emit("ToggledSignalDbitList(Int_t)", id);
}
void ctbSignal::ToggledSignalPlot(Int_t b){
Emit("ToggledSignalPlot(Int_t)", id);
}
ctbSignals::ctbSignals(TGVerticalFrame *page, sls::Detector *det)
: TGGroupFrame(page,"IO Signals",kVerticalFrame), myDet(det) {
SetTitlePos(TGGroupFrame::kLeft);
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
MapWindow();
TGHorizontalFrame *hframe;
TGHorizontalFrame* hhframe=new TGHorizontalFrame(this, 800,800);
AddFrame(hhframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
hhframe->MapWindow();
TGVerticalFrame *vframe;
int idac=0;
for (idac=0; idac<NSIGNALS; idac++) {
if (idac%((NSIGNALS+2)/2)==0) {
vframe=new TGVerticalFrame(hhframe, 400,800);
hhframe->AddFrame(vframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
vframe->MapWindow();
}
signals[idac]=new ctbSignal(vframe,idac,myDet);
signals[idac]->Connect("ToggledSignalOutput(Int_t)","ctbSignals",this,"ToggledOutReg(Int_t)");
signals[idac]->Connect("ToggledSignalDbitList(Int_t)","ctbSignals",this,"ToggledDbitList(Int_t)");
signals[idac]->Connect("ToggledSignalPlot(Int_t)","ctbSignals",this,"ToggledPlot(Int_t)");
vframe->AddFrame(signals[idac],new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
signals[idac]->MapWindow();
}
hframe=new TGHorizontalFrame(vframe, 800,50);
vframe->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
hframe->MapWindow();
TGLabel *label= new TGLabel(hframe, "IO Control Register: ");
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
label->MapWindow();
label->SetTextJustify(kTextLeft);
eIOCntrlRegister = new TGNumberEntry(hframe, 0, 16,999, TGNumberFormat::kNESHex,
TGNumberFormat::kNEANonNegative,
TGNumberFormat::kNELNoLimits);
hframe->AddFrame(eIOCntrlRegister,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
eIOCntrlRegister->MapWindow();
eIOCntrlRegister->Resize(150,30);
hframe=new TGHorizontalFrame(vframe, 800,50);
vframe->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
hframe->MapWindow();
label= new TGLabel(hframe, "DBit Offset: ");
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
label->MapWindow();
label->SetTextJustify(kTextLeft);
eDbitOffset = new TGNumberEntry(hframe, 0, 9,999, TGNumberFormat::kNESInteger,
TGNumberFormat::kNEANonNegative,
TGNumberFormat::kNELNoLimits);
hframe->AddFrame(eDbitOffset,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
eDbitOffset->MapWindow();
eDbitOffset->Resize(150,30);
TGTextEntry *e= eDbitOffset->TGNumberEntry::GetNumberEntry();
e->Connect("ReturnPressed()","ctbSignals",this,"setDbitOffset()");
e->Connect("ValueSet(Long_t)","ctbSignals",this,"setDbitOffset(Long_t)");
}
int ctbSignals::setSignalAlias(string line) {
int is=-1, plot=0, col=-1;
char tit[100];
int narg=sscanf(line.c_str(),"BIT%d %s %d %d",&is,tit,&plot,&col);
if (narg<2)
return -1;
if (is>=0 && is<NIOSIGNALS) {
signals[is]->setSignalAlias(tit,plot,col);
}
return is;
}
string ctbSignals::getSignalAlias() {
ostringstream oss;
for (int is=0; is<NIOSIGNALS; is++)
oss << signals[is]->getSignalAlias() << endl;
return oss.str();
}
void ctbSignals::update() {
try {
Long64_t oreg = static_cast<Long64_t>(myDet->getPatternIOControl().tsquash("Different values"));
cout << hex << oreg << dec << endl;
for (int idac=0; idac<NIOSIGNALS; idac++) {
signals[idac]->setOutput(oreg);
}
} CATCH_DISPLAY ("Could not get patternIOcontrol.", "ctbSignals::update")
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
// enable all
for (int is=0; is<64; is++) {
signals[is]->setDbitList(1);
}
eDbitOffset->SetNumber(0);
}
// ctb
else {
try {
auto dbitlist = myDet->getRxDbitList().tsquash("Different values");
// enable all
if (dbitlist.empty()) {
for (int is=0; is<64; is++) {
signals[is]->setDbitList(1);
}
}
else {
// disable all
for (int is=0; is<64; is++) {
signals[is]->setDbitList(0);
}
// enable selected
for (const auto &value : dbitlist) {
signals[value]->setDbitList(1);
}
}
} CATCH_DISPLAY ("Could not get receiver dbit list.", "ctbSignals::update")
try {
auto val = myDet->getRxDbitOffset().tsquash("Different values");
eDbitOffset->SetNumber(val);
} CATCH_DISPLAY ("Could not get receiver dbit offset.", "ctbSignals::update")
}
}
string ctbSignals::getSignalParameters() {
try {
auto val = myDet->getPatternIOControl().tsquash("Different values");
ostringstream line;
line << "patioctrl " << hex << val << dec << endl;
return line.str();
} CATCH_DISPLAY ("Could not get patternIOcontrol.", "ctbSignals::getSignalParameters")
return ("");
}
void ctbSignals::ToggledOutReg(Int_t mask) {
try {
Long64_t oreg = static_cast<Long64_t>(myDet->getPatternIOControl().tsquash("Different values"));
Long64_t m=((Long64_t)1)<<mask;
cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg;
if (signals[mask]->isOutput()) {
cout << " or " << m ;
oreg|=m;
} else {
cout << " not " << ~m ;
oreg&=~m;
}
cout << " after " << oreg << endl;
myDet->setPatternIOControl(static_cast<uint64_t>(oreg));
oreg = static_cast<Long64_t>(myDet->getPatternIOControl().tsquash("Different values"));
cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg << endl;
eIOCntrlRegister->SetText(to_string(oreg).c_str());
} CATCH_DISPLAY ("Could not get/set patternIOcontrol.", "ctbSignals::ToggledOutReg")
}
void ctbSignals::ToggledDbitList(Int_t mask){
try {
auto dbitlist = myDet->getRxDbitList().tsquash("Different values");
// anyway all enabled
if ((dbitlist.empty()) && (signals[mask]->isDbitList())) {
;
}
// set the dbitlist
else {
std::vector <int> new_dbitlist;
for (int is=0; is<64; is++) {
if (signals[is]->isDbitList()){
new_dbitlist.push_back(is);
cout << is << " " << new_dbitlist.size() - 1 << endl;
}
}
if (new_dbitlist.size() > 64)
new_dbitlist.clear();
myDet->setRxDbitList(new_dbitlist);
// get list again
dbitlist = myDet->getRxDbitList().tsquash("Different values");
}
// enable all
if (dbitlist.empty()) {
for (int is=0; is<64; is++) {
signals[is]->setDbitList(1);
}
}
else {
// disable all
for (int is=0; is<64; is++) {
signals[is]->setDbitList(0);
}
// enable selected
for (const auto &value : dbitlist) {
signals[value]->setDbitList(1);
}
}
} CATCH_DISPLAY ("Could not get/set receiver dbit list.", "ctbSignals::ToggledDbitList")
}
void ctbSignals::ToggledPlot(Int_t b) {
Emit("ToggledSignalPlot(Int_t)", b);
}
void ctbSignals::ToggledSignalPlot(Int_t b) {
Emit("ToggledSignalPlot(Int_t)", b);
}
Pixel_t ctbSignals::getColor(int i){
if (i>=0 && i<NSIGNALS)
return signals[i]->getColor();
return static_cast<Pixel_t>(-1);
}
int ctbSignals::getPlot(int i){
if (i>=0 && i<NSIGNALS)
return signals[i]->isPlot();
return -1;
};
void ctbSignals::setDbitOffset(Long_t) {
setDbitOffset();
}
void ctbSignals::setDbitOffset(){
try {
myDet->setRxDbitOffset(eDbitOffset->GetNumber());
} CATCH_DISPLAY ("Could not set receiver dbit offset.", "ctbSignals::setDbitOffset")
}

View File

@ -1,123 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef CTBSIGNALS_H
#define CTBSIGNALS_H
#include <TGFrame.h>
#define NSIGNALS 64
#define NIOSIGNALS 64 //for moench board was 52
#define ADCLATCH 63
#define DIGSIGLATCH 62
class TGTextEntry;
class TGLabel;
class TGNumberEntry;
class TGCheckButton;
class TH1I;
class TGTextButton;
class TGColorSelect;
class TGNumberEntry;
namespace sls
{
class Detector;
};
class ctbSignal;
#include <string>
using namespace std;
class ctbSignal : public TGHorizontalFrame {
// RQ_OBJECT("ctbSignal")
private:
TGLabel *sLabel;
TGCheckButton *sOutput;
TGCheckButton *sDbitList;
TGCheckButton *sPlot;
TGLabel *sValue;
TGNumberEntry *sEntry;
TGColorSelect *fColorSel;
sls::Detector *myDet;
Int_t id;
TH1I *hsig;
public:
ctbSignal(TGFrame *page, int i, sls::Detector *det);
int setSignalAlias(char *tit, int plot, int col);
string getSignalAlias();
TH1I *getPlot() {return hsig;};
int setOutput(Long64_t);
int fixOutput(int);
int setDbitList(Long64_t);
void ToggledOutput(Bool_t);
void ToggledDbitList(Bool_t);
void ToggledPlot(Bool_t);
void ColorChanged(Pixel_t);
int isDbitList();
int isOutput();
int isPlot();
Pixel_t getColor();
void ToggledSignalOutput(Int_t); //*SIGNAL*
void ToggledSignalDbitList(Int_t); //*SIGNAL*
void ToggledSignalPlot(Int_t); //*SIGNAL*
ClassDef(ctbSignal,0)
};
class ctbSignals : public TGGroupFrame {
private:
ctbSignal *signals[NSIGNALS];
TGNumberEntry *eIOCntrlRegister;
TGNumberEntry *eDbitOffset;
sls::Detector *myDet;
public:
ctbSignals(TGVerticalFrame *page, sls::Detector *det);
int setSignalAlias(string line);
string getSignalAlias();
int getPlot(int);
Pixel_t getColor(int);
void update();
// void saveParameters();
string getSignalParameters();
//void setDbitList(Int_t);
void setDbitOffset(Long_t);
void setDbitOffset();
void ToggledOutReg(Int_t);
void ToggledDbitList(Int_t);
void ToggledPlot(Int_t);
void ToggledSignalPlot(Int_t); //*SIGNAL*
ClassDef(ctbSignals,0)
};
#endif

View File

@ -1,184 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <TGTextEntry.h>
#include <TGLabel.h>
#include <TGNumberEntry.h>
#include <TGButton.h>
#include "ctbSlowAdcs.h"
#include "ctbDefs.h"
#include "sls/Detector.h"
#include "sls/sls_detector_defs.h"
using namespace std;
ctbSlowAdc::ctbSlowAdc(TGGroupFrame *page, int idac, sls::Detector *det) : TGHorizontalFrame(page, 800,50) , id(idac), myDet(det) {
TGHorizontalFrame *hframe=this;
page->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
MapWindow();
char tit[100];
sprintf(tit, "SENSE %d:",idac-1000);
dacsLabel= new TGLabel(hframe, tit);// new TGLabel(hframe, tit);
hframe->AddFrame(dacsLabel,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
dacsLabel->MapWindow();
dacsLabel->SetTextJustify(kTextLeft);
sprintf(tit, "xxx");
dacsValue= new TGLabel(hframe, tit);
hframe->AddFrame( dacsValue,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
dacsValue->MapWindow();
dacsValue->SetTextJustify(kTextLeft);
TGTextButton *b= new TGTextButton(hframe, "Update");
hframe->AddFrame( b,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
b->MapWindow();
b->SetTextJustify(kTextLeft);
b->Connect("Clicked()","ctbSlowAdc",this,"getValue()");
}
int ctbSlowAdc::setLabel(char *tit) {
if(tit)
dacsLabel->SetText(tit);
return id;
}
string ctbSlowAdc::getLabel() {
ostringstream line;
line << dacsLabel->GetText() << endl;
// line << "DAC" << dec << id << " " << dacsUnit->IsOn() << endl;
return line.str();
}
int ctbSlowAdc::getValue() {
try {
std::string s;
// temp
if (id == static_cast<int>(slsDetectorDefs::SLOW_ADC_TEMP)) {
int val = myDet->getTemperature(static_cast<slsDetectorDefs::dacIndex>(id)).tsquash("Different values");
cout << "slow adc temp" << " " << val << endl;
s = to_string(val) + " " + to_string(0x00b0) + "C";//<2F>C
dacsValue->SetText(s.c_str());
return val;
}
// mv
else {
int val = myDet->getSlowADC(static_cast<slsDetectorDefs::dacIndex>(id)).tsquash("Different values");
cout << "slow adc " << id << " " << val << endl;
s = to_string(val) + " mV";
dacsValue->SetText(s.c_str());
return val;
}
} CATCH_DISPLAY ("Could not get slow dac " + to_string(id) + ".", "ctbSlowAdc::getValue")
return -1;
}
ctbSlowAdcs::ctbSlowAdcs(TGVerticalFrame *page, sls::Detector *det) : TGGroupFrame(page,"Sense",kVerticalFrame) , myDet(det){
SetTitlePos(TGGroupFrame::kLeft);
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
MapWindow();
// cout << "window mapped " << endl;
for (int idac=0; idac<NSLOWADCS + 1; idac++) {
adcs[idac]=new ctbSlowAdc(this, idac+1000, myDet);
}
adcs[NSLOWADCS]->setLabel((char*)"Temperature");
}
int ctbSlowAdcs::setSlowAdcAlias(string line) {
int is=-1, mv=0;
char tit[100];
int narg=sscanf(line.c_str(),"SENSE%d %s %d",&is,tit,&mv);
if (narg<2)
return -1;
if (is>=0 && is<NSLOWADCS)
adcs[is]->setLabel(tit);
return is;
}
string ctbSlowAdcs::getSlowAdcAlias() {
ostringstream line;
for (int i=0; i<NSLOWADCS; i++)
line << adcs[i]->getLabel() << endl;
return line.str();
}
string ctbSlowAdcs::getAdcParameters() {
ostringstream line;
for (int i=0; i<NSLOWADCS; i++) {
//line << "dacs:" << i << " " << dacs[i]->getValue << endl;
line << "adc:" << i << " " << adcs[i]->getValue() << endl;
}
line << "adc:-1" << adcs[NSLOWADCS]->getValue() << endl;
return line.str();
}
void ctbSlowAdcs::update() {
for (int idac=0; idac<NSLOWADCS+1; idac++) {
adcs[idac]->getValue();
}
}

View File

@ -1,80 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef CTBSLOWADCS_H
#define CTBSLOWADCS_H
#include <TGFrame.h>
//#define NDACS 16
#define NSLOWADCS 8
class TGTextEntry;
class TGLabel;
class TGNumberEntry;
class TGCheckButton;
class TGTextButton;
namespace sls
{
class Detector;
};
#include <string>
using namespace std;
class ctbSlowAdc : public TGHorizontalFrame {
protected:
// TGLabel *dacsLabel;
// TGNumberEntry *dacsEntry;
// TGCheckButton *dacsUnit;
TGLabel *dacsLabel;
TGLabel *dacsValue;
int id;
sls::Detector* myDet;
public:
ctbSlowAdc(TGGroupFrame*, int , sls::Detector*);
int getValue();
int setLabel(char *tit);
string getLabel();
ClassDef(ctbSlowAdc,0)
};
class ctbSlowAdcs : public TGGroupFrame {
private:
ctbSlowAdc *adcs[NSLOWADCS+1];
sls::Detector* myDet;
public:
ctbSlowAdcs(TGVerticalFrame *page, sls::Detector*);
int setSlowAdcAlias(string line);
// int setDacAlias(string line);
string getSlowAdcAlias();
string getAdcParameters();
void update();
ClassDef(ctbSlowAdcs,0)
};
#endif

View File

@ -40,6 +40,7 @@ set(SPHINX_SOURCE_FILES
src/pydetector.rst
src/pyenums.rst
src/pyexamples.rst
src/pyPatternGenerator.rst
src/servers.rst
src/receiver_api.rst
src/result.rst
@ -53,11 +54,18 @@ set(SPHINX_SOURCE_FILES
src/serverdefaults.rst
src/quick_start_guide.rst
src/troubleshooting.rst
src/pattern.rst
src/receivers.rst
src/slsreceiver.rst
src/udpheader.rst
src/udpconfig.rst
src/udpdetspec.rst
src/fileformat.rst
src/slsreceiverheaderformat.rst
src/masterfileattributes.rst
src/binaryfileformat.rst
src/hdf5fileformat.rst
src/zmqjsonheaderformat.rst
)
foreach(filename ${SPHINX_SOURCE_FILES})

View File

@ -890,7 +890,7 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS = */docs/* */tests/* */python/* */manual */slsDetectorServers/* */libs/* */integrationTests *README* */slsDetectorGui/* */ctbGui/* */slsDetectorCalibration/*
EXCLUDE_PATTERNS = */docs/* */tests/* */python/* */manual */slsDetectorServers/* */libs/* */integrationTests *README* */slsDetectorGui/* */ctbGui/* */slsDetectorCalibration/* *TobiSchluter*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the

View File

@ -63,4 +63,4 @@ html_static_path = ['static']
def setup(app):
app.add_stylesheet('css/extra.css') # may also be an URL
app.add_css_file('css/extra.css') # may also be an URL

View File

@ -21,7 +21,7 @@ print('\n\n\n\n SERVER CSV')
src = Path('@CMAKE_SOURCE_DIR@')/'slsDetectorServers/'
detectors = ['Mythen3', 'Gotthard2', 'Eiger',
'Jungfrau', 'Moench', 'Gotthard', 'Ctb']
'Jungfrau', 'Moench', 'Ctb']
for det in detectors:

View File

@ -0,0 +1,384 @@
Binary File Format
====================
This is the default file format that can be configured using command `fformat <commandline.html#term-fformat-binary-hdf5>`_.
.. code-block:: bash
sls_detector_put fformat binary
Master File
--------------
* File Name: [fpath]/[fname]_master_[findex].json :ref:`Details here<file name format>`
* It is in json format and created for every acquisition.
* It contains :ref:`attributes<master file attributes>` relevant to the acquisition. This can vary with detector type shown in :ref:`master json file examples <json master file examples>` here.
* It shows the :ref:`**SLS Receiver Header** <sls receiver header format>` format used in data files.
* Enabled/disabled using command `fmaster <commandline.html#term-fmaster-0-1>`_.
Data File
----------
* File Name: [fpath]/[fname]_dx_fy_[findex].raw :ref:`Details here<file name format>`
* It store multiple frames sequentially, with total number of frames determined by `rx_framesperfile <commandline.html#term-rx_framesperfile-n_frames>`_ parameter.
* Each frame includes a :ref:`**sls_receiver_header** <sls receiver header format>` structure, followed by the actual frame data.
.. _json master file examples:
JSON Master File Examples
---------------------------------------------------
Eiger
^^^^^
.. code-block:: text
{
"Version": 7.2,
"Timestamp": "Wed Nov 13 15:46:30 2024",
"Detector Type": "Eiger",
"Timing Mode": "auto",
"Geometry": {
"x": 2,
"y": 1
},
"Image Size in bytes": 262144,
"Pixels": {
"x": 512,
"y": 256
},
"Max Frames Per File": 10000,
"Frame Discard Policy": "nodiscard",
"Frame Padding": 1,
"Scan Parameters": "[disabled]",
"Total Frames": 1,
"Receiver Roi": {
"xmin": 4294967295,
"xmax": 4294967295,
"ymin": 4294967295,
"ymax": 4294967295
},
"Dynamic Range": 16,
"Ten Giga": 0,
"Exptime": "1s",
"Period": "1s",
"Threshold Energy": -1,
"Sub Exptime": "2.62144ms",
"Sub Period": "2.62144ms",
"Quad": 0,
"Number of rows": 256,
"Rate Corrections": "[0]",
"Frames in File": 1,
"Frame Header Format": {
"Frame Number": "8 bytes",
"SubFrame Number/ExpLength": "4 bytes",
"Packet Number": "4 bytes",
"Bunch ID": "8 bytes",
"Timestamp": "8 bytes",
"Module Id": "2 bytes",
"Row": "2 bytes",
"Column": "2 bytes",
"Reserved": "2 bytes",
"Debug": "4 bytes",
"Round Robin Number": "2 bytes",
"Detector Type": "1 byte",
"Header Version": "1 byte",
"Packets Caught Mask": "64 bytes"
}
}
Jungfrau
^^^^^^^^
.. code-block:: text
{
"Version": 7.2,
"Timestamp": "Wed Nov 13 13:03:53 2024",
"Detector Type": "Jungfrau",
"Timing Mode": "auto",
"Geometry": {
"x": 1,
"y": 1
},
"Image Size in bytes": 1048576,
"Pixels": {
"x": 1024,
"y": 512
},
"Max Frames Per File": 10000,
"Frame Discard Policy": "nodiscard",
"Frame Padding": 1,
"Scan Parameters": "[disabled]",
"Total Frames": 1000,
"Receiver Roi": {
"xmin": 4294967295,
"xmax": 4294967295,
"ymin": 4294967295,
"ymax": 4294967295
},
"Exptime": "10us",
"Period": "2ms",
"Number of UDP Interfaces": 1,
"Number of rows": 512,
"Frames in File": 10,
"Frame Header Format": {
"Frame Number": "8 bytes",
"SubFrame Number/ExpLength": "4 bytes",
"Packet Number": "4 bytes",
"Bunch ID": "8 bytes",
"Timestamp": "8 bytes",
"Module Id": "2 bytes",
"Row": "2 bytes",
"Column": "2 bytes",
"Reserved": "2 bytes",
"Debug": "4 bytes",
"Round Robin Number": "2 bytes",
"Detector Type": "1 byte",
"Header Version": "1 byte",
"Packets Caught Mask": "64 bytes"
}
}
Gotthard2
^^^^^^^^^^^^
.. code-block:: text
{
"Version": 7.2,
"Timestamp": "Wed Nov 13 14:18:17 2024",
"Detector Type": "Gotthard2",
"Timing Mode": "auto",
"Geometry": {
"x": 1,
"y": 1
},
"Image Size in bytes": 2560,
"Pixels": {
"x": 1280,
"y": 1
},
"Max Frames Per File": 20000,
"Frame Discard Policy": "nodiscard",
"Frame Padding": 1,
"Scan Parameters": "[disabled]",
"Total Frames": 10,
"Receiver Roi": {
"xmin": 4294967295,
"xmax": 4294967295,
"ymin": 4294967295,
"ymax": 4294967295
},
"Exptime": "0ns",
"Period": "0ns",
"Burst Mode": "burst_internal",
"Frames in File": 10,
"Frame Header Format": {
"Frame Number": "8 bytes",
"SubFrame Number/ExpLength": "4 bytes",
"Packet Number": "4 bytes",
"Bunch ID": "8 bytes",
"Timestamp": "8 bytes",
"Module Id": "2 bytes",
"Row": "2 bytes",
"Column": "2 bytes",
"Reserved": "2 bytes",
"Debug": "4 bytes",
"Round Robin Number": "2 bytes",
"Detector Type": "1 byte",
"Header Version": "1 byte",
"Packets Caught Mask": "64 bytes"
}
}
Mythen3
^^^^^^^
.. code-block:: text
{
"Version": 7.2,
"Timestamp": "Wed Nov 13 14:39:14 2024",
"Detector Type": "Mythen3",
"Timing Mode": "auto",
"Geometry": {
"x": 1,
"y": 1
},
"Image Size in bytes": 15360,
"Pixels": {
"x": 3840,
"y": 1
},
"Max Frames Per File": 10000,
"Frame Discard Policy": "nodiscard",
"Frame Padding": 1,
"Scan Parameters": "[disabled]",
"Total Frames": 1,
"Receiver Roi": {
"xmin": 4294967295,
"xmax": 4294967295,
"ymin": 4294967295,
"ymax": 4294967295
},
"Dynamic Range": 32,
"Ten Giga": 1,
"Period": "2ms",
"Counter Mask": "0x7",
"Exptime1": "0.1s",
"Exptime2": "0.1s",
"Exptime3": "0.1s",
"GateDelay1": "0ns",
"GateDelay2": "0ns",
"GateDelay3": "0ns",
"Gates": 1,
"Threshold Energies": "[-1, -1, -1]",
"Frames in File": 1,
"Frame Header Format": {
"Frame Number": "8 bytes",
"SubFrame Number/ExpLength": "4 bytes",
"Packet Number": "4 bytes",
"Bunch ID": "8 bytes",
"Timestamp": "8 bytes",
"Module Id": "2 bytes",
"Row": "2 bytes",
"Column": "2 bytes",
"Reserved": "2 bytes",
"Debug": "4 bytes",
"Round Robin Number": "2 bytes",
"Detector Type": "1 byte",
"Header Version": "1 byte",
"Packets Caught Mask": "64 bytes"
}
}
Moench
^^^^^^
.. code-block:: text
{
"Version": 7.2,
"Timestamp": "Wed Nov 13 14:41:32 2024",
"Detector Type": "Moench",
"Timing Mode": "auto",
"Geometry": {
"x": 1,
"y": 1
},
"Image Size in bytes": 320000,
"Pixels": {
"x": 400,
"y": 400
},
"Max Frames Per File": 100000,
"Frame Discard Policy": "discardpartial",
"Frame Padding": 1,
"Scan Parameters": "[disabled]",
"Total Frames": 1,
"Receiver Roi": {
"xmin": 4294967295,
"xmax": 4294967295,
"ymin": 4294967295,
"ymax": 4294967295
},
"Exptime": "10us",
"Period": "2ms",
"Number of UDP Interfaces": 1,
"Number of rows": 400,
"Frames in File": 1,
"Frame Header Format": {
"Frame Number": "8 bytes",
"SubFrame Number/ExpLength": "4 bytes",
"Packet Number": "4 bytes",
"Bunch ID": "8 bytes",
"Timestamp": "8 bytes",
"Module Id": "2 bytes",
"Row": "2 bytes",
"Column": "2 bytes",
"Reserved": "2 bytes",
"Debug": "4 bytes",
"Round Robin Number": "2 bytes",
"Detector Type": "1 byte",
"Header Version": "1 byte",
"Packets Caught Mask": "64 bytes"
}
}
Chip Test Board
^^^^^^^^^^^^^^^
.. code-block:: text
{
"Version": 7.2,
"Timestamp": "Wed Nov 13 15:32:59 2024",
"Detector Type": "ChipTestBoard",
"Timing Mode": "auto",
"Geometry": {
"x": 1,
"y": 1
},
"Image Size in bytes": 48018,
"Pixels": {
"x": 3,
"y": 1
},
"Max Frames Per File": 20000,
"Frame Discard Policy": "nodiscard",
"Frame Padding": 1,
"Scan Parameters": "[disabled]",
"Total Frames": 1,
"Receiver Roi": {
"xmin": 4294967295,
"xmax": 4294967295,
"ymin": 4294967295,
"ymax": 4294967295
},
"Exptime": "0ns",
"Period": "0.18s",
"Ten Giga": 0,
"ADC Mask": "0x2202",
"Analog Flag": 1,
"Analog Samples": 8003,
"Digital Flag": 0,
"Digital Samples": 1000,
"Dbit Offset": 0,
"Dbit Reorder": 1,
"Dbit Bitset": 0,
"Transceiver Mask": "0x3",
"Transceiver Flag": 0,
"Transceiver Samples": 1,
"Frames in File": 1,
"Frame Header Format": {
"Frame Number": "8 bytes",
"SubFrame Number/ExpLength": "4 bytes",
"Packet Number": "4 bytes",
"Bunch ID": "8 bytes",
"Timestamp": "8 bytes",
"Module Id": "2 bytes",
"Row": "2 bytes",
"Column": "2 bytes",
"Reserved": "2 bytes",
"Debug": "4 bytes",
"Round Robin Number": "2 bytes",
"Detector Type": "1 byte",
"Header Version": "1 byte",
"Packets Caught Mask": "64 bytes"
}
}

View File

@ -4,11 +4,54 @@ Command line interface
Usage
-------------
Commands can be used either with sls_detector_get or sls_detector_put
The syntax is *'[detector index]-[module index]:[command]'*, where the indices are by default '0', when not specified.
Module index
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Modules are indexed based on their order in the hostname command. They are used to configure a specific module within a detector and are followed by a ':' in syntax.
.. code-block::
# Applies to all modules of detector 0
sls_detector_put exptime 5s
# Applies to only the 4th module
sls_detector_put 3:exptime 5s
Detector index
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This index is useful when configuring multiple detectors from a single host. Each detector uses a unique shared memory identified by a detector index, derived again from the hostname command. It is followed by a '-'.
.. code-block::
# For detector with index 2 in shared memory
sls_detector_put 2-hostname bchip133+bchip123+bchip456
# Without '-', the detector index defaults to 0
sls_detector_put hostname bchip133+bchip123+bchip456
# Accessing all modules with detector index 2
sls_detector_put 2-exptime
# Starting acquisition only for detector with index 2
sls_detector_put 2-start
# Applies only to the 2nd detector, 4th module
sls_detector_put 1-3:exptime 5s
Command Execution
^^^^^^^^^^^^^^^^^^^^^^^
Commands can be executed using:
* **sls_detector_put**: setting values
* **sls_detector_get**: getting values
* **sls_detector**: automatically infers based on the number of arguments.
* **sls_detector_help**: gets help on the specific command
* **sls_detector_acquire**: initiates acquisition with the detector. This command blocks until the entire acquisition process is completed.
.. code-block::
sls_detector_get vrf
Help
--------
@ -24,6 +67,19 @@ Help
# get help for a particular command
sls_detector_get -h fpath
sls_detector_help fpath
# list of deprecated commands
list deprecated
Autocompletion
---------------
bash_autocomplete.sh or zsh_autocomplete.sh must be sourced from the main package folder to enable auto completion of commands and arguments for the command line on that shell.
.. code-block::
source bash_autocomplete.sh
Commands
@ -32,14 +88,14 @@ Commands
.. include:: ../commands.rst
Depreciated commands
Deprecated commands
------------------------
.. note ::
All the dac commands are preceded with the **dac** command. Use command **daclist** to get correct list of dac command arguments for current detector.
.. csv-table:: Depreciated commands
:file: ../depreciated.csv
.. csv-table:: Deprecated commands
:file: ../deprecated.csv
:widths: 35, 35
:header-rows: 1

View File

@ -19,7 +19,7 @@ A minimal CMakeLists.txt could look like this:
.. code-block:: cmake
project(myDetectorIntegration)
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.14)
add_subdirectory(slsDetectorPackage)
#Add your executable
@ -43,7 +43,7 @@ should be needed, otherwise specify cmake prefix path.
.. code-block:: cmake
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.14)
project(myintegration)
find_package(slsDetectorPackage 5.0 REQUIRED)

View File

@ -13,24 +13,36 @@ To use the basic building blocks, meaning sls_detector_get/put and
the shared libraries these are needed:
* Linux, preferably recent kernel (currently no cross platform support)
* CMake > 3.12
* CMake >= 3.14
* C++11 compatible compiler. (We test with gcc and clang)
* ZeroMQ version 4
-----------------------
Python bindings
-----------------------
* Python >= 3.8
* pybind11 2.13.6 (packaged in libs)
.. note ::
Refer :ref:`pybind11 notes. <pybind for different slsDetectorPackage versions>`
-----------------------
ZeroMQ
-----------------------
* Zeromq 4.3.4 (packaged in libs)
.. note ::
Refer :ref:`zeromq notes. <zeromq for different slsDetectorPackage versions>`
-----------------------
GUI
-----------------------
* Qt 5.9
* Qwt 6.1.5 (packaged in libs/)
-----------------------
Python bindings
-----------------------
* Python > 3.6
* pybind11 (packaged in libs/)
* Qwt 6.1.5 (packaged in libs)
-----------------------
Moench executables
@ -54,4 +66,6 @@ Packaged in libs/
* catch2 (unit testing)
* rapidjson (streaming from receiver)
* pybind11 (python bindings)
* pybind11 (python bindings)
* qwt (gui plotting)
* libzmq (streaming to/from receiver)

View File

@ -1,15 +1,17 @@
Detector
==============================================
The sls::Detector is the new public API to control
The sls::Detector is the public API to control
detectors from C++. This API is also used internally
for the Python bindings and the command line interface.
If a receiver has been configured this is also controlled
If a receiver has been configured, this is also controlled
through this class.
Most, if not all, functions are called in parallel
and the return value is a thin std::vector wrapper
containing results from all modules. (Result<T>)
containing results from all modules. (:ref:`Result class<Result Class>`)
Here are some :ref:`examples <Cplusplus Api Examples>` on how to use the API.
.. doxygenclass:: sls::Detector
:members:

View File

@ -1,3 +1,4 @@
.. _Cplusplus Api Examples:
@ -53,8 +54,8 @@ then set up the detector.
jungfrauDetectorServer_virtual
This launches a virtual Jungfrau detector server. As default is uses port 1952 and 1953
for communication over TCP. Most commands go on 1952 and only stop and status on 1953.
This launches a virtual Jungfrau detector server. As default it uses port 1952 and 1953
for communication over TCP. Most commands go on 1952 and only a few such as stop and status on 1953.
**Run example to configure**
@ -90,7 +91,10 @@ std::vector.
sls::Result<int> res1{1, 1, 1};
std::cout << "res1: " << res1 << '\n';
res1.squash();
# return -1 if different
res1.squash(-1);
# throw exception with custom message if different
res1.tsquash("Values are different);

62
docs/src/fileformat.rst Normal file
View File

@ -0,0 +1,62 @@
File format
================================
If `fwrite <commandline.html#term-fwrite-0-1>`_ is enabled, the receiver will write data to files.
Number of Files
----------------
Every acquisition will create a master file and data files.
An acquisition can have multiple data files for a single frame. The number of files is determined by the number of UDP ports per module and the number of modules.
* Every modules has its own receiver process. Every receiver process can have 1 or 2 UDP ports.
* Each UDP port will create its own file. Therefore, each receiver can write 1 or 2 files.
* So, for example a detector with 4 modules with 2 UDP ports each will create a total of 8 files with file names containing UDP port index **'_d0'** to **'_d7'**.
A new file containing **'_f[file_index]'** in file name is also created when reaching the maximum frames per file. Configured using `rx_framesperfile <commandline.html#term-rx_framesperfile-n_frames>`_.
.. _file name format:
Naming
-------
| Master File Name: [fpath]/[fname]_master_[findex].[ext]
| Data File Name: [fpath]/[fname]_dx_fy_[findex].[ext]
* fpath: file path set using command `fpath <commandline.html#term-fpath-path>`_. Default: '/'
* fname: file name prefix using command `fname <commandline.html#term-fname-name>`_. Default: "run"
* findex: acquisition index using command `findex <commandline.html#term-findex-n_value>`_. Automatically incremented for every acquisition with `sls_detector_acquire <commandline.html#term-acquire>`_ (if `fwrite <commandline.html#term-fwrite-0-1>`_ enabled).
* x: unique udp port index. New file per UDP port.
* y: file index. New file created after reaching max frames per file.
* ext: file extension. Default: "raw"(data file) or "json"(master file)
Some file name examples:
.. code-block:: bash
# first file
path-to-file/run_d0_f0_0.raw
# first file for second UDP port
path-to-file/run_d1_f0_0.raw
# second file after reaching max frames in first file
path-to-file/run_d0_f1_0.raw
# second acquisition, first file
path-to-file/run_d0_f0_1.raw
Formats
--------
There are 2 file formats supported by the receiver:
* Binary - extension .json (master file) or .raw (data files)
* HDF5 - extension .h5
The default is binary. HDF5 can be enabled by compiling the package with HDF5 option enabled. The file format is set using the command `fformat <commandline.html#term-fformat-binary-hdf5>`_.

View File

@ -98,7 +98,7 @@ Upgrade
* 6.1.2 server has a fix for seamless fpga programming
* We recommend first updating the on-board detector server to 6.1.2 (with client 6.1.x) using command 'updatedetectorserver' or 'copydetectorserver'.
* We recommend first updating the on-board detector server to 6.1.2 (with client 6.1.x) using command `updatedetectorserver <commandline.html#term-updatedetectorserver-server_name-with-full-path>`_.
* Then use command 'programfpga' to only update firmware or use command 'update' to update firmware and server to the latest release.
@ -120,7 +120,7 @@ Program from console
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update jungfrauDetectorServervxxx pcxxx xx.pof
# v6.1.1 - present (copies server from the full path provided)
@ -131,42 +131,6 @@ Program from console
Gotthard I
-----------
Download
^^^^^^^^^^^^^
- detector server corresponding to package in slsDetectorPackage/serverBin
- `pof files <https://github.com/slsdetectorgroup/slsDetectorFirmware>`__
.. _firmware upgrade using blaster for blackfin:
Upgrade
^^^^^^^^
.. warning ::
| Gotthard firmware cannot be upgraded remotely and requires the use of USB-Blaster.
| It is generally updated by us.
#. Download `Altera Quartus software or Quartus programmer <https://fpgasoftware.intel.com/20.1/?edition=standard&platform=linux&product=qprogrammer#tabs-4>`__.
#. Start Quartus programmer, click on Hardware Setup. In the "Currently selected hardware" window, select USB-Blaster.
#. In the Mode combo box, select "Active Serial Programming".
#. Plug the end of your USB-Blaster with the adaptor provided to the connector 'AS config' on the Gotthard board.
#. Click on 'Add file'. Select programming (pof) file provided by us.
#. Check "Program/Configure" and "Verify". Push the start button. Wait until the programming process is finished.
#. In case of error messages, check the polarity of cable (that pin1 corresponds) and that the correct programming connector is selected.
#. Reboot the detector.
Mythen III
-----------
@ -190,7 +154,7 @@ Program from console
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update mythen3DetectorServervxxx pcxxx xxx.rbf
# v6.1.1 - present (copies server from the full path provided)
@ -224,7 +188,7 @@ Program from console
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update gotthard2DetectorServervxxx pcxxx xxx.rbf
# v6.1.1 - present (copies server from the full path provided)
@ -257,7 +221,7 @@ Upgrade
* 6.1.2 server has a fix for seamless fpga programming
* We recommend first updating the on-board detector server to 6.1.2 (with client 6.1.x) using command 'updatedetectorserver' or 'copydetectorserver'.
* We recommend first updating the on-board detector server to 6.1.2 (with client 6.1.x) using command `updatedetectorserver <commandline.html#term-updatedetectorserver-server_name-with-full-path>`_.
* Then use command 'programfpga' to only update firmware or use command 'update' to update firmware and server to the latest release.
@ -275,7 +239,7 @@ Program from console
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update moenchDetectorServervxxx pcxxx xx.pof
# v6.1.1 - present (copies server from the full path provided)
@ -310,7 +274,7 @@ Program from console
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update ctbDetectorServervxxx pcxxx xx.pof
# v6.1.1 - present (copies server from the full path provided)
@ -396,7 +360,3 @@ How to get back mtd3 drive remotely (udpating kernel)
more /proc/mtd # verify mtd3 is listed
Last Resort using USB Blaster
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If none of these steps work, the last resort might be physically upgrading the firmware using a USB blaster, which also requires opening up the detector. Instructions for all the blackfin detectors are the same as the one for :ref:`gotthard firmware upgrade <firmware upgrade using blaster for blackfin>`.

View File

@ -11,7 +11,7 @@
#include <string>
#include <vector>
#include "CmdProxy.h"
#include "Caller.h"
#include "sls/Detector.h"
#include "sls/sls_detector_defs.h"
@ -37,8 +37,8 @@ int main() {
std::cout << "Generating command line documentation!\n";
sls::CmdProxy proxy(nullptr);
auto commands = proxy.GetProxyCommands();
sls::Caller caller(nullptr);
auto commands = caller.getAllCommands();
std::ofstream fs("commands.rst");
fs << ".. glossary::\n";
@ -46,7 +46,7 @@ int main() {
for (const auto &cmd : commands) {
std::ostringstream os;
std::cout << cmd << '\n';
proxy.Call(cmd, {}, -1, slsDetectorDefs::HELP_ACTION, os);
caller.call(cmd, {}, -1, slsDetectorDefs::HELP_ACTION, os);
auto tmp = os.str().erase(0, cmd.size());
auto usage = tmp.substr(0, tmp.find_first_of('\n'));
@ -55,9 +55,9 @@ int main() {
fs << '\t' << cmd << usage << help << "\n";
}
std::ofstream fs2("depreciated.csv");
std::ofstream fs2("deprecated.csv");
fs2 << "Old, New\n";
auto cmds = proxy.GetDepreciatedCommands();
auto cmds = caller.GetDeprecatedCommands();
for (auto it : cmds) {
fs2 << it.first << ", " << it.second << '\n';
}

View File

@ -0,0 +1,89 @@
HDF5 File Format
================================
Compilation
-------------
#. Compile the package with HDF5 option enabled
#. Using cmk script: ./cmk.sh -hj9 -d [path of hdf5 dir] (-d is optional and for custom installation folder)
#. Enable using cmake option **-DSLS_USE_HDF5=ON** and **-DCMAKE_INSTALL_PREFIX=/path/to/custom/hdf/installation** (optional).
Setup
-------
#. Start Receiver process
#. Load config file
#. Set file format using command `fformat <commandline.html#term-fformat-binary-hdf5>`_.
.. code-block:: bash
sls_detector_put fformat hdf5
Master File
-------------
* File Name: [fpath]/[fname]_master_[findex].h5 :ref:`Details here<file name format>`
* It contains :ref:`attributes<master file attributes>` relevant to the acquisition. This can vary with detector type.
.. code-block:: text
/ # Root level
|---> entry # entry group
| |---> data # data group
| |---> column # dataset of each sls_receiver_header member
| |---> data
| |---> detector header version
| |---> detector specific 1
| |---> detector specific 2
| |---> detector specific 3
| |---> detector specific 4
| |---> detector type
| |---> exp length or sub exposure time
| |---> frame number
| |---> mod id
| |---> packets caught
| |---> packets caught bit mask
| |---> row
| |---> timestamp
| |---> instrument # instrument group
| |---> beam # beam group
| |---> detector # detector group
| |---> Master File Attribute 1 # dataset of each master file attribute
| |---> Master File Attribute 2
| |---> Master File Attribute 3
| |---> Master File Attribute ..
| |---> sample # sample group
If more than 1 data file per frame:
* The dataset of each :ref:`**SLS Receiver Header** <sls receiver header format>` member is a virtual dataset.
* **data** dataset is a virtual dataset.
More details regarding master file attributes can be found :ref:`here<master file attributes>`.
Data File
-----------
* File Name: [fpath]/[fname]_dx_fy_[findex].h5 :ref:`Details here<file name format>`
Virtual Data File
------------------
* File Name: [fpath]/[fname]_virtual_[findex].h5 :ref:`Details here<file name format>`
* For multiple modules, a virtual file linking data from all the modules is created. The individual files are expected to be present.
* It is linked in the master file.

View File

@ -8,11 +8,11 @@ Welcome to slsDetectorPackage's documentation!
.. note ::
This is the documentation for the latest development version of slsDetectorPackage
For documentation on current and previous releases visit the official page: https://www.psi.ch/en/detectors/documentation
This is the documentation for the latest development version of slsDetectorPackage.
For further documentation, visit the official page: https://www.psi.ch/en/detectors/documentation
.. toctree::
:maxdepth: 1
:maxdepth: 3
:caption: Installation:
installation
@ -36,10 +36,12 @@ Welcome to slsDetectorPackage's documentation!
pydetector
pyenums
pyexamples
pyPatternGenerator
pattern
.. toctree::
:caption: Command line
:maxdepth: 2
:maxdepth: 1
commandline
quick_start_guide
@ -79,8 +81,25 @@ Welcome to slsDetectorPackage's documentation!
:caption: Receiver
:maxdepth: 2
receivers
slsreceiver
receivers
.. toctree::
:caption: Receiver Files
:maxdepth: 3
fileformat
slsreceiverheaderformat
masterfileattributes
binaryfileformat
hdf5fileformat
.. toctree::
:caption: Receiver ZMQ Stream
:maxdepth: 2
zmqjsonheaderformat
.. toctree::
:caption: Troubleshooting

View File

@ -1,9 +1,4 @@
.. warning ::
Before building from source make sure that you have the
:doc:`dependencies <../dependencies>` installed. If installing using conda, conda will
manage the dependencies. Avoid also installing packages with pip.
.. _Installation:
@ -11,18 +6,47 @@
Installation
===============
Install binaries using conda
-------------------------------
.. contents::
:local:
:depth: 2
:backlinks: top
Overview
--------------
The ``slsDetectorPackage`` provides core detector software implemented in C++, along with Python bindings packaged as the ``slsdet`` Python extension module. Choose the option that best fits your environment and use case.
:ref:`conda pre-built binaries`:
Install pre-built binaries for the C++ client, receiver, GUI and the Python API (``slsdet``), simplifying setup across platforms.
:ref:`pip`:
Install only the Python extension module, either by downloading the pre-built library from PyPI or by building the extension locally from source. Available only from v9.2.0 onwards.
:ref:`build from source`:
Compile the entire package yourself, including both the C++ core and the Python bindings, for maximum control and customization. However, make sure that you have the :doc:`dependencies <../dependencies>` installed. If installing using conda, conda will manage the dependencies. Avoid installing packages with pip and conda simultaneously.
.. _conda pre-built binaries:
1. Install pre-built binaries using conda (Recommended)
--------------------------------------------------------
Conda is not only useful to manage python environments but can also
be used as a user space package manager. Dates in the tag (for eg. 2020.07.23.dev0)
are from the developer branch. Please use released tags for stability.
We have three different packages available:
* **slsdetlib** shared libraries and command line utilities
* **slsdetgui** GUI
* **slsdet** Python bindings
We have four different packages available:
============== =============================================
Package Description
============== =============================================
slsdetlib shared libraries and command line utilities
slsdetgui GUI
slsdet Python bindings
moenchzmq moench
============== =============================================
.. code-block:: bash
@ -38,7 +62,7 @@ We have three different packages available:
#ready to use
sls_detector_get exptime
etc ...
...
.. code-block:: bash
@ -50,48 +74,54 @@ We have three different packages available:
conda search slsdet
# gui
conda search slsdetgui
# moench
conda search moenchzmq
.. _pip:
2. Pip
-------
The Python extension module ``slsdet`` can be installed using pip. This is available from v9.2.0 onwards.
.. code-block:: bash
#Install the Python extension module from PyPI
pip install slsdet
# or install the python extension locally from source
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git --branch 9.2.0
cd slsDetectorPackage
pip install .
Build from source
-------------------
.. _build from source:
3. Build from source
-------------------------
1. Download Source Code from github
3.1. Download Source Code from github
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git --branch 6.1.1
.. note ::
| **Pybind for Python**
| v7.0.0+:
| pybind11 packaged into 'libs/pybind'. No longer a submodule. No need for "recursive" or "submodule update".
|
| Older versions:
| pybind11 is a submodule. Must be cloned using "recursive" and updated when switching between versions using the following commands.
.. code-block:: bash
# clone using recursive to get pybind11 submodule
git clone --recursive https://github.com/slsdetectorgroup/slsDetectorPackage.git
# update submodule when switching between releases
cd slsDetectorPackage
git submodule update --init
For v6.x.x of slsDetectorPackage and older, refer :ref:`pybind11 notes on cloning. <pybind for different slsDetectorPackage versions>`
.. _build from source using cmake:
2. Build from Source
3.2. Build from Source
^^^^^^^^^^^^^^^^^^^^^^^^^^
Build using CMake
^^^^^^^^^^^^^^^^^^^^^^
One can either build using cmake or use the in-built cmk.sh script.
3.2.1. Build using CMake
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
@ -118,33 +148,36 @@ Instead of the cmake command, one can use ccmake to get a list of options to con
ccmake ..
# choose the options
# first press [c] - configure
# first press [c] - configure (until you see [g])
# then press [g] - generate
=============================== ===========================================
=============================== ===============================
Example cmake options Comment
=============================== ===========================================
=============================== ===============================
-DSLS_USE_PYTHON=ON Python
-DPython_FIND_VIRTUALENV=ONLY Python from only the conda environment
-DZeroMQ_HINT=/usr/lib64 Use system zmq instead
-DPython_FIND_VIRTUALENV=ONLY Python from the conda env
-DSLS_USE_GUI=ON GUI
=============================== ===========================================
-DSLS_USE_HDF5=ON HDF5
-DSLS_USE_SIMULATOR=ON Simulator
=============================== ===============================
.. note ::
For v7.x.x of slsDetectorPackage and older, refer :ref:`zeromq notes for cmake option to hint library location. <zeromq for different slsDetectorPackage versions>`
Build using in-built cmk.sh script
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3.2.2. Build using in-built cmk.sh script
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
The binaries are generated in slsDetectorPackage/build/bin directory.
Usage: ./cmk.sh [-b] [-c] [-d <HDF5 directory>] [e] [g] [-h] [i] [-j <Number of threads>]
[-k <CMake command>] [-l <Install directory>] [m] [n] [-p] [-q <Zmq hint directory>]
[r] [s] [t] [u] [z]
Usage: $0 [-b] [-c] [-d <HDF5 directory>] [-e] [-g] [-h] [-i]
[-j <Number of threads>] [-k <CMake command>] [-l <Install directory>]
[-m] [-n] [-p] [-r] [-s] [-t] [-u] [-z]
-[no option]: only make
-b: Builds/Rebuilds CMake files normal mode
-c: Clean
@ -159,7 +192,6 @@ Build using in-built cmk.sh script
-m: Manuals
-n: Manuals without compiling doxygen (only rst)
-p: Builds/Rebuilds Python API
-q: Zmq hint directory
-r: Build/Rebuilds only receiver
-s: Simulator
-t: Build/Rebuilds only text client
@ -176,13 +208,17 @@ Build using in-built cmk.sh script
# new build, python and compile in parallel:
./cmk.sh -cbpj5
#To use the system zmq (/usr/lib64) instead
./cmk.sh -cbj5 -q /usr/lib64
#For rebuilding only certain sections
./cmk.sh -tg #only text client and gui
./cmk.sh -r #only receiver
.. note ::
For v7.x.x of slsDetectorPackage and older, refer :ref:`zeromq notes for cmk script option to hint library location. <zeromq for different slsDetectorPackage versions>`
Build on old distributions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3.3. Build on old distributions using conda
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If your linux distribution doesn't come with a C++11 compiler (gcc>4.8) then
it's possible to install a newer gcc using conda and build the slsDetectorPackage
@ -191,7 +227,7 @@ using this compiler
.. code-block:: bash
#Create an environment with the dependencies
conda create -n myenv gxx_linux-64 cmake zmq
conda create -n myenv gxx_linux-64 cmake
conda activate myenv
# outside slsDetecorPackage folder
@ -200,11 +236,17 @@ using this compiler
make -j12
.. note ::
Build slsDetectorGui (Qt5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
For v7.x.x of slsDetectorPackage and older, refer :ref:`zeromq notes for dependencies for conda. <zeromq for different slsDetectorPackage versions>`
3.4. Build slsDetectorGui (Qt5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. Using pre-built binary on conda
.. code-block:: bash
conda create -n myenv slsdetgui=7.0.0
@ -212,13 +254,22 @@ Build slsDetectorGui (Qt5)
2. Using system installation on RHEL7
.. code-block:: bash
yum install qt5-qtbase-devel.x86_64
yum install qt5-qtsvg-devel.x86_64
3. Using system installation on RHEL8
.. code-block:: bash
yum install qt5-qtbase-devel.x86_64
yum install qt5-qtsvg-devel.x86_64
yum install expat-devel.x86_64
4. Using conda
3. Using conda
.. code-block:: bash
#Add channels for dependencies and our library
@ -228,9 +279,9 @@ Build slsDetectorGui (Qt5)
# create environment to compile
# on rhel7
conda create -n slsgui zeromq gxx_linux-64 gxx_linux-64 mesa-libgl-devel-cos6-x86_64 qt
conda create -n slsgui gxx_linux-64 gxx_linux-64 mesa-libgl-devel-cos6-x86_64 qt
# on fedora or newer systems
conda create -n slsgui zeromq qt
conda create -n slsgui qt
# when using conda compilers, would also need libgl, but no need for it on fedora unless maybe using it with ROOT
@ -246,11 +297,14 @@ Build slsDetectorGui (Qt5)
cd slsDetectorPackage
./cmk.sh -cbgj9
.. note ::
For v7.x.x of slsDetectorPackage and older, refer :ref:`zeromq notes for dependencies for conda. <zeromq for different slsDetectorPackage versions>`
Build this documentation
^^^^^^^^^^^^^^^^^^^^^^^^
3.5. Build this documentation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The documentation for the slsDetectorPackage is build using a combination
of Doxygen, Sphinx and Breathe. The easiest way to install the dependencies
@ -258,7 +312,7 @@ is to use conda
.. code-block:: bash
conda create -n myenv python sphinx_rtd_theme breathe
conda create -n myenv python=3.12 sphinx sphinx_rtd_theme breathe doxygen numpy
.. code-block:: bash
@ -270,3 +324,53 @@ is to use conda
make docs # generate API docs and build Sphinx RST
make rst # rst only, saves time in case the API did not change
4. Pybind and Zeromq
-------------------------
.. _pybind for different slsDetectorPackage versions:
| **Pybind11 for Python**
| v8.0.0+:
| pybind11 is built
| * by default from tar file in repo (libs/pybind/v2.1x.0.tar.gz)
| * or use advanced option SLS_FETCH_PYBIND11_FROM_GITHUB [`link <https://github.com/pybind/pybind11>`__].
| * v9.0.0+: pybind11 (v2.13.6)
| * v8.x.x : pybind11 (v2.11.0)
|
| v7.x.x:
| pybind11 packaged into 'libs/pybind'. No longer a submodule. No need for "recursive" or "submodule update".
|
| Older versions:
| pybind11 is a submodule. Must be cloned using "recursive" and updated when switching between versions using the following commands.
.. code-block:: bash
# Note: Only for v6.x.x versions and older
# clone using recursive to get pybind11 submodule
git clone --recursive https://github.com/slsdetectorgroup/slsDetectorPackage.git
# update submodule when switching between releases
cd slsDetectorPackage
git submodule update --init
.. _zeromq for different slsDetectorPackage versions:
| **Zeromq**
| v8.0.0+:
| zeromq (v4.3.4) is built
| * by default from tar file in repo (libs/libzmq/libzmq-4.3.4.tar.gz)
| * or use advanced option SLS_FETCH_ZMQ_FROM_GITHUB [`link <https://github.com/zeromq/libzmq.git>`__].
|
| v7.x.x and older:
| zeromq-devel must be installed and one can hint its location using
| * cmake option:'-DZeroMQ_HINT=/usr/lib64' or
| * option '-q' in cmk.sh script: : ./cmk.sh -cbj5 -q /usr/lib64
| * 'zeromq' dependency added when installing using conda

View File

@ -0,0 +1,362 @@
.. _master file attributes:
Master File Attributes
=======================
These attributes are the same in binary and HDF5 file, but vary depending on detector type.
Eiger
^^^^^
+-----------------------+-------------------------------------------------+
| **Key** | **Description** |
+-----------------------+-------------------------------------------------+
| Version | Version of the master file |
| | Current value:8.0 |
+-----------------------+-------------------------------------------------+
| Timestamp | Timestamp of creation of master file |
+-----------------------+-------------------------------------------------+
| Detector Type | Detector type |
+-----------------------+-------------------------------------------------+
| Timing Mode | Timing Mode |
+-----------------------+-------------------------------------------------+
| Geometry | Number of UDP ports in x and y dimension for |
| | complete detector |
+-----------------------+-------------------------------------------------+
| Image Size in bytes | Image size in bytes per UDP port |
+-----------------------+-------------------------------------------------+
| Pixels | Number of pixels in x and y dimension |
| | per UDP port |
+-----------------------+-------------------------------------------------+
| Max Frames Per File | Maximum frames per file |
+-----------------------+-------------------------------------------------+
| Frame Discard Policy | Receiever Frame discard policy |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Frame Padding | Receiver Frame padding enable |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Scan Parameters | Scanning mode on detector |
+-----------------------+-------------------------------------------------+
| Total Frames | Total number of frames and triggers expected |
+-----------------------+-------------------------------------------------+
| Receiver Roi | Receiver ROI in file including xmax and ymax |
+-----------------------+-------------------------------------------------+
| Dynamic Range | Bits per pixel |
+-----------------------+-------------------------------------------------+
| Ten Giga | 10GbE enable for data |
+-----------------------+-------------------------------------------------+
| Exptime | Exposure time |
+-----------------------+-------------------------------------------------+
| Period | Period between frames |
+-----------------------+-------------------------------------------------+
| Threshold Energy | Threshold energy |
+-----------------------+-------------------------------------------------+
| Sub Exptime | Sub exposure time in 32 bit mode |
+-----------------------+-------------------------------------------------+
| Sub Period | Sub period between frames in 32 bit mode |
+-----------------------+-------------------------------------------------+
| Quad | Quad enable (hardware) |
+-----------------------+-------------------------------------------------+
| Number of rows | Number of rows enabled for readout |
+-----------------------+-------------------------------------------------+
| Rate Corrections | Rate Corrections |
+-----------------------+-------------------------------------------------+
| Frames in File | Number of frames written to file by Receiver 0 |
+-----------------------+-------------------------------------------------+
| Frame Header Format | Expected frame header format for the data files |
+-----------------------+-------------------------------------------------+
Jungfrau
^^^^^^^^
+-----------------------+-------------------------------------------------+
| **Key** | **Description** |
+-----------------------+-------------------------------------------------+
| Version | Version of the master file |
| | Current value:8.0 |
+-----------------------+-------------------------------------------------+
| Timestamp | Timestamp of creation of master file |
+-----------------------+-------------------------------------------------+
| Detector Type | Detector type |
+-----------------------+-------------------------------------------------+
| Timing Mode | Timing Mode |
+-----------------------+-------------------------------------------------+
| Geometry | Number of UDP ports in x and y dimension for |
| | complete detector |
+-----------------------+-------------------------------------------------+
| Image Size in bytes | Image size in bytes per UDP port |
+-----------------------+-------------------------------------------------+
| Pixels | Number of pixels in x and y dimension |
| | per UDP port |
+-----------------------+-------------------------------------------------+
| Max Frames Per File | Maximum frames per file |
+-----------------------+-------------------------------------------------+
| Frame Discard Policy | Receiever Frame discard policy |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Frame Padding | Receiver Frame padding enable |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Scan Parameters | Scanning mode on detector |
+-----------------------+-------------------------------------------------+
| Total Frames | Total number of frames and triggers expected |
+-----------------------+-------------------------------------------------+
| Receiver Roi | Receiver ROI in file including xmax and ymax |
+-----------------------+-------------------------------------------------+
| Exptime | Exposure time |
+-----------------------+-------------------------------------------------+
| Period | Period between frames |
+-----------------------+-------------------------------------------------+
| Number of UDP | Number of UDP Interfaces enabled per module |
| Interfaces | |
+-----------------------+-------------------------------------------------+
| Number of rows | Number of rows enabled for readout |
+-----------------------+-------------------------------------------------+
| Frames in File | Number of frames written to file by Receiver 0 |
+-----------------------+-------------------------------------------------+
| Frame Header Format | Expected frame header format for the data files |
+-----------------------+-------------------------------------------------+
Gotthard II
^^^^^^^^^^^^
+-----------------------+-------------------------------------------------+
| **Key** | **Description** |
+-----------------------+-------------------------------------------------+
| Version | Version of the master file |
| | Current value:8.0 |
+-----------------------+-------------------------------------------------+
| Timestamp | Timestamp of creation of master file |
+-----------------------+-------------------------------------------------+
| Detector Type | Detector type |
+-----------------------+-------------------------------------------------+
| Timing Mode | Timing Mode |
+-----------------------+-------------------------------------------------+
| Geometry | Number of UDP ports in x and y dimension for |
| | complete detector |
+-----------------------+-------------------------------------------------+
| Image Size in bytes | Image size in bytes per UDP port |
+-----------------------+-------------------------------------------------+
| Pixels | Number of pixels in x and y dimension |
| | per UDP port |
+-----------------------+-------------------------------------------------+
| Max Frames Per File | Maximum frames per file |
+-----------------------+-------------------------------------------------+
| Frame Discard Policy | Receiever Frame discard policy |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Frame Padding | Receiver Frame padding enable |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Scan Parameters | Scanning mode on detector |
+-----------------------+-------------------------------------------------+
| Total Frames | Total number of frames and triggers expected |
+-----------------------+-------------------------------------------------+
| Receiver Roi | Receiver ROI in file including xmax and ymax |
+-----------------------+-------------------------------------------------+
| Exptime | Exposure time |
+-----------------------+-------------------------------------------------+
| Period | Period between frames |
+-----------------------+-------------------------------------------------+
| Burst Mode | Burst mode of detector |
+-----------------------+-------------------------------------------------+
| Frames in File | Number of frames written to file by Receiver 0 |
+-----------------------+-------------------------------------------------+
| Frame Header Format | Expected frame header format for the data files |
+-----------------------+-------------------------------------------------+
Mythen3
^^^^^^^
+-----------------------+-------------------------------------------------+
| **Key** | **Description** |
+-----------------------+-------------------------------------------------+
| Version | Version of the master file |
| | Current value:8.0 |
+-----------------------+-------------------------------------------------+
| Timestamp | Timestamp of creation of master file |
+-----------------------+-------------------------------------------------+
| Detector Type | Detector type |
+-----------------------+-------------------------------------------------+
| Timing Mode | Timing Mode |
+-----------------------+-------------------------------------------------+
| Geometry | Number of UDP ports in x and y dimension for |
| | complete detector |
+-----------------------+-------------------------------------------------+
| Image Size in bytes | Image size in bytes per UDP port |
+-----------------------+-------------------------------------------------+
| Pixels | Number of pixels in x and y dimension |
| | per UDP port |
+-----------------------+-------------------------------------------------+
| Max Frames Per File | Maximum frames per file |
+-----------------------+-------------------------------------------------+
| Frame Discard Policy | Receiever Frame discard policy |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Frame Padding | Receiver Frame padding enable |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Scan Parameters | Scanning mode on detector |
+-----------------------+-------------------------------------------------+
| Total Frames | Total number of frames and triggers expected |
+-----------------------+-------------------------------------------------+
| Receiver Roi | Receiver ROI in file including xmax and ymax |
+-----------------------+-------------------------------------------------+
| Dynamic Range | Bits per pixel |
+-----------------------+-------------------------------------------------+
| Ten Giga | 10GbE enable for data |
+-----------------------+-------------------------------------------------+
| Period | Period between frames |
+-----------------------+-------------------------------------------------+
| Counter Mask | Mask of counters enabled |
+-----------------------+-------------------------------------------------+
| Exptime1 | Exposure time of counter 1 |
+-----------------------+-------------------------------------------------+
| Exptime2 | Exposure time of counter 2 |
+-----------------------+-------------------------------------------------+
| Exptime3 | Exposure time of counter 3 |
+-----------------------+-------------------------------------------------+
| GateDelay1 | Gate delay of counter 1 |
+-----------------------+-------------------------------------------------+
| GateDelay2 | Gate delay of counter 2 |
+-----------------------+-------------------------------------------------+
| GateDelay3 | Gate delay of counter 3 |
+-----------------------+-------------------------------------------------+
| Gates | Number of gates |
+-----------------------+-------------------------------------------------+
| Threshold energies | Threshold energy of all 3 counters |
+-----------------------+-------------------------------------------------+
| Frames in File | Number of frames written to file by Receiver 0 |
+-----------------------+-------------------------------------------------+
| Frame Header Format | Expected frame header format for the data files |
+-----------------------+-------------------------------------------------+
Moench
^^^^^^
+-----------------------+-------------------------------------------------+
| **Key** | **Description** |
+-----------------------+-------------------------------------------------+
| Version | Version of the master file |
| | Current value:8.0 |
+-----------------------+-------------------------------------------------+
| Timestamp | Timestamp of creation of master file |
+-----------------------+-------------------------------------------------+
| Detector Type | Detector type |
+-----------------------+-------------------------------------------------+
| Timing Mode | Timing Mode |
+-----------------------+-------------------------------------------------+
| Geometry | Number of UDP ports in x and y dimension for |
| | complete detector |
+-----------------------+-------------------------------------------------+
| Image Size in bytes | Image size in bytes per UDP port |
+-----------------------+-------------------------------------------------+
| Pixels | Number of pixels in x and y dimension |
| | per UDP port |
+-----------------------+-------------------------------------------------+
| Max Frames Per File | Maximum frames per file |
+-----------------------+-------------------------------------------------+
| Frame Discard Policy | Receiever Frame discard policy |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Frame Padding | Receiver Frame padding enable |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Scan Parameters | Scanning mode on detector |
+-----------------------+-------------------------------------------------+
| Total Frames | Total number of frames and triggers expected |
+-----------------------+-------------------------------------------------+
| Receiver Roi | Receiver ROI in file including xmax and ymax |
+-----------------------+-------------------------------------------------+
| Exptime | Exposure time |
+-----------------------+-------------------------------------------------+
| Period | Period between frames |
+-----------------------+-------------------------------------------------+
| Number of UDP | Number of UDP Interfaces enabled per module |
| Interfaces | |
+-----------------------+-------------------------------------------------+
| Number of rows | Number of rows enabled for readout |
+-----------------------+-------------------------------------------------+
| Frames in File | Number of frames written to file by Receiver 0 |
+-----------------------+-------------------------------------------------+
| Frame Header Format | Expected frame header format for the data files |
+-----------------------+-------------------------------------------------+
Chip Test Board
^^^^^^^^^^^^^^^
+-----------------------+-------------------------------------------------+
| **Key** | **Description** |
+-----------------------+-------------------------------------------------+
| Version | Version of the master file |
| | Current value:8.0 |
+-----------------------+-------------------------------------------------+
| Timestamp | Timestamp of creation of master file |
+-----------------------+-------------------------------------------------+
| Detector Type | Detector type |
+-----------------------+-------------------------------------------------+
| Timing Mode | Timing Mode |
+-----------------------+-------------------------------------------------+
| Geometry | Number of UDP ports in x and y dimension for |
| | complete detector |
+-----------------------+-------------------------------------------------+
| Image Size in bytes | Image size in bytes per UDP port |
+-----------------------+-------------------------------------------------+
| Pixels | Number of pixels in x and y dimension |
| | per UDP port |
+-----------------------+-------------------------------------------------+
| Max Frames Per File | Maximum frames per file |
+-----------------------+-------------------------------------------------+
| Frame Discard Policy | Receiever Frame discard policy |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Frame Padding | Receiver Frame padding enable |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Scan Parameters | Scanning mode on detector |
+-----------------------+-------------------------------------------------+
| Total Frames | Total number of frames and triggers expected |
+-----------------------+-------------------------------------------------+
| Receiver Roi | Receiver ROI in file including xmax and ymax |
+-----------------------+-------------------------------------------------+
| Exptime | Exposure time |
+-----------------------+-------------------------------------------------+
| Period | Period between frames |
+-----------------------+-------------------------------------------------+
| Ten Giga | Ten giga enable |
+-----------------------+-------------------------------------------------+
| ADC Mask | Mask of channels enabled in ADC |
+-----------------------+-------------------------------------------------+
| Analog Flag | Analog readout enable |
+-----------------------+-------------------------------------------------+
| Analog Samples | Number of analog samples |
+-----------------------+-------------------------------------------------+
| Digital Flag | Digital readout enable |
+-----------------------+-------------------------------------------------+
| Digital Samples | Number of digital samples |
+-----------------------+-------------------------------------------------+
| Dbit Offset | Digital offset of valid data in bytes |
+-----------------------+-------------------------------------------------+
| Dbit Reorder | Reorder such that it groups each signal (0-63) |
| | from all the different samples together |
+-----------------------+-------------------------------------------------+
| Dbit Bitset | Digital 64 bit mask of bits enabled in receiver |
+-----------------------+-------------------------------------------------+
| Transceiver Mask | Mask of channels enabled in Transceiver |
+-----------------------+-------------------------------------------------+
| Transceiver Flag | Transceiver readout enable |
+-----------------------+-------------------------------------------------+
| Transceiver Samples | Number of transceiver samples |
+-----------------------+-------------------------------------------------+
| Frames in File | Number of frames written to file by Receiver 0 |
+-----------------------+-------------------------------------------------+
| Frame Header Format | Expected frame header format for the data files |
+-----------------------+-------------------------------------------------+

122
docs/src/pattern.rst Normal file
View File

@ -0,0 +1,122 @@
Pattern
========================
This is a test and development feature implemented only for Ctb, Xilinx_Ctb and Mythen3.
A pattern is a sequence of 64-bit words which is executed using a clock on the FPGA. Each of the 64 bits is connected to a pin or internal signal of the FPGA. The purpose of a pattern is to provide a way to change these 64 signals with precise timing. Commands run by the detector server could manipulate the same signals as the pattern, but they cannot enforce a change in a specific clock cycle.
**Usage**
A pattern is written to memory on the FPGA using the patword command.
.. code-block::
patword 0x0000 0x000000000000000A
patword 0x0001 0x000000000000000B
patword 0x0002 0x000000000000000C
patword 0x0003 0x000000000000000D
patword 0x0004 0x000000000000000E
The example above writes a five-word pattern into FPGA memory. The first argument is the memory address, the second argument is the content to be written into this address. Before executing a pattern one has to set the address limits of the pattern:
.. code-block::
patlimits 0x0000 0x0004
This instructs the firmware to execute the commands from address 0 to 4 (including 0 and 4). The execution can be started from the pyctbgui or with the commands
.. code-block::
start [Ctb, Xilinx_Ctb]
patternstart [Mythen3]
The maximal number of patword addresses is 8192. However, it is possible to extend the length of the pattern sequence using loops and wait commands. Loops can be configured with the following commands:
.. code-block::
patloop 0 0x0001 0x0003
patnloop 0 7
The first argument of both commands is the ID of the loop. Ctb and Xilinx_Ctb can have 6 loops (ID 0-5), Mythen3 can have 4 loop definitions. The commands above configure the loop with ID 0 to run 7 times and jump from the patword with address 3 to the patword with address 1. Important: If patnloop is set to 1, the addresses 0x1-0x3 will execute exactly once; if it is set to 0, the pattern addresses will be skipped.
The same idea is used to introduce wait times. The example below causes the patword at address 0x0002 to be active for 9 clock cycles before the execution continues.
.. code-block::
patwait 0 0x0002
patwaittime 0 9
Waits can be placed inside a loop and loops can be nested.
**patioctrl**
The function of each bit in the sequence of 64-bit words depends on the connected detector and firmware version. Some of the 64 bits might connect directly to pads of a chip. The patioctrl command is used to configure the direction of some of these signals (not all of them !! See tables below). Signals where the corresponding bit in the argument of patioctrl is set to 1 will be driven from the FPGA.
**patsetbit and patmask**
The functions patsetbit and patmask can be used to ignore a specific bit of the pattern.
Example:
.. code-block::
patmask 0x0101
patsetbit 0x0001
Patmask configures bit 0 and 8 of the pattern to be set to their value in patsetbit. These bits will be ignored during pattern execution and will always be 0 (bit 8) and 1 (bit 0).
The mappings of bit positions in the pattern word to signals/pads of the FPGA are listed below for the three detector types where patterns are used. In the case of the two CTB's, connections of the signals to actual pads of a chip depend on the layout of the used detector adapter board. Therefore, each type of detector adapter board adds an additional mapping layer.
**CTB Pattern Bit Mapping**
.. table::
+----+---+------+----+----------+-------------------+----------------+
| 63 | 62| 61-57| 56 | 55-48 | 47-32 | 31-0 |
+----+---+------+----+----------+-------------------+----------------+
| A | D| --- | T | EXTIO | DO, stream source | DIO |
+----+---+------+----+----------+-------------------+----------------+
DIO: Driving the 32 FPGA pins corresponding to the lowest 32 bits of the patioctrl command. If bits in patioctrl are 0, the same bit positions in DIO will switch to input pins and connect to dbit sampling. Additionally, some of these 32 bits have an automatic override by detector-specific statemachines which is active whenever one of these statemachines is running (currently bits 7,8,11,14 and 20).
DO: Directly connected to 16 FPGA pins. Output only. Not influenced by patioctrl. Also connected to bit 47-32 in all Ctb dbit samples. All of them can be used as dbit sample trigger. In addition, every bit of DO can be selected as trigger for sending out a udp packet with samples to the receiver.
EXTIO: Similar to DIO, but not used as input to the fpga. With the corresponding patioctrl bits set to 0 these pins will switch to a high impedance mode and be ignored by the firmware.
T: trigger output
D: enable signal for digital sampling
A: adc enable
**Xilinx_CTB Pattern Bit Mapping**
.. table::
+-------+----------------+
| 63-32 | 31-0 |
+-------+----------------+
| --- | DIO |
+-------+----------------+
DIO: Driving the 32 FPGA pins corresponding to the lowest 32 bits of the patioctrl command. If bits in patioctrl are 0, the same bit positions in DIO will switch to input pins and connect to dbit sampling. Additionally, some of these 32 bits have an automatic override by detector-specific statemachines which is active whenever these sm's are running (currently bits 7,8,11,14 and 20).
**Mythen3 Pattern Bit Mapping**
.. table::
+-------+--------+-------+--------+------------+----------+----------+-----+-----+
| 63-33 | 32 | 31-25 | 24 | 23 | 22 | 21 | 20 | 19 |
+-------+--------+-------+--------+------------+----------+----------+-----+-----+
| --- | signARD| --- | CHSclk | cnt_rst | sto_rst | STATLOAD | STO | SIN |
+-------+--------+-------+--------+------------+----------+----------+-----+-----+
.. table::
+---------+-----+-------+-------+----+-------+---------+--------+
| 18 | 17 | 16-14 | 13 | 12 | 11 | 10 | 9-0 |
+---------+-----+-------+-------+----+-------+---------+--------+
| SR_MODE | clk | EN | PULSE | RD | CHSIN | ANAMode | TBLOAD |
+---------+-----+-------+-------+----+-------+---------+--------+
For Mythen3 the pattern word only connects to output pins of the FPGA when the pattern is running. Afterwards the signals will switch back to other logic in the FPGA. Both CTB's hold the last executed pattern word until a new pattern is started.

View File

@ -0,0 +1,34 @@
PatternGenerator
=====================================================
Python class to generate patterns for the Chip Test Board.
.. code-block:: python
from slsdet import PatternGenerator
p = PatternGenerator()
p.SB(5)
p.PW()
p.SB(8,9)
p.PW()
p.CB(5)
Created a pattern like this:
.. code-block:: bash
patword 0x0000 0x0000000000000020
patword 0x0001 0x0000000000000320
patword 0x0002 0x0000000000000300
patioctrl 0x0000000000000000
patlimits 0x0000 0x0002
...
.. py:currentmodule:: slsdet
.. autoclass:: PatternGenerator
:members:
:undoc-members:
:show-inheritance:
:inherited-members:

View File

@ -6,7 +6,7 @@ Getting Started
Which Python?
--------------------
We require at least Python 3.6 and strongly recommended that you don't use the system
We require at least Python 3.8 and strongly recommended that you don't use the system
Python installation. The examples in this documentation uses `conda
<https://docs.conda.io/en/latest/miniconda.html>`_ since it provides good support
also for non Python packages but there are also other alternatives like, pyenv.

View File

@ -109,12 +109,14 @@ For Multiple Modules
# connects to mulitple modules
hostname bchipxxx+bchipyyy+
# connects to receivers at ports 2012 and 2014
rx_hostname mpc1922:2012+mpc1922:2013+
# tcp port increases for each module (multi detector command)
rx_tcpport 2012
# sets differernt destination udp ports
0:udp_dstport 50012
1:udp_dstport 50014
# connects to receivers at ports 2012 and 2014
rx_hostname mpc1922
# increasing udp ports (multi detector command)
udp_dstport 50012
# source udp ips must be same subnet at destintaion udp ips
0:udp_srcip 192.168.1.112
@ -126,6 +128,10 @@ For Multiple Modules
# set file path
fpath /tmp
.. note ::
The **hostname** and **detsize** command in a multi module system can affect the row and column values in the udp/zmq header. The modules are stacked row by row until they reach the y-axis limit set by detsize (if specified). Then, stacking continues in the next column and so on.
Gui
----

View File

@ -1,25 +1,25 @@
Receivers
Custom Receiver
=================
Receiver processes can be run on same or different machines as the client, receives the data from the detector (via UDP packets).
When using the slsReceiver/ slsMultiReceiver, they can be further configured by the client control software (via TCP/IP) to set file name, file path, progress of acquisition etc.
The receiver essentially listens to UDP data packets sent out by the detector.
To know more about detector receiver setup in the config file, please check out :ref:`the detector-receiver UDP configuration in the config file<detector udp header config>` and the :ref:`detector udp format<detector udp header>`.
To know more about detector receiver configuration, please check out :ref:`detector udp header and udp commands in the config file <detector udp header>`
| Please note the following when using a custom receiver:
Custom Receiver
----------------
* **udp_dstmac** must be configured in the config file. This parameter is not required when using an in-built receiver.
| When using custom receiver with our package, ensure that **udp_dstmac** is also configured in the config file. This parameter is not required when using slsReceiver.
* Cannot use "auto" for **udp_dstip**.
| Cannot use "auto" for **udp_dstip**.
* No **rx_** commands in the config file. These commands are for configuring the slsReceiver.
| Also ensure that there are no **rx_** commands in the config file. These commands are for configuring the slsReceiver.
The main difference is the lack of **rx_** commands or file commands (eg. **f**write, **f**path) and the **udp_dstmac** is required in config file.
Example of a custom receiver config file
* The main difference is the lack of **rx_** commands or file commands (eg. fwrite, fpath) and the udp_dstmac is required in config file.
.. code-block:: bash
# detector hostname

View File

@ -1,3 +1,5 @@
.. _Result Class:
Result
==============================================

View File

@ -89,18 +89,3 @@ DACS
:widths: 35, 35
:header-rows: 1
Gotthard
-------------
.. csv-table:: Default values
:file: gotthard.csv
:widths: 35, 35
:header-rows: 1
DACS
^^^^^^^^^^^^^
.. csv-table:: Gotthard DACS
:file: gotthard-dacs.csv
:widths: 35, 35
:header-rows: 1

View File

@ -27,25 +27,24 @@ Arguments
-p, --port <port> : TCP communication port with client.
-g, --nomodule : [Mythen3][Gotthard2]
Generic or No Module mode. Skips detector type checks.
-f, --phaseshift <value> : [Gotthard] only. Sets phase shift.
-d, --devel : Developer mode. Skips firmware checks.
-u, --update : Update mode. Skips firmware checks and initial detector setup.
-i, --ignore-config : [Eiger][Jungfrau][Gotthard][Gotthard2][Moench]
-i, --ignore-config : [Eiger][Jungfrau][Gotthard2][Moench]
Ignore config file.
-m, --master <master> : [Eiger][Mythen3][Gotthard][Gotthard2]
-m, --master <master> : [Eiger][Mythen3][Gotthard2]
Set Master to 0 or 1. Precedence over config file. Only for virtual servers except Eiger.
-t, --top <top> : [Eiger] Set Top to 0 or 1. Precedence over config file.
-s, --stopserver : Stop server. Do not use as it is created by control server
.. _Automatic start servers:
Automatic start
------------------
One can start the on-board detector server automatically upon powering on the board.
#. Create a soft link to the binary on board
:
#. Create a soft link to the binary on board:
.. code-block:: bash
ln -sf someDetectorServervx.x.x someDetectorServer
@ -65,7 +64,7 @@ One can start the on-board detector server automatically upon powering on the bo
/home/root/executables/eigerDetectorServer &> /dev/null &
exit 0
Jungfrau | Moench | CTB | Gotthard I
Jungfrau | Moench | CTB
.. code-block:: bash
# Edit inittab on board
@ -87,8 +86,7 @@ One can start the on-board detector server automatically upon powering on the bo
/root/xxxDetectorServer >> /dev/null &
#. Sync, reboot and verify
:
#. Sync, reboot and verify:
.. code-block:: bash
sync

View File

@ -1,4 +1,5 @@
.. _Detector Server Upgrade:
Upgrade
========

View File

@ -1,16 +1,55 @@
slsReceiver/ slsMultiReceiver
In-built Receiver
================================
| One has to start the slsReceiver before loading config file or using any receiver commands (prefix: **rx_** )
The receiver essentially listens to UDP data packets sent out by the detector. It's main features are:
- **Listening**: Receives UDP data from the detector.
- **Writing to File**: Optionally writes received data to disk.
- **Streaming via ZMQ**: Optionally streams out the data using ZeroMQ.
Each of these operations runs asynchronously and in parallel for each UDP port.
.. note ::
* Can be run on the same or different machine as the client.
* Can be configured by the client. (set file name/ discard policy, get progress etc.)
* Has to be started before the client runs any receiver specific command.
Receiver Variants
-----------------
There are three main receiver types. How to start them is described :ref:`below<Starting up the Receiver>`.
+----------------------+--------------------+-----------------------------------------+--------------------------------+
| Receiver Type | slsReceiver | slsMultiReceiver |slsFrameSynchronizer |
+======================+====================+=========================================+================================+
| Modules Supported | 1 | Multiple | Multiple |
+----------------------+--------------------+-----------------------------------------+--------------------------------+
| Internal Architecture| Threads per porttt | Multiple child processes of slsReceiver | Multi-threading of slsReceiver |
+----------------------+--------------------+-----------------------------------------+--------------------------------+
| ZMQ Streaming | Disabled by default| Disabled by default | Enabled, not optional |
+----------------------+--------------------+-----------------------------------------+--------------------------------+
| ZMQ Synchronization | No | No | Yes, across ports |
+----------------------+--------------------+-----------------------------------------+--------------------------------+
| Image Reconstruction | No | No | No |
+----------------------+--------------------+-----------------------------------------+--------------------------------+
.. _Starting up the Receiver:
Starting up the Receiver
-------------------------
For a Single Module
.. code-block:: bash
slsReceiver # default port 1954
# default port 1954
slsReceiver
# custom port 2012
slsReceiver -t2012
slsReceiver -t2012 # custom port 2012
For Multiple Modules
@ -18,52 +57,66 @@ For Multiple Modules
# each receiver (for each module) requires a unique tcp port (if all on same machine)
# using slsReceiver in multiple consoles
# option 1 (one for each module)
slsReceiver
slsReceiver -t1955
# slsMultiReceiver [starting port] [number of receivers]
# option 2
slsMultiReceiver 2012 2
# slsMultiReceiver [starting port] [number of receivers] [print each frame header for debugging]
slsMultiReceiver 2012 2 1
# option 3
slsFrameSynchronizer 2012 2
Client Commands
-----------------
| One can remove **udp_dstmac** from the config file, as the slsReceiver fetches this from the **udp_ip**.
* Client commands to the receiver begin with **rx_** or **f_** (file commands).
| One can use "auto" for **udp_dstip** if one wants to use default ip of **rx_hostname**.
* **rx_hostname** has to be the first command to the receiver so the client knows which receiver process to communicate with.
| The first command to the receiver (**rx_** commands) should be **rx_hostname**. The following are the different ways to establish contact.
* Can use 'auto' for **udp_dstip** if using 1GbE interface or the :ref:`virtual simulators<Virtual Detector Servers>`.
To know more about detector receiver setup in the config file, please check out :ref:`the detector-receiver UDP configuration in the config file<detector udp header config>` and the :ref:`detector udp format<detector udp header>`.
The following are the different ways to establish contact using **rx_hostname** command.
.. code-block:: bash
# default receiver tcp port (1954)
# ---single module---
# default receiver port at 1954
rx_hostname xxx
# custom receiver port
rx_hostname xxx:1957 # option 1
rx_tcpport 1957 # option 2
rx_hostname xxx
# custom receiver port
rx_hostname xxx:1957
# custom receiver port
rx_tcpport 1954
# ---multi module---
# using increasing tcp ports
rx_tcpport 1955
rx_hostname xxx
# multi modules with custom ports
rx_hostname xxx:1955+xxx:1956+
# custom ports
rx_hostname xxx:1955+xxx:1958+ # option 1
# multi modules with custom ports on same rxr pc
0:rx_tcpport 1954
0:rx_tcpport 1954 # option 2
1:rx_tcpport 1955
2:rx_tcpport 1956
rx_hostname xxx
# multi modules with custom ports on different rxr pc
# custom ports on different receiver machines
0:rx_tcpport 1954
0:rx_hostname xxx
1:rx_tcpport 1955
1:rx_hostname yyy
1:rx_hostname yyyrxr
| Example commands:
@ -86,255 +139,32 @@ Client Commands
sls_detector_get -h rx_framescaught
ZMQ: Json Header Format
------------------------
Example of a config file using in-built receiver
.. code-block:: bash
**Change in field names from slsDetectorPackage v6.x.x to v7.0.0**
# detector hostname
hostname bchip052+bchip053+
* detSpec1 <- bunchId
* detSpec2 <- reserved
* detSpec3 <- debug
* detSpec4 <- roundRNumber
# udp destination port (receiver)
# sets increasing destination udp ports starting at 50004
udp_dstport 50004
# udp destination ip (receiver)
0:udp_dstip 10.0.1.100
1:udp_dstip 10.0.2.100
**Format**
# udp source ip (same subnet as udp_dstip)
0:udp_srcip 10.0.1.184
1:udp_srcip 10.0.2.184
.. code-block:: bash
# udp destination mac - not required (picked up from udp_dstip)
#udp_dstmac 22:47:d5:48:ad:ef
{
"jsonversion": unsigned int,
"bitmode": unsigned int,
"fileIndex": unsigned long int,
"detshape": [
unsigned int,
unsigned int
],
"shape": [
unsigned int,
unsigned int
],
"size": unsigned int,
"acqIndex": unsigned long int,
"frameIndex": unsigned long int,
"progress": double,
"fname": string,
"data": unsigned int,
"completeImage": unsigned int,
# connects to receivers at increasing tcp port starting at 1954
rx_hostname mpc3434
# same as rx_hostname mpc3434:1954+mpc3434:1955+
"frameNumber": unsigned long long int,
"expLength": unsigned int,
"packetNumber": unsigned int,
"detSpec1": unsigned long int,
"timestamp": unsigned long int,
"modId": unsigned int,
"row": unsigned int,
"column": unsigned int,
"detSpec2": unsigned int,
"detSpec3": unsigned int,
"detSpec4": unsigned int,
"detType": unsigned int,
"version": unsigned int,
"flipRows": unsigned int,
"quad": unsigned int,
"addJsonHeader": {
string : string
},
"rx_roi": [
unsigned int,
unsigned int,
unsigned int,
unsigned int
]
}
+--------------+----------------------------------------------+
| Field | Description |
+--------------+----------------------------------------------+
| jsonversion | Version of the json header. |
| | Value at 4 for v6.x.x - v7.0.1 |
| | Value at 5 for v7.0.2 |
+--------------+----------------------------------------------+
| bitmode | Bits per pixel [4|8|16|32] |
+--------------+----------------------------------------------+
| fileIndex | Current file acquisition index |
+--------------+----------------------------------------------+
| detshape | Geometry of the entire detector |
+--------------+----------------------------------------------+
| shape | Geometry of the current port streamed out |
+--------------+----------------------------------------------+
| size | Size of image of current port in bytesout |
+--------------+----------------------------------------------+
| acqIndex | Frame number from the detector (redundant) |
+--------------+----------------------------------------------+
| frameIndex | Frame number of current acquisition |
| | (Starting at 0) |
+--------------+----------------------------------------------+
| progress | Progress of current acquisition in % |
+--------------+----------------------------------------------+
| fname | Current file name |
+--------------+----------------------------------------------+
| data | 1 if there is data following |
| | 0 if dummy header |
+--------------+----------------------------------------------+
| completeImage| 1 if no missing packets for this frame |
| | in this port, else 0 |
+--------------+----------------------------------------------+
| frameNumber | Frame number |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| expLength | subframe number (32 bit eiger) |
| | or real time exposure time in 100ns (others) |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| packetNumber | Number of packets caught for that frame |
+--------------+----------------------------------------------+
| detSpec1 | See :ref:`here<Detector Specific Fields>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| timestamp | Timestamp with 10 MHz clock |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| modId | Module Id |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| row | Row number in detector |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| column | Column number in detector |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| detSpec2 | See :ref:`here<Detector Specific Fields>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| detSpec3 | See :ref:`here<Detector Specific Fields>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| detSpec4 | See :ref:`here<Detector Specific Fields>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| detType | Detector type enum |
| detSpec3 | See :ref:`Detector enum<Detector Enum>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| version | Detector header version. At 2 |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| flipRows | 1 if rows should be flipped. |
| | Usually for Eiger bottom. |
+--------------+----------------------------------------------+
| quad | 1 if its an Eiger quad. |
+--------------+----------------------------------------------+
| addJsonHeader| Optional custom parameters that is required |
| | for processing code. |
+--------------+----------------------------------------------+
| rx_roi | ROI in the receiver per port (xmin, xmax, |
| | ymin, ymax). For external guis to know |
| | what is saved |
+--------------+----------------------------------------------+
SLS Receiver Header Format
--------------------------
It is 112 bytes and consists of:
* 48 bytes of the SLS Detector Header (described in :ref:`the current detector header <detector udp header>`)
* 64 bytes of packet mask
.. code-block:: cpp
typedef struct {
uint64_t frameNumber;
uint32_t expLength;
uint32_t packetNumber;
uint64_t detSpec1;
uint64_t timestamp;
uint16_t modId;
uint16_t row;
uint16_t column;
uint16_t detSpec2;
uint32_t detSpec3;
uint16_t detSpec4;
uint8_t detType;
uint8_t version;
} sls_detector_header;
struct sls_receiver_header {
sls_detector_header detHeader; /**< is the detector header */
sls_bitset packetsMask; /**< is the packets caught bit mask */
};
.. note ::
| The packetNumber in the SLS Receiver Header will be modified to number of packets caught by receiver for that frame. For eg. Jungfrau will have 128 packets per frame. If it is less, then this is a partial frame due to missing packets.
| Furthermore, the bit mask will specify which packets have been received.
File format
--------------
Master file is in json format.
The file name format is [fpath]/[fname]_dx_fy_[findex].raw, where x is module index and y is file index. **fname** is file name prefix and by default "run". **fpath** is '/' by default.
Each acquisition will have an increasing acquisition index or findex (if file write enabled). This can be retrieved by using **findex** command.
Each acquisition can have multiple files (the file index number **y**), with **rx_framesperfile** being the maximum number of frames per file. The default varies for each detector type.
Some file name examples:
.. code-block:: bash
# first file
path-to-file/run_d0_f0_0.raw
# second file after reaching max frames in first file
path-to-file/run_d0_f1_0.raw
# second acquisition, first file
path-to-file/run_d0_f0_1.raw
Each acquisition will create a master file that can be enabled/disabled using **fmaster**. This should have parameters relevant to the acquisition.
**Binary file format**
This is the default file format.
Each data file will consist of frames, each consisting of slsReceiver Header followed by data for 1 frame.
Master file is of ASCII format and will also include the format of the slsReceiver Header.
**HDF5 file formats**
#. Compile the package with HDF5 option enabled
#. Using cmk script: ./cmk.sh -hj9 -d [path of hdf5 dir]
#. Enable using cmake **-DCMAKE_INSTALL_PREFIX=/path/to/hdf/installation** and **-DSLS_USE_HDF5=ON**
#. Start Receiver process
#. Load config file
#. Set file format from client or in config file
.. code-block:: bash
sls_detector_put fformat hdf5
| For multiple, modules, a virtual file linking all the modules is created. Both the data files and virtual files are linked in the master file.
Performance

View File

@ -0,0 +1,40 @@
.. _sls receiver header format:
SLS Receiver Header Format
====================================================
It is 112 bytes and consists of:
* 48 bytes of the SLS Detector Header
* 64 bytes of packet mask
.. code-block:: cpp
typedef struct {
uint64_t frameNumber;
uint32_t expLength;
uint32_t packetNumber;
uint64_t detSpec1;
uint64_t timestamp;
uint16_t modId;
uint16_t row;
uint16_t column;
uint16_t detSpec2;
uint32_t detSpec3;
uint16_t detSpec4;
uint8_t detType;
uint8_t version;
} sls_detector_header;
struct sls_receiver_header {
sls_detector_header detHeader; /**< is the detector header */
sls_bitset packetsMask; /**< is the packets caught bit mask */
};
| **sls_detector_header** (described in :ref:`the current detector header <detector udp header>`)
| The **packetNumber** from detector UDP header is modified in **sls_receiver_header** to number of packets caught by receiver for that frame and the bit mask for each packet caught is the **packetsMask**. The packetsMask is a total of 512 bits due to the largest number of packets per frame among our detectors.
| For eg. Jungfrau has 128 packets per frame. If **packetNumeber** is 128, then this frame is complete. If it is 127 or less, it is a partial frame due to missing packets. If one would still like to use it, the **packetsMask** will specify which packet has been received or is missing.

View File

@ -22,6 +22,8 @@ Common
* Check transeiver and fibers are compatible (all MMF 850nm or all SMF 1030nm)
* Check fiber
* Check fiber polarity (if short range, unplug the link anywhere, and look at the light/dark pattern: dark has to mate with light)
* For Jungfrau, check if the blue sfp light is blinking rapidly (even when it is not sending data). If so, most likely the link is down and something is wrong with the board. If it connected to a switch, then you do not see it with the ethtool command if link is down. One option is to connect it directly to a pc to see if link is down.
* With nc, try "nc -u -p 50001 -l" in receiving pc, and from another pc try "echo hallo | nc -u 10.1.2.172 50001" to send something to the recieving pc interface to see if the link is up and see if the other nc console receives the hallo.
#. Detector is not acquiring (Not Eiger)
* Take an acquisition with many images and using the following steps instead of acquire:
@ -47,11 +49,20 @@ Common
* Ensure that the interfaces (on NIC and the switch) used in receiver pc have MTU 9000 (jumbo frames) enabled.
#. Check if 'rx_frames' counter in 'ifconfig' do not increment for interface.
#. Check if 'rx packets' counter in 'ifconfig' do not increment for interface.
* If no, check switch configuration if present. Port counters of switch can also help to identify problem.
* If yes, but receiver software does not see it:
* Check no firewall (eg. firewalld) is present or add rules
.. code-block:: bash
# Stop and disable firewall
service firewalld stop
systemctl disable firewalld
# Check status
service firewalld status
* Check that selinux is disabled ( or add rules)
#. Source UDP IP in config file (Not Eiger)
@ -92,6 +103,9 @@ Common
sls_detector_put rx_arping 1
#. Only the slaves get no data
* Check trigger cabling and trigger configuration
* When you cannot stop Jungfrau slaves in sync mode, refer to :ref:`Cannot stop slaves<Jungfrau Troubleshooting Sync Slaves Cannot Stop>`.
.. _Receiver PC Tuning:
@ -371,13 +385,13 @@ Cannot get data without a module attached
You cannot get data without a module attached as a specific pin is floating. Attach module to get data.
Gotthard
----------
Mythen3
--------
Missing first frame or next frame after a delay
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Connect the data link from the Module directly to receiver pc or to a private network.
Detector status is waiting even in auto timing mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check if the control board or the flat band cable is connected properly. If not, connect them properly and try again.
Jungfrau
@ -421,3 +435,20 @@ Cannot get multi module data
* Comment out this line in the config file: powerchip 1
* Powering on the chip increases the power consumption by a considerable amount. If commenting out this line aids in getting data (strange data due to powered off chip), then it could be the power supply current limit. Fix it (possibly to 8A current limit) and uncomment the powerchip line back in config file.
.. _Jungfrau Troubleshooting Sync Slaves Cannot Stop:
Cannot stop slaves in sync mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#. If cabling is accessible, ensure termination board and flatband cable between the masters and the slaves are connnected properly. Then try to stop.
#. If cabling is inaccessible, unsync first so that the slaves can get the stop directly from the client using the command. Then, don't use sync mode until the cabling is fixed.
.. code-block:: bash
# unsync, slaves command will fail as it is still in waiting state
sls_detector_put sync 0
# stop should now be successful as master does not determine the stop anymore
sls_detector_put stop

View File

@ -1,4 +1,4 @@
.. _detector udp header:
.. _detector udp header config:
Config file

View File

@ -3,7 +3,7 @@
Format
=======
The UDP data format for the packets consist of a common header for all detectors, followed by the data for that one packet.
The UDP data format for the packets consist of a common header of 48 bytes for all detectors, followed by the data for that one packet.
Current Version
@ -11,6 +11,25 @@ Current Version
**v2.0 (slsDetectorPackage v7.0.0+)**
.. code-block:: cpp
typedef struct {
uint64_t frameNumber;
uint32_t expLength;
uint32_t packetNumber;
uint64_t detSpec1;
uint64_t timestamp;
uint16_t modId;
uint16_t row;
uint16_t column;
uint16_t detSpec2;
uint32_t detSpec3;
uint16_t detSpec4;
uint8_t detType;
uint8_t version;
} sls_detector_header;
.. table:: <---------------------------------------------------- 8 bytes per row --------------------------------------------->
:align: center
:widths: 30,30,30,15,15
@ -54,15 +73,17 @@ Description
* **modId**: module ID picked up from det_id_[detector type].txt on the detector cpu.
* **row**: row position of the module in the detector system. It is calculated by the order of the module in hostname command, as well as the detsize command.
* **row**: row position of the module in the detector system. It is calculated by the order of the module in hostname command, as well as the detsize command. The modules are stacked row by row until they reach the y-axis limit set by detsize (if specified). Then, stacking continues in the next column and so on.
* **column**: column position of the module in the detector system. It is calculated by the order of the module in hostname command, as well as the detsize command.
* **column**: column position of the module in the detector system. It is calculated by the order of the module in hostname command, as well as the detsize command. The modules are stacked row by row until they reach the y-axis limit set by detsize (if specified). Then, stacking continues in the next column and so on.
* **detType**: detector type from enum of detectorType in the package.
* **version**: current version of the detector header (0x2).
.. _detector enum:
Detector Enum
--------------
@ -71,14 +92,14 @@ Detector Enum
================ ========
GENERIC 0
EIGER 1
GOTTHARD 2
GOTTHARD* 2
JUNGFRAU 3
CHIPTESTBOARD 4
MOENCH 5
MYTHEN3 6
GOTTHARD2 7
================ ========
* deprecated since v10.0.0
Previous Versions

View File

@ -1,4 +1,5 @@
.. _Virtual Detector Servers:
Simulators
===========
@ -22,7 +23,6 @@ Binaries
eigerDetectorServer_virtual
jungfrauDetectorServer_virtual
gotthardDetectorServer_virtual
gotthard2DetectorServer_virtual
mythen3DetectorServer_virtual
moenchDetectorServer_virtual
@ -86,7 +86,8 @@ For a Single Module (With Options)
udp_dstport 50012
# source udp ips must be same subnet at destintaion udp ips
udp_srcip 192.168.1.112
# takes the same ip as hostname
udp_srcip auto
# destination udp ip picked up from rx_hostname (if auto)
udp_dstip auto
@ -101,12 +102,14 @@ For Multiple Modules
virtual 2 1912
# or hostname localhost:1912+localhost:1914+
# connects to receivers at ports 2012 and 2014
rx_hostname mpc1922:2012+mpc1922:2013+
# increasing receiver tcp ports (multi detector command)
rx_tcpport 2012
# sets differernt destination udp ports
0:udp_dstport 50012
1:udp_dstport 50014
# connects to reciever at port 2012 and 2013
rx_hostname mpc1922
# sets increasing destination udp ports
udp_dstport 50012
# source udp ips must be same subnet at destintaion udp ips
0:udp_srcip 192.168.1.112

View File

@ -0,0 +1,137 @@
ZMQ: Json Header Format
========================
**Change in field names from slsDetectorPackage v6.x.x to v7.0.0**
* detSpec1 <- bunchId
* detSpec2 <- reserved
* detSpec3 <- debug
* detSpec4 <- roundRNumber
**Format**
.. code-block:: bash
{
"jsonversion": unsigned int,
"bitmode": unsigned int,
"fileIndex": unsigned long int,
"detshape": [
unsigned int,
unsigned int
],
"shape": [
unsigned int,
unsigned int
],
"size": unsigned int,
"acqIndex": unsigned long int,
"frameIndex": unsigned long int,
"progress": double,
"fname": string,
"data": unsigned int,
"completeImage": unsigned int,
"frameNumber": unsigned long long int,
"expLength": unsigned int,
"packetNumber": unsigned int,
"detSpec1": unsigned long int,
"timestamp": unsigned long int,
"modId": unsigned int,
"row": unsigned int,
"column": unsigned int,
"detSpec2": unsigned int,
"detSpec3": unsigned int,
"detSpec4": unsigned int,
"detType": unsigned int,
"version": unsigned int,
"flipRows": unsigned int,
"quad": unsigned int,
"addJsonHeader": {
string : string
}
}
+--------------+----------------------------------------------+
| Field | Description |
+--------------+----------------------------------------------+
| jsonversion | Version of the json header. |
| | Value at 4 for v6.x.x and v7.x.x |
+--------------+----------------------------------------------+
| bitmode | Bits per pixel [4|8|16|32] |
+--------------+----------------------------------------------+
| fileIndex | Current file acquisition index |
+--------------+----------------------------------------------+
| detshape | Geometry of the entire detector |
+--------------+----------------------------------------------+
| shape | Geometry of the current port streamed out |
+--------------+----------------------------------------------+
| size | Size of image of current port in bytesout |
+--------------+----------------------------------------------+
| acqIndex | Frame number from the detector (redundant) |
+--------------+----------------------------------------------+
| frameIndex | Frame number of current acquisition |
| | (Starting at 0) |
+--------------+----------------------------------------------+
| progress | Progress of current acquisition in % |
+--------------+----------------------------------------------+
| fname | Current file name |
+--------------+----------------------------------------------+
| data | 1 if there is data following |
| | 0 if dummy header |
+--------------+----------------------------------------------+
| completeImage| 1 if no missing packets for this frame |
| | in this port, else 0 |
+--------------+----------------------------------------------+
| frameNumber | Frame number |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| expLength | subframe number (32 bit eiger) |
| | or real time exposure time in 100ns (others) |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| packetNumber | Number of packets caught for that frame |
+--------------+----------------------------------------------+
| detSpec1 | See :ref:`here<Detector Specific Fields>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| timestamp | Timestamp with 10 MHz clock |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| modId | Module Id |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| row | Row number in detector |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| column | Column number in detector |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| detSpec2 | See :ref:`here<Detector Specific Fields>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| detSpec3 | See :ref:`here<Detector Specific Fields>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| detSpec4 | See :ref:`here<Detector Specific Fields>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| detType | Detector type enum |
| detSpec3 | See :ref:`Detector enum<detector enum>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| version | Detector header version. At 2 |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| flipRows | 1 if rows should be flipped. |
| | Usually for Eiger bottom. |
+--------------+----------------------------------------------+
| quad | 1 if its an Eiger quad. |
+--------------+----------------------------------------------+
| addJsonHeader| Optional custom parameters that is required |
| | for processing code. |
+--------------+----------------------------------------------+

View File

@ -4,27 +4,33 @@ detsize 1024 512
# detector hostname for controls
hostname beb059+beb058+
# 1Gb receiver pc hostname with tcp port to configure receiver
rx_hostname x12sa-vcons:1991+x12sa-vcons:1992
# increasing receiver tcp port (multi detector command)
rx_tcpport 1991
# 1Gb receiver pc hostname to configure receiver
rx_hostname x12sa-vcons
# or 1Gb receiver pc hostname with tcp port to configure receiver
#rx_hostname x12sa-vcons:1991+x12sa-vcons:1992
# increasing udp destination ports for all half modules
udp_dstport 50011
# udp port first quadrant, first halfmodule
0:udp_dstport 50011
#0:udp_dstport 50011
# udp port second quadrant, first halfmodule
0:udp_dstport2 50012
#0:udp_dstport2 50012
# udp port first quadrant, second halfmodule
#1:udp_dstport 50013
# udp port second quadrant, second halfmodule
#1:udp_dstport2 50014
# udp IP of the receiver over 10Gb
0:udp_dstip 10.0.30.210
# first half module 10 Gb IP (same subnet as 0:udp_dstip)
0:udp_srcip 10.0.30.100
# udp port first quadrant, second halfmodule
1:udp_dstport 50013
# udp port second quadrant, second halfmodule
1:udp_dstport2 50014
# udp IP of the receiver over 10Gb,
1:udp_dstip 10.0.40.210

View File

@ -4,18 +4,23 @@ detsize 1024 512
# detector hostname for controls
hostname beb059+beb058+
# 1Gb receiver pc hostname with tcp port to configure receiver
rx_hostname x12sa-vcons:1991+x12sa-vcons:1992
# increasing receiver tcp port (multi detector command)
rx_tcpport 1991
# 1Gb receiver pc hostname to configure receiver
rx_hostname x12sa-vcons
# increasing udp destination ports for all half modules
udp_dstport 50011
# udp port first quadrant, first halfmodule
0:udp_dstport 50011
#0:udp_dstport 50011
#udp port second quadrant, first halfmodule
0:udp_dstport2 50012
#0:udp_dstport2 50012
# udp port first quadrant, second halfmodule
1:udp_dstport 50013
#1:udp_dstport 50013
# udp port second quadrant, second halfmodule
1:udp_dstport2 50014
#1:udp_dstport2 50014
# output directory
fpath /sls/X12SA/data/x12saop/Data10/Eiger0.5M

View File

@ -1,12 +0,0 @@
# detector hostname
hostname bchip007
# receiver pc hostname of 1Gb IP of the machine
rx_hostname my_receiver_hostname
# output directory
fpath /bigRAID/datadir_gotthard/rec_test_data
# high voltage
highvoltage 120

View File

@ -4,14 +4,18 @@ detsize 1024 1024
# detector hostname
hostname bchip048+bchip052+
# 1Gb receiver pc hostname (default tcpport: 1954)
rx_hostname pcmoench01:1954+pcmoench01:1955+
# increasing receiver ports 1954 and 1955 (multi detector command)
rx_tcpport 1954
# 1Gb receiver pc hostname
rx_hostname pcmoench01
# increasing udp ports 50004 and 50005 (multi detector command)
udp_dstport 50004
# or custom udp destination port (receiver) for 1st module
#0:udp_dstport 50014
# udp configurations for 1st module
# udp destination port (receiver)
0:udp_dstport 50004
# udp destination ip (receiver)
0:udp_dstip 10.1.1.100
@ -19,17 +23,11 @@ rx_hostname pcmoench01:1954+pcmoench01:1955+
# udp source ip (same subnet as 0:udp_dstip)
0:udp_srcip 10.1.1.10
# udp configurations for 2nd module
# udp destination port (receiver)
1:udp_dstport 50005
# udp destination ip (receiver)
1:udp_dstip 10.1.1.100
1:udp_dstip 10.1.2.100
# udp source ip (same subnet as 1:udp_dstip)
1:udp_srcip 10.1.1.11
1:udp_srcip 10.1.2.11
@ -45,5 +43,5 @@ timing trigger
# output file directory
fpath /external_pool/jungfrau_data/softwaretest
# disable file writing
# disable file writing (default)
fwrite 0

View File

@ -3,34 +3,33 @@
### edit with hostname or IP address of your detector
############################################
#hostname bchip181+
hostname bchip076
hostname bchip135
#############################################
### edit with hostname or 1Gbs IP address of your server
############################################
rx_hostname mpc2011:7777
rx_hostname mpc2011
#############################################
### edit with 10 Gbs IP of your server
############################################
udp_dstip 10.1.2.102
udp_dstip 10.1.1.102
#############################################
### edit with any number in the subnet of your server (first 3 numbers as above)
############################################
udp_srcip 10.1.2.19
udp_dstport 32777
udp_srcip 10.1.1.19
udp_dstport 32411
#############################################
### edit with 10 Gbs IP of your server
############################################
rx_zmqip 10.1.2.102
rx_zmqport 9003
rx_zmqip 10.1.1.102
rx_zmqport 50003
#############################################
### edit with 1 Gbs IP of PC where you will run the GUI
############################################
zmqip 129.129.202.57
zmqport 9005
zmqport 50001
@ -39,7 +38,7 @@ rx_zmqstream 1
frames 1
frames 100000
period 0.0006
exptime 0.00035
@ -50,7 +49,7 @@ fpath /mnt/moench_data/scratch1/
fwrite 0
rx_jsonpara frameMode newPedestal
rx_jsonpara frameMode frame
rx_jsonpara detectorMode counting
rx_discardpolicy discardpartial

22
examples/rawdata.config Normal file
View 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

View File

@ -2,10 +2,8 @@
hostname localhost:1900+localhost:1902+
# udp destination ports
0:udp_dstport 50000
0:udp_dstport2 50001
1:udp_dstport 50002
1:udp_dstport2 50003
udp_dstport 50000
udp_dstport2 50001
# receiver hostname
rx_hostname mpc1922:2000+mpc1922:2001+

View File

@ -5,24 +5,26 @@ detsize 2048 1024
virtual 4 1952
# udp destination ports
0:udp_dstport2 50001
0:udp_dstport2 50002
1:udp_dstport 50003
1:udp_dstport2 50004
2:udp_dstport 50005
2:udp_dstport2 50006
3:udp_dstport 50007
3:udp_dstport2 50008
udp_dstport 50001
#0:udp_dstport2 50001
#0:udp_dstport2 50002
#1:udp_dstport 50003
#1:udp_dstport2 50004
#2:udp_dstport 50005
#2:udp_dstport2 50006
#3:udp_dstport 50007
#3:udp_dstport2 50008
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
udp_srcip2 192.168.1.100
# receiver hostname and tcpports
0:rx_tcpport 1970
1:rx_tcpport 1971
2:rx_tcpport 1972
3:rx_tcpport 1973
rx_tcpport 1970
#0:rx_tcpport 1970
#1:rx_tcpport 1971
#2:rx_tcpport 1972
#3:rx_tcpport 1973
rx_hostname mpc1922
# udp destination ip from rx_hostname

16
examples/zmq.config Normal file
View 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

Binary file not shown.

View File

@ -0,0 +1,18 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd3d8eb9..c0187747 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,11 +1,8 @@
# CMake build script for ZeroMQ
project(ZeroMQ)
-if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
- cmake_minimum_required(VERSION 3.0.2)
-else()
- cmake_minimum_required(VERSION 2.8.12)
-endif()
+cmake_minimum_required(VERSION 3.15)
+message(STATUS "Patched cmake version")
include(CheckIncludeFiles)
include(CheckCCompilerFlag)

View File

@ -1,299 +0,0 @@
# CMakeLists.txt -- Build system for the pybind11 modules
#
# Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch>
#
# All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
cmake_minimum_required(VERSION 3.4)
# The `cmake_minimum_required(VERSION 3.4...3.22)` syntax does not work with
# some versions of VS that have a patched CMake 3.11. This forces us to emulate
# the behavior using the following workaround:
if(${CMAKE_VERSION} VERSION_LESS 3.22)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
else()
cmake_policy(VERSION 3.22)
endif()
# Avoid infinite recursion if tests include this as a subdirectory
if(DEFINED PYBIND11_MASTER_PROJECT)
return()
endif()
# Extract project version from source
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/include/pybind11/detail/common.h"
pybind11_version_defines REGEX "#define PYBIND11_VERSION_(MAJOR|MINOR|PATCH) ")
foreach(ver ${pybind11_version_defines})
if(ver MATCHES [[#define PYBIND11_VERSION_(MAJOR|MINOR|PATCH) +([^ ]+)$]])
set(PYBIND11_VERSION_${CMAKE_MATCH_1} "${CMAKE_MATCH_2}")
endif()
endforeach()
if(PYBIND11_VERSION_PATCH MATCHES [[\.([a-zA-Z0-9]+)$]])
set(pybind11_VERSION_TYPE "${CMAKE_MATCH_1}")
endif()
string(REGEX MATCH "^[0-9]+" PYBIND11_VERSION_PATCH "${PYBIND11_VERSION_PATCH}")
project(
pybind11
LANGUAGES CXX
VERSION "${PYBIND11_VERSION_MAJOR}.${PYBIND11_VERSION_MINOR}.${PYBIND11_VERSION_PATCH}")
# Standard includes
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(CMakeDependentOption)
if(NOT pybind11_FIND_QUIETLY)
message(STATUS "pybind11 v${pybind11_VERSION} ${pybind11_VERSION_TYPE}")
endif()
# Check if pybind11 is being used directly or via add_subdirectory
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
### Warn if not an out-of-source builds
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
set(lines
"You are building in-place. If that is not what you intended to "
"do, you can clean the source directory with:\n"
"rm -r CMakeCache.txt CMakeFiles/ cmake_uninstall.cmake pybind11Config.cmake "
"pybind11ConfigVersion.cmake tests/CMakeFiles/\n")
message(AUTHOR_WARNING ${lines})
endif()
set(PYBIND11_MASTER_PROJECT ON)
if(OSX AND CMAKE_VERSION VERSION_LESS 3.7)
# Bug in macOS CMake < 3.7 is unable to download catch
message(WARNING "CMAKE 3.7+ needed on macOS to download catch, and newer HIGHLY recommended")
elseif(WINDOWS AND CMAKE_VERSION VERSION_LESS 3.8)
# Only tested with 3.8+ in CI.
message(WARNING "CMAKE 3.8+ tested on Windows, previous versions untested")
endif()
message(STATUS "CMake ${CMAKE_VERSION}")
if(CMAKE_CXX_STANDARD)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
set(pybind11_system "")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
else()
set(PYBIND11_MASTER_PROJECT OFF)
set(pybind11_system SYSTEM)
endif()
# Options
option(PYBIND11_INSTALL "Install pybind11 header files?" ${PYBIND11_MASTER_PROJECT})
option(PYBIND11_TEST "Build pybind11 test suite?" ${PYBIND11_MASTER_PROJECT})
option(PYBIND11_NOPYTHON "Disable search for Python" OFF)
set(PYBIND11_INTERNALS_VERSION
""
CACHE STRING "Override the ABI version, may be used to enable the unstable ABI.")
cmake_dependent_option(
USE_PYTHON_INCLUDE_DIR
"Install pybind11 headers in Python include directory instead of default installation prefix"
OFF "PYBIND11_INSTALL" OFF)
cmake_dependent_option(PYBIND11_FINDPYTHON "Force new FindPython" OFF
"NOT CMAKE_VERSION VERSION_LESS 3.12" OFF)
# NB: when adding a header don't forget to also add it to setup.py
set(PYBIND11_HEADERS
include/pybind11/detail/class.h
include/pybind11/detail/common.h
include/pybind11/detail/descr.h
include/pybind11/detail/init.h
include/pybind11/detail/internals.h
include/pybind11/detail/type_caster_base.h
include/pybind11/detail/typeid.h
include/pybind11/attr.h
include/pybind11/buffer_info.h
include/pybind11/cast.h
include/pybind11/chrono.h
include/pybind11/common.h
include/pybind11/complex.h
include/pybind11/options.h
include/pybind11/eigen.h
include/pybind11/embed.h
include/pybind11/eval.h
include/pybind11/gil.h
include/pybind11/iostream.h
include/pybind11/functional.h
include/pybind11/numpy.h
include/pybind11/operators.h
include/pybind11/pybind11.h
include/pybind11/pytypes.h
include/pybind11/stl.h
include/pybind11/stl_bind.h
include/pybind11/stl/filesystem.h)
# Compare with grep and warn if mismatched
if(PYBIND11_MASTER_PROJECT AND NOT CMAKE_VERSION VERSION_LESS 3.12)
file(
GLOB_RECURSE _pybind11_header_check
LIST_DIRECTORIES false
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
CONFIGURE_DEPENDS "include/pybind11/*.h")
set(_pybind11_here_only ${PYBIND11_HEADERS})
set(_pybind11_disk_only ${_pybind11_header_check})
list(REMOVE_ITEM _pybind11_here_only ${_pybind11_header_check})
list(REMOVE_ITEM _pybind11_disk_only ${PYBIND11_HEADERS})
if(_pybind11_here_only)
message(AUTHOR_WARNING "PYBIND11_HEADERS has extra files:" ${_pybind11_here_only})
endif()
if(_pybind11_disk_only)
message(AUTHOR_WARNING "PYBIND11_HEADERS is missing files:" ${_pybind11_disk_only})
endif()
endif()
# CMake 3.12 added list(TRANSFORM <list> PREPEND
# But we can't use it yet
string(REPLACE "include/" "${CMAKE_CURRENT_SOURCE_DIR}/include/" PYBIND11_HEADERS
"${PYBIND11_HEADERS}")
# Cache variable so this can be used in parent projects
set(pybind11_INCLUDE_DIR
"${CMAKE_CURRENT_LIST_DIR}/include"
CACHE INTERNAL "Directory where pybind11 headers are located")
# Backward compatible variable for add_subdirectory mode
if(NOT PYBIND11_MASTER_PROJECT)
set(PYBIND11_INCLUDE_DIR
"${pybind11_INCLUDE_DIR}"
CACHE INTERNAL "")
endif()
# Note: when creating targets, you cannot use if statements at configure time -
# you need generator expressions, because those will be placed in the target file.
# You can also place ifs *in* the Config.in, but not here.
# This section builds targets, but does *not* touch Python
# Non-IMPORT targets cannot be defined twice
if(NOT TARGET pybind11_headers)
# Build the headers-only target (no Python included):
# (long name used here to keep this from clashing in subdirectory mode)
add_library(pybind11_headers INTERFACE)
add_library(pybind11::pybind11_headers ALIAS pybind11_headers) # to match exported target
add_library(pybind11::headers ALIAS pybind11_headers) # easier to use/remember
target_include_directories(
pybind11_headers ${pybind11_system} INTERFACE $<BUILD_INTERFACE:${pybind11_INCLUDE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_compile_features(pybind11_headers INTERFACE cxx_inheriting_constructors cxx_user_literals
cxx_right_angle_brackets)
if(NOT "${PYBIND11_INTERNALS_VERSION}" STREQUAL "")
target_compile_definitions(
pybind11_headers INTERFACE "PYBIND11_INTERNALS_VERSION=${PYBIND11_INTERNALS_VERSION}")
endif()
else()
# It is invalid to install a target twice, too.
set(PYBIND11_INSTALL OFF)
endif()
include("${CMAKE_CURRENT_SOURCE_DIR}/tools/pybind11Common.cmake")
# Relative directory setting
if(USE_PYTHON_INCLUDE_DIR AND DEFINED Python_INCLUDE_DIRS)
file(RELATIVE_PATH CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX} ${Python_INCLUDE_DIRS})
elseif(USE_PYTHON_INCLUDE_DIR AND DEFINED PYTHON_INCLUDE_DIR)
file(RELATIVE_PATH CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX} ${PYTHON_INCLUDE_DIRS})
endif()
if(PYBIND11_INSTALL)
install(DIRECTORY ${pybind11_INCLUDE_DIR}/pybind11 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
set(PYBIND11_CMAKECONFIG_INSTALL_DIR
"${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME}"
CACHE STRING "install path for pybind11Config.cmake")
if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
set(pybind11_INCLUDEDIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
else()
set(pybind11_INCLUDEDIR "\$\{PACKAGE_PREFIX_DIR\}/${CMAKE_INSTALL_INCLUDEDIR}")
endif()
configure_package_config_file(
tools/${PROJECT_NAME}Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${PYBIND11_CMAKECONFIG_INSTALL_DIR})
if(CMAKE_VERSION VERSION_LESS 3.14)
# Remove CMAKE_SIZEOF_VOID_P from ConfigVersion.cmake since the library does
# not depend on architecture specific settings or libraries.
set(_PYBIND11_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
unset(CMAKE_SIZEOF_VOID_P)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion)
set(CMAKE_SIZEOF_VOID_P ${_PYBIND11_CMAKE_SIZEOF_VOID_P})
else()
# CMake 3.14+ natively supports header-only libraries
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion ARCH_INDEPENDENT)
endif()
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
tools/FindPythonLibsNew.cmake
tools/pybind11Common.cmake
tools/pybind11Tools.cmake
tools/pybind11NewTools.cmake
DESTINATION ${PYBIND11_CMAKECONFIG_INSTALL_DIR})
if(NOT PYBIND11_EXPORT_NAME)
set(PYBIND11_EXPORT_NAME "${PROJECT_NAME}Targets")
endif()
install(TARGETS pybind11_headers EXPORT "${PYBIND11_EXPORT_NAME}")
install(
EXPORT "${PYBIND11_EXPORT_NAME}"
NAMESPACE "pybind11::"
DESTINATION ${PYBIND11_CMAKECONFIG_INSTALL_DIR})
# Uninstall target
if(PYBIND11_MASTER_PROJECT)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()
endif()
# BUILD_TESTING takes priority, but only if this is the master project
if(PYBIND11_MASTER_PROJECT AND DEFINED BUILD_TESTING)
if(BUILD_TESTING)
if(_pybind11_nopython)
message(FATAL_ERROR "Cannot activate tests in NOPYTHON mode")
else()
add_subdirectory(tests)
endif()
endif()
else()
if(PYBIND11_TEST)
if(_pybind11_nopython)
message(FATAL_ERROR "Cannot activate tests in NOPYTHON mode")
else()
add_subdirectory(tests)
endif()
endif()
endif()
# Better symmetry with find_package(pybind11 CONFIG) mode.
if(NOT PYBIND11_MASTER_PROJECT)
set(pybind11_FOUND
TRUE
CACHE INTERNAL "True if pybind11 and all required components found on the system")
endif()

View File

@ -1,29 +0,0 @@
Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>, All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Please also refer to the file .github/CONTRIBUTING.md, which clarifies licensing of
external contributions to this project including patches, pull requests, etc.

Some files were not shown because too many files have changed in this diff Show More