mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 13:57:13 +02:00
Compare commits
1009 Commits
jungfrau_d
...
con3
Author | SHA1 | Date | |
---|---|---|---|
c4c2866905 | |||
b90f9b046f | |||
d66df844e5 | |||
4f712fcd70 | |||
bb32b2f653 | |||
085cbbf0d6 | |||
45a770cf38 | |||
990008c9d9 | |||
5339e16101 | |||
c976c63fb5 | |||
9ee2d389fb | |||
8d0146949c | |||
6de68eacc2 | |||
94103a05b1 | |||
1185f1ea17 | |||
d3f420ffd4 | |||
6b5511c9e5 | |||
d8aa1ab08e | |||
b4c31327d6 | |||
c408f9807a | |||
c1ae67ac46 | |||
9df128fced | |||
e39ec65d19 | |||
601be462af | |||
68f76e5356 | |||
8afa11ed33 | |||
bc389f4825 | |||
095ced153c | |||
1d31695cc1 | |||
df63a6dffe | |||
cfa9049ed3 | |||
a1a5a20845 | |||
9a208caca8 | |||
78fb8080ce | |||
cd45f9d45b | |||
c725a05ef8 | |||
d536ad2b5b | |||
815b6a37aa | |||
655a410d43 | |||
97ba81d923 | |||
3d00eed0f0 | |||
2921cbfac8 | |||
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 | |||
f299a34e59 | |||
b1c93bb3df | |||
9e8a874e39 | |||
2c7b730987 | |||
4fe1a2c6df | |||
1322cff405 | |||
7f3d5e8a7e | |||
bf199767dc | |||
eaae54ebf5 | |||
6889741480 | |||
3030c262f1 | |||
6b391a34dc | |||
a2dd35ae38 | |||
e00c5068af | |||
c951b10b0f | |||
c5012a2d5a | |||
58050f72da | |||
eae1fb6609 | |||
5b5e0f109b | |||
f2e69fb5a3 | |||
adf6a4c471 | |||
94382c1ece | |||
28f1f6c1cd | |||
a95ab1e13e | |||
5e9d70948b | |||
b0073597f7 | |||
c4675da0c3 | |||
ba008db29a | |||
950096daf9 | |||
d07873ee39 | |||
f8df11886a | |||
d976c9fcf9 | |||
c4ae32b216 | |||
c689b8b954 | |||
fea94b15d5 | |||
955bc74a91 | |||
8727a93e3e | |||
83221ee955 | |||
398f3734ec | |||
f96f716f39 | |||
781e8fc67f | |||
66e9b80995 | |||
7bde337d58 | |||
1cea6af590 | |||
1539326fda | |||
dfc886a65b | |||
c4e7086d99 | |||
5ce79ec9fa | |||
dc78e23449 | |||
f2c0ff7f98 | |||
32cf46a8a3 | |||
fa2c842745 | |||
6a27207875 | |||
a62d6a2fb8 | |||
5518531620 | |||
fd631ebb71 | |||
21d23be522 | |||
28a5aa8342 | |||
5ee3f5cf4c | |||
72ac2745ea | |||
206041989f | |||
2fff9f5bfe | |||
90c34e4942 | |||
bb26b993ea | |||
d7ad995dd1 | |||
f53d260202 | |||
35556e96d1 | |||
2123fb47a5 | |||
38ad5d7931 | |||
aaeaeab576 | |||
03ec2c53ab | |||
d7e2ab8ec4 | |||
a92d931a8f | |||
615b3b2557 | |||
1797d39216 | |||
0f9fd5cd73 | |||
73b5c3ac57 | |||
18b8720c17 | |||
7de9401bc7 | |||
705ddb7f42 | |||
8eb04c33b5 | |||
cd5d327988 | |||
c3180737ed | |||
ba37a51858 | |||
2417f9cd7b | |||
b61ca18967 | |||
567e821569 | |||
1f64d2a4e2 | |||
96d64778ee | |||
2f2e4da628 | |||
b3587bcee5 | |||
40572b6b23 | |||
031241ae28 | |||
f9fff97f8a | |||
6c5c4f00b3 | |||
ba9a0c7917 | |||
ba3bc9c408 | |||
026771f42d | |||
d05be2519a | |||
11ea071543 | |||
4aba8b6ac0 | |||
82570bc084 | |||
fe467cdf70 | |||
925a750f9a | |||
eb2040f0a7 | |||
4b2cb7ecc1 | |||
badff47663 | |||
1084e5361b | |||
828859838b | |||
9b7ef84515 | |||
aa8610fb04 | |||
798f221764 | |||
4155e301b8 | |||
8c279695de | |||
bc7ebd45df | |||
3fdae431b0 | |||
7b59b7e7d5 | |||
19b85b8e40 | |||
61d7c76d55 | |||
93bb0c9aed | |||
f9d832bf34 | |||
8e771c48bd | |||
5a49182626 | |||
f4a0780b51 | |||
f73a15e786 | |||
fa84d17a19 | |||
12c7389b8d | |||
8006043a97 | |||
45012df95b | |||
8c6da7da1b | |||
f2fc187f13 | |||
fee110c73a | |||
995f0924e5 | |||
eebc1109b0 | |||
97d1c520e6 | |||
3822258dfa | |||
df4f37efc6 | |||
107234f4c5 | |||
59a7a462ab | |||
e16212bd23 | |||
be50344b45 | |||
0a3905802f | |||
833c07707f | |||
9b4fc02b0e | |||
b109ea8d7d | |||
29a7e227a3 | |||
cfd3680176 | |||
87aa5099f2 | |||
030cfacc9b | |||
b318f8126d | |||
17295bf662 | |||
58cadefa61 | |||
e0d10d0e01 | |||
6964326c7f | |||
6cda61a612 | |||
7a66dd08a3 | |||
5f94b5c246 | |||
16f7b42533 | |||
1b06edac9b | |||
d597636c1e | |||
0f99dd141e | |||
da630a8e05 | |||
cfb017f66a | |||
b3ff825ce8 | |||
c6fd13e49c | |||
e6472da5f1 | |||
5de5884341 | |||
b4f3c0586f | |||
aaade64e0b | |||
ffa9bbe8d2 | |||
3c6d7ca4a5 | |||
7242a6901a | |||
2a40c7f48e | |||
ca054626e6 | |||
6e6fcec698 | |||
3d52a2f169 | |||
8a4a6c7004 | |||
288b59d292 | |||
296518819e | |||
2a48f70320 | |||
07f71d3886 | |||
dde24559f3 | |||
b591a42ae7 | |||
032b4117dd | |||
af9c67539f | |||
27d223d199 | |||
26bc737445 | |||
61c495f218 | |||
c3c3f78c59 | |||
400e69cef2 | |||
1cf5033c99 | |||
21ce0055b2 | |||
4b987abf41 | |||
40b62ef5a4 | |||
5bcde789ac | |||
221bb65c0e | |||
02634abbbc | |||
bd95126da2 | |||
4a112104ad | |||
9bc6c44e51 | |||
8c15b52b87 | |||
9e7a133422 | |||
cb8c7eea54 | |||
0d35b966ff | |||
49d47e633d | |||
e23b3b0471 | |||
4f0634fe62 | |||
1980a7d80c | |||
014b8cf9a6 | |||
f123a280bb | |||
7abb18e5c8 | |||
fc0b25cfa7 | |||
aafe049a9b | |||
7a4c1161ab | |||
94013a7fad | |||
aecf3bb7db | |||
3497175b15 | |||
298e1dd1fe | |||
f981825172 | |||
3b2feba3b2 | |||
386b6601a8 | |||
9a48d9b832 | |||
2c5ff0e9bf | |||
e89b65002a | |||
5866e330c1 | |||
5c06549982 | |||
975a5a4cab | |||
57ac5c0dab | |||
6a20a780fe | |||
7afe0c510e | |||
8ec0ac4eb3 | |||
322970ebed | |||
9e40c06786 | |||
caedfbebd5 | |||
3ca52176b7 | |||
867bce8b38 | |||
170db19f48 | |||
4b7ab98135 | |||
72362b0334 | |||
794b6f8090 | |||
7fd5d7c610 | |||
199ecbce80 | |||
d4a2af1693 | |||
e247605b76 | |||
0735f890a3 | |||
3d78b7b6a7 | |||
1b5e939748 | |||
2ef9aa0ea0 | |||
cadb4cff93 | |||
e04242c5fa | |||
434aa78a04 | |||
cf045d8a1d | |||
a98271f0c2 | |||
5c393e6204 | |||
5eaea5fb8d | |||
f0ba8a06ce | |||
4b0fb5029f | |||
b4c207fc4e | |||
f77b6ab068 | |||
0daada9266 | |||
422a928be4 | |||
156ce0df00 | |||
62c4bfab64 | |||
28963e313b | |||
11c1fb0e11 | |||
9ebff9c8a8 | |||
ad907a43be | |||
ea5ac6ad03 | |||
d1ea74120d | |||
0c4ae89cd9 | |||
38b7e23ac4 | |||
08ac9b4ce8 | |||
51a3f3fd4d | |||
29c788b9f7 | |||
0f37481972 | |||
0d787788ea | |||
498a8bda9f | |||
3e874a3650 | |||
3881e2cd21 | |||
ee4aa94bbe | |||
d2e8c3bebc | |||
0d2598bd77 | |||
eebd1552f2 | |||
26958e99ef | |||
7457c56533 | |||
d10d9462a3 | |||
c6dddaba97 | |||
a0bdfcdae3 | |||
d3e60eba80 | |||
10ce82fc5f | |||
b59d69325e | |||
336f8ceb50 | |||
947252c852 | |||
e635ff035c | |||
8dae9243a5 | |||
ce14435c68 | |||
ba0c6ff286 | |||
d14fdc3a3f | |||
3a698cc306 | |||
e225275520 | |||
8e2b89d488 | |||
5f0a3eaee4 | |||
a23a3f4467 | |||
7f5640dd4e | |||
d191cee548 | |||
97192c5342 | |||
f7893f7f79 | |||
d4d8cbe9bc | |||
7b1cb517c0 | |||
17e3aea374 | |||
e3dedcd450 | |||
846d270243 | |||
2fe06c7163 | |||
6f6ee19906 | |||
c2f57f5ab0 | |||
160ce17a91 | |||
9686f78300 | |||
25eccdffab | |||
f99ebc7f21 | |||
935f7bc960 | |||
b52a8d2d61 | |||
4bff894782 | |||
1008944a6a | |||
99dc9bd44d | |||
0a34192a8d | |||
09684518c5 | |||
8e2494729b | |||
d9be3250ad | |||
95751766cd | |||
c36dfc3992 | |||
f78a98797f | |||
151c3ee062 | |||
f982a59a7c | |||
100d748154 | |||
b2d39d4785 | |||
c350b53b7f | |||
6a89e3e1a5 | |||
cac353748e | |||
4a97dd0eba | |||
dea402a7e7 | |||
206740efd6 | |||
56703c4886 | |||
1bd1d0d64d | |||
6b363a16fe | |||
6691680091 | |||
2ac421365d | |||
9913194774 | |||
a084ea2d0f | |||
2f61764fd7 | |||
31d2250cba | |||
1a60b59a48 | |||
e7af4d7518 | |||
a3c5c16417 | |||
8c40c02fc5 | |||
bdfdd5dbda | |||
1f549d51fa | |||
fc78bb9384 | |||
a6e8be2d67 | |||
5a483eaf29 | |||
dfbf7ab39a | |||
5292075a0a | |||
0bd6563e45 | |||
b0f34f2d4b | |||
6080e90bbb | |||
e76900ca9a | |||
cc0f1d9fcd | |||
dc24cfb9c3 | |||
869eee4d98 | |||
c34190f9f2 | |||
d1d730b779 | |||
b73b98ce3f | |||
ca2c284017 | |||
ce9f76d017 | |||
40bc498e9a | |||
eaf0d8668b | |||
dddd8eb849 | |||
a77964e1dd | |||
9d5cff3b34 | |||
23ea16f4b8 | |||
ca4618d8f4 | |||
ddfb66e999 | |||
7721787748 | |||
e6349d0312 | |||
373cfad645 | |||
d79447ed3a | |||
0b006b5080 | |||
6a780de22f | |||
d9ecec9bf7 | |||
8740e4f683 | |||
79d6ea614a | |||
f0e106f94f | |||
1bdff2b681 | |||
553b7d8568 | |||
e7e4bf13c3 | |||
095a7eac05 | |||
bba6e1667b | |||
21046bcae0 | |||
eec7b22582 | |||
e246a33269 | |||
0a2a5933da | |||
704a26af70 | |||
6a0c108e96 | |||
65ebd0baf0 | |||
dc1e01b444 | |||
6a71e61c12 | |||
615835f03d | |||
dd6a95d041 | |||
cff4d162c1 | |||
4ceee97c03 | |||
98ddf154b2 | |||
e20b5e6952 | |||
d72b6c3659 | |||
e17de0609c | |||
31a0161f42 | |||
63c2599328 | |||
facbc60907 | |||
64a8dd2def | |||
b524e0c95f | |||
a487aabb6e | |||
fb2c015c5c | |||
c8d9503d5f | |||
35aff6bf76 | |||
e3db7099f1 | |||
9cc1ff43a9 | |||
2c453fc1be | |||
b63ec9d84a | |||
025c67134a | |||
6e4e2c4524 | |||
e3f151851c | |||
61b40d89c7 | |||
fc80618a35 | |||
e7a76ccea1 | |||
0fa63f8be2 | |||
1a9755ad0b | |||
6b7d9445aa | |||
078a2e9e6a | |||
058e16b872 | |||
3ef8b392db | |||
8cdfe4194f | |||
d3879bb834 | |||
4f5b8c17b2 | |||
0f2641f9fa | |||
5e24591295 | |||
40c3c78024 | |||
cc769c5a96 | |||
d344365470 | |||
74bb7a3f1b | |||
4b10991429 | |||
0e0e5db7c5 | |||
8ac7d96ef3 | |||
c582ba15d5 | |||
6a60f7d222 | |||
659e19a856 | |||
4c23c0290d | |||
d2e4adf483 | |||
0954bdd2d3 | |||
f4fa19b559 | |||
864db79a13 | |||
455252f2f3 | |||
5e6eb45f56 | |||
975076043f | |||
00eaad3416 | |||
cbe979b4b9 | |||
44aa3f655b | |||
fc2cc7e00c | |||
547ab8a749 | |||
e16b857ba2 | |||
e22d03a744 | |||
a373609b08 | |||
039a725c5c | |||
9f61104f0d | |||
06834617de | |||
61b937e2e0 | |||
3bb0daeefb | |||
d3101baacb | |||
bd3e439d87 | |||
136e00d15e | |||
7c18ad3c53 | |||
3db09bc0cd | |||
33f5253831 | |||
c466623e86 | |||
e80ce1b4c4 | |||
2d3f5a03ca | |||
4b69c01357 | |||
f4bc255f2c | |||
d2280b4414 | |||
6c33f7de7b | |||
332e83d43c | |||
3f4dda9d33 | |||
e4190285be | |||
71f26b2831 | |||
7b456cb9c6 | |||
0acf97cc9a | |||
17b08b6e53 | |||
976b460e70 | |||
b6bba0b7bc | |||
5b8e4f6c72 | |||
6e14a2efe2 | |||
f5b419c6d8 | |||
8c332e8ffd | |||
326b14737f | |||
c96939cf94 | |||
8dff4f4b03 | |||
39be0770e3 | |||
4213a161fe | |||
c1435ea94f | |||
ca9fca88c4 | |||
359970dfc2 | |||
5d2567005d | |||
e6361c73fc | |||
55229f77a3 | |||
afb6d6bf3a | |||
b922b79232 | |||
3c1df02414 | |||
d3467432a9 | |||
cb2c39c62f | |||
111c48e3fa | |||
d2d25cdd69 | |||
1bab010d0b | |||
f0872174cf | |||
1fed3553b9 | |||
ca5a0b4cc8 | |||
48dd0fb084 | |||
893805e6fd | |||
170aca0e1f | |||
0c6304bdf8 | |||
2eaf7edd46 | |||
c86a1e7d48 | |||
bb760f3210 | |||
fc5306f7cc | |||
3cfeb74529 | |||
5944957977 | |||
7a11c6c986 | |||
2c7d78ff56 | |||
c4ea181811 | |||
45dc48721e | |||
72e0d7e168 | |||
e4546c6121 | |||
e46f3f9a2c | |||
6c64bdb04a | |||
03f8b389ad | |||
3d6404952a | |||
b5e4d7d8fb | |||
8cf94537c8 | |||
1db7521cfa | |||
862dc824ba | |||
ff3e5001e6 | |||
a6144f658e | |||
ffbc0a0fc3 | |||
3aea917175 | |||
b74ce95b24 | |||
d076be8887 | |||
1a2e252665 | |||
70ea143dcb | |||
7a9745e2da | |||
e8296da064 | |||
b7d81b1e87 | |||
3baa4b8ab1 | |||
17f745b45d | |||
e7c164fb24 | |||
29141ac1a6 | |||
894cc1c9e0 | |||
073d06f143 | |||
4b1a9bea32 | |||
0eec57f8a2 | |||
4a112d7889 | |||
c90a7b0e8a | |||
25541b37f6 | |||
d935e78763 | |||
0f869e1215 | |||
788ad8d3b6 | |||
a008c2b2c8 | |||
85d4dfc7c8 | |||
aa2bcfa308 | |||
7a9dbd8b76 | |||
daa82b91a9 | |||
8f4009bfb6 | |||
e64f57ecac | |||
57170b1c80 | |||
6a81e779c1 | |||
e4367c9ab1 | |||
8ebc0f2644 | |||
0972b803dd | |||
a11fc31c49 | |||
415567006f | |||
e6ad80e187 | |||
c30c6bb883 | |||
615d1b1f33 | |||
1db1b0307c | |||
0d98bd0048 | |||
54983c5fd0 | |||
9a8773d9a5 | |||
c6651df1b2 | |||
e252b8e0e9 | |||
40c2d9f760 | |||
c632badb55 | |||
8f8d565e4e | |||
f64facee0c | |||
9d5848d0d6 | |||
c30485a65b |
@ -16,7 +16,9 @@ Checks: '*,
|
||||
-hicpp-braces-around-statements,
|
||||
-google-runtime-references,
|
||||
-google-readability-todo,
|
||||
-google-readability-braces-around-statements'
|
||||
-google-readability-braces-around-statements,
|
||||
-modernize-use-trailing-return-type,
|
||||
-readability-isolate-declaration'
|
||||
|
||||
HeaderFilterRegex: \.h
|
||||
AnalyzeTemporaryDtors: false
|
||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -7,12 +7,16 @@ bin/
|
||||
*.out
|
||||
*.toc
|
||||
*.o
|
||||
*.so
|
||||
.*
|
||||
build
|
||||
docs/
|
||||
RELEASE.txt
|
||||
Testing/
|
||||
|
||||
ctbDict.cpp
|
||||
ctbDict.h
|
||||
|
||||
|
||||
|
||||
*.pyc
|
||||
*/__pycache__/*
|
||||
|
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -1,3 +1,3 @@
|
||||
[submodule "python/pybind11"]
|
||||
path = python/pybind11
|
||||
path = libs/pybind11
|
||||
url = https://github.com/pybind/pybind11.git
|
||||
|
28
.travis.yml
28
.travis.yml
@ -4,38 +4,25 @@ language: cpp
|
||||
|
||||
os: linux
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- CONDA_PY=3.6
|
||||
- CONDA_PY=3.7
|
||||
|
||||
|
||||
dist: trusty
|
||||
dist: bionic
|
||||
|
||||
install:
|
||||
- sudo apt-get update
|
||||
- ldd --version
|
||||
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
|
||||
- bash miniconda.sh -b -p $HOME/miniconda
|
||||
- export PATH="$HOME/miniconda/bin:$PATH"
|
||||
- source "$HOME/miniconda/etc/profile.d/conda.sh"
|
||||
- rm -f miniconda.sh
|
||||
- hash -r
|
||||
- conda config --set always_yes yes --set changeps1 no
|
||||
- conda config --add channels conda-forge
|
||||
- conda config --add channels slsdetectorgroup
|
||||
- conda update conda
|
||||
- conda update --all
|
||||
- conda install conda-build=3.17
|
||||
- conda install anaconda-client
|
||||
- conda install conda-verify
|
||||
|
||||
# Useful for debugging any issues with conda
|
||||
- conda update -q conda
|
||||
- conda info -a
|
||||
|
||||
|
||||
# Replace dep1 dep2 ... with your dependencies
|
||||
- conda create -q -n test-environment python=$CONDA_PY
|
||||
- source activate test-environment
|
||||
# Useful for debugging any issues with conda
|
||||
- conda create -q -n testenv conda-build anaconda-client conda-verify
|
||||
- conda activate testenv
|
||||
- conda-build .
|
||||
|
||||
script:
|
||||
@ -44,7 +31,8 @@ script:
|
||||
|
||||
deploy:
|
||||
provider: script
|
||||
script: find $HOME/miniconda/conda-bld/${TRAVIS_OS_NAME}-64 -name "*.tar.bz2" -exec anaconda -t $CONDA_TOKEN upload --force {} \;
|
||||
script: find $HOME/miniconda/envs/testenv/conda-bld/${TRAVIS_OS_NAME}-64 -name "*.tar.bz2" -exec anaconda -t $CONDA_TOKEN upload --force {} \;
|
||||
on:
|
||||
branch: developer
|
||||
tags: true
|
||||
|
||||
|
@ -1,9 +1,11 @@
|
||||
cmake_minimum_required(VERSION 3.9)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
project(slsDetectorPackage)
|
||||
|
||||
set(PROJECT_VERSION 5.0.0)
|
||||
include(cmake/project_version.cmake)
|
||||
include(CheckIPOSupported)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
||||
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
include(cmake/project_version.cmake)
|
||||
|
||||
# Include additional modules that are used unconditionally
|
||||
include(GNUInstallDirs)
|
||||
@ -34,10 +36,27 @@ option (SLS_USE_HDF5 "HDF5 File format" OFF)
|
||||
option (SLS_USE_TEXTCLIENT "Text Client" ON)
|
||||
option (SLS_USE_RECEIVER "Receiver" ON)
|
||||
option (SLS_USE_GUI "GUI" OFF)
|
||||
option (SLS_USE_SIMULATOR "Simulator" OFF)
|
||||
option (SLS_USE_TESTS "TESTS" OFF)
|
||||
option (SLS_USE_INTEGRATION_TESTS "Integration Tests" OFF)
|
||||
option(SLS_USE_SANITIZER "Sanitizers for debugging" OFF)
|
||||
option(SLS_USE_PYTHON "Python bindings" OFF)
|
||||
option(SLS_USE_CTBGUI "ctb GUI" OFF)
|
||||
option(SLS_BUILD_DOCS "docs" OFF)
|
||||
option(SLS_BUILD_EXAMPLES "examples" OFF)
|
||||
option(SLS_TUNE_LOCAL "tune to local machine" OFF)
|
||||
|
||||
# Use ld.gold if it is available and isn't disabled explicitly
|
||||
option(SLS_USE_LD_GOLD "Use GNU gold linker" ON)
|
||||
if (SLS_USE_LD_GOLD)
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||
if ("${LD_VERSION}" MATCHES "GNU gold")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
|
||||
else ()
|
||||
message(WARNING "GNU gold linker isn't available, using the default system linker.")
|
||||
endif ()
|
||||
endif ()
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
@ -62,6 +81,7 @@ target_compile_options(slsProjectWarnings INTERFACE
|
||||
-Wredundant-decls
|
||||
# -Wconversion
|
||||
-Wdouble-promotion
|
||||
-Werror=return-type
|
||||
|
||||
)
|
||||
|
||||
@ -87,24 +107,36 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
-Wno-misleading-indentation # mostly in rapidjson remove using clang format
|
||||
-Wduplicated-cond
|
||||
-Wnull-dereference )
|
||||
|
||||
endif()
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
|
||||
target_compile_options(slsProjectWarnings INTERFACE
|
||||
-Wno-class-memaccess )
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
if(SLS_USE_SANITIZER)
|
||||
target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined)
|
||||
target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined -fno-omit-frame-pointer)
|
||||
target_link_libraries(slsProjectOptions INTERFACE -fsanitize=address,undefined)
|
||||
# target_compile_options(slsProjectOptions INTERFACE -fsanitize=thread)
|
||||
# target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread)
|
||||
endif()
|
||||
|
||||
if(SLS_TUNE_LOCAL)
|
||||
target_compile_options(slsProjectOptions INTERFACE -mtune=native -march=native)
|
||||
endif()
|
||||
|
||||
|
||||
#rapidjson
|
||||
add_library(rapidjson INTERFACE)
|
||||
target_include_directories(rapidjson INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libs/rapidjson>
|
||||
)
|
||||
|
||||
# Install fake the libraries
|
||||
install(TARGETS slsProjectOptions slsProjectWarnings
|
||||
install(TARGETS slsProjectOptions slsProjectWarnings rapidjson
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
@ -112,10 +144,12 @@ install(TARGETS slsProjectOptions slsProjectWarnings
|
||||
)
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
set(CMAKE_INSTALL_RPATH "$ORIGIN")
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
set(CMAKE_INSTALL_RPATH $ORIGIN)
|
||||
# set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
|
||||
|
||||
|
||||
find_package(Doxygen)
|
||||
find_package(ZeroMQ 4 REQUIRED)
|
||||
|
||||
if (SLS_USE_TESTS)
|
||||
@ -123,6 +157,9 @@ if (SLS_USE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif(SLS_USE_TESTS)
|
||||
|
||||
|
||||
|
||||
|
||||
# Common functionallity to detector and receiver
|
||||
add_subdirectory(slsSupportLib)
|
||||
|
||||
@ -130,54 +167,55 @@ if (SLS_USE_TEXTCLIENT)
|
||||
add_subdirectory(slsDetectorSoftware)
|
||||
endif (SLS_USE_TEXTCLIENT)
|
||||
|
||||
|
||||
if (SLS_USE_RECEIVER)
|
||||
if (SLS_USE_HDF5)
|
||||
find_package(HDF5 1.10 COMPONENTS CXX REQUIRED)
|
||||
endif (SLS_USE_HDF5)
|
||||
add_subdirectory(slsReceiverSoftware)
|
||||
add_subdirectory(manual/manual-api)
|
||||
endif (SLS_USE_RECEIVER)
|
||||
|
||||
if (SLS_USE_GUI)
|
||||
find_package(Qt4 REQUIRED)
|
||||
find_package(Qwt 6 REQUIRED)
|
||||
find_package(Qwt 6.1 REQUIRED)
|
||||
if (QT4_FOUND AND QWT_FOUND)
|
||||
add_subdirectory(slsDetectorGui)
|
||||
endif()
|
||||
endif (SLS_USE_GUI)
|
||||
|
||||
if (SLS_USE_SIMULATOR)
|
||||
add_subdirectory(slsDetectorServers)
|
||||
endif (SLS_USE_SIMULATOR)
|
||||
|
||||
if (SLS_USE_INTEGRATION_TESTS)
|
||||
add_subdirectory(integrationTests)
|
||||
endif (SLS_USE_INTEGRATION_TESTS)
|
||||
|
||||
if (SLS_USE_PYTHON)
|
||||
set(PYBIND11_CPP_STANDARD -std=c++11)
|
||||
add_subdirectory(libs/pybind11)
|
||||
add_subdirectory(python)
|
||||
endif(SLS_USE_PYTHON)
|
||||
|
||||
if (SLS_USE_CTBGUI)
|
||||
add_subdirectory(ctbGui)
|
||||
endif(SLS_USE_CTBGUI)
|
||||
|
||||
configure_file( .clang-tidy
|
||||
${CMAKE_BINARY_DIR}/.clang-tidy
|
||||
)
|
||||
|
||||
if (SLS_BUILD_EXAMPLES)
|
||||
add_subdirectory(sample)
|
||||
endif(SLS_BUILD_EXAMPLES)
|
||||
|
||||
if (DOXYGEN_FOUND)
|
||||
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/doxygen/Doxyfile.in)
|
||||
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
||||
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
|
||||
|
||||
# note the option ALL which allows to build the docs together with the application
|
||||
add_custom_target( docs
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating API documentation with Doxygen"
|
||||
VERBATIM )
|
||||
else (DOXYGEN_FOUND)
|
||||
message("Doxygen need to be installed to generate the doxygen documentation")
|
||||
endif (DOXYGEN_FOUND)
|
||||
|
||||
if(SLS_BUILD_DOCS)
|
||||
add_subdirectory(docs)
|
||||
endif(SLS_BUILD_DOCS)
|
||||
|
||||
if(SLS_MASTER_PROJECT)
|
||||
# Set install dir CMake packages
|
||||
set(CMAKE_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/cmake/sls)
|
||||
set(CMAKE_INSTALL_DIR "share/cmake/${PROJECT_NAME}")
|
||||
# Set the list of exported targets
|
||||
set(PROJECT_LIBRARIES slsSupportLib slsDetectorShared slsReceiverShared)
|
||||
# Generate and install package config file and version
|
||||
|
111
README.md
111
README.md
@ -2,90 +2,67 @@
|
||||
Detailed documentation can be found on the [official site.](https://www.psi.ch/detectors/users-support)
|
||||
|
||||
### Binaries
|
||||
Documentation to obtain the binaries via the conda package is available for [lib](https://github.com/slsdetectorgroup/sls_detector_lib) and [gui](https://github.com/slsdetectorgroup/sls_detector_gui)
|
||||
Binaries for the slsDetectorPackage are available through conda.
|
||||
```
|
||||
#Add conda channels
|
||||
conda config --add channels conda-forge
|
||||
conda config --add channels slsdetectorgroup
|
||||
|
||||
conda install slsdetlib #only shared lib and command line
|
||||
conda install slsdet #python bindings (includes slsdetlib)
|
||||
conda install slsdetgui #gui (includes qt4)
|
||||
|
||||
#Install specific version
|
||||
conda install slsdet=2020.03.02.dev0 #developer version from 3 March 2020
|
||||
|
||||
```
|
||||
|
||||
### Source code
|
||||
One can also obtain the source code from this repository and compile while realizing the setup dependencies as required.
|
||||
One can also obtain the source code from this repository and compile.
|
||||
```
|
||||
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git
|
||||
|
||||
```
|
||||
#### Setup dependencies
|
||||
* Gui Client <br>
|
||||
Requirements: Qt 4.8 and Qwt 6.0
|
||||
```
|
||||
export QTDIR=/usr/local/Trolltech/
|
||||
export QWTDIR=/usr/local/qwt-6.0.1/
|
||||
```
|
||||
If either of them does not exist, the GUI client will not be built.
|
||||
#### Dependencies
|
||||
* Lib: c++11 compiler (gcc=>4.8), ZeroMQ 4
|
||||
* Gui: Qt 4.8 and Qwt 6.0
|
||||
* Calibration wizards and ctbGUI: ROOT
|
||||
* Optional: HDF5
|
||||
|
||||
* Advanced user Calibration wizards<br>
|
||||
Requirements: ROOT
|
||||
```
|
||||
export ROOTSYS=/usr/local/root-5.34
|
||||
```
|
||||
|
||||
#### Compilation
|
||||
|
||||
Compiling can be done in two ways.
|
||||
Compiling can be done in two ways. Either with the convenience script
|
||||
cmk.sh or directly with cmake for more control.
|
||||
|
||||
**1. Compile using script cmk.sh**<br>
|
||||
|
||||
After compiling, the libraries and executables will be found in `slsDetectorPackage/build/bin` directory<br>
|
||||
|
||||
Usage: [-c] [-b] [-h] [-d HDF5 directory] [-j]<br>
|
||||
* -[no option]: only make<br>
|
||||
* -c: Clean<br>
|
||||
* -b: Builds/Rebuilds CMake files normal mode<br>
|
||||
* -h: Builds/Rebuilds Cmake files with HDF5 package<br>
|
||||
* -d: HDF5 Custom Directory<br>
|
||||
* -t: Build/Rebuilds only text client<br>
|
||||
* -r: Build/Rebuilds only receiver<br>
|
||||
* -g: Build/Rebuilds only gui<br>
|
||||
* -j: Number of threads to compile through<br>
|
||||
* -e: Debug mode
|
||||
|
||||
Basic Option:
|
||||
./cmk.sh -b
|
||||
|
||||
For only make:
|
||||
./cmk.sh
|
||||
|
||||
For make clean;make:
|
||||
./cmk.sh -c
|
||||
|
||||
For using hdf5 without custom dir /blabla:
|
||||
./cmk.sh -h -d /blabla
|
||||
|
||||
For rebuilding cmake without hdf5
|
||||
./cmk.sh -b
|
||||
|
||||
For using multiple cores to compile faster:
|
||||
./cmk.sh -j9<br>
|
||||
|
||||
|
||||
For rebuilding only certain sections<br>
|
||||
./cmk.sh -tg #only text client and gui<br>
|
||||
./cmk.sh -r #only receiver<br>
|
||||
Usage: [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [-h] [-d <HDF5 directory>] [-j] <Number of threads>
|
||||
-[no option]: only make
|
||||
-c: Clean
|
||||
-b: Builds/Rebuilds CMake files normal mode
|
||||
-p: Builds/Rebuilds Python API
|
||||
-h: Builds/Rebuilds Cmake files with HDF5 package
|
||||
-d: HDF5 Custom Directory
|
||||
-t: Build/Rebuilds only text client
|
||||
-r: Build/Rebuilds only receiver
|
||||
-g: Build/Rebuilds only gui
|
||||
-s: Simulator
|
||||
-u: Chip Test Gui
|
||||
-j: Number of threads to compile through
|
||||
-e: Debug mode
|
||||
-i: Builds tests
|
||||
|
||||
eg. Rebuild when you switch to a new build and compile in parallel:
|
||||
./cmk.sh -bj5
|
||||
|
||||
**2. Compile without script**<br>
|
||||
Use cmake to create out-of-source builds, by creating a build folder parallel to source directory.
|
||||
Use cmake to create out-of-source builds, by creating a build folder parallel to source directory. This would create a debug build with address sanitizers.
|
||||
```
|
||||
$ cd ..
|
||||
$ mkdir slsDetectorPackage-build
|
||||
$ cd slsDetectorPackage-build
|
||||
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=OFF
|
||||
$ make
|
||||
```
|
||||
|
||||
Use the following as an example to compile statically and using specific hdf5 folder
|
||||
```
|
||||
$ HDF5_ROOT=/opt/hdf5v1.10.0 cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=ON
|
||||
```
|
||||
After compiling, the libraries and executables will be found at `bin` directory
|
||||
```
|
||||
$ ls bin/
|
||||
gui_client libSlsDetector.a libSlsDetector.so libSlsReceiver.a libSlsReceiver.so
|
||||
sls_detector_acquire sls_detector_get slsDetectorGui sls_detector_help sls_detector_put slsReceiver slsMultiReceiver
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON
|
||||
$ make -j12 #or whatever number of threads wanted
|
||||
```
|
||||
|
@ -0,0 +1,2 @@
|
||||
Draft
|
||||
- dr 4, 8, 16 in eiger -> speed 0, 32 stays same (speed 1)
|
||||
|
11
cmake/FindSphinx.cmake
Normal file
11
cmake/FindSphinx.cmake
Normal file
@ -0,0 +1,11 @@
|
||||
#Look for an executable called sphinx-build
|
||||
find_program(SPHINX_EXECUTABLE
|
||||
NAMES sphinx-build
|
||||
DOC "Path to sphinx-build executable")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
#Handle standard arguments to find_package like REQUIRED and QUIET
|
||||
find_package_handle_standard_args(Sphinx
|
||||
"Failed to find sphinx-build executable"
|
||||
SPHINX_EXECUTABLE)
|
@ -15,17 +15,20 @@ configure_package_config_file(
|
||||
write_basic_package_version_file(
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
|
||||
install(FILES
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake"
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
|
||||
COMPONENT devel
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER})
|
||||
DESTINATION ${CMAKE_INSTALL_DIR}
|
||||
)
|
||||
|
||||
if (PROJECT_LIBRARIES OR PROJECT_STATIC_LIBRARIES)
|
||||
install(
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
FILE ${PROJECT_NAME_LOWER}-targets.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER})
|
||||
DESTINATION ${CMAKE_INSTALL_DIR}
|
||||
)
|
||||
endif ()
|
||||
|
74
cmk.sh
74
cmk.sh
@ -8,6 +8,10 @@ RECEIVER=0
|
||||
GUI=0
|
||||
DEBUG=0
|
||||
PYTHON=0
|
||||
TESTS=0
|
||||
SIMULATOR=0
|
||||
CTBGUI=0
|
||||
MANUALS=0
|
||||
|
||||
|
||||
CLEAN=0
|
||||
@ -16,7 +20,7 @@ CMAKE_PRE=""
|
||||
CMAKE_POST=""
|
||||
|
||||
usage() { echo -e "
|
||||
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [-h] [-d <HDF5 directory>] [-j] <Number of threads>
|
||||
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [-h] [-d <HDF5 directory>] [-j] <Number of threads>
|
||||
-[no option]: only make
|
||||
-c: Clean
|
||||
-b: Builds/Rebuilds CMake files normal mode
|
||||
@ -26,8 +30,12 @@ Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [-h] [-d <HDF5 directory>] [-j] <Number
|
||||
-t: Build/Rebuilds only text client
|
||||
-r: Build/Rebuilds only receiver
|
||||
-g: Build/Rebuilds only gui
|
||||
-s: Simulator
|
||||
-u: Chip Test Gui
|
||||
-j: Number of threads to compile through
|
||||
-e: Debug mode
|
||||
-i: Builds tests
|
||||
-m: Manuals
|
||||
|
||||
Rebuild when you switch to a new build and compile in parallel:
|
||||
./cmk.sh -bj5
|
||||
@ -63,7 +71,7 @@ For rebuilding only certain sections
|
||||
|
||||
" ; exit 1; }
|
||||
|
||||
while getopts ":bpchd:j:trges:" opt ; do
|
||||
while getopts ":bpchd:j:trgeisum" opt ; do
|
||||
case $opt in
|
||||
b)
|
||||
echo "Building of CMake files Required"
|
||||
@ -110,16 +118,32 @@ while getopts ":bpchd:j:trges:" opt ; do
|
||||
echo "Compiling Options: Debug"
|
||||
DEBUG=1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG"
|
||||
i)
|
||||
echo "Compiling Options: Tests"
|
||||
TESTS=1
|
||||
;;
|
||||
s)
|
||||
echo "Compiling Options: Simulator"
|
||||
SIMULATOR=1
|
||||
;;
|
||||
m)
|
||||
echo "Compiling Manuals"
|
||||
MANUALS=1
|
||||
;;
|
||||
u)
|
||||
echo "Compiling Options: Chip Test Gui"
|
||||
CTBGUI=1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
:)
|
||||
echo "Option -$OPTARG requires an argument."
|
||||
exit 1
|
||||
;;
|
||||
:)
|
||||
echo "Option -$OPTARG requires an argument."
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@ -137,7 +161,7 @@ if [ $TEXTCLIENT -eq 0 ] && [ $RECEIVER -eq 0 ] && [ $GUI -eq 0 ]; then
|
||||
echo "Enabling Compile Option: TextClient, Receiver and GUI"
|
||||
else
|
||||
if [ $TEXTCLIENT -eq 1 ]; then
|
||||
CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON "
|
||||
CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON -DSLS_USE_RECEIVER=OFF "
|
||||
echo "Enabling Compile Option: TextClient"
|
||||
fi
|
||||
if [ $RECEIVER -eq 1 ]; then
|
||||
@ -169,10 +193,35 @@ fi
|
||||
|
||||
#Debug
|
||||
if [ $DEBUG -eq 1 ]; then
|
||||
# CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
|
||||
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON "
|
||||
echo "Debug Option enabled"
|
||||
fi
|
||||
|
||||
#Simulator
|
||||
if [ $SIMULATOR -eq 1 ]; then
|
||||
CMAKE_POST+=" -DSLS_USE_SIMULATOR=ON "
|
||||
echo "Simulator Option enabled"
|
||||
fi
|
||||
|
||||
#Manuals
|
||||
if [ $MANUALS -eq 1 ]; then
|
||||
CMAKE_POST+=" -DSLS_BUILD_DOCS=ON "
|
||||
echo "Manuals Option enabled"
|
||||
fi
|
||||
|
||||
#Chip Test Gui
|
||||
if [ $CTBGUI -eq 1 ]; then
|
||||
CMAKE_POST+=" -DSLS_USE_CTBGUI=ON "
|
||||
echo "CTB Gui Option enabled"
|
||||
fi
|
||||
|
||||
#Tests
|
||||
if [ $TESTS -eq 1 ]; then
|
||||
CMAKE_POST+=" -DSLS_USE_TESTS=ON -DSLS_USE_INTEGRATION_TESTS=ON"
|
||||
echo "Tests Option enabled"
|
||||
fi
|
||||
|
||||
|
||||
#hdf5 rebuild
|
||||
if [ $HDF5 -eq 1 ]; then
|
||||
@ -214,6 +263,9 @@ else
|
||||
make
|
||||
fi
|
||||
|
||||
if [ $MANUALS -eq 1 ]; then
|
||||
make docs
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
mkdir build
|
||||
mkdir install
|
||||
cd build
|
||||
@ -6,7 +7,7 @@ cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=install \
|
||||
-DSLS_USE_TEXTCLIENT=ON \
|
||||
-DSLS_USE_RECEIVER=ON \
|
||||
-DSLS_USE_GUI=OFF \
|
||||
-DSLS_USE_GUI=ON \
|
||||
-DSLS_USE_TESTS=ON \
|
||||
-DSLS_USE_PYTHON=OFF \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
|
@ -1,14 +1,4 @@
|
||||
|
||||
# mkdir $PREFIX/lib
|
||||
# mkdir $PREFIX/include
|
||||
|
||||
|
||||
# #Shared and static libraries
|
||||
# cp build/bin/_sls_detector* $PREFIX/lib/.
|
||||
|
||||
|
||||
# #Binaries
|
||||
# cp -r build/bin/sls_detector $PREFIX/lib/.
|
||||
|
||||
echo "|<-------- starting python build"
|
||||
cd python
|
||||
${PYTHON} setup.py install
|
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 @@
|
||||
|
||||
mkdir $PREFIX/lib
|
||||
#Copy the GUI
|
||||
mkdir $PREFIX/bin
|
||||
mkdir $PREFIX/include
|
||||
|
||||
#No libs for gui?
|
||||
|
||||
#Binaries
|
||||
cp build/bin/gui_client $PREFIX/bin/.
|
||||
cp build/bin/slsDetectorGui $PREFIX/bin/.
|
||||
|
||||
|
||||
#Which headers do we need for development??
|
||||
|
||||
# cp include/some_lib.h $PREFIX/include/.
|
@ -5,18 +5,20 @@ mkdir $PREFIX/include
|
||||
mkdir $PREFIX/include/slsDetectorPackage
|
||||
|
||||
#Shared and static libraries
|
||||
cp build/bin/libSlsDetector.so $PREFIX/lib/.
|
||||
cp build/bin/libSlsReceiver.so $PREFIX/lib/.
|
||||
cp build/bin/libSlsSupport.so $PREFIX/lib/.
|
||||
# cp build/bin/libSlsDetector.so $PREFIX/lib/.
|
||||
# cp build/bin/libSlsReceiver.so $PREFIX/lib/.
|
||||
# cp build/bin/libSlsSupport.so $PREFIX/lib/.
|
||||
|
||||
cp build/install/lib/* $PREFIX/lib/
|
||||
|
||||
#Binaries
|
||||
cp build/bin/sls_detector_acquire $PREFIX/bin/.
|
||||
cp build/bin/sls_detector_get $PREFIX/bin/.
|
||||
cp build/bin/sls_detector_put $PREFIX/bin/.
|
||||
cp build/bin/sls_detector_help $PREFIX/bin/.
|
||||
cp build/bin/slsReceiver $PREFIX/bin/.
|
||||
cp build/bin/slsMultiReceiver $PREFIX/bin/.
|
||||
cp build/install/bin/sls_detector_acquire $PREFIX/bin/.
|
||||
cp build/install/bin/sls_detector_get $PREFIX/bin/.
|
||||
cp build/install/bin/sls_detector_put $PREFIX/bin/.
|
||||
cp build/install/bin/sls_detector_help $PREFIX/bin/.
|
||||
cp build/install/bin/slsReceiver $PREFIX/bin/.
|
||||
cp build/install/bin/slsMultiReceiver $PREFIX/bin/.
|
||||
|
||||
#Which headers do we need for development??
|
||||
cp build/install/include/* $PREFIX/include/slsDetectorPackage/
|
||||
# cp include/some_lib.h $PREFIX/include/.
|
||||
|
||||
cp build/install/include/* $PREFIX/include/
|
||||
cp -r build/install/share/ $PREFIX/share
|
||||
|
@ -1,13 +1,14 @@
|
||||
|
||||
package:
|
||||
name: sls_detector_software
|
||||
version: "developer"
|
||||
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
|
||||
source:
|
||||
- path: ..
|
||||
|
||||
build:
|
||||
number: 1
|
||||
number: 0
|
||||
binary_relocation: True
|
||||
rpaths:
|
||||
- lib/
|
||||
|
||||
@ -16,10 +17,9 @@ requirements:
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- cmake
|
||||
# - qwt 6.* #require qt5 investigate befor activating gui
|
||||
# - qt=4.8.7=7
|
||||
- zeromq=4.2.5=hfc679d8_5
|
||||
- pyzmq
|
||||
- qwt 6.*
|
||||
- qt 4.8.*
|
||||
- zeromq
|
||||
- xorg-libx11
|
||||
- xorg-libice
|
||||
- xorg-libxext
|
||||
@ -37,6 +37,7 @@ requirements:
|
||||
host:
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- zeromq
|
||||
- xorg-libx11
|
||||
- xorg-libice
|
||||
- xorg-libxext
|
||||
@ -46,75 +47,52 @@ requirements:
|
||||
- xorg-libxfixes
|
||||
|
||||
run:
|
||||
- zeromq
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
|
||||
|
||||
outputs:
|
||||
- name: sls_detector_lib
|
||||
- name: slsdetlib
|
||||
script: copy_lib.sh
|
||||
|
||||
- name: sls_detector
|
||||
requirements:
|
||||
run:
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- zeromq
|
||||
|
||||
- name: slsdet
|
||||
|
||||
script: build_pylib.sh
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- python
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- python {{ python }}
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
- setuptools
|
||||
- sls_detector_lib
|
||||
- pyzmq
|
||||
- pybind11 2.2
|
||||
|
||||
host:
|
||||
- python
|
||||
- pybind11 2.2
|
||||
- pyzmq
|
||||
- sls_detector_lib
|
||||
|
||||
run:
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
run:
|
||||
- python
|
||||
- numpy
|
||||
- sls_detector_lib=developer
|
||||
- pyzmq
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
|
||||
|
||||
test:
|
||||
imports:
|
||||
- sls_detector
|
||||
- slsdet
|
||||
|
||||
# requirements:
|
||||
# build:
|
||||
# - {{ compiler('c') }}
|
||||
# - {{compiler('cxx')}}
|
||||
|
||||
# - name: sls_detector_gui
|
||||
# version: "refactor"
|
||||
# script: copy_gui.sh
|
||||
# requirements:
|
||||
# build:
|
||||
# - {{ compiler('c') }}
|
||||
# - {{compiler('cxx')}}
|
||||
# - cmake
|
||||
# - qwt 6.*
|
||||
# - qt=4.8.7=7
|
||||
# - zeromq=4.2.5=hfc679d8_5
|
||||
# - pyzmq
|
||||
# - xorg-libx11
|
||||
# - xorg-libice
|
||||
# - xorg-libxext
|
||||
# - xorg-libsm
|
||||
# - xorg-libxau
|
||||
# - xorg-libxrender
|
||||
# - xorg-libxfixes
|
||||
# - {{ cdt('mesa-libgl-devel') }} # [linux]
|
||||
# - {{ cdt('mesa-libegl-devel') }} # [linux]
|
||||
# - {{ cdt('mesa-dri-drivers') }} # [linux]
|
||||
# - {{ cdt('libselinux') }} # [linux]
|
||||
# - {{ cdt('libxdamage') }} # [linux]
|
||||
# - {{ cdt('libxxf86vm') }} # [linux]
|
||||
# run:
|
||||
# - sls_detector_lib=refactor
|
||||
# - qwt 6.*
|
||||
# - qt=4.8.7=7
|
||||
- name: slsdetgui
|
||||
script: copy_gui.sh
|
||||
requirements:
|
||||
run:
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
- qwt 6.*
|
||||
- qt 4.8.*
|
||||
|
89
ctbGui/CMakeLists.txt
Normal file
89
ctbGui/CMakeLists.txt
Normal file
@ -0,0 +1,89 @@
|
||||
|
||||
|
||||
find_package(ROOT CONFIG REQUIRED COMPONENTS Core Gui)
|
||||
find_package(TIFF REQUIRED)
|
||||
|
||||
target_include_directories(ROOT::Core INTERFACE "${ROOT_INCLUDE_DIRS}")
|
||||
add_library(ROOT::Flags_CXX IMPORTED INTERFACE)
|
||||
separate_arguments(ROOT_CXX_FLAGS)
|
||||
target_compile_options(ROOT::Flags_CXX INTERFACE ${ROOT_CXX_FLAGS})
|
||||
separate_arguments(ROOT_DEFINITIONS)
|
||||
target_compile_definitions(ROOT::Flags_CXX INTERFACE ${ROOT_DEFINITIONS})
|
||||
|
||||
# This fixes a bug in the linker flags
|
||||
string(REPLACE "-L " "-L" ROOT_EXE_LINKER_FLAGS "${ROOT_EXE_LINKER_FLAGS}")
|
||||
separate_arguments(ROOT_EXE_LINKER_FLAGS)
|
||||
|
||||
# Stuck into using old property method due to separate -L and -l arguments
|
||||
# (A full path to -l is better!)
|
||||
set_property(TARGET ROOT::Flags_CXX PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES ${ROOT_EXE_LINKER_FLAGS})
|
||||
set_property(TARGET ROOT::Core PROPERTY
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${ROOT_INCLUDE_DIRS}")
|
||||
|
||||
|
||||
add_executable(ctbGui
|
||||
ctbGui.cpp
|
||||
ctbMain.cpp
|
||||
ctbDacs.cpp
|
||||
ctbPowers.cpp
|
||||
ctbSlowAdcs.cpp
|
||||
ctbSignals.cpp
|
||||
ctbAdcs.cpp
|
||||
ctbPattern.cpp
|
||||
ctbAcquisition.cpp
|
||||
${CMAKE_SOURCE_DIR}/slsDetectorCalibration/tiffIO.cpp
|
||||
)
|
||||
|
||||
|
||||
#TODO! Replace with target
|
||||
target_include_directories(ctbGui PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/slsDetectorCalibration/dataStructures
|
||||
${CMAKE_SOURCE_DIR}/slsDetectorCalibration/interpolations
|
||||
${CMAKE_SOURCE_DIR}/slsDetectorCalibration/
|
||||
)
|
||||
|
||||
# Headders needed for ROOT dictionary generation
|
||||
set( HEADERS
|
||||
ctbDefs.h
|
||||
ctbMain.h
|
||||
ctbDacs.h
|
||||
ctbPattern.h
|
||||
ctbSignals.h
|
||||
ctbAdcs.h
|
||||
ctbAcquisition.h
|
||||
ctbPowers.h
|
||||
ctbSlowAdcs.h
|
||||
)
|
||||
|
||||
#set(ROOT_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# ROOT dictionary generation
|
||||
include("${ROOT_DIR}/modules/RootNewMacros.cmake")
|
||||
root_generate_dictionary(ctbDict ${HEADERS} LINKDEF ctbLinkDef.h)
|
||||
add_library(ctbRootLib SHARED ctbDict.cxx)
|
||||
target_include_directories(ctbRootLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(ctbRootLib PUBLIC
|
||||
ROOT::Core
|
||||
slsDetectorShared
|
||||
slsSupportLib
|
||||
${ROOT_LIBRARIES}
|
||||
${ROOT_EXE_LINKER_FLAGS}
|
||||
)
|
||||
|
||||
set_target_properties(
|
||||
ctbRootLib PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
)
|
||||
|
||||
target_link_libraries(ctbGui PUBLIC
|
||||
slsDetectorShared
|
||||
slsSupportLib
|
||||
ctbRootLib
|
||||
${TIFF_LIBRARIES}
|
||||
)
|
||||
|
||||
set_target_properties(ctbGui PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
|
||||
)
|
44
ctbGui/Makefile.root5
Normal file
44
ctbGui/Makefile.root5
Normal file
@ -0,0 +1,44 @@
|
||||
|
||||
|
||||
INCS=ctbMain.h ctbDacs.h ctbPattern.h ctbSignals.h ctbAdcs.h ctbAcquisition.h ctbPowers.h ctbSlowAdcs.h
|
||||
SRC= $(INCS:.h=.cpp) ctbDict.cpp
|
||||
LINKDEF=ctbLinkDef.h
|
||||
ZMQLIB=../slsReceiverSoftware/include
|
||||
LIBRARYCBF=$(CBFLIBDIR)/lib/*.o
|
||||
|
||||
INCDIR=-I../slsReceiverSoftware/include/ -I../slsDetectorSoftware/include/ -I../slsSupportLib/include/ -I../slsDetectorCalibration -I../slsDetectorCalibration/dataStructures -I$(CBFLIBDIR)/include -I../slsDetectorCalibration/interpolations
|
||||
LDFLAG=-L../build/bin -lSlsDetector -lSlsSupport -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -L$(ZMQLIB) -L$(CBFLIBDIR)/lib/ -std=c++11
|
||||
#
|
||||
MAIN=ctbGui.cpp
|
||||
|
||||
DESTDIR?=../build/bin
|
||||
|
||||
|
||||
OBJS = $(SRC:.cpp=.o) $(MAIN:.cpp=.o)
|
||||
|
||||
all: $(DESTDIR)/ctbGui
|
||||
|
||||
|
||||
doc:
|
||||
cd manual && make DESTDIR=$(DESTDIR)
|
||||
|
||||
htmldoc:
|
||||
cd manual && make html DESTDIR=$(DESTDIR)
|
||||
|
||||
ctbDict.cpp: $(INCS) $(LINKDEF)
|
||||
rootcint -f ctbDict.cpp -c $(INCS) $(LINKDEF)
|
||||
|
||||
%.o : %.cpp
|
||||
echo $@
|
||||
g++ -DMYROOT `root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o $@ -c $< $(INCDIR)
|
||||
#$(CXX) -o $@ -c $< $(INCLUDES) $(DFLAGS) -fPIC $(EPICSFLAGS) -lpthread #$(FLAGS)
|
||||
|
||||
|
||||
|
||||
$(DESTDIR)/ctbGui: $(OBJS) $(LINKDEF)
|
||||
g++ -DMYROOT `root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o ctbGui $(INCDIR) $(OBJS) ../slsDetectorCalibration/tiffIO.cpp
|
||||
mv ctbGui $(DESTDIR)
|
||||
|
||||
clean:
|
||||
rm -f $(DESTDIR)/ctbGui *.o ctbDict.* $(OBJS)
|
||||
|
46
ctbGui/Makefile.root6
Normal file
46
ctbGui/Makefile.root6
Normal file
@ -0,0 +1,46 @@
|
||||
|
||||
|
||||
INCS=ctbMain.h ctbDacs.h ctbPattern.h ctbSignals.h ctbAdcs.h ctbAcquisition.h ctbPowers.h ctbSlowAdcs.h
|
||||
SRC= $(INCS:.h=.cpp) ctbDict.cpp
|
||||
LINKDEF=ctbLinkDef.h
|
||||
#ctbActions.h
|
||||
ZMQLIB=../slsReceiverSoftware/include
|
||||
LIBRARYCBF=$(CBFLIBDIR)/lib/*.o
|
||||
|
||||
INCDIR=-I../slsReceiverSoftware/include/ -I../slsDetectorSoftware/include/ -I../slsSupportLib/include/ -I../slsDetectorCalibration -I../slsDetectorCalibration/dataStructures -I$(CBFLIBDIR)/include -I../slsDetectorCalibration/interpolations
|
||||
|
||||
LDFLAG=-L../build/bin -lSlsDetector -lSlsSupport -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -L$(ZMQLIB) -L$(CBFLIBDIR)/lib/ -std=c++11
|
||||
#
|
||||
MAIN=ctbGui.cpp
|
||||
|
||||
DESTDIR?=../build/bin
|
||||
|
||||
|
||||
OBJS = $(SRC:.cpp=.o) $(MAIN:.cpp=.o)
|
||||
|
||||
all: $(DESTDIR)/ctbGui
|
||||
|
||||
|
||||
doc:
|
||||
cd manual && make DESTDIR=$(DESTDIR)
|
||||
|
||||
htmldoc:
|
||||
cd manual && make html DESTDIR=$(DESTDIR)
|
||||
|
||||
ctbDict.cpp: $(INCS) $(LINKDEF)
|
||||
rootcling -f ctbDict.cpp -c $(INCS) $(LINKDEF)
|
||||
|
||||
%.o : %.cpp
|
||||
echo $@
|
||||
g++ -DMYROOT `source root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o $@ -c $< $(INCDIR)
|
||||
#$(CXX) -o $@ -c $< $(INCLUDES) $(DFLAGS) -fPIC $(EPICSFLAGS) -lpthread #$(FLAGS)
|
||||
|
||||
|
||||
|
||||
$(DESTDIR)/ctbGui: $(OBJS) $(LINKDEF)
|
||||
g++ -DMYROOT `source root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o ctbGui $(INCDIR) $(OBJS) ../slsDetectorCalibration/tiffIO.cpp
|
||||
mv ctbGui $(DESTDIR)
|
||||
|
||||
clean:
|
||||
rm -f $(DESTDIR)/ctbGui *.o ctbDict.* $(OBJS)
|
||||
|
2274
ctbGui/ctbAcquisition.cpp
Executable file
2274
ctbGui/ctbAcquisition.cpp
Executable file
File diff suppressed because it is too large
Load Diff
246
ctbGui/ctbAcquisition.h
Executable file
246
ctbGui/ctbAcquisition.h
Executable file
@ -0,0 +1,246 @@
|
||||
#ifndef CTBACQUISITION_H
|
||||
#define CTBACQUISITION_H
|
||||
#include <TGFrame.h>
|
||||
|
||||
#include "ctbAdcs.h"
|
||||
#include "ctbSignals.h"
|
||||
#include "ctbPattern.h"
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TGCheckButton;
|
||||
class TThread;
|
||||
class TGraph;
|
||||
class TMultiGraph;
|
||||
class THStack;
|
||||
class TGButtonGroup;
|
||||
class TGRadioButton;
|
||||
class TGComboBox;
|
||||
class TTimer;
|
||||
class TCanvas;
|
||||
class TH2F;
|
||||
class TH1F;
|
||||
class TGLabel;
|
||||
class TGTextButton;
|
||||
|
||||
namespace sls
|
||||
{
|
||||
class Detector;
|
||||
};
|
||||
class detectorData;
|
||||
|
||||
template <class dataType> class slsDetectorData;
|
||||
|
||||
class singlePhotonDetector;
|
||||
//class singlePhotonDetector;
|
||||
class commonModeSubtraction;
|
||||
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
using namespace std;
|
||||
|
||||
class ctbAcquisition : public TGGroupFrame {
|
||||
|
||||
|
||||
enum {DESERIALIZER, MOENCH04, MOENCH02, MOENCH03, IMAGE32B, IMAGE16B, ADCSAR2, MYTHEN301, MYTHEN302};
|
||||
|
||||
|
||||
private:
|
||||
TGTextEntry *eOutdir;
|
||||
TGTextEntry *eFname;
|
||||
TGNumberEntry *eFindex;
|
||||
TGCheckButton *cFileSave;
|
||||
|
||||
|
||||
TGNumberEntry *eSerOff;
|
||||
TGNumberEntry *eDynRange;
|
||||
TGNumberEntry *eNumCount;
|
||||
|
||||
|
||||
TGNumberEntry *ePixX;
|
||||
TGNumberEntry *ePixY;
|
||||
|
||||
TGNumberEntry *eFitADC;
|
||||
TGNumberEntry *eBitPlot;
|
||||
TGNumberEntry *eMinRaw;
|
||||
TGNumberEntry *eMaxRaw;
|
||||
TGNumberEntry *eMinPedSub;
|
||||
TGNumberEntry *eMaxPedSub;
|
||||
TGCheckButton *cMinMaxRaw;
|
||||
TGCheckButton *cMinMaxPedSub;
|
||||
|
||||
|
||||
|
||||
|
||||
TGNumberEntry *eMeasurements;
|
||||
|
||||
|
||||
|
||||
TGTextButton *bStatus;
|
||||
// TGTextButton
|
||||
TGCheckButton *cCompile;
|
||||
TGTextButton *cLoad;
|
||||
// TGCheckButton *cRun;
|
||||
|
||||
TThread *acqThread;
|
||||
|
||||
|
||||
THStack *adcStack;
|
||||
THStack *bitStack;
|
||||
THStack *countsStack;
|
||||
|
||||
|
||||
TH1F *adcHisto[NADCS];
|
||||
TH1F *countsHisto[NADCS];
|
||||
|
||||
TH1F *bitHisto[NSIGNALS];
|
||||
float bitOffset[NSIGNALS];
|
||||
|
||||
// int enableFlag[NADCS+4];
|
||||
int roMode;
|
||||
|
||||
int dBitOffset;
|
||||
|
||||
|
||||
|
||||
TH1F *adcFit;
|
||||
TH1F *bitPlot;
|
||||
TH1F *countsFit;
|
||||
|
||||
|
||||
|
||||
TH2F *h2DMapAn; // for 2D detectors
|
||||
TH2F *h2DMapDig; // for 2D detectors
|
||||
TH1F *h1DMap; //for 1D detectors
|
||||
|
||||
// TH2F *h2Scan; // for 2D detectors
|
||||
// TMultiGraph *mgAdcs;
|
||||
// TH1I *plotAdc[NADCS];
|
||||
|
||||
|
||||
sls::Detector* myDet;
|
||||
|
||||
int plotFlag[NADCS];
|
||||
int bitPlotFlag[NSIGNALS];
|
||||
|
||||
int ip;
|
||||
// int nChannels;
|
||||
// int chanEnable;
|
||||
//int nADCs;
|
||||
|
||||
std::vector <int> dbitlist;
|
||||
std::vector <int> adclist;
|
||||
|
||||
TGButtonGroup *bgPlot;// = new TGVButtonGroup(main_frame);
|
||||
TGRadioButton *rbPlotOff;
|
||||
TGRadioButton *rbWaveform;
|
||||
TGRadioButton *rbDistribution;
|
||||
TGRadioButton *rb2D;
|
||||
// TGRadioButton *rbScan;
|
||||
TGComboBox *cbDetType;
|
||||
TGCheckButton *cbGetPedestal;
|
||||
TGCheckButton *cbSubtractPedestal;
|
||||
TGCheckButton *cbCommonMode;
|
||||
TGTextButton *bResetPedestal;
|
||||
|
||||
TGLabel *lClickX;
|
||||
TGLabel *lClickY;
|
||||
TGLabel *lClickValue;
|
||||
|
||||
|
||||
TCanvas *myCanvas;
|
||||
TTimer *plotTimer;
|
||||
|
||||
char patternFile[10000];
|
||||
char patternCompiler[10000];
|
||||
|
||||
int globalPlot;
|
||||
int adcPlot;
|
||||
int dbitPlot;
|
||||
int tenG;
|
||||
|
||||
int nAnalogSamples, nDigitalSamples;
|
||||
// int iScanStep;
|
||||
|
||||
slsDetectorData<uint16_t> *dataStructure;
|
||||
singlePhotonDetector *photonFinder;
|
||||
//singlePhotonDetector *photonFinder;
|
||||
commonModeSubtraction *commonMode;
|
||||
int cmSub;
|
||||
|
||||
int stop;
|
||||
|
||||
uint64_t dBitMask;
|
||||
|
||||
int deserializer;
|
||||
|
||||
public:
|
||||
ctbAcquisition(TGVerticalFrame*, sls::Detector*);
|
||||
void setOutdir();
|
||||
void setFname();
|
||||
void setMeasurements();
|
||||
void setFsave(Bool_t);
|
||||
void changePlot(Int_t);
|
||||
void changeDetector(Int_t);
|
||||
void changePlot();
|
||||
void changeDetector();
|
||||
void setFindex();
|
||||
void Draw();
|
||||
void setCanvas(TCanvas*);
|
||||
|
||||
void toggleAcquisition();
|
||||
void loadPattern();
|
||||
static void* ThreadHandle(void *arg);
|
||||
void update();
|
||||
void acquisitionFinished();
|
||||
// string getParameters();
|
||||
|
||||
void setGraph (int i ,int en, Pixel_t col);
|
||||
void setBitGraph (int i ,int en, Pixel_t col);
|
||||
void startAcquisition();
|
||||
static void progressCallback(double,void*);
|
||||
static void dataCallback(detectorData*, long unsigned int, unsigned int, void*);
|
||||
int StopFlag;
|
||||
|
||||
int plotData(detectorData*, int);
|
||||
|
||||
void setPatternFile(const char* t);
|
||||
|
||||
void setPatternCompiler(const char* t);
|
||||
|
||||
void setAnalogSamples(int);
|
||||
void setDigitalSamples(int);
|
||||
|
||||
void setADCEnable(Int_t);
|
||||
void setDbitEnable(Int_t);
|
||||
void setReadoutMode(int);
|
||||
void updateChans();
|
||||
|
||||
void resetPedestal();
|
||||
|
||||
void ToggleCommonMode(Bool_t);
|
||||
void TogglePedSub(Bool_t);
|
||||
void ChangeHistoLimitsPedSub(Long_t );
|
||||
void ChangeHistoLimitsRaw(Long_t);
|
||||
void ChangeHistoLimitsPedSub( );
|
||||
void ChangeHistoLimitsRaw();
|
||||
void ChangeHistoLimitsPedSub(Bool_t );
|
||||
void ChangeHistoLimitsRaw(Bool_t);
|
||||
|
||||
|
||||
void ChangeSerialOffset();
|
||||
void ChangeSerialOffset(Long_t);
|
||||
void ChangeNumberOfChannels();
|
||||
void ChangeNumberOfChannels(Long_t);
|
||||
void ChangeDynamicRange();
|
||||
void ChangeDynamicRange(Long_t);
|
||||
void ChangeImagePixels();
|
||||
void ChangeImagePixels(Long_t);
|
||||
|
||||
void canvasClicked();
|
||||
void FitADC();
|
||||
void plotBit();
|
||||
ClassDef(ctbAcquisition,0)
|
||||
};
|
||||
|
||||
#endif
|
614
ctbGui/ctbAdcs.cpp
Executable file
614
ctbGui/ctbAdcs.cpp
Executable file
@ -0,0 +1,614 @@
|
||||
#include <TApplication.h>
|
||||
#include <TGClient.h>
|
||||
#include <TCanvas.h>
|
||||
#include <TF1.h>
|
||||
#include <TRandom.h>
|
||||
#include <TGButton.h>
|
||||
#include <TRootEmbeddedCanvas.h>
|
||||
#include <TGButtonGroup.h>
|
||||
#include <TGNumberEntry.h>
|
||||
#include <TGLabel.h>
|
||||
#include <TList.h>
|
||||
#include <TGFileDialog.h>
|
||||
#include <TGComboBox.h>
|
||||
#include <TH2F.h>
|
||||
#include <TColor.h>
|
||||
#include <TH1F.h>
|
||||
#include <TGraphErrors.h>
|
||||
#include <TGColorSelect.h>
|
||||
#include <THStack.h>
|
||||
#include <TGTab.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include "ctbAdcs.h"
|
||||
#include "ctbDefs.h"
|
||||
#include "Detector.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
ctbAdc::ctbAdc(TGVerticalFrame *page, int i, sls::Detector *det)
|
||||
: TGHorizontalFrame(page, 800,800), id(i), myDet(det) {
|
||||
|
||||
TGHorizontalFrame *hframe=this;
|
||||
char tit[100];
|
||||
|
||||
page->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sprintf(tit, "ADC%d", id);
|
||||
|
||||
sAdcLabel= new TGLabel(hframe, tit);
|
||||
hframe->AddFrame(sAdcLabel,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sAdcLabel->MapWindow();
|
||||
sAdcLabel->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sAdcInvert= new TGCheckButton(hframe, "Inv");
|
||||
hframe->AddFrame( sAdcInvert,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sAdcInvert->MapWindow();
|
||||
sAdcInvert->Connect("Toggled(Bool_t)","ctbAdc",this,"ToggledInvert(Bool_t)");
|
||||
|
||||
|
||||
sAdcEnable= new TGCheckButton(hframe, "En");
|
||||
hframe->AddFrame( sAdcEnable,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sAdcEnable->MapWindow();
|
||||
// sAdcEnable->SetOn(kTRUE);
|
||||
// sAdcEnable->SetEnabled(kFALSE);
|
||||
sAdcEnable->Connect("Toggled(Bool_t)","ctbAdc",this,"ToggledEnable(Bool_t)");
|
||||
|
||||
|
||||
|
||||
sAdcPlot= new TGCheckButton(hframe, "Plot");
|
||||
hframe->AddFrame( sAdcPlot,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sAdcPlot->MapWindow();
|
||||
|
||||
|
||||
sAdcPlot->Connect("Toggled(Bool_t)","ctbAdc",this,"ToggledPlot(Bool_t)");
|
||||
|
||||
|
||||
|
||||
fColorSel = new TGColorSelect(hframe, id+1, 0);
|
||||
|
||||
fColorSel->Connect("ColorSelected(Pixel_t)","ctbAdc",this,"ColorChanged(Pixel_t)");
|
||||
hframe->AddFrame(fColorSel, new TGLayoutHints(kLHintsTop |
|
||||
kLHintsLeft, 2, 0, 2, 2));
|
||||
|
||||
|
||||
fColorSel->SetColor(TColor::Number2Pixel(id+1));
|
||||
// sprintf(tit,"adc%d",id);
|
||||
// gADC=new TGraph();
|
||||
// gADC->SetName(tit);
|
||||
// gADC->SetLineColor(id+1);
|
||||
// gADC->SetMarkerColor(id+1);
|
||||
|
||||
|
||||
|
||||
};
|
||||
Pixel_t ctbAdc::getColor(){
|
||||
return fColorSel->GetColor();
|
||||
}
|
||||
Bool_t ctbAdc::getEnabled(){
|
||||
return getPlot();
|
||||
}
|
||||
Bool_t ctbAdc::getPlot(){
|
||||
return sAdcPlot->IsOn();
|
||||
}
|
||||
Bool_t ctbAdc::getInverted(){
|
||||
return sAdcInvert->IsOn();
|
||||
}
|
||||
|
||||
Bool_t ctbAdc::getEnable(){
|
||||
return sAdcEnable->IsOn();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbAdc::setInverted(Bool_t b){
|
||||
// cout << id << "set enabled " << b << endl;
|
||||
if (b)
|
||||
sAdcInvert->SetOn(kTRUE,kTRUE);
|
||||
else
|
||||
sAdcInvert->SetOn(kFALSE,kTRUE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ctbAdc::setEnable(Bool_t b){
|
||||
// cout << id << "set enabled " << b << endl;
|
||||
if (b)
|
||||
sAdcEnable->SetOn(kTRUE,kFALSE);
|
||||
else
|
||||
sAdcEnable->SetOn(kFALSE,kFALSE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void ctbAdc::setAdcAlias(char *tit, int plot, int color) {
|
||||
if (tit)
|
||||
sAdcLabel->SetText(tit);
|
||||
if (plot>0)
|
||||
sAdcPlot->SetOn(kTRUE,kTRUE);
|
||||
else if (plot==0)
|
||||
sAdcPlot->SetOn(kFALSE,kTRUE);
|
||||
if (color>=0)
|
||||
fColorSel->SetColor(color);
|
||||
fColorSel->SetEnabled(sAdcPlot->IsOn());
|
||||
}
|
||||
|
||||
|
||||
string ctbAdc::getAdcAlias() {
|
||||
|
||||
char line[1000];
|
||||
sprintf(line,"ADC%d %s %d %lx\n",id,sAdcLabel->GetText()->Data(),sAdcPlot->IsOn(),fColorSel->GetColor());
|
||||
return string(line);
|
||||
}
|
||||
|
||||
void ctbAdc::update() {
|
||||
|
||||
|
||||
//Emit("ToggledAdcEnable(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ctbAdc::ToggledPlot(Bool_t b){
|
||||
|
||||
// Long_t mask=b<<id;
|
||||
// ToggledAdcPlot(mask);
|
||||
cout << "Colsel " << id << " enable " << b << endl;
|
||||
if (b)
|
||||
fColorSel->SetEnabled(kTRUE);
|
||||
else
|
||||
fColorSel->SetEnabled(kFALSE);
|
||||
|
||||
// fColorSel->SetEnabled(sAdcPlot->IsOn());
|
||||
Emit("ToggledAdcPlot(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbAdc::ToggledInvert(Bool_t b){
|
||||
|
||||
|
||||
// fColorSel->SetEnabled(sAdcPlot->IsOn());
|
||||
Emit("ToggledAdcInvert(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbAdc::ToggledEnable(Bool_t b){
|
||||
|
||||
|
||||
fColorSel->SetEnabled(sAdcPlot->IsOn());
|
||||
Emit("ToggledAdcEnable(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void ctbAdc::ColorChanged(Pixel_t) {
|
||||
|
||||
Emit("ToggledAdcPlot(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
void ctbAdc::ToggledAdcPlot(Int_t b){
|
||||
|
||||
|
||||
Emit("ToggledAdcPlot(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
void ctbAdc::ToggledAdcInvert(Int_t b){
|
||||
|
||||
|
||||
Emit("ToggledAdcInvert(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
void ctbAdc::ToggledAdcEnable(Int_t b){
|
||||
|
||||
|
||||
Emit("ToggledAdcEnable(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ctbAdc::setEnabled(Bool_t b){
|
||||
// cout << id << "set enabled " << b << endl;
|
||||
if (b)
|
||||
sAdcPlot->SetOn(kTRUE,kFALSE);
|
||||
else
|
||||
sAdcPlot->SetOn(kFALSE,kFALSE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbAdc::setPlot(Bool_t b){
|
||||
// cout << id << "set enabled " << b << endl;
|
||||
if (b)
|
||||
sAdcPlot->SetOn(kTRUE,kTRUE);
|
||||
else
|
||||
sAdcPlot->SetOn(kFALSE,kTRUE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ctbAdcs::ctbAdcs(TGVerticalFrame *page, sls::Detector *det)
|
||||
: TGGroupFrame(page,"Adcs",kVerticalFrame), myDet(det) {
|
||||
|
||||
|
||||
SetTitlePos(TGGroupFrame::kLeft);
|
||||
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
|
||||
MapWindow();
|
||||
|
||||
|
||||
|
||||
TGHorizontalFrame* hframe=new TGHorizontalFrame(this, 800,800);
|
||||
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
|
||||
|
||||
int idac=0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
TGHorizontalFrame* hhframe=new TGHorizontalFrame(this, 800,800);
|
||||
AddFrame(hhframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hhframe->MapWindow();
|
||||
|
||||
TGVerticalFrame *vframe;
|
||||
|
||||
|
||||
|
||||
|
||||
for (idac=0; idac<NADCS; idac++) {
|
||||
if (idac%16==0) {
|
||||
|
||||
|
||||
vframe=new TGVerticalFrame(hhframe, 400,800);
|
||||
hhframe->AddFrame(vframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
vframe->MapWindow();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
sAdc[idac]=new ctbAdc(vframe,idac,myDet);
|
||||
|
||||
|
||||
sAdc[idac]->Connect("ToggledAdcPlot(Int_t)","ctbAdcs",this,"ToggledAdcPlot(Int_t)");
|
||||
sAdc[idac]->Connect("ToggledAdcInvert(Int_t)","ctbAdcs",this,"ToggledAdcInvert(Int_t)");
|
||||
sAdc[idac]->Connect("ToggledAdcEnable(Int_t)","ctbAdcs",this,"ToggledAdcEnable(Int_t)");
|
||||
|
||||
}
|
||||
|
||||
hframe=new TGHorizontalFrame(this, 800,800);
|
||||
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
bCheckHalf[0]=new TGTextButton(hframe, "All 0-15");
|
||||
hframe->AddFrame(bCheckHalf[0],new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
|
||||
bCheckHalf[0]->MapWindow();
|
||||
bCheckHalf[0]->Connect("Clicked()","ctbAdcs",this,"CheckHalf0()");
|
||||
|
||||
|
||||
bRemoveHalf[0]=new TGTextButton(hframe, "None 0-15");
|
||||
hframe->AddFrame(bRemoveHalf[0],new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 5, 5, 5, 5));
|
||||
bRemoveHalf[0]->MapWindow();
|
||||
bRemoveHalf[0]->Connect("Clicked()","ctbAdcs",this,"RemoveHalf0()");
|
||||
|
||||
|
||||
bCheckHalf[1]=new TGTextButton(hframe, "All 16-23");
|
||||
hframe->AddFrame(bCheckHalf[1],new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
|
||||
bCheckHalf[1]->MapWindow();
|
||||
bCheckHalf[1]->Connect("Clicked()","ctbAdcs",this,"CheckHalf1()");
|
||||
// bCheckAll->Connect("Clicked()","ctbAdcs",this,"CheckAll()");
|
||||
|
||||
|
||||
bRemoveHalf[1]=new TGTextButton(hframe, "None 16-23");
|
||||
hframe->AddFrame(bRemoveHalf[1],new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 5, 5, 5, 5));
|
||||
bRemoveHalf[1]->MapWindow();
|
||||
bRemoveHalf[1]->Connect("Clicked()","ctbAdcs",this,"RemoveHalf1()");
|
||||
// bRemoveAll->Connect("Clicked()","ctbAdcs",this,"RemoveAll()");
|
||||
|
||||
|
||||
|
||||
|
||||
hframe=new TGHorizontalFrame(this, 800,800);
|
||||
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
bCheckAll=new TGTextButton(hframe, "All");
|
||||
hframe->AddFrame(bCheckAll,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
|
||||
bCheckAll->MapWindow();
|
||||
bCheckAll->Connect("Clicked()","ctbAdcs",this,"CheckAll()");
|
||||
|
||||
|
||||
bRemoveAll=new TGTextButton(hframe, "None");
|
||||
hframe->AddFrame(bRemoveAll,new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 5, 5, 5, 5));
|
||||
bRemoveAll->MapWindow();
|
||||
bRemoveAll->Connect("Clicked()","ctbAdcs",this,"RemoveAll()");
|
||||
|
||||
|
||||
|
||||
hframe=new TGHorizontalFrame(this, 800,50);
|
||||
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
TGLabel *label= new TGLabel(hframe, "Inversion mask: ");
|
||||
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
label->MapWindow();
|
||||
label->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
eInversionMask = new TGNumberEntry(hframe, 0, 16,999, TGNumberFormat::kNESHex,
|
||||
TGNumberFormat::kNEANonNegative,
|
||||
TGNumberFormat::kNELNoLimits);
|
||||
|
||||
hframe->AddFrame(eInversionMask,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
|
||||
eInversionMask->MapWindow();
|
||||
eInversionMask->Resize(150,30);
|
||||
eInversionMask->SetState(kFALSE);
|
||||
|
||||
|
||||
hframe=new TGHorizontalFrame(this, 800,50);
|
||||
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
label= new TGLabel(hframe, "Enable mask: ");
|
||||
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
label->MapWindow();
|
||||
label->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
eEnableMask = new TGNumberEntry(hframe, 0, 16,999, TGNumberFormat::kNESHex,
|
||||
TGNumberFormat::kNEANonNegative,
|
||||
TGNumberFormat::kNELNoLimits);
|
||||
|
||||
hframe->AddFrame(eEnableMask,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
|
||||
eEnableMask->MapWindow();
|
||||
eEnableMask->Resize(150,30);
|
||||
eEnableMask->SetState(kFALSE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
int ctbAdcs::setEnable(int reg) {
|
||||
|
||||
try {
|
||||
if (reg > -1) {
|
||||
myDet->setADCEnableMask(reg);
|
||||
}
|
||||
auto retval = myDet->getADCEnableMask().tsquash("Different values");
|
||||
eEnableMask->SetHexNumber(retval);
|
||||
return retval;
|
||||
} CATCH_DISPLAY ("Could not set/get adc enablemask.", "ctbAdcs::setEnable")
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ctbAdcs::setInvert(int reg) {
|
||||
|
||||
try {
|
||||
if (reg > -1) {
|
||||
myDet->setADCInvert(reg);
|
||||
}
|
||||
auto retval = myDet->getADCInvert().tsquash("Different values");
|
||||
eInversionMask->SetHexNumber(retval);
|
||||
return retval;
|
||||
} CATCH_DISPLAY ("Could not set/get adc enablemask.", "ctbAdcs::setEnable")
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbAdcs::update() {
|
||||
Int_t invreg;
|
||||
Int_t disreg;
|
||||
|
||||
disreg=setEnable();
|
||||
invreg=setInvert();
|
||||
|
||||
for (int is=0; is<NADCS; is++) {
|
||||
sAdc[is]->setAdcAlias(NULL,-1,-1);
|
||||
if (invreg & (1<<is) )
|
||||
sAdc[is]->setInverted(kTRUE);
|
||||
else
|
||||
sAdc[is]->setInverted(kFALSE);
|
||||
|
||||
if (disreg & (1<<is) )
|
||||
sAdc[is]->setEnable(kTRUE);
|
||||
else
|
||||
sAdc[is]->setEnable(kFALSE);
|
||||
}
|
||||
|
||||
Emit("AdcEnable(Int_t)", disreg);
|
||||
|
||||
}
|
||||
string ctbAdcs::getAdcParameters() {
|
||||
ostringstream line;
|
||||
line << "reg "<< hex << setInvert() << "# ADC invert reg" << dec << endl;
|
||||
line << "reg "<< hex << setEnable() << " # ADC enable reg"<< dec << endl;
|
||||
return line.str();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::CheckAll() {
|
||||
for (int is=0; is<NADCS; is++){
|
||||
sAdc[is]->setPlot(kTRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::RemoveAll() {
|
||||
for (int is=0; is<NADCS; is++) {
|
||||
sAdc[is]->setPlot(kFALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbAdcs::CheckHalf0() {
|
||||
for (int is=0; is<NADCS/2; is++) {
|
||||
sAdc[is]->setPlot(kTRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::RemoveHalf0() {
|
||||
for (int is=0; is<NADCS/2; is++){
|
||||
sAdc[is]->setPlot(kFALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void ctbAdcs::CheckHalf1() {
|
||||
for (int is=NADCS/2; is<NADCS; is++){
|
||||
sAdc[is]->setPlot(kTRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::RemoveHalf1() {
|
||||
for (int is=NADCS/2; is<NADCS; is++){
|
||||
sAdc[is]->setPlot(kFALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int ctbAdcs::setAdcAlias(string line) {
|
||||
|
||||
int is=-1, plot=0, color=-1;
|
||||
char tit[100];
|
||||
int narg=sscanf(line.c_str(),"ADC%d %s %d %x",&is,tit,&plot, &color);
|
||||
if (narg<2)
|
||||
return -1;
|
||||
if (narg!=3)
|
||||
color=-1;
|
||||
if (is>=0 && is<NADCS) {
|
||||
sAdc[is]->setAdcAlias(tit,plot,color);
|
||||
}
|
||||
return is;
|
||||
|
||||
}
|
||||
|
||||
string ctbAdcs::getAdcAlias() {
|
||||
|
||||
ostringstream line;
|
||||
|
||||
for (int is=0; is<NADCS; is++)
|
||||
line << sAdc[is]->getAdcAlias();
|
||||
|
||||
return line.str();
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::ToggledAdcPlot(Int_t b){
|
||||
|
||||
|
||||
Emit("ToggledAdcPlot(Int_t)", b);
|
||||
|
||||
}
|
||||
|
||||
void ctbAdcs::AdcEnable(Int_t b){
|
||||
Emit("AdcEnable(Int_t)", b);
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::ToggledAdcEnable(Int_t b){
|
||||
|
||||
Int_t oreg=setEnable();
|
||||
Int_t m=1<<b;
|
||||
|
||||
if (sAdc[b]->getEnable())
|
||||
oreg|=m;
|
||||
else
|
||||
oreg&=~m;
|
||||
|
||||
setEnable(oreg);
|
||||
|
||||
Emit("AdcEnable(Int_t)", oreg);
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::ToggledAdcInvert(Int_t b){
|
||||
|
||||
Int_t oreg=setInvert();
|
||||
Int_t m=1<<b;
|
||||
|
||||
|
||||
if (sAdc[b]->getInverted())
|
||||
oreg|=m;
|
||||
else
|
||||
oreg&=~m;
|
||||
|
||||
setInvert(oreg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Pixel_t ctbAdcs::getColor(int i){
|
||||
if (i>=0 && i<NADCS)
|
||||
return sAdc[i]->getColor();
|
||||
return static_cast<Pixel_t>(-1);
|
||||
}
|
||||
|
||||
Bool_t ctbAdcs::getEnabled(int i){
|
||||
if (i>=0 && i<NADCS)
|
||||
return sAdc[i]->getEnabled();
|
||||
return static_cast<Bool_t>(-1);
|
||||
}
|
||||
|
||||
Bool_t ctbAdcs::getEnable(int i){
|
||||
if (i>=0 && i<NADCS)
|
||||
return sAdc[i]->getEnable();
|
||||
return static_cast<Bool_t>(-1);
|
||||
}
|
||||
|
||||
Bool_t ctbAdcs::getPlot(int i){
|
||||
if (i>=0 && i<NADCS)
|
||||
return sAdc[i]->getPlot();
|
||||
return static_cast<Bool_t>(-1);
|
||||
}
|
155
ctbGui/ctbAdcs.h
Executable file
155
ctbGui/ctbAdcs.h
Executable file
@ -0,0 +1,155 @@
|
||||
|
||||
|
||||
|
||||
#ifndef CTBADCS_H
|
||||
#define CTBADCS_H
|
||||
#include <TGFrame.h>
|
||||
|
||||
|
||||
#define NADCS 32
|
||||
|
||||
class TRootEmbeddedCanvas;
|
||||
class TGButtonGroup;
|
||||
class TGVerticalFrame;
|
||||
class TGHorizontalFrame;
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TH2F;
|
||||
class TGComboBox;
|
||||
class TGCheckButton;
|
||||
class TGColorSelect;
|
||||
class TColor;
|
||||
|
||||
class THStack;
|
||||
class TGraphErrors;
|
||||
class TGTextButton;
|
||||
class TGTab;
|
||||
|
||||
class TGraph;
|
||||
|
||||
namespace sls
|
||||
{
|
||||
class Detector;
|
||||
};
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
class ctbAdc : public TGHorizontalFrame {
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
TGLabel *sAdcLabel;
|
||||
TGCheckButton *sAdcEnable;
|
||||
TGCheckButton *sAdcPlot;
|
||||
TGCheckButton *sAdcInvert;
|
||||
|
||||
TGColorSelect *fColorSel;
|
||||
|
||||
// TGraph *gADC;
|
||||
|
||||
int id;
|
||||
sls::Detector *myDet;
|
||||
|
||||
public:
|
||||
ctbAdc(TGVerticalFrame *page, int i, sls::Detector *det);
|
||||
|
||||
|
||||
void setAdcAlias(char *tit, int plot, int color);
|
||||
string getAdcAlias();
|
||||
void ToggledAdcPlot(Int_t b);
|
||||
void ToggledAdcEnable(Int_t b);
|
||||
void ToggledAdcInvert(Int_t b);
|
||||
|
||||
|
||||
void ToggledPlot(Bool_t b);
|
||||
void ToggledEnable(Bool_t b);
|
||||
void ToggledInvert(Bool_t b);
|
||||
void ColorChanged(Pixel_t);
|
||||
void setEnabled(Bool_t b);
|
||||
Bool_t getEnabled();
|
||||
// TGraph *getGraph();
|
||||
void update();
|
||||
|
||||
Pixel_t getColor();
|
||||
|
||||
Bool_t getEnable();
|
||||
void setEnable(Bool_t);
|
||||
void setPlot(Bool_t);
|
||||
Bool_t getInverted();
|
||||
Bool_t getPlot();
|
||||
void setInverted(Bool_t);
|
||||
|
||||
ClassDef(ctbAdc,0)
|
||||
};
|
||||
|
||||
|
||||
|
||||
class ctbAdcs : public TGGroupFrame {
|
||||
private:
|
||||
|
||||
ctbAdc *sAdc[NADCS];
|
||||
sls::Detector *myDet;
|
||||
|
||||
|
||||
TGTextButton *bCheckAll;
|
||||
TGTextButton *bRemoveAll;
|
||||
TGTextButton *bCheckHalf[2];
|
||||
TGTextButton *bRemoveHalf[2];
|
||||
TGNumberEntry *eInversionMask;
|
||||
TGNumberEntry *eEnableMask;
|
||||
|
||||
|
||||
/* TGTextButton *bPlotSelected; */
|
||||
/* TGNumberEntry *eMinX; */
|
||||
/* TGNumberEntry *eMaxX; */
|
||||
/* TGNumberEntry *eMinY; */
|
||||
/* TGNumberEntry *eMaxY; */
|
||||
|
||||
|
||||
|
||||
/* TGTextButton *bGetPixel; */
|
||||
/* TGNumberEntry *ePixelX; */
|
||||
/* TGNumberEntry *ePixelY; */
|
||||
/* TGLabel *lPixelValue; */
|
||||
|
||||
public:
|
||||
|
||||
ctbAdcs(TGVerticalFrame *page, sls::Detector *det);
|
||||
int setAdcAlias(string line);
|
||||
string getAdcAlias();
|
||||
string getAdcParameters();
|
||||
void ToggledAdcPlot(Int_t);
|
||||
void ToggledAdcInvert(Int_t);
|
||||
void ToggledAdcEnable(Int_t);
|
||||
void AdcEnable(Int_t b);
|
||||
// TGraph *getGraph(int i);
|
||||
void CheckAll();
|
||||
void RemoveAll();
|
||||
void update();
|
||||
|
||||
int setInvert(int reg=-1);
|
||||
int setEnable(int reg=-1);
|
||||
|
||||
|
||||
Pixel_t getColor(int i);
|
||||
Bool_t getEnabled(int i);
|
||||
Bool_t getPlot(int i);
|
||||
Bool_t getEnable(int i);
|
||||
|
||||
void CheckHalf0();
|
||||
void RemoveHalf0();
|
||||
|
||||
void CheckHalf1();
|
||||
void RemoveHalf1();
|
||||
|
||||
|
||||
ClassDef(ctbAdcs,0)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
233
ctbGui/ctbDacs.cpp
Executable file
233
ctbGui/ctbDacs.cpp
Executable file
@ -0,0 +1,233 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include <TGTextEntry.h>
|
||||
#include <TGLabel.h>
|
||||
#include <TGNumberEntry.h>
|
||||
#include <TGButton.h>
|
||||
|
||||
#include "ctbDacs.h"
|
||||
#include "ctbDefs.h"
|
||||
#include "Detector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
ctbDac::ctbDac(TGGroupFrame *page, int idac, sls::Detector *det) : TGHorizontalFrame(page, 800,50) , id(idac), myDet(det) {
|
||||
|
||||
TGHorizontalFrame *hframe=this;
|
||||
|
||||
page->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
MapWindow();
|
||||
|
||||
char tit[100];
|
||||
|
||||
|
||||
sprintf(tit, "DAC %d:",idac);
|
||||
|
||||
dacsLabel= new TGCheckButton(hframe, tit);// new TGLabel(hframe, tit);
|
||||
dacsLabel->SetOn(kTRUE, kTRUE);
|
||||
|
||||
dacsLabel->Connect("Toggled(Bool_t)","ctbDac",this,"setOn(Bool_t)");
|
||||
|
||||
|
||||
hframe->AddFrame(dacsLabel,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
||||
dacsLabel->MapWindow();
|
||||
dacsLabel->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
dacsEntry = new TGNumberEntry(hframe, 0, 9,999, TGNumberFormat::kNESInteger,
|
||||
TGNumberFormat::kNEANonNegative,
|
||||
TGNumberFormat::kNELLimitMinMax,
|
||||
0, 65535);
|
||||
|
||||
hframe->AddFrame(dacsEntry,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
|
||||
dacsEntry->MapWindow();
|
||||
dacsEntry->Resize(150,30);
|
||||
|
||||
|
||||
dacsUnit= new TGCheckButton(hframe, "mV");
|
||||
// if (idac!=slsDetectorDefs::ADC_VPP) {
|
||||
hframe->AddFrame( dacsUnit,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
||||
dacsUnit->MapWindow();
|
||||
if (idac==slsDetectorDefs::ADC_VPP) {
|
||||
dacsUnit->SetEnabled(kFALSE);
|
||||
hframe->HideFrame(dacsUnit);
|
||||
dacsUnit->MapWindow();
|
||||
cout << "hiding!" << endl;
|
||||
}
|
||||
if (idac==slsDetectorDefs::HIGH_VOLTAGE) {
|
||||
dacsUnit->SetText("V");
|
||||
dacsUnit->SetOn(kTRUE,kTRUE);
|
||||
dacsUnit->SetEnabled(kFALSE);
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
|
||||
sprintf(tit, "xxx");
|
||||
dacsValue= new TGLabel(hframe, tit);
|
||||
hframe->AddFrame( dacsValue,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
||||
dacsValue->MapWindow();
|
||||
dacsValue->SetTextJustify(kTextLeft);
|
||||
|
||||
TGTextEntry *e=dacsEntry->TGNumberEntry::GetNumberEntry();
|
||||
e->Connect("ReturnPressed()","ctbDac",this,"setValue()");
|
||||
// e->Connect("ValueSet(Long_t)","ctbDac",this,"setValue(Long_t)");
|
||||
dacsEntry->Connect("ValueSet(Long_t)","ctbDac",this,"setValue(Long_t)");
|
||||
// cout << "(((((((((((((((((((((((((((((((" << dacsEntry->GetListOfSignals()->At(0)->IsA() << endl;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ctbDac::setLabel(char *tit, int mv) {
|
||||
if(tit)
|
||||
dacsLabel->SetText(tit);
|
||||
if (mv==1)
|
||||
dacsUnit->SetOn(kTRUE,kTRUE);
|
||||
else if (mv==0)
|
||||
dacsUnit->SetOn(kFALSE,kTRUE);
|
||||
// else if (mv==2) {
|
||||
// ;}
|
||||
// else if (mv==3)
|
||||
// ;
|
||||
return id;
|
||||
|
||||
}
|
||||
|
||||
string ctbDac::getLabel() {
|
||||
ostringstream line;
|
||||
line << dacsLabel->GetText() << " " << dacsUnit->IsOn() << endl;
|
||||
// line << "DAC" << dec << id << " " << dacsUnit->IsOn() << endl;
|
||||
return line.str();
|
||||
|
||||
}
|
||||
|
||||
int ctbDac::getMoenchDacId() {
|
||||
slsDetectorDefs::dacIndex moenchDacIndices[8] = {slsDetectorDefs::VBP_COLBUF, slsDetectorDefs::VIPRE, slsDetectorDefs::VIN_CM, slsDetectorDefs::VB_SDA, slsDetectorDefs::VCASC_SFP, slsDetectorDefs::VOUT_CM, slsDetectorDefs::VIPRE_CDS, slsDetectorDefs::IBIAS_SFP};
|
||||
|
||||
if (id >= 8) {
|
||||
return id;
|
||||
}
|
||||
return static_cast<int>(moenchDacIndices[id]);
|
||||
}
|
||||
|
||||
void ctbDac::setValue(Long_t a) {setValue();}
|
||||
|
||||
void ctbDac::setValue() {
|
||||
cout << "setting dac! "<< id << " value " << dacsEntry->GetIntNumber() << " units " << dacsUnit->IsOn() << endl;
|
||||
|
||||
try {
|
||||
int sid = id;
|
||||
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
||||
sid = getMoenchDacId();
|
||||
}
|
||||
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(sid), dacsEntry->GetIntNumber(), dacsUnit->IsOn());
|
||||
} CATCH_DISPLAY ("Could not set dac " + to_string(id) + ".", "ctbDac::setValue")
|
||||
|
||||
getValue();
|
||||
}
|
||||
|
||||
void ctbDac::setOn(Bool_t b) {
|
||||
// cout << "setting dac! "<< id << endl;
|
||||
if ( dacsLabel->IsOn()) {
|
||||
setValue();
|
||||
} else {
|
||||
try {
|
||||
int sid = id;
|
||||
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
||||
sid = getMoenchDacId();
|
||||
}
|
||||
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(sid), -100, false);
|
||||
} CATCH_DISPLAY ("Could not power off dac " + to_string(id) + ".", "ctbDac::setOn")
|
||||
}
|
||||
getValue();
|
||||
}
|
||||
|
||||
int ctbDac::getValue() {
|
||||
try {
|
||||
int sid = id;
|
||||
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
||||
sid = getMoenchDacId();
|
||||
}
|
||||
int val = myDet->getDAC(static_cast<slsDetectorDefs::dacIndex>(sid), dacsUnit->IsOn()).tsquash("Different values");
|
||||
cout << "dac " << id << " " << val << endl;
|
||||
dacsValue->SetText(to_string(val).c_str());
|
||||
if (val >= 0) {
|
||||
dacsLabel->SetOn(kTRUE);
|
||||
} else {
|
||||
dacsLabel->SetOn(kFALSE);
|
||||
}
|
||||
return val;
|
||||
} CATCH_DISPLAY ("Could not get dac " + to_string(id) + ".", "ctbDac::getValue")
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
ctbDacs::ctbDacs(TGVerticalFrame *page, sls::Detector *det) : TGGroupFrame(page,"DACs",kVerticalFrame) , myDet(det){
|
||||
|
||||
SetTitlePos(TGGroupFrame::kLeft);
|
||||
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
|
||||
MapWindow();
|
||||
|
||||
// cout << "window mapped " << endl;
|
||||
|
||||
for (int idac=0; idac<NDACS; idac++) {
|
||||
|
||||
dacs[idac]=new ctbDac(this, idac, myDet);
|
||||
|
||||
}
|
||||
dacs[NDACS]=new ctbDac(this, slsDetectorDefs::ADC_VPP, myDet);
|
||||
dacs[NDACS+1]=new ctbDac(this, slsDetectorDefs::HIGH_VOLTAGE, myDet);
|
||||
dacs[NDACS]->setLabel((char*)"ADC Vpp",2);
|
||||
dacs[NDACS+1]->setLabel((char*)"High Voltage",3);
|
||||
}
|
||||
|
||||
|
||||
int ctbDacs::setDacAlias(string line) {
|
||||
int is=-1, mv=0;
|
||||
char tit[100];
|
||||
int narg=sscanf(line.c_str(),"DAC%d %s %d",&is,tit,&mv);
|
||||
if (narg<2)
|
||||
return -1;
|
||||
if (is>=0 && is<NDACS)
|
||||
dacs[is]->setLabel(tit,mv);
|
||||
return is;
|
||||
|
||||
}
|
||||
|
||||
string ctbDacs::getDacAlias() {
|
||||
ostringstream line;
|
||||
|
||||
for (int i=0; i<NDACS; i++)
|
||||
line << dacs[i]->getLabel() << endl;
|
||||
return line.str();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
string ctbDacs::getDacParameters() {
|
||||
ostringstream line;
|
||||
|
||||
for (int i=0; i<NDACS; i++) {
|
||||
//line << "dacs:" << i << " " << dacs[i]->getValue << endl;
|
||||
line << "dac:" << i << " " << dacs[i]->getValue() << endl;
|
||||
}
|
||||
return line.str();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbDacs::update() {
|
||||
for (int idac=0; idac<NDACS+1; idac++) {
|
||||
dacs[idac]->getValue();
|
||||
}
|
||||
}
|
75
ctbGui/ctbDacs.h
Executable file
75
ctbGui/ctbDacs.h
Executable file
@ -0,0 +1,75 @@
|
||||
|
||||
|
||||
#ifndef CTBDACS_H
|
||||
#define CTBDACS_H
|
||||
#include <TGFrame.h>
|
||||
|
||||
|
||||
#define NDACS 18
|
||||
//#define NDACS 16
|
||||
|
||||
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TGCheckButton;
|
||||
|
||||
|
||||
namespace sls
|
||||
{
|
||||
class Detector;
|
||||
};
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
|
||||
class ctbDac : public TGHorizontalFrame {
|
||||
|
||||
|
||||
protected:
|
||||
// TGLabel *dacsLabel;
|
||||
TGNumberEntry *dacsEntry;
|
||||
TGCheckButton *dacsUnit;
|
||||
TGCheckButton *dacsLabel;
|
||||
TGLabel *dacsValue;
|
||||
int id;
|
||||
|
||||
sls::Detector* myDet;
|
||||
public:
|
||||
ctbDac(TGGroupFrame*, int , sls::Detector*);
|
||||
void setValue();
|
||||
void setValue(Long_t);
|
||||
int getValue();
|
||||
void setOn(Bool_t);
|
||||
|
||||
int setLabel(char *tit, int mv);
|
||||
string getLabel();
|
||||
int getMoenchDacId();
|
||||
|
||||
|
||||
ClassDef(ctbDac,0)
|
||||
};
|
||||
|
||||
class ctbDacs : public TGGroupFrame {
|
||||
private:
|
||||
|
||||
ctbDac *dacs[NDACS+2];
|
||||
|
||||
sls::Detector* myDet;
|
||||
|
||||
public:
|
||||
ctbDacs(TGVerticalFrame *page, sls::Detector*);
|
||||
|
||||
int setDacAlias(string line);
|
||||
// int setDacAlias(string line);
|
||||
string getDacAlias();
|
||||
string getDacParameters();
|
||||
|
||||
void update();
|
||||
|
||||
ClassDef(ctbDacs,0)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
84
ctbGui/ctbDefs.h
Executable file
84
ctbGui/ctbDefs.h
Executable file
@ -0,0 +1,84 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <chrono>
|
||||
|
||||
//#include "sls_detector_exceptions.h"
|
||||
//#include "ansi.h"
|
||||
#define RED "\x1b[31m"
|
||||
#define RESET "\x1b[0m"
|
||||
#define BOLD "\x1b[1m"
|
||||
#define cprintf(code, format, ...) printf(code format RESET, ##__VA_ARGS__)
|
||||
|
||||
|
||||
#define CATCH_DISPLAY(m, s) catch(...) { ctbDefs::DisplayExceptions(m, s); }
|
||||
#define CATCH_HANDLE(...) catch(...) { ctbDefs::HandleExceptions(__VA_ARGS__); }
|
||||
|
||||
class ctbDefs {
|
||||
public:
|
||||
/**
|
||||
* Empty Constructor
|
||||
*/
|
||||
ctbDefs(){};
|
||||
|
||||
// convert double seconds to chrono ns
|
||||
static std::chrono::nanoseconds ConvertDoubleStoChronoNS(double timeS) {
|
||||
using std::chrono::duration;
|
||||
using std::chrono::duration_cast;
|
||||
using std::chrono::nanoseconds;
|
||||
return duration_cast<nanoseconds>(duration<double>(timeS));
|
||||
}
|
||||
|
||||
// convert chrono ns to doubel s
|
||||
static double ConvertChronoNStoDoubleS(std::chrono::nanoseconds timeNs) {
|
||||
using std::chrono::duration;
|
||||
using std::chrono::duration_cast;
|
||||
return duration_cast<duration<double>>(timeNs).count();
|
||||
}
|
||||
|
||||
static void DisplayExceptions(std::string emsg, std::string src) {
|
||||
try {
|
||||
throw;
|
||||
} /* catch (const sls::SocketError &e) {
|
||||
throw;
|
||||
} catch (const sls::SharedMemoryError &e) {
|
||||
throw;
|
||||
} */catch (const std::exception &e) {
|
||||
ExceptionMessage(emsg, e.what(), src);
|
||||
}
|
||||
};
|
||||
|
||||
template <class CT> struct NonDeduced { using type = CT; };
|
||||
template <class S, typename RT, typename... CT>
|
||||
static void HandleExceptions(const std::string emsg, const std::string src, S* s,
|
||||
RT (S::*somefunc)(CT...),
|
||||
typename NonDeduced<CT>::type... Args) {
|
||||
try {
|
||||
throw;
|
||||
} /*catch (const sls::SocketError &e) {
|
||||
throw;
|
||||
} catch (const sls::SharedMemoryError &e) {
|
||||
throw;
|
||||
} */catch (const std::exception &e) {
|
||||
|
||||
ExceptionMessage(emsg, e.what(), src);
|
||||
(s->*somefunc)(Args...);
|
||||
}
|
||||
};
|
||||
|
||||
static void ExceptionMessage(std::string message,
|
||||
std::string exceptionMessage,
|
||||
std::string source) {
|
||||
// because sls_detector_exceptions cannot be included
|
||||
if (exceptionMessage.find("hared memory") != std::string::npos) {
|
||||
throw;
|
||||
}
|
||||
if (exceptionMessage.find("annot connect") != std::string::npos) {
|
||||
throw;
|
||||
}
|
||||
cprintf(RED, "Warning (%s): %s [Caught Exception: %s]\n", source.c_str(), message.c_str(), exceptionMessage.c_str());
|
||||
//return Message(qDefs::WARNING, message + std::string("\nCaught exception:\n") + exceptionMessage, source);
|
||||
};
|
||||
|
||||
};
|
157
ctbGui/ctbGui.cpp
Executable file
157
ctbGui/ctbGui.cpp
Executable file
@ -0,0 +1,157 @@
|
||||
#include <TApplication.h>
|
||||
#include <TColor.h>
|
||||
|
||||
#include <TStyle.h>
|
||||
#include <TROOT.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#include "Detector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
//#include "sls_receiver_defs.h"
|
||||
#include "ctbMain.h"
|
||||
#include "ctbDefs.h"
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
|
||||
string afname, cfname, pfname;
|
||||
int id=0;
|
||||
|
||||
int af=0, cf=0, pf=0;
|
||||
|
||||
|
||||
cout << " *** " << argc << endl;
|
||||
for (int ia=0; ia<argc; ia++) {
|
||||
if (strcmp(argv[ia],"-alias")==0) {
|
||||
if (ia+1<argc) {
|
||||
afname=argv[ia+1];
|
||||
ia++;
|
||||
af=1;
|
||||
}
|
||||
|
||||
} else if (strcmp(argv[ia],"-config")==0) {
|
||||
if (ia+1<argc) {
|
||||
cfname=argv[ia+1];
|
||||
ia++;
|
||||
cf=1;
|
||||
}
|
||||
|
||||
|
||||
} else if (strcmp(argv[ia],"-par")==0) {
|
||||
if (ia+1<argc) {
|
||||
pfname=argv[ia+1];
|
||||
ia++;
|
||||
pf=1;
|
||||
}
|
||||
|
||||
|
||||
} else if (strcmp(argv[ia],"-id")==0) {
|
||||
if (ia+1<argc) {
|
||||
id=atoi(argv[ia+1]);
|
||||
ia++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cout << " *** " << endl;
|
||||
sls::Detector *myDet = nullptr;
|
||||
try {
|
||||
/****** Create detector ****************/
|
||||
myDet=new sls::Detector(id);
|
||||
cout << "Created multi detector id " << id << endl;
|
||||
|
||||
if (cf) {
|
||||
myDet->loadConfig(cfname);
|
||||
cout << "Config file loaded successfully" << endl;
|
||||
} else {
|
||||
cout << "No config file specified" << endl;
|
||||
}
|
||||
cout << "hostname " << myDet->getHostname() << endl;
|
||||
|
||||
if (pf) {
|
||||
myDet->loadParameters(pfname);
|
||||
cout << "Loaded parameter file successfully" << endl;
|
||||
} else{
|
||||
cout << "No parameter file specified" << endl;
|
||||
}
|
||||
} CATCH_DISPLAY ("Could not create detector/ load config/parameters.", "ctbGui::main")
|
||||
|
||||
/***********Create GUI stuff *******************/
|
||||
TApplication theApp("App",&argc,argv);
|
||||
|
||||
|
||||
gStyle->SetDrawBorder(0);
|
||||
gStyle->SetCanvasColor(kWhite);
|
||||
gStyle->SetCanvasDefH(800);
|
||||
gStyle->SetCanvasDefW(800);
|
||||
gStyle->SetCanvasBorderMode(0);
|
||||
gStyle->SetPadBorderMode(0);
|
||||
gStyle->SetPaintTextFormat("5.2f");
|
||||
gStyle->SetLineWidth(2);
|
||||
gStyle->SetTextSize(1.1);
|
||||
gStyle->SetLabelSize(0.04,"xy");
|
||||
gStyle->SetTitleSize(0.05,"xy");
|
||||
gStyle->SetTitleOffset(1.0,"x");
|
||||
gStyle->SetTitleOffset(1.1,"y");
|
||||
gStyle->SetPadTopMargin(0.15);
|
||||
gStyle->SetPadRightMargin(0.15);
|
||||
gStyle->SetPadBottomMargin(0.15);
|
||||
gStyle->SetPadLeftMargin(0.15);
|
||||
gStyle->SetLegendBorderSize(1);
|
||||
gStyle->SetFrameBorderMode(0);
|
||||
gStyle->SetFrameFillColor(kWhite);
|
||||
// gStyle->SetLegendFillColor(kWhite);
|
||||
gStyle->SetTitleFillColor(kWhite);
|
||||
gStyle->SetFillColor(kWhite);
|
||||
gStyle->SetStatFontSize(0.03);
|
||||
gStyle->SetStatBorderSize(1);
|
||||
gStyle->SetStatFormat("6.4g");
|
||||
gStyle->SetStatX(0.95);
|
||||
gStyle->SetStatY(0.95);
|
||||
gStyle->SetStatW(0.2);
|
||||
gStyle->SetStatH(0.2);
|
||||
gStyle->SetTitleX(0.1);
|
||||
gStyle->SetTitleY(0.95);
|
||||
gStyle->SetTitleBorderSize(0);
|
||||
gStyle->SetTitleFontSize(0.05);
|
||||
gROOT->SetStyle("Default");
|
||||
|
||||
|
||||
TColor::InitializeColors();
|
||||
const Int_t NRGBs = 5;
|
||||
const Int_t NCont = 90;
|
||||
|
||||
Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
|
||||
Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
|
||||
Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
|
||||
Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
|
||||
TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
|
||||
gStyle->SetNumberContours(NCont);
|
||||
|
||||
|
||||
gROOT->ForceStyle();
|
||||
ctbMain *mf=new ctbMain(gClient->GetRoot(), myDet);
|
||||
|
||||
cout << " *** " << argc << endl;
|
||||
for (int ia=0; ia<argc; ia++)
|
||||
cout << argv[ia] << endl;
|
||||
|
||||
|
||||
cout << " *** " << endl;
|
||||
|
||||
if (af)
|
||||
mf->loadAlias(afname);
|
||||
else
|
||||
cout << "no alias specified" << endl;
|
||||
|
||||
theApp.Run();
|
||||
|
||||
return 0;
|
||||
}
|
15
ctbGui/ctbLinkDef.h
Executable file
15
ctbGui/ctbLinkDef.h
Executable file
@ -0,0 +1,15 @@
|
||||
#pragma link C++ class ctbMain;
|
||||
#pragma link C++ class ctbDacs;
|
||||
#pragma link C++ class ctbDac;
|
||||
#pragma link C++ class ctbSignals;
|
||||
#pragma link C++ class ctbSignal;
|
||||
#pragma link C++ class ctbAdc;
|
||||
#pragma link C++ class ctbAdcs;
|
||||
#pragma link C++ class ctbLoop;
|
||||
#pragma link C++ class ctbWait;
|
||||
#pragma link C++ class ctbPattern;
|
||||
#pragma link C++ class ctbAcquisition;
|
||||
#pragma link C++ class ctbPower;
|
||||
#pragma link C++ class ctbPowers;
|
||||
#pragma link C++ class ctbSlowAdc;
|
||||
#pragma link C++ class ctbSlowAdcs;
|
586
ctbGui/ctbMain.cpp
Executable file
586
ctbGui/ctbMain.cpp
Executable file
@ -0,0 +1,586 @@
|
||||
#include <TApplication.h>
|
||||
#include <TGClient.h>
|
||||
#include <TCanvas.h>
|
||||
#include <TF1.h>
|
||||
#include <TRandom.h>
|
||||
#include <TGButton.h>
|
||||
#include <TRootEmbeddedCanvas.h>
|
||||
#include <TGButtonGroup.h>
|
||||
#include <TGNumberEntry.h>
|
||||
#include <TGLabel.h>
|
||||
#include <TList.h>
|
||||
#include <TGFileDialog.h>
|
||||
#include <TGComboBox.h>
|
||||
#include <TH2F.h>
|
||||
#include <TColor.h>
|
||||
#include <TH1F.h>
|
||||
#include <TGraphErrors.h>
|
||||
#include <THStack.h>
|
||||
#include <TGTab.h>
|
||||
#include <TApplication.h>
|
||||
#include <TGCanvas.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <TGMenu.h>
|
||||
#include <TGDockableFrame.h>
|
||||
//#include <TGMenuBar.h>
|
||||
//#include <TGPopupMenu.h>
|
||||
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#include "Detector.h"
|
||||
#include "ctbDefs.h"
|
||||
#include "ctbMain.h"
|
||||
#include "ctbDacs.h"
|
||||
#include "ctbSlowAdcs.h"
|
||||
#include "ctbPowers.h"
|
||||
#include "ctbSignals.h"
|
||||
#include "ctbPattern.h"
|
||||
#include "ctbAdcs.h"
|
||||
#include "ctbAcquisition.h"
|
||||
//#include "ctbActions.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
ctbMain::ctbMain(const TGWindow *p, sls::Detector *det)
|
||||
: TGMainFrame(p,800,800), pwrs(NULL), senses(NULL) {
|
||||
|
||||
myDet=det;
|
||||
|
||||
Connect("CloseWindow()", "ctbMain", this, "CloseWindow()");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// fMenuDock = new TGDockableFrame(this);
|
||||
// AddFrame(fMenuDock, new TGLayoutHints(kLHintsExpandX, 0, 0, 1, 0));
|
||||
// fMenuDock->SetWindowName("GuiTest Menu");
|
||||
|
||||
fMenuBarLayout = new TGLayoutHints(kLHintsTop | kLHintsExpandX);
|
||||
fMenuBarItemLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
|
||||
fMenuBarHelpLayout = new TGLayoutHints(kLHintsTop | kLHintsRight);
|
||||
|
||||
fMenuFile = new TGPopupMenu(gClient->GetRoot());
|
||||
int im=0;
|
||||
|
||||
fMenuFile->AddEntry("Open Alias", im++);
|
||||
fMenuFile->AddEntry("Save Alias", im++);
|
||||
fMenuFile->AddSeparator();
|
||||
fMenuFile->AddEntry("Open Parameters", im++);
|
||||
fMenuFile->AddEntry("Save Parameters", im++);
|
||||
fMenuFile->AddSeparator();
|
||||
fMenuFile->AddEntry("Open Configuration", im++);
|
||||
fMenuFile->AddEntry("Save Configuration", im++);
|
||||
fMenuFile->AddSeparator();
|
||||
fMenuFile->AddEntry("Open Pattern", im++);
|
||||
fMenuFile->AddEntry("Save Pattern", im++);
|
||||
fMenuFile->AddSeparator();
|
||||
fMenuFile->AddEntry("Exit", im++);
|
||||
|
||||
fMenuFile->Connect("Activated(Int_t)", "ctbMain", this,
|
||||
"HandleMenu(Int_t)");
|
||||
|
||||
|
||||
i_dacs=-1;
|
||||
i_pwrs=-1;
|
||||
i_senses=-1;
|
||||
i_sig=-1;
|
||||
i_adcs=-1;
|
||||
i_pat=-1;
|
||||
i_acq=-1;
|
||||
|
||||
int i_page=0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
TGVerticalFrame *vframe=new TGVerticalFrame(this, 800,1200); //main frame
|
||||
|
||||
|
||||
|
||||
fMenuBar = new TGMenuBar(vframe, 1, 1, kHorizontalFrame);
|
||||
fMenuBar->AddPopup("&File", fMenuFile, fMenuBarItemLayout);
|
||||
// fMenuBar->AddPopup("&Test", fMenuTest, fMenuBarItemLayout);
|
||||
// fMenuBar->AddPopup("&View", fMenuView, fMenuBarItemLayout);
|
||||
// fMenuBar->AddPopup("&Help", fMenuHelp, fMenuBarHelpLayout);
|
||||
|
||||
vframe->AddFrame(fMenuBar, fMenuBarLayout);
|
||||
|
||||
TGHorizontalFrame* hpage=new TGHorizontalFrame(vframe, 800,1200); //horizontal frame. Inside there should be the tab and the canvas
|
||||
mtab=new TGTab(hpage, 1500, 1200); //tab!
|
||||
// page=new TGVerticalFrame(mtab, 1500,1200);
|
||||
|
||||
cout << "DACS" << endl;
|
||||
|
||||
TGCompositeFrame *tf = mtab->AddTab("DACs");
|
||||
TGVerticalFrame *page=new TGVerticalFrame(tf, 1500,1200);
|
||||
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
dacs=new ctbDacs(page, myDet);
|
||||
i_dacs=i_page++;
|
||||
|
||||
|
||||
cout << "power " << endl;
|
||||
tf = mtab->AddTab("Power Supplies");
|
||||
page=new TGVerticalFrame(tf, 1500,1200);
|
||||
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
pwrs=new ctbPowers(page, myDet);
|
||||
|
||||
i_pwrs=i_page++;
|
||||
|
||||
cout << "sense " << endl;
|
||||
tf = mtab->AddTab("Sense");
|
||||
page=new TGVerticalFrame(tf, 1500,1200);
|
||||
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
senses=new ctbSlowAdcs(page, myDet);
|
||||
|
||||
i_senses=i_page++;
|
||||
|
||||
|
||||
|
||||
cout << "signals " << endl;
|
||||
tf = mtab->AddTab("Signals");
|
||||
page=new TGVerticalFrame(tf, 1500,1200);
|
||||
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
sig=new ctbSignals(page, myDet);
|
||||
sig->Connect("ToggledSignalPlot(Int_t)","ctbMain",this,"setSignalPlot(Int_t)");
|
||||
|
||||
i_sig=i_page++;
|
||||
|
||||
cout << "adcs " << endl;
|
||||
tf = mtab->AddTab("ADCs");
|
||||
page=new TGVerticalFrame(tf, 1500,1200);
|
||||
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
adcs=new ctbAdcs(page, myDet);
|
||||
adcs->Connect("ToggledAdcPlot(Int_t)","ctbMain",this,"setADCPlot(Int_t)");
|
||||
adcs->Connect("AdcEnable(Int_t)","ctbMain",this,"setADCEnable(Int_t)");
|
||||
i_adcs=i_page++;
|
||||
|
||||
|
||||
cout << "pattern" << endl;
|
||||
|
||||
tf = mtab->AddTab("Pattern");
|
||||
page=new TGVerticalFrame(tf, 1500,1200);
|
||||
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
pat=new ctbPattern(page, myDet);
|
||||
pat->Connect("patternFileChanged(const char*)","ctbMain",this,"setPatternFile(const char*)");
|
||||
pat->Connect("patternCompilerChanged(const char*)","ctbMain",this,"setPatternCompiler(const char*)");
|
||||
pat->Connect("analogSamplesChanged(const int)","ctbMain",this,"setAnalogSamples(int)");
|
||||
pat->Connect("digitalSamplesChanged(const int)","ctbMain",this,"setDigitalSamples(int)");
|
||||
pat->Connect("readoutModeChanged(int)","ctbMain",this,"setReadoutMode(int)");
|
||||
|
||||
i_pat=i_page++;
|
||||
|
||||
cout << "acquisition" << endl;
|
||||
|
||||
tf = mtab->AddTab("Acquisition");
|
||||
page=new TGVerticalFrame(tf, 1500,1200);
|
||||
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
acq=new ctbAcquisition(page, myDet);
|
||||
|
||||
|
||||
i_acq=i_page++;
|
||||
|
||||
|
||||
// cout << "actions" << endl;
|
||||
// tf = mtab->AddTab("Actions");
|
||||
// page=new TGVerticalFrame(tf, 1500,1200);
|
||||
// tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
// actions=new ctbActions(page, myDet);
|
||||
|
||||
|
||||
// i_actions=i_page++;
|
||||
|
||||
|
||||
|
||||
cout << "tabs finished" << endl;
|
||||
|
||||
hpage->AddFrame(mtab,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
|
||||
vframe->AddFrame(hpage,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
|
||||
AddFrame(vframe,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
vframe->MapWindow();
|
||||
hpage->MapWindow();
|
||||
mtab->MapWindow();
|
||||
page->MapWindow();
|
||||
|
||||
// Sets window name and shows the main frame
|
||||
cout << "dockabel" << endl;
|
||||
TGDockableFrame *fdock=new TGDockableFrame(hpage);
|
||||
hpage->AddFrame(fdock, new TGLayoutHints(kLHintsBottom | kLHintsCenterX | kLHintsExpandX | kLHintsExpandY, 10,10,10,10));
|
||||
fdock->MapWindow();
|
||||
|
||||
cout << "canvas" << endl;
|
||||
// // Creates widgets of the example
|
||||
|
||||
|
||||
fEcanvas = new TRootEmbeddedCanvas ("Ecanvas",fdock,800,800);//hpage,800,800);
|
||||
//fEcanvas = new TRootEmbeddedCanvas ("Ecanvas",this,800,800);//hpage,800,800);
|
||||
// fEcanvas->Resize();
|
||||
// fEcanvas->GetCanvas()->Update();
|
||||
//AddFrame(fEcanvas, new TGLayoutHints(kLHintsBottom | kLHintsCenterX | kLHintsExpandX | kLHintsExpandY, 10,10,10,10));
|
||||
|
||||
// // hpage->
|
||||
fdock->AddFrame(fEcanvas, new TGLayoutHints(kLHintsBottom | kLHintsCenterX | kLHintsExpandX | kLHintsExpandY, 10,10,10,10));
|
||||
|
||||
|
||||
fEcanvas->MapWindow();
|
||||
|
||||
acq->setCanvas(getCanvas());
|
||||
|
||||
|
||||
|
||||
hpage->MapSubwindows();
|
||||
mtab->Connect("Selected(Int_t)","ctbMain",this,"tabSelected(Int_t)");
|
||||
|
||||
|
||||
|
||||
cout << "connect mtab" << endl;
|
||||
|
||||
try{
|
||||
setReadoutMode(pat->getReadoutMode());
|
||||
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
|
||||
|
||||
setADCEnable(adcs->setEnable());
|
||||
setAnalogSamples(pat->getAnalogSamples());
|
||||
setDigitalSamples(pat->getDigitalSamples());
|
||||
|
||||
tabSelected(0);
|
||||
|
||||
SetWindowName("CTB Gui");
|
||||
MapSubwindows();
|
||||
Resize(1500,1200);
|
||||
|
||||
MapWindow();
|
||||
}
|
||||
|
||||
void ctbMain::CloseWindow() {
|
||||
gApplication->Terminate();
|
||||
}
|
||||
|
||||
TCanvas* ctbMain::getCanvas() {
|
||||
return fEcanvas->GetCanvas();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbMain::HandleMenu(Int_t id)
|
||||
{
|
||||
// Handle menu items.
|
||||
|
||||
|
||||
|
||||
|
||||
switch (id) {
|
||||
|
||||
case 0: // fMenuFile->AddEntry("Open Alias", im++);
|
||||
cout << "Open Alias" << endl;
|
||||
{
|
||||
static TString dir(".");
|
||||
TGFileInfo fi;
|
||||
//fi.fFileTypes = filetypes;
|
||||
fi.fIniDir = StrDup(dir);
|
||||
printf("fIniDir = %s\n", fi.fIniDir);
|
||||
new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
|
||||
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
|
||||
// dir = fi.fIniDir;
|
||||
if (fi.fFilename)
|
||||
loadAlias(fi.fFilename);
|
||||
}
|
||||
break;
|
||||
|
||||
case 1: // fMenuFile->AddEntry("Save Alias", im++);
|
||||
cout << "Save Alias" << endl;
|
||||
{
|
||||
static TString dir(".");
|
||||
TGFileInfo fi;
|
||||
//fi.fFileTypes = filetypes;
|
||||
fi.fIniDir = StrDup(dir);
|
||||
printf("fIniDir = %s\n", fi.fIniDir);
|
||||
new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
|
||||
printf("Save file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
|
||||
// dir = fi.fIniDir;
|
||||
if (fi.fFilename)
|
||||
saveAlias(fi.fFilename);
|
||||
}
|
||||
break;
|
||||
case 2: //fMenuFile->AddEntry("Open Parameters", im++);
|
||||
cout << "Open Parameters" << endl;
|
||||
{
|
||||
static TString dir(".");
|
||||
TGFileInfo fi;
|
||||
//fi.fFileTypes = filetypes;
|
||||
fi.fIniDir = StrDup(dir);
|
||||
printf("fIniDir = %s\n", fi.fIniDir);
|
||||
new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
|
||||
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
|
||||
// dir = fi.fIniDir;
|
||||
if (fi.fFilename)
|
||||
loadParameters(fi.fFilename);
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: // fMenuFile->AddEntry("Open Configuration", im++);
|
||||
cout << "Open configuration" << endl;
|
||||
{
|
||||
static TString dir(".");
|
||||
TGFileInfo fi;
|
||||
//fi.fFileTypes = filetypes;
|
||||
fi.fIniDir = StrDup(dir);
|
||||
printf("fIniDir = %s\n", fi.fIniDir);
|
||||
new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
|
||||
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
|
||||
// dir = fi.fIniDir;
|
||||
if (fi.fFilename)
|
||||
loadConfiguration(fi.fFilename);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: //fMenuFile->AddEntry("Open Pattern", im++);
|
||||
cout << "Open pattern" << endl;
|
||||
{
|
||||
static TString dir(".");
|
||||
TGFileInfo fi;
|
||||
//fi.fFileTypes = filetypes;
|
||||
fi.fIniDir = StrDup(dir);
|
||||
printf("fIniDir = %s\n", fi.fIniDir);
|
||||
new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
|
||||
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
|
||||
// dir = fi.fIniDir;
|
||||
if (fi.fFilename)
|
||||
loadParameters(fi.fFilename);
|
||||
}
|
||||
break;
|
||||
|
||||
case 5: //fMenuFile->AddEntry("Save Pattern", im++);
|
||||
cout << "Save pattern" << endl;
|
||||
{
|
||||
static TString dir(".");
|
||||
TGFileInfo fi;
|
||||
//fi.fFileTypes = filetypes;
|
||||
fi.fIniDir = StrDup(dir);
|
||||
printf("fIniDir = %s\n", fi.fIniDir);
|
||||
new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
|
||||
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
|
||||
// dir = fi.fIniDir;
|
||||
if (fi.fFilename)
|
||||
savePattern(fi.fFilename);
|
||||
}
|
||||
break;
|
||||
|
||||
case 6: // fMenuFile->AddEntry("Exit", im++);
|
||||
CloseWindow();
|
||||
|
||||
default:
|
||||
printf("Menu item %d selected\n", id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ctbMain::setADCPlot(Int_t i) {
|
||||
|
||||
// cout << "ADC " << i << " plot or color toggled" << endl;
|
||||
// acq->setGraph(i,adcs->getGraph(i));
|
||||
acq->setGraph(i,adcs->getEnabled(i),adcs->getColor(i));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int ctbMain::setSignalPlot(Int_t i) {
|
||||
|
||||
// cout << "ADC " << i << " plot or color toggled" << endl;
|
||||
// acq->setGraph(i,adcs->getGraph(i));
|
||||
acq->setBitGraph(i,sig->getPlot(i),sig->getColor(i));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbMain::loadConfiguration(string fname) {
|
||||
try{
|
||||
myDet->loadConfig(fname);
|
||||
} CATCH_DISPLAY ("Could not load config.", "ctbMain::loadConfiguration")
|
||||
}
|
||||
|
||||
void ctbMain::loadParameters(string fname) {
|
||||
try{
|
||||
myDet->loadParameters(fname);
|
||||
} CATCH_DISPLAY ("Could not load parameters.", "ctbMain::loadParameters")
|
||||
}
|
||||
|
||||
void ctbMain::savePattern(string fname) {
|
||||
try{
|
||||
myDet->savePattern(fname);
|
||||
} CATCH_DISPLAY ("Could not save pattern.", "ctbMain::savePattern")
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ctbMain::loadAlias(string fname) {
|
||||
|
||||
|
||||
string line;
|
||||
char aaaa[1000];
|
||||
int i;
|
||||
ifstream myfile (fname.c_str());
|
||||
if (myfile.is_open())
|
||||
{
|
||||
while ( getline (myfile,line) )
|
||||
{
|
||||
// cout << line ;
|
||||
if (sscanf(line.c_str(),"BIT%d",&i)>0) {
|
||||
//cout << "*******" << line<< endl;
|
||||
sig->setSignalAlias(line);
|
||||
// cout << line ;
|
||||
} else if (sscanf(line.c_str(),"DAC%d",&i)>0) {
|
||||
dacs->setDacAlias(line);
|
||||
// cout << "+++++++++" << line<< endl;
|
||||
} else if (sscanf(line.c_str(),"ADC%d",&i)>0) {
|
||||
adcs->setAdcAlias(line);
|
||||
// cout << "---------" << line<< endl;
|
||||
} // else
|
||||
// cout << "<<<<<<<" << line << endl;
|
||||
else if (sscanf(line.c_str(),"PAT%s",aaaa)>0) {
|
||||
pat->setPatternAlias(line);
|
||||
// cout << "---------" << line<< endl;
|
||||
} else if (sscanf(line.c_str(),"V%s",aaaa)>0) {
|
||||
if (pwrs) pwrs->setPwrAlias(line);
|
||||
// cout << "+++++++++" << line<< endl;
|
||||
} else if (sscanf(line.c_str(),"SENSE%d",&i)>0) {
|
||||
if (senses) senses->setSlowAdcAlias(line);
|
||||
// cout << "+++++++++" << line<< endl;
|
||||
}
|
||||
|
||||
}
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
else cout << "Unable to open file";
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int ctbMain::saveAlias(string fname) {
|
||||
|
||||
|
||||
string line;
|
||||
ofstream myfile (fname.c_str());
|
||||
if (myfile.is_open())
|
||||
{
|
||||
//while ( getline (myfile,line) )
|
||||
// {
|
||||
// cout << line ;
|
||||
//if (sscanf(line.c_str(),"BIT%d",&i)>0) {
|
||||
//cout << "*******" << line<< endl;
|
||||
myfile << sig->getSignalAlias();
|
||||
// cout << line ;
|
||||
// } else if (sscanf(line.c_str(),"DAC%d",&i)>0) {
|
||||
myfile << dacs->getDacAlias();
|
||||
if (pwrs) myfile << pwrs->getPwrAlias();
|
||||
if (senses) myfile << senses->getSlowAdcAlias();
|
||||
// cout << "+++++++++" << line<< endl;
|
||||
// } else if (sscanf(line.c_str(),"ADC%d",&i)>0) {
|
||||
myfile << adcs->getAdcAlias();
|
||||
// cout << "---------" << line<< endl;
|
||||
// } // else
|
||||
// cout << "<<<<<<<" << line << endl;
|
||||
myfile << pat->getPatternAlias();
|
||||
|
||||
//}
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
else cout << "Unable to open file";
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void ctbMain::tabSelected(Int_t i) {
|
||||
|
||||
// cout << "Selected tab " << i << endl;
|
||||
// cout << "Current tab is " << mtab->GetCurrent() << endl;
|
||||
|
||||
if (i==i_dacs) dacs->update();
|
||||
else if (i==i_pwrs) pwrs->update();
|
||||
else if (i==i_senses) ;//senses->update();
|
||||
else if (i==i_sig) sig->update();
|
||||
else if (i==i_adcs) adcs->update();
|
||||
else if (i==i_pat) pat->update();
|
||||
else if (i==i_acq) acq->update();
|
||||
else if (i==i_acq) acq->update();
|
||||
// else if (i==i_actions) actions->update();
|
||||
else cout << "Unknown tab " << i << endl;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ctbMain::setPatternFile(const char* t) {
|
||||
acq->setPatternFile(t);
|
||||
|
||||
}
|
||||
|
||||
void ctbMain::setPatternCompiler(const char* t) {
|
||||
acq->setPatternCompiler(t);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ctbMain::setAnalogSamples(const int n) {
|
||||
acq->setAnalogSamples(n);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ctbMain::setDigitalSamples(const int n) {
|
||||
acq->setDigitalSamples(n);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ctbMain::setReadoutMode(int flags) {
|
||||
acq->setReadoutMode(flags);
|
||||
}
|
||||
|
||||
void ctbMain::setADCEnable(Int_t reg){
|
||||
acq->setADCEnable(reg);
|
||||
}
|
128
ctbGui/ctbMain.h
Executable file
128
ctbGui/ctbMain.h
Executable file
@ -0,0 +1,128 @@
|
||||
#ifndef CTBMAIN_H
|
||||
#define CTBMAIN_H
|
||||
#include <TGFrame.h>
|
||||
|
||||
|
||||
class TRootEmbeddedCanvas;
|
||||
class TGButtonGroup;
|
||||
class TGVerticalFrame;
|
||||
class TGHorizontalFrame;
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TH2F;
|
||||
class TGComboBox;
|
||||
class TGCheckButton;
|
||||
|
||||
class THStack;
|
||||
class TGraphErrors;
|
||||
class TGTextButton;
|
||||
class TGTab;
|
||||
|
||||
class TGMenuBar;
|
||||
class TGPopupMenu;
|
||||
class TGDockableFrame;
|
||||
class TGLayoutHints;
|
||||
class TGCanvas;
|
||||
class TCanvas;
|
||||
|
||||
class ctbDacs;
|
||||
class ctbSlowAdcs;
|
||||
class ctbPowers;
|
||||
|
||||
|
||||
class ctbSignals;
|
||||
|
||||
namespace sls
|
||||
{
|
||||
class Detector;
|
||||
};
|
||||
|
||||
class ctbPattern;
|
||||
class ctbAdcs;
|
||||
class ctbAcquisition;
|
||||
//class ctbActions;
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
class ctbMain : public TGMainFrame {
|
||||
private:
|
||||
|
||||
|
||||
sls::Detector *myDet;
|
||||
|
||||
|
||||
|
||||
TRootEmbeddedCanvas *fEcanvas;
|
||||
TRootEmbeddedCanvas *fModulecanvas;
|
||||
TGButtonGroup *br;
|
||||
|
||||
TGTab *mtab;
|
||||
|
||||
|
||||
ctbDacs *dacs;
|
||||
int i_dacs;
|
||||
|
||||
ctbPowers *pwrs;
|
||||
int i_pwrs;
|
||||
|
||||
ctbSlowAdcs *senses;
|
||||
int i_senses;
|
||||
|
||||
|
||||
ctbSignals *sig;
|
||||
int i_sig;
|
||||
|
||||
|
||||
ctbAdcs *adcs;
|
||||
int i_adcs;
|
||||
|
||||
|
||||
ctbPattern *pat;
|
||||
int i_pat;
|
||||
|
||||
ctbAcquisition *acq;
|
||||
int i_acq;
|
||||
|
||||
// ctbActions *actions;
|
||||
int i_actions;
|
||||
|
||||
TGDockableFrame *fMenuDock;
|
||||
|
||||
TGMenuBar *fMenuBar;
|
||||
TGPopupMenu *fMenuFile, *fMenuTest, *fMenuView, *fMenuHelp;
|
||||
TGPopupMenu *fCascadeMenu, *fCascade1Menu, *fCascade2Menu;
|
||||
TGPopupMenu *fMenuNew1, *fMenuNew2;
|
||||
TGLayoutHints *fMenuBarLayout, *fMenuBarItemLayout, *fMenuBarHelpLayout;
|
||||
TGCanvas *myCanvas;
|
||||
|
||||
|
||||
public:
|
||||
ctbMain(const TGWindow *p, sls::Detector *det);
|
||||
|
||||
|
||||
int loadAlias(string fname);
|
||||
int saveAlias(string fname);
|
||||
void loadParameters(string fname);
|
||||
void savePattern(string fname);
|
||||
void loadConfiguration(string fname);
|
||||
void tabSelected(Int_t);
|
||||
int setADCPlot(Int_t);
|
||||
int setSignalPlot(Int_t);
|
||||
void CloseWindow();
|
||||
|
||||
void setPatternFile(const char* t);
|
||||
|
||||
void setPatternCompiler(const char* t);
|
||||
void setAnalogSamples(const int);
|
||||
void setDigitalSamples(const int);
|
||||
void setReadoutMode(int);
|
||||
void setADCEnable(Int_t);
|
||||
|
||||
void HandleMenu(Int_t);
|
||||
TCanvas* getCanvas();
|
||||
ClassDef(ctbMain,0)
|
||||
};
|
||||
|
||||
#endif
|
1109
ctbGui/ctbPattern.cpp
Executable file
1109
ctbGui/ctbPattern.cpp
Executable file
File diff suppressed because it is too large
Load Diff
179
ctbGui/ctbPattern.h
Executable file
179
ctbGui/ctbPattern.h
Executable file
@ -0,0 +1,179 @@
|
||||
#ifndef CTBPATTERN_H
|
||||
#define CTBPATTERN_H
|
||||
#include <TGFrame.h>
|
||||
|
||||
|
||||
#define NLOOPS 3
|
||||
#define NWAITS 3
|
||||
#define NADCS 32
|
||||
#define PATLEN 1024
|
||||
|
||||
class TRootEmbeddedCanvas;
|
||||
class TGButtonGroup;
|
||||
class TGVerticalFrame;
|
||||
class TGHorizontalFrame;
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TH2F;
|
||||
class TGComboBox;
|
||||
class TGCheckButton;
|
||||
class TGTextEntry;
|
||||
class TGCheckButton;
|
||||
|
||||
class THStack;
|
||||
class TGraphErrors;
|
||||
class energyCalibration;
|
||||
class TGTextButton;
|
||||
class TGTab;
|
||||
|
||||
namespace sls
|
||||
{
|
||||
class Detector;
|
||||
};
|
||||
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
class ctbLoop : public TGHorizontalFrame {
|
||||
|
||||
|
||||
private:
|
||||
|
||||
TGNumberEntry *eLoopStartAddr;
|
||||
TGNumberEntry *eLoopStopAddr;
|
||||
TGNumberEntry *eLoopNumber;
|
||||
|
||||
int id;
|
||||
|
||||
sls::Detector *myDet;
|
||||
|
||||
public:
|
||||
ctbLoop(TGGroupFrame *page, int i,sls::Detector *det);
|
||||
|
||||
void setNLoops();
|
||||
void update();
|
||||
|
||||
ClassDef(ctbLoop,0)
|
||||
};
|
||||
|
||||
class ctbWait : public TGHorizontalFrame {
|
||||
|
||||
|
||||
private:
|
||||
|
||||
TGNumberEntry *eWaitAddr;
|
||||
TGNumberEntry *eWaitTime;
|
||||
|
||||
int id;
|
||||
|
||||
sls::Detector *myDet;
|
||||
|
||||
public:
|
||||
ctbWait(TGGroupFrame *page, int i,sls::Detector *det);
|
||||
|
||||
void setWaitTime();
|
||||
void update();
|
||||
|
||||
ClassDef(ctbWait,0)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class ctbPattern : public TGGroupFrame {
|
||||
private:
|
||||
|
||||
|
||||
TGNumberEntry *eAdcClkFreq;
|
||||
TGNumberEntry *eRunClkFreq;
|
||||
TGNumberEntry *eDBitClkFreq;
|
||||
TGNumberEntry *eAdcClkPhase;
|
||||
TGNumberEntry *eDBitClkPhase;
|
||||
//TGNumberEntry *eRunClkPhase;
|
||||
|
||||
TGNumberEntry *eStartAddr;
|
||||
TGNumberEntry *eStopAddr;
|
||||
TGNumberEntry *eFrames;
|
||||
TGNumberEntry *ePeriod;
|
||||
TGNumberEntry *eTriggers;
|
||||
// TGNumberEntry *eMeasurements;
|
||||
TGNumberEntry *eAdcPipeline;
|
||||
TGNumberEntry *eDBitPipeline;
|
||||
|
||||
ctbLoop *eLoop[NLOOPS];
|
||||
ctbWait *eWait[NWAITS];
|
||||
|
||||
TGTextEntry *patternCompiler;
|
||||
TGTextEntry *patternFile;
|
||||
|
||||
TGTextButton *browseCompiler;
|
||||
TGTextButton *browseFile;
|
||||
|
||||
|
||||
TGNumberEntry *eAnalogSamples;
|
||||
TGNumberEntry *eDigitalSamples;
|
||||
|
||||
TGCheckButton *cbAnalog;
|
||||
TGCheckButton *cbDigital;
|
||||
|
||||
char pat[PATLEN*8];
|
||||
|
||||
sls::Detector *myDet;
|
||||
|
||||
public:
|
||||
|
||||
ctbPattern(TGVerticalFrame *page, sls::Detector *det);
|
||||
|
||||
void update();
|
||||
void setAdcFreq();
|
||||
void setRunFreq();
|
||||
void setDBitFreq();
|
||||
void setAdcPhase();
|
||||
void setDBitPhase();
|
||||
// void setRunPhase();
|
||||
void setAdcPipeline();
|
||||
void setDBitPipeline();
|
||||
void setFrames();
|
||||
void setTriggers();
|
||||
// void setMeasurements();
|
||||
void setPeriod();
|
||||
|
||||
|
||||
void chooseCompiler();
|
||||
void choosePattern();
|
||||
|
||||
string getCompiler();
|
||||
string getPatternFile();
|
||||
|
||||
void setPatternAlias(string);
|
||||
string getPatternAlias();
|
||||
|
||||
|
||||
int getAnalogSamples();
|
||||
void setAnalogSamples();
|
||||
int getDigitalSamples();
|
||||
void setDigitalSamples();
|
||||
void setReadoutMode(Bool_t);
|
||||
int getReadoutMode();
|
||||
|
||||
|
||||
void setFile();
|
||||
void setCompiler();
|
||||
void patternFileChanged(const char*);
|
||||
void patternCompilerChanged(const char*);
|
||||
void analogSamplesChanged(const int t);
|
||||
void digitalSamplesChanged(const int t);
|
||||
void readoutModeChanged(int);
|
||||
|
||||
|
||||
ClassDef(ctbPattern,0)
|
||||
};
|
||||
|
||||
#endif
|
223
ctbGui/ctbPowers.cpp
Normal file
223
ctbGui/ctbPowers.cpp
Normal file
@ -0,0 +1,223 @@
|
||||
#include <TGFrame.h>
|
||||
|
||||
|
||||
#include <TGButtonGroup.h>
|
||||
#include <TGNumberEntry.h>
|
||||
#include <TGLabel.h>
|
||||
#include <TList.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include "ctbDefs.h"
|
||||
#include "ctbDacs.h"
|
||||
#include "ctbPowers.h"
|
||||
#include "Detector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
ctbPower::ctbPower(TGGroupFrame* f, int i, sls::Detector* d)
|
||||
: ctbDac(f, i, d)
|
||||
{
|
||||
cout << "****************************************************************power " << i << endl;
|
||||
dacsUnit->SetOn(kTRUE);
|
||||
dacsUnit->SetEnabled(kFALSE);
|
||||
|
||||
switch(i) {
|
||||
case slsDetectorDefs::V_POWER_IO:
|
||||
dacsLabel->SetText("VIO");
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_A:
|
||||
dacsLabel->SetText("VA");
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_B:
|
||||
dacsLabel->SetText("VB");
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_C:
|
||||
dacsLabel->SetText("VC");
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_D:
|
||||
dacsLabel->SetText("VD");
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_CHIP:
|
||||
dacsLabel->SetText("VCHIP");
|
||||
dacsLabel->SetEnabled(kFALSE);
|
||||
break;
|
||||
default:
|
||||
dacsLabel->SetText("Bad index");
|
||||
break;
|
||||
};
|
||||
|
||||
|
||||
TGTextEntry *e=dacsEntry->TGNumberEntry::GetNumberEntry();
|
||||
e->Disconnect ("ReturnPressed()");
|
||||
e->Disconnect ("ValueSet(Long_t)");
|
||||
|
||||
e->Connect("ReturnPressed()","ctbPower",this,"setValue()");
|
||||
dacsEntry->Connect("ValueSet(Long_t)","ctbPower",this,"setValue(Long_t)");
|
||||
};
|
||||
|
||||
|
||||
string ctbPower::getLabel() {
|
||||
|
||||
ostringstream line;
|
||||
switch (id) {
|
||||
case slsDetectorDefs::V_POWER_IO:
|
||||
line << "VIO";
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_A:
|
||||
line << "VA";
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_B:
|
||||
line << "VB";
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_C:
|
||||
line << "VC";
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_D:
|
||||
line << "VD";
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_CHIP:
|
||||
line << "VCHIP";
|
||||
break;
|
||||
default:
|
||||
line << "VBAD";
|
||||
break;
|
||||
|
||||
}
|
||||
line << " " << dacsLabel->GetText() << endl;
|
||||
return line.str();
|
||||
}
|
||||
|
||||
void ctbPower::setValue(Long_t a) {ctbPower::setValue();}
|
||||
|
||||
void ctbPower::setValue() {
|
||||
cout << "***************************Setting power " << dacsEntry->GetIntNumber() << " " << id << " " << 1 << endl;
|
||||
|
||||
try {
|
||||
myDet->setVoltage(static_cast<slsDetectorDefs::dacIndex>(id), dacsEntry->GetIntNumber());
|
||||
} CATCH_DISPLAY ("Could not set power " + to_string(id) + ".", "ctbPower::setValue")
|
||||
|
||||
getValue();
|
||||
}
|
||||
|
||||
|
||||
int ctbPower::getValue() {
|
||||
try {
|
||||
|
||||
int val = myDet->getVoltage(static_cast<slsDetectorDefs::dacIndex>(id)).tsquash("Different values");
|
||||
cout << "****************************Getting power " << val << " " << id << " " << 1 << endl;
|
||||
|
||||
dacsValue->SetText(to_string(val).c_str());
|
||||
if (val > 0) {
|
||||
if (id != static_cast<int>(slsDetectorDefs::V_POWER_CHIP))
|
||||
dacsLabel->SetOn(kTRUE);
|
||||
} else {
|
||||
dacsLabel->SetOn(kFALSE);
|
||||
}
|
||||
|
||||
return val;
|
||||
|
||||
} CATCH_DISPLAY ("Could not get power " + to_string(id) + ".", "ctbPower::getValue")
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ctbPowers::ctbPowers(TGVerticalFrame* page, sls::Detector* det) : TGGroupFrame(page,"Power Supplies",kVerticalFrame) , myDet(det){
|
||||
|
||||
|
||||
SetTitlePos(TGGroupFrame::kLeft);
|
||||
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
|
||||
MapWindow();
|
||||
|
||||
// cout << "window mapped " << endl;
|
||||
|
||||
for (int idac=0; idac<NPOWERS; idac++) {
|
||||
dacs[idac]=new ctbPower(this, slsDetectorDefs::V_POWER_A+idac, myDet);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int ctbPowers::setPwrAlias(string line) {
|
||||
|
||||
int is=-1;
|
||||
char tit[100];
|
||||
|
||||
if (sscanf(line.c_str(),"VA %s",tit)) {
|
||||
dacs[0]->setLabel(tit,1);
|
||||
is=0;
|
||||
}
|
||||
|
||||
if (sscanf(line.c_str(),"VB %s",tit)) {
|
||||
dacs[1]->setLabel(tit,1);
|
||||
is=1;
|
||||
}
|
||||
|
||||
if (sscanf(line.c_str(),"VC %s",tit)) {
|
||||
dacs[2]->setLabel(tit,1);
|
||||
is=2;
|
||||
}
|
||||
|
||||
if (sscanf(line.c_str(),"VD %s",tit)) {
|
||||
dacs[3]->setLabel(tit,1);
|
||||
is=3;
|
||||
}
|
||||
|
||||
if (sscanf(line.c_str(),"VIO %s",tit)) {
|
||||
dacs[4]->setLabel(tit,1);
|
||||
is=4;
|
||||
}
|
||||
|
||||
if (sscanf(line.c_str(),"VCHIP %s",tit)) {
|
||||
dacs[5]->setLabel(tit,1);
|
||||
is=5;
|
||||
}
|
||||
|
||||
return is;
|
||||
|
||||
}
|
||||
|
||||
string ctbPowers::getPwrAlias() {
|
||||
|
||||
ostringstream line;
|
||||
|
||||
for (int i=0; i<NPOWERS; i++)
|
||||
line << dacs[i]->getLabel() << endl;
|
||||
return line.str();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
string ctbPowers::getPwrParameters() {
|
||||
|
||||
ostringstream line;
|
||||
line << "v_a" << " " << dacs[0]->getValue() << " mv" << endl;
|
||||
line << "v_b" << " " << dacs[1]->getValue() << " mv" << endl;
|
||||
line << "v_c" << " " << dacs[2]->getValue() << " mv" << endl;
|
||||
line << "v_d" << " " << dacs[3]->getValue() << " mv" << endl;
|
||||
line << "v_io" << " " << dacs[4]->getValue() << " mv" << endl;
|
||||
line << "v_chip" << " " << dacs[5]->getValue() << " mv" << endl;
|
||||
// for (int i=0; i<POWERS; i++) {
|
||||
// //line << "dacs:" << i << " " << dacs[i]->getValue << endl;
|
||||
// line << "dac:" << i << " " << dacs[i]->getValue() << endl;
|
||||
// }
|
||||
return line.str();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbPowers::update() {
|
||||
for (int idac=0; idac<NPOWERS; idac++) {
|
||||
dacs[idac]->getValue();
|
||||
|
||||
}
|
||||
}
|
67
ctbGui/ctbPowers.h
Normal file
67
ctbGui/ctbPowers.h
Normal file
@ -0,0 +1,67 @@
|
||||
#ifndef CTBPOWERS_H
|
||||
#define CTBPOWERS_H
|
||||
|
||||
#include <TGFrame.h>
|
||||
|
||||
#define NPOWERS 6
|
||||
|
||||
|
||||
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TGCheckButton;
|
||||
|
||||
|
||||
|
||||
|
||||
namespace sls
|
||||
{
|
||||
class Detector;
|
||||
};
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
|
||||
class ctbPower : public ctbDac {
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
ctbPower(TGGroupFrame* f, int i, sls::Detector* d);
|
||||
|
||||
string getLabel();
|
||||
|
||||
int getValue();
|
||||
void setValue();
|
||||
void setValue(Long_t);
|
||||
|
||||
ClassDef(ctbPower,0)
|
||||
};
|
||||
|
||||
|
||||
class ctbPowers : public TGGroupFrame
|
||||
{
|
||||
private:
|
||||
|
||||
ctbPower *dacs[NPOWERS];
|
||||
|
||||
sls::Detector* myDet;
|
||||
|
||||
public:
|
||||
//ctbPowers();
|
||||
ctbPowers(TGVerticalFrame*, sls::Detector*);
|
||||
|
||||
int setPwrAlias(string);
|
||||
string getPwrAlias();
|
||||
string getPwrParameters();
|
||||
|
||||
void update();
|
||||
|
||||
ClassDef(ctbPowers,0)
|
||||
};
|
||||
|
||||
#endif
|
541
ctbGui/ctbSignals.cpp
Executable file
541
ctbGui/ctbSignals.cpp
Executable file
@ -0,0 +1,541 @@
|
||||
#include <TApplication.h>
|
||||
#include <TGClient.h>
|
||||
#include <TCanvas.h>
|
||||
#include <TF1.h>
|
||||
#include <TRandom.h>
|
||||
#include <TGButton.h>
|
||||
#include <TRootEmbeddedCanvas.h>
|
||||
#include <TGButtonGroup.h>
|
||||
#include <TGNumberEntry.h>
|
||||
#include <TGLabel.h>
|
||||
#include <TList.h>
|
||||
#include <TGFileDialog.h>
|
||||
#include <TGComboBox.h>
|
||||
#include <TH2F.h>
|
||||
#include <TColor.h>
|
||||
#include <TH1F.h>
|
||||
#include <TGraphErrors.h>
|
||||
#include <THStack.h>
|
||||
#include <TGTab.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <TGButton.h>
|
||||
#include <TRootEmbeddedCanvas.h>
|
||||
#include <TGButtonGroup.h>
|
||||
#include <TGNumberEntry.h>
|
||||
#include <TGLabel.h>
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <TColor.h>
|
||||
#include <TGColorSelect.h>
|
||||
|
||||
|
||||
#include "ctbSignals.h"
|
||||
#include "ctbDefs.h"
|
||||
#include "Detector.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
//#define DEFAULTFN "run_0.encal"
|
||||
|
||||
|
||||
ctbSignal::ctbSignal(TGFrame *page, int i, sls::Detector *det)
|
||||
: TGHorizontalFrame(page, 800,50), myDet(det), id(i), hsig(NULL) {
|
||||
|
||||
|
||||
TGHorizontalFrame *hframe=this;
|
||||
char tit[100];
|
||||
|
||||
|
||||
|
||||
sprintf(tit, "BIT%d ",id);
|
||||
|
||||
sLabel= new TGLabel(hframe, tit);
|
||||
hframe->AddFrame( sLabel,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sLabel->MapWindow();
|
||||
sLabel->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
|
||||
sOutput= new TGCheckButton(hframe, "Out");
|
||||
hframe->AddFrame( sOutput,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sOutput->MapWindow();
|
||||
|
||||
|
||||
sOutput->Connect("Toggled(Bool_t)","ctbSignal",this,"ToggledOutput(Bool_t)");
|
||||
|
||||
sDbitList= new TGCheckButton(hframe, "DB List");
|
||||
hframe->AddFrame( sDbitList,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sDbitList->MapWindow();
|
||||
|
||||
sDbitList->Connect("Toggled(Bool_t)","ctbSignal",this,"ToggledDbitList(Bool_t)");
|
||||
|
||||
|
||||
sPlot= new TGCheckButton(hframe, "Plot");
|
||||
hframe->AddFrame( sPlot,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sPlot->MapWindow();
|
||||
|
||||
sPlot->Connect("Toggled(Bool_t)","ctbSignal",this,"ToggledPlot(Bool_t)");
|
||||
|
||||
fColorSel = new TGColorSelect(hframe, id+1, 0);
|
||||
fColorSel->Connect("ColorSelected(Pixel_t)","ctbSignal",this,"ColorChanged(Pixel_t)");
|
||||
hframe->AddFrame(fColorSel, new TGLayoutHints(kLHintsTop |
|
||||
kLHintsLeft, 2, 0, 2, 2));
|
||||
|
||||
|
||||
fColorSel->SetColor(TColor::Number2Pixel(id+1));
|
||||
|
||||
|
||||
ToggledOutput(kFALSE);
|
||||
|
||||
|
||||
ToggledPlot(kFALSE);
|
||||
|
||||
// if (id==63) {
|
||||
// sOutput->SetOn(kTRUE);
|
||||
// sOutput->SetEnabled(kFALSE);
|
||||
// }
|
||||
// #ifdef CTB
|
||||
// if (id==62) {
|
||||
// sOutput->SetOn(kTRUE);
|
||||
// sOutput->SetEnabled(kFALSE);
|
||||
// }
|
||||
|
||||
// // if (id>=32 && id<48)
|
||||
// // fixOutput(1);
|
||||
// // else if (id>=48 && id<64)
|
||||
// // fixOutput(0);
|
||||
|
||||
// #endif
|
||||
}
|
||||
int ctbSignal::setSignalAlias(char *tit, int plot, int col) {
|
||||
|
||||
if (tit)
|
||||
sLabel->SetText(tit);
|
||||
|
||||
if (plot>0) {
|
||||
sPlot->SetOn(kTRUE,kTRUE);
|
||||
} else if (plot==0)
|
||||
sPlot->SetOn(kFALSE,kTRUE);
|
||||
|
||||
if (col>=0)
|
||||
fColorSel->SetColor(col);//TColor::Number2Pixel(col+1));
|
||||
|
||||
fColorSel->SetEnabled(sPlot->IsOn());
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
string ctbSignal::getSignalAlias() {
|
||||
|
||||
|
||||
ostringstream oss;
|
||||
oss << "BIT" << dec << id << " " << sLabel->GetText()->Data() << " " << sPlot->IsOn() << hex << " " << fColorSel->GetColor() << endl;
|
||||
return oss.str();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
int ctbSignal::setOutput(Long64_t r) {
|
||||
|
||||
|
||||
// cout << hex << r << dec <<endl;
|
||||
|
||||
Long64_t mask=((Long64_t)1<<id);
|
||||
|
||||
if (r&mask)
|
||||
sOutput->SetOn(kTRUE,kTRUE);
|
||||
else
|
||||
sOutput->SetOn(kFALSE,kTRUE);
|
||||
|
||||
return sOutput->IsOn();
|
||||
|
||||
}
|
||||
|
||||
int ctbSignal::fixOutput(int i) {
|
||||
|
||||
if (i) {
|
||||
sPlot->SetOn(kFALSE);
|
||||
//sClock->SetOn(kFALSE,kTRUE);
|
||||
sOutput->SetOn(kTRUE);
|
||||
// sPlot->SetEnabled(kFALSE);
|
||||
// sClock->SetEnabled(kTRUE);
|
||||
} else {
|
||||
sOutput->SetOn(kFALSE,kTRUE);
|
||||
// sClock->SetOn(kFALSE);
|
||||
// sClock->SetEnabled(kFALSE);
|
||||
sPlot->SetEnabled(kTRUE);
|
||||
}
|
||||
sOutput->SetEnabled(kFALSE);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int ctbSignal::setDbitList(Long64_t r) {
|
||||
|
||||
if (r)
|
||||
sDbitList->SetOn(kTRUE,kFALSE);
|
||||
else
|
||||
sDbitList->SetOn(kFALSE,kFALSE);
|
||||
|
||||
return sDbitList->IsOn();
|
||||
|
||||
}
|
||||
|
||||
int ctbSignal::isDbitList() { return sDbitList->IsOn();}
|
||||
int ctbSignal::isOutput() { return sOutput->IsOn();}
|
||||
int ctbSignal::isPlot() { return sPlot->IsOn();}
|
||||
Pixel_t ctbSignal::getColor(){return fColorSel->GetColor();}
|
||||
|
||||
void ctbSignal::ToggledOutput(Bool_t b) {
|
||||
ToggledSignalOutput(id);
|
||||
if (b) {
|
||||
// sClock->SetEnabled(kTRUE);
|
||||
sPlot->SetOn(kFALSE);
|
||||
// sPlot->SetEnabled(kFALSE);
|
||||
fColorSel->SetEnabled(kFALSE);
|
||||
} else {
|
||||
// sClock->SetEnabled(kFALSE);
|
||||
// sClock->SetOn(kFALSE);
|
||||
sPlot->SetEnabled(kTRUE);
|
||||
if ( sPlot->IsOn())
|
||||
fColorSel->SetEnabled(kFALSE);
|
||||
else
|
||||
fColorSel->SetEnabled(kTRUE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ctbSignal::ToggledDbitList(Bool_t b){
|
||||
Long_t mask=id;
|
||||
ToggledSignalDbitList(mask);
|
||||
}
|
||||
|
||||
|
||||
void ctbSignal::ToggledPlot(Bool_t b){
|
||||
Long_t mask=b<<id;
|
||||
ToggledSignalPlot(mask);
|
||||
fColorSel->SetEnabled(b);
|
||||
}
|
||||
|
||||
void ctbSignal::ColorChanged(Pixel_t p){
|
||||
ToggledSignalPlot(id);
|
||||
}
|
||||
|
||||
|
||||
void ctbSignal::ToggledSignalOutput(Int_t b) {
|
||||
cout << "Toggle signal " << id << " " << b << " " << sOutput->IsOn() <<endl;;
|
||||
Emit("ToggledSignalOutput(Int_t)", id);
|
||||
}
|
||||
|
||||
void ctbSignal::ToggledSignalDbitList(Int_t b){
|
||||
cout << "Toggle dbitlist " << id << " " << b << endl;;
|
||||
Emit("ToggledSignalDbitList(Int_t)", id);
|
||||
}
|
||||
|
||||
void ctbSignal::ToggledSignalPlot(Int_t b){
|
||||
Emit("ToggledSignalPlot(Int_t)", id);
|
||||
}
|
||||
|
||||
|
||||
ctbSignals::ctbSignals(TGVerticalFrame *page, sls::Detector *det)
|
||||
: TGGroupFrame(page,"IO Signals",kVerticalFrame), myDet(det) {
|
||||
|
||||
|
||||
SetTitlePos(TGGroupFrame::kLeft);
|
||||
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
|
||||
MapWindow();
|
||||
|
||||
|
||||
TGHorizontalFrame *hframe;
|
||||
|
||||
TGHorizontalFrame* hhframe=new TGHorizontalFrame(this, 800,800);
|
||||
AddFrame(hhframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hhframe->MapWindow();
|
||||
|
||||
TGVerticalFrame *vframe;
|
||||
|
||||
|
||||
|
||||
|
||||
int idac=0;
|
||||
for (idac=0; idac<NSIGNALS; idac++) {
|
||||
if (idac%((NSIGNALS+2)/2)==0) {
|
||||
vframe=new TGVerticalFrame(hhframe, 400,800);
|
||||
hhframe->AddFrame(vframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
vframe->MapWindow();
|
||||
}
|
||||
|
||||
|
||||
signals[idac]=new ctbSignal(vframe,idac,myDet);
|
||||
signals[idac]->Connect("ToggledSignalOutput(Int_t)","ctbSignals",this,"ToggledOutReg(Int_t)");
|
||||
signals[idac]->Connect("ToggledSignalDbitList(Int_t)","ctbSignals",this,"ToggledDbitList(Int_t)");
|
||||
signals[idac]->Connect("ToggledSignalPlot(Int_t)","ctbSignals",this,"ToggledPlot(Int_t)");
|
||||
|
||||
vframe->AddFrame(signals[idac],new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
signals[idac]->MapWindow();
|
||||
|
||||
|
||||
}
|
||||
|
||||
hframe=new TGHorizontalFrame(vframe, 800,50);
|
||||
vframe->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
TGLabel *label= new TGLabel(hframe, "IO Control Register: ");
|
||||
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
label->MapWindow();
|
||||
label->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
eIOCntrlRegister = new TGNumberEntry(hframe, 0, 16,999, TGNumberFormat::kNESHex,
|
||||
TGNumberFormat::kNEANonNegative,
|
||||
TGNumberFormat::kNELNoLimits);
|
||||
|
||||
hframe->AddFrame(eIOCntrlRegister,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
|
||||
eIOCntrlRegister->MapWindow();
|
||||
eIOCntrlRegister->Resize(150,30);
|
||||
|
||||
|
||||
|
||||
|
||||
hframe=new TGHorizontalFrame(vframe, 800,50);
|
||||
vframe->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
label= new TGLabel(hframe, "DBit Offset: ");
|
||||
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
label->MapWindow();
|
||||
label->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
eDbitOffset = new TGNumberEntry(hframe, 0, 9,999, TGNumberFormat::kNESInteger,
|
||||
TGNumberFormat::kNEANonNegative,
|
||||
TGNumberFormat::kNELNoLimits);
|
||||
|
||||
hframe->AddFrame(eDbitOffset,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
|
||||
eDbitOffset->MapWindow();
|
||||
eDbitOffset->Resize(150,30);
|
||||
|
||||
|
||||
TGTextEntry *e= eDbitOffset->TGNumberEntry::GetNumberEntry();
|
||||
e->Connect("ReturnPressed()","ctbSignals",this,"setDbitOffset()");
|
||||
|
||||
e->Connect("ValueSet(Long_t)","ctbSignals",this,"setDbitOffset(Long_t)");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int ctbSignals::setSignalAlias(string line) {
|
||||
|
||||
int is=-1, plot=0, col=-1;
|
||||
char tit[100];
|
||||
int narg=sscanf(line.c_str(),"BIT%d %s %d %d",&is,tit,&plot,&col);
|
||||
if (narg<2)
|
||||
return -1;
|
||||
if (is>=0 && is<NIOSIGNALS) {
|
||||
signals[is]->setSignalAlias(tit,plot,col);
|
||||
}
|
||||
return is;
|
||||
|
||||
}
|
||||
|
||||
string ctbSignals::getSignalAlias() {
|
||||
|
||||
ostringstream oss;
|
||||
for (int is=0; is<NIOSIGNALS; is++)
|
||||
oss << signals[is]->getSignalAlias() << endl;
|
||||
|
||||
|
||||
return oss.str();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ctbSignals::update() {
|
||||
try {
|
||||
|
||||
Long64_t oreg = static_cast<Long64_t>(myDet->getPatternIOControl().tsquash("Different values"));
|
||||
cout << hex << oreg << dec << endl;
|
||||
|
||||
for (int idac=0; idac<NIOSIGNALS; idac++) {
|
||||
signals[idac]->setOutput(oreg);
|
||||
}
|
||||
|
||||
} CATCH_DISPLAY ("Could not get patternIOcontrol.", "ctbSignals::update")
|
||||
|
||||
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
||||
// enable all
|
||||
for (int is=0; is<64; is++) {
|
||||
signals[is]->setDbitList(1);
|
||||
}
|
||||
eDbitOffset->SetNumber(0);
|
||||
}
|
||||
|
||||
// ctb
|
||||
else {
|
||||
try {
|
||||
|
||||
auto dbitlist = myDet->getRxDbitList().tsquash("Different values");
|
||||
// enable all
|
||||
if (dbitlist.empty()) {
|
||||
for (int is=0; is<64; is++) {
|
||||
signals[is]->setDbitList(1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// disable all
|
||||
for (int is=0; is<64; is++) {
|
||||
signals[is]->setDbitList(0);
|
||||
}
|
||||
// enable selected
|
||||
for (const auto &value : dbitlist) {
|
||||
signals[value]->setDbitList(1);
|
||||
}
|
||||
}
|
||||
|
||||
} CATCH_DISPLAY ("Could not get receiver dbit list.", "ctbSignals::update")
|
||||
|
||||
try {
|
||||
auto val = myDet->getRxDbitOffset().tsquash("Different values");
|
||||
eDbitOffset->SetNumber(val);
|
||||
} CATCH_DISPLAY ("Could not get receiver dbit offset.", "ctbSignals::update")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
string ctbSignals::getSignalParameters() {
|
||||
|
||||
try {
|
||||
|
||||
auto val = myDet->getPatternIOControl().tsquash("Different values");
|
||||
ostringstream line;
|
||||
line << "patioctrl " << hex << val << dec << endl;
|
||||
return line.str();
|
||||
|
||||
} CATCH_DISPLAY ("Could not get patternIOcontrol.", "ctbSignals::getSignalParameters")
|
||||
|
||||
return ("");
|
||||
}
|
||||
|
||||
void ctbSignals::ToggledOutReg(Int_t mask) {
|
||||
try {
|
||||
|
||||
Long64_t oreg = static_cast<Long64_t>(myDet->getPatternIOControl().tsquash("Different values"));
|
||||
Long64_t m=((Long64_t)1)<<mask;
|
||||
cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg;
|
||||
|
||||
if (signals[mask]->isOutput()) {
|
||||
cout << " or " << m ;
|
||||
oreg|=m;
|
||||
} else {
|
||||
cout << " not " << ~m ;
|
||||
oreg&=~m;
|
||||
}
|
||||
cout << " after " << oreg << endl;
|
||||
|
||||
myDet->setPatternIOControl(static_cast<uint64_t>(oreg));
|
||||
oreg = static_cast<Long64_t>(myDet->getPatternIOControl().tsquash("Different values"));
|
||||
cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg << endl;
|
||||
|
||||
eIOCntrlRegister->SetText(to_string(oreg).c_str());
|
||||
|
||||
} CATCH_DISPLAY ("Could not get/set patternIOcontrol.", "ctbSignals::ToggledOutReg")
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbSignals::ToggledDbitList(Int_t mask){
|
||||
try {
|
||||
|
||||
auto dbitlist = myDet->getRxDbitList().tsquash("Different values");
|
||||
|
||||
// anyway all enabled
|
||||
if ((dbitlist.empty()) && (signals[mask]->isDbitList())) {
|
||||
;
|
||||
}
|
||||
// set the dbitlist
|
||||
else {
|
||||
std::vector <int> new_dbitlist;
|
||||
for (int is=0; is<64; is++) {
|
||||
if (signals[is]->isDbitList()){
|
||||
new_dbitlist.push_back(is);
|
||||
cout << is << " " << new_dbitlist.size() - 1 << endl;
|
||||
}
|
||||
}
|
||||
if (new_dbitlist.size() > 64)
|
||||
new_dbitlist.clear();
|
||||
myDet->setRxDbitList(new_dbitlist);
|
||||
// get list again
|
||||
dbitlist = myDet->getRxDbitList().tsquash("Different values");
|
||||
}
|
||||
|
||||
// enable all
|
||||
if (dbitlist.empty()) {
|
||||
for (int is=0; is<64; is++) {
|
||||
signals[is]->setDbitList(1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// disable all
|
||||
for (int is=0; is<64; is++) {
|
||||
signals[is]->setDbitList(0);
|
||||
}
|
||||
// enable selected
|
||||
for (const auto &value : dbitlist) {
|
||||
signals[value]->setDbitList(1);
|
||||
}
|
||||
}
|
||||
|
||||
} CATCH_DISPLAY ("Could not get/set receiver dbit list.", "ctbSignals::ToggledDbitList")
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ctbSignals::ToggledPlot(Int_t b) {
|
||||
|
||||
Emit("ToggledSignalPlot(Int_t)", b);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ctbSignals::ToggledSignalPlot(Int_t b) {
|
||||
|
||||
Emit("ToggledSignalPlot(Int_t)", b);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Pixel_t ctbSignals::getColor(int i){
|
||||
if (i>=0 && i<NSIGNALS)
|
||||
return signals[i]->getColor();
|
||||
return static_cast<Pixel_t>(-1);
|
||||
}
|
||||
|
||||
int ctbSignals::getPlot(int i){
|
||||
if (i>=0 && i<NSIGNALS)
|
||||
return signals[i]->isPlot();
|
||||
return -1;
|
||||
};
|
||||
|
||||
void ctbSignals::setDbitOffset(Long_t) {
|
||||
setDbitOffset();
|
||||
}
|
||||
|
||||
void ctbSignals::setDbitOffset(){
|
||||
try {
|
||||
myDet->setRxDbitOffset(eDbitOffset->GetNumber());
|
||||
} CATCH_DISPLAY ("Could not set receiver dbit offset.", "ctbSignals::setDbitOffset")
|
||||
}
|
121
ctbGui/ctbSignals.h
Executable file
121
ctbGui/ctbSignals.h
Executable file
@ -0,0 +1,121 @@
|
||||
#ifndef CTBSIGNALS_H
|
||||
#define CTBSIGNALS_H
|
||||
#include <TGFrame.h>
|
||||
|
||||
|
||||
#define NSIGNALS 64
|
||||
|
||||
#define NIOSIGNALS 64 //for moench board was 52
|
||||
|
||||
|
||||
#define ADCLATCH 63
|
||||
#define DIGSIGLATCH 62
|
||||
|
||||
|
||||
|
||||
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TGCheckButton;
|
||||
class TH1I;
|
||||
class TGTextButton;
|
||||
class TGColorSelect;
|
||||
|
||||
|
||||
|
||||
class TGNumberEntry;
|
||||
namespace sls
|
||||
{
|
||||
class Detector;
|
||||
};
|
||||
class ctbSignal;
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
class ctbSignal : public TGHorizontalFrame {
|
||||
|
||||
// RQ_OBJECT("ctbSignal")
|
||||
|
||||
private:
|
||||
|
||||
TGLabel *sLabel;
|
||||
TGCheckButton *sOutput;
|
||||
TGCheckButton *sDbitList;
|
||||
TGCheckButton *sPlot;
|
||||
TGLabel *sValue;
|
||||
TGNumberEntry *sEntry;
|
||||
TGColorSelect *fColorSel;
|
||||
|
||||
sls::Detector *myDet;
|
||||
Int_t id;
|
||||
|
||||
TH1I *hsig;
|
||||
|
||||
public:
|
||||
|
||||
ctbSignal(TGFrame *page, int i, sls::Detector *det);
|
||||
int setSignalAlias(char *tit, int plot, int col);
|
||||
string getSignalAlias();
|
||||
|
||||
TH1I *getPlot() {return hsig;};
|
||||
int setOutput(Long64_t);
|
||||
int fixOutput(int);
|
||||
int setDbitList(Long64_t);
|
||||
|
||||
void ToggledOutput(Bool_t);
|
||||
void ToggledDbitList(Bool_t);
|
||||
void ToggledPlot(Bool_t);
|
||||
void ColorChanged(Pixel_t);
|
||||
|
||||
int isDbitList();
|
||||
int isOutput();
|
||||
int isPlot();
|
||||
Pixel_t getColor();
|
||||
|
||||
|
||||
void ToggledSignalOutput(Int_t); //*SIGNAL*
|
||||
void ToggledSignalDbitList(Int_t); //*SIGNAL*
|
||||
void ToggledSignalPlot(Int_t); //*SIGNAL*
|
||||
|
||||
|
||||
|
||||
ClassDef(ctbSignal,0)
|
||||
};
|
||||
|
||||
class ctbSignals : public TGGroupFrame {
|
||||
private:
|
||||
|
||||
ctbSignal *signals[NSIGNALS];
|
||||
|
||||
TGNumberEntry *eIOCntrlRegister;
|
||||
TGNumberEntry *eDbitOffset;
|
||||
|
||||
sls::Detector *myDet;
|
||||
|
||||
public:
|
||||
ctbSignals(TGVerticalFrame *page, sls::Detector *det);
|
||||
int setSignalAlias(string line);
|
||||
string getSignalAlias();
|
||||
|
||||
int getPlot(int);
|
||||
Pixel_t getColor(int);
|
||||
|
||||
void update();
|
||||
// void saveParameters();
|
||||
string getSignalParameters();
|
||||
|
||||
//void setDbitList(Int_t);
|
||||
void setDbitOffset(Long_t);
|
||||
void setDbitOffset();
|
||||
|
||||
void ToggledOutReg(Int_t);
|
||||
void ToggledDbitList(Int_t);
|
||||
void ToggledPlot(Int_t);
|
||||
void ToggledSignalPlot(Int_t); //*SIGNAL*
|
||||
|
||||
ClassDef(ctbSignals,0)
|
||||
};
|
||||
|
||||
#endif
|
182
ctbGui/ctbSlowAdcs.cpp
Normal file
182
ctbGui/ctbSlowAdcs.cpp
Normal file
@ -0,0 +1,182 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include <TGTextEntry.h>
|
||||
#include <TGLabel.h>
|
||||
#include <TGNumberEntry.h>
|
||||
#include <TGButton.h>
|
||||
|
||||
#include "ctbSlowAdcs.h"
|
||||
#include "ctbDefs.h"
|
||||
#include "Detector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
|
||||
ctbSlowAdc::ctbSlowAdc(TGGroupFrame *page, int idac, sls::Detector *det) : TGHorizontalFrame(page, 800,50) , id(idac), myDet(det) {
|
||||
|
||||
|
||||
TGHorizontalFrame *hframe=this;
|
||||
|
||||
page->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
MapWindow();
|
||||
|
||||
char tit[100];
|
||||
|
||||
|
||||
sprintf(tit, "SENSE %d:",idac-1000);
|
||||
|
||||
dacsLabel= new TGLabel(hframe, tit);// new TGLabel(hframe, tit);
|
||||
|
||||
|
||||
|
||||
hframe->AddFrame(dacsLabel,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
||||
dacsLabel->MapWindow();
|
||||
dacsLabel->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
|
||||
|
||||
sprintf(tit, "xxx");
|
||||
dacsValue= new TGLabel(hframe, tit);
|
||||
hframe->AddFrame( dacsValue,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
||||
dacsValue->MapWindow();
|
||||
dacsValue->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
|
||||
TGTextButton *b= new TGTextButton(hframe, "Update");
|
||||
hframe->AddFrame( b,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
||||
b->MapWindow();
|
||||
b->SetTextJustify(kTextLeft);
|
||||
|
||||
b->Connect("Clicked()","ctbSlowAdc",this,"getValue()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ctbSlowAdc::setLabel(char *tit) {
|
||||
if(tit)
|
||||
dacsLabel->SetText(tit);
|
||||
|
||||
return id;
|
||||
|
||||
}
|
||||
|
||||
string ctbSlowAdc::getLabel() {
|
||||
ostringstream line;
|
||||
line << dacsLabel->GetText() << endl;
|
||||
|
||||
// line << "DAC" << dec << id << " " << dacsUnit->IsOn() << endl;
|
||||
|
||||
return line.str();
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ctbSlowAdc::getValue() {
|
||||
try {
|
||||
std::string s;
|
||||
|
||||
// temp
|
||||
if (id == static_cast<int>(slsDetectorDefs::SLOW_ADC_TEMP)) {
|
||||
|
||||
int val = myDet->getTemperature(static_cast<slsDetectorDefs::dacIndex>(id)).tsquash("Different values");
|
||||
cout << "slow adc temp" << " " << val << endl;
|
||||
|
||||
s = to_string(val) + " " + to_string(0x00b0) + "C";//<2F>C
|
||||
dacsValue->SetText(s.c_str());
|
||||
return val;
|
||||
}
|
||||
|
||||
// mv
|
||||
else {
|
||||
|
||||
int val = myDet->getSlowADC(static_cast<slsDetectorDefs::dacIndex>(id)).tsquash("Different values");
|
||||
cout << "slow adc " << id << " " << val << endl;
|
||||
|
||||
s = to_string(val) + " mV";
|
||||
dacsValue->SetText(s.c_str());
|
||||
return val;
|
||||
}
|
||||
|
||||
} CATCH_DISPLAY ("Could not get slow dac " + to_string(id) + ".", "ctbSlowAdc::getValue")
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ctbSlowAdcs::ctbSlowAdcs(TGVerticalFrame *page, sls::Detector *det) : TGGroupFrame(page,"Sense",kVerticalFrame) , myDet(det){
|
||||
|
||||
SetTitlePos(TGGroupFrame::kLeft);
|
||||
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
|
||||
MapWindow();
|
||||
|
||||
// cout << "window mapped " << endl;
|
||||
|
||||
|
||||
for (int idac=0; idac<NSLOWADCS + 1; idac++) {
|
||||
|
||||
adcs[idac]=new ctbSlowAdc(this, idac+1000, myDet);
|
||||
|
||||
}
|
||||
adcs[NSLOWADCS]->setLabel((char*)"Temperature");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int ctbSlowAdcs::setSlowAdcAlias(string line) {
|
||||
|
||||
int is=-1, mv=0;
|
||||
char tit[100];
|
||||
int narg=sscanf(line.c_str(),"SENSE%d %s %d",&is,tit,&mv);
|
||||
if (narg<2)
|
||||
return -1;
|
||||
if (is>=0 && is<NSLOWADCS)
|
||||
adcs[is]->setLabel(tit);
|
||||
return is;
|
||||
|
||||
}
|
||||
|
||||
string ctbSlowAdcs::getSlowAdcAlias() {
|
||||
|
||||
ostringstream line;
|
||||
|
||||
for (int i=0; i<NSLOWADCS; i++)
|
||||
line << adcs[i]->getLabel() << endl;
|
||||
return line.str();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
string ctbSlowAdcs::getAdcParameters() {
|
||||
|
||||
ostringstream line;
|
||||
|
||||
for (int i=0; i<NSLOWADCS; i++) {
|
||||
//line << "dacs:" << i << " " << dacs[i]->getValue << endl;
|
||||
line << "adc:" << i << " " << adcs[i]->getValue() << endl;
|
||||
}
|
||||
line << "adc:-1" << adcs[NSLOWADCS]->getValue() << endl;
|
||||
return line.str();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbSlowAdcs::update() {
|
||||
for (int idac=0; idac<NSLOWADCS+1; idac++) {
|
||||
adcs[idac]->getValue();
|
||||
}
|
||||
}
|
78
ctbGui/ctbSlowAdcs.h
Normal file
78
ctbGui/ctbSlowAdcs.h
Normal file
@ -0,0 +1,78 @@
|
||||
|
||||
|
||||
#ifndef CTBSLOWADCS_H
|
||||
#define CTBSLOWADCS_H
|
||||
#include <TGFrame.h>
|
||||
|
||||
|
||||
//#define NDACS 16
|
||||
#define NSLOWADCS 8
|
||||
|
||||
|
||||
|
||||
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TGCheckButton;
|
||||
class TGTextButton;
|
||||
|
||||
|
||||
|
||||
namespace sls
|
||||
{
|
||||
class Detector;
|
||||
};
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
class ctbSlowAdc : public TGHorizontalFrame {
|
||||
|
||||
|
||||
protected:
|
||||
// TGLabel *dacsLabel;
|
||||
// TGNumberEntry *dacsEntry;
|
||||
// TGCheckButton *dacsUnit;
|
||||
TGLabel *dacsLabel;
|
||||
TGLabel *dacsValue;
|
||||
int id;
|
||||
|
||||
sls::Detector* myDet;
|
||||
public:
|
||||
ctbSlowAdc(TGGroupFrame*, int , sls::Detector*);
|
||||
int getValue();
|
||||
|
||||
int setLabel(char *tit);
|
||||
string getLabel();
|
||||
|
||||
|
||||
|
||||
ClassDef(ctbSlowAdc,0)
|
||||
};
|
||||
|
||||
|
||||
class ctbSlowAdcs : public TGGroupFrame {
|
||||
private:
|
||||
|
||||
|
||||
|
||||
ctbSlowAdc *adcs[NSLOWADCS+1];
|
||||
|
||||
sls::Detector* myDet;
|
||||
|
||||
public:
|
||||
ctbSlowAdcs(TGVerticalFrame *page, sls::Detector*);
|
||||
|
||||
int setSlowAdcAlias(string line);
|
||||
// int setDacAlias(string line);
|
||||
string getSlowAdcAlias();
|
||||
string getAdcParameters();
|
||||
|
||||
void update();
|
||||
|
||||
ClassDef(ctbSlowAdcs,0)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
110
ctbGui/patternGenerator/deserializer.cpp
Normal file
110
ctbGui/patternGenerator/deserializer.cpp
Normal file
@ -0,0 +1,110 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
int iarg;
|
||||
char fname[10000];
|
||||
uint64_t word;
|
||||
int val[64];
|
||||
int bit[64];
|
||||
FILE *fdin;
|
||||
|
||||
int nb=2;
|
||||
int off=0;
|
||||
int ioff=0;
|
||||
int dr=24;
|
||||
int idr=0;
|
||||
int ib=0;
|
||||
int iw=0;
|
||||
bit[0]=19;
|
||||
bit[1]=8;
|
||||
// for (iarg=0; iarg<argc; iarg++) printf("%d %s\n",iarg, argv[iarg]);
|
||||
|
||||
if (argc<2) printf("Error: usage is %s fname [dr off b0 b1 bn]\n");
|
||||
|
||||
if (argc>2) dr=atoi(argv[2]);
|
||||
if (argc>3) off=atoi(argv[3]);
|
||||
if (argc>4) {
|
||||
for (ib=0; ib<64; ib++) {
|
||||
if (argc>4+ib) {
|
||||
bit[ib]=atoi(argv[4+ib]);
|
||||
nb++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
idr=0;
|
||||
for (ib=0; ib<nb; ib++) {
|
||||
val[ib]=0;
|
||||
}
|
||||
|
||||
|
||||
fdin=fopen(argv[1],"rb");
|
||||
if (fdin==NULL) {
|
||||
printf("Cannot open input file %s for reading\n",argv[1]);
|
||||
return 200;
|
||||
}
|
||||
|
||||
while (fread((void*)&word, 8, 1, fdin)) {
|
||||
// printf("%llx\n",word);
|
||||
if (ioff<off) ioff++;
|
||||
else {
|
||||
|
||||
for (ib=0; ib<nb; ib++) {
|
||||
if (word&(1<<bit[ib])) val[ib]|=(1<<idr);
|
||||
}
|
||||
idr++;
|
||||
if (idr==dr) {
|
||||
idr=0;
|
||||
fprintf(stdout,"%d\t",iw++);
|
||||
for (ib=0; ib<nb; ib++) {
|
||||
#ifdef HEX
|
||||
fprintf(stdout,"%08llx\t",val[ib]);
|
||||
#else
|
||||
fprintf(stdout,"%lld\t",val[ib]);
|
||||
|
||||
#endif
|
||||
|
||||
val[ib]=0;
|
||||
}
|
||||
fprintf(stdout,"\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if (idr!=0) {
|
||||
fprintf(stdout,"%d\t",iw++);
|
||||
for (ib=0; ib<nb; ib++) {
|
||||
#ifdef HEX
|
||||
fprintf(stdout,"%08llx\t",val[ib]);
|
||||
#else
|
||||
fprintf(stdout,"%lld\t",val[ib]);
|
||||
|
||||
#endif
|
||||
|
||||
val[ib]=0;
|
||||
}
|
||||
fprintf(stdout,"\n");
|
||||
}
|
||||
|
||||
fclose(fdin);
|
||||
|
||||
return 0;
|
||||
}
|
30
ctbGui/patternGenerator/generate.sh
Executable file
30
ctbGui/patternGenerator/generate.sh
Executable file
@ -0,0 +1,30 @@
|
||||
if [ "$#" -eq 0 ]; then
|
||||
echo "Wrong number of arguments: usage should be $0 patname"
|
||||
exit 1
|
||||
fi
|
||||
infile=$1
|
||||
outfile=$infile"at"
|
||||
outfilebin=$infile"bin"
|
||||
if [ "$#" -ge 2 ]; then
|
||||
outfile=$2
|
||||
fi
|
||||
exe=$infile"exe"
|
||||
if [ "$#" -ge 4 ]; then
|
||||
exe=$4
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
outfilebin=$3
|
||||
fi
|
||||
|
||||
if [ -f "$infile" ]
|
||||
then
|
||||
gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ;
|
||||
echo compiling
|
||||
$exe ;
|
||||
echo cleaning
|
||||
rm $exe
|
||||
echo done
|
||||
else
|
||||
echo "$infile not found."
|
||||
fi
|
177
ctbGui/patternGenerator/generator.c
Executable file
177
ctbGui/patternGenerator/generator.c
Executable file
@ -0,0 +1,177 @@
|
||||
/****************************************************************************
|
||||
usage to generate a patter test.pat from test.p
|
||||
|
||||
gcc -DINFILE="\"test.p\"" -DOUTFILE="\"test.pat\"" -o test.exe generator.c ; ./test.exe ; rm test.exe
|
||||
|
||||
|
||||
*************************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define MAXLOOPS 3
|
||||
#define MAXTIMERS 3
|
||||
#define MAXWORDS 1024
|
||||
|
||||
|
||||
|
||||
uint64_t pat=0;
|
||||
uint64_t iopat=0;
|
||||
uint64_t clkpat=0;
|
||||
|
||||
int iaddr=0;
|
||||
int waitaddr[3]={MAXWORDS,MAXWORDS,MAXWORDS};
|
||||
int startloopaddr[3]={MAXWORDS,MAXWORDS,MAXWORDS};
|
||||
int stoploopaddr[3]={MAXWORDS,MAXWORDS,MAXWORDS};
|
||||
int start=0, stop=0;
|
||||
uint64_t waittime[3]={0,0,0};
|
||||
int nloop[3]={0,0,0};
|
||||
|
||||
char infile[10000], outfile[10000];
|
||||
|
||||
FILE *fd, *fd1;
|
||||
uint64_t PAT[MAXWORDS];
|
||||
|
||||
|
||||
int i,ii,iii,j,jj,jjj,pixx,pixy,memx,memy,muxout,memclk,colclk,rowclk,muxclk,memcol,memrow,loopcounter;
|
||||
|
||||
void setstart() {
|
||||
start=iaddr;
|
||||
}
|
||||
|
||||
void setstop() {
|
||||
stop=iaddr;
|
||||
}
|
||||
|
||||
void setinput(int bit) {
|
||||
uint64_t mask=1;
|
||||
mask=mask<<bit;
|
||||
iopat &= ~mask;
|
||||
}
|
||||
|
||||
void setoutput(int bit) {
|
||||
uint64_t mask=1;
|
||||
mask=mask<<bit;
|
||||
iopat |= mask;
|
||||
}
|
||||
|
||||
void setclk(int bit) {
|
||||
uint64_t mask=1;
|
||||
mask=mask<<bit;
|
||||
iopat |= mask;
|
||||
clkpat |= mask;
|
||||
}
|
||||
|
||||
void clearbit(int bit){
|
||||
uint64_t mask=1;
|
||||
mask=mask<<bit;
|
||||
pat &= ~mask;
|
||||
}
|
||||
void setbit(int bit){
|
||||
uint64_t mask=1;
|
||||
mask=mask<<bit;
|
||||
pat |= mask;
|
||||
}
|
||||
|
||||
int checkbit(int bit) {
|
||||
uint64_t mask=1;
|
||||
mask=mask<<bit;
|
||||
return (pat & mask ) >>bit;
|
||||
}
|
||||
|
||||
void setstartloop(int iloop) {
|
||||
if (iloop>=0 && iloop<MAXLOOPS)
|
||||
startloopaddr[iloop]=iaddr;
|
||||
}
|
||||
|
||||
|
||||
void setstoploop(int iloop) {
|
||||
if (iloop>=0 && iloop<MAXLOOPS)
|
||||
stoploopaddr[iloop]=iaddr;
|
||||
}
|
||||
|
||||
|
||||
void setnloop(int iloop, int n) {
|
||||
if (iloop>=0 && iloop<MAXLOOPS)
|
||||
nloop[iloop]=n;
|
||||
}
|
||||
|
||||
void setwaitpoint(int iloop) {
|
||||
if (iloop>=0 && iloop<MAXTIMERS)
|
||||
waitaddr[iloop]=iaddr;
|
||||
}
|
||||
|
||||
|
||||
void setwaittime(int iloop, uint64_t t) {
|
||||
if (iloop>=0 && iloop<MAXTIMERS)
|
||||
waittime[iloop]=t;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void pw(){
|
||||
if (iaddr<MAXWORDS)
|
||||
PAT[iaddr]= pat;
|
||||
fprintf(fd,"patword 0x%04x 0x%016llx\n",iaddr, pat);
|
||||
iaddr++;
|
||||
if (iaddr>=MAXWORDS) printf("ERROR: too many word in the pattern (%d instead of %d)!",iaddr, MAXWORDS);
|
||||
}
|
||||
|
||||
int parseCommand(int clk, int cmdbit, int cmd, int length) {
|
||||
int ibit;
|
||||
clearbit(clk);
|
||||
for (ibit=0; ibit<length; ibit++) {
|
||||
if (cmd&(1>>ibit))
|
||||
setbit(cmdbit);
|
||||
else
|
||||
clearbit(cmdbit);
|
||||
pw();
|
||||
/******/
|
||||
setbit(clk);
|
||||
pw();
|
||||
/******/
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
main(void) {
|
||||
int iloop=0;
|
||||
fd=fopen(OUTFILE,"w");
|
||||
#include INFILE
|
||||
|
||||
fprintf(fd,"patioctrl 0x%016llx\n",iopat);
|
||||
fprintf(fd,"patclkctrl 0x%016llx\n",clkpat);
|
||||
fprintf(fd,"patlimits 0x%04x 0x%04x\n",start, stop);
|
||||
|
||||
for (iloop=0; iloop<MAXLOOPS; iloop++) {
|
||||
fprintf(fd,"patloop%d 0x%04x 0x%04x\n",iloop, startloopaddr[iloop], stoploopaddr[iloop]);
|
||||
if ( startloopaddr[iloop]<0 || stoploopaddr[iloop]<= startloopaddr[iloop]) nloop[iloop]=0;
|
||||
fprintf(fd,"patnloop%d %d\n",iloop, nloop[iloop]);
|
||||
}
|
||||
|
||||
for (iloop=0; iloop<MAXTIMERS; iloop++) {
|
||||
fprintf(fd,"patwait%d 0x%04x\n",iloop, waitaddr[iloop]);
|
||||
if (waitaddr[iloop]<0) waittime[iloop]=0;
|
||||
fprintf(fd,"patwaittime%d %lld\n",iloop, waittime[iloop]);
|
||||
}
|
||||
|
||||
close((int)fd);
|
||||
fd1=fopen(OUTFILEBIN,"w");
|
||||
fwrite(PAT,sizeof(uint64_t),iaddr, fd1);
|
||||
close((int)fd1);
|
||||
}
|
201
ctbGui/patternGenerator/test.p
Executable file
201
ctbGui/patternGenerator/test.p
Executable file
@ -0,0 +1,201 @@
|
||||
//define signals and directions (Input, outputs, clocks)
|
||||
|
||||
|
||||
#define compTestIN 1
|
||||
setoutput(compTestIN);
|
||||
|
||||
#define curON 32
|
||||
setoutput(curON);
|
||||
|
||||
#define side_clk 2
|
||||
setclk(side_clk);
|
||||
|
||||
#define side_din 3
|
||||
setoutput(side_din);
|
||||
|
||||
#define clear_shr 4
|
||||
setoutput(clear_shr);
|
||||
|
||||
#define bottom_din 5
|
||||
setoutput(bottom_din);
|
||||
|
||||
#define bottom_clk 6
|
||||
setclk(bottom_clk);
|
||||
|
||||
#define gHG 7
|
||||
setoutput(gHG);
|
||||
|
||||
#define bypassCDS 31
|
||||
setoutput(bypassCDS);
|
||||
|
||||
|
||||
#define ENprechPRE 8
|
||||
setoutput(ENprechPRE);
|
||||
|
||||
|
||||
#define res 9
|
||||
setoutput(res);
|
||||
|
||||
#define pulseOFF 30
|
||||
setoutput(pulseOFF);
|
||||
|
||||
#define connCDS 27
|
||||
setoutput(connCDS);
|
||||
|
||||
#define Dsg_1 24
|
||||
setoutput(Dsg_1);
|
||||
|
||||
|
||||
#define Dsg_2 25
|
||||
setoutput(Dsg_2);
|
||||
|
||||
|
||||
#define Dsg_3 23
|
||||
setoutput(Dsg_3);
|
||||
|
||||
#define sto0 10
|
||||
setoutput(sto0);
|
||||
|
||||
#define sto1 11
|
||||
setoutput(sto1);
|
||||
|
||||
#define sto2 12
|
||||
setoutput(sto2);
|
||||
|
||||
#define resCDS 13
|
||||
setoutput(resCDS);
|
||||
|
||||
#define prechargeConnect 14
|
||||
setoutput(prechargeConnect);
|
||||
|
||||
#define pulse 15
|
||||
setoutput(pulse);
|
||||
|
||||
#define PCT_mode 21
|
||||
setoutput(PCT_mode);
|
||||
|
||||
#define res_DGS 16
|
||||
setoutput(res_DGS);
|
||||
|
||||
#define adc_ena 17
|
||||
setoutput(adc_ena);
|
||||
|
||||
|
||||
#define CLKBIT 18
|
||||
setclk(CLKBIT);
|
||||
|
||||
|
||||
#define adc_sync 63
|
||||
setoutput(adc_sync);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define PW pw()
|
||||
#define SB(x) setbit(x)
|
||||
#define CB(x) clearbit(x)
|
||||
#define CLOCK clearbit(CLKBIT); pw();setbit(CLKBIT);pw()
|
||||
#define LCLOCK clearbit(CLKBIT); pw();setbit(CLKBIT);pw();clearbit(CLKBIT); pw()
|
||||
#define CLOCKS(x) for (i=0;i<x;i++) {clearbit(CLKBIT);pw(); setbit(CLKBIT); pw();}
|
||||
#define STOP setstop();
|
||||
#define START setstart();
|
||||
#define REPEAT(x) for (i=0;i<(x);i++) {pw();}
|
||||
#define DOFOR(x) for (j=0;j<(x);j++) {
|
||||
// }
|
||||
#define STARTUP1 CB(compTestIN);SB(clear_shr);CB(side_clk);CB(side_din);CB(bottom_din);CB(bottom_clk);
|
||||
#define STARTUP2 CB(pulse);SB(PCT_mode);SB(pulseOFF);CB(curON);
|
||||
#define STARTUP3 SB(res);SB(gHG);SB(ENprechPRE);
|
||||
#define STARTUP4 SB(bypassCDS); CB(connCDS);CB(sto0);SB(sto1);SB(sto2);
|
||||
#define STARTUP5 SB(resCDS);CB(Dsg_1);CB(Dsg_2);SB(Dsg_3);CB(prechargeConnect);SB(res_DGS);
|
||||
#define STARTUP STARTUP1 STARTUP2 STARTUP3 STARTUP4 STARTUP5 PW;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//****NOTES****//
|
||||
//FUNCTIONS
|
||||
//Declare functions at the beginning
|
||||
void load_pix(int nx, int ny)
|
||||
{//SELECT PIXEL 1,1 for readout
|
||||
SB(clear_shr);PW;PW;
|
||||
CB(clear_shr);PW;PW;PW;PW;
|
||||
|
||||
SB(side_din);PW;
|
||||
SB(side_clk);PW;
|
||||
CB(side_din);
|
||||
setstartloop(0); //loop on the rows
|
||||
SB(side_clk);PW;
|
||||
setstoploop(0); //finish loop on the rows
|
||||
setnloop(0,ny); //set number row selected -can be changed dynamically
|
||||
CB(side_clk);PW;
|
||||
SB(bottom_din);PW;
|
||||
SB(bottom_clk);PW;
|
||||
CB(bottom_din);
|
||||
setstartloop(1); //loop on the columns
|
||||
SB(bottom_clk);PW;
|
||||
setstoploop(1); //loop on the columns
|
||||
setnloop(1,ny); //set number columns selected -can be changed dynamically
|
||||
}
|
||||
|
||||
void load_col(void)
|
||||
{//SELECT COLUMN 1 for readout
|
||||
SB(clear_shr);PW;PW;
|
||||
CB(clear_shr);PW;PW;PW;PW;
|
||||
SB(bottom_din);PW;
|
||||
SB(bottom_clk);PW;
|
||||
CB(bottom_clk);PW;
|
||||
CB(bottom_din);PW;
|
||||
}
|
||||
//END of FUNCTIONS
|
||||
////////////////////////////////////////////////////////
|
||||
//LET BYPASS PREAMP AND CDS and write on preamp out.//
|
||||
//THIS ALLOWS CHECKING SOURCE FOLLOWERS //
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
PW;
|
||||
|
||||
SB(5); PW;
|
||||
|
||||
CB(5); PW;
|
||||
|
||||
START; //pattern starts from here
|
||||
STARTUP;
|
||||
setwaitpoint(0); //set wait points
|
||||
PW;
|
||||
setwaittime(0,20); //wait time - can be changed dynamically
|
||||
SB(adc_ena);PW;
|
||||
printf("ADC sync %x %d %llx\n",iaddr,adc_sync, pat);
|
||||
SB(adc_sync);PW;
|
||||
printf("ADC sync %x %d %llx\n",iaddr, adc_sync, pat);
|
||||
CB(gHG);
|
||||
setwaitpoint(1); //set wait points
|
||||
setwaittime(1,16); //wait time - can be changed dynamically
|
||||
CB(adc_sync);PW;
|
||||
load_pix(10, 20);
|
||||
|
||||
CB(res);
|
||||
//CB(Dsg_3);PW;
|
||||
CB(res_DGS);
|
||||
setwaitpoint(2); //set wait points
|
||||
setwaittime(2,1000); //wait time - can be changed dynamically
|
||||
|
||||
//SB(res_DGS);
|
||||
//PW;
|
||||
//SB(Dsg_3);
|
||||
//
|
||||
//CB(connCDS);
|
||||
//TEST SIGNALS END
|
||||
//
|
||||
REPEAT(20)
|
||||
|
||||
//****************//
|
||||
//*FINAL COMMANDS*//
|
||||
//****************//
|
||||
CB(adc_ena);PW;
|
||||
//STARTUP;
|
||||
STOP; PW; //stops here
|
||||
//REPEAT(4);
|
69
docs/CMakeLists.txt
Normal file
69
docs/CMakeLists.txt
Normal file
@ -0,0 +1,69 @@
|
||||
find_package(Doxygen REQUIRED)
|
||||
find_package(Sphinx REQUIRED)
|
||||
|
||||
|
||||
|
||||
|
||||
# Utility to generate command line documentation
|
||||
add_executable(gendoc src/gendoc.cpp)
|
||||
# This is a bit hacky, but better than exposing stuff?
|
||||
target_include_directories(gendoc PRIVATE ${PROJECT_SOURCE_DIR}/slsDetectorSoftware/src)
|
||||
target_link_libraries(gendoc PRIVATE
|
||||
slsDetectorShared
|
||||
)
|
||||
set_target_properties(gendoc PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
#Doxygen
|
||||
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
|
||||
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
||||
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
|
||||
|
||||
#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/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")
|
||||
|
||||
|
@ -58,7 +58,7 @@ PROJECT_LOGO =
|
||||
# entered, it will be relative to the location where doxygen was started. If
|
||||
# left blank the current directory will be used.
|
||||
|
||||
OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/docs/
|
||||
OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@
|
||||
|
||||
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
|
||||
# directories (in 2 levels) under the output directory of each output format and
|
||||
@ -791,7 +791,7 @@ WARN_LOGFILE =
|
||||
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
|
||||
# Note: If this tag is empty the current directory is searched.
|
||||
|
||||
INPUT = @CMAKE_CURRENT_SOURCE_DIR@
|
||||
INPUT = @PROJECT_SOURCE_DIR@
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
||||
@ -890,7 +890,7 @@ EXCLUDE_SYMLINKS = NO
|
||||
# Note that the wildcards are matched against the file with absolute path, so to
|
||||
# exclude all test directories for example use the pattern */test/*
|
||||
|
||||
EXCLUDE_PATTERNS = */tests/* */python */manual */rapidjson */catch */integrationTests *README* */slsDetectorGui/*
|
||||
EXCLUDE_PATTERNS = */docs/* */tests/* */python/* */manual */slsDetectorServers/* */libs/* */integrationTests *README* */slsDetectorGui/* */ctbGui/* */slsDetectorCalibration/*
|
||||
|
||||
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
|
||||
# (namespaces, classes, functions, etc.) that should be excluded from the
|
||||
@ -1104,7 +1104,7 @@ IGNORE_PREFIX =
|
||||
# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
|
||||
# The default value is: YES.
|
||||
|
||||
GENERATE_HTML = YES
|
||||
GENERATE_HTML = NO
|
||||
|
||||
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
|
||||
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
||||
@ -1936,7 +1936,7 @@ MAN_LINKS = NO
|
||||
# captures the structure of the code including all documentation.
|
||||
# The default value is: NO.
|
||||
|
||||
GENERATE_XML = NO
|
||||
GENERATE_XML = YES
|
||||
|
||||
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
|
||||
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
62
docs/conf.py.in
Normal file
62
docs/conf.py.in
Normal file
@ -0,0 +1,62 @@
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# This file only contains a selection of the most common options. For a full
|
||||
# list see the documentation:
|
||||
# http://www.sphinx-doc.org/en/master/config
|
||||
|
||||
# -- Path setup --------------------------------------------------------------
|
||||
|
||||
# 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('.'))
|
||||
sys.path.insert(0, os.path.abspath('../bin/'))
|
||||
#sys.path.insert(0, '/home/l_frojdh/sls/build/bin')
|
||||
#sys.path.insert(0, @CMAKE_CURRENT_BINARY_DIR@)
|
||||
print(sys.path)
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = 'slsDetectorPackage'
|
||||
copyright = '2019, PSD Detector Group'
|
||||
author = 'PSD Detector Group'
|
||||
version = '@PROJECT_VERSION@'
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = ['breathe',
|
||||
'sphinx_rtd_theme',
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.napoleon',
|
||||
]
|
||||
|
||||
breathe_default_project = "slsDetectorPackage"
|
||||
napoleon_use_ivar = True
|
||||
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This pattern also affects html_static_path and html_extra_path.
|
||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
||||
|
||||
|
||||
# -- 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"
|
||||
|
||||
# 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']
|
6
docs/src/ToString.rst
Normal file
6
docs/src/ToString.rst
Normal file
@ -0,0 +1,6 @@
|
||||
ToString
|
||||
==============
|
||||
|
||||
String conversion
|
||||
|
||||
.. doxygenfile:: ToString.h
|
16
docs/src/commandline.rst
Normal file
16
docs/src/commandline.rst
Normal file
@ -0,0 +1,16 @@
|
||||
Command line interface
|
||||
==============================================
|
||||
|
||||
Usage
|
||||
-------------
|
||||
|
||||
Commands can be uses either with sls_detector_get or sls_detector_put
|
||||
|
||||
.. code-block::
|
||||
|
||||
sls_detector_get vrf
|
||||
|
||||
Commands
|
||||
-----------
|
||||
|
||||
.. include:: ../commands.rst
|
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
|
14
docs/src/container_utils.rst
Normal file
14
docs/src/container_utils.rst
Normal file
@ -0,0 +1,14 @@
|
||||
ContainerUtils
|
||||
==================
|
||||
|
||||
Helper functions to handle standard container compliant
|
||||
containers. Supports array, vector, sls::Result etc.
|
||||
|
||||
While not a part of the public API we aim not to change this
|
||||
interface too much. However, we don't give the same strong
|
||||
guarantees as for Detector etc.
|
||||
|
||||
Any reoccurring container operation should probably be added to
|
||||
this file.
|
||||
|
||||
.. doxygenfile:: container_utils.h
|
53
docs/src/dependencies.rst
Normal file
53
docs/src/dependencies.rst
Normal file
@ -0,0 +1,53 @@
|
||||
Dependencies
|
||||
=========================
|
||||
|
||||
While we value few dependencies some libraries are required in
|
||||
order to not have to reinvent the wheel. Due to the state of package
|
||||
management in C++ we decided to bundle some of them with our source
|
||||
code. These are found in the libs/ directory.
|
||||
|
||||
-----------------------
|
||||
Core
|
||||
-----------------------
|
||||
To use the basic building blocks, meaning sls_detector_get/put and
|
||||
the shared libraries these are needed:
|
||||
|
||||
* Linux, preferably recent kernel (currently no cross platform support)
|
||||
* CMake > 3.12
|
||||
* C++11 compatible compiler. (We test with gcc and clang)
|
||||
* ZeroMQ version 4
|
||||
|
||||
-----------------------
|
||||
GUI
|
||||
-----------------------
|
||||
|
||||
The GUI is currently using Qt4 but watch out for an upgrade to 5.
|
||||
|
||||
* Qt 4.8
|
||||
* Qwt 6.1
|
||||
|
||||
-----------------------
|
||||
Python bindings
|
||||
-----------------------
|
||||
|
||||
* Python > 3.6
|
||||
* pybind11 (packaged in libs/)
|
||||
|
||||
|
||||
-----------------------
|
||||
Documentation
|
||||
-----------------------
|
||||
|
||||
The documentation that you are reading now is built with
|
||||
|
||||
* Doxygen (to extract C++ classes etc.)
|
||||
* Breathe (Sphinx plugin to handle doxygen xml)
|
||||
* Sphinx
|
||||
|
||||
-----------------------
|
||||
Packaged in libs/
|
||||
-----------------------
|
||||
|
||||
* catch2 (unit testing)
|
||||
* rapidjson (streaming from receiver)
|
||||
* pybind11 (python bindings)
|
16
docs/src/detector.rst
Normal file
16
docs/src/detector.rst
Normal file
@ -0,0 +1,16 @@
|
||||
Detector
|
||||
==============================================
|
||||
|
||||
The sls::Detector is the new public API to control
|
||||
detectors from C++. This API is also used internally
|
||||
for the Python bindings and the command line interface.
|
||||
If a receiver has been configured this is also controlled
|
||||
through this class.
|
||||
|
||||
Most, if not all, functions are called in parallel
|
||||
and the return value is a thin std::vector wrapper
|
||||
containing results from all modules. (Result<T>)
|
||||
|
||||
.. doxygenclass:: sls::Detector
|
||||
:members:
|
||||
:undoc-members:
|
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);
|
||||
|
||||
|
||||
|
56
docs/src/gendoc.cpp
Normal file
56
docs/src/gendoc.cpp
Normal file
@ -0,0 +1,56 @@
|
||||
/**
|
||||
* Utility program to generate input files for the command line
|
||||
* documentation. Uses the string returned from sls_detector_help cmd
|
||||
*
|
||||
*/
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
#include "CmdProxy.h"
|
||||
#include "Detector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
std::string replace_all(const std::string &src, const std::string &from,
|
||||
const std::string &to) {
|
||||
|
||||
std::string results;
|
||||
std::string::const_iterator end = src.end();
|
||||
std::string::const_iterator current = src.begin();
|
||||
std::string::const_iterator next =
|
||||
std::search(current, end, from.begin(), from.end());
|
||||
while (next != end) {
|
||||
results.append(current, next);
|
||||
results.append(to);
|
||||
current = next + from.size();
|
||||
next = std::search(current, end, from.begin(), from.end());
|
||||
}
|
||||
results.append(current, next);
|
||||
return results;
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "Generating command line documentation!\n";
|
||||
|
||||
sls::CmdProxy proxy(nullptr);
|
||||
auto commands = proxy.GetProxyCommands();
|
||||
|
||||
std::ofstream fs("commands.rst");
|
||||
fs << ".. glossary::\n";
|
||||
|
||||
for (const auto &cmd : commands) {
|
||||
std::ostringstream os;
|
||||
proxy.Call(cmd, {}, -1, slsDetectorDefs::HELP_ACTION, os);
|
||||
|
||||
auto tmp = os.str().erase(0, cmd.size());
|
||||
auto usage = tmp.substr(0, tmp.find_first_of('\n'));
|
||||
tmp.erase(0, usage.size());
|
||||
auto help = replace_all(tmp, "\n\t", "\n\t\t");
|
||||
fs << '\t' << cmd << usage << help << "\n";
|
||||
}
|
||||
|
||||
}
|
57
docs/src/index.rst
Normal file
57
docs/src/index.rst
Normal file
@ -0,0 +1,57 @@
|
||||
.. slsDetectorPackage documentation master file, created by
|
||||
sphinx-quickstart on Mon Jul 29 17:38:15 2019.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to slsDetectorPackage's documentation!
|
||||
==============================================
|
||||
|
||||
.. note ::
|
||||
|
||||
This is the documentation for the latest development version of slsDetectorPackage
|
||||
For documentation on current and previous releases visit the official page: https://www.psi.ch/en/detectors/documentation
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Installation:
|
||||
|
||||
installation
|
||||
dependencies
|
||||
consuming
|
||||
|
||||
.. toctree::
|
||||
:caption: C++ API
|
||||
:maxdepth: 2
|
||||
|
||||
detector
|
||||
result
|
||||
receiver
|
||||
examples
|
||||
|
||||
.. toctree::
|
||||
:caption: Python API
|
||||
:maxdepth: 2
|
||||
|
||||
pydetector
|
||||
pyenums
|
||||
pyexamples
|
||||
|
||||
.. toctree::
|
||||
:caption: Command line
|
||||
:maxdepth: 2
|
||||
|
||||
commandline
|
||||
|
||||
.. toctree::
|
||||
:caption: Developer
|
||||
|
||||
container_utils
|
||||
type_traits
|
||||
ToString
|
||||
|
||||
.. Indices and tables
|
||||
.. ==================
|
||||
|
||||
.. * :ref:`genindex`
|
||||
.. * :ref:`modindex`
|
||||
.. * :ref:`search`
|
69
docs/src/installation.rst
Normal file
69
docs/src/installation.rst
Normal file
@ -0,0 +1,69 @@
|
||||
|
||||
Installation
|
||||
==============================================
|
||||
|
||||
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
|
9
docs/src/pydetector.rst
Normal file
9
docs/src/pydetector.rst
Normal file
@ -0,0 +1,9 @@
|
||||
Detector
|
||||
=====================================================
|
||||
|
||||
.. py:currentmodule:: slsdet
|
||||
|
||||
.. autoclass:: Detector
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
12
docs/src/pyenums.rst
Normal file
12
docs/src/pyenums.rst
Normal file
@ -0,0 +1,12 @@
|
||||
Enums
|
||||
===========
|
||||
|
||||
These enums are defined in slsDetectorDefs in the C++ package and
|
||||
exposed to Python through pybind11.
|
||||
|
||||
.. py:currentmodule:: sls_detector
|
||||
|
||||
.. autoclass:: runStatus
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
@ -12,13 +12,13 @@ file writing etc.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from sls_detector import Eiger
|
||||
from slsdet import Eiger
|
||||
|
||||
d = Eiger()
|
||||
threshold = range(0, 2000, 200)
|
||||
for th in threshold:
|
||||
d.vthreshold = th
|
||||
d.acq()
|
||||
d.acquire()
|
||||
|
||||
|
||||
If we want to control the shutter of for example, the big X-ray box we can add
|
||||
@ -30,7 +30,7 @@ and closes is afterwards.
|
||||
with xrf_shutter_open(box, 'Fe'):
|
||||
for th in threshold:
|
||||
d.vthreshold = th
|
||||
d.acq()
|
||||
d.acquire()
|
||||
|
||||
|
||||
-----------------------
|
6
docs/src/receiver.rst
Normal file
6
docs/src/receiver.rst
Normal file
@ -0,0 +1,6 @@
|
||||
Receiver
|
||||
==============================================
|
||||
|
||||
.. doxygenclass:: slsReceiver
|
||||
:members:
|
||||
.. :undoc-members:
|
4
docs/src/result.rst
Normal file
4
docs/src/result.rst
Normal file
@ -0,0 +1,4 @@
|
||||
Result
|
||||
==============================================
|
||||
|
||||
.. doxygenfile:: Result.h
|
7
docs/src/type_traits.rst
Normal file
7
docs/src/type_traits.rst
Normal file
@ -0,0 +1,7 @@
|
||||
TypeTraits
|
||||
==============
|
||||
|
||||
Template meta functions in the same spirit as type_traits
|
||||
from the standard library.
|
||||
|
||||
.. doxygenfile:: TypeTraits.h
|
132
examples/gotthard2_veto_photon.txt
Normal file
132
examples/gotthard2_veto_photon.txt
Normal file
@ -0,0 +1,132 @@
|
||||
#G1 Energy #G2 Energy
|
||||
300 7000
|
||||
|
||||
#G0 pedestal G1 pedestal G2 pedestal G0 gain G1 gain G2 gain (for every channel) ADU
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
||||
100 100 100 10 1 0.1
|
@ -8,7 +8,7 @@ period 0.000024984
|
||||
delay 0.999999968
|
||||
gates 1
|
||||
frames 300000.000000000
|
||||
cycles 1.000000000
|
||||
triggers 1.000000000
|
||||
timing auto
|
||||
fineoff 0.000000
|
||||
startscript none
|
||||
|
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 0001 0000000000000000
|
||||
@ -408,84 +418,84 @@ patnloop1 0
|
||||
patloop2 0400 0400
|
||||
patnloop2 0
|
||||
patwait0 00aa
|
||||
patwaittime0 40000
|
||||
patwaittime0 10000
|
||||
patwait1 0400
|
||||
patwaittime1 0
|
||||
patwait2 0400
|
||||
patwaittime2 0
|
||||
|
||||
|
||||
####mcp2011
|
||||
#0:rx_udpip 10.1.1.102
|
||||
#0:detectorip 10.1.1.19
|
||||
#0:rx_udpport 32410
|
||||
####gui listening to
|
||||
#zmqip 129.129.202.131
|
||||
#zmqport 30001
|
||||
####data streaming out of
|
||||
#rx_zmqip 10.1.2.103
|
||||
#rx_zmqport 30003
|
||||
#0:rx_hostname mpc2011
|
||||
#0:rx_tcpport 1977
|
||||
|
||||
####mx-test-1
|
||||
0:rx_udpip 10.1.1.100
|
||||
0:detectorip 10.1.1.19
|
||||
0:rx_udpport 32410
|
||||
####gui listening to (on receiver pc)
|
||||
zmqip 129.129.202.92
|
||||
zmqport 30001
|
||||
####data streaming out of
|
||||
rx_zmqip 10.1.1.100
|
||||
rx_zmqport 30003
|
||||
0:rx_hostname pcmoench01
|
||||
#############################################
|
||||
### edit with 10 Gbs IP of your server
|
||||
############################################
|
||||
0:udp_dstip 10.1.1.102
|
||||
#0:udp_dstip 129.129.202.136
|
||||
#############################################
|
||||
### edit with any number in the subnet of your server (first 3 numbers as above)
|
||||
############################################
|
||||
0:udp_srcip 10.1.1.19
|
||||
#0:udp_srcip 129.129.202.13
|
||||
|
||||
0:udp_dstport 33410
|
||||
#############################################
|
||||
### edit with 10 Gbs IP of your server
|
||||
############################################
|
||||
#zmqip 129.129.202.110
|
||||
#rx_zmqip 10.1.1.102
|
||||
#rx_zmqport 30001
|
||||
#############################################
|
||||
### edit with 1 Gbs IP of PC where you will run the GUI
|
||||
############################################
|
||||
#zmqip 129.129.202.110
|
||||
#zmqport 50001
|
||||
|
||||
|
||||
#############################################
|
||||
### edit with hostname or 1Gbs IP address of your server
|
||||
############################################
|
||||
rx_hostname mpc2011
|
||||
|
||||
tengiga 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#turn on datastream from commandline
|
||||
rx_datastream 1
|
||||
|
||||
r_readfreq 1
|
||||
|
||||
#0:configuremac -1
|
||||
rx_datastream 1
|
||||
|
||||
r_readfreq 1
|
||||
rx_readfreq 1
|
||||
|
||||
|
||||
dac:6 800
|
||||
dac:0 1300
|
||||
dac:4 1428
|
||||
dac:1 1000
|
||||
dac:7 900
|
||||
dac:3 680
|
||||
dac:2 1400
|
||||
dac:5 1200
|
||||
dac 6 800
|
||||
dac 0 1300
|
||||
dac 4 1428
|
||||
dac 1 1000
|
||||
dac 7 900
|
||||
dac 3 680
|
||||
dac 2 1400
|
||||
dac 5 1200
|
||||
adcinvert 4a342593
|
||||
samples 5000
|
||||
adcphase 90
|
||||
adcpipeline 15
|
||||
#0xb5cbda6c
|
||||
asamples 5000
|
||||
dsamples 0
|
||||
adcphase 30 deg
|
||||
adcpipeline 14
|
||||
adcreg 14 40
|
||||
powerchip 1
|
||||
|
||||
|
||||
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
|
||||
period 0.005
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
frames 100
|
||||
period 0.1
|
||||
outdir /scratch/
|
||||
enablefwrite 0
|
||||
|
||||
|
||||
|
@ -1,15 +1,16 @@
|
||||
hostname bchip038+
|
||||
hostname localhost
|
||||
|
||||
0:rx_udpport 50004
|
||||
0:rx_udpip 10.1.1.100
|
||||
0:detectorip 10.1.1.10
|
||||
rx_hostname pcmoench01
|
||||
0:rx_udpip 172.24.8.84
|
||||
0:detectorip 172.24.8.254
|
||||
rx_hostname localhost
|
||||
|
||||
powerchip 1
|
||||
#powerchip 1
|
||||
#vhighvoltage 200
|
||||
|
||||
#extsig:0 trigger_in_rising_edge
|
||||
#timing trigger
|
||||
|
||||
outdir /external_pool/jungfrau_data/softwaretest
|
||||
outdir /tmp/slsdetector
|
||||
|
||||
|
||||
|
@ -17,6 +17,7 @@ hostname bchip048+bchip052+
|
||||
rx_hostname pcmoench01
|
||||
|
||||
powerchip 1
|
||||
vhighvoltage 200
|
||||
#extsig:0 trigger_in_rising_edge
|
||||
#timing trigger
|
||||
|
||||
|
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
|
||||
|
||||
|
@ -7,11 +7,11 @@
|
||||
# ${PROJECT_SOURCE_DIR}/catch
|
||||
# )
|
||||
|
||||
target_sources(tests PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test-integrationMulti.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test-integrationDectector.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test-eigerIntegration.cpp
|
||||
)
|
||||
# target_sources(tests PRIVATE
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/test-integrationMulti.cpp
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/test-integrationDectector.cpp
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/test-eigerIntegration.cpp
|
||||
# )
|
||||
|
||||
# if(SLS_USE_TESTS)
|
||||
# set(TEST_SOURCES
|
||||
@ -32,18 +32,7 @@ target_sources(tests PRIVATE
|
||||
# RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
# )
|
||||
|
||||
# add_executable(a src/a.cpp)
|
||||
# target_link_libraries(a
|
||||
# slsProjectOptions
|
||||
# slsProjectWarnings
|
||||
# slsDetectorShared
|
||||
# slsSupportLib
|
||||
# pthread
|
||||
# rt
|
||||
# )
|
||||
# set_target_properties(a PROPERTIES
|
||||
# RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
# )
|
||||
|
||||
|
||||
# endif()
|
||||
|
||||
|
@ -1,88 +0,0 @@
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
#include "ClientSocket.h"
|
||||
#include "Timer.h"
|
||||
#include "logger.h"
|
||||
#include "network_utils.h"
|
||||
#include "slsDetector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
#include "sls_detector_exceptions.h"
|
||||
#include "sls_detector_funcs.h"
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <string>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "network_utils.h"
|
||||
|
||||
using namespace sls;
|
||||
using ROI = slsDetectorDefs::ROI;
|
||||
|
||||
// Easy printing of an ROI
|
||||
std::ostream &operator<<(std::ostream &out, const ROI &r) {
|
||||
return out << "xmin: " << std::setw(5) << r.xmin
|
||||
<< " xmax: " << std::setw(5) << r.xmax
|
||||
<< " ymin: " << std::setw(5) << r.ymin
|
||||
<< " ymax: " << std::setw(5) << r.ymax;
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "nullptr: " << sizeof(nullptr) << "\n";
|
||||
// int ret[]{0,0,0};
|
||||
// for (auto i: ret)
|
||||
// std::cout << i << "\n";
|
||||
// uint32_t imageSize = 101;
|
||||
// uint32_t packetSize = 100;
|
||||
// std::cout << "a: " << std::ceil((double)imageSize / (double)packetSize) <<'\n';
|
||||
// std::cout << "b: " << imageSize / packetSize <<'\n';
|
||||
// std::cout << "c: " << static_cast<double>(imageSize / packetSize) << '\n';
|
||||
// std::cout << "c: " << (imageSize + packetSize-1) / packetSize << '\n';
|
||||
|
||||
// slsDetectorDefs::ROI roilimits[5];
|
||||
// roilimits[0].xmin = 5;
|
||||
// roilimits[0].xmax = 12;
|
||||
// roilimits[0].ymin = 5;
|
||||
// roilimits[0].ymax = 15;
|
||||
|
||||
// roilimits[1].xmin = 0;
|
||||
// roilimits[1].xmax = 3;
|
||||
// roilimits[1].ymin = 20;
|
||||
// roilimits[1].ymax = 25;
|
||||
|
||||
// roilimits[2].xmin = 500;
|
||||
// roilimits[2].xmax = 600;
|
||||
// roilimits[2].ymin = 100;
|
||||
// roilimits[2].ymax = 200;
|
||||
|
||||
// roilimits[3].xmin = 300;
|
||||
// roilimits[3].xmax = 500;
|
||||
// roilimits[3].ymin = 800;
|
||||
// roilimits[3].ymax = 900;
|
||||
|
||||
// roilimits[4].xmin = 1000;
|
||||
// roilimits[4].xmax = 2000;
|
||||
// roilimits[4].ymin = 300;
|
||||
// roilimits[4].ymax = 500;
|
||||
|
||||
// std::cout << "Before sorting:\n";
|
||||
// for (auto r : roilimits) {
|
||||
// std::cout << r << '\n';
|
||||
// }
|
||||
|
||||
// std::sort(std::begin(roilimits), std::end(roilimits),
|
||||
// [](ROI a, ROI b) { return a.xmin < b.xmin; });
|
||||
|
||||
// std::cout << "After sorting: \n";
|
||||
// for (auto r : roilimits) {
|
||||
// std::cout << r << '\n';
|
||||
// }
|
||||
}
|
@ -1,18 +1,18 @@
|
||||
#include "catch.hpp"
|
||||
#include "multiSlsDetector.h"
|
||||
#include "DetectorImpl.h"
|
||||
#include "string_utils.h"
|
||||
#include "tests/globals.h"
|
||||
#include <iostream>
|
||||
|
||||
class MultiDetectorFixture {
|
||||
protected:
|
||||
multiSlsDetector d;
|
||||
DetectorImpl d;
|
||||
|
||||
public:
|
||||
MultiDetectorFixture() : d(0, true, true) {
|
||||
d.setHostname(hostname.c_str());
|
||||
if (my_ip != "undefined")
|
||||
d.setReceiverHostname(my_ip);
|
||||
d.setHostname(test::hostname.c_str());
|
||||
if (test::my_ip != "undefined")
|
||||
d.setReceiverHostname(test::my_ip);
|
||||
}
|
||||
~MultiDetectorFixture() { d.freeSharedMemory(); }
|
||||
};
|
||||
@ -22,56 +22,56 @@ TEST_CASE_METHOD(MultiDetectorFixture, "Set and get dacs",
|
||||
auto th = 1000;
|
||||
|
||||
// set and read back each individual dac of EIGER
|
||||
d.setDAC(0, di::E_SvP, 0);
|
||||
CHECK(d.setDAC(-1, di::E_SvP, 0) == 0);
|
||||
d.setDAC(4000, di::E_SvN, 0);
|
||||
CHECK(d.setDAC(-1, di::E_SvN, 0) == 4000);
|
||||
d.setDAC(2000, di::E_Vtr, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vtr, 0) == 2000);
|
||||
d.setDAC(3500, di::E_Vrf, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vrf, 0) == 3500);
|
||||
d.setDAC(1400, di::E_Vrs, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vrs, 0) == 1400);
|
||||
d.setDAC(2556, di::E_Vtgstv, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vtgstv, 0) == 2556);
|
||||
d.setDAC(1500, di::E_Vcmp_ll, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0) == 1500);
|
||||
d.setDAC(1400, di::E_Vcmp_lr, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_lr, 0) == 1400);
|
||||
d.setDAC(4000, di::E_cal, 0);
|
||||
CHECK(d.setDAC(-1, di::E_cal, 0) == 4000);
|
||||
d.setDAC(1300, di::E_Vcmp_rl, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_rl, 0) == 1300);
|
||||
d.setDAC(1200, di::E_Vcmp_rr, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_rr, 0) == 1200);
|
||||
d.setDAC(1100, di::E_rxb_rb, 0);
|
||||
CHECK(d.setDAC(-1, di::E_rxb_rb, 0) == 1100);
|
||||
d.setDAC(1100, di::E_rxb_lb, 0);
|
||||
CHECK(d.setDAC(-1, di::E_rxb_lb, 0) == 1100);
|
||||
d.setDAC(1500, di::E_Vcp, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vcp, 0) == 1500);
|
||||
d.setDAC(2000, di::E_Vcn, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vcn, 0) == 2000);
|
||||
d.setDAC(1550, di::E_Vis, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vis, 0) == 1550);
|
||||
d.setDAC(0, di::SVP, 0);
|
||||
CHECK(d.setDAC(-1, di::SVP, 0) == 0);
|
||||
d.setDAC(4000, di::SVN, 0);
|
||||
CHECK(d.setDAC(-1, di::SVN, 0) == 4000);
|
||||
d.setDAC(2000, di::VTR, 0);
|
||||
CHECK(d.setDAC(-1, di::VTR, 0) == 2000);
|
||||
d.setDAC(3500, di::VRF, 0);
|
||||
CHECK(d.setDAC(-1, di::VRF, 0) == 3500);
|
||||
d.setDAC(1400, di::VRS, 0);
|
||||
CHECK(d.setDAC(-1, di::VRS, 0) == 1400);
|
||||
d.setDAC(2556, di::VTGSTV, 0);
|
||||
CHECK(d.setDAC(-1, di::VTGSTV, 0) == 2556);
|
||||
d.setDAC(1500, di::VCMP_LL, 0);
|
||||
CHECK(d.setDAC(-1, di::VCMP_LL, 0) == 1500);
|
||||
d.setDAC(1400, di::VCMP_LR, 0);
|
||||
CHECK(d.setDAC(-1, di::VCMP_LR, 0) == 1400);
|
||||
d.setDAC(4000, di::CAL, 0);
|
||||
CHECK(d.setDAC(-1, di::CAL, 0) == 4000);
|
||||
d.setDAC(1300, di::VCMP_RL, 0);
|
||||
CHECK(d.setDAC(-1, di::VCMP_RL, 0) == 1300);
|
||||
d.setDAC(1200, di::VCMP_RR, 0);
|
||||
CHECK(d.setDAC(-1, di::VCMP_RR, 0) == 1200);
|
||||
d.setDAC(1100, di::RXB_RB, 0);
|
||||
CHECK(d.setDAC(-1, di::RXB_RB, 0) == 1100);
|
||||
d.setDAC(1100, di::RXB_LB, 0);
|
||||
CHECK(d.setDAC(-1, di::RXB_LB, 0) == 1100);
|
||||
d.setDAC(1500, di::VCP, 0);
|
||||
CHECK(d.setDAC(-1, di::VCP, 0) == 1500);
|
||||
d.setDAC(2000, di::VCN, 0);
|
||||
CHECK(d.setDAC(-1, di::VCN, 0) == 2000);
|
||||
d.setDAC(1550, di::VIS, 0);
|
||||
CHECK(d.setDAC(-1, di::VIS, 0) == 1550);
|
||||
d.setDAC(660, di::IO_DELAY, 0);
|
||||
CHECK(d.setDAC(-1, di::IO_DELAY, 0) == 660);
|
||||
|
||||
// setting threshold sets all individual vcmp
|
||||
d.setDAC(th, di::THRESHOLD, 0);
|
||||
CHECK(d.setDAC(-1, di::THRESHOLD, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_lr, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_rl, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_rr, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::VCMP_LL, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::VCMP_LR, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::VCMP_RL, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::VCMP_RR, 0) == th);
|
||||
|
||||
// different values gives -1
|
||||
if (d.getNumberOfDetectors() > 1) {
|
||||
d.setDAC(1600, di::E_Vcmp_ll, 0, 0);
|
||||
d.setDAC(1700, di::E_Vcmp_ll, 0, 1);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0, 0) == 1600);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0, 1) == 1700);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0) == -1);
|
||||
d.setDAC(1600, di::VCMP_LL, 0, 0);
|
||||
d.setDAC(1700, di::VCMP_LL, 0, 1);
|
||||
CHECK(d.setDAC(-1, di::VCMP_LL, 0, 0) == 1600);
|
||||
CHECK(d.setDAC(-1, di::VCMP_LL, 0, 1) == 1700);
|
||||
CHECK(d.setDAC(-1, di::VCMP_LL, 0) == -1);
|
||||
CHECK(d.setDAC(-1, di::THRESHOLD, 0) == -1);
|
||||
CHECK(d.setDAC(-1, di::THRESHOLD, 0, 0) == -1);
|
||||
CHECK(d.setDAC(-1, di::THRESHOLD, 0, 1) == -1);
|
||||
@ -99,7 +99,6 @@ int to_time(uint32_t reg) {
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Read/write register",
|
||||
"[.eigerintegration][cli]") {
|
||||
d.setTimer(ti::MEASUREMENTS_NUMBER, 1);
|
||||
d.setNumberOfFrames(1);
|
||||
d.setExposureTime(10000);
|
||||
d.acquire();
|
||||
@ -132,7 +131,7 @@ TEST_CASE_METHOD(MultiDetectorFixture, "Get time left",
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Get ID", "[.eigerintegration][cli]") {
|
||||
std::string hn = hostname;
|
||||
std::string hn = test::hostname;
|
||||
hn.erase(std::remove(begin(hn), end(hn), 'b'), end(hn));
|
||||
hn.erase(std::remove(begin(hn), end(hn), 'e'), end(hn));
|
||||
auto hostnames = sls::split(hn, '+');
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
#include "ClientSocket.h"
|
||||
#include "logger.h"
|
||||
#include "multiSlsDetector.h"
|
||||
#include "slsDetector.h"
|
||||
#include "DetectorImpl.h"
|
||||
#include "Module.h"
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
#include "Timer.h"
|
||||
@ -16,27 +16,24 @@
|
||||
// Header holding all configurations for different detectors
|
||||
#include "tests/config.h"
|
||||
#include "tests/globals.h"
|
||||
|
||||
// using namespace test;
|
||||
// using dt = slsDetectorDefs::detectorType;
|
||||
// extern std::string hostname;
|
||||
// extern std::string detector_type;
|
||||
// extern dt type;
|
||||
|
||||
TEST_CASE("Single detector no receiver", "[.integration][.single]") {
|
||||
auto t = slsDetector::getTypeFromDetector(hostname);
|
||||
CHECK(t == type);
|
||||
auto t = Module::getTypeFromDetector(test::hostname);
|
||||
CHECK(t == test::type);
|
||||
|
||||
slsDetector d(t);
|
||||
Module d(t);
|
||||
CHECK(d.getDetectorTypeAsEnum() == t);
|
||||
CHECK(d.getDetectorTypeAsString() == detector_type);
|
||||
CHECK(d.getDetectorTypeAsString() == test::detector_type);
|
||||
|
||||
d.setHostname(hostname);
|
||||
CHECK(d.getHostname() == hostname);
|
||||
d.setHostname(test::hostname);
|
||||
CHECK(d.getHostname() == test::hostname);
|
||||
|
||||
d.setOnline(true);
|
||||
CHECK(d.getOnlineFlag() == true);
|
||||
|
||||
CHECK(d.setDetectorType() == type);
|
||||
CHECK(d.setDetectorType() == test::type);
|
||||
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
@ -54,9 +51,8 @@ TEST_CASE("Set control port then create a new object with this control port",
|
||||
int new_cport = 1993;
|
||||
int new_sport = 2000;
|
||||
{
|
||||
slsDetector d(type);
|
||||
d.setHostname(hostname);
|
||||
d.setOnline(true);
|
||||
Module d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
CHECK(d.getControlPort() == old_cport);
|
||||
d.setControlPort(new_cport);
|
||||
CHECK(d.getStopPort() == old_sport);
|
||||
@ -64,24 +60,21 @@ TEST_CASE("Set control port then create a new object with this control port",
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
{
|
||||
slsDetector d(type);
|
||||
d.setHostname(hostname);
|
||||
Module d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
d.setControlPort(new_cport);
|
||||
d.setStopPort(new_sport);
|
||||
CHECK(d.getControlPort() == new_cport);
|
||||
CHECK(d.getStopPort() == new_sport);
|
||||
|
||||
d.setOnline(true);
|
||||
|
||||
// Reset standard ports
|
||||
d.setControlPort(old_cport);
|
||||
d.setStopPort(old_sport);
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
slsDetector d(type);
|
||||
d.setHostname(hostname);
|
||||
d.setOnline(true);
|
||||
Module d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
CHECK(d.getStopPort() == DEFAULT_PORTNO + 1);
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
@ -93,27 +86,24 @@ TEST_CASE("single EIGER detector no receiver basic set and get",
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// Read type by connecting to the detector
|
||||
auto type = slsDetector::getTypeFromDetector(c.hostname);
|
||||
auto type = Module::getTypeFromDetector(c.hostname);
|
||||
CHECK(type == c.type_enum);
|
||||
|
||||
// Create slsDetector of said type and set hostname and detector online
|
||||
slsDetector d(type);
|
||||
// Create Module of said type and set hostname and detector online
|
||||
Module d(type);
|
||||
CHECK(d.getDetectorTypeAsEnum() == type);
|
||||
CHECK(d.getDetectorTypeAsString() == c.type_string);
|
||||
|
||||
d.setHostname(c.hostname);
|
||||
CHECK(d.getHostname() == c.hostname);
|
||||
|
||||
d.setOnline(true);
|
||||
CHECK(d.getOnlineFlag() == true);
|
||||
|
||||
CHECK(d.getReceiverOnline() == false);
|
||||
CHECK(d.checkDetectorVersionCompatibility() == slsDetectorDefs::OK);
|
||||
CHECK(d.getUseReceiverFlag() == false);
|
||||
CHECK_NOTHROW(d.checkDetectorVersionCompatibility());
|
||||
|
||||
// Setting and reading exposure time
|
||||
auto t = 1000000000;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME, t);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME) == t);
|
||||
d.setExptime(t);
|
||||
CHECK(d.getExptime() == t);
|
||||
|
||||
// size of an eiger half module with and without gap pixels
|
||||
CHECK(d.getTotalNumberOfChannels() == 256 * 256 * 4);
|
||||
@ -143,9 +133,8 @@ TEST_CASE("single EIGER detector no receiver basic set and get",
|
||||
|
||||
|
||||
TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
||||
slsDetector d(type);
|
||||
d.setHostname(hostname);
|
||||
d.setOnline(true);
|
||||
Module d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
|
||||
// Check that detector server is unlocked then lock
|
||||
CHECK(d.lockServer() == 0);
|
||||
@ -154,33 +143,32 @@ TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
||||
|
||||
// Can we still access the detector while it's locked
|
||||
auto t = 1300000000;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME, t);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME) == t);
|
||||
d.setExptime(t);
|
||||
CHECK(d.getExptime() == t);
|
||||
|
||||
// unlock again and free
|
||||
d.lockServer(0);
|
||||
CHECK(d.lockServer() == 0);
|
||||
|
||||
CHECK(d.getLastClientIP() == my_ip);
|
||||
CHECK(d.getLastClientIP() == test::my_ip);
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
TEST_CASE("Set settings", "[.integration][.single]"){
|
||||
slsDetector d(type);
|
||||
d.setHostname(hostname);
|
||||
d.setOnline(true);
|
||||
Module d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD);
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("Timer functions", "[.integration][cli]") {
|
||||
// FRAME_NUMBER, /**< number of real time frames: total number of
|
||||
// acquisitions is number or frames*number of cycles */ ACQUISITION_TIME,
|
||||
// acquisitions is number or frames*number of triggers */ ACQUISITION_TIME,
|
||||
// /**< exposure time */ FRAME_PERIOD, /**< period between exposures */
|
||||
// DELAY_AFTER_TRIGGER, /**< delay between trigger and start of exposure or
|
||||
// readout (in triggered mode) */ GATES_NUMBER, /**< number of gates per
|
||||
// frame (in gated mode) */ CYCLES_NUMBER, /**< number of cycles: total
|
||||
// number of acquisitions is number or frames*number of cycles */
|
||||
// frame (in gated mode) */ TRIGGER_NUMBER, /**< number of triggers: total
|
||||
// number of acquisitions is number or frames*number of triggers */
|
||||
// ACTUAL_TIME, /**< Actual time of the detector's internal timer */
|
||||
// MEASUREMENT_TIME, /**< Time of the measurement from the detector (fifo)
|
||||
// */
|
||||
@ -197,73 +185,60 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
|
||||
// MEASURED_SUBPERIOD, /**< measured subperiod */
|
||||
// MAX_TIMERS
|
||||
|
||||
slsDetector d(type);
|
||||
d.setHostname(hostname);
|
||||
d.setOnline(true);
|
||||
Module d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
|
||||
// Number of frames
|
||||
auto frames = 5;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::FRAME_NUMBER, frames);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::FRAME_NUMBER) == frames);
|
||||
d.setNumberOfFrames(frames);
|
||||
CHECK(d.getNumberOfFrames() == frames);
|
||||
|
||||
auto exptime = 2000000000;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME, exptime);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME) == exptime);
|
||||
d.setExptime(exptime);
|
||||
CHECK(d.getExptime() == exptime);
|
||||
|
||||
auto period = 2000000000;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::FRAME_PERIOD, period);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::FRAME_PERIOD) == period);
|
||||
d.setPeriod(period);
|
||||
CHECK(d.getPeriod() == period);
|
||||
|
||||
if (type != dt::EIGER) {
|
||||
if (test::type != dt::EIGER) {
|
||||
auto delay = 10000;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::DELAY_AFTER_TRIGGER, delay);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::DELAY_AFTER_TRIGGER) ==
|
||||
d.setDelayAfterTrigger(delay);
|
||||
CHECK(d.getDelayAfterTrigger() ==
|
||||
delay);
|
||||
}
|
||||
|
||||
if (type != dt::EIGER) {
|
||||
auto gates = 1;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::GATES_NUMBER, gates);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::GATES_NUMBER) == gates);
|
||||
}
|
||||
auto triggers = 2;
|
||||
d.setNumberOfTriggers(triggers);
|
||||
CHECK(d.getNumberOfTriggers() == triggers);
|
||||
|
||||
auto cycles = 2;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::CYCLES_NUMBER, cycles);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::CYCLES_NUMBER) == cycles);
|
||||
|
||||
if (type == dt::EIGER) {
|
||||
if (test::type == dt::EIGER) {
|
||||
auto subtime = 200;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::SUBFRAME_ACQUISITION_TIME,
|
||||
subtime);
|
||||
CHECK(d.setTimer(
|
||||
slsDetectorDefs::timerIndex::SUBFRAME_ACQUISITION_TIME) ==
|
||||
subtime);
|
||||
d.setSubExptime(subtime);
|
||||
CHECK(d.getSubExptime() == subtime);
|
||||
}
|
||||
// for (int i =0; i!=frames; ++i)
|
||||
d.startAndReadAll();
|
||||
|
||||
d.freeSharedMemory();
|
||||
|
||||
// If we add a timer we should add tests for the timer
|
||||
CHECK(slsDetectorDefs::MAX_TIMERS == 19);
|
||||
}
|
||||
|
||||
// TEST_CASE("Aquire", "[.integration][eiger]"){
|
||||
// SingleDetectorConfig c;
|
||||
// auto type = slsDetector::getTypeFromDetector(c.hostname);
|
||||
// slsDetector d(type);
|
||||
// auto type = Module::getTypeFromDetector(c.hostname);
|
||||
// Module d(type);
|
||||
// d.setHostname(c.hostname);
|
||||
// d.setOnline(true);
|
||||
|
||||
// auto period = 1000000000;
|
||||
// auto exptime = 100000000;
|
||||
// d.setTimer(slsDetectorDefs::timerIndex::FRAME_NUMBER, 5);
|
||||
// d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME, exptime);
|
||||
// d.setTimer(slsDetectorDefs::timerIndex::FRAME_PERIOD, period);
|
||||
// d.setNumberOfFrames(5);
|
||||
// d.setExptime(exptime);
|
||||
// d.setPeriod(period);
|
||||
// d.startAndReadAll();
|
||||
|
||||
// auto rperiod =
|
||||
// d.getTimeLeft(slsDetectorDefs::timerIndex::MEASURED_PERIOD);
|
||||
// d.getMeasuredPeriod();
|
||||
// CHECK(rperiod == 0.1);
|
||||
|
||||
// d.freeSharedMemory();
|
||||
@ -277,15 +252,14 @@ TEST_CASE(
|
||||
int ratecorr = 125;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
multiSlsDetector m(0);
|
||||
DetectorImpl m(0);
|
||||
|
||||
// ensure eiger detector type, hostname and online
|
||||
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
REQUIRE(m.setOnline(true) == slsDetectorDefs::ONLINE_FLAG);
|
||||
|
||||
// starting state with rate correction off
|
||||
CHECK(m.setRateCorrection(0) == 0);
|
||||
m.setRateCorrection(0);
|
||||
|
||||
// dr 16: clk divider, no change for ratecorr
|
||||
CHECK(m.setDynamicRange(16) == 16);
|
||||
@ -313,14 +287,14 @@ TEST_CASE(
|
||||
CHECK(m.getRateCorrection() == ratecorr);
|
||||
|
||||
// ratecorr fail with dr 4 or 8
|
||||
CHECK_THROWS_AS(m.setDynamicRange(8), sls::NonCriticalError);
|
||||
CHECK_THROWS_AS(m.setDynamicRange(8), sls::RuntimeError);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
m.setDynamicRange(16);
|
||||
m.setDynamicRange(16);
|
||||
m.setRateCorrection(ratecorr);
|
||||
m.setDynamicRange(16);
|
||||
m.setRateCorrection(ratecorr);
|
||||
CHECK_THROWS_AS(m.setDynamicRange(4), sls::NonCriticalError);
|
||||
CHECK_THROWS_AS(m.setDynamicRange(4), sls::RuntimeError);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
}
|
||||
|
||||
@ -328,12 +302,11 @@ TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
multiSlsDetector m(0);
|
||||
DetectorImpl m(0);
|
||||
|
||||
// ensure ctb detector type, hostname and online
|
||||
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
REQUIRE(m.setOnline(true) == slsDetectorDefs::ONLINE_FLAG);
|
||||
|
||||
uint64_t word = 0;
|
||||
int addr = 0;
|
||||
@ -360,11 +333,11 @@ TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
|
||||
m.setPatternWord(addr, word);
|
||||
CHECK(m.setPatternWord(addr, -1) == word);
|
||||
addr = MAX_ADDR;
|
||||
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::NonCriticalError);
|
||||
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::RuntimeError);
|
||||
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
|
||||
Catch::Matchers::Contains("be between 0 and"));
|
||||
addr = -1;
|
||||
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::NonCriticalError);
|
||||
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::RuntimeError);
|
||||
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
|
||||
Catch::Matchers::Contains("be between 0 and"));
|
||||
|
||||
@ -414,12 +387,11 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegrat
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
multiSlsDetector m(0);
|
||||
DetectorImpl m(0);
|
||||
|
||||
// ensure ctb detector type, hostname and online
|
||||
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
REQUIRE(m.setOnline(true) == slsDetectorDefs::ONLINE_FLAG);
|
||||
|
||||
// dbit offset
|
||||
m.setReceiverDbitOffset(0);
|
||||
@ -480,3 +452,67 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegrat
|
||||
CHECK(m.readRegister(0x7b) == 0x1003E);
|
||||
|
||||
}
|
||||
|
||||
TEST_CASE("Eiger or Jungfrau startingfnum", "[.eigerintegration][.jungfrauintegration][startingfnum]") {
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
DetectorImpl m(0);
|
||||
|
||||
// ensure ctb detector type, hostname and online
|
||||
REQUIRE(((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER) || (m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::JUNGFRAU)));
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
|
||||
CHECK(m.setNumberOfFrames(1) == 1);
|
||||
|
||||
// starting fnum
|
||||
uint64_t val = 8;
|
||||
|
||||
m.setStartingFrameNumber(val);
|
||||
CHECK(m.getStartingFrameNumber() == val);
|
||||
CHECK(m.acquire() == slsDetectorDefs::OK);
|
||||
CHECK(m.getReceiverCurrentFrameIndex() == val);
|
||||
|
||||
++val;
|
||||
CHECK(m.acquire() == slsDetectorDefs::OK);
|
||||
CHECK(m.getReceiverCurrentFrameIndex() == val);
|
||||
|
||||
CHECK_THROWS_AS(m.setStartingFrameNumber(0), sls::RuntimeError);
|
||||
|
||||
if (m.getDetectorTypeAsString() == "Eiger") {
|
||||
val = 281474976710655;
|
||||
} else if (m.getDetectorTypeAsString() == "Jungfrau") {
|
||||
val = 18446744073709551615;
|
||||
}
|
||||
m.setStartingFrameNumber(val);
|
||||
CHECK(m.getStartingFrameNumber() == val);
|
||||
CHECK(m.acquire() == slsDetectorDefs::OK);
|
||||
CHECK(m.getReceiverCurrentFrameIndex() == val);
|
||||
CHECK(m.getStartingFrameNumber() == (val + 1));
|
||||
}
|
||||
|
||||
TEST_CASE("Eiger readnlines", "[.eigerintegration][readnlines]") {
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
DetectorImpl m(0);
|
||||
|
||||
// ensure detector type, hostname
|
||||
REQUIRE((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER));
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
|
||||
m.setDynamicRange(16);
|
||||
m.enableTenGigabitEthernet(0);
|
||||
m.setReadNLines(256);
|
||||
CHECK(m.getReadNLines() == 256);
|
||||
m.setReadNLines(1);
|
||||
CHECK(m.getReadNLines() == 1);
|
||||
|
||||
m.setDynamicRange(8);
|
||||
m.setReadNLines(256);
|
||||
CHECK(m.getReadNLines() == 256);
|
||||
CHECK_THROWS_AS(m.setReadNLines(1), sls::RuntimeError);
|
||||
CHECK(m.getReadNLines() == 256);
|
||||
CHECK_THROWS_AS(m.setReadNLines(0), sls::RuntimeError);
|
||||
m.setReadNLines(256);
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
#include "catch.hpp"
|
||||
#include "multiSlsDetector.h"
|
||||
#include "DetectorImpl.h"
|
||||
#include "string_utils.h"
|
||||
#include "tests/globals.h"
|
||||
#include <iostream>
|
||||
@ -7,19 +7,18 @@
|
||||
using namespace Catch::literals;
|
||||
|
||||
TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
|
||||
auto hostnames = sls::split(hostname, '+');
|
||||
auto hostnames = sls::split(test::hostname, '+');
|
||||
|
||||
multiSlsDetector d(0, true, true);
|
||||
d.setHostname(hostname.c_str());
|
||||
REQUIRE(d.setOnline() == true); // get!
|
||||
DetectorImpl d(0, true, true);
|
||||
d.setHostname(test::hostname.c_str());
|
||||
|
||||
CHECK(d.getHostname() == hostname);
|
||||
CHECK(d.getHostname() == test::hostname);
|
||||
for (size_t i = 0; i != hostnames.size(); ++i) {
|
||||
CHECK(d.getHostname(i) == hostnames[i]);
|
||||
}
|
||||
|
||||
CHECK(d.getDetectorTypeAsEnum() == type);
|
||||
CHECK(d.getDetectorTypeAsString() == detector_type);
|
||||
CHECK(d.getDetectorTypeAsEnum() == test::type);
|
||||
CHECK(d.getDetectorTypeAsString() == test::detector_type);
|
||||
|
||||
CHECK(d.getNumberOfDetectors() == hostnames.size());
|
||||
d.freeSharedMemory();
|
||||
@ -29,8 +28,8 @@ TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
|
||||
|
||||
TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
||||
|
||||
multiSlsDetector d(0, true, true);
|
||||
d.setHostname(hostname.c_str());
|
||||
DetectorImpl d(0, true, true);
|
||||
d.setHostname(test::hostname.c_str());
|
||||
|
||||
// FRAME_NUMBER
|
||||
int n_frames = 3;
|
||||
@ -51,16 +50,13 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
||||
|
||||
// DELAY_AFTER_TRIGGER,
|
||||
// GATES_NUMBER,
|
||||
// CYCLES_NUMBER,
|
||||
// TRIGGER_NUMBER,
|
||||
// ACTUAL_TIME
|
||||
// MEASUREMENT_TIME
|
||||
|
||||
// PROGRESS, /**< fraction of measurement elapsed - only get! */
|
||||
// MEASUREMENTS_NUMBER,
|
||||
|
||||
int measurements = 2;
|
||||
d.setTimer(ti::MEASUREMENTS_NUMBER, measurements);
|
||||
CHECK(d.setTimer(ti::MEASUREMENTS_NUMBER, -1) == measurements);
|
||||
|
||||
// FRAMES_FROM_START,
|
||||
// FRAMES_FROM_START_PG,
|
||||
@ -68,7 +64,7 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
||||
|
||||
// SUBFRAME_ACQUISITION_TIME, /**< subframe exposure time */
|
||||
double subframe_exposure = 2000000; // ns
|
||||
if (type == dt::EIGER) {
|
||||
if (test::type == dt::EIGER) {
|
||||
d.setSubFrameExposureTime(subframe_exposure);
|
||||
CHECK(d.setSubFrameExposureTime(-1) == Approx(subframe_exposure));
|
||||
}
|
||||
@ -77,13 +73,13 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
||||
|
||||
// SUBFRAME_DEADTIME, /**< subframe deadtime */
|
||||
double subframe_deadtime = 4000; // ns
|
||||
if (type == dt::EIGER) {
|
||||
if (test::type == dt::EIGER) {
|
||||
d.setSubFrameExposureDeadTime(subframe_deadtime);
|
||||
CHECK(d.setSubFrameExposureDeadTime(-1) == Approx(subframe_deadtime));
|
||||
}
|
||||
|
||||
|
||||
if (type == dt::EIGER) {
|
||||
if (test::type == dt::EIGER) {
|
||||
// 32bit is needed for subframe exposure
|
||||
d.setDynamicRange(32);
|
||||
CHECK(d.setDynamicRange(-1) == 32);
|
||||
|
1264
libs/catch/clara.hpp
Normal file
1264
libs/catch/clara.hpp
Normal file
File diff suppressed because it is too large
Load Diff
1
libs/pybind11
Submodule
1
libs/pybind11
Submodule
Submodule libs/pybind11 added at 4f72ef846f
@ -17,13 +17,13 @@
|
||||
|
||||
/*! \file document.h */
|
||||
|
||||
#include "reader.h"
|
||||
#include "encodedstream.h"
|
||||
#include "internal/meta.h"
|
||||
#include "internal/strfunc.h"
|
||||
#include "memorystream.h"
|
||||
#include "encodedstream.h"
|
||||
#include <new> // placement new
|
||||
#include "reader.h"
|
||||
#include <limits>
|
||||
#include <new> // placement new
|
||||
|
||||
RAPIDJSON_DIAG_PUSH
|
||||
#ifdef _MSC_VER
|
@ -15,8 +15,8 @@
|
||||
#ifndef RAPIDJSON_ENCODEDSTREAM_H_
|
||||
#define RAPIDJSON_ENCODEDSTREAM_H_
|
||||
|
||||
#include "stream.h"
|
||||
#include "memorystream.h"
|
||||
#include "stream.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
RAPIDJSON_DIAG_PUSH
|
@ -15,9 +15,9 @@
|
||||
#ifndef RAPIDJSON_STRTOD_
|
||||
#define RAPIDJSON_STRTOD_
|
||||
|
||||
#include "ieee754.h"
|
||||
#include "biginteger.h"
|
||||
#include "diyfp.h"
|
||||
#include "ieee754.h"
|
||||
#include "pow10.h"
|
||||
|
||||
RAPIDJSON_NAMESPACE_BEGIN
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user