Compare commits

...

201 Commits

Author SHA1 Message Date
835e62425f Merge branch 'main-rc' into b4.0.1 2020-11-30 17:03:16 +01:00
c8cdbfc488 Merge branch 'main-rc' into b4.0.0 2020-11-30 17:00:57 +01:00
2f75143245 Merge branch 'main-rc' into b3.1.5 2020-11-30 16:58:53 +01:00
6f7c31b747 Merge branch 'main-rc' into b3.1.4 2020-11-30 16:57:17 +01:00
75c2d987c4 Merge branch 'main-rc' into b3.1.3 2020-11-30 16:56:01 +01:00
726f5eba29 Merge branch 'main-rc' into b3.1.2 2020-11-30 16:54:56 +01:00
4404ee717a Merge branch 'main-rc' into b3.1.1 2020-11-30 16:52:52 +01:00
54530ab103 Merge branch 'main-rc' into b3.1.0 2020-11-30 16:50:15 +01:00
6126780660 Merge branch 'main-rc' into b3.0.1 2020-11-30 16:45:00 +01:00
9b7f9b1be1 Merge branch 'main-rc' into b3.0.0 2020-11-30 16:42:35 +01:00
26c829d766 Merge branch 'main-rc' into b2.3.4 2020-11-30 16:38:04 +01:00
3fde5c5b55 Merge branch 'main-rc' into b2.3.3 2020-11-30 16:36:24 +01:00
3e5f546ebe Merge branch 'main-rc' into b2.3.2 2020-11-30 16:26:44 +01:00
9833a7d330 Merge branch 'main-rc' into b2.3.1 2020-11-30 16:25:23 +01:00
8f9155e578 Merge branch 'main-rc' into b2.3.0 2020-11-30 16:23:50 +01:00
9df1eac3c1 Merge branch 'main-rc' into b2.2.0 2020-11-30 15:46:45 +01:00
5ededf9be4 Merge branch 'main-rc' into b2.1.1 2020-11-30 15:16:57 +01:00
3e8774798a Merge branch 'main-rc' into b2.1.0 2020-11-30 15:13:43 +01:00
3dce1e46f9 Merge branch 'main' into test 2020-11-20 14:25:45 +01:00
08ecc1e52d Merge branch 'main' into test 2020-11-20 14:24:14 +01:00
8c1974b34e Merge branch 'main' into test 2020-11-20 14:13:20 +01:00
d89d349247 Merge branch 'main' into test 2020-11-20 14:10:35 +01:00
910961cf41 Merge branch 'main' into test 2020-11-20 14:05:53 +01:00
595b7aa5e8 Merge branch 'main' into test 2020-11-20 14:03:36 +01:00
f72ad4326f Merge branch 'main' into test 2020-11-20 14:00:47 +01:00
2306e44ae3 Merge branch 'main' into test 2020-11-20 13:02:36 +01:00
e7eee67fed Update RELEASE.txt 2019-06-13 11:44:43 +02:00
f36a12e454 Release Notes typo: jungfrau min exptime is 50ns and not 50 us (#16) 2019-05-02 15:28:03 +02:00
d7ce5fedfd path 2019-02-12 15:06:15 +01:00
3a2682ffe7 missing headers updated build number 2019-02-12 14:46:56 +01:00
bf74a4135e travis 2019-02-11 10:25:58 +01:00
252ecf2769 travis 2019-02-11 10:15:57 +01:00
de01ab75e9 travis 2019-02-11 09:24:39 +01:00
a7ba5eb0d8 updated release.txt 2019-02-08 17:46:13 +01:00
6bf1a944da updaterev 2019-02-08 17:28:44 +01:00
3c77447868 removed minor warnings 2019-02-08 16:32:23 +01:00
046fb11e5e Merge branch '4.0.1-rc' of github.com:slsdetectorgroup/slsDetectorPackage into 4.0.1-rc 2019-02-08 16:02:15 +01:00
b89d56001e CMake: prefixing the options with SLS_ 2019-02-08 16:02:05 +01:00
de204dee38 Merge branch '4.0.1-rc' of github.com:slsdetectorgroup/slsDetectorPackage into 4.0.1-rc 2019-02-08 14:03:56 +01:00
0ef030354f warning 2019-02-08 14:03:49 +01:00
dccce9bf55 Merge branch 'esrf-bliss-add-targets-export-name' into 4.0.1-rc 2019-02-08 13:09:06 +01:00
441c3dc5db Merge branch 'add-targets-export-name' of https://github.com/esrf-bliss/slsDetectorPackage into esrf-bliss-add-targets-export-name
Pull request from Samuel ESRF
2019-02-08 13:07:08 +01:00
afd9e29424 updated release.txt to have eriks bug fix for receiver gap pixels enable in reciever 2019-02-08 12:53:58 +01:00
ce939b3cd6 Merge branch '4.0.1-rc' of github.com:slsdetectorgroup/slsDetectorPackage into 4.0.1-rc 2019-02-08 12:45:45 +01:00
0984654fd0 updated release.txt 2019-02-08 12:33:04 +01:00
cd738106ec printf and uninitialized variables 2019-02-08 11:14:16 +01:00
0e120330f4 fixed comparisons to build with clang 2019-02-08 10:16:32 +01:00
bf0e0ac601 updated binaries in serverbin 2019-02-07 17:06:07 +01:00
143682cfb1 updaterev 2019-02-07 16:55:01 +01:00
22686e1e25 eiger server bug fix: getmeasured period and exptime gets 32 bit from Febinterface and needs to be casted to int64_t before multiplying by 10 2019-02-06 14:52:52 +01:00
e13ecc8625 Add slsReceiver and slsDetector targets to the export set (used by donwstream project)
set TARGETS_EXPORT_NAME if the project is built directly.
2019-02-05 11:51:03 +01:00
ef3e01b9bd Merge branch '4.0.1-rc' of github.com:slsdetectorgroup/slsDetectorPackage into 4.0.1-rc 2019-02-05 10:49:46 +01:00
dffa4d9de5 eiger manual 2019-02-05 10:46:37 +01:00
dfca81208b manual acq: uncomment insignificant 2019-02-05 10:36:33 +01:00
37be7d0e2b manual acq config added 2019-02-04 17:54:58 +01:00
49812a34ae manual acq changes for debugging 2019-02-04 17:31:58 +01:00
133b82ad61 Merge branch '4.0.1-rc' of github.com:slsdetectorgroup/slsDetectorPackage into 4.0.1-rc 2019-02-04 16:43:44 +01:00
61e769773b got rid of insignificant printouts from debugging 2019-02-04 16:43:37 +01:00
23dce681b2 added clang format and clang tidy from refactor 2019-02-04 14:11:06 +01:00
7481c7f0e6 Merge branch '4.0.1-rc' of github.com:slsdetectorgroup/slsDetectorPackage into 4.0.1-rc 2019-02-01 18:50:08 +01:00
3c2bbf6ad4 gotthard server: possible fix for master and slave sync problem when configuring mac for different frames and sending dummy image, still problem of missing or extra 2 packets inslave or master not sending any frames sometimes, multi: possible fix of image reconstruction in x direction in gui 2019-02-01 18:48:51 +01:00
b8fec6c050 gotthard server: possible fix for master and slave sync problem when configuring mac for different frames and sending dummy image, still problem of missing or extra 2 packets inslave or master not sending any frames sometimes 2019-02-01 18:48:25 +01:00
2f11681d3f gotthard server: configmac should also set cycles for sending dummy frame 2019-01-30 18:24:25 +01:00
12f8166d25 manual acq changed config file, added some changes for jungfrau that aren;t tested, but soleil acq test passed 2019-01-29 15:49:41 +01:00
fd68a41918 udp socket creation error, udpsocket assigned only after. unique ptr later 2019-01-16 19:46:08 +01:00
d45375947f only destroy sem if it was initialized 2019-01-16 11:53:16 +01:00
73ae8c6151 removing static libs 2019-01-15 17:24:20 +01:00
615dd2a84f jungfrau server: minor change 2019-01-07 12:06:04 +01:00
dc80dccb8a jungfrau server: updated binaries 2019-01-07 11:52:36 +01:00
de34d85761 jungfrau server for firmware 0.7, updated required FW version to run current code 2019-01-07 11:51:25 +01:00
f747c908dc soleils test plus some modifications 2019-01-04 11:09:53 +01:00
64d94b978b for temporary testing 2019-01-04 09:13:33 +01:00
f810a9e9fb updated rev 2019-01-04 09:13:00 +01:00
152186ee59 updated gotthard server binaries 2019-01-03 14:14:17 +01:00
d9551fa07f gotthard server: updated gotthard api version 2019-01-03 11:45:39 +01:00
8738c6b9a2 jungfrau server: updated severdefs to correspond to registerdefs update, need to update firmware version required for jungffrau server exe 2019-01-03 11:43:21 +01:00
f701c731fb few changes to jungfrau server registers, mainly temp 2018-12-18 18:06:52 +01:00
e2306bd41c conda recipe 2018-12-12 16:46:01 +01:00
5698da5f95 added conda recipe 2018-12-12 16:33:25 +01:00
5e71aeb85f binaries modified 2018-12-04 13:39:27 +01:00
3a51d107bd gotthard server bug fix: switching between roi and no roi has complex fnum reengineering as fnum and pnum doesnt exist for gotthard, sol at the moment: send an image when configuremac, identify first packet if first two channels is 0xcacacaca, ifthe fnum is odd, then increment. Looking at this only at first image in an acquisition, also reduces roi time by configuring mac only when setting roi, not when getting 2018-12-04 12:09:46 +01:00
6b4a9be870 in between 2018-12-04 10:45:55 +01:00
b4b38cb607 bugfix for gotthard roi and noroi frame number, temporary fix to look at CACACACA to know if its a second packet, and first time look at last bit to know wheter to increment or not for consecutive frames fr no roi 2018-12-03 16:25:24 +01:00
03e7a83e74 incorrect mac address in config file should set error flag and give fail upon calling readconfig file 2018-12-03 12:10:37 +01:00
0869a975e4 updated makefile in manual-api to point to binaries in bin and not build/bin. cmake points to build/bin anyway 2018-12-03 12:05:38 +01:00
2cebec90ee users: added setroi and getroi, modified multi to allow imod for setroi on sls level, modified detectorsize to set a single roi or give roi if only one roi 2018-12-03 11:50:56 +01:00
c611523352 updated users class: get/set detector size sets one roi /get roi if roi enabled. mythen is not supported anymore, hence 2018-12-03 11:17:30 +01:00
a774c62cd4 binaries udpated 2018-12-03 10:56:24 +01:00
550ed4b1c2 eiger server bug fix: read and write reg only wrote to the right fpga, fixed 2018-12-03 10:55:32 +01:00
2c08c1e7ce updated binary 2018-12-03 10:49:26 +01:00
2b0208bd98 gotthard server bug fix: adc channel shifted by one fixed changin token timing rev for board 2 2018-12-03 10:48:52 +01:00
05d8ef6277 bug fix for starting and stopping receiver, without listening 2018-12-03 10:45:46 +01:00
228cfa35c0 receiver bug fix: padding was set only if deactivated, frame padding enabled and deactivated padding enabled. Fixed that frame padding and deactivated padding is independent. Padding is done if frame padding enabled or if deactivated and deactivated padding enabled 2018-11-30 16:10:13 +01:00
f120f9c3dd users bug fix:getting id(version) for single/multi detector 2018-11-30 16:00:27 +01:00
262bf1b307 users class: added stopped to getrunstatus list 2018-11-30 15:42:13 +01:00
7300d73675 udpate release 2018-11-30 15:34:15 +01:00
d4b467a641 update 2018-11-30 15:31:22 +01:00
7b71076180 update 2018-11-30 15:28:35 +01:00
9197d2b209 updated revisions 2018-11-30 15:27:39 +01:00
e094e41d89 updated releases.txt 2018-11-30 15:24:43 +01:00
512e1a3136 users bug fix:getting id(version) for single/multi detector, added resetframescaught in users 2018-11-30 14:39:01 +01:00
6d04c14bd6 users: added stopped to getrunstatus list 2018-11-30 11:35:31 +01:00
64183d8d6a gotthard server bug fix: updated a register for token timing for revision 2 boards 2018-11-30 11:27:06 +01:00
287efde54a Update RELEASE.txt 2018-08-17 18:01:13 +02:00
faa25b9e9f updated versioning 2018-08-17 17:57:53 +02:00
1b92b01a46 slsreceiver: removed warnings 2018-08-16 17:42:59 +02:00
4849063b6c client: unnecessary print while programming fpga 2018-08-16 12:21:26 +02:00
5cd020ae81 updated release.txt 2018-08-03 12:25:58 +02:00
160fabe02c slsDetectorSoftware: connect stop socket as well to confirm detector on line, also to prevent fclose closing socket 0 (if it never connected to stop socket). Future releases can use exception instead of using socketDescriptor 0 value to validate succesful constructor 2018-08-03 12:21:35 +02:00
90dd8e70e5 updated release.txt 2018-07-30 16:56:39 +02:00
08e121c71f slsDetectorSoftware: being able to get timer values individually from the users class since gotthard 25um master and slave will have different delay values 2018-07-30 16:49:15 +02:00
cb3b337a99 updated binary 2018-07-26 13:49:18 +02:00
5d9a952316 updated release.txt 2018-07-26 13:16:34 +02:00
8cc05c5848 gotthard server and slsDetectorSoftware: more accuracy when converting from double to int64_t by adding 0.5, improved clock precision of gotthard from 32.1 to 32.007729 2018-07-26 11:47:55 +02:00
d69d69e892 Merge branch '3.1.4-rc' of github.com:slsdetectorgroup/slsDetectorPackage into 3.1.4-rc 2018-07-23 14:57:56 +02:00
07a120fc4a slsDetectorSoftware: users class setsettings(-1) gave undefined settings from slsDetector::setSettings. It has been fixed. 2018-07-23 14:57:27 +02:00
11e8796847 slsReceiver: HDF5: printError obsolete since hdf51.10.2 and so using printErrorStack() 2018-07-18 12:53:52 +02:00
f79b009978 updated release txt 2018-07-17 14:42:49 +02:00
3259bfb008 slsReceiver: HDF5: absolute to relative linking 2018-07-17 14:23:32 +02:00
934bc5b9db slsReceiver HDF5: unlimited x dimension (#images) by extending by numImages if caught more images, fixed virtual mapping, fixed linking for jungfrau single module (removed virtual_ in all namings 2018-07-17 14:07:23 +02:00
6d11faed87 updated binaries 2018-06-28 15:32:53 +02:00
35fc52dae7 3.1.3: Bug fix: jungfrau server: delay after trigger always set to 5 seconds 2018-06-28 15:31:09 +02:00
e599bfe56f updating br versioning --version for binaries 2018-06-12 12:26:30 +02:00
764becc271 updated release.txt 2018-06-12 12:23:24 +02:00
7462d1002d bug fix for memory leak for every multi threading command when using API 2018-06-12 12:17:30 +02:00
834794ad98 gotthard renamed binaries 2017-12-19 18:04:44 +01:00
56c504abbb Merge remote branch 'slsDetectorCalibration/2.3.4' into 2.3.4 2017-12-12 11:14:19 +01:00
4d6346e678 Merge remote branch 'slsDetectorCalibration/2.3.3' into 2.3.3 2017-12-12 11:14:15 +01:00
dc7e448759 Merge remote branch 'slsDetectorCalibration/2.3.2' into 2.3.2 2017-12-12 11:14:12 +01:00
e658cbacda Merge remote branch 'slsDetectorCalibration/2.3.1' into 2.3.1 2017-12-12 11:14:08 +01:00
1e6c6dea71 Merge remote branch 'slsDetectorCalibration/2.3' into 2.3 2017-12-12 11:14:05 +01:00
0e5d4d1d8e Merge remote branch 'slsDetectorCalibration/2.2' into 2.2 2017-12-12 11:14:01 +01:00
a2986784d3 Merge remote branch 'slsDetectorCalibration/2.1.1' into 2.1.1 2017-12-12 11:13:34 +01:00
975cbb576e Merge remote branch 'slsDetectorCalibration/2.1' into 2.1 2017-12-12 11:06:15 +01:00
e48a92d9cd Merge remote branch 'slsDetectorCalibration/2.0.5' into 2.0.5 2017-12-12 11:02:57 +01:00
befdcf7f36 Merge remote branch 'slsDetectorGui/2.3.4' into 2.3.4 2017-12-04 16:48:01 +01:00
02f5c472a8 Merge remote branch 'slsReceiverSoftware/2.3.4' into 2.3.4 2017-12-04 16:48:00 +01:00
75ed2cd2e4 Merge remote branch 'slsDetectorSoftware/2.3.4' into 2.3.4 2017-12-04 16:47:59 +01:00
3be045f9b6 Merge remote branch 'slsDetectorGui/2.3.3' into 2.3.3 2017-12-04 16:47:54 +01:00
8fae982802 Merge remote branch 'slsReceiverSoftware/2.3.3' into 2.3.3 2017-12-04 16:47:54 +01:00
128ec88b5f Merge remote branch 'slsDetectorSoftware/2.3.3' into 2.3.3 2017-12-04 16:47:52 +01:00
d5fc158330 Merge remote branch 'slsDetectorGui/2.3.2' into 2.3.2 2017-12-04 16:47:47 +01:00
864e6e4c81 Merge remote branch 'slsReceiverSoftware/2.3.2' into 2.3.2 2017-12-04 16:47:47 +01:00
343d96ff16 Merge remote branch 'slsDetectorSoftware/2.3.2' into 2.3.2 2017-12-04 16:47:46 +01:00
4142328437 Merge remote branch 'slsDetectorGui/2.3.1' into 2.3.1 2017-12-04 16:47:41 +01:00
6c797988c7 Merge remote branch 'slsReceiverSoftware/2.3.1' into 2.3.1 2017-12-04 16:47:41 +01:00
215c262981 Merge remote branch 'slsDetectorSoftware/2.3.1' into 2.3.1 2017-12-04 16:47:39 +01:00
081b809078 Merge remote branch 'slsDetectorGui/2.3' into 2.3 2017-12-04 16:47:35 +01:00
9263567cd8 Merge remote branch 'slsReceiverSoftware/2.3' into 2.3 2017-12-04 16:47:34 +01:00
58e90a85be Merge remote branch 'slsDetectorSoftware/2.3' into 2.3 2017-12-04 16:47:33 +01:00
025c836e25 Merge remote branch 'slsDetectorGui/2.2' into 2.2 2017-12-04 16:47:28 +01:00
5d5abae3f4 Merge remote branch 'slsReceiverSoftware/2.2' into 2.2 2017-12-04 16:47:28 +01:00
e2ad46386e Merge remote branch 'slsDetectorSoftware/2.2' into 2.2 2017-12-04 16:47:26 +01:00
308d44e452 Merge remote branch 'slsDetectorGui/2.1.1' into 2.1.1 2017-12-04 16:47:22 +01:00
69da61b1fb Merge remote branch 'slsReceiverSoftware/2.1.1' into 2.1.1 2017-12-04 16:47:22 +01:00
460168ce04 Merge remote branch 'slsDetectorSoftware/2.1.1' into 2.1.1 2017-12-04 16:47:21 +01:00
4e429c0d77 Merge remote branch 'slsDetectorGui/2.1' into 2.1 2017-12-04 16:45:34 +01:00
bf4fab549d Merge remote branch 'slsReceiverSoftware/2.1' into 2.1 2017-12-04 16:45:34 +01:00
f7705eb1da Merge remote branch 'slsDetectorSoftware/2.1' into 2.1 2017-12-04 16:45:32 +01:00
a2217e2066 Merge remote branch 'slsReceiverSoftware/2.0.5' into 2.0.5 2017-12-04 15:33:33 +01:00
aaa02706fc Merge remote branch 'slsDetectorSoftware/2.0.5' into 2.0.5 2017-12-04 15:31:52 +01:00
6a80bc5b54 new feature, set threshold without uploading trimbits 2017-06-27 13:00:38 +02:00
b9275646ad crazy amount of changes, both necessary and unnecessary;need to narrow down the real change later 2017-04-27 14:05:04 +02:00
9e2f2697c7 crazy amount of changes, both necessary and unnecessary;need to narrow down the real change later 2017-04-27 13:58:25 +02:00
b6b0df62b6 updaterev 2017-04-20 08:26:29 +02:00
0ba537e479 removed headersize compile error 2017-04-20 08:26:16 +02:00
75ddf535dc updaterev 2017-04-19 17:59:53 +02:00
b1de501bef updaterev 2017-04-19 17:59:46 +02:00
0f3a63f101 changed zmq default port starting at 40001 to be able to view in wireshark and removed headersize for warning 2017-04-19 17:42:38 +02:00
3b4b2d707f changes without ostringstream done 2017-04-19 10:17:39 +02:00
f405aa1733 split zmq_msg_t so its not reused 2017-04-19 10:17:30 +02:00
df0fdb7ecb changes without ostringstream done 2017-04-19 10:16:45 +02:00
91b7a87557 just started changin frm ostringstream 2017-04-18 15:32:01 +02:00
9468b9ca1e updaterev 2017-04-11 13:39:59 +02:00
d7982e178e updaterev 2017-04-11 13:39:53 +02:00
9cf5714a5b removing warnings shown from esrf debian 2017-04-11 13:39:35 +02:00
0c9ac8911a removing warnings shown from esrf debian 2017-04-11 13:39:28 +02:00
4730c8c0a9 updaterev 2017-04-11 13:31:49 +02:00
43efb8acfd removing warnings shown from esrf debian 2017-04-11 13:31:32 +02:00
6ecca8fcb0 updaterev 2017-04-11 09:03:26 +02:00
17cb63a57f updaterev 2017-04-11 09:03:19 +02:00
4f83fcb001 updaterev 2017-04-11 09:02:10 +02:00
ab94af6d29 removed verbose etc 2017-04-07 15:08:40 +02:00
7c725cc69b .c_str() must not access global variables from thread 2017-04-07 14:57:19 +02:00
f0198d2d2e alejandro's changes from ESRF 2017-04-07 14:50:17 +02:00
5ddccbdee4 changed all -lpthread to -pthread 2017-04-07 14:28:00 +02:00
8fb39b8c7e changed all -lpthread to -pthread 2017-04-07 14:27:27 +02:00
bd5293f4b1 changed all -lpthread to -pthread 2017-04-07 14:26:09 +02:00
b91180f5b2 changed all -lpthread to -pthread 2017-04-07 14:26:03 +02:00
7c3b5065a5 changed all -lpthread to -pthread 2017-04-07 14:25:09 +02:00
9aef802bea changed all -lpthread to -pthread 2017-04-07 14:24:49 +02:00
f7d85231f2 solved warnings except sscanf for uint64_t 2017-04-07 14:12:21 +02:00
5b3a911e8d solved warnings except sscanf for uint64_t 2017-04-07 14:11:34 +02:00
65f5e1c1ab strtok is not thread safe..used to set receiver udp ip etc to detector, fixed 2017-04-06 15:04:33 +02:00
839896c7e6 fixed the print file packet loss progress bug 2016-10-19 15:53:26 +02:00
4a7e246604 removed asking only 1 for framescaugh 2016-10-19 10:21:29 +02:00
7f293115c4 moved f_activate to receiver funcs from detectors funcs 2016-10-10 08:43:18 +02:00
f59f40a659 ask only 1 for frames caught for 9m 2016-10-10 08:41:03 +02:00
64fd82f92c fixed bug in gui that overwrites the individual sls file path values with the multi value, included a febl and febr temp read 2016-10-10 08:39:46 +02:00
cd232fd732 fixed bug in gui that overwrites the individual sls file path values with the multi value 2016-10-10 08:17:34 +02:00
172fa66b1f hotfix for memory leak in server 2016-08-18 11:57:36 +02:00
80 changed files with 2121 additions and 935 deletions

6
.clang-format Normal file
View File

@ -0,0 +1,6 @@
BasedOnStyle: LLVM
IndentWidth: 4
UseTab: Never
ColumnLimit: 0
AlignConsecutiveAssignments: false

7
.clang-tidy Normal file
View File

@ -0,0 +1,7 @@
---
Checks: '*, -google-runtime-references, -hicpp-no-array-decay, -cppcoreguidelines-pro-bounds-array-to-pointer-decay, -cppcoreguidelines-pro-bounds-pointer-arithmetic, -fuchsia*,-readability-else-after-return,-readability-avoid-const-params-in-decls,-hicpp-signed-bitwise,-cppcoreguidelines-pro-bounds-constant-array-index,-llvm-header-guard,-readability-static-accessed-through-instance,-google-readability-todo'
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'
AnalyzeTemporaryDtors: false
FormatStyle: none
...

44
.travis.yml Normal file
View File

@ -0,0 +1,44 @@
sudo: false
language: cpp
matrix:
include:
- os: linux
env: CONDA_PY=3.6
dist: trusty
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"
- 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 anaconda-client
# Useful for debugging any issues with conda
- conda info -a
# Replace dep1 dep2 ... with your dependencies
- conda create -q -n test-environment python=$CONDA_PY
- source activate test-environment
- conda-build .
script:
- echo "No test scripts to be run!"
deploy:
provider: script
script: find $HOME/miniconda/conda-bld/${TRAVIS_OS_NAME}-64 -name "*.tar.bz2" -exec anaconda -t $CONDA_TOKEN upload --force {} \;
on:
all_branches: true

View File

@ -2,17 +2,32 @@ cmake_minimum_required(VERSION 2.8)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set (CALIBRATE OFF)
option (USE_HDF5 "HDF5 File format" OFF)
option (USE_TEXTCLIENT "Text Client" OFF)
option (USE_RECEIVER "Receiver" OFF)
option (USE_GUI "GUI" OFF)
# Check if project is being used directly or via add_subdirectory
set(SLS_MASTER_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(SLS_MASTER_PROJECT ON)
endif()
option (SLS_USE_HDF5 "HDF5 File format" OFF)
option (SLS_USE_TEXTCLIENT "Text Client" OFF)
option (SLS_USE_RECEIVER "Receiver" OFF)
option (SLS_USE_GUI "GUI" OFF)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++98 -Wno-misleading-indentation")
else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++98")
endif ()
#Flags to always be used
# -Wno-unused-parameter should eventually be removes
# -Wno-overloaded-virtual TODO! remove warnings in refactor
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-overloaded-virtual -Wno-unused-parameter -std=c++98")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# clang does not support -Wno-misleading-indentation
# add any special clang flags
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-misleading-indentation")
endif ()
endif()
find_package(Qt4)
find_package(Qwt 6)
@ -20,9 +35,9 @@ find_package(CBF)
find_package(Doxygen)
# find_package(PNG REQUIRED)
if (USE_HDF5)
if (SLS_USE_HDF5)
find_package(HDF5 1.10 COMPONENTS CXX)
endif (USE_HDF5)
endif (SLS_USE_HDF5)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
@ -30,22 +45,26 @@ set(CMAKE_INSTALL_RPATH "$ORIGIN")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
if (USE_TEXTCLIENT)
if (SLS_USE_TEXTCLIENT)
add_subdirectory(slsDetectorSoftware)
endif (USE_TEXTCLIENT)
endif (SLS_USE_TEXTCLIENT)
if (USE_RECEIVER)
if (SLS_USE_RECEIVER)
add_subdirectory(slsReceiverSoftware)
add_subdirectory(manual/manual-api)
endif (USE_RECEIVER)
endif (SLS_USE_RECEIVER)
if (USE_GUI)
if (SLS_USE_GUI)
if (QT4_FOUND AND QWT_FOUND)
add_subdirectory(slsDetectorGui)
endif()
endif (USE_GUI)
endif (SLS_USE_GUI)
if (SLS_MASTER_PROJECT)
# Set targets export name (otherwise set by upstream project)
set(TARGETS_EXPORT_NAME "slsdetector-targets")
endif (SLS_MASTER_PROJECT)
if (CALIBRATE)
if (DEFINED ENV{ROOTSYS})

View File

@ -75,13 +75,13 @@ Use cmake to create out-of-source builds, by creating a build folder parallel to
$ cd ..
$ mkdir slsDetectorPackage-build
$ cd slsDetectorPackage-build
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=OFF
$ 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 -DUSE_HDF5=ON
$ 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
```

View File

@ -1,508 +1,201 @@
SLS Detector Package 4.0.0 released on 27.09.2018
=================================================
SLS Detector Package 4.0.1 released on 08.02.2018 (Bug Fix Release)
===================================================================
This document describes the differences between 4.0.1 and 4.0.0 releases.
CONTENTS
--------
1. Topics Concerning
2. Resolved Issues
3. Known Issues
4. Firmware Requirements
5. Download, Documentation & Support
1. Topics Concerning
====================
- Jungfrau server (new firmware mapped)
- Eiger server (measuredPeriod, reg)
- Gotthard server(ADC channel shift, ROI, 25um slave packets)
- Receiver (padding, releasing resources segfault, gappixels)
- Users class (detectorSize, ROI, versions, status)
- API (config error, ROI)
- Compile (Options prefix, static libraries, Makefile for API)
- Gui (multi module)
INTRODUCTION
2. Resolved Issues
==================
This document describes the differences between 4.0.0 and 3.1.4 releases.
Download
--------
The Source Code (Default C++ API):
https://github.com/slsdetectorgroup/slsDetectorPackage
The Conda Lib Package:
https://github.com/slsdetectorgroup/sls_detector_lib
The Conda GUI Package:
https://github.com/slsdetectorgroup/sls_detector_gui
The Python Interface (including the package):
https://github.com/slsdetectorgroup/sls_detector
Documentation
-------------
Manual (HTML & PDF):
https://www.psi.ch/detectors/documentation
slsDetectorPackage/manual/docs/
Command Line Documentation:
manual/docs/html/slsDetectorClientDocs/index.html
manual/docs/pdf/slsDetectorClientDocs.pdf
C++ API Documentation:
manual/docs/html/slsDetectorUsersDocs/index.html
manual/docs/pdf/slsDetectorUsersDocs.pdf
C++ API Example:
manual/manual-api/mainClient.cpp
manual/manual-api/mainReceiver.cpp
Python API Documentation:
https://slsdetectorgroup.github.io/sls_detector/
Further Documentation:
https://www.psi.ch/detectors/users-support
Support
-------
General Software related:
dhanya.thattil@psi.ch
anna.bergamaschi@psi.ch
Python related:
erik.frojdh@psi.ch
CONTENTS
1. Firmware Requirements
2. Changes in User Interface
3. New/Modified Commands
4. Other New Features
5. Resolved Issues
6. Known Issues
7. Next Major Release Plans
1. Firmware Requirements
========================
Gotthard
========
Minimum compatible version : 11.01.2013
Latest version : 08.02.2018 (50um and 25um Master)
09.02.2018 (25 um Slave)
Eiger
=====
Minimum compatible version : 22
Latest version : 22
Detector Server
---------------
1. (Jungfrau): Latest Jungfrau firmware release mapped.
2. (Eiger): Measured subperiod initially wrapped around 4.29s. Now, upto 42.9s.
Jungfrau
========
Minimum compatible version : 15.06.2018
Latest version : 15.06.2018
Advanced command "reg" was writing only to right FPGA.
3. (Gotthard 25/50um): Since Gotthard only sends packet numbers, one had to
remember to take even number of images in ROI mode, if they wanted to
switch back to non ROI mode.
This is fixed now, but temporary fix involves sending an image during
configuration, which will not be captured by the receiver. Hence, it takes
longer to configure. Permanent fix will require a firmware update.
The detector output is shifted by 1 for every 32 channels. This is fixed now.
Receiver
--------
1. Receiver padding was enabled only if deactivated padding was also enabled.
Receiver padding enable and receiver deactivated padding enable are independent now.
2. Starting and stopping receiver without listening resulted in seg faults.
3. Gappixels in receiver bug fix.
Client
------
1. (Users class): DetectorSize modified to set/get ROI if ROI is only 1 in number.
Allowed setting/getting ROI at single detector level via API.
(ROI for Gotthard only). Added them to the users class as setROI and getROI.
Retrieving versions at module level is possible now.
Added "stopped" as status in getRunStatus list.
2. (API): Incorrect mac address in config file will set error flag in API and not just
print the error.
ROI possible at module level.
Compile
-------
1. CMake options now have a prefix 'SLS_'.
Detector Upgrade
================
Gotthard Cannot be upgraded remotely. Requires programming via USB blaster
Eiger Can be upgraded remotely via bit files
Jungfrau Can be upgraded remotely using sls_detector_put programfpga <pof>
Instructions available at
https://www.psi.ch/detectors/installation-instructions
under Detector Upgrade -> [Detector Type] -> Firmware.
Please refer to the link below for more details on the firmware versions.
https://www.psi.ch/detectors/firmware.
2. Static libraries removed.
2. slsDetectorPackage/manual/manual-api/Makefile modified to use libraries
from slsDetectorPackage/bin as the main Makefile copies the libraries there.
No effect when using CMakeFiles.
2. Changes in User Interface
============================
Client
------
1. Shared Memory:
POSIX shared memory has been implemented and they are typically created in
/dev/shm/ folder.
A multiSlsDetector object will create a shared memory segment with naming style:
slsDetectorPackage_x_[_z]
and an slsDetector object will create a shared memory segment with naming style:
slsDetectorPackage_x_sls_y[_z]
where
x is the multi detector id
y is the sls detector id
z is the environment variable SLSDETNAME, if set.
They can be deleted directly.
Environment variable SLSDETNAME included for user-friendliness
of using 2 different detectors from the same client pc. One needn't use
different multi detector id if the SLSDETNAME is different for both consoles.
Constructor will fail if shared memory size is different (different package
releases/detectors). Loading config file cleans shared memory.
2. Exceptions in constructors:
All constructors that have an error throws an exception. For this release,
this is caught within the package and interfaced as error codes or messages
to the users using command line or API.
As a result:
- slsDetectorsUsers constructor signature now includes a success flag.
- If one uses multiSlsDetector, slsDetector, ZmqSocket classes directly,
catch exceptions from constructors.
- In future releases, the exception will be thrown
outside the package for the users to handle it.
3. API Compatibility:
Client now checks API version of Detector Server - Client and Receiver - Client
when connecting for the first time to detector server or receiver server
and the online flags have not been set in shm.
Upon failure, error messages will ensue and further commands will not
be executed. Detector servers referred to are only for Eiger, Jungfrau and Gotthard.
Previously, the detector server would exit on mismatched Firmware-Detector
server mismatch. They now wait for client to ask for compatibility check,
which is done the first time client connects to the detector and the
online flag in shm has not been set.
4. Commands "type", "id" and "replace" are removed.
Receiver
--------
1. Reciever Header Structure in file writing and call back:
sls_receiver_header structure added to sls_receiver_defs.h for image headers
in file writing.
#define MAX_NUM_PACKETS 512
typedef std::bitset<MAX_NUM_PACKETS> sls_bitset;
typedef struct {
sls_detector_header detHeader; /**< is the detector header */
sls_bitset packetsMask; /**< is the packets caught bit mask */
} sls_receiver_header;
It includes the detector header structure + bitmask of 512 bits,
where each bit represents a packet caught. This is useful in saving time
in writing to file by not padding missing packets and still retaining useful data.
The binary and HDF5 writer version number changed from 1.0 to 2.0.
The detector header version remains as 1.0.
registerCallBackRawDataReady modified to give this structure pointer,
instead of individual structure member pointers.
2. ZmqSocket class:
If one uses ZmqSocket.h, then the json header has to be parsed outside
the class to allow the user to remove the restriction in extracting all data
from the json header.
3. Receiver Call back with modified size:
registerCallBackRawDataModifyReady call back that is similar to the receiver
registerCallBackRawDataReady has been added to allow the call back to
specify an updated size of image after call back. This is in view to process
an image in call back (including extract only a region of the image) and
provide this updated size in callback. This new resized/processed image
will be written to file or streamed out via zmq. This is useful in ROI
selection in the receiver.
This also means that the call back is now called before writing to file.
3. New/Modified Commands
========================
Client
------
1. add (modified):
appends detector to end of multi detector list.
2. replace:
sets hostname/ip address for a single detector.
3. user:
get user details from shared memory.
4. checkdetversion:
checks client version compatibility with detector server.
5. checkrecversion:
checks client version compatibility with receiver server.
Receiver
--------
1. rx_zmqip:
sets/gets the zmq (TCP) ip of the receiver from where data is streamed
out from. (Eg. to the gui or intermediate process). By default, it is
the same as the zmqip.
2. zmqip:
sets/gets the zmq (TCP) ip, where client listens to, to reconstuct images.
(Eg. from receiver or intermediate process). By default, it is the same
as rx_zmqip.
3. rx_jsonaddheader:
sets/gets additional json header to be streamed out with the zmq from
receiver. Default is empty. Eg. p rx_jsonaddheader \"what\":\"nothing\"
4. r_discardpolicy:
sets/gets the frame discard policy in the receiver.
nodiscard - no discard (default),
discardempty - discard only empty frames,
discardpartial - discard any partial frame(fastest)
5. r_padding:
sets/gets the frame padding in the receiver.
0 does not pad partial frames(fastest),
1 (default) pads partial frames.
One can look at bitmask in the sls_receiver_header to process the unpadded
partial frames later.
6. activate (modified):
Extra option added to pad or unpad images in receivers when deactivated.
activate i [padding option], where i is activate/deactivate and padding
option is "padding" (default) or "nopadding".
7. rx_udpsocksize:
sets/gets the UDP socket buffer size. Already attempts to set by default
to 100mb, 2gb for Jungfrau. Does not remember custom values in client
shared memory, so must be initialized each time after setting receiver
hostname in config file.
8. rx_realudpsocksize:
gets the actual UDP socket buffer size. Usually double the set udp socket
buffer size due to kernel bookkeeping.
9. r_framesperfile:
sets/gets the frames per file in receiver. 0 means infinite or all frames
in a single file. Default of Eiger changed from 2k to 10k.
Eiger Specific
--------------
1. status trigger:
To trigger internally via software, one can use "status trigger".
2. subdeadtime:
sets/gets sub frame dead time in s in 32 bit mode. Subperiod is set in
the detector by subexptime + subdeadtime. This value is normally a
constant set by an expert catered to individual detector modules in the
config file. Receiver files writes master file metadata subperiod
instead of subdeadtime.
3. gappixels:
enables/disables gap pixels in system (detector & receiver). 1 sets,
0 unsets. In Receiver, 4 bit gap pixels mode is not implemented, but is
implemented in client data call back. Gap pixels are at module level
and not at multi module level.
4. measuredperiod:
gets the measured frame period (time between last frame and the previous
one) in s. Makes sense only for acquisitions of more than 1 frame.
5. measuredsubperiod:
gets the measured subframe period (time between last subframe and the
previous one) in s in 32 bit mode.
6. flags(modified):
extra flags "nooverflow" (default) and "overflow" for sub images in 32
bit mode. If set to overflow, it will set MSB of pixel data high if
there was any saturation in any of the sub images 32 bit mode.
Jungfrau Specific
-----------------
1. storagecells:
sets/gets number of additional storage cells per acquisition. For very
advanced users only. Range: 0-15. Default: 0.
The #images = #frames * #cycles * (#storagecells +1).
2. storage_start:
sets/gets the storage cell that stores the first acquisition of the series.
For very advanced users only. Range: 0-15. Default: 15(0xf).
4. Other New Features
=====================
Client
------
1. (Jungfrau & Gotthard) Settingsdir and caldir is removed from config file.
Default dacs are stored in detector server. Hence, these folders
are also removed from slsDetectorPackage/settingsdir. Eiger and Mythen
continue to have them.
2. Depending on 1d position of detectors and detsizechan in config file,
row and column (previously xcoord and ycoord) are given to detector
servers (Eiger and Jungfrau) to encode into the udp header.
3. (Eiger) Setting threshold energy changes such as CAL dac is irrelevant
when interpolating between two energies and VRS dac is interpolated, not copied.
4. Users API updated with the following functions:
- setReceiverFramesDiscardPolicy
- setReceiverPartialFramesPadding
- setReceiverFramesPerFile
- sendSoftwareTrigger
- setSubFrameExposureDeadTime
- setSubFrameExposureTime
- enableGapPixels
- getMeasuredPeriod
- getMeasuredSubFramePeriod
- setOverflowMode
- setNumberOfStorageCells
- setStoragecellStart
- setThresholdEnergy (overloaded)
- resetFramesCaughtInReceiver
- setReceiverFifoDepth
- setFlowControl10G
- setTenGigabitEthernet
- getNMods
- setReceiverDataStreamingOutIP
- setClientDataStreamingInIP
SlsReceiver
-----------
1. slsMultiReceiver executable added that creates multiple receiver child processes.
./slsMultiReceiver [start_tcp_port] [num_receivers] [1 for call back, 0 for none]
2. Default row and column (previously xcoord and ycoord) are hardcoded
for missing packets. (Eiger and Jungfrau)
Gui
---
1. (Jungfrau) Gain plot included. Option under 2D options in Plot tab.
2. Option to maintain aspect ratio
3. Start and Stop separated to prevent multiple click syndrome.
Detector Server
---------------
1. (Jungfrau) To use programfpga command, one must start server with -update
mode and then restart server without -update mode.
2. (Jungfrau) ASIC Timer configured at server start up and changed a few
startup values for firmware v0.7 such as adc phase, ADC_PORT_INVERT_VAL
and ADC offset half speed value.
3. (Jungfrau) Minimum exposure time of 50 us was implemented.
4. (Eiger and Jungfrau) They can be configured to have x and y coord values
of the detector in their udp header.
5. Resolved Issues
==================
Client
------
memory leak for multi threading
1. Compiler flag -std=c++98 enforced. Debug flag removed.
2. If trimen gives different list from different detectors, it returns a -1.
3. Version format for each submodule of the package changed to just date YYMMDD.
Users class fixed to give correct version, instead of -1.
4. Getting settings in users class gave -1. Fixed now.
5. (Jungfrau) Programming FPGA now creates the rawbin file from pof in tmp
rather than source file location (for permission issues).
6. (Gotthard) ROI segmentation fault fixed.
Receiver
--------
1. Silent feature of receiver fixed.
2. Socket descriptor misused earlier for success flag, instead exceptions
used that are handled inside the package.
3. Global optind variable initialized to instantiate multiple receivers
in same process. Also removed static members to enable this feature.
4. Socket buffer size attempts to set for each acquiistion and provide
warning if no capabilities. Warnings can be removed using instruction with
error provided. Default Jungfrau UDP socket buffer size if 2 GB, default is
100 MB.
5. Refactored code a bit for performance and robustness, blocking push
in buffer between listener and dataprocessor
Detector Server
---------------
1. (Jungfrau) Stop server also mapped during a reset. Reading power status
instead of user input register for power.
2. (Eiger) Bug fix for saving trimbits to file (Advanced users).
3. (Gotthard 25um) config.txt is not read again after detector startup,
no matter the number of times the detector server is restarted.
6. Known Issues
Gui
---
1. Adding multiple detectors in x and y direction incremented number of detectors
in y direction incorrectly. Effect seen only in GUI (segfault) if
detsizechan has multi detectors in both direction. Fixed.
3. Known Issues
===============
Detector Specific
-----------------
1. (Gotthard 25 um): Slave misses or captures an extra frame. Occurs irregularly.
2. (Gotthard 25/50um): Using ROI (2 chips, 256 channels) missses last pixel
of that ADC.
4. Firmware Requirements
========================
Receiver
--------
1. HDF5 compression and filters are not implemented yet.
Detector Server
---------------
1. (Eiger) Registers mapped differently between firmware v20 and v22.
So, please ensure correct on-board server before switching between
firmware versions. Else one cannot ping it anymore. Will need to flash firmware
again to recover.
2. (Gotthard) To switch back to all ADC from single ADC ROI, one must take
even number of images for the receiver to understand complete images.
This will be fixed in the next firmware upgrade.
7. Next Major Release Plans
===========================
Client
------
1. Exceptions thrown to the user to be handled.
2. Compilation using c++11.
3. Support of Mythen II restricted to this major and its minor releases.
4. Restructuring and refactoring of client code.
Gotthard
========
Minimum compatible version : 11.01.2013
Latest compatible version : 08.02.2018 (50um and 25um Master)
09.02.2018 (25 um Slave)
Eiger
=====
Minimum compatible version : 23
Latest compatible version : 23
Jungfrau
========
Minimum compatible version : 26.02.2018
Latest compatible version : 06.12.2018
Detector Upgrade
================
Gotthard Cannot be upgraded remotely. Requires programming via USB blaster
Eiger Can be upgraded remotely via bit files
Jungfrau Can be upgraded remotely using sls_detector_put programfpga <pof>
Instructions available at
https://www.psi.ch/detectors/installation-instructions
under Detector Upgrade -> [Detector Type] -> Firmware.
Please refer to the link below for more details on the firmware versions.
https://www.psi.ch/detectors/firmware.
5. Download, Documentation & Support
====================================
Download
--------
The Source Code (Default C++ API):
https://github.com/slsdetectorgroup/slsDetectorPackage
The Conda Lib Package:
https://github.com/slsdetectorgroup/sls_detector_lib
The Conda GUI Package:
https://github.com/slsdetectorgroup/sls_detector_gui
The Python Interface (including the package):
https://github.com/slsdetectorgroup/sls_detector
Documentation
-------------
Manual (HTML & PDF):
https://www.psi.ch/detectors/documentation
slsDetectorPackage/manual/docs/
Command Line Documentation:
manual/docs/html/slsDetectorClientDocs/index.html
manual/docs/pdf/slsDetectorClientDocs.pdf
C++ API Documentation:
manual/docs/html/slsDetectorUsersDocs/index.html
manual/docs/pdf/slsDetectorUsersDocs.pdf
C++ API Example:
manual/manual-api/mainClient.cpp
manual/manual-api/mainReceiver.cpp
Python API Documentation:
https://slsdetectorgroup.github.io/sls_detector/
Further Documentation:
https://www.psi.ch/detectors/users-support
Support
-------
dhanya.thattil@psi.ch
erik.frojdh@psi.ch
anna.bergamaschi@psi.ch

12
cmk.sh
View File

@ -116,20 +116,20 @@ done
if [ $TEXTCLIENT -eq 0 ] && [ $RECEIVER -eq 0 ] && [ $GUI -eq 0 ]; then
CMAKE_POST+=" -DUSE_TEXTCLIENT=ON -DUSE_RECEIVER=ON -DUSE_GUI=ON "
CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON -DSLS_USE_RECEIVER=ON -DSLS_USE_GUI=ON "
echo "Compile Option: TextClient, Receiver and GUI"
else
if [ $TEXTCLIENT -eq 1 ]; then
CMAKE_POST+=" -DUSE_TEXTCLIENT=ON "
CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON "
echo "Compile Option: TextClient"
fi
if [ $RECEIVER -eq 1 ]; then
CMAKE_POST+=" -DUSE_RECEIVER=ON "
CMAKE_POST+=" -DSLS_USE_RECEIVER=ON "
echo "Compile Option: Receiver"
fi
if [ $GUI -eq 1 ]; then
CMAKE_POST+=" -DUSE_GUI=ON "
CMAKE_POST+=" -DSLS_USE_GUI=ON "
echo "Compile Option: GUI"
fi
fi
@ -161,10 +161,10 @@ fi
#hdf5 rebuild
if [ $HDF5 -eq 1 ]; then
CMAKE_PRE+="HDF5_ROOT="$HDF5DIR
CMAKE_POST+=" -DUSE_HDF5=ON "
CMAKE_POST+=" -DSLS_USE_HDF5=ON "
#normal mode rebuild
else
CMAKE_POST+=" -DUSE_HDF5=OFF "
CMAKE_POST+=" -DSLS_USE_HDF5=OFF "
fi

View File

@ -33,7 +33,7 @@ source directory.
$ cd ..
$ mkdir slsDetectorPackage-build
$ cd slsDetectorPackage-build
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=OFF
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=OFF
$ make
</PRE>
@ -42,7 +42,7 @@ Use the following as an example to compile statically and using specific hdf5
folder
<PRE>
$ HDF5_ROOT=/opt/hdf5v1.10.0 cmake ../slsDetectorPackage
-DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=ON
-DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=ON
</PRE>
<P>

View File

@ -0,0 +1,26 @@
INCLUDES = -I .
SRC_TEST = main.cpp
LIBDIR = ../../bin
ZLIBDIR = ../../slsReceiverSoftware/include
LBITS := $(shell getconf LONG_BIT)
SERVER_TYPE = "64 bits compile server detected..."
LDFLAG_DET = -I. -L$(LIBDIR) -L$(ZLIBDIR) -lSlsReceiver -lSlsDetector -L/usr/lib64/ -pthread -lrt -L. -lzmq
all: manual-acq
manual-acq:$(SRC_TEST)
@echo "------------------------------------------------------------"
@echo "creating test software"
@echo $(SERVER_TYPE)
@echo "------------------------------------------------------------"
mkdir -p bin
g++ -o bin/manual-acq $(SRC_TEST) $(INCLUDES) $(LDFLAG_DET) -lm -lstdc++
cp bin/manual-acq ../../bin
clean:
@echo "------------------------------------------------------------"
@echo "cleaning test software"
@echo "------------------------------------------------------------"
rm -rf bin/manual-acq

1
manual/manual-acq/ansi.h Symbolic link
View File

@ -0,0 +1 @@
../../slsReceiverSoftware/include/ansi.h

View File

@ -0,0 +1,21 @@
hostname bchip065+bchip195+
0:rx_tcpport 1954
0:rx_udpport 50005
0:detectorip 10.1.2.185
0:rx_udpip 10.1.2.102
1:rx_tcpport 1955
1:rx_udpport 50006
1:detectorip 10.1.2.186
1:rx_udpip 10.1.2.102
rx_hostname pc1875
outdir /home/l_msdetect/dhanya/outdir
vhighvoltage 0
enablefwrite 0
timing auto

1
manual/manual-acq/libzmq.a Symbolic link
View File

@ -0,0 +1 @@
../../slsReceiverSoftware/include/libzmq.a

900
manual/manual-acq/main.cpp Normal file
View File

@ -0,0 +1,900 @@
//------------------------------------------------------------------------------------------------------
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <cstring>
#include <stdint.h>
#include <algorithm>
#include <functional>
#include <cctype>
#include <locale>
#include <sstream>
#include <unistd.h>
#include "sls_receiver_defs.h"
#include "slsReceiverUsers.h"
#include "sls_detector_defs.h"
#include "slsDetectorUsers.h"
//#define GOTTHARD_25_TEST
//#define JUNGFRAU_TEST
#define GOTTHARD_TEST
//======================================================================================================
// test configuration
//======================================================================================================
int acquisition_nb = 1; // number of acquisition to make
int acquisition_nb_ok = 0; // number of correct acquisition
uint64_t last_acquisition_received_frames; // number of received frames during the last acquisition
std::vector <int> acquisition_nb_list;
bool use_trace = false; // activate the acquisition log
//------------------------------------------------------------------------------------------------------
// GOTTHARD 25um
//------------------------------------------------------------------------------------------------------
#ifdef GOTTHARD_25_TEST
const int receivers_nb = 2; // number of receivers
const int receivers_rx_tcpport[receivers_nb] = {1954, 1955}; // tcp port for each receiver
const int detector_id = 0; // detector identifier for slsDetectorUsers constructor
const std::string detector_config_file_name = "gotthard25.config"; // configuration file name (must be present in the same folder of this application)
const long detector_receiver_fifo_depth = 2500;
double detector_exposure_time_sec = 0.005;
double detector_exposure_period_sec = 0.10;
const double detector_delay_after_trigger_sec = 0.0;
const std::string detector_trig_mode = "auto"; // "auto" or "trigger"
int64_t detector_nb_frames_per_cycle = 10;
const int64_t detector_nb_cycles = 1;
int detector_module_index[receivers_nb] = {0, 1};
#else
//------------------------------------------------------------------------------------------------------
// GOTTHARD
//------------------------------------------------------------------------------------------------------
#ifdef GOTTHARD_TEST
const int receivers_nb = 1; // number of receivers
const int receivers_rx_tcpport[receivers_nb] = {1954}; // tcp port for each receiver
const int detector_id = 0; // detector identifier for slsDetectorUsers constructor
const std::string detector_config_file_name = "gotthard25.config"; // configuration file name (must be present in the same folder of this application)
const long detector_receiver_fifo_depth = 2500;
double detector_exposure_time_sec = 0.005;
double detector_exposure_period_sec = 0.1;
const double detector_delay_after_trigger_sec = 0.0;
const std::string detector_trig_mode = "auto"; // "auto" or "trigger"
int64_t detector_nb_frames_per_cycle = 10;
const int64_t detector_nb_cycles = 1;
int detector_module_index[receivers_nb] = {0};
#else
//------------------------------------------------------------------------------------------------------
// JUNGFRAU
//------------------------------------------------------------------------------------------------------
#ifdef JUNGFRAU_TEST
const int receivers_nb = 1; // number of receivers
const int receivers_rx_tcpport[receivers_nb] = {1954}; // tcp port for each receiver
const int detector_id = 0; // detector identifier for slsDetectorUsers constructor
const std::string detector_config_file_name = "jungfrau_nanoscopium_switch.config"; // configuration file name (must be present in the same folder of this application)
const long detector_receiver_fifo_depth = 2500;
double detector_exposure_time_sec = 0.0005;
double detector_exposure_period_sec = 0.001;
const double detector_delay_after_trigger_sec = 0.0;
const std::string detector_trig_mode = "auto"; // "auto" or "trigger"
int64_t detector_nb_frames_per_cycle = 10000;
const int64_t detector_nb_cycles = 1;
const int detector_clock_divider = 1;
int detector_module_index[receivers_nb] = {0};
#endif
#endif
#endif
//------------------------------------------------------------------------------------------------------
// test instances
//------------------------------------------------------------------------------------------------------
std::vector<slsReceiverUsers *> receivers;
slsDetectorUsers * detector = NULL;
//------------------------------------------------------------------------------------------------------
// tools functions
//------------------------------------------------------------------------------------------------------
/** Define Colors to print data call back in different colors for different recievers */
#define PRINT_IN_COLOR(c,f, ...) printf ("\033[%dm" f RESET, 30 + c+1, ##__VA_ARGS__)
#define PRINT_SEPARATOR() cprintf(MAGENTA, "============================================\n")
/************************************************************************
* \brief cleans the shared memory used by the camera
************************************************************************/
void clean_shared_memory()
{
std::string cmd = "rm /dev/shm/slsDetectorPackage*;";
std::system(cmd.c_str());
}
/*******************************************************************
* \brief converts a version id to a string
* \return version in string format (uppercase & hexa)
*******************************************************************/
std::string convertVersionToString(int64_t in_version)
{
std::stringstream tempStream;
tempStream << "0x" << std::uppercase << std::hex << in_version;
return tempStream.str();
}
//==================================================================
// Related to commands (put & get)
//==================================================================
/*******************************************************************
* \brief Converts a standard string to args arguments
* \param in_command command in command line format
* \param out_argv output c-strings c-array
* \param out_argc output number of arguments of out_argv
*******************************************************************/
void convertStringToArgs(const std::string & in_command,
char * * & out_argv ,
int & out_argc )
{
out_argv = NULL;
out_argc = 0 ;
// filling a string vector with the command line elements
std::vector<std::string> elements;
std::stringstream ss(in_command);
while (ss)
{
std::string element;
ss >> element;
if(element.size() > 0)
{
elements.push_back(element);
}
}
// setting argc value
out_argc = elements.size();
// allocating argv array
out_argv = new char * [out_argc];
// filling argv array
for (int element_index = 0; element_index < out_argc; element_index++)
{
out_argv[element_index] = new char[elements[element_index].size() + 1]; // adding the allocation of end of c-string
strcpy(out_argv[element_index], elements[element_index].c_str()); // copying the string including the eos
}
}
/*******************************************************************
* \brief Releases args arguments
* \param in_out_argv output c-strings c-array*(static_cast<int *>(p))
* \param in_out_argc output number of arguments of out_argv
*******************************************************************/
void releaseArgs(char * * & in_out_argv ,
int & in_out_argc )
{
if(in_out_argv != NULL)
{
// releasing the c_strings array content
for (int element_index = 0; element_index < in_out_argc; element_index++)
{
delete [] in_out_argv[element_index];
}
// releasing the c_strings array
delete [] in_out_argv;
in_out_argv = NULL;
in_out_argc = 0 ;
}
}
/*******************************************************************
* \brief Executes a set command
* \param in_command command in command line format
* \param in_module_index module index
* \return the command result
*******************************************************************/
std::string setCmd(const std::string & in_command, int in_module_index=-1)
{
std::cout << "setCmd - execute set command:\"" << in_command << "\"" << std::endl;
char * * argv ;
int argc ;
std::string result;
convertStringToArgs(in_command, argv, argc);
if(argc > 0)
{
result = detector->putCommand(argc, argv, in_module_index);
}
releaseArgs(argv, argc);
std::cout << "result=\"" << result << "\"" << std::endl;
return result;
}
/*******************************************************************
* \brief Executes a get command
* \param in_command command in command line format
* \param in_module_index module index
* \return the command result
*******************************************************************/
std::string getCmd(const std::string & in_command, int in_module_index=-1)
{
std::cout << "getCmd - execute get command:\"" << in_command << "\"" << std::endl;
char * * argv ;
int argc ;
std::string result;
convertStringToArgs(in_command, argv, argc);
if(argc > 0)
{
result = detector->getCommand(argc, argv, in_module_index);
}
releaseArgs(argv, argc);
std::cout << "result=\"" << result << "\"" << std::endl;
return result;
}
//------------------------------------------------------------------------------------------------------
// Receivers callbacks
//------------------------------------------------------------------------------------------------------
/**
* Start Acquisition Call back
* slsReceiver writes data if file write enabled.
* Users get data to write using call back if registerCallBackRawDataReady is registered.
* @param filepath file path
* @param filename file name
* @param fileindex file index
* @param datasize data size in bytes
* @param p pointer to object
* \returns ignored
*/
int StartAcq(char* filepath, char* filename, uint64_t fileindex, uint32_t datasize, void*p){
cprintf(BLUE, "#### StartAcq: filepath:%s filename:%s fileindex:%llu datasize:%u ####\n",
filepath, filename, fileindex, datasize);
cprintf(BLUE, "--StartAcq: returning 0\n");
last_acquisition_received_frames = 0LL;
return 0;
}
/**
* Acquisition Finished Call back
* @param frames Number of frames caught
* @param p pointer to object
*/
void AcquisitionFinished(uint64_t frames, void*p){
cprintf(BLUE, "#### AcquisitionFinished: frames:%llu ####\n",frames);
last_acquisition_received_frames = frames;
}
/**
* Get Receiver Data Call back
* Prints in different colors(for each receiver process) the different headers for each image call back.
* @param metadata sls_receiver_header metadata
* @param datapointer pointer to data
* @param datasize data size in bytes.
* @param p pointer to object
*/
void GetData(char* metadata, char* datapointer, uint32_t datasize, void* p)
{
if(use_trace)
{
slsReceiverDefs::sls_receiver_header* header = (slsReceiverDefs::sls_receiver_header*)metadata;
const slsReceiverDefs::sls_detector_header & detectorHeader = header->detHeader;
PRINT_IN_COLOR (*(static_cast<int *>(p)),
"#### %d GetData: ####\n"
"frameNumber: %llu\t\texpLength: %u\t\tpacketNumber: %u\t\tbunchId: %llu"
"\t\ttimestamp: %llu\t\tmodId: %u\t\t"
"row: %u\t\tcolumn: %u\t\treserved: %u\t\tdebug: %u"
"\t\troundRNumber: %u\t\tdetType: %u\t\tversion: %u"
//"\t\tpacketsMask:%s"
"\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
*(static_cast<int *>(p)),
(long long unsigned int)detectorHeader.frameNumber,
detectorHeader.expLength,
detectorHeader.packetNumber,
(long long unsigned int)detectorHeader.bunchId,
(long long unsigned int)detectorHeader.timestamp,
detectorHeader.modId,
detectorHeader.row,
detectorHeader.column,
detectorHeader.reserved,
detectorHeader.debug,
detectorHeader.roundRNumber,
detectorHeader.detType,
detectorHeader.version,
//header->packetsMask.to_string().c_str(),
((uint8_t)(*((uint8_t*)(datapointer)))),
datasize);
}
if((datapointer != NULL) && (datasize > 0))
{
char * buffer = new char[datasize];
memcpy(buffer, datapointer, datasize);
delete [] buffer;
}
}
//------------------------------------------------------------------------------------------------------
// CreateReceivers
//------------------------------------------------------------------------------------------------------
void CreateReceivers(void)
{
// preparing the args for receivers creation
char temp_port[10];
const int argc = 3;
char * args[argc] = {(char*)"slsReceiver", (char*)"--rx_tcpport", temp_port};
// creating the receivers instances
for(int i = 0 ; i < receivers_nb ; i++)
{
int ret = slsReceiverDefs::OK;
// changing the udp port in the args
sprintf(temp_port, "%d", receivers_rx_tcpport[i]);
// creating the receiver using the args
slsReceiverUsers * receiver = new slsReceiverUsers(argc, args, ret);
// managing a failed result
if(ret==slsReceiverDefs::FAIL)
{
delete receiver;
exit(EXIT_FAILURE);
}
// adding the receiver to the receivers container
receivers.push_back(receiver);
std::cout << "receiver (" << i << ") created - port (" << receivers_rx_tcpport[i] << ")" << std::endl;
// registering callbacks
// Call back for start acquisition
cprintf(BLUE, "Registering StartAcq()\n");
receiver->registerCallBackStartAcquisition(StartAcq, NULL);
// Call back for acquisition finished
cprintf(BLUE, "Registering AcquisitionFinished()\n");
receiver->registerCallBackAcquisitionFinished(AcquisitionFinished, NULL);
// Call back for raw data
cprintf(BLUE, "Registering GetData() \n");
receiver->registerCallBackRawDataReady(GetData, NULL);//&(detector_module_index[i]));
// starting tcp server thread
if (receiver->start() == slsReceiverDefs::FAIL)
{
delete receiver;
cprintf(BLUE,"Could not start receiver (%d)\n", i);
exit(EXIT_FAILURE);
}
}
}
//------------------------------------------------------------------------------------------------------
// ReleaseReceivers
//------------------------------------------------------------------------------------------------------
void ReleaseReceivers(void)
{
// deleting the receivers instances
for(int i = 0 ; i < receivers.size() ; i++)
{
slsReceiverUsers * receiver = receivers[i];
// stoping tcp server thread
receiver->stop();
delete receiver;
}
}
//------------------------------------------------------------------------------------------------------
// CreateDetector
//------------------------------------------------------------------------------------------------------
void CreateDetector(void)
{
int result;
// create the detector instance
detector = new slsDetectorUsers(result, detector_id);
if(result == slsDetectorDefs::FAIL)
{
std::cout << "slsDetectorUsers constructor failed! Could not initialize the camera!" << std::endl;
exit(EXIT_FAILURE);
}
// configuration file is used to properly configure advanced settings in the shared memory
result = detector->readConfigurationFile(detector_config_file_name);
if(result == slsDetectorDefs::FAIL)
{
std::cout << "readConfigurationFile failed! Could not initialize the camera!" << std::endl;
exit(EXIT_FAILURE);
}
// set detector in shared memory online (in case no config file was used) */
detector->setOnline(slsDetectorDefs::ONLINE_FLAG);
// set receiver in shared memory online (in case no config file was used) */
detector->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG);
// disabling the file write by the camera
detector->enableWriteToFile(slsDetectorDefs::DISABLED);
// logging some versions informations
std::cout << "Detector developer : " << detector->getDetectorDeveloper() << std::endl;
std::cout << "Detector type : " << detector->getDetectorType() << std::endl;
std::cout << "Detector Firmware Version : " << convertVersionToString(detector->getDetectorFirmwareVersion()) << std::endl;
std::cout << "Detector Software Version : " << convertVersionToString(detector->getDetectorSoftwareVersion()) << std::endl;
// ensuring detector status is idle
int status = detector->getDetectorStatus();
if((status != slsDetectorDefs::IDLE) && (status != slsDetectorDefs::STOPPED))
{
std::cout << "Detector not ready: " << slsDetectorUsers::runStatusType(status) << std::endl;
exit(EXIT_FAILURE);
}
}
//------------------------------------------------------------------------------------------------------
// ReleaseDetector
//------------------------------------------------------------------------------------------------------
void ReleaseDetector(void)
{
if(detector != NULL)
{
detector->setReceiverOnline(slsDetectorDefs::OFFLINE_FLAG);
detector->setOnline(slsDetectorDefs::OFFLINE_FLAG);
delete detector;
detector = NULL;
}
}
//------------------------------------------------------------------------------------------------------
// RunAcquisition
//------------------------------------------------------------------------------------------------------
int RunAcquisition(void)
{
std::string trig_mode_label;
double exposure_time ;
double exposure_period;
double delay_after_trigger;
int64_t nb_frames_per_cycle;
int64_t nb_cycles;
int64_t nb_frames;
#ifdef JUNGFRAU_TEST
int clock_divider;
#endif
//----------------------------------------------------------------------------------------------------
// setting the receiver fifo depth (number of frames in the receiver memory)
detector->setReceiverFifoDepth(detector_receiver_fifo_depth);
//----------------------------------------------------------------------------------------------------
detector->setExposureTime (detector_exposure_time_sec , true); // in seconds
detector->setExposurePeriod (detector_exposure_period_sec, true); // in seconds
detector->setDelayAfterTrigger(detector_delay_after_trigger_sec, true); // in seconds
exposure_time = detector->setExposureTime (-1, true); // in seconds
exposure_period = detector->setExposurePeriod (-1, true); // in seconds
delay_after_trigger = detector->setDelayAfterTrigger(-1, true, 0); // in seconds
//----------------------------------------------------------------------------------------------------
// initing the number of frames per cycle and number of cycles
// to avoid problems during the trigger mode change.
detector->setNumberOfFrames(1);
detector->setNumberOfCycles(1);
// conversion of trigger mode label to trigger mode index
int trigger_mode_index = slsDetectorUsers::getTimingMode(detector_trig_mode);
// apply the trigger change
detector->setTimingMode(trigger_mode_index);
// converting trigger mode index to trigger mode label
trig_mode_label = slsDetectorUsers::getTimingMode(trigger_mode_index);
// setting the number of cycles
nb_cycles = detector->setNumberOfCycles(detector_nb_cycles);
// setting the number of frames per cycle
nb_frames_per_cycle = detector->setNumberOfFrames(detector_nb_frames_per_cycle);
// setting the gain mode
detector->setSettings(slsDetectorUsers::getDetectorSettings("dynamicgain"));
#ifndef JUNGFRAU_TEST
detector->setSettings(slsDetectorUsers::getDetectorSettings("mediumgain"));
#else
detector->setSettings(slsDetectorUsers::getDetectorSettings("dynamichg0"));
#endif
// computing the number of frames
nb_frames = nb_cycles * nb_frames_per_cycle;
//----------------------------------------------------------------------------------------------------
#ifdef JUNGFRAU_TEST
// clock divider
detector->setClockDivider(detector_clock_divider);
clock_divider = detector->setClockDivider(-1);
#endif
//----------------------------------------------------------------------------------------------------
std::cout << "receiver fifo depth : " << detector_receiver_fifo_depth << std::endl;
std::cout << "Exposure time in seconds : " << exposure_time << std::endl;
std::cout << "Exposure period in seconds : " << exposure_period << std::endl;
std::cout << "Delay after trigger in seconds : " << delay_after_trigger << std::endl;
std::cout << "Trigger mode : " << trig_mode_label << std::endl;
std::cout << "Nb frames per cycle : " << nb_frames_per_cycle << std::endl;
std::cout << "Nb cycles : " << nb_cycles << std::endl;
std::cout << "Nb frames : " << nb_frames << std::endl;
#ifdef JUNGFRAU_TEST
std::cout << "Clock divider : " << clock_divider << std::endl;
#endif
std::cout << "Estimated frame rate : " << (1.0 / exposure_period) << std::endl;
//----------------------------------------------------------------------------------------------------
// reset the number of caught frames in the sdk
detector->resetFramesCaughtInReceiver();
//----------------------------------------------------------------------------------------------------
const unsigned int sleep_time_sec = 1; // sleep the thread in seconds
// starting receiver listening mode
if(detector->startReceiver() == slsDetectorDefs::FAIL)
{
std::cout << "Could not start the receiver listening mode!" << std::endl;
return slsDetectorDefs::FAIL;
}
// starting real time acquisition in non blocking mode
// returns OK if all detectors are properly started, FAIL otherwise
if(detector->startAcquisition() == slsDetectorDefs::FAIL)
{
detector->stopReceiver();
std::cout << "Could not start real time acquisition!" << std::endl;
return slsDetectorDefs::FAIL;
}
for(;;)
{
// checking if the hardware acquisition is running
int status = detector->getDetectorStatus();
if((status == slsDetectorDefs::IDLE ) ||
(status == slsDetectorDefs::STOPPED) ||
(status == slsDetectorDefs::ERROR ))
{
// we stop the treatment
break;
}
else
// hardware acquisition is running, we are waiting for new frames not using the cpu during this time
{
usleep(sleep_time_sec * 1000 * 1000); // sleep the thread in seconds
}
}
// stopping receiver listening mode
if(detector->stopReceiver() == slsDetectorDefs::FAIL)
{
std::cout << "Could not stop real time acquisition!" << std::endl;
return slsDetectorDefs::FAIL;
}
//----------------------------------------------------------------------------------------------------
PRINT_SEPARATOR();
std::cout << "receiver fifo depth : " << detector_receiver_fifo_depth << std::endl;
std::cout << "Exposure time in seconds : " << exposure_time << std::endl;
std::cout << "Exposure period in seconds : " << exposure_period << std::endl;
std::cout << "Delay after trigger in seconds : " << delay_after_trigger << std::endl;
std::cout << "Trigger mode : " << trig_mode_label << std::endl;
std::cout << "Nb frames per cycle : " << nb_frames_per_cycle << std::endl;
std::cout << "Nb cyles : " << nb_cycles << std::endl;
std::cout << "Nb frames : " << nb_frames << std::endl;
#ifdef JUNGFRAU_TEST
std::cout << "Clock divider : " << clock_divider << std::endl;
#endif
std::cout << "Estimated frame rate : " << (1.0 / exposure_period) << std::endl;
if(last_acquisition_received_frames == nb_frames)
{
acquisition_nb_ok++;
return slsDetectorDefs::OK;
}
PRINT_SEPARATOR();
return slsDetectorDefs::FAIL;
}
//------------------------------------------------------------------------------------------------------
// test
//------------------------------------------------------------------------------------------------------
void Test(void)
{
try
{
PRINT_SEPARATOR();
std::cout << "CreateReceivers" << std::endl;
PRINT_SEPARATOR();
CreateReceivers();
PRINT_SEPARATOR();
std::cout << "CreateDetector" << std::endl;
PRINT_SEPARATOR();
CreateDetector();
PRINT_SEPARATOR();
std::cout << "RunAcquisition" << std::endl;
PRINT_SEPARATOR();
for(int acquisition_index = 0 ; acquisition_index < acquisition_nb ; acquisition_index++)
{
cprintf(MAGENTA, "Acquisition number : %d\n", acquisition_index);
if (RunAcquisition() == slsDetectorDefs::FAIL) {
acquisition_nb_list.push_back(acquisition_index);
}
}
PRINT_SEPARATOR();
std::cout << "ReleaseDetector" << std::endl;
PRINT_SEPARATOR();
ReleaseDetector();
PRINT_SEPARATOR();
std::cout << "ReleaseReceivers" << std::endl;
PRINT_SEPARATOR();
ReleaseReceivers();
PRINT_SEPARATOR();
if (acquisition_nb - acquisition_nb_ok)
cprintf(BOLD RED, "Correct acquisition(s) %d/%d\n", acquisition_nb_ok, acquisition_nb);
else
cprintf(BOLD GREEN, "Correct acquisition(s) %d/%d\n", acquisition_nb_ok, acquisition_nb);
if (acquisition_nb - acquisition_nb_ok) {
cprintf(RED, "Acquisition(s) gone wrong :\n");
for (int list_index = 0; list_index < acquisition_nb_list.size(); ++list_index) {
cprintf(RED, "%d\n", acquisition_nb_list[list_index]);
}
}
PRINT_SEPARATOR();
}
catch (...)
{
std::cout << "unknown exception!" << std::endl;
exit(EXIT_FAILURE);
}
}
std::string roi_result =
"detector 0:\n"
"0 255 -1 -1\n"
"detector 1:\n"
"1024 1279 -1 -1\n"
"\n"
"xmin xmax ymin ymax\n"
"0 255 -1 -1\n"
"2304 2559 -1 -1\n"
"roi 2\n";
#include <vector>
// use example :
// std::vector<slsReceiverDefs::ROI> rois;
// get_rois_from_string(roi_result, rois);
/*******************************************************************
* \brief Cuts the string in pieces
* \param[in] in_string source string
* \param[in] in_delimitor line delimitor
* \param[out] out_lines line container result
*******************************************************************/
void split_string_line(const std::string & in_string, const char in_delimitor, std::vector<std::string> & out_lines)
{
std::stringstream ss(in_string);
std::string sub_string;
while (getline(ss, sub_string, in_delimitor))
{
out_lines.push_back(sub_string);
}
}
/*******************************************************************
* \brief retrieve the ROIs from a string
* \param[in] in_rois_string string from "get roi" command
* \param[out] out_rois ROI container result (empty if no set ROI)
*******************************************************************/
void get_rois_from_string(const std::string & in_rois_string, std::vector<slsReceiverDefs::ROI> & out_rois)
{
out_rois.clear();
try
{
// cuts the string in lines
std::vector<std::string> lines;
split_string_line(in_rois_string, '\n', lines);
if(lines.size() >= 1)
{
// checks if no ROI ?
if(lines[0] != "roi 0")
{
for(int roi_index = 0 ; roi_index < 2 ; roi_index++)
{
if(lines.size() >= ((roi_index + 1) * 2)) // two lines per ROI definition
{
std::stringstream detector_name;
detector_name << "detector " << roi_index << ":";
// checks the first line
if(lines[roi_index * 2] == detector_name.str())
{
std::stringstream ss(lines[(roi_index * 2) + 1]);
slsReceiverDefs::ROI roi;
ss >> roi.xmin;
ss >> roi.xmax;
ss >> roi.ymin;
ss >> roi.ymax;
out_rois.push_back(roi);
}
}
}
}
}
}
catch(...)
{
out_rois.clear();
}
}
//------------------------------------------------------------------------------------------------------
// read_simple_option
//------------------------------------------------------------------------------------------------------
bool read_simple_option(int argc, char* argv[], const char * in_option_name)
{
int option_index = 1;
while(option_index < argc)
{
if (strcmp(argv[option_index], in_option_name) == 0)
{
std::cout << "Found option:" << in_option_name << std::endl;
return true;
}
option_index++;
}
return false;
}
//------------------------------------------------------------------------------------------------------
// read_option_value
//------------------------------------------------------------------------------------------------------
template <typename T> bool read_option_value(int argc, char* argv[], const char * in_option_name, T & out_option_value)
{
int option_index = 1;
while(option_index < argc)
{
if (strcmp(argv[option_index], in_option_name) == 0)
{
option_index++;
if(option_index < argc)
{
std::stringstream ss(std::string(argv[option_index]));
ss >> out_option_value;
std::cout << "Found option: " << in_option_name << " " << out_option_value << std::endl;
return true;
}
}
option_index++;
}
return false;
}
//------------------------------------------------------------------------------------------------------
// main
//------------------------------------------------------------------------------------------------------
int main (int argc, char* argv[])
{
if(read_simple_option(argc, argv, "-help") || read_simple_option(argc, argv, "--help"))
{
PRINT_SEPARATOR();
std::cout << "Options:" << std::endl;
std::cout << "-clean -> clean shared memory" << std::endl;
std::cout << "-trace -> activate acquisition log" << std::endl;
std::cout << "-exp <value> -> set exposure time value in seconds (for example: -exp 0.0005)" << std::endl;
std::cout << "-period <value> -> set period time value in seconds (for example: -period 0.001)" << std::endl;
std::cout << "-frames <value> -> set number of frames (for example: -frames 10000)" << std::endl;
std::cout << "-acq <value> -> set number of acquisition (for example: -acq 10)" << std::endl;
std::cout << std::endl;
std::cout << "example: ./manual-acq -clean -trace -acq 1 -exp 0.0005 -period 0.001 -frames 1000" << std::endl;
PRINT_SEPARATOR();
return 0;
}
if(read_simple_option(argc, argv, "-clean"))
{
PRINT_SEPARATOR();
std::cout << "Cleaning shared memory" << std::endl;
PRINT_SEPARATOR();
clean_shared_memory();
}
if(read_simple_option(argc, argv, "-trace"))
{
PRINT_SEPARATOR();
std::cout << "Activating acquisition log..." << std::endl;
PRINT_SEPARATOR();
use_trace = true;
}
int64_t frames_value;
if(read_option_value(argc, argv, "-frames", frames_value))
{
detector_nb_frames_per_cycle = frames_value;
}
double exp_value;
if(read_option_value(argc, argv, "-exp", exp_value))
{
detector_exposure_time_sec = exp_value;
}
double period_value;
if(read_option_value(argc, argv, "-period", period_value))
{
detector_exposure_period_sec = period_value;
}
int acq_nb;
if(read_option_value(argc, argv, "-acq", acq_nb))
{
acquisition_nb = acq_nb;
}
Test();
std::cout << "====================== ENDING ======================" << std::endl;
return 0;
}
//------------------------------------------------------------------------------------------------------

View File

@ -0,0 +1 @@
../../slsDetectorSoftware/slsDetector/slsDetectorUsers.h

View File

@ -0,0 +1 @@
../../slsReceiverSoftware/include/slsReceiverUsers.h

View File

@ -0,0 +1 @@
../../slsDetectorSoftware/commonFiles/sls_detector_defs.h

View File

@ -0,0 +1 @@
../../slsDetectorSoftware/commonFiles/sls_detector_funcs.h

View File

@ -0,0 +1 @@
../../slsReceiverSoftware/include/sls_receiver_defs.h

View File

@ -0,0 +1 @@
../../slsReceiverSoftware/include/sls_receiver_funcs.h

1
manual/manual-acq/zmq.h Symbolic link
View File

@ -0,0 +1 @@
../../slsReceiverSoftware/include/zmq.h

View File

@ -1,5 +1,5 @@
PKGDIR = ../..
LIBDIR = $(PKGDIR)/build/bin
LIBDIR = $(PKGDIR)/bin
INCLUDES = -I . -I$(PKGDIR)/slsReceiverSoftware/include -I$(PKGDIR)/slsDetectorSoftware/slsDetectorAnalysis -I$(LIBDIR) -I$(PKGDIR)/slsDetectorSoftware/slsDetector
SRC_DET = mainClient.cpp
SRC_REC = mainReceiver.cpp

Binary file not shown.

View File

@ -28,8 +28,6 @@ Figure ~\ref{boards} show the readout board basic components on an Eiger half mo
\label{boards}
\end{figure}
\subsection{Mandatory setup - Hardware}
An EIGER single module (500~kpixels) needs:
\begin{itemize}
@ -66,7 +64,8 @@ The directory contains some executables that are needed to make your detector to
\begin{verbatim}
./on #to switch modules on
./off #to switch modules off
./hvget #gets the current HV value
./state #tells you if is ON or OFF
cat /var/log/pcu.log #displays the log if there are problem
./waterflow #returns the current waterflow returned by the flowmeter
./temp #returns the water temperature returned by the flowmeter
\end{verbatim}
@ -93,10 +92,14 @@ The receiver is a process run on a PC closely connected to the detector. Open on
where xxxx, yyyy are the tcp port numbers. Use 1955 and 1956 for example. The receiver for the bottom is open without arguments but still in the configuration file one needs to write {\tt{n:flippeddatax 1}}, where {\tt{2n+1}} indicated the half module number, 1 if it is a module.
\\ Open as many receiver as half module boards. A single module has two half module boards.
From the software version 3.0.1, one can decide weather start a zmq callback from the receiver to the client (for example to visualize data in the slsDetectorGui or another gui). If the zmq steam is not required (cased of the command line for example, one can switch off the streaming with {\tt{./sls\_detector\_put rx\_datastream 0}}, enable it with {\tt{./sls\_detector\_put rx\_datastream 1}}. In the case of inizialising the stream to use the slsDetectorGui, nothing needs to be taken care of by the user. If instead you want to stream the streaming on different channels, the zmq port of the client can be set stealing from the slsDetectorGui stream having {\tt{./sls\_detector\_put zmqport 300y}}. Note that if this is done globally (not for every half module n independently, then the client automatically takes into account that for every half module, there are 2 zmq stream. The receiver stream {\tt{./sls\_detector\_put rx\_zmqport 300y}} has to match such that the GUI can work.
From the software version 3.0.1, one can decide weather start a zmq callback from the receiver to the client (for example to visualize data in the slsDetectorGui or another gui). If the zmq steam is not required (cased of the command line for example, one can switch off the streaming with {\tt{./sls\_detector\_put rx\_datastream 0}}, enable it with {\tt{./sls\_detector\_put rx\_datastream 1}}. In the case of initializing the stream to use the slsDetectorGui, nothing needs to be taken care of by the user. If instead you want to stream the streaming on different channels, the zmq port of the client can be set stealing from the slsDetectorGui stream having {\tt{./sls\_detector\_put zmqport 300y}}. Note that if this is done globally (not for every half module n independently, then the client automatically takes into account that for every half module, there are 2 zmq stream. The receiver stream {\tt{./sls\_detector\_put rx\_zmqport 300y}} has to match such that the GUI can work.
If one desires to set the zmqport manually, he offset has to be taken into account: {\tt{./sls\_detector\_put 0:rx\_zmqport 300y}}, {\tt{./sls\_detector\_put 1:rx\_zmqport 300y+2}} and so on..
There is an example code that can be compiled in {\tt{manual/manual-api/mainReceiver.cpp}} and gives the executable {\tt{./detReceiver}}, use it with two or more receivers to open all receivers in one single terminal: {\tt{./detReceiver startTCPPort numReceivers withCallback}}, where startTCPPort assumes the other ports are consecutively increased.
{\tt{slsMultiReceiver}} uses two or more receivers in one single terminal: {\tt{./slsMultiReceiver startTCPPort numReceivers withCallback}}, where startTCPPort assumes the other ports are consecutively increased.
The command {\tt{r\_framesperfile}} sets the number of frames written in the same file. By default now it is 10000. It can be changes. It needs to be lowered particularly if one wants to parallelize the following conversion of the files.
\subsection{Mandatory setup - Client}
@ -282,6 +285,39 @@ The detector will not accept other commands while acquiring. If an acquisition w
\end{itemize}
this same command can be used after a non proper abortion of the acquisition to reset to normal status the detector.
\section{Gap pixels inside a module}
A module is composed of 2$\times$4 chips. Each chip is of dimension 256$\times$256 pixels. There is no dead area in a module, as a single sensor covers the 8 chips. The physical pixels at the border of the chips in the sensor are double in size, to allow not to loose photons in the gaps between the chip alignment. They count double what the other normal pixels would count. In the corner between chips, the pixels are 4-times the normal size. See figure~\ref{fgappix} to check the geometry.
\begin{figure}[t]
\begin{center}
\includegraphics[width=0.9\textwidth]{GapPixels}
\end{center}
\caption{Geometry of gap pixels between a module.}
\label{fgappix}
\end{figure}
It is possible to interpolated the value on the larger pixels by splitting the events (or properly interpolating) introducing a virtual pixel for every double pixel, or 3 virtual pixels for every corner. In this way the counts of a single large pixel can be shared among the correct amount of pixels of the normal dimension.
The gap pixels can be added for the slsDetectorGui, from the datacall back or stealing the zmq port from the GUI (see later). The detector size can be added in the configuration file as first thing.
Putting the long side of the module first always as a convection for the code, WITHOUT GAP PIXELS an EIGER module is:
\begin{verbatim}
detsizechan 1024 512
\end{verbatim}
and the client needs to be set {\tt{sls\_detector\_put gappixels 0}}, which is the default behavior.\\
If you want to have GAP PIXELS included:
\begin{verbatim}
detsizechan 1030 514
\end{verbatim}
and the client needs to be set {\tt{sls\_detector\_put gappixels 1}}.
The size of the gap pixels between modules to insert is
\begin{verbatim}
GapPixelsBetweenModules_x = 8
GapPixelsBetweenModules_y = 36
\end{verbatim}
where the {\tt{GapPixelsBetweenModules\_x}} are the one on the short side of the module, while {\tt{GapPixelsBetweenModules\_y}} are the ones on the long side of the module (where the wirebonds take physical space).
\section{Readout timing- maximum frame rate}\label{timing}
IMPORTANT: to have faster readout and smaller dead time, one can configure {\tt{clkdivider}}, i.e. the speed at which the data are read, i.e. 200/100/50~MHz for {\tt{clkdivider 0/1/2}} and the dead time between frames through {\tt{flags parallel}}, i.e. acquire and read at the same time or acquire and then read out.
The configuration of this timing variables allows to achieve different frame rates. NOTE THAT IN EIGER, WHATEVER YOU DO, THE FRAME RATE LIMITATIONS COME FROM THE NETWORK BOTTLENECK AS THE HARDWARE GOES FASTER THAN THE DATA OUT.
@ -369,48 +405,50 @@ where the 'minimum time between frames' and the minimum period will be discussed
\begin{tiny}
\begin{table}
\begin{flushleft}
\begin{tabular}{|c|c|c|c|c|c|c|}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
\tiny{dr} & \tiny{clkdivider} & \tiny{flags} & \tiny{t between frames($\mu$s) } & \tiny{max frame rate (kHz)} & \tiny{min period ($\mu$s)} & \tiny{max imgs (nominal/our network)}\\
\tiny{dr} & \tiny{clkdivider} & \tiny{flags} & \tiny{$\Delta$t frames($\mu$s) } & \tiny{max FR (kHz)} & \tiny{min period ($\mu$s)} & \tiny{meas. period ($\mu$s)} & \tiny{max imgs (nominal/our network)}\\
\hline
4 & 0 & parallel & 3.4 & 22 & 44 & 30k/50k\\
4 & 0 & \tiny {parallel} & 3.4 & 22 & 44 & 44.01 & 30k/50k\\
\hline
4 & 1 & parallel & 6 & 10.5 & 92 & 30k/100k\\
4 & 1 & \tiny {parallel} & 6 & 10.5 & 92 & 92.02 & 30k/100k\\
\hline
4 & 2 & parallel & 11.2 & 5.4 & 197 & infinite\\
4 & 2 & \tiny {parallel} & 11.2 & 5.4 & 197& 197.01 & infinite\\
\hline
\hline
8 & 0 & parallel & 3.4 & 11.1 & 89 & 15k/24k\\
8 & 0 & \tiny {parallel} & 3.4 & 11.1 & 89 & 89.01 & 15k/24k\\
\hline
8 & 1 & parallel & 6.1 & 5.7 & 181 & 15k/52k\\
8 & 1 & \tiny {parallel} & 6.1 & 5.7 & 181 & 181.01 & 15k/52k\\
\hline
8 & 2 & parallel & 11.2 & 2.9 & 342 & infinite\\
8 & 2 & \tiny {parallel} & 11.2 & 2.9 & 342 & 342.01 & infinite\\
\hline
\hline
16 & 0 & parallel & 3.4 & 6.1 & (126+38)* =164 & 8k/12k\\
16 & 0 & \tiny {parallel} & 3.4 & 6.1 & (126+38)* =164 & 164.02 & 8k/12k\\
\hline
16 & 0 & nonparallel & 126 & 5.6 & (126+52)*= 179 & 8k/23k\\
16 & 0 & \tiny {nonparallel} & 127 & 5.6 & (126+52)*= 179 & 179.01& 8k/23k\\
\hline
16 & 1 & parallel & 6.1 & 3.9 & 257 & 8k/28k\\
16 & 1 & \tiny {parallel} & 6.1 & 3.9 & 257 & 257.01 & 8k/28k\\
\hline
16 & 1 & nonparallel & 255 & 3.3 & 303 & infinite\\
16 & 1 & \tiny {nonparallel} & 255 & 3.3 & 303 & 303.01 & infinite\\
\hline
16 & 2 & parallel & 11 & 1.9 & 526 & infinite \\
16 & 2 & \tiny {parallel} & 11.2 & 1.9 & 526 & 526.2 & infinite \\
\hline
16 & 2 & nonparallel & 504 & 1.8 & 555 & infinite\\
16 & 2 & \tiny {nonparallel} & 505 & 1.8 & 555 & 555.01& infinite\\
\hline
%32 & 2 & parallel & 11 & 2& & &\\
%\hline
%32 & 2 & nonparallel & 504 & $<2$& & &\\
%\hline
\end{tabular}
\caption{Readout settings. The {\tiny{min exptime}} possible is 5$-$10~$\mu$s. This is due to the time to pass the pixel enable signal in the whole chip. The time between frames has been measured with the oscilloscope and the maximum frames rate has been tested with an external gating from a pulse generator at known frequence. The minimum period is obtained as 1/$\textrm{max frame rate}$.}
\caption{Readout settings. The {\tiny{min exptime}} possible is 5$-$10~$\mu$s. This is due to the time to pass the pixel enable signal in the whole chip. The time between frames ($\Delta$t) has been measured with the oscilloscope and the maximum frames rate (max FR) has been tested with an external gating from a pulse generator at known frequency. The minimum period is obtained as 1/$\textrm{max frame rate}$.}
\label{tframes}
\end{flushleft}
\end{table}
\end{tiny}
\textbf{As if you run too fast, the detector could become noisier, it is important to match the detector settings to your frame rate. This can be done having more parameters files and load the one suitable with your experiment.} We experienced that with low energy settings could not reach 6~kHz and no noise.
\textbf{From software version 4.0.0, there is a very useful function {\tt{sls\_detector\_get measuredperiod}} which return the measured period AFTER the acquisition. This is important to check that the settings to obtain the targeted frame rate was correct.}
\textbf{If you run too fast, the detector could become noisier (see problem shooting), it is important to match the detector settings to your frame rate. This can be done having more parameters files and load the one suitable with your experiment.} We experienced that with low energy settings could not reach 6~kHz and no noise.
In 16 bit mode, it could make sense, in case of noise and low threshold to either reduce the frame rate:
\begin{equation}
@ -482,6 +520,12 @@ The number of subframes composing a single 32bit acquisition can be calculated a
\end{equation}
This also means that {\tt{exptime}}$<${\tt{subexptime}} will be rounded to{\tt{subexptime}}. If you want shorter acquisitions, either reduce the {\tt{subexptime}} or switch two 16-bit mode (you can always sum offline if needed).
From release 4.0.0, an extra {\tt{flag overflow/nooverflow}} is added, with {\tt{nooverflow}} default:
\begin{itemize}
\item {\tt{nooverflow}}: the internal 12-bit result is summed, even if there was saturation of the 12-bit counter (4095) in any of the subframes. Note that if there is saturation for every subframe, you might get as a result a value of the counter equal to (4095$\times$~number~of~subframes), which you need to correctly identify. On the other hand if the saturation occurred only one time, you will get something "close'' to the real number.
\item {\tt{overflow}}: In this case, even if a pixel saturate only 1 time in a subframe, you will be returned as a value of the counter for that pixel: $2^{32}-1$, i.e. 4294967295.
\end{itemize}
The UDP header will contain, after you receive the data, the effective number of subframe per image (see section~\ref{UDP}) as "SubFrame Num or Exp Time", i.e. the number of subframes recorded (32 bit eiger).
The effective time the detector has recorded data can be computed as:
\begin{equation}
@ -489,7 +533,9 @@ The effective time the detector has recorded data can be computed as:
%\label{esubframes}
\end{equation}
In the future release, a configurable extra time difference between subframes will be introduced for the parallel mode, so that some noise appearing in detectors at low threshold can be removed. This will enlarge the time difference between frames form the default 12~$\mu$s to something configurable, expected to be 15-40~$\mu$s (for the 9M it is currently 200~$\mu$s due to a noisier module).
From release 4.0.0, a configurable extra time difference between subframes can be introduced for the parallel mode, so that some noise appearing in detectors at low threshold can be removed. This is obtained through the {\tt{subdeadtime}}. You need to add values specific for your detector (ask the detector group). Typically, values between 15-40~$\mu$s should be used (for the 9M it is currently 200~$\mu$s due to a noisier module).
\section{External triggering options}\label{triggering}
The detector can be setup such to receive external triggers. Connect a LEMO signal to the TRIGGER IN connector in the Power Distribution Board (see Fig.). The logic 0 for the board is passed by low level 0$-$0.7~V, the logic 1 is passed to the board with a signal between 1.2$-$5~V. Eiger is 50~$\Omega$ terminated. By default the positive polarity is used (negative should not be passed to the board).
@ -515,12 +561,23 @@ Here are the implemented options so far:
\item {\tt{auto}} is the software controlled acquisition (does not use triggers), where {\tt{exptime}} and {\tt{period}} have to be set. Set number of cycles (i.e. triggers) to 1 using {\tt{cycles}}. Set number of frames using {\tt{frames}}.
\item {\tt{trigger}} 1 frame taken for 1 trigger. Your {\tt{frames}} needs to be 1 always, {\tt{cycles}} can be changed and defines how many triggers are considered. {\tt{exptime}} needs to be set. In the GUI this is called trigger exposure series.
\item {\tt{burst\_trigger}} gets only 1 trigger, but allows to take many frames. With {\tt{frames}} one can change the number of frames. {\tt{cycles}} needs to be 1. {\tt{exptime}} and {\tt{period}} have to be set. In the gui it is called trigger readout.
\item{\tt{gating}} allows to get a frame only when the trigger pulse is gating. Note that in this case the exp time and period only depend on the gating signal. {\tt{cycles}} allows to select how many gates to consider. Set number of frames to 1 using {\tt{frames}}.
\item{\tt{gating}} allows to get a frame only when the trigger pulse is gating. Note that in this case the exp time and period only depend on the gating signal. {\tt{cycles}} allows to select how many gates to consider. Set number of frames to 1 using {\tt{frames}}. ATTENTION: if you are in 16 bit mode and you are applying online rate corrections, as now the exptime is generated by the trigger, you might not have correct rate corrections. If you know what the exposure time is in the gating signal, then you can set the {\tt{exptime}} once and the rate corrections will be correct. If the exposure time is unknow, it is recommended that you switch off the rate corrections. In 32 bit mode, it does not matter as the rate corrections depends on the {\tt{subexptime}} which is software set independently from the gate exptime.
\end{itemize}
Hardware-wise, the ENABLE OUT signal outputs when the chips are really acquiring. This means that the single subframes will be output in 32 bit mode. The TRIGGER OUT outputs the sum-up-signal at the moment (which is useless). This will be changed in the future to output the envelop of the enable signal.
We are planning to change some functionality, i.e. unify the {\tt{trigger}} and {\tt{burst}} trigger modes and make both {\tt{frames}} and {\tt{cycles}} configurable at the same time.
We are planning to change some functionality, i.e. unify the {\tt{trigger}} and {\tt{burst\_trigger}} trigger modes and make both {\tt{frames}} and {\tt{cycles}} configurable at the same time.
There is the possibility to use {\tt{timing trigger/burst\_trigger}} and send software single commands to fake the trigger. This is done with:
\begin{verbatim}
sls_detector_put 0-timing [trigger/burst_trigger]
sls_detector_put 0-frames x
sls_detector_put 0-cycles y
sls_detector_status trigger
\end{verbatim}
Note that this functionality is very (!) useful if you need to do something between and acquisition and the next. This can be used to do a fast threshold scan for example. See section~\ref{Sec:fastthresholdscan}.
\section{Autosumming and rate corrections} \label{advanced}
@ -718,44 +775,53 @@ white the option {\tt{n:flippeddatax 1}}, which flips in vertical the content of
\subsection{``raw'' files}
If you use the option of writing raw files, you will have a raw file for each UDP port (meaning most likely 2 chips), 4 files per module. In addition to the raw files, you will get also a ``master'' file, containing in ascii some detector general parameters and the explanation of how to interpret the data from the raw files.
The master file is named: {\tt{filename\_master\_0.raw}} and for version ``3.0'' of the slsDetectorSoftware looks like:
The master file is named: {\tt{filename\_master\_0.raw}} and for version ``4.0.0'' of the slsDetectorSoftware looks like:
\begin{verbatim}
Version : 1.0
Dynamic Range : 16
Ten Giga : 1
Image Size : 262144 bytes
x : 512 pixels
y : 256 pixels
Total Frames : 1
Exptime (ns) : 1000000000
SubExptime (ns) : 2621440
Period (ns) : 1000000000
Timestamp : Thu Aug 17 10:55:19 2017
Version : 2.0
Dynamic Range : 32
Ten Giga : 1
Image Size : 524288 bytes
x : 512 pixels
y : 256 pixels
Max. Frames Per File : 10000
Total Frames : 1
Exptime (ns) : 1000000000
SubExptime (ns) : 2621440
SubPeriod(ns) : 2621440
Period (ns) : 1000000000
Timestamp : Mon Sep 3 09:07:05 2018
#Frame Header
Frame Number : 8 bytes
SubFrame Number : 4 bytes
Packet Number : 4 bytes
Bunch ID : 8 bytes
Timestamp : 8 bytes
Module Id : 2 bytes
X Coordinate : 2 bytes
Y Coordinate : 2 bytes
Z Coordinate : 2 bytes
Debug : 4 bytes
Round Robin Number : 2 bytes
Detector Type : 1 byte
Header Version : 1 byte
Frame Number : 8 bytes
SubFrame Number/ExpLength : 4 bytes
Packet Number : 4 bytes
Bunch ID : 8 bytes
Timestamp : 8 bytes
Module Id : 2 bytes
X Coordinate : 2 bytes
Y Coordinate : 2 bytes
Z Coordinate : 2 bytes
Debug : 4 bytes
Round Robin Number : 2 bytes
Detector Type : 1 byte
Header Version : 1 byte
Packets Caught Mask : 64 bytes
\end{verbatim}
Note that if one wants to reconstruct the real time the detector was acquiring in 32 bit (autosumming mode), one would have to multiply the SubExptime (ns) for the SubFrame Number.
\subsection{Offline image reconstruction}
The offline image reconstruction{\tt{slsImageReconstruction}} is not part of the package anymore.
The offline image reconstruction{\tt{slsImageReconstruction}} is not part of the package anymore. The code is still available doing \\
{\tt{git clone git@git.psi.ch:sls\_detectors\_software/sls\_image\_reconstruction.git slsImageReconstruction}}.
Checkout the {\tt{developer}} branch if in a 3.1.X release or the {\tt{v4.0.0}} branch if in 4.0.X release of the {\tt{slsDetector}} code.
The detector writes 2 raw files per receiver. An offline image reconstruction executable has been written to collate the possible files together and produce cbf files. The executable uses the CBFlib-0.9.5 library (downloaded from the web as it download some architecture dependent packages at installation).\\
Three possible conversions are possible: into \textbf{cbf}, \textbf{hdf5} and \textbf{root} format. The detector writes 4 raw files per receiver. An offline image reconstruction executable has been written to collate the possible files together and produce output files. By default an interpolation between the values of the large pixels is performed. Gap pixels between modules are also inserted.
\subsubsection{cbf}
The cbf executable executable uses the CBFlib-0.9.5 library (downloaded from the web as it download some architecture dependent packages at installation).Edit the Makefile to correclty point at it.\\
\underline{At cSAXS, the CBFlib-0.9.5 has been compiled -such that the required packages are}\\\underline{ downloaded in /sls/X12SA/data/x12saop/EigerPackage/CBFlib-0.9.5.}\\
To use it for a single module:
@ -765,29 +831,90 @@ cbfMaker [filename with dir]
eg.
{\tt{cbfMaker /scratch/run\_63\_d1\_f000000000000\_3.raw}}\\
To use it for a 1.5 multi modules:
\begin{verbatim}
cbfMaker [filename] [pixels x] [pixels y] ([singlemodulelongside_x] [start det])
\end{verbatim}
To use it any geometry:\\
{\tt{cbfMaker [filename] [pixels x, def=1024] [pixels y, def=512] [singlemodulelongside\_x, def=1] [fillgaps, def=Interpolate Big Pixels] [hdf5datasetname, def="Eiger"] [start det,def=0]}}\\
eg.
{\tt cbfMaker /scratch/run\_63\_d0\_f000000000000\_3.raw 3072 512 1 0}.\\
The {\tt{[singlemodulelongside\_x]}} {\tt{[option to interpolate gap pixels]}} param are optional. Defaults are ``1'', the detector long side is on the x coordinate and start to reconstruct from module 0.
{\tt cbfMaker /scratch/run\_63\_d0\_f000000000000\_3.raw 3072 512 1 2 ``Eiger'' 0}.\\
The {\tt{[singlemodulelongside\_x]}} {\tt{[option to interpolate gap pixels]}} param are optional. Defaults are ``1'', the detector long side is on the x coordinate and to start to reconstruct from module 0.
The interpolation scheme fro the gap pixels between chips is by default ``interpolate large big pixels'', =2;
If you want to change interpolation scheme, use:\\
\begin{tabular}{|c|c|}
\hline
interpolation scheme & argument\\
\hline
insert gap pixels and assign value only to the first one & 0\\
\hline
equally divide the value of the counter bettern the two pixels & 1\\
\hline
interpolate large pixel value & 2\\
\hline
mask the value of the two gap pixels & 3\\
\hline
\end{tabular}
\ \\
\ \\
The executables:
\begin{verbatim}
bcfMaker1.5M [file_name_with_dir]
bcfMaker9M [file_name_with_dir]
cbfMaker1.5M [file_name_with_dir]
cbfMakerOMNY [file_name_with_dir]
cbfMaker9M [file_name_with_dir]
\end{verbatim}
contain the hardcoded geometry for the 1.5M (3 modules horizontal on the long side) and for the 9M at cSAXS: 6(short side)$\times$3 (long side) modules.\\
contain the hardcoded geometry for the 1.5M (3 modules horizontal on the long side), the 1.5M OMNY geometry (3 modules next to each other on the long side) and for the 9M at cSAXS: 6(short side)$\times$3 (long side) modules.\\
Missing packets in a frame and border pixels ($\times 2$ and $\times 4$ are given with value $-1$ at the present time.
It is important to know, that the pixels at the edge between 2 chips count more as double size. We can virtually introduced 1 virtual pixel per double larger pixel, so to have an even number of counts everywhere. Virtual pixels (not filled ) between module gaps are also inserted.
Make sure the following options are uncommented in the {\tt{slsImageReconstruction/src/main\_csaxs.cpp}} file.
\begin{verbatim}
#define MYCBF
##following line only if you need to process with
##BUBBLE (Material Science / uXAS beamlines).
#define MSHeader
\end{verbatim}
Compile it with:
\begin{verbatim}
make cbfMaker; make cbfMakerOMNY;
\end{verbatim}
\begin{verbatim}
GapPixelsBetweenChips_x = 2;
GapPixelsBetweenChips_y = 2;
GapPixelsBetweenModules_x = 8;
GapPixelsBetweenModules_y = 36;
\end{verbatim}
\subsubsection{hdf5}
In case of HDF5 output file, we rely on having the HDF5 1.10.1 library installed. Edit the Makefile to correclty point at it. Different compression methods are being tried so different external filters might be to be installed. This work is not finished yet.
To choose HDF5, with ZLIB implementation, open {\tt{slsImageReconstruction/src/main\_csaxs.cpp}} and make sure that
\begin{verbatim}
#define HDF5f
#define ZLIB
\end{verbatim}
are not commented out. All other options need to be commented out. Copile the code with
\begin{verbatim}
make hdf5Maker; make hdf5MakerOMNY;
\end{verbatim}
If you are at cSAXS. all images collected will be written in a single file. If you are not at CSAXS, most likely you want to have all the images written in a single raw file into an HDF5 file. The multiple HDF5 files are then linked in a master file, with many subdatasets (can be read by albula) or by a virtual file with a single dataset. If you want a mster o virtual file, uncomment this option:
\begin{verbatim}
#define MASTERVIRTUAL
\end{verbatim}
and recompile.
To use it for a single module:
\begin{verbatim}
hdf5Maker [filename with dir]
\end{verbatim}
eg.
{\tt{hdf5Maker /scratch/run\_63\_d1\_f000000000000\_3.raw}}\\
To use it any geometry:\\
{\tt{hdf5Maker [filename] [pixels x, def=1024] [pixels y, def=512] [singlemodulelongside\_x, def=1] [fillgaps, def=Interpolate Big Pixels] [hdf5datasetname, def="Eiger"] [start det,def=0]}}\\
eg.
{\tt hdf5Maker /scratch/run\_63\_d0\_f000000000000\_3.raw 3072 512 1 2 ``Eiger'' 0}.\\
\subsubsection{root}
The data will be written as TH2D in root format. Edit the {\tt{Makefile}} to point to the correct ROOT library location. Compile the executable as:
\begin{verbatim}
make image
\end{verbatim}
There is no program other executable that alredy keeps into account the geometry for it.
To use it any geometry:\\
{\tt{image [filename] [pixels x, def=1024] [pixels y, def=512] [singlemodulelongside\_x, def=1] [fillgaps, def=Interpolate Big Pixels] [hdf5datasetname, def="Eiger"] [start det,def=0]}}\\
eg.
{\tt image /scratch/run\_63\_d0\_f000000000000\_3.raw 3072 512 1 2 ``Eiger'' 0}.\\
\subsection{Read temperatures/HV from boards}
@ -851,6 +978,16 @@ ssh root@$i sync; done
\section{Loading firmware bitfiles}
\textbf{As a new procedure, the first thing to do is to kill the server on the boards, copy the new one there without starting it.} Note taht failure to do this step before may cause the linux on the baords to crash and not being able to ping it (this if the registers between the old and new firmware change).
This is teh procedure from a terminal;
\begin{verbatim}
for i in beb111 beb070;
do ssh root@$i killall eigerDetectorServer;
scp eigerDetectorServer root@$i:~/executables/eigerDetectorServer ;
ssh root@$i sync; done
\end{verbatim}
A \textbf{bcp} executable (which needs \textbf{tftp} installed on the PC, is needed.
\begin{enumerate}
\item Manual way: you need to press something on the detector. To program bitfiles (firmware files), do a hard reset with a pin/thin stuff in the holes at the very back of the module. They are between the top 7 LED and the bottom 1 and opposite for the other side. Push hard till all LEDs are alternating green and red.
@ -909,7 +1046,7 @@ for j in $(seq 0 255) ; do
sls_detector_put pulsenmove N 0 1;
done;
done;
sls_detector_p resmat 0
sls_detector_put resmat 0
sls_detector_acquire
\end{verbatim}
You read {\tt{N}} in every pixel if you are setup correctly.
@ -921,6 +1058,12 @@ To load the special noise file look at {\tt{settingsdir/eiger/standard/eigernois
\begin{verbatim}
sls_detector_put trimbits ../settingsdir/eiger/standard/eigernoise
\end{verbatim}
To exit from this pattern noise, just set the theshold to something known.
\begin{verbatim}
\item sls_detector_put threshold 50000 standard
\end{verbatim}
where 5000 would be a value in eV and {/tt{standard}} is important in this case.
\section{Troubleshooting}
\subsection{Cannot successfully finish an acquisition}
@ -1017,6 +1160,10 @@ Note that occasionally if there is a shared memory of a different size (from an
\end{verbatim}
This needs to be cleaned with {\tt{ipcs -m}} and then {\tt{ipcrm -M xxx}}, where xxx are the keys with nattch 0. Alternative in the main slsDetectorFolder there is a script that can be used as {\tt{sh cleansharedmemory.sh}}. Note that you need to run the script with the account of the client user, as the shared memory belongs to the client. It is good procedure to implement an automatic cleanup of the shared memory if the client user changes often.
\subsection{Client has shared memory iusses}
The shared memory from software version 4.0.0 creates shared memory segments in /dev/shm/. You can look at them and cancel them directly. Note that this is still user dependent.
Environment variable SLSDETNAME can be set for using 2 different detectors from the same client pc. One needs a different multi detector id if the SLSDETNAME is different for both consoles.
\subsection{Measure the HV}
For every system:
\begin{itemize}
@ -1038,6 +1185,13 @@ If you see strange lines in vertical occurring at period patterns, it is a memor
\subsection{ssh to the boards takes long}
Depending on your network setup, to speed up the ssh to the boards from a pc with internal dhcp server running: \textbf{iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE; echo "1" > /proc/sys/net/ipv4/ip\_forward}, where eth1 has to be the 1Gb network device on the pc
\subsection{Generate keys on the boards not to have to type the password}
\begin{verbatim}
export AFSDIRS64=/afs/psi.ch/intranet/Controls/Software/Trolltech/SL6-x86_64
ssh-copy-id -i /afs/psi.ch/user/t/tinti_g/.ssh/id_rsa.pub root@beb100
ssh-keygen
\end{verbatim}
\subsection{Check firmware version installed on BEB}
You can either ask in the client as described in section~\ref{api}, or login to the boards directly. Follow some steps described in Section~\ref{server}.
\begin{verbatim}
@ -1061,6 +1215,13 @@ Scroll up in the terminal till you find:\\
*************** MASTER/SLAVE ***************\\
*************** NORMAL/SPECIAL ***************\\
There is also an easier way, that is that only the master module will reaturn the real value of the HV. If you have more than 1 detector system, then you will have more than 1 physical master, as the HV needs to be applied to all the systems.
\begin{verbatim}
for i in $(seq 0 36); do sls_detector_put $i:vhighvoltage; done
\end{verbatim}
Only the master will return to you a sensible number (150 normally). the others will return -999.
\subsection{'Cannot connect to socket'}
This error is typically due to the detector server not running. For why, see section~\ref{servernot}.
@ -1078,15 +1239,14 @@ If you see the client returning the following error message:\\
\end{verbatim}
\subsection{There is noise running the detector in 32-bit}
Short story (for now): You are running in {\tt{parallel}} mode, switch {\tt{flags}} to non {\tt{nonparallel}} mode.
Long story: If you are running the detector in 32-bit (autosumming), there might be some noise, particularly at lower thereshold energies. This is due to the fact that the analog part of the chips require some latency time to settle which is larger than the redout time. At the present moment it is possible to run the detector only in {\tt{parallel}} or {\tt{nonparallel}} mode, respectively with readout times between frames of 12~$\mu$s and 504~$\mu$s. If you switch {\tt{flags}} to non {\tt{nonparallel}} mode you will giveenough time for teh signals to settle. For future realeas we are planning to introduce some configurable delay, such that you can remain with the {\tt{parallel}} flag, but can obtain a configurable dead time between frames in the range 12$-$504~$\mu$s.
If you are running the detector in 32-bit (autosumming), there might be some noise, particularly at lower thereshold energies. This is due to the fact that the analog part of the chips require some latency time to settle which is larger than the readout time. It is possible to run the detector only in {\tt{parallel}} or {\tt{nonparallel}} mode, respectively with readout times between frames of 12~$\mu$s and 504~$\mu$s. If you switch {\tt{flags}} to non {\tt{nonparallel}} mode you will give enough time for the signals to settle. From release 4.0.0, there is a configurable delay that can be set through the {\tt{subdeadtime}} variable, such that you can remain with the {\tt{parallel}} flag, but can obtain a configurable dead time between frames. Ask the SLS detector group for an appropriate dead time for your detector, but typically a dead time of 20-50~$\mu$s should be enough. Note that this {\tt{subdeadtime}} need to include the 12~$\mu$s minimum readout time, so it has to be larger than 12~$\mu$s to do anything.
\subsection{There is noise running the detector at high frame rate(4,8,16 bit)}
If are running in {\tt{parallel}} mode, in particular at low thereshold energies, you might encounter some noise. The reason is that the analog part of the chips require some latency time to settle which is larger than the redout time.
If are running in {\tt{parallel}} mode, in particular at low thereshold energies, you might encounter some noise. The reason is that the analog part of the chips require some latency time to settle which is larger than the readout time.
\begin{enumerate}
\item You can lower the frame rate and relax requirements on period:
At low frame rate, you normally leave enough time between the end of the acquisition and the starting of the next, so you should not see this effect. In any case setting a {\tt{period}}={\tt{exptime}}+readout time from Table~\ref{tchipro} +extra 20$\mu$s cures the problem. The 20$\mu$s could also be 10~$\mu$s, they are very hardware dependent.
\item The frame rate requirement are stingent (as for time resolved measurements): the only option here is to reduce the {\tt{exptime}} to let the extra 20~$\mu$s (or 10)~$\mu$s. The {\tt{period}} remains the same.
\item The frame rate requirement are stringent (as for time resolved measurements): the only option here is to reduce the {\tt{exptime}} to let the extra 20~$\mu$s (or 10)~$\mu$s. The {\tt{period}} remains the same.
\end{enumerate}
\section{Client checks - command line}
@ -1289,7 +1449,7 @@ In table~\ref{tframescomplete} is a list of all the readout times in the differe
\end{table}
\end{tiny}
Table~\ref{tx} shows the bandwidth of data trasnferring between the FEB and BEB and of the DDR2 memory access. the GTX lanes are only capable of 25.6~Gbit/s. This limits the 12/16 bit frame rate. The 2$\times$DDR2 memories have a bandwidth or 2$\cdot$25.6~Gb/s=51.2~Gb/s. Due to this memory access bandwidth, the 32 bit autosumming mode can only run in {\tt{clkdivider}} 2.
Table~\ref{tx} shows the bandwidth of data transferring between the FEB and BEB and of the DDR2 memory access. the GTX lanes are only capable of 25.6~Gbit/s. This limits the 12/16 bit frame rate. The 2$\times$DDR2 memories have a bandwidth or 2$\cdot$25.6~Gb/s=51.2~Gb/s. Due to this memory access bandwidth, the 32 bit autosumming mode can only run in {\tt{clkdivider}} 2.
\begin{figure}[t]
\begin{center}
\includegraphics[width=1.\textwidth]{TansmissionRates}

View File

@ -369,7 +369,7 @@ source directory.
$ cd ..
$ mkdir slsDetectorPackage-build
$ cd slsDetectorPackage-build
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=OFF
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=OFF
$ make
\end{verbatim}
@ -377,7 +377,7 @@ Use the following as an example to compile statically and using specific hdf5
folder
\begin{verbatim}
$ HDF5_ROOT=/opt/hdf5v1.10.0 cmake ../slsDetectorPackage
-DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=ON
-DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=ON
\end{verbatim}
After compiling, the libraries and executables will be found at `bin` directory

15
recipe/build.sh Normal file
View File

@ -0,0 +1,15 @@
mkdir build
mkdir install
cd build
cmake .. \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
-DCMAKE_INSTALL_PREFIX=install \
-DSLS_USE_TEXTCLIENT=ON \
-DSLS_USE_RECEIVER=ON \
-DSLS_USE_GUI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DSLS_USE_HDF5=OFF\
cmake --build . -- -j10
cmake --build . --target install

15
recipe/copy_gui.sh Normal file
View File

@ -0,0 +1,15 @@
mkdir $PREFIX/lib
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/.

23
recipe/copy_lib.sh Normal file
View File

@ -0,0 +1,23 @@
mkdir $PREFIX/lib
mkdir $PREFIX/bin
mkdir $PREFIX/include
mkdir $PREFIX/include/slsDetectorPackage
#Shared and static libraries
cp build/bin/libSlsDetector.so $PREFIX/lib/.
# cp build/bin/libSlsDetector.a $PREFIX/lib/.
cp build/bin/libSlsReceiver.so $PREFIX/lib/.
# cp build/bin/libSlsReceiver.a $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/.
#Which headers do we need for development??
cp build/install/include/* $PREFIX/include/slsDetectorPackage/
# cp include/some_lib.h $PREFIX/include/.

89
recipe/meta.yaml Normal file
View File

@ -0,0 +1,89 @@
package:
name: sls_detector_software
version: 4.0.1
source:
- path: ..
build:
number: 1
rpaths:
- lib/
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]
host:
- libstdcxx-ng
- libgcc-ng
- libpng >=1.6.32,<1.6.35
- xorg-libx11
- xorg-libice
- xorg-libxext
- xorg-libsm
- xorg-libxau
- xorg-libxrender
- xorg-libxfixes
run:
- libstdcxx-ng
- libgcc-ng
outputs:
- name: sls_detector_lib
version: 4.0.1
script: copy_lib.sh
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- name: sls_detector_gui
version: 4.0.1
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=4.0.1
- qwt 6.*
- qt=4.8.7=7

View File

@ -1 +0,0 @@
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv4.0.0.22.0

View File

@ -0,0 +1 @@
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv4.0.1.22.1

View File

@ -1 +0,0 @@
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv4.0.0.3

View File

@ -0,0 +1 @@
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv4.0.1.4

View File

@ -1 +0,0 @@
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv4.0.0.0

View File

@ -0,0 +1 @@
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv4.0.1.0

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorGui
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: d2bce7e372c241cd235977b92be18555bca6a77d
Revision: 521
Branch: 4.0.0
Repsitory UUID: 3c774478681813e451df683e2bc8403b37490323
Revision: 524
Branch: 4.0.1
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4020
Last Changed Date: 2018-09-27 16:09:16.000000002 +0200 ./src/qTabSettings.cpp
Last Changed Rev: 4084
Last Changed Date: 2019-02-07 18:05:28.000000002 +0100 ./src/qTabSettings.cpp

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "d2bce7e372c241cd235977b92be18555bca6a77d"
#define GITREPUUID "3c774478681813e451df683e2bc8403b37490323"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4020
#define GITDATE 0x20180927
#define GITBRANCH "4.0.0"
#define GITREV 0x4084
#define GITDATE 0x20190207
#define GITBRANCH "4.0.1"

View File

@ -23,33 +23,24 @@ set(HEADERS
)
include_directories(
commonFiles
multiSlsDetector
sharedMemory
slsDetector
slsDetectorUtils
slsDetectorCommand
slsDetectorAnalysis
slsReceiverInterface
threadFiles
usersFunctions
../slsReceiverSoftware/include
../slsReceiverSoftware/MySocketTCP
commonFiles
multiSlsDetector
sharedMemory
slsDetector
slsDetectorUtils
slsDetectorCommand
slsDetectorAnalysis
slsReceiverInterface
threadFiles
usersFunctions
../slsReceiverSoftware/include
../slsReceiverSoftware/MySocketTCP
)
add_definitions(
-DDACS_INT
)
add_library(slsDetectorStatic STATIC
${SOURCES}
${HEADERS}
)
set_target_properties(slsDetectorStatic PROPERTIES
ARCHIVE_OUTPUT_NAME SlsDetector
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
add_library(slsDetectorShared SHARED
${SOURCES}
${HEADERS}
@ -78,6 +69,8 @@ set(PUBLICHEADERS
multiSlsDetector/multiSlsDetector.h
slsReceiverInterface/receiverInterface.h
../slsReceiverSoftware/include/sls_receiver_exceptions.h
slsDetector/slsDetectorUsers.h
../slsReceiverSoftware/include/slsReceiverUsers.h
)
set_target_properties(slsDetectorShared PROPERTIES
LIBRARY_OUTPUT_NAME SlsDetector
@ -98,7 +91,8 @@ if(DOXYGEN_FOUND)
)
endif()
install(TARGETS slsDetectorShared slsDetectorStatic
install(TARGETS slsDetectorShared
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include
ARCHIVE DESTINATION lib)

View File

@ -1,5 +1,5 @@
/** API versions */
#define APIRECEIVER 0x180823
#define APIEIGER 0x180820
#define APIJUNGFRAU 0x180823
#define APIGOTTHARD 0x180927
#define APIEIGER 0x181130
#define APIJUNGFRAU 0x190107
#define APIGOTTHARD 0x190201

View File

@ -1966,7 +1966,7 @@ int64_t Feb_Control_GetMeasuredPeriod() {
unsigned int value = 0;
Feb_Interface_ReadRegister(sub_num,MEAS_PERIOD_REG, &value);
return value*10;
return (int64_t)value*10;
}
int64_t Feb_Control_GetSubMeasuredPeriod() {
@ -1976,7 +1976,7 @@ int64_t Feb_Control_GetSubMeasuredPeriod() {
unsigned int value = 0;
Feb_Interface_ReadRegister(sub_num,MEAS_SUBPERIOD_REG, &value);
return value*10;
return (int64_t)value*10;
}
@ -2014,14 +2014,24 @@ uint32_t Feb_Control_WriteRegister(uint32_t offset, uint32_t data) {
uint32_t value=0;
if(Module_TopAddressIsValid(&modules[1])){
if(!Feb_Interface_WriteRegister(Module_GetTopRightAddress (&modules[1]),offset, data,0, 0)) {
cprintf(RED,"Could not read value. Value read:%d\n", value);
cprintf(RED,"Could not read tr value. Value read:%d\n", value);
value = 0;
}
if(!Feb_Interface_WriteRegister(Module_GetTopLeftAddress (&modules[1]),offset, data,0, 0)) {
cprintf(RED,"Could not read tl value. Value read:%d\n", value);
value = 0;
}
} else {
if(!Feb_Interface_WriteRegister(Module_GetBottomRightAddress (&modules[1]),offset, data,0, 0)) {
cprintf(RED,"Could not read value. Value read:%d\n", value);
cprintf(RED,"Could not read br value. Value read:%d\n", value);
value = 0;
}
if(!Feb_Interface_WriteRegister(Module_GetBottomLeftAddress (&modules[1]),offset, data,0, 0)) {
cprintf(RED,"Could not read bl value. Value read:%d\n", value);
value = 0;
}
}
return Feb_Control_ReadRegister(offset);
}
@ -2029,16 +2039,34 @@ uint32_t Feb_Control_WriteRegister(uint32_t offset, uint32_t data) {
uint32_t Feb_Control_ReadRegister(uint32_t offset) {
uint32_t value=0;
uint32_t value1=0;
if(Module_TopAddressIsValid(&modules[1])){
if(!Feb_Interface_ReadRegister(Module_GetTopRightAddress (&modules[1]),offset, &value)) {
cprintf(RED,"Could not read value. Value read:%d\n", value);
value = 0;
}
if(!Feb_Interface_ReadRegister(Module_GetTopRightAddress (&modules[1]),offset, &value)) {
cprintf(RED,"Could not read value. Value read:%d\n", value);
value = 0;
}
printf("Read top right addr: 0x%08x\n", value);
if(!Feb_Interface_ReadRegister(Module_GetTopLeftAddress (&modules[1]),offset, &value1)) {
cprintf(RED,"Could not read value. Value read:%d\n", value1);
value1 = 0;
}
printf("Read top left addr: 0x%08x\n", value1);
if (value != value1)
value = -1;
} else {
if(!Feb_Interface_ReadRegister(Module_GetBottomRightAddress (&modules[1]),offset, &value)) {
cprintf(RED,"Could not read value. Value read:%d\n", value);
value = 0;
}
if(!Feb_Interface_ReadRegister(Module_GetBottomRightAddress (&modules[1]),offset, &value)) {
cprintf(RED,"Could not read value. Value read:%d\n", value);
value = 0;
}
printf("Read bottom right addr: 0x%08x\n", value);
if(!Feb_Interface_ReadRegister(Module_GetBottomLeftAddress (&modules[1]),offset, &value1)) {
cprintf(RED,"Could not read value. Value read:%d\n", value1);
value1 = 0;
}
printf("Read bottom left addr: 0x%08x\n", value1);
if (value != value1)
value = -1;
}
return value;
}

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: 63c130a3806b47332b1532ab00f9f344c5839e0e
Revision: 348
Branch: 4.0.0-rc
Repsitory UUID: ef3e01b9bdf3a6a08367e2448bcc92bd13cf73ad
Revision: 351
Branch: 4.0.1-rc
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3986
Last Changed Date: 2018-08-20 11:38:13.000000002 +0200 ./Makefile.virtual
Last Changed Rev: 4068
Last Changed Date: 2019-02-06 14:44:47.000000002 +0100 ./xparameters.h

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "63c130a3806b47332b1532ab00f9f344c5839e0e"
#define GITREPUUID "ef3e01b9bdf3a6a08367e2448bcc92bd13cf73ad"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3986
#define GITDATE 0x20180820
#define GITBRANCH "4.0.0-rc"
#define GITREV 0x4068
#define GITDATE 0x20190206
#define GITBRANCH "4.0.1-rc"

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: d2bce7e372c241cd235977b92be18555bca6a77d
Revision: 2040
Branch: 4.0.0
Repsitory UUID: 3c774478681813e451df683e2bc8403b37490323
Revision: 2071
Branch: 4.0.1
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4020
Last Changed Date: 2018-09-27 18:22:10.000000002 +0200 ./sharedMemory/SharedMemory.o
Last Changed Rev: 4084
Last Changed Date: 2019-02-08 17:25:57.000000002 +0100 ./threadFiles/ThreadPool.o

View File

@ -887,7 +887,7 @@ int64_t get64BitReg(int aLSB, int aMSB){
return v64;
}
int64_t setFrames(int64_t value){
int64_t setFrames(int64_t value){printf("setting frames to %lld\n", (long long int)value);
return set64BitReg(value, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
}
@ -895,7 +895,7 @@ int64_t getFrames(){
return get64BitReg(GET_FRAMES_LSB_REG, GET_FRAMES_MSB_REG);
}
int64_t setExposureTime(int64_t value){
int64_t setExposureTime(int64_t value){printf("setting exptime to %lld ns\n", (long long int)value);
/* time is in ns */
if (value!=-1) {
value = (value * 1E-3 * CLK_FREQ ) + 0.5;
@ -909,7 +909,7 @@ int64_t getExposureTime(){
(1E-3 * CLK_FREQ)) + 0.5;
}
int64_t setGates(int64_t value){
int64_t setGates(int64_t value){printf("setting gates to %lld\n", (long long int)value);
return set64BitReg(value, SET_GATES_LSB_REG, SET_GATES_MSB_REG);
}
@ -917,7 +917,7 @@ int64_t getGates(){
return get64BitReg(GET_GATES_LSB_REG, GET_GATES_MSB_REG);
}
int64_t setPeriod(int64_t value){
int64_t setPeriod(int64_t value){printf("setting period to %lld ns\n", (long long int)value);
/* time is in ns */
if (value!=-1) {
value = (value * 1E-3 * CLK_FREQ ) + 0.5;
@ -931,7 +931,7 @@ int64_t getPeriod(){
(1E-3 * CLK_FREQ)) + 0.5;
}
int64_t setDelay(int64_t value){
int64_t setDelay(int64_t value){printf("setting delay to %lld ns\n", (long long int)value);
/* time is in ns */
if (value!=-1) {
if (masterflags == IS_MASTER) {
@ -955,7 +955,7 @@ int64_t getDelay(){
(1E-3 * CLK_FREQ)) + 0.5;
}
int64_t setTrains(int64_t value){
int64_t setTrains(int64_t value){printf("setting cycles to %lld\n", (long long int)value);
return set64BitReg(value, SET_TRAINS_LSB_REG, SET_TRAINS_MSB_REG);
}
@ -1438,6 +1438,56 @@ int configureMAC(int ipad,long long int macad,long long int detectormacad, int d
usleep(1000 * 1000);
/** send out first image as first packet does not give 0xcacacaca (needed to know if first image
* when switching back and forth between roi and no roi
*/
// remember old parameters
int oldtiming = setTiming(-1);
uint64_t oldframes = setFrames(-1);
uint64_t oldcycles = setTrains(-1);
uint64_t oldPeriod = setPeriod(-1);
uint64_t oldExptime = setExposureTime(-1);
// set to basic parameters
cprintf(BLUE,"Setting basic parameters\n"
"\tTiming: auto, frames: 1, cycles: 1, period: 1s, exptime: 900ms\n");
setTiming(AUTO_TIMING);
setFrames(1);
setTrains(1);
setPeriod(1e9); // important to keep this until we have to wait for acquisition to start
setExposureTime(900 * 1000);
// take an image
if (masterflags == IS_MASTER)
usleep(1 * 1000 * 1000); // required to ensure master starts acquisition only after slave has changed to basic parameters and is waiting
int loop = 0;
startStateMachine();
// wait for acquisition to start (trigger from master)
printf(" Waiting for acquisition to start\n");
while(!runBusy()) {
usleep(0);
++loop;
}
cprintf(MAGENTA, "waited %d loops to start\n", loop);
cprintf(BLUE, " Waiting for acquisition to end (frames left: %lld)\n", (long long int)getFrames());
waitForAcquisitionFinish();
// set to previous parameters
cprintf(BLUE,"Setting previous parameters:\n"
"\tTiming: %d, "
"frames: %lld, "
"cycles: %lld, "
"period: %lld ns, "
"exptime:%lld ns\n",
oldtiming, oldframes, oldcycles, oldPeriod, oldExptime);
setTiming(oldtiming);
setFrames(oldframes);
setTrains(oldcycles);
setPeriod(oldPeriod);
setExposureTime(oldExptime);
return adcConfigured;
}
@ -1448,6 +1498,7 @@ int getAdcConfigured(){
u_int32_t runBusy(void) {
u_int32_t s = bus_r(STATUS_REG) & RUN_BUSY_BIT;
//printf("runBusy: 0x%08x\n", s);
return s;
}
@ -1478,7 +1529,8 @@ u_int32_t runState(void) {
int startStateMachine(){
//#ifdef VERBOSE
printf("*******Starting State Machine*******\n");
cprintf(GREEN,"*******Starting State Machine*******\n");
cprintf(GREEN,"Number of frames to acquire:%lld\n", (long long int)setFrames(-1));
//#endif
cleanFifo();
// fifoReset();
@ -1559,28 +1611,29 @@ u_int32_t fifo_full(void)
void waitForAcquisitionFinish(){
volatile u_int32_t t = bus_r(LOOK_AT_ME_REG);
volatile u_int32_t t = bus_r(LOOK_AT_ME_REG);
#ifdef VERBOSE
printf("lookatmereg=x%x\n",t);
printf("lookatmereg=x%x\n",t);
#endif
while((t&0x1)==0) {
if (runBusy()==0) {
t = bus_r(LOOK_AT_ME_REG);
if ((t&0x1)==0) {
while((t&0x1)==0) {
if (runBusy() == 0) {
t = bus_r(LOOK_AT_ME_REG);
if ((t&0x1)==0) {
#ifdef VERBOSE
printf("no frame found - exiting ");
printf("%08x %08x\n", runState(), bus_r(LOOK_AT_ME_REG));
printf("no frame found - exiting ");
printf("%08x %08x\n", runState(), bus_r(LOOK_AT_ME_REG));
#endif
return;
} else {
return;
} else {
#ifdef VERBOSE
printf("no frame found %x status %x\n", bus_r(LOOK_AT_ME_REG),runState());
printf("no frame found %x status %x\n", bus_r(LOOK_AT_ME_REG),runState());
#endif
break;
}
}
t = bus_r(LOOK_AT_ME_REG);
}
break;
}
}
t = bus_r(LOOK_AT_ME_REG);
}
}

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/gotthardDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: c2db073d5e936d64733ba9bdfdce311a556ae212
Revision: 241
Branch: 4.0.0
Repsitory UUID: 2f11681d3f2bd2e437cd23fa28dc618dbbd39c68
Revision: 247
Branch: 4.0.1-rc
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4018
Last Changed Date: 2018-09-27 16:32:41.000000002 +0200 ./firmware_funcs.c
Last Changed Rev: 4057
Last Changed Date: 2019-02-01 11:47:52.000000002 +0100 ./firmware_funcs.c

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "c2db073d5e936d64733ba9bdfdce311a556ae212"
#define GITREPUUID "2f11681d3f2bd2e437cd23fa28dc618dbbd39c68"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4018
#define GITDATE 0x20180927
#define GITBRANCH "4.0.0"
#define GITREV 0x4057
#define GITDATE 0x20190201
#define GITBRANCH "4.0.1-rc"

View File

@ -42,7 +42,7 @@
#define TOKEN_RESTART_DELAY 0x88000000
#define TOKEN_RESTART_DELAY_ROI 0x1b000000
#define TOKEN_TIMING_REV1 0x1f16
#define TOKEN_TIMING_REV2 0x1f0f
#define TOKEN_TIMING_REV2 0x1f10
#define DEFAULT_PHASE_SHIFT 120
#define DEFAULT_IP_PACKETSIZE 0x0522

View File

@ -1829,7 +1829,7 @@ int get_run_status(int file_des) {
#endif
retval= runState();
printf("\n\nSTATUS=%08x\n",retval);
printf("STATUS=%08x\n",retval);
//stopped (external stop, also maybe fifo full)
@ -2046,9 +2046,9 @@ int set_timer(int file_des) {
printf(mess);
}
//#ifdef VERBOSE
#ifdef VERBOSE
printf("setting timer %d to %lld ns\n",ind,tns);
//#endif
#endif
if (ret==OK) {
if (differentClients==1 && lockStatus==1 && tns!=-1) {
@ -2593,7 +2593,7 @@ int configure_mac(int file_des) {
sscanf(arg[3], "%llx", &idetectormacadd);
sscanf(arg[4], "%x", &detipad);
//arg[5] is udpport2 for eiger
#ifdef VERBOSE
//#ifdef VERBOSE
int i;
printf("\ndigital_test_bit in server %d\t",digitalTestBit);
printf("\nipadd %x\t",ipad);
@ -2606,8 +2606,9 @@ int configure_mac(int file_des) {
for (i=0;i<6;i++)
printf("detector mac adress %d is 0x%x \n",6-i,(unsigned int)(((idetectormacadd>>(8*i))&0xFF)));
printf("detipad %x\n",detipad);
printf("destination ip is %d.%d.%d.%d = 0x%x \n",(detipad>>24)&0xff,(detipad>>16)&0xff,(detipad>>8)&0xff,(detipad)&0xff,detipad);
printf("\n");
#endif
//#endif

View File

@ -11,11 +11,11 @@
#define DETECTOR_TYPE_OFST (24)
#define DETECTOR_TYPE_MSK (0x000000FF << DETECTOR_TYPE_OFST)
/* Fix pattern register */
#define FIX_PATT_REG (0x01 << MEM_MAP_SHIFT)
#define FIX_PATT_VAL (0xACDC2014)
/* Status register */
#define STATUS_REG (0x02 << MEM_MAP_SHIFT)
@ -32,7 +32,6 @@
#define RUNMACHINE_BUSY_OFST (17)
#define RUNMACHINE_BUSY_MSK (0x00000001 << RUNMACHINE_BUSY_OFST)
/* Look at me register */
#define LOOK_AT_ME_REG (0x03 << MEM_MAP_SHIFT) //Not used in firmware or software
@ -86,20 +85,19 @@
#define GET_FRAMES_LSB_REG (0x16 << MEM_MAP_SHIFT)
#define GET_FRAMES_MSB_REG (0x17 << MEM_MAP_SHIFT)
/* Get Period 64 bit register */
/* Get Period 64 bit register tT = T x 50 ns */
#define GET_PERIOD_LSB_REG (0x18 << MEM_MAP_SHIFT)
#define GET_PERIOD_MSB_REG (0x19 << MEM_MAP_SHIFT)
/** Get Temperature Carlos, incorrectl as get gates */
#define GET_TEMPERATURE_TMP112_REG (0x1c << MEM_MAP_SHIFT) // (after multiplying by 625) in 10ths of millidegrees of TMP112
#define TEMPERATURE_POLARITY_BIT (15)
#define TEMPERATURE_POLARITY_MSK (0x00000001 << TEMPERATURE_POLARITY_BIT)
#define TEMPERATURE_VALUE_BIT (0)
#define TEMPERATURE_VALUE_MSK (0x00007FFF << TEMPERATURE_VALUE_BIT)
#define TEMPERATURE_VALUE_MSK (0x000007FF << TEMPERATURE_VALUE_BIT)
#define TEMPERATURE_POLARITY_BIT (11)
#define TEMPERATURE_POLARITY_MSK (0x00000001 << TEMPERATURE_POLARITY_BIT)
/* Get Frames from Start 64 bit register (frames from start Run Control) */
/* Get Frames from Start 64 bit register (frames from last reset using CONTROL_CRST) */
#define FRAMES_FROM_START_PG_LSB_REG (0x24 << MEM_MAP_SHIFT)
#define FRAMES_FROM_START_PG_MSB_REG (0x25 << MEM_MAP_SHIFT)
@ -140,6 +138,15 @@
/* ADC Port Invert Register */
#define ADC_PORT_INVERT_REG (0x43 << MEM_MAP_SHIFT)
#define ADC_PORT_INVERT_ADC_0_OFST (0)
#define ADC_PORT_INVERT_ADC_0_MSK (0x000000FF << ADC_PORT_INVERT_ADC_0_OFST)
#define ADC_PORT_INVERT_ADC_1_OFST (8)
#define ADC_PORT_INVERT_ADC_1_MSK (0x000000FF << ADC_PORT_INVERT_ADC_1_OFST)
#define ADC_PORT_INVERT_ADC_2_OFST (16)
#define ADC_PORT_INVERT_ADC_2_MSK (0x000000FF << ADC_PORT_INVERT_ADC_2_OFST)
#define ADC_PORT_INVERT_ADC_3_OFST (24)
#define ADC_PORT_INVERT_ADC_3_MSK (0x000000FF << ADC_PORT_INVERT_ADC_3_OFST)
/* Receiver IP Address Register */
#define RX_IP_REG (0x45 << MEM_MAP_SHIFT)
@ -181,10 +188,12 @@
/* Configuration Register */
#define CONFIG_REG (0x4D << MEM_MAP_SHIFT)
#define CONFIG_OPERATION_MODE_OFST (16)
#define CONFIG_OPERATION_MODE_MSK (0x00000001 << CONFIG_OPERATION_MODE_OFST)
#define CONFIG_MODE_1_X_10GBE_VAL ((0x0 << CONFIG_OPERATION_MODE_OFST) & CONFIG_OPERATION_MODE_MSK)
#define CONFIG_MODE_2_X_10GBE_VAL ((0x1 << CONFIG_OPERATION_MODE_OFST) & CONFIG_OPERATION_MODE_MSK)
// readout timer (from chip) to stabilize (esp in burst acquisition mode) tRDT = (RDT + 1) * 25ns
#define CONFIG_RDT_TMR_OFST (0)
#define CONFIG_RDT_TMR_MSK (0x0000FFFF << CONFIG_RDT_TMR_OFST)
#define CONFIG_OPRTN_MDE_2_X_10GbE_OFST (16)
#define CONFIG_OPRTN_MDE_2_X_10GbE_MSK (0x00000001 << CONFIG_OPRTN_MDE_2_X_10GbE_OFST)
#define CONFIG_OPRTN_MDE_1_X_10GBE_VAL ((0x0 << CONFIG_OPRTN_MDE_2_X_10GbE_OFST) & CONFIG_OPRTN_MDE_2_X_10GbE_MSK)
#define CONFIG_READOUT_SPEED_OFST (20)
#define CONFIG_READOUT_SPEED_MSK (0x00000003 << CONFIG_READOUT_SPEED_OFST)
#define CONFIG_QUARTER_SPEED_10MHZ_VAL ((0x0 << CONFIG_READOUT_SPEED_OFST) & CONFIG_READOUT_SPEED_MSK)
@ -192,17 +201,17 @@
#define CONFIG_FULL_SPEED_40MHZ_VAL ((0x2 << CONFIG_READOUT_SPEED_OFST) & CONFIG_READOUT_SPEED_MSK)
#define CONFIG_TDMA_OFST (24)
#define CONFIG_TDMA_MSK (0x00000001 << CONFIG_TDMA_OFST)
#define CONFIG_TDMA_DISABLE_VAL ((0x0 << CONFIG_TDMA_OFST) & CONFIG_TDMA_MSK)
#define CONFIG_TDMA_ENABLE_VAL ((0x1 << CONFIG_TDMA_OFST) & CONFIG_TDMA_MSK)
#define CONFIG_TDMA_TIMESLOT_OFST (25)
#define CONFIG_TDMA_DISABLE_VAL ((0x0 << CONFIG_TDMA_OFST) & CONFIG_TDMA_MSK)
#define CONFIG_TDMA_TIMESLOT_OFST (25) // 1ms
#define CONFIG_TDMA_TIMESLOT_MSK (0x0000001F << CONFIG_TDMA_TIMESLOT_OFST)
#define CONFIG_ETHRNT_FLW_CNTRL_OFST (31)
#define CONFIG_ETHRNT_FLW_CNTRL_MSK (0x00000001 << CONFIG_ETHRNT_FLW_CNTRL_OFST)
/* External Signal Register */
#define EXT_SIGNAL_REG (0x4E << MEM_MAP_SHIFT)
#define EXT_SIGNAL_OFST (0)
#define EXT_SIGNAL_MSK (0x00000003 << EXT_SIGNAL_OFST) //enabled when both bits high
#define EXT_SIGNAL_MSK (0x00000001 << EXT_SIGNAL_OFST)
/* Control Register */
#define CONTROL_REG (0x4F << MEM_MAP_SHIFT)
@ -250,7 +259,7 @@
#define SAMPLE_ADC_SAMPLE_5_VAL ((0x5 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
#define SAMPLE_ADC_SAMPLE_6_VAL ((0x6 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
#define SAMPLE_ADC_SAMPLE_7_VAL ((0x7 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
// Decimation = ADF + 1
#define SAMPLE_ADC_DECMT_FACTOR_OFST (4)
#define SAMPLE_ADC_DECMT_FACTOR_MSK (0x00000007 << SAMPLE_ADC_DECMT_FACTOR_OFST)
#define SAMPLE_ADC_DECMT_FACTOR_0_VAL ((0x0 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
@ -283,6 +292,7 @@
#define SAMPLE_DGTL_DECMT_FACTOR_OFST (12)
#define SAMPLE_DGTL_DECMT_FACTOR_MSK (0x00000003 << SAMPLE_DGTL_DECMT_FACTOR_OFST)
// 1 = full speed, 2 = half speed, 4 = quarter speed
#define SAMPLE_DECMT_FACTOR_1_VAL ((0x0 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
#define SAMPLE_DECMT_FACTOR_2_VAL ((0x1 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
#define SAMPLE_DECMT_FACTOR_4_VAL ((0x2 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
@ -293,7 +303,7 @@
#define VREF_COMP_MOD_OFST (0)
#define VREF_COMP_MOD_MSK (0x00000FFF << VREF_COMP_MOD_OFST)
#define VREF_COMP_MOD_ENABLE_OFST (31)
#define VREF_COMP_MOD_ENABLE_MSK (0x00000FFF << VREF_COMP_MOD_ENABLE_OFST)
#define VREF_COMP_MOD_ENABLE_MSK (0x00000001 << VREF_COMP_MOD_ENABLE_OFST)
/** DAQ Register */
@ -343,10 +353,9 @@
#define TEMP_CTRL_PROTCT_THRSHLD_MSK (0x000007FF << TEMP_CTRL_PROTCT_THRSHLD_OFST)
#define TEMP_CTRL_PROTCT_ENABLE_OFST (16)
#define TEMP_CTRL_PROTCT_ENABLE_MSK (0x00000001 << TEMP_CTRL_PROTCT_ENABLE_OFST)
// set when temp higher than over threshold, write 1 to clear it
#define TEMP_CTRL_OVR_TMP_EVNT_OFST (31)
#define TEMP_CTRL_OVR_TMP_EVNT_MSK (0x00000001 << TEMP_CTRL_OVR_TMP_EVNT_OFST)
#define TEMP_CTRL_CLR_OVR_TMP_EVNT_VAL ((0x1 << TEMP_CTRL_OVR_TMP_EVNT_OFST) & TEMP_CTRL_OVR_TMP_EVNT_MSK)
/* Set Delay 64 bit register */
#define SET_DELAY_LSB_REG (0x60 << MEM_MAP_SHIFT) // different kind of delay
@ -360,11 +369,11 @@
#define SET_FRAMES_LSB_REG (0x64 << MEM_MAP_SHIFT)
#define SET_FRAMES_MSB_REG (0x65 << MEM_MAP_SHIFT)
/* Set Period 64 bit register */
/* Set Period 64 bit register tT = T x 50 ns */
#define SET_PERIOD_LSB_REG (0x66 << MEM_MAP_SHIFT)
#define SET_PERIOD_MSB_REG (0x67 << MEM_MAP_SHIFT)
/* Set Period 64 bit register */
/* Set Exposure Time 64 bit register eEXP = Exp x 25 ns */
#define SET_EXPTIME_LSB_REG (0x68 << MEM_MAP_SHIFT)
#define SET_EXPTIME_MSB_REG (0x69 << MEM_MAP_SHIFT)
@ -388,13 +397,17 @@
/* ASIC Control Register */
#define ASIC_CTRL_REG (0x7F << MEM_MAP_SHIFT)
// tPC = (PCT + 1) * 25ns
#define ASIC_CTRL_PRCHRG_TMR_OFST (0)
#define ASIC_CTRL_PRCHRG_TMR_MSK (0x000000FF << ASIC_CTRL_PRCHRG_TMR_OFST)
#define ASIC_CTRL_PRCHRG_TMR_VAL ((0x1F << ASIC_CTRL_PRCHRG_TMR_OFST) & ASIC_CTRL_PRCHRG_TMR_MSK)
// tDS = (DST + 1) * 25ns
#define ASIC_CTRL_DS_TMR_OFST (8)
#define ASIC_CTRL_DS_TMR_MSK (0x000000FF << ASIC_CTRL_DS_TMR_OFST)
#define ASIC_CTRL_DS_TMR_VAL ((0x1F << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK)
// tET = (ET + 1) * 25ns (increase timeout range between 2 consecutive storage cells)
#define ASIC_CTRL_EXPSRE_TMR_OFST (16)
#define ASIC_CTRL_EXPSRE_TMR_MSK (0x0000FFFF << ASIC_CTRL_EXPSRE_TMR_OFST)
#endif //REGISTERS_G_H

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/jungfrauDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: b163180d6f2505ff8a84f10e586cc2e0bbdaac86
Revision: 163
Branch: 4.0.0
Repsitory UUID: f747c908dc4ece72acd29e5b677049b44e5b7da4
Revision: 167
Branch: 4.0.1-rc
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4009
Last Changed Date: 2018-09-25 12:19:12.000000002 +0200 ./RegisterDefs.h
Last Changed Rev: 4049
Last Changed Date: 2019-01-07 11:38:36.000000002 +0100 ./RegisterDefs.h

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "b163180d6f2505ff8a84f10e586cc2e0bbdaac86"
#define GITREPUUID "f747c908dc4ece72acd29e5b677049b44e5b7da4"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4009
#define GITDATE 0x20180925
#define GITBRANCH "4.0.0"
#define GITREV 0x4049
#define GITDATE 0x20190107
#define GITBRANCH "4.0.1-rc"

View File

@ -1588,6 +1588,7 @@ enum runStatus getRunStatus(){
//not running
else {
// stopped or error
if ((retval & STOPPED_MSK) >> STOPPED_OFST) {
printf("-----------------------------------STOPPED--------------------------\n");
s=STOPPED;

View File

@ -10,7 +10,7 @@
#define GOODBYE (-200)
#define PROGRAMMING_MODE (-200)
#define MIN_REQRD_VRSN_T_RD_API 0x171220
#define REQRD_FRMWR_VRSN 0x180615
#define REQRD_FRMWR_VRSN 0x181206 // temp bug fix from last version, timing mode is backwards compatible
/* Struct Definitions */
@ -76,8 +76,6 @@ enum NETWORKINDEX { TXN_FRAME };
#define DEFAULT_STRG_CLL_STRT (0xf)
/* Defines in the Firmware */
#define FIX_PATT_VAL (0xACDC2014)
#define ADC_PORT_INVERT_VAL (0x453b2a9c)
#define MAX_TIMESLOT_VAL (0x1F)
#define MAX_THRESHOLD_TEMP_VAL (127999) //millidegrees
#define MAX_STORAGE_CELL_VAL (15) //0xF
@ -86,8 +84,8 @@ enum NETWORKINDEX { TXN_FRAME };
#define SAMPLE_ADC_HALF_SPEED (SAMPLE_DECMT_FACTOR_2_VAL + SAMPLE_DGTL_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + SAMPLE_ADC_SAMPLE_0_VAL) /* 0x1000 */
#define SAMPLE_ADC_QUARTER_SPEED (SAMPLE_DECMT_FACTOR_4_VAL + SAMPLE_DGTL_SAMPLE_8_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + SAMPLE_ADC_SAMPLE_0_VAL) /* 0x2810 */
#define CONFIG_HALF_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_HALF_SPEED_20MHZ_VAL + CONFIG_MODE_1_X_10GBE_VAL)
#define CONFIG_QUARTER_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_QUARTER_SPEED_10MHZ_VAL + CONFIG_MODE_1_X_10GBE_VAL)
#define CONFIG_HALF_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_HALF_SPEED_20MHZ_VAL + CONFIG_OPRTN_MDE_1_X_10GBE_VAL)
#define CONFIG_QUARTER_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_QUARTER_SPEED_10MHZ_VAL + CONFIG_OPRTN_MDE_1_X_10GBE_VAL)
#define ADC_OFST_HALF_SPEED_VAL (0x1f) //(0x20)
#define ADC_OFST_QUARTER_SPEED_VAL (0x0f) //(0x0f)
#define ADC_PHASE_HALF_SPEED (0x2D) //45

View File

@ -604,7 +604,7 @@ int64_t multiSlsDetector::getId(idMode mode, int imod) {
slsDetector* multiSlsDetector::getSlsDetector(unsigned int pos) {
if (pos >= 0 && pos < detectors.size()) {
if (pos < detectors.size()) {
return detectors[pos];
}
return 0;
@ -1315,7 +1315,9 @@ void multiSlsDetector::updateOffsets() {
numY_gp += detectors[idet]->getTotalNumberOfChannelsInclGapPixels(Y);
maxY += detectors[idet]->getMaxNumberOfChannels(Y);
maxY_gp += detectors[idet]->getMaxNumberOfChannelsInclGapPixels(Y);
++thisMultiDetector->numberOfDetector[Y];
// increment in y again only in the first column (else you double increment)
if (thisMultiDetector->numberOfDetector[X] == 1)
++thisMultiDetector->numberOfDetector[Y];
#ifdef VERBOSE
cout << "incrementing in y direction" << endl;
#endif
@ -2341,7 +2343,7 @@ int multiSlsDetector::sendSoftwareTrigger() {
int multiSlsDetector::startReadOut() {
unsigned int i = 0;
int i = 0;
int ret = OK, ret1 = OK;
i = thisMultiDetector->masterPosition;
if (i >= 0) {
@ -2351,7 +2353,7 @@ int multiSlsDetector::startReadOut() {
if (ret != OK)
ret1 = FAIL;
}
for (i = 0; i < detectors.size(); ++i) {
for (i = 0; i < (int)detectors.size(); ++i) {
ret = detectors[i]->startReadOut();
if (detectors[i]->getErrorMask())
setErrorMask(getErrorMask() | (1 << i));
@ -3261,7 +3263,10 @@ void multiSlsDetector::verifyMinMaxROI(int n, ROI r[]) {
}
}
int multiSlsDetector::setROI(int n, ROI roiLimits[]) {
int multiSlsDetector::setROI(int n, ROI roiLimits[], int imod) {
if (imod > 0 && imod < (int)detectors.size()) {
return detectors[imod]->setROI(n, roiLimits, imod);
}
int ret1 = -100, ret;
int i, xmin, xmax, ymin, ymax, channelX, channelY, idet, lastChannelX,
lastChannelY, index, offsetX, offsetY;
@ -3393,8 +3398,10 @@ int multiSlsDetector::setROI(int n, ROI roiLimits[]) {
}
slsDetectorDefs::ROI* multiSlsDetector::getROI(int& n) {
slsDetectorDefs::ROI* multiSlsDetector::getROI(int& n, int imod) {
if (imod > 0 && imod < (int)detectors.size()) {
return detectors[imod]->getROI(n, imod);
}
n = 0;
int num = 0, i, j;
int ndet = detectors.size();
@ -5379,7 +5386,7 @@ int multiSlsDetector::setCTBPattern(std::string fname) {
uint64_t word;
int addr = 0;
FILE* fd = fopen(fname.c_str(), "r");
if (fd > 0) {
if (fd) {
while (fread(&word, sizeof(word), 1, fd)) {
for (unsigned int idet = 0; idet < detectors.size(); ++idet)
detectors[idet]->setCTBWord(addr, word);

View File

@ -1222,16 +1222,18 @@ public:
* At the moment only one set allowed
* @param n number of rois
* @param roiLimits array of roi
* @param imod module number (-1 for all)
* @returns OK or FAIL
*/
int setROI(int n=-1,ROI roiLimits[]=NULL);
int setROI(int n=-1,ROI roiLimits[]=NULL, int imod = -1);
/**
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
* @param n number of rois
* @returns OK or FAIL
* @param imod module number (-1 for all)
* @returns pointer to array of ROI structure
*/
ROI* getROI(int &n);
ROI* getROI(int &n, int imod = -1);
/**
* Write to ADC register (Gotthard, Jungfrau, ChipTestBoard). For expert users

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "d2bce7e372c241cd235977b92be18555bca6a77d"
#define GITREPUUID "3c774478681813e451df683e2bc8403b37490323"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4020
#define GITDATE 0x20180927
#define GITBRANCH "4.0.0"
#define GITREV 0x4084
#define GITDATE 0x20190208
#define GITBRANCH "4.0.1"

View File

@ -2213,7 +2213,7 @@ string slsDetector::getLastClientIP() {
int slsDetector::exitServer() {
int retval;
int retval = FAIL;
int fnum=F_EXIT_SERVER;
if (thisDetector->onlineFlag==ONLINE_FLAG) {
@ -3158,13 +3158,15 @@ string slsDetector::getSettingsDir() {
return std::string(thisDetector->settingsDir);
}
string slsDetector::setSettingsDir(string s) {
sprintf(thisDetector->settingsDir, s.c_str()); return thisDetector->settingsDir;
sprintf(thisDetector->settingsDir, "%s", s.c_str());
return thisDetector->settingsDir;
}
string slsDetector::getCalDir() {
return thisDetector->calDir;
}
string slsDetector::setCalDir(string s) {
sprintf(thisDetector->calDir, s.c_str()); return thisDetector->calDir;
sprintf(thisDetector->calDir, "%s", s.c_str());
return thisDetector->calDir;
}
@ -4338,7 +4340,7 @@ int64_t slsDetector::getTimeLeft(timerIndex index, int imod) {
int fnum=F_GET_TIME_LEFT;
int64_t retval;
int64_t retval = FAIL;
char mess[MAX_STR_LENGTH]="";
int ret=OK;
@ -4627,7 +4629,7 @@ dacs_t slsDetector::setDAC(dacs_t val, dacIndex index, int mV, int imod) {
dacs_t slsDetector::getADC(dacIndex index, int imod) {
dacs_t retval;
dacs_t retval = 0;
int fnum=F_GET_ADC;
int ret=FAIL;
char mess[MAX_STR_LENGTH]="";
@ -5353,12 +5355,13 @@ string slsDetector::setReceiverUDPMAC(string udpmac) {
if((udpmac[2]==':')&&(udpmac[5]==':')&&(udpmac[8]==':')&&
(udpmac[11]==':')&&(udpmac[14]==':')){
strcpy(thisDetector->receiverUDPMAC,udpmac.c_str());
if(!strcmp(thisDetector->receiver_hostname,"none"))
if(!strcmp(thisDetector->receiver_hostname,"none")) {
#ifdef VERBOSE
std::cout << "Warning: Receiver hostname not set yet." << endl;
#else
;
#endif
}
/* else if(setUDPConnection()==FAIL){ commented out to be replaced by user
* defined udpmac
std::cout<< "Warning: UDP connection set up failed" << std::endl;
@ -5732,8 +5735,10 @@ int slsDetector::setUDPConnection() {
std::cout << "could not configure mac" << endl;
}
}
}else
}else {
ret=FAIL;
setErrorMask((getErrorMask())|(COULD_NOT_CONFIGURE_MAC));
}
#ifdef VERBOSE
printReceiverConfiguration();
#endif
@ -6017,7 +6022,7 @@ int slsDetector::setCounterBit(int i) {
int slsDetector::setROI(int n,ROI roiLimits[]) {
int slsDetector::setROI(int n,ROI roiLimits[], int imod) {
int ret = FAIL;
//sort ascending order
int temp;
@ -6053,7 +6058,7 @@ int slsDetector::setROI(int n,ROI roiLimits[]) {
}
slsDetectorDefs::ROI* slsDetector::getROI(int &n) {
slsDetectorDefs::ROI* slsDetector::getROI(int &n, int imod) {
sendROI(-1,NULL);
n=thisDetector->nROI;
if(thisDetector->myDetectorType==JUNGFRAUCTB) getTotalNumberOfChannels();
@ -6126,7 +6131,7 @@ int slsDetector::sendROI(int n,ROI roiLimits[]) {
#endif
// old firmware requires configuremac after setting roi
if (thisDetector->myDetectorType == GOTTHARD) {
if (thisDetector->myDetectorType == GOTTHARD && n != -1) {
configureMAC();
}
@ -6362,7 +6367,7 @@ int slsDetector::setFlippedData(dimension d, int value) {
int slsDetector::setAllTrimbits(int val, int imod) {
int fnum=F_SET_ALL_TRIMBITS;
int retval;
int retval = FAIL;
char mess[MAX_STR_LENGTH]="";
int ret=OK;
@ -7663,17 +7668,13 @@ int slsDetector::setChip(int reg, int ichip, int imod) {
int slsDetector::setChip(sls_detector_chip chip) {
int fnum=F_SET_CHIP;
int retval;
int retval = FAIL;
int ret=FAIL;
char mess[MAX_STR_LENGTH]="";
int ichi=chip.chip;
int im=chip.module;
if (thisDetector->onlineFlag==ONLINE_FLAG) {
if (connectControl() == OK){
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
@ -8490,7 +8491,7 @@ string slsDetector::getReceiverLastClientIP() {
int slsDetector::exitReceiver() {
int retval;
int retval = FAIL;
int fnum=F_EXIT_RECEIVER;
if (thisDetector->receiverOnlineFlag==ONLINE_FLAG) {
@ -8662,7 +8663,7 @@ void slsDetector::sendMultiDetectorSize() {
ret=thisReceiver->sendIntArray(fnum,retval,arg);
disconnectData();
}
if((ret==FAIL)){
if(ret==FAIL){
std::cout << "Could not set position Id" << std::endl;
setErrorMask((getErrorMask())|(RECEIVER_MULTI_DET_SIZE_NOT_SET));
}
@ -9561,7 +9562,7 @@ int slsDetector::setCTBPattern(string fname) {
int addr=0;
FILE *fd=fopen(fname.c_str(),"r");
if (fd>0) {
if (fd) {
while (fread(&word, sizeof(word), 1,fd)) {
setCTBWord(addr,word);
// cout << hex << addr << " " << word << dec << endl;

View File

@ -1500,16 +1500,18 @@ public:
* At the moment only one set allowed
* @param n number of rois
* @param roiLimits array of roi
* @param imod module number (ignored)
* @returns OK or FAIL
*/
int setROI(int n=-1,ROI roiLimits[]=NULL);
int setROI(int n=-1,ROI roiLimits[]=NULL, int imod = -1);
/**
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
* @param n number of rois
* @returns OK or FAIL
*/
slsDetectorDefs::ROI* getROI(int &n);
/**
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
* @param n number of rois
* @param imod module number (ignored)
* @returns pointer to array of ROI structure
*/
ROI* getROI(int &n, int imod = -1);
/**
* Returns number of rois

View File

@ -343,11 +343,11 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
\returns id
*/
virtual int64_t getId(idMode mode, int imod=0)=0;
int64_t getModuleFirmwareVersion(){return getId(MODULE_FIRMWARE_VERSION,-1);};
int64_t getModuleFirmwareVersion(int imod=-1){return getId(MODULE_FIRMWARE_VERSION,imod);};
int64_t getModuleSerialNumber(int imod=-1){return getId(MODULE_SERIAL_NUMBER,imod);};
int64_t getDetectorFirmwareVersion(){return getId(DETECTOR_FIRMWARE_VERSION,-1);};
int64_t getDetectorSerialNumber(){return getId(DETECTOR_SERIAL_NUMBER,-1);};
int64_t getDetectorSoftwareVersion(){return getId(DETECTOR_SOFTWARE_VERSION,-1);};
int64_t getDetectorFirmwareVersion(int imod=-1){return getId(DETECTOR_FIRMWARE_VERSION,imod);};
int64_t getDetectorSerialNumber(int imod=-1){return getId(DETECTOR_SERIAL_NUMBER,imod);};
int64_t getDetectorSoftwareVersion(int imod=-1){return getId(DETECTOR_SOFTWARE_VERSION,imod);};
int64_t getThisSoftwareVersion(){return getId(THIS_SOFTWARE_VERSION,-1);};
/**
@ -846,6 +846,7 @@ virtual int enableDataStreamingFromReceiver(int enable=-1)=0;
case RUNNING: return std::string("running");\
case TRANSMITTING: return std::string("data"); \
case RUN_FINISHED: return std::string("finished"); \
case STOPPED: return std::string("stopped"); \
default: return std::string("idle"); \
}};

View File

@ -3434,34 +3434,27 @@ string slsDetectorCommand::cmdAngConv(int narg, char *args[], int action){
} else {
return string("none");
}
}else{
return "unknown action";
}
} else if (string(args[0])==string("globaloff")) {
c=GLOBAL_OFFSET;
} else if (string(args[0])==string("fineoff")) {
c=FINE_OFFSET;
} else if (string(args[0])==string("binsize")) {
c=BIN_SIZE;
} else if (string(args[0])==string("angdir")) {
c=ANGULAR_DIRECTION;
} else if (string(args[0])==string("moveflag")) {
c=MOVE_FLAG;
} else if (string(args[0])==string("samplex")) {
c=SAMPLE_X;
} else if (string(args[0])==string("sampley")) {
c=SAMPLE_Y;
}
else
}else{
return string("could not decode angular conversion parameter ")+cmd;
}
if (action==PUT_ACTION) {
if (sscanf(args[1],"%lf",&fval))
@ -3568,7 +3561,7 @@ string slsDetectorCommand::helpThreaded(int narg, char *args[], int action){
string slsDetectorCommand::cmdImage(int narg, char *args[], int action){
string sval;
int retval;
int retval = FAIL;
if (action==HELP_ACTION)
return helpImage(narg,args,HELP_ACTION);
else if (action==GET_ACTION)
@ -3609,7 +3602,7 @@ string slsDetectorCommand::cmdCounter(int narg, char *args[], int action){
int ival;
char answer[100];
string sval;
int retval;
int retval = FAIL;
if (action==HELP_ACTION)
return helpCounter(narg,args,HELP_ACTION);
else if (action==PUT_ACTION)
@ -4533,7 +4526,9 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) {
myDet->setReceiverOnline(ONLINE_FLAG);
ret=myDet->setDynamicRange(val);
} else if (cmd=="roi") {
myDet->getROI(ret);
ROI* r = myDet->getROI(ret);
if (myDet->isMultiSlsDetectorClass() && r != NULL)
delete [] r;
} else if (cmd=="detsizechan") {
sprintf(ans,"%d %d",myDet->getMaxNumberOfChannelsPerDetector(X),myDet->getMaxNumberOfChannelsPerDetector(Y));
return string(ans);
@ -6207,7 +6202,8 @@ string slsDetectorCommand::cmdConfiguration(int narg, char *args[], int action)
myDet->setReceiverOnline(ONLINE_FLAG);
if (action==PUT_ACTION)
return string("cannot put");
return string(""+myDet->printReceiverConfiguration());
myDet->printReceiverConfiguration();
return string("");
}else if (cmd=="parameters") {
myDet->setReceiverOnline(ONLINE_FLAG);
if (action==PUT_ACTION) {
@ -6995,6 +6991,8 @@ string slsDetectorCommand::cmdPattern(int narg, char *args[], int action) {
}
}
os << hex << reg << dec;
if (myDet->isMultiSlsDetectorClass() && aa != NULL)
delete [] aa;
//os <<" "<< hex << myDet->readRegister(120) << dec;

View File

@ -115,18 +115,37 @@ int slsDetectorUsers::getPositions(double *pos){
}
int slsDetectorUsers::setDetectorSize(int x0, int y0, int nx, int ny){
if(myDetector->getTotalNumberOfChannels(slsDetectorDefs::Y)>1)
return 1;
int nmod=nx/(myDetector->getChansPerMod(0));
cout << myDetector->getChansPerMod(0) << " " << nx << " " << nmod << endl;
return myDetector->setNumberOfModules(nmod)*myDetector->getChansPerMod(0);}
// only one roi
slsDetectorDefs::ROI roi[1];
roi[0].xmin = x0;
roi[0].ymin = y0;
roi[0].xmax = x0 + nx;
roi[0].ymax = y0 + ny;
return myDetector->setROI(1, roi);
}
int slsDetectorUsers::getDetectorSize(int &x0, int &y0, int &nx, int &ny){
y0=0;
x0=0;
nx=myDetector->getTotalNumberOfChannels(slsDetectorDefs::X);
ny=myDetector->getTotalNumberOfChannels(slsDetectorDefs::Y);
return nx*ny;
// default (no roi)
y0=0;
x0=0;
nx=myDetector->getTotalNumberOfChannels(slsDetectorDefs::X);
ny=myDetector->getTotalNumberOfChannels(slsDetectorDefs::Y);
int n = 0;
slsDetectorDefs::ROI* roi = myDetector->getROI(n);
// roi
if (roi != NULL && n == 1) {
x0 = roi[0].xmin;
y0 = roi[0].ymin;
nx = roi[0].xmax - roi[0].xmin;
ny = roi[0].ymax - roi[0].ymin;
}
if (roi != NULL)
delete [] roi;
return nx*ny;
}
int slsDetectorUsers::getMaximumDetectorSize(int &nx, int &ny){
@ -267,24 +286,24 @@ string slsDetectorUsers::setClientDataStreamingInIP(string ip){
return myDetector->setClientDataStreamingInIP(ip);
}
int64_t slsDetectorUsers::getModuleFirmwareVersion(){
return myDetector->getModuleFirmwareVersion();
int64_t slsDetectorUsers::getModuleFirmwareVersion(int imod){
return myDetector->getModuleFirmwareVersion(imod);
}
int64_t slsDetectorUsers::getModuleSerialNumber(int imod){
return myDetector->getModuleSerialNumber(imod);
}
int64_t slsDetectorUsers::getDetectorFirmwareVersion(){
return myDetector->getDetectorFirmwareVersion();
int64_t slsDetectorUsers::getDetectorFirmwareVersion(int imod){
return myDetector->getDetectorFirmwareVersion(imod);
}
int64_t slsDetectorUsers::getDetectorSerialNumber(){
return myDetector->getDetectorSerialNumber();
int64_t slsDetectorUsers::getDetectorSerialNumber(int imod){
return myDetector->getDetectorSerialNumber(imod);
}
int64_t slsDetectorUsers::getDetectorSoftwareVersion(){
return myDetector->getDetectorSoftwareVersion();
int64_t slsDetectorUsers::getDetectorSoftwareVersion(int imod){
return myDetector->getDetectorSoftwareVersion(imod);
}
int64_t slsDetectorUsers::getThisSoftwareVersion(){
@ -494,3 +513,11 @@ int64_t slsDetectorUsers::setNumberOfStorageCells(int64_t t, int imod) {
int slsDetectorUsers::setStoragecellStart(int pos) {
return myDetector->setStoragecellStart(pos);
}
int slsDetectorUsers::setROI(int n, slsDetectorDefs::ROI roiLimits[], int imod) {
return myDetector->setROI(n, roiLimits, imod);
}
slsDetectorDefs::ROI* slsDetectorUsers::getROI(int &n, int imod) {
return myDetector->getROI(n, imod);
}

View File

@ -17,6 +17,8 @@ class detectorData;
class multiSlsDetector;
class multiSlsDetectorCommand;
#include "sls_detector_defs.h"
#include <stdint.h>
#include <string>
@ -247,7 +249,7 @@ class slsDetectorUsers
int getPositions(double *pos=NULL);
/**
@short sets the detector size
@short sets the detector size (only 1 ROI)
\param x0 horizontal position origin in channel number (-1 unchanged)
\param y0 vertical position origin in channel number (-1 unchanged)
\param nx number of channels in horiziontal (-1 unchanged)
@ -256,14 +258,13 @@ class slsDetectorUsers
*/
int setDetectorSize(int x0=-1, int y0=-1, int nx=-1, int ny=-1);
/**
@short gets detector size
@short gets detector size (roi size if only one roi)
\param x0 horizontal position origin in channel number
\param y0 vertical position origin in channel number
\param nx number of channels in horiziontal
\param ny number of channels in vertical
\returns OK/FAIL
\returns total number of channels
*/
int getDetectorSize(int &x0, int &y0, int &nx, int &ny);
/**
@ -505,12 +506,13 @@ class slsDetectorUsers
/**
get get Module Firmware Version
@param imod module number
\returns id
*/
int64_t getModuleFirmwareVersion();
int64_t getModuleFirmwareVersion(int imod=-1);
/**
get get Module Serial Number
get get Module Serial Number (only mythen)
@param imod module number
\returns id
*/
@ -518,21 +520,24 @@ class slsDetectorUsers
/**
get get Detector Firmware Version
@param imod module number
\returns id
*/
int64_t getDetectorFirmwareVersion();
int64_t getDetectorFirmwareVersion(int imod=-1);
/**
get get Detector Serial Number
@param imod module number
\returns id
*/
int64_t getDetectorSerialNumber();
int64_t getDetectorSerialNumber(int imod=-1);
/**
get get Detector Software Version
@param imod module number
\returns id
*/
int64_t getDetectorSoftwareVersion();
int64_t getDetectorSoftwareVersion(int imod=-1);
/**
get this Software Version
@ -814,6 +819,25 @@ class slsDetectorUsers
*/
int setStoragecellStart(int pos=-1);
/**
* Set ROI (Gotthard) (>= 1 roi, but max 1 roi per module)
* At the moment only one set allowed
* @param n number of rois
* @param roiLimits array of roi
* @param imod module number (-1 for all)
* @returns OK or FAIL
*/
int setROI(int n=-1, slsDetectorDefs::ROI roiLimits[]=NULL, int imod = -1);
/**
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
* >= 1 roi, but max 1 roi per module
* @param n number of rois
* @param imod module number (ignored)
* @returns pointer to array of ROI structure
*/
slsDetectorDefs::ROI* getROI(int &n, int imod = -1);
/************************************************************************
STATIC FUNCTIONS
@ -832,6 +856,7 @@ class slsDetectorUsers
case 3: return std::string("finished"); \
case 4: return std::string("data"); \
case 5: return std::string("running"); \
case 6: return std::string("stoppped"); \
default: return std::string("unknown"); \
}};

View File

@ -869,16 +869,18 @@ virtual int calibratePedestal(int frames = 0)=0;
set roi
\param n number of rois
\param roiLimits array of roi
\param imod module number (-1 for all)
\returns success or failure
*/
virtual int setROI(int n=-1,ROI roiLimits[]=NULL)=0;
virtual int setROI(int n=-1,ROI roiLimits[]=NULL, int imod = -1)=0;
/**
get roi from each detector and convert it to the multi detector scale
\param n number of rois
\returns an array of multidetector's rois
\param imod module number (-1 for all)
\returns pointer to array of ROI structure
*/
virtual ROI* getROI(int &n)=0;
virtual ROI* getROI(int &n, int imod = -1)=0;
/** Sets the read receiver frequency
if data required from receiver randomly readRxrFrequency=0,

View File

@ -96,7 +96,7 @@ double angularConversionStatic::convertAngle(double pos, int ich, angleConversio
// cout << "no ang conv " << endl;
double enc=0, trans=0;
double ang;
double ang=0;
switch (mF) {
case 0:

View File

@ -93,7 +93,7 @@ class fileIO : public fileIOStatic, public virtual slsDetectorBase {
*/
virtual std::string setFilePath(std::string s) {
pthread_mutex_lock(&mf);
sprintf(filePath, s.c_str());
sprintf(filePath, "%s", s.c_str());
pthread_mutex_unlock(&mf);
return std::string(filePath);
};
@ -105,7 +105,7 @@ class fileIO : public fileIOStatic, public virtual slsDetectorBase {
*/
virtual std::string setFileName(std::string s) {
pthread_mutex_lock(&mf);
sprintf(fileName, s.c_str());
sprintf(fileName, "%s", s.c_str());
pthread_mutex_unlock(&mf);
return std::string(fileName);};

View File

@ -103,7 +103,7 @@ int postProcessingFuncs::addFrame(double *data, double *pos, double *I0, double
if (I0>0) {
if (I0 != NULL) {
i0=*I0;
totalI0+=i0;
} else

View File

@ -1,5 +1,5 @@
#ifndef POSTPROCESSINGFUNCS_H
#define POSTPROCESSINGFUNC_H
#define POSTPROCESSINGFUNCS_H
@ -77,4 +77,4 @@ class postProcessingFuncs : public virtual angularConversionStatic
};
#endif
#endif //POSTPROCESSINGFUNCS_H

View File

@ -18,7 +18,7 @@ set(SOURCES
# HDF5
if (USE_HDF5)
if (SLS_USE_HDF5)
if (HDF5_FOUND)
include_directories(
${HDF5_INCLUDE_DIRS}
@ -30,7 +30,7 @@ if (USE_HDF5)
src/HDF5File.cpp
)
endif ()
endif (USE_HDF5)
endif (SLS_USE_HDF5)
add_definitions(
@ -48,15 +48,6 @@ set_target_properties(zmq PROPERTIES
IMPORTED_LOCATION ${ZMQ_STATIC_ARCHIVE}
)
add_library(slsReceiverStatic STATIC
${SOURCES}
${HEADERS}
)
set_target_properties(slsReceiverStatic PROPERTIES
ARCHIVE_OUTPUT_NAME SlsReceiver
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
add_library(slsReceiverShared SHARED
${SOURCES}
${HEADERS}
@ -98,12 +89,12 @@ endif ()
install(TARGETS slsReceiverShared slsReceiverStatic slsReceiver
install(TARGETS slsReceiverShared slsReceiver
EXPORT "${TARGETS_EXPORT_NAME}"
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include)
install(FILES ${ZMQ_STATIC_ARCHIVE}
DESTINATION lib)
DESTINATION lib)

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsReceiverSoftware
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: d2bce7e372c241cd235977b92be18555bca6a77d
Revision: 839
Branch: 4.0.0
Repsitory UUID: 3c774478681813e451df683e2bc8403b37490323
Revision: 858
Branch: 4.0.1
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4020
Last Changed Date: 2018-09-27 17:58:04.000000002 +0200 ./src/UDPStandardImplementation.cpp
Last Changed Rev: 4084
Last Changed Date: 2019-02-08 16:44:46.000000002 +0100 ./src/Listener.cpp

View File

@ -189,10 +189,6 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
/** additional json header */
char* additionJsonHeader;
/** Silent Mode */
bool* silentMode;
/** Aquisition Started flag */
bool acquisitionStartedFlag;

View File

@ -89,7 +89,6 @@ public:
/** Cosntructor */
GeneralData():
myDetectorType(slsReceiverDefs::GENERIC),
@ -120,32 +119,18 @@ public:
/** Destructor */
virtual ~GeneralData(){};
/**
* Get Header Infomation (frame number, packet number)
* @param index thread index for debugging purposes
* @param packetData pointer to data
* @param frameNumber frame number
* @param packetNumber packet number
*/
virtual void GetHeaderInfo(int index, char* packetData, uint64_t& frameNumber, uint32_t& packetNumber) const
{
frameNumber = ((uint32_t)(*((uint32_t*)(packetData))));
frameNumber++;
packetNumber = frameNumber&packetIndexMask;
frameNumber = (frameNumber & frameIndexMask) >> frameIndexOffset;
}
/**
* Get Header Infomation (frame number, packet number)
* @param index thread index for debugging purposes
* @param packetData pointer to data
* @param dynamicRange dynamic range to assign subframenumber if 32 bit mode
* @param oddStartingPacket odd starting packet (gotthard)
* @param frameNumber frame number
* @param packetNumber packet number
* @param subFrameNumber sub frame number if applicable
* @param bunchId bunch id
*/
virtual void GetHeaderInfo(int index, char* packetData, uint32_t dynamicRange,
virtual void GetHeaderInfo(int index, char* packetData, uint32_t dynamicRange, bool oddStartingPacket,
uint64_t& frameNumber, uint32_t& packetNumber, uint32_t& subFrameNumber, uint64_t& bunchId) const
{
subFrameNumber = -1;
@ -170,7 +155,7 @@ public:
* @param i pointer to a vector of ROI pointers
* @returns adc configured
*/
virtual const int GetAdcConfigured(int index, std::vector<slsReceiverDefs::ROI>* i) const{
virtual int GetAdcConfigured(int index, std::vector<slsReceiverDefs::ROI>* i) const{
cprintf(RED,"This is a generic function that should be overloaded by a derived class\n");
return 0;
};
@ -210,6 +195,17 @@ public:
cprintf(RED,"This is a generic function that should be overloaded by a derived class\n");
};
/**
* Set odd starting packet (gotthard)
* @param index thread index for debugging purposes
* @param packetData pointer to data
* @returns true or false for odd starting packet number
*/
virtual bool SetOddStartingPacket(int index, char* packetData) {
cprintf(RED,"This is a generic function that should be overloaded by a derived class\n");
return false;
};
/**
* Print all variables
@ -270,44 +266,26 @@ private:
};
/**
* Get Header Infomation (frame number, packet number)
* @param index thread index for debugging purposes
* @param packetData pointer to data
* @param frameNumber frame number
* @param packetNumber packet number
*/
virtual void GetHeaderInfo(int index, char* packetData, uint64_t& frameNumber, uint32_t& packetNumber) const
{
if (nPixelsX == 1280) {
frameNumber = ((uint32_t)(*((uint32_t*)(packetData))));
frameNumber++;
packetNumber = frameNumber&packetIndexMask;
frameNumber = (frameNumber & frameIndexMask) >> frameIndexOffset;
} else {
frameNumber = ((uint32_t)(*((uint32_t*)(packetData))));
packetNumber = 0;
}
}
/**
* Get Header Infomation (frame number, packet number)
* @param index thread index for debugging purposes
* @param packetData pointer to data
* @param dynamicRange dynamic range to assign subframenumber if 32 bit mode
* @param oddStartingPacket odd starting packet (gotthard)
* @param frameNumber frame number
* @param packetNumber packet number
* @param subFrameNumber sub frame number if applicable
* @param bunchId bunch id
*/
virtual void GetHeaderInfo(int index, char* packetData, uint32_t dynamicRange,
void GetHeaderInfo(int index, char* packetData, uint32_t dynamicRange, bool oddStartingPacket,
uint64_t& frameNumber, uint32_t& packetNumber, uint32_t& subFrameNumber, uint64_t& bunchId) const
{
if (nPixelsX == 1280) {
subFrameNumber = -1;
bunchId = -1;
frameNumber = ((uint32_t)(*((uint32_t*)(packetData))));
frameNumber++;
if (oddStartingPacket)
frameNumber++;
packetNumber = frameNumber&packetIndexMask;
frameNumber = (frameNumber & frameIndexMask) >> frameIndexOffset;
} else {
@ -323,7 +301,7 @@ private:
* Set ROI
* @param i ROI
*/
virtual void SetROI(std::vector<slsReceiverDefs::ROI> i) {
void SetROI(std::vector<slsReceiverDefs::ROI> i) {
// all adcs
if(!i.size()) {
nPixelsX = 1280;
@ -367,7 +345,7 @@ private:
* @param i pointer to a vector of ROI
* @returns adc configured
*/
virtual const int GetAdcConfigured(int index, std::vector<slsReceiverDefs::ROI>* i) const{
int GetAdcConfigured(int index, std::vector<slsReceiverDefs::ROI>* i) const{
int adc = -1;
// single adc
if(i->size()) {
@ -392,6 +370,40 @@ private:
return adc;
};
/**
* Set odd starting packet (gotthard)
* @param index thread index for debugging purposes
* @param packetData pointer to data
* @returns true or false for odd starting packet number
*/
bool SetOddStartingPacket(int index, char* packetData) {
bool oddStartingPacket = true;
// care only if no roi
if (nPixelsX == 1280) {
uint32_t fnum = ((uint32_t)(*((uint32_t*)(packetData))));
uint32_t firstData = ((uint32_t)(*((uint32_t*)(packetData + 4))));
// first packet
if (firstData == 0xCACACACA) {
// packet number should be 0, but is 1 => so odd starting packet
if (fnum & packetIndexMask) {
oddStartingPacket = true;
} else {
oddStartingPacket = false;
}
}
// second packet
else {
// packet number should be 1, but is 0 => so odd starting packet
if (!(fnum & packetIndexMask)) {
oddStartingPacket = true;
} else {
oddStartingPacket = false;
}
}
}
return oddStartingPacket;
};
};
@ -520,29 +532,18 @@ private:
defaultFifoDepth = 2500;
};
/**
* Get Header Infomation (frame number, packet number)
* @param index thread index for debugging purposes
* @param packetData pointer to data
* @param frameNumber frame number
* @param packetNumber packet number
*/
virtual void GetHeaderInfo(int index, char* packetData, uint64_t& frameNumber, uint32_t& packetNumber) const {
jfrauctb_packet_header_t* header = (jfrauctb_packet_header_t*)(packetData);
frameNumber = (uint64_t)((*( (uint32_t*) header->frameNumber)) & frameIndexMask);
packetNumber = (uint32_t)(*( (uint8_t*) header->packetNumber));
}
/**
* Get Header Infomation (frame number, packet number)
* @param index thread index for debugging purposes
* @param packetData pointer to data
* @param dynamicRange dynamic range to assign subframenumber if 32 bit mode
* @param oddStartingPacket odd starting packet (gotthard)
* @param frameNumber frame number * @param packetNumber packet number
* @param subFrameNumber sub frame number if applicable
* @param bunchId bunch id
*/
void GetHeaderInfo(int index, char* packetData, uint32_t dynamicRange,
void GetHeaderInfo(int index, char* packetData, uint32_t dynamicRange, bool oddStartingPacket,
uint64_t& frameNumber, uint32_t& packetNumber, uint32_t& subFrameNumber, uint64_t& bunchId) const {
subFrameNumber = -1;
jfrauctb_packet_header_t* header = (jfrauctb_packet_header_t*)(packetData);

View File

@ -202,7 +202,7 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
bool runningFlag;
/** GeneralData (Detector Data) object */
const GeneralData* generalData;
GeneralData* generalData;
/** Fifo structure */
Fifo* fifo;
@ -311,5 +311,11 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
/** number of images for statistic */
uint32_t numFramesStatistic;
/**
* starting packet number is odd or evern, accordingly increment frame number
* to get first packet number as 0
* (pecific to gotthard, can vary between modules, hence defined here) */
bool oddStartingPacket;
};

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "d2bce7e372c241cd235977b92be18555bca6a77d"
#define GITREPUUID "3c774478681813e451df683e2bc8403b37490323"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4020
#define GITDATE 0x20180927
#define GITBRANCH "4.0.0"
#define GITREV 0x4084
#define GITDATE 0x20190208
#define GITBRANCH "4.0.1"

View File

@ -115,7 +115,7 @@ inline std::string NowTime()
const int buffer_len = sizeof(buffer);
time_t t;
time(&t);
tm r = {0};
tm r;
strftime(buffer, buffer_len, "%X", localtime_r(&t, &r));
buffer[buffer_len - 1] = 0;
struct timeval tv;

View File

@ -146,7 +146,7 @@ void DataProcessor::ResetParametersforNewMeasurement(){
delete [] tempBuffer;
tempBuffer = 0;
}
if (*gapPixelsEnable >= 0) {
if (*gapPixelsEnable) {
tempBuffer = new char[generalData->imageSize];
memset(tempBuffer, 0, generalData->imageSize);
}
@ -363,10 +363,12 @@ void DataProcessor::ProcessAnImage(char* buf) {
*dynamicRange);
// frame padding
if (*activated && *framePadding && nump < generalData->packetsPerFrame)
PadMissingPackets(buf);
// deactivated and padding enabled
if ((!(*activated) && *deactivatedPaddingEnable) ||
// frame padding
(*framePadding && nump < generalData->packetsPerFrame))
else if (!(*activated) && *deactivatedPaddingEnable)
PadMissingPackets(buf);
// normal call back

View File

@ -28,7 +28,6 @@ DataStreamer::DataStreamer(int ind, Fifo*& f, uint32_t* dr, std::vector<ROI>* r,
fileIndex(fi),
flippedData(fd),
additionJsonHeader(ajh),
silentMode(sm),
acquisitionStartedFlag(false),
measurementStartedFlag(false),
firstAcquisitionIndex(0),

View File

@ -54,7 +54,8 @@ Listener::Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s,
listeningPacket(0),
udpSocketAlive(0),
numPacketsStatistic(0),
numFramesStatistic(0)
numFramesStatistic(0),
oddStartingPacket(true)
{
if(ThreadObject::CreateThread() == FAIL)
throw std::exception();
@ -64,9 +65,11 @@ Listener::Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s,
Listener::~Listener() {
if (udpSocket) delete udpSocket;
sem_post(&semaphore_socket);
sem_destroy(&semaphore_socket);
if (udpSocket){
delete udpSocket;
sem_post(&semaphore_socket);
sem_destroy(&semaphore_socket);
}
if (carryOverPacket) delete [] carryOverPacket;
if (listeningPacket) delete [] listeningPacket;
ThreadObject::DestroyThread();
@ -201,9 +204,10 @@ int Listener::CreateUDPSockets() {
ShutDownUDPSocket();
try{
udpSocket = new genericSocket(*udpPortNumber, genericSocket::UDP,
genericSocket* g = new genericSocket(*udpPortNumber, genericSocket::UDP,
generalData->packetSize, (strlen(eth)?eth:NULL), generalData->headerPacketSize,
*udpSocketBufferSize);
udpSocket = g;
FILE_LOG(logINFO) << index << ": UDP port opened at port " << *udpPortNumber;
} catch (...) {
FILE_LOG(logERROR) << "Could not create UDP socket on port " << *udpPortNumber;
@ -227,8 +231,10 @@ void Listener::ShutDownUDPSocket() {
udpSocket->ShutDownSocket();
FILE_LOG(logINFO) << "Shut down of UDP port " << *udpPortNumber;
fflush(stdout);
//delete socket at stoplistening
sem_wait(&semaphore_socket);
// wait only if the threads have started as it is the threads that
//give a post to semaphore(at stopListening)
if (runningFlag)
sem_wait(&semaphore_socket);
delete udpSocket;
udpSocket = 0;
sem_destroy(&semaphore_socket);
@ -427,7 +433,7 @@ uint32_t Listener::ListenToAnImage(char* buf) {
// -------------------old header -----------------------------------------------------------------------------
else {
generalData->GetHeaderInfo(index, carryOverPacket + esize,
*dynamicRange, fnum, pnum, snum, bid);
*dynamicRange, oddStartingPacket, fnum, pnum, snum, bid);
}
//------------------------------------------------------------------------------------------------------------
if (fnum != currentFrameIndex) {
@ -542,8 +548,13 @@ uint32_t Listener::ListenToAnImage(char* buf) {
}
// -------------------old header -----------------------------------------------------------------------------
else {
// set first packet to be odd or even (check required when switching from roi to no roi)
if (myDetectorType == GOTTHARD && !measurementStartedFlag) {
oddStartingPacket = generalData->SetOddStartingPacket(index, listeningPacket + esize);
}
generalData->GetHeaderInfo(index, listeningPacket + esize,
*dynamicRange, fnum, pnum, snum, bid);
*dynamicRange, oddStartingPacket, fnum, pnum, snum, bid);
}
//------------------------------------------------------------------------------------------------------------