Compare commits

...

135 Commits

Author SHA1 Message Date
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
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
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
17c20748bc updated links in serverbin 2018-03-21 08:28:49 +01:00
d5f8a1b4e7 updated doc 2018-03-20 17:37:48 +01:00
70ce8c1653 updated doc 2018-03-20 17:35:39 +01:00
5203a0d621 updated doc 2018-03-20 16:40:56 +01:00
59ad15b54e eiger server bug fix: in 10giga mode always used the 1g ip (dhcp ip) if detectorip is before tengiga in config file 2018-03-20 16:36:45 +01:00
afac5be3c3 updated release notes 2018-03-20 12:20:15 +01:00
688dd15fe9 Jungfrau bug fix: cannot give same adcphase value to pll, updated recommended default of adcphase for half speed and quarter speed, updated client manuals for both adcphase and clkdivider 2018-03-20 12:12:38 +01: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
74 changed files with 567 additions and 675 deletions

View File

@ -1,353 +1,37 @@
SLS Detector Package 3.1.0 released on 2018-03-12 SLS Detector Package 3.1.5 released on 2018-11-30
================================================= =================================================
INTRODUCTION INTRODUCTION
This document describes the differences between 3.1.0 and 3.0.0 releases. This document describes the differences between 3.1.5 and 3.1.4 releases.
The conda package of the binaries can be downloaded from
https://github.com/slsdetectorgroup/sls_detector_software.git
The Python interface to the software package (including the package) is at
https://github.com/slsdetectorgroup/sls_detector.git
Manual (both HTML and pdf versions) are provided in
manual/docs/
Documentation from Source Code can be found for the Command Line and C++ API in
html:
manual/docs/html/slsDetectorClientDocs/index.html
manual/docs/html/slsDetectorUsersDocs/index.html
pdf:
manual/docs/pdf/slsDetectorClientDocs.pdf
manual/docs/pdf/slsDetectorUsersDocs.pdf
Documentation to the python API is available at
https://slsdetectorgroup.github.io/sls_detector/
Example including binaries for detector and receiver user classes can be found in
manual/manual-api
User documentation can also be accessed directly at this location:
https://www.psi.ch/detectors/users-support
If you have any software related questions or comments, please send them to:
dhanya.thattil@psi.ch
anna.bergamaschi@psi.ch
If you have any python related questions or comments, please send them to:
erik.frojdh@psi.ch
CONTENTS Topics Concerning
==================
- Firmware Requirements - Gotthard adc channel shifted by one
- Changes in User Interface - users class: get version, status, resetframescaught
- New Features
- Resolved Issues
- Known Issues
Firmware Requirements
=====================
Please refer to the link below for more details on the firmware versions.
https://www.psi.ch/detectors/firmware.
Gotthard
========
Minimum compatible version : 11.01.2013
Latest version : 08.02.2018 (50um and 25um Master)
09.02.2018 (25 um Slave)
-Can not be upgraded remotely.
Eiger
=====
Minimum compatible version : 16
Latest version : 20
-Can be upgraded remotely via bit files.
Jungfrau
========
Minimum compatible version : 13.11.2017
Latest version : 13.11.2017
-Can be upgraded remotely via sls_detector_put programfpga <pof>.
Changes in User Interface
=========================
Client
------
1. Additional functions added for advanced users in users class:
(setSpeed, setClockDivider, setReadOutFlags, setDac, getADC,
setAllTrimbits, startReceiver, stopReceiver,
startAcquisition non blocking, setReceiverSilentMode, setHighVoltage,
enableDataStreamingToClient, enableDataStreamingFromReceiver,
setReceiverDataStreamingOutPort, setClientDataStreamingInPort)
2. Zmq set up for client and receiver are separated.
zmqport for client and rx_zmqport for receiver. By default, they are the
same for the slsDetectorGui to work.
3. Users example also works without config file, where detector already
configured in shared memory.
4. Use "sls_detector_get busy 0" to clear acquiring flag in shared memory
caused due to an earlier interrupted acquisition from Ctrl+C"
5. Set bit, clear bit, read register and write register cannot give -1 for
inconsistent values from multiple detectors. One has to check error from
API or read the values individually.
6. multiSlsDetector::char* getSettingsFile() function signature has been
changed to string getSettingsFile().
Receiver
--------
7. Modified the help manaual/main-api/mainReceiver.cpp to make it more
robust (handling child process exit) and flexible to determine upon
start up the number of receivers (child processes), the start TCP port
and whether to call back data.
detReceiver is now executed with [start tcp port] [number of receivers]
[1 for call back, 0 for none] as arguments.
By default, start tcp port is 1954, number of receivers is 1, and call
back is initiated.
8. rx_datastream to enable/disable data streaming in receiver. Using the GUI
or registering data call back in client automatically enables zmq in
receiver and client. "externalgui" is removed from the command line. Use
this command instead.
9. Rx_tcpport argument to the slsReceiver can be given using -t.
Eg. slsReceiver -t1955
New Features
============
Package
-------
1. In addition to the C++ API, the Python API is also now provided.
2. CMAKE now with debug flag and rpath, show warnings, compile only certain
components (such as receiver or gui)
3. One repository for entire package and made available at github.
4. One can do --version or -v to all the binaries to find out the release
version of the particular executable.
5. All the software version numbers have only date in format YYMMDD.
Client
------
6. Parallelized more commands to detector. Beneficial for large detectors.
(setTimer, setFileIndex, setOnline, setReceiverOnline, getReceiverStatus,
resetFramesCaught, setFrameIndex, setFileName, getFramesCaughtByReceiver,
setDynamicRange, setRateCorrection)
Option to also use "sls_detector_put threaded 0" to improve speed by
eliminating progress display during acquisition. Effective only for
large detectors.
Detector Server
---------------
7. (Eiger) Virtual class to execute on pc.
8. One can now read temperatures during acquisition. It goes via the stop
server.
9. (Jungfrau) One can start server in "debug" mode and then program the
new firmware via software command "sls_detector_put programfpga xx.pof".
10. (Jungfrau) Server can exit on start up if either the firmware or the
server is incompatible with each other.
11. (Jungfrau) One is able to set transmission delay (ms) of image for each
individual detector using "txndelay_frame" command. Beneficial for
large detectors.
12. (Jungfrau) One can set a threshold temperature (temp_threshold) and
enable the temperature control feature (temp_control). When the
temperature (temp_fpga) overshoots the threshold temperature, it will
set the temperature event (temp_event) and power off the chip. One must
then switch off the detector and check cooling. Switching back on starts
with defaults.
13. (25um Gotthard) Added start acquisition delay to master module.
14. (Gotthard) New constraints for firmware dated 08.02.2018 and 09.02.2018
(25 um Slave) include minimum exposure time is 186 ns and minimum
period is 1278 ns + current exposure time.
Receiver
--------
14. The detectorip and rx_udpip does not have to be in the same subnet anymore.
Add the following commands after rx_hostname in config file to overwrite
mac configuration:
rx_udpmac [router mac]
configuremac 0
15. Added silent mode to receiver using command r_silent [i] from client.
It might be beneficial for max frame rate applications.
16. Receiver print out can handle black or white backgrounds.
17. zmq package included updated to v4.0.8.
18. Zmq streaming from receiver also sends file index in json header.
Gui
---
19. If acquisition is done, but "stop dummy packet" to the gui was lost in
the network, stop acquisition command will restream it so that the gui
doesnt hang forever. This is used only for very fast detectors like
Moench.
Resolved Issues Resolved Issues
=============== ===============
Detector Server
---------------
1. (Gotthard) The adc channel is shifted by one due to an incorrect ADC pipeline
register. This is fixed now.
Client
Client ------
------ 1. Users class: Get versions gave -1. Has been fixed for single and multi modules.
1. gethostbyname used in connecting to sockets was not thread safe for
multiple detectors. Using getaddrinfo for stability in multi threaded
environment.
2. Updated writing content of config and parameter dump into files. New Features
3. More locking to handle main and processing threads using the threadpool.
Removing unlock twice, which is undefined behavior.
4. (Jungfrau) adcphase returns the correct value, instead of -1.
Detector Server
---------------
4. (Eiger) The hardware MAC of the detector is used during configuration
and relayed back to client. Similarly, hardware IP for 1 Gbe data mode.
5. (Eiger) Status will return error if there was the unlikely trouble
reading status register in the front end board. Earlier, it would only
return idle.
6. (Jungfrau) patch server v3.0.0.6.3
Able to set settings, high voltage now correctly reads 0 when
switched off, dacs are properly set.
7. (Jungfrau) FPGA reset and programming FPGA firmware via software is done
properly
8. (Gotthard) patch server v3.0.0.5.1
Able to read temperature properly.
9. (Gotthard) butst mode if set too fast had unwanted behavior such as
sending same image continuously. Now it is handled to display error
and stop acquisition.
10. (Gotthard) completely removed the possibility to set timing modes
other than auto and trigger as they are not implemented anyway. Also
signal index 1, 2 and 3 are reserved and hence, cannot be configured for
an external trigger.
11. Non Mythen and non Eiger detectors can also now get settings file from
board.
12. (Gotthard) Did not get first few images initially after configuring MAC
of detector. Fixed.
Receiver
--------
12. Made it easier to disable the standard receiver and fixing bugs related
to the use of a custom one.
13. (Jungfrau) HDF5 dimensions (npixelsY) required for mapping fixed.
14. patch2-v3.0.0-slsReceiverSoftware.patch
x, y and z coordinates in the call backs and the files are hardcoded
for this release.
15. Rest implementation (not used by standard receiver) removed.
Gui
---
16. patch1-v3.0.0-slsDetectorGui.patch
(Eiger) In expert mode and in advanced tab, when trimbits
loaded are different for every pixel, the gui complains and sets
all trimbits to zero. This has been resolved. Now, the "Set All
Trimbits" field is just set to -1.
17. Fixed segmentation fault of xputsn properly.
18. Upon clicking on "Start", clears acquiring flag in shared memory
caused due to an earlier interrupted acquisition from Ctrl+C"
19. Fixed plotting twice caused due to unzooming the first time.
20. Removed option for compression in Gui as it is not available currently.
21. Can also show Jungfrau multi detector in x direction in gui.
22. Switching tabs sometimes results in delay and gates fields being incorrectly
enabled. Fixed.
Known Issues
============ ============
Client
Client ------
------ 1. Users class: Added "stopped" to detector status list, resetframescaught in
1. File name prefix can only be done at multi deector level. Changing at receiver function.
individual detector level will not include scan or position variables.
Detector Server
---------------
2. Standard header fills x-coord in 1D. y-coord and z-coord is not
implemented (3D).
Receiver
--------
3. HDF5 compression and filters are not implemented yet.

View File

@ -78,7 +78,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe> </iframe>
</div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 12 Mar 2018 by&nbsp; <hr size="1"/><address style="text-align: right;"><small>Generated on 20 Mar 2018 by&nbsp;
<a href="http://www.doxygen.org/index.html"> <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body> </body>

View File

@ -129,7 +129,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe> </iframe>
</div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 12 Mar 2018 by&nbsp; <hr size="1"/><address style="text-align: right;"><small>Generated on 20 Mar 2018 by&nbsp;
<a href="http://www.doxygen.org/index.html"> <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body> </body>

View File

@ -54,7 +54,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe> </iframe>
</div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 12 Mar 2018 by&nbsp; <hr size="1"/><address style="text-align: right;"><small>Generated on 20 Mar 2018 by&nbsp;
<a href="http://www.doxygen.org/index.html"> <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body> </body>

View File

@ -183,7 +183,7 @@ Versions</a></h2>
Speed</a></h2> Speed</a></h2>
<p>commands to configure speed of detector</p> <p>commands to configure speed of detector</p>
<ul> <ul>
<li><b>clkdivider [i]</b> sets/gets the readout clock divider. EIGER, JUNGFRAU [0(fast speed), 1(half speed), 2(quarter speed)]. MYTHEN[???]. <code>Returns</code> <code></code>(int)</li> <li><b>clkdivider [i]</b> sets/gets the readout clock divider. EIGER, JUNGFRAU [0(fast speed), 1(half speed), 2(quarter speed)]. Jungfrau, full speed is not implemented and overwrites adcphase to recommended default. MYTHEN[???]. <code>Returns</code> <code></code>(int)</li>
</ul> </ul>
<ul> <ul>
<li><b>setlength [i]</b> sets/gets length of set/reset signals (in clock cycles). Used in MYTHEN only. <code>Returns</code> <code></code>(int)</li> <li><b>setlength [i]</b> sets/gets length of set/reset signals (in clock cycles). Used in MYTHEN only. <code>Returns</code> <code></code>(int)</li>
@ -207,7 +207,7 @@ Speed</a></h2>
<li><b>adcclk [i]</b> sets/gets the ADC clock frequency in MHz. For the new chiptestboard!<code>Returns</code> <code></code>(int)</li> <li><b>adcclk [i]</b> sets/gets the ADC clock frequency in MHz. For the new chiptestboard!<code>Returns</code> <code></code>(int)</li>
</ul> </ul>
<ul> <ul>
<li><b>adcphase [i]</b> Sets/gets the ADC clock frequency in MHz. For the new chiptestboard!<code>Returns</code> <code></code>(int)</li> <li><b>adcphase [i]</b> Sets/gets phase of the sampling clock. For JUNGFRAU, setting speed (clkdivider) overwrites adcphase to its default recommended value. (Not for EIGER) <code>Returns</code> <code></code>(int)</li>
</ul> </ul>
<ul> <ul>
<li><b>adcpipeline [i]</b> Sets/gets the pipeline of the ADC. For the new chiptestbaord!<code>Returns</code> <code></code>(int)</li> <li><b>adcpipeline [i]</b> Sets/gets the pipeline of the ADC. For the new chiptestbaord!<code>Returns</code> <code></code>(int)</li>
@ -251,7 +251,7 @@ Detector Parameters</a></h2>
</iframe> </iframe>
</div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 12 Mar 2018 by&nbsp; <hr size="1"/><address style="text-align: right;"><small>Generated on 20 Mar 2018 by&nbsp;
<a href="http://www.doxygen.org/index.html"> <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body> </body>

View File

@ -114,7 +114,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe> </iframe>
</div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 12 Mar 2018 by&nbsp; <hr size="1"/><address style="text-align: right;"><small>Generated on 20 Mar 2018 by&nbsp;
<a href="http://www.doxygen.org/index.html"> <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body> </body>

View File

@ -99,7 +99,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe> </iframe>
</div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 12 Mar 2018 by&nbsp; <hr size="1"/><address style="text-align: right;"><small>Generated on 20 Mar 2018 by&nbsp;
<a href="http://www.doxygen.org/index.html"> <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body> </body>

View File

@ -83,7 +83,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe> </iframe>
</div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 12 Mar 2018 by&nbsp; <hr size="1"/><address style="text-align: right;"><small>Generated on 20 Mar 2018 by&nbsp;
<a href="http://www.doxygen.org/index.html"> <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body> </body>

View File

@ -114,7 +114,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe> </iframe>
</div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 12 Mar 2018 by&nbsp; <hr size="1"/><address style="text-align: right;"><small>Generated on 20 Mar 2018 by&nbsp;
<a href="http://www.doxygen.org/index.html"> <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body> </body>

View File

@ -75,7 +75,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe> </iframe>
</div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 12 Mar 2018 by&nbsp; <hr size="1"/><address style="text-align: right;"><small>Generated on 20 Mar 2018 by&nbsp;
<a href="http://www.doxygen.org/index.html"> <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body> </body>

View File

@ -77,7 +77,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe> </iframe>
</div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 12 Mar 2018 by&nbsp; <hr size="1"/><address style="text-align: right;"><small>Generated on 20 Mar 2018 by&nbsp;
<a href="http://www.doxygen.org/index.html"> <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body> </body>

View File

@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe> </iframe>
</div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 12 Mar 2018 by&nbsp; <hr size="1"/><address style="text-align: right;"><small>Generated on 20 Mar 2018 by&nbsp;
<a href="http://www.doxygen.org/index.html"> <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body> </body>

View File

@ -317,7 +317,7 @@ Temp Control</a></h2>
</iframe> </iframe>
</div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 12 Mar 2018 by&nbsp; <hr size="1"/><address style="text-align: right;"><small>Generated on 20 Mar 2018 by&nbsp;
<a href="http://www.doxygen.org/index.html"> <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body> </body>

View File

@ -96,7 +96,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe> </iframe>
</div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 12 Mar 2018 by&nbsp; <hr size="1"/><address style="text-align: right;"><small>Generated on 20 Mar 2018 by&nbsp;
<a href="http://www.doxygen.org/index.html"> <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body> </body>

View File

@ -114,7 +114,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe> </iframe>
</div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 12 Mar 2018 by&nbsp; <hr size="1"/><address style="text-align: right;"><small>Generated on 20 Mar 2018 by&nbsp;
<a href="http://www.doxygen.org/index.html"> <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body> </body>

View File

@ -1,4 +1,4 @@
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6) (format=latex 2014.12.17) 12 MAR 2018 15:45 This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6) (format=latex 2014.12.17) 20 MAR 2018 12:10
entering extended mode entering extended mode
%&-line parsing enabled. %&-line parsing enabled.
**./images.tex **./images.tex

View File

@ -43,7 +43,7 @@ original version by: Nikos Drakos, CBLU, University of Leeds
<H1 ALIGN="CENTER">SLS Detector text clients manual</H1> <H1 ALIGN="CENTER">SLS Detector text clients manual</H1>
<DIV> <DIV>
<P ALIGN="CENTER"><STRONG>March 12, 2018</STRONG></P> <P ALIGN="CENTER"><STRONG>March 20, 2018</STRONG></P>
</DIV> </DIV>
<P> <P>
@ -148,7 +148,7 @@ original version by: Nikos Drakos, CBLU, University of Leeds
<BR><HR> <BR><HR>
<ADDRESS> <ADDRESS>
Thattil Dhanya Thattil Dhanya
2018-03-12 2018-03-20
</ADDRESS> </ADDRESS>
</BODY> </BODY>
</HTML> </HTML>

View File

@ -123,7 +123,7 @@ For additional questions concerning the indexing of the detector, please refer t
<!--End of Navigation Panel--> <!--End of Navigation Panel-->
<ADDRESS> <ADDRESS>
Thattil Dhanya Thattil Dhanya
2018-03-12 2018-03-20
</ADDRESS> </ADDRESS>
</BODY> </BODY>
</HTML> </HTML>

View File

@ -68,7 +68,7 @@ For additional questions concerning the acquisition flow, please refer to the <I
<BR><HR> <BR><HR>
<ADDRESS> <ADDRESS>
Thattil Dhanya Thattil Dhanya
2018-03-12 2018-03-20
</ADDRESS> </ADDRESS>
</BODY> </BODY>
</HTML> </HTML>

View File

@ -763,7 +763,7 @@ Debug</A>
<!--End of Navigation Panel--> <!--End of Navigation Panel-->
<ADDRESS> <ADDRESS>
Thattil Dhanya Thattil Dhanya
2018-03-12 2018-03-20
</ADDRESS> </ADDRESS>
</BODY> </BODY>
</HTML> </HTML>

View File

@ -815,7 +815,7 @@ Advanced settings changing the analog or digital performance of the acquisition.
<!--End of Navigation Panel--> <!--End of Navigation Panel-->
<ADDRESS> <ADDRESS>
Thattil Dhanya Thattil Dhanya
2018-03-12 2018-03-20
</ADDRESS> </ADDRESS>
</BODY> </BODY>
</HTML> </HTML>

View File

@ -160,7 +160,7 @@ sls_detector_put ratecorr -1
<!--End of Navigation Panel--> <!--End of Navigation Panel-->
<ADDRESS> <ADDRESS>
Thattil Dhanya Thattil Dhanya
2018-03-12 2018-03-20
</ADDRESS> </ADDRESS>
</BODY> </BODY>
</HTML> </HTML>

View File

@ -61,11 +61,11 @@ Mathematics Department, Macquarie University, Sydney.
The command line arguments were: <BR> The command line arguments were: <BR>
<STRONG>latex2html</STRONG> <TT>-split 4 slsDetectorClientHowTo.tex</TT> <STRONG>latex2html</STRONG> <TT>-split 4 slsDetectorClientHowTo.tex</TT>
<P> <P>
The translation was initiated by Thattil Dhanya on 2018-03-12 The translation was initiated by Thattil Dhanya on 2018-03-20
<BR><HR> <BR><HR>
<ADDRESS> <ADDRESS>
Thattil Dhanya Thattil Dhanya
2018-03-12 2018-03-20
</ADDRESS> </ADDRESS>
</BODY> </BODY>
</HTML> </HTML>

View File

@ -43,7 +43,7 @@ original version by: Nikos Drakos, CBLU, University of Leeds
<H1 ALIGN="CENTER">SLS Detector text clients manual</H1> <H1 ALIGN="CENTER">SLS Detector text clients manual</H1>
<DIV> <DIV>
<P ALIGN="CENTER"><STRONG>March 12, 2018</STRONG></P> <P ALIGN="CENTER"><STRONG>March 20, 2018</STRONG></P>
</DIV> </DIV>
<P> <P>
@ -148,7 +148,7 @@ original version by: Nikos Drakos, CBLU, University of Leeds
<BR><HR> <BR><HR>
<ADDRESS> <ADDRESS>
Thattil Dhanya Thattil Dhanya
2018-03-12 2018-03-20
</ADDRESS> </ADDRESS>
</BODY> </BODY>
</HTML> </HTML>

View File

@ -71,11 +71,6 @@ int main(int argc, char **argv) {
/** - registering data callback */ /** - registering data callback */
pDetector->registerDataCallback(&dataCallback, NULL); pDetector->registerDataCallback(&dataCallback, NULL);
/** - if receiver exists, enable data streaming from receiver to get the data */
pDetector->enableDataStreamingFromReceiver(1);
/** - create zmq sockets in client to enable data streaming in of data from receiver/different process */
pDetector->enableDataStreamingToClient(1);
/** - ensuring detector status is idle before starting acquisition. exiting if not idle */ /** - ensuring detector status is idle before starting acquisition. exiting if not idle */

View File

@ -1 +0,0 @@
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.1.0.16.1

View File

@ -0,0 +1 @@
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.1.1.16.0

View File

@ -1 +0,0 @@
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.1.0.1

View File

@ -0,0 +1 @@
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.1.4.0

View File

@ -1 +0,0 @@
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.1.0.2

View File

@ -0,0 +1 @@
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.1.3.0

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorGui Path: slsDetectorsPackage/slsDetectorGui
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: b389402d647e939342dbb2c9317c688c0eb6b105 Repsitory UUID: e094e41d89d91e341bc6cf272b4570145a82446b
Revision: 452 Revision: 456
Branch: 3.1.0-rc Branch: 3.1.5
Last Changed Author: Erik_Frojdh Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3458 Last Changed Rev: 3498
Last Changed Date: 2018-03-09 10:55:40.000000002 +0100 ./src/qTabSettings.cpp Last Changed Date: 2018-11-30 11:03:38.000000002 +0100 ./src/qTabSettings.cpp

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "b389402d647e939342dbb2c9317c688c0eb6b105" #define GITREPUUID "e094e41d89d91e341bc6cf272b4570145a82446b"
#define GITAUTH "Erik_Frojdh" #define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3458 #define GITREV 0x3498
#define GITDATE 0x20180309 #define GITDATE 0x20181130
#define GITBRANCH "3.1.0-rc" #define GITBRANCH "3.1.5"

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: 8b02aa9e91bbee0470492dcf1ff67415851e14fa Repsitory UUID: afac5be3c3674fe87044d3b7a54471291698d4ba
Revision: 315 Revision: 316
Branch: 3.1.0-rc Branch: 3.1.1-rc
Last Changed Author: Erik_Frojdh Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3455 Last Changed Rev: 3467
Last Changed Date: 2018-03-08 16:44:32.000000002 +0100 ./FebRegisterDefs.h Last Changed Date: 2018-03-19 17:26:38.000000002 +0100 ./FebRegisterDefs.h

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "8b02aa9e91bbee0470492dcf1ff67415851e14fa" #define GITREPUUID "afac5be3c3674fe87044d3b7a54471291698d4ba"
#define GITAUTH "Erik_Frojdh" #define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3455 #define GITREV 0x3467
#define GITDATE 0x20180308 #define GITDATE 0x20180319
#define GITBRANCH "3.1.0-rc" #define GITBRANCH "3.1.1-rc"

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware Path: slsDetectorsPackage/slsDetectorSoftware
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: b389402d647e939342dbb2c9317c688c0eb6b105 Repsitory UUID: e094e41d89d91e341bc6cf272b4570145a82446b
Revision: 1714 Revision: 1730
Branch: 3.1.0-rc Branch: 3.1.5
Last Changed Author: Erik_Frojdh Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3458 Last Changed Rev: 3498
Last Changed Date: 2018-03-12 14:19:44.000000002 +0100 ./threadFiles/ThreadPool.o Last Changed Date: 2018-11-30 15:26:47.000000002 +0100 ./threadFiles/ThreadPool.o

View File

@ -905,21 +905,16 @@ int64_t getFrames(){
int64_t setExposureTime(int64_t value){ int64_t setExposureTime(int64_t value){
/* time is in ns */ /* time is in ns */
if (value!=-1) { if (value != -1) {
double actualvalue = value*(1E-9*CLK_FREQ); value = (value * 1E-3 * CLK_FREQ ) + 0.5;
value*=(1E-9*CLK_FREQ);
if(fabs(actualvalue-value)>= 0.5){
if(actualvalue > value)
value++;
else
value--;
}
} }
return set64BitReg(value,SET_EXPTIME_LSB_REG, SET_EXPTIME_MSB_REG)/(1E-9*CLK_FREQ); return (set64BitReg(value,SET_EXPTIME_LSB_REG, SET_EXPTIME_MSB_REG) /
(1E-3 * CLK_FREQ)) + 0.5;
} }
int64_t getExposureTime(){ int64_t getExposureTime(){
return get64BitReg(GET_EXPTIME_LSB_REG, GET_EXPTIME_MSB_REG)/(1E-9*CLK_FREQ); return (get64BitReg(GET_EXPTIME_LSB_REG, GET_EXPTIME_MSB_REG) /
(1E-3 * CLK_FREQ)) + 0.5;
} }
int64_t setGates(int64_t value){ int64_t setGates(int64_t value){
@ -933,23 +928,16 @@ int64_t getGates(){
int64_t setPeriod(int64_t value){ int64_t setPeriod(int64_t value){
/* time is in ns */ /* time is in ns */
if (value!=-1) { if (value!=-1) {
double actualvalue = value*(1E-9*CLK_FREQ); value = (value * 1E-3 * CLK_FREQ ) + 0.5;
value*=(1E-9*CLK_FREQ);
if(fabs(actualvalue-value)>= 0.5){
if(actualvalue > value)
value++;
else
value--;
}
} }
return (set64BitReg(value,SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG) /
(1E-3 * CLK_FREQ)) + 0.5;
return set64BitReg(value,SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG)/(1E-9*CLK_FREQ);
} }
int64_t getPeriod(){ int64_t getPeriod(){
return get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG)/(1E-9*CLK_FREQ); return (get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG) /
(1E-3 * CLK_FREQ)) + 0.5;
} }
int64_t setDelay(int64_t value){ int64_t setDelay(int64_t value){
@ -959,16 +947,11 @@ int64_t setDelay(int64_t value){
value += masterdefaultdelay; value += masterdefaultdelay;
cprintf(BLUE,"Actual delay for master: %lld\n", (long long int) value); cprintf(BLUE,"Actual delay for master: %lld\n", (long long int) value);
} }
double actualvalue = value*(1E-9*CLK_FREQ); value = (value * 1E-3 * CLK_FREQ ) + 0.5;
value*=(1E-9*CLK_FREQ);
if(fabs(actualvalue-value)>= 0.5){
if(actualvalue > value)
value++;
else
value--;
}
} }
int64_t retval = set64BitReg(value,SET_DELAY_LSB_REG, SET_DELAY_MSB_REG)/(1E-9*CLK_FREQ);
int64_t retval = (set64BitReg(value,SET_DELAY_LSB_REG, SET_DELAY_MSB_REG) /
(1E-3 * CLK_FREQ)) + 0.5;
if (masterflags == IS_MASTER) { if (masterflags == IS_MASTER) {
cprintf(BLUE,"Actual delay read from master: %lld\n", (long long int) retval); cprintf(BLUE,"Actual delay read from master: %lld\n", (long long int) retval);
retval -= masterdefaultdelay; retval -= masterdefaultdelay;
@ -978,7 +961,8 @@ int64_t setDelay(int64_t value){
} }
int64_t getDelay(){ int64_t getDelay(){
return get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG)/(1E-9*CLK_FREQ); return (get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG) /
(1E-3 * CLK_FREQ)) + 0.5;
} }
int64_t setTrains(int64_t value){ int64_t setTrains(int64_t value){
@ -996,37 +980,26 @@ int64_t setProbes(int64_t value){
int64_t setProgress() { int64_t setProgress() {
//????? eventually call after setting the registers //????? eventually call after setting the registers
return 0; return 0;
} }
int64_t getProgress() { int64_t getProgress() {
//should be done in firmware!!!! //should be done in firmware!!!!
return 0; return 0;
} }
int64_t getActualTime(){ int64_t getActualTime(){
return get64BitReg(GET_ACTUAL_TIME_LSB_REG, GET_ACTUAL_TIME_MSB_REG)/(1E-9*CLK_FREQ); return (get64BitReg(GET_ACTUAL_TIME_LSB_REG, GET_ACTUAL_TIME_MSB_REG) /
(1E-3 * CLK_FREQ)) + 0.5;
} }
int64_t getMeasurementTime(){ int64_t getMeasurementTime(){
int64_t v=get64BitReg(GET_MEASUREMENT_TIME_LSB_REG, GET_MEASUREMENT_TIME_MSB_REG); int64_t v=get64BitReg(GET_MEASUREMENT_TIME_LSB_REG, GET_MEASUREMENT_TIME_MSB_REG);
/* u_int64_t mask=0x8000000000000000; return (v / (1E-3 * CLK_FREQ)) + 0.5;
if (v & mask ) {
#ifdef VERBOSE
printf("no measurement time left\n");
#endif
return -1E+9;
} else*/
return v/(1E-9*CLK_FREQ);
} }

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/gotthardDetectorServer Path: slsDetectorsPackage/slsDetectorSoftware/gotthardDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: 675d69392a6497d42b23057c7c8783c8dad768d0 Repsitory UUID: 287efde54ae1e0ac2613728af3dd638e86a46d6b
Revision: 223 Revision: 226
Branch: 3.1.0-rc Branch: 3.1.5-rc
Last Changed Author: Dhanya_Thattil Last Changed Author: GitHub_GitHub
Last Changed Rev: 3447 Last Changed Rev: 3494
Last Changed Date: 2018-02-27 14:04:08.000000002 +0100 ./server_funcs.c Last Changed Date: 2018-11-30 11:16:03.000000002 +0100 ./server_defs.h

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "675d69392a6497d42b23057c7c8783c8dad768d0" #define GITREPUUID "287efde54ae1e0ac2613728af3dd638e86a46d6b"
#define GITAUTH "Dhanya_Thattil" #define GITAUTH "GitHub_GitHub"
#define GITREV 0x3447 #define GITREV 0x3494
#define GITDATE 0x20180227 #define GITDATE 0x20181130
#define GITBRANCH "3.1.0-rc" #define GITBRANCH "3.1.5-rc"

View File

@ -42,7 +42,7 @@
#define TOKEN_RESTART_DELAY 0x88000000 #define TOKEN_RESTART_DELAY 0x88000000
#define TOKEN_RESTART_DELAY_ROI 0x1b000000 #define TOKEN_RESTART_DELAY_ROI 0x1b000000
#define TOKEN_TIMING_REV1 0x1f16 #define TOKEN_TIMING_REV1 0x1f16
#define TOKEN_TIMING_REV2 0x1f0f #define TOKEN_TIMING_REV2 0x1f10
#define DEFAULT_PHASE_SHIFT 120 #define DEFAULT_PHASE_SHIFT 120
#define DEFAULT_IP_PACKETSIZE 0x0522 #define DEFAULT_IP_PACKETSIZE 0x0522
@ -54,7 +54,7 @@
#define DEBUGOUT #define DEBUGOUT
#endif #endif
#define CLK_FREQ 32.1E+6 #define CLK_FREQ 32.007729
#endif #endif

View File

@ -75,8 +75,8 @@
#define TIME_FROM_START_MSB_REG (0x11 << 11) #define TIME_FROM_START_MSB_REG (0x11 << 11)
/* Get Delay 64 bit register */ /* Get Delay 64 bit register */
#define GET_DELAY_LSB_REG (0x12 << 11) #define GET_DELAY_LSB_REG (0x12 << 11) // different kind of delay
#define GET_DELAY_MSB_REG (0x13 << 11) #define GET_DELAY_MSB_REG (0x13 << 11) // different kind of delay
/* Get Cycles 64 bit register */ /* Get Cycles 64 bit register */
#define GET_CYCLES_LSB_REG (0x14 << 11) #define GET_CYCLES_LSB_REG (0x14 << 11)
@ -321,8 +321,8 @@
/* Set Delay 64 bit register */ /* Set Delay 64 bit register */
#define SET_DELAY_LSB_REG (0x60 << 11) #define SET_DELAY_LSB_REG (0x60 << 11) // different kind of delay
#define SET_DELAY_MSB_REG (0x61 << 11) #define SET_DELAY_MSB_REG (0x61 << 11) // different kind of delay
/* Set Cycles 64 bit register */ /* Set Cycles 64 bit register */
#define SET_CYCLES_LSB_REG (0x62 << 11) #define SET_CYCLES_LSB_REG (0x62 << 11)

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/jungfrauDetectorServer Path: slsDetectorsPackage/slsDetectorSoftware/jungfrauDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: 8b02aa9e91bbee0470492dcf1ff67415851e14fa Repsitory UUID: e599bfe56f512ea6a262483f61ffd8d67d6c6fcd
Revision: 117 Revision: 119
Branch: 3.1.0-rc Branch: 3.1.3
Last Changed Author: Erik_Frojdh Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3455 Last Changed Rev: 3475
Last Changed Date: 2018-03-08 16:44:32.000000002 +0100 ./RegisterDefs.h Last Changed Date: 2018-06-28 15:11:57.000000002 +0200 ./RegisterDefs.h

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "8b02aa9e91bbee0470492dcf1ff67415851e14fa" #define GITREPUUID "e599bfe56f512ea6a262483f61ffd8d67d6c6fcd"
#define GITAUTH "Erik_Frojdh" #define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3455 #define GITREV 0x3475
#define GITDATE 0x20180308 #define GITDATE 0x20180628
#define GITBRANCH "3.1.0-rc" #define GITBRANCH "3.1.3"

View File

@ -155,18 +155,21 @@ int testBus() {
printf("\nTesting Bus...\n"); printf("\nTesting Bus...\n");
int ret = OK; int ret = OK;
u_int32_t addr = SET_DELAY_LSB_REG; u_int32_t addr = SET_TRIGGER_DELAY_LSB_REG;
int times = 1000 * 1000; int times = 1000 * 1000;
int i = 0; int i = 0;
for (i = 0; i < times; ++i) { for (i = 0; i < times; ++i) {
bus_w(addr, i * 100); bus_w(addr, i * 100);
if (i * 100 != bus_r(SET_DELAY_LSB_REG)) { if (i * 100 != bus_r(addr)) {
cprintf(RED,"ERROR: Mismatch! Wrote 0x%x, read 0x%x\n", i * 100, bus_r(SET_DELAY_LSB_REG)); cprintf(RED,"ERROR: Mismatch! Wrote 0x%x, read 0x%x\n",
i * 100, bus_r(addr));
ret = FAIL; ret = FAIL;
} }
} }
bus_w(addr, 0);
if (ret == OK) if (ret == OK)
printf("Successfully tested bus %d times\n", times); printf("Successfully tested bus %d times\n", times);
return ret; return ret;
@ -487,9 +490,11 @@ int adcPhase(int st){ /**carlos needed clkphase 1 and 2? cehck with Aldo */
printf("Setting ADC Phase to %d\n",st); printf("Setting ADC Phase to %d\n",st);
if (st > 65535 || st < -65535) if (st > 65535 || st < -65535)
return clkPhase[0]; return clkPhase[0];
clkPhase[1] = st - clkPhase[0];
printf(" phase %d\n", clkPhase[1] ); clkPhase[1] = st - clkPhase[0];
if (clkPhase[1] == 0)
return clkPhase[0];
configurePll(); configurePll();
clkPhase[0] = st; clkPhase[0] = st;
return clkPhase[0]; return clkPhase[0];
@ -695,12 +700,12 @@ int64_t getTimeLeft(enum timerIndex ind){
retval = get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG) / (1E-3 * CLK_SYNC); retval = get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG) / (1E-3 * CLK_SYNC);
printf("Getting period left: %lldns\n", (long long int)retval); printf("Getting period left: %lldns\n", (long long int)retval);
break; break;
/*
case DELAY_AFTER_TRIGGER: case DELAY_AFTER_TRIGGER:
retval = get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG) / (1E-3 * CLK_SYNC); retval = get64BitReg(xxx) / (1E-3 * CLK_SYNC);
printf("Getting delay left: %lldns\n", (long long int)retval); printf("Getting delay left: %lldns\n", (long long int)retval);
break; break;
*/
case CYCLES_NUMBER: case CYCLES_NUMBER:
retval = get64BitReg(GET_CYCLES_LSB_REG, GET_CYCLES_MSB_REG); retval = get64BitReg(GET_CYCLES_LSB_REG, GET_CYCLES_MSB_REG);
printf("Getting number of cycles left: %lld\n", (long long int)retval); printf("Getting number of cycles left: %lld\n", (long long int)retval);
@ -1230,8 +1235,12 @@ void configurePll() {
#endif #endif
u_int32_t val; u_int32_t val;
int32_t phase=0, inv=0; int32_t phase=0, inv=0;
// ensuring PLL is never configured with same phase
if (clkPhase[1] == 0) {
return;
}
printf(" phase in %d\n", clkPhase[1]); printf("Configuring PLL with phase in %d\n", clkPhase[1]);
if (clkPhase[1]>0) { if (clkPhase[1]>0) {
inv=0; inv=0;
phase=clkPhase[1]; phase=clkPhase[1];

View File

@ -101,8 +101,8 @@ enum NETWORKINDEX { TXN_FRAME };
#define CONFIG_QUARTER_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_QUARTER_SPEED_10MHZ_VAL + CONFIG_MODE_1_X_10GBE_VAL) #define CONFIG_QUARTER_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_QUARTER_SPEED_10MHZ_VAL + CONFIG_MODE_1_X_10GBE_VAL)
#define ADC_OFST_HALF_SPEED_VAL (0x20) //adc pipeline #define ADC_OFST_HALF_SPEED_VAL (0x20) //adc pipeline
#define ADC_OFST_QUARTER_SPEED_VAL (0x0f) #define ADC_OFST_QUARTER_SPEED_VAL (0x0f)
#define ADC_PHASE_HALF_SPEED (0x41) #define ADC_PHASE_HALF_SPEED (0x48) //72
#define ADC_PHASE_QUARTER_SPEED (0x19) #define ADC_PHASE_QUARTER_SPEED (0x48) //72
/* Maybe not required for jungfrau */ /* Maybe not required for jungfrau */
#define NTRIMBITS (6) #define NTRIMBITS (6)

View File

@ -1974,10 +1974,26 @@ void multiSlsDetector::resetFinalDataQueue() {
GATE_INTEGRATED_TIME GATE_INTEGRATED_TIME
} }
*/ */
int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t){ int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t, int imod){
int64_t ret=-100; int64_t ret=-100;
// single (for gotthard 25 um)
if (imod != -1) {
if (imod >= 0 && imod < thisMultiDetector->numberOfDetectors) {
if (detectors[imod]) {
ret = detectors[imod]->setTimer(index,t,imod);
if(detectors[imod]->getErrorMask())
setErrorMask(getErrorMask()|(1<<imod));
return ret;
}
return -1;
}
return -1;
}
// multi
if(!threadpool){ if(!threadpool){
cout << "Error in creating threadpool. Exiting" << endl; cout << "Error in creating threadpool. Exiting" << endl;
return -1; return -1;
@ -1987,8 +2003,8 @@ int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t){
for(int idet=0; idet<thisMultiDetector->numberOfDetectors; ++idet){ for(int idet=0; idet<thisMultiDetector->numberOfDetectors; ++idet){
if(detectors[idet]){ if(detectors[idet]){
iret[idet]= new int64_t(-1); iret[idet]= new int64_t(-1);
Task* task = new Task(new func2_t<int64_t,timerIndex,int64_t>(&slsDetector::setTimer, Task* task = new Task(new func3_t<int64_t,timerIndex,int64_t,int>(&slsDetector::setTimer,
detectors[idet],index,t,iret[idet])); detectors[idet],index,t,imod,iret[idet]));
threadpool->add_task(task); threadpool->add_task(task);
} }
} }
@ -4485,7 +4501,16 @@ int64_t multiSlsDetector::getId(idMode mode, int imod) {
} }
} }
return -1; ret = -100; int64_t ret1;
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; ++idet)
if (detectors[idet]){
ret1=detectors[idet]->getId(mode, imod);
if(ret==-100)
ret=ret1;
else if (ret!=ret1)
ret=-1;
}
return ret;
} }

View File

@ -688,9 +688,10 @@ class multiSlsDetector : public slsDetectorUtils {
set/get timer value set/get timer value
\param index timer index \param index timer index
\param t time in ns or number of...(e.g. frames, gates, probes) \param t time in ns or number of...(e.g. frames, gates, probes)
\param imod module number (gotthard delay can have different values)
\returns timer set value in ns or number of...(e.g. frames, gates, probes) \returns timer set value in ns or number of...(e.g. frames, gates, probes)
*/ */
int64_t setTimer(timerIndex index, int64_t t=-1); int64_t setTimer(timerIndex index, int64_t t=-1, int imod = -1);
/** /**
set/get timer value set/get timer value
\param index timer index \param index timer index

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "b389402d647e939342dbb2c9317c688c0eb6b105" #define GITREPUUID "e094e41d89d91e341bc6cf272b4570145a82446b"
#define GITAUTH "Erik_Frojdh" #define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3458 #define GITREV 0x3498
#define GITDATE 0x20180312 #define GITDATE 0x20181130
#define GITBRANCH "3.1.0-rc" #define GITBRANCH "3.1.5"

View File

@ -270,7 +270,10 @@ slsDetector::~slsDetector(){
else else
printf("Shared memory %d detached\n", shmId); printf("Shared memory %d detached\n", shmId);
#endif #endif
delete thisReceiver; if(controlSocket) delete controlSocket;
if(stopSocket) delete stopSocket;
if(dataSocket) delete dataSocket;
if(thisReceiver) delete thisReceiver;
}; };
slsDetector::slsDetector(int pos, char *name, int id, int cport,multiSlsDetector *p) : slsDetectorUtils(), slsDetector::slsDetector(int pos, char *name, int id, int cport,multiSlsDetector *p) : slsDetectorUtils(),
@ -1318,6 +1321,26 @@ string slsDetector::checkOnline() {
disconnectControl(); disconnectControl();
#ifdef VERBOSE #ifdef VERBOSE
std::cout<< "online!" << std::endl; std::cout<< "online!" << std::endl;
#endif
}
}
//still cannot connect to socket, controlSocket=0
if(stopSocket){
if (connectStop() == FAIL) {
stopSocket->SetTimeOut(5);
thisDetector->onlineFlag=OFFLINE_FLAG;
delete stopSocket;
stopSocket=NULL;
retval = string(thisDetector->hostname);
#ifdef VERBOSE
std::cout<< "stop offline!" << std::endl;
#endif
} else {
thisDetector->onlineFlag=ONLINE_FLAG;
stopSocket->SetTimeOut(100);
disconnectStop();
#ifdef VERBOSE
std::cout<< "stop online!" << std::endl;
#endif #endif
} }
} }
@ -3698,6 +3721,9 @@ slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings ise
std::cout<< "slsDetector setSettings "<< std::endl; std::cout<< "slsDetector setSettings "<< std::endl;
#endif #endif
if (isettings == -1)
return getSettings(imod);
//only set client shared memory variable for Eiger, settings threshold loads the module data (trimbits, dacs etc.) //only set client shared memory variable for Eiger, settings threshold loads the module data (trimbits, dacs etc.)
if (thisDetector->myDetectorType == EIGER) { if (thisDetector->myDetectorType == EIGER) {
switch(isettings) { switch(isettings) {
@ -4583,7 +4609,7 @@ int slsDetector::startAndReadAllNoWait(){
GATE_INTEGRATED_TIME GATE_INTEGRATED_TIME
} }
*/ */
int64_t slsDetector::setTimer(timerIndex index, int64_t t){ int64_t slsDetector::setTimer(timerIndex index, int64_t t, int imod){
int fnum=F_SET_TIMER,fnum2=F_SET_RECEIVER_TIMER; int fnum=F_SET_TIMER,fnum2=F_SET_RECEIVER_TIMER;
@ -7392,7 +7418,7 @@ int slsDetector::programFPGA(string fname){
#endif #endif
if (thisDetector->onlineFlag==ONLINE_FLAG) { if (thisDetector->onlineFlag==ONLINE_FLAG) {
if (connectControl() == OK){ if (connectControl() == OK){
controlSocket->SendDataOnly(&fnum,sizeof(fnum));cprintf(BG_RED,"size of filesize:%lu\n",sizeof(filesize)); controlSocket->SendDataOnly(&fnum,sizeof(fnum));
controlSocket->SendDataOnly(&filesize,sizeof(filesize)); controlSocket->SendDataOnly(&filesize,sizeof(filesize));
//check opening error //check opening error
controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); controlSocket->ReceiveDataOnly(&ret,sizeof(ret));

View File

@ -1205,9 +1205,10 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
set/get timer value set/get timer value
\param index timer index \param index timer index
\param t time in ns or number of...(e.g. frames, gates, probes) \param t time in ns or number of...(e.g. frames, gates, probes)
\param imod module number (pointless in slsDetector)
\returns timer set value in ns or number of...(e.g. frames, gates, probes) \returns timer set value in ns or number of...(e.g. frames, gates, probes)
*/ */
int64_t setTimer(timerIndex index, int64_t t=-1); int64_t setTimer(timerIndex index, int64_t t=-1, int imod = -1);
/** /**
get current timer value get current timer value

View File

@ -345,11 +345,11 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
\returns id \returns id
*/ */
virtual int64_t getId(idMode mode, int imod=0)=0; virtual int64_t getId(idMode mode, int imod=0)=0;
int64_t getModuleFirmwareVersion(){return getId(MODULE_FIRMWARE_VERSION,-1);}; int64_t getModuleFirmwareVersion(int imod=-1){return getId(MODULE_FIRMWARE_VERSION,imod);};
int64_t getModuleSerialNumber(int imod=-1){return getId(MODULE_SERIAL_NUMBER,imod);}; int64_t getModuleSerialNumber(int imod=-1){return getId(MODULE_SERIAL_NUMBER,imod);};
int64_t getDetectorFirmwareVersion(){return getId(DETECTOR_FIRMWARE_VERSION,-1);}; int64_t getDetectorFirmwareVersion(int imod=-1){return getId(DETECTOR_FIRMWARE_VERSION,imod);};
int64_t getDetectorSerialNumber(){return getId(DETECTOR_SERIAL_NUMBER,-1);}; int64_t getDetectorSerialNumber(int imod=-1){return getId(DETECTOR_SERIAL_NUMBER,imod);};
int64_t getDetectorSoftwareVersion(){return getId(DETECTOR_SOFTWARE_VERSION,-1);}; int64_t getDetectorSoftwareVersion(int imod=-1){return getId(DETECTOR_SOFTWARE_VERSION,imod);};
int64_t getThisSoftwareVersion(){return getId(THIS_SOFTWARE_VERSION,-1);}; int64_t getThisSoftwareVersion(){return getId(THIS_SOFTWARE_VERSION,-1);};
/** /**
@ -369,16 +369,17 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
set/get timer value set/get timer value
\param index timer index \param index timer index
\param t time in ns or number of...(e.g. frames, gates, probes) \param t time in ns or number of...(e.g. frames, gates, probes)
\param imod module number
\returns timer set value in ns or number of...(e.g. frames, gates, probes) \returns timer set value in ns or number of...(e.g. frames, gates, probes)
*/ */
virtual int64_t setTimer(timerIndex index, int64_t t=-1)=0; virtual int64_t setTimer(timerIndex index, int64_t t=-1, int imod = -1) = 0;
int64_t setExposureTime(int64_t t=-1){return setTimer(ACQUISITION_TIME,t);}; int64_t setExposureTime(int64_t t=-1, int imod = -1){return setTimer(ACQUISITION_TIME,t,imod);};
int64_t setSubFrameExposureTime(int64_t t=-1){return setTimer(SUBFRAME_ACQUISITION_TIME,t);}; int64_t setSubFrameExposureTime(int64_t t=-1, int imod = -1){return setTimer(SUBFRAME_ACQUISITION_TIME,t,imod);};
int64_t setExposurePeriod(int64_t t=-1){return setTimer(FRAME_PERIOD,t);}; int64_t setExposurePeriod(int64_t t=-1, int imod = -1){return setTimer(FRAME_PERIOD,t,imod);};
int64_t setDelayAfterTrigger(int64_t t=-1){return setTimer(DELAY_AFTER_TRIGGER,t);}; int64_t setDelayAfterTrigger(int64_t t=-1, int imod = -1){return setTimer(DELAY_AFTER_TRIGGER,t,imod);};
int64_t setNumberOfGates(int64_t t=-1){return setTimer(GATES_NUMBER,t);}; int64_t setNumberOfGates(int64_t t=-1, int imod = -1){return setTimer(GATES_NUMBER,t,imod);};
int64_t setNumberOfFrames(int64_t t=-1){return setTimer(FRAME_NUMBER,t);}; int64_t setNumberOfFrames(int64_t t=-1, int imod = -1){return setTimer(FRAME_NUMBER,t,imod);};
int64_t setNumberOfCycles(int64_t t=-1){return setTimer(CYCLES_NUMBER,t);}; int64_t setNumberOfCycles(int64_t t=-1, int imod = -1){return setTimer(CYCLES_NUMBER,t,imod);};
/** sets/gets the value of important readout speed parameters /** sets/gets the value of important readout speed parameters
@ -816,6 +817,7 @@ virtual int enableDataStreamingFromReceiver(int enable=-1)=0;
case RUNNING: return string("running");\ case RUNNING: return string("running");\
case TRANSMITTING: return string("data"); \ case TRANSMITTING: return string("data"); \
case RUN_FINISHED: return string("finished"); \ case RUN_FINISHED: return string("finished"); \
case STOPPED: return string("stopped");\
default: return string("idle"); \ default: return string("idle"); \
}}; }};

View File

@ -710,7 +710,7 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
*/ */
/*! \page config /*! \page config
- <b>clkdivider [i]</b> sets/gets the readout clock divider. EIGER, JUNGFRAU [0(fast speed), 1(half speed), 2(quarter speed)]. MYTHEN[???]. \c Returns \c (int) - <b>clkdivider [i]</b> sets/gets the readout clock divider. EIGER, JUNGFRAU [0(fast speed), 1(half speed), 2(quarter speed)]. Jungfrau, full speed is not implemented and overwrites adcphase to recommended default. MYTHEN[???]. \c Returns \c (int)
*/ */
descrToFuncMap[i].m_pFuncName="clkdivider"; // descrToFuncMap[i].m_pFuncName="clkdivider"; //
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed;
@ -766,7 +766,7 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
++i; ++i;
/*! \page config /*! \page config
- <b>adcphase [i]</b> Sets/gets the ADC clock frequency in MHz. For the new chiptestboard!\c Returns \c (int) - <b>adcphase [i]</b> Sets/gets phase of the sampling clock. For JUNGFRAU, setting speed (clkdivider) overwrites adcphase to its default recommended value. (Not for EIGER) \c Returns \c (int)
*/ */
descrToFuncMap[i].m_pFuncName="adcphase"; // descrToFuncMap[i].m_pFuncName="adcphase"; //
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed;
@ -5464,11 +5464,8 @@ string slsDetectorCommand::cmdTimer(int narg, char *args[], int action) {
else else
return string("cannot scan timer value ")+string(args[1]); return string("cannot scan timer value ")+string(args[1]);
if (index==ACQUISITION_TIME || index==SUBFRAME_ACQUISITION_TIME || index==FRAME_PERIOD || index==DELAY_AFTER_TRIGGER) { if (index==ACQUISITION_TIME || index==SUBFRAME_ACQUISITION_TIME || index==FRAME_PERIOD || index==DELAY_AFTER_TRIGGER) {
// t=(int64_t)(val*1E+9); for precision of eg.0.0000325, following done // +0.5 for precision of eg.0.0000325
val*=1E9; t = ( val * 1E9 + 0.5);
t = (int64_t)val;
if(fabs(val-t)) // to validate precision loss
t = t + val - t; //even t += vak-t loses precision
}else t=(int64_t)val; }else t=(int64_t)val;
} }
@ -5685,9 +5682,6 @@ string slsDetectorCommand::cmdSpeed(int narg, char *args[], int action) {
return string("cannot scan speed value ")+string(args[1]); return string("cannot scan speed value ")+string(args[1]);
} }
// -1 could work
else if (cmd=="adcphase")
t = 65536;
myDet->setOnline(ONLINE_FLAG); myDet->setOnline(ONLINE_FLAG);
@ -5707,21 +5701,23 @@ string slsDetectorCommand::helpSpeed(int narg, char *args[], int action) {
ostringstream os; ostringstream os;
if (action==PUT_ACTION || action==HELP_ACTION) { if (action==PUT_ACTION || action==HELP_ACTION) {
os << "clkdivider c \t sets readout clock divider" << std::endl; os << "clkdivider c \t sets readout clock divider. For Jungfrau, it also overwrites adcphase to recommended default" << std::endl;
os << "setlength c\t sets the length of the set/reset signals (in clock cycles)" << std::endl; os << "setlength c\t sets the length of the set/reset signals (in clock cycles)" << std::endl;
os << "waitstates c \t sets the waitstates of the bus interface" << std::endl; os << "waitstates c \t sets the waitstates of the bus interface" << std::endl;
os << "totdivider c\t sets the clock divider in tot mode" << std::endl; os << "totdivider c\t sets the clock divider in tot mode" << std::endl;
os << "totdutycycle c\t sets the duty cycle of the tot clock" << std::endl; os << "totdutycycle c\t sets the duty cycle of the tot clock" << std::endl;
os << "adcphase c\t Sets phase of the sampling clock. For JUNGFRAU, setting speed (clkdivider) overwrites adcphase to its default recommended value. (Not for EIGER)" << std::endl;
os << std::endl; os << std::endl;
} }
if (action==GET_ACTION || action==HELP_ACTION) { if (action==GET_ACTION || action==HELP_ACTION) {
os << "clkdivider \t gets readout clock divider" << std::endl; os << "clkdivider \t gets readout clock divider. For Jungfrau, it also overwrites adcphase to recommended default" << std::endl;
os << "setlength \t gets the length of the set/reset signals (in clock cycles)" << std::endl; os << "setlength \t gets the length of the set/reset signals (in clock cycles)" << std::endl;
os << "waitstates \t gets the waitstates of the bus interface" << std::endl; os << "waitstates \t gets the waitstates of the bus interface" << std::endl;
os << "totdivider \t gets the clock divider in tot mode" << std::endl; os << "totdivider \t gets the clock divider in tot mode" << std::endl;
os << "totdutycycle \t gets the duty cycle of the tot clock" << std::endl; os << "totdutycycle \t gets the duty cycle of the tot clock" << std::endl;
os << "totdutycycle \t gets phase of the sampling clock. For JUNGFRAU, setting speed (clkdivider) overwrites adcphase to its default recommended value. (Not for EIGER)" << std::endl;
os << std::endl; os << std::endl;
} }

View File

@ -151,43 +151,58 @@ int slsDetectorUsers::setThresholdEnergy(int e_eV){
return myDetector->setThresholdEnergy(e_eV); return myDetector->setThresholdEnergy(e_eV);
} }
double slsDetectorUsers::setExposureTime(double t, bool inseconds){ double slsDetectorUsers::setExposureTime(double t, bool inseconds, int imod){
int64_t tms = (int64_t)(t * (1E+9));
if (t < 0) tms = -1;
if(!inseconds) if(!inseconds)
return myDetector->setExposureTime((int64_t)t); return myDetector->setExposureTime((int64_t)t,imod);
else else {
return ((1E-9) * (double)myDetector->setExposureTime(tms)); // + 0.5 to round for precision lost from converting double to int64_t
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
if (t < 0) tms = -1;
tms = myDetector->setExposureTime(tms,imod);
if (tms < 0)
return -1;
return ((1E-9) * (double)tms);
}
} }
double slsDetectorUsers::setExposurePeriod(double t, bool inseconds){ double slsDetectorUsers::setExposurePeriod(double t, bool inseconds, int imod){
int64_t tms = (int64_t)(t * (1E+9));
if (t < 0) tms = -1;
if(!inseconds) if(!inseconds)
return myDetector->setExposurePeriod((int64_t)t); return myDetector->setExposurePeriod((int64_t)t,imod);
else else {
return ((1E-9) * (double)myDetector->setExposurePeriod(tms)); // + 0.5 to round for precision lost from converting double to int64_t
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
if (t < 0) tms = -1;
tms = myDetector->setExposurePeriod(tms,imod);
if (tms < 0)
return -1;
return ((1E-9) * (double)tms);
}
} }
double slsDetectorUsers::setDelayAfterTrigger(double t, bool inseconds){ double slsDetectorUsers::setDelayAfterTrigger(double t, bool inseconds, int imod){
int64_t tms = (int64_t)(t * (1E+9));
if (t < 0) tms = -1;
if(!inseconds) if(!inseconds)
return myDetector->setDelayAfterTrigger((int64_t)t); return myDetector->setDelayAfterTrigger((int64_t)t,imod);
else else {
return ((1E-9) * (double)myDetector->setDelayAfterTrigger(tms)); // + 0.5 to round for precision lost from converting double to int64_t
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
if (t < 0) tms = -1;
tms = myDetector->setDelayAfterTrigger(tms,imod);
if (tms < 0)
return -1;
return ((1E-9) * (double)tms);
}
} }
int64_t slsDetectorUsers::setNumberOfGates(int64_t t){ int64_t slsDetectorUsers::setNumberOfGates(int64_t t, int imod){
return myDetector->setNumberOfGates(t); return myDetector->setNumberOfGates(t,imod);
} }
int64_t slsDetectorUsers::setNumberOfFrames(int64_t t){ int64_t slsDetectorUsers::setNumberOfFrames(int64_t t, int imod){
return myDetector->setNumberOfFrames(t); return myDetector->setNumberOfFrames(t,imod);
} }
int64_t slsDetectorUsers::setNumberOfCycles(int64_t t){ int64_t slsDetectorUsers::setNumberOfCycles(int64_t t, int imod){
return myDetector->setNumberOfCycles(t); return myDetector->setNumberOfCycles(t,imod);
} }
int slsDetectorUsers::setTimingMode(int pol){ int slsDetectorUsers::setTimingMode(int pol){
@ -243,24 +258,24 @@ int slsDetectorUsers::setClientDataStreamingInPort(int i){
return myDetector->setClientDataStreamingInPort(i); return myDetector->setClientDataStreamingInPort(i);
} }
int64_t slsDetectorUsers::getModuleFirmwareVersion(){ int64_t slsDetectorUsers::getModuleFirmwareVersion(int imod){
return myDetector->getModuleFirmwareVersion(); return myDetector->getModuleFirmwareVersion(imod);
} }
int64_t slsDetectorUsers::getModuleSerialNumber(int imod){ int64_t slsDetectorUsers::getModuleSerialNumber(int imod){
return myDetector->getModuleSerialNumber(imod); return myDetector->getModuleSerialNumber(imod);
} }
int64_t slsDetectorUsers::getDetectorFirmwareVersion(){ int64_t slsDetectorUsers::getDetectorFirmwareVersion(int imod){
return myDetector->getDetectorFirmwareVersion(); return myDetector->getDetectorFirmwareVersion(imod);
} }
int64_t slsDetectorUsers::getDetectorSerialNumber(){ int64_t slsDetectorUsers::getDetectorSerialNumber(int imod){
return myDetector->getDetectorSerialNumber(); return myDetector->getDetectorSerialNumber(imod);
} }
int64_t slsDetectorUsers::getDetectorSoftwareVersion(){ int64_t slsDetectorUsers::getDetectorSoftwareVersion(int imod){
return myDetector->getDetectorSoftwareVersion(); return myDetector->getDetectorSoftwareVersion(imod);
} }
int64_t slsDetectorUsers::getThisSoftwareVersion(){ int64_t slsDetectorUsers::getThisSoftwareVersion(){
@ -374,3 +389,7 @@ int slsDetectorUsers::setReceiverSilentMode(int i) {
int slsDetectorUsers::setHighVoltage(int i) { int slsDetectorUsers::setHighVoltage(int i) {
return myDetector->setHighVoltage(i); return myDetector->setHighVoltage(i);
} }
int slsDetectorUsers::resetFramesCaughtInReceiver() {
return myDetector->resetFramesCaught();
}

View File

@ -77,7 +77,7 @@ You can find examples of how this classes can be instatiated in mainClient.cpp
@libdoc The slsDetectorUsers class is a minimal interface class which should be instantiated by the users in their acquisition software (EPICS, spec etc.). More advanced configuration functions are not implemented and can be written in a configuration or parameters file that can be read/written. @libdoc The slsDetectorUsers class is a minimal interface class which should be instantiated by the users in their acquisition software (EPICS, spec etc.). More advanced configuration functions are not implemented and can be written in a configuration or parameters file that can be read/written.
*/ */
/** /**
@short Class for detector functionalitiesto embed the detector controls in the users custom interface e.g. EPICS, Lima etc. @short Class for detector functionalities to embed the detector controls in the users custom interface e.g. EPICS, Lima etc.
*/ */
@ -270,7 +270,7 @@ class slsDetectorUsers
*/ */
int getDetectorSize(int &x0, int &y0, int &nx, int &ny); int getDetectorSize(int &x0, int &y0, int &nx, int &ny);
/** /**
@short setsthe maximum detector size @short gets the maximum detector size
\param x0 horizontal position origin in channel number \param x0 horizontal position origin in channel number
\param y0 vertical position origin in channel number \param y0 vertical position origin in channel number
\param nx number of channels in horiziontal \param nx number of channels in horiziontal
@ -315,47 +315,53 @@ class slsDetectorUsers
@short set/get exposure time value @short set/get exposure time value
\param t time in sn (-1 gets) \param t time in sn (-1 gets)
\param inseconds true if the value is in s, else ns \param inseconds true if the value is in s, else ns
\param imod module number (-1 for all)
\returns timer set value in ns, or s if specified \returns timer set value in ns, or s if specified
*/ */
double setExposureTime(double t=-1, bool inseconds=false); double setExposureTime(double t=-1, bool inseconds=false, int imod = -1);
/** /**
@short set/get exposure period @short set/get exposure period
\param t time in ns (-1 gets) \param t time in ns (-1 gets)
\param inseconds true if the value is in s, else ns \param inseconds true if the value is in s, else ns
\param imod module number (-1 for all)
\returns timer set value in ns, or s if specified \returns timer set value in ns, or s if specified
*/ */
double setExposurePeriod(double t=-1, bool inseconds=false); double setExposurePeriod(double t=-1, bool inseconds=false, int imod = -1);
/** /**
@short set/get delay after trigger @short set/get delay after trigger
\param t time in ns (-1 gets) \param t time in ns (-1 gets)
\param inseconds true if the value is in s, else ns \param inseconds true if the value is in s, else ns
\param imod module number (-1 for all)
\returns timer set value in ns, or s if specified \returns timer set value in ns, or s if specified
*/ */
double setDelayAfterTrigger(double t=-1, bool inseconds=false); double setDelayAfterTrigger(double t=-1, bool inseconds=false, int imod = -1);
/** /**
@short set/get number of gates @short set/get number of gates
\param t number of gates (-1 gets) \param t number of gates (-1 gets)
\param imod module number (-1 for all)
\returns number of gates \returns number of gates
*/ */
int64_t setNumberOfGates(int64_t t=-1); int64_t setNumberOfGates(int64_t t=-1, int imod = -1);
/** /**
@short set/get number of frames i.e. number of exposure per trigger @short set/get number of frames i.e. number of exposure per trigger
\param t number of frames (-1 gets) \param t number of frames (-1 gets)
\param imod module number (-1 for all)
\returns number of frames \returns number of frames
*/ */
int64_t setNumberOfFrames(int64_t t=-1); int64_t setNumberOfFrames(int64_t t=-1, int imod = -1);
/** /**
@short set/get number of cycles i.e. number of triggers @short set/get number of cycles i.e. number of triggers
\param t number of frames (-1 gets) \param t number of frames (-1 gets)
\param imod module number (-1 for all)
\returns number of frames \returns number of frames
*/ */
int64_t setNumberOfCycles(int64_t t=-1); int64_t setNumberOfCycles(int64_t t=-1, int imod = -1);
/** /**
@ -477,12 +483,13 @@ class slsDetectorUsers
/** /**
get get Module Firmware Version get get Module Firmware Version
@param imod module number
\returns id \returns id
*/ */
int64_t getModuleFirmwareVersion(); int64_t getModuleFirmwareVersion(int imod=-1);
/** /**
get get Module Serial Number get get Module Serial Number (mythen only)
@param imod module number @param imod module number
\returns id \returns id
*/ */
@ -490,21 +497,24 @@ class slsDetectorUsers
/** /**
get get Detector Firmware Version get get Detector Firmware Version
@param imod module number
\returns id \returns id
*/ */
int64_t getDetectorFirmwareVersion(); int64_t getDetectorFirmwareVersion(int imod=-1);
/** /**
get get Detector Serial Number get get Detector Serial Number
@param imod module number
\returns id \returns id
*/ */
int64_t getDetectorSerialNumber(); int64_t getDetectorSerialNumber(int imod=-1);
/** /**
get get Detector Software Version get get Detector Software Version
@param imod module number
\returns id \returns id
*/ */
int64_t getDetectorSoftwareVersion(); int64_t getDetectorSoftwareVersion(int imod=-1);
/** /**
get this Software Version get this Software Version
@ -653,6 +663,13 @@ class slsDetectorUsers
*/ */
int setHighVoltage(int i); int setHighVoltage(int i);
/**
* reset frames caught in receiver
* should be called before startReceiver()
* @returns OK or FAIL
*/
int resetFramesCaughtInReceiver();
/************************************************************************ /************************************************************************
STATIC FUNCTIONS STATIC FUNCTIONS
@ -671,6 +688,7 @@ class slsDetectorUsers
case 3: return string("finished"); \ case 3: return string("finished"); \
case 4: return string("data"); \ case 4: return string("data"); \
case 5: return string("running"); \ case 5: return string("running"); \
case 6: return string("stopped"); \
default: return string("unknown"); \ default: return string("unknown"); \
}}; }};

View File

@ -39,6 +39,9 @@ char mess[MAX_STR_LENGTH];
int dataBytes = 10; int dataBytes = 10;
int isControlServer = 0; int isControlServer = 0;
int debugflag = 0; int debugflag = 0;
#ifdef EIGERD
uint32_t dhcpipad = 0;
#endif
/* initialization functions */ /* initialization functions */
@ -64,6 +67,9 @@ void init_detector(int controlserver) {
if (controlserver) { if (controlserver) {
isControlServer = 1; isControlServer = 1;
initControlServer(); initControlServer();
#ifdef EIGERD
dhcpipad = getDetectorIP();
#endif
} }
else initStopServer(); else initStopServer();
#endif #endif
@ -2621,36 +2627,50 @@ int get_time_left(int file_des) {
printf("getting time left on timer %d \n",ind); printf("getting time left on timer %d \n",ind);
#endif #endif
#ifdef SLS_DETECTOR_FUNCTION_LIST #ifdef SLS_DETECTOR_FUNCTION_LIST
switch(ind) {
#ifdef MYTHEND
case PROBES_NUMBER:
#endif
case FRAME_NUMBER:
case ACQUISITION_TIME:
case FRAME_PERIOD:
case DELAY_AFTER_TRIGGER:
#ifndef JUNGFRAUD
case GATES_NUMBER:
#endif
case CYCLES_NUMBER:
case PROGRESS:
case ACTUAL_TIME:
case MEASUREMENT_TIME:
#ifdef JUNGFRAUD #ifdef JUNGFRAUD
case FRAMES_FROM_START: if (ind == DELAY_AFTER_TRIGGER) {
case FRAMES_FROM_START_PG:
#endif
retval=getTimeLeft(ind);
break;
default:
ret = FAIL; ret = FAIL;
sprintf(mess,"Timer Left Index (%d) is not implemented for this detector\n", (int)ind); sprintf(mess,"Timer Left Index (%d) is not implemented for this release.\n", (int)ind);
cprintf(RED, "%s", mess); cprintf(RED, "%s", mess);
break; } else {
}
#ifdef VERBOSE
printf("Time left on timer %d is %lld\n",ind, retval);
#endif #endif
switch(ind) {
#ifdef MYTHEND
case PROBES_NUMBER:
#endif
case FRAME_NUMBER:
case ACQUISITION_TIME:
case FRAME_PERIOD:
case DELAY_AFTER_TRIGGER:
#ifndef JUNGFRAUD
case GATES_NUMBER:
#endif
case CYCLES_NUMBER:
case PROGRESS:
case ACTUAL_TIME:
case MEASUREMENT_TIME:
#ifdef JUNGFRAUD
case FRAMES_FROM_START:
case FRAMES_FROM_START_PG:
#endif
retval=getTimeLeft(ind);
break;
default:
ret = FAIL;
sprintf(mess,"Timer Left Index (%d) is not implemented for this detector\n", (int)ind);
cprintf(RED, "%s", mess);
break;
}
#ifdef VERBOSE
printf("Time left on timer %d is %lld\n",ind, retval);
#endif
#ifdef JUNGFRAUD
} // end of if (ind == DELAY_AFTER_TRIGGER)
#endif
#endif #endif
if (ret==OK && differentClients) if (ret==OK && differentClients)
ret=FORCE_UPDATE; ret=FORCE_UPDATE;
@ -2988,7 +3008,7 @@ int set_speed(int file_des) {
#ifdef JUNGFRAUD #ifdef JUNGFRAUD
case ADC_PHASE: case ADC_PHASE:
retval = adcPhase(val); retval = adcPhase(val);
if ((val != 65536) && (retval!=val) && (val>=0)) { if ((val != 100000) && (retval!=val) && (val>=0)) {
ret=FAIL; ret=FAIL;
sprintf(mess,"could not change set adc phase: should be %d but is %d \n", val, retval); sprintf(mess,"could not change set adc phase: should be %d but is %d \n", val, retval);
cprintf(RED, "Warning: %s", mess); cprintf(RED, "Warning: %s", mess);
@ -3488,16 +3508,19 @@ int configure_mac(int file_des) {
printf("WARNING: Matched detectormac to the hardware mac now\n"); printf("WARNING: Matched detectormac to the hardware mac now\n");
printf("*************************************************\n"); printf("*************************************************\n");
} }
// always remember the ip sent from the client (could be for 10g(if not dhcp))
if (detipad != getDetectorIP())
dhcpipad = detipad;
//only for 1Gbe //only for 1Gbe
if(!enableTenGigabitEthernet(-1)){ if(!enableTenGigabitEthernet(-1)){
if (detipad != getDetectorIP()){ printf("*************************************************\n");
printf("*************************************************\n"); printf("WARNING: Using DHCP IP for Configuring MAC\n");
printf("WARNING: actual detector ip address %x does not match the one from client %x\n",getDetectorIP(),detipad); printf("*************************************************\n");
detipad = getDetectorIP(); detipad = getDetectorIP();
printf("WARNING: Matched detector ip to the hardware ip now\n"); } else
printf("*************************************************\n"); detipad = dhcpipad;
}
}
#endif #endif
retval=configureMAC(ipad,imacadd,idetectormacadd,detipad,udpport,udpport2,0); //digitalTestBit); retval=configureMAC(ipad,imacadd,idetectormacadd,detipad,udpport,udpport2,0); //digitalTestBit);
if(retval==-1) { if(retval==-1) {

View File

@ -15,9 +15,7 @@ receiverInterface::receiverInterface(MySocketTCP *socket):dataSocket(socket){}
receiverInterface::~receiverInterface(){ receiverInterface::~receiverInterface(){}
delete dataSocket;
}

View File

@ -110,7 +110,7 @@ class SuperTask: public virtual slsDetectorDefs {
public: public:
SuperTask(): SuperTask():
m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0),m9(0),m10(0),m11(0),m12(0),m13(0),m14(0),m15(0),m16(0),m17(0),m18(0){}; m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0),m9(0),m10(0),m11(0),m12(0),m13(0),m14(0),m15(0),m16(0),m17(0),m18(0){};
~SuperTask(){}; virtual ~SuperTask(){};
protected: protected:
/** Function signature defined /** Function signature defined
* First argument is Return type, the remaining are arguments * First argument is Return type, the remaining are arguments
@ -127,7 +127,7 @@ protected:
func2_t <int, string,int>* m10; func2_t <int, string,int>* m10;
func2_t <dacs_t, dacIndex,int>* m11; func2_t <dacs_t, dacIndex,int>* m11;
func2_t <detectorSettings, detectorSettings,int>* m12; func2_t <detectorSettings, detectorSettings,int>* m12;
func2_t <int64_t, timerIndex,int64_t>* m13; func3_t <int64_t, timerIndex,int64_t,int>* m13;
func2_t <string, networkParameter,string>* m14; func2_t <string, networkParameter,string>* m14;
func3_t <int, int,int,int>* m15; func3_t <int, int,int,int>* m15;
func4_t <int, trimMode,int,int,int>* m16; func4_t <int, trimMode,int,int,int>* m16;
@ -152,14 +152,39 @@ public:
Task(func2_t <int, string,int>* t): SuperTask(),fnum(10){m10 = t;}; Task(func2_t <int, string,int>* t): SuperTask(),fnum(10){m10 = t;};
Task(func2_t <dacs_t, dacIndex,int>* t): SuperTask(),fnum(11){m11 = t;}; Task(func2_t <dacs_t, dacIndex,int>* t): SuperTask(),fnum(11){m11 = t;};
Task(func2_t <detectorSettings, detectorSettings,int>* t): SuperTask(),fnum(12){m12 = t;}; Task(func2_t <detectorSettings, detectorSettings,int>* t): SuperTask(),fnum(12){m12 = t;};
Task(func2_t <int64_t, timerIndex,int64_t>* t): SuperTask(),fnum(13){m13 = t;}; Task(func3_t <int64_t, timerIndex,int64_t,int>* t): SuperTask(),fnum(13){m13 = t;};
Task(func2_t <string, networkParameter,string>* t): SuperTask(),fnum(14){m14 = t;}; Task(func2_t <string, networkParameter,string>* t): SuperTask(),fnum(14){m14 = t;};
Task(func3_t <int, int,int,int>* t): SuperTask(),fnum(15){m15 = t;}; Task(func3_t <int, int,int,int>* t): SuperTask(),fnum(15){m15 = t;};
Task(func4_t <int, trimMode,int,int,int>* t): SuperTask(),fnum(16){m16 = t;}; Task(func4_t <int, trimMode,int,int,int>* t): SuperTask(),fnum(16){m16 = t;};
Task(func4_t <int, int,int,detectorSettings,int>* t): SuperTask(),fnum(17){m17 = t;}; Task(func4_t <int, int,int,detectorSettings,int>* t): SuperTask(),fnum(17){m17 = t;};
Task(func4_t <dacs_t, dacs_t,dacIndex,int,int>* t): SuperTask(),fnum(18){m18 = t;}; Task(func4_t <dacs_t, dacs_t,dacIndex,int,int>* t): SuperTask(),fnum(18){m18 = t;};
~Task(){} virtual ~Task(){
switch(fnum) {
case 1: delete m1; break;
case 2: delete m2; break;
case 3: delete m3; break;
case 4: delete m4; break;
case 5: delete m5; break;
case 6: delete m6; break;
case 7: delete m7; break;
case 8: delete m8; break;
case 9: delete m9; break;
case 10: delete m10; break;
case 11: delete m11; break;
case 12: delete m12; break;
case 13: delete m13; break;
case 14: delete m14; break;
case 15: delete m15; break;
case 16: delete m16; break;
case 17: delete m17; break;
case 18: delete m18; break;
default:
cprintf(RED, "Error: Task not defined. Abort!\n");
break;
}
};
void operator()(){ void operator()(){
switch(fnum) { switch(fnum) {

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsReceiverSoftware Path: slsDetectorsPackage/slsReceiverSoftware
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: b389402d647e939342dbb2c9317c688c0eb6b105 Repsitory UUID: e094e41d89d91e341bc6cf272b4570145a82446b
Revision: 708 Revision: 716
Branch: 3.1.0-rc Branch: 3.1.5
Last Changed Author: Erik_Frojdh Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3458 Last Changed Rev: 3498
Last Changed Date: 2018-03-09 12:23:14.000000002 +0100 ./src/Listener.cpp Last Changed Date: 2018-11-30 11:03:41.000000002 +0100 ./src/utilities.cpp

View File

@ -198,9 +198,10 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
/** /**
* End of Acquisition * End of Acquisition
* @param anyPacketsCaught true if any packets are caught, else false
* @param numf number of images caught * @param numf number of images caught
*/ */
void EndofAcquisition(uint64_t numf); void EndofAcquisition(bool anyPacketsCaught, uint64_t numf);
private: private:

View File

@ -159,9 +159,10 @@ class File : private virtual slsReceiverDefs {
/** /**
* End of Acquisition * End of Acquisition
* @param anyPacketsCaught true if any packets are caught, else false
* @param numf number of images caught * @param numf number of images caught
*/ */
virtual void EndofAcquisition(uint64_t numf) { virtual void EndofAcquisition(bool anyPacketsCaught, uint64_t numf) {
cprintf(RED,"This is a generic function EndofAcquisition that should be overloaded by a derived class\n"); cprintf(RED,"This is a generic function EndofAcquisition that should be overloaded by a derived class\n");
} }

View File

@ -111,9 +111,10 @@ class HDF5File : private virtual slsReceiverDefs, public File, public HDF5FileSt
/** /**
* End of Acquisition * End of Acquisition
* @param anyPacketsCaught true if any packets are caught, else false
* @param numf number of images caught * @param numf number of images caught
*/ */
void EndofAcquisition(uint64_t numf); void EndofAcquisition(bool anyPacketsCaught, uint64_t numf);
/** /**
* Create Virtual File * Create Virtual File
@ -180,5 +181,8 @@ class HDF5File : private virtual slsReceiverDefs, public File, public HDF5FileSt
/** Dataset array for parameters */ /** Dataset array for parameters */
DataSet* dataset_para[HDF5FileStatic::NumberofParameters]; DataSet* dataset_para[HDF5FileStatic::NumberofParameters];
/** Number of Images (including extended during acquisition) */
uint64_t extNumImages;
}; };
#endif #endif

View File

@ -112,7 +112,7 @@ public:
} }
} catch(Exception error) { } catch(Exception error) {
cprintf(RED,"Error in closing HDF5 handles of index %d\n", ind); cprintf(RED,"Error in closing HDF5 handles of index %d\n", ind);
error.printError(); error.printErrorStack();
} }
} }
@ -130,7 +130,7 @@ public:
} }
} catch(Exception error) { } catch(Exception error) {
cprintf(RED,"Error in closing master HDF5 handles\n"); cprintf(RED,"Error in closing master HDF5 handles\n");
error.printError(); error.printErrorStack();
} }
} }
@ -177,7 +177,7 @@ public:
} }
catch(Exception error){ catch(Exception error){
cprintf(RED,"Error in writing to file in object %d\n",ind); cprintf(RED,"Error in writing to file in object %d\n",ind);
error.printError(); error.printErrorStack();
return 1; return 1;
} }
return 0; return 0;
@ -187,6 +187,12 @@ public:
/** /**
* Write Parameter Arrays as datasets (to virtual file) * Write Parameter Arrays as datasets (to virtual file)
* @param ind self index
* @param dpace_para parameter dataspace
* @param fnum frame number current
* @param dset_para parameter dataset
* @param header image header
* @returns 0 for success and 1 for fail
*/ */
static int WriteParameterDatasets(int ind, DataSpace* dspace_para, uint64_t fnum, static int WriteParameterDatasets(int ind, DataSpace* dspace_para, uint64_t fnum,
DataSet* dset_para[],sls_detector_header* header) DataSet* dset_para[],sls_detector_header* header)
@ -213,12 +219,50 @@ public:
} }
catch(Exception error){ catch(Exception error){
cprintf(RED,"Error in writing parameters to file in object %d\n",ind); cprintf(RED,"Error in writing parameters to file in object %d\n",ind);
error.printError(); error.printErrorStack();
return 1; return 1;
} }
return 0; return 0;
} }
/**
* Extend datasets in #images dimension (x dimension)
* @param ind self index
* @param dpace data space pointer address
* @param dset data set pointer
* @param dspace_para parameter dataspace address pointer
* @param dset dataset parameter pointer
* @param initialNumImages initial number of images
* @returns 0 for success and 1 for fail
*/
static int ExtendDataset(int ind, DataSpace*& dspace, DataSet* dset,
DataSpace*& dspace_para, DataSet* dset_para[],
uint64_t initialNumImages) {
try{
Exception::dontPrint(); //to handle errors
hsize_t dims[3];
dspace->getSimpleExtentDims(dims);
dims[0] += initialNumImages;
dset->extend(dims);
delete dspace;
dspace = new DataSpace(dset->getSpace());
hsize_t dims_para[1] = {dims[0]};
for (int i = 0; i < NumberofParameters; ++i)
dset_para[i]->extend(dims_para);
delete dspace_para;
dspace_para = new DataSpace(dset_para[0]->getSpace());
}
catch(Exception error){
cprintf(RED,"Error in extending dataset in object %d\n",ind);
error.printErrorStack();
return 1;
}
return 0;
}
/** /**
* Create master file * Create master file
@ -246,9 +290,9 @@ public:
FileAccPropList flist; FileAccPropList flist;
flist.setFcloseDegree(H5F_CLOSE_STRONG); flist.setFcloseDegree(H5F_CLOSE_STRONG);
if(!owenable) if(!owenable)
fd = new H5File( fname.c_str(), H5F_ACC_EXCL, NULL, flist ); fd = new H5File( fname.c_str(), H5F_ACC_EXCL, FileCreatPropList::DEFAULT, flist );
else else
fd = new H5File( fname.c_str(), H5F_ACC_TRUNC, NULL, flist ); fd = new H5File( fname.c_str(), H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, flist );
//variables //variables
DataSpace dataspace = DataSpace (H5S_SCALAR); DataSpace dataspace = DataSpace (H5S_SCALAR);
@ -328,7 +372,7 @@ public:
} catch(Exception error) { } catch(Exception error) {
cprintf(RED,"Error in creating master HDF5 handles\n"); cprintf(RED,"Error in creating master HDF5 handles\n");
error.printError(); error.printErrorStack();
return 1; return 1;
} }
return 0; return 0;
@ -374,9 +418,9 @@ public:
FileAccPropList fapl; FileAccPropList fapl;
fapl.setFcloseDegree(H5F_CLOSE_STRONG); fapl.setFcloseDegree(H5F_CLOSE_STRONG);
if(!owenable) if(!owenable)
fd = new H5File( fname.c_str(), H5F_ACC_EXCL, NULL,fapl ); fd = new H5File( fname.c_str(), H5F_ACC_EXCL, FileCreatPropList::DEFAULT,fapl );
else else
fd = new H5File( fname.c_str(), H5F_ACC_TRUNC, NULL, fapl ); fd = new H5File( fname.c_str(), H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl );
//attributes - version //attributes - version
double dValue=version; double dValue=version;
@ -386,7 +430,8 @@ public:
//dataspace //dataspace
hsize_t srcdims[3] = {nDimx, nDimy, nDimz}; hsize_t srcdims[3] = {nDimx, nDimy, nDimz};
dspace = new DataSpace (3,srcdims); hsize_t srcdimsmax[3] = {H5S_UNLIMITED, nDimy, nDimz};
dspace = new DataSpace (3,srcdims,srcdimsmax);
//dataset name //dataset name
ostringstream osfn; ostringstream osfn;
@ -396,23 +441,28 @@ public:
//dataset //dataset
//chunked dataset if greater than max_chunked_images //chunked dataset if greater than max_chunked_images
if(nDimx > maxchunkedimages){ // always create chunked dataset as unlimited is only supported with chunked layout
DSetCreatPropList plist; DSetCreatPropList plist;
hsize_t chunk_dims[3] ={maxchunkedimages, nDimy, nDimz}; hsize_t chunk_dims[3] ={maxchunkedimages, nDimy, nDimz};
plist.setChunk(3, chunk_dims); plist.setChunk(3, chunk_dims);
dset = new DataSet (fd->createDataSet(dsetname.c_str(), dtype, *dspace, plist)); dset = new DataSet (fd->createDataSet(dsetname.c_str(), dtype, *dspace, plist));
}else
dset = new DataSet (fd->createDataSet(dsetname.c_str(), dtype, *dspace));
//create parameter datasets //create parameter datasets
hsize_t dims[1] = {nDimx}; hsize_t dims[1] = {nDimx};
dspace_para = new DataSpace (1,dims); hsize_t dimsmax[1] = {H5S_UNLIMITED};
dspace_para = new DataSpace (1,dims,dimsmax);
// always create chunked dataset as unlimited is only supported with chunked layout
DSetCreatPropList paralist;
hsize_t chunkpara_dims[3] ={maxchunkedimages};
paralist.setChunk(1, chunkpara_dims);
for (int i = 0; i < NumberofParameters; ++i) for (int i = 0; i < NumberofParameters; ++i)
dset_para[i] = new DataSet(fd->createDataSet(ParameterNames[i], ParameterDataTypes[i], *dspace_para)); dset_para[i] = new DataSet(fd->createDataSet(ParameterNames[i], ParameterDataTypes[i], *dspace_para, paralist));
} }
catch(Exception error){ catch(Exception error){
cprintf(RED,"Error in creating HDF5 handles in object %d\n",ind); cprintf(RED,"Error in creating HDF5 handles in object %d\n",ind);
error.printError(); error.printErrorStack();
fd->close(); fd->close();
return 1; return 1;
} }
@ -488,7 +538,7 @@ public:
hid_t vdsDataspace = H5Screate_simple(3, vdsdims ,NULL); hid_t vdsDataspace = H5Screate_simple(3, vdsdims ,NULL);
if (vdsDataspace < 0) if (vdsDataspace < 0)
return CloseFileOnError(fd, string("Error in creating virtual dataspace in virtual file ") + virtualFileName + string("\n")); return CloseFileOnError(fd, string("Error in creating virtual dataspace in virtual file ") + virtualFileName + string("\n"));
hsize_t vdsdims_para[2] = {numf, numDety * numDetz}; hsize_t vdsdims_para[2] = {numf, (unsigned int)numDety * numDetz};
hid_t vdsDataspace_para = H5Screate_simple(2, vdsdims_para, NULL); hid_t vdsDataspace_para = H5Screate_simple(2, vdsdims_para, NULL);
if (vdsDataspace_para < 0) if (vdsDataspace_para < 0)
return CloseFileOnError(fd, string("Error in creating virtual dataspace (parameters) in virtual file ") + virtualFileName + string("\n")); return CloseFileOnError(fd, string("Error in creating virtual dataspace (parameters) in virtual file ") + virtualFileName + string("\n"));
@ -541,6 +591,14 @@ public:
string srcFileName = HDF5FileStatic::CreateFileName(fpath, fnameprefix, findex, string srcFileName = HDF5FileStatic::CreateFileName(fpath, fnameprefix, findex,
frindexenable, framesSaved, dindex, numunits, i); frindexenable, framesSaved, dindex, numunits, i);
// find relative path
string relative_srcFileName = srcFileName;
{
size_t i = srcFileName.rfind('/', srcFileName.length());
if (i != string::npos)
relative_srcFileName = (srcFileName.substr(i+1, srcFileName.length() - i));
}
//source dataset name //source dataset name
ostringstream osfn; ostringstream osfn;
osfn << "/data"; osfn << "/data";
@ -549,23 +607,25 @@ public:
//source dataspace //source dataspace
hsize_t srcdims[3] = {nDimx, nDimy, nDimz}; hsize_t srcdims[3] = {nDimx, nDimy, nDimz};
hid_t srcDataspace = H5Screate_simple(3, srcdims, NULL); hsize_t srcdimsmax[3] = {H5S_UNLIMITED, nDimy, nDimz};
hid_t srcDataspace = H5Screate_simple(3, srcdims, srcdimsmax);
if (srcDataspace < 0) if (srcDataspace < 0)
return CloseFileOnError(fd, string("Error in creating source dataspace in virtual file ") + virtualFileName + string("\n")); return CloseFileOnError(fd, string("Error in creating source dataspace in virtual file ") + virtualFileName + string("\n"));
hsize_t srcdims_para[1] = {nDimx}; hsize_t srcdims_para[1] = {nDimx};
hid_t srcDataspace_para = H5Screate_simple(1, srcdims_para, NULL); hsize_t srcdimsmax_para[1] = {H5S_UNLIMITED};
hid_t srcDataspace_para = H5Screate_simple(1, srcdims_para, srcdimsmax_para);
if (srcDataspace_para < 0) if (srcDataspace_para < 0)
return CloseFileOnError(fd, string("Error in creating source dataspace (parameters) in virtual file ") + virtualFileName + string("\n")); return CloseFileOnError(fd, string("Error in creating source dataspace (parameters) in virtual file ") + virtualFileName + string("\n"));
//mapping //mapping
if (H5Pset_virtual(dcpl, vdsDataspace, srcFileName.c_str(), srcDatasetName.c_str(), srcDataspace) < 0) { if (H5Pset_virtual(dcpl, vdsDataspace, relative_srcFileName.c_str(), srcDatasetName.c_str(), srcDataspace) < 0) {
cprintf(RED,"could not set mapping for paramter 1\n"); cprintf(RED,"could not set mapping for paramter 1\n");
error = true; error = true;
break; break;
} }
for (int k = 0; k < NumberofParameters; ++k) { for (int k = 0; k < NumberofParameters; ++k) {
if (H5Pset_virtual(dcpl_para[k], vdsDataspace_para, srcFileName.c_str(), ParameterNames[k], srcDataspace_para) < 0) { if (H5Pset_virtual(dcpl_para[k], vdsDataspace_para, relative_srcFileName.c_str(), ParameterNames[k], srcDataspace_para) < 0) {
cprintf(RED,"could not set mapping for paramter %d\n", k); cprintf(RED,"could not set mapping for paramter %d\n", k);
error = true; error = true;
break; break;
@ -587,7 +647,7 @@ public:
return CloseFileOnError(fd, string("Error in mapping files in virtual file ") + virtualFileName + string("\n")); return CloseFileOnError(fd, string("Error in mapping files in virtual file ") + virtualFileName + string("\n"));
//dataset //dataset
string virtualDatasetName = string("/virtual_") + srcDataseName; string virtualDatasetName = /*string("/virtual_") + */srcDataseName;
hid_t vdsdataset = H5Dcreate2 (fd, virtualDatasetName.c_str(), GetDataTypeinC(dataType), vdsDataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); hid_t vdsdataset = H5Dcreate2 (fd, virtualDatasetName.c_str(), GetDataTypeinC(dataType), vdsDataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
if (vdsdataset < 0) if (vdsdataset < 0)
return CloseFileOnError(fd, string("Error in creating virutal dataset in virtual file ") + virtualFileName + string("\n")); return CloseFileOnError(fd, string("Error in creating virutal dataset in virtual file ") + virtualFileName + string("\n"));
@ -596,7 +656,7 @@ public:
//virtual parameter dataset //virtual parameter dataset
for (int i = 0; i < NumberofParameters; ++i) { for (int i = 0; i < NumberofParameters; ++i) {
hid_t vdsdataset_para = H5Dcreate2 (fd, hid_t vdsdataset_para = H5Dcreate2 (fd,
(string("/virtual_") + string (ParameterNames[i])).c_str(), (/*string("/virtual_") + */string (ParameterNames[i])).c_str(),
GetDataTypeinC(ParameterDataTypes[i]), vdsDataspace_para, H5P_DEFAULT, dcpl_para[i], H5P_DEFAULT); GetDataTypeinC(ParameterDataTypes[i]), vdsDataspace_para, H5P_DEFAULT, dcpl_para[i], H5P_DEFAULT);
if (vdsdataset_para < 0) if (vdsdataset_para < 0)
return CloseFileOnError(fd, string("Error in creating virutal dataset (parameters) in virtual file ") + virtualFileName + string("\n")); return CloseFileOnError(fd, string("Error in creating virutal dataset (parameters) in virtual file ") + virtualFileName + string("\n"));
@ -697,7 +757,7 @@ public:
oldfd->close(); oldfd->close();
} catch(Exception error){ } catch(Exception error){
cprintf(RED,"Error in copying virtual files\n"); cprintf(RED,"Error in copying virtual files\n");
error.printError(); error.printErrorStack();
free(data_out); free(data_out);
oldfd->close(); oldfd->close();
newfd->close(); newfd->close();
@ -739,6 +799,14 @@ public:
return CloseFileOnError( vfd, string("Error in opening virtual file\n")); return CloseFileOnError( vfd, string("Error in opening virtual file\n"));
} }
// find relative path
string relative_virtualfname = virtualfname;
{
size_t i = virtualfname.rfind('/', virtualfname.length());
if (i != string::npos)
relative_virtualfname = (virtualfname.substr(i+1, virtualfname.length() - i));
}
//**data dataset** //**data dataset**
hid_t vdset = H5Dopen2( vfd, virtualDatasetname.c_str(), H5P_DEFAULT); hid_t vdset = H5Dopen2( vfd, virtualDatasetname.c_str(), H5P_DEFAULT);
if (vdset < 0) { if (vdset < 0) {
@ -746,7 +814,7 @@ public:
return CloseFileOnError( vfd, string("Error in opening virtual data dataset\n")); return CloseFileOnError( vfd, string("Error in opening virtual data dataset\n"));
} }
sprintf(linkname, "/entry/data/%s",virtualDatasetname.c_str()); sprintf(linkname, "/entry/data/%s",virtualDatasetname.c_str());
if(H5Lcreate_external( virtualfname.c_str(), virtualDatasetname.c_str(), if(H5Lcreate_external( relative_virtualfname.c_str(), virtualDatasetname.c_str(),
mfd, linkname, H5P_DEFAULT, H5P_DEFAULT) < 0) { mfd, linkname, H5P_DEFAULT, H5P_DEFAULT) < 0) {
H5Fclose(mfd); mfd = 0; H5Fclose(mfd); mfd = 0;
return CloseFileOnError( vfd, string("Error in creating link to data dataset\n")); return CloseFileOnError( vfd, string("Error in creating link to data dataset\n"));
@ -755,13 +823,13 @@ public:
//**paramter datasets** //**paramter datasets**
for (int i = 0; i < NumberofParameters; ++i){ for (int i = 0; i < NumberofParameters; ++i){
hid_t vdset_para = H5Dopen2( vfd, (string("/virtual_") + string (ParameterNames[i])).c_str(), H5P_DEFAULT); hid_t vdset_para = H5Dopen2( vfd, (/*string("/virtual_") + */string (ParameterNames[i])).c_str(), H5P_DEFAULT);
if (vdset_para < 0) { if (vdset_para < 0) {
H5Fclose(mfd); mfd = 0; H5Fclose(mfd); mfd = 0;
return CloseFileOnError( vfd, string("Error in opening virtual parameter dataset to create link\n")); return CloseFileOnError( vfd, string("Error in opening virtual parameter dataset to create link\n"));
} }
sprintf(linkname, "/entry/data/%s",(string("/virtual_") + string (ParameterNames[i])).c_str()); sprintf(linkname, "/entry/data/%s",(/*string("/virtual_") + */string (ParameterNames[i])).c_str());
if(H5Lcreate_external( virtualfname.c_str(), (string("/virtual_") + string (ParameterNames[i])).c_str(), if(H5Lcreate_external( relative_virtualfname.c_str(), (/*string("/virtual_") + */string (ParameterNames[i])).c_str(),
mfd, linkname, H5P_DEFAULT, H5P_DEFAULT) < 0) { mfd, linkname, H5P_DEFAULT, H5P_DEFAULT) < 0) {
H5Fclose(mfd); mfd = 0; H5Fclose(mfd); mfd = 0;
return CloseFileOnError( vfd, string("Error in creating link to virtual parameter dataset\n")); return CloseFileOnError( vfd, string("Error in creating link to virtual parameter dataset\n"));

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "b389402d647e939342dbb2c9317c688c0eb6b105" #define GITREPUUID "e094e41d89d91e341bc6cf272b4570145a82446b"
#define GITAUTH "Erik_Frojdh" #define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3458 #define GITREV 0x3498
#define GITDATE 0x20180309 #define GITDATE 0x20181130
#define GITBRANCH "3.1.0-rc" #define GITBRANCH "3.1.5"

View File

@ -282,9 +282,9 @@ void DataProcessor::CloseFiles() {
file->CloseAllFiles(); file->CloseAllFiles();
} }
void DataProcessor::EndofAcquisition(uint64_t numf) { void DataProcessor::EndofAcquisition(bool anyPacketsCaught, uint64_t numf) {
if (file && file->GetFileType() == HDF5) { if (file && file->GetFileType() == HDF5) {
file->EndofAcquisition(numf); file->EndofAcquisition(anyPacketsCaught, numf);
} }
} }

View File

@ -38,7 +38,8 @@ HDF5File::HDF5File(int ind, uint32_t maxf, const uint32_t* ppf,
numFramesInFile(0), numFramesInFile(0),
numActualPacketsInFile(0), numActualPacketsInFile(0),
numFilesinAcquisition(0), numFilesinAcquisition(0),
dataspace_para(0) dataspace_para(0),
extNumImages(0)
{ {
#ifdef VERBOSE #ifdef VERBOSE
PrintMembers(); PrintMembers();
@ -97,7 +98,7 @@ int HDF5File::CreateFile(uint64_t fnum) {
//first time //first time
if(!fnum) UpdateDataType(); if(!fnum) UpdateDataType();
uint64_t framestosave = ((*numImages - fnum) > maxFramesPerFile) ? maxFramesPerFile : (*numImages-fnum); uint64_t framestosave = ((extNumImages - fnum) > maxFramesPerFile) ? maxFramesPerFile : (extNumImages-fnum);
pthread_mutex_lock(&Mutex); pthread_mutex_lock(&Mutex);
if (HDF5FileStatic::CreateDataFile(index, *overWriteEnable, currentFileName, *frameIndexEnable, if (HDF5FileStatic::CreateDataFile(index, *overWriteEnable, currentFileName, *frameIndexEnable,
fnum, framestosave, nPixelsY, ((*dynamicRange==4) ? (nPixelsX/2) : nPixelsX), fnum, framestosave, nPixelsY, ((*dynamicRange==4) ? (nPixelsX/2) : nPixelsX),
@ -111,9 +112,9 @@ int HDF5File::CreateFile(uint64_t fnum) {
if (dataspace == NULL) if (dataspace == NULL)
cprintf(RED,"Got nothing!\n"); cprintf(RED,"Got nothing!\n");
if(!silentMode) if(!silentMode) {
FILE_LOG(logINFO) << *udpPortNumber << ": HDF5 File created: " << currentFileName; FILE_LOG(logINFO) << *udpPortNumber << ": HDF5 File created: " << currentFileName;
}
return OK; return OK;
} }
@ -145,6 +146,19 @@ int HDF5File::WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_t
numFramesInFile++; numFramesInFile++;
numActualPacketsInFile += nump; numActualPacketsInFile += nump;
pthread_mutex_lock(&Mutex); pthread_mutex_lock(&Mutex);
// extend dataset (when receiver start followed by many status starts (jungfrau)))
if (fnum >= extNumImages) {
if (HDF5FileStatic::ExtendDataset(index, dataspace, dataset,
dataspace_para, dataset_para, *numImages) == OK) {
if (!silentMode) {
cprintf(BLUE,"%d Extending HDF5 dataset by %lu, Total x Dimension: %lu\n",
index, extNumImages, extNumImages + *numImages);
}
extNumImages += *numImages;
}
}
if (HDF5FileStatic::WriteDataFile(index, buffer + sizeof(sls_detector_header), if (HDF5FileStatic::WriteDataFile(index, buffer + sizeof(sls_detector_header),
fnum%maxFramesPerFile, nPixelsY, ((*dynamicRange==4) ? (nPixelsX/2) : nPixelsX), fnum%maxFramesPerFile, nPixelsY, ((*dynamicRange==4) ? (nPixelsX/2) : nPixelsX),
dataspace, dataset, datatype) == OK) { dataspace, dataset, datatype) == OK) {
@ -163,18 +177,23 @@ int HDF5File::WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_t
} }
int HDF5File::CreateMasterFile(bool en, uint32_t size, int HDF5File::CreateMasterFile(bool en, uint32_t size,
uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t ap) { uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t ap) {
//beginning of every acquisition //beginning of every acquisition
numFramesInFile = 0; numFramesInFile = 0;
numActualPacketsInFile = 0; numActualPacketsInFile = 0;
extNumImages = *numImages;
if (master && (*detIndex==0)) { if (master && (*detIndex==0)) {
virtualfd = 0; virtualfd = 0;
masterFileName = HDF5FileStatic::CreateMasterFileName(filePath, fileNamePrefix, *fileIndex); masterFileName = HDF5FileStatic::CreateMasterFileName(filePath, fileNamePrefix, *fileIndex);
if(!silentMode) if(!silentMode){
FILE_LOG(logINFO) << "Master File: " << masterFileName; FILE_LOG(logINFO) << "Master File: " << masterFileName;
}
pthread_mutex_lock(&Mutex); pthread_mutex_lock(&Mutex);
int ret = HDF5FileStatic::CreateMasterDataFile(masterfd, masterFileName, *overWriteEnable, int ret = HDF5FileStatic::CreateMasterDataFile(masterfd, masterFileName, *overWriteEnable,
*dynamicRange, en, size, nx, ny, *numImages, at, st, ap, HDF5_WRITER_VERSION); *dynamicRange, en, size, nx, ny, *numImages, at, st, ap, HDF5_WRITER_VERSION);
@ -185,11 +204,11 @@ int HDF5File::CreateMasterFile(bool en, uint32_t size,
} }
void HDF5File::EndofAcquisition(uint64_t numf) { void HDF5File::EndofAcquisition(bool anyPacketsCaught, uint64_t numf) {
//not created before //not created before
if (!virtualfd) { if (!virtualfd && anyPacketsCaught) {
//only one file and one sub image //only one file and one sub image (link current file in master)
if (((numFilesinAcquisition == 1) && (numDetY*numDetX) == 1)) { if (((numFilesinAcquisition == 1) && (numDetY*numDetX) == 1)) {
//dataset name //dataset name
ostringstream osfn; ostringstream osfn;
@ -217,7 +236,7 @@ int HDF5File::CreateVirtualFile(uint64_t numf) {
virtualfd, masterFileName, virtualfd, masterFileName,
filePath, fileNamePrefix, *fileIndex, *frameIndexEnable, filePath, fileNamePrefix, *fileIndex, *frameIndexEnable,
*detIndex, *numUnitsPerDetector, *detIndex, *numUnitsPerDetector,
maxFramesPerFile, numf, maxFramesPerFile, numf+1,
"data", datatype, "data", datatype,
numDetY, numDetX, nPixelsY, ((*dynamicRange==4) ? (nPixelsX/2) : nPixelsX), numDetY, numDetX, nPixelsY, ((*dynamicRange==4) ? (nPixelsX/2) : nPixelsX),
HDF5_WRITER_VERSION); HDF5_WRITER_VERSION);

View File

@ -290,7 +290,7 @@ void UDPBaseImplementation::setFilePath(const char c[]){
else else
FILE_LOG(logERROR) << "FilePath does not exist: " << filePath; FILE_LOG(logERROR) << "FilePath does not exist: " << filePath;
} }
FILE_LOG(logINFO) << "Info: File path: " << filePath; FILE_LOG(logINFO) << "File path: " << filePath;
} }
void UDPBaseImplementation::setFileIndex(const uint64_t i){ void UDPBaseImplementation::setFileIndex(const uint64_t i){

View File

@ -462,8 +462,9 @@ void UDPStandardImplementation::stopReceiver(){
if((*it)->GetMeasurementStartedFlag()) if((*it)->GetMeasurementStartedFlag())
anycaught = true; anycaught = true;
} }
if (anycaught)
dataProcessor[0]->EndofAcquisition(maxIndexCaught); //to create virtual file //to create virtual file & set files/acquisition to 0 (only hdf5 at the moment)
dataProcessor[0]->EndofAcquisition(anycaught, maxIndexCaught);
} }
while(DataStreamer::GetRunningMask()){ while(DataStreamer::GetRunningMask()){
@ -480,7 +481,7 @@ void UDPStandardImplementation::stopReceiver(){
tot += dataProcessor[i]->GetNumFramesCaught(); tot += dataProcessor[i]->GetNumFramesCaught();
uint64_t missingpackets = numberOfFrames*generalData->packetsPerFrame-listener[i]->GetPacketsCaught(); uint64_t missingpackets = numberOfFrames*generalData->packetsPerFrame-listener[i]->GetPacketsCaught();
if (missingpackets) { if ((int)missingpackets > 0) {
cprintf(RED, "\n[Port %d]\n",udpPortNum[i]); cprintf(RED, "\n[Port %d]\n",udpPortNum[i]);
cprintf(RED, "Missing Packets\t\t: %lld\n",(long long int)missingpackets); cprintf(RED, "Missing Packets\t\t: %lld\n",(long long int)missingpackets);
cprintf(RED, "Complete Frames\t\t: %lld\n",(long long int)dataProcessor[i]->GetNumFramesCaught()); cprintf(RED, "Complete Frames\t\t: %lld\n",(long long int)dataProcessor[i]->GetNumFramesCaught());
@ -562,12 +563,15 @@ void UDPStandardImplementation::shutDownUDPSockets() {
void UDPStandardImplementation::closeFiles() { void UDPStandardImplementation::closeFiles() {
uint64_t maxIndexCaught = 0; uint64_t maxIndexCaught = 0;
bool anycaught = false;
for (vector<DataProcessor*>::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it) { for (vector<DataProcessor*>::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it) {
(*it)->CloseFiles(); (*it)->CloseFiles();
maxIndexCaught = max(maxIndexCaught, (*it)->GetProcessedMeasurementIndex()); maxIndexCaught = max(maxIndexCaught, (*it)->GetProcessedMeasurementIndex());
if((*it)->GetMeasurementStartedFlag())
anycaught = true;
} }
if (maxIndexCaught) //to create virtual file & set files/acquisition to 0 (only hdf5 at the moment)
dataProcessor[0]->EndofAcquisition(maxIndexCaught); dataProcessor[0]->EndofAcquisition(anycaught, maxIndexCaught);
} }