Compare commits

...

748 Commits

Author SHA1 Message Date
27b2a607c8 binaries in 2020-08-10 12:05:37 +02:00
8e2bd17704 updated client script 2020-08-10 12:04:31 +02:00
0e011a77b5 array init fix for old gcc 2020-08-10 10:35:26 +02:00
d56b2134ef updated client versions 2020-08-10 09:58:57 +02:00
8af1183220 house keeping 2020-08-06 16:50:29 +02:00
78fdf5b60a removed casts 2020-08-06 12:33:43 +02:00
132043a70d static_assert enum size 2020-08-06 11:50:35 +02:00
b51290d0fe avoid conversions 2020-08-05 16:49:23 +02:00
0369413201 rename fix 2020-08-05 15:22:47 +02:00
04d6644753 Merge pull request #128 from slsdetectorgroup/rxrchrono
rxr chrono
2020-08-05 13:58:08 +02:00
949c6a81ce vector to array 2020-08-05 13:54:56 +02:00
aa0c36713c Utility function to get a vector of set bits
Template function to return a vector with the positions of all set bits in a variable.
2020-08-05 13:42:57 +02:00
4aee113dda temp fix 2020-08-05 13:27:19 +02:00
6c3f0d18ec rxr:removed delte and initialize memebers 2020-08-05 13:23:45 +02:00
7b6f4d0b5b rxr chrono 2020-08-05 12:07:45 +02:00
6db5954d21 Merge pull request #127 from slsdetectorgroup/configuremac
Configuremac
2020-08-05 10:22:20 +02:00
69d9680034 mior 2020-08-05 10:17:47 +02:00
bbf8ab4b88 binary in 2020-08-05 09:49:13 +02:00
79f010a438 renamed is_configurable to is_udp_configured 2020-08-05 09:37:58 +02:00
ab05da4d0e clean up 2020-08-05 09:13:53 +02:00
6e67ff9f90 tests 2020-08-04 17:54:40 +02:00
321ed13659 merge from developer 2020-08-04 17:43:38 +02:00
de39310a9c Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-08-04 17:40:27 +02:00
e1de2f72ba partial clean2 2020-08-04 17:40:17 +02:00
f6172f9b9e binary in 2020-08-04 17:36:49 +02:00
5616d4aeeb m3: deserializers reg also have to updated when changing dr, #counters 2020-08-04 17:32:34 +02:00
857aa47ee7 partial clean 2020-08-04 17:00:20 +02:00
bb3951c201 binaries in 2020-08-04 16:57:06 +02:00
380b062216 configure mac 2020-08-04 16:55:31 +02:00
a70d4e1e5d Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-08-04 15:38:45 +02:00
3301a80d99 send string 2020-08-04 15:38:38 +02:00
ce25b3018c Merge pull request #126 from slsdetectorgroup/m3
M3
2020-08-04 15:21:30 +02:00
d25f9093d5 binary in 2020-08-04 12:02:37 +02:00
d24edd52e1 m3: optimizing 1g and 10g digitizing by setting number of packets depending on 10/1g, dr and #counters 2020-08-04 12:01:28 +02:00
7b1ede32b1 m3: optimizing 1g and 10g digitizing by setting number of packets depending on 10/1g, dr and #counters 2020-08-04 11:58:20 +02:00
4174d193b4 removed exec_command from ClientInterface 2020-08-04 10:50:57 +02:00
0514f00552 m3: update deserializers except for deserializer reg 2020-08-03 17:23:04 +02:00
8631f5e2b0 m3: counter mask in master file 2020-08-03 16:39:31 +02:00
540a203139 Merge pull request #125 from slsdetectorgroup/eiger
Eiger
2020-08-03 15:04:25 +02:00
57c3cb0849 class to struct: review 2020-08-03 14:48:27 +02:00
e82bcafb76 moved class to struct masterattributes 2020-08-03 14:36:35 +02:00
3cdf98b230 Merge branch 'eiger' of github.com:slsdetectorgroup/slsDetectorPackage into eiger 2020-08-03 14:29:23 +02:00
acc43842eb code reviewe 2020-08-03 14:29:16 +02:00
63a5b4d61f send vector for ratecorr 2020-08-03 13:05:36 +02:00
3083260b28 changed clkdiv to speed in python 2020-08-03 11:13:47 +02:00
6e4b7f5bd7 fixed space in python enums 2020-08-03 11:10:01 +02:00
ddd562f8b5 fix 2020-08-03 10:27:06 +02:00
e2f1fd076a rate correction updated in rxr also when chanign exptime, subexptime, default rate correction 2020-08-03 10:07:00 +02:00
6a084e99b4 eiger manual for 5.0 2020-07-31 21:03:22 +02:00
885b22eca8 ratecorrectiosn addded to master file 2020-07-31 18:38:27 +02:00
bea4ba131a eiger rxr added threshold to master file 2020-07-31 17:45:33 +02:00
09fa8a3ba5 timing mode into receiver master file 2020-07-31 17:37:04 +02:00
874092a9d0 gui sub frame index now shows 2020-07-31 17:26:53 +02:00
5c4d355d57 minor 2020-07-31 17:18:15 +02:00
4702a76235 Merge branch 'developer' into eiger 2020-07-31 17:15:07 +02:00
fd503e84af m3: gui: when counters change, the npixelsx also changes 2020-07-31 16:50:17 +02:00
1211d02428 hdf5 dependant master attributes 2020-07-31 16:19:34 +02:00
ec27d35d6d refactor 2020-07-31 14:09:21 +02:00
ea2e7839d0 binary master attributes done, hdf5 WIP 2020-07-31 13:59:06 +02:00
d5b893e452 readErrorMessage 2020-07-31 13:32:53 +02:00
68c0f76bd9 created detector dependant master file attributes 2020-07-31 12:15:38 +02:00
4eaa9588ba created detector dependant master file attributes 2020-07-31 12:15:28 +02:00
459a715b9c minor 2020-07-31 12:15:02 +02:00
40d0430f2e get type from detector 2020-07-31 12:02:12 +02:00
0cb38a9c51 simplified sending 2020-07-31 11:51:06 +02:00
caef8c111c added overload to send vector 2020-07-31 11:05:39 +02:00
02d5cf14e4 removed extra decltype 2020-07-31 09:17:04 +02:00
bd221fefe5 Merge branch 'eiger' of github.com:slsdetectorgroup/slsDetectorPackage into eiger 2020-07-31 08:51:04 +02:00
c683f62452 Merge branch 'developer' into eiger 2020-07-31 08:50:51 +02:00
1177e54602 Remove VLAs (#124)
Removing the use of VLAs in the client and receiver side code. In addition cleaning up sending jsonheader
2020-07-30 18:22:39 +02:00
85c958facf WIP det dependant master file attribtes 2020-07-30 18:05:47 +02:00
87c33c8e81 gotthard2: bug fix: reversed list, but gain indices not reversed 2020-07-30 15:39:26 +02:00
7492f7dbfa m3: numpackets to 2 or 20 depending on ten giga enable (#123) 2020-07-30 15:02:33 +02:00
c2b586a333 eiger: virtual server more print minor 2020-07-30 14:07:02 +02:00
d31839e80e roi constructor added 2020-07-30 14:04:50 +02:00
b47f751d66 Merge branch 'm3' into eiger 2020-07-30 12:04:34 +02:00
aa52028690 Merge branch 'developer' into m3 2020-07-30 12:04:14 +02:00
6f5635a402 gotthard2: vetoref taken as decimal and not hex in server 2020-07-30 12:03:36 +02:00
5b9c7c4105 python vhighvoltage to highvoltage 2020-07-30 11:52:22 +02:00
98ffe350f3 changing command from vhighvoltage to highvoltage 2020-07-30 11:50:56 +02:00
7dfeb987db changing command from vhighvoltage to highvoltage 2020-07-30 11:50:03 +02:00
7899c5faef Merge branch 'm3' into eiger 2020-07-30 11:31:55 +02:00
17fb497774 Merge branch 'developer' into m3 2020-07-30 11:20:57 +02:00
e9c03c6eaf Merge pull request #122 from slsdetectorgroup/g2
G2
2020-07-30 11:18:56 +02:00
f497177022 fixes fro review 2020-07-30 11:18:40 +02:00
984b43545e Merge branch 'm3' into eiger 2020-07-29 17:26:20 +02:00
327218cb2b Merge branch 'g2' into m3 2020-07-29 17:26:04 +02:00
cdfd3934ee Merge branch 'developer' into g2 2020-07-29 17:25:45 +02:00
4cebefbc55 Merge branch 'm3' into eiger 2020-07-29 17:21:14 +02:00
24c4cd8d84 Merge branch 'g2' into m3 2020-07-29 17:15:37 +02:00
f358492e09 all binaries in 2020-07-29 16:53:21 +02:00
86d3fc7e55 fixes from review, moving from array to vector to avoid VLA 2020-07-29 16:52:22 +02:00
89da671ae2 m3: numpackets to 2 or 20 depending on ten giga enable 2020-07-29 15:10:54 +02:00
24e44d56fe Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-07-29 15:02:22 +02:00
b13d04dd89 eiger manual in 5.x 2020-07-29 15:02:11 +02:00
d19530b3d4 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-07-29 14:39:44 +02:00
5ba3a414d6 Warn on the use of VLAs 2020-07-29 14:39:34 +02:00
54ad92a2bf binarires in 2020-07-29 13:26:55 +02:00
74a7ca9b71 gotthard2: vetophoton now has gain thresholds for each row and the get writes to file gain indices and adu for each channel, adus written in dec instead of hex, veto file in server removed and uses vetophoton instead 2020-07-29 13:24:42 +02:00
6846939f92 eiger rxr: space between subperiod(ns) in master file 2020-07-29 09:56:03 +02:00
99ec7f0046 eiger: always change speed when changing dr 2020-07-28 17:06:46 +02:00
df3ae7f409 gotthard2: reversing order of adc channels to chip 2020-07-28 15:08:13 +02:00
410f38c804 jungfrau calibrated settings in 2020-07-28 09:26:20 +02:00
91652df5b1 minor 2020-07-28 08:41:45 +02:00
02bda7c533 using GET_FLAG directly 2020-07-27 16:55:26 +02:00
9204a56ff7 Merge pull request #121 from slsdetectorgroup/checkargs
Check args for sending to detector/receiver
2020-07-27 15:49:19 +02:00
3ec637601d Merge branch 'developer' into checkargs 2020-07-27 15:49:08 +02:00
dc33f1a5da const 2020-07-27 09:14:58 +02:00
879b2c8864 clean getThresholdTemp 2020-07-27 08:58:33 +02:00
b1a4723028 WIP 2020-07-27 08:53:10 +02:00
bad7fd3906 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-07-24 15:48:44 +02:00
21c8b77e2c fixed tests 2020-07-24 15:45:21 +02:00
097acf8086 renamed function to checkArgs 2020-07-24 14:26:58 +02:00
799f540d71 Update change_request.md 2020-07-24 11:32:51 +02:00
a412b465c6 Create change_request.md 2020-07-24 11:32:09 +02:00
bb2f70beb5 Update feature_request.md 2020-07-24 11:27:01 +02:00
096e94562a Update bug_report.md 2020-07-24 11:25:54 +02:00
9063a8d4ed Update feature_request.md 2020-07-24 11:25:02 +02:00
b1d3cbb25e Create feature_request.md 2020-07-24 11:23:50 +02:00
1fefc001f9 added const methods for detector 2020-07-24 11:17:45 +02:00
e8556abbe7 WIP 2020-07-24 10:57:54 +02:00
f8da057735 Update bug_report.md 2020-07-24 10:57:00 +02:00
df0b52604f Update bug_report.md 2020-07-24 10:55:39 +02:00
f792d59682 Update bug_report.md 2020-07-24 10:55:05 +02:00
98d061a032 Create bug_report.md 2020-07-24 10:51:43 +02:00
2bb9629f14 Create config.yml 2020-07-24 10:50:32 +02:00
cf2e1c1dfc Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-07-24 07:57:20 +02:00
cb54bf6225 docs 2020-07-24 07:57:12 +02:00
3b0f68c3c4 gotthard2: fix of ext burst mode global settings 2020-07-23 17:05:43 +02:00
5faf3c7336 format 2020-07-23 14:01:59 +02:00
3ddb264875 minor 2020-07-23 14:01:13 +02:00
1fb19aeae2 constexpr 2020-07-23 12:29:08 +02:00
ad297e9c51 Readlink (#117)
* gotthard config file path using readlink

* gotthard2

* eiger

* eieger, mnythen3, moench

* binaries in

* moved readlink to a common function

* binaries in
2020-07-23 12:17:46 +02:00
beb6afe101 Merge pull request #120 from slsdetectorgroup/usleep
Replaced usleep with std::this_thread::sleep_for
2020-07-23 11:44:30 +02:00
78a6896ae9 replaced usleep with sleep_for 2020-07-23 11:07:42 +02:00
9ea8882c05 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-07-23 10:57:47 +02:00
4cf5e81971 removed usleep 2020-07-23 10:48:59 +02:00
2fa5e7d00c Merge pull request #118 from slsdetectorgroup/rxstartfix
Fixed rx_start
2020-07-23 10:28:38 +02:00
af17fb9f61 removed make_timedelta 2020-07-23 09:34:04 +02:00
07869134d6 removed additional buggy signatures 2020-07-23 08:19:08 +02:00
8b9a69e1f1 overload for rx void return type 2020-07-23 08:07:36 +02:00
023924c4cc updatd gotthard2 module id for new hdi 2020-07-22 11:22:58 +02:00
01d00164e5 added cast to silence warning in CTB server 2020-07-22 08:57:02 +02:00
e6c8ba0e88 Merge pull request #116 from slsdetectorgroup/serverconfigs
Serverconfigs
2020-07-21 10:33:41 +02:00
37fc69b297 modified permissions of config file 2020-07-20 18:01:13 +02:00
e1e265bd49 moench fix 2020-07-20 17:53:38 +02:00
b46809e1c0 binaries in 2020-07-20 17:36:55 +02:00
396d82bd62 eiger 2020-07-20 17:33:19 +02:00
e7ff96fe8d gotthard2 2020-07-20 17:30:44 +02:00
07a292af95 gotthard 2020-07-20 17:28:29 +02:00
e4433a99a5 moench 2020-07-20 17:24:55 +02:00
28fb1023fa mythen3: rename default pattern txt and move to inst dir 2020-07-20 17:18:59 +02:00
c4374e623e Merge pull request #115 from slsdetectorgroup/mythen3
Mythen3
2020-07-17 19:24:34 +02:00
da2f12072f virtual data mythen3 fix 2020-07-17 19:19:21 +02:00
918da2402f binaries in 2020-07-17 19:06:30 +02:00
94e9591974 gui: dr enabled for m3 2020-07-17 18:49:05 +02:00
a76ed6d8db tengiga enable 2020-07-17 18:34:23 +02:00
b7cb341ee3 dr 2020-07-17 17:33:43 +02:00
546bef5e5a powerchip at server startup 2020-07-17 15:38:27 +02:00
97ddfed819 Merge pull request #114 from slsdetectorgroup/gotthard2
Gotthard2
2020-07-17 13:00:07 +02:00
2d68b61f00 binaries recompiled 2020-07-17 12:59:37 +02:00
3bdf02a23c rx_zmqstartfnum added to have an offset of streaming frame numbers 2020-07-17 11:11:19 +02:00
f70d28b175 Merge branch 'developer' into gotthard2 2020-07-17 10:34:46 +02:00
d076fda59a Merge pull request #113 from slsdetectorgroup/shmissue
Shmissue
2020-07-17 07:19:46 +02:00
a3062a5e00 formatting 2020-07-17 07:19:19 +02:00
c6921bf954 virtual memory error verbosity 2020-07-16 17:19:05 +02:00
ae9499047b powerpc and nios binaries in 2020-07-16 16:36:49 +02:00
8dd9bb6ea3 blackfin binaries 2020-07-16 16:21:00 +02:00
9a284f75c3 pthread mutex works on blackfin 2020-07-16 16:18:40 +02:00
3e87cfa5c1 WIP shm deletion working on blackfin 2020-07-16 16:01:30 +02:00
6136eabee2 WIP shm deletion working on blackfin 2020-07-16 16:00:28 +02:00
67bb0dff1a rx_zmqstartfnum, not tested 2020-07-16 12:18:18 +02:00
ca298580f3 badchannels done 2020-07-15 18:24:17 +02:00
d7f490701b confadc added to client, removed conf adc depending on burst mode 2020-07-15 13:30:30 +02:00
7752b86d97 veto file in 2020-07-14 18:51:47 +02:00
35dbc3813d filter and cds gain, burst and continuous value to asic changed, bug fix to scanning function addresses in server_funcs.c 2020-07-14 17:09:51 +02:00
a096434864 new few version 2020-07-14 15:38:32 +02:00
ab4d89aa70 updated new config file 2020-07-14 15:37:47 +02:00
c67b7aab4d fix for datasocket and clientsocket, to be reviewed.
clientsocket: to print origin of error (rx/det) for tcp socket failure
datasocket: usleep only for send for rhel7, not for fedora.. when fpath /, fwrite 1, rx_start fails without sending exception
2020-07-14 13:04:33 +02:00
293fda0c7a mythen3, gotthard2: bug fix- changing wrong pll phases when changing frequency 2020-07-13 15:47:43 +02:00
bef35eb3d6 Merge pull request #112 from slsdetectorgroup/m3pattern
M3pattern
2020-07-08 17:10:30 +02:00
eea013d492 Merge branch 'developer' into m3pattern 2020-07-08 14:10:04 +02:00
890a641304 temp via stop server fix 2020-07-08 14:09:41 +02:00
1e0160d655 updated default pattern 2020-07-08 12:33:33 +02:00
42b7f6fa7c binary in 2020-07-08 11:35:46 +02:00
4a1943216b default pattern file for mythen3 2020-07-07 15:50:32 +02:00
a23504c9c4 help print 2020-07-07 14:14:03 +02:00
4db3473e32 Merge pull request #111 from slsdetectorgroup/shm
Shm
2020-07-07 13:35:52 +02:00
8c1c696f64 no scan at module level 2020-07-06 09:43:10 +02:00
39bbc5c688 OutString for scanParameters 2020-07-06 09:19:44 +02:00
28b3fb4101 binaries 2020-07-03 17:15:24 +02:00
05059c1176 Test 2020-07-03 17:14:45 +02:00
95089b5faa WIP 2020-07-03 16:06:12 +02:00
7c48ef8931 binaries and fix 2020-07-02 17:15:24 +02:00
0dc062e6d3 binaries 2020-07-02 16:41:03 +02:00
9b1b878f95 Merge branch 'shm' of github.com:slsdetectorgroup/slsDetectorPackage into shm 2020-07-02 16:40:25 +02:00
e23a8e7da2 frames fix 2020-07-02 16:40:18 +02:00
a228ae0773 binaries 2020-07-02 16:38:00 +02:00
9787c6a385 Merge branch 'shm' of github.com:slsdetectorgroup/slsDetectorPackage into shm 2020-07-02 16:37:01 +02:00
4d1fad04c3 frames fix 2020-07-02 16:36:54 +02:00
c5a9ff3024 binaries in 2020-07-02 15:53:57 +02:00
25ec47dfff state machine on a different thread 2020-07-02 15:50:22 +02:00
93c5505285 WIP 2020-07-02 13:42:32 +02:00
a656668d73 WIP 2020-07-01 20:00:36 +02:00
3156e6f50e binaries 2020-07-01 13:13:52 +02:00
f224b7dadf Merge branch 'shm' of github.com:slsdetectorgroup/slsDetectorPackage into shm 2020-07-01 13:13:18 +02:00
ccf54f29b6 binaries 2020-07-01 12:52:31 +02:00
ef564e382c fix 2020-07-01 12:50:46 +02:00
e571f7bb3e WIP 2020-07-01 09:10:49 +02:00
aacc61b058 WIP 2020-06-30 17:11:51 +02:00
7d128585e1 WIP 2020-06-30 16:55:02 +02:00
279986d77c WIP 2020-06-30 12:09:23 +02:00
ff729fb43f WIP 2020-06-30 11:59:35 +02:00
488e0230ba WIP, eiger 2020-06-30 10:55:31 +02:00
c04793a9d7 fix frame rates 2020-06-30 09:54:30 +02:00
f1cbf49449 binaries in 2020-06-30 09:06:15 +02:00
285ef30439 WIP 2020-06-29 20:01:55 +02:00
75e9d63341 WIP 2020-06-29 19:11:57 +02:00
21a79752e2 clang-tidy delete nullptr 2020-06-29 17:54:08 +02:00
5780cabe8d clang-tidy nullptr 2020-06-29 17:48:22 +02:00
cec26f81e1 more using .empty() 2020-06-29 17:41:06 +02:00
0c045f0faa WIP 2020-06-29 17:40:41 +02:00
19e40cf0e6 using .empty() on stl containers 2020-06-29 17:20:56 +02:00
902366fede inbetween WIP, startstatemachien ugly 2020-06-26 19:08:03 +02:00
ee67c28711 WIP, all servers with virtual stop and start working 2020-06-26 16:47:58 +02:00
cfe9a431f9 WIP, moving virtual status stop to shm from files 2020-06-26 11:50:40 +02:00
524c86de49 WIP 2020-06-26 11:50:00 +02:00
05ef55b258 target skipping doxygen 2020-06-25 10:32:47 +02:00
bcd217b6fe Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-06-24 09:11:38 +02:00
4ca46e4123 removed old python docs 2020-06-24 09:11:26 +02:00
7333909f6b unnecessary hdf5 define, allows doxygen to include them 2020-06-24 09:10:54 +02:00
ba7f54744b doc warnings fixed 2020-06-23 17:32:56 +02:00
cd677e4d97 Merge pull request #110 from slsdetectorgroup/pattern
Pattern
2020-06-23 14:30:23 +02:00
4240ea57d4 fix 2020-06-23 14:26:54 +02:00
692ade6c17 fix 2020-06-23 13:56:45 +02:00
4cbe354396 pattern word prints every 10 for pattern file 2020-06-23 12:47:06 +02:00
39d5a7db26 Merge branch 'pattern' of github.com:slsdetectorgroup/slsDetectorPackage into pattern 2020-06-23 12:10:52 +02:00
ae88af2a72 fix 2020-06-23 12:10:40 +02:00
f592d21570 clkctrl 2020-06-23 11:49:13 +02:00
35f95e603e removed patternClockControl removed from python 2020-06-23 11:45:13 +02:00
5c42792580 binaries in 2020-06-23 11:00:51 +02:00
301073e60b WIP 2020-06-23 10:53:17 +02:00
159b0a0367 WIP 2020-06-23 09:30:17 +02:00
f6911c4238 WIP 2020-06-23 09:02:26 +02:00
1d53dc65cd WIP 2020-06-23 08:48:54 +02:00
9d3bbc0a68 WIP 2020-06-22 15:02:28 +02:00
801f2c4559 WIP 2020-06-22 09:33:09 +02:00
da2ce03e1d Merge pull request #108 from slsdetectorgroup/removeget
Removeget
2020-06-19 14:24:32 +02:00
f366e9ae6f fixed python enums 2020-06-19 14:14:52 +02:00
5bf6b7a338 Refactor of ZmqSocket (#109)
Changed data type of address from char[1000] to string to reduce stack size of object.

Removed redundant calls to Close

Removed function exposing the socket descriptor

Using functions from network_utils instead of duplicates

Added tests
2020-06-19 12:41:03 +02:00
991acc7c07 binaries 2020-06-18 17:54:57 +02:00
b40e481da9 WIP 2020-06-18 17:53:43 +02:00
12b40a44a2 first test for ZmqSocket 2020-06-18 17:49:40 +02:00
f14c2d06a5 binaries in 2020-06-18 17:41:32 +02:00
0cc547c2de WIP 2020-06-18 17:40:23 +02:00
489fccb25c removed GET_ flags, replaced -1 with GET_FLAG 2020-06-18 17:10:53 +02:00
7c23f1e42c Merge pull request #106 from slsdetectorgroup/settingsfile
removed settings file option for gotthard and jungfrau, also removed …
2020-06-18 16:05:00 +02:00
f66345d128 removed store in ram from python 2020-06-18 15:36:43 +02:00
e7da4ae862 fix 2020-06-18 14:48:20 +02:00
8adddfb083 binaries in 2020-06-18 12:42:53 +02:00
7cc05ead89 WIP 2020-06-18 12:41:10 +02:00
ebc164aaa6 WIP 2020-06-18 11:02:33 +02:00
a57f7943ee WIP 2020-06-17 18:30:25 +02:00
db8616fcb3 Merge branch 'developer' into settingsfile 2020-06-17 15:35:48 +02:00
55af974c4e moench zmq processor option included to compile 2020-06-17 15:33:41 +02:00
1f3fd010a7 reordering WIP 2020-06-17 15:25:59 +02:00
cf9ec3de0d moench zmq (#107) 2020-06-17 10:34:42 +02:00
b5781e1f9b multisize to numberofdetectors 2020-06-17 09:57:56 +02:00
e09fc8cd2b from previous 2020-06-17 09:33:39 +02:00
48b8116849 removed settings file option for gotthard and jungfrau, also removed ghost functiosn writesettingsfile and savesettingsfile in module 2020-06-17 09:30:51 +02:00
f5759921d2 Merge pull request #105 from slsdetectorgroup/eiger
Eiger
2020-06-17 09:15:00 +02:00
b5b50a2061 binary in 2020-06-17 09:11:44 +02:00
a7d2a89c50 Merge branch 'developer' into eiger 2020-06-17 09:11:08 +02:00
e80bc905d6 minor print fix 2020-06-17 09:10:48 +02:00
c6b664b25b added tests 2020-06-17 08:28:24 +02:00
f078e6147d Merge branch 'developer' into eiger 2020-06-16 16:55:49 +02:00
7609a2bda4 mythen3: timers based on run clk and not on sync clk 2020-06-16 16:47:03 +02:00
d5ae9a22f4 mythen3: changed system vco from 1.25GHz to 1GHz and hence the sytem clock dividers defaults 2020-06-16 15:00:02 +02:00
ffb1a59df0 binary 2020-06-16 12:53:34 +02:00
889e926479 WIP 2020-06-16 12:47:40 +02:00
19bd39eece WIP 2020-06-16 12:47:06 +02:00
f28b41b130 WIP 2020-06-16 12:42:19 +02:00
9a80975929 WIP 2020-06-16 12:41:39 +02:00
efc247f46f WIP 2020-06-16 12:32:28 +02:00
c0e8e44b41 WIP 2020-06-16 10:47:53 +02:00
82a6383466 WIP 2020-06-16 10:47:23 +02:00
0289f22a0d WIP 2020-06-16 10:44:41 +02:00
6a919ece02 Merge branch 'eiger' of github.com:slsdetectorgroup/slsDetectorPackage into eiger 2020-06-16 10:42:55 +02:00
d0baa4c7b9 WIP 2020-06-16 10:42:44 +02:00
6dccf48759 WIP 2020-06-15 17:37:52 +02:00
b128837538 Merge branch 'eiger' of github.com:slsdetectorgroup/slsDetectorPackage into eiger 2020-06-15 17:30:14 +02:00
3c46204b14 WIP 2020-06-15 17:30:05 +02:00
807a588c4b WIP 2020-06-15 17:15:31 +02:00
fb5b2133f5 WIP 2020-06-15 17:13:49 +02:00
6f2413fd5d WIP 2020-06-15 17:11:33 +02:00
5412569e77 WIP 2020-06-15 17:10:38 +02:00
0375e80b42 WIP 2020-06-15 16:51:59 +02:00
569d0464e7 WIP 2020-06-15 16:44:18 +02:00
cc8549e6cb WIP 2020-06-15 16:43:16 +02:00
bcb5b8047b WIP 2020-06-15 16:41:40 +02:00
8c9341836b WIP 2020-06-15 16:26:26 +02:00
ad36ee2ba2 and bottom... 2020-06-15 10:40:30 +02:00
afa71895e7 eiger virtual slave missing c99 2020-06-15 10:38:55 +02:00
62449b81ad format 2020-06-15 10:36:59 +02:00
6794d58db1 Merge branch 'developer' into eiger 2020-06-15 10:36:36 +02:00
3775ff302e WIP 2020-06-15 10:36:24 +02:00
e76da84c9f eiger dac names 2020-06-15 10:34:16 +02:00
24af0ee578 WIP 2020-06-15 10:29:50 +02:00
e0b86799ae Merge branch 'developer' into eiger 2020-06-15 09:39:45 +02:00
5a7451e29e Merge pull request #104 from slsdetectorgroup/gnu99
Gnu99
2020-06-15 09:39:07 +02:00
e0c056be09 eiger fix 2020-06-15 09:22:26 +02:00
cf0681a23c Merge branch 'gnu99' of github.com:slsdetectorgroup/slsDetectorPackage into gnu99 2020-06-15 09:21:25 +02:00
24168d5e32 fix 2020-06-15 09:20:38 +02:00
7c2949f372 WIP 2020-06-12 17:07:58 +02:00
5a7eeb3d76 WIP 2020-06-12 16:22:31 +02:00
64a94b962a binaries in 2020-06-10 17:32:43 +02:00
ab72d342c9 formatting 2020-06-10 17:29:28 +02:00
200186ddde binaries in, std=gnu99, for loop variable declaration inside for loop 2020-06-10 17:27:02 +02:00
7388bb4aa7 clang-tidy string init 2020-06-10 08:39:24 +02:00
9c26cd5552 clang-tidy delete nullptr 2020-06-10 08:37:06 +02:00
5f91198328 clang-tidy nullptr 2020-06-10 08:30:12 +02:00
265e96d675 clang-tidy nullptr 2020-06-10 08:27:35 +02:00
f5160b0978 exposing receiver thread ids to client (#102)
* exposing receiver thread ids to client

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2020-06-09 16:18:37 +02:00
2a2bb5f63a binary in 2020-06-08 14:12:06 +02:00
e306c39e1d mythen3: numcounters to mask, updating gateperiod 2020-06-08 10:15:22 +02:00
6c95bf171b Merge branch 'test' into developer 2020-06-05 09:07:42 +02:00
fd948f1a00 updated binaries 2020-06-05 09:06:49 +02:00
ff9811895f WIP 2020-06-05 09:04:32 +02:00
7f6d57d6ba WIP 2020-06-04 17:42:24 +02:00
099805ba8b WIP 2020-06-04 17:02:56 +02:00
1e2a3f2767 WIP 2020-06-04 15:21:53 +02:00
9a8300ca08 WIP 2020-06-04 12:12:40 +02:00
40257fc82d Adds the stripDetector daemon 2020-06-04 11:50:33 +02:00
3bdc8e95ce WIP 2020-06-03 16:10:47 +02:00
223e24f924 WIP 2020-06-03 14:56:24 +02:00
4053594c4d WIP 2020-06-03 14:40:51 +02:00
f07e722d26 read/write reg moved to stop server, tests 2020-06-02 11:56:50 +02:00
2ef8f2f046 WIP 2020-05-29 19:36:41 +02:00
0e514a470d gotthard2 config example 2020-05-29 17:04:54 +02:00
294612b03c WIP 2020-05-29 17:04:10 +02:00
f223415f94 fix for testing 2020-05-29 16:26:57 +02:00
c6ff50d753 merge vetoheader 2020-05-29 10:50:33 +02:00
f0a318777c mythen3 bnaries in 2020-05-28 13:11:32 +02:00
8aa7144252 mythen3: fix of external signals to not allow master output inversion, but can edge detect not configurable, and default dout pulse length 2020-05-28 13:09:09 +02:00
15eea51f12 gotthard2 new firmware veto header reduced to 16 (frames, bunchid) 2020-05-28 12:44:03 +02:00
e884836f5c Merge branch 'vetoheader' of github.com:slsdetectorgroup/slsDetectorPackage into vetoheader 2020-05-28 11:33:59 +02:00
104d91e8c6 more jf stuff 2020-05-28 11:33:52 +02:00
9ddebc4c09 binaries in 2020-05-28 10:36:17 +02:00
0525e374b2 settign veto also configures mac, sending veto data for 10gb only if veto and numinterfaces==2, changed veto entry offset 2020-05-28 10:35:48 +02:00
e727b97d75 gottahrd2 binary in 2020-05-28 09:46:12 +02:00
5ca987ecbb Merge branch 'vetoheader' of github.com:slsdetectorgroup/slsDetectorPackage into vetoheader 2020-05-28 09:44:32 +02:00
2a64a9f6e0 gotthard2: removed check for module attached when setting veto, for later 2020-05-28 09:44:25 +02:00
a708da5455 Merge branch 'vetoheader' of github.com:slsdetectorgroup/slsDetectorPackage into vetoheader 2020-05-28 09:29:02 +02:00
e2eb1598d3 jf stuff 2020-05-28 09:28:53 +02:00
d175ba0936 check for module attached only when enabling veto streaming, not disabling 2020-05-28 09:21:19 +02:00
6189fd157a gotthard2: cehck if module attached when setting veto to 1 2020-05-28 09:19:55 +02:00
6c753f3b50 veto 2020-05-28 08:48:11 +02:00
098d3e6d98 gotthard2: binaries in 2020-05-27 14:39:28 +02:00
4300e95a8e virtual, adding veto command 2020-05-27 14:37:52 +02:00
46daa7e2de merge from developer (mythen3 branch) 2020-05-27 14:19:33 +02:00
754536898a Merge pull request #100 from slsdetectorgroup/mythen3
Mythen3
2020-05-27 14:12:52 +02:00
20bfe92573 gatedelay 2020-05-27 14:02:33 +02:00
9493ae3da9 WIP 2020-05-27 11:30:47 +02:00
0fca9fba79 Merge branch 'mythen3' of github.com:slsdetectorgroup/slsDetectorPackage into mythen3 2020-05-27 11:30:23 +02:00
b543708d9d exptime 2020-05-27 11:30:11 +02:00
e0ea08332f gotthard2: fix in rxr for gotthard2 2020-05-26 17:44:31 +02:00
e229fee6ba gotthard2: hv soft max uptdated to 500v 2020-05-26 14:59:48 +02:00
44a88893ba mythen3: hv soft max uptdated to 500v 2020-05-26 14:58:41 +02:00
f4ba46c19b update function and enum generation 2020-05-26 11:26:24 +02:00
37cb0bb1c0 minor PR fixes 2020-05-26 08:57:48 +02:00
f293ba8c56 gui cmake fix 2020-05-26 08:50:09 +02:00
e9ca17f860 Merge branch 'vetoheader' of github.com:slsdetectorgroup/slsDetectorPackage into vetoheader 2020-05-25 14:23:45 +02:00
30391a2faf veto header size in server using sizeof 2020-05-25 14:23:10 +02:00
7ba877446c gotthard2 binary 2020-05-25 12:21:44 +02:00
6bdc506a34 veto header smaller size 2020-05-25 12:20:40 +02:00
9592d1760f gui fix 2020-05-25 11:09:26 +02:00
8ffb27c300 WIP 2020-05-25 11:05:51 +02:00
0a66605111 tests mainly and minor print 2020-05-22 15:23:56 +02:00
02d8b1fb5f mythen3 binary 2020-05-20 17:30:40 +02:00
457f31ed61 mythen3 server minor print fix 2020-05-20 17:30:07 +02:00
be3f095b56 gui minor fix 2020-05-20 17:27:22 +02:00
174bb32744 gui minor fix 2020-05-20 17:26:57 +02:00
07d90d127f gui fix 2020-05-20 17:25:39 +02:00
0debd6a457 mythen3: auto mode does not ignore #triggers 2020-05-20 17:12:45 +02:00
8f0ef68029 binaries in 2020-05-20 17:07:41 +02:00
d71e40729a external signals 2020-05-20 17:05:42 +02:00
9475e01062 gui done 2020-05-20 12:41:14 +02:00
dc8f67cd7b gui fix 2020-05-20 12:04:48 +02:00
3ebb1fca02 gui WIP 2020-05-20 11:51:18 +02:00
8973ef1aaa from timetest merge 2020-05-20 10:18:51 +02:00
5690914048 Merge branch 'mythen3' of github.com:slsdetectorgroup/slsDetectorPackage into mythen3 2020-05-20 10:15:04 +02:00
fa768e584e rxr 2020-05-20 10:14:57 +02:00
62e69b900b Merge pull request #99 from slsdetectorgroup/timetest
directly writing exptime
2020-05-20 09:56:34 +02:00
30fc346e22 directly writing exptime 2020-05-20 09:47:41 +02:00
761f93d753 exptime of gates 2020-05-20 09:36:43 +02:00
6d71d6cf9f fix with virtual server 2020-05-19 19:11:05 +02:00
e208d3ebe8 WIP 2020-05-19 18:59:07 +02:00
cd90f09a30 WIP 2020-05-19 18:24:32 +02:00
4570ffc8ad Merge branch 'mythen3' of github.com:slsdetectorgroup/slsDetectorPackage into mythen3 2020-05-18 14:36:17 +02:00
a7ce30391c register defs from pattern control to flow control 2020-05-18 14:35:59 +02:00
c33c479ada removed funcs from install 2020-05-18 14:18:12 +02:00
c8eda1a458 mythen binary up 2020-05-15 17:07:27 +02:00
ecc692ad9a start pattern without binaries 2020-05-15 17:06:08 +02:00
00c1211c56 unformatting regdefs 2020-05-15 16:14:57 +02:00
599625e6ed server binaries up 2020-05-15 15:49:59 +02:00
3514b14bc9 servers: removing notification file as this will be done by daemon 2020-05-15 15:48:52 +02:00
395b9f1b72 reordering one function, minor 2020-05-15 13:08:59 +02:00
26dfccf77e binaries compiling, removed inline for c 2020-05-15 13:03:50 +02:00
50d2d21018 fix for virtual servers for rhel7 2020-05-15 12:44:44 +02:00
2c83abcac7 merged detFuncs for c and c++ 2020-05-15 12:24:06 +02:00
ea7cc9db8c less public headers 2020-05-15 10:52:23 +02:00
0dd5a099c8 renamed FixedCap.. to StaticVector 2020-05-15 09:03:23 +02:00
e6deccc2c6 Merge pull request #98 from slsdetectorgroup/gotthard2
Gotthard2
2020-05-14 11:54:09 +02:00
ad42a61bae Merge branch 'developer' into gotthard2 2020-05-14 11:53:59 +02:00
cbc2856c1c rxr should print ip, mac, when set from structure 2020-05-13 18:35:46 +02:00
e34fbb4350 binaries in 2020-05-13 17:55:08 +02:00
eea67014b7 gotthard2 with veto data on second interface 2020-05-13 17:50:18 +02:00
3962714b48 format + exception.cpp 2020-05-13 14:48:52 +02:00
f0f97f265a removed non used slsDetectorUsers 2020-05-13 14:05:05 +02:00
e730c124e3 Merge pull request #97 from slsdetectorgroup/eiger26
Eiger26
2020-05-13 10:47:53 +02:00
f51c4e1d7c c99 2020-05-13 09:41:41 +02:00
a62b650e24 eiger binary in 2020-05-13 09:25:58 +02:00
af4b5bbf50 Pr fix 2020-05-13 09:22:40 +02:00
d8ca9bb6b5 eiger virtual server fix 2020-05-12 13:49:08 +02:00
9a1fdc4104 Merge branch 'developer' into eiger26 2020-05-12 13:43:36 +02:00
b3ebce378d Merge pull request #96 from slsdetectorgroup/rxthrow
More receiver functions throws
2020-05-12 13:42:43 +02:00
46afcfe694 removed logging 2020-05-12 11:49:49 +02:00
d7563fdd1a Merge branch 'developer' into eiger26 2020-05-12 11:39:29 +02:00
ccf1889113 formatting 2020-05-11 20:09:45 +02:00
88f801061f fix for reset 2020-05-11 20:09:09 +02:00
e3d3c88d74 update format 2020-05-11 19:53:50 +02:00
80f4f115f9 updated bianries 2020-05-11 19:53:00 +02:00
9a7d15bbf6 WIP 2020-05-11 19:36:12 +02:00
e148a584df formatting 2020-05-11 19:27:49 +02:00
5aaefc8e00 fix using real detectors, moving readconfig to end (due to initialization) 2020-05-11 19:26:22 +02:00
ed8d606eb2 WIP 2020-05-11 19:19:49 +02:00
eff664e790 cleanup 2020-05-11 18:28:06 +02:00
1ed1b5da86 migrate to return values 2020-05-11 12:15:16 +02:00
353b8d0057 migrate to return values 2020-05-11 11:48:18 +02:00
bbe9108fb9 migrate to return values 2020-05-11 11:39:11 +02:00
1998f9541e reorder read settings func 2020-05-11 10:30:55 +02:00
6620027439 reset to hardware evn if no file 2020-05-08 18:14:59 +02:00
30078d6c1f eiger: deactivate at startup, hostname activates, config file for top or master, if none, reset to hardware, no binaries 2020-05-08 18:11:15 +02:00
13c1f7c2d6 WIP 2020-05-08 16:31:26 +02:00
28bafb012a fixed test for new default values 2020-05-08 15:09:12 +02:00
9c7ff84b73 compiled all servers again 2020-05-08 13:57:23 +02:00
ab5cad4fde formatted servers 2020-05-08 13:56:47 +02:00
dac9998161 updated all servers 2020-05-08 13:42:07 +02:00
1dfac6ae6a Merge pull request #95 from slsdetectorgroup/trim
Trim
2020-05-08 13:39:42 +02:00
2e75f36fa0 pr fixes 2020-05-08 12:24:12 +02:00
c1902c713d mythne3 binary 2020-05-08 11:16:10 +02:00
61f5564bb7 Merge branch 'trim' of github.com:slsdetectorgroup/slsDetectorPackage into trim 2020-05-08 11:15:34 +02:00
ec2f7db729 mythen3: settings file of dac -1 fix 2020-05-08 11:15:27 +02:00
676055837f mythen3: binaries for 1 chip fix 2020-05-08 11:04:47 +02:00
cce028b825 Merge branch 'trim' of github.com:slsdetectorgroup/slsDetectorPackage into trim 2020-05-08 11:04:13 +02:00
d468641138 fix 2020-05-08 11:04:04 +02:00
01d1c86403 mythen3 trim one chip fix 2020-05-08 11:03:00 +02:00
2ac7451a99 eiger server 2020-05-08 10:53:34 +02:00
15b57b29fb all binaries except eiger 2020-05-08 10:18:54 +02:00
902616a09d Merge branch 'trim' of github.com:slsdetectorgroup/slsDetectorPackage into trim 2020-05-08 10:18:38 +02:00
eb3971fedc all binaries except eiger 2020-05-08 10:18:29 +02:00
64f0aa98ab Merge branch 'trim' of github.com:slsdetectorgroup/slsDetectorPackage into trim 2020-05-08 10:17:43 +02:00
61b86962bd no binaries yet, malloc need no casting 2020-05-08 10:17:36 +02:00
0e5a96e1ed binaries mythen3, gotthard2 2020-05-08 09:42:29 +02:00
2f11dbc2c9 nios, for variable delcaration in loop 2020-05-08 09:39:36 +02:00
9b21f44d94 binary 2020-05-07 17:41:56 +02:00
e56b431dc3 trim crash fix 2020-05-07 17:41:23 +02:00
1741c84406 binary 2020-05-07 17:22:43 +02:00
1623448086 minor 2020-05-07 17:14:51 +02:00
1a39f92f8f binary 2020-05-07 17:14:20 +02:00
4ea1f2c7e3 Merge branch 'trim' of github.com:slsdetectorgroup/slsDetectorPackage into trim 2020-05-07 17:07:56 +02:00
66d30cb2f1 remove printouts during trimming 2020-05-07 17:07:44 +02:00
8f021fe4ac binaries 2020-05-07 16:48:27 +02:00
7f42f5cadb trim change mythen3 2020-05-07 16:40:09 +02:00
999c548aa1 mythen3: trim: removing printout while tirmming 2020-05-07 16:36:09 +02:00
6872f24037 mythen3: binary 2020-05-07 16:07:24 +02:00
1a75170eed mythen3: set trimbits (not settings, threshold yet), set all trimbits 2020-05-07 16:04:30 +02:00
a12d47da36 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-05-06 12:02:54 +02:00
c16411ba00 new regex for version 2020-05-06 12:02:42 +02:00
379b9b53b4 fixed still one index in cluster finder 2020-05-06 12:02:22 +02:00
d76f43f5fd Fixed problem in cluster finder 2020-05-06 11:59:49 +02:00
7d94ad51ab format slsdetectorservers .c 2020-05-05 15:30:44 +02:00
671cf45fd7 format slsdetectorservers 2020-05-05 15:23:11 +02:00
31ec3c8cf7 check for clang-format version 2020-05-05 10:37:17 +02:00
8ff9b0cdac format GUI 2020-05-05 10:12:05 +02:00
ea4044e4b1 format support lib 2020-05-05 10:07:19 +02:00
e599bb7c24 format receiver 2020-05-05 10:04:52 +02:00
3618f6e5d3 removed obsolete tests 2020-05-05 09:20:05 +02:00
959fd562d3 clang-format 2020-05-04 16:30:00 +02:00
32662baef8 cleaning 2020-05-04 16:18:55 +02:00
4e4f06560c Adding support for clang-format (#94) 2020-05-04 16:16:23 +02:00
efcb6cf480 Merge branch 'static' into developer 2020-04-30 18:06:55 +02:00
9ae933b177 WIP 2020-04-30 18:04:30 +02:00
f87e8d3c19 WIP 2020-04-30 18:03:17 +02:00
903ebb2679 WIP 2020-04-30 17:58:31 +02:00
f41083842f WIP 2020-04-30 17:09:14 +02:00
9a87ba610a WIP 2020-04-30 15:26:50 +02:00
7224ad989a WIP 2020-04-30 14:04:50 +02:00
64f5c0f34b jungfrau virtual bug fix: sends multiple frames for both interfaces now 2020-04-29 18:07:59 +02:00
3238ecfc8d WIP 2020-04-29 18:02:57 +02:00
395d7ba98a Merge branch 'developer' into static 2020-04-29 14:20:12 +02:00
96ec3b2123 merge conflict resolved 2020-04-29 14:17:07 +02:00
b7805ae0d4 gotthard2, moench: remove leading spaces in config file on board detector server 2020-04-29 14:09:35 +02:00
1f6b0b5887 gotthard2: new default clk dividers 2020-04-29 12:51:05 +02:00
b1cdc79bd4 Merge branch 'developer' into static 2020-04-28 18:31:11 +02:00
f626db454e updated gotthard2, mythen3 binaries 2020-04-28 17:07:18 +02:00
86b39853a3 gotthard2, mythen3: making them clkdivider dependant and not clkfrequency, binaries not loaded yet 2020-04-28 17:04:57 +02:00
e3044689dd WIP 2020-04-28 14:26:59 +02:00
337e56d9bf cleaned up LTO detection 2020-04-23 08:23:36 +02:00
eb257154c6 added triggers 2020-04-22 09:15:31 +02:00
c1ae67ac46 Small refactor on ThreadObject and listener (#93)
* removed pointer, slight cleaning of loop

* removed semaphore, use getters

* removed redundant log msg

* removed comment

* added const

* removed comment

* changed header
2020-04-21 09:45:29 +02:00
68f76e5356 more like UdpRxSocket 2020-04-20 17:24:53 +02:00
8afa11ed33 removed pointer to server socket 2020-04-20 17:20:33 +02:00
bc389f4825 moved data members to top 2020-04-20 14:51:48 +02:00
095ced153c removed need for pointer 2020-04-20 14:31:10 +02:00
a1a5a20845 from thread sanitizer 2020-04-17 09:35:38 +02:00
c725a05ef8 fix RH7 2020-04-16 15:51:28 +02:00
815b6a37aa moved flag to base class 2020-04-16 13:22:51 +02:00
655a410d43 cleaned up UdpRxSocket 2020-04-16 09:45:44 +02:00
97ba81d923 fixed test 2020-04-14 16:58:37 +02:00
3d00eed0f0 Change SetTrimbits() and SaveAllTrimbits() to rely on top/bottom signal instead of TopAddressIsValid() for further cleanup. 2020-04-14 16:13:26 +02:00
a7f5300455 Merge pull request #92 from slsdetectorgroup/setrxhostname
Setrxhostname
2020-04-09 11:52:46 +02:00
2f33a1a479 updated binaries 2020-04-09 09:35:46 +02:00
39fa5e0185 client recieve rx parameters as a struct 2020-04-09 09:34:20 +02:00
ba4985ed4d Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-04-09 09:32:09 +02:00
f811c065d1 corrected a delete [] in multiThreadedAnalogDetector 2020-04-09 09:31:43 +02:00
3a1d87728c updated client api 2020-04-09 08:38:37 +02:00
0652ff6b5a updated binaries 2020-04-09 08:37:27 +02:00
373e177274 WIP 2020-04-09 08:35:30 +02:00
6dd6685e7d minor 2020-04-09 08:24:16 +02:00
38c31fdada WIP 2020-04-08 20:27:10 +02:00
b3fe0e79bc WIP 2020-04-08 16:43:28 +02:00
215e4a56fd Merge branch 'developer' into setrxhostname 2020-04-08 12:00:21 +02:00
71a68c2022 eiger transmitting fix in 10g mode (stop servers informed about 10g mode) 2020-04-08 11:58:59 +02:00
55f8497eac WIP 2020-04-08 11:05:06 +02:00
738f341265 eiger server compiled from previous commit 2020-04-08 08:41:39 +02:00
c4ae876ca7 Add Eiger server Init() modification also to initStopServer() 2020-04-07 17:45:53 +02:00
07cd71f0c7 removed update shared memory from detector, check if eiger firmware >=26: have same top and bottom addresses 2020-04-07 17:19:47 +02:00
9f3ad4e2f4 merge from 4.2.0 2020-04-07 15:14:27 +02:00
ab9fed45fb Merge pull request #91 from slsdetectorgroup/testing
Testing
2020-04-07 12:15:37 +02:00
a86ae0cb47 WIP 2020-04-07 12:14:22 +02:00
bdf0f9e2b9 fixed start stop tests 2020-04-07 10:39:50 +02:00
fad10273ed fix for server crashing when sending udp packets if no udp server present to listen to it (receiver): cannot use connect and write 2020-04-07 09:57:22 +02:00
83283b672a WIP 2020-04-06 19:38:35 +02:00
456b96446f WIP 2020-04-06 17:59:06 +02:00
80e55cd4da WIP 2020-04-06 17:28:05 +02:00
47b0e46f15 Merge branch 'developer' into testing 2020-04-06 10:55:41 +02:00
fdb6e3f3d4 Removeshm (#90)
* eiger: moved rate correction outside, fixed threshold energy bug in client (binaries not  updated yet)

* removed dr and deadtiem from shm

* help for rx_status and status to point them to rx_Start, rx_stop, start and stop

* moved progress to receiver

* removed currentsettings from eiger shm

* updated server binaries, and client api

* moench and ctb virtual servers compile fix

* gui: moved acquire to a concurrent qt thread so it doesnt block updateplot
2020-04-06 10:44:44 +02:00
eeed102bf3 somewhere between fork and pipes, crashes at sendingudppacket at print 2020-04-03 20:18:16 +02:00
7c7f7e8c70 testing WIP 2020-04-03 16:20:05 +02:00
262b4b0b16 more tests 2020-03-31 18:19:32 +02:00
83010de9f4 updated all binaries, previous ones may not work 2020-03-31 16:58:35 +02:00
f2dd146e56 updates on servers (mainly virtual): indices, dbit clock not allowed for moench anymore 2020-03-31 16:54:35 +02:00
03af145ee8 test delay fix 2020-03-31 13:38:11 +02:00
043e62f9fd delay test 2020-03-31 13:35:04 +02:00
6289163ac8 virtual servers checked 2020-03-31 10:40:42 +02:00
3ba9e5ec22 eiger, jungfrau, ctb, moench, gotthard virtual servers checked 2020-03-30 18:24:42 +02:00
719157f5c3 python funcs 2020-03-30 14:59:08 +02:00
d58eb1dc6e Gappixels (#89)
* WIP

* WIP virtual delays, imagetest for saturation

* WIP, vertical and horizontal

* WIP

* gap pixels work, fixed 32 bit data out (10gbe=0) for virtual servers

* quad works (also in virtual), handling gappixels and quad

* jungfrau gapppixels work

* jungfrau: done

* complete image or missing packets given in json header and gui

* eiger virtual 4 bit mode bug fix

* working version of zmq add json header, except printout

* printout bug

* fix for json para

* to map WIP

* map done

* map print , mapwith result left

* json result works, testing added

* updated server binaries

* compiling on rhels7, variable size char array iniitalization

* zmqsocket parsing didnt need Document

* const to map, json para is strings not map

* json add header: mapping cleaner without insert make_pair
2020-03-30 14:54:35 +02:00
6a6af528ef testing WIP 2020-03-30 13:25:39 +02:00
112d120a89 testing WIP 2020-03-27 18:54:46 +01:00
8dfb55d476 testing 2020-03-27 17:00:14 +01:00
d488f4bea8 updated all receiver testing 2020-03-27 16:59:16 +01:00
58ab3c4123 gold linker 2020-03-27 08:22:24 +01:00
02d7381788 compile manuals 2020-03-26 18:42:01 +01:00
fb051355b8 moved string conversion to .cpp 2020-03-26 15:06:23 +01:00
4d8a63eee1 ToString of Result<map> 2020-03-26 14:10:06 +01:00
d0c3e006fb printing of std::map 2020-03-26 12:39:56 +01:00
f22f23849d minor 2020-03-26 11:56:38 +01:00
94bddb9908 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-03-24 12:03:59 +01:00
ed20e17c3a fixed bug in pedestal cloning and changed cluster finder file format- tested only for 3x3 2020-03-24 12:03:29 +01:00
8fc1578a5e added support for MSG_PEEK 2020-03-24 09:20:38 +01:00
9753d075f0 added headers to install 2020-03-24 09:06:36 +01:00
865b4e50ad Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-03-19 17:12:44 +01:00
597c359ef8 added overload signatures in python binding 2020-03-19 17:12:35 +01:00
a108a4df4c fixed also the moench oofline cluster finder 2020-03-19 15:42:24 +01:00
0a6b04ee76 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-03-19 15:25:33 +01:00
78dd96357d fixed slsDeetctorcalibration - including interpolation for rectangular pixels 2020-03-19 15:25:00 +01:00
9230182e35 rxr: dont update index if fwrite 0 2020-03-19 15:21:21 +01:00
8f7adb130f conflict fix 2020-03-19 14:07:33 +01:00
16d5321885 rx_hostname can be added with port and also concatenated 2020-03-19 14:06:16 +01:00
9a6f521f6a other replacements for string 2020-03-19 12:39:42 +01:00
dee0aea378 replace stoi with StringTo<int> 2020-03-19 12:33:13 +01:00
0e3cd00579 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-03-19 11:56:49 +01:00
6091271f37 somenthing on calibration 2020-03-19 11:41:55 +01:00
272a8bfaf1 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-03-19 11:36:44 +01:00
75692c3539 zmq server address copy warning fix 2020-03-19 11:36:32 +01:00
46e9b450c0 assume dec unless 0x 2020-03-19 11:09:20 +01:00
40c5ccfe37 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-03-19 10:30:15 +01:00
bf1b1a2d9e string conversion for uint 2020-03-19 10:30:05 +01:00
b608ec6fbd zmqsocket: fname to string to remove warning in copying maxstr in maxstr in json header 2020-03-19 10:24:08 +01:00
4813b5567a Minimal shared memory for receiver 2020-03-19 07:01:32 +01:00
8ab742c2b7 docs 2020-03-18 17:53:57 +01:00
cb8403f1b0 zmq 2020-03-18 12:38:06 +01:00
b751238fc1 ZmqSocket 2020-03-18 12:12:01 +01:00
5479d3a198 fix 2020-03-18 11:11:00 +01:00
e1768905dd build interface 2020-03-18 11:06:37 +01:00
775d0842e9 build interface 2020-03-18 11:00:54 +01:00
e7e201bd2a export and include 2020-03-18 10:20:01 +01:00
ec9f8305e9 not export gui 2020-03-18 08:41:25 +01:00
3307bfab1b fix 2020-03-17 19:11:29 +01:00
ce2c62000d include cmake in build 2020-03-17 18:57:19 +01:00
cf817c4ec1 WIP 2020-03-17 18:29:51 +01:00
bd01a5f2d2 cmake pkg 2020-03-16 19:36:18 +01:00
b059ba7c90 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-03-16 15:43:55 +01:00
89d70097f6 WIP 2020-03-16 15:43:46 +01:00
41d115a394 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-03-13 19:36:38 +01:00
45c1d3a553 gotthard2: burst mode fix for all the registers 2020-03-13 19:36:23 +01:00
17227be4df gotthard2: burst mode fix 2020-03-13 17:39:16 +01:00
7f4f8e8f09 help bug emax 2020-03-13 09:56:11 +01:00
6809bd6567 removed header 2020-03-12 12:38:00 +01:00
711d40a56e added sendToReceiver 2020-03-12 11:45:12 +01:00
81911fae3c new version of send to detector 2020-03-11 19:18:26 +01:00
f940397e3a cleaning 2020-03-11 18:10:37 +01:00
dc53887a48 minor clean 2020-03-11 17:49:32 +01:00
5784ce8231 slsDetector -> Module 2020-03-11 16:16:15 +01:00
012c66bbbf minor 2020-03-11 15:57:10 +01:00
3dbd6a33f7 removed genericSocket 2020-03-11 13:39:40 +01:00
0de0d82a1a replaced old logger 2020-03-11 12:40:12 +01:00
4aeb8bf62e introducing new logger 2020-03-11 10:54:55 +01:00
2acf64b09c gui changes (#87) 2020-03-11 10:08:30 +01:00
dea8cba985 changes from 4.2.0-rc: eiger check for max trimbits; end of eigerserver: if detector ip, set activate; update both control and stop server for activate 2020-03-10 16:49:08 +01:00
9467b4c610 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-03-10 16:25:15 +01:00
2cb09a590a gotthard2, mythen3: firmware type check added, others: minor print 2020-03-10 16:25:07 +01:00
5900403f20 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-03-10 16:10:09 +01:00
53749c3b77 clean 2020-03-10 16:09:59 +01:00
1d2f4a8af0 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-03-10 15:59:35 +01:00
df2512fb1c all servers: eiger, jungfrau, gotthard, ctb, moench, mythen3, gotthard2 updated 2020-03-10 15:57:27 +01:00
e4942a5c8d virtual servers warnings fixed 2020-03-10 15:53:44 +01:00
ac1c40d6f9 virtual servers: redundant declarations fixed 2020-03-10 15:50:33 +01:00
8ba0ef093e cmap 2020-03-10 15:50:14 +01:00
cb268aa43f cmap 2020-03-10 15:49:54 +01:00
5192dae9c5 removed virtual server warnings 2020-03-10 15:15:09 +01:00
d818e2570f clang-tidy nullptr 2020-03-10 15:06:51 +01:00
ee799b540a removed redundant includes etc. 2020-03-10 11:12:00 +01:00
ae3189d836 changed cxx to cpp 2020-03-10 10:28:27 +01:00
9ede0629ef clang format on gui 2020-03-10 10:18:52 +01:00
bd6529a64c warnings for virtual servers 2020-03-10 09:27:23 +01:00
758afad02c ctb, moench, eiger, gotthard: get number of channels for moench and ctb, others removed unnecessary variables in shm, added moench virtual sever (#86) 2020-03-10 09:08:08 +01:00
013836bea5 Merge pull request #85 from slsdetectorgroup/qwtifdef
Version defs and checking pointer before delete
2020-03-09 18:06:25 +01:00
de6808b170 Update CMakeLists.txt
qwt minimum 6.1
2020-03-09 18:05:27 +01:00
4c4ee3ae25 Merge pull request #83 from slsdetectorgroup/logger
New logger
2020-03-09 17:46:18 +01:00
0e171f291d added std::flush 2020-03-09 13:57:50 +01:00
bd47c969dd WIP 2020-03-09 12:49:24 +01:00
e4a86e544a WIP 2020-03-09 12:42:57 +01:00
a4fa9ff480 gui: scroll area uniquie pointers to remove mem leak 2020-03-06 19:44:44 +01:00
908afc790d jungfrau: new firmware version 2020-03-06 18:08:08 +01:00
d6e174ea11 jungfrau: adc phase changed again 2020-03-06 17:54:38 +01:00
f255becffe jungfrau: adcphase values nad dbit values done for new boards 2020-03-06 17:49:22 +01:00
0a596c689b sanitizer on, gui:removed qfuture, client: not implemented made specific as to what is not 2020-03-06 15:41:15 +01:00
a2e019ff36 moench: updated adcpipeline from 14 to 15 2020-03-06 10:47:21 +01:00
959d62ed66 moench: default clocks and phase are same as ctb at startup 2020-03-05 18:03:53 +01:00
1d2a46cdbe moench:dsamples=0 at startup 2020-03-05 17:13:58 +01:00
aeb9ddfe62 moench:dbit clock updated to 40 2020-03-05 17:10:37 +01:00
4a802bd2e4 gotthard2: switching between continuous to burst mode (burstperiod got reset: fixed) 2020-03-05 16:35:52 +01:00
c2639854fa ctb gui works with moench detector 2020-03-05 14:53:24 +01:00
dec4d00fbf ctb: gui call back fix 2020-03-05 11:31:36 +01:00
e3f9ef0b25 moench and eiger updated as well 2020-03-05 10:24:59 +01:00
9ca86c2edb ctb, gotthard, gotthard2, jungfrau, mythen updated 2020-03-05 10:21:24 +01:00
c64b09ee79 Jungfraufix (#84)
* jungfrau: added dbitphase, different pll clkindex 0 with different wr bit
2020-03-04 17:06:18 +01:00
c6ddd19c0f WIP 2020-03-04 15:38:21 +01:00
661adaf4ed WIP 2020-03-04 15:25:49 +01:00
4e2f685b76 gotthard2: gain plot fix with clones 2020-03-04 14:39:44 +01:00
6e4a3353a3 moench: removed commented out settings 2020-03-04 13:53:28 +01:00
042e5715e6 conflict fix 2020-03-04 13:51:58 +01:00
e143204ce1 Corrected settings and patter for moench detector 2020-03-04 13:33:42 +01:00
ff9c37701b WIP 2020-03-04 12:35:41 +01:00
5f3af794ce moench bug fix: power chip enable 2020-03-04 12:34:32 +01:00
e7df925d6b moench sample config file in examples 2020-03-04 11:32:11 +01:00
7859cf78e9 moench: allow power chip 2020-03-04 10:41:10 +01:00
1b996d1703 revised gain plot; updated version api 2020-03-04 10:25:38 +01:00
2fcb41426a Merge pull request #82 from slsdetectorgroup/moenchUpdated
Moench updated
2020-03-04 10:22:09 +01:00
032475fc14 gainplot clone revised 2020-03-04 10:17:51 +01:00
5430288ce8 merge fix 2020-03-03 17:57:55 +01:00
a61c5e0206 Merge pull request #81 from slsdetectorgroup/readme
Updated readme
2020-03-03 17:56:05 +01:00
582a3c6878 Update README.md 2020-03-03 17:55:16 +01:00
134611c638 gotthard2: switching between period and burst period (not delay and burst period), internal frequency depending on timing source (for all except actualtime and measurement time) 2020-03-03 17:49:28 +01:00
3431752649 WIP 2020-03-03 17:01:45 +01:00
06bd6dfd53 Merge branch 'developer' into moenchUpdated 2020-03-03 16:37:31 +01:00
fca7d51cb4 moench: removed hardcoding ny in call back for gui 2020-03-03 16:30:28 +01:00
85aca0ffad moench: insignficant dac naming fix 2020-03-03 16:21:45 +01:00
fac95516cf moench: insignficant naming fix 2020-03-03 16:07:37 +01:00
8abc32e7f1 moench: default pattern file in server, settings, tests 2020-03-03 16:00:01 +01:00
1efacc9475 cleaning up headers 2020-03-03 11:33:28 +01:00
b2d88b441a removed comments 2020-03-03 11:17:26 +01:00
75e083ae46 find tests and commands 2020-03-03 11:04:05 +01:00
9699e064d3 WIP 2020-03-03 10:12:26 +01:00
c6c3a68520 WIP 2020-03-03 10:08:20 +01:00
5e92c5b67e WIP 2020-03-03 09:38:05 +01:00
0947cefe08 WIP 2020-03-03 09:29:25 +01:00
6bbcf6173d moench: first version 2020-03-02 18:34:10 +01:00
ecc3b36204 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-03-02 14:50:48 +01:00
3e88beb8a5 O3 as default and option for mtune 2020-03-02 13:50:16 +01:00
cce659d98c deploy only on tags 2020-03-02 13:12:46 +01:00
95d56ad545 lookup 2020-03-02 11:57:35 +01:00
84cd4d8436 generated python funcs 2020-03-02 11:34:30 +01:00
d7319968a7 gui: always show gain plots, include intensity ticks(2d), channels number and gain ticks(1d) 2020-02-28 17:28:44 +01:00
a769f7515c gotthard2 bug fix: fixed pll freq was incorrect when 0 in front 2020-02-28 16:03:15 +01:00
11e7737a2f gotthard2: timingsource and currentsource features, (timing source external yet to be implemented in fpga to test (#80) 2020-02-28 12:45:02 +01:00
913df8ecae Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-02-28 12:26:48 +01:00
c10e04c4eb explicitly setting rx zmq datastream int the ctb Gui 2020-02-28 12:25:48 +01:00
2e2e91b219 ctb adc: get in uV and print in client in mV to get decimals 2020-02-27 15:43:42 +01:00
10ba16a9dc updating versions 2020-02-27 14:26:18 +01:00
8c8032dc69 ctb bug fix: slow adcs incorrect mv read out, needed clk down and usleep before reading 2020-02-27 09:16:22 +01:00
90acd51389 server api changes: for mythen3, jungfrau, eiger as well 2020-02-26 17:52:35 +01:00
f38ed8706f removing gui warnings from qwt section 2020-02-26 16:56:41 +01:00
300b0c8105 Merge pull request #79 from slsdetectorgroup/bursts
Bursts
2020-02-26 11:29:05 +01:00
d9cfc59df6 code refactor in slsdet: prevval for setnumtriggers 2020-02-26 11:27:24 +01:00
80304c2eaf multi progress calculated in one function rather getting all of them from shm 2020-02-26 11:17:49 +01:00
fe3a7b0faf gotthard2: removed unnecessary casting 2020-02-26 11:02:28 +01:00
e66d42a43d old form fix 2020-02-26 10:28:45 +01:00
ec76590f28 Merge branch 'developer' into bursts 2020-02-26 09:29:18 +01:00
2fcb2bff75 dac tests 2020-02-26 09:29:06 +01:00
2310b5e55d Merge branch 'developer' into bursts 2020-02-25 20:03:18 +01:00
dca2d098a9 gui: hide gain legend 2020-02-25 20:03:09 +01:00
462bc2e70c Merge branch 'developer' into bursts 2020-02-25 18:22:58 +01:00
2da3d179ee gotthard2 gain plot in gui 2020-02-25 18:22:18 +01:00
5e6a3b7e3d merge resolved 2020-02-25 15:48:41 +01:00
6a0a931e3e gotthard2: bursts and burst period, written to same register as triggers and delay (kept in server as variables) and set if conditions meet. bursts and burst period only in auto timing and burst mode. Also updating theses registers when switching between timing modes or burst modes 2020-02-25 15:45:40 +01:00
2bec476b4f fixed failed tests 2020-02-25 09:26:57 +01:00
f902bb06ad gui bug fix: trigger timing mode was disconnected 2020-02-24 17:40:00 +01:00
c03bc4a6b4 gotthard2: copy #frames and period when switching between continuous and burst mode 2020-02-24 17:20:51 +01:00
6118567959 gotthard2 gui bug fix: gainbit not masked out 2020-02-24 17:04:37 +01:00
02b367ffe8 mythen3 and gotthard2: updated clocks 2020-02-24 16:50:47 +01:00
87d48fd943 bugfix rxr numpacketscaught if stopped 2020-02-24 15:02:01 +01:00
21a1b872bf bugfix:mythen3 date change 2020-02-24 11:00:16 +01:00
3a74ca8fc2 bugfix: mythen3 git date incorrect 2020-02-24 10:53:06 +01:00
f4b922165f bugfix from earlier commit: dr in readfromreceiver commented out 2020-02-24 10:36:52 +01:00
247d40f5a6 added Zmq image structures 2020-02-21 11:56:44 +01:00
8953235268 reverted to UdpRxSocket.h version of revision fc27cfd (with gcc problem fixed) 2020-02-21 11:07:24 +01:00
3b84684415 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-02-18 18:26:19 +01:00
d0da5d3fcd update manual 2020-02-18 18:26:11 +01:00
52a89cbcc5 fix for older gcc 2020-02-18 17:54:28 +01:00
d8c9748850 update manual to 4.1.1 2020-02-18 15:49:00 +01:00
f42e87e37f format 2020-02-18 15:03:02 +01:00
53a3656d5e removed copy, fixed receive to external buffer 2020-02-18 15:02:40 +01:00
fc27cfd663 merging problem 2020-02-18 10:55:41 +01:00
6b0bf02a85 Some fixes to use moench 2020-02-18 10:45:53 +01:00
f1bce15a57 replaced udp socket 2020-02-17 17:43:14 +01:00
3ea9b86bf5 date fix 2020-02-13 14:50:23 +01:00
4cce0aee62 Fixed ctbGui to work also with moench03 2020-02-06 14:28:20 +01:00
dfb1b9ad69 Revert "gotthard2: burst mode check"
This reverts commit 4d6996bd55.
2020-02-04 15:29:43 +01:00
4d6996bd55 gotthard2: burst mode check 2020-02-04 15:28:24 +01:00
0ac28c0208 gotthard2: burst mode check for #frames 2020-02-04 15:27:18 +01:00
37c3048c2a gotthard2: bug fix from previosu commit 2020-02-04 12:32:37 +01:00
d3dc9a7690 gotthard2: disentangled burst mode #frames, exptime, period from start of acquisition, order dependent now for debugging 2020-02-04 12:23:58 +01:00
c4559fadb3 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-02-04 12:00:15 +01:00
806a2736c1 gotthard2: longer wait for startup, period 0 2020-02-04 12:00:07 +01:00
427 changed files with 65471 additions and 55048 deletions

View File

@ -3,4 +3,5 @@ IndentWidth: 4
UseTab: Never
ColumnLimit: 80
AlignConsecutiveAssignments: false
AlignConsecutiveAssignments: false
AlignConsecutiveMacros: true

View File

@ -17,7 +17,8 @@ Checks: '*,
-google-runtime-references,
-google-readability-todo,
-google-readability-braces-around-statements,
-modernize-use-trailing-return-type'
-modernize-use-trailing-return-type,
-readability-isolate-declaration'
HeaderFilterRegex: \.h
AnalyzeTemporaryDtors: false

60
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,60 @@
---
name: Bug Report
about: Create a report to help us improve
title: New Bug Report
labels: action - Bug, priority - Unclassified, status - Pending
template: bug_report.md
---
<!-- Check an option by - [x], Uncheck an option by - [ ] -->
<!-- Please preview to see your option has been selected -->
<!-- Please fill out everything with an *, as this report will be discarded otherwise -->
##### *Distribution:
- [x] RHEL7
- [ ] RHEL6
- [ ] Fedora
- [ ] Other
##### *Detector type:
- [x] Not applicable
- [ ] Eiger
- [ ] Jungfrau
- [ ] Mythen3
- [ ] Gotthard2
- [ ] Gotthard
- [ ] Moench
- [ ] ChipTestBoard
##### *Software Package Version:
- [ ] developer
- [ ] 4.2.0
- [ ] 4.1.1
<!-- If others, please describe -->
##### Priority:
- [ ] Super Low
- [ ] Low
- [ ] Medium
- [ ] High
- [ ] Super High
##### *Describe the bug
<!-- A clear and concise description of what the bug is -->
##### Expected behavior
<!-- A clear and concise description of what you expected to happen. -->
##### To Reproduce
<!-- Steps to reproduce the behavior: -->
<!-- 1. Go to '...' -->
<!-- 2. Click on '....' -->
<!-- 3. Scroll down to '....' -->
<!-- 4. See error -->
##### Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->
##### Additional context
<!-- Add any other context about the problem here. -->

View File

@ -0,0 +1,44 @@
---
name: Change Request
about: Suggest a change to an existing feature
title: New Change Request
labels: action - Change, priority - Unclassified, status - Pending
template: change_request.md
---
<!-- Check an option by - [x], Uncheck an option by - [ ] -->
<!-- Please preview to see your option has been selected -->
<!-- Please fill out everything with an *, as this report will be discarded otherwise -->
##### *Detector type:
- [x] Not applicable
- [ ] Eiger
- [ ] Jungfrau
- [ ] Mythen3
- [ ] Gotthard2
- [ ] Gotthard
- [ ] Moench
- [ ] ChipTestBoard
##### *Software Package Version:
- [ ] developer
- [ ] 4.2.0
- [ ] 4.1.1
<!-- If others, please describe -->
##### Priority:
- [ ] Super Low
- [ ] Low
- [ ] Medium
- [ ] High
- [ ] Super High
##### *State the change request:
<!-- A clear and concise description of what the change is to an existing feature -->
##### Is your change request related to a problem. Please describe:
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
##### Additional context:
<!-- Add any other context about the feature here -->

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1 @@
blank_issues_enabled: false

View File

@ -0,0 +1,50 @@
---
name: Feature Request
about: Suggest a feature
title: New Feature Request
labels: action - Enhancement, priority - Unclassified, status - Pending
template: feature_request.md
---
<!-- Check an option by - [x], Uncheck an option by - [ ] -->
<!-- Please preview to see your option has been selected -->
<!-- Please fill out everything with an *, as this report will be discarded otherwise -->
##### *Detector type:
- [x] Not applicable
- [ ] Eiger
- [ ] Jungfrau
- [ ] Mythen3
- [ ] Gotthard2
- [ ] Gotthard
- [ ] Moench
- [ ] ChipTestBoard
##### *Software Package Version:
- [ ] developer
- [ ] 4.2.0
- [ ] 4.1.1
<!-- If others, please describe -->
##### Priority:
- [ ] Super Low
- [ ] Low
- [ ] Medium
- [ ] High
- [ ] Super High
##### *State the feature:
<!-- A clear and concise description of what the feature is -->
##### Is your feature request related to a problem. Please describe:
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
##### Describe the solution you'd like:
<!-- A clear and concise description of what you want to happen -->
##### Describe alternatives you've considered:
<!-- A clear and concise description of any alternative solutions or features you've considered -->
##### Additional context:
<!-- Add any other context about the feature here -->

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ bin/
*.out
*.toc
*.o
*.so
.*
build
RELEASE.txt

View File

@ -4,39 +4,25 @@ language: cpp
os: linux
env:
matrix:
- CONDA_PY=3.6
- CONDA_PY=3.7
- CONDA_PY=3.8
dist: trusty
dist: bionic
install:
- sudo apt-get update
- ldd --version
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- source "$HOME/miniconda/etc/profile.d/conda.sh"
- rm -f miniconda.sh
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda config --add channels conda-forge
- conda config --add channels slsdetectorgroup
- conda update conda
- conda update --all
- conda install conda-build=3.17
- conda install anaconda-client
- conda install conda-verify
# Useful for debugging any issues with conda
- conda update -q conda
- conda info -a
# Replace dep1 dep2 ... with your dependencies
- conda create -q -n test-environment python=$CONDA_PY
- source activate test-environment
# Useful for debugging any issues with conda
- conda create -q -n testenv conda-build anaconda-client conda-verify
- conda activate testenv
- conda-build .
script:
@ -45,7 +31,8 @@ script:
deploy:
provider: script
script: find $HOME/miniconda/conda-bld/${TRAVIS_OS_NAME}-64 -name "*.tar.bz2" -exec anaconda -t $CONDA_TOKEN upload --force {} \;
script: find $HOME/miniconda/envs/testenv/conda-bld/${TRAVIS_OS_NAME}-64 -name "*.tar.bz2" -exec anaconda -t $CONDA_TOKEN upload --force {} \;
on:
branch: developer
tags: true

View File

@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.12)
project(slsDetectorPackage)
set(PROJECT_VERSION 5.0.0)
include(CheckIPOSupported)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
cmake_policy(SET CMP0074 NEW)
include(cmake/project_version.cmake)
@ -44,6 +44,36 @@ option(SLS_USE_PYTHON "Python bindings" OFF)
option(SLS_USE_CTBGUI "ctb GUI" OFF)
option(SLS_BUILD_DOCS "docs" OFF)
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)
# set(ClangFormat_BIN_NAME clang-format)
set(ClangFormat_EXCLUDE_PATTERNS "build/"
"libs/"
"slsDetectorCalibration/"
"ctbGui/"
"manual/"
"python/"
"sample/"
${CMAKE_BINARY_DIR})
find_package(ClangFormat)
#Enable LTO if available
check_ipo_supported(RESULT SLS_LTO_AVAILABLE)
# Use ld.gold if it is available and isn't disabled explicitly
option(SLS_USE_LD_GOLD "Use GNU gold linker" ON)
if (SLS_USE_LD_GOLD)
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if ("${LD_VERSION}" MATCHES "GNU gold")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
else ()
message(WARNING "GNU gold linker isn't available, using the default system linker.")
endif ()
endif ()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
@ -67,6 +97,7 @@ target_compile_options(slsProjectWarnings INTERFACE
-Wformat=2
-Wredundant-decls
# -Wconversion
-Wvla
-Wdouble-promotion
-Werror=return-type
@ -111,6 +142,11 @@ if(SLS_USE_SANITIZER)
# target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread)
endif()
if(SLS_TUNE_LOCAL)
target_compile_options(slsProjectOptions INTERFACE -mtune=native -march=native)
endif()
#rapidjson
add_library(rapidjson INTERFACE)
target_include_directories(rapidjson INTERFACE
@ -126,7 +162,7 @@ install(TARGETS slsProjectOptions slsProjectWarnings rapidjson
)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INSTALL_RPATH "$ORIGIN")
set(CMAKE_INSTALL_RPATH $ORIGIN)
# set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
@ -159,7 +195,7 @@ endif (SLS_USE_RECEIVER)
if (SLS_USE_GUI)
find_package(Qt4 REQUIRED)
find_package(Qwt 6 REQUIRED)
find_package(Qwt 6.1 REQUIRED)
if (QT4_FOUND AND QWT_FOUND)
add_subdirectory(slsDetectorGui)
endif()
@ -174,6 +210,7 @@ if (SLS_USE_INTEGRATION_TESTS)
endif (SLS_USE_INTEGRATION_TESTS)
if (SLS_USE_PYTHON)
set(PYBIND11_CPP_STANDARD -std=c++11)
add_subdirectory(libs/pybind11)
add_subdirectory(python)
endif(SLS_USE_PYTHON)
@ -195,10 +232,13 @@ if(SLS_BUILD_DOCS)
endif(SLS_BUILD_DOCS)
if(SLS_USE_MOENCH)
add_subdirectory(slsDetectorCalibration/moenchExecutables)
endif(SLS_USE_MOENCH)
if(SLS_MASTER_PROJECT)
# Set install dir CMake packages
set(CMAKE_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/cmake/sls)
set(CMAKE_INSTALL_DIR "share/cmake/${PROJECT_NAME}")
# Set the list of exported targets
set(PROJECT_LIBRARIES slsSupportLib slsDetectorShared slsReceiverShared)
# Generate and install package config file and version

113
README.md
View File

@ -2,90 +2,67 @@
Detailed documentation can be found on the [official site.](https://www.psi.ch/detectors/users-support)
### Binaries
Documentation to obtain the binaries via the conda package is available for [lib](https://github.com/slsdetectorgroup/sls_detector_lib) and [gui](https://github.com/slsdetectorgroup/sls_detector_gui)
Binaries for the slsDetectorPackage are available through conda.
```
#Add conda channels
conda config --add channels conda-forge
conda config --add channels slsdetectorgroup
conda install slsdetlib #only shared lib and command line
conda install slsdet #python bindings (includes slsdetlib)
conda install slsdetgui #gui (includes qt4)
#Install specific version
conda install slsdet=2020.03.02.dev0 #developer version from 3 March 2020
```
### Source code
One can also obtain the source code from this repository and compile while realizing the setup dependencies as required.
One can also obtain the source code from this repository and compile.
```
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git
```
#### Setup dependencies
* Gui Client <br>
Requirements: Qt 4.8 and Qwt 6.0
```
export QTDIR=/usr/local/Trolltech/
export QWTDIR=/usr/local/qwt-6.0.1/
```
If either of them does not exist, the GUI client will not be built.
#### Dependencies
* Lib: c++11 compiler (gcc=>4.8), ZeroMQ 4
* Gui: Qt 4.8 and Qwt 6.0
* Calibration wizards and ctbGUI: ROOT
* Optional: HDF5
* Advanced user Calibration wizards<br>
Requirements: ROOT
```
export ROOTSYS=/usr/local/root-5.34
```
#### Compilation
Compiling can be done in two ways.
Compiling can be done in two ways. Either with the convenience script
cmk.sh or directly with cmake for more control.
**1. Compile using script cmk.sh**<br>
After compiling, the libraries and executables will be found in `slsDetectorPackage/build/bin` directory<br>
Usage: [-c] [-b] [-h] [-d HDF5 directory] [-j]<br>
* -[no option]: only make<br>
* -c: Clean<br>
* -b: Builds/Rebuilds CMake files normal mode<br>
* -h: Builds/Rebuilds Cmake files with HDF5 package<br>
* -d: HDF5 Custom Directory<br>
* -t: Build/Rebuilds only text client<br>
* -r: Build/Rebuilds only receiver<br>
* -g: Build/Rebuilds only gui<br>
* -j: Number of threads to compile through<br>
* -e: Debug mode
Basic Option:
./cmk.sh -b
For only make:
./cmk.sh
For make clean;make:
./cmk.sh -c
For using hdf5 without custom dir /blabla:
./cmk.sh -h -d /blabla
For rebuilding cmake without hdf5
./cmk.sh -b
For using multiple cores to compile faster:
./cmk.sh -j9<br>
For rebuilding only certain sections<br>
./cmk.sh -tg #only text client and gui<br>
./cmk.sh -r #only receiver<br>
Usage: [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [-h] [-d <HDF5 directory>] [-j] <Number of threads>
-[no option]: only make
-c: Clean
-b: Builds/Rebuilds CMake files normal mode
-p: Builds/Rebuilds Python API
-h: Builds/Rebuilds Cmake files with HDF5 package
-d: HDF5 Custom Directory
-t: Build/Rebuilds only text client
-r: Build/Rebuilds only receiver
-g: Build/Rebuilds only gui
-s: Simulator
-u: Chip Test Gui
-j: Number of threads to compile through
-e: Debug mode
-i: Builds tests
eg. Rebuild when you switch to a new build and compile in parallel:
./cmk.sh -bj5
**2. Compile without script**<br>
Use cmake to create out-of-source builds, by creating a build folder parallel to source directory.
Use cmake to create out-of-source builds, by creating a build folder parallel to source directory. This would create a debug build with address sanitizers.
```
$ cd ..
$ mkdir slsDetectorPackage-build
$ cd slsDetectorPackage-build
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=OFF
$ make
```
Use the following as an example to compile statically and using specific hdf5 folder
```
$ HDF5_ROOT=/opt/hdf5v1.10.0 cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=ON
```
After compiling, the libraries and executables will be found at `bin` directory
```
$ ls bin/
gui_client libSlsDetector.a libSlsDetector.so libSlsReceiver.a libSlsReceiver.so
sls_detector_acquire sls_detector_get slsDetectorGui sls_detector_help sls_detector_put slsReceiver slsMultiReceiver
$ mkdir build
$ cd build
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON
$ make -j12 #or whatever number of threads wanted
```

View File

@ -0,0 +1,39 @@
# Find Clang format
if(NOT ClangFormat_BIN_NAME)
set(ClangFormat_BIN_NAME clang-format)
endif()
# if custom path check there first
if(ClangFormat_ROOT_DIR)
find_program(ClangFormat_BIN
NAMES
${ClangFormat_BIN_NAME}
PATHS
"${ClangFormat_ROOT_DIR}"
NO_DEFAULT_PATH)
endif()
find_program(ClangFormat_BIN NAMES ${ClangFormat_BIN_NAME})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
ClangFormat
DEFAULT_MSG
ClangFormat_BIN)
mark_as_advanced(
ClangFormat_BIN)
if(ClangFormat_FOUND)
exec_program(${ClangFormat_BIN} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version 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
message(STATUS "found clang-format \"${CLANG_VERSION}\" adding formatting targets")
include(clang-format)
else()
message(STATUS "clang-format version \"${CLANG_VERSION}\" found but need at least 9. Not setting up format targets")
endif()
else()
message(STATUS "clang-format not found. Not setting up format targets")
endif()

47
cmake/clang-format.cmake Normal file
View File

@ -0,0 +1,47 @@
# A CMake script to find all source files and setup clang-format targets for them
# Find all source files
set(ClangFormat_CXX_FILE_EXTENSIONS ${ClangFormat_CXX_FILE_EXTENSIONS} *.cpp *.h *.cxx *.hxx *.hpp *.cc *.ipp *.c)
file(GLOB_RECURSE ALL_SOURCE_FILES ${ClangFormat_CXX_FILE_EXTENSIONS})
# Don't include some common build folders
set(ClangFormat_EXCLUDE_PATTERNS ${ClangFormat_EXCLUDE_PATTERNS} "/CMakeFiles/" "cmake")
# get all project files file
foreach (SOURCE_FILE ${ALL_SOURCE_FILES})
foreach (EXCLUDE_PATTERN ${ClangFormat_EXCLUDE_PATTERNS})
string(FIND ${SOURCE_FILE} ${EXCLUDE_PATTERN} EXCLUDE_FOUND)
if (NOT ${EXCLUDE_FOUND} EQUAL -1)
list(REMOVE_ITEM ALL_SOURCE_FILES ${SOURCE_FILE})
endif ()
endforeach ()
endforeach ()
#target for formatting soruce files
add_custom_target(format
COMMENT "Running clang-format to change files"
COMMAND ${ClangFormat_BIN}
-style=file
-i
${ALL_SOURCE_FILES}
)
#target to check format on source files
add_custom_target(format-check
COMMENT "Checking clang-format changes"
# Use ! to negate the result for correct output
COMMAND !
${ClangFormat_BIN}
-style=file
-output-replacements-xml
${ALL_SOURCE_FILES}
| grep -q "replacement offset"
)
# debug to check which file will be formatted
add_custom_target(
listformatfiles
COMMAND
echo ${ALL_SOURCE_FILES}
)

View File

@ -15,17 +15,20 @@ configure_package_config_file(
write_basic_package_version_file(
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)
COMPATIBILITY SameMajorVersion
)
install(FILES
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
COMPONENT devel
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER})
DESTINATION ${CMAKE_INSTALL_DIR}
)
if (PROJECT_LIBRARIES OR PROJECT_STATIC_LIBRARIES)
install(
EXPORT "${TARGETS_EXPORT_NAME}"
FILE ${PROJECT_NAME_LOWER}-targets.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER})
DESTINATION ${CMAKE_INSTALL_DIR}
)
endif ()

42
cmk.sh
View File

@ -11,6 +11,8 @@ PYTHON=0
TESTS=0
SIMULATOR=0
CTBGUI=0
MANUALS=0
MOENCHZMQ=0
CLEAN=0
@ -19,7 +21,7 @@ CMAKE_PRE=""
CMAKE_POST=""
usage() { echo -e "
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [-h] [-d <HDF5 directory>] [-j] <Number of threads>
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [-h] [z] [-d <HDF5 directory>] [-j] <Number of threads>
-[no option]: only make
-c: Clean
-b: Builds/Rebuilds CMake files normal mode
@ -34,6 +36,8 @@ Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [-h] [-d <HDF5 directory>]
-j: Number of threads to compile through
-e: Debug mode
-i: Builds tests
-m: Manuals
-z: Moench zmq processor
Rebuild when you switch to a new build and compile in parallel:
./cmk.sh -bj5
@ -69,7 +73,7 @@ For rebuilding only certain sections
" ; exit 1; }
while getopts ":bpchd:j:trgeisu" opt ; do
while getopts ":bpchd:j:trgeisumz" opt ; do
case $opt in
b)
echo "Building of CMake files Required"
@ -124,6 +128,14 @@ while getopts ":bpchd:j:trgeisu" opt ; do
echo "Compiling Options: Simulator"
SIMULATOR=1
;;
m)
echo "Compiling Manuals"
MANUALS=1
;;
z)
echo "Compiling Moench Zmq Processor"
MOENCHZMQ=1
;;
u)
echo "Compiling Options: Chip Test Gui"
CTBGUI=1
@ -187,8 +199,8 @@ fi
#Debug
if [ $DEBUG -eq 1 ]; then
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
# CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON "
# CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON "
echo "Debug Option enabled"
fi
@ -198,6 +210,18 @@ if [ $SIMULATOR -eq 1 ]; then
echo "Simulator Option enabled"
fi
#Manuals
if [ $MANUALS -eq 1 ]; then
CMAKE_POST+=" -DSLS_BUILD_DOCS=ON "
echo "Manuals Option enabled"
fi
#Moench zmq processor
if [ $MOENCHZMQ -eq 1 ]; then
CMAKE_POST+=" -DSLS_USE_MOENCH=ON "
echo "Moench Zmq Processor Option enabled"
fi
#Chip Test Gui
if [ $CTBGUI -eq 1 ]; then
CMAKE_POST+=" -DSLS_USE_CTBGUI=ON "
@ -247,8 +271,18 @@ if [ $COMPILERTHREADS -gt 0 ]; then
BUILDCOMMAND="make -j$COMPILERTHREADS"
echo $BUILDCOMMAND
eval $BUILDCOMMAND
if [ $MANUALS -eq 1 ]; then
BUILDCOMMAND="make docs -j$COMPILERTHREADS"
echo $BUILDCOMMAND
eval $BUILDCOMMAND
fi
else
echo "make"
make
if [ $MANUALS -eq 1 ]; then
echo "make docs"
make docs
fi
fi

View File

@ -1,3 +1,4 @@
mkdir build
mkdir install
cd build
@ -6,7 +7,7 @@ cmake .. \
-DCMAKE_INSTALL_PREFIX=install \
-DSLS_USE_TEXTCLIENT=ON \
-DSLS_USE_RECEIVER=ON \
-DSLS_USE_GUI=OFF \
-DSLS_USE_GUI=ON \
-DSLS_USE_TESTS=ON \
-DSLS_USE_PYTHON=OFF \
-DCMAKE_BUILD_TYPE=Release \

View File

@ -1,14 +1,4 @@
# mkdir $PREFIX/lib
# mkdir $PREFIX/include
# #Shared and static libraries
# cp build/bin/_sls_detector* $PREFIX/lib/.
# #Binaries
# cp -r build/bin/sls_detector $PREFIX/lib/.
echo "|<-------- starting python build"
cd python
${PYTHON} setup.py install
${PYTHON} setup.py install

View File

@ -0,0 +1,7 @@
python:
- 3.6
- 3.7
- 3.8
numpy:
- 1.17

View File

@ -0,0 +1,9 @@
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,15 +1,3 @@
mkdir $PREFIX/lib
#Copy the GUI
mkdir $PREFIX/bin
mkdir $PREFIX/include
#No libs for gui?
#Binaries
cp build/bin/gui_client $PREFIX/bin/.
cp build/bin/slsDetectorGui $PREFIX/bin/.
#Which headers do we need for development??
# cp include/some_lib.h $PREFIX/include/.

View File

@ -5,18 +5,20 @@ mkdir $PREFIX/include
mkdir $PREFIX/include/slsDetectorPackage
#Shared and static libraries
cp build/bin/libSlsDetector.so $PREFIX/lib/.
cp build/bin/libSlsReceiver.so $PREFIX/lib/.
cp build/bin/libSlsSupport.so $PREFIX/lib/.
# cp build/bin/libSlsDetector.so $PREFIX/lib/.
# cp build/bin/libSlsReceiver.so $PREFIX/lib/.
# cp build/bin/libSlsSupport.so $PREFIX/lib/.
cp build/install/lib/* $PREFIX/lib/
#Binaries
cp build/bin/sls_detector_acquire $PREFIX/bin/.
cp build/bin/sls_detector_get $PREFIX/bin/.
cp build/bin/sls_detector_put $PREFIX/bin/.
cp build/bin/sls_detector_help $PREFIX/bin/.
cp build/bin/slsReceiver $PREFIX/bin/.
cp build/bin/slsMultiReceiver $PREFIX/bin/.
cp build/install/bin/sls_detector_acquire $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/slsReceiver $PREFIX/bin/.
cp build/install/bin/slsMultiReceiver $PREFIX/bin/.
#Which headers do we need for development??
cp build/install/include/* $PREFIX/include/slsDetectorPackage/
# cp include/some_lib.h $PREFIX/include/.
cp build/install/include/* $PREFIX/include/
cp -r build/install/share/ $PREFIX/share

View File

@ -1,13 +1,14 @@
package:
name: sls_detector_software
version: "developer"
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
source:
- path: ..
build:
number: 1
number: 0
binary_relocation: True
rpaths:
- lib/
@ -16,10 +17,9 @@ requirements:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- cmake
# - qwt 6.* #require qt5 investigate befor activating gui
# - qt=4.8.7=7
- zeromq=4.2.5=hfc679d8_5
- pyzmq
- qwt 6.*
- qt 4.8.*
- zeromq
- xorg-libx11
- xorg-libice
- xorg-libxext
@ -37,6 +37,7 @@ requirements:
host:
- libstdcxx-ng
- libgcc-ng
- zeromq
- xorg-libx11
- xorg-libice
- xorg-libxext
@ -46,75 +47,52 @@ requirements:
- xorg-libxfixes
run:
- zeromq
- libstdcxx-ng
- libgcc-ng
outputs:
- name: sls_detector_lib
- name: slsdetlib
script: copy_lib.sh
- name: sls_detector
requirements:
run:
- libstdcxx-ng
- libgcc-ng
- zeromq
- name: slsdet
script: build_pylib.sh
requirements:
build:
- python
- {{ compiler('c') }}
- {{compiler('cxx')}}
- python {{ python }}
- {{ pin_subpackage('slsdetlib', exact=True) }}
- setuptools
- sls_detector_lib
- pyzmq
- pybind11 2.4
host:
- python
- pybind11 2.4
- pyzmq
- sls_detector_lib
run:
- libstdcxx-ng
- libgcc-ng
run:
- python
- numpy
- sls_detector_lib=developer
- pyzmq
- libstdcxx-ng
- libgcc-ng
- {{ pin_subpackage('slsdetlib', exact=True) }}
test:
imports:
- sls_detector
- slsdet
# requirements:
# build:
# - {{ compiler('c') }}
# - {{compiler('cxx')}}
# - name: sls_detector_gui
# version: "refactor"
# script: copy_gui.sh
# requirements:
# build:
# - {{ compiler('c') }}
# - {{compiler('cxx')}}
# - cmake
# - qwt 6.*
# - qt=4.8.7=7
# - zeromq=4.2.5=hfc679d8_5
# - pyzmq
# - 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]
# run:
# - sls_detector_lib=refactor
# - qwt 6.*
# - qt=4.8.7=7
- name: slsdetgui
script: copy_gui.sh
requirements:
run:
- {{ pin_subpackage('slsdetlib', exact=True) }}
- qwt 6.*
- qt 4.8.*

View File

@ -71,6 +71,11 @@ target_link_libraries(ctbRootLib PUBLIC
${ROOT_EXE_LINKER_FLAGS}
)
set_target_properties(
ctbRootLib PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
target_link_libraries(ctbGui PUBLIC
slsDetectorShared
slsSupportLib
@ -80,4 +85,5 @@ target_link_libraries(ctbGui PUBLIC
set_target_properties(ctbGui PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)

View File

@ -29,9 +29,10 @@
#include "sls_detector_defs.h"
#include "ctbMain.h"
#include "moench03CtbData.h"
#include "moench03TCtbData.h"
#include "moench03T1CtbData.h"
//#include "moench03TCtbData.h"
//#include "moench03T1CtbData.h"
#include "moench03CommonMode.h"
#include "moench03T1ZmqDataNew.h"
#include "moench02CtbData.h"
//#include "jungfrau10ModuleData.h"
#include "moenchCommonMode.h"
@ -43,6 +44,9 @@
#include "moench04CtbZmq10GbData.h"
#include "deserializer.h"
#include "detectorData.h"
#include "imageZmq16bit.h"
#include "imageZmq32bit.h"
using namespace std;
@ -232,7 +236,10 @@ hframe=new TGHorizontalFrame(this, 800,50);
cbDetType->AddEntry("MOENCH02", MOENCH02);
cbDetType->AddEntry("MOENCH04", MOENCH04);
// cbDetType->AddEntry("JUNGFRAU1.0", 2);
//cbDetType->AddEntry("MOENCH03 T", iiii++);
cbDetType->AddEntry("MOENCH03",MOENCH03);
cbDetType->AddEntry("IMAGE32BIT",IMAGE32B);
cbDetType->AddEntry("IMAGE16BIT",IMAGE16B);
//cbDetType->AddEntry("MOENCH03", iiii++);
// cbDetType->AddEntry("MYTHEN3 0.1", MYTHEN301);
// cbDetType->AddEntry("ADCSAR2", ADCSAR2);
@ -271,7 +278,7 @@ hframe=new TGHorizontalFrame(this, 800,50);
cout << "off "<< endl;
// cout << "off "<< endl;
hframe=new TGHorizontalFrame(this, 800,50);
@ -290,8 +297,8 @@ hframe=new TGHorizontalFrame(this, 800,50);
TGNumberFormat::kNEANonNegative,
TGNumberFormat::kNELLimitMinMax,0,16535);
hframe->AddFrame(eSerOff,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
eSerOff->MapWindow();;
eSerOff->SetNumber(5);
eSerOff->MapWindow();
eSerOff->SetNumber(0);
e= eSerOff->TGNumberEntry::GetNumberEntry();
eSerOff->Connect("ValueSet(Long_t)","ctbAcquisition",this,"ChangeSerialOffset(Long_t)");
e->Connect("ReturnPressed()","ctbAcquisition",this,"ChangeSerialOffset()");
@ -337,6 +344,53 @@ hframe=new TGHorizontalFrame(this, 800,50);
hframe=new TGHorizontalFrame(this, 800,50);
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 10,10,10,10));
hframe->MapWindow();
label=new TGLabel(hframe,"Image Pixels");
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
label->MapWindow();
label->SetTextJustify(kTextLeft);
label=new TGLabel(hframe,"X: ");
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
label->MapWindow();
label->SetTextJustify(kTextRight);
ePixX=new TGNumberEntry(hframe, 0, 9,999, TGNumberFormat::kNESInteger,
TGNumberFormat::kNEANonNegative,
TGNumberFormat::kNELLimitMinMax,0,16535);
hframe->AddFrame(ePixX,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
ePixX->MapWindow();
ePixX->SetNumber(400);
e= ePixX->TGNumberEntry::GetNumberEntry();
ePixX->Connect("ValueSet(Long_t)","ctbAcquisition",this,"ChangeImagePixels(Long_t)");
e->Connect("ReturnPressed()","ctbAcquisition",this,"ChangeImagePixels()");
label=new TGLabel(hframe,"Y: ");
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
label->MapWindow();
label->SetTextJustify(kTextRight);
ePixY=new TGNumberEntry(hframe, 0, 9,999, TGNumberFormat::kNESInteger,
TGNumberFormat::kNEANonNegative,
TGNumberFormat::kNELLimitMinMax,0,16535);
hframe->AddFrame(ePixY,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
ePixY->MapWindow();
ePixY->SetNumber(400);
e= ePixY->TGNumberEntry::GetNumberEntry();
ePixY->Connect("ValueSet(Long_t)","ctbAcquisition",this,"ChangeImagePixels(Long_t)");
e->Connect("ReturnPressed()","ctbAcquisition",this,"ChangeImagePixels()");
hframe=new TGHorizontalFrame(this, 800,50);
@ -609,8 +663,10 @@ hframe=new TGHorizontalFrame(this, 800,50);
cout <<"Registering data callback" << endl;
try {
myDet->registerDataCallback(&dataCallback, (void*)this);
} CATCH_DISPLAY ("Could not get register call back.", "ctbAcquisition::ctbAcquisition")
} CATCH_DISPLAY ("Could not get register call back.", "ctbAcquisition::ctbAcquisition")
try {
myDet->setRxZmqDataStream(true);
} CATCH_DISPLAY ("Could not get set RxZmqDataStream.", "ctbAcquisition::ctbAcquisition")
cout <<"Done" << endl;
// mgAdcs=new TMultiGraph();
@ -832,7 +888,7 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
// cout <<"global plot is " << globalPlot << endl;
// cout << "*******************************************" <<endl;
// cout <<"------Plot: "<< index << " prog:" << data->progressIndex << " npoints:" << data->npoints << " npy: " << data->npy << " " << data->fileName << " bytes: " << data->databytes << " dr:"<< data->dynamicRange << " fi: " << data ->fileIndex << endl;
cout <<"------Plot: "<< index << " prog:" << data->progressIndex << " nx:" << data->nx << " ny: " << data->ny << " " << data->fileName << " bytes: " << data->databytes << " dr:"<< data->dynamicRange << " fi: " << data ->fileIndex << endl;
if (globalPlot || cbGetPedestal->IsOn()) {
//#ifdef TESTADC
// cout <<"------"<< index << " " << ip << " " << data->npoints << endl;
@ -859,6 +915,11 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
nx=eNumCount->GetIntNumber();
dr=eDynRange->GetIntNumber();
soff=eSerOff->GetIntNumber();
// cout <<"deserializer: " << endl;
// cout << "Number of chans:\t" << nx << endl;
// cout << "Serial Offset:\t" << soff << endl;
// cout << "Dynamic range:\t" << dr << endl;
}
i=0;
@ -923,7 +984,8 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
for (int y=0; y<ny; y++) {
ped=0;
aval=dataStructure->getValue(data->data,x,y);
//aval=dataStructure->getChannel(data->data,x,y);
cout << x << " " <<y << " "<< aval << endl;
if (cbGetPedestal->IsOn()) {
if (photonFinder) {
photonFinder->addToPedestal(aval,x,y);
@ -1094,8 +1156,20 @@ void ctbAcquisition::Draw(){
void ctbAcquisition::changePlot(){
if (rbPlotOff->IsOn()) {
adcPlot=0;
dbitPlot=0;
dbitPlot=0;
try {
myDet->registerDataCallback(nullptr, this);
} CATCH_DISPLAY ("Could not get unregister call back.", "ctbAcquisition::ctbAcquisition")
try {
myDet->setRxZmqDataStream(false);
} CATCH_DISPLAY ("Could not get unset RxZmqDataStream.", "ctbAcquisition::ctbAcquisition")
} else {
try {
myDet->registerDataCallback(&dataCallback, (void*)this);
} CATCH_DISPLAY ("Could not get register call back.", "ctbAcquisition::ctbAcquisition")
try {
myDet->setRxZmqDataStream(true);
} CATCH_DISPLAY ("Could not get set RxZmqDataStream.", "ctbAcquisition::ctbAcquisition")
adcPlot=0;
dbitPlot=0;
for (int ii=0; ii<NADCS; ii++)
@ -1200,6 +1274,9 @@ void ctbAcquisition::changeDetector(){
eNumCount->SetState(kFALSE);
eDynRange->SetState(kFALSE);
eSerOff->SetState(kFALSE);
ePixX->SetState(kFALSE);
ePixY->SetState(kFALSE);
deserializer=0;
if (rb2D->IsOn() ) {//|| rbScan->IsOn()
switch (cbDetType->GetSelected()) {
@ -1210,7 +1287,6 @@ void ctbAcquisition::changeDetector(){
// commonMode=new moench03CommonMode();
break;
case MOENCH04:
try {
auto retval = myDet->getTenGiga().tsquash("Different values");
if (retval) {
@ -1223,6 +1299,54 @@ void ctbAcquisition::changeDetector(){
cout << "MOENCH 0.4!" << endl;
commonMode=new moench03CommonMode();
break;
case MOENCH03:
//try {
// auto retval = myDet->getTenGiga().tsquash("Different values");
// if (retval) {
dataStructure=new moench03T1ZmqDataNew(nAnalogSamples);
// } else {
// dataStructure=new moench04CtbZmqData(nAnalogSamples, nDigitalSamples);
// }
//} CATCH_DISPLAY ("Could not get ten giga enable.", "ctbAcquisition::changeDetector")
cout << "MOENCH 0.3! USE JUNGFRAU MODULE!" << endl;
commonMode=new moench03CommonMode();
break;
case IMAGE32B:
//try {
// auto retval = myDet->getTenGiga().tsquash("Different values");
// if (retval) {
// if (deserializer) {
ePixX->SetState(kTRUE);
ePixY->SetState(kTRUE);
// }
dataStructure=new imageZmq32bit(ePixX->GetIntNumber(),ePixY->GetIntNumber());
// } else {
// dataStructure=new moench04CtbZmqData(nAnalogSamples, nDigitalSamples);
// }
//} CATCH_DISPLAY ("Could not get ten giga enable.", "ctbAcquisition::changeDetector")
cout << "Image 32bit, no channel shuffling" << endl;
commonMode=NULL;
break;
case IMAGE16B:
//try {
// auto retval = myDet->getTenGiga().tsquash("Different values");
// if (retval) {
// if (deserializer) {
ePixX->SetState(kTRUE);
ePixY->SetState(kTRUE);
// }
dataStructure=new imageZmq16bit(ePixX->GetIntNumber(),ePixY->GetIntNumber());
// } else {
// dataStructure=new moench04CtbZmqData(nAnalogSamples, nDigitalSamples);
// }
//} CATCH_DISPLAY ("Could not get ten giga enable.", "ctbAcquisition::changeDetector")
cout << "Image 16bit, no channel shuffling" << endl;
commonMode=NULL;
break;
// case 1:
// cout << "************** T!!!!!!!!!!" << endl;
@ -1286,6 +1410,7 @@ void ctbAcquisition::changeDetector(){
photonFinder=new singlePhotonDetector(dataStructure,csize,nsigma,1,cm); //sign is positive - should correct with ADC mask, no common mode
//photonFinder=new singlePhotonDetector(dataStructure,csize,nsigma,1,cm); //sign is positive - should correct with ADC mask, no common mode
dataStructure->getDetectorSize(nx,ny);
}
if (deserializer) {
ny=1;
@ -1511,20 +1636,23 @@ void ctbAcquisition::update() {
if (dataStructure) {
cout << cbDetType->GetSelected()<< endl;
if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302){
cout << "settings deserialiation parameters for MYTHEN" << endl;
mythen3_01_jctbData* ms=(mythen3_01_jctbData*)dataStructure;
eSerOff->SetNumber( ms->setSerialOffset(-1));
eDynRange->SetNumber( ms->setDynamicRange(-1));
eNumCount->SetNumber( ms->setNumberOfCounters(-1));
}
// if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302){
// cout << "settings deserialiation parameters for MYTHEN" << endl;
// mythen3_01_jctbData* ms=(mythen3_01_jctbData*)dataStructure;
// eSerOff->SetNumber( ms->setSerialOffset(-1));
// eDynRange->SetNumber( ms->setDynamicRange(-1));
// eNumCount->SetNumber( ms->setNumberOfCounters(-1));
// }
}
try {
dBitOffset = myDet->getRxDbitOffset().tsquash("Different values");
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::update")
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
dBitOffset = 0;
} else {
try {
dBitOffset = myDet->getRxDbitOffset().tsquash("Different values");
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::update")
}
try {
tenG = myDet->getTenGiga().tsquash("Different values");
} CATCH_DISPLAY ("Could not get ten giga enable", "ctbAcquisition::update")
@ -1610,9 +1738,13 @@ void ctbAcquisition::toggleAcquisition() {
setDigitalSamples(retval);
} CATCH_DISPLAY ("Could not get number of digital samples", "ctbAcquisition::toggleAcquisition")
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
dBitOffset = 0;
} else {
try {
dBitOffset = myDet->getRxDbitOffset().tsquash("Different values");
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::toggleAcquisition")
dBitOffset = myDet->getRxDbitOffset().tsquash("Different values");
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::toggleAcquisition")
}
try {
roMode = static_cast<int>(myDet->getReadoutMode().tsquash("Different values"));
@ -1849,14 +1981,18 @@ void ctbAcquisition::setDbitEnable(Int_t reg){
void ctbAcquisition::updateChans() {
// dbit list
try {
auto retval = myDet->getRxDbitList().tsquash("Different values");
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
dbitlist.clear();
if (!retval.empty()) {
for (const auto &value : retval)
dbitlist.push_back(value);
}
} CATCH_DISPLAY ("Could not get receiver dbit list.", "ctbAcquisition::updateChans")
} else {
try {
auto retval = myDet->getRxDbitList().tsquash("Different values");
dbitlist.clear();
if (!retval.empty()) {
for (const auto &value : retval)
dbitlist.push_back(value);
}
} CATCH_DISPLAY ("Could not get receiver dbit list.", "ctbAcquisition::updateChans")
}
// adc mask
try {
@ -1977,20 +2113,22 @@ void ctbAcquisition::ChangeNumberOfChannels(Long_t a){
void ctbAcquisition::ChangeSerialOffset(){
changeDetector();
// if (dataStructure) {
// // cout << cbDetType->GetSelected()<< endl;
// // if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302 ){
// // cout << "settings offsets for MYTHEN" << endl;
// // mythen3_01_jctbData* ms=(mythen3_01_jctbData*)dataStructure;
// // ms->setSerialOffset(eSerOff->GetIntNumber());
// cout << cbDetType->GetSelected()<< endl;
// if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302 ){
// cout << "settings offsets for MYTHEN" << endl;
// mythen3_01_jctbData* ms=(mythen3_01_jctbData*)dataStructure;
// ms->setSerialOffset(eSerOff->GetIntNumber());
// // }
// }
// }
};
void ctbAcquisition::ChangeDynamicRange(){
changeDetector();
// if (dataStructure) {
// cout << cbDetType->GetSelected()<< endl;
@ -2004,6 +2142,7 @@ void ctbAcquisition::ChangeDynamicRange(){
};
void ctbAcquisition::ChangeNumberOfChannels(){
changeDetector();
// if (dataStructure) {
// cout << cbDetType->GetSelected()<< endl;
// if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302){
@ -2017,6 +2156,24 @@ void ctbAcquisition::ChangeNumberOfChannels(){
changePlot();
};
void ctbAcquisition::ChangeImagePixels(Long_t a){
ChangeImagePixels();
};
void ctbAcquisition::ChangeImagePixels(){
changeDetector();
// if (dataStructure) {
// cout << cbDetType->GetSelected()<< endl;
// if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302){
// cout << "settings number of channels for MYTHEN" << endl;
// mythen3_01_jctbData* ms=(mythen3_01_jctbData*)dataStructure;
// ms->setNumberOfCounters(eNumCount->GetIntNumber());
// }
// }
// if (deserializer)
// changePlot();
};
void ctbAcquisition::ChangeHistoLimitsPedSub(Long_t a){

View File

@ -42,7 +42,7 @@ using namespace std;
class ctbAcquisition : public TGGroupFrame {
enum {DESERIALIZER, MOENCH04, MOENCH02, ADCSAR2, MYTHEN301, MYTHEN302};
enum {DESERIALIZER, MOENCH04, MOENCH02, MOENCH03, IMAGE32B, IMAGE16B, ADCSAR2, MYTHEN301, MYTHEN302};
private:
@ -57,6 +57,9 @@ class ctbAcquisition : public TGGroupFrame {
TGNumberEntry *eNumCount;
TGNumberEntry *ePixX;
TGNumberEntry *ePixY;
TGNumberEntry *eFitADC;
TGNumberEntry *eBitPlot;
TGNumberEntry *eMinRaw;
@ -231,7 +234,8 @@ class ctbAcquisition : public TGGroupFrame {
void ChangeNumberOfChannels(Long_t);
void ChangeDynamicRange();
void ChangeDynamicRange(Long_t);
void ChangeImagePixels();
void ChangeImagePixels(Long_t);
void canvasClicked();
void FitADC();

View File

@ -108,15 +108,26 @@ string ctbDac::getLabel() {
}
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 {
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(id), dacsEntry->GetIntNumber(), dacsUnit->IsOn());
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();
@ -128,7 +139,11 @@ void ctbDac::setOn(Bool_t b) {
setValue();
} else {
try {
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(id), -100, false);
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();
@ -136,7 +151,11 @@ void ctbDac::setOn(Bool_t b) {
int ctbDac::getValue() {
try {
int val = myDet->getDAC(static_cast<slsDetectorDefs::dacIndex>(id), dacsUnit->IsOn()).tsquash("Different values");
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) {

View File

@ -45,7 +45,7 @@ class ctbDac : public TGHorizontalFrame {
int setLabel(char *tit, int mv);
string getLabel();
int getMoenchDacId();
ClassDef(ctbDac,0)
@ -54,8 +54,6 @@ class ctbDac : public TGHorizontalFrame {
class ctbDacs : public TGGroupFrame {
private:
ctbDac *dacs[NDACS+2];
sls::Detector* myDet;

View File

@ -71,14 +71,14 @@ class ctbDefs {
std::string exceptionMessage,
std::string source) {
// because sls_detector_exceptions cannot be included
if (exceptionMessage.find("hared memory")) {
if (exceptionMessage.find("hared memory") != std::string::npos) {
throw;
}
if (exceptionMessage.find("annot connect")) {
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

@ -259,8 +259,10 @@ ctbMain::ctbMain(const TGWindow *p, sls::Detector *det)
cout << "connect mtab" << endl;
setReadoutMode(pat->getReadoutMode());
try{
setReadoutMode(pat->getReadoutMode());
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
setADCEnable(adcs->setEnable());
setAnalogSamples(pat->getAnalogSamples());
setDigitalSamples(pat->getDigitalSamples());

View File

@ -1035,33 +1035,42 @@ void ctbPattern::readoutModeChanged(int flags) {
}
int ctbPattern::getReadoutMode() {
try{
auto retval = myDet->getReadoutMode().tsquash("Different values");
switch(retval) {
case slsDetectorDefs::ANALOG_AND_DIGITAL:
cout << "analog and digital" << endl;
cbAnalog->SetOn(kTRUE);
cbDigital->SetOn(kTRUE);
break;
case slsDetectorDefs::DIGITAL_ONLY:
cout << "digital only" << endl;
cbAnalog->SetOn(kFALSE);
cbDigital->SetOn(kTRUE);
break;
case slsDetectorDefs::ANALOG_ONLY:
cout << "analog only" << endl;
cbAnalog->SetOn(kTRUE);
cbDigital->SetOn(kFALSE);
break;
default:
throw("unknown readout flag");
}
int ctbPattern::getReadoutMode() {
int retval=slsDetectorDefs::ANALOG_ONLY;
if (myDet->getDetectorType().squash() == slsDetectorDefs::CHIPTESTBOARD) {
try{
retval = myDet->getReadoutMode().tsquash("Different values");
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
switch(retval) {
case slsDetectorDefs::ANALOG_AND_DIGITAL:
cout << "analog and digital" << endl;
cbAnalog->SetOn(kTRUE);
cbDigital->SetOn(kTRUE);
break;
case slsDetectorDefs::DIGITAL_ONLY:
cout << "digital only" << endl;
cbAnalog->SetOn(kFALSE);
cbDigital->SetOn(kTRUE);
break;
case slsDetectorDefs::ANALOG_ONLY:
cout << "analog only" << endl;
cbAnalog->SetOn(kTRUE);
cbDigital->SetOn(kFALSE);
break;
default:
throw("unknown readout flag");
}
} else {
cbAnalog->SetOn(kTRUE);
cbDigital->SetOn(kFALSE);
}
Emit("readoutModeChanged(int)",static_cast<int>(retval));
return retval;
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
return -1;
}
int ctbPattern::getAnalogSamples() {
@ -1075,13 +1084,17 @@ int ctbPattern::getAnalogSamples() {
return -1;
}
int ctbPattern::getDigitalSamples() {
try{
auto retval = myDet->getNumberOfDigitalSamples().tsquash("Different values");
eDigitalSamples->SetNumber((Double_t)retval);
Emit("digitalSamplesChanged(const int)", eDigitalSamples->GetNumber());
return eDigitalSamples->GetNumber();
} CATCH_DISPLAY ("Could not get number of triggers.", "ctbPattern::update")
int ctbPattern::getDigitalSamples() {
int retval=0;
if (myDet->getDetectorType().squash() == slsDetectorDefs::CHIPTESTBOARD) {
try{
auto retval = myDet->getNumberOfDigitalSamples().tsquash("Different values");
} CATCH_DISPLAY ("Could not get number of digital samples.", "ctbPattern::getDigitalSamples")
}
eDigitalSamples->SetNumber((Double_t)retval);
Emit("digitalSamplesChanged(const int)", eDigitalSamples->GetNumber());
return eDigitalSamples->GetNumber();
return -1;
}

View File

@ -374,33 +374,43 @@ void ctbSignals::update() {
} CATCH_DISPLAY ("Could not get patternIOcontrol.", "ctbSignals::update")
try {
auto dbitlist = myDet->getRxDbitList().tsquash("Different values");
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
// 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);
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);
}
}
// enable selected
for (const auto &value : dbitlist) {
signals[value]->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")
} 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")
}
}

View File

@ -21,6 +21,7 @@ if [ -f "$infile" ]
then
gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ;
echo compiling
echo gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ;
$exe ;
echo cleaning
rm $exe

View File

@ -1,69 +1,75 @@
find_package(Doxygen)
find_package(Sphinx)
find_package(Doxygen REQUIRED)
find_package(Sphinx REQUIRED)
if (DOXYGEN_FOUND AND SPHINX_FOUND)
message(${CMAKE_PROJECT_SORURCE_DIR}/slsDetectorSoftware/src)
# Utility to generate command line documentation
add_executable(gendoc src/gendoc.cpp)
# This is a bit hacky, but better than exposing stuff?
target_include_directories(gendoc PRIVATE ${PROJECT_SOURCE_DIR}/slsDetectorSoftware/src)
target_link_libraries(gendoc PRIVATE
slsDetectorShared
)
set_target_properties(gendoc PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
#Doxygen
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
# Utility to generate command line documentation
add_executable(gendoc src/gendoc.cpp)
# This is a bit hacky, but better than exposing stuff?
target_include_directories(gendoc PRIVATE ${PROJECT_SOURCE_DIR}/slsDetectorSoftware/src)
target_link_libraries(gendoc PRIVATE
slsDetectorShared
)
set_target_properties(gendoc PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
#Sphinx
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR})
set(SPHINX_SOURCE_FILES
src/commandline.rst
src/container_utils.rst
src/dependencies.rst
src/detector.rst
src/index.rst
src/installation.rst
src/pydetector.rst
src/pyenums.rst
src/pyexamples.rst
src/receiver.rst
src/result.rst
src/type_traits.rst
src/ToString.rst
)
foreach(filename ${SPHINX_SOURCE_FILES})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${filename}
"${SPHINX_BUILD}/${filename}")
endforeach(filename ${SPHINX_SOURCE_FILES})
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in"
"${SPHINX_BUILD}/conf.py"
@ONLY)
#Doxygen
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
add_custom_target(docs
gendoc
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
COMMAND ${SPHINX_EXECUTABLE} -a -b html
-Dbreathe_projects.slsDetectorPackage=${CMAKE_CURRENT_BINARY_DIR}/xml
-c "${SPHINX_BUILD}"
${SPHINX_BUILD}/src
${SPHINX_BUILD}/html
COMMENT "Generating documentation with Sphinx")
#Sphinx
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR})
else (DOXYGEN_FOUND AND SPHINX_FOUND)
message("Doxygen and Sphinx are needed to build documentation")
endif (DOXYGEN_FOUND AND SPHINX_FOUND)
set(SPHINX_SOURCE_FILES
src/commandline.rst
src/container_utils.rst
src/consuming.rst
src/dependencies.rst
src/detector.rst
src/index.rst
src/installation.rst
src/pydetector.rst
src/pyenums.rst
src/pyexamples.rst
src/receiver.rst
src/result.rst
src/type_traits.rst
src/ToString.rst
src/examples.rst
)
foreach(filename ${SPHINX_SOURCE_FILES})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${filename}
"${SPHINX_BUILD}/${filename}")
endforeach(filename ${SPHINX_SOURCE_FILES})
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in"
"${SPHINX_BUILD}/conf.py"
@ONLY)
add_custom_target(docs
gendoc
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
COMMAND ${SPHINX_EXECUTABLE} -a -b html
-Dbreathe_projects.slsDetectorPackage=${CMAKE_CURRENT_BINARY_DIR}/xml
-c "${SPHINX_BUILD}"
${SPHINX_BUILD}/src
${SPHINX_BUILD}/html
COMMENT "Generating documentation with Sphinx")
add_custom_target(rst
COMMAND ${SPHINX_EXECUTABLE} -a -b html
-Dbreathe_projects.slsDetectorPackage=${CMAKE_CURRENT_BINARY_DIR}/xml
-c "${SPHINX_BUILD}"
${SPHINX_BUILD}/src
${SPHINX_BUILD}/html
COMMENT "Generating documentation with Sphinx")

View File

@ -21,7 +21,7 @@ print(sys.path)
# -- Project information -----------------------------------------------------
project = 'slsDetectorPackage'
copyright = '2019, PSD Detector Group'
copyright = '2020, PSD Detector Group'
author = 'PSD Detector Group'
version = '@PROJECT_VERSION@'

116
docs/src/consuming.rst Normal file
View File

@ -0,0 +1,116 @@
Consuming slsDetectorPackage
===============================
Depending on how you want to build your integration with
slsDetectorPackage there are a few different ways to
consume our package. The recommended way is to use one of the
CMake approaches.
CMake: slsDetectorPackage as submodule in your project
---------------------------------------
If you are using CMake to build your integration and want to build everything
in one go, we support adding slsDetectorPackage as a subfolder in your cmake project.
A minimal CMakeLists.txt could look like this:
.. code-block:: cmake
project(myDetectorIntegration)
cmake_minimum_required(VERSION 3.12)
add_subdirectory(slsDetectorPackage)
#Add your executable
add_executable(example main.cpp)
target_compile_features(example PRIVATE cxx_std_11)
#Link towards slsDetectorShared
target_link_libraries(example slsDetectorShared)
A fully working example can be found at:
https://github.com/slsdetectorgroup/cmake-subfolder-example
CMake: find_package(slsDetectorPackage)
------------------------------------------
If you have compiled and installed slsDetectorPackage we also support
find_package in CMake. If installed in a system wide location no path
should be needed, otherwise specify cmake prefix path.
.. code-block:: cmake
cmake_minimum_required(VERSION 3.12)
project(myintegration)
find_package(slsDetectorPackage 5.0 REQUIRED)
add_executable(example main.cpp)
target_link_libraries(example slsDetectorShared)
Then assuming the slsDetectorPackage is installed in /path/to/sls/install
you should be able to configure and build your project in this way.
.. code-block:: bash
cmake ../path/to/your/source -DCMAKE_PREFIX_PATH=/path/to/sls/install
make
A minimal example is available at: https://github.com/slsdetectorgroup/minimal-cmake
CMake: find_package and conda
----------------------------------
.. note::
conda can also be used for installing dependencies such as zmq, Qt4 etc.
find_package(slsDetectorPackage) also works if you have installed slsDetectorPackage using conda.
The only difference is that you point CMake to $CONDA_PREFIX
.. code-block:: bash
#assuming myenv contains slsdetlib
conda activate myenv
cmake ../path/to/your/source -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
make
Depending on your system compiler you might also have to install gxx_linux-64 to compiled.
No tools minimal approach
-----------------------------
While not recommended it is still possible to specify the include and library paths
manually when invoking g++. This can sometimes be handy for a quick try.
.. code-block:: cpp
#include "Detector.h"
#include <iostream>
int main(){
sls::Detector det;
//Get all values and print them
std::cout << "Hostname: " << det.getHostname() << "\n";
std::cout << "Type: " << det.getDetectorType() << "\n";
std::cout << "Udp ip: " << det.getSourceUDPIP() << "\n";
//Get mac addr
const int module = 0;
auto mac = det.getSourceUDPMAC()[module];
std::cout << "Mac addr of module "<< module << " is " << mac.str() << '\n';
}
.. code-block:: bash
g++ -I/install/path/include/ -L/install/path/lib64/ myapp.cpp -lSlsDetector -lSlsSupport -Wl,-rpath=../install/path/lib64

View File

@ -13,7 +13,7 @@ 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.9
* CMake > 3.12
* C++11 compatible compiler. (We test with gcc and clang)
* ZeroMQ version 4
@ -24,7 +24,7 @@ GUI
The GUI is currently using Qt4 but watch out for an upgrade to 5.
* Qt 4.8
* Qwt 6
* Qwt 6.1
-----------------------
Python bindings
@ -42,7 +42,7 @@ The documentation that you are reading now is built with
* Doxygen (to extract C++ classes etc.)
* Breathe (Sphinx plugin to handle doxygen xml)
* Sphinx
* Sphinx with sphinx_rtd_theme
-----------------------
Packaged in libs/

115
docs/src/examples.rst Normal file
View File

@ -0,0 +1,115 @@
Examples
===========
Setup
------------
The examples here assume that you have compiled and installed slsDetectorPackage
to ~/sls/install and that the option for SLS_USE_SIMULATOR was enabled. This also builds
the virtual detector servers that we will be using for testing.
We also add ~/sls/detector/install/bin to the path for convenience.
Compile examples
-------------------
The source code of the examples is available at:
https://github.com/slsdetectorgroup/api-examples
.. code-block:: bash
git clone https://github.com/slsdetectorgroup/api-examples.git
mkdir build && cd build
cmake ../api-examples -DCMAKE_PREFIX_PATH=~/sls/detector/install
make
Below follows a short description of what is included in the examples.
Running a config file [e1]
-----------------------------
.. code-block:: cpp
#include "Detector.h"
...
sls::Detector det;
det.loadConfig("path/to/config/file.config");
To configure the connection between PC and detector the easiest
is to run a config file. For this example we first launch a virtual Jungfrau server and
then set up the detector.
**Launch a virtual detector server**
.. code-block:: bash
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.
**Run example to configure**
.. code-block:: bash
./e1-config one_det_no_receiver.config
- 12:01:06.371 INFO: Shared memory deleted /slsDetectorPackage_multi_0_sls_0
- 12:01:06.371 INFO: Shared memory deleted /slsDetectorPackage_multi_0
- 12:01:06.372 INFO: Shared memory created /slsDetectorPackage_multi_0
- 12:01:06.376 INFO: Loading configuration file: one_det_no_receiver.config
- 12:01:06.376 INFO: Adding detector localhost
- 12:01:06.377 INFO: Shared memory created /slsDetectorPackage_multi_0_sls_0
- 12:01:06.377 INFO: Checking Detector Version Compatibility
- 12:01:06.378 INFO: Detector connecting - updating!
hostname [localhost]
Jungfrau detector with 1 modules configured
Using the return type sls::Result [e2]
-----------------------------------------
Since many our detectors have multiple modules we cannot return
a single value when reading from the Detector. Hostname, Ip and also
for example exposure time can differ between modules.
Therefore we return Result<T> which is a thin wrapper around
std::vector.
.. code-block:: cpp
sls::Result<int> res1{1, 1, 1};
std::cout << "res1: " << res1 << '\n';
res1.squash();
res1.squash(-1);
Setting exposure time [e3]
-----------------------------------------
For setting times, like exposure time, period, delay etc.
we use std::chrono::duration.
Example 3 shows how to set and read exposure time as well
as converting to floating point.
.. code-block:: cpp
#include "Detector.h"
#include <chrono>
...
std::chrono::microseconds t0{500};
det.setExptime(t0);

View File

@ -1,7 +1,7 @@
/**
* Utility program to generate input files for the command line
/**
* Utility program to generate input files for the command line
* documentation. Uses the string returned from sls_detector_help cmd
*
*
*/
#include <fstream>
#include <iostream>
@ -9,7 +9,6 @@
#include <string>
#include <vector>
#include "CmdProxy.h"
#include "Detector.h"
#include "sls_detector_defs.h"
@ -52,5 +51,4 @@ int main() {
auto help = replace_all(tmp, "\n\t", "\n\t\t");
fs << '\t' << cmd << usage << help << "\n";
}
}

View File

@ -6,12 +6,18 @@
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
.. toctree::
:maxdepth: 1
:caption: Installation:
installation
dependencies
consuming
.. toctree::
:caption: C++ API
@ -20,6 +26,7 @@ Welcome to slsDetectorPackage's documentation!
detector
result
receiver
examples
.. toctree::
:caption: Python API

View File

@ -1,5 +1,114 @@
.. note ::
The default branch of our git repository is developer. It contains the
latest development version. It is expected to compile and work but
features might be added or tweaked. In some cases the API might also change
without being communicated. If absolute stability of the API is needed please
use one of the release versions.
.. warning ::
Before building from source make sure that you have the
:doc:`dependencies <../dependencies>` installed. If installing using conda, conda will
manage the dependencies.
Installation
==============================================
get the source etc.
Build from source using CMake
---------------------------------
Note that on some systems, for example RH7, cmake v3+ is available under the cmake3 alias.
It is also required to clone with the option --recursive to get the git submodules used
in the package.
.. code-block:: bash
git clone --recursive https://github.com/slsdetectorgroup/slsDetectorPackage.git
mkdir build && cd build
cmake ../slsDetectorPackage -DCMAKE_INSTALL_PREFIX=/your/install/path
make -j12 #or whatever number of cores you are using to build
make install
The easiest way to configure options is to use the ccmake utility.
.. code-block:: bash
#from the build directory
ccmake .
Install binaries using conda
--------------------------------
Conda is not only useful to manage python environments but can also
be used as a user space package manager.
We have three different packages available:
* **slsdetlib**, shared libraries and command line utilities
* **slsdetgui**, GUI
* **slsdet**, Python bindings
.. code-block:: bash
#Add channels for dependencies and our library
conda config --add channels conda-forge
conda config --add channels slsdetectorgroup
conda config --set channel_priority strict
#cerate an environment with our library, then activate
conda create -n myenv slsdetlib=2020.07.23.dev0
conda activate myenv
#ready to use
sls_detector_get exptime
etc ...
.. code-block:: bash
#List available versions
conda search slsdet
Build from source 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
using this compiler
.. code-block:: bash
#Create an environment with the dependencies
conda create -n myenv gxx_linux-64 cmake zmq
conda activate myenv
cmake ../slsDetectorPackage -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
make -j12
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
is to use conda
.. code-block:: bash
conda create -n myenv python sphinx sphinx_rtd_theme
Then enable the option SLS_BUILD_DOCS to create the targets
.. code-block:: bash
make docs # generate API docs and build Sphinx RST
make rst # rst only, saves time in case the API did not change

View File

@ -1,9 +1,9 @@
Detector
=====================================================
.. py:currentmodule:: sls_detector
.. py:currentmodule:: slsdet
.. autoclass:: ExperimentalDetector
.. autoclass:: Detector
:members:
:undoc-members:
:show-inheritance:

View File

@ -4,9 +4,55 @@ Enums
These enums are defined in slsDetectorDefs in the C++ package and
exposed to Python through pybind11.
.. py:currentmodule:: sls_detector
.. py:currentmodule:: slsdet
.. autoclass:: runStatus
:members:
:undoc-members:
:show-inheritance:
.. autoclass:: detectorType
:undoc-members:
.. autoclass:: frameDiscardPolicy
:undoc-members:
.. autoclass:: fileFormat
:undoc-members:
.. autoclass:: dimension
:undoc-members:
.. autoclass:: externalSignalFlag
:undoc-members:
.. autoclass:: timingMode
:undoc-members:
.. autoclass:: dacIndex
:undoc-members:
.. autoclass:: detectorSettings
:undoc-members:
.. autoclass:: clockIndex
:undoc-members:
.. autoclass:: speedLevel
:undoc-members:
.. autoclass:: readoutMode
:undoc-members:
.. autoclass:: masterFlags
:undoc-members:
.. autoclass:: frameModeType
:undoc-members:
.. autoclass:: detectorModeType
:undoc-members:
.. autoclass:: burstMode
:undoc-members:
.. autoclass:: timingSourceType
:undoc-members:

View File

@ -12,7 +12,7 @@ file writing etc.
.. code-block:: python
from sls_detector import Eiger
from slsdet import Eiger
d = Eiger()
threshold = range(0, 2000, 200)
@ -74,7 +74,7 @@ But lets start looking at the at the manual way:
::
import time
from sls_detector import Eiger
from slsdet import Eiger
d = Eiger()
n = 10
@ -114,7 +114,7 @@ hang around until the main process exits.
import time
from multiprocessing import Process
from sls_detector import Eiger
from slsdet import Eiger
def acquire():
"""

View File

@ -1,6 +1,6 @@
Receiver
==============================================
.. doxygenclass:: slsReceiver
.. doxygenclass:: Receiver
:members:
.. :undoc-members:

View File

@ -12,7 +12,7 @@ hostname bchip007
0:rx_udpip 129.129.202.98
0:rx_hostname pc6898
0:outdir /bigRAID/datadir_gotthard/rec_test_data
0:vhighvoltage 120
0:highvoltage 120
master -1
sync none
outdir /bigRAID/datadir_gotthard/rec_test_data

View File

@ -0,0 +1,129 @@
#Gain index ADU value (12 bit)
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655

View File

@ -1,132 +1,129 @@
#G1 Energy #G2 Energy
300 7000
#G0 pedestal G1 pedestal G2 pedestal G0 gain G1 gain G2 gain (for every channel) ADU
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
100 100 100 10 1 0.1
#G0 pedestal G1 pedestal G2 pedestal G0 gain G1 gain G2 gain #G1 Energy #G2 Energy
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000

View File

@ -0,0 +1,29 @@
hostname strip3
udp_srcip 10.1.1.184
udp_dstip 10.1.1.107
udp_dstport2 50084
udp_srcip2 10.1.1.185
udp_dstip2 10.1.1.107
rx_hostname pc12365:1954
#udp_dstmac 3c:fd:fe:d2:a4:25
fpath /tmp
fname run
fwrite 0
bursts 10
frames 2700
burstperiod 100ms
numinterfaces 2
veto 1
#fixing data looks
# Sampling pipeline 1 clk
reg 0x120 0x00000010
clkphase 1 135 deg

View File

@ -6,12 +6,12 @@ hostname bchip074+bchip075+
0:extsig:0 trigger_in_rising_edge
0:rx_tcpport 1954
0:rx_udpport 50001
0:vhighvoltage 0
0:highvoltage 0
1:extsig:0 trigger_in_rising_edge
1:rx_tcpport 1955
1:rx_udpport 50002
1:vhighvoltage 0
1:highvoltage 0
##############################################################################
#########
@ -53,5 +53,5 @@ settings veryhighgain
exptime 0.000005
period 0.0001
vhighvoltage 90
highvoltage 90

View File

@ -1,4 +1,14 @@
hostname bchip085+
initialchecks 0
#############################################
### edit with hostname or IP address of your detector
############################################
hostname bchip181+
runclk 40
adcclk 20
dbitclk 40
patword 0000 0000000000000000
patword 0001 0000000000000000
@ -408,84 +418,84 @@ patnloop1 0
patloop2 0400 0400
patnloop2 0
patwait0 00aa
patwaittime0 40000
patwaittime0 10000
patwait1 0400
patwaittime1 0
patwait2 0400
patwaittime2 0
####mcp2011
#0:rx_udpip 10.1.1.102
#0:detectorip 10.1.1.19
#0:rx_udpport 32410
####gui listening to
#zmqip 129.129.202.131
#zmqport 30001
####data streaming out of
#rx_zmqip 10.1.2.103
#rx_zmqport 30003
#0:rx_hostname mpc2011
#0:rx_tcpport 1977
####mx-test-1
0:rx_udpip 10.1.1.100
0:detectorip 10.1.1.19
0:rx_udpport 32410
####gui listening to (on receiver pc)
zmqip 129.129.202.92
zmqport 30001
####data streaming out of
rx_zmqip 10.1.1.100
rx_zmqport 30003
0:rx_hostname pcmoench01
#############################################
### edit with 10 Gbs IP of your server
############################################
0:udp_dstip 10.1.1.102
#0:udp_dstip 129.129.202.136
#############################################
### edit with any number in the subnet of your server (first 3 numbers as above)
############################################
0:udp_srcip 10.1.1.19
#0:udp_srcip 129.129.202.13
0:udp_dstport 33410
#############################################
### edit with 10 Gbs IP of your server
############################################
#zmqip 129.129.202.110
#rx_zmqip 10.1.1.102
#rx_zmqport 30001
#############################################
### edit with 1 Gbs IP of PC where you will run the GUI
############################################
#zmqip 129.129.202.110
#zmqport 50001
#############################################
### edit with hostname or 1Gbs IP address of your server
############################################
rx_hostname mpc2011
tengiga 1
#turn on datastream from commandline
rx_datastream 1
r_readfreq 1
#0:configuremac -1
rx_datastream 1
r_readfreq 1
rx_readfreq 1
dac:6 800
dac:0 1300
dac:4 1428
dac:1 1000
dac:7 900
dac:3 680
dac:2 1400
dac:5 1200
dac 6 800
dac 0 1300
dac 4 1428
dac 1 1000
dac 7 900
dac 3 680
dac 2 1400
dac 5 1200
adcinvert 4a342593
samples 5000
adcphase 90
adcpipeline 15
#0xb5cbda6c
asamples 5000
dsamples 0
adcphase 30 deg
adcpipeline 14
adcreg 14 40
powerchip 1
vhighvoltage 90
period 0.005
frames 1000
period 0.001
#############################################
### edit with directory you want to write to
############################################
fpath /tmp/
fwrite 0
romode analog
#rx_jsonaddheader frameMode
rx_jsonpara frameMode newpedestal
#rx_jsonaddheader detectorMode
rx_jsonpara detectorMode analog
#flags newpedestal
#flags analog
frames 100
period 0.1
outdir /scratch/
enablefwrite 0
reg 0x5e 0x00010000
#powerchip 1
highvoltage 90

View File

@ -6,7 +6,7 @@ hostname localhost
rx_hostname localhost
#powerchip 1
#vhighvoltage 200
#highvoltage 200
#extsig:0 trigger_in_rising_edge
#timing trigger

View File

@ -17,7 +17,7 @@ hostname bchip048+bchip052+
rx_hostname pcmoench01
powerchip 1
vhighvoltage 200
highvoltage 200
#extsig:0 trigger_in_rising_edge
#timing trigger

View File

@ -0,0 +1,63 @@
initialchecks 0
#############################################
### edit with hostname or IP address of your detector
############################################
hostname bchip181+
#############################################
### edit with hostname or 1Gbs IP address of your server
############################################
rx_hostname mpc2011
rx_tcpport 1954
#############################################
### edit with 10 Gbs IP of your server
############################################
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.1.19
udp_dstport 32411
#############################################
### edit with 10 Gbs IP of your server
############################################
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.136
zmqport 50001
tengiga 1
rx_datastream 1
frames 100000
period 0.0006
#############################################
### edit with directory you want to write to
############################################
fpath /mnt/moench_data/scratch/
fwrite 0
rx_datastream 1
rx_jsonpara frameMode frame
rx_jsonpara detectorMode counting
rx_discardpolicy discardpartial
adcpipeline 15
powerchip 1
highvoltage 90
#adcreg 0x14 0x40

View File

@ -19,7 +19,7 @@ hostname bchip007+bchip009+
0:rx_udpip 10.1.1.1
0:rx_hostname 129.129.202.134
0:outdir /data/speedt
0:vhighvoltage 120
0:highvoltage 120
#1:hostname bchip009
@ -37,7 +37,7 @@ hostname bchip007+bchip009+
1:rx_udpip 10.1.2.1
1:rx_hostname 129.129.202.134
1:outdir /data/speedt
1:vhighvoltage 120
1:highvoltage 120
master -1

View File

@ -1,5 +1,5 @@
#include "catch.hpp"
#include "DetectorImpl.h"
#include "catch.hpp"
#include "string_utils.h"
#include "tests/globals.h"
#include <iostream>

80
integrationTests/test-integrationDectector.cpp Executable file → Normal file
View File

@ -2,9 +2,9 @@
#include "catch.hpp"
#include "ClientSocket.h"
#include "logger.h"
#include "DetectorImpl.h"
#include "slsDetector.h"
#include "Module.h"
#include "logger.h"
#include "sls_detector_defs.h"
#include "Timer.h"
@ -23,10 +23,10 @@
// extern dt type;
TEST_CASE("Single detector no receiver", "[.integration][.single]") {
auto t = slsDetector::getTypeFromDetector(test::hostname);
auto t = Module::getTypeFromDetector(test::hostname);
CHECK(t == test::type);
slsDetector d(t);
Module d(t);
CHECK(d.getDetectorTypeAsEnum() == t);
CHECK(d.getDetectorTypeAsString() == test::detector_type);
@ -51,7 +51,7 @@ TEST_CASE("Set control port then create a new object with this control port",
int new_cport = 1993;
int new_sport = 2000;
{
slsDetector d(test::type);
Module d(test::type);
d.setHostname(test::hostname);
CHECK(d.getControlPort() == old_cport);
d.setControlPort(new_cport);
@ -60,7 +60,7 @@ TEST_CASE("Set control port then create a new object with this control port",
d.freeSharedMemory();
}
{
slsDetector d(test::type);
Module d(test::type);
d.setHostname(test::hostname);
d.setControlPort(new_cport);
d.setStopPort(new_sport);
@ -73,24 +73,23 @@ TEST_CASE("Set control port then create a new object with this control port",
d.freeSharedMemory();
}
slsDetector d(test::type);
Module d(test::type);
d.setHostname(test::hostname);
CHECK(d.getStopPort() == DEFAULT_PORTNO + 1);
d.freeSharedMemory();
}
TEST_CASE("single EIGER detector no receiver basic set and get",
"[.integration][eiger]") {
// TODO! this test should take command line arguments for config
SingleDetectorConfig c;
// Read type by connecting to the detector
auto type = slsDetector::getTypeFromDetector(c.hostname);
auto type = Module::getTypeFromDetector(c.hostname);
CHECK(type == c.type_enum);
// Create slsDetector of said type and set hostname and detector online
slsDetector d(type);
// Create Module of said type and set hostname and detector online
Module d(type);
CHECK(d.getDetectorTypeAsEnum() == type);
CHECK(d.getDetectorTypeAsString() == c.type_string);
@ -130,10 +129,8 @@ TEST_CASE("single EIGER detector no receiver basic set and get",
d.freeSharedMemory();
}
TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
slsDetector d(test::type);
Module d(test::type);
d.setHostname(test::hostname);
// Check that detector server is unlocked then lock
@ -154,13 +151,12 @@ TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
d.freeSharedMemory();
}
TEST_CASE("Set settings", "[.integration][.single]"){
slsDetector d(test::type);
TEST_CASE("Set settings", "[.integration][.single]") {
Module d(test::type);
d.setHostname(test::hostname);
CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD);
}
TEST_CASE("Timer functions", "[.integration][cli]") {
// FRAME_NUMBER, /**< number of real time frames: total number of
// acquisitions is number or frames*number of triggers */ ACQUISITION_TIME,
@ -185,7 +181,7 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
// MEASURED_SUBPERIOD, /**< measured subperiod */
// MAX_TIMERS
slsDetector d(test::type);
Module d(test::type);
d.setHostname(test::hostname);
// Number of frames
@ -204,8 +200,7 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
if (test::type != dt::EIGER) {
auto delay = 10000;
d.setDelayAfterTrigger(delay);
CHECK(d.getDelayAfterTrigger() ==
delay);
CHECK(d.getDelayAfterTrigger() == delay);
}
auto triggers = 2;
@ -218,16 +213,15 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
CHECK(d.getSubExptime() == subtime);
}
// for (int i =0; i!=frames; ++i)
d.startAndReadAll();
d.startAndReadAll();
d.freeSharedMemory();
}
// TEST_CASE("Aquire", "[.integration][eiger]"){
// SingleDetectorConfig c;
// auto type = slsDetector::getTypeFromDetector(c.hostname);
// slsDetector d(type);
// auto type = Module::getTypeFromDetector(c.hostname);
// Module d(type);
// d.setHostname(c.hostname);
// auto period = 1000000000;
@ -382,8 +376,8 @@ TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
}
}
TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegration][dbit]") {
TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
"[.ctbintegration][dbit]") {
SingleDetectorConfig c;
// pick up multi detector from shm id 0
@ -403,27 +397,27 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegrat
// dbit list
std::vector <int> list = m.getReceiverDbitList();
std::vector<int> list = m.getReceiverDbitList();
list.clear();
for (int i = 0; i < 10; ++i)
list.push_back(i);
m.setReceiverDbitList(list);
CHECK(m.getReceiverDbitList().size() == 10);
list.push_back(64);
CHECK_THROWS_AS(m.setReceiverDbitList(list), sls::RuntimeError);
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
Catch::Matchers::Contains("be between 0 and 63"));
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
Catch::Matchers::Contains("be between 0 and 63"));
list.clear();
for (int i = 0; i < 65; ++i)
list.push_back(i);
CHECK(list.size() == 65);
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
Catch::Matchers::Contains("be greater than 64"));
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
Catch::Matchers::Contains("be greater than 64"));
list.clear();
list.clear();
m.setReceiverDbitList(list);
CHECK(m.getReceiverDbitList().empty());
@ -441,8 +435,8 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegrat
m.setExternalSamplingSource(62);
CHECK(m.getExternalSamplingSource() == 62);
CHECK_THROWS_WITH(m.setExternalSamplingSource(64),
Catch::Matchers::Contains("be 0-63"));
CHECK(m.getExternalSamplingSource() == 62);
Catch::Matchers::Contains("be 0-63"));
CHECK(m.getExternalSamplingSource() == 62);
m.setExternalSampling(1);
CHECK(m.getExternalSampling() == 1);
m.setExternalSampling(0);
@ -450,20 +444,23 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegrat
m.setExternalSampling(1);
CHECK(m.getExternalSampling() == 1);
CHECK(m.readRegister(0x7b) == 0x1003E);
}
TEST_CASE("Eiger or Jungfrau startingfnum", "[.eigerintegration][.jungfrauintegration][startingfnum]") {
TEST_CASE("Eiger or Jungfrau startingfnum",
"[.eigerintegration][.jungfrauintegration][startingfnum]") {
SingleDetectorConfig c;
// pick up multi detector from shm id 0
DetectorImpl m(0);
// ensure ctb detector type, hostname and online
REQUIRE(((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER) || (m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::JUNGFRAU)));
REQUIRE(
((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER) ||
(m.getDetectorTypeAsEnum() ==
slsDetectorDefs::detectorType::JUNGFRAU)));
REQUIRE(m.getHostname() == c.hostname);
CHECK(m.setNumberOfFrames(1) == 1);
CHECK(m.setNumberOfFrames(1) == 1);
// starting fnum
uint64_t val = 8;
@ -498,7 +495,8 @@ TEST_CASE("Eiger readnlines", "[.eigerintegration][readnlines]") {
DetectorImpl m(0);
// ensure detector type, hostname
REQUIRE((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER));
REQUIRE(
(m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER));
REQUIRE(m.getHostname() == c.hostname);
m.setDynamicRange(16);
@ -507,7 +505,7 @@ TEST_CASE("Eiger readnlines", "[.eigerintegration][readnlines]") {
CHECK(m.getReadNLines() == 256);
m.setReadNLines(1);
CHECK(m.getReadNLines() == 1);
m.setDynamicRange(8);
m.setReadNLines(256);
CHECK(m.getReadNLines() == 256);

6
integrationTests/test-integrationMulti.cpp Executable file → Normal file
View File

@ -1,5 +1,5 @@
#include "catch.hpp"
#include "DetectorImpl.h"
#include "catch.hpp"
#include "string_utils.h"
#include "tests/globals.h"
#include <iostream>
@ -24,8 +24,6 @@ TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
d.freeSharedMemory();
}
TEST_CASE("Set and read timers", "[.integration][.multi]") {
DetectorImpl d(0, true, true);
@ -57,7 +55,6 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
// PROGRESS, /**< fraction of measurement elapsed - only get! */
// MEASUREMENTS_NUMBER,
// FRAMES_FROM_START,
// FRAMES_FROM_START_PG,
// SAMPLES,
@ -78,7 +75,6 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
CHECK(d.setSubFrameExposureDeadTime(-1) == Approx(subframe_deadtime));
}
if (test::type == dt::EIGER) {
// 32bit is needed for subframe exposure
d.setDynamicRange(32);

View File

@ -99,7 +99,7 @@ If one desires to set the zmqport manually, he offset has to be taken into accou
{\tt{slsMultiReceiver}} uses two or more receivers in one single terminal: {\tt{./slsMultiReceiver startTCPPort numReceivers withCallback}}, where startTCPPort assumes the other ports are consecutively increased.
The command {\tt{r\_framesperfile}} sets the number of frames written in the same file. By default now it is 10000. It can be changes. It needs to be lowered particularly if one wants to parallelize the following conversion of the files.
The command {\tt{r\_framesperfile}} (\tt{\textcolor{red}{rx\_framesperfile}}) sets the number of frames written in the same file. By default now it is 10000. It can be changes. It needs to be lowered particularly if one wants to parallelize the following conversion of the files.
\subsection{Mandatory setup - Client}
@ -122,7 +122,23 @@ To do that:
sls_detector_put 0-config mydetector.config
\end{verbatim}
In the config file, if client, receiver and detector are using \textbf{1GbE} the following lines are mandatory (see slsDetectorsPackage/examples/eiger\_1Gb.config):
In the config file, if client, receiver and detector are using \textbf{1GbE} the following lines are mandatory (see slsDetectorsPackage/examples/eiger\_1Gb.config). It has been adapted to the the new 5.0 major release change:
\begin{verbatim}
detsize 1024 512 #detector geometry, long side of the module first
hostname beb059+beb058+ #1Gb detector hostname for controls
#1Gb receiver pc hostname to be inserted immediately and tcp\_ports to be stated immediately
rx_hostname x12sa-vcons:1991+pc1875:1992+
0:udp_dstport 50011 #udp port first quadrant, first halfmodule
0:udp_dstport2 50012 #udp port second quadrant, first halfmodule
1:udp_dstport 50013 #udp port first quadrant, second halfmodule
1:udp_dstport2 50014 #udp port second quadrant, second halfmodule
0:udp_srcip 129.129.202.237
0:udp_dstip auto
1:udp_srcip 129.129.202.236
1:udp_dstip auto
fpath /sls/X12SA/data/x12saop/Data10/Eiger0.5M
\end{verbatim}
In the old 3.x and 4.x release it was:
\begin{verbatim}
detsizechan 1024 512 #detector geometry, long side of the module first
hostname beb059+beb058+ #1Gb detector hostname for controls
@ -172,23 +188,25 @@ configuremac 0
rx_udpmac xx:xx:...
\end{verbatim}
Now we will give general communication commands. Commands with a diffent name in the \textcolor{red}{5.x} realease will be highlighted in \textcolor{red}{red}.
One can configure all the detector settings in a parameter file {\tt{setup.det}}, which is loaded by doing:
\begin{verbatim}
sls_detector_put 0-parameters setup.det
\end{verbatim}
Note that the parameter file for any realease before 4.1.1 has not the possibility to understand parameters to be set differently for different half modules, i.e. {\tt{0:txndelay\_left xxxxx},\tt{1:txndelay\_left yyyyy}}.
In the case of \E, the proper bias voltage of the sensor has to be setup, i.e. the {\tt{setup.det}} file needs to contain the line {\tt{vhighvoltage 150}}. Other detector functionality, which are rarely changed can be setup here.
In the case of \E, the proper bias voltage of the sensor has to be setup, i.e. the {\tt{setup.det}} file needs to contain the line {\tt{highvoltage 150}}. Other detector functionality, which are rarely changed can be setup here.
Other important settings that are configured in the {\tt{setup.det}} file are:
\begin{itemize}
\item {\tt{tengiga 0/1}}, which sets whether the detector is enabled to send data through the 1~or the 10~Gb Ethernet.
\item {\tt{flags parallel/nonparallel}}, which sets whether the detector is set in parallel acquisition and readout or in sequential mode. This changes the readout time of the chip and affects the frame rate capability (faster is {\tt{parallel}}, with higher noise but needed when the frame rate is $>2$~kHz.
\item {\tt{flags parallel/nonparallel}} or {\tt{\textcolor{red}{parallel 1/0}}}, which sets whether the detector is set in parallel acquisition and readout or in sequential mode. This changes the readout time of the chip and affects the frame rate capability (faster is {\tt{parallel}}).
\item {\tt{dr 32/16/8/4}} sets the detector in autosumming mode (32 bit counter or not autosumming, 12 bit out of the chip). This is strictly connected to what is required for the readout clock of chip. See next point.
\item {\tt{clkdivider 0/1/2}}. Changes the readout clock: 200, 100, 50~MHz (also referred to as full, half, quarter speed). Note that autosumming mode ({\tt{dr 32}} only works at {clkdivider 2}=quarter speed). By selecting Refer to readout timing specifications in~section\ref{timing} for how to set the detector.
\item {\tt{clkdivider 0/1/2}} or {\tt{\textcolor{red}{speed full\_speed/half\_speed/quart\_speed}}}. Changes the readout clock: 200, 100, 50~MHz (also referred to as full, half, quarter speed). Note that autosumming mode ({\tt{dr 32}} only works at \tt{clkdivider 2}=\tt{quart\_speed}). By selecting Refer to readout timing specifications in~section\ref{timing} for how to set the detector.
\item {\tt{flags continuous/storeinram}}. Allows to take frame continuously or storing them on memory. Users should use the {\tt{continuous}} flags. Enabling the {\tt{stroreinram}} flag makes the data to be sent out all at the end of the acquisition. Refer to readout timing specifications in section~\ref{timing} for how to set the detector. Examples will be given in section~\ref{}.
\end{itemize}
One should notice that, by default, by choosing the option {\tt{dr 32}}, then the software automatically sets the detector to {\tt{clkdivider 2}}. By choosing the option {\tt{dr 16}}, the software automatically sets the detector to {\tt{clkdivider 1}}. One needs to choose {\tt{clkdivider 0}} after setting the {\tt{dr 16}} option to have the fastest frame rate.
We would recommend expert users (beamline people) to write their parameters file for the users.
One should notice that, by default, by choosing the option {\tt{dr 32}}, then the software automatically sets the detector to {\tt{clkdivider 2}} ({\tt{\textcolor{red}{quart\_speed}}}). By choosing the option {\tt{dr 16}}, the software automatically sets the detector to {\tt{clkdivider 1}} ({\tt{\textcolor{red}{speed quart\_speed}}}). From release 5.x,
\section{API versioning} \label{api}
The eigerDetectorServer running on the boards has a versioning API scheme that will make it crash if used with a wrong firmware.
@ -209,10 +227,18 @@ Killing and starting the server on the boards allows you to check the firmware v
\section{Setting up the threshold}
\begin{verbatim}
sls_detector_put 0-settingsdir /path
sls_detector_put 0-trimen N xxxx yyyy zzzz
sls_detector_put 0-settings standard
sls_detector_put 0-threshold energy_in_eV standard
\end{verbatim}
or in \textcolor{red}{5.x}:
\begin{verbatim}
sls_detector_put 0-settingspath /path}
sls_detector_put 0-trimen N xxxx yyyy zzzz}
sls_detector_put 0-threshold energy_in_eV standard
\end{verbatim}
The first line requires to specify how many ({\tt{N}}) and at which energies in eV {\{tt{xxxx}}, {\tt{yyyy}}, {\tt{zzzz}} and so on) trimmed files were generated (to allow for an interpolation). This line should normally be included into the {\tt{mydetector.config}} file and should be set for you by one of the detector group.
NORMALLY, in this new calibration scheme, only {\tt{settings standard}} will be provided to you, unless specific cases to be discussed.
The threshold at 6000 eV , for example would be set as:{\tt{sls\_detector\_put 0-threshold 6000 standard}}.
@ -266,12 +292,13 @@ sls_detector_get receiver
There is a more complex way of performing an acquisition, that is useful for debugging and in case one wants a non blocking behavior:
You can then reset to zero the number of frames caught, then start the receiver and the detector:
You can then reset to zero the number of frames caught (in releases<5.0), then start the receiver and the detector:
\begin{enumerate}
\item {\tt{sls\_detector\_put 0-resetframescaught 0}}
\item {\tt{sls\_detector\_put 0-receiver start}}
\item {\tt{sls\_detector\_put 0-status start}}
\end{enumerate}
In release \textcolor{red}{5.0} it is not needed to reset the frames caughts.
You can poll the detector status using:
\begin{verbatim}
@ -346,8 +373,11 @@ col : 257 pixels
\end{verbatim}
\section{Readout timing- maximum frame rate}\label{timing}
IMPORTANT: to have faster readout and smaller dead time, one can configure {\tt{clkdivider}}, i.e. the speed at which the data are read, i.e. 200/100/50~MHz for {\tt{clkdivider 0/1/2}} and the dead time between frames through {\tt{flags parallel}}, i.e. acquire and read at the same time or acquire and then read out.
The configuration of this timing variables allows to achieve different frame rates. NOTE THAT IN EIGER, WHATEVER YOU DO, THE FRAME RATE LIMITATIONS COME FROM THE NETWORK BOTTLENECK AS THE HARDWARE GOES FASTER THAN THE DATA OUT.
IMPORTANT: to have faster readout and smaller dead time, one can configure {\tt{clkdivider}}, i.e. the {\tt{textcolor}{red}{speed} at which the data are read, i.e. 200/100/50~MHz for {\tt{clkdivider 0/1/2}} ({\tt{
\textcolor{red}{speed full\_speed/half\_speed/quart\_speed}}) and the dead time between frames through {\tt{flags parallel}} or {\tt{\textcolor{red}{parallel 1}}}, i.e. acquire and read at the same time or acquire and then read out.
The configuration of this timing variables allows to achieve different frame rates. NOTE THAT IN EIGER, WHATEVER YOU DO, THE FRAME RATE LIMITATIONS COME FROM THE NETWORK BOTTLENECK AS THE HARDWARE GOES FASTER THAN THE DATA OUT. WE recconmmend using the detector in \tt{dr 4/8/16}, \tt{\textcolor{red}{speed full\_speed}}, \tt{parallel 1} or \tt{dr 32}, \tt{\textcolor{red}{speed quart\_speed}}, \tt{parallel 1. All those options are now the defaults options starting from version 5.x.
In the case of REAL CONTINUOUS readout, i.e. continuous acquire and readout from the boards (independent on how the chip is set), the continuous frame rates are listed in table~\ref{tcont}. The time to send out the frame out of the board
\begin{table}
@ -359,16 +389,16 @@ In the case of REAL CONTINUOUS readout, i.e. continuous acquire and readout from
\hline
1 & 32 & \textbf{128} & 7820 & \\
\hline
10 & 4 & \textbf{10240} & 98 & 105/128\\
10 & 4 & \textbf{7813} & 98 & 105/128\\
\hline
10 & 8 & \textbf{5120} & 196 & 210/250\\
10 & 8 & \textbf{4000} & 196 & 210/250\\
\hline
10 & 16 & \textbf{2560} & 391 & 420/490\\
10 & 16 & \textbf{2000} & 391 & 420/490\\
\hline
10 & 32 & \textbf{1280} & 782 & 840/977\\
10 & 32 & \textbf{1023} & 782 & 840/977\\
\hline
\end{tabular}
\caption{Frame rate limits for the CONTINUOS streaming out of images, i.e. the data rate out is just below 1Gb/s or 10Gb/s. 1280~Hz for 32-bit, 10GbE is obtained from the 10GbE limitation. The maximum achievable frame rate is 977~Hz.}
\caption{Frame rate limits for the CONTINUOS streaming out of images, i.e. the data rate out is just below 1Gb/s or 10Gb/s. 1023~Hz for 32-bit, 10GbE is obtained from the 10GbE limitation. The maximum achievable frame rate is 977~Hz.}
\label{tcont}\end{table}
Note that in the {\tt{continuous}} flag mode, some buffering is still done on the memories, so a higher frame rate than the proper real continuous one can be achieved. Still, this extra buffering is possible till the memories are not saturated. The number of images that can be stored on the DDR2 on board memories are listed in table~\ref{timgs}.
\begin{table}
@ -383,11 +413,11 @@ dynamic range & images\\
16 & 7600\\
\hline
\end{tabular}
\caption{Amount of images that can be stored on board. As while we store them, we start to send them out, the effective number of images could be larger than this, but it will depend on the network setup (how fats you stream out images).}
\caption{Amount of images that can be stored on board. As while we store them, we start to send them out, the effective number of images could be larger than this, but it will depend on the network setup (how fast you stream out images).}
\label{timgs}
\end{table}
The maximum frame rate achievable with 10~GbE, {\tt{dr 16}}, {\tt{flags continuous}}, {\tt{flags parallel}},{\tt{clkdivider 0}}, \textbf{6.1~kHz}. This is currently limited by the connection between the Front End Board and the Backend board. We expect the 32 bit mode limit, internally, to be \textbf{2~kHz} ({\tt{clkdivider 2}}).
The maximum frame rate achievable with 10~GbE, {\tt{dr 16}}, {\tt{flags continuous}}, {\tt{flags parallel}} ({\tt{\textcolor{red}{parallel 1}}}),{\tt{clkdivider 0}} ({\tt{\textcolor{red}{speed full\_speed}}}), \textbf{6.1~kHz}. This is currently limited by the connection between the Front End Board and the Backend board. We expect the 32 bit mode limit, internally, to be \textbf{2~kHz} ({\tt{clkdivider 2}}).
In dynamic range {\tt{dr 8}} the frame rate is \textbf{11~kHz} and for{\tt{dr 4}} is \textbf{22~kHz}. For 4 and 8 bit mode the frame rate are directly limited by the speed of the detector chip and not by the readout boards.
\subsection{Minimum time between frames and Maximum frame rate}
@ -458,6 +488,23 @@ where the 'minimum time between frames' and the minimum period will be discussed
\textbf{From software version 4.0.0, there is a very useful function {\tt{sls\_detector\_get measuredperiod}} which return the measured period AFTER the acquisition. This is important to check that the settings to obtain the targeted frame rate was correct.}
In release \textcolor{red}{5.0} in 4-bit modes one can set a sort of ROI in the detector such to read half of the module (the central part) or a quarter of it with almost double or four times the frame rate. By default the \tt{\textcolor{red}{readnlines}} is set to \tt{256} meaning the whole chip. With \tt{\textcolor{red}{readnlines 128}} or \tt{\textcolor{red}{readnlines 64}} one sets to read half/quarter rows from the chip. In table~\ref{table:hfrpartial} the maximum frame rates, exposure time and period for the partial readout.\\
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
readnlines & \# pixels & Active area (cm$^2$) & Max frame rate (kHz) & Period ($\mu$s) & Dead time ($\mu$s) & \# buffered images\\
\hline
256 &1024 $\times$ 512 & 8 $\times$ 3.8 & 22.7 & 44.0 &4.1 & 30k\\
\hline
128 &1024 $\times$ 256 & 8 $\times$ 1.9 & 42.1 & 23.7 &4.2 & 60k\\
\hline
64 & 1024 $\times$ 128 & 8 $\times$ 0.95 & 73.5 & 13.6 &4.2 & 120k\\
\hline
\end{tabular}
\label{table:hfrpartial}
\textbf{If you run too fast, the detector could become noisier (see problem shooting), it is important to match the detector settings to your frame rate. This can be done having more parameters files and load the one suitable with your experiment.} We experienced that with low energy settings could not reach 6~kHz and no noise.
In 16 bit mode, it could make sense, in case of noise and low threshold to either reduce the frame rate:
\begin{equation}
@ -578,10 +625,10 @@ The number of subframes composing a single 32bit acquisition can be calculated a
\end{equation}
This also means that {\tt{exptime}}$<${\tt{subexptime}} will be rounded to{\tt{subexptime}}. If you want shorter acquisitions, either reduce the {\tt{subexptime}} or switch two 16-bit mode (you can always sum offline if needed).
From release 4.0.0, an extra {\tt{flag overflow/nooverflow}} is added, with {\tt{nooverflow}} default:
From release 4.0.0, an extra {\tt{flag overflow/nooverflow}} is added (\tt{\textcolor{red}{overflow 0/1}}), with {\tt{nooverflow}} (\tt{\textcolor{red}{overflow 0}}) default:
\begin{itemize}
\item {\tt{nooverflow}}: the internal 12-bit result is summed, even if there was saturation of the 12-bit counter (4095) in any of the subframes. Note that if there is saturation for every subframe, you might get as a result a value of the counter equal to (4095$\times$~number~of~subframes), which you need to correctly identify. On the other hand if the saturation occurred only one time, you will get something "close'' to the real number.
\item {\tt{overflow}}: In this case, even if a pixel saturate only 1 time in a subframe, you will be returned as a value of the counter for that pixel: $2^{32}-1$, i.e. 4294967295.
\item {\tt{nooverflow}} (\tt{\textcolor{red}{overflow 0}}): the internal 12-bit result is summed, even if there was saturation of the 12-bit counter (4095) in any of the subframes. Note that if there is saturation for every subframe, you might get as a result a value of the counter equal to (4095$\times$~number~of~subframes), which you need to correctly identify. On the other hand if the saturation occurred only one time, you will get something "close'' to the real number.
\item {\tt{overflow}} (\tt{\textcolor{red}{overflow 1}})): In this case, even if a pixel saturate only 1 time in a subframe, you will be returned as a value of the counter for that pixel: $2^{32}-1$, i.e. 4294967295.
\end{itemize}
The UDP header will contain, after you receive the data, the effective number of subframe per image (see section~\ref{UDP}) as "SubFrame Num or Exp Time", i.e. the number of subframes recorded (32 bit eiger).
@ -609,18 +656,19 @@ The detector can be setup such to receive external triggers. Connect a LEMO sign
\begin{verbatim}
sls_detector_put 0-timing [auto/trigger/burst_trigger/gating]
sls_detector_put 0-frames x
sls_detector_put 0-triggers y
sls_detector_put 0-cycles y (\textcolor{red}{triggers})
sls_detector_acquire 0-
\end{verbatim}
No timeout is expected between the start of the acquisition and the arrival of the first trigger.
Here are the implemented options so far:
\begin{itemize}
\item {\tt{auto}} is the software controlled acquisition (does not use triggers), where {\tt{exptime}} and {\tt{period}} have to be set. Set number of triggers (i.e. triggers) to 1 using {\tt{triggers}}. Set number of frames using {\tt{frames}}.
\item {\tt{trigger}} 1 frame taken for 1 trigger. Your {\tt{frames}} needs to be 1 always, {\tt{triggers}} can be changed and defines how many triggers are considered. {\tt{exptime}} needs to be set. In the GUI this is called trigger exposure series.
\item {\tt{burst\_trigger}} gets only 1 trigger, but allows to take many frames. With {\tt{frames}} one can change the number of frames. {\tt{triggers}} needs to be 1. {\tt{exptime}} and {\tt{period}} have to be set. In the gui it is called trigger readout.
\item{\tt{gating}} allows to get a frame only when the trigger pulse is gating. Note that in this case the exp time and period only depend on the gating signal. {\tt{triggers}} allows to select how many gates to consider. Set number of frames to 1 using {\tt{frames}}. IMPORTANT: Up to firmware 23, the last subframe is oblige to finish being taken, despite the gate signal going down. This will be configurable from later fw and software version. Also, in gating mode, due to timimg of the state machine, you need to leave 500~$\mu$s deadtime between the end on an acquisition and the next. This is as the state machine is unable to check for changes in the status in the first 500~$\mu$s. ATTENTION: if you are in 16 bit mode and you are applying online rate corrections, as now the exptime is generated by the trigger, you might not have correct rate corrections. If you know what the exposure time is in the gating signal, then you can set the {\tt{exptime}} once and the rate corrections will be correct. In 32 bit mode, it does not matter as the rate corrections depends on the {\tt{subexptime}} which is software set independently from the gate exptime.
\item {\tt{auto}} is the software controlled acquisition (does not use triggers), where {\tt{exptime}} and {\tt{period}} have to be set. Set number of {\tt{cycles}} (\textcolor{red}{triggers}) to 1. Set number of frames using {\tt{frames}}.
\item {\tt{trigger}} 1 frame taken for 1 trigger. Your {\tt{frames}} needs to be 1 always, {\tt{cycles}} ({\tt{\textcolor{red}{triggers}}}) can be changed and defines how many triggers are considered. {\tt{exptime}} needs to be set. In the GUI this is called trigger exposure series.
\item {\tt{burst\_trigger}} gets only 1 trigger, but allows to take many frames. With {\tt{frames}} one can change the number of frames. {\tt{cycles}} ({\tt{\textcolor{red}{triggers}}}) needs to be 1. {\tt{exptime}} and {\tt{period}} have to be set. In the gui it is called trigger readout.
\item{\tt{gating}} allows to get a frame only when the trigger pulse is gating. Note that in this case the exp time and period only depend on the gating signal. {\tt{cycles}} (\tt{\textcolor{red}{triggers}}) allows to select how many gates to consider. Set number of frames to 1 using {\tt{frames}}. IMPORTANT: Up to firmware 23, the last subframe is oblige to finish being taken, despite the gate signal going down. This will be configurable from later fw and software version. Also, in gating mode, due to timimg of the state machine, you need to leave 500~$\mu$s deadtime between the end on an acquisition and the next. This is as the state machine is unable to check for changes in the status in the first 500~$\mu$s. ATTENTION: if you are in 16 bit mode and you are applying online rate corrections, as now the exptime is generated by the trigger, you might not have correct rate corrections. If you know what the exposure time is in the gating signal, then you can set the {\tt{exptime}} once and the rate corrections will be correct. In 32 bit mode, it does not matter as the rate corrections depends on the {\tt{subexptime}} which is software set independently from the gate exptime.
ATTENTION: From release 4.1.1 with the {\tt{trigger}} option it is possible to have software triggers as a debugging tool (instead of the hardware trigger signal. One should start the acquisition (with the blocking {\tt{sls\_detector\_acquire}} if wanted and with another client one can send the softare trigger {\tt{sls\_detector\_put status trigger}}. This option allows for example to perform a motor scan (moving a motor in between single images) and still writing all images to the same file.
When using 32-bit mode, by default the acquisition ends the last complete subframe that was started when still the acquisition time was valid. This has been chosen as many people wants to know the exact acquisition time for when the detector was taking data and also, if {\tt{ratecorr}} are active, the last subframe will be correctly corrected, while otherwise it will be corrected with a wrong subdeadtime.
However, from 4.1.0, in gating mode, an option to immediately terminate the subframe when the gate signal goes down it is implemented to stop the acquisition at the same time. This option is {\tt{./sls\_detector\_put interruptsubframe 1}} while the default option is {\tt{./sls\_detector\_put interruptsubframe 0}}.
@ -628,13 +676,13 @@ However, from 4.1.0, in gating mode, an option to immediately terminate the subf
Hardware-wise, the ENABLE OUT signal outputs when the chips are really acquiring. This means that the single subframes will be output in 32 bit mode. The TRIGGER OUT outputs the sum-up-signal at the moment (which is useless). This will be changed in the future to output the envelop of the enable signal.
We are planning to change some functionality, i.e. unify the {\tt{trigger}} and {\tt{burst\_trigger}} trigger modes and make both {\tt{frames}} and {\tt{triggers}} configurable at the same time.
We are planning to change some functionality, i.e. unify the {\tt{trigger}} and {\tt{burst\_trigger}} trigger modes and make both {\tt{frames}} and {\tt{cycles}} (\tt{\textcolor{red}{triggers}}) configurable at the same time.
There is the possibility to use {\tt{timing trigger/burst\_trigger}} and send software single commands to fake the trigger. This is done with:
\begin{verbatim}
sls_detector_put 0-timing [trigger/burst_trigger]
sls_detector_put 0-frames x
sls_detector_put 0-triggers y
sls_detector_put 0-cycles y (\textcolor{red}{triggers})
sls_detector_status trigger
\end{verbatim}
Note that this functionality is very (!) useful if you need to do something between and acquisition and the next. This can be used to do a fast threshold scan for example. See section~\ref{sec:fastthresholdscan}.
@ -714,8 +762,8 @@ If \textbf{dr} is 32 and \textbf{clkdivider} is not 2, whatever the detector get
Here is a list of parameters that should be reset:
\begin{enumerate}
\item \textbf{resetframescaught} should be reset to zero after every acquisition taken with {\tt{receiver start}},{\tt{status start}},{\tt{receiver stop}}. If the acquisition is taken with {\tt{sls\_detector\_acquire}}, there is no need to reset this.
\item After changing the {\tt{timing}} mode of the detector, one should reset to '1' the unused value, in that specific timing mode, between \textbf{frames} and \textbf{triggers}. See section~\ref{triggering} for how to use the timing. At the present moment the detector will acquire more frames than planned if the variable not used between \textbf{frames} and \textbf{triggers} is not reset. In future releases, the unused variable will be ignored. Still resetting is a good practice.
\item \textbf{resetframescaught} (only for releases < 5.x) should be reset to zero after every acquisition taken with {\tt{receiver start}},{\tt{status start}},{\tt{receiver stop}}. If the acquisition is taken with {\tt{sls\_detector\_acquire}}, there is no need to reset this.
\item After changing the {\tt{timing}} mode of the detector, one should reset to '1' the unused value, in that specific timing mode, between \textbf{frames} and \textbf{cycles} (\tt{\textcolor{red}{triggers}}). See section~\ref{triggering} for how to use the timing. At the present moment the detector will acquire more frames than planned if the variable not used between \textbf{frames} and \textbf{cycles} (\tt{\textcolor{red}{trigger}}) is not reset. In future releases, the unused variable will be ignored. Still resetting is a good practice.
\end{enumerate}
@ -988,13 +1036,14 @@ Packets Caught Mask : 64 bytes
Note that if one wants to reconstruct the real time the detector was acquiring in 32 bit (autosumming mode), one would have to multiply the SubExptime (ns) for the SubFrame Number.
\subsection{Offline image reconstruction}
The offline image reconstruction{\tt{slsImageReconstruction}} is not part of the package anymore. The code is still available doing \\
{\tt{git clone git@git.psi.ch:sls\_detectors\_software/sls\_image\_reconstruction.git slsImageReconstruction}}.
Checkout the {\tt{developer}} branch if in a 3.1.X release, the {\tt{v4.0.0}} branch if in 4.0.X release, or the {\tt{v4.1}} branch if in 4.1.X release of the {\tt{slsDetector}} code.
The offline image reconstruction{\tt{slsImageReconstruction}} is not part of the package anymore. However, it can be retrieved from \\
{\tt{git clone https://github.com/slsdetectorgroup/slsImageReconstruction.git slsImageReconstruction}}.\\
Checkout the {\tt{v3.1}} branch if in a 3.1.X release, the {\tt{v4.0.0}} branch if in 4.0.X release, or the {\tt{v4.1}} branch if in 4.1.X release of the {\tt{slsDetector}} code. There is a {\tt{developer}} branch that has newer updates but needs to be tested.
Three possible conversions are possible: into \textbf{cbf}, \textbf{hdf5} and \textbf{root} format. The detector writes 4 raw files per receiver. An offline image reconstruction executable has been written to collate the possible files together and produce output files. By default an interpolation between the values of the large pixels is performed. Gap pixels between modules are also inserted.
Three possible conversions are possible: into \textbf{cbf}, \textbf{hdf5}. \textbf{tiff} and \textbf{root} format. The detector writes 2 raw files per receiver. An offline image reconstruction executable has been written to collate the possible files together and produce output files. By default an interpolation between the values of the large pixels is performed. Gap pixels between modules are also inserted.
Note that the number of images per file in the 3.1.X release is hardcoded and needs to match whatever you are using in {\tt{slsDetectorsPackage/slsReceiverSoftware/include/sls\_receiver\_defs.h}}:
Note that the number of images per file in the 3.1.X release is hardcoded and needs to match whatever you are using in \\
{\tt{slsDetectorsPackage/slsReceiverSoftware/include/sls\_receiver\_defs.h}}:
\begin{verbatim}
#define EIGER_MAX_FRAMES_PER_FILE 2000
\end{verbatim}
@ -1043,11 +1092,12 @@ cbfMaker9M [file_name_with_dir]
contain the hardcoded geometry for the 1.5M (3 modules horizontal on the long side), the 1.5M OMNY geometry (3 modules next to each other on the long side) and for the 9M at cSAXS: 6(short side)$\times$3 (long side) modules.\\
Missing packets in a frame and border pixels ($\times 2$ and $\times 4$ are given with value $-1$ at the present time.
From the new {{v4.1.1}} all the define that you see below need only to be modified in the Makefile.
Make sure the following options are uncommented in the {\tt{slsImageReconstruction/src/main\_csaxs.cpp}} file.
\begin{verbatim}
#define MYCBF
##following line only if you need to process with
##BUBBLE (Material Science / uXAS beamlines).
##following line only if you need to process with BUBBLE
#define MSHeader
\end{verbatim}
Compile it with:
@ -1096,6 +1146,10 @@ To use it any geometry:\\
eg.
{\tt image /scratch/run\_63\_d0\_f000000000000\_3.raw 3072 512 1 2 ``Eiger'' 0}.\\
With new new software, the new options to run the cbfMaker/hdf5Maker executablesare:
./hdf5Maker -f [filename] -d [outdirname] -x [npix\_x] -y [npix\_y] -v (v flags that longedge is vertical, no argument) -n [name\_of\_hdf5\_dataset] -m (mask\_hot\_pixels, need to be in file maskpix.txt in the samedir as executable, no argument) -g [0,no filling/1,division/2,interpolation/3,interpolate,alternative]
\subsection{Read temperatures/HV from boards}
With an updated kernel on the linux boards (ask to the SLS detector group for specifications), it is possible to monitor the temperature on the boards:
@ -1120,10 +1174,10 @@ In 500k--2M pixel systems there is a hardware temperature safety switch, which w
The HV can also be set and read through the software:
\begin{verbatim}
./sls_detector_put vhighvoltage 150
./sls_detector_get vhighvoltage
./sls_detector_put highvoltage 150
./sls_detector_get highvoltage
\end{verbatim}
Note that the get {\tt{vhighvoltage}} would return the measured HV from the master module only. If getting the vhighvoltage for individual halfmodules, only the master will have a value different from -999.
Note that the get {\tt{highvoltage}} would return the measured HV from the master module only. If getting the highvoltage for individual halfmodules, only the master will have a value different from -999.
\appendix
@ -1205,13 +1259,21 @@ do the same for the other boards. You can program in parallel many boards, but y
There are two ways to pulse the detector:
\begin{itemize}
\item \textbf{Pulse digitally:} when you are interested to the output readout and do not care about the analog response from the pixels:
\begin{verbatim}
\begin{verbatim}
sls_detector_put vthreshold 4000
sls_detector_put vtr 4000
sls_detector_put pulsechip N #to pulse N
sls_detector_put pulsechip -1 #to get out of testing mode
\end{verbatim}
Note that the answer will be $2 \cdot \textrm{{\tt{N}}} +2$ in this case.
Or in \textcolor{red}{5.x}:
\begin{verbatim}
sls_detector_put vthreshold 4000
sls_detector_put vtrim 4000
sls_detector_put pulsechip N #to pulse N
sls_detector_put pulsechip -1 #to get out of testing mode
\end{verbatim}
Note that the answer will be $2 \cdot \textrm{{\tt{N}}} +4$ in this case.
\item \textbf{Pulse analogically:} You want to really check the analogical part of the detector, not just the readout.
@ -1230,8 +1292,25 @@ sls_detector_put resmat 0
sls_detector_acquire
\end{verbatim}
You read {\tt{N}} in every pixel if you are setup correctly.
or in realese \textcolor{red}{5.x}:
\begin{verbatim}
sls_detector_put vcal 3600
sls_detector_put vthreshold 1700
sls_detector_put vrpreamp 3100
for i in $(seq 0 7) ;
do px=$((-255+i));
sls_detector_put pulse 0 $px 0;
for j in $(seq 0 255) ; do
sls_detector_put pulsenmove 100 0 1;
done;
done;
sls_detector_put partialreset 1
\end{verbatim}
\end{itemize}
\section{Load a noise pattern with shape}
For debug purposes, we have created a noise pattern with a shape. If you reconstruct correctly your image, you should be able to read ".EIGER'' in the same direction for both the top and bottom in normal human readable orientation.
To load the special noise file look at {\tt{settingsdir/eiger/standard/eigernoise.sn0xx}} in the package.
@ -1257,7 +1336,7 @@ We have also been requested if we could speed up the threshold scan. At the mome
./sls_detector_put enablefwrite 0
./sls_detector_put resetframescaught 0
./sls_detector_put index 0
./sls_detector_put triggers 21
./sls_detector_put cycles 21 (\textcolor{red}{triggers})
./sls_detector_put receiver start
./sls_detector_put status start
for i in $(seq 0 20);
@ -1375,7 +1454,7 @@ Environment variable SLSDETNAME can be set for using 2 different detectors from
\subsection{Measure the HV}
For every system:
\begin{itemize}
\item Software-wise measure it (now the software returns the measured value), with {\tt{sls\_detector\_get vhighvoltage}}. The returned value is the HV (for proper Eiger setting is approximately 150~V) if it is correctly set. If two master modules are presents (multi systems), the average is returned (still to be tested). If one asks for the individual $n$ half module bias voltage through {\tt{sls\_detector\_get n:vhighvoltage}}, if the $n$ module is a master, the actual voltage will be returned. If it is a slave, -999 will be returned.
\item Software-wise measure it (now the software returns the measured value), with {\tt{sls\_detector\_get highvoltage}}. The returned value is the HV (for proper Eiger setting is approximately 150~V) if it is correctly set. If two master modules are presents (multi systems), the average is returned (still to be tested). If one asks for the individual $n$ half module bias voltage through {\tt{sls\_detector\_get n:highvoltage}}, if the $n$ module is a master, the actual voltage will be returned. If it is a slave, -999 will be returned.
\item Hardware-wise (opening the detector) measure value of HV on C14 on the power distribution board. Check also that the small HV connector cable is really connected.
\end{itemize}
@ -1426,7 +1505,7 @@ Scroll up in the terminal till you find:\\
There is also an easier way, that is that only the master module will return the real value of the HV. If you have more than 1 detector system, then you will have more than 1 physical master, as the HV needs to be applied to all the systems.
\begin{verbatim}
for i in $(seq 0 36); do sls_detector_put $i:vhighvoltage; done
for i in $(seq 0 36); do sls_detector_put $i:highvoltage; done
\end{verbatim}
Only the master will return to you a sensible number (150 normally). the others will return -999.
@ -1515,8 +1594,8 @@ frames number
where {\tt{number}} is a string to be interpreted as an integer.
\item \begin{verbatim}
sls_detector_get triggers
triggers number
sls_detector_get cycles
cycles number
\end{verbatim}
where {\tt{number}} is a string to be interpreted as an integer.
@ -1587,10 +1666,10 @@ ratecorr number
where {\tt{number}} is a string that should be interpreted as a float in s. 0.000000 means correction off. Values above zero are the value of $\tau$ in ns.
\item \begin{verbatim}
sls_detector_get vhighvoltage
vhighvoltage number
sls_detector_get highvoltage
highvoltage number
\end{verbatim}
where {\tt{number}} is a string that should be interpreted as an int and for proper Eiger setting is approximately 150~V if it is correctly set. If two master modules are presents (multi systems), the average is returned (still to be tested). If one asks for the individual $n$ half module bias voltage through {\tt{sls\_detector\_get n:vhighvoltage}}, if the $n$ module is a master, the actual voltage will be returned. If it is a slave, -999 will be returned.
where {\tt{number}} is a string that should be interpreted as an int and for proper Eiger setting is approximately 150~V if it is correctly set. If two master modules are presents (multi systems), the average is returned (still to be tested). If one asks for the individual $n$ half module bias voltage through {\tt{sls\_detector\_get n:highvoltage}}, if the $n$ module is a master, the actual voltage will be returned. If it is a slave, -999 will be returned.
\item \begin{verbatim}
sls_detector_get busy

View File

@ -142,7 +142,7 @@
"vpreamp"; // sets/get vpreamp value (advanced! Mythen)
"vshaper1"; // sets/get vshaper1 value (advanced! Mythen)
"vshaper2"; // sets/get vshaper2 value (advanced! Mythen)
"vhighvoltage"; // sets/get vhighvoltage value (advanced! Chiptest board and Eiger)
"highvoltage"; // sets/get highvoltage value (advanced! Chiptest board and Eiger)
"vapower"; // sets/get vapower value (advanced! Chiptest board)
"vddpower"; // sets/get vddpower value (advanced! Chiptest board)
"vshpower"; // sets/get vshpower value (advanced! Chiptest board)

View File

@ -335,7 +335,7 @@ Advanced settings changing the analog or digital performance of the acquisition.
\item[vpreamp n] Sets the DAC value of the preamp feedback to n.
\item[vshaper1 n] Sets the DAC value of the shaper1 feedback to n.
\item[vshaper2 n] Sets the DAC value of the shaper2 feedback to n.
\item[vhighvoltage n] Sets the DAC value of the high voltage to n (in V).
\item[highvoltage n] Sets the DAC value of the high voltage to n (in V).
\item[vapower n] CHIPTEST BOARD ONLY - Sets the DAC value of the analog voltage to n.
\item[vddpower n] CHIPTEST BOARD ONLY - Sets the DAC value of the analog voltage to n.
\item[vshpower n] CHIPTEST BOARD ONLY - Sets the comparator power supply in dac units (0-1024).
@ -648,7 +648,7 @@ Advanced settings changing the analog or digital performance of the acquisition.
\item[vpreamp] Returns the DAC value of the preamp feedback to n.
\item[vshaper1] Returns the DAC value of the shaper1 feedback to n.
\item[vshaper2] Returns the DAC value of the shaper2 feedback to n.
\item[vhighvoltage] Returns the DAC value of the high voltage to n.
\item[highvoltage] Returns the DAC value of the high voltage to n.
\item[vapower] CHIPTEST BOARD ONLY - Returns the DAC value of the analog voltage to n.
\item[vddpower] CHIPTEST BOARD ONLY - Returns the DAC value of the analog voltage to n.
\item[vshpower] CHIPTEST BOARD ONLY - Returns the comparator power supply in dac units (0-1024).
@ -714,7 +714,7 @@ One can configure all the detector settings in a parameter file {\tt{setup.det}}
sls_detector_put parameters setup.det
\end{verbatim}
In the case of \E, the parameter file ({\tt{setup.det}} needs to setup the proper bias voltage of the sensor, i.e. needs to contain the line {\tt{vhighvoltage 150}}.
In the case of \E, the parameter file ({\tt{setup.det}} needs to setup the proper bias voltage of the sensor, i.e. needs to contain the line {\tt{highvoltage 150}}.
\subsection{Standard acquisition}

View File

@ -322,7 +322,7 @@ Advanced settings changing the analog or digital performance of the acquisition.
\item[vpreamp n] Sets the DAC value of the preamp feedback to n.
\item[vshaper1 n] Sets the DAC value of the shaper1 feedback to n.
\item[vshaper2 n] Sets the DAC value of the shaper2 feedback to n.
\item[vhighvoltage n] CHIPTEST BOARD ONLY - Sets the DAC value of the high voltage to n.
\item[highvoltage n] CHIPTEST BOARD ONLY - Sets the DAC value of the high voltage to n.
\item[vapower n] CHIPTEST BOARD ONLY - Sets the DAC value of the analog voltage to n.
\item[vddpower n] CHIPTEST BOARD ONLY - Sets the DAC value of the analog voltage to n.
\item[vshpower n] CHIPTEST BOARD ONLY - Sets the comparator power supply in dac units (0-1024).
@ -594,7 +594,7 @@ Advanced settings changing the analog or digital performance of the acquisition.
\item[vpreamp] Returns the DAC value of the preamp feedback to n.
\item[vshaper1] Returns the DAC value of the shaper1 feedback to n.
\item[vshaper2] Returns the DAC value of the shaper2 feedback to n.
\item[vhighvoltage] CHIPTEST BOARD ONLY - Returns the DAC value of the high voltage to n.
\item[highvoltage] CHIPTEST BOARD ONLY - Returns the DAC value of the high voltage to n.
\item[vapower] CHIPTEST BOARD ONLY - Returns the DAC value of the analog voltage to n.
\item[vddpower] CHIPTEST BOARD ONLY - Returns the DAC value of the analog voltage to n.
\item[vshpower] CHIPTEST BOARD ONLY - Returns the comparator power supply in dac units (0-1024).

View File

@ -1,20 +1,23 @@
pybind11_add_module(_sls_detector
# find_package (Python COMPONENTS Interpreter Development)
pybind11_add_module(_slsdet
src/main.cpp
src/enums.cpp
src/detector.cpp
src/network.cpp
)
target_link_libraries(_sls_detector PUBLIC
target_link_libraries(_slsdet PUBLIC
slsDetectorShared
slsReceiverShared
slsSupportLib
zmq )
${ZeroMQ_LIBRARIES}
)
set_target_properties(_sls_detector PROPERTIES
set_target_properties(_slsdet PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
@ -38,8 +41,8 @@ set( PYTHON_FILES
)
foreach(FILE ${PYTHON_FILES})
configure_file( sls_detector/${FILE}
${CMAKE_BINARY_DIR}/bin/sls_detector/${FILE} )
configure_file( slsdet/${FILE}
${CMAKE_BINARY_DIR}/bin/slsdet/${FILE} )
endforeach(FILE ${PYTHON_FILES})

View File

@ -0,0 +1,82 @@
import pytest
import datetime as dt
from slsdet import Detector, timingMode, detectorType
not_eiger = pytest.mark.skipif(
Detector().type == detectorType.EIGER, reason="Does not work for eiger"
)
@pytest.fixture
def det():
from slsdet import Detector
return Detector()
def test_frames(det):
for n in [1, 100, 3245, 10000]:
det.frames = n
assert det.frames == n
det.frames = 1
def test_triggers(det):
for n in [1, 100, 3245, 10000]:
det.triggers = n
assert det.triggers == n
det.triggers = 1
def test_exptime(det):
det.exptime = 1
assert det.exptime == 1
det.exptime = dt.timedelta(milliseconds=10)
assert det.exptime == 0.01
det.exptime = 1
def test_period(det):
det.period = 3.2
assert det.period == 3.2
p = dt.timedelta(microseconds=1020)
det.period = p
assert det.period == 0.001020
r = det.getPeriod()
assert r[0] == p
det.period = 0
assert det.period == 0
def test_lock(det):
for l in [True, False]:
det.lock = l
assert det.lock == l
def test_timing(det):
# auto and trigger is available for all det
for m in [timingMode.TRIGGER_EXPOSURE, timingMode.AUTO_TIMING]:
det.timing = m
assert det.timing == m
@not_eiger
def test_delay(det):
det.delay = 1
assert det.delay == 1
t = dt.timedelta(microseconds=1)
det.delay = t
assert det.delay == t.total_seconds()
r = det.getDelayAfterTrigger()[0]
assert r == t
det.delay = 0
assert det.delay == 0
@not_eiger
def test_delayl(det):
assert det.delayl == 0

View File

@ -0,0 +1,89 @@
import pytest
import datetime as dt
from slsdet import Detector, detectorType
"""
These tests are designed to work the API and catch
any changes in behavior or naming. Tests are expected
to pass with a virtual detector or a real one
"""
@pytest.fixture
def jf():
from slsdet import Jungfrau
return Jungfrau()
jungfrautest = pytest.mark.skipif(
Detector().type != detectorType.JUNGFRAU, reason="Only valid for Jungfrau"
)
@jungfrautest
def test_storagecells(jf):
for i in range(16):
jf.storagecells = i
assert jf.storagecells == i
jf.storagecells = 0 # default
@jungfrautest
def test_storagecell_start(jf):
for i in range(16):
jf.storagecell_start = i
assert jf.storagecell_start == i
jf.storagecells = 15 # default
@jungfrautest
def test_storagecell_delay(jf):
for t in [0.001, 0.0002, 0.0013]:
jf.storagecell_delay = t
assert jf.storagecell_delay == t
jf.storagecell_delay = 0 # default
@jungfrautest
def test_temp_event(jf):
# hard to test with virtual server
assert jf.temp_event == 0
@jungfrautest
def test_temp_threshold(jf):
for th in [0, 10, 43, 72]:
jf.temp_threshold = th
assert jf.temp_threshold == th
jf.temp_threshold = 0
@jungfrautest
def test_auto_comp_disable(jf):
for v in [True, False]:
jf.auto_comp_disable = v
assert jf.auto_comp_disable == v
@jungfrautest
def test_numinterfaces(jf):
for n in [2, 1]:
jf.numinterfaces = n
assert jf.numinterfaces == n
@jungfrautest
def test_dr(jf):
assert jf.dr == 16
@jungfrautest
def test_temp_control(jf):
for v in [True, False]:
jf.temp_control = v
assert jf.temp_control == v
@jungfrautest
def test_startingfnum(jf):
for n in [10, 127, 43321, 1]:
jf.startingfnum = n
assert jf.startingfnum == n
@jungfrautest
def test_selinterface(jf):
for i in [1, 0]:
jf.selinterface = i
assert jf.selinterface == i

View File

@ -3,9 +3,9 @@ import sys
import numpy as np
sys.path.append(os.path.join(os.getcwd(), 'bin'))
from sls_detector import Detector, Mythen3, Eiger, Jungfrau, DetectorDacs, Dac, Ctb
from sls_detector import dacIndex, readoutMode
from sls_detector.lookup import view, find
from slsdet import Detector, Mythen3, Eiger, Jungfrau, DetectorDacs, Dac, Ctb
from slsdet import dacIndex, readoutMode
from slsdet.lookup import view, find
d = Detector()
# e = Eiger()

View File

@ -4,17 +4,18 @@ out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.ge
cmd = out.stdout.splitlines()
cmd.pop(0)
from sls_detector import Detector, Eiger, Ctb
from slsdet import Detector, Eiger, Ctb
pycmd = dir(Detector)+dir(Eiger)+dir(Ctb)
#Add commands that we should not expect as direct commands in python
pycmd += ['vrf', 'vtr', 'vrs', 'vtgstv', 'vsvn', 'vtrim',
'vsvp', 'vth1', 'vth2', 'vth3', 'vshaper', 'vshaperneg', 'rxb_rb',
'rxb_lb', 'vref_prech', 'vref_rstore', 'vref_cds',
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
, 'vcmp_rl', 'vcmp_rr']
, 'vcmp_rl', 'vcmp_rr', 'daclist', 'dacvalues', 'vcal', 'vcas']
missing = []
for c in cmd:

View File

@ -11,6 +11,10 @@ import subprocess
from parse import remove_comments
def single_line_enum(line):
sub = line[line.find('{')+1:line.find('}')]
return sub.strip().split(',')
def extract_enums(lines):
line_iter = iter(lines)
enums = {}
@ -18,19 +22,27 @@ def extract_enums(lines):
m = re.search("(?<=enum )\w+(?= {)", line)
if m:
enum_name = m.group()
# print(enum_name)
print(enum_name)
# print(line)
fields = []
while True:
l = next(line_iter)
if '};' in l:
break
m = re.search("\w+", l)
try:
# print('\t', m.group())
fields.append(m.group())
except:
pass
#deal with single line enums
if '};' in line:
fields = single_line_enum(line)
else:
#deal with multi line enums
while True:
l = next(line_iter)
if '};' in l:
break
m = re.search("\w+", l)
try:
# print('\t', m.group())
fields.append(m.group())
except:
pass
fields = [f.strip() for f in fields]
enums[enum_name] = fields
return enums

View File

@ -13,12 +13,18 @@ import argparse
from parse import system_include_paths
default_build_path = "/home/l_frojdh/sls/build/"
default_build_path = "/home/l_frojdh/sls/build/"
fpath = "../../slsDetectorSoftware/src/Detector.cpp"
parser = argparse.ArgumentParser()
parser.add_argument("-p", "--build_path", help="Path to the build database", type = str, default=default_build_path)
parser.add_argument(
"-p",
"--build_path",
help="Path to the build database",
type=str,
default=default_build_path,
)
cargs = parser.parse_args()
db = cindex.CompilationDatabase.fromDirectory(cargs.build_path)
@ -26,7 +32,7 @@ index = cindex.Index.create()
args = db.getCompileCommands(fpath)
args = list(iter(args).__next__().arguments)[0:-1]
args = args + "-x c++ --std=c++11".split()
syspath = system_include_paths('clang++')
syspath = system_include_paths("clang++")
incargs = ["-I" + inc for inc in syspath]
args = args + incargs
@ -39,6 +45,9 @@ ag = []
lines = []
ag2 = []
cn = []
def get_arguments(node):
args = [a.type.spelling for a in node.get_arguments()]
@ -46,9 +55,25 @@ def get_arguments(node):
"py::arg() = Positions{}" if item == "sls::Positions" else "py::arg()"
for item in args
]
args = ', '.join(args)
args = ", ".join(args)
if args:
args = f', {args}'
args = f", {args}"
return args
def get_fdec(node):
args = [a.type.spelling for a in node.get_arguments()]
if node.result_type.spelling:
return_type = node.result_type.spelling
else:
return_type = 'void'
if node.is_const_method():
const = 'const'
else:
const = ''
args = ", ".join(args)
args = f'({return_type}(Detector::*)({args}){const})'
return args
@ -62,23 +87,37 @@ def visit(node):
):
m.append(child)
args = get_arguments(child)
lines.append(f'.def(\"{child.spelling}\", &Detector::{child.spelling}{args})')
fs = get_fdec(child)
lines.append(
f'.def("{child.spelling}",{fs} &Detector::{child.spelling}{args})'
)
cn.append(child)
for child in node.get_children():
visit(child)
# .def("setRxHostname",
# (void (Detector::*)(const std::string &, Positions)) &
# Detector::setRxHostname,
# py::arg(), py::arg() = Positions{})
# .def("setRxHostname",
# (void (Detector::*)(const std::vector<std::string> &)) &
# Detector::setRxHostname,
# py::arg())
visit(tu.cursor)
with open('../src/detector_in.cpp') as f:
with open("../src/detector_in.cpp") as f:
data = f.read()
s = ''.join(lines)
s += ';'
text = data.replace('[[FUNCTIONS]]', s)
warning = '/* WARINING This file is auto generated any edits might be overwritten without warning */\n\n'
with open('../src/detector.cpp', 'w') as f:
s = "".join(lines)
s += ";"
text = data.replace("[[FUNCTIONS]]", s)
warning = "/* WARINING This file is auto generated any edits might be overwritten without warning */\n\n"
with open("../src/detector.cpp", "w") as f:
f.write(warning)
f.write(text)
# run clang format on the output
subprocess.run(['clang-format', '../src/detector.cpp', '-i'])
subprocess.run(["clang-format", "../src/detector.cpp", "-i"])

29
python/scripts/list_tested_cmd.py Normal file → Executable file
View File

@ -1,11 +1,19 @@
"""
Utility to find and list which command line functions have tests and
where the tests are located
"""
#local import for for parsing c++
import parse
from pathlib import Path
#General python stuff
import os
import locale
import argparse
path = Path('../../slsDetectorSoftware/tests/')
import subprocess
from pathlib import Path
#Realative path from this dir
path = Path('../../slsDetectorSoftware/tests/')
parser = argparse.ArgumentParser()
parser.add_argument("-s", "--startswith", help="for filter", type = str, default=None)
args = parser.parse_args()
@ -15,15 +23,12 @@ tested = []
for fname in files:
with open(path/fname) as f:
data = f.read()
data = parse.remove_comments(data)
data = data.splitlines()
for line in data:
if 'TEST_CASE' in line or 'SECTION' in line:
cmd = line.split("\"")[1]
tested.append(cmd)
tested.append([cmd, fname])
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
all_cmd = out.stdout.splitlines()
@ -33,18 +38,18 @@ all_cmd.pop(0)
if args.startswith is not None:
all_cmd = [cmd for cmd in all_cmd if cmd.startswith(args.startswith)]
tested = [cmd for cmd in tested if cmd.startswith(args.startswith)]
tested = [cmd for cmd in tested if cmd[0].startswith(args.startswith)]
tn = [cmd[0] for cmd in tested]
not_tested = [cmd for cmd in all_cmd if cmd not in tested]
misnamed = [cmd for cmd in tested if cmd not in all_cmd]
tested = [cmd for cmd in tested if cmd in all_cmd]
not_tested = [cmd for cmd in all_cmd if cmd not in tn]
misnamed = [cmd for cmd in tn if cmd not in all_cmd]
tested = [cmd for cmd in tested if cmd[0] in all_cmd]
print("\nThe following commands are tested:")
for cmd in tested:
print(cmd)
print(f'{cmd[0]:>18} : {cmd[1]}')
print("\nThe following commands are NOT tested:")
for cmd in not_tested:

View File

@ -1,5 +1,5 @@
"""
Setup file for sls_detector
Setup file for slsdet
Build upon the pybind11 example found here: https://github.com/pybind/python_example
"""
from setuptools import setup, Extension, find_packages
@ -8,7 +8,7 @@ import sys
import setuptools
import os
__version__ = 'refactor'
__version__ = os.environ.get('GIT_DESCRIBE_TAG', 'developer')
def get_conda_path():
@ -19,32 +19,33 @@ def get_conda_path():
return os.environ['CONDA_PREFIX']
class get_pybind_include(object):
"""Helper class to determine the pybind11 include path
The purpose of this class is to postpone importing pybind11
until it is actually installed, so that the ``get_include()``
method can be invoked. """
# class get_pybind_include(object):
# """Helper class to determine the pybind11 include path
# The purpose of this class is to postpone importing pybind11
# until it is actually installed, so that the ``get_include()``
# method can be invoked. """
def __init__(self, user=False):
self.user = user
# def __init__(self, user=False):
# self.user = user
def __str__(self):
import pybind11
return pybind11.get_include(self.user)
# def __str__(self):
# import pybind11
# return pybind11.get_include(self.user)
ext_modules = [
Extension(
'_sls_detector',
'_slsdet',
['src/main.cpp',
'src/enums.cpp',
'src/detector.cpp',
'src/network.cpp'],
include_dirs=[
# Path to pybind11 headers
get_pybind_include(),
get_pybind_include(user=True),
os.path.join(get_conda_path(), 'include/slsDetectorPackage'),
# get_pybind_include(),
# get_pybind_include(user=True),
os.path.join('../libs/pybind11/include'),
os.path.join(get_conda_path(), 'include'),
],
libraries=['SlsDetector', 'SlsReceiver', 'zmq'],
@ -109,20 +110,28 @@ class BuildExt(build_ext):
opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version())
for ext in self.extensions:
ext.extra_compile_args = opts
build_ext.build_extensions(self)
print('**************************************************')
print(ct)
print(opts)
print('**************************************************')
build_ext.build_extensions(self)
def get_shared_lib():
return [f for f in os.listdir('.') if '_slsdet' in f]
setup(
name='sls_detector',
name='slsdet',
version=__version__,
author='Erik Frojdh',
author_email='erik.frojdh@psi.ch',
url='https://github.com/slsdetectorgroup/sls_detector',
url='https://github.com/slsdetectorgroup/slsDetectorPackage',
description='Detector API for SLS Detector Group detectors',
long_description='',
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
ext_modules=ext_modules,
install_requires=['pybind11>=2.2'],
cmdclass={'build_ext': BuildExt},
zip_safe=False,
)

View File

@ -27,7 +27,7 @@ dr 32
threaded 1
tengiga 0
vhighvoltage 150
highvoltage 150
iodelay 660
#gappixels 1

View File

@ -1 +1 @@
vhighvoltage 200
highvoltage 200

View File

@ -1,23 +0,0 @@
# from .detector import Detector, DetectorError, free_shared_memory
from .eiger import Eiger
from .ctb import Ctb
from .dacs import DetectorDacs, Dac
from .detector import Detector
from .jungfrau import Jungfrau
from .mythen3 import Mythen3
# from .jungfrau_ctb import JungfrauCTB
# from _sls_detector import DetectorApi
import _sls_detector
defs = _sls_detector.slsDetectorDefs
runStatus = _sls_detector.slsDetectorDefs.runStatus
speedLevel = _sls_detector.slsDetectorDefs.speedLevel
timingMode = _sls_detector.slsDetectorDefs.timingMode
dacIndex = _sls_detector.slsDetectorDefs.dacIndex
detectorType = _sls_detector.slsDetectorDefs.detectorType
detectorSettings = _sls_detector.slsDetectorDefs.detectorSettings
readoutMode = _sls_detector.slsDetectorDefs.readoutMode
IpAddr = _sls_detector.IpAddr
MacAddr = _sls_detector.MacAddr

View File

@ -1,9 +0,0 @@
from .detector import Detector
def view(name):
names = find(name)
for n in names:
print(n)
def find(name):
return [n for n in dir(Detector) if name in n]

37
python/slsdet/__init__.py Executable file
View File

@ -0,0 +1,37 @@
# from .detector import Detector, DetectorError, free_shared_memory
from .eiger import Eiger
from .ctb import Ctb
from .dacs import DetectorDacs, Dac
from .detector import Detector
from .jungfrau import Jungfrau
from .mythen3 import Mythen3
# from .jungfrau_ctb import JungfrauCTB
# from _slsdet import DetectorApi
import _slsdet
defs = _slsdet.slsDetectorDefs
runStatus = _slsdet.slsDetectorDefs.runStatus
speedLevel = _slsdet.slsDetectorDefs.speedLevel
detectorType = _slsdet.slsDetectorDefs.detectorType
frameDiscardPolicy = _slsdet.slsDetectorDefs.frameDiscardPolicy
fileFormat = _slsdet.slsDetectorDefs.fileFormat
dimension = _slsdet.slsDetectorDefs.dimension
externalSignalFlag = _slsdet.slsDetectorDefs.externalSignalFlag
timingMode = _slsdet.slsDetectorDefs.timingMode
dacIndex = _slsdet.slsDetectorDefs.dacIndex
detectorSettings = _slsdet.slsDetectorDefs.detectorSettings
clockIndex = _slsdet.slsDetectorDefs.clockIndex
readoutMode = _slsdet.slsDetectorDefs.readoutMode
masterFlags = _slsdet.slsDetectorDefs.masterFlags
frameModeType = _slsdet.slsDetectorDefs.frameModeType
detectorModeType = _slsdet.slsDetectorDefs.detectorModeType
burstMode = _slsdet.slsDetectorDefs.burstMode
timingSourceType = _slsdet.slsDetectorDefs.timingSourceType
IpAddr = _slsdet.IpAddr
MacAddr = _slsdet.MacAddr

View File

@ -1,8 +1,8 @@
from .detector import Detector
from .utils import element_if_equal
from .dacs import DetectorDacs
import _sls_detector
dacIndex = _sls_detector.slsDetectorDefs.dacIndex
import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty
class CtbDacs(DetectorDacs):

View File

@ -1,9 +1,9 @@
from .detector_property import DetectorProperty
from functools import partial
import numpy as np
import _sls_detector
import _slsdet
from .detector import freeze
dacIndex = _sls_detector.slsDetectorDefs.dacIndex
dacIndex = _slsdet.slsDetectorDefs.dacIndex
class Dac(DetectorProperty):
"""
This class represents a dac on the detector. One instance handles all

View File

@ -1,23 +1,29 @@
from _sls_detector import CppDetectorApi
from _sls_detector import slsDetectorDefs
from _slsdet import CppDetectorApi
from _slsdet import slsDetectorDefs
from _slsdet import IpAddr, MacAddr
runStatus = slsDetectorDefs.runStatus
timingMode = slsDetectorDefs.timingMode
speedLevel = slsDetectorDefs.speedLevel
dacIndex = slsDetectorDefs.dacIndex
detectorType = slsDetectorDefs.detectorType
from .utils import element_if_equal, all_equal, get_set_bits, list_to_bitmask
from .utils import Geometry, to_geo, element
from .utils import Geometry, to_geo, element, reduce_time, is_iterable
from . import utils as ut
from .registers import Register, Adc_register
import datetime as dt
from functools import wraps
from collections import namedtuple
import socket
def freeze(cls):
cls._frozen = False
def frozensetattr(self, key, value):
if self._frozen and not hasattr(self, key):
if self._frozen and not key in dir(self):
raise AttributeError(
"Class {} is frozen. Cannot set {} = {}".format(
cls.__name__, key, value
@ -57,23 +63,16 @@ class Detector(CppDetectorApi):
self._register = Register(self)
self._adc_register = Adc_register(self)
# CONFIGURATION
def __len__(self):
return self.size()
def __repr__(self):
return '{}(id = {})'.format(self.__class__.__name__,
self.getShmId())
return "{}(id = {})".format(self.__class__.__name__, self.getShmId())
def free(self):
self.freeSharedMemory()
@property
def config(self):
return NotImplementedError("config is set only")
@ -109,7 +108,7 @@ class Detector(CppDetectorApi):
@property
def server_version(self):
#TODO! handle hex print
# TODO! handle hex print
return element_if_equal(self.getDetectorServerVersion())
@property
@ -130,7 +129,7 @@ class Detector(CppDetectorApi):
@dr.setter
def dr(self, dr):
self.setDynamicRange(dr)
self.setDynamicRange(dr)
@property
def module_geometry(self):
@ -161,65 +160,54 @@ class Detector(CppDetectorApi):
def frames(self, n_frames):
self.setNumberOfFrames(n_frames)
@property
def triggers(self):
return element_if_equal(self.getNumberOfTriggers())
@triggers.setter
def triggers(self, n_triggers):
self.setNumberOfTriggers(n_triggers)
@property
def exptime(self):
res = self.getExptime()
return element_if_equal([it.total_seconds() for it in res])
if self.type == detectorType.MYTHEN3:
res = self.getExptimeForAllGates()
else:
res = self.getExptime()
return reduce_time(res)
@exptime.setter
def exptime(self, t):
if isinstance(t, dt.timedelta):
self.setExptime(t)
else:
self.setExptime(dt.timedelta(seconds=t))
@property
def subexptime(self):
res = self.getSubExptime()
return element_if_equal([it.total_seconds() for it in res])
@subexptime.setter
def subexptime(self, t):
if isinstance(t, dt.timedelta):
self.setSubExptime(t)
else:
self.setSubExptime(dt.timedelta(seconds=t))
@property
def subdeadtime(self):
res = self.getSubDeadTime()
return element_if_equal([it.total_seconds() for it in res])
@subdeadtime.setter
def subdeadtime(self, t):
if isinstance(t, dt.timedelta):
self.setSubDeadTime(t)
else:
self.setSubDeadTime(dt.timedelta(seconds=t))
self.setExptime(t)
@property
def period(self):
res = self.getPeriod()
return element_if_equal([it.total_seconds() for it in res])
return reduce_time(res)
@period.setter
def period(self, t):
if isinstance(t, dt.timedelta):
self.setPeriod(t)
else:
self.setPeriod(dt.timedelta(seconds=t))
self.setPeriod(t)
@property
@element
def delay(self):
return ut.reduce_time(self.getDelayAfterTrigger())
@delay.setter
def delay(self, t):
self.setDelayAfterTrigger(t)
@property
@element
def delayl(self):
return ut.reduce_time(self.getDelayAfterTriggerLeft())
# Time
@property
def rx_framescaught(self):
return element_if_equal(self.getFramesCaught())
@property
def startingfnum(self):
@ -228,10 +216,7 @@ class Detector(CppDetectorApi):
@startingfnum.setter
def startingfnum(self, value):
self.setStartingFrameNumber(value)
#TODO! add txdelay
# TODO! add txdelay
@property
def use_receiver(self):
@ -297,14 +282,21 @@ class Detector(CppDetectorApi):
@property
def rx_lastclient(self):
return element_if_equal(self.getRxLastClientIP())
# FILE
@property
@element
def numinterfaces(self):
return self.getNumberofUDPInterfaces()
#FILE
@numinterfaces.setter
def numinterfaces(self, value):
self.setNumberofUDPInterfaces(value)
@property
def fformat(self):
return element_if_equal(self.getFileFormat())
@fformat.setter
def fformat(self, format):
self.setFileFormat(format)
@ -415,14 +407,15 @@ class Detector(CppDetectorApi):
def zmqip(self, ip):
self.setClientZmqIp(ip)
@property
def udp_dstip(self):
return element_if_equal(self.getDestinationUDPIP())
@udp_dstip.setter
def udp_dstip(self, ip):
self.getDestinationUDPIP(ip)
if ip == "auto":
ip = socket.gethostbyname(self.rx_hostname)
self.setDestinationUDPIP(IpAddr(ip))
@property
def udp_dstip2(self):
@ -430,7 +423,9 @@ class Detector(CppDetectorApi):
@udp_dstip2.setter
def udp_dstip2(self, ip):
self.getDestinationUDPIP2(ip)
if ip == "auto":
ip = socket.gethostbyname(self.rx_hostname)
self.setDestinationUDPIP2(IpAddr(ip))
@property
def udp_dstmac(self):
@ -438,7 +433,7 @@ class Detector(CppDetectorApi):
@udp_dstmac.setter
def udp_dstmac(self, mac):
self.getDestinationUDPMAC2(mac)
self.setDestinationUDPMAC(MacAddr(mac))
@property
def udp_dstmac2(self):
@ -446,8 +441,7 @@ class Detector(CppDetectorApi):
@udp_dstmac2.setter
def udp_dstmac2(self, mac):
self.getDestinationUDPMAC2(mac)
self.setDestinationUDPMAC2(MacAddr(mac))
@property
def udp_srcip(self):
@ -455,7 +449,7 @@ class Detector(CppDetectorApi):
@udp_srcip.setter
def udp_srcip(self, ip):
self.setSourceUDPIP(ip)
self.setSourceUDPIP(IpAddr(ip))
@property
def udp_srcip2(self):
@ -487,7 +481,7 @@ class Detector(CppDetectorApi):
@src_udpmac.setter
def src_udpmac(self, mac):
self.setSourceUDPMAC(mac)
self.setSourceUDPMAC(MacAddr(mac))
@property
def src_udpip2(self):
@ -495,7 +489,7 @@ class Detector(CppDetectorApi):
@src_udpip2.setter
def src_udpip2(self, ip):
self.setSourceUDPIP(ip)
self.setSourceUDPIP(IpAddr(ip))
@property
def src_udpip(self):
@ -503,8 +497,7 @@ class Detector(CppDetectorApi):
@src_udpip.setter
def src_udpip(self, ip):
self.setSourceUDPIP(ip)
self.setSourceUDPIP(IpAddr(ip))
@property
def src_udpmac2(self):
@ -512,14 +505,14 @@ class Detector(CppDetectorApi):
@src_udpmac2.setter
def src_udpmac2(self, mac):
self.setSourceUDPMAC2(mac)
self.setSourceUDPMAC2(MacAddr(mac))
@property
def vhighvoltage(self):
def highvoltage(self):
return element_if_equal(self.getHighVoltage())
@vhighvoltage.setter
def vhighvoltage(self, v):
@highvoltage.setter
def highvoltage(self, v):
self.setHighVoltage(v)
@property
@ -542,8 +535,6 @@ class Detector(CppDetectorApi):
def rx_status(self):
return element_if_equal(self.getReceiverStatus())
@property
def rx_udpsocksize(self):
return element_if_equal(self.getRxUDPSocketBufferSize())
@ -558,7 +549,7 @@ class Detector(CppDetectorApi):
@property
def trimbits(self):
return NotImplementedError('trimbits are set only')
return NotImplementedError("trimbits are set only")
@trimbits.setter
def trimbits(self, fname):
@ -592,7 +583,6 @@ class Detector(CppDetectorApi):
def adcreg(self):
return self._adc_register
@property
def led(self):
return element_if_equal(self.getLEDEnable())
@ -611,13 +601,12 @@ class Detector(CppDetectorApi):
self.setRateCorrection(tau)
@property
def clkdivider(self):
res = [int(value) for value in self.getSpeed()]
return element_if_equal(res)
def speed(self):
return element_if_equal(self.getSpeed())
@clkdivider.setter
def clkdivider(self, value):
self.setSpeed(speedLevel(value))
@speed.setter
def speed(self, value):
self.setSpeed(value)
@property
def frameindex(self):
@ -633,11 +622,11 @@ class Detector(CppDetectorApi):
@property
def timing(self):
return element_if_equal(self.getTimingMode())
return element_if_equal(self.getTimingMode())
@timing.setter
def timing(self, mode):
self.setTimingMode(mode)
self.setTimingMode(mode)
@property
def trimen(self):
@ -649,9 +638,7 @@ class Detector(CppDetectorApi):
@property
def vthreshold(self):
return element_if_equal(self.getDAC(dacIndex.THRESHOLD))
return element_if_equal(self.getDAC(dacIndex.VTHRESHOLD, False))
@property
def type(self):
@ -665,10 +652,27 @@ class Detector(CppDetectorApi):
def rx_missingpackets(self):
return element_if_equal(self.getNumMissingPackets())
"""
Some Eiger stuff, does this have to be here or can we move it to subclass?
"""
@property
def subexptime(self):
res = self.getSubExptime()
return reduce_time(res)
@subexptime.setter
def subexptime(self, t):
self.setSubExptime(t)
@property
def subdeadtime(self):
res = self.getSubDeadTime()
reduce_time(res)
@subdeadtime.setter
def subdeadtime(self, t):
self.setSubDeadTime(t)
@property
def partialreset(self):
return element_if_equal(self.getPartialReset())
@ -680,7 +684,7 @@ class Detector(CppDetectorApi):
@property
def tengiga(self):
return element_if_equal(self.getTenGiga())
@tengiga.setter
def tengiga(self, value):
self.setTenGiga(value)
@ -728,19 +732,116 @@ class Detector(CppDetectorApi):
return element_if_equal([it.total_seconds() for it in res])
@property
def storeinram(self):
return element_if_equal(self.getStoreInRamMode())
"""
Jungfrau specific
"""
@storeinram.setter
def storeinram(self, value):
self.setStoreInRamMode(value)
@property
@element
def auto_comp_disable(self):
return self.getAutoCompDisable()
@auto_comp_disable.setter
def auto_comp_disable(self, value):
self.setAutoCompDisable(value)
@property
@element
def storagecells(self):
return self.getNumberOfAdditionalStorageCells()
@storagecells.setter
def storagecells(self, n_cells):
self.setNumberOfAdditionalStorageCells(n_cells)
@property
@element
def storagecell_start(self):
return self.getStorageCellStart()
@storagecell_start.setter
def storagecell_start(self, value):
self.setStorageCellStart(value)
@property
@element
def storagecell_delay(self):
return ut.reduce_time(self.getStorageCellDelay())
@storagecell_delay.setter
def storagecell_delay(self, t):
self.setStorageCellDelay(t)
@property
@element
def temp_threshold(self):
return self.getThresholdTemperature()
@temp_threshold.setter
def temp_threshold(self, value):
self.setThresholdTemperature(value)
@property
@element
def temp_event(self):
return self.getTemperatureEvent()
@temp_event.setter
def temp_event(self, value):
if value != 0:
raise ValueError("Value needs to be 0 for reset. Setting not allowed")
self.resetTemperatureEvent()
@property
@element
def temp_control(self):
return self.getTemperatureControl()
@temp_control.setter
def temp_control(self, value):
self.setTemperatureControl(value)
@property
@element
def selinterface(self):
return self.getSelectedUDPInterface()
@selinterface.setter
def selinterface(self, i):
self.selectUDPInterface(i)
"""
Gotthard2
"""
@property
@element
def veto(self):
return self.getVeto()
@veto.setter
def veto(self, value):
self.setVeto(value)
"""
Mythen3 specific
"""
@property
def gatedelay(self):
return reduce_time(self.getGateDelayForAllGates())
@gatedelay.setter
def gatedelay(self, value):
if is_iterable(value):
if len(value) == 3:
for i, v in enumerate(value):
self.setGateDelay(i, v)
else:
self.setGateDelay(-1, value)
@property
def counters(self):
mask = self.getCounterMask()
@ -750,11 +851,10 @@ class Detector(CppDetectorApi):
else:
return [get_set_bits(m) for m in mask]
@counters.setter
def counters(self, values):
self.setCounterMask(list_to_bitmask(values))
"""
CTB stuff
"""
@ -802,7 +902,7 @@ class Detector(CppDetectorApi):
@property
def dbitclk(self):
return element_if_equal(self.getDBITClock())
@dbitclk.setter
def dbitclk(self, value):
self.setDBITClock(value)
@ -842,7 +942,7 @@ class Detector(CppDetectorApi):
@property
def adcphase(self):
return element_if_equal(self.getADCPhase())
@adcphase.setter
def adcphase(self, value):
self.setADCPhase(value)
@ -866,21 +966,13 @@ class Detector(CppDetectorApi):
@property
def syncclk(self):
return element_if_equal(self.getSYNCClock())
@property
def pattern(self):
#TODO! Clean fix
# TODO! Clean fix
print("Set only")
return 0
@property
def patclkctrl(self):
return element_if_equal(self.getPatternClockControl())
@patclkctrl.setter
def patclkctrl(self, mask):
self.setPatternClockControl(mask)
# patioctrl
@property
def patioctrl(self):
@ -958,7 +1050,6 @@ class Detector(CppDetectorApi):
def patwaittime2(self, nclk):
self.setPatternWaitTime(2, nclk)
@property
def patloop0(self):
return element_if_equal(self.getPatternLoopAddresses(0))
@ -1007,7 +1098,6 @@ class Detector(CppDetectorApi):
def patnloop2(self, n):
self.setPatternLoopCycles(2, n)
@property
@element
def v_a(self):
@ -1085,4 +1175,4 @@ class Detector(CppDetectorApi):
@property
@element
def im_io(self):
return self.getMeasuredCurrent(dacIndex.I_POWER_IO)
return self.getMeasuredCurrent(dacIndex.I_POWER_IO)

View File

@ -11,8 +11,8 @@ from .detector import Detector
# from .adcs import Adc, DetectorAdcs
from .dacs import DetectorDacs
import _sls_detector
dacIndex = _sls_detector.slsDetectorDefs.dacIndex
import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty
# from .utils import element_if_equal
# from sls_detector.errors import DetectorValueError, DetectorError
@ -60,23 +60,23 @@ class EigerDacs(DetectorDacs):
"""
Eiger specific dacs
"""
_dacs = [('vsvp', dacIndex.SVP,0, 4000, 0),
('vtr', dacIndex.VTR,0, 4000, 2500),
('vrf', dacIndex.VRF,0, 4000, 3300),
('vrs', dacIndex.VRS,0, 4000, 1400),
('vsvn', dacIndex.SVN,0, 4000, 4000),
('vtgstv', dacIndex.VTGSTV,0, 4000, 2556),
('vcmp_ll', dacIndex.VCMP_LL,0, 4000, 1500),
('vcmp_lr', dacIndex.VCMP_LR,0, 4000, 1500),
('vcall', dacIndex.CAL,0, 4000, 4000),
('vcmp_rl', dacIndex.VCMP_RL,0, 4000, 1500),
('rxb_rb', dacIndex.RXB_RB,0, 4000, 1100),
('rxb_lb', dacIndex.RXB_LB,0, 4000, 1100),
('vcmp_rr', dacIndex.VCMP_RR,0, 4000, 1500),
('vcp', dacIndex.VCP,0, 4000, 200),
('vcn', dacIndex.VCN,0, 4000, 2000),
('vis', dacIndex.VIS,0, 4000, 1550),
('iodelay', dacIndex.IO_DELAY,0, 4000, 660)]
_dacs = [('vsvp', dacIndex.VSVP,0, 4000, 0),
('vtrim', dacIndex.VTRIM,0, 4000, 2500),
('vrpreamp', dacIndex.VRPREAMP,0, 4000, 3300),
('vrshaper', dacIndex.VRSHAPER,0, 4000, 1400),
('vsvn', dacIndex.VSVN,0, 4000, 4000),
('vtgstv', dacIndex.VTGSTV,0, 4000, 2556),
('vcmp_ll', dacIndex.VCMP_LL,0, 4000, 1500),
('vcmp_lr', dacIndex.VCMP_LR,0, 4000, 1500),
('vcal', dacIndex.VCAL,0, 4000, 4000),
('vcmp_rl', dacIndex.VCMP_RL,0, 4000, 1500),
('rxb_rb', dacIndex.RXB_RB,0, 4000, 1100),
('rxb_lb', dacIndex.RXB_LB,0, 4000, 1100),
('vcmp_rr', dacIndex.VCMP_RR,0, 4000, 1500),
('vcp', dacIndex.VCP,0, 4000, 200),
('vcn', dacIndex.VCN,0, 4000, 2000),
('vishaper', dacIndex.VISHAPER,0, 4000, 1550),
('iodelay', dacIndex.IO_DELAY,0, 4000, 660)]
_dacnames = [_d[0] for _d in _dacs]
# # noinspection PyProtectedMember

View File

@ -9,8 +9,8 @@ from .detector import Detector, freeze
# from .adcs import Adc, DetectorAdcs
from .dacs import DetectorDacs
import _sls_detector
dacIndex = _sls_detector.slsDetectorDefs.dacIndex
import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty
# @freeze

9
python/slsdet/lookup.py Normal file
View File

@ -0,0 +1,9 @@
from .detector import Detector
def view(name, det = Detector):
names = find(name, det)
for n in names:
print(n)
def find(name, det = Detector):
return [n for n in dir(det) if name.lower() in n.lower()]

View File

@ -9,53 +9,36 @@ from .detector import Detector, freeze
# from .adcs import Adc, DetectorAdcs
from .dacs import DetectorDacs
import _sls_detector
dacIndex = _sls_detector.slsDetectorDefs.dacIndex
import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty
# vcassh 1200,
# vth2 2800,
# vshaper 1280,
# vshaperneg 2800,
# vipre_out 1220,
# vth3 2800,
# vth1 2800,
# vicin 1708,
# vcas 1800,
# vpreamp 1100,
# vpl 1100,
# vipre 2624,
# viinsh 1708,
# vph 1712,
# vtrim 2800,
# vdcsh 800
# @freeze
class Mythen3Dacs(DetectorDacs):
"""
Jungfrau specific DACs
"""
_dacs = [('vcassh', dacIndex.CASSH, 0, 4000, 1220),
_dacs = [('vcassh', dacIndex.VCASSH, 0, 4000, 1220),
('vth2', dacIndex.VTH2, 0, 4000, 2800),
('vshaper', dacIndex.SHAPER1, 0, 4000, 1280),
('vshaperneg', dacIndex.SHAPER2, 0, 4000, 2800),
('vrshaper', dacIndex.VRSHAPER, 0, 4000, 1280),
('vrshaper_n', dacIndex.VRSHAPER_N, 0, 4000, 2800),
('vipre_out', dacIndex.VIPRE_OUT, 0, 4000, 1220),
('vth3', dacIndex.VTH3, 0, 4000, 2800),
('vth1', dacIndex.THRESHOLD, 0, 4000, 2800),
('vth1', dacIndex.VTH1, 0, 4000, 2800),
('vicin', dacIndex.VICIN, 0, 4000, 1708),
('vcas', dacIndex.CAS, 0, 4000, 1800),
('vpreamp', dacIndex.PREAMP, 0, 4000, 1100),
('vpl', dacIndex.VPL, 0, 4000, 1100),
('vcas', dacIndex.VCAS, 0, 4000, 1800),
('vrpreamp', dacIndex.VRPREAMP, 0, 4000, 1100),
('vcal_n', dacIndex.VCAL_N, 0, 4000, 1100),
('vipre', dacIndex.VIPRE, 0, 4000, 2624),
('viinsh', dacIndex.VIINSH, 0, 4000, 1708),
('vph', dacIndex.CALIBRATION_PULSE, 0, 4000, 1712),
('vtrim', dacIndex.TRIMBIT_SIZE, 0, 4000, 2800),
('vdcsh', dacIndex.VDCSH, 0, 4000, 800),
('vishaper', dacIndex.VISHAPER, 0, 4000, 1708),
('vcal_p', dacIndex.VCAL_P, 0, 4000, 1712),
('vtrim', dacIndex.VTRIM, 0, 4000, 2800),
('vdcsh', dacIndex.VDCSH, 0, 4000, 800),
]
_dacnames = [_d[0] for _d in _dacs]
#vthreshold??
@freeze

View File

@ -5,12 +5,19 @@ but not directly used in controlling the detector
from collections import namedtuple
import _sls_detector #C++ lib
import _slsdet #C++ lib
import functools
import datetime as dt
Geometry = namedtuple('Geometry', ['x', 'y'])
def is_iterable(item):
try:
iter(item)
except TypeError:
return False
return True
def get_set_bits(mask):
"""
Return a list of the set bits in a python integer
@ -29,7 +36,7 @@ def list_to_bitmask(values):
return mask
def to_geo(value):
if isinstance(value, _sls_detector.xy):
if isinstance(value, _slsdet.xy):
return Geometry(x = value.x, y = value.y)
else:
raise ValueError("Can only convert sls_detector.xy")
@ -41,6 +48,9 @@ def all_equal(mylist):
def element_if_equal(mylist):
"""If all elements are equal return only one element"""
if not is_iterable(mylist):
return mylist
if all_equal(mylist):
if len(mylist) == 0:
return None
@ -49,6 +59,15 @@ def element_if_equal(mylist):
else:
return mylist
def reduce_time(mylist):
res = element_if_equal(element_if_equal(mylist))
if isinstance(res, dt.timedelta):
return res.total_seconds()
elif isinstance(res[0], list):
return [[item.total_seconds() for item in subl] for subl in res]
else:
return [r.total_seconds() for r in res]
def element(func):
"""
Wrapper to return either list or element
@ -69,3 +88,8 @@ def eiger_register_to_time(register):
exponent = register & 0b111
return clocks*10**exponent / 100e6
def make_timedelta(t):
if isinstance(t, dt.timedelta):
return t
else:
return dt.timedelta(seconds=t)

View File

@ -1,20 +0,0 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = sls_detector_tools
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

View File

@ -1,134 +0,0 @@
Code quality
=============================
For usability and reliability of the software the code needs to be high quality. For this
project it means meeting the four criteria described below. Any addition should pass all of
them.
--------------------------------
Look, read and feel like Python
--------------------------------
When using classes and functions from the
package it should feel like you are using Python tools and be forces
to write C++ style code with Python syntax.
::
with xray_box.shutter_open():
for th in threshold:
d.vthreshold = th
d.acq()
should be preferred over
::
N = len(threshold)
xray_box.open_shutter()
for i in range(N):
d.dacs.set_dac('vthreshold', threshold[i])
d.acq()
xray_box.close_shutter()
even if the difference might seem small.
--------------------
Have documentation
--------------------
Classes and functions should be documented with doc-strings
in the source code. Preferably with examples. The syntax to be used
is numpy-sphinx.
::
def function(arg):
"""
This is a function that does something
Parameters
----------
arg: int
An argument
Returns
--------
value: double
Returns a value
"""
return np.sin(arg+np.pi)
---------------------------------
Pass static analysis with pylint
---------------------------------
Yes, anything less than 9/10 just means that you are lazy. If
there is a good reason why to diverge, then we can always
add an exception.
Currently the following additions are made:
* good-names: x, y, ax, im etc.
* function arguments 10
* Whitelist: numpy, _sls
-----------------------
Tested code
-----------------------
Last but not least... *actually last just because of the long list included.*
All code that goes in should have adequate tests. If a new function does not
have a minimum of one test it does not get added.
**Unit-tests with pytest and mocker**
::
----------- coverage: platform linux, python 3.6.4-final-0 -----------
Name Stmts Miss Cover
------------------------------------------------
sls_detector/__init__.py 4 0 100%
sls_detector/decorators.py 14 3 79%
sls_detector/detector.py 461 115 75%
sls_detector/eiger.py 150 64 57%
sls_detector/errors.py 7 0 100%
sls_detector/jungfrau.py 59 26 56%
------------------------------------------------
TOTAL 695 208 70%
========= 78 passed in 0.60 seconds =========
**Simple integration tests**
These tests require a detector connected. Performs simple tasks like setting
exposure time and reading back to double check the value
::
----------- coverage: platform linux, python 3.6.4-final-0 -----------
Name Stmts Miss Cover
------------------------------------------------
sls_detector/__init__.py 4 0 100%
sls_detector/decorators.py 14 0 100%
sls_detector/detector.py 461 103 78%
sls_detector/eiger.py 150 20 87%
sls_detector/errors.py 7 0 100%
sls_detector/jungfrau.py 59 26 56%
------------------------------------------------
TOTAL 695 149 79%
========= 67 passed, 1 skipped in 16.66 seconds =========
**Complex integration test**
Typical measurements. Might require X-rays. Tests are usually evaluated from
plots

View File

@ -1,370 +0,0 @@
Command line to Python
=========================
If you are already familiar with the command line interface to the
slsDetectorSoftware here is a quick reference translating to Python commands
.. note ::
Commands labeled Mythen only or Gotthard only are currently not implemented in the
Python class. If you need this functionallity please contact the SLS Detector Group
.. py:currentmodule:: sls_detector
.. |ro| replace:: *(read only)*
.. |free| replace:: :py:func:`Detector.free_shared_memory`
.. |sub| replace:: :py:attr:`Detector.sub_exposure_time`
.. |mg| replace:: Mythen and Gotthard only
.. |g| replace:: Gotthard only
.. |m| replace:: Mythen only
.. |msp| replace:: :py:attr:`Detector.measured_subperiod`
.. |new_chiptest| replace:: New chip test board only
.. |chiptest| replace:: Chip test board only
.. |dr| replace:: :py:attr:`Detector.dynamic_range`
.. |j| replace:: Jungfrau only
.. |te| replace:: :py:attr:`Detector.trimmed_energies`
.. |temp_fpgaext| replace:: :py:attr:`Detector.temp`.fpgaext
.. |epa| replace:: :py:func:`Eiger.pulse_all_pixels`
.. |rfc| replace:: :py:func:`Detector.reset_frames_caught`
.. |rfi| replace:: :py:attr:`Detector.receiver_frame_index`
.. |ron| replace:: :py:attr:`Detector.receiver_online`
.. |flipy| replace:: :py:attr:`Detector.flipped_data_y`
.. |flipx| replace:: :py:attr:`Detector.flipped_data_x`
.. |adcr| replace:: :py:func:`DetectorApi.writeAdcRegister`
.. |sb| replace:: :py:func:`DetectorApi.setBitInRegister`
.. |cb| replace:: :py:func:`DetectorApi.clearBitInRegister`
.. |tempth| replace:: :py:attr:`Jungfrau.temperature_threshold`
.. |tempev| replace:: :py:attr:`Jungfrau.temperature_event`
.. |tempco| replace:: :py:attr:`Jungfrau.temperature_control`
.. |depr| replace:: *Deprecated/Internal*
.. |nimp| replace:: *Not implemented*
.. |rudp| replace:: :py:attr:`Detector.rx_realudpsocksize`
.. |lci| replace:: :py:attr:`Detector.last_client_ip`
.. |rlci| replace:: :py:attr:`Detector.receiver_last_client_ip`
.. |fdp| replace:: :py:attr:`Detector.frame_discard_policy`
.. |apic| replace:: :py:attr:`Detector.api_compatibility`
------------------------
Commands
------------------------
===================== ===================================== ================== =========
Command Python Implementation Tests
===================== ===================================== ================== =========
sls_detector_acquire :py:func:`Detector.acq` OK OK
test |depr| \- \-
help help(Detector.acq) \- \-
exitserver |depr| \- \-
exitreceiver |depr| \- \-
flippeddatay |flipy| OK \-
digitest |depr| \- \-
bustest |depr| \- \-
digibittest Which detector? \- \-
reg :py:attr:`Detector.register` OK \-
adcreg |adcr| OK \-
setbit |sb| OK \-
clearbit |cb| OK \-
getbit |nimp| \- \-
r_compression Not implemented in receiver \- \-
acquire :py:func:`Detector.acq` OK \-
busy :py:attr:`Detector.busy` OK Partial
status :py:attr:`Detector.status` OK |ro| \-
status start :py:func:`Detector.start_detector` OK \-
status stop :py:func:`Detector.stop_detector` OK \-
data |depr| \- \-
frame |depr| \- \-
readctr |g| \- \-
resetctr |g| \- \-
resmat :py:attr:`Eiger.eiger_matrix_reset` OK OK
free |free| OK \-
hostname :py:attr:`Detector.hostname` OK OK
add |nimp| \- \-
replace |nimp| \- \-
user |nimp| \- \-
master |nimp| \- \-
sync Which detector? \- \-
online :py:attr:`Detector.online` OK \-
checkonline |nimp| \- \-
activate :py:attr:`Eiger.active` \- \-
nmod :py:attr:`Detector.n_modules` OK \-
maxmod |depr| \- \-
dr |dr| OK OK
roi |g| \- \-
detsizechan :py:attr:`Detector.image_size` OK \-
roimask |nimp| \- \-
flippeddatax |flipx| OK \-
tengiga :py:attr:`Eiger.tengiga` OK \-
gappixels :py:attr:`Eiger.add_gappixels` OK \-
flags :py:attr:`Detector.flags` OK \-
extsig |mg| \- \-
programfpga |j| \- \-
resetfpga |j| \- \-
powerchip :py:attr:`Jungfrau.powerchip` \- \-
led |nimp| \- \-
auto_comp_disable |j| \- \-
pulse Used in |epa| OK \-
pulsenmove Used in |epa| OK \-
pulsechip :py:func:`Eiger.pulse_chip` OK \-
checkdetversion |apic| \- \-
checkrecversion |apic| \- \-
moduleversion |m| \- \-
detectornumber :py:attr:`Detector.detector_number` OK \-
modulenumber |m| \- \-
detectorversion :py:attr:`Detector.firmware_version` OK OK
softwareversion :py:attr:`Detector.server_version` \- \-
thisversion :py:attr:`Detector.client_version` Reads date \-
receiverversion :py:attr:`Detector.receiver_version` Reads date \-
timing :py:attr:`Detector.timing_mode` OK \-
exptime :py:attr:`Detector.exposure_time` OK OK
subexptime |sub| OK OK
period :py:attr:`Detector.period` OK OK
subdeadtime :py:attr:`Eiger.sub_deadtime` OK OK
delay :py:attr:`Jungfrau.delay` OK \-
gates :py:attr:`Jungfrau.n_gates` OK \-
frames :py:attr:`Detector.n_frames` OK OK
cycles :py:attr:`Detector.n_cycles` OK \-
probes :py:attr:`Jungfrau.n_probes` OK \-
measurements :py:attr:`Detector.n_measurements` OK \-
samples Chip test board only (new?) \- \-
storagecells :py:attr:`Jungfrau.n_storagecells` OK \-
storagecell_start :py:attr:`Jungfrau.storagecell_start` OK \-
exptimel |mg| \- \-
periodl |mg| \- \-
delayl |mg| \- \-
gatesl |mg| \- \-
framesl |mg| \- \-
cyclesl |mg| \- \-
probesl |mg| \- \-
now |nimp| \- \-
timestamp |m| \- \-
nframes |nimp| \- \-
measuredperiod :py:attr:`Detector.measured_period` OK \-
measuredsubperiod |msp| \- \-
clkdivider :py:attr:`Detector.readout_clock` OK OK
setlength |m| \- \-
waitstates |m| \- \-
totdivider |m| \- \-
totdutycycle |m| \- \-
phasestep |g| \- \-
oversampling |new_chiptest| \- \-
adcclk |new_chiptest| \- \-
adcphase |new_chiptest| \- \-
adcpipeline |new_chiptest| \- \-
dbitclk |new_chiptest| \- \-
dbitphase |new_chiptest| \- \-
dbitpipeline |new_chiptest| \- \-
config :py:func:`Detector.load_config` OK \-
rx_printconfig |nimp| \- \-
parameters :py:func:`Detector.load_parameters` OK \-
setup |nimp| \- \-
flatfield |nimp| \- \-
ffdir |nimp| \- \-
ratecorr :py:attr:`Detector.rate_correction` OK \-
badchannels |nimp| \- \-
angconv |m| \- \-
globaloff |nimp| \- \-
fineoff |nimp| \- \-
binsize |nimp| \- \-
angdir |nimp| \- \-
moveflag |nimp| \- \-
samplex |nimp| \- \-
sampley |nimp| \- \-
threaded :py:attr:`Detector.threaded` OK \-
darkimage |nimp| \- \-
gainimage |nimp| \- \-
settingsdir :py:attr:`Detector.settings_path` OK \-
trimdir |nimp| \- \-
caldir |nimp| \- \-
trimen :py:attr:`Detector.trimmed_energies` OK \-
settings :py:attr:`Detector.settings` OK \-
threshold :py:attr:`Detector.threshold` OK \-
thresholdnotb |nimp| \- \-
trimbits :py:func:`Detector.load_trimbits` OK \-
trim |nimp| \- \-
trimval :py:attr:`Detector.trimbits` OK OK
pedestal |nimp| \- \-
vthreshold :py:attr:`Detector.vthreshold` OK \-
vcalibration |nimp| \- \-
vtrimbit |nimp| \- \-
vpreamp |nimp| \- \-
vshaper1 |nimp| \- \-
vshaper2 |nimp| \- \-
vhighvoltage :py:attr:`Detector.high_voltage` OK \-
vapower |nimp| \- \-
vddpower |nimp| \- \-
vshpower |nimp| \- \-
viopower |nimp| \- \-
vref_ds :py:attr:`Jungfrau.dacs.vref_ds` OK \-
vcascn_pb |nimp| \- \-
vcascp_pb |nimp| \- \-
vout_cm |nimp| \- \-
vcasc_out |nimp| \- \-
vin_cm |nimp| \- \-
vref_comp |nimp| \- \-
ib_test_c |nimp| \- \-
dac0 |nimp| \- \-
dac1 |nimp| \- \-
dac2 |nimp| \- \-
dac3 |nimp| \- \-
dac4 |nimp| \- \-
dac5 |nimp| \- \-
dac6 |nimp| \- \-
dac7 |nimp| \- \-
vsvp :py:attr:`Eiger.dacs.vsvp` OK \-
vsvn :py:attr:`Eiger.dacs.vsvn` OK \-
vtr :py:attr:`Eiger.dacs.vtr` OK \-
vrf :py:attr:`Eiger.dacs.vrf` OK \-
vrs :py:attr:`Eiger.dacs.vrs` OK \-
vtgstv :py:attr:`Eiger.dacs.vtgstv` OK \-
vcmp_ll :py:attr:`Eiger.dacs.vcmp_ll` OK \-
vcmp_ll :py:attr:`Eiger.dacs.vcmp_ll` OK \-
vcall :py:attr:`Eiger.dacs.vcall` OK \-
vcmp_rl :py:attr:`Eiger.dacs.vcmp_rl` OK \-
vcmp_rr :py:attr:`Eiger.dacs.vcmp_rr` OK \-
rxb_rb :py:attr:`Eiger.dacs.rxb_rb` OK \-
rxb_lb :py:attr:`Eiger.dacs.rxb_lb` OK \-
vcp :py:attr:`Eiger.dacs.vcp` OK \-
vcn :py:attr:`Eiger.dacs.vcn` OK \-
vis :py:attr:`Eiger.dacs.vis` OK \-
iodelay :py:attr:`Eiger.dacs.iodelay` OK \-
dac |nimp| \- \-
adcvpp |nimp| \- \-
v_a |nimp| \- \-
v_b |nimp| \- \-
v_c |nimp| \- \-
v_d |nimp| \- \-
v_io |nimp| \- \-
v_chip |nimp| \- \-
v_limit |nimp| \- \-
vIpre |nimp| \- \-
VcdSh |nimp| \- \-
Vth1 |nimp| \- \-
Vth2 |nimp| \- \-
Vth3 |nimp| \- \-
VPL |nimp| \- \-
Vtrim |nimp| \- \-
vIbias |nimp| \- \-
vIinSh |nimp| \- \-
cas |nimp| \- \-
casSh |nimp| \- \-
vIbiasSh |nimp| \- \-
vIcin |nimp| \- \-
vIpreOut |nimp| \- \-
temp_adc |nimp| \- \-
temp_fpga :py:attr:`Detector.temp`.fpga OK \-
temp_fpgaext |temp_fpgaext| OK \-
temp_10ge :py:attr:`Detector.temp`.t10ge OK \-
temp_dcdc :py:attr:`Detector.temp`.dcdc OK \-
temp_sodl :py:attr:`Detector.temp`.sodl OK \-
temp_sodr :py:attr:`Detector.temp`.sodr OK \-
adc |nimp| \- \-
temp_fpgafl :py:attr:`Detector.temp`.fpgafl OK \-
temp_fpgafr :py:attr:`Detector.temp`.fpgafr OK \-
i_a |nimp| \- \-
i_b |nimp| \- \-
i_c |nimp| \- \-
i_d |nimp| \- \-
i_io |nimp| \- \-
vm_a |nimp| \- \-
vm_b |nimp| \- \-
vm_c |nimp| \- \-
vm_d |nimp| \- \-
vm_io |nimp| \- \-
temp_threshold |tempth| \- \-
temp_control |tempco| \- \-
temp_event |tempev| \- \-
outdir :py:attr:`Detector.file_path` OK OK
fname :py:attr:`Detector.file_name` OK OK
index :py:attr:`Detector.file_index` OK OK
enablefwrite :py:attr:`Detector.file_write` OK OK
overwrite :py:attr:`Detector.file_overwrite` OK \-
currentfname |nimp| \- \-
fileformat :py:attr:`Detector.file_format` OK \-
positions |depr| \- \-
startscript |depr| \- \-
startscriptpar |depr| \- \-
stopscript |depr| \- \-
stopscriptpar |depr| \- \-
scriptbefore |depr| \- \-
scriptbeforepar |depr| \- \-
scriptafter |depr| \- \-
scriptafterpar |depr| \- \-
headerafter |depr| \- \-
headerbefore |depr| \- \-
headerbeforepar |depr| \- \-
headerafterpar |depr| \- \-
encallog |depr| \- \-
angcallog |depr| \- \-
scan0script |depr| \- \-
scan0par |depr| \- \-
scan0prec |depr| \- \-
scan0steps |depr| \- \-
scan0range |depr| \- \-
scan1script |depr| \- \-
scan1par |depr| \- \-
scan1prec |depr| \- \-
scan1steps |depr| \- \-
scan1range |depr| \- \-
rx_hostname :py:attr:`Detector.rx_hostname` OK \-
rx_udpip :py:attr:`Detector.rx_udpip` OK \-
rx_udpmac :py:attr:`Detector.rx_udpmac` OK \-
rx_udpport :py:attr:`Detector.rx_udpport` OK \-
rx_udpport2 :py:attr:`Detector.rx_udpport` OK \-
rx_udpsocksize :py:attr:`Detector.rx_udpsocksize` OK \-
rx_realudpsocksize |rudp| OK
detectormac :py:attr:`Detector.detector_mac` OK \-
detectorip :py:attr:`Detector.detector_ip` OK \-
txndelay_left :py:attr:`Eiger.delay`.left OK \-
txndelay_right :py:attr:`Eiger.delay`.right OK \-
txndelay_frame :py:attr:`Eiger.delay`.frame OK \-
flowcontrol_10g :py:attr:`Eiger.flowcontrol_10g` OK \-
zmqport :py:attr:`Detector.client_zmqport` Read \-
rx_zmqport :py:attr:`Detector.rx_zmqport` Read \-
rx_datastream :py:attr:`Detector.rx_datastream` OK \-
zmqip :py:attr:`Detector.client_zmqip` OK \-
rx_zmqip :py:attr:`Detector.rx_zmqip` Read \-
rx_jsonaddheader :py:attr:`Detector.rx_jsonaddheader` OK \-
configuremac :py:attr:`Detector.config_network` OK \-
rx_tcpport :py:attr:`Detector.rx_tcpport`
port |nimp| \- \-
stopport |nimp| \- \-
lock :py:attr:`Detector.lock` OK \-
lastclient :py:attr:`Detector.last_client_ip` OK \-
receiver start :py:func:`Detector.start_receiver` OK \-
receiver stop :py:func:`Detector.stop_receiver` \- \-
r_online |ron| OK \-
r_checkonline |nimp| \- \-
framescaught :py:attr:`Detector.frames_caught` OK \-
resetframescaught |rfc| OK \-
frameindex |rfi| OK \-
r_lock :py:attr:`Detector.lock_receiver` OK \-
r_lastclient |rlci| OK \-
r_readfreq |nimp| \- \-
rx_fifodepth :py:attr:`Detector.rx_fifodepth` OK \-
r_silent |nimp| \- \-
r_framesperfile :py:attr:`Detector.n_frames_per_file` OK \-
r_discardpolicy |fdp| OK \-
r_padding :py:attr:`Detector.file_padding` OK \-
adcinvert |chiptest| \- \-
adcdisable |chiptest| \- \-
pattern |chiptest| \- \-
patword |chiptest| \- \-
patioctrl |chiptest| \- \-
patclkctrl |chiptest| \- \-
patlimits |chiptest| \- \-
patloop0 |chiptest| \- \-
patnloop0 |chiptest| \- \-
patwait0 |chiptest| \- \-
patwaittime0 |chiptest| \- \-
patloop1 |chiptest| \- \-
patnloop1 |chiptest| \- \-
patwait1 |chiptest| \- \-
patwaittime1 |chiptest| \- \-
patloop2 |chiptest| \- \-
patnloop2 |chiptest| \- \-
patwait2 |chiptest| \- \-
patwaittime2 |chiptest| \- \-
dut_clk |chiptest| \- \-
===================== ===================================== ================== =========

View File

@ -1,178 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# sls_detector_tools documentation build configuration file, created by
# sphinx-quickstart on Wed Nov 1 10:17:29 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx.ext.autosummary']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'sls_detector'
copyright = '2019, Sls Detector Group'
author = 'Erik Frojdh'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '4.0.1'
# The full version, including alpha/beta/rc tags.
release = '4.0.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
'donate.html',
]
}
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'sls_detector_doc'
napoleon_use_ivar = True
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'sls_detector.tex', 'sls_detector Documentation',
'Erik Frojdh', 'manual'),
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'sls_detector_tools', 'sls_detector_tools Documentation',
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'py_sls', 'py_sls Documentation',
author, 'py_sls', 'One line description of project.',
'Miscellaneous'),
]

View File

@ -1,12 +0,0 @@
C++ API
=====================================================
.. py:currentmodule:: _sls_detector
.. autoclass:: DetectorApi
:members:
:undoc-members:

View File

@ -1,67 +0,0 @@
Error handling
=========================
Check input in Python
----------------------
As far as possible we try to check the input on the Python side
before calling the slsDeteectorsSoftware. Errors should not pass
silently but raise an exception
::
#Trimbit range for Eiger is 0-63
detector.trimbits = 98
(...)
ValueError: Trimbit setting 98 is outside of range:0-63
Errors in slsDetectorsSoftware
-------------------------------
The slsDetectorsSoftware uses a mask to record errors from the different
detectors. If an error is found we raise a RuntimeError at the end of the
call using the error message from slsDetectorsSoftware
.. todo ::
Implement this for all functions
::
detector.settings = 'bananas'
(...)
RuntimeError: Detector 0:
Could not set settings.
Detector 1:
Could not set settings.
Detector 2:
Could not set settings.
Using decorators
-------------------
Using decorators we can reset the error mask before the command and then
check it after the command
.. code-block:: python
#add decorator to check the error mask
@error_handling
def some_function():
a = 1+1
return a
Communication with the detector is usually the biggest overhead so
this does not impact performance.
::
%timeit d.exposure_time
>> 1.52 ms ± 5.42 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
%timeit d.decorated_exposure_time
>> 1.53 ms ± 3.18 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)

View File

@ -1,122 +0,0 @@
Getting started
================
------------------------
Setting up the detector
------------------------
All configuration of the detector can either be done from the Python
API (including loading config file) or externally. The detector setup is
discovered from the shared memory when launching a new script. Because the
detector usually should remain online longer than a specific script it is
recommended to run the receivers seperate.
---------------------------------
Setting and getting attributes
---------------------------------
Most of the detector and software setting are implemented as attributes
in the Detector class. When something is assigned it is also set
in the detector and when the attribute is called using dot notation it
it looked up from the detector.
::
#Currently Eiger and Jungfrau but Detector should work for all
from sls_detector import Eiger()
d = Eiger()
d.file_write = True
d.vthreshold = 1500
d.frame_index
>> 12
d.file_name
>> 'run'
---------------------------------
Working with DACs
---------------------------------
The following examples assumes an Eiger500k detector. But the same syntax
works for other detector sizes and models.
::
d.dacs
>>
========== DACS =========
vsvp : 0, 0
vtr : 4000, 4000
vrf : 2000, 2300
vrs : 1400, 1400
vsvn : 4000, 4000
vtgstv : 2556, 2556
vcmp_ll : 1500, 1500
vcmp_lr : 1500, 1500
vcall : 3500, 3600
vcmp_rl : 1500, 1500
rxb_rb : 1100, 1100
rxb_lb : 1100, 1100
vcmp_rr : 1500, 1500
vcp : 1500, 1500
vcn : 2000, 2000
vis : 1550, 1550
iodelay : 660, 660
#Read dac values to a variable
vrf = d.dacs.vrf[:]
#Set a dac in a module
d.dacs.vrf[0] = 1500
d.dacs.vrf[0]
>> 1500
#Set vrf to the same value in all moduels
d.dacs.vrf = 1500
#Set a dac using an iterable
d.dacs.vrf = [1500, 1600]
d.dacs.vrf
>> vrf : 1500, 1600
#Set dacs iterating on index and values
d.dacs.vrf[0,1] = 1300,1400
---------------------------------
Operating multiple detectors
---------------------------------
Operating multiple detectors is supported by assigning an id when creating the object. If no id is
set it defaults to 0.
::
d0 = Eiger() #id is now 0
d1 = Jungfrau(1)
#Or explicitly
d1 = Jungfrau(id = 0)
The detectors now operate independently of each other but can be synchronized using a hardware trigger.
::
from sls_detector import Eiger
d0 = Eiger(0)
d1 = Eiger(1)
d0.load_config('/some/path/T45.config')
d1.load_config('/some/path/T62.config')
d0.n_frames = 1
d0.exposure_time = 1
d0.timing_mode = 'trigger'
d1.n_frames = 5
d1.exposure_time = 0.2
d1.timing_mode = 'trigger'

View File

@ -1,30 +0,0 @@
sls_detector - Python interface for the slsDetectorsPackage
==============================================================
sls_detector provide Python bindings to the slsDetectorsPackage using mainly the
DetectorImpl API. This module contains two parts, a compiled C module to
expose the API and a Python class to offer a more Pythonic interface.
.. toctree::
:maxdepth: 3
:caption: Contents:
installation
getting_started
code_quality
command_line
examples
error-handling
sls_detector
cpp_api
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -1,90 +0,0 @@
Installation
=========================
The easiest way to install the Python API and the slsDetectorPackage is using conda. But other
methods are also available.
---------------------
Install using conda
---------------------
If you don't have it installed get the latest version of `Miniconda`_
.. _Miniconda: https://conda.io/miniconda.html
::
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh Miniconda3-latest-Linux-x86_64.sh
Install sls_detector and sls_detector_lib using:
::
#Add conda channels
conda config --add channels conda-forge
conda config --add channels slsdetectorgroup
#Install latest version
conda install sls_detector
#Install specific version
conda install sls_detector=3.0.1
------------------------------
Local build using conda-build
------------------------------
Needs the `sls_detector_lib`_ installed in order to automatically find headers
and shared libraries. Make sure that the branch of sls_detector matches the lib
version installed.
.. _sls_detector_lib: https://github.com/slsdetectorgroup/sls_detector_lib
::
#Clone source code
git clone https://github.com/slsdetectorgroup/sls_detector.git
#Checkout the branch needed
git checkout 3.0.1
#Build and install the local version
conda-build sls_detector
conda install --use-local sls_detector
-----------------------
Developer build
-----------------------
IF you if you are developing and are making constant changes to the code it's a bit cumbersome
to build with conda and install. Then an easier way is to build the C/C++ parts in the package
directory and temporary add this to the path
::
#in path/to/sls_detector
python setup.py build_ext --inplace
Then in your Python script
::
import sys
sys.path.append('/path/to/sls_detector')
from sls_detector import Detector
--------------
Prerequisites
--------------
All dependencies are manged trough conda but for a stand alone build you would need
* gcc 4.8+
* Qwt 6
* Qt 4.8
* numpy
* slsDetectorPackage

View File

@ -1,6 +0,0 @@
make clean
make html
rm -rf ../docs/
mv _build/html/ ../docs/
touch ../docs/.nojekyll
rm -rf _build

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