Compare commits

...

198 Commits

Author SHA1 Message Date
59b56c764f Merge branch 'main-rc' into b4.1.0 2020-11-30 17:09:23 +01:00
ff7afd0de7 Merge branch 'main-rc' into b4.0.2 2020-11-30 17:05:39 +01:00
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
62c86f56b1 Merge branch 'main' into test 2020-11-20 14:27:25 +01:00
77080a524a Merge branch 'main' into test 2020-11-20 14:26:37 +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
f7cb2b5dcd conda pkg 2019-10-08 12:48:51 +02:00
9ea3cbc8f1 Update RELEASE.txt 2019-10-04 10:56:14 +02:00
53bb677f8c eiger doc updated 2019-10-04 10:41:13 +02:00
663999a539 updated versions 2019-10-04 10:35:42 +02:00
98b45b32fd added jungfrau virtual binaries 2019-10-04 10:29:57 +02:00
74c08cd742 updated binaries in sererbin 2019-10-04 09:42:07 +02:00
696073b505 fixed eiger virtual software versions 2019-10-04 09:41:21 +02:00
e4645a8273 Update RELEASE.txt 2019-10-02 09:37:26 +02:00
c0cd25460d Update RELEASE.txt 2019-10-02 09:35:59 +02:00
e7e30693f0 transmission delays 2019-08-21 20:29:07 +02:00
dd96aac3cd build for conda 2019-08-20 12:24:39 +02:00
5697393a70 Merge branch '4.1.0-rc' of github.com:slsdetectorgroup/slsDetectorPackage into 4.1.0-rc 2019-08-16 15:33:04 +02:00
052dd8058f updated eiger binary 2019-08-16 15:32:49 +02:00
4d99ce8c52 receiver master file includes quad, gap pixels enable, version updated for binary and hdf5 2019-08-14 20:33:40 +02:00
633c646239 eiger bug fix: 4 bit mode gap pixels, also added quad to shm 2019-08-14 15:31:18 +02:00
2a88bc6a1e Merge branch '4.1.0-rc' of github.com:slsdetectorgroup/slsDetectorPackage into 4.1.0-rc 2019-08-14 10:43:15 +02:00
d8af2e594a eiger bug fix: quad mode, without gap pixels, data messed up 2019-08-14 10:42:54 +02:00
8da7c3e805 eiger manual 2019-08-13 16:57:22 +02:00
ddfbea76be eiger server bug fix: interrupt subframe wrong bit mapped, virtual compilation 2019-08-06 17:22:54 +02:00
c5f2275703 eiger serveR: minor fix for beb check quad fail 2019-07-31 15:20:25 +02:00
8c491f18fd quad enabled with gap pixels without the extra vertical pixel line 2019-07-31 13:00:12 +02:00
e07e2f2da0 eiger server bug fix: split quad and interruptframe into set and get to catch fails in set and when quad and interrupt subframe used together(different register values for tl and tr) 2019-07-31 10:58:49 +02:00
d981e1b8e5 eiger server: interrupt subframe, quad change flipping, registers set left and right separately 2019-07-29 15:19:46 +02:00
58e6338f9c eiger server for v24 2019-07-29 09:36:45 +02:00
27f3af5365 updated release text 2019-07-29 09:32:17 +02:00
350b4f0368 bug fix on quad: if no data streaming enabled in the beginning 2019-07-22 17:09:34 +02:00
445f3c66fd bug fix for previous commit to work for bottom module 2019-07-10 17:56:32 +02:00
1189b991e5 quad implemented 2019-07-10 17:39:43 +02:00
3e2b471ee1 client bug fix: framesl, cyclesl printed in float, fixed 2019-07-10 11:13:35 +02:00
8c76d5d52c updated release.txt 2019-06-14 09:19:34 +02:00
e7eee67fed Update RELEASE.txt 2019-06-13 11:44:43 +02:00
fade48dcfa updated release.rxt 2019-06-13 11:43:06 +02:00
8e58e7f8bf Updated release.txt : eiger firmware version 23 2019-06-13 11:41:50 +02:00
c8f56ee23c qwt 2019-06-13 10:44:45 +02:00
32d951e28a Merge branch '4.0.2' of github.com:slsdetectorgroup/slsDetectorPackage into 4.0.2 2019-06-13 09:01:47 +02:00
5c63c8fc8f gui bug fix: switching to tab plot while acquiring produced error messages 2019-06-13 09:01:39 +02:00
7b70274d4f checking online when refreshing (during acquire) is removed 2019-06-13 08:56:29 +02:00
1cd905c08b disable gui 2019-06-12 16:02:43 +02:00
13e809acd4 updated versions 2019-06-12 15:40:19 +02:00
46533b0411 updated server binaries 2019-06-12 15:37:17 +02:00
4f4de15d3a 1s sleep for large JF during powerchip 2019-06-12 14:53:52 +02:00
4f99aeabd2 bug fix: hdf5 printError still called once. replcaed with printErrorStack 2019-05-22 19:09:45 +02:00
f36a12e454 Release Notes typo: jungfrau min exptime is 50ns and not 50 us (#16) 2019-05-02 15:28:03 +02:00
5e246c0754 Merge branch '4.0.2-rc' of github.com:slsdetectorgroup/slsDetectorPackage into 4.0.2-rc 2019-04-11 16:13:42 +02:00
518c6783cc Client (data call back API) and Gui (Eiger 4 bit mode with multiple images) bug fix: npixelsx and npixelsy was not updated to complete detector level when calling call back function to give complete image 2019-04-11 16:13:31 +02:00
0706564694 deploy only on specific branch 2019-04-11 09:31:27 +02:00
2108bbda66 Merge branch '4.0.2-rc' of github.com:slsdetectorgroup/slsDetectorPackage into 4.0.2-rc 2019-04-08 18:06:19 +02:00
82feed1ab8 updated server binaries 2019-04-08 18:06:06 +02:00
4be0b5d436 jungfrau server bug fix: setting detector position gave error when switching between different sized detector configurations 2019-04-08 18:05:05 +02:00
f7eb256eb6 version 2019-03-15 14:45:44 +01:00
250fc26308 fixed deloyment 2019-03-15 14:40:12 +01:00
06a50520c1 gotthard server: bug fix get settings should not set default dacs 2019-03-11 14:54:53 +01:00
fc766055d4 receiver bug fix release text updated 2019-03-04 11:42:54 +01:00
828b1479c7 receiver bug fix jungfrau as root 2019-03-04 11:28:56 +01:00
22ed52605c receiverbug fixe affecting jungfrau receivers as root 2019-03-04 11:15:53 +01:00
a1a95ebb20 receiver bug fixaffecting Jungfrau receivers as root (optlen size as int), but setting buffer size is uint32_t size. setting it to uint64_t 2019-03-04 11:02:10 +01: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
5698da5f95 added conda recipe 2018-12-12 16:33:25 +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
86 changed files with 1710 additions and 632 deletions

View File

@ -41,5 +41,4 @@ deploy:
provider: script
script: find $HOME/miniconda/conda-bld/${TRAVIS_OS_NAME}-64 -name "*.tar.bz2" -exec anaconda -t $CONDA_TOKEN upload --force {} \;
on:
branch: 4.0.1-rc
branch: 4.1.0

View File

@ -1,8 +1,8 @@
SLS Detector Package 4.0.1 released on 08.02.2018 (Bug Fix Release)
===================================================================
SLS Detector Package 4.1.0 released on 04.10.2019 (Minor Release)
=================================================================
This document describes the differences between 4.0.1 and 4.0.0 releases.
This document describes the differences between 4.1.0 and 4.0.2 releases.
CONTENTS
--------
@ -17,100 +17,54 @@ This document describes the differences between 4.0.1 and 4.0.0 releases.
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)
- software for eiger quad hardware integrated
- command line framesl, cyclesl was printing in float (jungfrau, gotthard)
- eiger interrupt subframe flag
- eiger server reg command (+0x100 for left and +0x200 for right)
- additional eiger parameters included i master file
2. Resolved Issues
==================
Detector Server
---------------
Client
------
1. (Jungfrau): Latest Jungfrau firmware release mapped.
1. Command line quad integrates Eiger quad hardware
2. (Eiger): Measured subperiod initially wrapped around 4.29s. Now, upto 42.9s.
2. Command line commands framesl, cyclesl, fatesl, problesl and nframes was
printing the result in decimals. It is now fixed to print as whole numbers.
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.
Detector Server (Eiger)
-----------------------
The detector output is shifted by 1 for every 32 channels. This is fixed now.
1. Command line quad integrates Eiger quad hardware
2. Control flag to set last subframe to be interrupted depending on subexptime.
By default, it is disabled and will wait till the last sub frame has finished
exposing.
3. Left and Right FEB registers accessed independently using addr (+0x100 and +0x200)
respectively.
Receiver
--------
1. Receiver padding was enabled only if deactivated padding was also enabled.
Receiver padding enable and receiver deactivated padding enable are independent now.
1. Command line quad integrates Eiger quad hardware
2. Starting and stopping receiver without listening resulted in seg faults.
2. Master file has additional parameters for Eiger (Quad Enable, Gap Pixels Enable).
Writer version update to 4.0.
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_'.
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.
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. Zmq Json Header has additional informaion
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
@ -123,8 +77,8 @@ This document describes the differences between 4.0.1 and 4.0.0 releases.
09.02.2018 (25 um Slave)
Eiger
=====
Minimum compatible version : 22
Latest compatible version : 22
Minimum compatible version : 24
Latest compatible version : 24
Jungfrau
========
@ -139,12 +93,13 @@ This document describes the differences between 4.0.1 and 4.0.0 releases.
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.
https://slsdetectorgroup.github.io/slsDetectorPackage/docs/html/slsDetectorInstall/GOTTHARD_Firmware.html
https://slsdetectorgroup.github.io/slsDetectorPackage/docs/html/slsDetectorInstall/EIGER_Firmware.html
https://slsdetectorgroup.github.io/slsDetectorPackage/docs/html/slsDetectorInstall/JUNGFRAU_Firmware.html
Please refer to the link below for more details on the firmware versions.
https://www.psi.ch/detectors/firmware.
https://www.psi.ch/en/detectors/firmware
@ -171,35 +126,42 @@ This document describes the differences between 4.0.1 and 4.0.0 releases.
-------------
Manual (HTML & PDF):
https://www.psi.ch/detectors/documentation
https://www.psi.ch/en/detectors/documentation
slsDetectorPackage/manual/docs/
Command Line Documentation:
https://slsdetectorgroup.github.io/slsDetectorPackage/docs/html/slsDetectorClientDocs/index.html
https://slsdetectorgroup.github.io/slsDetectorPackage/docs/pdf/slsDetectorClientDocs.pdf
manual/docs/html/slsDetectorClientDocs/index.html
manual/docs/pdf/slsDetectorClientDocs.pdf
C++ API Documentation:
https://slsdetectorgroup.github.io/slsDetectorPackage/docs/html/slsDetectorUsersDocs/index.html
https://slsdetectorgroup.github.io/slsDetectorPackage/docs/pdf/slsDetectorUsersDocs.pdf
manual/docs/html/slsDetectorUsersDocs/index.html
manual/docs/pdf/slsDetectorUsersDocs.pdf
C++ API Example:
https://slsdetectorgroup.github.io/slsDetectorPackage/exampleCode/slsDetectorUsersExample/index.html
manual/manual-api/mainClient.cpp
manual/manual-api/mainReceiver.cpp
Python API Documentation:
https://slsdetectorgroup.github.io/sls_detector/
TroubleShotting:
https://www.psi.ch/en/detectors/troubleshooting
Further Documentation:
https://www.psi.ch/detectors/users-support
https://www.psi.ch/en/detectors/users-support
Support
-------
General Software related:
dhanya.thattil@psi.ch
anna.bergamaschi@psi.ch
Python related:
erik.frojdh@psi.ch
anna.bergamaschi@psi.ch

5
cmk.sh
View File

@ -60,6 +60,7 @@ while getopts ":bchd:j:trge" opt ; do
b)
echo "Building of CMake files Required"
REBUILD=1
CLEAN=1
;;
c)
echo "Clean Required"
@ -69,6 +70,7 @@ while getopts ":bchd:j:trge" opt ; do
echo "Building of CMake files with HDF5 option Required"
HDF5=1
REBUILD=1
CLEAN=1
;;
d)
echo "New HDF5 directory: $OPTARG"
@ -82,16 +84,19 @@ while getopts ":bchd:j:trge" opt ; do
echo "Compiling Options: Text Client"
TEXTCLIENT=1
REBUILD=1
CLEAN=1
;;
r)
echo "Compiling Options: Receiver"
RECEIVER=1
REBUILD=1
CLEAN=1
;;
g)
echo "Compiling Options: GUI"
GUI=1
REBUILD=1
CLEAN=1
;;
e)
echo "Compiling Options: Debug"

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

View File

@ -6,6 +6,7 @@
\usepackage{verbatim}
\usepackage{xspace}
\usepackage{hyperref}
\usepackage{xcolor}
\newcommand{\E}{EIGER\xspace}
\newcommand{\p}{sls\_detector\_put}
\newcommand{\g}{sls\_detector\_get}
@ -24,7 +25,7 @@ Figure ~\ref{boards} show the readout board basic components on an Eiger half mo
\begin{center}
\includegraphics[width=1\textwidth]{Boards}
\end{center}
\caption{Picture with most relevant components of the EIGER readout system. The readout system starts with the Front End Boards (FEB) which performs data descrambling (also converts the packets from 12 $\to$ 16 bits) and rate correction. The BackEndBoard (BEB) has 2x2GB DDR2 memories and can perform data buffering (storing images on board) and data summation (16 bit $\to$ 32 bits). The controls to the detector are passed through the 1Gb, while in most installations, the data are sent out through the 10GB ethernet connection.}
\caption{Picture with most relevant components of the EIGER readout system. The readout system starts with the Front End Boards (FEB) which performs data descrambling (also converts the packets from 12 $\to$ 16 bits) and rate correction. The BackEndBoard (BEB) has 2x2GB DDR2 memories and can perform data buffering (storing images on board) and data summation (16 bit $\to$ 32 bits). The controls to the detector are passed through the 1Gb, while in most installations, the data are sent out through the 10~GB ethernet connection.}
\label{boards}
\end{figure}
@ -156,6 +157,14 @@ outdir /sls/X12SA/data/x12saop/Data10/Eiger0.5M
threaded 1
\end{verbatim}
The geometry on af an EIGER module, showing the quadrants corresponding to the udp ports and the 2 receivers is shown in figure~\ref{fig:eigerports}.
\begin{figure}[t]
\begin{center}
\includegraphics[width=0.9\textwidth]{Eiger-Chips}
\end{center}
\caption{Geometry of UDP ports and receivers in a singel module.}
\label{fig:eigerports}
\end{figure}
In the case you are developing your own receiver, then you need to remove the 1Gb receiver hostname {\tt{rx\_hostname}} and substitute it with the mac address of the device:
\begin{verbatim}
@ -163,7 +172,6 @@ configuremac 0
rx_udpmac xx:xx:...
\end{verbatim}
One can configure all the detector settings in a parameter file {\tt{setup.det}}, which is loaded by doing:
\begin{verbatim}
sls_detector_put 0-parameters setup.det
@ -219,6 +227,7 @@ We have added a special command, {\tt{thresholdnotb}}, which allows to scan the
\begin{verbatim}
sls_detector_put 0-thresholdnotb energy_in_eV
\end{verbatim}
See section~\ref{sec:fastthresholdscan}.
\section{Standard acquisition}
@ -317,31 +326,49 @@ The size of the gap pixels between modules to insert is
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{QUAD special geometry}
Starting from release 4.1.0, we support a special geometry with 2x2 pixels. This is for a Quad, where a single half module reads out 4 chips but in a quad shape. For now this hardware is only available as a PEEM detector at SIM.
The {\tt{detsizechan 1024 512}} needs to remain set like this for a half module. However, thanks to the command:
\begin{verbatim}
./sls_detector_put quad 1
\end{verbatim}
a 512x512 geomtry will be read out if {\tt{gappixels 0}} and 514x514 will be readout if {\tt{gappixels 1}}. Note that as above, {\tt{gappixels 1}} is not supported for {\tt{dr 4}}.
If {\tt{gappixels 0}}, in the master.raw file you will read:
\begin{verbatim}
row : 512 pixels
col : 256 pixels
\end{verbatim}
else if {\tt{gappixels 1}}, in the master.raw file you will read:
\begin{verbatim}
row : 514 pixels
col : 257 pixels
\end{verbatim}
\section{Readout timing- maximum frame rate}\label{timing}
IMPORTANT: to have faster readout and smaller dead time, one can configure {\tt{clkdivider}}, i.e. the speed at which the data are read, i.e. 200/100/50~MHz for {\tt{clkdivider 0/1/2}} and the dead time between frames through {\tt{flags parallel}}, i.e. acquire and read at the same time or acquire and then read out.
The configuration of this timing variables allows to achieve different frame rates. NOTE THAT IN EIGER, WHATEVER YOU DO, THE FRAME RATE LIMITATIONS COME FROM THE NETWORK BOTTLENECK AS THE HARDWARE GOES FASTER THAN THE DATA OUT.
In the case of REAL CONTINUOUS readout, i.e. continuous acquire and readout from the boards (independent on how the chip is set), the continuous frame rates are listed in table~\ref{tcont}.
In the case of REAL CONTINUOUS readout, i.e. continuous acquire and readout from the boards (independent on how the chip is set), the continuous frame rates are listed in table~\ref{tcont}. The time to send out the frame out of the board
\begin{table}
\begin{tabular}{|c|c|c|c|}
\begin{tabular}{|c|c|c|c|c|}
\hline
GbE & dynamic range & continuos maximum frame rate(Hz) & minimum period ($\mu$s)\\
\tiny{GbE} & \tiny{dynamic range} & \tiny{continuos maximum frame rate(Hz)} & \tiny{minimum period ($\mu$s)}& \tiny{calculated/measered time to send out data ($\mu$s)}\\
\hline
1 & 16 & \textbf{256} & 3901\\
1 & 16 & \textbf{256} & 3901 & \\
\hline
1 & 32 & \textbf{128} & 7820\\
1 & 32 & \textbf{128} & 7820 & \\
\hline
10 & 16 & \textbf{2560} & 391\\
10 & 4 & \textbf{10240} & 98 & 105/128\\
\hline
10 & 32 & \textbf{1280}& 782\\
10 & 8 & \textbf{5120} & 196 & 210/250\\
\hline
10 & 8 & \textbf{5120} & 196\\
10 & 16 & \textbf{2560} & 391 & 420/490\\
\hline
10 & 4 & \textbf{10240} & 98\\
10 & 32 & \textbf{1280} & 782 & 840/977\\
\hline
\end{tabular}
\caption{Frame rate limits for the CONTINUOS streaming out of images, i.e. the data rate out is just below 1Gb/s or 10Gb/s.}
\caption{Frame rate limits for the CONTINUOS streaming out of images, i.e. the data rate out is just below 1Gb/s or 10Gb/s. 1280~Hz for 32-bit, 10GbE is obtained from the 10GbE limitation. The maximum achievable frame rate is 977~Hz.}
\label{tcont}\end{table}
Note that in the {\tt{continuous}} flag mode, some buffering is still done on the memories, so a higher frame rate than the proper real continuous one can be achieved. Still, this extra buffering is possible till the memories are not saturated. The number of images that can be stored on the DDR2 on board memories are listed in table~\ref{timgs}.
\begin{table}
@ -411,18 +438,9 @@ where the 'minimum time between frames' and the minimum period will be discussed
\hline
4 & 0 & \tiny {parallel} & 3.4 & 22 & 44 & 44.01 & 30k/50k\\
\hline
4 & 1 & \tiny {parallel} & 6 & 10.5 & 92 & 92.02 & 30k/100k\\
\hline
4 & 2 & \tiny {parallel} & 11.2 & 5.4 & 197& 197.01 & infinite\\
\hline
\hline
8 & 0 & \tiny {parallel} & 3.4 & 11.1 & 89 & 89.01 & 15k/24k\\
\hline
8 & 1 & \tiny {parallel} & 6.1 & 5.7 & 181 & 181.01 & 15k/52k\\
\hline
8 & 2 & \tiny {parallel} & 11.2 & 2.9 & 342 & 342.01 & infinite\\
\hline
\hline
16 & 0 & \tiny {parallel} & 3.4 & 6.1 & (126+38)* =164 & 164.02 & 8k/12k\\
\hline
16 & 0 & \tiny {nonparallel} & 127 & 5.6 & (126+52)*= 179 & 179.01& 8k/23k\\
@ -431,14 +449,6 @@ where the 'minimum time between frames' and the minimum period will be discussed
\hline
16 & 1 & \tiny {nonparallel} & 255 & 3.3 & 303 & 303.01 & infinite\\
\hline
16 & 2 & \tiny {parallel} & 11.2 & 1.9 & 526 & 526.2 & infinite \\
\hline
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 ($\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}
@ -449,7 +459,6 @@ where the 'minimum time between frames' and the minimum period will be discussed
\textbf{From software version 4.0.0, there is a very useful function {\tt{sls\_detector\_get measuredperiod}} which return the measured period AFTER the acquisition. This is important to check that the settings to obtain the targeted frame rate was correct.}
\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}
\textrm{new period} = \textrm{exptime} + \textrm{minimum time between frames} + (\textrm{10$-$20 }\mu \textrm{s})
@ -459,7 +468,56 @@ to let the signal settle or, if the frame rate is important, leave the {\tt{pe
\textrm{new exptime} = \textrm{old exptime} - (\textrm{10$-$20 }\mu \textrm{s})
\end{equation}
In general, choose first the desired dead time: this will tell you if you want to run in parallel or non parallel mode, although most likely it is parallel mode. Then, choose the maximum frame rate you want to aim, not exceeding what you aim for not to increase the noise. In 4 and 8 bit modes it makes no sense to run nonparallel as the exposure time is too small compared to the readout time.
In general, choose the maximum frame rate you want to aim, not exceeding what you aim for not to increase the noise. In 4 and 8 bit modes it makes no sense to run nonparallel as the exposure time is too small compared to the readout time.
Here below are the final tables for settting the detcetor correctly:
\begin{itemize}
\item CONTINUOUS redout (imagesnot stored on board memories, frames can be achieved. {\tt{flags parallel}}, {\tt{clkdivider 0}} are always set. In 32-bit no extra {\tt{subdeadtime}} is assumed. The difference between {\tt{exptime}} and {\tt{period}} has to be $\approx$5 $\mu$s:
\begin{center}
\begin{tabular}{ |c| c| }
\hline
max frame rate & settings\\
\hline
\textcolor{red}{189~Hz (977~Hz max)} & \textcolor{red}{32-bit} \\
& Nframes=infinite\\
\hline
\textcolor{red}{2.56 kHz} & \textcolor{red}{16-bit}\\
& Nframes=infinite\\
\hline
\textcolor{red}{5.1 kHz} & \textcolor{red}{8-bit}\\
& Nframes=infinite\\
\hline
\textcolor{red}{10.2 kHz} & \textcolor{red}{4-bit}\\
& Nframes=infinite\\
\hline
\end{tabular}
\end{center}
BE CAREFUL that if you have the transmission delays setup (see sec.~\ref{network}), this will slow down the sending of the data and you risk to fill up the memories of the boards on eiger (30000 images in 4 bit mode) and you will get corrupted data (parts of the memory on the boads will be overwritten).
\item BUFFERED readout (images stored on board memories, such that the maximum frame rate can be achieved for a limited amount of frames. {\tt{flags parallel}}, {\tt{clkdivider 0}} are always set. In 32-bit no extra {\tt{subdeadtime}} is assumed. The difference between {\tt{exptime}} and {\tt{period}} has to be $\approx$5 $\mu$s:
\begin{center}
\begin{tabular}{ |c| c| }
\hline
max frame rate & settings\\
\hline
\textcolor{red}{189~Hz (977~Hz)} & \textcolor{red}{32-bit} \\
& Nframes=infinite\\
\hline
\textcolor{red}{6.1 kHz} & \textcolor{red}{16-bit}\\
& Nframes=7600\\
\hline
\textcolor{red}{11.1 kHz} & \textcolor{red}{8-bit}\\
& Nframes=15000\\
\hline
\textcolor{red}{22 kHz} & \textcolor{red}{4-bit}\\
& Nframes=30000\\
\hline
\end{tabular}
\end{center}
\end{itemize}
\subsubsection{4 and 8 bit mode}
In {\tt{parallel}} mode, the minimum time between frames is due to the time required to latch the values of the counter with capacitors. These values are determined in firmware and they can be estimated as:
@ -497,16 +555,16 @@ The time between 12-bit subframes are listed in table~\ref{t32bitframe}.
\begin{tiny}
\begin{table}
\begin{flushleft}
\begin{tabular}{|c|c|c|c|c|c|}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
\tiny{dr} & \tiny{clkdivider} & \tiny{flags} & \tiny{t difference between subframes($\mu$s)} & \tiny{max internal subframe rate (kHz)} & \tiny{maximum frame rate (Hz)}\\
\tiny{dr} & \tiny{clkdivider} & \tiny{flags} & \tiny{subexptime (s)} & \tiny{t difference between subframes($\mu$s)} & \tiny{max internal subframe rate (kHz)} & \tiny{maximum frame rate (Hz)}\\
\hline
32 & 2 & parallel & 12 & 2 & 170\\
32 & 2 & parallel & 0.00262144 & 12 & 380 & 189\\
\hline
32 & 2 & nonparallel & 504 & $<2$ & 160\\
32 & 2 & parallel & 0.000490 & 12 & 2 & 997\\
\hline
\end{tabular}
\caption{Timing for the 32bit case. The maximum frame rate has been computed assuming 2 subframes of default {\tt{subexptime}} of 2.62144 ms.}
\caption{Timing for the 32bit case. The maximum frame rate has been computed assuming 2 subframes of default {\tt{subexptime}} of 2.62144 ms, which is the default value. By setting up {\tt{subexptime}} to 490~$\mu$s one can achieve a maximum frame rate. Note that one has to leave 490$\mu$s extra between a frame and the following.}
\label{t32bitframe}
\end{flushleft}
\end{table}
@ -561,7 +619,10 @@ 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}}. 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.
\item{\tt{gating}} allows to get a frame only when the trigger pulse is gating. Note that in this case the exp time and period only depend on the gating signal. {\tt{cycles}} allows to select how many gates to consider. Set number of frames to 1 using {\tt{frames}}. IMPORTANT: Up to firmware 23, the last subframe is oblige to finish being taken, despite the gate signal going down. This will be configurable from later fw and software version. Also, in gating mode, due to timimg of the state machine, you need to leave 500~$\mu$s deadtime between the end on an acquisition and the next. This is as the state machine is unable to check for changes in the status in the first 500~$\mu$s. ATTENTION: if you are in 16 bit mode and you are applying online rate corrections, as now the exptime is generated by the trigger, you might not have correct rate corrections. If you know what the exposure time is in the gating signal, then you can set the {\tt{exptime}} once and the rate corrections will be correct. In 32 bit mode, it does not matter as the rate corrections depends on the {\tt{subexptime}} which is software set independently from the gate exptime.
When using 32-bit mode, by default the acquisition ends the last complete subframe that was started when still the acquisition time was valid. This has been chosen as many people wants to know the exact acquisition time for when the detector was taking data and also, if {\tt{ratecorr}} are active, the last subframe will be correctly corrected, while otherwise it will be corrected with a wrong subdeadtime.
However, from 4.1.0, in gating mode, an option to immediately terminate the subframe when the gate signal goes down it is implemented to stop the acquisition at the same time. This option is {\tt{./sls\_detector\_put interruptsubframe 1}} while the default option is {\tt{./sls\_detector\_put interruptsubframe 0}}.
\end{itemize}
@ -576,7 +637,7 @@ 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}.
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}
@ -616,6 +677,19 @@ sls_detector_put 0-ratecorr -1
Every time either the rate corrections are activated, $\tau$ is changed or the subframe length is changed, then a new correction table is evaluated. Note that computing the correction table is time consuming.
Here in figure~\ref{rateplots} you can find typical values of $\tau$ and typical values of the rates for which we have small non linerities (10\% non linearity) as a function of the beam energy.
\begin{figure}[t]
\begin{center}
\includegraphics[width=.7\textwidth]{tauvsE}
\includegraphics[width=.7\textwidth]{Ratecapabilityflux}
\end{center}
\caption{Typical values of the dead time for the detector and safe fluxes as a function of the beam energy}.
\label{rateplots}
\end{figure}
\section{Dependent parameters and limits}
Here is a list of dependent parameters:
\begin{enumerate}
@ -664,7 +738,7 @@ LEDs on the backpanel board at the back of each half module signal:
\subsection{Delays in sending for 1Gb/s, 10Gb/s, 10Gb flow control, receiver fifo}
\subsection{Delays in sending for 1Gb/s, 10Gb/s, 10Gb flow control, receiver fifo}\label{network}
Extremely advanced options allow to:
\begin{itemize}
@ -693,6 +767,7 @@ for X in $(seq 0 4); do ./sls_detector_put $X:txndelay_left $((X*100000)); done
./sls_detector_put txndelay_frame zzzz
\end{verbatim}
In the example before, it would be: {\tt{zzzz}}=4*100000+ 100000
To decide the size of the transmission delays, look at subsection~\ref{delays}.
\item Readjust the size of the fifo of the receiver between listening and writing (useful when writing is limited)
\begin{verbatim}
@ -711,35 +786,132 @@ To activate back a module, do:
\end{verbatim}
\end{itemize}
\subsection{Setting up 10Gb correctly: experience so far}\label{10g}
\section{Choose correct transmission delays}\label{delays}
Transmission delays should be chosen only to accomodate the writing speed of the disk. The 10Gb network should be optimised independently to allow no packet loss situation. This can be done by turning off the writing of the files and check only for missing frames.
Table~\ref{tcont} gives the times that are needed to transfer 1 images out of the 10~Gb Ethernet connection. This reflects the CONTINUOS frame rate achieavable. The disk speed can be monitored with {\tt{dstat}}. One you have worked out this, you can calculated the {\tt{txndelay\_frame}} delay as:
\begin{equation}
{\tt{txndelay\_frame}}=-t_sending+dr \cdot \frac{4*256*256*N\_half\_modules}{1024 \cdot 1000 \cdot disk\_speed [MB/s] \cdot 8}
\end{equation}
In 4-bit mode, for a disk seed of 320MB/s, the {\tt{txndelay\_frame}} is 300~$\mu$s (30000 to be set up to the detector). The sending time is 100~$\mu$s, such that an total ackievable writing speed of 1/400~$\mu$s (2.5~kHz) in achieved.
Note that:
\begin{enumerate}
\item The continuos frame rate goes down when transmission delays are introduced:
\begin{equation}
continuos\_frame\_rate= \frac{1}{\tt{txndelay\_frame}+t\_sending}
\end{equation}
\item If your transmission delays reduce the continuos frame rate, you will saturate the memory on board at some point and you will corrupt images. Conservatively, we say that the number of maximum images in buffered mode is the one listed in table~\ref{timgs}, call N\_images. However, one can approximately say that (and here we need to test more, so do not believe to these numbers yet),
\begin{equation}
N\_tot\_images= N\_images+\frac{ N\_images}{frame\_rate \cdot (t\_delay\_frame + t\_sending) }
\end{equation}
\end{enumerate}
\section{Setting up the PC settings for 10Gb}\label{10g}
For configuring well the 10Gb card not to loose packets,
\begin{itemize}
\item MTU must be set up to 9000 (jumbo frames) on all the involved sides: detector, switch, server NIC
\item you should set up static MAC address tables with separated VLANs
\end{itemize}
As root, also do:
As root, also first check your ethtool settings (-small letter arguments), then change the settings (-capital letter arguments):
\begin{verbatim}
ethtool -G xth1 rx 4096, ethtool -C xth1 rx-usecs 100
ethtool -g xth1
ethtool -c xth1
ethtool -a xth1
\end{verbatim}
where {\tt{xth1}} can be replaced with the correct 10Gb device. To minimise loosing packets, priorities are set better as root user, so have the receiver as root.
To change settings:
\begin{verbatim}
ethtool -G xth1 rx 4096 #or wheterver is the max number for your pc
ethtool -C xth1 rx-usecs 100
ethtool -A xth1 rx on
\end{verbatim}
where {\tt{xth1}} can be replaced with the correct 10Gb device.
NOTE THAT THIS SETTINGS WILL BE LOST IF YOU REBOOT THE COMPUTER.
Very important is to activate the flow control in 10Gb (in 1Gb it is on by default and not configurable)
\begin{verbatim}
./sls_detector_put flowcontrol_10g 1
\end{verbatim}
You ned to check that flow control is setup on the reeceiving interfaces. Check with:
\begin{verbatim}
ethtool -a eth1
\end{verbatim}
.RX should be ON. Set the transmission delays as explained in the manual if necessary. These transmission delays should help matching teh writing speed performance of your disk. You can check how fast you are writing using the {\tt{dstat}} command.
Now setup the computer server propery:
Check the size of:
\begin{verbatim}
sysctl -a | grep backlog
sysctl -a | grep rmem
\end{verbatim}
Set it correctly with:
\begin{verbatim}
sysctl net.core.netdev_max_backlog=250000
sysctl net.core.rmem_default=$((100*1024*1024))
sysctl net.core.rmem_max=$((100*1024*1024))
\end{verbatim}
Other way to setup the same, increase the socket receiving buffer size and the maximum length of the input queue:
\begin{verbatim}
echo $((100*1024*1024)) > /proc/sys/net/core/rmem_max
echo 250000 > /proc/sys/net/core/netdev_max_backlog
\end{verbatim}
to make the settings permanent, edit /etc/sysctl.conf:
\begin{verbatim}
# 100MiB
net.core.rmem_max = 104857600
net.core.rmem_default= 104857600
net.core.netdev_max_backlog = 250000
\end{verbatim}
and run \textbf{sysctl -p}.
To minimise loosing packets, priorities are set better as root user, so have the receiver as root.
To try to bypass being root, we trued something like this:
\begin{verbatim}
/etc/security/limits.conf username rtprio 99
\end{verbatim}
but somehow it did not fully worked so we kept the trick of being root.
Very important is to activate the flow control in 10Gb (in 1Gb it is on by default and not configurable)
Last, you can disable power saving in the CPU frequency (chose the appropriate command for your system):
\begin{verbatim}
./sls_detector_put flowcontrol_10g 1
cpupower frequency-info
cpupower frequency-set -g performance
\end{verbatim}
or
\begin{verbatim}
cpufreq-info
for i in `seq 0 7`; do cpufreq-set -c $i -g performance; done
\end{verbatim}
Set the transmission delays as explained in the manual.
It can help to increase the fifo size of the receiver to {\tt{rx\_fifodepth}} to 1000 images
\begin{verbatim}
./sls_detector_put rx_fifodepth 1000
\end{verbatim}
One needs to keep into account that in 16 bit mode for 1 image we expect each slsReceiver to allocate 0.5MB. So for 1000 images, we expect 500MB memory for each receiver. This can be monitored in Linux with "top" or "free -m".
One needs to keep into account that in 16 bit mode for 1 image we expect each slsReceiver to allocate 0.5MB. So for 1000 images, we expect 500MB memory for each receiver. This can be monitored in Linux with "top" or "free -m". To receive the max number of images possible on the detector, a minimum of 8~GB of memories are required.
For very high frame rate, very long measurements, we had to increase the {\tt{rx\_fifodepth}} to 10000 images but this only in 4, 8, 16 bit mode. In 32 bit mode it will assign 40~GB of memory, which is more than what normal PC would have. So make sure you do not require too much memory.
Last, it is very important that not too many files are created. There is high possibility to loose packets in the time to close and open files for the writer. IN 3.1.x, the default number of images written per file, in Eiger is 2000. This is defined by the line:
\begin{verbatim}
#define EIGER_MAX_FRAMES_PER_FILE 2000
\end{verbatim}
in {\tt{slsDetectorsPackage/slsReceiverSoftware/include/sls\_receiver\_defs.h}}. In 4.0.x, this is interactively defined using the command: {\tt{r\_framesperfile}}. By default it is 10000.
If you do not have a large disk, you can write to memory if your pc is not fast enough:
\begin{verbatim}
mount -t tmpfs none /ramdisk_folder
\end{verbatim}
or
\begin{verbatim}
mount -t tmpfs none /mnt/ramdisk -o size=10G
\end{verbatim}
check how many GB memory you can allocate, to avoid swapping otherwise
\section{Offline processing and monitoring}
@ -778,19 +950,22 @@ If you use the option of writing raw files, you will have a raw file for each UD
The master file is named: {\tt{filename\_master\_0.raw}} and for version ``4.0.0'' of the slsDetectorSoftware looks like:
\begin{verbatim}
Version : 2.0
Version : 4.0
Detector Type : 3
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
nPixelsX : 512 pixels
nPixelsY : 256 pixels
Max Frames Per File : 10000
Total Frames : 3
Exptime (ns) : 10000000
SubExptime (ns) : 2621440
SubPeriod(ns) : 2621440
Period (ns) : 1000000000
Timestamp : Mon Sep 3 09:07:05 2018
Period (ns) : 0
Gap Pixels Enable : 0
Quad Enable : 0
Timestamp : Wed Aug 21 16:30:20 2019
#Frame Header
@ -800,9 +975,9 @@ 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
Row : 2 bytes
Column : 2 bytes
Reserved : 2 bytes
Debug : 4 bytes
Round Robin Number : 2 bytes
Detector Type : 1 byte
@ -815,13 +990,18 @@ Note that if one wants to reconstruct the real time the detector was acquiring
\subsection{Offline image reconstruction}
The offline image reconstruction{\tt{slsImageReconstruction}} is not part of the package anymore. The code is still available doing \\
{\tt{git clone git@git.psi.ch:sls\_detectors\_software/sls\_image\_reconstruction.git slsImageReconstruction}}.
Checkout the {\tt{developer}} branch if in a 3.1.X release or the {\tt{v4.0.0}} branch if in 4.0.X release of the {\tt{slsDetector}} code.
Checkout the {\tt{developer}} branch if in a 3.1.X release, the {\tt{v4.0.0}} branch if in 4.0.X release, or the {\tt{v4.1}} branch if in 4.1.X release of the {\tt{slsDetector}} code.
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.
Note that the number of images per file in the 3.1.X release is hardcoded and needs to match whatever you are using in {\tt{slsDetectorsPackage/slsReceiverSoftware/include/sls\_receiver\_defs.h}}:
\begin{verbatim}
#define EIGER_MAX_FRAMES_PER_FILE 2000
\end{verbatim}
The default is 2000 in the 3.1.X release. The default has been changed to 10000 frm realease 4.0.X and now this is picked up automatically without doing anything.
\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.\\
The cbf executable executable uses the CBFlib-0.9.5 library (downloaded from the web as it downloads 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:
@ -832,7 +1012,7 @@ eg.
{\tt{cbfMaker /scratch/run\_63\_d1\_f000000000000\_3.raw}}\\
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]}}\\
{\tt{cbfMaker [filename] [outdir, def=same as 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 2 ``Eiger'' 0}.\\
@ -876,7 +1056,7 @@ make cbfMaker; make cbfMakerOMNY;
\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.
In case of HDF5 output file, we rely on having the HDF5 1.10.1 library installed and {\tt{HDF5-External-Filter-Plugins}} installed. With HDF5 1.10.3, no need of the external plugings package is needed, but a small modification to the file is needed. 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}
@ -888,7 +1068,7 @@ are not commented out. All other options need to be commented out. Copile the co
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:
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 master o virtual file, uncomment this option:
\begin{verbatim}
#define MASTERVIRTUAL
\end{verbatim}
@ -910,7 +1090,7 @@ The data will be written as TH2D in root format. Edit the {\tt{Makefile}} to poi
\begin{verbatim}
make image
\end{verbatim}
There is no program other executable that alredy keeps into account the geometry for it.
There is no program other executable that already 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.
@ -978,9 +1158,9 @@ 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).
\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 that failure to do this step before may cause the linux on the boards 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;
This is the procedure from a terminal;
\begin{verbatim}
for i in beb111 beb070;
do ssh root@$i killall eigerDetectorServer;
@ -1058,12 +1238,40 @@ 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.
To exit from this pattern noise, just set the threshold 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{(Fast) threshold scans during beam operation}\label{sec:fastthresholdscan}
Occasionally you might need to do threshold scans during your data taking (for example for Laue experiments or to get any spectral information). Setting the threshold in this case would be not optimal as you would change trimbits at every energy and this could give you a ``step'' behaviour. What you could do is to use the
\begin{verbatim}
\item sls_detector_put thresholdnotb 50000
\end{verbatim}
which set the threshold to an energy but does not change trimbits. We suggest that before using this function you load the {\tt{threshold}} at an energy in the middle of your scan range and then change {\tt{thresholdnotb}}.
We have also been requested if we could speed up the threshold scan. At the moment no specific function has been integrated in firmware, but one could use the software trigger option to perform what you need:
\begin{verbatim}
./sls_detector_put exptime 0.01
./sls_detector_put timing trigger
./sls_detector_put enablefwrite 0
./sls_detector_put resetframescaught 0
./sls_detector_put index 0
./sls_detector_put cycles 21
./sls_detector_put receiver start
./sls_detector_put status start
for i in $(seq 0 20);
do
#./sls_detector_put thresholdnotb 5000 ##this is still too slow as it loads the module
./sls_detector_put 0:vrf 3199 #need to know the appropriate vrf at every energy
./sls_detector_put 1:vrf 3199 #need to know the appropriate vrf at every energy
./sls_detector_put status trigger
#sleep 0.005
done
./sls_detector_put receiver stop
./sls_detector_put resetframescaught 0
./sls_detector_put timing auto
\end{verbatim}
\section{Troubleshooting}
\subsection{Cannot successfully finish an acquisition}
@ -1215,7 +1423,7 @@ 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.
There is also an easier way, that is that only the master module will return the real value of the HV. If you have more than 1 detector system, then you will have more than 1 physical master, as the HV needs to be applied to all the systems.
\begin{verbatim}
for i in $(seq 0 36); do sls_detector_put $i:vhighvoltage; done
@ -1225,10 +1433,14 @@ for i in $(seq 0 36); do sls_detector_put $i:vhighvoltage; done
\subsection{'Cannot connect to socket'}
This error is typically due to the detector server not running. For why, see section~\ref{servernot}.
\subsection{Running at low frame rate, the communication to receiver stops}
If running in 32-bit mode (or even in 16-bit mode), if more memory than what your machine can handle is asked for, the receiver process could be terminated by the kernel of your machine. It would loook like you had executed a clean control-c on the receiver executable. This has been the case, when setting up by mistake
\tt{rx\_fifodepth} to 10000 images in 32 bit mode. In 32 bit mode it will assign 40~GB of memory, which is more than what normal PC would have. So make sure you do not require too much memory. The same is tru also for smaller values of {\tt{rx\_fifodepth}} if your machine has not much memory.
\subsection{Detector server is not running}\label{servernot}
The detector server could not be running: either the detector was powered off, or it powered off itself due to too high temperature or, in the case of the 9M, if the waterflow sensor detected no flux and powered it off (the chiller stops occasionally as cSAXS).
If the powering and the temperature are OK, instead, it can be that the firmware version is incompatible to the server version and/or the client software version. So check the consistency of firmware/software/server versions.
If the powering and the temperature are OK, instead, it can be that the firmware version is incompatible to the server version and/or the client software version. In software packages 3.x.y, the eigerDetectorServer was killed automatically. So check the consistency of firmware/software/server versions if using this version of the software. From 4.x.y onwards, the server, if associated to a wrong firmware, does not kill itself.
\subsection{'Acquire has already started' error message}
If you see the client returning the following error message:\\
@ -1239,10 +1451,10 @@ If you see the client returning the following error message:\\
\end{verbatim}
\subsection{There is noise running the detector in 32-bit}
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.
If you are running the detector in 32-bit (autosumming), there might be some noise, particularly at lower threshold 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 readout time.
If are running in {\tt{parallel}} mode, in particular at low threshold 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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -6,9 +6,9 @@ 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/libSlsDetector.a $PREFIX/lib/.
cp build/bin/libSlsReceiver.so $PREFIX/lib/.
cp build/bin/libSlsReceiver.a $PREFIX/lib/.
# cp build/bin/libSlsReceiver.a $PREFIX/lib/.
#Binaries
cp build/bin/sls_detector_acquire $PREFIX/bin/.

View File

@ -1,13 +1,12 @@
package:
name: sls_detector_software
version: 4.0.1
version: 4.1.0
source:
- path: ..
build:
number: 0
number: 1
rpaths:
- lib/
@ -16,8 +15,7 @@ requirements:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- cmake
- qwt 6.*
- qt=4.8.7=7
- qwt 6.1.4=hf484d3e_1001
- zeromq=4.2.5=hfc679d8_5
- pyzmq
- xorg-libx11
@ -52,22 +50,21 @@ requirements:
outputs:
- name: sls_detector_lib
version: 4.0.1
version: 4.1.0
script: copy_lib.sh
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- name: sls_detector_gui
version: 4.0.1
version: 4.1.0
script: copy_gui.sh
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- cmake
- qwt 6.*
- qt=4.8.7=7
- qwt 6.1.4=hf484d3e_1001
- zeromq=4.2.5=hfc679d8_5
- pyzmq
- xorg-libx11
@ -84,6 +81,5 @@ outputs:
- {{ cdt('libxdamage') }} # [linux]
- {{ cdt('libxxf86vm') }} # [linux]
run:
- sls_detector_lib=4.0.1
- qwt 6.*
- qt=4.8.7=7
- sls_detector_lib=4.1.0
- qwt 6.1.4=hf484d3e_1001

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1 @@
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv4.0.2.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: 3c774478681813e451df683e2bc8403b37490323
Revision: 524
Branch: 4.0.1
Repsitory UUID: 98b45b32fd6653fb2758afdc3f804e2a785c504d
Revision: 532
Branch: 4.1.0
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4084
Last Changed Date: 2019-02-07 18:05:28.000000002 +0100 ./src/qTabSettings.cpp
Last Changed Rev: 4141
Last Changed Date: 2019-10-04 09:28:27.000000001 +0200 ./src/qTabSettings.cpp

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "3c774478681813e451df683e2bc8403b37490323"
#define GITREPUUID "98b45b32fd6653fb2758afdc3f804e2a785c504d"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4084
#define GITDATE 0x20190207
#define GITBRANCH "4.0.1"
#define GITREV 0x4141
#define GITDATE 0x20191004
#define GITBRANCH "4.1.0"

View File

@ -690,9 +690,9 @@ void qDetectorMain::ExecuteHelp(QAction *action){
void qDetectorMain::Refresh(int index){
myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
myDet->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG);
qDefs::checkErrorMessage(myDet,"qDetectorMain::Refresh");
//myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
//myDet->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG);
//qDefs::checkErrorMessage(myDet,"qDetectorMain::Refresh");
if(!tabs->isTabEnabled(index))
tabs->setCurrentIndex((index++)<(tabs->count()-1)?index:Measurement);
else{

View File

@ -121,12 +121,24 @@ void qDrawPlot::SetupWidgetWindow(){
nPixelsX = myDet->getTotalNumberOfChannelsInclGapPixels(slsDetectorDefs::X);
nPixelsY = myDet->getTotalNumberOfChannelsInclGapPixels(slsDetectorDefs::Y);
if (detType == slsDetectorDefs::JUNGFRAUCTB) {
switch(detType) {
case slsDetectorDefs::JUNGFRAUCTB:
npixelsy_jctb = (myDet->setTimer(slsDetectorDefs::SAMPLES_JCTB, -1) * 2)/25;// for moench 03
nPixelsX = npixelsx_jctb;
nPixelsY = npixelsy_jctb;
break;
case slsDetectorDefs::EIGER:
if (myDet->setQuad()) {
nPixelsX /= 2;
nPixelsY *= 2;
if (nPixelsX != nPixelsY) {
--nPixelsX;
}
}
break;
default:
break;
}
cout<<"nPixelsX:"<<nPixelsX<<endl;
cout<<"nPixelsY:"<<nPixelsY<<endl;
@ -583,13 +595,29 @@ void qDrawPlot::SetScanArgument(int scanArg){
maxPixelsY = 0;
minPixelsY = 0;
nPixelsX = myDet->getTotalNumberOfChannelsInclGapPixels(slsDetectorDefs::X);
nPixelsY = myDet->getTotalNumberOfChannelsInclGapPixels(slsDetectorDefs::Y);
if (detType == slsDetectorDefs::JUNGFRAUCTB) {
switch(detType) {
case slsDetectorDefs::JUNGFRAUCTB:
npixelsy_jctb = (myDet->setTimer(slsDetectorDefs::SAMPLES_JCTB, -1) * 2)/25;// for moench 03
nPixelsX = npixelsx_jctb;
nPixelsY = npixelsy_jctb;
break;
case slsDetectorDefs::EIGER:
if (myDet->setQuad()) {
nPixelsX /= 2;
nPixelsY *= 2;
if (nPixelsX != nPixelsY) {
--nPixelsX;
}
}
break;
default:
break;
}
cout<<"nPixelsX:"<<nPixelsX<<endl;
cout<<"nPixelsY:"<<nPixelsY<<endl;
//cannot do this in between measurements , so update instantly
if(scanArgument==qDefs::Level0){
@ -1215,7 +1243,6 @@ int qDrawPlot::GetData(detectorData *data,int fIndex, int subIndex){
}else
gainPlotEnable = false;
//recalculating pedestal
if(startPedestalCal){
//start adding frames to get to the pedestal value

View File

@ -69,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

View File

@ -52,6 +52,7 @@
#define CLEANUP_ACQUISITION 0x0000080000000000ULL
#define REGISER_WRITE_READ 0x0000040000000000ULL
#define VERSION_COMPATIBILITY 0x0000020000000000ULL
#define SOME_ERROR 0x0000010000000000ULL
// 0xFFFFFF0000000000ULL
// 0x000000FFFFFFFFFFULL
@ -174,6 +175,10 @@ public:
if(slsErrorMask&VERSION_COMPATIBILITY)
retval.append("Incompatible versions with detector or receiver. Please check log for more details.\n");
if(slsErrorMask&SOME_ERROR)
retval.append("Some error has occurred. Please check log for more details.\n");
if(slsErrorMask&COULD_NOT_CONFIGURE_MAC)

View File

@ -123,6 +123,8 @@ enum detFuncs{
F_CHECK_VERSION, /** < check version compatibility */
F_SOFTWARE_TRIGGER, /** < software trigger */
F_QUAD,
F_INTERRUPT_SUBFRAME,
/* Always append functions hereafter!!! */
/* Always append functions before!!! */

View File

@ -50,6 +50,8 @@
uint32_t Beb_detid = 0;
int Beb_top =0;
int Beb_quadEnable = 0;
int Beb_positions[3] = {0, 0, 0};
@ -1210,16 +1212,38 @@ void Beb_SetDetectorNumber(uint32_t detid) {
printf("detector id %d has been set in udp header\n", detid);
}
int Beb_SetQuad(int val) {
if (val < 0)
return OK;
printf("Setting Quad to %d in Beb\n", val);
Beb_quadEnable = (val == 0 ? 0 : 1);
return Beb_SetDetectorPosition(Beb_positions);
}
int Beb_GetQuad() {
return Beb_quadEnable;
}
int Beb_SetDetectorPosition(int pos[]) {
if(!Beb_activated)
return OK;
cprintf(BLUE,"Got Position values %d %d %d...\n", pos[0],pos[1], pos[2]);
pos[0] = Beb_swap_uint16(pos[0]);
//pos[1] = Beb_swap_uint16(pos[1]);
pos[2] = Beb_swap_uint16(pos[2]);
cprintf(BLUE,"Got Position values [%d %d %d]\n", pos[0], pos[1], pos[2]);
// save positions
Beb_positions[0] = pos[0];
Beb_positions[1] = pos[1];
Beb_positions[2] = pos[2];
// get left and right
int posLeft[3] = {pos[0], Beb_top ? pos[1] : pos[1] + 1, pos[2]};
int posRight[3] = {pos[0], Beb_top ? pos[1] + 1 : pos[1], pos[2]};
if (Beb_quadEnable) {
posRight[0] = 1; // right is next row
posRight[1] = 0; // right same first column
}
int ret = FAIL;
//mapping new memory to read master top module configuration
@ -1233,26 +1257,28 @@ int Beb_SetDetectorPosition(int pos[]) {
uint32_t value = 0;
ret = OK;
// x left
int posval = Beb_swap_uint16(posLeft[0]);
value = Beb_Read32(csp0base, UDP_HEADER_A_LEFT_OFST);
value &= UDP_HEADER_ID_MSK; // to keep previous id value
Beb_Write32(csp0base, UDP_HEADER_A_LEFT_OFST, value | ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK));
Beb_Write32(csp0base, UDP_HEADER_A_LEFT_OFST, value | ((posval << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_A_LEFT_OFST);
if((value & UDP_HEADER_X_MSK) != ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK))
if((value & UDP_HEADER_X_MSK) != ((posval << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK))
ret = FAIL;
// x right
posval = Beb_swap_uint16(posRight[0]);
value = Beb_Read32(csp0base, UDP_HEADER_A_RIGHT_OFST);
value &= UDP_HEADER_ID_MSK; // to keep previous id value
Beb_Write32(csp0base, UDP_HEADER_A_RIGHT_OFST, value | ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK));
Beb_Write32(csp0base, UDP_HEADER_A_RIGHT_OFST, value | ((posval << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_A_RIGHT_OFST);
if((value & UDP_HEADER_X_MSK) != ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK))
if((value & UDP_HEADER_X_MSK) != ((posval << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK))
ret = FAIL;
// y left (column)
// overwriting z anyway, so no need to look at previous z value
int posval = Beb_swap_uint16(Beb_top ? pos[1] : (pos[1]+1));
posval = Beb_swap_uint16(posLeft[1]);
Beb_Write32(csp0base, UDP_HEADER_B_LEFT_OFST, ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_B_LEFT_OFST);
if(value != ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK))
@ -1260,7 +1286,7 @@ int Beb_SetDetectorPosition(int pos[]) {
// y right
// overwriting z anyway, so no need to look at previous z value
posval = Beb_swap_uint16(Beb_top ? (pos[1]+1) : pos[1]);
posval = Beb_swap_uint16(posRight[1]);
Beb_Write32(csp0base, UDP_HEADER_B_RIGHT_OFST, ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_B_RIGHT_OFST);
if(value != ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK))
@ -1269,19 +1295,21 @@ int Beb_SetDetectorPosition(int pos[]) {
// z left
posval = Beb_swap_uint16(posLeft[2]);
value = Beb_Read32(csp0base, UDP_HEADER_B_LEFT_OFST);
value &= UDP_HEADER_Y_MSK; // to keep previous y value
Beb_Write32(csp0base, UDP_HEADER_B_LEFT_OFST, value | ((pos[2] << UDP_HEADER_Z_OFST) & UDP_HEADER_Z_MSK));
Beb_Write32(csp0base, UDP_HEADER_B_LEFT_OFST, value | ((posval << UDP_HEADER_Z_OFST) & UDP_HEADER_Z_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_B_LEFT_OFST);
if((value & UDP_HEADER_Z_MSK) != ((pos[2] << UDP_HEADER_Z_OFST) & UDP_HEADER_Z_MSK))
if((value & UDP_HEADER_Z_MSK) != ((posval << UDP_HEADER_Z_OFST) & UDP_HEADER_Z_MSK))
ret = FAIL;
// z right
posval = Beb_swap_uint16(posRight[2]);
value = Beb_Read32(csp0base, UDP_HEADER_B_RIGHT_OFST);
value &= UDP_HEADER_Y_MSK; // to keep previous y value
Beb_Write32(csp0base, UDP_HEADER_B_RIGHT_OFST, value | ((pos[2] << UDP_HEADER_Z_OFST) & UDP_HEADER_Z_MSK));
Beb_Write32(csp0base, UDP_HEADER_B_RIGHT_OFST, value | ((posval << UDP_HEADER_Z_OFST) & UDP_HEADER_Z_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_B_RIGHT_OFST);
if((value & UDP_HEADER_Z_MSK) != ((pos[2] << UDP_HEADER_Z_OFST) & UDP_HEADER_Z_MSK))
if((value & UDP_HEADER_Z_MSK) != ((posval << UDP_HEADER_Z_OFST) & UDP_HEADER_Z_MSK))
ret = FAIL;
@ -1292,8 +1320,7 @@ int Beb_SetDetectorPosition(int pos[]) {
cprintf(BLUE, "Position set to...\n"
"Left: [%d, %d, %d]\n"
"Right:[%d, %d, %d]\n",
Beb_swap_uint16(pos[0]), Beb_top ? pos[1] : (pos[1]+1), Beb_swap_uint16(pos[2]),
Beb_swap_uint16(pos[0]), Beb_top ? (pos[1]+1) : pos[1], Beb_swap_uint16(pos[2]));
posLeft[0], posLeft[1], posLeft[2], posRight[0], posRight[1], posRight[2]);
}
return ret;

View File

@ -91,6 +91,8 @@ struct BebInfo{
int Beb_GetBebFPGATemp();
void Beb_SetDetectorNumber(uint32_t detid);
int Beb_SetQuad(int val);
int Beb_GetQuad();
int Beb_SetDetectorPosition(int pos[]);
uint16_t Beb_swap_uint16( uint16_t val);

View File

@ -2009,64 +2009,172 @@ int Feb_Control_SoftwareTrigger() {
return 1;
}
int Feb_Control_SetInterruptSubframe(int val) {
printf("Setting Interrupt Subframe to %d\n", val);
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 tr value. Value read:%d\n", value);
value = 0;
// they need to be written separately because the left and right registers have different values for this particular register
uint32_t offset = DAQ_REG_HRDWRE;
uint32_t regVal = 0;
char side[2][10] = {"right", "left"};
char isTop[10]; strcpy(isTop, Module_TopAddressIsValid(&modules[1]) ? "top" : "bottom");
unsigned int addr[2];
addr[0] = Module_TopAddressIsValid(&modules[1]) ? Module_GetTopRightAddress (&modules[1]) : Module_GetBottomRightAddress (&modules[1]);
addr[1] = Module_TopAddressIsValid(&modules[1]) ? Module_GetTopLeftAddress (&modules[1]) : Module_GetBottomLeftAddress (&modules[1]);
int iloop = 0;
for(iloop = 0; iloop < 2; ++iloop) {
// get previous value to keep it
if(!Feb_Interface_ReadRegister(addr[iloop], offset, &regVal)) {
cprintf(RED, "Could not read %s %s interrupt subframe\n", isTop, side[iloop]);
return 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;
uint32_t data = ((val == 0) ? (regVal &~ DAQ_REG_HRDWRE_INTRRPT_SF_MSK) : (regVal | DAQ_REG_HRDWRE_INTRRPT_SF_MSK));
if(!Feb_Interface_WriteRegister(addr[iloop], offset, data, 0, 0)) {
cprintf(RED, "Could not write 0x%x to %s %s interrupt subframe addr 0x%x\n", data, isTop, side[iloop], offset);
return 0;
}
}
return 1;
}
} else {
if(!Feb_Interface_WriteRegister(Module_GetBottomRightAddress (&modules[1]),offset, data,0, 0)) {
cprintf(RED,"Could not read br value. Value read:%d\n", value);
value = 0;
int Feb_Control_GetInterruptSubframe() {
// they need to be written separately because the left and right registers have different values for this particular register
uint32_t offset = DAQ_REG_HRDWRE;
uint32_t regVal = 0;
char side[2][10] = {"right", "left"};
char isTop[10]; strcpy(isTop, Module_TopAddressIsValid(&modules[1]) ? "top" : "bottom");
unsigned int addr[2];
addr[0] = Module_TopAddressIsValid(&modules[1]) ? Module_GetTopRightAddress (&modules[1]) : Module_GetBottomRightAddress (&modules[1]);
addr[1] = Module_TopAddressIsValid(&modules[1]) ? Module_GetTopLeftAddress (&modules[1]) : Module_GetBottomLeftAddress (&modules[1]);
uint32_t value[2] = {0, 0};
int iloop = 0;
for(iloop = 0; iloop < 2; ++iloop) {
if(!Feb_Interface_ReadRegister(addr[iloop], offset, &regVal)) {
cprintf(RED, "Could not read back %s %s interrupt subframe\n", isTop, side[iloop]);
return -1;
}
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;
value[iloop] = (regVal & DAQ_REG_HRDWRE_INTRRPT_SF_MSK) >> DAQ_REG_HRDWRE_INTRRPT_SF_OFST;
}
// inconsistent
if (value[0] != value[1]) {
cprintf(RED, "Inconsistent values of interrupt subframe betweeen left %d and right %d\n", value[0], value[1]);
return -1;
}
return Feb_Control_ReadRegister(offset);
return value[0];
}
int Feb_Control_SetQuad(int val) {
// no bottom for quad
if (!Module_TopAddressIsValid(&modules[1])) {
return 1;
}
uint32_t offset = DAQ_REG_HRDWRE;
printf("Setting Quad to %d in Feb\n", val);
unsigned int addr = Module_GetTopRightAddress (&modules[1]);
uint32_t regVal = 0;
if(!Feb_Interface_ReadRegister(addr, offset, &regVal)) {
cprintf(RED, "Could not read top right quad reg\n");
return 0;
}
uint32_t data = ((val == 0) ? (regVal &~ DAQ_REG_HRDWRE_OW_MSK) : ((regVal | DAQ_REG_HRDWRE_OW_MSK) &~ DAQ_REG_HRDWRE_TOP_MSK));
if(!Feb_Interface_WriteRegister(addr, offset, data, 0, 0)) {
cprintf(RED, "Could not write 0x%x to top right quad addr 0x%x\n", data, offset);
return 0;
}
return 1;
}
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;
}
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;
int Feb_Control_WriteRegister(uint32_t offset, uint32_t data) {
uint32_t actualOffset = offset;
char side[2][10] = {"right", "left"};
char isTop[10]; strcpy(isTop, Module_TopAddressIsValid(&modules[1]) ? "top" : "bottom");
unsigned int addr[2];
addr[0] = Module_TopAddressIsValid(&modules[1]) ? Module_GetTopRightAddress (&modules[1]) : Module_GetBottomRightAddress (&modules[1]);
addr[1] = Module_TopAddressIsValid(&modules[1]) ? Module_GetTopLeftAddress (&modules[1]) : Module_GetBottomLeftAddress (&modules[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;
int run[2] = {0, 0};
// both registers
if (offset < 0x100) {
run[0] = 1;
run[1] = 1;
}
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;
// right registers only
else if (offset >= 0x200) {
run[0] = 1;
actualOffset = offset - 0x200;
}
printf("Read bottom left addr: 0x%08x\n", value1);
if (value != value1)
value = -1;
// left registers only
else {
run[1] = 1;
actualOffset = offset - 0x100;
}
return value;
int iloop = 0;
for(iloop = 0; iloop < 2; ++iloop) {
if(run[iloop]) {
printf("Writing 0x%x to %s %s 0x%x\n", data, isTop, side[iloop], actualOffset);
if(!Feb_Interface_WriteRegister(addr[iloop],actualOffset, data, 0, 0)) {
cprintf(RED, "Could not write 0x%x to %s %s addr 0x%x\n", data, isTop, side[iloop], actualOffset);
return 0;
}
}
}
return 1;
}
int Feb_Control_ReadRegister(uint32_t offset, uint32_t* retval) {
uint32_t actualOffset = offset;
char side[2][10] = {"right", "left"};
char isTop[10]; strcpy(isTop, Module_TopAddressIsValid(&modules[1]) ? "top" : "bottom");
unsigned int addr[2];
addr[0] = Module_TopAddressIsValid(&modules[1]) ? Module_GetTopRightAddress (&modules[1]) : Module_GetBottomRightAddress (&modules[1]);
addr[1] = Module_TopAddressIsValid(&modules[1]) ? Module_GetTopLeftAddress (&modules[1]) : Module_GetBottomLeftAddress (&modules[1]);
uint32_t value[2] = {0, 0};
int run[2] = {0, 0};
// both registers
if (offset < 0x100) {
run[0] = 1;
run[1] = 1;
}
// right registers only
else if (offset >= 0x200) {
run[0] = 1;
actualOffset = offset - 0x200;
}
// left registers only
else {
run[1] = 1;
actualOffset = offset - 0x100;
}
int iloop = 0;
for(iloop = 0; iloop < 2; ++iloop) {
if(run[iloop]) {
if(!Feb_Interface_ReadRegister(addr[iloop],actualOffset, &value[iloop])) {
cprintf(RED, "Could not read from %s %s addr 0x%x\n", isTop, side[iloop], actualOffset);
return 0;
}
printf("Read 0x%x from %s %s 0x%x\n", value[iloop], isTop, side[iloop], actualOffset);
*retval = value[iloop];
// if not the other (left, not right OR right, not left), return the value
if (!run[iloop ? 0 : 1]) {
return 1;
}
}
}
// Inconsistent values
if (value[0] != value[1]) {
cprintf(RED, "Inconsistent values read from left 0x%x and right 0x%x\n", value[0], value[1]);
return 0;
}
return 1;
}

View File

@ -204,7 +204,10 @@ int Feb_Control_GetModuleNumber();
int64_t Feb_Control_GetSubMeasuredPeriod();
int Feb_Control_SoftwareTrigger();
int Feb_Control_SetInterruptSubframe(int val);
int Feb_Control_GetInterruptSubframe();
int Feb_Control_SetQuad(int val);
uint32_t Feb_Control_WriteRegister(uint32_t offset, uint32_t data);
uint32_t Feb_Control_ReadRegister(uint32_t offset);
int Feb_Control_WriteRegister(uint32_t offset, uint32_t data);
int Feb_Control_ReadRegister(uint32_t offset, uint32_t* retval);
#endif

View File

@ -20,8 +20,16 @@
#define DAQ_REG_SUBFRAME_EXPOSURES 6
#define DAQ_REG_SUBFRAME_PERIOD 7 //also pg and fifo status register
#define DAQ_REG_HRDWRE 12
#define DAQ_REG_RO_OFFSET 12
#define DAQ_REG_HRDWRE_OW_OFST (0)
#define DAQ_REG_HRDWRE_OW_MSK (0x00000001 << DAQ_REG_HRDWRE_OW_OFST)
#define DAQ_REG_HRDWRE_TOP_OFST (1)
#define DAQ_REG_HRDWRE_TOP_MSK (0x00000001 << DAQ_REG_HRDWRE_TOP_OFST)
#define DAQ_REG_HRDWRE_INTRRPT_SF_OFST (2)
#define DAQ_REG_HRDWRE_INTRRPT_SF_MSK (0x00000001 << DAQ_REG_HRDWRE_INTRRPT_SF_OFST)
#define DAQ_REG_RO_OFFSET 20
#define DAQ_REG_STATUS (DAQ_REG_RO_OFFSET + 0) //also pg and fifo status register
#define FEB_REG_STATUS (DAQ_REG_RO_OFFSET + 3)
#define MEAS_SUBPERIOD_REG (DAQ_REG_RO_OFFSET + 4)
@ -29,6 +37,7 @@
#define DAQ_CTRL_RESET 0x80000000
#define DAQ_CTRL_START 0x40000000
#define ACQ_CTRL_START 0x50000000 //this is 0x10000000 (acq) | 0x40000000 (daq)

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: ef3e01b9bdf3a6a08367e2448bcc92bd13cf73ad
Revision: 351
Branch: 4.0.1-rc
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4068
Last Changed Date: 2019-02-06 14:44:47.000000002 +0100 ./xparameters.h
Repsitory UUID: e4645a8273c8265bc584579d5f7f8eb6dc4379f7
Revision: 360
Branch: 4.1.0-rc
Last Changed Author: GitHub_GitHub
Last Changed Rev: 4138
Last Changed Date: 2019-10-04 09:28:27.000000001 +0200 ./xparameters.h

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "ef3e01b9bdf3a6a08367e2448bcc92bd13cf73ad"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4068
#define GITDATE 0x20190206
#define GITBRANCH "4.0.1-rc"
#define GITREPUUID "e4645a8273c8265bc584579d5f7f8eb6dc4379f7"
#define GITAUTH "GitHub_GitHub"
#define GITREV 0x4138
#define GITDATE 0x20191004
#define GITBRANCH "4.1.0-rc"

View File

@ -10,11 +10,11 @@
#endif
#include "slsDetectorFunctionList.h"
#ifndef VIRTUAL
#include "versionAPI.h"
#include "gitInfoEiger.h"
#ifndef VIRTUAL
#include "FebControl.h"
#include "Beb.h"
#include "versionAPI.h"
#endif
int default_tau_from_file= -1;
@ -200,10 +200,7 @@ void checkFirmwareCompatibility(int flag){
/* Ids */
int64_t getDetectorId(enum idMode arg){
#ifdef VIRTUAL
return 0;
#else
int64_t retval = -1;
int64_t retval = 0;
switch(arg){
case DETECTOR_SERIAL_NUMBER:
@ -212,7 +209,9 @@ int64_t getDetectorId(enum idMode arg){
case DETECTOR_FIRMWARE_VERSION:
return (int64_t)getFirmwareVersion();
case SOFTWARE_FIRMWARE_API_VERSION:
#ifndef VIRTUAL
return (int64_t)Beb_GetFirmwareSoftwareAPIVersion();
#endif
case DETECTOR_SOFTWARE_VERSION:
return (GITDATE & 0xFFFFFF);
case CLIENT_SOFTWARE_API_VERSION:
@ -220,9 +219,7 @@ int64_t getDetectorId(enum idMode arg){
default:
break;
}
return retval;
#endif
}
u_int64_t getFirmwareVersion() {
@ -486,19 +483,25 @@ void setupDetector() {
/* advanced read/write reg */
uint32_t writeRegister(uint32_t offset, uint32_t data) {
int writeRegister(uint32_t offset, uint32_t data) {
#ifdef VIRTUAL
return 0;
return OK;
#else
return Feb_Control_WriteRegister(offset, data);
if(!Feb_Control_WriteRegister(offset, data)) {
return FAIL;
}
return OK;
#endif
}
uint32_t readRegister(uint32_t offset) {
int readRegister(uint32_t offset, uint32_t* retval) {
#ifdef VIRTUAL
return 0;
return OK;
#else
return Feb_Control_ReadRegister(offset);
if(!Feb_Control_ReadRegister(offset, retval)) {
return FAIL;
}
return OK;
#endif
}
@ -1220,6 +1223,47 @@ int setDetectorPosition(int pos[]) {
int setQuad(int value) {
if (value < 0)
return OK;
#ifndef VIRTUAL
if (Beb_SetQuad(value) == FAIL) {
return FAIL;
}
if (!Feb_Control_SetQuad(value)) {
return FAIL;
}
#endif
return OK;
}
int getQuad() {
#ifdef VIRTUAL
return 0;
#else
return Beb_GetQuad();
#endif
}
int setInterruptSubframe(int value) {
if(value < 0)
return FAIL;
#ifndef VIRTUAL
if(!Feb_Control_SetInterruptSubframe(value)) {
return FAIL;
}
#endif
return OK;
}
int getInterruptSubframe() {
#ifdef VIRTUAL
return 0;
#else
return Feb_Control_GetInterruptSubframe();
#endif
}
/* eiger specific - iodelay, 10g, pulse, rate, temp, activate, delay nw parameter */

View File

@ -12,7 +12,7 @@
#include <stdint.h>
#define GOODBYE (-200)
#define REQUIRED_FIRMWARE_VERSION (22)
#define REQUIRED_FIRMWARE_VERSION (24)
#define IDFILECOMMAND "more /home/root/executables/detid.txt"
#define STATUS_IDLE 0

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: 3c774478681813e451df683e2bc8403b37490323
Revision: 2071
Branch: 4.0.1
Repsitory UUID: 98b45b32fd6653fb2758afdc3f804e2a785c504d
Revision: 2094
Branch: 4.1.0
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4084
Last Changed Date: 2019-02-08 17:25:57.000000002 +0100 ./threadFiles/ThreadPool.o
Last Changed Rev: 4141
Last Changed Date: 2019-10-04 10:33:35.000000001 +0200 ./threadFiles/ThreadPool.o

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: 2f11681d3f2bd2e437cd23fa28dc618dbbd39c68
Revision: 247
Branch: 4.0.1-rc
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4057
Last Changed Date: 2019-02-01 11:47:52.000000002 +0100 ./firmware_funcs.c
Repsitory UUID: 4f4de15d3a55dc043775050cf5f0521934e2c9ce
Revision: 250
Branch: 4.0.2-rc
Last Changed Author: Erik_Frojdh
Last Changed Rev: 4106
Last Changed Date: 2019-06-12 14:40:26.000000002 +0200 ./.target-makefrag

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "2f11681d3f2bd2e437cd23fa28dc618dbbd39c68"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4057
#define GITDATE 0x20190201
#define GITBRANCH "4.0.1-rc"
#define GITREPUUID "4f4de15d3a55dc043775050cf5f0521934e2c9ce"
#define GITAUTH "Erik_Frojdh"
#define GITREV 0x4106
#define GITDATE 0x20190612
#define GITBRANCH "4.0.2-rc"

View File

@ -1692,7 +1692,7 @@ int set_settings(int file_des) {
printf("Warning: %s",mess);
}
else {
else if (isett != GET_SETTINGS){
ret = setDefaultDacs();
if (ret == FAIL) {
strcpy(mess,"Could change settings, but could not set to default dacs\n");

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: f747c908dc4ece72acd29e5b677049b44e5b7da4
Revision: 167
Branch: 4.0.1-rc
Repsitory UUID: 74c08cd74240c08b395c9acf8897d5254839d9c3
Revision: 172
Branch: 4.1.0-rc
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4049
Last Changed Date: 2019-01-07 11:38:36.000000002 +0100 ./RegisterDefs.h
Last Changed Rev: 4140
Last Changed Date: 2019-10-04 09:28:27.000000001 +0200 ./RegisterDefs.h

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "f747c908dc4ece72acd29e5b677049b44e5b7da4"
#define GITREPUUID "74c08cd74240c08b395c9acf8897d5254839d9c3"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4049
#define GITDATE 0x20190107
#define GITBRANCH "4.0.1-rc"
#define GITREV 0x4140
#define GITDATE 0x20191004
#define GITBRANCH "4.1.0-rc"

View File

@ -1313,14 +1313,17 @@ int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t
int setDetectorPosition(int pos[]) {
int ret = OK;
bus_w(COORD_0_REG, bus_r(COORD_0_REG) & (~COORD_0_X_MSK));
bus_w(COORD_0_REG, bus_r(COORD_0_REG) | ((pos[0] << COORD_0_X_OFST) & COORD_0_X_MSK));
if ((bus_r(COORD_0_REG) & COORD_0_X_MSK) != ((pos[0] << COORD_0_X_OFST) & COORD_0_X_MSK))
ret = FAIL;
bus_w(COORD_0_REG, bus_r(COORD_0_REG) & (~COORD_0_Y_MSK));
bus_w(COORD_0_REG, bus_r(COORD_0_REG) | ((pos[1] << COORD_0_Y_OFST) & COORD_0_Y_MSK));
if ((bus_r(COORD_0_REG) & COORD_0_Y_MSK) != ((pos[1] << COORD_0_Y_OFST) & COORD_0_Y_MSK))
ret = FAIL;
bus_w(COORD_1_REG, bus_r(COORD_1_REG) & (~COORD_0_Z_MSK));
bus_w(COORD_1_REG, bus_r(COORD_1_REG) | ((pos[2] << COORD_0_Z_OFST) & COORD_0_Z_MSK));
if ((bus_r(COORD_1_REG) & COORD_0_Z_MSK) != ((pos[2] << COORD_0_Z_OFST) & COORD_0_Z_MSK))
ret = FAIL;

View File

@ -3907,9 +3907,11 @@ int multiSlsDetector::resetFPGA() {
int multiSlsDetector::powerChip(int ival) {
int ret = OK, ret1 = OK;
for (unsigned int i = 0; i < detectors.size(); ++i) {
ret = detectors[i]->powerChip(ival);
// 1s sleep per module for large systems
if(ival >=0 && detectors.size() > 3)
usleep(1000 * 1000);
if (detectors[i]->getErrorMask())
setErrorMask(getErrorMask() | (1 << i));
if (ret == FAIL)
@ -4981,17 +4983,13 @@ int multiSlsDetector::createReceivingDataSockets(const bool destroy) {
}
void multiSlsDetector::readFrameFromReceiver() {
int nX = thisMultiDetector->numberOfDetector[X]; // to copy data in multi module
int nY = thisMultiDetector->numberOfDetector[Y]; // for eiger, to reverse the data
int nX = 0;
int nY = 0;
int nDetPixelsX = 0;
int nDetPixelsY = 0;
bool gappixelsenable = false;
bool quadEnable = false;
bool eiger = false;
if (getDetectorsType() == EIGER) {
eiger = true;
nX *= 2;
gappixelsenable = detectors[0]->enableGapPixels(-1) >= 1 ? true : false;
}
bool runningList[zmqSocket.size()], connectList[zmqSocket.size()];
int numRunning = 0;
for (unsigned int i = 0; i < zmqSocket.size(); ++i) {
@ -5066,6 +5064,16 @@ void multiSlsDetector::readFrameFromReceiver() {
// shape
nPixelsX = doc["shape"][0].GetUint();
nPixelsY = doc["shape"][1].GetUint();
// detector shape
nX = doc["detshape"][0].GetUint();
nY = doc["detshape"][1].GetUint();
nDetPixelsX = nX * nPixelsX;
nDetPixelsY = nY * nPixelsY;
// det type
eiger = (doc["detType"].GetUint() == (int)EIGER) ? true : false;
// gap pixels enable
gappixelsenable = (doc["gappixels"].GetUint() == 0) ? false : true;
quadEnable = (doc["quad"].GetUint() == 0) ? false : true;
#ifdef VERBOSE
cprintf(BLUE, "(Debug) One Time Header Info:\n"
@ -5074,9 +5082,14 @@ void multiSlsDetector::readFrameFromReceiver() {
"dynamicRange: %u\n"
"bytesPerPixel: %f\n"
"nPixelsX: %u\n"
"nPixelsY: %u\n",
"nPixelsY: %u\n"
"nX: %u\n"
"nY: %u\n"
"eiger: %d\n"
"gappixelsenable: %d\n"
"quadEnable: %d\n",
size, multisize, dynamicRange, bytesPerPixel,
nPixelsX, nPixelsY);
nPixelsX, nPixelsY, nX, nY, eiger, gappixelsenable, quadEnable);
#endif
}
// each time, parse rest of header
@ -5144,22 +5157,32 @@ void multiSlsDetector::readFrameFromReceiver() {
}
}
}
#ifdef VERBOSE
cprintf(BLUE,"nPixelsX:%d, nPixelsY:%d nx:%d ny:%d quadEnable:%d\n", nDetPixelsX, nDetPixelsY, nX, nY, quadEnable);
#endif
//send data to callback
if (data) {
// 4bit gap pixels
if (dynamicRange == 4 && gappixelsenable) {
int n = processImageWithGapPixels(multiframe, multigappixels);
nPixelsX = thisMultiDetector->numberOfChannelInclGapPixels[X];
nPixelsY = thisMultiDetector->numberOfChannelInclGapPixels[Y];
if (quadEnable) {
nDetPixelsX += 2;
nDetPixelsY += 2;
} else {
nDetPixelsX = nX * (nPixelsX + 3);
nDetPixelsY = nY * (nPixelsY + 1);
}
#ifdef VERBOSE
cprintf(RED,"Corrected nPixelsX:%d, nPixelsY:%d quadEnable:%d\n", nDetPixelsX, nDetPixelsY, quadEnable);
#endif
int n = processImageWithGapPixels(multiframe, multigappixels, quadEnable);
thisData = new detectorData(NULL, NULL, NULL, getCurrentProgress(),
currentFileName.c_str(), nPixelsX, nPixelsY,
currentFileName.c_str(), nDetPixelsX, nDetPixelsY,
multigappixels, n, dynamicRange, currentFileIndex);
}
// normal pixels
else {
thisData = new detectorData(NULL, NULL, NULL, getCurrentProgress(),
currentFileName.c_str(), nPixelsX, nPixelsY,
currentFileName.c_str(), nDetPixelsX, nDetPixelsY,
multiframe, multisize, dynamicRange, currentFileIndex);
}
dataReady(thisData, currentFrameIndex,
@ -5203,14 +5226,23 @@ void multiSlsDetector::readFrameFromReceiver() {
delete[] multigappixels;
}
int multiSlsDetector::processImageWithGapPixels(char* image, char*& gpImage) {
// eiger 4 bit mode
int multiSlsDetector::processImageWithGapPixels(char* image, char*& gpImage, bool quadEnable) {
// eiger 4 bit mode (divided by 2 already)
int nxb = thisMultiDetector->numberOfDetector[X] * (512 + 3);
int nyb = thisMultiDetector->numberOfDetector[Y] * (256 + 1);
int gapdatabytes = nxb * nyb;
int nchipInRow = 4;
int nxchip = thisMultiDetector->numberOfDetector[X] * 4;
int nychip = thisMultiDetector->numberOfDetector[Y] * 1;
if (quadEnable) {
nxb = thisMultiDetector->numberOfDetector[X] * (256 + 1);
nyb = thisMultiDetector->numberOfDetector[Y] * (512 + 2);
nxchip /= 2;
nychip *= 2;
nchipInRow /= 2;
}
int gapdatabytes = nxb * nyb;
// allocate
if (gpImage == NULL)
@ -5226,13 +5258,13 @@ int multiSlsDetector::processImageWithGapPixels(char* image, char*& gpImage) {
// copying line by line
src = image;
dst = gpImage;
for (int row = 0; row < nychip; ++row) { // for each chip in a row
for (int row = 0; row < nychip; ++row) { // for each chip row
for (int ichipy = 0; ichipy < b1chipy; ++ichipy) { //for each row in a chip
for (int col = 0; col < nxchip; ++col) {
for (int col = 0; col < nxchip; ++col) { // for each chip in a row
memcpy(dst, src, b1chipx);
src += b1chipx;
dst += b1chipx;
if ((col + 1) % 4)
if ((col + 1) % nchipInRow) // 1, 2, and 3rd chip, skip gap pixels
++dst;
}
}
@ -5245,11 +5277,11 @@ int multiSlsDetector::processImageWithGapPixels(char* image, char*& gpImage) {
uint8_t temp, g1, g2;
int mod;
dst = gpImage;
for (int row = 0; row < nychip; ++row) { // for each chip in a row
for (int row = 0; row < nychip; ++row) { // for each chip row
for (int ichipy = 0; ichipy < b1chipy; ++ichipy) { //for each row in a chip
for (int col = 0; col < nxchip; ++col) {
for (int col = 0; col < nxchip; ++col) { // for each chip in a row
dst += b1chipx;
mod = (col + 1) % 4;
mod = (col + 1) % nchipInRow; // 1, 2, and 3rd chip, get gap pixels
// copy gap pixel(chip 0, 1, 2)
if (mod) {
// neighbouring gap pixels to left
@ -5281,7 +5313,7 @@ int multiSlsDetector::processImageWithGapPixels(char* image, char*& gpImage) {
uint8_t temp, g1, g2;
char* dst_prevline = 0;
dst = gpImage;
for (int row = 0; row < nychip; ++row) { // for each chip in a row
for (int row = 0; row < nychip; ++row) { // for each chip row
dst += (b1chipy * nxb);
// horizontal copying of gap pixels from neighboring past line (bottom parts)
if (row < nychip - 1) {
@ -5426,3 +5458,13 @@ int multiSlsDetector::setCTBPatWaitAddr(int level, int addr) {
int multiSlsDetector::setCTBPatWaitTime(int level, uint64_t t) {
return callDetectorMember(&slsDetector::setCTBPatWaitTime, level, t);
}
int multiSlsDetector::setQuad(int val) {
if (getNumberOfDetectors() > 1)
val = 0;
return callDetectorMember(&slsDetector::setQuad, val);
}
int multiSlsDetector::setInterruptSubframe(int val) {
return callDetectorMember(&slsDetector::setInterruptSubframe, val);
}

View File

@ -1869,6 +1869,20 @@ public:
*/
int setCTBPatWaitTime(int level, uint64_t t=-1);
/**
* Set or Get Quad Type (Only for Eiger Quad detector hardware)
* @param val 1 if quad type set, else 0, -1 gets
* @returns 1 if quad type set, else 0
*/
int setQuad(int val = -1);
/**
* Set or Get Interrupt last sub frame(Only for Eiger)
* @param val 1 if interrupt last subframe set, else 0, -1 gets
* @returns 1 if interrupt last subframe set, else 0, -1 different values
*/
int setInterruptSubframe(int val = -1);
private:
/**
@ -1912,9 +1926,10 @@ private:
* add gap pixels to the image (only for Eiger in 4 bit mode)
* @param image pointer to image without gap pixels
* @param gpImage poiner to image with gap pixels, if NULL, allocated inside function
* @param quadEnable quad enabled
* @returns number of data bytes of image with gap pixels
*/
int processImageWithGapPixels(char* image, char*& gpImage);
int processImageWithGapPixels(char* image, char*& gpImage, bool quadEnable);
/** Multi detector Id */

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "3c774478681813e451df683e2bc8403b37490323"
#define GITREPUUID "98b45b32fd6653fb2758afdc3f804e2a785c504d"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4084
#define GITDATE 0x20190208
#define GITBRANCH "4.0.1"
#define GITREV 0x4141
#define GITDATE 0x20191004
#define GITBRANCH "4.1.0"

View File

@ -752,6 +752,7 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
thisDetector->activated = true;
thisDetector->receiver_deactivatedPaddingEnable = true;
thisDetector->receiver_silentMode = false;
thisDetector->quadEnable = false;
// get the detector parameters based on type
detParameterList detlist;
@ -2367,6 +2368,12 @@ int slsDetector::updateDetectorNoWait() {
getTotalNumberOfChannels();
}
if(thisDetector->myDetectorType == EIGER){
n += controlSocket->ReceiveDataOnly( &nm,sizeof(int32_t));
thisDetector->quadEnable = nm;
}
if (!n)
printf("n: %d\n", n);
@ -4959,6 +4966,7 @@ uint32_t slsDetector::clearBit(uint32_t addr, int n) {
string slsDetector::setNetworkParameter(networkParameter index, string value) {
int i;
uint64_t i64 = -1;
switch (index) {
case DETECTOR_MAC:
return setDetectorMAC(value);
@ -5000,8 +5008,8 @@ string slsDetector::setNetworkParameter(networkParameter index, string value) {
case ADDITIONAL_JSON_HEADER:
return setAdditionalJsonHeader(value);
case RECEIVER_UDP_SCKT_BUF_SIZE:
sscanf(value.c_str(),"%d",&i);
setReceiverUDPSocketBufferSize(i);
sscanf(value.c_str(),"%ld",&i64);
setReceiverUDPSocketBufferSize(i64);
return getReceiverUDPSocketBufferSize();
default:
@ -5109,7 +5117,7 @@ string slsDetector::getReceiverRealUDPSocketBufferSize() {
int fnum=F_RECEIVER_REAL_UDP_SOCK_BUF_SIZE;
int ret = FAIL;
int retval = -1;
int64_t retval = -1;
if(thisDetector->receiverOnlineFlag == ONLINE_FLAG){
#ifdef VERBOSE
@ -5305,6 +5313,9 @@ string slsDetector::setReceiver(string receiverIP) {
if(thisDetector->myDetectorType == GOTTHARD)
sendROI(-1, NULL);
if (thisDetector->myDetectorType == EIGER) {
setQuad(-1);
}
}
}
@ -5591,12 +5602,12 @@ string slsDetector::setAdditionalJsonHeader(string jsonheader) {
}
string slsDetector::setReceiverUDPSocketBufferSize(int udpsockbufsize) {
string slsDetector::setReceiverUDPSocketBufferSize(uint64_t udpsockbufsize) {
int fnum=F_RECEIVER_UDP_SOCK_BUF_SIZE;
int ret = FAIL;
int retval = -1;
int arg = udpsockbufsize;
int64_t retval = -1;
int64_t arg = udpsockbufsize;
if(thisDetector->receiverOnlineFlag == ONLINE_FLAG){
#ifdef VERBOSE
@ -9755,5 +9766,83 @@ int slsDetector::setCTBPatWaitTime(int level, uint64_t t) {
}
int slsDetector::setQuad(int val) {
int fnum = F_QUAD, fnum2 = F_RECEIVER_QUAD;
int ret = FAIL;
int retval = -1;
#ifdef VERBOSE
std::cout<<"Setting Quad to " <<val << std::endl;
#endif
// set row column header in detector
if (val >= 0) {
if (thisDetector->onlineFlag==ONLINE_FLAG) {
if (connectControl() == OK){
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
controlSocket->SendDataOnly(&val,sizeof(val));
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
if (ret==FAIL){
char mess[MAX_STR_LENGTH] = {};
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
std::cout<< "Detector returned error: " << mess << std::endl;
setErrorMask((getErrorMask())|(SOME_ERROR));
}
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
thisDetector->quadEnable = retval;
disconnectControl();
if (ret==FORCE_UPDATE)
updateDetector();
}
}
} else
ret = OK;
// set quad type to receiver (flipped data and detector shape, numdet)
if (ret != FAIL) {
ret = FAIL;
if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){
if(val ==-1) {
val = thisDetector->quadEnable;
}
#ifdef VERBOSE
std::cout<< "Setting Receiver Quad Mode to " << val << endl;
#endif
if (connectData() == OK){
ret=thisReceiver->sendInt(fnum2,retval,val);
disconnectData();
}
if(ret==FAIL)
setErrorMask((getErrorMask())|(RECEIVER_PARAMETER_NOT_SET));
}
}
return retval;
}
int slsDetector::setInterruptSubframe(int val) {
int fnum = F_INTERRUPT_SUBFRAME;
int ret = FAIL;
int retval = -1;
#ifdef VERBOSE
std::cout<<"Setting Interrupt Sub frame to " <<val << std::endl;
#endif
if (thisDetector->onlineFlag==ONLINE_FLAG) {
if (connectControl() == OK){
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
controlSocket->SendDataOnly(&val,sizeof(val));
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
if (ret==FAIL){
char mess[MAX_STR_LENGTH] = {};
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
std::cout<< "Detector returned error: " << mess << std::endl;
setErrorMask((getErrorMask())|(SOME_ERROR));
}
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
disconnectControl();
if (ret==FORCE_UPDATE)
updateDetector();
}
}
return retval;
}

View File

@ -19,7 +19,7 @@ class multiSlsDetector;
class SharedMemory;
class receiverInterface;
#define SLS_SHMVERSION 0x180629
#define SLS_SHMVERSION 0x180630
#define NMODMAXX 24
#define NMODMAXY 24
#define NCHIPSMAX 10
@ -384,6 +384,9 @@ private:
/** silent receiver */
bool receiver_silentMode;
/** quad enable */
bool quadEnable;
} sharedSlsDetector;
@ -2274,6 +2277,20 @@ public:
*/
int setCTBPatWaitTime(int level, uint64_t t=-1);
/**
* Set or Get Quad Type (Only for Eiger Quad detector hardware)
* @param val 1 if quad type set, else 0, -1 gets
* @returns 1 if quad type set, else 0
*/
int setQuad(int val = -1);
/**
* Set or Get Interrupt last sub frame(Only for Eiger)
* @param val 1 if interrupt last subframe set, else 0, -1 gets
* @returns 1 if interrupt last subframe set, else 0, -1 different values
*/
int setInterruptSubframe(int val = -1);
private:
/**
@ -2422,7 +2439,7 @@ private:
* @param udpsockbufsize additional json header
* @returns receiver udp socket buffer size
*/
std::string setReceiverUDPSocketBufferSize(int udpsockbufsize=-1);
std::string setReceiverUDPSocketBufferSize(uint64_t udpsockbufsize=-1);
/**
* Sets the transmission delay for left, right or entire frame

View File

@ -378,6 +378,13 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize;
++i;
/*! \page config
- <b>quad [i] </b> if 1, sets the detector size to a quad (Specific to an EIGER quad hardware). 0 by default. \c Returns \c (int)
*/
descrToFuncMap[i].m_pFuncName="quad"; //
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize;
++i;
/*! \page config
- <b>roimask [i]</b> ?? \c Returns \c (int) in hexadecimal
*/
@ -421,6 +428,14 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced;
++i;
/*! \page config
- <b>interruptsubframe [i]</b> sets/gets the interrupt subframe flag. Setting it to 1 will interrupt the last subframe at the required exposure time. By default, this is disabled and set to 0, ie. it will wait for the last sub frame to finish exposing. Used for EIGER in 32 bit mode only. \c Returns \c (int).
*/
descrToFuncMap[i].m_pFuncName="interruptsubframe";
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced;
++i;
/*! \page config
- <b>extsig:[i] [flag]</b> sets/gets the mode of the external signal i. Options: \c off, \c gate_in_active_high, \c gate_in_active_low, \c trigger_in_rising_edge, \c trigger_in_falling_edge,
\c ro_trigger_in_rising_edge, \c ro_trigger_in_falling_edge, \c gate_out_active_high, \c gate_out_active_low, \c trigger_out_rising_edge, \c trigger_out_falling_edge, \c ro_trigger_out_rising_edge,
@ -4040,7 +4055,8 @@ string slsDetectorCommand::cmdNetworkParameter(int narg, char *args[], int actio
} else if (cmd=="rx_udpsocksize") {
t=RECEIVER_UDP_SCKT_BUF_SIZE;
if (action==PUT_ACTION){
if (!(sscanf(args[1],"%d",&i)))
uint64_t ival = -1;
if (!(sscanf(args[1],"%ld",&ival)))
return ("cannot parse argument") + string(args[1]);
}
} else if (cmd=="rx_realudpsocksize") {
@ -4457,7 +4473,7 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) {
myDet->setOnline(ONLINE_FLAG);
if (cmd == "roi")
if (cmd == "roi" || cmd == "quad")
myDet->setReceiverOnline(ONLINE_FLAG);
if (action==PUT_ACTION) {
@ -4493,6 +4509,13 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) {
myDet->setMaxNumberOfChannelsPerDetector(Y,val);
}
if(cmd=="quad"){
if (val >=0 ) {
sprintf(ans, "%d", myDet->setQuad(val));
return string(ans);
}
}
if(cmd=="flippeddatax"){
if ((!sscanf(args[1],"%d",&val)) || (val!=0 && val != 1))
return string ("cannot scan flippeddata x mode: must be 0 or 1");
@ -4533,6 +4556,12 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) {
sprintf(ans,"%d %d",myDet->getMaxNumberOfChannelsPerDetector(X),myDet->getMaxNumberOfChannelsPerDetector(Y));
return string(ans);
}
else if (cmd=="quad") {
sprintf(ans, "%d", myDet->setQuad());
return string(ans);
}
else if(cmd=="flippeddatax"){
myDet->setReceiverOnline(ONLINE_FLAG);
ret = myDet->getFlippedData(X);
@ -4570,6 +4599,7 @@ string slsDetectorCommand::helpDetectorSize(int narg, char *args[], int action)
os << "dr i \n sets the dynamic range of the detector"<< std::endl;
os << "roi i xmin xmax ymin ymax \n sets region of interest where i is number of rois;i=0 to clear rois"<< std::endl;
os << "detsizechan x y \n sets the maximum number of channels for complete detector set in both directions; -1 is no limit"<< std::endl;
os << "quad i \n if i = 1, sets the detector size to a quad (Specific to an EIGER quad hardware). 0 by default."<< std::endl;
os << "flippeddatax x \n sets if the data should be flipped on the x axis"<< std::endl;
os << "flippeddatay y \n sets if the data should be flipped on the y axis"<< std::endl;
os << "gappixels i \n enables/disables gap pixels in system (detector & receiver). 1 sets, 0 unsets. Used in EIGER only and multidetector level." << std::endl;
@ -4580,6 +4610,7 @@ string slsDetectorCommand::helpDetectorSize(int narg, char *args[], int action)
os << "dr \n gets the dynamic range of the detector"<< std::endl;
os << "roi \n gets region of interest"<< std::endl;
os << "detsizechan \n gets the maximum number of channels for complete detector set in both directions; -1 is no limit"<< std::endl;
os << "quad \n returns 1 if the detector size is a quad (Specific to an EIGER quad hardware). 0 by default."<< std::endl;
os << "flippeddatax\n gets if the data will be flipped on the x axis"<< std::endl;
os << "flippeddatay\n gets if the data will be flipped on the y axis"<< std::endl;
os << "gappixels\n gets if gap pixels is enabled in system. Used in EIGER only and multidetector level." << std::endl;
@ -5819,18 +5850,14 @@ string slsDetectorCommand::cmdTimeLeft(int narg, char *args[], int action) {
if ((ret!=-1) && (index==ACQUISITION_TIME || index==FRAME_PERIOD || index==DELAY_AFTER_TRIGGER
|| index==ACTUAL_TIME || index==MEASUREMENT_TIME ||
MEASURED_PERIOD || MEASURED_SUBPERIOD))
MEASURED_PERIOD || MEASURED_SUBPERIOD)) {
rval=(double)ret*1E-9;
else rval=ret;
sprintf(answer,"%0.9f",rval);
} else {
sprintf(answer,"%lld",(long long int)ret);
}
return string(answer);
}
@ -6043,6 +6070,17 @@ string slsDetectorCommand::cmdAdvanced(int narg, char *args[], int action) {
return string("unknown");
} else if (cmd=="interruptsubframe") {
myDet->setOnline(ONLINE_FLAG);
if (action==PUT_ACTION) {
int ival = -1;
if (!sscanf(args[1],"%d",&ival))
return string("could not scan interrupt sub frame parameter " + string(args[1]));
myDet->setInterruptSubframe(ival);
}
char ans[100];
sprintf(ans,"%d",myDet->setInterruptSubframe(-1));
return std::string(ans);
} else if (cmd=="extsig") {
externalSignalFlag flag=GET_EXTERNAL_SIGNAL_FLAG;
int is=-1;
@ -6143,6 +6181,7 @@ string slsDetectorCommand::helpAdvanced(int narg, char *args[], int action) {
os << "extsig:i mode \t sets the mode of the external signal i. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
os << "flags mode \t sets the readout flags to mode. can be none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, overlow, nooverflow, unknown." << std::endl;
os << "interruptsubframe flag \t sets the interrupt subframe flag. Setting it to 1 will interrupt the last subframe at the required exposure time. By default, this is disabled and set to 0, ie. it will wait for the last sub frame to finish exposing. Used for EIGER in 32 bit mode only." << std::endl;
os << "programfpga f \t programs the fpga with file f (with .pof extension)." << std::endl;
os << "resetfpga f \t resets fpga, f can be any value" << std::endl;
@ -6156,6 +6195,7 @@ string slsDetectorCommand::helpAdvanced(int narg, char *args[], int action) {
os << "extsig:i \t gets the mode of the external signal i. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
os << "flags \t gets the readout flags. can be none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, overflow, nooverflow, unknown" << std::endl;
os << "interruptsubframe \t gets the interrupt subframe flag. Setting it to 1 will interrupt the last subframe at the required exposure time. By default, this is disabled and set to 0, ie. it will wait for the last sub frame to finish exposing. Used for EIGER in 32 bit mode only." << std::endl;
os << "led \t returns led status (0 off, 1 on)" << std::endl;
os << "powerchip \t gets if the chip has been powered on or off" << std::endl;
os << "auto_comp_disable \t Currently not implemented. gets if the automatic comparator diable mode is enabled/disabled" << std::endl;

View File

@ -913,9 +913,9 @@ class slsDetectorUsers
} };
/**
@short returns external communication mode std::string from index
\param s index for communication mode
\returns auto, trigger, ro_trigger, gating, triggered_gating, unknown when wrong mode
@short returns external communication mode index from std::string
\param s auto, trigger, ro_trigger, gating, triggered_gating, burst_trigger, unknown when wrong mode
\returns index for communication mode
*/
static int getTimingMode(std::string s){ \
@ -924,7 +924,8 @@ class slsDetectorUsers
if (s== "ro_trigger") return 2; \
if (s== "gating") return 3; \
if (s== "triggered_gating") return 4; \
return -1; };
if (s== "burst_trigger") return 5; \
return -1; }; \
private:

View File

@ -1021,12 +1021,23 @@ virtual int setReceiverSilentMode(int i = -1)=0;
*/
virtual int checkVersionCompatibility(portType t) = 0;
/**
* Set or Get Quad Type (Only for Eiger Quad detector hardware)
* @param val 1 if quad type set, else 0, -1 gets
* @returns 1 if quad type set, else 0
*/
virtual int setQuad(int val = -1) = 0;
/**
* Set or Get Interrupt last sub frame(Only for Eiger)
* @param val 1 if interrupt last subframe set, else 0, -1 gets
* @returns 1 if interrupt last subframe set, else 0, -1 different values
*/
virtual int setInterruptSubframe(int val = -1) = 0;
protected:
static const int64_t thisSoftwareVersion=0x20141013;
//protected:
int *stoppedFlag;

View File

@ -73,8 +73,8 @@ int setDefaultDacs();
extern u_int32_t writeRegister(u_int32_t offset, u_int32_t data); // blackfin.h
extern u_int32_t readRegister(u_int32_t offset); // blackfin.h
#else
uint32_t writeRegister(uint32_t offset, uint32_t data);
uint32_t readRegister(uint32_t offset);
int writeRegister(uint32_t offset, uint32_t data);
int readRegister(uint32_t offset, uint32_t* retval);
#endif
@ -194,6 +194,12 @@ int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32
#if defined(JUNGFRAUD) || defined(EIGERD)
int setDetectorPosition(int pos[]);
#endif
#ifdef EIGERD
int setQuad(int val);
int getQuad();
int setInterruptSubframe(int val);
int getInterruptSubframe();
#endif
// very detector specific

View File

@ -211,6 +211,8 @@ const char* getFunctionName(enum detFuncs func) {
case F_STORAGE_CELL_START: return "F_STORAGE_CELL_START";
case F_CHECK_VERSION: return "F_CHECK_VERSION";
case F_SOFTWARE_TRIGGER: return "F_SOFTWARE_TRIGGER";
case F_QUAD: return "F_QUAD";
case F_INTERRUPT_SUBFRAME: return "F_INTERRUPT_SUBFRAME";
default: return "Unknown Function";
}
@ -297,6 +299,8 @@ void function_table() {
flist[F_STORAGE_CELL_START] = &storage_cell_start;
flist[F_CHECK_VERSION] = &check_version;
flist[F_SOFTWARE_TRIGGER] = &software_trigger;
flist[F_QUAD] = &set_quad;
flist[F_INTERRUPT_SUBFRAME] = &set_interrupt_subframe;
// check
if (NUM_DET_FUNCTIONS >= TOO_MANY_FUNCTIONS_DEFINED) {
@ -1454,8 +1458,22 @@ int write_register(int file_des) {
#ifdef VERBOSE
printf("writing to register 0x%x data 0x%x\n", addr, val);
#endif
#ifdef EIGERD
if(writeRegister(addr, val) == FAIL) {
ret = FAIL;
sprintf(mess,"Could not write to register 0x%x.\n", addr);
cprintf(RED, "Warning: %s", mess);
} else {
if(readRegister(addr, &retval) == FAIL) {
ret = FAIL;
sprintf(mess,"Could not read register 0x%x.\n", addr);
cprintf(RED, "Warning: %s", mess);
}
}
#else
retval=writeRegister(addr,val);
if (retval!=val) {
#endif
if (ret == OK && retval!=val) {
ret = FAIL;
sprintf(mess,"Writing to register 0x%x failed: wrote 0x%x but read 0x%x\n", addr, val, retval);
cprintf(RED, "Warning: %s", mess);
@ -1505,8 +1523,16 @@ int read_register(int file_des) {
printf("reading register 0x%x\n", addr);
#endif
#ifdef SLS_DETECTOR_FUNCTION_LIST
#ifdef EIGERD
if(readRegister(addr, &retval) == FAIL) {
ret = FAIL;
sprintf(mess,"Could not read register 0x%x.\n", addr);
cprintf(RED, "Warning: %s", mess);
}
#else
retval=readRegister(addr);
#endif
#endif
#ifdef VERBOSE
printf("Returned value 0x%x\n", retval);
#endif
@ -3708,6 +3734,14 @@ int send_update(int file_des) {
if (n < 0) return printSocketReadError();
#ifdef EIGERD
#ifdef SLS_DETECTOR_FUNCTION_LIST
nm=getQuad();
#endif
n = sendData(file_des,&nm,sizeof(int32_t),INT32);
if (n < 0) return printSocketReadError();
#endif
if (lockStatus==0) {
strcpy(lastClientIP,thisClientIP);
}
@ -5926,3 +5960,133 @@ int software_trigger(int file_des) {
return ret;
}
int set_quad(int file_des) {
int ret=OK,ret1=OK;
int n=0;
int retval=-1;
sprintf(mess,"Setting quad failed\n");
// execute action
#ifndef EIGERD
//to receive any arguments
while (n > 0)
n = receiveData(file_des,mess,MAX_STR_LENGTH,OTHER);
ret = FAIL;
sprintf(mess,"Function (set_quad) is not implemented for this detector\n");
cprintf(RED, "Warning: %s", mess);
#else
// receive arguments
int arg=-1;
n = receiveData(file_des,&arg,sizeof(arg),INT32);
if (n < 0) return printSocketReadError();
// execute action
if (differentClients && lockStatus && arg!=-1) {
ret = FAIL;
sprintf(mess,"Detector locked by %s\n",lastClientIP);
cprintf(RED, "Warning: %s", mess);
}
#ifdef SLS_DETECTOR_FUNCTION_LIST
else {
#ifdef VERBOSE
printf("Setting Quad :%d \n",arg);
#endif
if(arg != -1 && setQuad(arg) == FAIL) {
ret=FAIL;
strcpy(mess, "setting quad failed\n");
cprintf(RED, "Warning: %s", mess);
}
retval = getQuad();
if(ret == OK && (arg != -1) && (retval != arg)) {
ret=FAIL;
cprintf(RED, "Warning: %s", mess);
}
}
#endif
if (ret==OK && differentClients)
ret=FORCE_UPDATE;
#endif
// ret could be swapped during sendData
ret1 = ret;
// send ok / fail
n = sendData(file_des,&ret1,sizeof(ret),INT32);
// send return argument
if (ret==FAIL) {
n += sendData(file_des,mess,sizeof(mess),OTHER);
}
n += sendData(file_des,&retval,sizeof(retval),INT32);
// return ok / fail
return ret;
}
int set_interrupt_subframe(int file_des) {
int ret=OK,ret1=OK;
int n=0;
int retval=-1;
sprintf(mess,"Setting interrupt subframe failed\n");
// execute action
#ifndef EIGERD
//to receive any arguments
while (n > 0)
n = receiveData(file_des,mess,MAX_STR_LENGTH,OTHER);
ret = FAIL;
sprintf(mess,"Function (set_interrupt_subframe) is not implemented for this detector\n");
cprintf(RED, "Warning: %s", mess);
#else
// receive arguments
int arg=-1;
n = receiveData(file_des,&arg,sizeof(arg),INT32);
if (n < 0) return printSocketReadError();
// execute action
if (differentClients && lockStatus && arg!=-1) {
ret = FAIL;
sprintf(mess,"Detector locked by %s\n",lastClientIP);
cprintf(RED, "Warning: %s", mess);
}
#ifdef SLS_DETECTOR_FUNCTION_LIST
else {
#ifdef VERBOSE
printf("Setting Interrupt subframe :%d \n",arg);
#endif
if (arg != -1 && setInterruptSubframe(arg) == FAIL) {
ret=FAIL;
strcpy(mess, "setting interrupt subframe failed\n");
cprintf(RED, "Warning: %s", mess);
}
retval = getInterruptSubframe();
#ifdef VERBOSE
printf("retval Interrupt subframe :%d \n",retval);
#endif
if(ret == OK && (arg != -1) && (retval != arg)) {
ret=FAIL;
sprintf(mess, "setting interrupt subframe failed. Set %d, got %d\n", arg, retval);
cprintf(RED, "Warning: %s", mess);
}
}
#endif
if (ret==OK && differentClients)
ret=FORCE_UPDATE;
#endif
// ret could be swapped during sendData
ret1 = ret;
// send ok / fail
n = sendData(file_des,&ret1,sizeof(ret),INT32);
// send return argument
if (ret==FAIL) {
n += sendData(file_des,mess,sizeof(mess),OTHER);
}
n += sendData(file_des,&retval,sizeof(retval),INT32);
// return ok / fail
return ret;
}

View File

@ -97,5 +97,7 @@ int auto_comp_disable(int);
int storage_cell_start(int);
int check_version(int);
int software_trigger(int);
int set_quad(int);
int set_interrupt_subframe(int);
#endif

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: 3c774478681813e451df683e2bc8403b37490323
Revision: 858
Branch: 4.0.1
Repsitory UUID: 98b45b32fd6653fb2758afdc3f804e2a785c504d
Revision: 870
Branch: 4.1.0
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4084
Last Changed Date: 2019-02-08 16:44:46.000000002 +0100 ./src/Listener.cpp
Last Changed Rev: 4141
Last Changed Date: 2019-10-04 09:28:28.000000001 +0200 ./updateAPIVersion.sh

View File

@ -58,19 +58,10 @@ class BinaryFile : private virtual slsReceiverDefs, public File, public BinaryFi
/**
* Create master file
* @param en ten giga enable
* @param size image size
* @param nx number of pixels in x direction
* @param ny number of pixels in y direction
* @param at acquisition time
* @param st sub exposure time
* @param sp sub period
* @param ap acquisition period
* @param attr master file attributes
* @returns OK or FAIL
*/
int CreateMasterFile(bool en, uint32_t size,
uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t sp,
uint64_t ap);
int CreateMasterFile(masterAttributes& attr);
/**
* Close Current File

View File

@ -100,26 +100,11 @@ class BinaryFileStatic {
* @param fd pointer to file handle
* @param fname master file name
* @param owenable overwrite enable
* @param dr dynamic range
* @param tenE ten giga enable
* @param size image size
* @param nPixelsX number of pixels in x direction
* @param nPixelsY number of pixels in y direction
* @param nf number of images
* @param maxf maximum frames per file
* @param acquisitionTime acquisition time
* @param acquisitionPeriod acquisition period
* @param subexposuretime sub exposure time
* @param subperiod sub period
* @param version version of software for binary writing
* @param attr master file attributes
* @returns 0 for success and 1 for fail
*/
static int CreateMasterDataFile(FILE*& fd, std::string fname, bool owenable,
uint32_t dr, bool tenE, uint32_t size,
uint32_t nPixelsX, uint32_t nPixelsY, uint64_t nf,
uint32_t maxf,
uint64_t acquisitionTime, uint64_t subexposuretime,
uint64_t subperiod, uint64_t acquisitionPeriod, double version)
masterAttributes& attr)
{
if(!owenable){
if (NULL == (fd = fopen((const char *) fname.c_str(), "wx"))){
@ -136,17 +121,20 @@ class BinaryFileStatic {
char message[MAX_MASTER_FILE_LENGTH];
sprintf(message,
"Version : %.1f\n"
"Detector Type : %d\n"
"Dynamic Range : %d\n"
"Ten Giga : %d\n"
"Image Size : %d bytes\n"
"row : %d pixels\n"
"col : %d pixels\n"
"Max. Frames Per File : %u\n"
"nPixelsX : %d pixels\n"
"nPixelsY : %d pixels\n"
"Max Frames Per File : %u\n"
"Total Frames : %lld\n"
"Exptime (ns) : %lld\n"
"SubExptime (ns) : %lld\n"
"SubPeriod(ns) : %lld\n"
"Period (ns) : %lld\n"
"Gap Pixels Enable : %d\n"
"Quad Enable : %d\n"
"Timestamp : %s\n\n"
"#Frame Header\n"
@ -165,18 +153,21 @@ class BinaryFileStatic {
"Header Version : 1 byte\n"
"Packets Caught Mask : 64 bytes\n"
,
version,
dr,
tenE,
size,
nPixelsX,
nPixelsY,
maxf,
(long long int)nf,
(long long int)acquisitionTime,
(long long int)subexposuretime,
(long long int)subperiod,
(long long int)acquisitionPeriod,
attr.version,
attr.detectorType,
attr.dynamicRange,
attr.tenGiga,
attr.imageSize,
attr.nPixelsX,
attr.nPixelsY,
attr.maxFramesPerFile,
(long long int)attr.totalFrames,
(long long int)attr.exptimeNs,
(long long int)attr.subExptimeNs,
(long long int)attr.subPeriodNs,
(long long int)attr.periodNs,
attr.gapPixelsEnable,
attr.quadEnable,
ctime(&t));
if (strlen(message) > MAX_MASTER_FILE_LENGTH) {
cprintf(RED,"Master File Size %d is greater than max str size %d\n",

View File

@ -10,6 +10,7 @@
*/
#include "ThreadObject.h"
#include "receiver_defs.h"
class GeneralData;
class Fifo;
@ -38,6 +39,7 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
* @param act pointer to activated
* @param depaden pointer to deactivated padding enable
* @param sm pointer to silent mode
* @param qe pointer to quad Enable
* @param dataReadycb pointer to data ready call back function
* @param dataModifyReadycb pointer to data ready call back function with modified
* @param pDataReadycb pointer to arguments of data ready call back function. To write/stream a smaller size of processed data, change this value (only smaller value is allowed).
@ -45,7 +47,7 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
DataProcessor(int ind, detectorType dtype, Fifo*& f, fileFormat* ftype,
bool fwenable, bool* dsEnable, bool* gpEnable, uint32_t* dr,
uint32_t* freq, uint32_t* timer,
bool* fp, bool* act, bool* depaden, bool* sm,
bool* fp, bool* act, bool* depaden, bool* sm, bool* qe,
void (*dataReadycb)(char*, char*, uint32_t, void*),
void (*dataModifyReadycb)(char*, char*, uint32_t &, void*),
void *pDataReadycb);
@ -175,16 +177,10 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
/**
* Create New File
* @param en ten giga enable
* @param nf number of frames
* @param at acquisition time
* @param st sub exposure time
* @param sp sub period
* @param ap acquisition period
* @param attr master file attributes
* @returns OK or FAIL
*/
int CreateNewFile(bool en, uint64_t nf, uint64_t at, uint64_t st,
uint64_t sp, uint64_t ap);
int CreateNewFile(masterAttributes& attr);
/**
* Closes files
@ -341,6 +337,9 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
/** Silent Mode */
bool* silentMode;
/** quad enable */
bool* quadEnable;
/** frame padding */
bool* framePadding;

View File

@ -27,12 +27,15 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
* @param dr pointer to dynamic range
* @param r roi
* @param fi pointer to file index
* @param fd flipped data enable for x and y dimensions
* @param fd flipped data enable for x dimension
* @param ajh additional json header
* @param sm pointer to silent mode
* @param nd pointer to number of detectors in each dimension
* @param gpEnable pointer to gap pixels enable
* @param qe pointer to quad Enable
*/
DataStreamer(int ind, Fifo*& f, uint32_t* dr, std::vector<ROI>* r,
uint64_t* fi, int* fd, char* ajh, bool* sm);
uint64_t* fi, int fd, char* ajh, bool* sm, int* nd, bool* gpEnable, bool* qe);
/**
* Destructor
@ -88,6 +91,18 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
*/
int SetThreadPriority(int priority);
/**
* Set number of detectors
* @param number of detectors in both dimensions
*/
void SetNumberofDetectors(int* nd);
/**
* Set Flipped data enable across x dimension
* @param flipped data enable in x dimension
*/
void SetFlippedDataX(int fd);
/**
* Creates Zmq Sockets
* (throws an exception if it couldnt create zmq sockets)
@ -183,8 +198,8 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
/** Pointer to file index */
uint64_t* fileIndex;
/** flipped data across both dimensions enable */
int* flippedData;
/** flipped data across x dimension */
int flippedDataX;
/** additional json header */
char* additionJsonHeader;
@ -207,5 +222,13 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
/** Complete buffer used for roi, eg. shortGotthard */
char* completeBuffer;
/** Number of Detectors in X and Y dimension */
int numDet[2];
/** Gap Pixels Enable */
bool* gapPixelsEnable;
/** quad enable */
bool* quadEnable;
};

View File

@ -10,6 +10,7 @@
#include "sls_receiver_defs.h"
#include "logger.h"
#include "receiver_defs.h"
#include <string>
@ -121,19 +122,10 @@ class File : private virtual slsReceiverDefs {
/**
* Create master file
* @param en ten giga enable
* @param size image size
* @param nx number of pixels in x direction
* @param ny number of pixels in y direction
* @param at acquisition time
* @param st sub exposure time
* @param sp sub period
* @param ap acquisition period
* @param attr master file attributes
* @returns OK or FAIL
*/
virtual int CreateMasterFile(bool en, uint32_t size,
uint32_t nx, uint32_t ny, uint64_t at, uint64_t st,
uint64_t sp, uint64_t ap) {
virtual int CreateMasterFile(masterAttributes& attr) {
cprintf(RED,"This is a generic function CreateMasterFile that "
"should be overloaded by a derived class\n");
return OK;

View File

@ -190,8 +190,10 @@ public:
/**
* Enable Gap Pixels changes member variables
* @param enable true if gap pixels enable, else false
* @param dr dynamic range
* @param q quad enable
*/
virtual void SetGapPixelsEnable(bool b, int dr) {
virtual void SetGapPixelsEnable(bool b, int dr, bool q) {
cprintf(RED,"This is a generic function that should be overloaded by a derived class\n");
};
@ -646,13 +648,17 @@ class EigerData : public GeneralData {
* Enable Gap Pixels changes member variables
* @param enable true if gap pixels enable, else false
* @param dr dynamic range
* @param q quad enable
*/
void SetGapPixelsEnable(bool b, int dr) {
void SetGapPixelsEnable(bool b, int dr, bool q) {
if (dr == 4)
b = 0;
switch((int)b) {
case 1:
nPixelsX = (256 * 2) + 3;
if (q) {
--nPixelsX; // if quad, remove last line
}
nPixelsY = 256 + 1;
imageSize = nPixelsX * nPixelsY * ((dr > 16) ? 4 : // 32 bit
((dr > 8) ? 2 : // 16 bit

View File

@ -93,19 +93,10 @@ class HDF5File : private virtual slsReceiverDefs, public File, public HDF5FileSt
/**
* Create master file
* @param en ten giga enable
* @param size image size
* @param nx number of pixels in x direction
* @param ny number of pixels in y direction
* @param at acquisition time
* @param st sub exposure time
* @param sp sub period
* @param ap acquisition period
* @param attr master file attributes
* @returns OK or FAIL
*/
int CreateMasterFile(bool en, uint32_t size,
uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t sp,
uint64_t ap);
int CreateMasterFile(masterAttributes& attr);
/**
* End of Acquisition

View File

@ -283,7 +283,7 @@ public:
}
catch(Exception error){
cprintf(RED,"Error in extending dataset in object %d\n",ind);
error.printError();
error.printErrorStack();
return 1;
}
return 0;
@ -294,26 +294,12 @@ public:
* Create master file
* @param fname master file name
* @param owenable overwrite enable
* @param dr dynamic range
* @param tenE ten giga enable
* @param size image size
* @param nx number of pixels in x direction
* @param ny number of pixels in y direction
* @param nf number of images
* @param maxf maximum frames per file
* @param acquisitionTime acquisition time
* @param subexposuretime sub exposure time
* @param subperiod sub period
* @param acquisitionPeriod acquisition period
* @param attr master file attributes
* @param version version of software for hdf5 writing
* @returns 0 for success and 1 for fail
*/
static int CreateMasterDataFile(H5File*& fd, std::string fname, bool owenable,
uint32_t dr, bool tenE, uint32_t size,
uint32_t nPixelsx, uint32_t nPixelsy, uint64_t nf,
uint32_t maxf,
uint64_t acquisitionTime, uint64_t subexposuretime,
uint64_t subperiod, uint64_t acquisitionPeriod, double version)
masterAttributes& attr)
{
try {
Exception::dontPrint(); //to handle errors
@ -340,7 +326,7 @@ public:
//create attributes
//version
dValue=version;
dValue=attr.version;
attribute = fd->createAttribute("version",PredType::NATIVE_DOUBLE, dataspace);
attribute.write(PredType::NATIVE_DOUBLE, &dValue);
@ -352,63 +338,75 @@ public:
Group group5( group3.createGroup("detector") );
Group group6( group1.createGroup("sample") );
//Detector Type
dataset = group5.createDataSet ( "detector type", PredType::NATIVE_INT, dataspace );
dataset.write ( &(attr.detectorType), PredType::NATIVE_INT);
//Dynamic Range
dataset = group5.createDataSet ( "dynamic range", PredType::NATIVE_INT, dataspace );
dataset.write ( &dr, PredType::NATIVE_INT);
dataset.write ( &(attr.dynamicRange), PredType::NATIVE_INT);
attribute = dataset.createAttribute("unit",strdatatype, dataspace);
attribute.write(strdatatype, std::string("bits"));
//Ten Giga
iValue = tenE;
iValue = attr.tenGiga;
dataset = group5.createDataSet ( "ten giga enable", PredType::NATIVE_INT, dataspace );
dataset.write ( &iValue, PredType::NATIVE_INT);
//Image Size
dataset = group5.createDataSet ( "image size", PredType::NATIVE_INT, dataspace );
dataset.write ( &size, PredType::NATIVE_INT);
dataset.write ( &(attr.imageSize), PredType::NATIVE_INT);
attribute = dataset.createAttribute("unit",strdatatype, dataspace);
attribute.write(strdatatype, std::string("bytes"));
//x
dataset = group5.createDataSet ( "number of pixels in x axis", PredType::NATIVE_INT, dataspace );
dataset.write ( &nPixelsx, PredType::NATIVE_INT);
dataset.write ( &(attr.nPixelsX), PredType::NATIVE_INT);
//y
dataset = group5.createDataSet ( "number of pixels in y axis", PredType::NATIVE_INT, dataspace );
dataset.write ( &nPixelsy, PredType::NATIVE_INT);
dataset.write ( &(attr.nPixelsY), PredType::NATIVE_INT);
//Maximum frames per file
dataset = group5.createDataSet ( "maximum frames per file", PredType::NATIVE_INT, dataspace );
dataset.write ( &maxf, PredType::NATIVE_INT);
dataset.write ( &(attr.maxFramesPerFile), PredType::NATIVE_INT);
//Total Frames
dataset = group5.createDataSet ( "total frames", PredType::STD_U64LE, dataspace );
dataset.write ( &nf, PredType::STD_U64LE);
dataset.write ( &(attr.totalFrames), PredType::STD_U64LE);
//Exptime
dataset = group5.createDataSet ( "exposure time", PredType::STD_U64LE, dataspace );
dataset.write ( &acquisitionTime, PredType::STD_U64LE);
dataset.write ( &(attr.exptimeNs), PredType::STD_U64LE);
attribute = dataset.createAttribute("unit",strdatatype, dataspace);
attribute.write(strdatatype, std::string("ns"));
//SubExptime
dataset = group5.createDataSet ( "sub exposure time", PredType::STD_U64LE, dataspace );
dataset.write ( &subexposuretime, PredType::STD_U64LE);
dataset.write ( &(attr.subExptimeNs), PredType::STD_U64LE);
attribute = dataset.createAttribute("unit",strdatatype, dataspace);
attribute.write(strdatatype, std::string("ns"));
//SubPeriod
dataset = group5.createDataSet ( "sub period", PredType::STD_U64LE, dataspace );
dataset.write ( &subperiod, PredType::STD_U64LE);
dataset.write ( &(attr.subPeriodNs), PredType::STD_U64LE);
attribute = dataset.createAttribute("unit",strdatatype, dataspace);
attribute.write(strdatatype, std::string("ns"));
//Period
dataset = group5.createDataSet ( "acquisition period", PredType::STD_U64LE, dataspace );
dataset.write ( &acquisitionPeriod, PredType::STD_U64LE);
dataset.write ( &(attr.periodNs), PredType::STD_U64LE);
attribute = dataset.createAttribute("unit",strdatatype, dataspace);
attribute.write(strdatatype, std::string("ns"));
//Gap Pixels Enable
dataset = group5.createDataSet ( "gap pixels enable", PredType::NATIVE_INT, dataspace );
dataset.write ( &(attr.gapPixelsEnable), PredType::NATIVE_INT);
//Quad Enable
dataset = group5.createDataSet ( "quad enable", PredType::NATIVE_INT, dataspace );
dataset.write ( &(attr.quadEnable), PredType::NATIVE_INT);
//Timestamp
time_t t = time(0);
dataset = group5.createDataSet ( "timestamp", strdatatype, dataspace );

View File

@ -39,7 +39,7 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
*/
Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s,
uint32_t* portno, char* e, uint64_t* nf, uint32_t* dr,
uint32_t* us, uint32_t* as, uint32_t* fpf,
uint64_t* us, uint64_t* as, uint32_t* fpf,
frameDiscardPolicy* fdp, bool* act, bool* depaden, bool* sm);
/**
@ -138,7 +138,7 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
* @param s UDP socket buffer size to be set
* @return OK or FAIL of dummy socket creation
*/
int CreateDummySocketForUDPSocketBufferSize(uint32_t s);
int CreateDummySocketForUDPSocketBufferSize(uint64_t s);
/**
* Set hard coded (calculated but not from detector) row and column
@ -231,10 +231,10 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
uint32_t* dynamicRange;
/** UDP Socket Buffer Size */
uint32_t* udpSocketBufferSize;
uint64_t* udpSocketBufferSize;
/** actual UDP Socket Buffer Size (double due to kernel bookkeeping) */
uint32_t* actualUDPSocketBufferSize;
uint64_t* actualUDPSocketBufferSize;
/** frames per file */
uint32_t* framesPerFile;

View File

@ -72,6 +72,12 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
*/
bool getGapPixelsEnable() const;
/**
* Get Quad type Enable (eiger and hardware specific)
* @return true if quad enabled, else false
*/
bool getQuad() const;
//***file parameters***
/**
@ -313,14 +319,14 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
* Get UDP Socket Buffer Size
* @return UDP Socket Buffer Size
*/
uint32_t getUDPSocketBufferSize() const;
uint64_t getUDPSocketBufferSize() const;
/** (not saved in client shared memory)
* Get actual UDP Socket Buffer Size
* @return actual UDP Socket Buffer Size
*/
uint32_t getActualUDPSocketBufferSize() const;
uint64_t getActualUDPSocketBufferSize() const;
/*************************************************************************
* Setters ***************************************************************
@ -341,7 +347,7 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
void setMultiDetectorSize(const int* size);
/*
* Get flipped data across 'axis'
* Set flipped data across 'axis'
* @return if data is flipped across 'axis'
*/
void setFlippedData(int axis=0, int enable=-1);
@ -353,6 +359,13 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
*/
int setGapPixelsEnable(const bool b);
/**
* Set Quad type Enable (eiger and hardware specific)
* @param true if quad enabled, else false
* @return OK or FAIL
*/
int setQuad(const bool b);
//***file parameters***
/**
@ -651,7 +664,7 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
* @param s UDP Socket Buffer Size
* @return OK or FAIL if dummy socket could be created
*/
int setUDPSocketBufferSize(const uint32_t s);
int setUDPSocketBufferSize(const uint64_t s);
/*
* Restream stop dummy packet from receiver
@ -735,10 +748,12 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
bool tengigaEnable;
/** Fifo Depth */
uint32_t fifoDepth;
/** enable for flipping data across both axes */
int flippedData[2];
/** enable for flipping data across x axis */
int flippedDataX;
/** gap pixels enable */
bool gapPixelsEnable;
/** quad type enable */
bool quadEnable;
//***receiver parameters***
/** Maximum Number of Listening Threads/ UDP Ports */
@ -760,9 +775,9 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
/** Server UDP Port Number*/
uint32_t udpPortNum[MAX_NUMBER_OF_LISTENING_THREADS];
/** udp socket buffer size */
uint32_t udpSocketBufferSize;
uint64_t udpSocketBufferSize;
/** actual UDP Socket Buffer Size (halved due to kernel bookkeeping) */
uint32_t actualUDPSocketBufferSize;
uint64_t actualUDPSocketBufferSize;
//***file parameters***
/** File format */

View File

@ -162,6 +162,12 @@ class UDPInterface {
*/
virtual bool getGapPixelsEnable() const = 0;
/**
* Get Quad type Enable (eiger and hardware specific)
* @return true if quad enabled, else false
*/
virtual bool getQuad() const = 0;
//***file parameters***
/**
@ -404,13 +410,13 @@ class UDPInterface {
* Get UDP Socket Buffer Size
* @return UDP Socket Buffer Size
*/
virtual uint32_t getUDPSocketBufferSize() const = 0;
virtual uint64_t getUDPSocketBufferSize() const = 0;
/** (not saved in client shared memory)
* Get actual UDP Socket Buffer Size
* @return actual UDP Socket Buffer Size
*/
virtual uint32_t getActualUDPSocketBufferSize() const = 0;
virtual uint64_t getActualUDPSocketBufferSize() const = 0;
/*************************************************************************
* Setters ***************************************************************
@ -444,6 +450,13 @@ class UDPInterface {
*/
virtual int setGapPixelsEnable(const bool b) = 0;
/**
* Set Quad type Enable (eiger and hardware specific)
* @param true if quad enabled, else false
* @return OK or FAIL
*/
virtual int setQuad(const bool b) = 0;
//***file parameters***
/**
@ -743,7 +756,7 @@ class UDPInterface {
* @param s UDP Socket Buffer Size
* @return OK or FAIL if dummy socket could be created
*/
virtual int setUDPSocketBufferSize(const uint32_t s) = 0;
virtual int setUDPSocketBufferSize(const uint64_t s) = 0;
/*
* Restream stop dummy packet from receiver

View File

@ -53,6 +53,18 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
*/
int64_t getAcquisitionIndex() const;
/*
* Set multi detector size
* @param pointer to array of multi detector size in every dimension
*/
void setMultiDetectorSize(const int* size);
/*
* Set flipped data across 'axis'
* @return if data is flipped across 'axis'
*/
void setFlippedData(int axis=0, int enable=-1);
/**
* Set Gap Pixels Enable (eiger specific)
* @param b true for gap pixels enable, else false
@ -60,6 +72,13 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
*/
int setGapPixelsEnable(const bool b);
/**
* Set Quad type Enable (eiger and hardware specific)
* @param true if quad enabled, else false
* @return OK or FAIL
*/
int setQuad(const bool b);
/**
* Set File Format
* @param f fileformat binary or hdf5
@ -184,7 +203,7 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
* @param s UDP Socket Buffer Size
* @return OK or FAIL if dummy socket could be created
*/
int setUDPSocketBufferSize(const uint32_t s);
int setUDPSocketBufferSize(const uint64_t s);
/**
* Restream stop dummy packet from receiver

View File

@ -238,20 +238,43 @@ public:
/**
* Send Message Header
* @param buf message
* @param length length of message
* @param dummy true if end of acquistion else false
* @param index self index for debugging
* @param dummy true if a dummy message for end of acquisition
* @param jsonversion json version
* @param dynamicrange dynamic range
* @param fileIndex file or acquisition index
* @param ndetx number of detectors in x axis
* @param ndety number of detectors in y axis
* @param npixelsx number of pixels/channels in x axis for this zmq socket
* @param npixelsy number of pixels/channels in y axis for this zmq socket
* @param imageSize number of bytes for an image in this socket
* @param frameNumber current frame number
* @param expLength exposure length or subframe index if eiger
* @param packetNumber number of packets caught for this frame
* @param bunchId bunch id
* @param timestamp time stamp
* @param modId module Id
* @param row row index in complete detector
* @param column column index in complete detector
* @param reserved reserved
* @param debug debug
* @param roundRNumber not used yet
* @param detType detector enum
* @param version detector header version
* @param gapPixelsEnable gap pixels enable (exception: if gap pixels enable for 4 bit mode, data is not yet gap pixel enabled in receiver)
* @param flippedData int array of 2 elements for x and y, if it is flipped across x or y axis
* @param additionalJsonHeader additional json header
* @returns 0 if error, else 1
*/
int SendHeaderData ( int index, bool dummy, uint32_t jsonversion, uint32_t dynamicrange = 0, uint64_t fileIndex = 0,
uint32_t npixelsx = 0, uint32_t npixelsy = 0, uint32_t imageSize = 0,
uint32_t ndetx = 0, uint32_t ndety = 0, uint32_t npixelsx = 0, uint32_t npixelsy = 0, uint32_t imageSize = 0,
uint64_t acqIndex = 0, uint64_t fIndex = 0, char* fname = NULL,
uint64_t frameNumber = 0, uint32_t expLength = 0, uint32_t packetNumber = 0,
uint64_t bunchId = 0, uint64_t timestamp = 0,
uint16_t modId = 0, uint16_t row = 0, uint16_t column = 0, uint16_t reserved = 0,
uint32_t debug = 0, uint16_t roundRNumber = 0,
uint8_t detType = 0, uint8_t version = 0, int* flippedData = 0,
char* additionalJsonHeader = 0) {
uint8_t detType = 0, uint8_t version = 0, uint32_t gapPixelsEnable = 0, uint32_t flippedDataX = 0,
uint32_t quadEnable = 0, char* additionalJsonHeader = 0) {
char buf[MAX_STR_LENGTH] = "";
@ -261,6 +284,7 @@ public:
"\"jsonversion\":%u, "
"\"bitmode\":%u, "
"\"fileIndex\":%llu, "
"\"detshape\":[%u, %u], "
"\"shape\":[%u, %u], "
"\"size\":%u, "
"\"acqIndex\":%llu, "
@ -283,11 +307,13 @@ public:
"\"version\":%u, "
//additional stuff
"\"flippedDataX\":%u"
"\"gappixels\":%u, "
"\"flippedDataX\":%u, "
"\"quad\":%u"
;//"}\n";
int length = sprintf(buf, jsonHeaderFormat,
jsonversion, dynamicrange, fileIndex, npixelsx, npixelsy, imageSize,
jsonversion, dynamicrange, fileIndex, ndetx, ndety, npixelsx, npixelsy, imageSize,
acqIndex, fIndex, (fname == NULL)? "":fname, dummy?0:1,
frameNumber, expLength, packetNumber, bunchId, timestamp,
@ -295,7 +321,9 @@ public:
detType, version,
//additional stuff
((flippedData == 0 ) ? 0 :flippedData[0])
gapPixelsEnable,
flippedDataX,
quadEnable
);
if (additionalJsonHeader && strlen(additionalJsonHeader)) {
length = sprintf(buf, "%s, %s}\n", buf, additionalJsonHeader);
@ -304,7 +332,7 @@ public:
}
#ifdef VERBOSE
//if(!index)
if(!index)
cprintf(BLUE,"%d : Streamer: buf: %s\n", index, buf);
#endif

View File

@ -112,7 +112,7 @@ public:
*/
genericSocket(unsigned short int const port_number, communicationProtocol p,
int ps = DEFAULT_PACKET_SIZE, const char *eth=NULL, int hsize=0,
uint32_t buf_size=SOCKET_BUFFER_SIZE):
uint64_t buf_size=SOCKET_BUFFER_SIZE):
portno(port_number),
protocol(p),
is_a_server(1),
@ -181,10 +181,10 @@ public:
//increase socket buffer size if its udp
if (p == UDP) {
uint32_t desired_size = buf_size;
uint32_t real_size = desired_size * 2; // kernel doubles this value for bookkeeping overhead
uint32_t ret_size = -1;
socklen_t optlen = sizeof(int);
uint64_t desired_size = buf_size;
uint64_t real_size = desired_size * 2; // kernel doubles this value for bookkeeping overhead
uint64_t ret_size = -1;
socklen_t optlen = sizeof(uint64_t);
// confirm if sufficient
if (getsockopt(sockfd.fd, SOL_SOCKET, SO_RCVBUF, &ret_size, &optlen) == -1) {
@ -268,7 +268,7 @@ public:
* Halving is because of kernel book keeping
* @returns actual udp socket buffer size/2
*/
int getActualUDPSocketBufferSize(){return actual_udp_socket_buffer_size;};
uint64_t getActualUDPSocketBufferSize(){return actual_udp_socket_buffer_size;};
/**
* Get protocol TCP or UDP
@ -831,5 +831,5 @@ private:
int nsent;
int total_sent;
int header_packet_size;
int actual_udp_socket_buffer_size;
uint64_t actual_udp_socket_buffer_size;
};

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "3c774478681813e451df683e2bc8403b37490323"
#define GITREPUUID "98b45b32fd6653fb2758afdc3f804e2a785c504d"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4084
#define GITDATE 0x20190208
#define GITBRANCH "4.0.1"
#define GITREV 0x4141
#define GITDATE 0x20191004
#define GITBRANCH "4.1.0"

View File

@ -28,8 +28,8 @@
#define MAX_CHUNKED_IMAGES 1
//versions
#define HDF5_WRITER_VERSION 3.0 //1 decimal places
#define BINARY_WRITER_VERSION 3.0 //1 decimal places
#define HDF5_WRITER_VERSION 4.0 //1 decimal places
#define BINARY_WRITER_VERSION 4.0 //1 decimal places
//parameters to calculate fifo depth
@ -48,3 +48,21 @@
#define STREAMER_PRIORITY 10
#define TCP_PRIORITY 10
struct masterAttributes {
double version;
uint32_t detectorType;
uint32_t dynamicRange;
uint32_t tenGiga;
uint32_t imageSize;
uint32_t nPixelsX;
uint32_t nPixelsY;
uint32_t maxFramesPerFile;
uint64_t totalFrames;
uint64_t exptimeNs;
uint64_t subExptimeNs;
uint64_t subPeriodNs;
uint64_t periodNs;
uint32_t gapPixelsEnable;
uint32_t quadEnable;
};

View File

@ -284,6 +284,9 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs {
/** set deactivated receiver padding enable */
int set_deactivated_receiver_padding_enable();
/** set quad type */
int set_quad_type();
/** detector type */
detectorType myDetectorType;

View File

@ -71,6 +71,7 @@ enum recFuncs{
F_RECEIVER_DISCARD_POLICY, /** < frames discard policy */
F_RECEIVER_PADDING_ENABLE, /** < partial frames padding enable */
F_RECEIVER_DEACTIVATED_PADDING_ENABLE, /** < deactivated receiver padding enable */
F_RECEIVER_QUAD,
/* Always append functions hereafter!!! */

View File

@ -114,9 +114,7 @@ int BinaryFile::WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_
}
int BinaryFile::CreateMasterFile(bool en, uint32_t size,
uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t sp,
uint64_t ap) {
int BinaryFile::CreateMasterFile(masterAttributes& attr) {
//beginning of every acquisition
numFramesInFile = 0;
numActualPacketsInFile = 0;
@ -127,10 +125,9 @@ int BinaryFile::CreateMasterFile(bool en, uint32_t size,
if(!(*silentMode)) {
FILE_LOG(logINFO) << "Master File: " << masterFileName;
}
attr.version = BINARY_WRITER_VERSION;
return BinaryFileStatic::CreateMasterDataFile(masterfd, masterFileName,
*overWriteEnable,
*dynamicRange, en, size, nx, ny, *numImages, *maxFramesPerFile,
at, st, sp, ap, BINARY_WRITER_VERSION);
*overWriteEnable, attr);
}
return OK;
}

View File

@ -26,7 +26,7 @@ DataProcessor::DataProcessor(int ind, detectorType dtype, Fifo*& f,
fileFormat* ftype, bool fwenable,
bool* dsEnable, bool* gpEnable, uint32_t* dr,
uint32_t* freq, uint32_t* timer,
bool* fp, bool* act, bool* depaden, bool* sm,
bool* fp, bool* act, bool* depaden, bool* sm, bool* qe,
void (*dataReadycb)(char*, char*, uint32_t, void*),
void (*dataModifyReadycb)(char*, char*, uint32_t &, void*),
void *pDataReadycb) :
@ -49,6 +49,7 @@ DataProcessor::DataProcessor(int ind, detectorType dtype, Fifo*& f,
activated(act),
deactivatedPaddingEnable(depaden),
silentMode(sm),
quadEnable(qe),
framePadding(fp),
acquisitionStartedFlag(false),
measurementStartedFlag(false),
@ -248,14 +249,11 @@ void DataProcessor::SetupFileWriter(bool fwe, int* nd, uint32_t* maxf,
}
// only the first file
int DataProcessor::CreateNewFile(bool en, uint64_t nf, uint64_t at, uint64_t st,
uint64_t sp, uint64_t ap) {
int DataProcessor::CreateNewFile(masterAttributes& attr) {
if (file == NULL)
return FAIL;
file->CloseAllFiles();
if (file->CreateMasterFile(en, generalData->imageSize,
generalData->nPixelsX, generalData->nPixelsY,
at, st, sp, ap) == FAIL)
if (file->CreateMasterFile(attr) == FAIL)
return FAIL;
if (file->CreateFile(currentFrameIndex) == FAIL)
return FAIL;
@ -511,31 +509,34 @@ void DataProcessor::InsertGapPixels(char* buf, uint32_t dr) {
memset(tempBuffer, 0xFF, generalData->imageSize);
int rightChip = ((*quadEnable) ? 0 : index); // quad enable, then faking both to be left chips
const uint32_t nx = generalData->nPixelsX;
const uint32_t ny = generalData->nPixelsY;
const uint32_t npx = nx * ny;
bool group3 = (*quadEnable) ? false : true; // if quad enabled, no last line for left chips
char* srcptr = 0;
char* dstptr = 0;
const uint32_t b1px = generalData->imageSize / (npx); // not double as not dealing with 4 bit mode
const uint32_t b2px = 2 * b1px;
const uint32_t b1pxofst = (index ? b1px : 0); // left fpga (index 0) has no extra 1px offset, but right fpga has
const uint32_t b1pxofst = (rightChip ? b1px : 0); // left fpga (chipIndex 0) has no extra 1px offset, but right fpga has
const uint32_t b1chip = 256 * b1px;
const uint32_t b1line = (nx * b1px);
const uint32_t bgroup3chip = b1chip + (group3 ? b1px : 0);
// copying line by line
srcptr = buf;
dstptr = tempBuffer + b1line + b1pxofst; // left fpga (index 0) has no extra 1px offset, but right fpga has
dstptr = tempBuffer + b1line + b1pxofst; // left fpga (chipIndex 0) has no extra 1px offset, but right fpga has
for (uint32_t i = 0; i < (ny-1); ++i) {
memcpy(dstptr, srcptr, b1chip);
srcptr += b1chip;
dstptr += (b1chip + b2px);
memcpy(dstptr, srcptr, b1chip);
srcptr += b1chip;
dstptr += (b1chip + b1px);
dstptr += bgroup3chip;
}
// vertical filling of values
{
char* srcgp1 = 0; char* srcgp2 = 0; char* srcgp3 = 0;
@ -550,28 +551,36 @@ void DataProcessor::InsertGapPixels(char* buf, uint32_t dr) {
dstgp1 = srcgp1 + b1px;
srcgp2 = srcgp1 + b3px;
dstgp2 = dstgp1 + b1px;
if (!index) {
if (group3) {
if (!rightChip) {
srcgp3 = srcptr + b1line - b2px;
dstgp3 = srcgp3 + b1px;
} else {
srcgp3 = srcptr + b1px;
dstgp3 = srcptr;
}
}
switch (dr) {
case 8:
(*((uint8_t*)srcgp1)) = (*((uint8_t*)srcgp1))/2; (*((uint8_t*)dstgp1)) = (*((uint8_t*)srcgp1));
(*((uint8_t*)srcgp2)) = (*((uint8_t*)srcgp2))/2; (*((uint8_t*)dstgp2)) = (*((uint8_t*)srcgp2));
if (group3) {
(*((uint8_t*)srcgp3)) = (*((uint8_t*)srcgp3))/2; (*((uint8_t*)dstgp3)) = (*((uint8_t*)srcgp3));
}
break;
case 16:
(*((uint16_t*)srcgp1)) = (*((uint16_t*)srcgp1))/2; (*((uint16_t*)dstgp1)) = (*((uint16_t*)srcgp1));
(*((uint16_t*)srcgp2)) = (*((uint16_t*)srcgp2))/2; (*((uint16_t*)dstgp2)) = (*((uint16_t*)srcgp2));
if (group3) {
(*((uint16_t*)srcgp3)) = (*((uint16_t*)srcgp3))/2; (*((uint16_t*)dstgp3)) = (*((uint16_t*)srcgp3));
}
break;
default:
(*((uint32_t*)srcgp1)) = (*((uint32_t*)srcgp1))/2; (*((uint32_t*)dstgp1)) = (*((uint32_t*)srcgp1));
(*((uint32_t*)srcgp2)) = (*((uint32_t*)srcgp2))/2; (*((uint32_t*)dstgp2)) = (*((uint32_t*)srcgp2));
if (group3) {
(*((uint32_t*)srcgp3)) = (*((uint32_t*)srcgp3))/2; (*((uint32_t*)dstgp3)) = (*((uint32_t*)srcgp3));
}
break;
}
srcptr += b1line;

View File

@ -16,7 +16,7 @@ const std::string DataStreamer::TypeName = "DataStreamer";
DataStreamer::DataStreamer(int ind, Fifo*& f, uint32_t* dr, std::vector<ROI>* r,
uint64_t* fi, int* fd, char* ajh, bool* sm) :
uint64_t* fi, int fd, char* ajh, bool* sm, int* nd, bool* gpEnable, bool* qe) :
ThreadObject(ind),
runningFlag(0),
generalData(0),
@ -26,14 +26,19 @@ DataStreamer::DataStreamer(int ind, Fifo*& f, uint32_t* dr, std::vector<ROI>* r,
roi(r),
adcConfigured(-1),
fileIndex(fi),
flippedData(fd),
flippedDataX(fd),
additionJsonHeader(ajh),
acquisitionStartedFlag(false),
measurementStartedFlag(false),
firstAcquisitionIndex(0),
firstMeasurementIndex(0),
completeBuffer(0)
completeBuffer(0),
gapPixelsEnable(gpEnable),
quadEnable(qe)
{
numDet[0] = nd[0];
numDet[1] = nd[1];
if(ThreadObject::CreateThread() == FAIL)
throw std::exception();
@ -130,6 +135,15 @@ int DataStreamer::SetThreadPriority(int priority) {
return OK;
}
void DataStreamer::SetNumberofDetectors(int* nd) {
numDet[0] = nd[0];
numDet[1] = nd[1];
}
void DataStreamer::SetFlippedDataX(int fd) {
flippedDataX = fd;
}
void DataStreamer::CreateZmqSockets(int* nunits, uint32_t port, const char* srcip) {
uint32_t portnum = port + index;
@ -235,7 +249,6 @@ void DataStreamer::ProcessAnImage(char* buf) {
//normal
else {
if (!SendHeader(header, (uint32_t)(*((uint32_t*)buf)),
generalData->nPixelsX, generalData->nPixelsY, false)) // new size possibly from callback
cprintf(RED,"Error: Could not send zmq header for fnum %lld and streamer %d\n",
@ -261,13 +274,13 @@ int DataStreamer::SendHeader(sls_receiver_header* rheader, uint32_t size, uint32
uint64_t acquisitionIndex = header.frameNumber - firstAcquisitionIndex;
return zmqSocket->SendHeaderData(index, dummy, SLS_DETECTOR_JSON_HEADER_VERSION, *dynamicRange, *fileIndex,
nx, ny, size,
numDet[0], numDet[1], nx, ny, size,
acquisitionIndex, frameIndex, fileNametoStream,
header.frameNumber, header.expLength, header.packetNumber, header.bunchId, header.timestamp,
header.modId, header.row, header.column, header.reserved,
header.debug, header.roundRNumber,
header.detType, header.version,
flippedData,
*gapPixelsEnable ? 1 : 0, flippedDataX, *quadEnable,
additionJsonHeader
);
}

View File

@ -243,9 +243,7 @@ int HDF5File::WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_t
}
int HDF5File::CreateMasterFile(bool en, uint32_t size,
uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t sp,
uint64_t ap) {
int HDF5File::CreateMasterFile(masterAttributes& attr) {
//beginning of every acquisition
numFramesInFile = 0;
@ -260,11 +258,9 @@ int HDF5File::CreateMasterFile(bool en, uint32_t size,
FILE_LOG(logINFO) << "Master File: " << masterFileName;
}
pthread_mutex_lock(&Mutex);
attr.version = HDF5_WRITER_VERSION;
int ret = HDF5FileStatic::CreateMasterDataFile(masterfd, masterFileName,
*overWriteEnable,
*dynamicRange, en, size, nx, ny, *numImages, *maxFramesPerFile,
at, st, sp, ap,
HDF5_WRITER_VERSION);
*overWriteEnable, attr);
pthread_mutex_unlock(&Mutex);
return ret;
}

View File

@ -20,7 +20,7 @@ const std::string Listener::TypeName = "Listener";
Listener::Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s,
uint32_t* portno, char* e, uint64_t* nf, uint32_t* dr,
uint32_t* us, uint32_t* as, uint32_t* fpf,
uint64_t* us, uint64_t* as, uint32_t* fpf,
frameDiscardPolicy* fdp, bool* act, bool* depaden, bool* sm) :
ThreadObject(ind),
runningFlag(0),
@ -242,7 +242,7 @@ void Listener::ShutDownUDPSocket() {
}
int Listener::CreateDummySocketForUDPSocketBufferSize(uint32_t s) {
int Listener::CreateDummySocketForUDPSocketBufferSize(uint64_t s) {
FILE_LOG(logINFO) << "Testing UDP Socket Buffer size with test port " << *udpPortNumber;
if (!(*activated)) {
@ -250,7 +250,7 @@ int Listener::CreateDummySocketForUDPSocketBufferSize(uint32_t s) {
return OK;
}
uint32_t temp = *udpSocketBufferSize;
uint64_t temp = *udpSocketBufferSize;
*udpSocketBufferSize = s;
//if eth is mistaken with ip address

View File

@ -50,9 +50,9 @@ void UDPBaseImplementation::initializeMembers(){
dynamicRange = 16;
tengigaEnable = false;
fifoDepth = 0;
flippedData[0] = 0;
flippedData[1] = 0;
flippedDataX = 0;
gapPixelsEnable = false;
quadEnable = false;
//***receiver parameters***
status = IDLE;
@ -128,8 +128,14 @@ char *UDPBaseImplementation::getDetectorHostname() const{
int UDPBaseImplementation::getFlippedData(int axis) const{
FILE_LOG(logDEBUG) << __AT__ << " starting";
if(axis<0 || axis > 1) return -1;
return flippedData[axis];
switch(axis) {
case 0:
return flippedDataX;
case 1:
return 0;
default:
return -1;
}
}
bool UDPBaseImplementation::getGapPixelsEnable() const {
@ -137,6 +143,11 @@ bool UDPBaseImplementation::getGapPixelsEnable() const {
return gapPixelsEnable;
}
bool UDPBaseImplementation::getQuad() const {
FILE_LOG(logDEBUG) << __AT__ << " starting";
return quadEnable;
}
/***file parameters***/
slsReceiverDefs::fileFormat UDPBaseImplementation::getFileFormat() const{
FILE_LOG(logDEBUG) << __AT__ << " starting";
@ -356,12 +367,12 @@ char *UDPBaseImplementation::getAdditionalJsonHeader() const{
return output;
}
uint32_t UDPBaseImplementation::getUDPSocketBufferSize() const {
uint64_t UDPBaseImplementation::getUDPSocketBufferSize() const {
FILE_LOG(logDEBUG) << __AT__ << " starting";
return udpSocketBufferSize;
}
uint32_t UDPBaseImplementation::getActualUDPSocketBufferSize() const {
uint64_t UDPBaseImplementation::getActualUDPSocketBufferSize() const {
FILE_LOG(logDEBUG) << __AT__ << " starting";
return actualUDPSocketBufferSize;
}
@ -392,13 +403,18 @@ void UDPBaseImplementation::setMultiDetectorSize(const int* size) {
}
strcat(message,")");
FILE_LOG(logINFO) << message;
// overridden
}
void UDPBaseImplementation::setFlippedData(int axis, int enable){
FILE_LOG(logDEBUG) << __AT__ << " starting";
if(axis<0 || axis>1) return;
flippedData[axis] = enable==0?0:1;
FILE_LOG(logINFO) << "Flipped Data: " << flippedData[0] << " , " << flippedData[1];
if (axis != 0)
return;
flippedDataX = enable==0?0:1;
FILE_LOG(logINFO) << "Flipped Data X: " << flippedDataX;
// overridden
}
int UDPBaseImplementation::setGapPixelsEnable(const bool b) {
@ -410,6 +426,15 @@ int UDPBaseImplementation::setGapPixelsEnable(const bool b) {
return OK;
}
int UDPBaseImplementation::setQuad(const bool b) {
FILE_LOG(logDEBUG) << __AT__ << " starting";
quadEnable = b;
FILE_LOG(logINFO) << "Quad Enable: " << quadEnable;
// overridden
return OK;
}
/***file parameters***/
void UDPBaseImplementation::setFileFormat(const fileFormat f){
FILE_LOG(logDEBUG) << __AT__ << " starting";
@ -786,7 +811,7 @@ void UDPBaseImplementation::setAdditionalJsonHeader(const char c[]){
FILE_LOG(logINFO) << "Additional JSON Header: " << additionalJsonHeader;
}
int UDPBaseImplementation::setUDPSocketBufferSize(const uint32_t s) {
int UDPBaseImplementation::setUDPSocketBufferSize(const uint64_t s) {
FILE_LOG(logDEBUG) << __AT__ << " starting";
udpSocketBufferSize = s;

View File

@ -111,13 +111,60 @@ int64_t UDPStandardImplementation::getAcquisitionIndex() const {
}
void UDPStandardImplementation::setMultiDetectorSize(const int* size) {
char message[100];
strcpy(message, "Detector Size: (");
for (int i = 0; i < MAX_DIMENSIONS; ++i) {
if (myDetectorType == EIGER && (!i))
numDet[i] = size[i]*2;
else
numDet[i] = size[i];
sprintf(message,"%s%d",message,numDet[i]);
if (i < MAX_DIMENSIONS-1 )
strcat(message,",");
}
strcat(message,")");
int nd[2] = {numDet[0], numDet[1]};
if (quadEnable) {
nd[0] = 1;
nd[1] = 2;
}
for (std::vector<DataStreamer*>::const_iterator it = dataStreamer.begin(); it != dataStreamer.end(); ++it){
(*it)->SetNumberofDetectors(nd);
}
FILE_LOG(logINFO) << message;
}
void UDPStandardImplementation::setFlippedData(int axis, int enable){
if (axis != 0)
return;
flippedDataX = enable == 0 ? 0 : 1;
if (!quadEnable) {
for (std::vector<DataStreamer*>::const_iterator it = dataStreamer.begin(); it != dataStreamer.end(); ++it){
(*it)->SetFlippedDataX(flippedDataX);
}
}
else {
if (dataStreamer.size() == 2) {
dataStreamer[0]->SetFlippedDataX(0);
dataStreamer[1]->SetFlippedDataX(1);
}
}
FILE_LOG(logINFO) << "Flipped Data X: " << flippedDataX;
}
int UDPStandardImplementation::setGapPixelsEnable(const bool b) {
if (gapPixelsEnable != b) {
gapPixelsEnable = b;
// side effects
generalData->SetGapPixelsEnable(b, dynamicRange);
generalData->SetGapPixelsEnable(b, dynamicRange, quadEnable);
// to update npixelsx, npixelsy in file writer
for (std::vector<DataProcessor*>::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it)
(*it)->SetPixelDimension();
@ -130,6 +177,38 @@ int UDPStandardImplementation::setGapPixelsEnable(const bool b) {
return OK;
}
int UDPStandardImplementation::setQuad(const bool b) {
if (quadEnable != b) {
quadEnable = b;
generalData->SetGapPixelsEnable(gapPixelsEnable, dynamicRange, b);
// to update npixelsx, npixelsy in file writer
for (std::vector<DataProcessor*>::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it)
(*it)->SetPixelDimension();
numberofJobs = -1; //changes to imagesize has to be noted to recreate fifo structure
if (SetupFifoStructure() == FAIL)
return FAIL;
if (!quadEnable) {
for (std::vector<DataStreamer*>::const_iterator it = dataStreamer.begin(); it != dataStreamer.end(); ++it){
(*it)->SetNumberofDetectors(numDet);
(*it)->SetFlippedDataX(flippedDataX);
}
} else {
int size[2] = {1, 2};
for (std::vector<DataStreamer*>::const_iterator it = dataStreamer.begin(); it != dataStreamer.end(); ++it){
(*it)->SetNumberofDetectors(size);
}
if (dataStreamer.size() == 2) {
dataStreamer[0]->SetFlippedDataX(0);
dataStreamer[1]->SetFlippedDataX(1);
}
}
}
FILE_LOG(logINFO) << "Quad Enable: " << quadEnable;
return OK;
}
void UDPStandardImplementation::setFileFormat(const fileFormat f){
switch(f){
@ -251,8 +330,15 @@ int UDPStandardImplementation::setDataStreamEnable(const bool enable) {
if (enable) {
for ( int i = 0; i < numThreads; ++i ) {
try {
int fd = flippedDataX;
int nd[2] = {numDet[0], numDet[1]};
if (quadEnable) {
fd = i;
nd[0] = 1;
nd[1] = 2;
}
DataStreamer* s = new DataStreamer(i, fifo[i], &dynamicRange,
&roi, &fileIndex, flippedData, additionalJsonHeader, &silentMode);
&roi, &fileIndex, fd, additionalJsonHeader, &silentMode, (int*)nd, &gapPixelsEnable, &quadEnable);
dataStreamer.push_back(s);
dataStreamer[i]->SetGeneralData(generalData);
dataStreamer[i]->CreateZmqSockets(&numThreads, streamingPort, streamingSrcIP);
@ -295,7 +381,7 @@ int UDPStandardImplementation::setDynamicRange(const uint32_t i) {
//side effects
generalData->SetDynamicRange(i,tengigaEnable);
generalData->SetGapPixelsEnable(gapPixelsEnable, dynamicRange);
generalData->SetGapPixelsEnable(gapPixelsEnable, dynamicRange, quadEnable);
// to update npixelsx, npixelsy in file writer
for (std::vector<DataProcessor*>::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it)
(*it)->SetPixelDimension();
@ -314,6 +400,7 @@ int UDPStandardImplementation::setTenGigaEnable(const bool b) {
tengigaEnable = b;
//side effects
generalData->SetTenGigaEnable(b,dynamicRange);
generalData->SetGapPixelsEnable(gapPixelsEnable, dynamicRange, quadEnable);
numberofJobs = -1; //changes to imagesize has to be noted to recreate fifo structure
if (SetupFifoStructure() == FAIL)
@ -396,7 +483,7 @@ int UDPStandardImplementation::setDetectorType(const detectorType d) {
DataProcessor* p = new DataProcessor(i, myDetectorType, fifo[i], &fileFormatType,
fileWriteEnable, &dataStreamEnable, &gapPixelsEnable,
&dynamicRange, &frameToGuiFrequency, &frameToGuiTimerinMS,
&framePadding, &activated, &deactivatedPaddingEnable, &silentMode,
&framePadding, &activated, &deactivatedPaddingEnable, &silentMode, &quadEnable,
rawDataReadyCallBack, rawDataModifyReadyCallBack, pRawDataReady);
dataProcessor.push_back(p);
}
@ -654,7 +741,7 @@ void UDPStandardImplementation::closeFiles() {
dataProcessor[0]->EndofAcquisition(anycaught, maxIndexCaught);
}
int UDPStandardImplementation::setUDPSocketBufferSize(const uint32_t s) {
int UDPStandardImplementation::setUDPSocketBufferSize(const uint64_t s) {
if (listener.size())
return listener[0]->CreateDummySocketForUDPSocketBufferSize(s);
return FAIL;
@ -789,9 +876,23 @@ int UDPStandardImplementation::CreateUDPSockets() {
int UDPStandardImplementation::SetupWriter() {
bool error = false;
masterAttributes attr;
attr.detectorType = myDetectorType;
attr.dynamicRange = dynamicRange;
attr.tenGiga = tengigaEnable;
attr.imageSize = generalData->imageSize;
attr.nPixelsX = generalData->nPixelsX;
attr.nPixelsY = generalData->nPixelsY;
attr.maxFramesPerFile = framesPerFile;
attr.totalFrames = numberOfFrames;
attr.exptimeNs = acquisitionTime;
attr.subExptimeNs = subExpTime;
attr.subPeriodNs = subPeriod;
attr.periodNs = acquisitionPeriod;
attr.gapPixelsEnable = gapPixelsEnable;
attr.quadEnable = quadEnable;
for (unsigned int i = 0; i < dataProcessor.size(); ++i)
if (dataProcessor[i]->CreateNewFile(tengigaEnable,
numberOfFrames, acquisitionTime, subExpTime, subPeriod, acquisitionPeriod) == FAIL) {
if (dataProcessor[i]->CreateNewFile(attr) == FAIL) {
error = true;
break;
}

View File

@ -246,6 +246,7 @@ const char* slsReceiverTCPIPInterface::getFunctionName(enum recFuncs func) {
case F_RECEIVER_DISCARD_POLICY: return "F_RECEIVER_DISCARD_POLICY";
case F_RECEIVER_PADDING_ENABLE: return "F_RECEIVER_PADDING_ENABLE";
case F_RECEIVER_DEACTIVATED_PADDING_ENABLE: return "F_RECEIVER_DEACTIVATED_PADDING_ENABLE";
case F_RECEIVER_QUAD: return "F_RECEIVER_QUAD";
default: return "Unknown Function";
}
@ -303,7 +304,7 @@ int slsReceiverTCPIPInterface::function_table(){
flist[F_RECEIVER_DISCARD_POLICY] = &slsReceiverTCPIPInterface::set_discard_policy;
flist[F_RECEIVER_PADDING_ENABLE] = &slsReceiverTCPIPInterface::set_padding_enable;
flist[F_RECEIVER_DEACTIVATED_PADDING_ENABLE] = &slsReceiverTCPIPInterface::set_deactivated_receiver_padding_enable;
flist[F_RECEIVER_QUAD] = &slsReceiverTCPIPInterface::set_quad_type;
#ifdef VERYVERBOSE
for (int i = 0; i < NUM_REC_FUNCTIONS ; i++) {
@ -2626,8 +2627,8 @@ int slsReceiverTCPIPInterface::set_additional_json_header() {
int slsReceiverTCPIPInterface::set_udp_socket_buffer_size() {
ret = OK;
memset(mess, 0, sizeof(mess));
int index = -1;
int retval = -1;
uint64_t index = -1;
uint64_t retval = -1;
// receive arguments
if (mySock->ReceiveDataOnly(&index,sizeof(index)) < 0 )
@ -2639,7 +2640,7 @@ int slsReceiverTCPIPInterface::set_udp_socket_buffer_size() {
invalidReceiverObject();
else {
// set
if(index >= 0) {
if((int64_t)index >= 0) {
if (mySock->differentClients && lockStatus)
receiverlocked();
else if (receiverBase->getStatus() != IDLE)
@ -2654,9 +2655,10 @@ int slsReceiverTCPIPInterface::set_udp_socket_buffer_size() {
}
//get
retval=receiverBase->getUDPSocketBufferSize();
if(index >= 0 && ((retval != index) || ((int)receiverBase->getActualUDPSocketBufferSize() != (index*2)))) {
if((int64_t)index >= 0 && ((retval != index) || (receiverBase->getActualUDPSocketBufferSize() != (index*2)))) {
ret = FAIL;
strcpy(mess, "Could not set UDP Socket buffer size (No CAP_NET_ADMIN privileges?)\n");
sprintf(mess, "Could not set UDP Socket buffer size (No CAP_NET_ADMIN privileges?). "
"set %lld, got %lld\n", (long long unsigned int)index, (long long unsigned int)retval);
FILE_LOG(logERROR) << mess;
}
}
@ -2981,3 +2983,57 @@ int slsReceiverTCPIPInterface::set_deactivated_receiver_padding_enable() {
// return ok/fail
return ret;
}
int slsReceiverTCPIPInterface::set_quad_type() {
ret = OK;
memset(mess, 0, sizeof(mess));
int value = -1;
int retval = -1;
// receive arguments
if (mySock->ReceiveDataOnly(&value,sizeof(value)) < 0 )
return printSocketReadError();
// execute action
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
if (receiverBase == NULL)
invalidReceiverObject();
else {
// set
if(value >= 0) {
if (mySock->differentClients && lockStatus)
receiverlocked();
else if (receiverBase->getStatus() != IDLE)
receiverNotIdle();
else {
ret = receiverBase->setQuad(value);
if (ret == FAIL) {
strcpy(mess, "Could not set Quad due to fifo structure.\n");
FILE_LOG(logERROR) << mess;
}
}
}
//get
retval = (int)receiverBase->getQuad(); // no check required
}
#endif
#ifdef VERYVERBOSE
FILE_LOG(logINFO) << "Quad mode:" << retval;
#endif
if (ret == OK && mySock->differentClients)
ret = FORCE_UPDATE;
// send answer
mySock->SendDataOnly(&ret,sizeof(ret));
if (ret == FAIL)
mySock->SendDataOnly(mess,sizeof(mess));
mySock->SendDataOnly(&retval,sizeof(retval));
// return ok/fail
return ret;
}