mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 07:17:13 +02:00
Compare commits
757 Commits
ctb1.0
...
2020.07.23
Author | SHA1 | Date | |
---|---|---|---|
1fb19aeae2 | |||
ad297e9c51 | |||
beb6afe101 | |||
78a6896ae9 | |||
9ea8882c05 | |||
4cf5e81971 | |||
2fa5e7d00c | |||
af17fb9f61 | |||
07869134d6 | |||
8b9a69e1f1 | |||
023924c4cc | |||
01d00164e5 | |||
e6c8ba0e88 | |||
37fc69b297 | |||
e1e265bd49 | |||
b46809e1c0 | |||
396d82bd62 | |||
e7ff96fe8d | |||
07a292af95 | |||
e4433a99a5 | |||
28fb1023fa | |||
c4374e623e | |||
da2f12072f | |||
918da2402f | |||
94e9591974 | |||
a76ed6d8db | |||
b7cb341ee3 | |||
546bef5e5a | |||
97ddfed819 | |||
2d68b61f00 | |||
3bdf02a23c | |||
f70d28b175 | |||
d076fda59a | |||
a3062a5e00 | |||
c6921bf954 | |||
ae9499047b | |||
8dd9bb6ea3 | |||
9a284f75c3 | |||
3e87cfa5c1 | |||
6136eabee2 | |||
67bb0dff1a | |||
ca298580f3 | |||
d7f490701b | |||
7752b86d97 | |||
35dbc3813d | |||
a096434864 | |||
ab4d89aa70 | |||
c67b7aab4d | |||
293fda0c7a | |||
bef35eb3d6 | |||
eea013d492 | |||
890a641304 | |||
1e0160d655 | |||
42b7f6fa7c | |||
4a1943216b | |||
a23504c9c4 | |||
4db3473e32 | |||
8c1c696f64 | |||
39bbc5c688 | |||
28b3fb4101 | |||
05059c1176 | |||
95089b5faa | |||
7c48ef8931 | |||
0dc062e6d3 | |||
9b1b878f95 | |||
e23a8e7da2 | |||
a228ae0773 | |||
9787c6a385 | |||
4d1fad04c3 | |||
c5a9ff3024 | |||
25ec47dfff | |||
93c5505285 | |||
a656668d73 | |||
3156e6f50e | |||
f224b7dadf | |||
ccf54f29b6 | |||
ef564e382c | |||
e571f7bb3e | |||
aacc61b058 | |||
7d128585e1 | |||
279986d77c | |||
ff729fb43f | |||
488e0230ba | |||
c04793a9d7 | |||
f1cbf49449 | |||
285ef30439 | |||
75e9d63341 | |||
21a79752e2 | |||
5780cabe8d | |||
cec26f81e1 | |||
0c045f0faa | |||
19e40cf0e6 | |||
902366fede | |||
ee67c28711 | |||
cfe9a431f9 | |||
524c86de49 | |||
05ef55b258 | |||
bcd217b6fe | |||
4ca46e4123 | |||
7333909f6b | |||
ba7f54744b | |||
cd677e4d97 | |||
4240ea57d4 | |||
692ade6c17 | |||
4cbe354396 | |||
39d5a7db26 | |||
ae88af2a72 | |||
f592d21570 | |||
35f95e603e | |||
5c42792580 | |||
301073e60b | |||
159b0a0367 | |||
f6911c4238 | |||
1d53dc65cd | |||
9d3bbc0a68 | |||
801f2c4559 | |||
da2ce03e1d | |||
f366e9ae6f | |||
5bf6b7a338 | |||
991acc7c07 | |||
b40e481da9 | |||
12b40a44a2 | |||
f14c2d06a5 | |||
0cc547c2de | |||
489fccb25c | |||
7c23f1e42c | |||
f66345d128 | |||
e7da4ae862 | |||
8adddfb083 | |||
7cc05ead89 | |||
ebc164aaa6 | |||
a57f7943ee | |||
db8616fcb3 | |||
55af974c4e | |||
1f3fd010a7 | |||
cf9ec3de0d | |||
b5781e1f9b | |||
e09fc8cd2b | |||
48b8116849 | |||
f5759921d2 | |||
b5b50a2061 | |||
a7d2a89c50 | |||
e80bc905d6 | |||
c6b664b25b | |||
f078e6147d | |||
7609a2bda4 | |||
d5ae9a22f4 | |||
ffb1a59df0 | |||
889e926479 | |||
19bd39eece | |||
f28b41b130 | |||
9a80975929 | |||
efc247f46f | |||
c0e8e44b41 | |||
82a6383466 | |||
0289f22a0d | |||
6a919ece02 | |||
d0baa4c7b9 | |||
6dccf48759 | |||
b128837538 | |||
3c46204b14 | |||
807a588c4b | |||
fb5b2133f5 | |||
6f2413fd5d | |||
5412569e77 | |||
0375e80b42 | |||
569d0464e7 | |||
cc8549e6cb | |||
bcb5b8047b | |||
8c9341836b | |||
ad36ee2ba2 | |||
afa71895e7 | |||
62449b81ad | |||
6794d58db1 | |||
3775ff302e | |||
e76da84c9f | |||
24af0ee578 | |||
e0b86799ae | |||
5a7451e29e | |||
e0c056be09 | |||
cf0681a23c | |||
24168d5e32 | |||
7c2949f372 | |||
5a7eeb3d76 | |||
64a94b962a | |||
ab72d342c9 | |||
200186ddde | |||
7388bb4aa7 | |||
9c26cd5552 | |||
5f91198328 | |||
265e96d675 | |||
f5160b0978 | |||
2a2bb5f63a | |||
e306c39e1d | |||
6c95bf171b | |||
fd948f1a00 | |||
ff9811895f | |||
7f6d57d6ba | |||
099805ba8b | |||
1e2a3f2767 | |||
9a8300ca08 | |||
40257fc82d | |||
3bdc8e95ce | |||
223e24f924 | |||
4053594c4d | |||
f07e722d26 | |||
2ef8f2f046 | |||
0e514a470d | |||
294612b03c | |||
f223415f94 | |||
c6ff50d753 | |||
f0a318777c | |||
8aa7144252 | |||
15eea51f12 | |||
e884836f5c | |||
104d91e8c6 | |||
9ddebc4c09 | |||
0525e374b2 | |||
e727b97d75 | |||
5ca987ecbb | |||
2a64a9f6e0 | |||
a708da5455 | |||
e2eb1598d3 | |||
d175ba0936 | |||
6189fd157a | |||
6c753f3b50 | |||
098d3e6d98 | |||
4300e95a8e | |||
46daa7e2de | |||
754536898a | |||
20bfe92573 | |||
9493ae3da9 | |||
0fca9fba79 | |||
b543708d9d | |||
e0ea08332f | |||
e229fee6ba | |||
44a88893ba | |||
f4ba46c19b | |||
37cb0bb1c0 | |||
f293ba8c56 | |||
e9ca17f860 | |||
30391a2faf | |||
7ba877446c | |||
6bdc506a34 | |||
9592d1760f | |||
8ffb27c300 | |||
0a66605111 | |||
02d8b1fb5f | |||
457f31ed61 | |||
be3f095b56 | |||
174bb32744 | |||
07d90d127f | |||
0debd6a457 | |||
8f0ef68029 | |||
d71e40729a | |||
9475e01062 | |||
dc8f67cd7b | |||
3ebb1fca02 | |||
8973ef1aaa | |||
5690914048 | |||
fa768e584e | |||
62e69b900b | |||
30fc346e22 | |||
761f93d753 | |||
6d71d6cf9f | |||
e208d3ebe8 | |||
cd90f09a30 | |||
4570ffc8ad | |||
a7ce30391c | |||
c33c479ada | |||
c8eda1a458 | |||
ecc692ad9a | |||
00c1211c56 | |||
599625e6ed | |||
3514b14bc9 | |||
395b9f1b72 | |||
26dfccf77e | |||
50d2d21018 | |||
2c83abcac7 | |||
ea7cc9db8c | |||
0dd5a099c8 | |||
e6deccc2c6 | |||
ad42a61bae | |||
cbc2856c1c | |||
e34fbb4350 | |||
eea67014b7 | |||
3962714b48 | |||
f0f97f265a | |||
e730c124e3 | |||
f51c4e1d7c | |||
a62b650e24 | |||
af4b5bbf50 | |||
d8ca9bb6b5 | |||
9a1fdc4104 | |||
b3ebce378d | |||
46afcfe694 | |||
d7563fdd1a | |||
ccf1889113 | |||
88f801061f | |||
e3d3c88d74 | |||
80f4f115f9 | |||
9a7d15bbf6 | |||
e148a584df | |||
5aaefc8e00 | |||
ed8d606eb2 | |||
eff664e790 | |||
1ed1b5da86 | |||
353b8d0057 | |||
bbe9108fb9 | |||
1998f9541e | |||
6620027439 | |||
30078d6c1f | |||
13c1f7c2d6 | |||
28bafb012a | |||
9c7ff84b73 | |||
ab5cad4fde | |||
dac9998161 | |||
1dfac6ae6a | |||
2e75f36fa0 | |||
c1902c713d | |||
61f5564bb7 | |||
ec2f7db729 | |||
676055837f | |||
cce028b825 | |||
d468641138 | |||
01d1c86403 | |||
2ac7451a99 | |||
15b57b29fb | |||
902616a09d | |||
eb3971fedc | |||
64f0aa98ab | |||
61b86962bd | |||
0e5a96e1ed | |||
2f11dbc2c9 | |||
9b21f44d94 | |||
e56b431dc3 | |||
1741c84406 | |||
1623448086 | |||
1a39f92f8f | |||
4ea1f2c7e3 | |||
66d30cb2f1 | |||
8f021fe4ac | |||
7f42f5cadb | |||
999c548aa1 | |||
6872f24037 | |||
1a75170eed | |||
a12d47da36 | |||
c16411ba00 | |||
379b9b53b4 | |||
d76f43f5fd | |||
7d94ad51ab | |||
671cf45fd7 | |||
31ec3c8cf7 | |||
8ff9b0cdac | |||
ea4044e4b1 | |||
e599bb7c24 | |||
3618f6e5d3 | |||
959fd562d3 | |||
32662baef8 | |||
4e4f06560c | |||
efcb6cf480 | |||
9ae933b177 | |||
f87e8d3c19 | |||
903ebb2679 | |||
f41083842f | |||
9a87ba610a | |||
7224ad989a | |||
64f5c0f34b | |||
3238ecfc8d | |||
395d7ba98a | |||
96ec3b2123 | |||
b7805ae0d4 | |||
1f6b0b5887 | |||
b1cdc79bd4 | |||
f626db454e | |||
86b39853a3 | |||
e3044689dd | |||
337e56d9bf | |||
eb257154c6 | |||
c1ae67ac46 | |||
68f76e5356 | |||
8afa11ed33 | |||
bc389f4825 | |||
095ced153c | |||
a1a5a20845 | |||
c725a05ef8 | |||
815b6a37aa | |||
655a410d43 | |||
97ba81d923 | |||
3d00eed0f0 | |||
a7f5300455 | |||
2f33a1a479 | |||
39fa5e0185 | |||
ba4985ed4d | |||
f811c065d1 | |||
3a1d87728c | |||
0652ff6b5a | |||
373e177274 | |||
6dd6685e7d | |||
38c31fdada | |||
b3fe0e79bc | |||
215e4a56fd | |||
71a68c2022 | |||
55f8497eac | |||
738f341265 | |||
c4ae876ca7 | |||
07cd71f0c7 | |||
9f3ad4e2f4 | |||
ab9fed45fb | |||
a86ae0cb47 | |||
bdf0f9e2b9 | |||
fad10273ed | |||
83283b672a | |||
456b96446f | |||
80e55cd4da | |||
47b0e46f15 | |||
fdb6e3f3d4 | |||
eeed102bf3 | |||
7c7f7e8c70 | |||
262b4b0b16 | |||
83010de9f4 | |||
f2dd146e56 | |||
03af145ee8 | |||
043e62f9fd | |||
6289163ac8 | |||
3ba9e5ec22 | |||
719157f5c3 | |||
d58eb1dc6e | |||
6a6af528ef | |||
112d120a89 | |||
8dfb55d476 | |||
d488f4bea8 | |||
58ab3c4123 | |||
02d7381788 | |||
fb051355b8 | |||
4d8a63eee1 | |||
d0c3e006fb | |||
f22f23849d | |||
94bddb9908 | |||
ed20e17c3a | |||
8fc1578a5e | |||
9753d075f0 | |||
865b4e50ad | |||
597c359ef8 | |||
a108a4df4c | |||
0a6b04ee76 | |||
78dd96357d | |||
9230182e35 | |||
8f7adb130f | |||
16d5321885 | |||
9a6f521f6a | |||
dee0aea378 | |||
0e3cd00579 | |||
6091271f37 | |||
272a8bfaf1 | |||
75692c3539 | |||
46e9b450c0 | |||
40c5ccfe37 | |||
bf1b1a2d9e | |||
b608ec6fbd | |||
4813b5567a | |||
8ab742c2b7 | |||
cb8403f1b0 | |||
b751238fc1 | |||
5479d3a198 | |||
e1768905dd | |||
775d0842e9 | |||
e7e201bd2a | |||
ec9f8305e9 | |||
3307bfab1b | |||
ce2c62000d | |||
cf817c4ec1 | |||
bd01a5f2d2 | |||
b059ba7c90 | |||
89d70097f6 | |||
41d115a394 | |||
45c1d3a553 | |||
17227be4df | |||
7f4f8e8f09 | |||
6809bd6567 | |||
711d40a56e | |||
81911fae3c | |||
f940397e3a | |||
dc53887a48 | |||
5784ce8231 | |||
012c66bbbf | |||
3dbd6a33f7 | |||
0de0d82a1a | |||
4aeb8bf62e | |||
2acf64b09c | |||
dea8cba985 | |||
9467b4c610 | |||
2cb09a590a | |||
5900403f20 | |||
53749c3b77 | |||
1d2f4a8af0 | |||
df2512fb1c | |||
e4942a5c8d | |||
ac1c40d6f9 | |||
8ba0ef093e | |||
cb268aa43f | |||
5192dae9c5 | |||
d818e2570f | |||
ee799b540a | |||
ae3189d836 | |||
9ede0629ef | |||
bd6529a64c | |||
758afad02c | |||
013836bea5 | |||
de6808b170 | |||
4c4ee3ae25 | |||
0e171f291d | |||
bd47c969dd | |||
e4a86e544a | |||
a4fa9ff480 | |||
908afc790d | |||
d6e174ea11 | |||
f255becffe | |||
0a596c689b | |||
a2e019ff36 | |||
959d62ed66 | |||
1d2a46cdbe | |||
aeb9ddfe62 | |||
4a802bd2e4 | |||
c2639854fa | |||
dec4d00fbf | |||
e3f9ef0b25 | |||
9ca86c2edb | |||
c64b09ee79 | |||
c6ddd19c0f | |||
661adaf4ed | |||
4e2f685b76 | |||
6e4a3353a3 | |||
042e5715e6 | |||
e143204ce1 | |||
ff9c37701b | |||
5f3af794ce | |||
e7df925d6b | |||
7859cf78e9 | |||
1b996d1703 | |||
2fcb41426a | |||
032475fc14 | |||
5430288ce8 | |||
a61c5e0206 | |||
582a3c6878 | |||
134611c638 | |||
3431752649 | |||
06bd6dfd53 | |||
fca7d51cb4 | |||
85aca0ffad | |||
fac95516cf | |||
8abc32e7f1 | |||
1efacc9475 | |||
b2d88b441a | |||
75e083ae46 | |||
9699e064d3 | |||
c6c3a68520 | |||
5e92c5b67e | |||
0947cefe08 | |||
6bbcf6173d | |||
ecc3b36204 | |||
3e88beb8a5 | |||
cce659d98c | |||
95d56ad545 | |||
84cd4d8436 | |||
d7319968a7 | |||
a769f7515c | |||
11e7737a2f | |||
913df8ecae | |||
c10e04c4eb | |||
2e2e91b219 | |||
10ba16a9dc | |||
8c8032dc69 | |||
90acd51389 | |||
f38ed8706f | |||
300b0c8105 | |||
d9cfc59df6 | |||
80304c2eaf | |||
fe3a7b0faf | |||
e66d42a43d | |||
ec76590f28 | |||
2fcb2bff75 | |||
2310b5e55d | |||
dca2d098a9 | |||
462bc2e70c | |||
2da3d179ee | |||
5e6a3b7e3d | |||
6a0a931e3e | |||
2bec476b4f | |||
f902bb06ad | |||
c03bc4a6b4 | |||
6118567959 | |||
02b367ffe8 | |||
87d48fd943 | |||
21a1b872bf | |||
3a74ca8fc2 | |||
f4b922165f | |||
247d40f5a6 | |||
8953235268 | |||
3b84684415 | |||
d0da5d3fcd | |||
52a89cbcc5 | |||
d8c9748850 | |||
f42e87e37f | |||
53a3656d5e | |||
fc27cfd663 | |||
6b0bf02a85 | |||
f1bce15a57 | |||
3ea9b86bf5 | |||
4cce0aee62 | |||
dfb1b9ad69 | |||
4d6996bd55 | |||
0ac28c0208 | |||
37c3048c2a | |||
d3dc9a7690 | |||
c4559fadb3 | |||
806a2736c1 | |||
94fcf52e64 | |||
64214f22f9 | |||
36bd91daa3 | |||
40bfca588b | |||
b9446f40d1 | |||
ec66079f65 | |||
e6340456f6 | |||
f42d591845 | |||
e9029ba8f2 | |||
121747352d | |||
4cfea36b93 | |||
a829e69313 | |||
42124ca97c | |||
972f21258a | |||
6bb1188c37 | |||
a57c677105 | |||
254e8f85d8 | |||
56484daf18 | |||
6cc13f9dc1 | |||
93ab8d05d7 | |||
88c65c506f | |||
074636a7d6 | |||
e432e6f90d | |||
a3c686d271 | |||
9f79f132b7 | |||
4a7424d749 | |||
e4f2072067 | |||
8bae1059db | |||
4b39ca6e5f | |||
f0cccf9de8 | |||
89c774dbf7 | |||
5ca3a1b685 | |||
7d7302a90c | |||
ac3230c656 | |||
5761642da0 | |||
70ffdf9709 | |||
af2f2708ad | |||
c42b4b8c0e | |||
d9b88ea7d2 | |||
9f22c80081 | |||
ab6f448e1f | |||
53e5a097ab | |||
e527aad6ab | |||
a0208778c1 | |||
69897d4c78 | |||
41035808e9 | |||
2314fdabd1 | |||
abe63acc79 | |||
688e4e84d9 | |||
0210b7358c | |||
dd84337ef3 | |||
a9e375ed34 | |||
f881133795 | |||
8cbf3c62a9 | |||
ffc09ed19c | |||
3ea2520615 | |||
1dea112742 | |||
d8fccdcefa | |||
981b13494c | |||
7131f77a3a | |||
f08d430d16 | |||
9c89f6a63d | |||
e746256653 | |||
2e78484b61 | |||
1908a82627 | |||
bdf3a010c3 | |||
6bd0256172 | |||
5667353f47 | |||
c4137dc309 | |||
4b7edf2e62 | |||
0194d7ba1c | |||
23dffa47df | |||
5c35a33e02 | |||
a0c222b3c6 | |||
65d95480bd | |||
6cfd0f8962 | |||
6e47f0b7f7 | |||
3c891495db | |||
66b837eb59 | |||
6170c42618 | |||
95030bc55f | |||
69dd5f3b5e | |||
c1fac7cdb7 | |||
de57146e1b | |||
fb75986c55 | |||
e8bdf5a505 | |||
f3598c1f39 | |||
9ac08ad5c9 | |||
bcb4942793 | |||
4b69ac5cfc | |||
7a00732fa8 | |||
30a4a1740f | |||
39ec29c0e6 | |||
b6d9015ed0 | |||
de53747ddd | |||
70c54f4315 | |||
a709384fbb | |||
a1abd7587c | |||
8c8d213b56 | |||
7b31fbc002 | |||
db9aa7589a | |||
28f8a76dcc | |||
dac5ecd123 | |||
71b0ed271e | |||
c223f00511 | |||
639ed52d65 | |||
6943763e3d | |||
4b3b518401 | |||
7379b1e2ef | |||
ed2a69744b | |||
086cbacd84 | |||
af9b25fd67 | |||
504fc2d095 | |||
5cf1502287 | |||
8881542156 | |||
d9ae9a8cc6 | |||
6765eb0c94 | |||
be3d82b7b4 | |||
4e0d1fa711 | |||
619106e05f | |||
9bc60518d8 | |||
12d168a6ef | |||
1a8337540a | |||
16bec25b0c | |||
f178b0da39 | |||
2ece6b945e | |||
1d6be74ee5 | |||
07455bb11e | |||
f4cdd759b0 | |||
796890d1c8 | |||
3486137de3 | |||
d53082c615 | |||
c94f6a2bf2 | |||
2364364697 | |||
ad0fb44573 | |||
9455a5fba1 | |||
a28fa66e54 | |||
e996068328 | |||
1bbd77536c | |||
ace105a268 |
@ -3,4 +3,5 @@ IndentWidth: 4
|
|||||||
|
|
||||||
UseTab: Never
|
UseTab: Never
|
||||||
ColumnLimit: 80
|
ColumnLimit: 80
|
||||||
AlignConsecutiveAssignments: false
|
AlignConsecutiveAssignments: false
|
||||||
|
AlignConsecutiveMacros: true
|
@ -16,7 +16,9 @@ Checks: '*,
|
|||||||
-hicpp-braces-around-statements,
|
-hicpp-braces-around-statements,
|
||||||
-google-runtime-references,
|
-google-runtime-references,
|
||||||
-google-readability-todo,
|
-google-readability-todo,
|
||||||
-google-readability-braces-around-statements'
|
-google-readability-braces-around-statements,
|
||||||
|
-modernize-use-trailing-return-type,
|
||||||
|
-readability-isolate-declaration'
|
||||||
|
|
||||||
HeaderFilterRegex: \.h
|
HeaderFilterRegex: \.h
|
||||||
AnalyzeTemporaryDtors: false
|
AnalyzeTemporaryDtors: false
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,6 +7,7 @@ bin/
|
|||||||
*.out
|
*.out
|
||||||
*.toc
|
*.toc
|
||||||
*.o
|
*.o
|
||||||
|
*.so
|
||||||
.*
|
.*
|
||||||
build
|
build
|
||||||
RELEASE.txt
|
RELEASE.txt
|
||||||
|
28
.travis.yml
28
.travis.yml
@ -4,38 +4,25 @@ language: cpp
|
|||||||
|
|
||||||
os: linux
|
os: linux
|
||||||
|
|
||||||
env:
|
dist: bionic
|
||||||
matrix:
|
|
||||||
- CONDA_PY=3.6
|
|
||||||
- CONDA_PY=3.7
|
|
||||||
|
|
||||||
|
|
||||||
dist: trusty
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- sudo apt-get update
|
- sudo apt-get update
|
||||||
- ldd --version
|
- ldd --version
|
||||||
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
|
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
|
||||||
- bash miniconda.sh -b -p $HOME/miniconda
|
- 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
|
- rm -f miniconda.sh
|
||||||
- hash -r
|
- hash -r
|
||||||
- conda config --set always_yes yes --set changeps1 no
|
- conda config --set always_yes yes --set changeps1 no
|
||||||
- conda config --add channels conda-forge
|
- conda config --add channels conda-forge
|
||||||
- conda config --add channels slsdetectorgroup
|
- conda config --add channels slsdetectorgroup
|
||||||
- conda update conda
|
- conda update -q 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 info -a
|
- conda info -a
|
||||||
|
|
||||||
|
# Useful for debugging any issues with conda
|
||||||
# Replace dep1 dep2 ... with your dependencies
|
- conda create -q -n testenv conda-build anaconda-client conda-verify
|
||||||
- conda create -q -n test-environment python=$CONDA_PY
|
- conda activate testenv
|
||||||
- source activate test-environment
|
|
||||||
- conda-build .
|
- conda-build .
|
||||||
|
|
||||||
script:
|
script:
|
||||||
@ -44,7 +31,8 @@ script:
|
|||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
provider: script
|
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:
|
on:
|
||||||
branch: developer
|
branch: developer
|
||||||
|
tags: true
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
cmake_minimum_required(VERSION 3.11)
|
cmake_minimum_required(VERSION 3.12)
|
||||||
project(slsDetectorPackage)
|
project(slsDetectorPackage)
|
||||||
set(PROJECT_VERSION 5.0.0)
|
set(PROJECT_VERSION 5.0.0)
|
||||||
|
|
||||||
include(CheckIPOSupported)
|
include(CheckIPOSupported)
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
||||||
|
|
||||||
cmake_policy(SET CMP0074 NEW)
|
cmake_policy(SET CMP0074 NEW)
|
||||||
include(cmake/project_version.cmake)
|
include(cmake/project_version.cmake)
|
||||||
@ -45,6 +44,36 @@ option(SLS_USE_PYTHON "Python bindings" OFF)
|
|||||||
option(SLS_USE_CTBGUI "ctb GUI" OFF)
|
option(SLS_USE_CTBGUI "ctb GUI" OFF)
|
||||||
option(SLS_BUILD_DOCS "docs" OFF)
|
option(SLS_BUILD_DOCS "docs" OFF)
|
||||||
option(SLS_BUILD_EXAMPLES "examples" 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)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
@ -106,12 +135,17 @@ endif()
|
|||||||
|
|
||||||
|
|
||||||
if(SLS_USE_SANITIZER)
|
if(SLS_USE_SANITIZER)
|
||||||
# target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined -fno-omit-frame-pointer)
|
target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined -fno-omit-frame-pointer)
|
||||||
# target_link_libraries(slsProjectOptions INTERFACE -fsanitize=address,undefined)
|
target_link_libraries(slsProjectOptions INTERFACE -fsanitize=address,undefined)
|
||||||
target_compile_options(slsProjectOptions INTERFACE -fsanitize=thread)
|
# target_compile_options(slsProjectOptions INTERFACE -fsanitize=thread)
|
||||||
target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread)
|
# target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(SLS_TUNE_LOCAL)
|
||||||
|
target_compile_options(slsProjectOptions INTERFACE -mtune=native -march=native)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
#rapidjson
|
#rapidjson
|
||||||
add_library(rapidjson INTERFACE)
|
add_library(rapidjson INTERFACE)
|
||||||
target_include_directories(rapidjson INTERFACE
|
target_include_directories(rapidjson INTERFACE
|
||||||
@ -127,7 +161,7 @@ install(TARGETS slsProjectOptions slsProjectWarnings rapidjson
|
|||||||
)
|
)
|
||||||
|
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
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 TRUE)
|
||||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||||
|
|
||||||
@ -160,7 +194,7 @@ endif (SLS_USE_RECEIVER)
|
|||||||
|
|
||||||
if (SLS_USE_GUI)
|
if (SLS_USE_GUI)
|
||||||
find_package(Qt4 REQUIRED)
|
find_package(Qt4 REQUIRED)
|
||||||
find_package(Qwt 6 REQUIRED)
|
find_package(Qwt 6.1 REQUIRED)
|
||||||
if (QT4_FOUND AND QWT_FOUND)
|
if (QT4_FOUND AND QWT_FOUND)
|
||||||
add_subdirectory(slsDetectorGui)
|
add_subdirectory(slsDetectorGui)
|
||||||
endif()
|
endif()
|
||||||
@ -175,6 +209,7 @@ if (SLS_USE_INTEGRATION_TESTS)
|
|||||||
endif (SLS_USE_INTEGRATION_TESTS)
|
endif (SLS_USE_INTEGRATION_TESTS)
|
||||||
|
|
||||||
if (SLS_USE_PYTHON)
|
if (SLS_USE_PYTHON)
|
||||||
|
set(PYBIND11_CPP_STANDARD -std=c++11)
|
||||||
add_subdirectory(libs/pybind11)
|
add_subdirectory(libs/pybind11)
|
||||||
add_subdirectory(python)
|
add_subdirectory(python)
|
||||||
endif(SLS_USE_PYTHON)
|
endif(SLS_USE_PYTHON)
|
||||||
@ -196,10 +231,13 @@ if(SLS_BUILD_DOCS)
|
|||||||
endif(SLS_BUILD_DOCS)
|
endif(SLS_BUILD_DOCS)
|
||||||
|
|
||||||
|
|
||||||
|
if(SLS_USE_MOENCH)
|
||||||
|
add_subdirectory(slsDetectorCalibration/moenchExecutables)
|
||||||
|
endif(SLS_USE_MOENCH)
|
||||||
|
|
||||||
if(SLS_MASTER_PROJECT)
|
if(SLS_MASTER_PROJECT)
|
||||||
# Set install dir CMake packages
|
# 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 the list of exported targets
|
||||||
set(PROJECT_LIBRARIES slsSupportLib slsDetectorShared slsReceiverShared)
|
set(PROJECT_LIBRARIES slsSupportLib slsDetectorShared slsReceiverShared)
|
||||||
# Generate and install package config file and version
|
# Generate and install package config file and version
|
||||||
|
113
README.md
113
README.md
@ -2,90 +2,67 @@
|
|||||||
Detailed documentation can be found on the [official site.](https://www.psi.ch/detectors/users-support)
|
Detailed documentation can be found on the [official site.](https://www.psi.ch/detectors/users-support)
|
||||||
|
|
||||||
### Binaries
|
### 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
|
### 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
|
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git
|
||||||
|
|
||||||
```
|
```
|
||||||
#### Setup dependencies
|
#### Dependencies
|
||||||
* Gui Client <br>
|
* Lib: c++11 compiler (gcc=>4.8), ZeroMQ 4
|
||||||
Requirements: Qt 4.8 and Qwt 6.0
|
* Gui: Qt 4.8 and Qwt 6.0
|
||||||
```
|
* Calibration wizards and ctbGUI: ROOT
|
||||||
export QTDIR=/usr/local/Trolltech/
|
* Optional: HDF5
|
||||||
export QWTDIR=/usr/local/qwt-6.0.1/
|
|
||||||
```
|
|
||||||
If either of them does not exist, the GUI client will not be built.
|
|
||||||
|
|
||||||
* Advanced user Calibration wizards<br>
|
|
||||||
Requirements: ROOT
|
|
||||||
```
|
|
||||||
export ROOTSYS=/usr/local/root-5.34
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Compilation
|
#### 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>
|
**1. Compile using script cmk.sh**<br>
|
||||||
|
|
||||||
After compiling, the libraries and executables will be found in `slsDetectorPackage/build/bin` directory<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>
|
Usage: [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [-h] [-d <HDF5 directory>] [-j] <Number of threads>
|
||||||
* -[no option]: only make<br>
|
-[no option]: only make
|
||||||
* -c: Clean<br>
|
-c: Clean
|
||||||
* -b: Builds/Rebuilds CMake files normal mode<br>
|
-b: Builds/Rebuilds CMake files normal mode
|
||||||
* -h: Builds/Rebuilds Cmake files with HDF5 package<br>
|
-p: Builds/Rebuilds Python API
|
||||||
* -d: HDF5 Custom Directory<br>
|
-h: Builds/Rebuilds Cmake files with HDF5 package
|
||||||
* -t: Build/Rebuilds only text client<br>
|
-d: HDF5 Custom Directory
|
||||||
* -r: Build/Rebuilds only receiver<br>
|
-t: Build/Rebuilds only text client
|
||||||
* -g: Build/Rebuilds only gui<br>
|
-r: Build/Rebuilds only receiver
|
||||||
* -j: Number of threads to compile through<br>
|
-g: Build/Rebuilds only gui
|
||||||
* -e: Debug mode
|
-s: Simulator
|
||||||
|
-u: Chip Test Gui
|
||||||
Basic Option:
|
-j: Number of threads to compile through
|
||||||
./cmk.sh -b
|
-e: Debug mode
|
||||||
|
-i: Builds tests
|
||||||
For only make:
|
|
||||||
./cmk.sh
|
eg. Rebuild when you switch to a new build and compile in parallel:
|
||||||
|
./cmk.sh -bj5
|
||||||
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>
|
|
||||||
|
|
||||||
|
|
||||||
**2. Compile without script**<br>
|
**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 build
|
||||||
$ mkdir slsDetectorPackage-build
|
$ cd build
|
||||||
$ cd slsDetectorPackage-build
|
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON
|
||||||
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=OFF
|
$ make -j12 #or whatever number of threads wanted
|
||||||
$ 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
|
|
||||||
```
|
```
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
Draft
|
||||||
|
- dr 4, 8, 16 in eiger -> speed 0, 32 stays same (speed 1)
|
||||||
|
39
cmake/FindClangFormat.cmake
Normal file
39
cmake/FindClangFormat.cmake
Normal 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
47
cmake/clang-format.cmake
Normal 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}
|
||||||
|
)
|
@ -15,17 +15,20 @@ configure_package_config_file(
|
|||||||
write_basic_package_version_file(
|
write_basic_package_version_file(
|
||||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
|
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
|
||||||
VERSION ${PROJECT_VERSION}
|
VERSION ${PROJECT_VERSION}
|
||||||
COMPATIBILITY SameMajorVersion)
|
COMPATIBILITY SameMajorVersion
|
||||||
|
)
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake"
|
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake"
|
||||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
|
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
|
||||||
COMPONENT devel
|
COMPONENT devel
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER})
|
DESTINATION ${CMAKE_INSTALL_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
if (PROJECT_LIBRARIES OR PROJECT_STATIC_LIBRARIES)
|
if (PROJECT_LIBRARIES OR PROJECT_STATIC_LIBRARIES)
|
||||||
install(
|
install(
|
||||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||||
FILE ${PROJECT_NAME_LOWER}-targets.cmake
|
FILE ${PROJECT_NAME_LOWER}-targets.cmake
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER})
|
DESTINATION ${CMAKE_INSTALL_DIR}
|
||||||
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
42
cmk.sh
42
cmk.sh
@ -11,6 +11,8 @@ PYTHON=0
|
|||||||
TESTS=0
|
TESTS=0
|
||||||
SIMULATOR=0
|
SIMULATOR=0
|
||||||
CTBGUI=0
|
CTBGUI=0
|
||||||
|
MANUALS=0
|
||||||
|
MOENCHZMQ=0
|
||||||
|
|
||||||
|
|
||||||
CLEAN=0
|
CLEAN=0
|
||||||
@ -19,7 +21,7 @@ CMAKE_PRE=""
|
|||||||
CMAKE_POST=""
|
CMAKE_POST=""
|
||||||
|
|
||||||
usage() { echo -e "
|
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
|
-[no option]: only make
|
||||||
-c: Clean
|
-c: Clean
|
||||||
-b: Builds/Rebuilds CMake files normal mode
|
-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
|
-j: Number of threads to compile through
|
||||||
-e: Debug mode
|
-e: Debug mode
|
||||||
-i: Builds tests
|
-i: Builds tests
|
||||||
|
-m: Manuals
|
||||||
|
-z: Moench zmq processor
|
||||||
|
|
||||||
Rebuild when you switch to a new build and compile in parallel:
|
Rebuild when you switch to a new build and compile in parallel:
|
||||||
./cmk.sh -bj5
|
./cmk.sh -bj5
|
||||||
@ -69,7 +73,7 @@ For rebuilding only certain sections
|
|||||||
|
|
||||||
" ; exit 1; }
|
" ; exit 1; }
|
||||||
|
|
||||||
while getopts ":bpchd:j:trgeisu" opt ; do
|
while getopts ":bpchd:j:trgeisumz" opt ; do
|
||||||
case $opt in
|
case $opt in
|
||||||
b)
|
b)
|
||||||
echo "Building of CMake files Required"
|
echo "Building of CMake files Required"
|
||||||
@ -124,6 +128,14 @@ while getopts ":bpchd:j:trgeisu" opt ; do
|
|||||||
echo "Compiling Options: Simulator"
|
echo "Compiling Options: Simulator"
|
||||||
SIMULATOR=1
|
SIMULATOR=1
|
||||||
;;
|
;;
|
||||||
|
m)
|
||||||
|
echo "Compiling Manuals"
|
||||||
|
MANUALS=1
|
||||||
|
;;
|
||||||
|
z)
|
||||||
|
echo "Compiling Moench Zmq Processor"
|
||||||
|
MOENCHZMQ=1
|
||||||
|
;;
|
||||||
u)
|
u)
|
||||||
echo "Compiling Options: Chip Test Gui"
|
echo "Compiling Options: Chip Test Gui"
|
||||||
CTBGUI=1
|
CTBGUI=1
|
||||||
@ -187,8 +199,8 @@ fi
|
|||||||
|
|
||||||
#Debug
|
#Debug
|
||||||
if [ $DEBUG -eq 1 ]; then
|
if [ $DEBUG -eq 1 ]; then
|
||||||
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
|
# CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
|
||||||
# CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON "
|
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON "
|
||||||
echo "Debug Option enabled"
|
echo "Debug Option enabled"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -198,6 +210,18 @@ if [ $SIMULATOR -eq 1 ]; then
|
|||||||
echo "Simulator Option enabled"
|
echo "Simulator Option enabled"
|
||||||
fi
|
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
|
#Chip Test Gui
|
||||||
if [ $CTBGUI -eq 1 ]; then
|
if [ $CTBGUI -eq 1 ]; then
|
||||||
CMAKE_POST+=" -DSLS_USE_CTBGUI=ON "
|
CMAKE_POST+=" -DSLS_USE_CTBGUI=ON "
|
||||||
@ -247,8 +271,18 @@ if [ $COMPILERTHREADS -gt 0 ]; then
|
|||||||
BUILDCOMMAND="make -j$COMPILERTHREADS"
|
BUILDCOMMAND="make -j$COMPILERTHREADS"
|
||||||
echo $BUILDCOMMAND
|
echo $BUILDCOMMAND
|
||||||
eval $BUILDCOMMAND
|
eval $BUILDCOMMAND
|
||||||
|
if [ $MANUALS -eq 1 ]; then
|
||||||
|
BUILDCOMMAND="make docs -j$COMPILERTHREADS"
|
||||||
|
echo $BUILDCOMMAND
|
||||||
|
eval $BUILDCOMMAND
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
|
echo "make"
|
||||||
make
|
make
|
||||||
|
if [ $MANUALS -eq 1 ]; then
|
||||||
|
echo "make docs"
|
||||||
|
make docs
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
mkdir build
|
mkdir build
|
||||||
mkdir install
|
mkdir install
|
||||||
cd build
|
cd build
|
||||||
@ -6,7 +7,7 @@ cmake .. \
|
|||||||
-DCMAKE_INSTALL_PREFIX=install \
|
-DCMAKE_INSTALL_PREFIX=install \
|
||||||
-DSLS_USE_TEXTCLIENT=ON \
|
-DSLS_USE_TEXTCLIENT=ON \
|
||||||
-DSLS_USE_RECEIVER=ON \
|
-DSLS_USE_RECEIVER=ON \
|
||||||
-DSLS_USE_GUI=OFF \
|
-DSLS_USE_GUI=ON \
|
||||||
-DSLS_USE_TESTS=ON \
|
-DSLS_USE_TESTS=ON \
|
||||||
-DSLS_USE_PYTHON=OFF \
|
-DSLS_USE_PYTHON=OFF \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
@ -1,14 +1,4 @@
|
|||||||
|
|
||||||
# mkdir $PREFIX/lib
|
echo "|<-------- starting python build"
|
||||||
# mkdir $PREFIX/include
|
|
||||||
|
|
||||||
|
|
||||||
# #Shared and static libraries
|
|
||||||
# cp build/bin/_sls_detector* $PREFIX/lib/.
|
|
||||||
|
|
||||||
|
|
||||||
# #Binaries
|
|
||||||
# cp -r build/bin/sls_detector $PREFIX/lib/.
|
|
||||||
|
|
||||||
cd python
|
cd python
|
||||||
${PYTHON} setup.py install
|
${PYTHON} setup.py install
|
||||||
|
7
conda-recepie/conda_build_config.yaml
Normal file
7
conda-recepie/conda_build_config.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
python:
|
||||||
|
- 3.6
|
||||||
|
- 3.7
|
||||||
|
- 3.8
|
||||||
|
|
||||||
|
numpy:
|
||||||
|
- 1.17
|
9
conda-recepie/copy_ctbgui.sh
Normal file
9
conda-recepie/copy_ctbgui.sh
Normal 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/.
|
||||||
|
|
@ -1,15 +1,3 @@
|
|||||||
|
#Copy the GUI
|
||||||
mkdir $PREFIX/lib
|
|
||||||
mkdir $PREFIX/bin
|
mkdir $PREFIX/bin
|
||||||
mkdir $PREFIX/include
|
|
||||||
|
|
||||||
#No libs for gui?
|
|
||||||
|
|
||||||
#Binaries
|
|
||||||
cp build/bin/gui_client $PREFIX/bin/.
|
|
||||||
cp build/bin/slsDetectorGui $PREFIX/bin/.
|
cp build/bin/slsDetectorGui $PREFIX/bin/.
|
||||||
|
|
||||||
|
|
||||||
#Which headers do we need for development??
|
|
||||||
|
|
||||||
# cp include/some_lib.h $PREFIX/include/.
|
|
@ -5,18 +5,20 @@ mkdir $PREFIX/include
|
|||||||
mkdir $PREFIX/include/slsDetectorPackage
|
mkdir $PREFIX/include/slsDetectorPackage
|
||||||
|
|
||||||
#Shared and static libraries
|
#Shared and static libraries
|
||||||
cp build/bin/libSlsDetector.so $PREFIX/lib/.
|
# cp build/bin/libSlsDetector.so $PREFIX/lib/.
|
||||||
cp build/bin/libSlsReceiver.so $PREFIX/lib/.
|
# cp build/bin/libSlsReceiver.so $PREFIX/lib/.
|
||||||
cp build/bin/libSlsSupport.so $PREFIX/lib/.
|
# cp build/bin/libSlsSupport.so $PREFIX/lib/.
|
||||||
|
|
||||||
|
cp build/install/lib/* $PREFIX/lib/
|
||||||
|
|
||||||
#Binaries
|
#Binaries
|
||||||
cp build/bin/sls_detector_acquire $PREFIX/bin/.
|
cp build/install/bin/sls_detector_acquire $PREFIX/bin/.
|
||||||
cp build/bin/sls_detector_get $PREFIX/bin/.
|
cp build/install/bin/sls_detector_get $PREFIX/bin/.
|
||||||
cp build/bin/sls_detector_put $PREFIX/bin/.
|
cp build/install/bin/sls_detector_put $PREFIX/bin/.
|
||||||
cp build/bin/sls_detector_help $PREFIX/bin/.
|
cp build/install/bin/sls_detector_help $PREFIX/bin/.
|
||||||
cp build/bin/slsReceiver $PREFIX/bin/.
|
cp build/install/bin/slsReceiver $PREFIX/bin/.
|
||||||
cp build/bin/slsMultiReceiver $PREFIX/bin/.
|
cp build/install/bin/slsMultiReceiver $PREFIX/bin/.
|
||||||
|
|
||||||
#Which headers do we need for development??
|
|
||||||
cp build/install/include/* $PREFIX/include/slsDetectorPackage/
|
cp build/install/include/* $PREFIX/include/
|
||||||
# cp include/some_lib.h $PREFIX/include/.
|
cp -r build/install/share/ $PREFIX/share
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
|
|
||||||
package:
|
package:
|
||||||
name: sls_detector_software
|
name: sls_detector_software
|
||||||
version: "developer"
|
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||||
|
|
||||||
source:
|
source:
|
||||||
- path: ..
|
- path: ..
|
||||||
|
|
||||||
build:
|
build:
|
||||||
number: 1
|
number: 0
|
||||||
|
binary_relocation: True
|
||||||
rpaths:
|
rpaths:
|
||||||
- lib/
|
- lib/
|
||||||
|
|
||||||
@ -16,10 +17,9 @@ requirements:
|
|||||||
- {{ compiler('c') }}
|
- {{ compiler('c') }}
|
||||||
- {{compiler('cxx')}}
|
- {{compiler('cxx')}}
|
||||||
- cmake
|
- cmake
|
||||||
# - qwt 6.* #require qt5 investigate befor activating gui
|
- qwt 6.*
|
||||||
# - qt=4.8.7=7
|
- qt 4.8.*
|
||||||
- zeromq=4.2.5=hfc679d8_5
|
- zeromq
|
||||||
- pyzmq
|
|
||||||
- xorg-libx11
|
- xorg-libx11
|
||||||
- xorg-libice
|
- xorg-libice
|
||||||
- xorg-libxext
|
- xorg-libxext
|
||||||
@ -37,6 +37,7 @@ requirements:
|
|||||||
host:
|
host:
|
||||||
- libstdcxx-ng
|
- libstdcxx-ng
|
||||||
- libgcc-ng
|
- libgcc-ng
|
||||||
|
- zeromq
|
||||||
- xorg-libx11
|
- xorg-libx11
|
||||||
- xorg-libice
|
- xorg-libice
|
||||||
- xorg-libxext
|
- xorg-libxext
|
||||||
@ -46,75 +47,52 @@ requirements:
|
|||||||
- xorg-libxfixes
|
- xorg-libxfixes
|
||||||
|
|
||||||
run:
|
run:
|
||||||
|
- zeromq
|
||||||
- libstdcxx-ng
|
- libstdcxx-ng
|
||||||
- libgcc-ng
|
- libgcc-ng
|
||||||
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
- name: sls_detector_lib
|
- name: slsdetlib
|
||||||
script: copy_lib.sh
|
script: copy_lib.sh
|
||||||
|
|
||||||
- name: sls_detector
|
requirements:
|
||||||
|
run:
|
||||||
|
- libstdcxx-ng
|
||||||
|
- libgcc-ng
|
||||||
|
- zeromq
|
||||||
|
|
||||||
|
- name: slsdet
|
||||||
|
|
||||||
script: build_pylib.sh
|
script: build_pylib.sh
|
||||||
|
|
||||||
requirements:
|
requirements:
|
||||||
build:
|
build:
|
||||||
|
- python
|
||||||
- {{ compiler('c') }}
|
- {{ compiler('c') }}
|
||||||
- {{compiler('cxx')}}
|
- {{compiler('cxx')}}
|
||||||
- python {{ python }}
|
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||||
- setuptools
|
- setuptools
|
||||||
- sls_detector_lib
|
|
||||||
- pyzmq
|
|
||||||
- pybind11 2.2
|
|
||||||
host:
|
host:
|
||||||
- python
|
- python
|
||||||
- pybind11 2.2
|
|
||||||
- pyzmq
|
run:
|
||||||
- sls_detector_lib
|
|
||||||
- libstdcxx-ng
|
- libstdcxx-ng
|
||||||
- libgcc-ng
|
- libgcc-ng
|
||||||
run:
|
|
||||||
- python
|
- python
|
||||||
- numpy
|
- numpy
|
||||||
- sls_detector_lib=developer
|
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||||
- pyzmq
|
|
||||||
- libstdcxx-ng
|
|
||||||
- libgcc-ng
|
|
||||||
test:
|
test:
|
||||||
imports:
|
imports:
|
||||||
- sls_detector
|
- slsdet
|
||||||
|
|
||||||
# requirements:
|
- name: slsdetgui
|
||||||
# build:
|
script: copy_gui.sh
|
||||||
# - {{ compiler('c') }}
|
requirements:
|
||||||
# - {{compiler('cxx')}}
|
run:
|
||||||
|
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||||
# - name: sls_detector_gui
|
- qwt 6.*
|
||||||
# version: "refactor"
|
- qt 4.8.*
|
||||||
# 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
|
|
||||||
|
@ -71,6 +71,11 @@ target_link_libraries(ctbRootLib PUBLIC
|
|||||||
${ROOT_EXE_LINKER_FLAGS}
|
${ROOT_EXE_LINKER_FLAGS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set_target_properties(
|
||||||
|
ctbRootLib PROPERTIES
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(ctbGui PUBLIC
|
target_link_libraries(ctbGui PUBLIC
|
||||||
slsDetectorShared
|
slsDetectorShared
|
||||||
slsSupportLib
|
slsSupportLib
|
||||||
@ -80,4 +85,5 @@ target_link_libraries(ctbGui PUBLIC
|
|||||||
|
|
||||||
set_target_properties(ctbGui PROPERTIES
|
set_target_properties(ctbGui PROPERTIES
|
||||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
|
|
||||||
)
|
)
|
@ -29,9 +29,10 @@
|
|||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
#include "ctbMain.h"
|
#include "ctbMain.h"
|
||||||
#include "moench03CtbData.h"
|
#include "moench03CtbData.h"
|
||||||
#include "moench03TCtbData.h"
|
//#include "moench03TCtbData.h"
|
||||||
#include "moench03T1CtbData.h"
|
//#include "moench03T1CtbData.h"
|
||||||
#include "moench03CommonMode.h"
|
#include "moench03CommonMode.h"
|
||||||
|
#include "moench03T1ZmqDataNew.h"
|
||||||
#include "moench02CtbData.h"
|
#include "moench02CtbData.h"
|
||||||
//#include "jungfrau10ModuleData.h"
|
//#include "jungfrau10ModuleData.h"
|
||||||
#include "moenchCommonMode.h"
|
#include "moenchCommonMode.h"
|
||||||
@ -43,6 +44,9 @@
|
|||||||
#include "moench04CtbZmq10GbData.h"
|
#include "moench04CtbZmq10GbData.h"
|
||||||
#include "deserializer.h"
|
#include "deserializer.h"
|
||||||
#include "detectorData.h"
|
#include "detectorData.h"
|
||||||
|
#include "imageZmq16bit.h"
|
||||||
|
#include "imageZmq32bit.h"
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -232,7 +236,10 @@ hframe=new TGHorizontalFrame(this, 800,50);
|
|||||||
cbDetType->AddEntry("MOENCH02", MOENCH02);
|
cbDetType->AddEntry("MOENCH02", MOENCH02);
|
||||||
cbDetType->AddEntry("MOENCH04", MOENCH04);
|
cbDetType->AddEntry("MOENCH04", MOENCH04);
|
||||||
// cbDetType->AddEntry("JUNGFRAU1.0", 2);
|
// 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("MOENCH03", iiii++);
|
||||||
// cbDetType->AddEntry("MYTHEN3 0.1", MYTHEN301);
|
// cbDetType->AddEntry("MYTHEN3 0.1", MYTHEN301);
|
||||||
// cbDetType->AddEntry("ADCSAR2", ADCSAR2);
|
// 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);
|
hframe=new TGHorizontalFrame(this, 800,50);
|
||||||
@ -290,8 +297,8 @@ hframe=new TGHorizontalFrame(this, 800,50);
|
|||||||
TGNumberFormat::kNEANonNegative,
|
TGNumberFormat::kNEANonNegative,
|
||||||
TGNumberFormat::kNELLimitMinMax,0,16535);
|
TGNumberFormat::kNELLimitMinMax,0,16535);
|
||||||
hframe->AddFrame(eSerOff,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
|
hframe->AddFrame(eSerOff,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
|
||||||
eSerOff->MapWindow();;
|
eSerOff->MapWindow();
|
||||||
eSerOff->SetNumber(5);
|
eSerOff->SetNumber(0);
|
||||||
e= eSerOff->TGNumberEntry::GetNumberEntry();
|
e= eSerOff->TGNumberEntry::GetNumberEntry();
|
||||||
eSerOff->Connect("ValueSet(Long_t)","ctbAcquisition",this,"ChangeSerialOffset(Long_t)");
|
eSerOff->Connect("ValueSet(Long_t)","ctbAcquisition",this,"ChangeSerialOffset(Long_t)");
|
||||||
e->Connect("ReturnPressed()","ctbAcquisition",this,"ChangeSerialOffset()");
|
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);
|
hframe=new TGHorizontalFrame(this, 800,50);
|
||||||
@ -609,8 +663,10 @@ hframe=new TGHorizontalFrame(this, 800,50);
|
|||||||
cout <<"Registering data callback" << endl;
|
cout <<"Registering data callback" << endl;
|
||||||
try {
|
try {
|
||||||
myDet->registerDataCallback(&dataCallback, (void*)this);
|
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;
|
cout <<"Done" << endl;
|
||||||
|
|
||||||
// mgAdcs=new TMultiGraph();
|
// mgAdcs=new TMultiGraph();
|
||||||
@ -832,7 +888,7 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
|
|||||||
|
|
||||||
// cout <<"global plot is " << globalPlot << endl;
|
// cout <<"global plot is " << globalPlot << endl;
|
||||||
// cout << "*******************************************" <<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()) {
|
if (globalPlot || cbGetPedestal->IsOn()) {
|
||||||
//#ifdef TESTADC
|
//#ifdef TESTADC
|
||||||
// cout <<"------"<< index << " " << ip << " " << data->npoints << endl;
|
// cout <<"------"<< index << " " << ip << " " << data->npoints << endl;
|
||||||
@ -859,6 +915,11 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
|
|||||||
nx=eNumCount->GetIntNumber();
|
nx=eNumCount->GetIntNumber();
|
||||||
dr=eDynRange->GetIntNumber();
|
dr=eDynRange->GetIntNumber();
|
||||||
soff=eSerOff->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;
|
i=0;
|
||||||
@ -923,7 +984,8 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
|
|||||||
for (int y=0; y<ny; y++) {
|
for (int y=0; y<ny; y++) {
|
||||||
ped=0;
|
ped=0;
|
||||||
aval=dataStructure->getValue(data->data,x,y);
|
aval=dataStructure->getValue(data->data,x,y);
|
||||||
|
//aval=dataStructure->getChannel(data->data,x,y);
|
||||||
|
cout << x << " " <<y << " "<< aval << endl;
|
||||||
if (cbGetPedestal->IsOn()) {
|
if (cbGetPedestal->IsOn()) {
|
||||||
if (photonFinder) {
|
if (photonFinder) {
|
||||||
photonFinder->addToPedestal(aval,x,y);
|
photonFinder->addToPedestal(aval,x,y);
|
||||||
@ -1094,8 +1156,20 @@ void ctbAcquisition::Draw(){
|
|||||||
void ctbAcquisition::changePlot(){
|
void ctbAcquisition::changePlot(){
|
||||||
if (rbPlotOff->IsOn()) {
|
if (rbPlotOff->IsOn()) {
|
||||||
adcPlot=0;
|
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 {
|
} 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;
|
adcPlot=0;
|
||||||
dbitPlot=0;
|
dbitPlot=0;
|
||||||
for (int ii=0; ii<NADCS; ii++)
|
for (int ii=0; ii<NADCS; ii++)
|
||||||
@ -1200,6 +1274,9 @@ void ctbAcquisition::changeDetector(){
|
|||||||
eNumCount->SetState(kFALSE);
|
eNumCount->SetState(kFALSE);
|
||||||
eDynRange->SetState(kFALSE);
|
eDynRange->SetState(kFALSE);
|
||||||
eSerOff->SetState(kFALSE);
|
eSerOff->SetState(kFALSE);
|
||||||
|
ePixX->SetState(kFALSE);
|
||||||
|
ePixY->SetState(kFALSE);
|
||||||
|
|
||||||
deserializer=0;
|
deserializer=0;
|
||||||
if (rb2D->IsOn() ) {//|| rbScan->IsOn()
|
if (rb2D->IsOn() ) {//|| rbScan->IsOn()
|
||||||
switch (cbDetType->GetSelected()) {
|
switch (cbDetType->GetSelected()) {
|
||||||
@ -1210,7 +1287,6 @@ void ctbAcquisition::changeDetector(){
|
|||||||
// commonMode=new moench03CommonMode();
|
// commonMode=new moench03CommonMode();
|
||||||
break;
|
break;
|
||||||
case MOENCH04:
|
case MOENCH04:
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto retval = myDet->getTenGiga().tsquash("Different values");
|
auto retval = myDet->getTenGiga().tsquash("Different values");
|
||||||
if (retval) {
|
if (retval) {
|
||||||
@ -1223,6 +1299,54 @@ void ctbAcquisition::changeDetector(){
|
|||||||
cout << "MOENCH 0.4!" << endl;
|
cout << "MOENCH 0.4!" << endl;
|
||||||
commonMode=new moench03CommonMode();
|
commonMode=new moench03CommonMode();
|
||||||
break;
|
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:
|
// case 1:
|
||||||
// cout << "************** T!!!!!!!!!!" << endl;
|
// 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
|
||||||
//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);
|
dataStructure->getDetectorSize(nx,ny);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (deserializer) {
|
if (deserializer) {
|
||||||
ny=1;
|
ny=1;
|
||||||
@ -1511,20 +1636,23 @@ void ctbAcquisition::update() {
|
|||||||
|
|
||||||
if (dataStructure) {
|
if (dataStructure) {
|
||||||
cout << cbDetType->GetSelected()<< endl;
|
cout << cbDetType->GetSelected()<< endl;
|
||||||
if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302){
|
// if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302){
|
||||||
cout << "settings deserialiation parameters for MYTHEN" << endl;
|
// cout << "settings deserialiation parameters for MYTHEN" << endl;
|
||||||
mythen3_01_jctbData* ms=(mythen3_01_jctbData*)dataStructure;
|
// mythen3_01_jctbData* ms=(mythen3_01_jctbData*)dataStructure;
|
||||||
eSerOff->SetNumber( ms->setSerialOffset(-1));
|
// eSerOff->SetNumber( ms->setSerialOffset(-1));
|
||||||
eDynRange->SetNumber( ms->setDynamicRange(-1));
|
// eDynRange->SetNumber( ms->setDynamicRange(-1));
|
||||||
eNumCount->SetNumber( ms->setNumberOfCounters(-1));
|
// eNumCount->SetNumber( ms->setNumberOfCounters(-1));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
||||||
dBitOffset = myDet->getRxDbitOffset().tsquash("Different values");
|
dBitOffset = 0;
|
||||||
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::update")
|
} else {
|
||||||
|
try {
|
||||||
|
dBitOffset = myDet->getRxDbitOffset().tsquash("Different values");
|
||||||
|
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::update")
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
tenG = myDet->getTenGiga().tsquash("Different values");
|
tenG = myDet->getTenGiga().tsquash("Different values");
|
||||||
} CATCH_DISPLAY ("Could not get ten giga enable", "ctbAcquisition::update")
|
} CATCH_DISPLAY ("Could not get ten giga enable", "ctbAcquisition::update")
|
||||||
@ -1610,9 +1738,13 @@ void ctbAcquisition::toggleAcquisition() {
|
|||||||
setDigitalSamples(retval);
|
setDigitalSamples(retval);
|
||||||
} CATCH_DISPLAY ("Could not get number of digital samples", "ctbAcquisition::toggleAcquisition")
|
} CATCH_DISPLAY ("Could not get number of digital samples", "ctbAcquisition::toggleAcquisition")
|
||||||
|
|
||||||
|
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
||||||
|
dBitOffset = 0;
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
dBitOffset = myDet->getRxDbitOffset().tsquash("Different values");
|
dBitOffset = myDet->getRxDbitOffset().tsquash("Different values");
|
||||||
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::toggleAcquisition")
|
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::toggleAcquisition")
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
roMode = static_cast<int>(myDet->getReadoutMode().tsquash("Different values"));
|
roMode = static_cast<int>(myDet->getReadoutMode().tsquash("Different values"));
|
||||||
@ -1849,14 +1981,18 @@ void ctbAcquisition::setDbitEnable(Int_t reg){
|
|||||||
void ctbAcquisition::updateChans() {
|
void ctbAcquisition::updateChans() {
|
||||||
|
|
||||||
// dbit list
|
// dbit list
|
||||||
try {
|
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
||||||
auto retval = myDet->getRxDbitList().tsquash("Different values");
|
|
||||||
dbitlist.clear();
|
dbitlist.clear();
|
||||||
if (!retval.empty()) {
|
} else {
|
||||||
for (const auto &value : retval)
|
try {
|
||||||
dbitlist.push_back(value);
|
auto retval = myDet->getRxDbitList().tsquash("Different values");
|
||||||
}
|
dbitlist.clear();
|
||||||
} CATCH_DISPLAY ("Could not get receiver dbit list.", "ctbAcquisition::updateChans")
|
if (!retval.empty()) {
|
||||||
|
for (const auto &value : retval)
|
||||||
|
dbitlist.push_back(value);
|
||||||
|
}
|
||||||
|
} CATCH_DISPLAY ("Could not get receiver dbit list.", "ctbAcquisition::updateChans")
|
||||||
|
}
|
||||||
|
|
||||||
// adc mask
|
// adc mask
|
||||||
try {
|
try {
|
||||||
@ -1977,20 +2113,22 @@ void ctbAcquisition::ChangeNumberOfChannels(Long_t a){
|
|||||||
|
|
||||||
|
|
||||||
void ctbAcquisition::ChangeSerialOffset(){
|
void ctbAcquisition::ChangeSerialOffset(){
|
||||||
|
changeDetector();
|
||||||
// if (dataStructure) {
|
// if (dataStructure) {
|
||||||
|
|
||||||
// // cout << cbDetType->GetSelected()<< endl;
|
// cout << cbDetType->GetSelected()<< endl;
|
||||||
// // if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302 ){
|
// if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302 ){
|
||||||
// // cout << "settings offsets for MYTHEN" << endl;
|
// cout << "settings offsets for MYTHEN" << endl;
|
||||||
// // mythen3_01_jctbData* ms=(mythen3_01_jctbData*)dataStructure;
|
// mythen3_01_jctbData* ms=(mythen3_01_jctbData*)dataStructure;
|
||||||
// // ms->setSerialOffset(eSerOff->GetIntNumber());
|
// ms->setSerialOffset(eSerOff->GetIntNumber());
|
||||||
|
|
||||||
// // }
|
// }
|
||||||
// }
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void ctbAcquisition::ChangeDynamicRange(){
|
void ctbAcquisition::ChangeDynamicRange(){
|
||||||
|
changeDetector();
|
||||||
// if (dataStructure) {
|
// if (dataStructure) {
|
||||||
|
|
||||||
// cout << cbDetType->GetSelected()<< endl;
|
// cout << cbDetType->GetSelected()<< endl;
|
||||||
@ -2004,6 +2142,7 @@ void ctbAcquisition::ChangeDynamicRange(){
|
|||||||
};
|
};
|
||||||
|
|
||||||
void ctbAcquisition::ChangeNumberOfChannels(){
|
void ctbAcquisition::ChangeNumberOfChannels(){
|
||||||
|
changeDetector();
|
||||||
// if (dataStructure) {
|
// if (dataStructure) {
|
||||||
// cout << cbDetType->GetSelected()<< endl;
|
// cout << cbDetType->GetSelected()<< endl;
|
||||||
// if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302){
|
// if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302){
|
||||||
@ -2017,6 +2156,24 @@ void ctbAcquisition::ChangeNumberOfChannels(){
|
|||||||
changePlot();
|
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){
|
void ctbAcquisition::ChangeHistoLimitsPedSub(Long_t a){
|
||||||
|
@ -42,7 +42,7 @@ using namespace std;
|
|||||||
class ctbAcquisition : public TGGroupFrame {
|
class ctbAcquisition : public TGGroupFrame {
|
||||||
|
|
||||||
|
|
||||||
enum {DESERIALIZER, MOENCH04, MOENCH02, ADCSAR2, MYTHEN301, MYTHEN302};
|
enum {DESERIALIZER, MOENCH04, MOENCH02, MOENCH03, IMAGE32B, IMAGE16B, ADCSAR2, MYTHEN301, MYTHEN302};
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -57,6 +57,9 @@ class ctbAcquisition : public TGGroupFrame {
|
|||||||
TGNumberEntry *eNumCount;
|
TGNumberEntry *eNumCount;
|
||||||
|
|
||||||
|
|
||||||
|
TGNumberEntry *ePixX;
|
||||||
|
TGNumberEntry *ePixY;
|
||||||
|
|
||||||
TGNumberEntry *eFitADC;
|
TGNumberEntry *eFitADC;
|
||||||
TGNumberEntry *eBitPlot;
|
TGNumberEntry *eBitPlot;
|
||||||
TGNumberEntry *eMinRaw;
|
TGNumberEntry *eMinRaw;
|
||||||
@ -231,7 +234,8 @@ class ctbAcquisition : public TGGroupFrame {
|
|||||||
void ChangeNumberOfChannels(Long_t);
|
void ChangeNumberOfChannels(Long_t);
|
||||||
void ChangeDynamicRange();
|
void ChangeDynamicRange();
|
||||||
void ChangeDynamicRange(Long_t);
|
void ChangeDynamicRange(Long_t);
|
||||||
|
void ChangeImagePixels();
|
||||||
|
void ChangeImagePixels(Long_t);
|
||||||
|
|
||||||
void canvasClicked();
|
void canvasClicked();
|
||||||
void FitADC();
|
void FitADC();
|
||||||
|
@ -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(Long_t a) {setValue();}
|
||||||
|
|
||||||
void ctbDac::setValue() {
|
void ctbDac::setValue() {
|
||||||
|
|
||||||
cout << "setting dac! "<< id << " value " << dacsEntry->GetIntNumber() << " units " << dacsUnit->IsOn() << endl;
|
cout << "setting dac! "<< id << " value " << dacsEntry->GetIntNumber() << " units " << dacsUnit->IsOn() << endl;
|
||||||
|
|
||||||
try {
|
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")
|
} CATCH_DISPLAY ("Could not set dac " + to_string(id) + ".", "ctbDac::setValue")
|
||||||
|
|
||||||
getValue();
|
getValue();
|
||||||
@ -128,7 +139,11 @@ void ctbDac::setOn(Bool_t b) {
|
|||||||
setValue();
|
setValue();
|
||||||
} else {
|
} else {
|
||||||
try {
|
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")
|
} CATCH_DISPLAY ("Could not power off dac " + to_string(id) + ".", "ctbDac::setOn")
|
||||||
}
|
}
|
||||||
getValue();
|
getValue();
|
||||||
@ -136,7 +151,11 @@ void ctbDac::setOn(Bool_t b) {
|
|||||||
|
|
||||||
int ctbDac::getValue() {
|
int ctbDac::getValue() {
|
||||||
try {
|
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;
|
cout << "dac " << id << " " << val << endl;
|
||||||
dacsValue->SetText(to_string(val).c_str());
|
dacsValue->SetText(to_string(val).c_str());
|
||||||
if (val >= 0) {
|
if (val >= 0) {
|
||||||
|
@ -45,7 +45,7 @@ class ctbDac : public TGHorizontalFrame {
|
|||||||
|
|
||||||
int setLabel(char *tit, int mv);
|
int setLabel(char *tit, int mv);
|
||||||
string getLabel();
|
string getLabel();
|
||||||
|
int getMoenchDacId();
|
||||||
|
|
||||||
|
|
||||||
ClassDef(ctbDac,0)
|
ClassDef(ctbDac,0)
|
||||||
@ -54,8 +54,6 @@ class ctbDac : public TGHorizontalFrame {
|
|||||||
class ctbDacs : public TGGroupFrame {
|
class ctbDacs : public TGGroupFrame {
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ctbDac *dacs[NDACS+2];
|
ctbDac *dacs[NDACS+2];
|
||||||
|
|
||||||
sls::Detector* myDet;
|
sls::Detector* myDet;
|
||||||
|
@ -71,14 +71,14 @@ class ctbDefs {
|
|||||||
std::string exceptionMessage,
|
std::string exceptionMessage,
|
||||||
std::string source) {
|
std::string source) {
|
||||||
// because sls_detector_exceptions cannot be included
|
// because sls_detector_exceptions cannot be included
|
||||||
if (exceptionMessage.find("hared memory")) {
|
if (exceptionMessage.find("hared memory") != std::string::npos) {
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
if (exceptionMessage.find("annot connect")) {
|
if (exceptionMessage.find("annot connect") != std::string::npos) {
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
cprintf(RED, "Warning (%s): %s [Caught Exception: %s]\n", source.c_str(), message.c_str(), exceptionMessage.c_str());
|
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);
|
//return Message(qDefs::WARNING, message + std::string("\nCaught exception:\n") + exceptionMessage, source);
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -259,8 +259,10 @@ ctbMain::ctbMain(const TGWindow *p, sls::Detector *det)
|
|||||||
|
|
||||||
cout << "connect mtab" << endl;
|
cout << "connect mtab" << endl;
|
||||||
|
|
||||||
|
try{
|
||||||
setReadoutMode(pat->getReadoutMode());
|
setReadoutMode(pat->getReadoutMode());
|
||||||
|
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
|
||||||
|
|
||||||
setADCEnable(adcs->setEnable());
|
setADCEnable(adcs->setEnable());
|
||||||
setAnalogSamples(pat->getAnalogSamples());
|
setAnalogSamples(pat->getAnalogSamples());
|
||||||
setDigitalSamples(pat->getDigitalSamples());
|
setDigitalSamples(pat->getDigitalSamples());
|
||||||
|
@ -1035,33 +1035,42 @@ void ctbPattern::readoutModeChanged(int flags) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ctbPattern::getReadoutMode() {
|
int ctbPattern::getReadoutMode() {
|
||||||
try{
|
int retval=slsDetectorDefs::ANALOG_ONLY;
|
||||||
auto retval = myDet->getReadoutMode().tsquash("Different values");
|
|
||||||
switch(retval) {
|
if (myDet->getDetectorType().squash() == slsDetectorDefs::CHIPTESTBOARD) {
|
||||||
case slsDetectorDefs::ANALOG_AND_DIGITAL:
|
try{
|
||||||
cout << "analog and digital" << endl;
|
retval = myDet->getReadoutMode().tsquash("Different values");
|
||||||
cbAnalog->SetOn(kTRUE);
|
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
|
||||||
cbDigital->SetOn(kTRUE);
|
|
||||||
break;
|
switch(retval) {
|
||||||
case slsDetectorDefs::DIGITAL_ONLY:
|
case slsDetectorDefs::ANALOG_AND_DIGITAL:
|
||||||
cout << "digital only" << endl;
|
cout << "analog and digital" << endl;
|
||||||
cbAnalog->SetOn(kFALSE);
|
cbAnalog->SetOn(kTRUE);
|
||||||
cbDigital->SetOn(kTRUE);
|
cbDigital->SetOn(kTRUE);
|
||||||
break;
|
break;
|
||||||
case slsDetectorDefs::ANALOG_ONLY:
|
case slsDetectorDefs::DIGITAL_ONLY:
|
||||||
cout << "analog only" << endl;
|
cout << "digital only" << endl;
|
||||||
cbAnalog->SetOn(kTRUE);
|
cbAnalog->SetOn(kFALSE);
|
||||||
cbDigital->SetOn(kFALSE);
|
cbDigital->SetOn(kTRUE);
|
||||||
break;
|
break;
|
||||||
default:
|
case slsDetectorDefs::ANALOG_ONLY:
|
||||||
throw("unknown readout flag");
|
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));
|
Emit("readoutModeChanged(int)",static_cast<int>(retval));
|
||||||
return retval;
|
return retval;
|
||||||
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ctbPattern::getAnalogSamples() {
|
int ctbPattern::getAnalogSamples() {
|
||||||
@ -1075,13 +1084,17 @@ int ctbPattern::getAnalogSamples() {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ctbPattern::getDigitalSamples() {
|
int ctbPattern::getDigitalSamples() {
|
||||||
try{
|
int retval=0;
|
||||||
auto retval = myDet->getNumberOfDigitalSamples().tsquash("Different values");
|
if (myDet->getDetectorType().squash() == slsDetectorDefs::CHIPTESTBOARD) {
|
||||||
eDigitalSamples->SetNumber((Double_t)retval);
|
try{
|
||||||
Emit("digitalSamplesChanged(const int)", eDigitalSamples->GetNumber());
|
auto retval = myDet->getNumberOfDigitalSamples().tsquash("Different values");
|
||||||
return eDigitalSamples->GetNumber();
|
} CATCH_DISPLAY ("Could not get number of digital samples.", "ctbPattern::getDigitalSamples")
|
||||||
} CATCH_DISPLAY ("Could not get number of triggers.", "ctbPattern::update")
|
}
|
||||||
|
eDigitalSamples->SetNumber((Double_t)retval);
|
||||||
|
Emit("digitalSamplesChanged(const int)", eDigitalSamples->GetNumber());
|
||||||
|
return eDigitalSamples->GetNumber();
|
||||||
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -374,33 +374,43 @@ void ctbSignals::update() {
|
|||||||
|
|
||||||
} CATCH_DISPLAY ("Could not get patternIOcontrol.", "ctbSignals::update")
|
} CATCH_DISPLAY ("Could not get patternIOcontrol.", "ctbSignals::update")
|
||||||
|
|
||||||
try {
|
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
||||||
|
|
||||||
auto dbitlist = myDet->getRxDbitList().tsquash("Different values");
|
|
||||||
// enable all
|
// enable all
|
||||||
if (dbitlist.empty()) {
|
for (int is=0; is<64; is++) {
|
||||||
for (int is=0; is<64; is++) {
|
signals[is]->setDbitList(1);
|
||||||
signals[is]->setDbitList(1);
|
}
|
||||||
}
|
eDbitOffset->SetNumber(0);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
// disable all
|
// ctb
|
||||||
for (int is=0; is<64; is++) {
|
else {
|
||||||
signals[is]->setDbitList(0);
|
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
|
else {
|
||||||
for (const auto &value : dbitlist) {
|
// disable all
|
||||||
signals[value]->setDbitList(1);
|
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")
|
} 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")
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
auto val = myDet->getRxDbitOffset().tsquash("Different values");
|
||||||
|
eDbitOffset->SetNumber(val);
|
||||||
|
} CATCH_DISPLAY ("Could not get receiver dbit offset.", "ctbSignals::update")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ if [ -f "$infile" ]
|
|||||||
then
|
then
|
||||||
gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ;
|
gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ;
|
||||||
echo compiling
|
echo compiling
|
||||||
|
echo gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ;
|
||||||
$exe ;
|
$exe ;
|
||||||
echo cleaning
|
echo cleaning
|
||||||
rm $exe
|
rm $exe
|
||||||
|
@ -1,69 +1,75 @@
|
|||||||
find_package(Doxygen)
|
find_package(Doxygen REQUIRED)
|
||||||
find_package(Sphinx)
|
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
|
# Utility to generate command line documentation
|
||||||
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
|
add_executable(gendoc src/gendoc.cpp)
|
||||||
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
# This is a bit hacky, but better than exposing stuff?
|
||||||
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
|
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(
|
#Doxygen
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in"
|
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
|
||||||
"${SPHINX_BUILD}/conf.py"
|
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
||||||
@ONLY)
|
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
|
||||||
|
|
||||||
add_custom_target(docs
|
#Sphinx
|
||||||
gendoc
|
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
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")
|
|
||||||
|
|
||||||
else (DOXYGEN_FOUND AND SPHINX_FOUND)
|
set(SPHINX_SOURCE_FILES
|
||||||
message("Doxygen and Sphinx are needed to build documentation")
|
src/commandline.rst
|
||||||
endif (DOXYGEN_FOUND AND SPHINX_FOUND)
|
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")
|
||||||
|
@ -21,7 +21,7 @@ print(sys.path)
|
|||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
|
|
||||||
project = 'slsDetectorPackage'
|
project = 'slsDetectorPackage'
|
||||||
copyright = '2019, PSD Detector Group'
|
copyright = '2020, PSD Detector Group'
|
||||||
author = 'PSD Detector Group'
|
author = 'PSD Detector Group'
|
||||||
version = '@PROJECT_VERSION@'
|
version = '@PROJECT_VERSION@'
|
||||||
|
|
||||||
|
116
docs/src/consuming.rst
Normal file
116
docs/src/consuming.rst
Normal 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
|
@ -13,7 +13,7 @@ To use the basic building blocks, meaning sls_detector_get/put and
|
|||||||
the shared libraries these are needed:
|
the shared libraries these are needed:
|
||||||
|
|
||||||
* Linux, preferably recent kernel (currently no cross platform support)
|
* 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)
|
* C++11 compatible compiler. (We test with gcc and clang)
|
||||||
* ZeroMQ version 4
|
* ZeroMQ version 4
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ GUI
|
|||||||
The GUI is currently using Qt4 but watch out for an upgrade to 5.
|
The GUI is currently using Qt4 but watch out for an upgrade to 5.
|
||||||
|
|
||||||
* Qt 4.8
|
* Qt 4.8
|
||||||
* Qwt 6
|
* Qwt 6.1
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
Python bindings
|
Python bindings
|
||||||
|
115
docs/src/examples.rst
Normal file
115
docs/src/examples.rst
Normal 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);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -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
|
* documentation. Uses the string returned from sls_detector_help cmd
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -9,7 +9,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
#include "CmdProxy.h"
|
#include "CmdProxy.h"
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
@ -52,5 +51,4 @@ int main() {
|
|||||||
auto help = replace_all(tmp, "\n\t", "\n\t\t");
|
auto help = replace_all(tmp, "\n\t", "\n\t\t");
|
||||||
fs << '\t' << cmd << usage << help << "\n";
|
fs << '\t' << cmd << usage << help << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -6,12 +6,18 @@
|
|||||||
Welcome to slsDetectorPackage's documentation!
|
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::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
:caption: Installation:
|
:caption: Installation:
|
||||||
|
|
||||||
installation
|
installation
|
||||||
dependencies
|
dependencies
|
||||||
|
consuming
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:caption: C++ API
|
:caption: C++ API
|
||||||
@ -20,6 +26,7 @@ Welcome to slsDetectorPackage's documentation!
|
|||||||
detector
|
detector
|
||||||
result
|
result
|
||||||
receiver
|
receiver
|
||||||
|
examples
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:caption: Python API
|
:caption: Python API
|
||||||
|
@ -2,4 +2,68 @@
|
|||||||
Installation
|
Installation
|
||||||
==============================================
|
==============================================
|
||||||
|
|
||||||
get the source etc.
|
Build from source using CMake
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
|
.. 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.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake ../slsDetectorPackage -DCMAKE_INSTALL_PREFIX=/your/install/path
|
||||||
|
make -j12
|
||||||
|
make install
|
||||||
|
|
||||||
|
Install binaries using conda
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
.. 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.03.18.dev2
|
||||||
|
codna activate myenv
|
||||||
|
|
||||||
|
#ready to use
|
||||||
|
sls_detector_get exptime
|
||||||
|
etc ...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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
|
@ -1,9 +1,9 @@
|
|||||||
Detector
|
Detector
|
||||||
=====================================================
|
=====================================================
|
||||||
|
|
||||||
.. py:currentmodule:: sls_detector
|
.. py:currentmodule:: slsdet
|
||||||
|
|
||||||
.. autoclass:: ExperimentalDetector
|
.. autoclass:: Detector
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
@ -4,7 +4,7 @@ Enums
|
|||||||
These enums are defined in slsDetectorDefs in the C++ package and
|
These enums are defined in slsDetectorDefs in the C++ package and
|
||||||
exposed to Python through pybind11.
|
exposed to Python through pybind11.
|
||||||
|
|
||||||
.. py:currentmodule:: sls_detector
|
.. py:currentmodule:: slsdet
|
||||||
|
|
||||||
.. autoclass:: runStatus
|
.. autoclass:: runStatus
|
||||||
:members:
|
:members:
|
||||||
|
@ -12,7 +12,7 @@ file writing etc.
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from sls_detector import Eiger
|
from slsdet import Eiger
|
||||||
|
|
||||||
d = Eiger()
|
d = Eiger()
|
||||||
threshold = range(0, 2000, 200)
|
threshold = range(0, 2000, 200)
|
||||||
@ -74,7 +74,7 @@ But lets start looking at the at the manual way:
|
|||||||
::
|
::
|
||||||
|
|
||||||
import time
|
import time
|
||||||
from sls_detector import Eiger
|
from slsdet import Eiger
|
||||||
d = Eiger()
|
d = Eiger()
|
||||||
|
|
||||||
n = 10
|
n = 10
|
||||||
@ -114,7 +114,7 @@ hang around until the main process exits.
|
|||||||
|
|
||||||
import time
|
import time
|
||||||
from multiprocessing import Process
|
from multiprocessing import Process
|
||||||
from sls_detector import Eiger
|
from slsdet import Eiger
|
||||||
|
|
||||||
def acquire():
|
def acquire():
|
||||||
"""
|
"""
|
||||||
|
29
examples/gotthard_II.config
Normal file
29
examples/gotthard_II.config
Normal 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
|
||||||
|
|
||||||
|
|
||||||
|
|
140
examples/moench01_T1_lab.config → examples/jctb_moench03_T1.config
Executable file → Normal file
140
examples/moench01_T1_lab.config → examples/jctb_moench03_T1.config
Executable file → Normal 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 0000 0000000000000000
|
||||||
patword 0001 0000000000000000
|
patword 0001 0000000000000000
|
||||||
@ -408,84 +418,84 @@ patnloop1 0
|
|||||||
patloop2 0400 0400
|
patloop2 0400 0400
|
||||||
patnloop2 0
|
patnloop2 0
|
||||||
patwait0 00aa
|
patwait0 00aa
|
||||||
patwaittime0 40000
|
patwaittime0 10000
|
||||||
patwait1 0400
|
patwait1 0400
|
||||||
patwaittime1 0
|
patwaittime1 0
|
||||||
patwait2 0400
|
patwait2 0400
|
||||||
patwaittime2 0
|
patwaittime2 0
|
||||||
|
|
||||||
|
|
||||||
####mcp2011
|
#0:rx_tcpport 1977
|
||||||
#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
|
|
||||||
|
|
||||||
####mx-test-1
|
#############################################
|
||||||
0:rx_udpip 10.1.1.100
|
### edit with 10 Gbs IP of your server
|
||||||
0:detectorip 10.1.1.19
|
############################################
|
||||||
0:rx_udpport 32410
|
0:udp_dstip 10.1.1.102
|
||||||
####gui listening to (on receiver pc)
|
#0:udp_dstip 129.129.202.136
|
||||||
zmqip 129.129.202.92
|
#############################################
|
||||||
zmqport 30001
|
### edit with any number in the subnet of your server (first 3 numbers as above)
|
||||||
####data streaming out of
|
############################################
|
||||||
rx_zmqip 10.1.1.100
|
0:udp_srcip 10.1.1.19
|
||||||
rx_zmqport 30003
|
#0:udp_srcip 129.129.202.13
|
||||||
0:rx_hostname pcmoench01
|
|
||||||
|
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
|
rx_datastream 1
|
||||||
|
rx_readfreq 1
|
||||||
r_readfreq 1
|
|
||||||
|
|
||||||
#0:configuremac -1
|
|
||||||
rx_datastream 1
|
|
||||||
|
|
||||||
r_readfreq 1
|
|
||||||
|
|
||||||
|
|
||||||
dac:6 800
|
dac 6 800
|
||||||
dac:0 1300
|
dac 0 1300
|
||||||
dac:4 1428
|
dac 4 1428
|
||||||
dac:1 1000
|
dac 1 1000
|
||||||
dac:7 900
|
dac 7 900
|
||||||
dac:3 680
|
dac 3 680
|
||||||
dac:2 1400
|
dac 2 1400
|
||||||
dac:5 1200
|
dac 5 1200
|
||||||
adcinvert 4a342593
|
adcinvert 4a342593
|
||||||
samples 5000
|
#0xb5cbda6c
|
||||||
adcphase 90
|
asamples 5000
|
||||||
adcpipeline 15
|
dsamples 0
|
||||||
|
adcphase 30 deg
|
||||||
|
adcpipeline 14
|
||||||
adcreg 14 40
|
adcreg 14 40
|
||||||
powerchip 1
|
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
reg 0x5e 0x00010000
|
||||||
|
#powerchip 1
|
||||||
vhighvoltage 90
|
vhighvoltage 90
|
||||||
period 0.005
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
frames 100
|
|
||||||
period 0.1
|
|
||||||
outdir /scratch/
|
|
||||||
enablefwrite 0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
63
examples/moench03_T1.config
Normal file
63
examples/moench03_T1.config
Normal 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
|
||||||
|
vhighvoltage 90
|
||||||
|
|
||||||
|
#adcreg 0x14 0x40
|
||||||
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
|||||||
|
#include "DetectorImpl.h"
|
||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
#include "multiSlsDetector.h"
|
|
||||||
#include "string_utils.h"
|
#include "string_utils.h"
|
||||||
#include "tests/globals.h"
|
#include "tests/globals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class MultiDetectorFixture {
|
class MultiDetectorFixture {
|
||||||
protected:
|
protected:
|
||||||
multiSlsDetector d;
|
DetectorImpl d;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MultiDetectorFixture() : d(0, true, true) {
|
MultiDetectorFixture() : d(0, true, true) {
|
||||||
|
90
integrationTests/test-integrationDectector.cpp
Executable file → Normal file
90
integrationTests/test-integrationDectector.cpp
Executable file → Normal file
@ -2,9 +2,9 @@
|
|||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
|
|
||||||
#include "ClientSocket.h"
|
#include "ClientSocket.h"
|
||||||
|
#include "DetectorImpl.h"
|
||||||
|
#include "Module.h"
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
#include "multiSlsDetector.h"
|
|
||||||
#include "slsDetector.h"
|
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
@ -23,10 +23,10 @@
|
|||||||
// extern dt type;
|
// extern dt type;
|
||||||
|
|
||||||
TEST_CASE("Single detector no receiver", "[.integration][.single]") {
|
TEST_CASE("Single detector no receiver", "[.integration][.single]") {
|
||||||
auto t = slsDetector::getTypeFromDetector(test::hostname);
|
auto t = Module::getTypeFromDetector(test::hostname);
|
||||||
CHECK(t == test::type);
|
CHECK(t == test::type);
|
||||||
|
|
||||||
slsDetector d(t);
|
Module d(t);
|
||||||
CHECK(d.getDetectorTypeAsEnum() == t);
|
CHECK(d.getDetectorTypeAsEnum() == t);
|
||||||
CHECK(d.getDetectorTypeAsString() == test::detector_type);
|
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_cport = 1993;
|
||||||
int new_sport = 2000;
|
int new_sport = 2000;
|
||||||
{
|
{
|
||||||
slsDetector d(test::type);
|
Module d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
CHECK(d.getControlPort() == old_cport);
|
CHECK(d.getControlPort() == old_cport);
|
||||||
d.setControlPort(new_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();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
slsDetector d(test::type);
|
Module d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
d.setControlPort(new_cport);
|
d.setControlPort(new_cport);
|
||||||
d.setStopPort(new_sport);
|
d.setStopPort(new_sport);
|
||||||
@ -73,24 +73,23 @@ TEST_CASE("Set control port then create a new object with this control port",
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
slsDetector d(test::type);
|
Module d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
CHECK(d.getStopPort() == DEFAULT_PORTNO + 1);
|
CHECK(d.getStopPort() == DEFAULT_PORTNO + 1);
|
||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("single EIGER detector no receiver basic set and get",
|
TEST_CASE("single EIGER detector no receiver basic set and get",
|
||||||
"[.integration][eiger]") {
|
"[.integration][eiger]") {
|
||||||
// TODO! this test should take command line arguments for config
|
// TODO! this test should take command line arguments for config
|
||||||
SingleDetectorConfig c;
|
SingleDetectorConfig c;
|
||||||
|
|
||||||
// Read type by connecting to the detector
|
// Read type by connecting to the detector
|
||||||
auto type = slsDetector::getTypeFromDetector(c.hostname);
|
auto type = Module::getTypeFromDetector(c.hostname);
|
||||||
CHECK(type == c.type_enum);
|
CHECK(type == c.type_enum);
|
||||||
|
|
||||||
// Create slsDetector of said type and set hostname and detector online
|
// Create Module of said type and set hostname and detector online
|
||||||
slsDetector d(type);
|
Module d(type);
|
||||||
CHECK(d.getDetectorTypeAsEnum() == type);
|
CHECK(d.getDetectorTypeAsEnum() == type);
|
||||||
CHECK(d.getDetectorTypeAsString() == c.type_string);
|
CHECK(d.getDetectorTypeAsString() == c.type_string);
|
||||||
|
|
||||||
@ -130,10 +129,8 @@ TEST_CASE("single EIGER detector no receiver basic set and get",
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
||||||
slsDetector d(test::type);
|
Module d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
|
|
||||||
// Check that detector server is unlocked then lock
|
// Check that detector server is unlocked then lock
|
||||||
@ -154,13 +151,12 @@ TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Set settings", "[.integration][.single]"){
|
TEST_CASE("Set settings", "[.integration][.single]") {
|
||||||
slsDetector d(test::type);
|
Module d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD);
|
CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("Timer functions", "[.integration][cli]") {
|
TEST_CASE("Timer functions", "[.integration][cli]") {
|
||||||
// FRAME_NUMBER, /**< number of real time frames: total number of
|
// FRAME_NUMBER, /**< number of real time frames: total number of
|
||||||
// acquisitions is number or frames*number of triggers */ ACQUISITION_TIME,
|
// acquisitions is number or frames*number of triggers */ ACQUISITION_TIME,
|
||||||
@ -185,7 +181,7 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
|
|||||||
// MEASURED_SUBPERIOD, /**< measured subperiod */
|
// MEASURED_SUBPERIOD, /**< measured subperiod */
|
||||||
// MAX_TIMERS
|
// MAX_TIMERS
|
||||||
|
|
||||||
slsDetector d(test::type);
|
Module d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
|
|
||||||
// Number of frames
|
// Number of frames
|
||||||
@ -204,8 +200,7 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
|
|||||||
if (test::type != dt::EIGER) {
|
if (test::type != dt::EIGER) {
|
||||||
auto delay = 10000;
|
auto delay = 10000;
|
||||||
d.setDelayAfterTrigger(delay);
|
d.setDelayAfterTrigger(delay);
|
||||||
CHECK(d.getDelayAfterTrigger() ==
|
CHECK(d.getDelayAfterTrigger() == delay);
|
||||||
delay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto triggers = 2;
|
auto triggers = 2;
|
||||||
@ -218,16 +213,15 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
|
|||||||
CHECK(d.getSubExptime() == subtime);
|
CHECK(d.getSubExptime() == subtime);
|
||||||
}
|
}
|
||||||
// for (int i =0; i!=frames; ++i)
|
// for (int i =0; i!=frames; ++i)
|
||||||
d.startAndReadAll();
|
d.startAndReadAll();
|
||||||
|
|
||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TEST_CASE("Aquire", "[.integration][eiger]"){
|
// TEST_CASE("Aquire", "[.integration][eiger]"){
|
||||||
// SingleDetectorConfig c;
|
// SingleDetectorConfig c;
|
||||||
// auto type = slsDetector::getTypeFromDetector(c.hostname);
|
// auto type = Module::getTypeFromDetector(c.hostname);
|
||||||
// slsDetector d(type);
|
// Module d(type);
|
||||||
// d.setHostname(c.hostname);
|
// d.setHostname(c.hostname);
|
||||||
|
|
||||||
// auto period = 1000000000;
|
// auto period = 1000000000;
|
||||||
@ -252,7 +246,7 @@ TEST_CASE(
|
|||||||
int ratecorr = 125;
|
int ratecorr = 125;
|
||||||
|
|
||||||
// pick up multi detector from shm id 0
|
// pick up multi detector from shm id 0
|
||||||
multiSlsDetector m(0);
|
DetectorImpl m(0);
|
||||||
|
|
||||||
// ensure eiger detector type, hostname and online
|
// ensure eiger detector type, hostname and online
|
||||||
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
||||||
@ -302,7 +296,7 @@ TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
|
|||||||
SingleDetectorConfig c;
|
SingleDetectorConfig c;
|
||||||
|
|
||||||
// pick up multi detector from shm id 0
|
// pick up multi detector from shm id 0
|
||||||
multiSlsDetector m(0);
|
DetectorImpl m(0);
|
||||||
|
|
||||||
// ensure ctb detector type, hostname and online
|
// ensure ctb detector type, hostname and online
|
||||||
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
||||||
@ -382,12 +376,12 @@ TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
|
||||||
TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegration][dbit]") {
|
"[.ctbintegration][dbit]") {
|
||||||
SingleDetectorConfig c;
|
SingleDetectorConfig c;
|
||||||
|
|
||||||
// pick up multi detector from shm id 0
|
// pick up multi detector from shm id 0
|
||||||
multiSlsDetector m(0);
|
DetectorImpl m(0);
|
||||||
|
|
||||||
// ensure ctb detector type, hostname and online
|
// ensure ctb detector type, hostname and online
|
||||||
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
||||||
@ -403,27 +397,27 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegrat
|
|||||||
|
|
||||||
// dbit list
|
// dbit list
|
||||||
|
|
||||||
std::vector <int> list = m.getReceiverDbitList();
|
std::vector<int> list = m.getReceiverDbitList();
|
||||||
list.clear();
|
list.clear();
|
||||||
for (int i = 0; i < 10; ++i)
|
for (int i = 0; i < 10; ++i)
|
||||||
list.push_back(i);
|
list.push_back(i);
|
||||||
m.setReceiverDbitList(list);
|
m.setReceiverDbitList(list);
|
||||||
|
|
||||||
CHECK(m.getReceiverDbitList().size() == 10);
|
CHECK(m.getReceiverDbitList().size() == 10);
|
||||||
|
|
||||||
list.push_back(64);
|
list.push_back(64);
|
||||||
CHECK_THROWS_AS(m.setReceiverDbitList(list), sls::RuntimeError);
|
CHECK_THROWS_AS(m.setReceiverDbitList(list), sls::RuntimeError);
|
||||||
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
|
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
|
||||||
Catch::Matchers::Contains("be between 0 and 63"));
|
Catch::Matchers::Contains("be between 0 and 63"));
|
||||||
|
|
||||||
list.clear();
|
list.clear();
|
||||||
for (int i = 0; i < 65; ++i)
|
for (int i = 0; i < 65; ++i)
|
||||||
list.push_back(i);
|
list.push_back(i);
|
||||||
CHECK(list.size() == 65);
|
CHECK(list.size() == 65);
|
||||||
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
|
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
|
||||||
Catch::Matchers::Contains("be greater than 64"));
|
Catch::Matchers::Contains("be greater than 64"));
|
||||||
|
|
||||||
list.clear();
|
list.clear();
|
||||||
m.setReceiverDbitList(list);
|
m.setReceiverDbitList(list);
|
||||||
CHECK(m.getReceiverDbitList().empty());
|
CHECK(m.getReceiverDbitList().empty());
|
||||||
|
|
||||||
@ -441,8 +435,8 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegrat
|
|||||||
m.setExternalSamplingSource(62);
|
m.setExternalSamplingSource(62);
|
||||||
CHECK(m.getExternalSamplingSource() == 62);
|
CHECK(m.getExternalSamplingSource() == 62);
|
||||||
CHECK_THROWS_WITH(m.setExternalSamplingSource(64),
|
CHECK_THROWS_WITH(m.setExternalSamplingSource(64),
|
||||||
Catch::Matchers::Contains("be 0-63"));
|
Catch::Matchers::Contains("be 0-63"));
|
||||||
CHECK(m.getExternalSamplingSource() == 62);
|
CHECK(m.getExternalSamplingSource() == 62);
|
||||||
m.setExternalSampling(1);
|
m.setExternalSampling(1);
|
||||||
CHECK(m.getExternalSampling() == 1);
|
CHECK(m.getExternalSampling() == 1);
|
||||||
m.setExternalSampling(0);
|
m.setExternalSampling(0);
|
||||||
@ -450,20 +444,23 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegrat
|
|||||||
m.setExternalSampling(1);
|
m.setExternalSampling(1);
|
||||||
CHECK(m.getExternalSampling() == 1);
|
CHECK(m.getExternalSampling() == 1);
|
||||||
CHECK(m.readRegister(0x7b) == 0x1003E);
|
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;
|
SingleDetectorConfig c;
|
||||||
|
|
||||||
// pick up multi detector from shm id 0
|
// pick up multi detector from shm id 0
|
||||||
multiSlsDetector m(0);
|
DetectorImpl m(0);
|
||||||
|
|
||||||
// ensure ctb detector type, hostname and online
|
// 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);
|
REQUIRE(m.getHostname() == c.hostname);
|
||||||
|
|
||||||
CHECK(m.setNumberOfFrames(1) == 1);
|
CHECK(m.setNumberOfFrames(1) == 1);
|
||||||
|
|
||||||
// starting fnum
|
// starting fnum
|
||||||
uint64_t val = 8;
|
uint64_t val = 8;
|
||||||
@ -495,10 +492,11 @@ TEST_CASE("Eiger readnlines", "[.eigerintegration][readnlines]") {
|
|||||||
SingleDetectorConfig c;
|
SingleDetectorConfig c;
|
||||||
|
|
||||||
// pick up multi detector from shm id 0
|
// pick up multi detector from shm id 0
|
||||||
multiSlsDetector m(0);
|
DetectorImpl m(0);
|
||||||
|
|
||||||
// ensure detector type, hostname
|
// ensure detector type, hostname
|
||||||
REQUIRE((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER));
|
REQUIRE(
|
||||||
|
(m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER));
|
||||||
REQUIRE(m.getHostname() == c.hostname);
|
REQUIRE(m.getHostname() == c.hostname);
|
||||||
|
|
||||||
m.setDynamicRange(16);
|
m.setDynamicRange(16);
|
||||||
@ -507,7 +505,7 @@ TEST_CASE("Eiger readnlines", "[.eigerintegration][readnlines]") {
|
|||||||
CHECK(m.getReadNLines() == 256);
|
CHECK(m.getReadNLines() == 256);
|
||||||
m.setReadNLines(1);
|
m.setReadNLines(1);
|
||||||
CHECK(m.getReadNLines() == 1);
|
CHECK(m.getReadNLines() == 1);
|
||||||
|
|
||||||
m.setDynamicRange(8);
|
m.setDynamicRange(8);
|
||||||
m.setReadNLines(256);
|
m.setReadNLines(256);
|
||||||
CHECK(m.getReadNLines() == 256);
|
CHECK(m.getReadNLines() == 256);
|
||||||
|
10
integrationTests/test-integrationMulti.cpp
Executable file → Normal file
10
integrationTests/test-integrationMulti.cpp
Executable file → Normal file
@ -1,5 +1,5 @@
|
|||||||
|
#include "DetectorImpl.h"
|
||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
#include "multiSlsDetector.h"
|
|
||||||
#include "string_utils.h"
|
#include "string_utils.h"
|
||||||
#include "tests/globals.h"
|
#include "tests/globals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -9,7 +9,7 @@ using namespace Catch::literals;
|
|||||||
TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
|
TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
|
||||||
auto hostnames = sls::split(test::hostname, '+');
|
auto hostnames = sls::split(test::hostname, '+');
|
||||||
|
|
||||||
multiSlsDetector d(0, true, true);
|
DetectorImpl d(0, true, true);
|
||||||
d.setHostname(test::hostname.c_str());
|
d.setHostname(test::hostname.c_str());
|
||||||
|
|
||||||
CHECK(d.getHostname() == test::hostname);
|
CHECK(d.getHostname() == test::hostname);
|
||||||
@ -24,11 +24,9 @@ TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
||||||
|
|
||||||
multiSlsDetector d(0, true, true);
|
DetectorImpl d(0, true, true);
|
||||||
d.setHostname(test::hostname.c_str());
|
d.setHostname(test::hostname.c_str());
|
||||||
|
|
||||||
// FRAME_NUMBER
|
// FRAME_NUMBER
|
||||||
@ -57,7 +55,6 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
|||||||
// PROGRESS, /**< fraction of measurement elapsed - only get! */
|
// PROGRESS, /**< fraction of measurement elapsed - only get! */
|
||||||
// MEASUREMENTS_NUMBER,
|
// MEASUREMENTS_NUMBER,
|
||||||
|
|
||||||
|
|
||||||
// FRAMES_FROM_START,
|
// FRAMES_FROM_START,
|
||||||
// FRAMES_FROM_START_PG,
|
// FRAMES_FROM_START_PG,
|
||||||
// SAMPLES,
|
// SAMPLES,
|
||||||
@ -78,7 +75,6 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
|||||||
CHECK(d.setSubFrameExposureDeadTime(-1) == Approx(subframe_deadtime));
|
CHECK(d.setSubFrameExposureDeadTime(-1) == Approx(subframe_deadtime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (test::type == dt::EIGER) {
|
if (test::type == dt::EIGER) {
|
||||||
// 32bit is needed for subframe exposure
|
// 32bit is needed for subframe exposure
|
||||||
d.setDynamicRange(32);
|
d.setDynamicRange(32);
|
||||||
|
Submodule libs/pybind11 updated: a23996fce3...4f72ef846f
@ -17,13 +17,13 @@
|
|||||||
|
|
||||||
/*! \file document.h */
|
/*! \file document.h */
|
||||||
|
|
||||||
#include "reader.h"
|
#include "encodedstream.h"
|
||||||
#include "internal/meta.h"
|
#include "internal/meta.h"
|
||||||
#include "internal/strfunc.h"
|
#include "internal/strfunc.h"
|
||||||
#include "memorystream.h"
|
#include "memorystream.h"
|
||||||
#include "encodedstream.h"
|
#include "reader.h"
|
||||||
#include <new> // placement new
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include <new> // placement new
|
||||||
|
|
||||||
RAPIDJSON_DIAG_PUSH
|
RAPIDJSON_DIAG_PUSH
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
#ifndef RAPIDJSON_ENCODEDSTREAM_H_
|
#ifndef RAPIDJSON_ENCODEDSTREAM_H_
|
||||||
#define RAPIDJSON_ENCODEDSTREAM_H_
|
#define RAPIDJSON_ENCODEDSTREAM_H_
|
||||||
|
|
||||||
#include "stream.h"
|
|
||||||
#include "memorystream.h"
|
#include "memorystream.h"
|
||||||
|
#include "stream.h"
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
RAPIDJSON_DIAG_PUSH
|
RAPIDJSON_DIAG_PUSH
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
#ifndef RAPIDJSON_STRTOD_
|
#ifndef RAPIDJSON_STRTOD_
|
||||||
#define RAPIDJSON_STRTOD_
|
#define RAPIDJSON_STRTOD_
|
||||||
|
|
||||||
#include "ieee754.h"
|
|
||||||
#include "biginteger.h"
|
#include "biginteger.h"
|
||||||
#include "diyfp.h"
|
#include "diyfp.h"
|
||||||
|
#include "ieee754.h"
|
||||||
#include "pow10.h"
|
#include "pow10.h"
|
||||||
|
|
||||||
RAPIDJSON_NAMESPACE_BEGIN
|
RAPIDJSON_NAMESPACE_BEGIN
|
||||||
|
@ -164,8 +164,8 @@
|
|||||||
#include "msinttypes/inttypes.h"
|
#include "msinttypes/inttypes.h"
|
||||||
#else
|
#else
|
||||||
// Other compilers should have this.
|
// Other compilers should have this.
|
||||||
#include <stdint.h>
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
//!@endcond
|
//!@endcond
|
||||||
#ifdef RAPIDJSON_DOXYGEN_RUNNING
|
#ifdef RAPIDJSON_DOXYGEN_RUNNING
|
||||||
|
@ -18,11 +18,11 @@
|
|||||||
/*! \file reader.h */
|
/*! \file reader.h */
|
||||||
|
|
||||||
#include "allocators.h"
|
#include "allocators.h"
|
||||||
#include "stream.h"
|
|
||||||
#include "encodedstream.h"
|
#include "encodedstream.h"
|
||||||
#include "internal/meta.h"
|
#include "internal/meta.h"
|
||||||
#include "internal/stack.h"
|
#include "internal/stack.h"
|
||||||
#include "internal/strtod.h"
|
#include "internal/strtod.h"
|
||||||
|
#include "stream.h"
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER)
|
#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER)
|
||||||
|
@ -176,6 +176,7 @@ One can configure all the detector settings in a parameter file {\tt{setup.det}}
|
|||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
sls_detector_put 0-parameters setup.det
|
sls_detector_put 0-parameters setup.det
|
||||||
\end{verbatim}
|
\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{vhighvoltage 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:
|
Other important settings that are configured in the {\tt{setup.det}} file are:
|
||||||
@ -359,16 +360,16 @@ In the case of REAL CONTINUOUS readout, i.e. continuous acquire and readout from
|
|||||||
\hline
|
\hline
|
||||||
1 & 32 & \textbf{128} & 7820 & \\
|
1 & 32 & \textbf{128} & 7820 & \\
|
||||||
\hline
|
\hline
|
||||||
10 & 4 & \textbf{10240} & 98 & 105/128\\
|
10 & 4 & \textbf{7813} & 98 & 105/128\\
|
||||||
\hline
|
\hline
|
||||||
10 & 8 & \textbf{5120} & 196 & 210/250\\
|
10 & 8 & \textbf{4000} & 196 & 210/250\\
|
||||||
\hline
|
\hline
|
||||||
10 & 16 & \textbf{2560} & 391 & 420/490\\
|
10 & 16 & \textbf{2000} & 391 & 420/490\\
|
||||||
\hline
|
\hline
|
||||||
10 & 32 & \textbf{1280} & 782 & 840/977\\
|
10 & 32 & \textbf{1023} & 782 & 840/977\\
|
||||||
\hline
|
\hline
|
||||||
\end{tabular}
|
\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}
|
\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}.
|
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}
|
\begin{table}
|
||||||
@ -609,18 +610,19 @@ The detector can be setup such to receive external triggers. Connect a LEMO sign
|
|||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
sls_detector_put 0-timing [auto/trigger/burst_trigger/gating]
|
sls_detector_put 0-timing [auto/trigger/burst_trigger/gating]
|
||||||
sls_detector_put 0-frames x
|
sls_detector_put 0-frames x
|
||||||
sls_detector_put 0-triggers y
|
sls_detector_put 0-cycles y
|
||||||
sls_detector_acquire 0-
|
sls_detector_acquire 0-
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
No timeout is expected between the start of the acquisition and the arrival of the first trigger.
|
No timeout is expected between the start of the acquisition and the arrival of the first trigger.
|
||||||
|
|
||||||
Here are the implemented options so far:
|
Here are the implemented options so far:
|
||||||
\begin{itemize}
|
\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{auto}} is the software controlled acquisition (does not use triggers), where {\tt{exptime}} and {\tt{period}} have to be set. Set number of cycles (i.e. triggers) to 1 using {\tt{cycles}}. 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{trigger}} 1 frame taken for 1 trigger. Your {\tt{frames}} needs to be 1 always, {\tt{cycles}} 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{burst\_trigger}} gets only 1 trigger, but allows to take many frames. With {\tt{frames}} one can change the number of frames. {\tt{cycles}} 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{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}} 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.
|
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}}.
|
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 +630,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.
|
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}} 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:
|
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}
|
\begin{verbatim}
|
||||||
sls_detector_put 0-timing [trigger/burst_trigger]
|
sls_detector_put 0-timing [trigger/burst_trigger]
|
||||||
sls_detector_put 0-frames x
|
sls_detector_put 0-frames x
|
||||||
sls_detector_put 0-triggers y
|
sls_detector_put 0-cycles y
|
||||||
sls_detector_status trigger
|
sls_detector_status trigger
|
||||||
\end{verbatim}
|
\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}.
|
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}.
|
||||||
@ -715,7 +717,7 @@ 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:
|
Here is a list of parameters that should be reset:
|
||||||
\begin{enumerate}
|
\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 \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 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}. 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} is not reset. In future releases, the unused variable will be ignored. Still resetting is a good practice.
|
||||||
|
|
||||||
\end{enumerate}
|
\end{enumerate}
|
||||||
|
|
||||||
@ -988,13 +990,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.
|
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}
|
\subsection{Offline image reconstruction}
|
||||||
The offline image reconstruction{\tt{slsImageReconstruction}} is not part of the package anymore. The code is still available doing \\
|
The offline image reconstruction{\tt{slsImageReconstruction}} is not part of the package anymore. However, it can be retrieved from \\
|
||||||
{\tt{git clone git@git.psi.ch:sls\_detectors\_software/sls\_image\_reconstruction.git slsImageReconstruction}}.
|
{\tt{git clone https://github.com/slsdetectorgroup/slsImageReconstruction.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.
|
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}
|
\begin{verbatim}
|
||||||
#define EIGER_MAX_FRAMES_PER_FILE 2000
|
#define EIGER_MAX_FRAMES_PER_FILE 2000
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
@ -1043,11 +1046,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.\\
|
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.
|
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.
|
Make sure the following options are uncommented in the {\tt{slsImageReconstruction/src/main\_csaxs.cpp}} file.
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
#define MYCBF
|
#define MYCBF
|
||||||
##following line only if you need to process with
|
##following line only if you need to process with BUBBLE
|
||||||
##BUBBLE (Material Science / uXAS beamlines).
|
|
||||||
#define MSHeader
|
#define MSHeader
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
Compile it with:
|
Compile it with:
|
||||||
@ -1096,6 +1100,10 @@ To use it any geometry:\\
|
|||||||
eg.
|
eg.
|
||||||
{\tt image /scratch/run\_63\_d0\_f000000000000\_3.raw 3072 512 1 2 ``Eiger'' 0}.\\
|
{\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}
|
\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:
|
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:
|
||||||
@ -1257,7 +1265,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 enablefwrite 0
|
||||||
./sls_detector_put resetframescaught 0
|
./sls_detector_put resetframescaught 0
|
||||||
./sls_detector_put index 0
|
./sls_detector_put index 0
|
||||||
./sls_detector_put triggers 21
|
./sls_detector_put cycles 21
|
||||||
./sls_detector_put receiver start
|
./sls_detector_put receiver start
|
||||||
./sls_detector_put status start
|
./sls_detector_put status start
|
||||||
for i in $(seq 0 20);
|
for i in $(seq 0 20);
|
||||||
@ -1515,8 +1523,8 @@ frames number
|
|||||||
where {\tt{number}} is a string to be interpreted as an integer.
|
where {\tt{number}} is a string to be interpreted as an integer.
|
||||||
|
|
||||||
\item \begin{verbatim}
|
\item \begin{verbatim}
|
||||||
sls_detector_get triggers
|
sls_detector_get cycles
|
||||||
triggers number
|
cycles number
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
where {\tt{number}} is a string to be interpreted as an integer.
|
where {\tt{number}} is a string to be interpreted as an integer.
|
||||||
|
|
||||||
|
@ -1,19 +1,23 @@
|
|||||||
|
|
||||||
pybind11_add_module(_sls_detector
|
# find_package (Python COMPONENTS Interpreter Development)
|
||||||
|
|
||||||
|
pybind11_add_module(_slsdet
|
||||||
src/main.cpp
|
src/main.cpp
|
||||||
src/enums.cpp
|
src/enums.cpp
|
||||||
src/experimental.cpp
|
src/detector.cpp
|
||||||
|
src/network.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(_sls_detector PUBLIC
|
target_link_libraries(_slsdet PUBLIC
|
||||||
slsDetectorShared
|
slsDetectorShared
|
||||||
slsReceiverShared
|
slsReceiverShared
|
||||||
slsSupportLib
|
slsSupportLib
|
||||||
zmq )
|
${ZeroMQ_LIBRARIES}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
set_target_properties(_sls_detector PROPERTIES
|
set_target_properties(_slsdet PROPERTIES
|
||||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -24,20 +28,21 @@ set( PYTHON_FILES
|
|||||||
dacs.py
|
dacs.py
|
||||||
decorators.py
|
decorators.py
|
||||||
detector_property.py
|
detector_property.py
|
||||||
# detector.py
|
detector.py
|
||||||
# eiger.py
|
eiger.py
|
||||||
errors.py
|
errors.py
|
||||||
experimental.py
|
ctb.py
|
||||||
# jungfrau_ctb.py
|
jungfrau.py
|
||||||
# jungfrau.py
|
mythen3.py
|
||||||
registers.py
|
registers.py
|
||||||
|
lookup.py
|
||||||
utils.py
|
utils.py
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach(FILE ${PYTHON_FILES})
|
foreach(FILE ${PYTHON_FILES})
|
||||||
configure_file( sls_detector/${FILE}
|
configure_file( slsdet/${FILE}
|
||||||
${CMAKE_BINARY_DIR}/bin/sls_detector/${FILE} )
|
${CMAKE_BINARY_DIR}/bin/slsdet/${FILE} )
|
||||||
|
|
||||||
endforeach(FILE ${PYTHON_FILES})
|
endforeach(FILE ${PYTHON_FILES})
|
||||||
|
|
||||||
|
82
python/api-tests/test_detector.py
Normal file
82
python/api-tests/test_detector.py
Normal 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
|
89
python/api-tests/test_jungfrau.py
Normal file
89
python/api-tests/test_jungfrau.py
Normal 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
|
@ -2,9 +2,14 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import numpy as np
|
import numpy as np
|
||||||
sys.path.append(os.path.join(os.getcwd(), 'bin'))
|
sys.path.append(os.path.join(os.getcwd(), 'bin'))
|
||||||
# from sls_detector import Eiger, Jungfrau, Detector, defs
|
|
||||||
from sls_detector import Detector
|
from slsdet import Detector, Mythen3, Eiger, Jungfrau, DetectorDacs, Dac, Ctb
|
||||||
from sls_detector import dacIndex
|
from slsdet import dacIndex, readoutMode
|
||||||
|
from slsdet.lookup import view, find
|
||||||
|
|
||||||
d = Detector()
|
d = Detector()
|
||||||
|
# e = Eiger()
|
||||||
|
c = Ctb()
|
||||||
|
# j = Jungfrau()
|
||||||
|
# m = Mythen3()
|
||||||
|
|
||||||
|
26
python/scripts/cmd_python.py
Normal file
26
python/scripts/cmd_python.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import subprocess
|
||||||
|
import locale
|
||||||
|
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
|
||||||
|
cmd = out.stdout.splitlines()
|
||||||
|
cmd.pop(0)
|
||||||
|
|
||||||
|
from slsdet import Detector, Eiger, Ctb
|
||||||
|
|
||||||
|
pycmd = dir(Detector)+dir(Eiger)+dir(Ctb)
|
||||||
|
|
||||||
|
#Add commands that we should not expect as direct commands in python
|
||||||
|
pycmd += ['vrf', 'vtr', 'vrs', 'vtgstv', 'vsvn', 'vtrim',
|
||||||
|
'vsvp', 'vth1', 'vth2', 'vth3', 'vshaper', 'vshaperneg', 'rxb_rb',
|
||||||
|
'rxb_lb', 'vref_prech', 'vref_rstore', 'vref_cds',
|
||||||
|
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
|
||||||
|
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
|
||||||
|
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
|
||||||
|
, 'vcmp_rl', 'vcmp_rr', 'daclist', 'dacvalues', 'vcal', 'vcas']
|
||||||
|
|
||||||
|
missing = []
|
||||||
|
for c in cmd:
|
||||||
|
if c not in pycmd:
|
||||||
|
print(c)
|
||||||
|
missing.append(c)
|
||||||
|
|
||||||
|
print(f'Missing: {len(missing)} commands')
|
@ -9,19 +9,11 @@ enums.cpp
|
|||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
from parse import remove_comments
|
||||||
|
|
||||||
# def remove_comments(text):
|
def single_line_enum(line):
|
||||||
# def replacer(match):
|
sub = line[line.find('{')+1:line.find('}')]
|
||||||
# s = match.group(0)
|
return sub.strip().split(',')
|
||||||
# if s.startswith('/'):
|
|
||||||
# return " " # note: a space and not an empty string
|
|
||||||
# else:
|
|
||||||
# return s
|
|
||||||
# pattern = re.compile(
|
|
||||||
# r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
|
|
||||||
# re.DOTALL | re.MULTILINE
|
|
||||||
# )
|
|
||||||
# return re.sub(pattern, replacer, text)
|
|
||||||
|
|
||||||
def extract_enums(lines):
|
def extract_enums(lines):
|
||||||
line_iter = iter(lines)
|
line_iter = iter(lines)
|
||||||
@ -30,19 +22,26 @@ def extract_enums(lines):
|
|||||||
m = re.search("(?<=enum )\w+(?= {)", line)
|
m = re.search("(?<=enum )\w+(?= {)", line)
|
||||||
if m:
|
if m:
|
||||||
enum_name = m.group()
|
enum_name = m.group()
|
||||||
# print(enum_name)
|
print(enum_name)
|
||||||
|
# print(line)
|
||||||
fields = []
|
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:
|
#deal with single line enums
|
||||||
pass
|
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
|
||||||
enums[enum_name] = fields
|
enums[enum_name] = fields
|
||||||
return enums
|
return enums
|
||||||
|
|
||||||
|
123
python/scripts/generate_functions.py
Normal file
123
python/scripts/generate_functions.py
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
"""
|
||||||
|
This file is used to auto generate Python bindings for the
|
||||||
|
sls::Detector class. The tool needs the libclang bindings
|
||||||
|
to be installed.
|
||||||
|
|
||||||
|
When the Detector API is updated this file should be run
|
||||||
|
manually
|
||||||
|
"""
|
||||||
|
from clang import cindex
|
||||||
|
import subprocess
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
|
||||||
|
from parse import system_include_paths
|
||||||
|
|
||||||
|
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,
|
||||||
|
)
|
||||||
|
cargs = parser.parse_args()
|
||||||
|
|
||||||
|
db = cindex.CompilationDatabase.fromDirectory(cargs.build_path)
|
||||||
|
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++")
|
||||||
|
incargs = ["-I" + inc for inc in syspath]
|
||||||
|
args = args + incargs
|
||||||
|
|
||||||
|
|
||||||
|
tu = index.parse(fpath, args=args)
|
||||||
|
|
||||||
|
|
||||||
|
m = []
|
||||||
|
ag = []
|
||||||
|
|
||||||
|
lines = []
|
||||||
|
|
||||||
|
ag2 = []
|
||||||
|
|
||||||
|
cn = []
|
||||||
|
|
||||||
|
def get_arguments(node):
|
||||||
|
args = [a.type.spelling for a in node.get_arguments()]
|
||||||
|
args = [
|
||||||
|
"py::arg() = Positions{}" if item == "sls::Positions" else "py::arg()"
|
||||||
|
for item in args
|
||||||
|
]
|
||||||
|
args = ", ".join(args)
|
||||||
|
if 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
|
||||||
|
|
||||||
|
|
||||||
|
def visit(node):
|
||||||
|
if node.kind == cindex.CursorKind.CLASS_DECL:
|
||||||
|
if node.displayname == "Detector":
|
||||||
|
for child in node.get_children():
|
||||||
|
if (
|
||||||
|
child.kind == cindex.CursorKind.CXX_METHOD
|
||||||
|
and child.access_specifier == cindex.AccessSpecifier.PUBLIC
|
||||||
|
):
|
||||||
|
m.append(child)
|
||||||
|
args = get_arguments(child)
|
||||||
|
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:
|
||||||
|
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:
|
||||||
|
f.write(warning)
|
||||||
|
f.write(text)
|
||||||
|
|
||||||
|
# run clang format on the output
|
||||||
|
subprocess.run(["clang-format", "../src/detector.cpp", "-i"])
|
||||||
|
|
29
python/scripts/list_tested_cmd.py
Normal file → Executable file
29
python/scripts/list_tested_cmd.py
Normal file → Executable 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
|
import parse
|
||||||
from pathlib import Path
|
|
||||||
|
#General python stuff
|
||||||
import os
|
import os
|
||||||
import locale
|
import locale
|
||||||
import argparse
|
import argparse
|
||||||
path = Path('../../slsDetectorSoftware/tests/')
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
#Realative path from this dir
|
||||||
|
path = Path('../../slsDetectorSoftware/tests/')
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("-s", "--startswith", help="for filter", type = str, default=None)
|
parser.add_argument("-s", "--startswith", help="for filter", type = str, default=None)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
@ -15,15 +23,12 @@ tested = []
|
|||||||
for fname in files:
|
for fname in files:
|
||||||
with open(path/fname) as f:
|
with open(path/fname) as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
|
|
||||||
data = parse.remove_comments(data)
|
data = parse.remove_comments(data)
|
||||||
data = data.splitlines()
|
data = data.splitlines()
|
||||||
|
|
||||||
|
|
||||||
for line in data:
|
for line in data:
|
||||||
if 'TEST_CASE' in line or 'SECTION' in line:
|
if 'TEST_CASE' in line or 'SECTION' in line:
|
||||||
cmd = line.split("\"")[1]
|
cmd = line.split("\"")[1]
|
||||||
tested.append(cmd)
|
tested.append([cmd, fname])
|
||||||
|
|
||||||
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
|
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
|
||||||
all_cmd = out.stdout.splitlines()
|
all_cmd = out.stdout.splitlines()
|
||||||
@ -33,18 +38,18 @@ all_cmd.pop(0)
|
|||||||
|
|
||||||
if args.startswith is not None:
|
if args.startswith is not None:
|
||||||
all_cmd = [cmd for cmd in all_cmd if cmd.startswith(args.startswith)]
|
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 tn]
|
||||||
not_tested = [cmd for cmd in all_cmd if cmd not in tested]
|
misnamed = [cmd for cmd in tn if cmd not in all_cmd]
|
||||||
misnamed = [cmd for cmd in tested if cmd not in all_cmd]
|
tested = [cmd for cmd in tested if cmd[0] in all_cmd]
|
||||||
tested = [cmd for cmd in tested if cmd in all_cmd]
|
|
||||||
|
|
||||||
|
|
||||||
print("\nThe following commands are tested:")
|
print("\nThe following commands are tested:")
|
||||||
for cmd in tested:
|
for cmd in tested:
|
||||||
print(cmd)
|
print(f'{cmd[0]:>18} : {cmd[1]}')
|
||||||
|
|
||||||
print("\nThe following commands are NOT tested:")
|
print("\nThe following commands are NOT tested:")
|
||||||
for cmd in not_tested:
|
for cmd in not_tested:
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
import re
|
import re
|
||||||
|
import subprocess
|
||||||
|
from subprocess import PIPE
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
def remove_comments(text):
|
def remove_comments(text):
|
||||||
def replacer(match):
|
def replacer(match):
|
||||||
s = match.group(0)
|
s = match.group(0)
|
||||||
@ -10,4 +15,42 @@ def remove_comments(text):
|
|||||||
r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
|
r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
|
||||||
re.DOTALL | re.MULTILINE
|
re.DOTALL | re.MULTILINE
|
||||||
)
|
)
|
||||||
return re.sub(pattern, replacer, text)
|
return re.sub(pattern, replacer, text)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#based on ccsyspath: https://github.com/AndrewWalker/ccsyspath
|
||||||
|
|
||||||
|
def compiler_preprocessor_verbose(compiler, extraflags):
|
||||||
|
"""Capture the compiler preprocessor stage in verbose mode
|
||||||
|
"""
|
||||||
|
lines = []
|
||||||
|
with open(os.devnull, 'r', encoding='utf-8') as devnull:
|
||||||
|
cmd = [compiler, '-E']
|
||||||
|
cmd += extraflags
|
||||||
|
cmd += ['-', '-v']
|
||||||
|
p = subprocess.Popen(cmd, stdin=devnull, stdout=PIPE, stderr=PIPE)
|
||||||
|
p.wait()
|
||||||
|
lines = p.stderr.read()
|
||||||
|
lines = lines.splitlines()
|
||||||
|
return lines
|
||||||
|
|
||||||
|
def system_include_paths(compiler, cpp=True):
|
||||||
|
extraflags = []
|
||||||
|
if cpp:
|
||||||
|
extraflags = b'-x c++'.split()
|
||||||
|
lines = compiler_preprocessor_verbose(compiler, extraflags)
|
||||||
|
lines = [ line.strip() for line in lines ]
|
||||||
|
|
||||||
|
start = lines.index(b'#include <...> search starts here:')
|
||||||
|
end = lines.index(b'End of search list.')
|
||||||
|
|
||||||
|
lines = lines[start+1:end]
|
||||||
|
paths = []
|
||||||
|
for line in lines:
|
||||||
|
line = line.replace(b'(framework directory)', b'')
|
||||||
|
line = line.strip()
|
||||||
|
paths.append(line)
|
||||||
|
paths = [p.decode('utf-8') for p in paths]
|
||||||
|
return paths
|
@ -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
|
Build upon the pybind11 example found here: https://github.com/pybind/python_example
|
||||||
"""
|
"""
|
||||||
from setuptools import setup, Extension, find_packages
|
from setuptools import setup, Extension, find_packages
|
||||||
@ -8,7 +8,7 @@ import sys
|
|||||||
import setuptools
|
import setuptools
|
||||||
import os
|
import os
|
||||||
|
|
||||||
__version__ = 'refactor'
|
__version__ = os.environ.get('GIT_DESCRIBE_TAG', 'developer')
|
||||||
|
|
||||||
|
|
||||||
def get_conda_path():
|
def get_conda_path():
|
||||||
@ -19,31 +19,33 @@ def get_conda_path():
|
|||||||
return os.environ['CONDA_PREFIX']
|
return os.environ['CONDA_PREFIX']
|
||||||
|
|
||||||
|
|
||||||
class get_pybind_include(object):
|
# class get_pybind_include(object):
|
||||||
"""Helper class to determine the pybind11 include path
|
# """Helper class to determine the pybind11 include path
|
||||||
The purpose of this class is to postpone importing pybind11
|
# The purpose of this class is to postpone importing pybind11
|
||||||
until it is actually installed, so that the ``get_include()``
|
# until it is actually installed, so that the ``get_include()``
|
||||||
method can be invoked. """
|
# method can be invoked. """
|
||||||
|
|
||||||
def __init__(self, user=False):
|
# def __init__(self, user=False):
|
||||||
self.user = user
|
# self.user = user
|
||||||
|
|
||||||
def __str__(self):
|
# def __str__(self):
|
||||||
import pybind11
|
# import pybind11
|
||||||
return pybind11.get_include(self.user)
|
# return pybind11.get_include(self.user)
|
||||||
|
|
||||||
|
|
||||||
ext_modules = [
|
ext_modules = [
|
||||||
Extension(
|
Extension(
|
||||||
'_sls_detector',
|
'_slsdet',
|
||||||
['src/main.cpp',
|
['src/main.cpp',
|
||||||
'src/enums.cpp',
|
'src/enums.cpp',
|
||||||
'src/experimental.cpp'],
|
'src/detector.cpp',
|
||||||
|
'src/network.cpp'],
|
||||||
include_dirs=[
|
include_dirs=[
|
||||||
# Path to pybind11 headers
|
# Path to pybind11 headers
|
||||||
get_pybind_include(),
|
# get_pybind_include(),
|
||||||
get_pybind_include(user=True),
|
# get_pybind_include(user=True),
|
||||||
os.path.join(get_conda_path(), 'include/slsDetectorPackage'),
|
os.path.join('../libs/pybind11/include'),
|
||||||
|
os.path.join(get_conda_path(), 'include'),
|
||||||
|
|
||||||
],
|
],
|
||||||
libraries=['SlsDetector', 'SlsReceiver', 'zmq'],
|
libraries=['SlsDetector', 'SlsReceiver', 'zmq'],
|
||||||
@ -108,20 +110,28 @@ class BuildExt(build_ext):
|
|||||||
opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version())
|
opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version())
|
||||||
for ext in self.extensions:
|
for ext in self.extensions:
|
||||||
ext.extra_compile_args = opts
|
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(
|
setup(
|
||||||
name='sls_detector',
|
name='slsdet',
|
||||||
version=__version__,
|
version=__version__,
|
||||||
author='Erik Frojdh',
|
author='Erik Frojdh',
|
||||||
author_email='erik.frojdh@psi.ch',
|
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',
|
description='Detector API for SLS Detector Group detectors',
|
||||||
long_description='',
|
long_description='',
|
||||||
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
|
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
|
||||||
ext_modules=ext_modules,
|
ext_modules=ext_modules,
|
||||||
install_requires=['pybind11>=2.2'],
|
|
||||||
cmdclass={'build_ext': BuildExt},
|
cmdclass={'build_ext': BuildExt},
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
)
|
)
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
# from .detector import Detector, DetectorError, free_shared_memory
|
|
||||||
# from .eiger import Eiger
|
|
||||||
from .experimental import Detector
|
|
||||||
|
|
||||||
# from .jungfrau import Jungfrau
|
|
||||||
# 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
|
|
@ -1,596 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
|
||||||
Created on Wed Dec 6 11:51:18 2017
|
|
||||||
|
|
||||||
@author: l_frojdh
|
|
||||||
"""
|
|
||||||
|
|
||||||
import socket
|
|
||||||
from collections.abc import Iterable
|
|
||||||
from collections import namedtuple
|
|
||||||
from functools import partial
|
|
||||||
|
|
||||||
from .adcs import Adc, DetectorAdcs
|
|
||||||
from .dacs import DetectorDacs
|
|
||||||
from .detector import Detector
|
|
||||||
from .detector_property import DetectorProperty
|
|
||||||
from .utils import element_if_equal
|
|
||||||
from sls_detector.errors import DetectorValueError, DetectorError
|
|
||||||
|
|
||||||
class EigerVcmp:
|
|
||||||
"""
|
|
||||||
Convenience class to be able to loop over vcmp for Eiger
|
|
||||||
|
|
||||||
|
|
||||||
.. todo::
|
|
||||||
|
|
||||||
Support single assignment and perhaps unify with Dac class
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, detector):
|
|
||||||
_names = ['vcmp_ll',
|
|
||||||
'vcmp_lr',
|
|
||||||
'vcmp_rl',
|
|
||||||
'vcmp_rr']
|
|
||||||
self.set = []
|
|
||||||
self.get = []
|
|
||||||
for i in range(detector.n_modules):
|
|
||||||
if i % 2 == 0:
|
|
||||||
name = _names
|
|
||||||
else:
|
|
||||||
name = _names[::-1]
|
|
||||||
for n in name:
|
|
||||||
self.set.append(partial(detector._api.setDac, n, i))
|
|
||||||
self.get.append(partial(detector._api.getDac, n, i))
|
|
||||||
|
|
||||||
def __getitem__(self, key):
|
|
||||||
if key == slice(None, None, None):
|
|
||||||
return [_d() for _d in self.get]
|
|
||||||
return self.get[key]()
|
|
||||||
|
|
||||||
def __setitem__(self, i, value):
|
|
||||||
self.set[i](value)
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
return 'vcmp: '+ str(self[:])
|
|
||||||
|
|
||||||
|
|
||||||
class EigerDacs(DetectorDacs):
|
|
||||||
_dacs = [('vsvp', 0, 4000, 0),
|
|
||||||
('vtr', 0, 4000, 2500),
|
|
||||||
('vrf', 0, 4000, 3300),
|
|
||||||
('vrs', 0, 4000, 1400),
|
|
||||||
('vsvn', 0, 4000, 4000),
|
|
||||||
('vtgstv', 0, 4000, 2556),
|
|
||||||
('vcmp_ll', 0, 4000, 1500),
|
|
||||||
('vcmp_lr', 0, 4000, 1500),
|
|
||||||
('vcall', 0, 4000, 4000),
|
|
||||||
('vcmp_rl', 0, 4000, 1500),
|
|
||||||
('rxb_rb', 0, 4000, 1100),
|
|
||||||
('rxb_lb', 0, 4000, 1100),
|
|
||||||
('vcmp_rr', 0, 4000, 1500),
|
|
||||||
('vcp', 0, 4000, 200),
|
|
||||||
('vcn', 0, 4000, 2000),
|
|
||||||
('vis', 0, 4000, 1550),
|
|
||||||
('iodelay', 0, 4000, 660)]
|
|
||||||
_dacnames = [_d[0] for _d in _dacs]
|
|
||||||
|
|
||||||
|
|
||||||
# noinspection PyProtectedMember
|
|
||||||
class DetectorDelays:
|
|
||||||
_delaynames = ['frame', 'left', 'right']
|
|
||||||
|
|
||||||
def __init__(self, detector):
|
|
||||||
# We need to at least initially know which detector we are connected to
|
|
||||||
self._detector = detector
|
|
||||||
|
|
||||||
setattr(self, '_frame', DetectorProperty(detector._api.getDelayFrame,
|
|
||||||
detector._api.setDelayFrame,
|
|
||||||
detector._api.getNumberOfDetectors,
|
|
||||||
'frame'))
|
|
||||||
|
|
||||||
setattr(self, '_left', DetectorProperty(detector._api.getDelayLeft,
|
|
||||||
detector._api.setDelayLeft,
|
|
||||||
detector._api.getNumberOfDetectors,
|
|
||||||
'left'))
|
|
||||||
|
|
||||||
setattr(self, '_right', DetectorProperty(detector._api.getDelayRight,
|
|
||||||
detector._api.setDelayRight,
|
|
||||||
detector._api.getNumberOfDetectors,
|
|
||||||
'right'))
|
|
||||||
# Index to support iteration
|
|
||||||
self._current = 0
|
|
||||||
|
|
||||||
def __getattr__(self, name):
|
|
||||||
return self.__getattribute__('_' + name)
|
|
||||||
|
|
||||||
def __setattr__(self, name, value):
|
|
||||||
if name in self._delaynames:
|
|
||||||
return self.__getattribute__('_' + name).__setitem__(slice(None, None, None), value)
|
|
||||||
else:
|
|
||||||
super().__setattr__(name, value)
|
|
||||||
|
|
||||||
def __next__(self):
|
|
||||||
if self._current >= len(self._delaynames):
|
|
||||||
self._current = 0
|
|
||||||
raise StopIteration
|
|
||||||
else:
|
|
||||||
self._current += 1
|
|
||||||
return self.__getattr__(self._delaynames[self._current-1])
|
|
||||||
|
|
||||||
def __iter__(self):
|
|
||||||
return self
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
hn = self._detector.hostname
|
|
||||||
r_str = ['Transmission delay [ns]\n'
|
|
||||||
'{:11s}{:>8s}{:>8s}{:>8s}'.format('', 'left', 'right', 'frame')]
|
|
||||||
for i in range(self._detector.n_modules):
|
|
||||||
r_str.append('{:2d}:{:8s}{:>8d}{:>8d}{:>8d}'.format(i, hn[i], self.left[i], self.right[i], self.frame[i]))
|
|
||||||
return '\n'.join(r_str)
|
|
||||||
|
|
||||||
|
|
||||||
class Eiger(Detector):
|
|
||||||
"""
|
|
||||||
Subclassing Detector to set up correct dacs and detector specific
|
|
||||||
functions.
|
|
||||||
"""
|
|
||||||
_detector_dynamic_range = [4, 8, 16, 32]
|
|
||||||
|
|
||||||
|
|
||||||
_settings = ['standard', 'highgain', 'lowgain', 'veryhighgain', 'verylowgain']
|
|
||||||
"""available settings for Eiger, note almost always standard"""
|
|
||||||
|
|
||||||
def __init__(self, id=0):
|
|
||||||
super().__init__(id)
|
|
||||||
|
|
||||||
self._active = DetectorProperty(self._api.getActive,
|
|
||||||
self._api.setActive,
|
|
||||||
self._api.getNumberOfDetectors,
|
|
||||||
'active')
|
|
||||||
|
|
||||||
self._vcmp = EigerVcmp(self)
|
|
||||||
self._dacs = EigerDacs(self)
|
|
||||||
self._trimbit_limits = namedtuple('trimbit_limits', ['min', 'max'])(0, 63)
|
|
||||||
self._delay = DetectorDelays(self)
|
|
||||||
|
|
||||||
# Eiger specific adcs
|
|
||||||
self._temp = DetectorAdcs()
|
|
||||||
self._temp.fpga = Adc('temp_fpga', self)
|
|
||||||
self._temp.fpgaext = Adc('temp_fpgaext', self)
|
|
||||||
self._temp.t10ge = Adc('temp_10ge', self)
|
|
||||||
self._temp.dcdc = Adc('temp_dcdc', self)
|
|
||||||
self._temp.sodl = Adc('temp_sodl', self)
|
|
||||||
self._temp.sodr = Adc('temp_sodr', self)
|
|
||||||
self._temp.fpgafl = Adc('temp_fpgafl', self)
|
|
||||||
self._temp.fpgafr = Adc('temp_fpgafr', self)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def active(self):
|
|
||||||
"""
|
|
||||||
Is the detector active? Can be used to enable or disable a detector
|
|
||||||
module
|
|
||||||
|
|
||||||
Examples
|
|
||||||
----------
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
d.active
|
|
||||||
>> active: [True, True]
|
|
||||||
|
|
||||||
d.active[1] = False
|
|
||||||
>> active: [True, False]
|
|
||||||
"""
|
|
||||||
return self._active
|
|
||||||
|
|
||||||
@active.setter
|
|
||||||
def active(self, value):
|
|
||||||
self._active[:] = value
|
|
||||||
|
|
||||||
@property
|
|
||||||
def measured_period(self):
|
|
||||||
return self._api.getMeasuredPeriod()
|
|
||||||
|
|
||||||
@property
|
|
||||||
def measured_subperiod(self):
|
|
||||||
return self._api.getMeasuredSubPeriod()
|
|
||||||
|
|
||||||
@property
|
|
||||||
def add_gappixels(self):
|
|
||||||
"""Enable or disable the (virual) pixels between ASICs
|
|
||||||
|
|
||||||
Examples
|
|
||||||
----------
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
d.add_gappixels = True
|
|
||||||
|
|
||||||
d.add_gappixels
|
|
||||||
>> True
|
|
||||||
|
|
||||||
"""
|
|
||||||
return self._api.getGapPixels()
|
|
||||||
|
|
||||||
@add_gappixels.setter
|
|
||||||
def add_gappixels(self, value):
|
|
||||||
self._api.setGapPixels(value)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def dacs(self):
|
|
||||||
"""
|
|
||||||
|
|
||||||
An instance of DetectorDacs used for accessing the dacs of a single
|
|
||||||
or multi detector.
|
|
||||||
|
|
||||||
Examples
|
|
||||||
---------
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
d = Eiger()
|
|
||||||
|
|
||||||
#Set all vrf to 1500
|
|
||||||
d.dacs.vrf = 1500
|
|
||||||
|
|
||||||
#Check vrf
|
|
||||||
d.dacs.vrf
|
|
||||||
>> vrf : 1500, 1500
|
|
||||||
|
|
||||||
#Set a single vtr
|
|
||||||
d.dacs.vtr[0] = 1800
|
|
||||||
|
|
||||||
#Set vrf with multiple values
|
|
||||||
d.dacs.vrf = [3500,3700]
|
|
||||||
d.dacs.vrf
|
|
||||||
>> vrf : 3500, 3700
|
|
||||||
|
|
||||||
#read into a variable
|
|
||||||
var = d.dacs.vrf[:]
|
|
||||||
|
|
||||||
#set multiple with multiple values, mostly used for large systems
|
|
||||||
d.dacs.vcall[0,1] = [3500,3600]
|
|
||||||
d.dacs.vcall
|
|
||||||
>> vcall : 3500, 3600
|
|
||||||
|
|
||||||
d.dacs
|
|
||||||
>>
|
|
||||||
========== DACS =========
|
|
||||||
vsvp : 0, 0
|
|
||||||
vtr : 4000, 4000
|
|
||||||
vrf : 1900, 1900
|
|
||||||
vrs : 1400, 1400
|
|
||||||
vsvn : 4000, 4000
|
|
||||||
vtgstv : 2556, 2556
|
|
||||||
vcmp_ll : 1500, 1500
|
|
||||||
vcmp_lr : 1500, 1500
|
|
||||||
vcall : 4000, 4000
|
|
||||||
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
|
|
||||||
|
|
||||||
"""
|
|
||||||
return self._dacs
|
|
||||||
|
|
||||||
@property
|
|
||||||
def tx_delay(self):
|
|
||||||
"""
|
|
||||||
Transmission delay of the modules to allow running the detector
|
|
||||||
in a network not supporting the full speed of the detector.
|
|
||||||
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
d.tx_delay
|
|
||||||
>>
|
|
||||||
Transmission delay [ns]
|
|
||||||
left right frame
|
|
||||||
0:beb048 0 15000 0
|
|
||||||
1:beb049 100 190000 100
|
|
||||||
|
|
||||||
d.tx_delay.left = [2000,5000]
|
|
||||||
"""
|
|
||||||
return self._delay
|
|
||||||
|
|
||||||
def default_settings(self):
|
|
||||||
"""
|
|
||||||
reset the detector to some type of standard settings
|
|
||||||
mostly used when testing
|
|
||||||
"""
|
|
||||||
self.n_frames = 1
|
|
||||||
self.exposure_time = 1
|
|
||||||
self.period = 0
|
|
||||||
self.n_cycles = 1
|
|
||||||
self.n_measurements = 1
|
|
||||||
self.dynamic_range = 16
|
|
||||||
|
|
||||||
@property
|
|
||||||
def eiger_matrix_reset(self):
|
|
||||||
"""
|
|
||||||
Matrix reset bit for Eiger.
|
|
||||||
|
|
||||||
:py:obj:`True` : Normal operation, the matrix is reset before each acq.
|
|
||||||
:py:obj:`False` : Matrix reset disabled. Used to not reset before
|
|
||||||
reading out analog test pulses.
|
|
||||||
"""
|
|
||||||
return self._api.getCounterBit()
|
|
||||||
|
|
||||||
@eiger_matrix_reset.setter
|
|
||||||
def eiger_matrix_reset(self, value):
|
|
||||||
self._api.setCounterBit(value)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def flowcontrol_10g(self):
|
|
||||||
"""
|
|
||||||
:py:obj:`True` - Flow control enabled :py:obj:`False` flow control disabled.
|
|
||||||
Sets for all moduels, if for some reason access to a single module is needed
|
|
||||||
this can be done trough the C++ API.
|
|
||||||
|
|
||||||
"""
|
|
||||||
fc = self._api.getNetworkParameter('flow_control_10g')
|
|
||||||
return element_if_equal([bool(int(e)) for e in fc])
|
|
||||||
|
|
||||||
@flowcontrol_10g.setter
|
|
||||||
def flowcontrol_10g(self, value):
|
|
||||||
if value is True:
|
|
||||||
v = '1'
|
|
||||||
else:
|
|
||||||
v = '0'
|
|
||||||
self._api.setNetworkParameter('flow_control_10g', v, -1)
|
|
||||||
|
|
||||||
def pulse_all_pixels(self, n):
|
|
||||||
"""
|
|
||||||
Pulse each pixel of the chip **n** times using the analog test pulses.
|
|
||||||
The pulse height is set using d.dacs.vcall with 4000 being 0 and 0 being
|
|
||||||
the highest pulse.
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
#Pulse all pixels ten times
|
|
||||||
d.pulse_all_pixels(10)
|
|
||||||
|
|
||||||
#Avoid resetting before acq
|
|
||||||
d.eiger_matrix_reset = False
|
|
||||||
|
|
||||||
d.acq() #take frame
|
|
||||||
|
|
||||||
#Restore normal behaviour
|
|
||||||
d.eiger_matrix_reset = True
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
self._api.pulseAllPixels(n)
|
|
||||||
|
|
||||||
|
|
||||||
def pulse_diagonal(self, n):
|
|
||||||
"""
|
|
||||||
Pulse pixels in super colums in a diagonal fashion. Used for calibration
|
|
||||||
of vcall. Saves time compared to pulsing all pixels.
|
|
||||||
"""
|
|
||||||
self._api.pulseDiagonal(n)
|
|
||||||
|
|
||||||
|
|
||||||
def pulse_chip(self, n):
|
|
||||||
"""
|
|
||||||
Advance the counter by toggling enable. Gives 2*n+2 int the counter
|
|
||||||
|
|
||||||
"""
|
|
||||||
n = int(n)
|
|
||||||
if n >= -1:
|
|
||||||
self._api.pulseChip(n)
|
|
||||||
else:
|
|
||||||
raise ValueError('n must be equal or larger than -1')
|
|
||||||
|
|
||||||
@property
|
|
||||||
def vcmp(self):
|
|
||||||
"""
|
|
||||||
Convenience function to get and set the individual vcmp of chips
|
|
||||||
Used mainly in the calibration code.
|
|
||||||
|
|
||||||
Examples
|
|
||||||
---------
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
#Reading
|
|
||||||
d.vcmp[:]
|
|
||||||
>> [500, 500, 500, 500, 500, 500, 500, 500]
|
|
||||||
|
|
||||||
#Setting
|
|
||||||
d.vcmp = [500, 500, 500, 500, 500, 500, 500, 500]
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
return self._vcmp
|
|
||||||
|
|
||||||
@vcmp.setter
|
|
||||||
def vcmp(self, values):
|
|
||||||
if len(values) == len(self._vcmp.set):
|
|
||||||
for i, v in enumerate(values):
|
|
||||||
self._vcmp.set[i](v)
|
|
||||||
else:
|
|
||||||
raise ValueError('vcmp only compatible with setting all')
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_udpport(self):
|
|
||||||
"""
|
|
||||||
UDP port for the receiver. Each module has two ports referred to
|
|
||||||
as rx_udpport and rx_udpport2 in the command line interface
|
|
||||||
here they are grouped for each detector
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
[0:rx_udpport, 0:rx_udpport2, 1:rx_udpport ...]
|
|
||||||
|
|
||||||
Examples
|
|
||||||
-----------
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
d.rx_udpport
|
|
||||||
>> [50010, 50011, 50004, 50005]
|
|
||||||
|
|
||||||
d.rx_udpport = [50010, 50011, 50012, 50013]
|
|
||||||
|
|
||||||
"""
|
|
||||||
p0 = self._api.getReceiverUDPPort()
|
|
||||||
p1 = self._api.getReceiverUDPPort2()
|
|
||||||
return [int(val) for pair in zip(p0, p1) for val in pair]
|
|
||||||
|
|
||||||
@rx_udpport.setter
|
|
||||||
def rx_udpport(self, ports):
|
|
||||||
"""Requires iterating over elements two and two for setting ports"""
|
|
||||||
a = iter(ports)
|
|
||||||
for i, p in enumerate(zip(a, a)):
|
|
||||||
self._api.setReceiverUDPPort(p[0], i)
|
|
||||||
self._api.setReceiverUDPPort2(p[1], i)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_zmqport(self):
|
|
||||||
"""
|
|
||||||
Return the receiver zmq ports. Note that Eiger has two ports per receiver!
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
detector.rx_zmqport
|
|
||||||
>> [30001, 30002, 30003, 30004]
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
_s = self._api.getReceiverStreamingPort()
|
|
||||||
if _s == '':
|
|
||||||
return []
|
|
||||||
else:
|
|
||||||
return [int(_p) + i for _p in _s for i in range(2)]
|
|
||||||
|
|
||||||
@rx_zmqport.setter
|
|
||||||
def rx_zmqport(self, port):
|
|
||||||
if isinstance(port, Iterable):
|
|
||||||
for i, p in enumerate(port):
|
|
||||||
self._api.setReceiverStreamingPort(p, i)
|
|
||||||
else:
|
|
||||||
self._api.setReceiverStreamingPort(port, -1)
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
|
||||||
def sub_exposure_time(self):
|
|
||||||
"""
|
|
||||||
Sub frame exposure time in *seconds* for Eiger in 32bit autosumming mode
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
d.sub_exposure_time
|
|
||||||
>> 0.0023
|
|
||||||
|
|
||||||
d.sub_exposure_time = 0.002
|
|
||||||
|
|
||||||
"""
|
|
||||||
return self._api.getSubExposureTime() / 1e9
|
|
||||||
|
|
||||||
|
|
||||||
@sub_exposure_time.setter
|
|
||||||
def sub_exposure_time(self, t):
|
|
||||||
#TODO! checking here or in the detector?
|
|
||||||
ns_time = int(t * 1e9)
|
|
||||||
if ns_time > 0:
|
|
||||||
self._api.setSubExposureTime(ns_time)
|
|
||||||
else:
|
|
||||||
raise DetectorValueError('Sub exposure time must be larger than 0')
|
|
||||||
|
|
||||||
@property
|
|
||||||
def sub_deadtime(self):
|
|
||||||
"""
|
|
||||||
Deadtime between subexposures. Used to mimize noise by delaying the start of the next
|
|
||||||
subexposure.
|
|
||||||
"""
|
|
||||||
return self._api.getSubExposureDeadTime() / 1e9
|
|
||||||
|
|
||||||
|
|
||||||
@sub_deadtime.setter
|
|
||||||
def sub_deadtime(self, t):
|
|
||||||
ns_time = int(t * 1e9)
|
|
||||||
if ns_time >= 0:
|
|
||||||
self._api.setSubExposureDeadTime(ns_time)
|
|
||||||
else:
|
|
||||||
raise ValueError('Sub deadtime time must be larger or equal to 0')
|
|
||||||
|
|
||||||
@property
|
|
||||||
def temp(self):
|
|
||||||
"""
|
|
||||||
An instance of DetectorAdcs used to read the temperature
|
|
||||||
of different components
|
|
||||||
|
|
||||||
Examples
|
|
||||||
-----------
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
detector.temp
|
|
||||||
>>
|
|
||||||
temp_fpga : 36.90°C, 45.60°C
|
|
||||||
temp_fpgaext : 31.50°C, 32.50°C
|
|
||||||
temp_10ge : 0.00°C, 0.00°C
|
|
||||||
temp_dcdc : 36.00°C, 36.00°C
|
|
||||||
temp_sodl : 33.00°C, 34.50°C
|
|
||||||
temp_sodr : 33.50°C, 34.00°C
|
|
||||||
temp_fpgafl : 33.81°C, 30.93°C
|
|
||||||
temp_fpgafr : 27.88°C, 29.15°C
|
|
||||||
|
|
||||||
a = detector.temp.fpga[:]
|
|
||||||
a
|
|
||||||
>> [36.568, 45.542]
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
return self._temp
|
|
||||||
|
|
||||||
@property
|
|
||||||
def tengiga(self):
|
|
||||||
"""Enable 10Gbit/s data output
|
|
||||||
|
|
||||||
Examples
|
|
||||||
----------
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
d.tengiga
|
|
||||||
>> False
|
|
||||||
|
|
||||||
d.tengiga = True
|
|
||||||
|
|
||||||
"""
|
|
||||||
return self._api.getTenGigabitEthernet()
|
|
||||||
|
|
||||||
@tengiga.setter
|
|
||||||
def tengiga(self, value):
|
|
||||||
self._api.setTenGigabitEthernet(value)
|
|
||||||
|
|
||||||
def set_delays(self, delta):
|
|
||||||
self.tx_delay.left = [delta*(i*2) for i in range(self.n_modules)]
|
|
||||||
self.tx_delay.right = [delta*(i*2+1) for i in range(self.n_modules)]
|
|
||||||
|
|
||||||
|
|
||||||
def setup500k(self, hostnames):
|
|
||||||
"""
|
|
||||||
Setup the Eiger detector to run on the local machine
|
|
||||||
"""
|
|
||||||
|
|
||||||
self.hostname = hostnames
|
|
||||||
self.file_write = False
|
|
||||||
self.image_size = (512, 1024)
|
|
||||||
self.rx_tcpport = [1954, 1955]
|
|
||||||
self.rx_udpport = [50010, 50011, 50004, 50005]
|
|
||||||
self.rx_hostname = socket.gethostname().split('.')[0]
|
|
||||||
self.rx_datastream = False
|
|
||||||
self.file_write = False
|
|
||||||
self.online = True
|
|
||||||
self.receiver_online = True
|
|
@ -1,633 +0,0 @@
|
|||||||
from _sls_detector import CppDetectorApi
|
|
||||||
from _sls_detector import slsDetectorDefs
|
|
||||||
|
|
||||||
runStatus = slsDetectorDefs.runStatus
|
|
||||||
speedLevel = slsDetectorDefs.speedLevel
|
|
||||||
dacIndex = slsDetectorDefs.dacIndex
|
|
||||||
|
|
||||||
from .utils import element_if_equal, all_equal
|
|
||||||
from .utils import Geometry, to_geo
|
|
||||||
import datetime as dt
|
|
||||||
|
|
||||||
from functools import wraps
|
|
||||||
from collections import namedtuple
|
|
||||||
|
|
||||||
class Register:
|
|
||||||
"""
|
|
||||||
Helper class to read and write to registers using a
|
|
||||||
more Pythonic syntax
|
|
||||||
"""
|
|
||||||
def __init__(self, detector):
|
|
||||||
self._detector = detector
|
|
||||||
|
|
||||||
def __getitem__(self, key):
|
|
||||||
return self._detector.readRegister(key)
|
|
||||||
|
|
||||||
def __setitem__(self, key, value):
|
|
||||||
self._detector.writeRegister(key, value)
|
|
||||||
|
|
||||||
|
|
||||||
def freeze(cls):
|
|
||||||
cls.__frozen = False
|
|
||||||
|
|
||||||
def frozensetattr(self, key, value):
|
|
||||||
if self.__frozen and not hasattr(self, key):
|
|
||||||
raise AttributeError(
|
|
||||||
"Class {} is frozen. Cannot set {} = {}".format(
|
|
||||||
cls.__name__, key, value
|
|
||||||
)
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
object.__setattr__(self, key, value)
|
|
||||||
|
|
||||||
def init_decorator(func):
|
|
||||||
@wraps(func)
|
|
||||||
def wrapper(self, *args, **kwargs):
|
|
||||||
func(self, *args, **kwargs)
|
|
||||||
self.__frozen = True
|
|
||||||
|
|
||||||
return wrapper
|
|
||||||
|
|
||||||
cls.__setattr__ = frozensetattr
|
|
||||||
cls.__init__ = init_decorator(cls.__init__)
|
|
||||||
return cls
|
|
||||||
|
|
||||||
|
|
||||||
@freeze
|
|
||||||
class Detector(CppDetectorApi):
|
|
||||||
"""
|
|
||||||
This class is the base for detector specific
|
|
||||||
interfaces. Most functions exists in two versions
|
|
||||||
like the getExptime() function that uses the
|
|
||||||
C++ API directly and the simplified exptime property.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, multi_id=0):
|
|
||||||
"""
|
|
||||||
multi_id refers to the shared memory id of the
|
|
||||||
slsDetectorPackage. Default value is 0.
|
|
||||||
"""
|
|
||||||
super().__init__(multi_id)
|
|
||||||
self._register = Register(self)
|
|
||||||
|
|
||||||
# CONFIGURATION
|
|
||||||
def __len__(self):
|
|
||||||
return self.size()
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
return '{}(id = {})'.format(self.__class__.__name__,
|
|
||||||
self.getShmId())
|
|
||||||
|
|
||||||
|
|
||||||
def free(self):
|
|
||||||
self.freeSharedMemory()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
|
||||||
def config(self):
|
|
||||||
return NotImplementedError("config is set only")
|
|
||||||
|
|
||||||
@config.setter
|
|
||||||
def config(self, fname):
|
|
||||||
self.loadConfig(fname)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def parameters(self):
|
|
||||||
return NotImplementedError("parameters is set only")
|
|
||||||
|
|
||||||
@parameters.setter
|
|
||||||
def parameters(self, fname):
|
|
||||||
self.loadParameters(fname)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def hostname(self):
|
|
||||||
return self.getHostname()
|
|
||||||
|
|
||||||
@hostname.setter
|
|
||||||
def hostname(self, hostnames):
|
|
||||||
if isinstance(hostnames, str):
|
|
||||||
hostnames = [hostnames]
|
|
||||||
if isinstance(hostnames, list):
|
|
||||||
self.setHostname(hostnames)
|
|
||||||
else:
|
|
||||||
raise ValueError("hostname needs to be string or list of strings")
|
|
||||||
|
|
||||||
@property
|
|
||||||
def fw_version(self):
|
|
||||||
return element_if_equal(self.getFirmwareVersion())
|
|
||||||
|
|
||||||
@property
|
|
||||||
def server_version(self):
|
|
||||||
#TODO! handle hex print
|
|
||||||
return element_if_equal(self.getDetectorServerVersion())
|
|
||||||
|
|
||||||
@property
|
|
||||||
def client_version(self):
|
|
||||||
return element_if_equal(self.getClientVersion())
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_version(self):
|
|
||||||
return element_if_equal(self.getReceiverVersion())
|
|
||||||
|
|
||||||
@property
|
|
||||||
def detector_type(self):
|
|
||||||
return element_if_equal(self.getDetectorType())
|
|
||||||
|
|
||||||
@property
|
|
||||||
def dr(self):
|
|
||||||
return element_if_equal(self.getDynamicRange())
|
|
||||||
|
|
||||||
@dr.setter
|
|
||||||
def dr(self, dr):
|
|
||||||
self.setDynamicRange(dr)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def module_geometry(self):
|
|
||||||
return to_geo(self.getModuleGeometry())
|
|
||||||
|
|
||||||
@property
|
|
||||||
def module_size(self):
|
|
||||||
ms = [to_geo(item) for item in self.getModuleSize()]
|
|
||||||
return element_if_equal(ms)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def detector_size(self):
|
|
||||||
return to_geo(self.getDetectorSize())
|
|
||||||
|
|
||||||
@property
|
|
||||||
def settings(self):
|
|
||||||
return element_if_equal(self.getSettings())
|
|
||||||
|
|
||||||
@settings.setter
|
|
||||||
def settings(self, value):
|
|
||||||
self.setSettings(value)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def frames(self):
|
|
||||||
return element_if_equal(self.getNumberOfFrames())
|
|
||||||
|
|
||||||
@frames.setter
|
|
||||||
def frames(self, n_frames):
|
|
||||||
self.setNumberOfFrames(n_frames)
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
|
||||||
def exptime(self):
|
|
||||||
res = self.getExptime()
|
|
||||||
return element_if_equal([it.total_seconds() for it in 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 period(self):
|
|
||||||
res = self.getPeriod()
|
|
||||||
return element_if_equal([it.total_seconds() for it in res])
|
|
||||||
|
|
||||||
@period.setter
|
|
||||||
def period(self, t):
|
|
||||||
if isinstance(t, dt.timedelta):
|
|
||||||
self.setPeriod(t)
|
|
||||||
else:
|
|
||||||
self.setPeriod(dt.timedelta(seconds=t))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Time
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#TODO! Rename to rx_framescaught
|
|
||||||
@property
|
|
||||||
def framescaught(self):
|
|
||||||
return element_if_equal(self.getFramesCaught())
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
|
||||||
def startingfnum(self):
|
|
||||||
return element_if_equal(self.getStartingFrameNumber())
|
|
||||||
|
|
||||||
@startingfnum.setter
|
|
||||||
def startingfnum(self, value):
|
|
||||||
self.setStartingFrameNumber(value)
|
|
||||||
|
|
||||||
#TODO! testing switches on automatically?
|
|
||||||
@property
|
|
||||||
def flowcontrol_10g(self):
|
|
||||||
return element_if_equal(self.getTenGigaFlowControl())
|
|
||||||
|
|
||||||
@flowcontrol_10g.setter
|
|
||||||
def flowcontrol_10g(self, enable):
|
|
||||||
self.setTenGigaFlowControl(enable)
|
|
||||||
|
|
||||||
#TODO! add txdelay
|
|
||||||
|
|
||||||
@property
|
|
||||||
def use_receiver(self):
|
|
||||||
return element_if_equal(self.getUseReceiverFlag())
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_hostname(self):
|
|
||||||
return element_if_equal(self.getRxHostname())
|
|
||||||
|
|
||||||
@rx_hostname.setter
|
|
||||||
def rx_hostname(self, hostname):
|
|
||||||
self.setRxHostname(hostname)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_tcpport(self):
|
|
||||||
return element_if_equal(self.getRxPort())
|
|
||||||
|
|
||||||
@rx_tcpport.setter
|
|
||||||
def rx_tcpport(self, port):
|
|
||||||
self.setRxPort(port)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_fifodepth(self):
|
|
||||||
return element_if_equal(self.getRxFifoDepth())
|
|
||||||
|
|
||||||
@rx_fifodepth.setter
|
|
||||||
def rx_fifodepth(self, frames):
|
|
||||||
self.setRxFifoDepth(frames)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_silent(self):
|
|
||||||
return element_if_equal(self.getRxSilentMode())
|
|
||||||
|
|
||||||
@rx_silent.setter
|
|
||||||
def rx_silent(self, value):
|
|
||||||
self.setRxSilentMode(value)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_discardpolicy(self):
|
|
||||||
return element_if_equal(self.getRxFrameDiscardPolicy())
|
|
||||||
|
|
||||||
@rx_discardpolicy.setter
|
|
||||||
def rx_discardpolicy(self, policy):
|
|
||||||
self.setRxFrameDiscardPolicy()
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_padding(self):
|
|
||||||
return element_if_equal(self.getPartialFramesPadding())
|
|
||||||
|
|
||||||
@rx_padding.setter
|
|
||||||
def rx_padding(self, policy):
|
|
||||||
self.setPartialFramesPadding(policy)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_lock(self):
|
|
||||||
"""Lock the receiver to a specific IP"""
|
|
||||||
return element_if_equal(self.getRxLock())
|
|
||||||
|
|
||||||
@rx_lock.setter
|
|
||||||
def rx_lock(self, value):
|
|
||||||
self.setRxLock(value)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_lastclient(self):
|
|
||||||
return element_if_equal(self.getRxLastClientIP())
|
|
||||||
|
|
||||||
|
|
||||||
#FILE
|
|
||||||
|
|
||||||
@property
|
|
||||||
def fformat(self):
|
|
||||||
return element_if_equal(self.getFileFormat())
|
|
||||||
|
|
||||||
@fformat.setter
|
|
||||||
def fformat(self, format):
|
|
||||||
self.setFileFormat(format)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def findex(self):
|
|
||||||
return element_if_equal(self.getAcquisitionIndex())
|
|
||||||
|
|
||||||
@findex.setter
|
|
||||||
def findex(self, index):
|
|
||||||
self.setAcquisitionIndex(index)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def fname(self):
|
|
||||||
return element_if_equal(self.getFileNamePrefix())
|
|
||||||
|
|
||||||
@fname.setter
|
|
||||||
def fname(self, file_name):
|
|
||||||
self.setFileNamePrefix(file_name)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def fpath(self):
|
|
||||||
return element_if_equal(self.getFilePath())
|
|
||||||
|
|
||||||
@fpath.setter
|
|
||||||
def fpath(self, path):
|
|
||||||
self.setFilePath(path)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def fwrite(self):
|
|
||||||
return element_if_equal(self.getFileWrite())
|
|
||||||
|
|
||||||
@fwrite.setter
|
|
||||||
def fwrite(self, value):
|
|
||||||
self.setFileWrite(value)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def foverwrite(self):
|
|
||||||
return element_if_equal(self.getFileOverWrite())
|
|
||||||
|
|
||||||
@foverwrite.setter
|
|
||||||
def foverwrite(self, value):
|
|
||||||
self.setFileOverWrite(value)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def fmaster(self):
|
|
||||||
return element_if_equal(self.getMasterFileWrite())
|
|
||||||
|
|
||||||
@fmaster.setter
|
|
||||||
def fmaster(self, enable):
|
|
||||||
self.setMasterFileWrite(enable)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_framesperfile(self):
|
|
||||||
return element_if_equal(self.getFramesPerFile())
|
|
||||||
|
|
||||||
@rx_framesperfile.setter
|
|
||||||
def rx_framesperfile(self, n_frames):
|
|
||||||
self.setFramesPerFile(n_frames)
|
|
||||||
|
|
||||||
# ZMQ Streaming Parameters (Receiver<->Client)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_datastream(self):
|
|
||||||
return element_if_equal(self.getRxZmqDataStream())
|
|
||||||
|
|
||||||
@rx_datastream.setter
|
|
||||||
def rx_zmqdatastream(self, enable):
|
|
||||||
self.setRxZmqDataStream(enable)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_readfreq(self):
|
|
||||||
return element_if_equal(self.getRxZmqFrequency())
|
|
||||||
|
|
||||||
@rx_readfreq.setter
|
|
||||||
def rx_readfreq(self, nth_frame):
|
|
||||||
self.setRxZmqFrequency(nth_frame)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_zmqport(self):
|
|
||||||
return element_if_equal(self.getRxZmqPort())
|
|
||||||
|
|
||||||
@rx_zmqport.setter
|
|
||||||
def rx_zmqport(self, port):
|
|
||||||
self.setRxZmqPort(port)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def zmqport(self):
|
|
||||||
return element_if_equal(self.getClientZmqPort())
|
|
||||||
|
|
||||||
@zmqport.setter
|
|
||||||
def zmqport(self, port):
|
|
||||||
self.setClientZmqPort(port)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_zmqip(self):
|
|
||||||
return element_if_equal(self.getRxZmqIP())
|
|
||||||
|
|
||||||
@rx_zmqip.setter
|
|
||||||
def rx_zmqip(self, ip):
|
|
||||||
self.setRxZmqIP(ip)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def zmqip(self):
|
|
||||||
return element_if_equal(self.getClientZmqIp())
|
|
||||||
|
|
||||||
@zmqip.setter
|
|
||||||
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)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def udp_dstip2(self):
|
|
||||||
return element_if_equal(self.getDestinationUDPIP2())
|
|
||||||
|
|
||||||
@udp_dstip2.setter
|
|
||||||
def udp_dstip2(self, ip):
|
|
||||||
self.getDestinationUDPIP2(ip)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def udp_dstmac(self):
|
|
||||||
return element_if_equal(self.getDestinationUDPMAC())
|
|
||||||
|
|
||||||
@udp_dstmac.setter
|
|
||||||
def udp_dstmac(self, mac):
|
|
||||||
self.getDestinationUDPMAC2(mac)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def udp_dstmac2(self):
|
|
||||||
return element_if_equal(self.getDestinationUDPMAC2())
|
|
||||||
|
|
||||||
@udp_dstmac2.setter
|
|
||||||
def udp_dstmac2(self, mac):
|
|
||||||
self.getDestinationUDPMAC2(mac)
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
|
||||||
def udp_dstport(self):
|
|
||||||
return element_if_equal(self.getDestinationUDPPort())
|
|
||||||
|
|
||||||
@udp_dstport.setter
|
|
||||||
def udp_dstport(self, port):
|
|
||||||
self.setDestinationUDPPort(port)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def udp_dstport2(self):
|
|
||||||
return element_if_equal(self.getDestinationUDPPort2())
|
|
||||||
|
|
||||||
@udp_dstport2.setter
|
|
||||||
def udp_dstport2(self, port):
|
|
||||||
self.setDestinationUDPPort2(port)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def src_udpmac(self):
|
|
||||||
return element_if_equal(self.getSourceUDPMAC())
|
|
||||||
|
|
||||||
@src_udpmac.setter
|
|
||||||
def src_udpmac(self, mac):
|
|
||||||
self.setSourceUDPMAC(mac)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def src_udpip2(self):
|
|
||||||
return element_if_equal(self.getSourceUDPIP())
|
|
||||||
|
|
||||||
@src_udpip2.setter
|
|
||||||
def src_udpip2(self, ip):
|
|
||||||
self.setSourceUDPIP(ip)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def src_udpip(self):
|
|
||||||
return element_if_equal(self.getSourceUDPIP())
|
|
||||||
|
|
||||||
@src_udpip.setter
|
|
||||||
def src_udpip(self, ip):
|
|
||||||
self.setSourceUDPIP(ip)
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
|
||||||
def src_udpmac2(self):
|
|
||||||
return element_if_equal(self.getSourceUDPMAC2())
|
|
||||||
|
|
||||||
@src_udpmac2.setter
|
|
||||||
def src_udpmac2(self, mac):
|
|
||||||
self.setSourceUDPMAC2(mac)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def vhighvoltage(self):
|
|
||||||
return element_if_equal(self.getHighVoltage())
|
|
||||||
|
|
||||||
@vhighvoltage.setter
|
|
||||||
def vhighvoltage(self, v):
|
|
||||||
self.setHighVoltage(v)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def user(self):
|
|
||||||
return self.getUserDetails()
|
|
||||||
|
|
||||||
@property
|
|
||||||
def settingspath(self):
|
|
||||||
return element_if_equal(self.getSettingsPath())
|
|
||||||
|
|
||||||
@settingspath.setter
|
|
||||||
def settingspath(self, path):
|
|
||||||
self.setSettingsPath(path)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def status(self):
|
|
||||||
return element_if_equal(self.getDetectorStatus())
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_status(self):
|
|
||||||
return element_if_equal(self.getReceiverStatus())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_udpsocksize(self):
|
|
||||||
return element_if_equal(self.getRxUDPSocketBufferSize())
|
|
||||||
|
|
||||||
@rx_udpsocksize.setter
|
|
||||||
def rx_udpsocksize(self, buffer_size):
|
|
||||||
self.setRxUDPSocketBufferSize(buffer_size)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_realudpsocksize(self):
|
|
||||||
return element_if_equal(self.getRxRealUDPSocketBufferSize())
|
|
||||||
|
|
||||||
@property
|
|
||||||
def trimbits(self):
|
|
||||||
return NotImplementedError('trimbits are set only')
|
|
||||||
|
|
||||||
@trimbits.setter
|
|
||||||
def trimbits(self, fname):
|
|
||||||
self.loadTrimbits(fname)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def lock(self):
|
|
||||||
return element_if_equal(self.getDetectorLock())
|
|
||||||
|
|
||||||
@lock.setter
|
|
||||||
def lock(self, value):
|
|
||||||
self.setDetectorLock(value)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def rx_lock(self):
|
|
||||||
return element_if_equal(self.getRxLock())
|
|
||||||
|
|
||||||
@rx_lock.setter
|
|
||||||
def rx_lock(self, value):
|
|
||||||
self.setRxLock(value)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def lastclient(self):
|
|
||||||
return element_if_equal(self.getLastClientIP())
|
|
||||||
|
|
||||||
@property
|
|
||||||
def reg(self):
|
|
||||||
return self._register
|
|
||||||
|
|
||||||
@property
|
|
||||||
def ratecorr(self):
|
|
||||||
""" tau in ns """
|
|
||||||
return element_if_equal(self.getRateCorrection())
|
|
||||||
|
|
||||||
@ratecorr.setter
|
|
||||||
def ratecorr(self, tau):
|
|
||||||
self.setRateCorrection(tau)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def clkdivider(self):
|
|
||||||
res = [int(value) for value in self.getSpeed()]
|
|
||||||
return element_if_equal(res)
|
|
||||||
|
|
||||||
@clkdivider.setter
|
|
||||||
def clkdivider(self, value):
|
|
||||||
self.setSpeed(speedLevel(value))
|
|
||||||
|
|
||||||
@property
|
|
||||||
def frameindex(self):
|
|
||||||
return self.getRxCurrentFrameIndex()
|
|
||||||
|
|
||||||
@property
|
|
||||||
def threshold(self):
|
|
||||||
return element_if_equal(self.getThresholdEnergy())
|
|
||||||
|
|
||||||
@threshold.setter
|
|
||||||
def threshold(self, eV):
|
|
||||||
self.setThresholdEnergy(eV)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def timing(self):
|
|
||||||
return element_if_equal(self.getTimingMode())
|
|
||||||
|
|
||||||
@timing.setter
|
|
||||||
def timing(self, mode):
|
|
||||||
self.setTimingMode(mode)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def trimen(self):
|
|
||||||
return element_if_equal(self.getTrimEnergies())
|
|
||||||
|
|
||||||
@trimen.setter
|
|
||||||
def trimen(self, energies):
|
|
||||||
self.setTrimEnergies(energies)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def vthreshold(self):
|
|
||||||
return element_if_equal(self.getDAC(dacIndex.THRESHOLD))
|
|
@ -1,41 +0,0 @@
|
|||||||
"""
|
|
||||||
Utility functions that are useful for testing and troubleshooting
|
|
||||||
but not directly used in controlling the detector
|
|
||||||
"""
|
|
||||||
from collections import namedtuple
|
|
||||||
import _sls_detector #C++ lib
|
|
||||||
|
|
||||||
Geometry = namedtuple('Geometry', ['x', 'y'])
|
|
||||||
|
|
||||||
def to_geo(value):
|
|
||||||
if isinstance(value, _sls_detector.xy):
|
|
||||||
return Geometry(x = value.x, y = value.y)
|
|
||||||
else:
|
|
||||||
raise ValueError("Can only convert sls_detector.xy")
|
|
||||||
|
|
||||||
def all_equal(mylist):
|
|
||||||
"""If all elements are equal return true otherwise false"""
|
|
||||||
return all(x == mylist[0] for x in mylist)
|
|
||||||
|
|
||||||
|
|
||||||
def element_if_equal(mylist):
|
|
||||||
"""If all elements are equal return only one element"""
|
|
||||||
if all_equal(mylist):
|
|
||||||
if len(mylist) == 0:
|
|
||||||
return None
|
|
||||||
else:
|
|
||||||
return mylist[0]
|
|
||||||
else:
|
|
||||||
return mylist
|
|
||||||
|
|
||||||
|
|
||||||
def eiger_register_to_time(register):
|
|
||||||
"""
|
|
||||||
Decode register value and return time in s. Values are stored in
|
|
||||||
a 32bit register with bits 2->0 containing the exponent and bits
|
|
||||||
31->3 containing the significand (int value)
|
|
||||||
|
|
||||||
"""
|
|
||||||
clocks = register >> 3
|
|
||||||
exponent = register & 0b111
|
|
||||||
return clocks*10**exponent / 100e6
|
|
23
python/slsdet/__init__.py
Executable file
23
python/slsdet/__init__.py
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
# 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
|
||||||
|
timingMode = _slsdet.slsDetectorDefs.timingMode
|
||||||
|
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||||
|
detectorType = _slsdet.slsDetectorDefs.detectorType
|
||||||
|
detectorSettings = _slsdet.slsDetectorDefs.detectorSettings
|
||||||
|
readoutMode = _slsdet.slsDetectorDefs.readoutMode
|
||||||
|
|
||||||
|
IpAddr = _slsdet.IpAddr
|
||||||
|
MacAddr = _slsdet.MacAddr
|
43
python/slsdet/ctb.py
Normal file
43
python/slsdet/ctb.py
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
from .detector import Detector
|
||||||
|
from .utils import element_if_equal
|
||||||
|
from .dacs import DetectorDacs
|
||||||
|
import _slsdet
|
||||||
|
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||||
|
from .detector_property import DetectorProperty
|
||||||
|
|
||||||
|
class CtbDacs(DetectorDacs):
|
||||||
|
"""
|
||||||
|
Ctb dacs
|
||||||
|
"""
|
||||||
|
_dacs = [('dac0', dacIndex(0), 0, 4000, 1400),
|
||||||
|
('dac1', dacIndex(1), 0, 4000, 1200),
|
||||||
|
('dac2', dacIndex(2), 0, 4000, 900),
|
||||||
|
('dac3', dacIndex(3), 0, 4000, 1050),
|
||||||
|
('dac4', dacIndex(4), 0, 4000, 1400),
|
||||||
|
('dac5', dacIndex(5), 0, 4000, 655),
|
||||||
|
('dac6', dacIndex(6), 0, 4000, 2000),
|
||||||
|
('dac7', dacIndex(7), 0, 4000, 1400),
|
||||||
|
('dac8', dacIndex(8), 0, 4000, 850),
|
||||||
|
('dac9', dacIndex(9), 0, 4000, 2000),
|
||||||
|
('dac10', dacIndex(10), 0, 4000, 2294),
|
||||||
|
('dac11', dacIndex(11), 0, 4000, 983),
|
||||||
|
('dac12', dacIndex(12), 0, 4000, 1475),
|
||||||
|
('dac13', dacIndex(13), 0, 4000, 1200),
|
||||||
|
('dac14', dacIndex(14), 0, 4000, 1600),
|
||||||
|
('dac15', dacIndex(15), 0, 4000, 1455),
|
||||||
|
('dac16', dacIndex(16), 0, 4000, 0),
|
||||||
|
('dac17', dacIndex(17), 0, 4000, 1000),
|
||||||
|
]
|
||||||
|
_dacnames = [_d[0] for _d in _dacs]
|
||||||
|
|
||||||
|
from .utils import element
|
||||||
|
class Ctb(Detector):
|
||||||
|
def __init__(self, id = 0):
|
||||||
|
super().__init__(id)
|
||||||
|
self._frozen = False
|
||||||
|
self._dacs = CtbDacs(self)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def dacs(self):
|
||||||
|
return self._dacs
|
||||||
|
|
@ -1,7 +1,9 @@
|
|||||||
from .detector_property import DetectorProperty
|
from .detector_property import DetectorProperty
|
||||||
from functools import partial
|
from functools import partial
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import _slsdet
|
||||||
|
from .detector import freeze
|
||||||
|
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||||
class Dac(DetectorProperty):
|
class Dac(DetectorProperty):
|
||||||
"""
|
"""
|
||||||
This class represents a dac on the detector. One instance handles all
|
This class represents a dac on the detector. One instance handles all
|
||||||
@ -14,11 +16,11 @@ class Dac(DetectorProperty):
|
|||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def __init__(self, name, low, high, default, detector):
|
def __init__(self, name, enum, low, high, default, detector):
|
||||||
|
|
||||||
super().__init__(partial(detector._api.getDac, name),
|
super().__init__(partial(detector.getDAC, enum, False),
|
||||||
partial(detector._api.setDac, name),
|
lambda x, y : detector.setDAC(enum, x, False, y),
|
||||||
detector._api.getNumberOfDetectors,
|
detector.size,
|
||||||
name)
|
name)
|
||||||
|
|
||||||
self.min_value = low
|
self.min_value = low
|
||||||
@ -29,30 +31,16 @@ class Dac(DetectorProperty):
|
|||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
"""String representation for a single dac in all modules"""
|
"""String representation for a single dac in all modules"""
|
||||||
r_str = ['{:10s}: '.format(self.__name__)]
|
dacstr = ''.join([f'{item:5d}' for item in self.get()])
|
||||||
r_str += ['{:5d}, '.format(self.get(i)) for i in range(self.get_nmod())]
|
return f'{self.__name__:10s}:{dacstr}'
|
||||||
return ''.join(r_str).strip(', ')
|
|
||||||
|
|
||||||
|
|
||||||
|
# a = Dac('vrf', dacIndex.VRF, 0, 4000, 2500, d )
|
||||||
|
# @freeze
|
||||||
class DetectorDacs:
|
class DetectorDacs:
|
||||||
_dacs = [('vsvp', 0, 4000, 0),
|
_dacs = []
|
||||||
('vtr', 0, 4000, 2500),
|
|
||||||
('vrf', 0, 4000, 3300),
|
|
||||||
('vrs', 0, 4000, 1400),
|
|
||||||
('vsvn', 0, 4000, 4000),
|
|
||||||
('vtgstv', 0, 4000, 2556),
|
|
||||||
('vcmp_ll', 0, 4000, 1500),
|
|
||||||
('vcmp_lr', 0, 4000, 1500),
|
|
||||||
('vcall', 0, 4000, 4000),
|
|
||||||
('vcmp_rl', 0, 4000, 1500),
|
|
||||||
('rxb_rb', 0, 4000, 1100),
|
|
||||||
('rxb_lb', 0, 4000, 1100),
|
|
||||||
('vcmp_rr', 0, 4000, 1500),
|
|
||||||
('vcp', 0, 4000, 200),
|
|
||||||
('vcn', 0, 4000, 2000),
|
|
||||||
('vis', 0, 4000, 1550),
|
|
||||||
('iodelay', 0, 4000, 660)]
|
|
||||||
_dacnames = [_d[0] for _d in _dacs]
|
_dacnames = [_d[0] for _d in _dacs]
|
||||||
|
_allowed_attr = ['_detector', '_current']
|
||||||
|
_frozen = False
|
||||||
|
|
||||||
def __init__(self, detector):
|
def __init__(self, detector):
|
||||||
# We need to at least initially know which detector we are connected to
|
# We need to at least initially know which detector we are connected to
|
||||||
@ -65,6 +53,8 @@ class DetectorDacs:
|
|||||||
for _d in self._dacs:
|
for _d in self._dacs:
|
||||||
setattr(self, '_'+_d[0], Dac(*_d, detector))
|
setattr(self, '_'+_d[0], Dac(*_d, detector))
|
||||||
|
|
||||||
|
self._frozen = True
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
return self.__getattribute__('_' + name)
|
return self.__getattribute__('_' + name)
|
||||||
|
|
||||||
@ -73,8 +63,11 @@ class DetectorDacs:
|
|||||||
if name in self._dacnames:
|
if name in self._dacnames:
|
||||||
return self.__getattribute__('_' + name).__setitem__(slice(None, None, None), value)
|
return self.__getattribute__('_' + name).__setitem__(slice(None, None, None), value)
|
||||||
else:
|
else:
|
||||||
|
if self._frozen == True and name not in self._allowed_attr:
|
||||||
|
raise AttributeError(f'Dac not found: {name}')
|
||||||
super().__setattr__(name, value)
|
super().__setattr__(name, value)
|
||||||
|
|
||||||
|
|
||||||
def __next__(self):
|
def __next__(self):
|
||||||
if self._current >= len(self._dacs):
|
if self._current >= len(self._dacs):
|
||||||
self._current = 0
|
self._current = 0
|
||||||
@ -95,7 +88,7 @@ class DetectorDacs:
|
|||||||
"""
|
"""
|
||||||
Read the dacs into a numpy array with dimensions [ndacs, nmodules]
|
Read the dacs into a numpy array with dimensions [ndacs, nmodules]
|
||||||
"""
|
"""
|
||||||
dac_array = np.zeros((len(self._dacs), self._detector.n_modules))
|
dac_array = np.zeros((len(self._dacs), len(self._detector)))
|
||||||
for i, _d in enumerate(self):
|
for i, _d in enumerate(self):
|
||||||
dac_array[i,:] = _d[:]
|
dac_array[i,:] = _d[:]
|
||||||
return dac_array
|
return dac_array
|
||||||
@ -115,11 +108,3 @@ class DetectorDacs:
|
|||||||
for _d in self:
|
for _d in self:
|
||||||
_d[:] = _d.default
|
_d[:] = _d.default
|
||||||
|
|
||||||
def update_nmod(self):
|
|
||||||
"""
|
|
||||||
Update the cached value of nmod, needs to be run after adding or
|
|
||||||
removing detectors
|
|
||||||
"""
|
|
||||||
for _d in self:
|
|
||||||
_d._n_modules = self._detector.n_modules
|
|
||||||
|
|
1179
python/slsdet/detector.py
Executable file
1179
python/slsdet/detector.py
Executable file
File diff suppressed because it is too large
Load Diff
@ -14,21 +14,20 @@ class DetectorProperty:
|
|||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
if key == slice(None, None, None):
|
if key == slice(None, None, None):
|
||||||
return [self.get(i) for i in range(self.get_nmod())]
|
return self.get()
|
||||||
elif isinstance(key, Iterable):
|
elif isinstance(key, Iterable):
|
||||||
return [self.get(k) for k in key]
|
return self.get(list(key))
|
||||||
else:
|
else:
|
||||||
return self.get(key)
|
return self.get([key])[0] #No list for single value
|
||||||
|
|
||||||
def __setitem__(self, key, value):
|
def __setitem__(self, key, value):
|
||||||
#operate on all values
|
#operate on all values
|
||||||
if key == slice(None, None, None):
|
if key == slice(None, None, None):
|
||||||
if isinstance(value, (np.integer, int)):
|
if isinstance(value, (np.integer, int)):
|
||||||
for i in range(self.get_nmod()):
|
self.set(value, [])
|
||||||
self.set(i, value)
|
|
||||||
elif isinstance(value, Iterable):
|
elif isinstance(value, Iterable):
|
||||||
for i in range(self.get_nmod()):
|
for i in range(self.get_nmod()):
|
||||||
self.set(i, value[i])
|
self.set(value[i], [i])
|
||||||
else:
|
else:
|
||||||
raise ValueError('Value should be int or np.integer not', type(value))
|
raise ValueError('Value should be int or np.integer not', type(value))
|
||||||
|
|
||||||
@ -36,15 +35,14 @@ class DetectorProperty:
|
|||||||
elif isinstance(key, Iterable):
|
elif isinstance(key, Iterable):
|
||||||
if isinstance(value, Iterable):
|
if isinstance(value, Iterable):
|
||||||
for k,v in zip(key, value):
|
for k,v in zip(key, value):
|
||||||
self.set(k,v)
|
self.set(v, [k])
|
||||||
|
|
||||||
elif isinstance(value, int):
|
elif isinstance(value, int):
|
||||||
for k in key:
|
self.set(value, list(key))
|
||||||
self.set(k, value)
|
|
||||||
|
|
||||||
#Set single value
|
#Set single value
|
||||||
elif isinstance(key, int):
|
elif isinstance(key, int):
|
||||||
self.set(key, value)
|
self.set(value, [key])
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
s = ', '.join(str(v) for v in self[:])
|
s = ', '.join(str(v) for v in self[:])
|
476
python/slsdet/eiger.py
Executable file
476
python/slsdet/eiger.py
Executable file
@ -0,0 +1,476 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
Created on Wed Dec 6 11:51:18 2017
|
||||||
|
|
||||||
|
@author: l_frojdh
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from .detector import Detector
|
||||||
|
|
||||||
|
# from .adcs import Adc, DetectorAdcs
|
||||||
|
from .dacs import DetectorDacs
|
||||||
|
import _slsdet
|
||||||
|
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||||
|
from .detector_property import DetectorProperty
|
||||||
|
# from .utils import element_if_equal
|
||||||
|
# from sls_detector.errors import DetectorValueError, DetectorError
|
||||||
|
|
||||||
|
class EigerVcmp:
|
||||||
|
"""
|
||||||
|
Convenience class to be able to loop over vcmp for Eiger
|
||||||
|
|
||||||
|
|
||||||
|
.. todo::
|
||||||
|
|
||||||
|
Support single assignment and perhaps unify with Dac class
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, detector):
|
||||||
|
_dacs = [ dacIndex.VCMP_LL,
|
||||||
|
dacIndex.VCMP_LR,
|
||||||
|
dacIndex.VCMP_RL,
|
||||||
|
dacIndex.VCMP_RR]
|
||||||
|
self.set = []
|
||||||
|
self.get = []
|
||||||
|
for i in range(detector.size()):
|
||||||
|
if i % 2 == 0:
|
||||||
|
dacs = _dacs
|
||||||
|
else:
|
||||||
|
dacs = _dacs[::-1]
|
||||||
|
for d in dacs:
|
||||||
|
self.set.append(lambda x, d=d, i=i : detector.setDAC(d, x, False, [i]))
|
||||||
|
self.get.append(lambda d=d, i=i : detector.getDAC(d, False, [i])[0])
|
||||||
|
|
||||||
|
def __getitem__(self, key):
|
||||||
|
if key == slice(None, None, None):
|
||||||
|
return [_d() for _d in self.get]
|
||||||
|
return self.get[key]()
|
||||||
|
|
||||||
|
def __setitem__(self, i, value):
|
||||||
|
self.set[i](value)
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return 'vcmp: '+ str(self[:])
|
||||||
|
|
||||||
|
|
||||||
|
class EigerDacs(DetectorDacs):
|
||||||
|
"""
|
||||||
|
Eiger specific dacs
|
||||||
|
"""
|
||||||
|
_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
|
||||||
|
# class DetectorDelays:
|
||||||
|
# _delaynames = ['frame', 'left', 'right']
|
||||||
|
|
||||||
|
# def __init__(self, detector):
|
||||||
|
# # We need to at least initially know which detector we are connected to
|
||||||
|
# self._detector = detector
|
||||||
|
|
||||||
|
# setattr(self, '_frame', DetectorProperty(detector._api.getDelayFrame,
|
||||||
|
# detector._api.setDelayFrame,
|
||||||
|
# detector._api.getNumberOfDetectors,
|
||||||
|
# 'frame'))
|
||||||
|
|
||||||
|
# setattr(self, '_left', DetectorProperty(detector._api.getDelayLeft,
|
||||||
|
# detector._api.setDelayLeft,
|
||||||
|
# detector._api.getNumberOfDetectors,
|
||||||
|
# 'left'))
|
||||||
|
|
||||||
|
# setattr(self, '_right', DetectorProperty(detector._api.getDelayRight,
|
||||||
|
# detector._api.setDelayRight,
|
||||||
|
# detector._api.getNumberOfDetectors,
|
||||||
|
# 'right'))
|
||||||
|
# # Index to support iteration
|
||||||
|
# self._current = 0
|
||||||
|
|
||||||
|
# def __getattr__(self, name):
|
||||||
|
# return self.__getattribute__('_' + name)
|
||||||
|
|
||||||
|
# def __setattr__(self, name, value):
|
||||||
|
# if name in self._delaynames:
|
||||||
|
# return self.__getattribute__('_' + name).__setitem__(slice(None, None, None), value)
|
||||||
|
# else:
|
||||||
|
# super().__setattr__(name, value)
|
||||||
|
|
||||||
|
# def __next__(self):
|
||||||
|
# if self._current >= len(self._delaynames):
|
||||||
|
# self._current = 0
|
||||||
|
# raise StopIteration
|
||||||
|
# else:
|
||||||
|
# self._current += 1
|
||||||
|
# return self.__getattr__(self._delaynames[self._current-1])
|
||||||
|
|
||||||
|
# def __iter__(self):
|
||||||
|
# return self
|
||||||
|
|
||||||
|
# def __repr__(self):
|
||||||
|
# hn = self._detector.hostname
|
||||||
|
# r_str = ['Transmission delay [ns]\n'
|
||||||
|
# '{:11s}{:>8s}{:>8s}{:>8s}'.format('', 'left', 'right', 'frame')]
|
||||||
|
# for i in range(self._detector.n_modules):
|
||||||
|
# r_str.append('{:2d}:{:8s}{:>8d}{:>8d}{:>8d}'.format(i, hn[i], self.left[i], self.right[i], self.frame[i]))
|
||||||
|
# return '\n'.join(r_str)
|
||||||
|
|
||||||
|
from .detector import freeze
|
||||||
|
|
||||||
|
@freeze
|
||||||
|
class Eiger(Detector):
|
||||||
|
"""
|
||||||
|
Subclassing Detector to set up correct dacs and detector specific
|
||||||
|
functions.
|
||||||
|
"""
|
||||||
|
_detector_dynamic_range = [4, 8, 16, 32]
|
||||||
|
|
||||||
|
|
||||||
|
_settings = ['standard', 'highgain', 'lowgain', 'veryhighgain', 'verylowgain']
|
||||||
|
"""available settings for Eiger, note almost always standard"""
|
||||||
|
|
||||||
|
def __init__(self, id=0):
|
||||||
|
super().__init__(id)
|
||||||
|
self._frozen = False
|
||||||
|
self._dacs = EigerDacs(self)
|
||||||
|
self._vcmp = EigerVcmp(self)
|
||||||
|
|
||||||
|
# self._active = DetectorProperty(self.getActive,
|
||||||
|
# self.setActive,
|
||||||
|
# self.size,
|
||||||
|
# 'active')
|
||||||
|
|
||||||
|
# self._trimbit_limits = namedtuple('trimbit_limits', ['min', 'max'])(0, 63)
|
||||||
|
# self._delay = DetectorDelays(self)
|
||||||
|
|
||||||
|
# # Eiger specific adcs
|
||||||
|
# self._temp = DetectorAdcs()
|
||||||
|
# self._temp.fpga = Adc('temp_fpga', self)
|
||||||
|
# self._temp.fpgaext = Adc('temp_fpgaext', self)
|
||||||
|
# self._temp.t10ge = Adc('temp_10ge', self)
|
||||||
|
# self._temp.dcdc = Adc('temp_dcdc', self)
|
||||||
|
# self._temp.sodl = Adc('temp_sodl', self)
|
||||||
|
# self._temp.sodr = Adc('temp_sodr', self)
|
||||||
|
# self._temp.fpgafl = Adc('temp_fpgafl', self)
|
||||||
|
# self._temp.fpgafr = Adc('temp_fpgafr', self)
|
||||||
|
|
||||||
|
# @property
|
||||||
|
# def active(self):
|
||||||
|
# """
|
||||||
|
# Is the detector active? Can be used to enable or disable a detector
|
||||||
|
# module
|
||||||
|
|
||||||
|
# Examples
|
||||||
|
# ----------
|
||||||
|
|
||||||
|
# ::
|
||||||
|
|
||||||
|
# d.active
|
||||||
|
# >> active: [True, True]
|
||||||
|
|
||||||
|
# d.active[1] = False
|
||||||
|
# >> active: [True, False]
|
||||||
|
# """
|
||||||
|
# return self._active
|
||||||
|
|
||||||
|
# @active.setter
|
||||||
|
# def active(self, value):
|
||||||
|
# self._active[:] = value
|
||||||
|
|
||||||
|
# @property
|
||||||
|
# def measured_period(self):
|
||||||
|
# return self._api.getMeasuredPeriod()
|
||||||
|
|
||||||
|
# @property
|
||||||
|
# def measured_subperiod(self):
|
||||||
|
# return self._api.getMeasuredSubPeriod()
|
||||||
|
|
||||||
|
# @property
|
||||||
|
# def add_gappixels(self):
|
||||||
|
# """Enable or disable the (virual) pixels between ASICs
|
||||||
|
|
||||||
|
# Examples
|
||||||
|
# ----------
|
||||||
|
|
||||||
|
# ::
|
||||||
|
|
||||||
|
# d.add_gappixels = True
|
||||||
|
|
||||||
|
# d.add_gappixels
|
||||||
|
# >> True
|
||||||
|
|
||||||
|
# """
|
||||||
|
# return self._api.getGapPixels()
|
||||||
|
|
||||||
|
# @add_gappixels.setter
|
||||||
|
# def add_gappixels(self, value):
|
||||||
|
# self._api.setGapPixels(value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def dacs(self):
|
||||||
|
"""
|
||||||
|
|
||||||
|
An instance of DetectorDacs used for accessing the dacs of a single
|
||||||
|
or multi detector.
|
||||||
|
|
||||||
|
Examples
|
||||||
|
---------
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
d = Eiger()
|
||||||
|
|
||||||
|
#Set all vrf to 1500
|
||||||
|
d.dacs.vrf = 1500
|
||||||
|
|
||||||
|
#Check vrf
|
||||||
|
d.dacs.vrf
|
||||||
|
>> vrf : 1500, 1500
|
||||||
|
|
||||||
|
#Set a single vtr
|
||||||
|
d.dacs.vtr[0] = 1800
|
||||||
|
|
||||||
|
#Set vrf with multiple values
|
||||||
|
d.dacs.vrf = [3500,3700]
|
||||||
|
d.dacs.vrf
|
||||||
|
>> vrf : 3500, 3700
|
||||||
|
|
||||||
|
#read into a variable
|
||||||
|
var = d.dacs.vrf[:]
|
||||||
|
|
||||||
|
#set multiple with multiple values, mostly used for large systems
|
||||||
|
d.dacs.vcall[0,1] = [3500,3600]
|
||||||
|
d.dacs.vcall
|
||||||
|
>> vcall : 3500, 3600
|
||||||
|
|
||||||
|
d.dacs
|
||||||
|
>>
|
||||||
|
========== DACS =========
|
||||||
|
vsvp : 0, 0
|
||||||
|
vtr : 4000, 4000
|
||||||
|
vrf : 1900, 1900
|
||||||
|
vrs : 1400, 1400
|
||||||
|
vsvn : 4000, 4000
|
||||||
|
vtgstv : 2556, 2556
|
||||||
|
vcmp_ll : 1500, 1500
|
||||||
|
vcmp_lr : 1500, 1500
|
||||||
|
vcall : 4000, 4000
|
||||||
|
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
|
||||||
|
|
||||||
|
"""
|
||||||
|
return self._dacs
|
||||||
|
|
||||||
|
# @property
|
||||||
|
# def tx_delay(self):
|
||||||
|
# """
|
||||||
|
# Transmission delay of the modules to allow running the detector
|
||||||
|
# in a network not supporting the full speed of the detector.
|
||||||
|
|
||||||
|
|
||||||
|
# ::
|
||||||
|
|
||||||
|
# d.tx_delay
|
||||||
|
# >>
|
||||||
|
# Transmission delay [ns]
|
||||||
|
# left right frame
|
||||||
|
# 0:beb048 0 15000 0
|
||||||
|
# 1:beb049 100 190000 100
|
||||||
|
|
||||||
|
# d.tx_delay.left = [2000,5000]
|
||||||
|
# """
|
||||||
|
# return self._delay
|
||||||
|
|
||||||
|
# def pulse_all_pixels(self, n):
|
||||||
|
# """
|
||||||
|
# Pulse each pixel of the chip **n** times using the analog test pulses.
|
||||||
|
# The pulse height is set using d.dacs.vcall with 4000 being 0 and 0 being
|
||||||
|
# the highest pulse.
|
||||||
|
|
||||||
|
# ::
|
||||||
|
|
||||||
|
# #Pulse all pixels ten times
|
||||||
|
# d.pulse_all_pixels(10)
|
||||||
|
|
||||||
|
# #Avoid resetting before acq
|
||||||
|
# d.eiger_matrix_reset = False
|
||||||
|
|
||||||
|
# d.acq() #take frame
|
||||||
|
|
||||||
|
# #Restore normal behaviour
|
||||||
|
# d.eiger_matrix_reset = True
|
||||||
|
|
||||||
|
|
||||||
|
# """
|
||||||
|
# self._api.pulseAllPixels(n)
|
||||||
|
|
||||||
|
|
||||||
|
# def pulse_diagonal(self, n):
|
||||||
|
# """
|
||||||
|
# Pulse pixels in super colums in a diagonal fashion. Used for calibration
|
||||||
|
# of vcall. Saves time compared to pulsing all pixels.
|
||||||
|
# """
|
||||||
|
# self._api.pulseDiagonal(n)
|
||||||
|
|
||||||
|
|
||||||
|
# def pulse_chip(self, n):
|
||||||
|
# """
|
||||||
|
# Advance the counter by toggling enable. Gives 2*n+2 int the counter
|
||||||
|
|
||||||
|
# """
|
||||||
|
# n = int(n)
|
||||||
|
# if n >= -1:
|
||||||
|
# self._api.pulseChip(n)
|
||||||
|
# else:
|
||||||
|
# raise ValueError('n must be equal or larger than -1')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def vcmp(self):
|
||||||
|
"""
|
||||||
|
Convenience function to get and set the individual vcmp of chips
|
||||||
|
Used mainly in the calibration code.
|
||||||
|
|
||||||
|
Examples
|
||||||
|
---------
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
#Reading
|
||||||
|
d.vcmp[:]
|
||||||
|
>> [500, 500, 500, 500, 500, 500, 500, 500]
|
||||||
|
|
||||||
|
#Setting
|
||||||
|
d.vcmp = [500, 500, 500, 500, 500, 500, 500, 500]
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
return self._vcmp
|
||||||
|
|
||||||
|
@vcmp.setter
|
||||||
|
def vcmp(self, values):
|
||||||
|
if len(values) == len(self._vcmp.set):
|
||||||
|
for i, v in enumerate(values):
|
||||||
|
self._vcmp.set[i](v)
|
||||||
|
else:
|
||||||
|
raise ValueError('vcmp only compatible with setting all')
|
||||||
|
|
||||||
|
# @property
|
||||||
|
# def rx_udpport(self):
|
||||||
|
# """
|
||||||
|
# UDP port for the receiver. Each module has two ports referred to
|
||||||
|
# as rx_udpport and rx_udpport2 in the command line interface
|
||||||
|
# here they are grouped for each detector
|
||||||
|
|
||||||
|
# ::
|
||||||
|
|
||||||
|
# [0:rx_udpport, 0:rx_udpport2, 1:rx_udpport ...]
|
||||||
|
|
||||||
|
# Examples
|
||||||
|
# -----------
|
||||||
|
|
||||||
|
# ::
|
||||||
|
|
||||||
|
# d.rx_udpport
|
||||||
|
# >> [50010, 50011, 50004, 50005]
|
||||||
|
|
||||||
|
# d.rx_udpport = [50010, 50011, 50012, 50013]
|
||||||
|
|
||||||
|
# """
|
||||||
|
# p0 = self._api.getReceiverUDPPort()
|
||||||
|
# p1 = self._api.getReceiverUDPPort2()
|
||||||
|
# return [int(val) for pair in zip(p0, p1) for val in pair]
|
||||||
|
|
||||||
|
# @rx_udpport.setter
|
||||||
|
# def rx_udpport(self, ports):
|
||||||
|
# """Requires iterating over elements two and two for setting ports"""
|
||||||
|
# a = iter(ports)
|
||||||
|
# for i, p in enumerate(zip(a, a)):
|
||||||
|
# self._api.setReceiverUDPPort(p[0], i)
|
||||||
|
# self._api.setReceiverUDPPort2(p[1], i)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def rx_zmqport(self):
|
||||||
|
"""
|
||||||
|
Return the receiver zmq ports. Note that Eiger has two ports per receiver!
|
||||||
|
This functions therefore differ from the base class.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
e.rx_zmqport
|
||||||
|
>> [30001, 30002, 30003, 30004]
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
ports = self.getRxZmqPort()
|
||||||
|
return [p + i for p in ports for i in range(2)]
|
||||||
|
|
||||||
|
|
||||||
|
# @rx_zmqport.setter
|
||||||
|
# def rx_zmqport(self, port):
|
||||||
|
# if isinstance(port, Iterable):
|
||||||
|
# for i, p in enumerate(port):
|
||||||
|
# self._api.setReceiverStreamingPort(p, i)
|
||||||
|
# else:
|
||||||
|
# self._api.setReceiverStreamingPort(port, -1)
|
||||||
|
|
||||||
|
# @property
|
||||||
|
# def temp(self):
|
||||||
|
# """
|
||||||
|
# An instance of DetectorAdcs used to read the temperature
|
||||||
|
# of different components
|
||||||
|
|
||||||
|
# Examples
|
||||||
|
# -----------
|
||||||
|
|
||||||
|
# ::
|
||||||
|
|
||||||
|
# detector.temp
|
||||||
|
# >>
|
||||||
|
# temp_fpga : 36.90°C, 45.60°C
|
||||||
|
# temp_fpgaext : 31.50°C, 32.50°C
|
||||||
|
# temp_10ge : 0.00°C, 0.00°C
|
||||||
|
# temp_dcdc : 36.00°C, 36.00°C
|
||||||
|
# temp_sodl : 33.00°C, 34.50°C
|
||||||
|
# temp_sodr : 33.50°C, 34.00°C
|
||||||
|
# temp_fpgafl : 33.81°C, 30.93°C
|
||||||
|
# temp_fpgafr : 27.88°C, 29.15°C
|
||||||
|
|
||||||
|
# a = detector.temp.fpga[:]
|
||||||
|
# a
|
||||||
|
# >> [36.568, 45.542]
|
||||||
|
|
||||||
|
|
||||||
|
# """
|
||||||
|
# return self._temp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# def set_delays(self, delta):
|
||||||
|
# self.tx_delay.left = [delta*(i*2) for i in range(self.n_modules)]
|
||||||
|
# self.tx_delay.right = [delta*(i*2+1) for i in range(self.n_modules)]
|
||||||
|
|
||||||
|
|
54
python/slsdet/jungfrau.py
Normal file
54
python/slsdet/jungfrau.py
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
This file contains the specialization for the Jungfrau detector
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from .detector import Detector, freeze
|
||||||
|
|
||||||
|
# from .adcs import Adc, DetectorAdcs
|
||||||
|
from .dacs import DetectorDacs
|
||||||
|
import _slsdet
|
||||||
|
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||||
|
from .detector_property import DetectorProperty
|
||||||
|
|
||||||
|
# @freeze
|
||||||
|
class JungfrauDacs(DetectorDacs):
|
||||||
|
"""
|
||||||
|
Jungfrau specific DACs
|
||||||
|
"""
|
||||||
|
_dacs = [('vb_comp', dacIndex.VB_COMP, 0, 4000, 1220),
|
||||||
|
('vdd_prot', dacIndex.VDD_PROT, 0, 4000, 3000),
|
||||||
|
('vin_com', dacIndex.VIN_COM, 0, 4000, 1053),
|
||||||
|
('vref_prech', dacIndex.VREF_PRECH, 0, 4000, 1450),
|
||||||
|
('vb_pixbuff', dacIndex.VB_PIXBUF, 0, 4000, 750),
|
||||||
|
('vb_ds', dacIndex.VB_DS, 0, 4000, 1000),
|
||||||
|
('vref_ds', dacIndex.VREF_DS, 0, 4000, 480),
|
||||||
|
('vref_comp', dacIndex.VREF_COMP, 0, 4000, 420),
|
||||||
|
]
|
||||||
|
_dacnames = [_d[0] for _d in _dacs]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@freeze
|
||||||
|
class Jungfrau(Detector):
|
||||||
|
"""
|
||||||
|
Subclassing Detector to set up correct dacs and detector specific
|
||||||
|
functions.
|
||||||
|
"""
|
||||||
|
_detector_dynamic_range = [4, 8, 16, 32]
|
||||||
|
|
||||||
|
|
||||||
|
_settings = ['standard', 'highgain', 'lowgain', 'veryhighgain', 'verylowgain']
|
||||||
|
"""available settings for Eiger, note almost always standard"""
|
||||||
|
|
||||||
|
def __init__(self, id=0):
|
||||||
|
super().__init__(id)
|
||||||
|
self._frozen = False
|
||||||
|
self._dacs = JungfrauDacs(self)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def dacs(self):
|
||||||
|
return self._dacs
|
9
python/slsdet/lookup.py
Normal file
9
python/slsdet/lookup.py
Normal 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()]
|
63
python/slsdet/mythen3.py
Normal file
63
python/slsdet/mythen3.py
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
This file contains the specialization for the Jungfrau detector
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from .detector import Detector, freeze
|
||||||
|
|
||||||
|
# from .adcs import Adc, DetectorAdcs
|
||||||
|
from .dacs import DetectorDacs
|
||||||
|
import _slsdet
|
||||||
|
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||||
|
from .detector_property import DetectorProperty
|
||||||
|
|
||||||
|
|
||||||
|
# @freeze
|
||||||
|
class Mythen3Dacs(DetectorDacs):
|
||||||
|
"""
|
||||||
|
Jungfrau specific DACs
|
||||||
|
"""
|
||||||
|
_dacs = [('vcassh', dacIndex.VCASSH, 0, 4000, 1220),
|
||||||
|
('vth2', dacIndex.VTH2, 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.VTH1, 0, 4000, 2800),
|
||||||
|
('vicin', dacIndex.VICIN, 0, 4000, 1708),
|
||||||
|
('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),
|
||||||
|
('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
|
||||||
|
class Mythen3(Detector):
|
||||||
|
"""
|
||||||
|
Subclassing Detector to set up correct dacs and detector specific
|
||||||
|
functions.
|
||||||
|
"""
|
||||||
|
_detector_dynamic_range = [4, 8, 16, 32]
|
||||||
|
|
||||||
|
|
||||||
|
_settings = ['standard', 'highgain', 'lowgain', 'veryhighgain', 'verylowgain']
|
||||||
|
"""available settings for Eiger, note almost always standard"""
|
||||||
|
|
||||||
|
def __init__(self, id=0):
|
||||||
|
super().__init__(id)
|
||||||
|
self._frozen = False
|
||||||
|
self._dacs = Mythen3Dacs(self)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def dacs(self):
|
||||||
|
return self._dacs
|
@ -3,14 +3,17 @@ class Register:
|
|||||||
self._detector = detector
|
self._detector = detector
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
return self._detector._api.readRegister(key)
|
return self._detector.readRegister(key)
|
||||||
|
|
||||||
def __setitem__(self, key, value):
|
def __setitem__(self, key, value):
|
||||||
self._detector._api.writeRegister(key, value)
|
self._detector.writeRegister(key, value)
|
||||||
|
|
||||||
class Adc_register:
|
class Adc_register:
|
||||||
def __init__(self, detector):
|
def __init__(self, detector):
|
||||||
self._detector = detector
|
self._detector = detector
|
||||||
|
|
||||||
def __setitem__(self, key, value):
|
def __setitem__(self, key, value):
|
||||||
self._detector._api.writeAdcRegister(key, value)
|
self._detector.writeAdcRegister(key, value)
|
||||||
|
|
||||||
|
def __getitem__(self, key):
|
||||||
|
raise ValueError('Adc registers cannot be read back')
|
95
python/slsdet/utils.py
Executable file
95
python/slsdet/utils.py
Executable file
@ -0,0 +1,95 @@
|
|||||||
|
"""
|
||||||
|
Utility functions that are useful for testing and troubleshooting
|
||||||
|
but not directly used in controlling the detector
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from collections import namedtuple
|
||||||
|
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
|
||||||
|
"""
|
||||||
|
return [i for i in range(mask.bit_length()) if (mask>>i)&1]
|
||||||
|
|
||||||
|
def list_to_bitmask(values):
|
||||||
|
"""
|
||||||
|
Convert a list of integers to a bitmask with set bits
|
||||||
|
where the list indicates
|
||||||
|
"""
|
||||||
|
mask = int(0)
|
||||||
|
values = list(set(values)) #Remove duplicates
|
||||||
|
for v in values:
|
||||||
|
mask += 1 << v
|
||||||
|
return mask
|
||||||
|
|
||||||
|
def to_geo(value):
|
||||||
|
if isinstance(value, _slsdet.xy):
|
||||||
|
return Geometry(x = value.x, y = value.y)
|
||||||
|
else:
|
||||||
|
raise ValueError("Can only convert sls_detector.xy")
|
||||||
|
|
||||||
|
def all_equal(mylist):
|
||||||
|
"""If all elements are equal return true otherwise false"""
|
||||||
|
return all(x == mylist[0] for x in 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
|
||||||
|
else:
|
||||||
|
return mylist[0]
|
||||||
|
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
|
||||||
|
"""
|
||||||
|
@functools.wraps(func)
|
||||||
|
def wrapper(self, *args, **kwargs):
|
||||||
|
return element_if_equal(func(self, *args, **kwargs))
|
||||||
|
return wrapper
|
||||||
|
|
||||||
|
def eiger_register_to_time(register):
|
||||||
|
"""
|
||||||
|
Decode register value and return time in s. Values are stored in
|
||||||
|
a 32bit register with bits 2->0 containing the exponent and bits
|
||||||
|
31->3 containing the significand (int value)
|
||||||
|
|
||||||
|
"""
|
||||||
|
clocks = register >> 3
|
||||||
|
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)
|
@ -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 |
@ -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
|
|
@ -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| \- \-
|
|
||||||
===================== ===================================== ================== =========
|
|
@ -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'),
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
|||||||
C++ API
|
|
||||||
=====================================================
|
|
||||||
|
|
||||||
|
|
||||||
.. py:currentmodule:: _sls_detector
|
|
||||||
|
|
||||||
.. autoclass:: DetectorApi
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -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)
|
|
||||||
|
|
||||||
|
|
@ -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'
|
|
@ -1,30 +0,0 @@
|
|||||||
sls_detector - Python interface for the slsDetectorsPackage
|
|
||||||
==============================================================
|
|
||||||
|
|
||||||
sls_detector provide Python bindings to the slsDetectorsPackage using mainly the
|
|
||||||
multiSlsDetector 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`
|
|
@ -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
|
|
@ -1,6 +0,0 @@
|
|||||||
make clean
|
|
||||||
make html
|
|
||||||
rm -rf ../docs/
|
|
||||||
mv _build/html/ ../docs/
|
|
||||||
touch ../docs/.nojekyll
|
|
||||||
rm -rf _build
|
|
@ -1,8 +0,0 @@
|
|||||||
sls_detector
|
|
||||||
==================
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:maxdepth: 4
|
|
||||||
|
|
||||||
sls_detector
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
|||||||
Python classes
|
|
||||||
=====================================================
|
|
||||||
|
|
||||||
|
|
||||||
.. py:currentmodule:: sls_detector
|
|
||||||
|
|
||||||
Detector
|
|
||||||
----------
|
|
||||||
|
|
||||||
.. autoclass:: Detector
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Eiger
|
|
||||||
-------
|
|
||||||
|
|
||||||
.. autoclass:: Eiger
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Jungfrau
|
|
||||||
----------
|
|
||||||
|
|
||||||
.. autoclass:: Jungfrau
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
1405
python/src/detector.cpp
Normal file
1405
python/src/detector.cpp
Normal file
File diff suppressed because it is too large
Load Diff
28
python/src/detector_in.cpp
Normal file
28
python/src/detector_in.cpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#include <pybind11/chrono.h>
|
||||||
|
#include <pybind11/operators.h>
|
||||||
|
#include <pybind11/pybind11.h>
|
||||||
|
#include <pybind11/stl.h>
|
||||||
|
|
||||||
|
#include "Detector.h"
|
||||||
|
#include "ToString.h"
|
||||||
|
#include "network_utils.h"
|
||||||
|
#include "sls_detector_defs.h"
|
||||||
|
#include "typecaster.h"
|
||||||
|
|
||||||
|
#include "TimeHelper.h"
|
||||||
|
#include <array>
|
||||||
|
#include <chrono>
|
||||||
|
namespace py = pybind11;
|
||||||
|
void init_det(py::module &m) {
|
||||||
|
using sls::Detector;
|
||||||
|
using sls::Positions;
|
||||||
|
using sls::Result;
|
||||||
|
using sls::defs;
|
||||||
|
using sls::ns;
|
||||||
|
|
||||||
|
py::class_<Detector> CppDetectorApi(m, "CppDetectorApi");
|
||||||
|
CppDetectorApi
|
||||||
|
.def(py::init<int>())
|
||||||
|
|
||||||
|
[[FUNCTIONS]]
|
||||||
|
}
|
@ -17,8 +17,6 @@ void init_enums(py::module &m) {
|
|||||||
xy.def_readwrite("y", &slsDetectorDefs::xy::y);
|
xy.def_readwrite("y", &slsDetectorDefs::xy::y);
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::detectorType>(Defs, "detectorType")
|
py::enum_<slsDetectorDefs::detectorType>(Defs, "detectorType")
|
||||||
.value("GET_DETECTOR_TYPE",
|
|
||||||
slsDetectorDefs::detectorType::GET_DETECTOR_TYPE)
|
|
||||||
.value("GENERIC", slsDetectorDefs::detectorType::GENERIC)
|
.value("GENERIC", slsDetectorDefs::detectorType::GENERIC)
|
||||||
.value("EIGER", slsDetectorDefs::detectorType::EIGER)
|
.value("EIGER", slsDetectorDefs::detectorType::EIGER)
|
||||||
.value("GOTTHARD", slsDetectorDefs::detectorType::GOTTHARD)
|
.value("GOTTHARD", slsDetectorDefs::detectorType::GOTTHARD)
|
||||||
@ -40,8 +38,6 @@ void init_enums(py::module &m) {
|
|||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::frameDiscardPolicy>(Defs, "frameDiscardPolicy")
|
py::enum_<slsDetectorDefs::frameDiscardPolicy>(Defs, "frameDiscardPolicy")
|
||||||
.value("GET_FRAME_DISCARD_POLICY",
|
|
||||||
slsDetectorDefs::frameDiscardPolicy::GET_FRAME_DISCARD_POLICY)
|
|
||||||
.value("NO_DISCARD", slsDetectorDefs::frameDiscardPolicy::NO_DISCARD)
|
.value("NO_DISCARD", slsDetectorDefs::frameDiscardPolicy::NO_DISCARD)
|
||||||
.value("DISCARD_EMPTY_FRAMES",
|
.value("DISCARD_EMPTY_FRAMES",
|
||||||
slsDetectorDefs::frameDiscardPolicy::DISCARD_EMPTY_FRAMES)
|
slsDetectorDefs::frameDiscardPolicy::DISCARD_EMPTY_FRAMES)
|
||||||
@ -52,72 +48,76 @@ void init_enums(py::module &m) {
|
|||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::fileFormat>(Defs, "fileFormat")
|
py::enum_<slsDetectorDefs::fileFormat>(Defs, "fileFormat")
|
||||||
.value("GET_FILE_FORMAT", slsDetectorDefs::fileFormat::GET_FILE_FORMAT)
|
|
||||||
.value("BINARY", slsDetectorDefs::fileFormat::BINARY)
|
.value("BINARY", slsDetectorDefs::fileFormat::BINARY)
|
||||||
.value("HDF5", slsDetectorDefs::fileFormat::HDF5)
|
.value(" HDF5", slsDetectorDefs::fileFormat::HDF5)
|
||||||
.value("NUM_FILE_FORMATS",
|
.value(" NUM_FILE_FORMATS",
|
||||||
slsDetectorDefs::fileFormat::NUM_FILE_FORMATS)
|
slsDetectorDefs::fileFormat::NUM_FILE_FORMATS)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::dimension>(Defs, "dimension")
|
py::enum_<slsDetectorDefs::dimension>(Defs, "dimension")
|
||||||
.value("X", slsDetectorDefs::dimension::X)
|
.value("X", slsDetectorDefs::dimension::X)
|
||||||
.value("Y", slsDetectorDefs::dimension::Y)
|
.value(" Y", slsDetectorDefs::dimension::Y)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::externalSignalFlag>(Defs, "externalSignalFlag")
|
py::enum_<slsDetectorDefs::externalSignalFlag>(Defs, "externalSignalFlag")
|
||||||
.value("GET_EXTERNAL_SIGNAL_FLAG",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GET_EXTERNAL_SIGNAL_FLAG)
|
|
||||||
.value("SIGNAL_OFF", slsDetectorDefs::externalSignalFlag::SIGNAL_OFF)
|
|
||||||
.value("GATE_IN_ACTIVE_HIGH",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GATE_IN_ACTIVE_HIGH)
|
|
||||||
.value("GATE_IN_ACTIVE_LOW",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GATE_IN_ACTIVE_LOW)
|
|
||||||
.value("TRIGGER_IN_RISING_EDGE",
|
.value("TRIGGER_IN_RISING_EDGE",
|
||||||
slsDetectorDefs::externalSignalFlag::TRIGGER_IN_RISING_EDGE)
|
slsDetectorDefs::externalSignalFlag::TRIGGER_IN_RISING_EDGE)
|
||||||
.value("TRIGGER_IN_FALLING_EDGE",
|
.value("TRIGGER_IN_FALLING_EDGE",
|
||||||
slsDetectorDefs::externalSignalFlag::TRIGGER_IN_FALLING_EDGE)
|
slsDetectorDefs::externalSignalFlag::TRIGGER_IN_FALLING_EDGE)
|
||||||
.value("RO_TRIGGER_IN_RISING_EDGE",
|
.value("INVERSION_ON",
|
||||||
slsDetectorDefs::externalSignalFlag::RO_TRIGGER_IN_RISING_EDGE)
|
slsDetectorDefs::externalSignalFlag::INVERSION_ON)
|
||||||
.value("RO_TRIGGER_IN_FALLING_EDGE",
|
.value("INVERSION_OFF",
|
||||||
slsDetectorDefs::externalSignalFlag::RO_TRIGGER_IN_FALLING_EDGE)
|
slsDetectorDefs::externalSignalFlag::INVERSION_OFF)
|
||||||
.value("GATE_OUT_ACTIVE_HIGH",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GATE_OUT_ACTIVE_HIGH)
|
|
||||||
.value("GATE_OUT_ACTIVE_LOW",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GATE_OUT_ACTIVE_LOW)
|
|
||||||
.value("TRIGGER_OUT_RISING_EDGE",
|
|
||||||
slsDetectorDefs::externalSignalFlag::TRIGGER_OUT_RISING_EDGE)
|
|
||||||
.value("TRIGGER_OUT_FALLING_EDGE",
|
|
||||||
slsDetectorDefs::externalSignalFlag::TRIGGER_OUT_FALLING_EDGE)
|
|
||||||
.value("RO_TRIGGER_OUT_RISING_EDGE",
|
|
||||||
slsDetectorDefs::externalSignalFlag::RO_TRIGGER_OUT_RISING_EDGE)
|
|
||||||
.value("RO_TRIGGER_OUT_FALLING_EDGE",
|
|
||||||
slsDetectorDefs::externalSignalFlag::RO_TRIGGER_OUT_FALLING_EDGE)
|
|
||||||
.value("OUTPUT_LOW", slsDetectorDefs::externalSignalFlag::OUTPUT_LOW)
|
|
||||||
.value("OUTPUT_HIGH", slsDetectorDefs::externalSignalFlag::OUTPUT_HIGH)
|
|
||||||
.value(
|
|
||||||
"MASTER_SLAVE_SYNCHRONIZATION",
|
|
||||||
slsDetectorDefs::externalSignalFlag::MASTER_SLAVE_SYNCHRONIZATION)
|
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::timingMode>(Defs, "timingMode")
|
py::enum_<slsDetectorDefs::timingMode>(Defs, "timingMode")
|
||||||
.value("GET_TIMING_MODE", slsDetectorDefs::timingMode::GET_TIMING_MODE)
|
|
||||||
.value("AUTO_TIMING", slsDetectorDefs::timingMode::AUTO_TIMING)
|
.value("AUTO_TIMING", slsDetectorDefs::timingMode::AUTO_TIMING)
|
||||||
.value("TRIGGER_EXPOSURE",
|
.value("TRIGGER_EXPOSURE",
|
||||||
slsDetectorDefs::timingMode::TRIGGER_EXPOSURE)
|
slsDetectorDefs::timingMode::TRIGGER_EXPOSURE)
|
||||||
.value("GATED", slsDetectorDefs::timingMode::GATED)
|
.value("GATED", slsDetectorDefs::timingMode::GATED)
|
||||||
.value("BURST_TRIGGER", slsDetectorDefs::timingMode::BURST_TRIGGER)
|
.value("BURST_TRIGGER", slsDetectorDefs::timingMode::BURST_TRIGGER)
|
||||||
|
.value("TRIGGER_GATED", slsDetectorDefs::timingMode::TRIGGER_GATED)
|
||||||
|
.value("NUM_TIMING_MODES",
|
||||||
|
slsDetectorDefs::timingMode::NUM_TIMING_MODES)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::dacIndex>(Defs, "dacIndex")
|
py::enum_<slsDetectorDefs::dacIndex>(Defs, "dacIndex")
|
||||||
.value("THRESHOLD", slsDetectorDefs::dacIndex::THRESHOLD)
|
.value("DAC_0", slsDetectorDefs::dacIndex::DAC_0)
|
||||||
.value("CALIBRATION_PULSE",
|
.value("DAC_1", slsDetectorDefs::dacIndex::DAC_1)
|
||||||
slsDetectorDefs::dacIndex::CALIBRATION_PULSE)
|
.value("DAC_2", slsDetectorDefs::dacIndex::DAC_2)
|
||||||
.value("TRIMBIT_SIZE", slsDetectorDefs::dacIndex::TRIMBIT_SIZE)
|
.value("DAC_3", slsDetectorDefs::dacIndex::DAC_3)
|
||||||
.value("PREAMP", slsDetectorDefs::dacIndex::PREAMP)
|
.value("DAC_4", slsDetectorDefs::dacIndex::DAC_4)
|
||||||
.value("SHAPER1", slsDetectorDefs::dacIndex::SHAPER1)
|
.value("DAC_5", slsDetectorDefs::dacIndex::DAC_5)
|
||||||
.value("SHAPER2", slsDetectorDefs::dacIndex::SHAPER2)
|
.value("DAC_6", slsDetectorDefs::dacIndex::DAC_6)
|
||||||
.value("TEMPERATURE_ADC", slsDetectorDefs::dacIndex::TEMPERATURE_ADC)
|
.value("DAC_7", slsDetectorDefs::dacIndex::DAC_7)
|
||||||
.value("TEMPERATURE_FPGA", slsDetectorDefs::dacIndex::TEMPERATURE_FPGA)
|
.value("DAC_8", slsDetectorDefs::dacIndex::DAC_8)
|
||||||
|
.value("DAC_9", slsDetectorDefs::dacIndex::DAC_9)
|
||||||
|
.value("DAC_10", slsDetectorDefs::dacIndex::DAC_10)
|
||||||
|
.value("DAC_11", slsDetectorDefs::dacIndex::DAC_11)
|
||||||
|
.value("DAC_12", slsDetectorDefs::dacIndex::DAC_12)
|
||||||
|
.value("DAC_13", slsDetectorDefs::dacIndex::DAC_13)
|
||||||
|
.value("DAC_14", slsDetectorDefs::dacIndex::DAC_14)
|
||||||
|
.value("DAC_15", slsDetectorDefs::dacIndex::DAC_15)
|
||||||
|
.value("DAC_16", slsDetectorDefs::dacIndex::DAC_16)
|
||||||
|
.value("DAC_17", slsDetectorDefs::dacIndex::DAC_17)
|
||||||
|
.value("VSVP", slsDetectorDefs::dacIndex::VSVP)
|
||||||
|
.value("VTRIM", slsDetectorDefs::dacIndex::VTRIM)
|
||||||
|
.value("VRPREAMP", slsDetectorDefs::dacIndex::VRPREAMP)
|
||||||
|
.value("VRSHAPER", slsDetectorDefs::dacIndex::VRSHAPER)
|
||||||
|
.value("VSVN", slsDetectorDefs::dacIndex::VSVN)
|
||||||
|
.value("VTGSTV", slsDetectorDefs::dacIndex::VTGSTV)
|
||||||
|
.value("VCMP_LL", slsDetectorDefs::dacIndex::VCMP_LL)
|
||||||
|
.value("VCMP_LR", slsDetectorDefs::dacIndex::VCMP_LR)
|
||||||
|
.value("VCAL", slsDetectorDefs::dacIndex::VCAL)
|
||||||
|
.value("VCMP_RL", slsDetectorDefs::dacIndex::VCMP_RL)
|
||||||
|
.value("RXB_RB", slsDetectorDefs::dacIndex::RXB_RB)
|
||||||
|
.value("RXB_LB", slsDetectorDefs::dacIndex::RXB_LB)
|
||||||
|
.value("VCMP_RR", slsDetectorDefs::dacIndex::VCMP_RR)
|
||||||
|
.value("VCP", slsDetectorDefs::dacIndex::VCP)
|
||||||
|
.value("VCN", slsDetectorDefs::dacIndex::VCN)
|
||||||
|
.value("VISHAPER", slsDetectorDefs::dacIndex::VISHAPER)
|
||||||
|
.value("VTHRESHOLD", slsDetectorDefs::dacIndex::VTHRESHOLD)
|
||||||
|
.value("IO_DELAY", slsDetectorDefs::dacIndex::IO_DELAY)
|
||||||
.value("VREF_DS", slsDetectorDefs::dacIndex::VREF_DS)
|
.value("VREF_DS", slsDetectorDefs::dacIndex::VREF_DS)
|
||||||
.value("VCASCN_PB", slsDetectorDefs::dacIndex::VCASCN_PB)
|
.value("VCASCN_PB", slsDetectorDefs::dacIndex::VCASCN_PB)
|
||||||
.value("VCASCP_PB", slsDetectorDefs::dacIndex::VCASCP_PB)
|
.value("VCASCP_PB", slsDetectorDefs::dacIndex::VCASCP_PB)
|
||||||
@ -126,25 +126,46 @@ void init_enums(py::module &m) {
|
|||||||
.value("VIN_CM", slsDetectorDefs::dacIndex::VIN_CM)
|
.value("VIN_CM", slsDetectorDefs::dacIndex::VIN_CM)
|
||||||
.value("VREF_COMP", slsDetectorDefs::dacIndex::VREF_COMP)
|
.value("VREF_COMP", slsDetectorDefs::dacIndex::VREF_COMP)
|
||||||
.value("IB_TESTC", slsDetectorDefs::dacIndex::IB_TESTC)
|
.value("IB_TESTC", slsDetectorDefs::dacIndex::IB_TESTC)
|
||||||
.value("SVP", slsDetectorDefs::dacIndex::SVP)
|
.value("VB_COMP", slsDetectorDefs::dacIndex::VB_COMP)
|
||||||
.value("SVN", slsDetectorDefs::dacIndex::SVN)
|
.value("VDD_PROT", slsDetectorDefs::dacIndex::VDD_PROT)
|
||||||
.value("VTR", slsDetectorDefs::dacIndex::VTR)
|
.value("VIN_COM", slsDetectorDefs::dacIndex::VIN_COM)
|
||||||
.value("VRF", slsDetectorDefs::dacIndex::VRF)
|
.value("VREF_PRECH", slsDetectorDefs::dacIndex::VREF_PRECH)
|
||||||
.value("VRS", slsDetectorDefs::dacIndex::VRS)
|
.value("VB_PIXBUF", slsDetectorDefs::dacIndex::VB_PIXBUF)
|
||||||
.value("VTGSTV", slsDetectorDefs::dacIndex::VTGSTV)
|
.value("VB_DS", slsDetectorDefs::dacIndex::VB_DS)
|
||||||
.value("VCMP_LL", slsDetectorDefs::dacIndex::VCMP_LL)
|
.value("VREF_H_ADC", slsDetectorDefs::dacIndex::VREF_H_ADC)
|
||||||
.value("VCMP_LR", slsDetectorDefs::dacIndex::VCMP_LR)
|
.value("VB_COMP_FE", slsDetectorDefs::dacIndex::VB_COMP_FE)
|
||||||
.value("CAL", slsDetectorDefs::dacIndex::CAL)
|
.value("VB_COMP_ADC", slsDetectorDefs::dacIndex::VB_COMP_ADC)
|
||||||
.value("VCMP_RL", slsDetectorDefs::dacIndex::VCMP_RL)
|
.value("VCOM_CDS", slsDetectorDefs::dacIndex::VCOM_CDS)
|
||||||
.value("VCMP_RR", slsDetectorDefs::dacIndex::VCMP_RR)
|
.value("VREF_RSTORE", slsDetectorDefs::dacIndex::VREF_RSTORE)
|
||||||
.value("RXB_RB", slsDetectorDefs::dacIndex::RXB_RB)
|
.value("VB_OPA_1ST", slsDetectorDefs::dacIndex::VB_OPA_1ST)
|
||||||
.value("RXB_LB", slsDetectorDefs::dacIndex::RXB_LB)
|
.value("VREF_COMP_FE", slsDetectorDefs::dacIndex::VREF_COMP_FE)
|
||||||
.value("VCP", slsDetectorDefs::dacIndex::VCP)
|
.value("VCOM_ADC1", slsDetectorDefs::dacIndex::VCOM_ADC1)
|
||||||
.value("VCN", slsDetectorDefs::dacIndex::VCN)
|
.value("VREF_L_ADC", slsDetectorDefs::dacIndex::VREF_L_ADC)
|
||||||
.value("VIS", slsDetectorDefs::dacIndex::VIS)
|
.value("VREF_CDS", slsDetectorDefs::dacIndex::VREF_CDS)
|
||||||
.value("IO_DELAY", slsDetectorDefs::dacIndex::IO_DELAY)
|
.value("VB_CS", slsDetectorDefs::dacIndex::VB_CS)
|
||||||
|
.value("VB_OPA_FD", slsDetectorDefs::dacIndex::VB_OPA_FD)
|
||||||
|
.value("VCOM_ADC2", slsDetectorDefs::dacIndex::VCOM_ADC2)
|
||||||
|
.value("VCASSH", slsDetectorDefs::dacIndex::VCASSH)
|
||||||
|
.value("VTH2", slsDetectorDefs::dacIndex::VTH2)
|
||||||
|
.value("VRSHAPER_N", slsDetectorDefs::dacIndex::VRSHAPER_N)
|
||||||
|
.value("VIPRE_OUT", slsDetectorDefs::dacIndex::VIPRE_OUT)
|
||||||
|
.value("VTH3", slsDetectorDefs::dacIndex::VTH3)
|
||||||
|
.value("VTH1", slsDetectorDefs::dacIndex::VTH1)
|
||||||
|
.value("VICIN", slsDetectorDefs::dacIndex::VICIN)
|
||||||
|
.value("VCAS", slsDetectorDefs::dacIndex::VCAS)
|
||||||
|
.value("VCAL_N", slsDetectorDefs::dacIndex::VCAL_N)
|
||||||
|
.value("VIPRE", slsDetectorDefs::dacIndex::VIPRE)
|
||||||
|
.value("VCAL_P", slsDetectorDefs::dacIndex::VCAL_P)
|
||||||
|
.value("VDCSH", slsDetectorDefs::dacIndex::VDCSH)
|
||||||
|
.value("VBP_COLBUF", slsDetectorDefs::dacIndex::VBP_COLBUF)
|
||||||
|
.value("VB_SDA", slsDetectorDefs::dacIndex::VB_SDA)
|
||||||
|
.value("VCASC_SFP", slsDetectorDefs::dacIndex::VCASC_SFP)
|
||||||
|
.value("VIPRE_CDS", slsDetectorDefs::dacIndex::VIPRE_CDS)
|
||||||
|
.value("IBIAS_SFP", slsDetectorDefs::dacIndex::IBIAS_SFP)
|
||||||
.value("ADC_VPP", slsDetectorDefs::dacIndex::ADC_VPP)
|
.value("ADC_VPP", slsDetectorDefs::dacIndex::ADC_VPP)
|
||||||
.value("HIGH_VOLTAGE", slsDetectorDefs::dacIndex::HIGH_VOLTAGE)
|
.value("HIGH_VOLTAGE", slsDetectorDefs::dacIndex::HIGH_VOLTAGE)
|
||||||
|
.value("TEMPERATURE_ADC", slsDetectorDefs::dacIndex::TEMPERATURE_ADC)
|
||||||
|
.value("TEMPERATURE_FPGA", slsDetectorDefs::dacIndex::TEMPERATURE_FPGA)
|
||||||
.value("TEMPERATURE_FPGAEXT",
|
.value("TEMPERATURE_FPGAEXT",
|
||||||
slsDetectorDefs::dacIndex::TEMPERATURE_FPGAEXT)
|
slsDetectorDefs::dacIndex::TEMPERATURE_FPGAEXT)
|
||||||
.value("TEMPERATURE_10GE", slsDetectorDefs::dacIndex::TEMPERATURE_10GE)
|
.value("TEMPERATURE_10GE", slsDetectorDefs::dacIndex::TEMPERATURE_10GE)
|
||||||
@ -155,35 +176,6 @@ void init_enums(py::module &m) {
|
|||||||
slsDetectorDefs::dacIndex::TEMPERATURE_FPGA2)
|
slsDetectorDefs::dacIndex::TEMPERATURE_FPGA2)
|
||||||
.value("TEMPERATURE_FPGA3",
|
.value("TEMPERATURE_FPGA3",
|
||||||
slsDetectorDefs::dacIndex::TEMPERATURE_FPGA3)
|
slsDetectorDefs::dacIndex::TEMPERATURE_FPGA3)
|
||||||
.value("VIPRE", slsDetectorDefs::dacIndex::VIPRE)
|
|
||||||
.value("VIINSH", slsDetectorDefs::dacIndex::VIINSH)
|
|
||||||
.value("VDCSH", slsDetectorDefs::dacIndex::VDCSH)
|
|
||||||
.value("VTH2", slsDetectorDefs::dacIndex::VTH2)
|
|
||||||
.value("VPL", slsDetectorDefs::dacIndex::VPL)
|
|
||||||
.value("VTH3", slsDetectorDefs::dacIndex::VTH3)
|
|
||||||
.value("CASSH", slsDetectorDefs::dacIndex::CASSH)
|
|
||||||
.value("CAS", slsDetectorDefs::dacIndex::CAS)
|
|
||||||
.value("VICIN", slsDetectorDefs::dacIndex::VICIN)
|
|
||||||
.value("VIPRE_OUT", slsDetectorDefs::dacIndex::VIPRE_OUT)
|
|
||||||
.value("VREF_H_ADC", slsDetectorDefs::dacIndex::VREF_H_ADC)
|
|
||||||
.value("VB_COMP_FE", slsDetectorDefs::dacIndex::VB_COMP_FE)
|
|
||||||
.value("VB_COMP_ADC", slsDetectorDefs::dacIndex::VB_COMP_ADC)
|
|
||||||
.value("VCOM_CDS", slsDetectorDefs::dacIndex::VCOM_CDS)
|
|
||||||
.value("VREF_RESTORE", slsDetectorDefs::dacIndex::VREF_RESTORE)
|
|
||||||
.value("VB_OPA_1ST", slsDetectorDefs::dacIndex::VB_OPA_1ST)
|
|
||||||
.value("VREF_COMP_FE", slsDetectorDefs::dacIndex::VREF_COMP_FE)
|
|
||||||
.value("VCOM_ADC1", slsDetectorDefs::dacIndex::VCOM_ADC1)
|
|
||||||
.value("VREF_PRECH", slsDetectorDefs::dacIndex::VREF_PRECH)
|
|
||||||
.value("VREF_L_ADC", slsDetectorDefs::dacIndex::VREF_L_ADC)
|
|
||||||
.value("VREF_CDS", slsDetectorDefs::dacIndex::VREF_CDS)
|
|
||||||
.value("VB_CS", slsDetectorDefs::dacIndex::VB_CS)
|
|
||||||
.value("VB_OPA_FD", slsDetectorDefs::dacIndex::VB_OPA_FD)
|
|
||||||
.value("VCOM_ADC2", slsDetectorDefs::dacIndex::VCOM_ADC2)
|
|
||||||
.value("VB_DS", slsDetectorDefs::dacIndex::VB_DS)
|
|
||||||
.value("VB_COMP", slsDetectorDefs::dacIndex::VB_COMP)
|
|
||||||
.value("VB_PIXBUF", slsDetectorDefs::dacIndex::VB_PIXBUF)
|
|
||||||
.value("VIN_COM", slsDetectorDefs::dacIndex::VIN_COM)
|
|
||||||
.value("VDD_PROT", slsDetectorDefs::dacIndex::VDD_PROT)
|
|
||||||
.value("V_POWER_A", slsDetectorDefs::dacIndex::V_POWER_A)
|
.value("V_POWER_A", slsDetectorDefs::dacIndex::V_POWER_A)
|
||||||
.value("V_POWER_B", slsDetectorDefs::dacIndex::V_POWER_B)
|
.value("V_POWER_B", slsDetectorDefs::dacIndex::V_POWER_B)
|
||||||
.value("V_POWER_C", slsDetectorDefs::dacIndex::V_POWER_C)
|
.value("V_POWER_C", slsDetectorDefs::dacIndex::V_POWER_C)
|
||||||
@ -208,7 +200,6 @@ void init_enums(py::module &m) {
|
|||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::detectorSettings>(Defs, "detectorSettings")
|
py::enum_<slsDetectorDefs::detectorSettings>(Defs, "detectorSettings")
|
||||||
.value("GET_SETTINGS", slsDetectorDefs::detectorSettings::GET_SETTINGS)
|
|
||||||
.value("STANDARD", slsDetectorDefs::detectorSettings::STANDARD)
|
.value("STANDARD", slsDetectorDefs::detectorSettings::STANDARD)
|
||||||
.value("FAST", slsDetectorDefs::detectorSettings::FAST)
|
.value("FAST", slsDetectorDefs::detectorSettings::FAST)
|
||||||
.value("HIGHGAIN", slsDetectorDefs::detectorSettings::HIGHGAIN)
|
.value("HIGHGAIN", slsDetectorDefs::detectorSettings::HIGHGAIN)
|
||||||
@ -224,6 +215,18 @@ void init_enums(py::module &m) {
|
|||||||
.value("FORCESWITCHG2",
|
.value("FORCESWITCHG2",
|
||||||
slsDetectorDefs::detectorSettings::FORCESWITCHG2)
|
slsDetectorDefs::detectorSettings::FORCESWITCHG2)
|
||||||
.value("VERYLOWGAIN", slsDetectorDefs::detectorSettings::VERYLOWGAIN)
|
.value("VERYLOWGAIN", slsDetectorDefs::detectorSettings::VERYLOWGAIN)
|
||||||
|
.value("G1_HIGHGAIN", slsDetectorDefs::detectorSettings::G1_HIGHGAIN)
|
||||||
|
.value("G1_LOWGAIN", slsDetectorDefs::detectorSettings::G1_LOWGAIN)
|
||||||
|
.value("G2_HIGHCAP_HIGHGAIN",
|
||||||
|
slsDetectorDefs::detectorSettings::G2_HIGHCAP_HIGHGAIN)
|
||||||
|
.value("G2_HIGHCAP_LOWGAIN",
|
||||||
|
slsDetectorDefs::detectorSettings::G2_HIGHCAP_LOWGAIN)
|
||||||
|
.value("G2_LOWCAP_HIGHGAIN",
|
||||||
|
slsDetectorDefs::detectorSettings::G2_LOWCAP_HIGHGAIN)
|
||||||
|
.value("G2_LOWCAP_LOWGAIN",
|
||||||
|
slsDetectorDefs::detectorSettings::G2_LOWCAP_LOWGAIN)
|
||||||
|
.value("G4_HIGHGAIN", slsDetectorDefs::detectorSettings::G4_HIGHGAIN)
|
||||||
|
.value("G4_LOWGAIN", slsDetectorDefs::detectorSettings::G4_LOWGAIN)
|
||||||
.value("UNDEFINED", slsDetectorDefs::detectorSettings::UNDEFINED)
|
.value("UNDEFINED", slsDetectorDefs::detectorSettings::UNDEFINED)
|
||||||
.value("UNINITIALIZED",
|
.value("UNINITIALIZED",
|
||||||
slsDetectorDefs::detectorSettings::UNINITIALIZED)
|
slsDetectorDefs::detectorSettings::UNINITIALIZED)
|
||||||
@ -231,51 +234,55 @@ void init_enums(py::module &m) {
|
|||||||
|
|
||||||
py::enum_<slsDetectorDefs::clockIndex>(Defs, "clockIndex")
|
py::enum_<slsDetectorDefs::clockIndex>(Defs, "clockIndex")
|
||||||
.value("ADC_CLOCK", slsDetectorDefs::clockIndex::ADC_CLOCK)
|
.value("ADC_CLOCK", slsDetectorDefs::clockIndex::ADC_CLOCK)
|
||||||
.value("DBIT_CLOCK", slsDetectorDefs::clockIndex::DBIT_CLOCK)
|
.value(" DBIT_CLOCK", slsDetectorDefs::clockIndex::DBIT_CLOCK)
|
||||||
.value("RUN_CLOCK", slsDetectorDefs::clockIndex::RUN_CLOCK)
|
.value(" RUN_CLOCK", slsDetectorDefs::clockIndex::RUN_CLOCK)
|
||||||
.value("SYNC_CLOCK", slsDetectorDefs::clockIndex::SYNC_CLOCK)
|
.value(" SYNC_CLOCK", slsDetectorDefs::clockIndex::SYNC_CLOCK)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::readoutMode>(Defs, "readoutMode")
|
py::enum_<slsDetectorDefs::readoutMode>(Defs, "readoutMode")
|
||||||
.value("ANALOG_ONLY", slsDetectorDefs::readoutMode::ANALOG_ONLY)
|
.value("ANALOG_ONLY", slsDetectorDefs::readoutMode::ANALOG_ONLY)
|
||||||
.value("DIGITAL_ONLY", slsDetectorDefs::readoutMode::DIGITAL_ONLY)
|
.value(" DIGITAL_ONLY", slsDetectorDefs::readoutMode::DIGITAL_ONLY)
|
||||||
.value("ANALOG_AND_DIGITAL",
|
.value(" ANALOG_AND_DIGITAL",
|
||||||
slsDetectorDefs::readoutMode::ANALOG_AND_DIGITAL)
|
slsDetectorDefs::readoutMode::ANALOG_AND_DIGITAL)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::speedLevel>(Defs, "speedLevel")
|
py::enum_<slsDetectorDefs::speedLevel>(Defs, "speedLevel")
|
||||||
.value("FULL_SPEED", slsDetectorDefs::speedLevel::FULL_SPEED)
|
.value("FULL_SPEED", slsDetectorDefs::speedLevel::FULL_SPEED)
|
||||||
.value("HALF_SPEED", slsDetectorDefs::speedLevel::HALF_SPEED)
|
.value(" HALF_SPEED", slsDetectorDefs::speedLevel::HALF_SPEED)
|
||||||
.value("QUARTER_SPEED", slsDetectorDefs::speedLevel::QUARTER_SPEED)
|
.value(" QUARTER_SPEED", slsDetectorDefs::speedLevel::QUARTER_SPEED)
|
||||||
.export_values();
|
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::portType>(Defs, "portType")
|
|
||||||
.value("CONTROL_PORT", slsDetectorDefs::portType::CONTROL_PORT)
|
|
||||||
.value("STOP_PORT", slsDetectorDefs::portType::STOP_PORT)
|
|
||||||
.value("DATA_PORT", slsDetectorDefs::portType::DATA_PORT)
|
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::masterFlags>(Defs, "masterFlags")
|
py::enum_<slsDetectorDefs::masterFlags>(Defs, "masterFlags")
|
||||||
.value("GET_MASTER", slsDetectorDefs::masterFlags::GET_MASTER)
|
|
||||||
.value("NO_MASTER", slsDetectorDefs::masterFlags::NO_MASTER)
|
.value("NO_MASTER", slsDetectorDefs::masterFlags::NO_MASTER)
|
||||||
.value("IS_MASTER", slsDetectorDefs::masterFlags::IS_MASTER)
|
.value(" IS_MASTER", slsDetectorDefs::masterFlags::IS_MASTER)
|
||||||
.value("IS_SLAVE", slsDetectorDefs::masterFlags::IS_SLAVE)
|
.value(" IS_SLAVE", slsDetectorDefs::masterFlags::IS_SLAVE)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::frameModeType>(Defs, "frameModeType")
|
py::enum_<slsDetectorDefs::frameModeType>(Defs, "frameModeType")
|
||||||
.value("GET_FRAME_MODE", slsDetectorDefs::frameModeType::GET_FRAME_MODE)
|
|
||||||
.value("PEDESTAL", slsDetectorDefs::frameModeType::PEDESTAL)
|
.value("PEDESTAL", slsDetectorDefs::frameModeType::PEDESTAL)
|
||||||
.value("NEW_PEDESTAL", slsDetectorDefs::frameModeType::NEW_PEDESTAL)
|
.value(" NEW_PEDESTAL", slsDetectorDefs::frameModeType::NEW_PEDESTAL)
|
||||||
.value("FLATFIELD", slsDetectorDefs::frameModeType::FLATFIELD)
|
.value(" FLATFIELD", slsDetectorDefs::frameModeType::FLATFIELD)
|
||||||
.value("NEW_FLATFIELD", slsDetectorDefs::frameModeType::NEW_FLATFIELD)
|
.value(" NEW_FLATFIELD", slsDetectorDefs::frameModeType::NEW_FLATFIELD)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::detectorModeType>(Defs, "detectorModeType")
|
py::enum_<slsDetectorDefs::detectorModeType>(Defs, "detectorModeType")
|
||||||
.value("GET_DETECTOR_MODE",
|
|
||||||
slsDetectorDefs::detectorModeType::GET_DETECTOR_MODE)
|
|
||||||
.value("COUNTING", slsDetectorDefs::detectorModeType::COUNTING)
|
.value("COUNTING", slsDetectorDefs::detectorModeType::COUNTING)
|
||||||
.value("INTERPOLATING",
|
.value(" INTERPOLATING",
|
||||||
slsDetectorDefs::detectorModeType::INTERPOLATING)
|
slsDetectorDefs::detectorModeType::INTERPOLATING)
|
||||||
.value("ANALOG", slsDetectorDefs::detectorModeType::ANALOG)
|
.value(" ANALOG", slsDetectorDefs::detectorModeType::ANALOG)
|
||||||
|
.export_values();
|
||||||
|
|
||||||
|
py::enum_<slsDetectorDefs::burstMode>(Defs, "burstMode")
|
||||||
|
.value("BURST_OFF", slsDetectorDefs::burstMode::BURST_OFF)
|
||||||
|
.value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL)
|
||||||
|
.value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL)
|
||||||
|
.value("NUM_BURST_MODES", slsDetectorDefs::burstMode::NUM_BURST_MODES)
|
||||||
|
.export_values();
|
||||||
|
|
||||||
|
py::enum_<slsDetectorDefs::timingSourceType>(Defs, "timingSourceType")
|
||||||
|
.value("TIMING_INTERNAL",
|
||||||
|
slsDetectorDefs::timingSourceType::TIMING_INTERNAL)
|
||||||
|
.value(" TIMING_EXTERNAL",
|
||||||
|
slsDetectorDefs::timingSourceType::TIMING_EXTERNAL)
|
||||||
.export_values();
|
.export_values();
|
||||||
}
|
}
|
||||||
|
@ -1,616 +0,0 @@
|
|||||||
#include <pybind11/chrono.h>
|
|
||||||
#include <pybind11/operators.h>
|
|
||||||
#include <pybind11/pybind11.h>
|
|
||||||
#include <pybind11/stl.h>
|
|
||||||
|
|
||||||
#include "Detector.h"
|
|
||||||
#include "ToString.h"
|
|
||||||
#include "network_utils.h"
|
|
||||||
#include "sls_detector_defs.h"
|
|
||||||
#include "typecaster.h"
|
|
||||||
namespace py = pybind11;
|
|
||||||
void init_experimental(py::module &m) {
|
|
||||||
using sls::Detector;
|
|
||||||
using sls::Positions;
|
|
||||||
using defs = slsDetectorDefs;
|
|
||||||
|
|
||||||
py::class_<Detector> CppDetectorApi(m, "CppDetectorApi");
|
|
||||||
CppDetectorApi
|
|
||||||
.def(py::init<int>())
|
|
||||||
|
|
||||||
// Configuration
|
|
||||||
.def("freeSharedMemory", (void (Detector::*)()) &Detector::freeSharedMemory)
|
|
||||||
.def("loadConfig", &Detector::loadConfig)
|
|
||||||
.def("loadParameters", &Detector::loadParameters)
|
|
||||||
.def("setHostname", &Detector::setHostname)
|
|
||||||
.def("getHostname", &Detector::getHostname, py::arg() = Positions{})
|
|
||||||
.def("getShmId", &Detector::getShmId)
|
|
||||||
.def("getFirmwareVersion", &Detector::getFirmwareVersion,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getDetectorServerVersion", &Detector::getDetectorServerVersion,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getSerialNumber", &Detector::getSerialNumber,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getClientVersion", &Detector::getClientVersion)
|
|
||||||
.def("getReceiverVersion", &Detector::getReceiverVersion,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getDetectorType", &Detector::getDetectorType,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("size", &Detector::size)
|
|
||||||
.def("getModuleGeometry", &Detector::getModuleGeometry)
|
|
||||||
.def("getModuleSize", &Detector::getModuleSize, py::arg() = Positions{})
|
|
||||||
.def("getDetectorSize", &Detector::getDetectorSize)
|
|
||||||
.def("setDetectorSize", &Detector::setDetectorSize)
|
|
||||||
.def("getSettings", &Detector::getSettings, py::arg() = Positions{})
|
|
||||||
.def("setSettings", &Detector::setSettings, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
// TODO! Python funcs for callbacks?
|
|
||||||
|
|
||||||
// Acquisition Parameters
|
|
||||||
.def("getNumberOfFrames", &Detector::getNumberOfFrames)
|
|
||||||
.def("setNumberOfFrames", &Detector::setNumberOfFrames)
|
|
||||||
.def("getNumberOfTriggers", &Detector::getNumberOfTriggers)
|
|
||||||
.def("setNumberOfTriggers", &Detector::setNumberOfTriggers)
|
|
||||||
.def("setExptime", &Detector::setExptime, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getExptime", &Detector::getExptime, py::arg() = Positions{})
|
|
||||||
.def("setPeriod", &Detector::setPeriod, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getPeriod", &Detector::getPeriod, py::arg() = Positions{})
|
|
||||||
.def("getDelayAfterTrigger", &Detector::getDelayAfterTrigger,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setDelayAfterTrigger", &Detector::setDelayAfterTrigger, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getNumberOfFramesLeft", &Detector::getNumberOfFramesLeft,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getNumberOfTriggersLeft", &Detector::getNumberOfTriggersLeft,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getDelayAfterTriggerLeft", &Detector::getDelayAfterTriggerLeft,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getSpeed", &Detector::getSpeed, py::arg() = Positions{})
|
|
||||||
.def("setSpeed", &Detector::setSpeed, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getADCPhase", &Detector::getADCPhase, py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("setADCPhase", &Detector::setADCPhase, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getADCPhaseInDegrees", &Detector::getADCPhaseInDegrees,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setADCPhaseInDegrees", &Detector::setADCPhaseInDegrees, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getHighVoltage", &Detector::getHighVoltage,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setHighVoltage", &Detector::setHighVoltage, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getTemperature", &Detector::getTemperature, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getDAC", &Detector::getDAC, py::arg(), py::arg() = false,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setDAC", &Detector::setDAC, py::arg(), py::arg(), py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getTimingMode", &Detector::getTimingMode, py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("setTimingMode", &Detector::setTimingMode, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
// ACQUISITION
|
|
||||||
.def("acquire", &Detector::acquire)
|
|
||||||
.def("startDetector", &Detector::startDetector)
|
|
||||||
.def("stopDetector", &Detector::stopDetector)
|
|
||||||
.def("startReceiver", &Detector::startReceiver)
|
|
||||||
.def("stopReceiver", &Detector::stopReceiver)
|
|
||||||
.def("clearAcquiringFlag", &Detector::clearAcquiringFlag)
|
|
||||||
.def("getDetectorStatus", &Detector::getDetectorStatus,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getReceiverStatus", &Detector::getReceiverStatus,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getFramesCaught", &Detector::getFramesCaught,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getStartingFrameNumber", &Detector::getStartingFrameNumber,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setStartingFrameNumber", &Detector::setStartingFrameNumber,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("sendSoftwareTrigger", &Detector::sendSoftwareTrigger,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
// Network Configuration (Detector<->Receiver)
|
|
||||||
.def("getNumberofUDPInterfaces", &Detector::getNumberofUDPInterfaces,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("setNumberofUDPInterfaces", &Detector::setNumberofUDPInterfaces,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getSelectedUDPInterface", &Detector::getSelectedUDPInterface,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("selectUDPInterface", &Detector::selectUDPInterface, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
// Using lambda to allow for conversion from IpAddr
|
|
||||||
.def("getSourceUDPIP",
|
|
||||||
[](const Detector &d, Positions pos) {
|
|
||||||
std::vector<std::string> res;
|
|
||||||
for (const auto &s : d.getSourceUDPIP(pos))
|
|
||||||
res.push_back(s.str());
|
|
||||||
return res;
|
|
||||||
},
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("setSourceUDPIP",
|
|
||||||
[](Detector &d, std::string ip, Positions pos) {
|
|
||||||
d.setSourceUDPIP(sls::IpAddr(ip), pos);
|
|
||||||
},
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getSourceUDPIP2",
|
|
||||||
[](const Detector &d, Positions pos) {
|
|
||||||
std::vector<std::string> res;
|
|
||||||
for (const auto &s : d.getSourceUDPIP2(pos))
|
|
||||||
res.push_back(s.str());
|
|
||||||
return res;
|
|
||||||
},
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setSourceUDPIP2",
|
|
||||||
[](Detector &d, std::string ip, Positions pos) {
|
|
||||||
d.setSourceUDPIP2(sls::IpAddr(ip), pos);
|
|
||||||
},
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getSourceUDPMAC",
|
|
||||||
[](const Detector &d, Positions pos) {
|
|
||||||
std::vector<std::string> res;
|
|
||||||
for (const auto &s : d.getSourceUDPMAC(pos))
|
|
||||||
res.push_back(s.str());
|
|
||||||
return res;
|
|
||||||
},
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setSourceUDPMAC",
|
|
||||||
[](Detector &d, std::string mac, Positions pos) {
|
|
||||||
d.setSourceUDPMAC(sls::MacAddr(mac), pos);
|
|
||||||
},
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getSourceUDPMAC2",
|
|
||||||
[](const Detector &d, Positions pos) {
|
|
||||||
std::vector<std::string> res;
|
|
||||||
for (const auto &s : d.getSourceUDPMAC2(pos))
|
|
||||||
res.push_back(s.str());
|
|
||||||
return res;
|
|
||||||
},
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setSourceUDPMAC2",
|
|
||||||
[](Detector &d, std::string mac, Positions pos) {
|
|
||||||
d.setSourceUDPMAC2(sls::MacAddr(mac), pos);
|
|
||||||
},
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getDestinationUDPIP",
|
|
||||||
[](const Detector &d, Positions pos) {
|
|
||||||
std::vector<std::string> res;
|
|
||||||
for (const auto &s : d.getDestinationUDPIP(pos))
|
|
||||||
res.push_back(s.str());
|
|
||||||
return res;
|
|
||||||
},
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setDestinationUDPIP",
|
|
||||||
[](Detector &d, std::string ip, Positions pos) {
|
|
||||||
d.setDestinationUDPIP(sls::IpAddr(ip), pos);
|
|
||||||
},
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getDestinationUDPIP2",
|
|
||||||
[](const Detector &d, Positions pos) {
|
|
||||||
std::vector<std::string> res;
|
|
||||||
for (const auto &s : d.getDestinationUDPIP2(pos))
|
|
||||||
res.push_back(s.str());
|
|
||||||
return res;
|
|
||||||
},
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setDestinationUDPIP2",
|
|
||||||
[](Detector &d, std::string ip, Positions pos) {
|
|
||||||
d.setDestinationUDPIP2(sls::IpAddr(ip), pos);
|
|
||||||
},
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getDestinationUDPMAC",
|
|
||||||
[](const Detector &d, Positions pos) {
|
|
||||||
std::vector<std::string> res;
|
|
||||||
for (const auto &s : d.getDestinationUDPMAC(pos))
|
|
||||||
res.push_back(s.str());
|
|
||||||
return res;
|
|
||||||
},
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("setDestinationUDPMAC",
|
|
||||||
[](Detector &d, std::string mac, Positions pos) {
|
|
||||||
d.setDestinationUDPMAC(sls::MacAddr(mac), pos);
|
|
||||||
},
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getDestinationUDPMAC2",
|
|
||||||
[](const Detector &d, Positions pos) {
|
|
||||||
std::vector<std::string> res;
|
|
||||||
for (const auto &s : d.getDestinationUDPMAC2(pos))
|
|
||||||
res.push_back(s.str());
|
|
||||||
return res;
|
|
||||||
},
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("setDestinationUDPMAC2",
|
|
||||||
[](Detector &d, std::string mac, Positions pos) {
|
|
||||||
d.setDestinationUDPMAC2(sls::MacAddr(mac), pos);
|
|
||||||
},
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getDestinationUDPPort", &Detector::getDestinationUDPPort,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setDestinationUDPPort", &Detector::setDestinationUDPPort,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getDestinationUDPPort2", &Detector::getDestinationUDPPort2,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setDestinationUDPPort2", &Detector::setDestinationUDPPort2,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("printRxConfiguration", &Detector::printRxConfiguration,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getTenGiga", &Detector::getTenGiga, py::arg() = Positions{})
|
|
||||||
.def("setTenGiga", &Detector::setTenGiga, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getTenGigaFlowControl", &Detector::getTenGigaFlowControl,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setTenGigaFlowControl", &Detector::setTenGigaFlowControl,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getTransmissionDelayFrame", &Detector::getTransmissionDelayFrame,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setTransmissionDelayFrame", &Detector::setTransmissionDelayFrame,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getTransmissionDelayLeft", &Detector::getTransmissionDelayLeft,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setTransmissionDelayLeft", &Detector::setTransmissionDelayLeft,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getTransmissionDelayRight", &Detector::getTransmissionDelayRight,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setTransmissionDelayRight", &Detector::setTransmissionDelayRight,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
|
|
||||||
/**************************************************
|
|
||||||
* *
|
|
||||||
* RECEIVER CONFIG *
|
|
||||||
* *
|
|
||||||
* ************************************************/
|
|
||||||
|
|
||||||
.def("getUseReceiverFlag", &Detector::getUseReceiverFlag,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getRxHostname", &Detector::getRxHostname, py::arg() = Positions{})
|
|
||||||
.def("setRxHostname", &Detector::setRxHostname, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getRxPort", &Detector::getRxPort, py::arg() = Positions{})
|
|
||||||
.def("setRxPort", &Detector::setRxPort, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getRxFifoDepth", &Detector::getRxFifoDepth,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setRxFifoDepth", &Detector::setRxFifoDepth, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getRxSilentMode", &Detector::getRxSilentMode,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setRxSilentMode", &Detector::setRxSilentMode, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getRxFrameDiscardPolicy", &Detector::getRxFrameDiscardPolicy,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setRxFrameDiscardPolicy", &Detector::setRxFrameDiscardPolicy,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getPartialFramesPadding", &Detector::getPartialFramesPadding,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setPartialFramesPadding", &Detector::setPartialFramesPadding,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getRxUDPSocketBufferSize", &Detector::getRxUDPSocketBufferSize,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setRxUDPSocketBufferSize", &Detector::setRxUDPSocketBufferSize,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getRxRealUDPSocketBufferSize",
|
|
||||||
&Detector::getRxRealUDPSocketBufferSize, py::arg() = Positions{})
|
|
||||||
.def("getRxLock", &Detector::getRxLock, py::arg() = Positions{})
|
|
||||||
.def("setRxLock", &Detector::setRxLock, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getRxLastClientIP", &Detector::getRxLastClientIP,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
/**************************************************
|
|
||||||
* *
|
|
||||||
* FILE *
|
|
||||||
* *
|
|
||||||
* ************************************************/
|
|
||||||
.def("getFileFormat", &Detector::getFileFormat, py::arg() = Positions{})
|
|
||||||
.def("setFileFormat", &Detector::setFileFormat, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getFilePath", &Detector::getFilePath, py::arg() = Positions{})
|
|
||||||
.def("setFilePath", &Detector::setFilePath, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getFileNamePrefix", &Detector::getFileNamePrefix,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setFileNamePrefix", &Detector::setFileNamePrefix, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getFilePath", &Detector::getFilePath)
|
|
||||||
.def("setFilePath", &Detector::setFilePath, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getAcquisitionIndex", &Detector::getAcquisitionIndex,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setAcquisitionIndex", &Detector::setAcquisitionIndex, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setFileWrite", &Detector::setFileWrite, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getFileWrite", &Detector::getFileWrite, py::arg() = Positions{})
|
|
||||||
.def("setFileOverWrite", &Detector::setFileOverWrite, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getFileOverWrite", &Detector::getFileOverWrite,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setMasterFileWrite", &Detector::setMasterFileWrite, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getMasterFileWrite", &Detector::getMasterFileWrite,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setFramesPerFile", &Detector::setFramesPerFile, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getFramesPerFile", &Detector::getFramesPerFile,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
/**************************************************
|
|
||||||
* *
|
|
||||||
* ZMQ Streaming Parameters (Receiver<->Client)*
|
|
||||||
* *
|
|
||||||
* ************************************************/
|
|
||||||
|
|
||||||
.def("getRxZmqDataStream", &Detector::getRxZmqDataStream,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setRxZmqDataStream", &Detector::setRxZmqDataStream, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getRxZmqFrequency", &Detector::getRxZmqFrequency,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setRxZmqFrequency", &Detector::setRxZmqFrequency, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getRxZmqTimer", &Detector::getRxZmqTimer, py::arg() = Positions{})
|
|
||||||
.def("setRxZmqTimer", &Detector::setRxZmqTimer, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getRxZmqPort", &Detector::getRxZmqPort, py::arg() = Positions{})
|
|
||||||
.def("setRxZmqPort", &Detector::setRxZmqPort, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getRxZmqIP", &Detector::getRxZmqIP, py::arg() = Positions{})
|
|
||||||
.def("setRxZmqIP", &Detector::setRxZmqIP, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getClientZmqPort", &Detector::getClientZmqPort,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setClientZmqPort", &Detector::setClientZmqPort, py::arg(),
|
|
||||||
py::arg() = -1)
|
|
||||||
.def("getClientZmqIp", &Detector::getClientZmqIp,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setClientZmqIp", &Detector::setClientZmqIp, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
/**************************************************
|
|
||||||
* *
|
|
||||||
* Eiger Specific *
|
|
||||||
* *
|
|
||||||
* ************************************************/
|
|
||||||
|
|
||||||
.def("getDynamicRange", &Detector::getDynamicRange,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setDynamicRange", &Detector::setDynamicRange)
|
|
||||||
.def("getSubExptime", &Detector::getSubExptime, py::arg() = Positions{})
|
|
||||||
.def("setSubExptime", &Detector::setSubExptime, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getSubDeadTime", &Detector::getSubDeadTime,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setSubDeadTime", &Detector::setSubDeadTime, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getThresholdEnergy", &Detector::getThresholdEnergy,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setThresholdEnergy", &Detector::setThresholdEnergy, py::arg(),
|
|
||||||
py::arg() = defs::STANDARD, py::arg() = true,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getSettingsPath", &Detector::getSettingsPath,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setSettingsPath", &Detector::setSettingsPath, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("loadTrimbits", &Detector::loadTrimbits, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getRxAddGapPixels", &Detector::getRxAddGapPixels,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setRxAddGapPixels", &Detector::setRxAddGapPixels)
|
|
||||||
.def("getParallelMode", &Detector::getParallelMode,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setParallelMode", &Detector::setParallelMode, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getOverFlowMode", &Detector::getOverFlowMode,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setOverFlowMode", &Detector::setOverFlowMode, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getStoreInRamMode", &Detector::getStoreInRamMode,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setStoreInRamMode", &Detector::setStoreInRamMode, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getBottom", &Detector::getBottom, py::arg() = Positions{})
|
|
||||||
.def("setBottom", &Detector::setBottom, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getAllTrimbits", &Detector::getAllTrimbits,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setAllTrimbits", &Detector::setAllTrimbits, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getTrimEnergies", &Detector::getTrimEnergies,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setTrimEnergies", &Detector::setTrimEnergies, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getRateCorrection", &Detector::getRateCorrection,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setRateCorrection", &Detector::setRateCorrection, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setDefaultRateCorrection", &Detector::setDefaultRateCorrection,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getPartialReadout", &Detector::getPartialReadout,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setPartialReadout", &Detector::setPartialReadout, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getInterruptSubframe", &Detector::getInterruptSubframe,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setInterruptSubframe", &Detector::setInterruptSubframe, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getMeasuredPeriod", &Detector::getMeasuredPeriod,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getMeasuredSubFramePeriod", &Detector::getMeasuredSubFramePeriod,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getActive", &Detector::getActive, py::arg() = Positions{})
|
|
||||||
.def("setActive", &Detector::setActive, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getRxPadDeactivatedMode", &Detector::getRxPadDeactivatedMode,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setRxPadDeactivatedMode", &Detector::setRxPadDeactivatedMode,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getPartialReset", &Detector::getPartialReset,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setPartialReset", &Detector::setPartialReset, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("pulsePixel", &Detector::pulsePixel, py::arg(), py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("pulsePixelNMove", &Detector::pulsePixelNMove, py::arg(),
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("pulseChip", &Detector::pulseChip, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getQuad", &Detector::getQuad, py::arg() = Positions{})
|
|
||||||
.def("setQuad", &Detector::setQuad)
|
|
||||||
|
|
||||||
/**************************************************
|
|
||||||
* *
|
|
||||||
* Jungfrau Specific *
|
|
||||||
* *
|
|
||||||
* ************************************************/
|
|
||||||
.def("getThresholdTemperature", &Detector::getThresholdTemperature,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setThresholdTemperature", &Detector::setThresholdTemperature,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getTemperatureControl", &Detector::getTemperatureControl,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setTemperatureControl", &Detector::setTemperatureControl,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getTemperatureEvent", &Detector::getTemperatureEvent,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("resetTemperatureEvent", &Detector::resetTemperatureEvent,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getPowerChip", &Detector::getPowerChip, py::arg() = Positions{})
|
|
||||||
.def("setPowerChip", &Detector::setPowerChip, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getAutoCompDisable", &Detector::getAutoCompDisable,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setAutoCompDisable", &Detector::setAutoCompDisable, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getNumberOfAdditionalStorageCells",
|
|
||||||
&Detector::getNumberOfAdditionalStorageCells)
|
|
||||||
.def("setNumberOfAdditionalStorageCells",
|
|
||||||
&Detector::setNumberOfAdditionalStorageCells)
|
|
||||||
.def("getStorageCellStart", &Detector::getStorageCellStart,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setStoragecellStart", &Detector::setStoragecellStart, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("setStorageCellDelay", &Detector::setStorageCellDelay, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
// Bits and registers
|
|
||||||
.def("setBit", &Detector::setBit, py::arg(), py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("clearBit", &Detector::clearBit, py::arg(), py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("readRegister", &Detector::readRegister, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("writeRegister", &Detector::writeRegister, py::arg(), py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
.def("getStartingFrameNumber", &Detector::getStartingFrameNumber,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setStartingFrameNumber", &Detector::setStartingFrameNumber,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
|
|
||||||
/**************************************************
|
|
||||||
* *
|
|
||||||
* Insignificant *
|
|
||||||
* *
|
|
||||||
* ************************************************/
|
|
||||||
|
|
||||||
.def("getControlPort", &Detector::getControlPort,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setControlPort", &Detector::setControlPort, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getStopPort", &Detector::getStopPort, py::arg() = Positions{})
|
|
||||||
.def("setStopPort", &Detector::setStopPort, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getDetectorLock", &Detector::getDetectorLock,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setDetectorLock", &Detector::setDetectorLock, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getLastClientIP", &Detector::getLastClientIP,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("executeCommand", &Detector::executeCommand, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getNumberOfFramesFromStart",
|
|
||||||
&Detector::getNumberOfFramesFromStart, py::arg() = Positions{})
|
|
||||||
.def("getActualTime", &Detector::getActualTime, py::arg() = Positions{})
|
|
||||||
.def("getMeasurementTime", &Detector::getMeasurementTime,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getUserDetails", &Detector::getUserDetails)
|
|
||||||
.def("getRxCurrentFrameIndex", &Detector::getRxCurrentFrameIndex,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
|
|
||||||
/**************************************************
|
|
||||||
* *
|
|
||||||
* CTB Specific *
|
|
||||||
* *
|
|
||||||
* ************************************************/
|
|
||||||
.def("getNumberOfAnalogSamples", &Detector::getNumberOfAnalogSamples,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setNumberOfAnalogSamples", &Detector::setNumberOfAnalogSamples,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getNumberOfDigitalSamples", &Detector::getNumberOfDigitalSamples,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setNumberOfDigitalSamples", &Detector::setNumberOfDigitalSamples,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getReadoutMode", &Detector::getReadoutMode,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setReadoutMode", &Detector::setReadoutMode, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getDBITPhase", &Detector::getDBITPhase, py::arg() = Positions{})
|
|
||||||
.def("setDBITPhase", &Detector::setDBITPhase, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getMaxDBITPhaseShift", &Detector::getMaxDBITPhaseShift,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getDBITPhaseInDegrees", &Detector::getDBITPhaseInDegrees,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setDBITPhaseInDegrees", &Detector::setDBITPhaseInDegrees,
|
|
||||||
py::arg(), py::arg() = Positions{})
|
|
||||||
.def("getADCClock", &Detector::getADCClock, py::arg() = Positions{})
|
|
||||||
.def("setADCClock", &Detector::setADCClock, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getDBITClock", &Detector::getDBITClock, py::arg() = Positions{})
|
|
||||||
.def("setDBITClock", &Detector::setDBITClock, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getRUNClock", &Detector::getRUNClock, py::arg() = Positions{})
|
|
||||||
.def("setRUNClock", &Detector::setRUNClock, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getSYNCClock", &Detector::getSYNCClock, py::arg() = Positions{})
|
|
||||||
|
|
||||||
// Time
|
|
||||||
|
|
||||||
.def("setSubExptime", &Detector::setSubExptime, py::arg(),
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("getSubExptime", &Detector::getSubExptime,
|
|
||||||
py::arg() = Positions{});
|
|
||||||
}
|
|
@ -17,7 +17,9 @@ using ds = std::chrono::duration<double>;
|
|||||||
namespace py = pybind11;
|
namespace py = pybind11;
|
||||||
void init_enums(py::module &);
|
void init_enums(py::module &);
|
||||||
void init_experimental(py::module &);
|
void init_experimental(py::module &);
|
||||||
PYBIND11_MODULE(_sls_detector, m) {
|
void init_det(py::module &);
|
||||||
|
void init_network(py::module &);
|
||||||
|
PYBIND11_MODULE(_slsdet, m) {
|
||||||
m.doc() = R"pbdoc(
|
m.doc() = R"pbdoc(
|
||||||
C/C++ API
|
C/C++ API
|
||||||
-----------------------
|
-----------------------
|
||||||
@ -29,7 +31,9 @@ PYBIND11_MODULE(_sls_detector, m) {
|
|||||||
)pbdoc";
|
)pbdoc";
|
||||||
|
|
||||||
init_enums(m);
|
init_enums(m);
|
||||||
init_experimental(m);
|
init_det(m);
|
||||||
|
init_network(m);
|
||||||
|
// init_experimental(m);
|
||||||
|
|
||||||
|
|
||||||
py::module io = m.def_submodule("io", "Submodule for io");
|
py::module io = m.def_submodule("io", "Submodule for io");
|
||||||
|
41
python/src/network.cpp
Normal file
41
python/src/network.cpp
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
This file contains Python bindings for the IpAddr and MacAddr
|
||||||
|
classes.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <pybind11/chrono.h>
|
||||||
|
#include <pybind11/operators.h>
|
||||||
|
#include <pybind11/pybind11.h>
|
||||||
|
#include <pybind11/stl.h>
|
||||||
|
|
||||||
|
#include "network_utils.h"
|
||||||
|
namespace py = pybind11;
|
||||||
|
using sls::IpAddr;
|
||||||
|
using sls::MacAddr;
|
||||||
|
void init_network(py::module &m) {
|
||||||
|
|
||||||
|
py::class_ <IpAddr>(m, "IpAddr")
|
||||||
|
.def(py::init())
|
||||||
|
.def(py::init<const std::string&>())
|
||||||
|
.def(py::init<uint32_t>())
|
||||||
|
.def(py::init<const IpAddr&>())
|
||||||
|
.def("hex", &IpAddr::hex)
|
||||||
|
.def("uint32", &IpAddr::uint32)
|
||||||
|
.def(py::self == py::self)
|
||||||
|
.def("__repr__", &IpAddr::str)
|
||||||
|
.def("str", &IpAddr::str);
|
||||||
|
|
||||||
|
|
||||||
|
py::class_ <MacAddr>(m, "MacAddr")
|
||||||
|
.def(py::init())
|
||||||
|
.def(py::init<const std::string&>())
|
||||||
|
.def(py::init<uint64_t>())
|
||||||
|
.def(py::init<const MacAddr&>())
|
||||||
|
.def("hex", &MacAddr::hex)
|
||||||
|
.def(py::self == py::self)
|
||||||
|
.def("uint64", &MacAddr::uint64)
|
||||||
|
.def("__repr__", &MacAddr::str)
|
||||||
|
.def("str", &MacAddr::str);
|
||||||
|
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user