diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2d0c7098..14f4ecf85 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,7 @@ find_package(Qt4)
find_package(Qwt 6)
find_package(CBF)
find_package(Doxygen)
-
+find_package(PNG REQUIRED)
if (USE_HDF5)
find_package(HDF5 1.10 COMPONENTS CXX)
diff --git a/README.md b/README.md
index c73101c0b..02ce963d0 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,16 @@
-# slsDetector package
+### Documentation
+Detailed documentation can be found on the [official site.](https://www.psi.ch/detectors/users-support)
-The SLS Detectors Package is intended to control the detectors developed by the SLS Detectors Group.
-The detectors currently supported are namely MYTHEN, GOTTHARD, EIGER, JUNGFRAU and MOENCH.
-
-## Installation
-
-### Get binaries
+### Binaries
Documentation to obtain the binaries via the conda package is available [here.](https://github.com/slsdetectorgroup/sls_detector_software)
-### Get source code
-One can also obtain the source code from this repository and compile as follows.
+### Source code
+One can also obtain the source code from this repository and compile while realizing the setup dependencies as required.
+```
+git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git --branch 3.1.0
-### Setup dependencies
+```
+#### Setup dependencies
* Gui Client
Requirements: Qt 4.8 and Qwt 6.0
```
@@ -26,7 +25,14 @@ Requirements: ROOT
export ROOTSYS=/usr/local/root-5.34
```
-### Compile using script cmk.sh
+#### Compilation
+
+Compiling can be done in two ways.
+
+**1. Compile using script cmk.sh**
+
+After compiling, the libraries and executables will be found in `slsDetectorPackage/build/bin` directory
+
Usage: [-c] [-b] [-h] [-d HDF5 directory] [-j]
* -[no option]: only make
* -c: Clean
@@ -50,33 +56,30 @@ For using hdf5 without custom dir /blabla:
For rebuilding cmake without hdf5
./cmk.sh -b
-For using multiple cores to compile faster:
-(all these options work)
+For using multiple cores to compile faster:
./cmk.sh -j9
-./cmk.sh -cj9 #with clean
-./cmk.sh -hj9 #with hdf5
-./cmk.sh -j9 -h #with hdf
+
For rebuilding only certain sections
./cmk.sh -tg #only text client and gui
./cmk.sh -r #only receiver
-### Compile without script
+**2. Compile without script**
Use cmake to create out-of-source builds, by creating a build folder parallel to source directory.
```
$ cd ..
$ mkdir slsDetectorPackage-build
$ cd slsDetectorPackage-build
- $ cmake ../slsDetectorPackage -DUSE_TEXTCLIENT=ON -DUSE_RECEIVER=ON -DUSE_GUI=OFF -DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=OFF
+ $ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=OFF
$ make
```
Use the following as an example to compile statically and using specific hdf5 folder
```
- $ HDF5_ROOT=/opt/hdf5v1.10.0 cmake ../slsDetectorPackage -DUSE_TEXTCLIENT=ON -DUSE_RECEIVER=ON -DUSE_GUI=OFF -DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=ON
+ $ HDF5_ROOT=/opt/hdf5v1.10.0 cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=ON
```
-The libraries and executables will be found at `bin` directory
+After compiling, the libraries and executables will be found at `bin` directory
```
$ ls bin/
gui_client libSlsDetector.a libSlsDetector.so libSlsReceiver.a libSlsReceiver.so
diff --git a/RELEASE.txt b/RELEASE.txt
index aa8246486..9c4042e6f 100644
--- a/RELEASE.txt
+++ b/RELEASE.txt
@@ -1,12 +1,20 @@
-SLS Detector Package 3.0.1 released on 2017-09-27
+SLS Detector Package 3.1.1 released on 2018-03-12
=================================================
INTRODUCTION
-This document describes the differences between 3.0.0 and 3.0.1 release.
+This document describes the differences between 3.1.0 and 3.1.0 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/
@@ -30,10 +38,15 @@ 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
+- Firmware Requirements
- Changes in User Interface
- New Features
- Resolved Issues
@@ -41,113 +54,56 @@ CONTENTS
+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 .
+
+
+
Changes in User Interface
=========================
- Receiver
- --------
-
- 1. Bug Fix: Example receiver users code now handles child process exit
- better. Example receiver code in slsDetectorsPackage/manual/manual-api
- folder (mainReceiver.cpp).
- 2. detReceiver is now executed with [start tcp port] [number of receivers]
- as arguments. By default, start tcp port is 1954 and number of receivers
- is 1.
-
- User
- ----
-
- 3. Added a few advanced user functions in slsDetectorUser class.
-
New Features
============
- Detector Server
- ---------------
- 1. (Eiger): Virtual class to execute on pc for integration.
-
-
- Client
- ------
-
- 2. Parallelized more commands to detector. Beneficial for large multi detector systems.
-
- 3. One can set "threaded" to 0 in the config file and acquire from command line. It will
- not give you progress, but might be faster for large multi detector systems.
-
-
- Receiver
- --------
-
- 4. Added silent mode to receiver using command r_silent [i] from client.
- It might be beneficial for max frame rate applications.
Resolved Issues
===============
- Gui
- ---
-
- 1. Bug fix:(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.
-
- 2. Minor alignment issue in Advanced Tab fixed.
-
- Client
- ------
-
- 3. Made it easier to disable the standard receiver and fixing bugs related to the use of a
- custom one.
-
- Detector Server
- ---------------
-
- 4. (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.
-
- Receiver
- --------
-
- 5. Bug fix: x, y and z coordinates in the call backs and the files
- are still not corrected in the detector udp header and must be
- hardcoded for this release. It is done now.
-
- 6. File class in receiver should be created only if file write is
- enabled. This has been corrected to that.
-
-
Known Issues
============
- Client
- ------
-
- 1. Changing file name prefix at the single detector level will not concatenate scan or
- position variables to the file name prefix. This is now done only at the multi
- detector level.
-
-
- Detector Server
- ---------------
-
- 2. (Eiger) The hardware mac of the detector is used (not relayed back to the client).
- For 1 GbE, the hardware IP of the detector is used (also not relayed back to the
- client).
-
- 3. Standard header fills x-coord in 1D. y-coord and z-coord is not implemented (3D).
-
-
- Receiver
- --------
-
- 4. HDF5 compression and filters are not implemented yet.
diff --git a/examples/gotthard.config b/examples/gotthard.config
index 61184cdfb..5d2c4c8f7 100644
--- a/examples/gotthard.config
+++ b/examples/gotthard.config
@@ -10,9 +10,6 @@ hostname bchip007
0:caldir /home/l_maliakal_d/mySoft/newMythenSoftware/settingsdir/gotthard
0:ffdir /home/l_maliakal_d
0:extsig:0 off
-0:extsig:1 off
-0:extsig:2 off
-0:extsig:3 off
#0:detectorip 129.129.202.9
0:detectormac 00:aa:bb:cc:dd:ee
0:rx_udpport 50004
diff --git a/examples/two_gotthard.config b/examples/two_gotthard.config
index 05b9bb10a..d3bf02cd6 100644
--- a/examples/two_gotthard.config
+++ b/examples/two_gotthard.config
@@ -15,9 +15,6 @@ hostname bchip007+bchip009+
0:caldir /home/l_msdetect/dhanya/slsDetectorsPackage/settingsdir/gotthard
0:ffdir /home/l_msdetect
0:extsig:0 off
-0:extsig:1 off
-0:extsig:2 off
-0:extsig:3 off
0:detectorip 10.1.1.2
#0:detectormac 00:aa:bb:cc:dd:ee
#0:rx_udpport 50001
@@ -38,9 +35,6 @@ hostname bchip007+bchip009+
1:caldir /home/l_msdetect/dhanya/slsDetectorsPackage/settingsdir/gotthard
1:ffdir /home/l_msdetect
1:extsig:0 off
-1:extsig:1 off
-1:extsig:2 off
-1:extsig:3 off
1:detectorip 10.1.2.2
#1:detectormac 00:aa:bb:cc:dd:ee
1:rx_udpport 50004
diff --git a/manual/docs/html/slsDetectors-FAQ/WARNINGS b/manual/docs/html/slsDetectors-FAQ/WARNINGS
deleted file mode 100644
index 4ea2dda68..000000000
--- a/manual/docs/html/slsDetectors-FAQ/WARNINGS
+++ /dev/null
@@ -1,13 +0,0 @@
-No implementation found for style `graphicx'
-No implementation found for style `eucal'
-No implementation found for style `amsxtra'
-No implementation found for style `upref'
-No implementation found for style `layout'
-No implementation found for style `calc'
-No implementation found for style `framed'
-
-? brace missing for \
-
-Substitution of arg to newlabelxx delayed.
-
-? brace missing for \textit
diff --git a/manual/docs/html/slsDetectors-FAQ/footnode.html b/manual/docs/html/slsDetectors-FAQ/footnode.html
deleted file mode 100644
index 9d4a88914..000000000
--- a/manual/docs/html/slsDetectors-FAQ/footnode.html
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
-Footnotes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
The default name of the calibrated trimfiles is trimbits/beamline/settings/noise.snxxx where settings is the chosen settings. You can change it in src/qDetector.h and then recompile the acquisition program as described in .
-
-
The default name of the calibration file calibration/settings.snxxx where settings is the chosen settings. You can change it in src/qDetector.h and then recompile the acquisition program.
-
-
-
-
-
-Thattil Dhanya
-2018-02-09
-
-
-
diff --git a/manual/docs/html/slsDetectors-FAQ/node10.html b/manual/docs/html/slsDetectors-FAQ/node10.html
deleted file mode 100644
index 64e22bc17..000000000
--- a/manual/docs/html/slsDetectors-FAQ/node10.html
+++ /dev/null
@@ -1,201 +0,0 @@
-
-
-
-
-
-How can I synchronize my detector with the experiment?
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Next:How can several controllers
- Up:SLS Detectors Software
- Previous:Which is the sequence
- Contents
-
-
-
-
-
-
-How can I synchronize my detector with the experiment?
-
-
-
-The timing of the detector is always defined by an active detection time followed by a dead time during which the detector is read out. This read out time as a fixed duration depending on the detector type and its configuration (e.g. dynamic range) which limits the maximum frame rate achievable.
-
-In the following is a list of the main parameters involved in the acquisition timing:
-
-
Exposure time
-
is the time during which the detector is detecting X-rays for each image (ignored is the timing mode is gating).
-
-
Period
-
is the period of the images acquired. If it is shorter than the exposure time plus readout time, it will be ignored.
-
-
Delay after trigger
-
can be set as a delay between the trigger signal and the start of the detection time.
-
-
Number of gates
-
is used only in gating mode and is the number of times that the gate is toggled before the detector is read out. Useful for stroboscopic measurements with gate period shorter than the minim acquisition period of the detector, otherwise can be left to 1.
-
-
Number of frames
-
is the number of images to be acquired per cycle. Frames and cycles have the same meaning except in trigger mode, when frames means the number of images per trigger. The total number of images is frames time cycles.
-
-
Number of cycles
-
is the number of times that the frames are acquired. Frames and cycles have the same meaning except in trigger mode, when cycles means the number of triggers that will be accepted. The total number of images is frames time cycles.
-
-
Number of probes
-
is used in stoboscopic measurements when the period is longer than the minimum acquisition period, but shorter than the frame rate.
-
-In this case the data can be summed in firmware.
-
-Currently it is implemented for Mythen only. If probes is set to 0, works normallyreturning an image for each readout, otherwise set number of cycles to 1. The maximum number of probes that can be set is 3. The detector will return a number of image equal to the number of probes, where all frames are going to be accumulated. The total number of readouts is number of frames time probes and for probes=1 the detector will return one image where all frames have been summed, for probes=2 two images where every second frame has been summed (each image accumulates the number of frames), for probes=3 three images where every third image has been summed (each image accumulates the number of frames).
-
-The returned images will always have 32 bit dynamic range, while the dynamic range if the detector defines the bit depth of the counters in rder to limit the readout time, if necessary.
-
-The probes counter waorks also in trigger and gating modes.
-
-
-
-
-
-
-
-
Figure 1.3:
-Auto timing: the detection time is defined by the exposure time and the period by period (if longer than exposure time plus readout time). The total number of images is frames (in the example 3) times cycles (in the example 2), and in this case there is no difference between the acquisition of the two.
-
-
-
-
-
-
-
-
-
-
-
-
-
Figure 1.4:
-Gating mode: the detector acquires for a number of gates define by the user (in this case 4) before being read out, independently on the timing of the gates. The detector remains insensitive during the readout time and then starts being active again. External gates given during the readout time are ignored. The total number of images is frames (in the example 3) times cycles (in the example 2), and in this case there is no difference between the acquisition of the two. The polarity of the external gate signal can be defined by the user through the external signal flag (in the example active high).
-
-
-
-
-
-
-
-
-
-
-
-
-
Figure 1.5:
-Trigger mode: the external trigger signal defines the start of the beginning of the acquisition, which starts after the delay set by the user. For each trigger, the number of frames is acquired (in the example 3) and all trigger signals ignored. The number of trigger accepted is given by the number of cycles (in the example 2). The polarity of the external trigger signal can be defined by the user through the external signal flag (in the example rising edge).
-
-
-
-
-
-
-
-
-
-
-
-
-
Figure 1.6:
-Read Out Trigger mode: the external trigger signal defines the beginning of the readout. The exposure time works as a time out for the waiting time for the trigger signal. The number of trigger accepted is given by the number of cycles (in the example 3) and it does not make sense to program more than one frame. The polarity of the external trigger signal can be defined by the user through the external signal flag (in the example rising edge).
-If you are not performing time resolved measurements, you will probably not need any synchronization of the controllers: they will be started sequentially by the software and their acquisition will have a jitter of a few ms.
-
-In the case you need a precise synchronization, on the other hand, hardware connection is required between the controllers through the external IO signals. The external signals used for this synchronization should be configured as sync with the extsig command.
-
-In this case a master controller should be defined for the acquisition which will the send the synchronization signal to the other controllers, while the other controllers will use them as inputs.
-
-The type of synchronization can begating or trigger depending if the synchronization signal will gate the slave detectors or trigegr the beginning of the acquisition. There are no particular reasons to chose one or the other method, except if the user finds out that one is more stable than the other.
-
-Normally the configuration of the synchronization is configured inside the configuration file and should not be changed dynamically by the user.
-
-
-After the configuration, the synchronization of the controllers will be completely transparent for the user, who will simply have to setup the timing parameters of the detector as a whole.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Next:How can the detector
- Up:SLS Detectors Software
- Previous:How can I synchronize
- Contents
-
-
-Thattil Dhanya
-2018-02-09
-
-
-
diff --git a/manual/docs/html/slsDetectors-FAQ/node12.html b/manual/docs/html/slsDetectors-FAQ/node12.html
deleted file mode 100644
index 9f5739782..000000000
--- a/manual/docs/html/slsDetectors-FAQ/node12.html
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
-
-How can the detector movement and position and I0 readout be customized for my beamline?
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Next:In which data format
- Up:SLS Detectors Software
- Previous:How can several controllers
- Contents
-
-
-
-
-
-
-How can the detector movement and position and I0 readout be customized for my beamline?
-
-
-
-The easiest way to allow the software to perform all the necessary normalization and angular conversion steps, is enable it to move your detector and read the encoder position and the value of the ionization chamber.
-
-These functions are defines as callbacks and can be redifined by registering your own functions. This is normally a good method if you use the API or are willing to write your main client program.
-
-Otherwise the simpleast way is to edit the file
- slsDetectorSoftware/usersFunctions/usersFunctions.cpp
-
-where the default functions performing these actions are implemented and modify them to interface with your beamline hardware. The functions are written in C and are very simple to implement for anyone with some programming knowledge.
-
-A simple high-level solution in case you need to maintain the software for several beamlines and don't want to recompile for all of them is to call external scripts.
-
-
-For MYTHEN the data are writen in ASCII fomat, one file per frame, in columns, either channel number - counts for the .raw files or angle (or channel number)-counts-error for the .dat files.
-
-
-For the other detectors the files are written in binary format, and must be decoded depending on the detector.
-
-
Each frame is split into 2 packets of 1286 bytes each, where actual data is 1280 bytes each. Both the packets (incl header and footer) are written one after the other into the file.
-
-
-Representation of each packet:
-
-
-
The first 4 bytes represents a number from which, the frame number and packet number can be derived.
-If the number was 108601, increment it by 1 to get 108602.
-
-Then this
-
- is the frame number
-and
-
- is the packet number.
-
-0 is the packet on the left and 1 is the packet on the right.
-
-On a side note, when you use the data call back, we also give you the derived frame number as an argument.
-
-
-
-
Data of 1280 bytes. 16 bits per pixel.
-
-
-
-
2 bytes of insignificant footer.
-
-
-
-
-
-
Short Frame Mode
-
One Frame has only one packet of 518 bytes, where actual data is 512 bytes.
-
-
-
first 4 bytes is the frame number. There is no packet number or increment required herecompared to the normal mode.
-
-Most of the SLS detectors make use of silicon sensors.
-
-
-Since silicon is a relatively light for hard X-rays the only limitation at high energies is the acceptable absorption efficiency that can be achieved in the sensors thickness.
-
-Figure 2.1 shows the absorption efficiency as a function of the X-ray energy and detector thickness. Normally it is possible to use sensors up to 1 mm thick, while to achieve larger absorption thicknesses it is necessary tu assemble and control telescopic systems (possible up to a few mms).
-
-To achieve larger absorption thicknesses, the sensors can be oriented in edge-on configuration (in particular strip sensors). However in this case one should take into consideration the dead entrance window due to the cutting distance from the strips, which is normally several hundreds micron, or even up to mms and reduces the absorption efficiency at lower energies.
-
-
-
-
-
-
Figure 2.1:
-Efficiency of a silicon sensor as a function of the sensors thickness and X-ray energy.
-
-
-
-
-
-In standard face-on orientation, the backplane of the sensor acts as the entrance window. It presents a think n+ doped layer, which is unsensitive to radiation and causes a loss of efficiency at low energies.
-Figure 2.2 shows the absorption efficiency of the sensors for different backplane thicknesses at low energies.
-
-The exact thickness of the backplane for standard SLS sensors is not exactly known but should be about 1-2
-m.
-
-
-
-
-
-
Figure 2.2:
-Efficiency of a silicon sensor as a function of the X-ray energy for different thicknesses of the backplane.
-
-
-
-
-
-However for lower energies, the main limitation is normally given by the noise of the frontend electronics (if single photon resolution is required).
-
-For higher energies it is also possible to use different sesnor materials as CdTe or Ge, although up to now they cannot provide the same signal quality as silicon.
-
-
-The limitations on the energy range arising from the readout electronics come from the noise and from saturation.
-The electronic noise limits the minimum detectable energy for single photons, while saturation limits the maximum detectable signal either for single photons or in total.
-
-
-
In single photon counting detectors, the minimum threshold cannot be set lower than 3-5 times the electronic noise.
-If the threshold is set at approximately half of the X-ray energy (see specific documentation about single photon counting detectors), the minimu detectable energy will be about 6-10 times the noise.
-
-In order to reduce the noise of the frontend electronics different settings can be chosen, but this puts a limit on the maximum incoming flux that can be detected without incurring in pileup (see specific documentation about single photon counting detectors). Figure 2.3 shows an example of the settings used for the MYTHEN detector for different energy ranges and fluxes.
-
-For state of the art single photon counting detectors, the minimum thrshold can be about 2-3 keV (details depend on the detector and can be further reduced using special settings).
-
-
-Concerning saturation, this imposes a maximum value for the comparator threshold. Normally photons of higher energies can still be detected, but without resolution concerning the threshold energy and eventually losing spatial resolution.
-By changing the settings it is possible to increase the maximum threshold value (normally also noise increases in this case).
-
-
-
-
For charge integrating detectors the electronics noise puts a limit on the minimum detectable signal. Therefore if single photon resolution is required, the minimum detectable energy is defined as for single photon counting detectors at about 6-10 times the electronic noise. In case no single photon resolution is required, the electronic noise will put a limit on the sensitivity of the detector i.e. the total accumulated signal needs to be larger than 6-10 times the noise in order to be detected (also about 2-3 keV depending on the detector). It is important to point out that the acquisition time of charge integrating detectors is limited by the leakage current of the sesnors and the noise quadratically sums out. Therefore the signal for low energy photons should be strong enough to be acquired during single frames.
-
-
-Concerning saturation, this sets a limit on the total number of photons acquired during the acquistion slot and is normally much larger than the energy released by single X-rays. Dynamic gain switching can strongly increase the dynamic range of the detector up to 10E+4 12 keV photons.
-
-
-
-
-
-
-
-
-
-
Figure 2.3:
-Settings to be chosen for the MYTHEN detector as a function of the X-ray energy and radiation intensity.
-In order to acquired the data, they should be:
-
-
-
Transferred from readout electronics to readout board memory. This readou time is very dependent on the detector and on the dynamic range chose (for single photon counting detectors if configurable) and can range from hundreds or tens to few us.
-
-In case the board has some memory that can be accessed by the hardware, this is the only limitation on the maximum frame rate as long as the memory is not filled (burst mode). Frame rates as high as a few tens of kHz can be achieved for photon countign detectors (EIGER) or up to 1 MHz for charge integrating (GOTTHARD).
-
-
-
-
Transferred from readout board to client PC or file server. In this case the main bottleneck is normally given by the data transfer rate on the network and on the performances of the receiver PC. This limits the frame rate in continous mode. However also the data writing capabilities and amount of data which are being acquired should be taken into consideration when setting up very fast acquisitions.
-
-
-The choice of the operation settings is very important in order to obtain good quality data.
-
-Normally slower settings will reduce the electronics noise and therefore it is possible to work at lower energies, but will saturate for high photon fluxes.
-
-On the other hand, faster settings will allow to work with higher photon intensities without pileup, but not to access lower energies because of an higher electronics noise.
-
-Therefore it is extremely important to chose adequate settings for the detector depending on the X-ray energy and expected maximum count rate.
-In the following is a description of the energy and intensity range coverd by the different settings for each detector.
-
-
If the X-ray energy is lower than 8 keV the High gain setting should be used. Since it is a slow mode of operation it is necessary to take care that the maximum count rate is lower than 100 kcounts/s for all channels (use filters to reduce the beam intensisty).
-
-
For energies higher than 8 keV, the Standard setting is normally fine if the count rate can be kept lower than 300 kcounts/s for all channels (use filters to reduce the beam intensisty).
-
-
-
-
In case a larger count rate is required in order to keep the acquisition time shorter, the Fast setting must be selected. However the maximum count rate should never exceed 1 Mcounts/s for all channels.
-
-
-
-
-
-
-
-
Figure 3.1:
-Plot indicating the reccomended choice of detector settings as a function of the X-ray energy and maximum count rate per channel..
Figure 3.2:
-Number of counts as a function of the threshold detected in an ideal case.
-
-
-
-
-
-
-
-
-
-
-
-
-
Figure 3.3:
-Number of counts as a function of the threshold detected in presence of fluorescent radiation
-
-
-
-
-
-
-
-
-
-Once selected the settings, the threshold should be selected.
-Figure 3.2 shows the number of counts as a function of the threshold value in the ideal case of monoenergetix X-rays of energy
-=10 keV.
-For thresholds larger than the X-ray energy the detector should always count 0 and for lower thresholds it should always count all the photons. However the curve is smoothed around
- because of the electronic noise (ENC) and is not perfectly flat for lower energies because the photons absorbed in the region between two strips distribute their energy between them and it is not flully collected by a single channel (charge sharing).
-
-In order to count once al X-rays the threshold should be set at half of the X-ray energy
-: if the threshold would be higher some photons would not be counted, leading to a loss of efficiency, while if it would be lower some photons would be counted twice leading to a loss of spatial resolution.
-
-
-Since the detector threshold can't be precisely set at the same value for all channels but there will always be some spread of the order of 200 eV (threshold dispersion) there will always be some fluctuations on the number of counts between channels, which however should be corrected by the flat field correction.
-
-
-The choice of the threshold should also depend from considerations regarding the emission of fluorescent radiation from the sample.
-
-Figure 3.3 shows how the curve of the counts would look like for monochromatic X-rays of energy
- in presence of radiation of energy
- emitted by the sample. The curve would show a second step at
-.
-
-
-Since the fluorecence emission is not present in the flat field data, the difference of counts between the channels due to the fluorescent radiation cannot be corrected and the threshold
- should be set at an energy larger than
-. This also helps to cut down the background.
-
-The difference of counts between the channels will be particularly large if the threshold is set in some ``steep'' part of the curve i.e. close to
- or to
- (but in this case it would be corrected by the flat field, at cost of loss of efficiency).
-Because of the presence of the electronic noise,
- should be at least 3 keV larger than
-.
-
-
-Here is a short list of rules to select the appropriate working threshold in order of importance (and eventually modify the X-ray energy):
-
-
-
List the fluorescent emission lines
- that you expect from your sample.
-
-
If there is no fluorescent emission (
-)
-
-
-
If there is fluorescent emission
-
-
-
- keV
-
-
- keV
-
-
-If the range where both requirements are satisfied is large, try to increase the distance of
- from
- up to 5 keV and then set
- as close as possible to the ideal value
-
-
-
If it is not possible to satisfy the previous minimal requirements:
-
-
-
If you need high quality data and you can sacrifice detector efficiency (a lot!)
- keV
-
-
If you need fast measurments and you can sacrifice detector uniformity (difficult to say how much) and increase the background
- keV. Remember that
- is klimited by the electronic noise
- keV (3 keV for High gain settings).
-
-
Consider to change
- to values lower than
- or at least 6-8 keV larger than
-
-
-
-
-
-
-
-
-
-
-
Figure 3.4:
-Example of data from a sample emitting fluorescent light and detector threshold set at a value close to the emission line. The background data cannot be properly flat field corrected.
-The main reasons of a non flat flat-field can be:
-
-
-
The scattering from the glass rod is not uniform over the angular range. In this case you should take the flat field dynamically i.e. scanning the detector in front of the cylinder with the small window, as we do at the SLS. In this case when you shift the detector, the shape of the illumination remains in the same angular position (and shifts in channel number). Of course it depends a lot on the energy and on the geometry of the flat field acquisition.
-
-
-
-
Figure 3.5:
-Example of a very bad flat field data set with highlights of some of the reasons which can cause the non-flat behavior for the MYTHEN detector. Similar effects can be visible also in 2D.
-
-
-
-
-
-
-
-
-
-
-
The entrance window for the X-rays is deformed (we also have this problem at the SLS). In this case when you move the detector the "mountain" moves with it in angle (And remains still in channel number). However this should correct without problems with the flat field correction, even in case of fluorescent emission. Should appear at all energies.
-
-
Differences of efficiency between the modules i.e. mainly bad energy calibration. You normally see really steps at the transition between modules. Sometimes you have some groups of strips withing a module that are not properly trimmed and look as smallish peaks or valleys in the flat field. When you move the detector, these steps or peaks move in angle and remain still in channel number.
-These differences can slightly change as a function of the energy (probably more evident at lower energies) but should normally always be there for the same settings.
-These differences get much worse in presence of fluorescent emission, but normally correct properly with flat field correction.
-
-In case it is not possible to uniformely illuminate the detector due to its large dimensions, one of the solutions is to scan it in front of an illuminated are with a uniform speed such that the integrated number of counts during the exposure time is the same for all channels.
-
-
-To do that, at the SLS we have optimized the dynamic acquisition of the flat fiel with the MYTHEN detector using a setup similar to the one sketched in figure 3.6.
-It is important that the scanning range of the detector is chose such that the detector is not illuminated both at the beginning and at the end of the acquisition. Moreover the movement of the detector should be as uniform as possible. To avoid this kind of systematic errors we normally sum two flat field images taken in the two opposite directions of translation.
-
-
-Also take care that your sample does not emit fluorescent light at the chosen energy (e.g. a glass rod works at all energies, but heavier materials can be chosen to increase the efficiency at higher energies taking care that the fluorescence emission is negligible).
-
-
-
-
-
-
Figure 3.6:
-Sketch of the experimental setup for a dynamic acquisition of the flat field.
-The first step in the trimming procedure is to trim with noise (this is often sufficient). This has to be done for all the settings which are foreseen to be used (highgain, standard and fast).
-
-The procedure for the noise trimming is as follows:
-
-
-
In the Initialization tab click on the settings for which you want to trim (e.g. standard)
-
-
In the Initialization tab click on the advanced radio button to make the trimming accessible.
-
-
In the Acquisition tab set the acquisition time to 100 ms, the repetion to 1 and the delay between frames to 0.
-
-
For noise trimming usually the default parameters
-
-,
-
-,
-
- work.
-
-However, to verify the threshold setting it is best to make a threshold scan. To do this go to the Data tab, in the Data display section select the 2D color and type advanced option. In the Acquisition tab select your data directory. Set the number of positions to 0. Select Scan, Type threshold. Typical values for the range are 500 to 900 with a step size of 10. Then click on the start button to perform the threshold scan. After the threhold scan has finished an image similar to the one in 3.7 should be shown. Depending on the system the number of modules may vary. If the plot is similar to the one in 3.10 the noise trim files did already exist and have been loaded when selecting the settings. In this case you don't need to trim with noise again.
-
-Set the parameter Vthreshold in the Trimming box (Initialization tab) 10-30 DAC units below the onset of the noise for the module with the lowest threshold offset. Since the modules have differences in the offset and gain the onset of the noise varies.
-
-You can usually leave the remaining parameters unchanged (Counts/pixel=500; Resolution=4).
-
-
Select the directory where the noise trim files should be written and the filename, to wich will be attached the extension given by the module serial number (.snxxx). If you want the trimfiles to be loaded authomatically when the global settings are selected, select the default directory specified in the config file (or in the ``trimbits/beamline'' directory for the older software versions).
-Click on Trim to start the noise trimming process. After the trimming has finished look at the plot and the distribution of the trim bits. The distribution should be around 32
-5 and should look gaussian. An example distribution is shown in figure 3.8 and an example plot in 3.9. If the distribution is too much off center change the counts/pixel, if it is too narrow reduce the resolution (set it to 3), if it is too wide increase it (set it to 5). Make sure not too many channels have a trim value of 0 or 63.
-
-
Execute the treshold scan again to verify the trimming was done properly. A plot similar tho the one in figure 3.10 should appear.
-
-
-
-
-
-
-
-
Figure 3.7:
-The untrimmed threshold scan.
-
-
-
-
-
-
-
-
-
-
-
-
-
Figure 3.8:
-The distribution of the trimbits.
-
-
-
-
-
-
-
-
-
-
-
-
-
Figure 3.9:
-The trimbits for all the channels.
-
-
-
-
-
-
-
-
-
-
-
-
-
Figure 3.10:
-The trimmed threshold scan.
-
-
-
-
-
-
-
-
-
-Improve the trimming using X-rays
-
-
-The improvement of the trimming acquired with noise is not essential: at 12 keV an untrimmed module has a threshold dispersion which is about 1.4 keV and is already reduced to 200 eV at 12 keV by the noise trimming. At lower energies the noise trimming will be more effective, while the threshold dispesion will be still larger at higher energies. The trimming improvement reduces the threshold dispersion to 140 eV at 12 keV and is expected to be almost constant at all energies. For this reason it is suggested to perform the trimming improvement only when a small threshold dispersion is really important (e.g. to avoid flat field corrections or in presence of fluorescent lines close to the threshold value) and it will probably be not worthy at lower energies (i.e. threshold lower than 6 keV and X-ray energy lower than 12 keV).
-The procedure for the trimming improvement is as follows:
-
-
-
Select the settings of the detector and load the noise trimming file
-
-
Set the threshold at half of the X-ray energy (better if the detector has already been calibrated in energy like explained in 3.5)
-
-
Illuminate the detector with a flat field. This is very important to obtain a good trimming.
-
-
Select the acquisition time in the acquisition tab so that there are at least 1000 counts/strip per frame (the more counts, the better trimming). Set the repetions to 1 and the delay between frames to 0.
-
-
Go to expert mode by clicking on advanced in the initialization tab, settings box
-
-
In the trimming box select the directory where the noise trim files should be written and the filename, to wich will be attached the extension given by the module serial number (.snxxx).
-
-
Select the improve method
-Start the trimming
-
-
-If the trimming is correctly performed and the illumination is flat enough, the same trimming can be used every time you will measure at this same energy.
-The authomatic loading of energy-specific trim files is not yet implemented.
-
-
-Since the conversion between the threshold DAC units and energy depends on the gain and offset of the channels the energy calibration has to be done for all settings (high gain, standard and fast). For each setting follow this procedure:
-
-
-
Select the setting in the Initialization tab.
-
-
Enter in expert mode by clicking the Advanced radiobutton in the Global settings box in the Initialization tab.
-
-
If the trimfiles are in the correct location and with the correct name, they should be loaded by default every time you select the corresponding settings in the global settings box in the initialization tab 3.1.
-If the trim files do not yet exist generate them as explained in section 3.4.1.
-
-
Execute a threshold scan of the detector with at least three different energies. The more monochromatic are the X-rays, the better the calibration will be (i.e. scattered X-rays are better than the fluorescent emission).
-
-The scan should range from where all modules count 0 (estimate 850-20
-energy(keV) DAcu) and where all modules start having a lot of noise (usually 800 DACu) with a step of 1 or 2 DACu. The acquisition time should be chosen so that there are at least 1000 counts per strip on the plateau.
-
-
Open the file root/CalAllModules.C for editing. Change the value of the following global variables according to your needs:
-
-
-
nmod is the number of modules of your system.
-
-
nscan is the number of different threshold scans you acquired.
-
-
en is the array with the energies at which you acquired the scans, in keV.
-
-
een is the array with the errors on the energies at which you acquired the scans, in keV. It is usually small, but can be some hundreds eV in case of dirty fluorescent samples.
-
-
fn is the array containing the location and root file name of your data.
-
-
run is the array containing the run index of your data.
-
-
startscan is the array containing the threshold value at which you started the scans.
-
-
stopscan is the array containing the threshold value at which you finished the scans.
-
-
stepscan is the array containing the threshold step of the scans.
-
-
ave is the array containing the average number of counts per strip on the plateau (it must not be too precise).
-
-
sn is the array containing the list of the serial number of the modules to be calibrated. It is important that the list is in the right order, so that the optput calibration files have the extension .snxxx corresponding to the right module.
-
-
of is the location and root file name of the calibration file. The directory should already exist and the extension .snxxx will be attached to the output file.
-
-
-
-
Launch root, which you should have already installed on your linux PC
-
-
Execute the following commands in order to load the macros needed for the calibration:
-
-You should get a lot of warnings, but no errors.
-
-
Execute the following command in order to run the calibration:
-
-root$ EnCalModules()
-root$
-
-Reading and analyzing the data takes some time, but, after a while, a canvas should open where the plots of the median of the counts of every module as a function of the threshold should be shown for each energy, fitted with a modified erf function in order to find the inflextion point. The last plot of the canvas should represent the inflexion points as a function of the energies, and by fitting it with a straight line it is possible to calculate the offset and gain for each module i.e. calibrate it as a function of the energy. Please check that this automated fitting procedure succeeds. In case you see many fitting errors you should try to check wether the variable you edited in root/CalAllModules.C are all correct or try to edit the fitting procedures in the two root macro files (sorry!).
-
-
Copy the calibration file you obtained to calibration/settings.snxxx3.2 By doing this the correct threshold for each module will be calculated every time you change the threhsold energy in the global settings box in the initialization tab, you have loaded some default settings and you are not in expert mode.
-
-The complete software package is composed of several programs which can be installed (or locally compiled) depending on the needs:
-
-
-
-
-
The slsDetector shared and static libraries which are necessary for all user interfaces.
-
-The class slsDetectorUsers can be used as API from your acquisition software (see separate documentation).
-
-
The command line interfaces (sls_detector_put, sls_detector_get, sls_detector_acquire, sls_detector_help), which are provided to communicate with the detectors using the command line and eventually to the data receiver
-
-
The data receiver (slsReceiver), which can be run on a different machine, receives the data from the detector and interfaces to the control software via TCP/IP for defining e.g. the file name, output path and return status and progress of the acquisition
-
-
The graphical user interface (slsDetectorGUI) which provides a user friendly way of operating the detectors with online data preview
-
-
The calibration wizards (energyCalibrationWizard, angularCalibrationWizard) to analyze the data and produce the energy or angular calibration files
-
-For most users the detector will be composed by a single module. Therefore all configurations of the detector will refere to that single entity.
-
-
-However, for some experiments it is necessary to concatenate the data from several detector controllers, and sometimes (e.g. MYTHEN) each controller can control many modules. This should be transparent to the user since most parameters will be identical for all controllers (e.g. exposure time, energy threshold etc.), except for the configurations specific to the controller (e.g. hardware configuration).
-
-In principle it is possible to combine controllers of different type (e.g. MYTHEN, GOTTHARD, EIGER) but the user should then evaluate if it really makes sense to control such different systems in parallel.
-
-
-In other cases, several SLS detectors will independently acquire data during the same experiment. In this case it will be necessary to be able to seperately control them.
-
-
-The detectors can be controlled in parallel from several PCs (clients). However it is important the the configurations match on all of the them such that no conflict arise. Eventually a detector can be locked to a specific control PC, still different users interfaces (command line, GUI) can be used in parallel.
-
-
-A sketch of a possible complex detector configuration is shown in figure 1.1
-
-
-For this reason and index is assigned to each detector. If a single detector is used, as in most cases, the index will be omitted and defaults to 0.
-
-To control the other detectors the index cannot be omitted!
-
-
-An index will also be assigned to each controller within a detector. However the user normally will not need to address single controllers, except for the most advanced settings which can be left to configuration files.
-
-
-Finally each module within a controller has an internal index. However in general it is not required that the user is aware of the system architecture and, if needed (rarely), the modules can simply be addressed sequentially starting from controller 0.
-
-
-
-
-
-
Figure 1.1:
-Scketch of a possible complex system architecture composed of several detector, each consisting in many controllers eventually controlling several modules.
-For MYTHEN, if one needs to control 6 modules, the system can either be composed by and MCS6 with 6 modules (1 detector, 1 controller, 6 modules), or by 6 MCS1 (1 detector, 6 controller, 1 module each). After apppropriate configuration of the system, the interface to the user will be the same for both systems.
-
-
-For GOTTHARD, one module corresponds to one controller. A detector will have the smae number of controllers and modules.
-
-
-For EIGER, one module consists in two controllers. Fo a multi-module system, the number of controllers will increase accordingly, but should be left to a configuration file.
-
-
-You will need to configure more than one detector, only in case you want to operate several detectors independently.
-
-
-For slower acquisitions, the detector will return the data to the control PC over TCP/IP (e.g. MYTHEN).
-
-
-However, for faster frame rates (e.g. GOTTHARD, EIGER) the controllers will return the data to a data receiver i.e. a process specifically designed to receive the data from the controller over a GBit network and save them to disk.
-
-The data receiver can run on any machine (e.g. a file server) accessible by both the control PC and the detector controller, as sketched in figure 1.2. A data receiver process must be configured for each controller. Normally, to avoid performance loss it is better if different data receivers run on different machines.
-
-
-
-
-
-
Figure 1.2:
-Scketch of the communication between the control PC, the detector and the data receiver.
-
-
-
-
-
-To setup the system, you should configure:
-
-
Client-Detector TCP/IP connection
-
i.e. for each controller hostname or IP address (hostname) and communication port (port, use default).
-
-
Client-Receiver TCP/IP connection
-
i.e. hostname or IP address of the data receiver (rx_hostname) and communication port (textitrx_tcpport, use default).
-
-
Detector-Receiver UDP connection
-
i.e. for each controller IP address of the receiver network interface (rx_udpip) and communication port (rx_udpport) used for receiveing the data. By detfault the IP address of the TCP/IP receiver interface will be used also for the UDP conenction. Editing the UDP network interfaces and ports is useful if several controller are sending data to a single receiver (not reccomended to avoid performance loss).
-
-A MAC (detectormac) and IP address (detectorudpip) should also be assigned to the controller network interface used for the UDP communication, but the default values can normally be used unless firewalls are defined between the detectors and the receiver.
-
-
-All these configurations are normally left to the configuration file and should not be changed dynamically by the user.
-
-
-After starting the data receiver process and correctly configuring the client and the detector, this architecture should be completely transparent for the user, except that the output file path must be properly configured from the client for the data receiver machine (easiest is that the disk is mounted for both machines in the same location).
-
-The client will take care of communicating with the data receiver and the detector. A feedback about the progress of the acquisition and a preview of the data being acquired can also be obtained by the client from the data receiver.
-
-
-The analog characteristics of the detector have to be initialized in order to define the noise and the dynamic range which need to be used for the measurements. These parameters have a different meaning for analog or digital detectors, but in both cases some predefined voltage levels and current (we call them settings) must be laoded to the detector. Moreover, there are some parameters that are custom to single detectors or modules (e.g. the trimbits). All these settings are stored in some settings file, which are organized in a settingsdir with a definite architecture, where the software will look for the files to load to the detector whaen changing its settings.
-
-
-In addition to that, in a single photon counting detector the threshold is set as a voltage level for the comparator, but for the user it is useful to have a direct conversion to the energy level. For this, after a proper calibration of the detector (see specific documentation) calibration file are generated in order to convert threshold in volts to keV. Also in this case the directory caldir where the calibration files are stored must be defined ad organized with a proper architecture, suche that the software can find the calibration coefficients for settings the threshold.
-
-Normally settingsdir and caldir can be the same, but have been left separate for flexibility.
-
-
-The settingsdir and caldir should be properly configured for your detector either in a configuration file (for use with text clients, GUI or API) or dynamically (works only for the text clients).
-
-
-In the following, the architecture of the settingsdir and caldir is described for the different detectors.
-
-
-For mythen, an example of settingsdir and caldir is given in the software package by the directory trimdir.
-Since these directories are customized by producing trimbit files and calibration for each detector, make sure not to overwrite yours every time you upgrade the software.
-
-
-settingsdir should contain three subdirectories standard, fast and highgain containing respectively the trimfiles standard.trim, fast.trim and highgain.trim which contain the correct voltage settings for the detector although all the individual channel thresholds set to 0. The original files contained in the package should be used, infact in case of error the detector would not recognize the correct settings.
-
-The default trimbit files for each file will be stored in the directory according to the settings with the name noise.snxxx where xxx is the module serial number.
-
-
-caldir should contain three subdirectories standard, fast and highgain containing respectively the trimfiles standard.cal, fast.cal and highgain.cal which contain an average calibration of the modules for the diffrent settings. However this can different from the correct one for each individual module even of several kev and therefore it is very important to perform an energy calibration on a module basis.
-
-The default calibration files for each file will be stored in the directory according to the settings with the name calibration.snxxx where xxx is the module serial number.
-
-
-A settingsdir should be configured, as the directory settings in this software package.
-
-It must contain the subdirectories dynamicgain, gain1, gain2, gain3, highgain, lowgain, mediumgain, and veryhighgain in order to properly configure the GOTTHARD detector using the various gain settings.
-
-
-A configuration file is a list of command necessary to properly configure your detector systems, with default valuee for some parameters and other settings that the users should normally not change dinamically.
-For this reason most of the commands present in the configuration file cannot be modified when using the API.
-
-The syntax of the configuration file is exactly the same as in the comman line interface, therefore you can refere to that documentation to edit the files.
-
-The configuration files look different for the different detector types. Examples of configuration files can be found in the examples directory.
-
-
-
-
-Thattil Dhanya
-2018-02-09
-
-
-
diff --git a/manual/docs/html/slsDetectors-FAQ/node8.html b/manual/docs/html/slsDetectors-FAQ/node8.html
deleted file mode 100644
index 18ed3c2d5..000000000
--- a/manual/docs/html/slsDetectors-FAQ/node8.html
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-What is the meaning of the file name?
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Next:Which is the sequence
- Up:SLS Detectors Software
- Previous:How should a configuration
- Contents
-
-
-
-
-
-The final file name will be:
- outdir/prefix[_d
-][_Sv0][_sv1][_pp][_ff]_i.ext
-
-where:
- outdir is the output directory path;
- prefix is the chosen prefix for the file name;
- d is the detector index, in case of data receiver and more than one detector;
- v0 is the scan0 variable with the desired precision, if scan0 is enabled;
- v1 is the scan1 variable with the desired precision, if scan1 is enabled;
- p is the position index, if different positions are configured;
- f is the frame index of the first frame stored in the file, if many frames and cycles are configured;
- i is the file index;
- ext is the file extension e.g. .raw for MYTHEN raw data, .dat for MYTHEN processed data.
-
-
-
-
-Thattil Dhanya
-2018-02-09
-
-
-
diff --git a/manual/docs/html/slsDetectors-FAQ/node9.html b/manual/docs/html/slsDetectors-FAQ/node9.html
deleted file mode 100644
index 48288384b..000000000
--- a/manual/docs/html/slsDetectors-FAQ/node9.html
+++ /dev/null
@@ -1,343 +0,0 @@
-
-
-
-
-
-Which is the sequence of the acquisition flow?
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Next:How can I synchronize
- Up:SLS Detectors Software
- Previous:What is the meaning
- Contents
-
-
-
-
-
-The software gives the possibility to setup several loops, actions and scan utilities which are then handled during the acquisition.
-The software will also take care to generate the file names and increment the indexes accordingly.
-
-
-Figure 1.7 shows in which sequence the various scripts and loops are executed when calling the acquire command. The loops are drawn using the
-
- symbol, while the scripts using the
-
-.
-
-
-
-
-
-
-
-
-
-
-If you prefere to handle the acquisition from your acquisition enviroment, simply leave al scripts and scans disabled and call the acquition from your acquisition enviroment.
-
-Only the frames and cycles loops are defined in firmware and guarantee a precise timing of the acquisition which cannot replaced by any other method (you can synchronize to your beamline by hardware connection of the IO signals as described in 1.8).
-
-
-Hereafter a description of the meaning of the various loops:
-
-
Measurement loop
-
executes offline several times the entire sequence of the acquisition. At the end of each measurement the file index is incremented.
-
-
-
-
Scan 0 loop
-
is a high level scan loop which can be used e.g to loop on an enviroment variable (temperature, humidity...) or even to change sample.
-
-The list of steps or range of the scan0 variable must be set as scan0steps or scan0range. For small steps of the scan variable, avoid overwriting of the files specifying all the necessary digits in the filename by properly setting the precision with scan0prec.
-
-
-
-
Scan 1 loop
-
is a low level scan loop which can be used e.g to loop on an enviroment variable (temperature, humidity...) or to move the sample in case of radiation damage.
-
-The list of steps or range of the scan1 variable must be set as scan1steps or scan1range. For small steps of the scan variable, avoid overwriting of the files specifying all the necessary digits in the filename by properly setting the precision with scan1prec.
-
-
-
-
Position loop
-
The detector is moved in the angular positions specified by the positions command.
-
-The command for moving the detector should be defined as described in 1.10.
-
-All data acquired during a position loop will be merged together, unless the number of positions is set to 0. In this case single frames will be converted to angle without merging.
-
-Avoid using the position loop together with many frames/cycles.
-
-
-
-
Cycles loop
-
is executed in real time and defines e.g. the number of triggers that will be accepted. The total number of images will be given by frames times cycles.
-
-
-
-
Frames loop
-
is executed in real time and defines e.g. the images acquired per trigger. The total number of images will be given by frames times cycles.
-
-
-
-
-Executing a script simply consists in a system call with the arguments specified below. The various scripts are executed only if they are enabled and different than none.
-
-The scripts must be executable and the capability of parsing the arguments passed by the acquition program is left to the user writing the scripts. some example scripts writte in awk can be found in the examples directory.
-
-Hereafter a short description of how the scripts are called and with which options:
-
-
Start script
-
is executed at the very beginning of the measurement and can be used e.g. to initialize all the devices needed for the acquisition or open the beamline valves. The script is executed as:
-
-script nrun=i par=p
-
-where i is the file index and p is the start script parameter.
-
-
-
-
Scan0 script
-
There are a few predefined scan modes i.e. threshold changing the detector threshold in DAC units, energy chaning the calibrated detector threshold in eV, trimbits chaning the trimbits of the detector (advanced: do not use) and position changing the detector position (if the motor movement is correctly setup as described in 1.10). Otherwise the scan0script is executed as:
-
-script nrun=i fn=fn var=v par=p
-
-where i is the file index, fn is the file name, v is the value of the scan0 variable at the present step of the scan0 loop and p is the scan 0 script parameter.
-
-
-
-
Scan1 script
-
There are a few predefined scan modes i.e. threshold changing the detector threshold in DAC units, energy chaning the calibrated detector threshold in eV, trimbits chaning the trimbits of the detector (advanced: do not use) and position changing the detector position (if the motor movement is correctly setup as described in 1.10). Otherwise the scan1script is executed as:
-
-script nrun=i fn=fn var=v par=p
-
-where i is the file index, fn is the file name, v is the value of the scan1 variable at the present step of the scan1 loop and p is the scan 1 script parameter.
-
-
-
-
Script before
-
is called just before the beginning of the data taking and can be used e.g. to open the shutter.
- The script is executed as:
-
-script nrun=i fn=fn par=p sv0=v0 sv1=v1 p0=p0 p1=p1
-
-where i is the file index, fn is the file name, p is the script before parameter, v0 and v1 are the values of the scan0 and scan1 variables at the present step of the scan loops and p0 and p1 are the scan0 and scan1 script parameters.
-
-
-
-
Header before script
-
is called before every step of the data taking (i.e. for each position, but at the beginning of the frames train if several acquisition have been programmed in real time) and can e.g. be used to dump the exact settings of the detector and beamline to reproduce or analyze the data offline.
- The script is executed as:
-
-script nrun=i fn=fn par=p
-
-where i is the file index, fn is the file name, and p is the header before parameter.
-
-
-
-
Header after script
-
is called after every step of the data taking (i.e. for each position, but at the end of the frames train if several acquisition have been programmed in real time) and can e.g. be used to dump the exact settings of the detector and beamline to reproduce or analyze the data offline.
- The script is executed as:
-
-script nrun=i fn=fn par=p
-
-where i is the file index, fn is the file name, and p is the header after parameter.
-
-
-
-
Script after
-
is called just after the end of the data taking and can be used e.g. to close the shutter.
- The script is executed as:
-
-script nrun=i fn=fn par=p sv0=v0 sv1=v1 p0=p0 p1=p1
-
-where i is the file index, fn is the file name, p is the script after parameter, v0 and v1 are the values of the scan0 and scan1 variables at the present step of the scan loops and p0 and p1 are the scan0 and scan1 script parameters.
-
-
-
-
Stop script
-
is executed at the very end of the measurement and can be used e.g. to switch off all devices. The script is executed as:
-
-script nrun=i par=p
-
-where i si the file index and p is the stop script parameter.
-
-
-
-
-
-Thattil Dhanya
-2018-02-09
-
-
-
diff --git a/manual/docs/pdf/slsDetectorInstall.pdf b/manual/docs/pdf/slsDetectorInstall.pdf
deleted file mode 100644
index ffb8f1894..000000000
Binary files a/manual/docs/pdf/slsDetectorInstall.pdf and /dev/null differ
diff --git a/manual/docs/pdf/slsDetectors-FAQ.pdf b/manual/docs/pdf/slsDetectors-FAQ.pdf
deleted file mode 100644
index da6a64d2e..000000000
Binary files a/manual/docs/pdf/slsDetectors-FAQ.pdf and /dev/null differ
diff --git a/manual/manual-main/Makefile b/manual/manual-main/Makefile
index a87cf09e1..130ddea50 100644
--- a/manual/manual-main/Makefile
+++ b/manual/manual-main/Makefile
@@ -4,28 +4,34 @@ DESTDIR=../docs
TEX=latex
-MAINTEXS= slsDetectorInstall.tex slsDetectors-FAQ.tex
+MAINTEXS2= slsDetectorInstall.tex
+MAINTEXS=slsDetectors-FAQ.tex
TEXS=slsDetector-softFAQ.tex singlePhotonCounting-FAQ.tex angConv-FAQ.tex generalDet-FAQ.tex
DVIS = $(MAINTEXS:.tex=.dvi)
PSS = $(MAINTEXS:.tex=.ps)
PDFS = $(MAINTEXS:.tex=.pdf)
+PDFS2 = $(MAINTEXS2:.tex=.pdf)
HTMLS = $(MAINTEXS:%.tex=%)
+HTMLS2 = $(MAINTEXS2:%.tex=%)
all: pdf html
echo $(PWD)
echo $(PDFS)
+ echo $(PDFS2)
echo $(HTMLS)
+ echo $(HTMLS2)
-pdf: $(PDFS)
+pdf: $(PDFS) $(PDFS2)
$(shell test -d $(DESTDIR) || mkdir -p $(DESTDIR))
$(shell test -d $(DESTDIR)/pdf || mkdir -p $(DESTDIR)/pdf)
- mv $(PDFS) $(DESTDIR)/pdf
+ mv $(PDFS) $(DESTDIR)/pdf
+ mv $(PDFS2) $(DESTDIR)/pdf
-html: $(HTMLS)
+html: $(HTMLS) $(HTMLS2)
$(HTMLS): $(TEXS) $(MAINTEXS)
@@ -34,7 +40,18 @@ $(HTMLS): $(TEXS) $(MAINTEXS)
$(shell test -d $(DESTDIR)/html/$@ && rm -fr $(DESTDIR)/html/$@)
echo "***************************** $@"
latex $@.tex
- latex2html -split 4 $@.tex
+ latex2html $@.tex
+ mv $@ $(DESTDIR)/html
+
+$(HTMLS2): $(MAINTEXS2)
+ $(shell test -d $(DESTDIR) || mkdir -p $(DESTDIR))
+ $(shell test -d $(DESTDIR)/html || mkdir -p $(DESTDIR)/html)
+ $(shell test -d $(DESTDIR)/html/$@ && rm -fr $(DESTDIR)/html/$@)
+ echo "***************************** $@"
+ latex $@.tex
+ latex2html -split 16 -no_navigation -info "" -address "" -long_titles 5 -link 0 $@.tex
+ #-show_section_numbers $@.tex
+ # -local_icons
mv $@ $(DESTDIR)/html
@@ -51,7 +68,7 @@ $(HTMLS): $(TEXS) $(MAINTEXS)
clean:
- rm -rf *.aux *.log *.toc *.out $(DVIS) $(PSS) $(PDFS) $(HTMLS)
+ rm -rf *.aux *.log *.toc *.out $(DVIS) $(PSS) $(PDFS) $(PDFS2) $(HTMLS) $(HTMLS2)
rm -rf $(DESTDIR)/html/slsDetectors-FAQ
rm -rf $(DESTDIR)/html/slsDetectorInstall
rm -rf $(DESTDIR)/pdf/slsDetectors-FAQ.pdf
diff --git a/manual/manual-main/slsDetectorInstall.tex b/manual/manual-main/slsDetectorInstall.tex
index 4b73977ec..0df430fdd 100644
--- a/manual/manual-main/slsDetectorInstall.tex
+++ b/manual/manual-main/slsDetectorInstall.tex
@@ -3,135 +3,299 @@
\usepackage[dvips]{graphicx}
\usepackage{verbatim}
\usepackage{hyperref}
+\usepackage{color}
+
+
+
\begin{document}
\title{SLS Detectors software installation}
-\author{Anna Bergamaschi}
+\author{Anna Bergamaschi, Dhanya Thattil}
\date{\today}
\maketitle
\tableofcontents
\clearpage
+%setcounter{tocdepth}{4} and \setcounter{secnumdepth}{4}
-The SLS detectors software is intended to control the detectors developed by the SLS Detectors group.
-
-It provides a command line interface (text client), a graphical user interface (GUI) as well as an API that can be embedded in your acquisitions system, some tools for detector calibration and the software to receive the data from detector with high data throughput (e.g. GOTTHARD, EIGER).
-\section{The software package}
+
+\section{The Software Package}
+The SLS detectors software is intended to control the detectors developed by
+the SLS Detectors group. The detectors currently supported are:
+
+\indent MYTHEN, GOTTHARD, EIGER and JUNGFRAU.
-The complete software package is composed of several programs which can be installed (or locally compiled) depending on the needs:
+The package provides software for the distributed system that comprises of
+detectors, data receivers (to process detector data), and the client (to control
+or monitor the system). The client and data receivers can be embedded in
+the user's acquisitions system. Furthermore, the package also provides some
+tools for detector calibration.
+
+\subsection{Binaries}
+\noindent The complete software package is composed of several programs which
+can be installed (or locally compiled) depending on one's requirements:
\begin{itemize}
-\item The \textbf{slsDetector shared and static libraries} which are necessary for all user interfaces. \\
- The class slsDetectorUsers can be used as API from your acquisition software (see separate documentation).
-\item The \textbf{command line interfaces (sls\_detector\_put, sls\_detector\_get, sls\_detector\_acquire, sls\_detector\_help)}, which are provided to communicate with the detectors using the command line and eventually to the data receiver
-\item The \textbf{data receiver (slsReceiver)}, which can be run on a different machine, receives the data from the detector and interfaces to the control software via TCP/IP for defining e.g. the file name, output path and return status and progress of the acquisition
-\item The \textbf{graphical user interface (slsDetectorGUI)} which provides a user friendly way of operating the detectors with online data preview
-\item The \textbf{calibration wizards (energyCalibrationWizard, angularCalibrationWizard)} to analyze the data and produce the energy or angular calibration files
-\item The \textbf{GOTTHARD and MYTHEN virtual servers} to simulate the detectors behavior (however only control commands work, not the data acquisition itself)
+
+\item \textcolor{blue}{libSlsDetector.so, libSlsReceiver.so}:\\
+The \textit{slsDetector shared and static libraries}, which are
+necessary for all user interfaces. The \textit{C++ API} via the class
+\textit{slsDetectorUsers} (installed with the default package) or the
+\textit{Python API} via the class \textit{sls\_detector} (installed with the
+package including Python API), which can be used from the user's acquisition
+software to control the detectors and the data receivers.
+
+\item \textcolor{blue}{sls\_detector\_put, sls\_detector\_get,
+sls\_detector\_acquire, sls\_detector\_help}: \\
+The \textit{command line interfaces}, which are provided to communicate with the
+detectors and data receivers using the command line.
+
+\item \textcolor{blue}{slsReceiver}: \\
+The \textit{data receiver}, which can be run on a different machine than the
+client, receives the data from the detector and processes it. The receiver can
+be configured, controlled and monitored by the client.
+
+\item \textcolor{blue}{slsDetectorGUI}: \\
+The \textit{graphical user interface}, which provides a user friendly way
+of operating the detectors and data receivers with online data preview.
+
+\item \textcolor{blue}{energyCalibrationWizard,angularCalibrationWizard}: \\
+The \textit{calibration wizards} to analyze the data and produce the energy or
+angular calibration files.
+
+\item The \textit{virtual Detector servers} to simulate the detectors behavior.
+However, only control commands work, not the data acquisition itself.
\end{itemize}
-Please refere to the SLS Detectors FAQ for additional documentation.
-\section{Requirements}
-The software is written in C/C++.\\
-It needs to be able to access the shared memeory of the control PC and communicate to the detectors over TCP/IP. Therefore the detector should receive a proper IP address (either DHCP or static) and no firewall should be present between th control PC and the detector.
-For installing the slsDetector shared and static libraries and the slsDetectorClient software, any Linux installation with a working gcc should be fine.
+\section{Install Binaries via Conda}
+This section is useful only if one wants to download only the binaries for
+specific distribution and use the package via command line. Please refer later
+sections to download source code and compile them.
-The slsDetectorGUI is based on Qt4 with Qwt libraries.
-The calibration wizards are based on the CERN Root data analysis framework.
+One can download and install Miniconda via
-To compile the software you will need the whole Qt4, Qwt and Root installation, including the header files.\\
-To run the software, it is enough to have the Qt4, Qwt or Root libraries appended to the \verb=LD_LIBRARY_PATH=.
+\url{https://conda.io/miniconda.html}
-\subsection{Qt4 installation}
-A Qt version equal or higher than 4.6 is required.
+The conda package uses Travis CI for continuous integration with
+automatic deployment to Anaconda Cloud. One can download only the package or the
+package including the python interface.
+
+
+After the installation, the binaries will be available in your path.
+
+Please remember to clear shared memory after installation.
+\begin{verbatim}
+#displays list of shared memeory segments
+ipcs -m
+#remove segments that have nattach equal to zero. They key is the first column
+ipcrm -M [key]
+\end{verbatim}
+
+\begin{itemize}
+ \item Only the package
+\begin{verbatim}
+#Add conda channels
+conda config --add channels conda-forge
+conda config --add channels slsdetectorgroup
+
+#Install latest version
+conda install sls_detector_software
+
+#Install specific release (GLIBC2.14)
+conda install sls_detector_software=3.1.0
+
+#Scientific Linux 6 version (GLIBC2.12)
+conda install sls_detector_software=SL6_3.1.0
+\end{verbatim}
+ \item The package including Python interface
+\begin{verbatim}
+#Add conda channels
+conda config --add channels conda-forge
+conda config --add channels sls_detector
+
+#Install latest version
+conda install sls_detector
+
+#Install specific release (GLIBC2.14)
+conda install sls_detector=3.1.0
+
+#Scientific Linux 6 version (GLIBC2.12)
+conda install sls_detector=SL6_3.1.0
+\end{verbatim}
+\end{itemize}
+
+
+\clearpage
+\section{Install via Source Code}
+This section is useful if one wants to use the API and embed it in their
+acquisition system, or if one wants to download the source code and compile.
+
+\subsection{Download Source Code}
+
+\begin{itemize}
+ \item Only the package
+\begin{verbatim}
+#Clone source code with specific release
+git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git --branch
+3.1.0
+\end{verbatim}
+ \item The package including Python interface
+\begin{verbatim}
+#Clone source code with specific release
+git clone https://github.com/slsdetectorgroup/sls_detector.git --branch
+3.1.0
+\end{verbatim}
+\end{itemize}
+
+
+
+\subsection{Requirements}
+These are the basic requirements to install and use the software. Fine Tuning
+the system will be discussed in other documentation provided.
+\begin{itemize}
+
+ \item \emph{C/C++}:\\
+The software is written in C/C++. If Python API is used, it is a wrap around
+to the C++ software. Any Linux installation with working libgcc should be
+sufficient.
+
+ \item \emph{Shared Memory}:\\
+Access to the shared memory of the control PC is required for the client.
+
+ \item \emph{Network}:\\
+The control PC communicates to the detectors and data receivers over TCP/IP.
+Therefore, the detector should receive a proper IP address (either DHCP or
+static) and no firewall should be present between the control PC and the
+detector.
+
+\item \emph{Compilation}:\\
+cmake is required to compile. make is also possible, but is harder to find
+dependencies.
+
+\item \emph{GUI}:\\
+To use the GUI, one requires atleast Qt4.8.2 and Qwt6.0. Installation of these
+are discussed in the next sections.
+
+\item \emph{Calibration Wizards}:\\
+They are based on the CERN Root data analysis framework. Installation of it is
+discussed in the next sections.
+
+\end{itemize}
+
+
+\subsubsection{Qt4 Installation for GUI}
+It must be installed before Qwt. A Qt version equal or higher than 4.6 is
+required. One can install it:
+\begin{itemize}
+ \item via YUM:
+\begin{verbatim}
+ yum install qt-devel
+\end{verbatim}
+ \item via download from:\\
+\url{
+https://download.qt.io/archive/qt/4.8/4.8.2/qt-everywhere-opensource-src-4.8.2.t
+ar.gz}
-You can retrieve the Qt4 libraries using YUM or download the open source version from e.g. \url{ftp://ftp.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.8.1.tar.gz}
To install:
\begin{verbatim}
-> gunzip qt-everywhere-opensource-src-4.6.2.tar.gz
-> tar xvf qt-everywhere-opensource-src-4.6.2.tar
+> gunzip qt-everywhere-opensource-src-4.8.2.tar.gz
+> tar xvf qt-everywhere-opensource-src-4.8.2.tar
> ./configure
> make
> make install
\end{verbatim}
+By default Qt4 will be installed in /usr/local/Trolltech/Qt-4.8.2/.
+\end{itemize}
-By default Qt4 will be installed int /usr/local/Trolltech/Qt-4.8.1/
-Edit your .bashrc to define the enviroment variable \verb=QTDIR= and add the libraries and exacutables to your \verb=LD_LIBRARY_PATH= and \verb=PATH=:
+
+\textbf{Setup Environment}
+
+
+One has to ensure that \verb=PATH= and \verb=LD_LIBRARY_PATH= have
+been updated to include Qt4 install path, binaries and libraries.
+Confirm by executing \verb=qmake -v= and ensuring the result points to Qt4 (not
+Qt3 or Qt5).
+
+
+If the environment is not set up, one can add the libraries and
+executables to the .bashrc by adding
+\verb=LD_LIBRARY_PATH= and \verb=PATH=:
\begin{verbatim}
-export QTDIR=/usr/local/Trolltech/Qt-4.8.1
+export QTDIR=/usr/local/Trolltech/Qt-4.8.2
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
\end{verbatim}
-If your system also have Qt3 installed, make sure that \verb=QTDIR=, \verb=PATH= and \verb=LD_LIBRARY_PATH= point to Qt4 before installing Qwt (and of course compiling and running the GUI).
-\subsection{Qwt installation}
-A Qwt version equal or higher than 5 is required.\\
-Before installing it, make sure that your \verb=QTDIR=, \verb=LD_LIBRARY_PATH= and \verb=PATH= point to the correct Qt4 version.
+\subsubsection{Qwt Installation for GUI}
+Before installing Qwt, one must install Qt
+and ensure that \verb=QTDIR=, \verb=LD_LIBRARY_PATH= and \verb=PATH= point to
+the correct Qt4
+version.
-You can retrieve the Qwt libraries using YUM or download the open source version via svn:
+
+A Qwt version equal or higher than 6 is required. One can
+install it:
+\begin{itemize}
+ \item via YUM:
\begin{verbatim}
-> svn co https://qwt.svn.sourceforge.net/svnroot/qwt/branches/qwt-6.0
+ yum install qwt-devel
\end{verbatim}
+ \item via download from:\\
+\url{
+https://sourceforge.net/projects/qwt/files/qwt/6.0.0/qwt-6.0.0.zip/download}
+
To install:
\begin{verbatim}
-> cd qwt-6.0
+> cd qwt-6.0.0
> qmake
> make
> make install
\end{verbatim}
+By default Qwt will be installed int /usr/local/qwt-6.0.0
+\end{itemize}
-By default Qwt will be installed in /usr/local/qwt-6.0
-Edit your .bashrc to define the enviroment variable \verb=QWTDIR= and add the libraries to the \verb=LD_LIBRARY_PATH=:
+\textbf{Setup Environment}
+
+
+One has to ensure that \verb=QWTDIR= and \verb=LD_LIBRARY_PATH= have
+been updated to include Qwt install path and libraries.
+
+
+If the environment is not set up, one can add the libraries to the
+.bashrc by adding \verb=LD_LIBRARY_PATH=:
\begin{verbatim}
-export QWTDIR=/usr/local/qwt-6.0-svn/
+export QWTDIR=/usr/local/qwt-6.0.0/
export LD_LIBRARY_PATH=$QWTDIR/lib:$LD_LIBRARY_PATH
\end{verbatim}
-\subsection{Installation with YUM}
-
-You must install the qt4 and qwt development package i.e.
-\begin{verbatim}
-> yum install qt-devel qwt-devel
-\end{verbatim}
- and then edit edit your .bashrc as follows
-\begin{verbatim}
-export ROOTSYS=/opt/root/5.28.00
-export QTDIR=/usr/lib64/qt4
-export QWTDIR=/usr/include/qwt
-export PATH=$QTDIR:bin:$PATH
-\end{verbatim}
-
-You should then continue with the root installation.
-
-To compile, you should edit the file slsDetectorGui/slsDetectorGui.pro as follows.\\
-All lines containing \verb=$QTDIR= and \verb=$QWTDIR= should be commented, except in the INCLUDEPATH (\verb=$QWTDIR \=).\\
-Moreover the \verb=LIBS= line should be changed \verb=-L$(QWTDIR)/lib= to \verb=-L$(QWTDIR)/lib64=.
-\subsection{Root installation}
-The software has been developed and tested with root 5.20, but any version should work.
-Download the sources via svn:
+
+
+\subsubsection{Root Installation for Calibration Wizards}
+The software has been developed and tested with root 5.20, but any version
+should work. One can download it from:
\begin{verbatim}
> svn co https://root.cern.ch/svn/root/trunk root
\end{verbatim}
-To install:
+\noindent To install:
\begin{verbatim}
> cd root
> ./configure --enable-qt
@@ -139,120 +303,212 @@ To install:
> make install
\end{verbatim}
-Edit your .bashrc to define the ROOTSYS enviroment variable and annd the libraries and executables to the \verb=LD_LIBRARY_PATH= and \verb=PATH=:
+Edit your .bashrc to define the ROOTSYS enviroment variable and annd
+the libraries and executables to the \verb=LD_LIBRARY_PATH= and \verb=PATH=:
\begin{verbatim}
-export ROOTSYS=/usr/local/root
+export ROOTSYS=/usr/local/root-5.34
export PATH=$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
\end{verbatim}
-You can also download the binaries, assuming that your linuc and gcc versions match:
+You can also download the binaries, assuming that your linux and gcc versions
+match as in:
\begin{verbatim}
http://root.cern.ch/drupal/content/production-version-534
\end{verbatim}
-\section{Compilation}
-If you simply want to install the software in the working directory you can:
+\subsection{Compilation}
+One requires \verb=cmake= to compile and can be done in two ways:
+
+\subsubsection{Using script cmk.sh}
+The script uses \verb=cmake=. After compiling, the libraries and executables
+will be found in `slsDetectorPackage/build/bin` directory.
+Usage: [-c] [-b] [-h] [-d HDF5 directory] [-j]
\begin{itemize}
-\item[make] compile the library, the command line interface and the receiver
-
-\item[make lib] compile only the library
-
-\item[make textclient] compile the command line interface (and the library, since it is required)
-
-\item[make stextclient] compile the command line interface statically linking the library (and the library, since it is required)
-
-\item[make receiver] compile the data reciever (and the library, since it is required)
-
-\item[make sreceiver] compile the data reciever statically linking the library (and the library, since it is required)
-
-\item[make gui] compile slsDetectorGUI - requires a working Qt4 and Qwt installation
-
-\item[make calWiz] compile the calibration wizards - requires a working root installation
-
-\item[make doc] compile documentation in pdf format
-
-\item[make htmldoc] compile documentation in html format
-
-\item[make install\_lib] installs the libraries, the text clients, the documentation and the includes for the API
-
-\item[make install] installs all software, including the gui, the cal wizards and the includes for the API
-
-\item[make confinstall] installs all software, including the gui, the cal wizards and the includes for the API, prompting for the install paths
-
-\item[make clean] remove object files and executables
-
-\item[make help] lists possible targets
-
-\item[make mythen\_virtual] compile a virtual MYTHEN detector server (works for control commands, not for data taking)
-
-\item[make gotthard\_virtual] compile a virtual GOTTHARD detector server (works for control commands, not for data taking)
+ \item -[no option]: only make
+ \item -c: Clean
+ \item -b: Builds/Rebuilds CMake files normal mode
+ \item -h: Builds/Rebuilds Cmake files with HDF5 package
+ \item -d: HDF5 Custom Directory
+ \item -t: Build/Rebuilds only text client
+ \item -r: Build/Rebuilds only receiver
+ \item -g: Build/Rebuilds only gui
+ \item -j: Number of threads to compile through
\end{itemize}
-The path where the files binaries, libraries, documentation and includes will be installed can either be defined interactively by sourcing the \verb=configure= script (not executing!) or during compilation using \verb=make confinstall= or defined on the command line deifning one (or all) the following variables (normally \verb=INSTALLROOT= is enough:
-\begin{itemize}
-\item[INSTALLROOT] Directory where you want to install the software. Defaults to \verb=PWD=
-\item[BINDIR] Directory where you want to install the binaries. Defaults to bin/
-\item[INCDIR] Directory where you want to pute the header files. Defaults to include
-\item[LIBDIR] Directory where you want to install the libraries. Defaults to bin/
-\item[DOCDIR] Directory where you want to copy the documentation. Defaults to doc/
-\end{itemize}
+Some example options for compilation:
+
+Most basic option: \verb=./cmk.sh -b=
+
+For only make: \verb=./cmk.sh=
+
+For make clean;make: \verb=./cmk.sh -c=
+
+For using hdf5 without custom dir /blabla: \verb=./cmk.sh -h -d /blabla=
+
+For rebuilding cmake without hdf5: \verb=./cmk.sh -b=
+
+For using multiple cores to compile faster: \verb=./cmk.sh -j9=
+
+For rebuilding only certain parts: \verb=./cmk.sh -tg= (only text client and
+gui)
+
+
+\subsubsection{Directly using cmake}
+
+Use cmake to create out-of-source builds, by creating a build folder parallel to
+source directory.
+\begin{verbatim}
+ $ cd ..
+ $ mkdir slsDetectorPackage-build
+ $ cd slsDetectorPackage-build
+ $ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=OFF
+ $ make
+\end{verbatim}
+
+Use the following as an example to compile statically and using specific hdf5
+folder
+\begin{verbatim}
+ $ HDF5_ROOT=/opt/hdf5v1.10.0 cmake ../slsDetectorPackage
+-DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=ON
+\end{verbatim}
+
+After compiling, the libraries and executables will be found at `bin` directory
+\begin{verbatim}
+ $ ls bin/
+ gui_client libSlsDetector.a libSlsDetector.so libSlsReceiver.a
+libSlsReceiver.so sls_detector_acquire sls_detector_get slsDetectorGui
+sls_detector_help sls_detector_put slsReceiver
+\end{verbatim}
-To be able to run the executables, append the \verb=BINDIR= directory to your \verb=PATH= and \verb=LIBDIR= to the \verb=LD_LIBRARY_PATH=.
-To run the GUI, you also need to add to your \verb=LD_LIBRARY_PATH= the Qt4 and Qwt libraries, without the need to install the whole Qt and Qwt developer package:
-\begin{itemize}
-\item libqwt.so.6
-\item libQtGui.so.4
-\item libQtCore.so.4
-\item libQtSvg.so.4
-\end{itemize}
+\subsection{Setting environment variables}
+One can set up the environment variables in the following ways.
-To run the calibration wizards it is preferrable to have a complete Root installation (binaries), with \verb=ROOTSYS= defined and the libraries added to the \verb=LD_LIBRARY_PATH=.
-
-
-\section{Detector upgrade}
-
-Sometimes the upgarde of the communication software, can require an upgrade of the software and/or firmware running on the detector as well.\\
-In these cases, the users are not expected to compile teh software themselves (which would require dedicated softwares) but only to download on the detector board the programming files and/or communication program provided by the SLS Detectors group.
-
-
-\subsection{MYTHEN upgrade}
-\subsubsection{Firmware upgrade}
-
-To upgrade the firmware you need either a working version of the Altera Quartus software or of the Quartus programmer, which can easly be downloade from \\
-\verb=https://www.altera.com/download/programming/quartus2/pq2-index.jsp= \\
-Normally installation of the software and of the driver for the USB-Blaster (provided together with the MYTHEN detector) are simpler under Windows.\\
-Under Windows, the first time that you connect the USB-Blasterto one of your USB ports, you will be asked to install new hardware. Set the path to search
-for the driver to: \verb=C:\altera\80sp1\qprogrammer\drivers\usb-blasterp= (where \verb=C:\altera\80sp1\qprogrammer\= is assumed to be ther path where your Quartus version is installed).\\
+\subsubsection{Using .bashrc file}
\begin{enumerate}
-\item After starting the Quartus programmer, click on Hardware Setup and in the "Currently selected hardware" window select USB-Blaster.
-\item In the Mode combo box select "Active Serial Programming".
-\item Plug the end of your USB-Blaster WITH THE ADAPTER PROVIDED in the connector ASMI on the MCS board taking care that pin1 corresponds to the one indexed and with the rectangualr pad.
-\item Click on add file and from select the programming file provided when the upgrade has been reccomended.
-\item Check "Program/Configure" and "Verify".
-\item Push the start button and wait until the programming process is finished (progress bar top left).
-\item In case the programmer gives you error messages, check the polarity of your cable (pin1 corresponds) and that you have selected the correct programming connector.
+ \item \verb=emacs ~/.bashrc=
+ \item Add the following function \verb=setup_slsdet= and replace \verb=path=
+with absolute path of installed directory
+\begin{verbatim}
+function setup_slsdet
+{
+export PKGPATH=[path]
+export LD_LIBRARY_PATH=$PKGPATH/slsDetectorPackage/build/bin:$LD_LIBRARY_PATH
+export PATH=$PKGPATH/slsDetectorPackage/build/bin:$PATH
+cd $PKGPATH/slsDetectorPackage/build/bin
+}
+\end{verbatim}
+ \item \verb=source ~/.bashrc=
+ \item Next time, just run \verb=setup_slsdet= to load the environment
+variables.
\end{enumerate}
-\subsubsection{Software upgrade}
-First telent to the board:
+
+One can also add the GUI environment variables if installed locally by adding
+the following in the function \verb=setup_sldet= \\
+\begin{verbatim}
+export QTDIR=/path-where-it-is/Qt-4.8.2
+export QWTDIR=/path-where-it-is/qwt-6.0.1
+export QWT3D=/path-where-it-is/qwtplot3d
+export QMAKESPEC=$QTDIR/mkspecs/linux-g++
+export LD_LIBRARY_PATH=$QTDIR/lib:$QWTDIR/lib:$QWT3D/lib:$LD_LIBRARY _PATH
+export PATH=$QTDIR/bin:$PATH
+\end{verbatim}
+
+\subsubsection{Without .bashrc file}
+Go to binaries folder slsDetectorPackage/build/bin and execute the following:
+\begin{verbatim}
+export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH
+export PATH=$PWD:$PATH
+\end{verbatim}
+
+
+\subsection{Clean Shared Memory}
+It is very crucial to clean the shared memory, before using a new version of
+the SLS Detector Package or a different detector type.
+
+One can use the \verb=cleansharedmemory.sh= script available under the
+slsDetector Package.
+
+One can also just use the following commands to clean the shared memory
+segments one by one.
+\begin{verbatim}
+#displays list of shared memeory segments
+ipcs -m
+#remove segments that have nattach equal to zero. They key is the first column
+ipcrm -M [key]
+\end{verbatim}
+
+\section{Software Upgrade}
+
+The upgrade of the package could require an upgrade of the on-board detector
+server and/or firmware running on the detector as well.
+
+
+\subsection{MYTHEN}
+In such cases, the users are not expected to compile the software
+themselves (which would require dedicated softwares) but only to download on the
+detector board the programming files and/or software package provided by
+the SLS Detectors group.
+
+\subsubsection{MYTHEN Firmware}
+
+To upgrade the firmware you need either a working version of the Altera
+Quartus software or of the Quartus programmer, which can easily be downloaded
+from: \\
+\url{https://www.altera.com/download/programming/quartus2/pq2-index.jsp}
+\medskip
+
+\noindent Normally, installation of the software and of the driver for the
+USB-Blaster (provided together with the MYTHEN detector) are simpler under
+Windows.
+
+
+Under Windows, the first time that you connect the USB-Blaster to one
+of your USB ports, you will be asked to install new hardware. Set the path to
+search for the driver to:
+\verb=C:\altera\80sp1\qprogrammer\drivers\usb-blasterp= (where
+\verb=C:\altera\80sp1\qprogrammer\= is assumed to be ther path where your
+Quartus version is installed).
+\begin{enumerate}
+\item After starting the Quartus programmer, click on Hardware Setup and in the
+"Currently selected hardware" window select USB-Blaster.
+\item In the Mode combo box select "Active Serial Programming".
+\item Plug the end of your USB-Blaster WITH THE ADAPTER PROVIDED in the
+connector ASMI on the MCS board taking care that pin1 corresponds to the one
+indexed and with the rectangualr pad.
+\item Click on add file and from select the programming file provided when
+the upgrade has been reccomended.
+\item Check "Program/Configure" and "Verify".
+\item Push the start button and wait until the programming process is
+finished (progress bar top left).
+\item In case the programmer gives you error messages, check the polarity of
+your cable (pin1 corresponds) and that you have selected the correct programming
+connector.
+\end{enumerate}
+
+\subsubsection{MYTHEN On-board Software}
+\begin{enumerate}
+ \item Connect to the board using telnet:
\begin{verbatim}
telnet mymcs.mydomain.com
username: root
password: pass
+\end{verbatim}
+ \item Kill currently running servers and ensure \verb=/mnt/flash/root= exists.
+\begin{verbatim}
killall mythenDetectorServer
ls /mnt/flash/root
#if the directory does not exist mkdir /mnt/flash/root
\end{verbatim}
-
-To upgrade the software on the detector board transfer the provided software by ftp to the MCS:
+ \item Transfer the provided software by ftp to the MCS.
\begin{verbatim}
ftp mymcs.mydomain.com
username: root
@@ -262,14 +518,312 @@ put mythenDetectorServer
quit
\end{verbatim}
-After pressing reset on the board, the board should reboot.\\
+\item After pressing reset on the board, the board should reboot.
+
+\item If the program does not correctly start
+ \begin{enumerate}
+ \item Check by using the http interface that it is started by the inittab
+(check that the file \verb=/mnt/etc/inittab= ends with the line \\
+\verb=myid2:3:once:/mnt/flash/root/mythenDetectorServer=).
+ \item If program has not started, make the program executable by telnetting to
+the MCS and executing: \\
+\verb=chmod a+xrw /mnt/flash/root/mythenDetectorServer=
+ \item After pressing reset on the board, the board should reboot and the
+acqusition program correctly start.
+ \end{enumerate}
+\end{enumerate}
+
+
+
+
+\subsection{GOTTHARD}
+
+In such cases, the users are not expected to compile the software
+themselves (which would require dedicated softwares) but only to download on the
+detector board the programming files and/or software package provided by
+the SLS Detectors group.
+
+\subsubsection{GOTTHARD Firmware}
+\textit{For SLS Detector Package v3.1.0} \\
+\indent Minimum compatible version: \\
+\indent \indent 11.01.2013 \\
+\indent Latest version: \\
+\indent \indent 08.02.2018 (50um and 25um Master) \\
+\indent \indent 09.02.2018 (25 um Slave) \\
+
+
+Normally, the firmware will be upgraded by us as it requires programming the
+FPGA via the USB-Blaster.
+
+
+To upgrade the firmware you need either a working version of the Altera
+Quartus software or of the Quartus programmer, which can easily be downloaded
+from: \\
+\url{https://www.altera.com/download/programming/quartus2/pq2-index.jsp}
+
+
+Normally, installation of the software and of the driver for the
+USB-Blaster (provided together with the MYTHEN detector) are simpler under
+Windows.
+
+
+Under Windows, the first time that you connect the USB-Blaster to one
+of your USB ports, you will be asked to install new hardware. Set the path to
+search for the driver to:
+\verb=C:\altera\80sp1\qprogrammer\drivers\usb-blasterp= (where
+\verb=C:\altera\80sp1\qprogrammer\= is assumed to be ther path where your
+Quartus version is installed).
+\begin{enumerate}
+\item After starting the Quartus programmer, click on Hardware Setup and in the
+"Currently selected hardware" window select USB-Blaster.
+\item In the Mode combo box select "Active Serial Programming".
+\item Plug the end of your USB-Blaster WITH THE ADAPTER PROVIDED in the
+connector ASMI on the MCS board taking care that pin1 corresponds to the one
+indexed and with the rectangualr pad.
+\item Click on add file and from select the programming file provided when
+the upgrade has been reccomended.
+\item Check "Program/Configure" and "Verify".
+\item Push the start button and wait until the programming process is
+finished (progress bar top left).
+\item In case the programmer gives you error messages, check the polarity of
+your cable (pin1 corresponds) and that you have selected the correct programming
+connector.
+\end{enumerate}
+
+\subsubsection{GOTTHARD On-board Software}
+Every SLS Detector package release will have its coresponding matching on-board
+server under \textbf{slsDetectorPackage/serverBin}.
+
+\begin{enumerate}
+ \item Install tftp if the pc does not have it.
+ \item Copy the server from serverBin folder to /tftpboot (or equivalent tftp
+folder) of the pc
+ \item Copy the server to the detector by:
+ \begin{enumerate}
+ \item Connect to the blackfin on the detector\\
+\verb=telnet bchipxxx=
+ \item Prevent existing on-board server from respawning by:
+ \begin{enumerate}
+ \item Edit \verb=/etc/inittab=
+ \item Comment out the line
+\verb=#ttyS0::respawn:/gotthardDetectorServervxxx=
+ \item Reboot blackfin using \verb=reboot=
+ \item Run \verb=ps= to ensure no gotthardDetectorServers are running
+ \end{enumerate}
+ \item Copy new on-board server from pc to the blackfin using: \\
+\verb=tftp pcxxx -r gotthardDetectorServerxxx -g=
+ \item Respawn the new server (server starts at detector statup):
+ \begin{enumerate}
+ \item Edit \verb=/etc/inittab=
+ \item Uncomment out the line
+\verb=ttyS0::respawn:/gotthardDetectorServervxxx=
+ \item Reboot blackfin using \verb=reboot=
+ \item Run \verb=ps= to ensure that both the gotthardDetectorServers are
+running.\\
+\verb=gotthardDetectorServerxxx= \\
+\verb=gotthardDetectorServerxxx 1953=
+ \end{enumerate}
+ \end{enumerate}
+\end{enumerate}
+
+
+
+\subsection{EIGER}
+
+In such cases, the users are not expected to compile the software
+themselves (which would require dedicated softwares) but only to download on the
+detector board the programming files and/or software package provided by
+the SLS Detectors group.
+
+\subsubsection{EIGER Firmware}
+\textit{For SLS Detector Package v3.1.0} \\
+\indent Minimum compatible version: 16 \\
+\indent Latest version: 20 \\
+
+
+\begin{enumerate}
+ \item One must get the latest package's corresponding bit files from the SLS
+Detector Group.
+ \item If one does not have the bcp script, that should also be obtained from
+the SLS Detector Group. It is required to program the bit files and requires
+that tftp be installed on the pc.
+ \item Run the following to update firmware
+\begin{verbatim}
+ #update back end fpga
+bcp download.bit bebxxx:/fw0
+
+ #update front left fpga
+bcp download.bit bebxxx:/febl
+
+ #update front right fpga
+bcp download.bit bebxxx:/febr
+
+ #update kernel
+bcp download.bit bebxxx:/kernel
+\end{verbatim}
+Please update bit files with great caution as it could make your board
+inaccessible, if done incorrectly.
+\end{enumerate}
+
+
+
+\subsubsection{EIGER On-board Software}
+Every SLS Detector package release will have its coresponding matching on-board
+server under \textbf{slsDetectorPackage/serverBin}.
+
+
+Update the on-board software without connecting to the detector
+\begin{verbatim}
+#password for the boards: root
+
+#Kill existing servers that are running on the detector
+ssh root@beb031 killall eigerDetectorServer;
+
+#Copy on-board server to detector inside executables folder
+scp ~/path-where-it-is/eigerDetectorServerxxx root@bebxxx:~/executables;
+
+#Overwrite the actual eigerDetectorServer on board
+scp ~/path-where-it-is/eigerDetectorServerxxx
+root@bebxxx:~/executables/eigerDetectorServer;
+
+#sync
+ssh root@bebxxx sync;
+
+#reboot the eiger board
+\end{verbatim}
+
+
+\bigskip One can connect to the detector by:
+\begin{verbatim}
+ssh root@bebxxx
+password: root
+\end{verbatim}
+
+
+The on-board server is in ~/executables folder and respawned at startup in \\
+\verb=/etc/rc5.d/S50board_com.sh=
+
+
+
+
+
+\subsection{JUNGFRAU}
+
+In such cases, the users are not expected to compile the software
+themselves (which would require dedicated softwares) but only to download on the
+detector board the programming files and/or software package provided by
+the SLS Detectors group.
+
+\subsubsection{JUNGFRAU Firmware}
+\textit{For SLS Detector Package v3.1.0} \\
+\indent Minimum compatible version: 13.11.2017 \\
+\indent Latest version: 13.11.2017 \\
+
+
+At times, one has to update the firmware, which then also requires updating the
+on-board software.
+
+
+\textbf{\textit{Jungfrau firmware can be upgraded via the SLS Detector Package
+binaries from the command line.}}
+
+\begin{enumerate}
+ \item One must get the latest package's corresponding POF file from the SLS
+Detector Group.
+ \item Update the latest SLS Detector package installed.
+ \item Update the on-board software as per the instructions in the next
+section.
+ \item Start the on-board server in debug mode:
+ \begin{enumerate}
+ \item Connect to the blackfin on the detector\\
+\verb=telnet bchipxxx=
+ \item Prevent existing on-board server from respawning by:
+ \begin{enumerate}
+ \item Edit \verb=/etc/inittab=
+ \item Comment out the line
+\verb=#ttyS0::respawn:/jungfrauDetectorServervxxx=
+ \item Reboot blackfin using \verb=reboot=
+ \item Run \verb=ps= to ensure no gotthardDetectorServers are running
+ \end{enumerate}
+ \item Start the server in debug mode using: \\
+\verb=./jungfrauDetectorServerxxx -debug= \\
+ Leave this console on to come back to it later.
+ \end{enumerate}
+ \item From the command line of the pc, clear shared memory \\
+\verb=./sls_detector_get free= \\
+ If one gets shmget error, please clean the shared memory properly using the
+script in \verb=slsDetectorPackage/cleansharedmemory.sh=
+ \item Add the detector to shared memory using \\
+\verb=./sls_detector_put hostname bchipxxx=
+ \item Program the FPGA using \\
+\verb=./sls_detector_put programfpga xxx.pof=
+ \item Once the programming is done:
+ \begin{enumerate}
+ \item Switch to the console that has the debug server running and kill it
+using Ctrl+C and ensure no jungfrauDetectorServers are
+running
+ \item Restart the new server to see if it runs with the new firmware \\
+\verb=./jungfrauDetectorServerxxx= \\
+If the server didn't start properly, please contact us with the error message
+shown when starting the server up, else continue with the following steps.
+ \item Respawn the new server (server starts at detector statup):
+ \begin{enumerate}
+ \item Edit \verb=/etc/inittab=
+ \item Uncomment out the line
+\verb=ttyS0::respawn:/jungfrauDetectorServervxxx=
+ \item Reboot blackfin using \verb=reboot=
+ \item Run \verb=ps= to ensure that both the gotthardDetectorServers are
+running.\\
+\verb=jungfrauDetectorServervxxx= \\
+\verb=jungfrauDetectorServervxxx 1953=
+ \end{enumerate}
+ \end{enumerate}
+
+\end{enumerate}
+
+
+
+\subsubsection{JUNGFRAU On-board Software}
+Every SLS Detector package release will have its coresponding matching on-board
+server under \textbf{slsDetectorPackage/serverBin}.
+
+
+\begin{enumerate}
+ \item Install tftp if the pc does not have it.
+ \item Copy the server from serverBin folder to /tftpboot (or equivalent tftp
+folder) of the pc
+ \item Copy the server to the detector by:
+ \begin{enumerate}
+ \item Connect to the blackfin on the detector\\
+\verb=telnet bchipxxx=
+ \item Prevent existing on-board server from respawning by:
+ \begin{enumerate}
+ \item Edit \verb=/etc/inittab=
+ \item Comment out the line
+\verb=#ttyS0::respawn:/jungfrauDetectorServervxxx=
+ \item Reboot blackfin using \verb=reboot=
+ \item Run \verb=ps= to ensure no gotthardDetectorServers are running
+ \end{enumerate}
+ \item Copy new on-board server from pc to the blackfin using: \\
+\verb=tftp pcxxx -r jungfrauDetectorServervxxx -g=
+ \item Respawn the new server (server starts at detector statup):
+ \begin{enumerate}
+ \item Edit \verb=/etc/inittab=
+ \item Uncomment out the line
+\verb=ttyS0::respawn:/jungfrauDetectorServervxxx=
+ \item Reboot blackfin using \verb=reboot=
+ \item Run \verb=ps= to ensure that both the gotthardDetectorServers are
+running.\\
+\verb=jungfrauDetectorServervxxx= \\
+\verb=jungfrauDetectorServervxxx 1953=
+ \end{enumerate}
+ \end{enumerate}
+\end{enumerate}
+
+
-If the program does not correctly start either check by using the http interface that it is started by the inittab (check that the file \verb=/mnt/etc/inittab= ends with the line \verb=myid2:3:once:/mnt/flash/root/mythenDetectorServer= ). \\
-Otherwise make the program executable by telnetting to the MCS and executing:
-\verb=chmod a+xrw /mnt/flash/root/mythenDetectorServer=\\
-After pressing reset on the board, the board should reboot and the acqusition program correctly start.
\begin{comment}
\section{Detector system architecture}
@@ -346,7 +900,11 @@ The \textit{settingsdir} and \textit{caldir} should be properly configured for y
\subsection{GOTTHARD}
A \textit{settingsdir} should be configured, as the directory \verb=settings= in this software package.\\
-It must contain the subdirectories \verb=dynamicgain=, \verb=gain1=, \verb=gain2=, \verb=gain3=, \verb=highgain=, \verb=lowgain=, \verb=mediumgain=, and \verb=veryhighgain= in order to properly configure the GOTTHARD detector using the various gain settings.
+It must contain the subdirectories \verb=dynamicgain=, \verb=gain1=,
+\verb=gain2=, \verb=gain3=, \verb=highgain=, \verb=lowgain=,
+\verb=mediumgain=, and \verb=veryhighgain= in order to properly configure the
+GOTTHARD detector using the various gain settings.
+
\end{comment}
\end{document}
diff --git a/serverBin/eigerDetectorServer_virtualMaster b/serverBin/eigerDetectorServer_virtualMaster
new file mode 120000
index 000000000..8bab52260
--- /dev/null
+++ b/serverBin/eigerDetectorServer_virtualMaster
@@ -0,0 +1 @@
+../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_virtualMaster
\ No newline at end of file
diff --git a/serverBin/eigerDetectorServer_virtualSlave b/serverBin/eigerDetectorServer_virtualSlave
new file mode 120000
index 000000000..fb644ed5c
--- /dev/null
+++ b/serverBin/eigerDetectorServer_virtualSlave
@@ -0,0 +1 @@
+../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_virtualSlave
\ No newline at end of file
diff --git a/serverBin/eigerDetectorServerv3.1.0.16.1 b/serverBin/eigerDetectorServerv3.1.0.16.1
new file mode 120000
index 000000000..2c90d8002
--- /dev/null
+++ b/serverBin/eigerDetectorServerv3.1.0.16.1
@@ -0,0 +1 @@
+../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.1.0.16.1
\ No newline at end of file
diff --git a/serverBin/gotthardDetectorServer_virtual b/serverBin/gotthardDetectorServer_virtual
new file mode 120000
index 000000000..e0f7013b5
--- /dev/null
+++ b/serverBin/gotthardDetectorServer_virtual
@@ -0,0 +1 @@
+../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServer_virtual
\ No newline at end of file
diff --git a/serverBin/gotthardDetectorServerv3.0.0.6 b/serverBin/gotthardDetectorServerv3.0.0.6
deleted file mode 120000
index ca005a699..000000000
--- a/serverBin/gotthardDetectorServerv3.0.0.6
+++ /dev/null
@@ -1 +0,0 @@
-../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.0.0.6
\ No newline at end of file
diff --git a/serverBin/gotthardDetectorServerv3.1.0.1 b/serverBin/gotthardDetectorServerv3.1.0.1
new file mode 120000
index 000000000..499ae8c21
--- /dev/null
+++ b/serverBin/gotthardDetectorServerv3.1.0.1
@@ -0,0 +1 @@
+../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.1.0.1
\ No newline at end of file
diff --git a/serverBin/jungfrauDetectorServer_virtual b/serverBin/jungfrauDetectorServer_virtual
new file mode 120000
index 000000000..cbb38b3d6
--- /dev/null
+++ b/serverBin/jungfrauDetectorServer_virtual
@@ -0,0 +1 @@
+../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_virtual
\ No newline at end of file
diff --git a/serverBin/jungfrauDetectorServerv3.1.0.2 b/serverBin/jungfrauDetectorServerv3.1.0.2
new file mode 120000
index 000000000..e5ad646f3
--- /dev/null
+++ b/serverBin/jungfrauDetectorServerv3.1.0.2
@@ -0,0 +1 @@
+../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.1.0.2
\ No newline at end of file
diff --git a/serverBin/moenchDetectorServerv2.0.3 b/serverBin/moenchDetectorServerv2.0.3
deleted file mode 120000
index 0e78f92a3..000000000
--- a/serverBin/moenchDetectorServerv2.0.3
+++ /dev/null
@@ -1 +0,0 @@
-../slsDetectorSoftware/moenchDetectorServer/moenchDetectorServerv2.0.3
\ No newline at end of file
diff --git a/settingsdir/gotthard/dynamicgain/settings.sn b/settingsdir/gotthard/dynamicgain/settings.sn
index 324a9774c..12aef34b2 100755
--- a/settingsdir/gotthard/dynamicgain/settings.sn
+++ b/settingsdir/gotthard/dynamicgain/settings.sn
@@ -4,5 +4,5 @@ VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
-Vref_comp 887
+Vref_comp 350
Vib_test 2001
diff --git a/settingsdir/gotthard/highgain/settings.sn b/settingsdir/gotthard/highgain/settings.sn
index 324a9774c..12aef34b2 100644
--- a/settingsdir/gotthard/highgain/settings.sn
+++ b/settingsdir/gotthard/highgain/settings.sn
@@ -4,5 +4,5 @@ VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
-Vref_comp 887
+Vref_comp 350
Vib_test 2001
diff --git a/settingsdir/gotthard/lowgain/settings.sn b/settingsdir/gotthard/lowgain/settings.sn
index 324a9774c..12aef34b2 100644
--- a/settingsdir/gotthard/lowgain/settings.sn
+++ b/settingsdir/gotthard/lowgain/settings.sn
@@ -4,5 +4,5 @@ VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
-Vref_comp 887
+Vref_comp 350
Vib_test 2001
diff --git a/settingsdir/gotthard/mediumgain/settings.sn b/settingsdir/gotthard/mediumgain/settings.sn
index 324a9774c..12aef34b2 100644
--- a/settingsdir/gotthard/mediumgain/settings.sn
+++ b/settingsdir/gotthard/mediumgain/settings.sn
@@ -4,5 +4,5 @@ VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
-Vref_comp 887
+Vref_comp 350
Vib_test 2001
diff --git a/settingsdir/gotthard/veryhighgain/settings.sn b/settingsdir/gotthard/veryhighgain/settings.sn
index 324a9774c..12aef34b2 100644
--- a/settingsdir/gotthard/veryhighgain/settings.sn
+++ b/settingsdir/gotthard/veryhighgain/settings.sn
@@ -4,5 +4,5 @@ VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
-Vref_comp 887
+Vref_comp 350
Vib_test 2001
diff --git a/slsDetectorGui/gitInfo.txt b/slsDetectorGui/gitInfo.txt
index 1eeaeed15..16b79dc77 100644
--- a/slsDetectorGui/gitInfo.txt
+++ b/slsDetectorGui/gitInfo.txt
@@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorGui
-URL: origin git@git.psi.ch:sls_detectors_software/slsDetectorPackage.git
-Repository Root: origin git@git.psi.ch:sls_detectors_software/slsDetectorPackage.git
-Repsitory UUID: c4a242e10a4aafd102cc9a2a7ddae4ac92b8ba99
-Revision: 439
-Branch: 3.0.1
-Last Changed Author: Dhanya_Maliakal
-Last Changed Rev: 3187
-Last Changed Date: 2017-12-06 08:45:14.000000002 +0100 ./src/qTabSettings.cpp
+URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
+Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
+Repsitory UUID: b389402d647e939342dbb2c9317c688c0eb6b105
+Revision: 452
+Branch: 3.1.0-rc
+Last Changed Author: Erik_Frojdh
+Last Changed Rev: 3458
+Last Changed Date: 2018-03-09 10:55:40.000000002 +0100 ./src/qTabSettings.cpp
diff --git a/slsDetectorGui/include/gitInfoGui.h b/slsDetectorGui/include/gitInfoGui.h
index 61d748cf1..cbbcf49db 100644
--- a/slsDetectorGui/include/gitInfoGui.h
+++ b/slsDetectorGui/include/gitInfoGui.h
@@ -1,6 +1,6 @@
-#define GITURL "git@git.psi.ch:sls_detectors_software/slsDetectorPackage.git"
-#define GITREPUUID "c4a242e10a4aafd102cc9a2a7ddae4ac92b8ba99"
-#define GITAUTH "Dhanya_Maliakal"
-#define GITREV 0x3187
-#define GITDATE 0x20171206
-#define GITBRANCH "3.0.1"
+#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
+#define GITREPUUID "b389402d647e939342dbb2c9317c688c0eb6b105"
+#define GITAUTH "Erik_Frojdh"
+#define GITREV 0x3458
+#define GITDATE 0x20180309
+#define GITBRANCH "3.1.0-rc"
diff --git a/slsDetectorGui/src/qDetectorMain.cpp b/slsDetectorGui/src/qDetectorMain.cpp
index c9661348c..83be041bf 100644
--- a/slsDetectorGui/src/qDetectorMain.cpp
+++ b/slsDetectorGui/src/qDetectorMain.cpp
@@ -111,7 +111,7 @@ qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, int& ret,
+ "Usage: " + string(argv[0]) + " [arguments]\n"
+ "Possible arguments are:\n"
+ "\t-d, --developer : Enables the developer tab\n"
- + "\t-f, --f, --config : Loads config from file\n"
+ + "\t-f, --config : Loads config from file\n"
+ "\t-i, --id : Sets the multi detector id to i. Default: 0. Required \n"
+ "\t only when more than one multi detector object is needed.\n\n";
cout << help_message << endl;
@@ -306,11 +306,8 @@ void qDetectorMain::SetUpDetector(const string fName){
cout << endl << "Type : " << slsDetectorBase::getDetectorType(detType) << "\nDetector : " << host << endl;
//#endif
myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
- if(detType != slsDetectorDefs::MYTHEN) {
- if(myDet->setReceiverOnline(slsDetectorDefs::GET_ONLINE_FLAG) == slsDetectorDefs::ONLINE_FLAG) {
- myDet->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG);
- }else cprintf(RED,"is not online!\n");
- }
+ if(detType != slsDetectorDefs::MYTHEN)
+ myDet->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG);
qDefs::checkErrorMessage(myDet,"qDetectorMain::SetUpDetector");
}
diff --git a/slsDetectorGui/src/qTabDataOutput.cpp b/slsDetectorGui/src/qTabDataOutput.cpp
index eb81cf40c..1f38edb5e 100644
--- a/slsDetectorGui/src/qTabDataOutput.cpp
+++ b/slsDetectorGui/src/qTabDataOutput.cpp
@@ -535,8 +535,10 @@ void qTabDataOutput::GetOutputDir(){
dispOutputDir->setText(QString(myDet->getFilePath().c_str()));
//multi file path blank means sls file paths are different
if (dispOutputDir->text().isEmpty()) {
+#ifdef VERYVERBOSE
qDefs::Message(qDefs::INFORMATION,"The file path for individual units are different.\n"
"Hence, leaving the common field blank.","qTabDataOutput::GetOutputDir");
+#endif
#ifdef VERBOSE
cout << "The file path for individual units are different.\n"
"Hence, leaving the common field blank." << endl;
diff --git a/slsDetectorGui/src/qTabMeasurement.cpp b/slsDetectorGui/src/qTabMeasurement.cpp
index de5ea2065..b6e28ce0e 100644
--- a/slsDetectorGui/src/qTabMeasurement.cpp
+++ b/slsDetectorGui/src/qTabMeasurement.cpp
@@ -843,28 +843,14 @@ void qTabMeasurement::Refresh(){
cout << "Getting delay after trigger, number of triggers and number of gates" << endl;
#endif
//delay
- //delay
- if (detType == slsDetectorDefs::EIGER) {
- lblDelay->setEnabled(false);
- spinDelay->setEnabled(false);
- comboDelayUnit->setEnabled(false);
- } else {
- lblDelay->setEnabled(true);
- spinDelay->setEnabled(true);
- comboDelayUnit->setEnabled(true);
- time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,-1)*(1E-9))));
- spinDelay->setValue(time);
- comboDelayUnit->setCurrentIndex((int)unit);
- }
+ if (detType != slsDetectorDefs::EIGER)
+ time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,-1)*(1E-9))));
+
//gates
- if ((detType == slsDetectorDefs::EIGER) || (detType == slsDetectorDefs::JUNGFRAU) || (detType == slsDetectorDefs::JUNGFRAUCTB)) {
- lblNumGates->setEnabled(false);
- spinNumGates->setEnabled(false);
- } else {
- lblNumGates->setEnabled(true);
- spinNumGates->setEnabled(true);
- spinNumGates->setValue((int)myDet->setTimer(slsDetectorDefs::GATES_NUMBER,-1));
- }
+ if ((detType != slsDetectorDefs::EIGER) && (detType != slsDetectorDefs::JUNGFRAU) && (detType != slsDetectorDefs::JUNGFRAUCTB) )
+ spinNumGates->setValue((int)myDet->setTimer(slsDetectorDefs::GATES_NUMBER,-1));
+
+
//Number of Triggers
spinNumTriggers->setValue((int)myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,-1));
diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_developer b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_developer
index 31256ced9..5e0f545e2 100755
Binary files a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_developer and b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_developer differ
diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_virtualMaster b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_virtualMaster
index 934f86b70..0167b8fd3 100755
Binary files a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_virtualMaster and b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_virtualMaster differ
diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_virtualSlave b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_virtualSlave
index b92f53b65..2a735216d 100755
Binary files a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_virtualSlave and b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_virtualSlave differ
diff --git a/slsDetectorSoftware/eigerDetectorServer/gitInfo.txt b/slsDetectorSoftware/eigerDetectorServer/gitInfo.txt
index ce68604ef..bfe91ab6f 100644
--- a/slsDetectorSoftware/eigerDetectorServer/gitInfo.txt
+++ b/slsDetectorSoftware/eigerDetectorServer/gitInfo.txt
@@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
-Repsitory UUID: 897cbac27d3154d72893e331df3147d4b706ccc8
-Revision: 321
+Repsitory UUID: 06cdf8ad9204fd306cb1017b91e67452c61715d4
+Revision: 323
Branch: developer
-Last Changed Author: Dhanya_Thattil
-Last Changed Rev: 3600
-Last Changed Date: 2018-02-07 15:22:30.000000002 +0100 ./FebRegisterDefs.h
+Last Changed Author: Erik_Frojdh
+Last Changed Rev: 3671
+Last Changed Date: 2018-03-13 10:28:12.000000002 +0100 ./FebRegisterDefs.h
diff --git a/slsDetectorSoftware/eigerDetectorServer/gitInfoEiger.h b/slsDetectorSoftware/eigerDetectorServer/gitInfoEiger.h
index 67043ae4d..00181c6cb 100644
--- a/slsDetectorSoftware/eigerDetectorServer/gitInfoEiger.h
+++ b/slsDetectorSoftware/eigerDetectorServer/gitInfoEiger.h
@@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
-#define GITREPUUID "897cbac27d3154d72893e331df3147d4b706ccc8"
-#define GITAUTH "Dhanya_Thattil"
-#define GITREV 0x3600
-#define GITDATE 0x20180207
+#define GITREPUUID "06cdf8ad9204fd306cb1017b91e67452c61715d4"
+#define GITAUTH "Erik_Frojdh"
+#define GITREV 0x3671
+#define GITDATE 0x20180313
#define GITBRANCH "developer"
diff --git a/slsDetectorSoftware/gitInfo.txt b/slsDetectorSoftware/gitInfo.txt
index c06e8bfb4..06c0590f7 100644
--- a/slsDetectorSoftware/gitInfo.txt
+++ b/slsDetectorSoftware/gitInfo.txt
@@ -1,9 +1,18 @@
Path: slsDetectorsPackage/slsDetectorSoftware
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
+<<<<<<< HEAD
Repsitory UUID: 92b4b3324e09299663b9862bad26b38a3257dd60
Revision: 1752
Branch: developer
Last Changed Author: Andrä_Marie
Last Changed Rev: 3570
Last Changed Date: 2018-01-19 14:14:34.000000002 +0100 ./commonFiles/sls_detector_defs.h
+=======
+Repsitory UUID: b389402d647e939342dbb2c9317c688c0eb6b105
+Revision: 1714
+Branch: 3.1.0-rc
+Last Changed Author: Erik_Frojdh
+Last Changed Rev: 3458
+Last Changed Date: 2018-03-12 14:19:44.000000002 +0100 ./threadFiles/ThreadPool.o
+>>>>>>> 3.1.0
diff --git a/slsDetectorSoftware/gotthardDetectorServer/Makefile.virtual b/slsDetectorSoftware/gotthardDetectorServer/Makefile.virtual
index 4f563e2a0..d36e90b8e 100755
--- a/slsDetectorSoftware/gotthardDetectorServer/Makefile.virtual
+++ b/slsDetectorSoftware/gotthardDetectorServer/Makefile.virtual
@@ -5,7 +5,7 @@ CC = gcc
CFLAGS += -Wall -DGOTTHARDD -DMCB_FUNCS -DDACS_INT -DDEBUG -DVIRTUAL
-PROGS= $(DESTDIR)/gotthardVirtualServer
+PROGS= $(DESTDIR)/gotthardDetectorServer_virtual
SRCS = server.c server_funcs.c communication_funcs.c firmware_funcs.c mcb_funcs.c trimming_funcs.c sharedmemory.c
diff --git a/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c b/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c
index bd63ca880..52a25b8bd 100755
--- a/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c
+++ b/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c
@@ -1474,6 +1474,7 @@ int configureMAC(int ipad,long long int macad,long long int detectormacad, int d
#endif
// if(val!=0x2820) return -1;
+ usleep(1000 * 1000);
return adcConfigured;
}
@@ -1536,12 +1537,8 @@ int startStateMachine(){
int stopStateMachine(){
//#ifdef VERBOSE
- printf("*******Stopping State Machine*******\n");
+ cprintf(BG_RED,"*******Stopping State Machine*******\n");
//#endif
-#ifdef SHAREDMEMORY
- write_stop_sm(1);
- write_status_sm("Stopped");
-#endif
bus_w16(CONTROL_REG, STOP_ACQ_BIT);
bus_w16(CONTROL_REG, 0x0);
usleep(500);
diff --git a/slsDetectorSoftware/gotthardDetectorServer/gitInfo.txt b/slsDetectorSoftware/gotthardDetectorServer/gitInfo.txt
index 14cea4392..68b17f2ed 100644
--- a/slsDetectorSoftware/gotthardDetectorServer/gitInfo.txt
+++ b/slsDetectorSoftware/gotthardDetectorServer/gitInfo.txt
@@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/gotthardDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
-Repsitory UUID: 94b61ea2c40176cf2a9a36c7d6477016cd5d7fcd
-Revision: 218
-Branch: 3.0.1
+Repsitory UUID: 675d69392a6497d42b23057c7c8783c8dad768d0
+Revision: 223
+Branch: 3.1.0-rc
Last Changed Author: Dhanya_Thattil
-Last Changed Rev: 3351
-Last Changed Date: 2018-02-08 11:04:28.000000002 +0100 ./firmware_funcs.c
+Last Changed Rev: 3447
+Last Changed Date: 2018-02-27 14:04:08.000000002 +0100 ./server_funcs.c
diff --git a/slsDetectorSoftware/gotthardDetectorServer/gitInfoGotthard.h b/slsDetectorSoftware/gotthardDetectorServer/gitInfoGotthard.h
index ba801bef8..6c3fb814c 100644
--- a/slsDetectorSoftware/gotthardDetectorServer/gitInfoGotthard.h
+++ b/slsDetectorSoftware/gotthardDetectorServer/gitInfoGotthard.h
@@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
-#define GITREPUUID "94b61ea2c40176cf2a9a36c7d6477016cd5d7fcd"
+#define GITREPUUID "675d69392a6497d42b23057c7c8783c8dad768d0"
#define GITAUTH "Dhanya_Thattil"
-#define GITREV 0x3351
-#define GITDATE 0x20180208
-#define GITBRANCH "3.0.1"
+#define GITREV 0x3447
+#define GITDATE 0x20180227
+#define GITBRANCH "3.1.0-rc"
diff --git a/slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServer_virtual b/slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServer_virtual
new file mode 100755
index 000000000..2dcd81447
Binary files /dev/null and b/slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServer_virtual differ
diff --git a/slsDetectorSoftware/gotthardDetectorServer/gotthardVirtualServer b/slsDetectorSoftware/gotthardDetectorServer/gotthardVirtualServer
deleted file mode 100755
index 00f509290..000000000
Binary files a/slsDetectorSoftware/gotthardDetectorServer/gotthardVirtualServer and /dev/null differ
diff --git a/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c b/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c
index 1cbbfbfb1..b3dee5d5d 100755
--- a/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c
+++ b/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c
@@ -579,16 +579,18 @@ int get_id(int file_des) {
#ifdef VERBOSE
printf("Getting id %d\n", arg);
-#endif
+#endif
switch (arg) {
case DETECTOR_SERIAL_NUMBER:
retval=getDetectorNumber();
break;
case DETECTOR_FIRMWARE_VERSION:
- return (getFirmwareVersion() & 0xFFFFFF);
+ retval = (getFirmwareVersion() & 0xFFFFFF);
+ break;
case DETECTOR_SOFTWARE_VERSION:
- return (GITDATE & 0xFFFFFF);
+ retval = (GITDATE & 0xFFFFFF);
+ break;
default:
printf("Required unknown id %d \n", arg);
ret=FAIL;
@@ -1725,12 +1727,10 @@ int stop_acquisition(int file_des) {
int ret=OK;
int n;
-
sprintf(mess,"can't stop acquisition\n");
-#ifdef VERBOSE
- printf("Stopping acquisition\n");
-#endif
+ cprintf(BG_RED,"Client command received to stop acquisition\n");
+
if (differentClients==1 && lockStatus==1) {
diff --git a/slsDetectorSoftware/jungfrauDetectorServer/Makefile.virtual b/slsDetectorSoftware/jungfrauDetectorServer/Makefile.virtual
index 8ee348341..b3c6ce7f8 100644
--- a/slsDetectorSoftware/jungfrauDetectorServer/Makefile.virtual
+++ b/slsDetectorSoftware/jungfrauDetectorServer/Makefile.virtual
@@ -1,24 +1,26 @@
CC = gcc
-CFLAGS += -Wall -DJUNGFRAUD -DSLS_DETECTOR_FUNCTION_LIST -DDACS_INT -DSTOP_SERVER #-DVERBOSEI #-DVERBOSE
+CFLAGS += -Wall -DJUNGFRAUD -DVIRTUAL -DSLS_DETECTOR_FUNCTION_LIST -DDACS_INT -DSTOP_SERVER #-DVERBOSEI #-DVERBOSE
LDLIBS += -lm -lstdc++
-PROGS = jungfrauDetectorServer
+PROGS = jungfrauDetectorServer_virtual
DESTDIR ?= bin
INSTMODE = 0777
SRC_CLNT = communication_funcs.c slsDetectorServer.c slsDetectorServer_funcs.c slsDetectorFunctionList.c
OBJS = $(SRC_CLNT:.c=.o)
-all: clean $(PROGS)
+all: clean versioning $(PROGS)
boot: $(OBJS)
+versioning:
+ @echo `tput setaf 6; ./updateGitVersion.sh; tput sgr0;`
+
$(PROGS): $(OBJS)
- echo $(OBJS)
+# echo $(OBJS)
mkdir -p $(DESTDIR)
$(CC) -o $@ $^ $(CFLAGS) $(LDLIBS)
mv $(PROGS) $(DESTDIR)
- rm *.gdb
clean:
rm -rf $(DESTDIR)/$(PROGS) *.o
diff --git a/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer
index 236ebd9a2..b77199c10 100755
Binary files a/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer and b/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer differ
diff --git a/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_virtual b/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_virtual
new file mode 100755
index 000000000..cd39898fa
Binary files /dev/null and b/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_virtual differ
diff --git a/slsDetectorSoftware/jungfrauDetectorServer/gitInfo.txt b/slsDetectorSoftware/jungfrauDetectorServer/gitInfo.txt
index fcd27ac13..2cffea544 100644
--- a/slsDetectorSoftware/jungfrauDetectorServer/gitInfo.txt
+++ b/slsDetectorSoftware/jungfrauDetectorServer/gitInfo.txt
@@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/jungfrauDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
-Repsitory UUID: a536f8ac9be2f064974da454273bfa828edb5bb1
-Revision: 121
+Repsitory UUID: 06cdf8ad9204fd306cb1017b91e67452c61715d4
+Revision: 122
Branch: developer
Last Changed Author: Erik_Frojdh
-Last Changed Rev: 3669
-Last Changed Date: 2018-02-22 10:31:42.834118468 +0100 ./blackfin.h~
+Last Changed Rev: 3671
+Last Changed Date: 2018-03-13 10:29:31.000000002 +0100 ./Makefile.virtual
diff --git a/slsDetectorSoftware/jungfrauDetectorServer/gitInfoJungfrau.h b/slsDetectorSoftware/jungfrauDetectorServer/gitInfoJungfrau.h
index b87a74e6b..00181c6cb 100644
--- a/slsDetectorSoftware/jungfrauDetectorServer/gitInfoJungfrau.h
+++ b/slsDetectorSoftware/jungfrauDetectorServer/gitInfoJungfrau.h
@@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
-#define GITREPUUID "a536f8ac9be2f064974da454273bfa828edb5bb1"
+#define GITREPUUID "06cdf8ad9204fd306cb1017b91e67452c61715d4"
#define GITAUTH "Erik_Frojdh"
-#define GITREV 0x3669
-#define GITDATE 0x20180222
+#define GITREV 0x3671
+#define GITDATE 0x20180313
#define GITBRANCH "developer"
diff --git a/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c
index 426f5f4ba..26e951a46 100644
--- a/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c
+++ b/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c
@@ -26,6 +26,17 @@ int32_t clkPhase[2] = {0, 0};
/* basic tests */
void checkFirmwareCompatibility(int flag) {
+#ifdef VIRTUAL
+ cprintf(BLUE,"\n\n"
+ "********************************************************\n"
+ "************** Jungfrau Virtual Server *****************\n"
+ "********************************************************\n\n");
+ if (mapCSP0() == FAIL) {
+ cprintf(BG_RED, "Dangerous to continue. Goodbye!\n");
+ exit(EXIT_FAILURE);
+ }
+ return;
+#endif
defineGPIOpins();
resetFPGA();
@@ -104,6 +115,9 @@ void checkFirmwareCompatibility(int flag) {
int checkType() {
+#ifdef VIRTUAL
+ return OK;
+#endif
volatile u_int32_t type = ((bus_r(FPGA_VERSION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST);
if (type != JUNGFRAU){
cprintf(BG_RED,"This is not a Jungfrau Server (read %d, expected %d)\n",type, JUNGFRAU);
@@ -116,6 +130,9 @@ int checkType() {
u_int32_t testFpga(void) {
+#ifdef VIRTUAL
+ return OK;
+#endif
printf("\nTesting FPGA...\n");
//fixed pattern
@@ -132,6 +149,9 @@ u_int32_t testFpga(void) {
int testBus() {
+#ifdef VIRTUAL
+ return OK;
+#endif
printf("\nTesting Bus...\n");
int ret = OK;
@@ -158,6 +178,9 @@ int moduleTest( enum digitalTestMode arg, int imod){
}
int detectorTest( enum digitalTestMode arg){
+#ifdef VIRTUAL
+ return OK;
+#endif
switch(arg){
case DETECTOR_FIRMWARE_TEST: return testFpga();
case DETECTOR_BUS_TEST: return testBus();
@@ -194,26 +217,44 @@ int64_t getDetectorId(enum idMode arg){
}
u_int64_t getFirmwareVersion() {
+#ifdef VIRTUAL
+ return 0;
+#endif
return ((bus_r(FPGA_VERSION_REG) & BOARD_REVISION_MSK) >> BOARD_REVISION_OFST);
}
u_int64_t getFirmwareAPIVersion() {
+#ifdef VIRTUAL
+ return 0;
+#endif
return ((bus_r(API_VERSION_REG) & API_VERSION_MSK) >> API_VERSION_OFST);
}
u_int16_t getHardwareVersionNumber() {
+#ifdef VIRTUAL
+ return 0;
+#endif
return ((bus_r(MOD_SERIAL_NUM_REG) & HARDWARE_VERSION_NUM_MSK) >> HARDWARE_VERSION_NUM_OFST);
}
u_int16_t getHardwareSerialNumber() {
+#ifdef VIRTUAL
+ return 0;
+#endif
return ((bus_r(MOD_SERIAL_NUM_REG) & HARDWARE_SERIAL_NUM_MSK) >> HARDWARE_SERIAL_NUM_OFST);
}
u_int32_t getDetectorNumber(){
+#ifdef VIRTUAL
+ return 0;
+#endif
return bus_r(MOD_SERIAL_NUM_REG);
}
u_int64_t getDetectorMAC() {
+#ifdef VIRTUAL
+ return 0;
+#endif
char output[255],mac[255]="";
u_int64_t res=0;
FILE* sysFile = popen("ifconfig eth0 | grep HWaddr | cut -d \" \" -f 11", "r");
@@ -231,6 +272,9 @@ u_int64_t getDetectorMAC() {
}
u_int32_t getDetectorIP(){
+#ifdef VIRTUAL
+ return 0;
+#endif
char temp[50]="";
u_int32_t res=0;
//execute and get address
@@ -325,9 +369,9 @@ void setupDetector() {
resetCore();
resetPeripheral();
cleanFifos();
-
+#ifndef VIRTUAL
prepareADC();
-
+#endif
// initialize dac series
initDac(0); /* todo might work without */
initDac(8); //only for old board compatibility
@@ -344,8 +388,7 @@ void setupDetector() {
cprintf(RED, "Warning: Setting dac %d failed, wrote %d, read %d\n",i ,defaultvals[i], retval[0]);
}
}
-
- bus_w(DAQ_REG, 0x0); /* Only once at server startup */
+ bus_w(DAQ_REG, 0x0); /* Only once at server startup */
setSpeed(CLOCK_DIVIDER, HALF_SPEED);
cleanFifos(); /* todo might work without */
resetCore(); /* todo might work without */
@@ -414,18 +457,27 @@ int autoCompDisable(int on) {
void cleanFifos() {
+#ifdef VIRTUAL
+ return;
+#endif
printf("\nClearing Acquisition Fifos\n");
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_ACQ_FIFO_CLR_MSK);
bus_w(CONTROL_REG, bus_r(CONTROL_REG) & ~CONTROL_ACQ_FIFO_CLR_MSK);
}
void resetCore() {
+#ifdef VIRTUAL
+ return;
+#endif
printf("\nResetting Core\n");
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_CORE_RST_MSK);
bus_w(CONTROL_REG, bus_r(CONTROL_REG) & ~CONTROL_CORE_RST_MSK);
}
void resetPeripheral() {
+#ifdef VIRTUAL
+ return;
+#endif
printf("\nResetting Peripheral\n");
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_PERIPHERAL_RST_MSK);
bus_w(CONTROL_REG, bus_r(CONTROL_REG) & ~CONTROL_PERIPHERAL_RST_MSK);
@@ -628,6 +680,9 @@ int64_t setTimer(enum timerIndex ind, int64_t val) {
int64_t getTimeLeft(enum timerIndex ind){
+#ifdef VIRTUAL
+ return 0;
+#endif
int64_t retval = -1;
switch(ind){
@@ -810,6 +865,9 @@ enum detectorSettings getSettings(){
void initDac(int dacnum) {
+#ifdef VIRTUAL
+ return;
+#endif
printf("\nInitializing dac for %d to \n",dacnum);
u_int32_t codata;
@@ -871,6 +929,9 @@ void setDAC(enum DACINDEX ind, int val, int imod, int mV, int retval[]){
}
if ( (val >= 0) || (val == -100)) {
+#ifdef VIRTUAL
+ dacValues[ind] = dacval;
+#else
u_int32_t codata;
int csdx = ind / NDAC + DAC_SERIAL_CS_OUT_OFST; // old board (16 dacs),so can be DAC_SERIAL_CS_OUT_OFST or +1
int dacchannel = ind % NDAC; // 0-8, dac channel number (also for dacnum 9-15 in old board)
@@ -902,6 +963,7 @@ void setDAC(enum DACINDEX ind, int val, int imod, int mV, int retval[]){
bus_w (VREF_COMP_MOD_REG, (bus_r(VREF_COMP_MOD_REG) &~ (VREF_COMP_MOD_MSK)) // reset
| ((val << VREF_COMP_MOD_OFST) & VREF_COMP_MOD_MSK)); // or it with value
}
+#endif
}
printf("Getting DAC %d : ",ind);
@@ -911,6 +973,9 @@ void setDAC(enum DACINDEX ind, int val, int imod, int mV, int retval[]){
int getADC(enum ADCINDEX ind, int imod){
+#ifdef VIRTUAL
+ return 0;
+#endif
char tempnames[2][40]={"VRs/FPGAs Temperature", "ADCs/ASICs Temperature"};
printf("Getting Temperature for %s\n",tempnames[ind]);
u_int32_t addr = GET_TEMPERATURE_TMP112_REG;
@@ -936,6 +1001,11 @@ int getADC(enum ADCINDEX ind, int imod){
int setHighVoltage(int val){
+#ifdef VIRTUAL
+ if (val >= 0)
+ highvoltage = val;
+ return highvoltage;
+#endif
u_int32_t dacvalue;
float alpha = 0.55;
// setting hv
@@ -1029,6 +1099,9 @@ long int calcChecksum(int sourceip, int destip) {
int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t sourceip, uint32_t udpport, uint32_t udpport2, int ival){
+#ifdef VIRTUAL
+ return 0;
+#endif
cprintf(BLUE, "\n*** Configuring MAC ***\n");
uint32_t sourceport = DEFAULT_TX_UDP_PORT;
@@ -1137,6 +1210,9 @@ int setDetectorPosition(int pos[]) {
void resetPLL() {
+#ifdef VIRTUAL
+ return;
+#endif
// reset PLL Reconfiguration and PLL
bus_w(PLL_CONTROL_REG, bus_r(PLL_CONTROL_REG) | PLL_CTRL_RECONFIG_RST_MSK | PLL_CTRL_RST_MSK);
usleep(100);
@@ -1145,7 +1221,9 @@ void resetPLL() {
u_int32_t setPllReconfigReg(u_int32_t reg, u_int32_t val) {
-
+#ifdef VIRTUAL
+ return val;
+#endif
// set parameter
bus_w(PLL_PARAM_REG, val);
@@ -1165,6 +1243,9 @@ u_int32_t setPllReconfigReg(u_int32_t reg, u_int32_t val) {
void configurePll() {
+#ifdef VIRTUAL
+ return;
+#endif
u_int32_t val;
int32_t phase=0, inv=0;
@@ -1238,6 +1319,9 @@ int setTemperatureControl(int val) {
int setTemperatureEvent(int val) {
+#ifdef VIRTUAL
+ return 0;
+#endif
if (val >= 0) {
// set bit to clear it
val = 1;
@@ -1261,6 +1345,10 @@ int setNetworkParameter(enum NETWORKINDEX mode, int value) {
printf("\nSetting transmission delay: %d\n", value);
bus_w(CONFIG_REG, (bus_r(CONFIG_REG) &~CONFIG_TDMA_TIMESLOT_MSK)
| (((value << CONFIG_TDMA_TIMESLOT_OFST) & CONFIG_TDMA_TIMESLOT_MSK)));
+ if (value == 0)
+ bus_w(CONFIG_REG, bus_r(CONFIG_REG) &~ CONFIG_TDMA_MSK);
+ else
+ bus_w(CONFIG_REG, bus_r(CONFIG_REG) | CONFIG_TDMA_MSK);
#ifdef VERBOSE
printf("Transmission delay set to %d\n", ((bus_r(CONFIG_REG) & CONFIG_TDMA_TIMESLOT_MSK) >> CONFIG_TDMA_TIMESLOT_OFST));
#endif
@@ -1276,6 +1364,9 @@ int setNetworkParameter(enum NETWORKINDEX mode, int value) {
/* aquisition */
int startStateMachine(){
+#ifdef VIRTUAL
+ return OK;
+#endif
printf("*******Starting State Machine*******\n");
cleanFifos();
@@ -1290,6 +1381,9 @@ int startStateMachine(){
int stopStateMachine(){
+#ifdef VIRTUAL
+ return OK;
+#endif
cprintf(BG_RED,"*******Stopping State Machine*******\n");
//stop state machine
@@ -1306,6 +1400,9 @@ int stopStateMachine(){
enum runStatus getRunStatus(){
+#ifdef VIRTUAL
+ return IDLE;
+#endif
#ifdef VERBOSE
printf("Getting status\n");
#endif
@@ -1349,7 +1446,11 @@ enum runStatus getRunStatus(){
void readFrame(int *ret, char *mess){
-
+#ifdef VIRTUAL
+ *ret = (int)FAIL;
+ sprintf(mess,"virtual detector, no acquisition taken\n");
+ return;
+#endif
// wait for status to be done
while(runBusy()){
usleep(500);
@@ -1371,6 +1472,9 @@ void readFrame(int *ret, char *mess){
u_int32_t runBusy(void) {
+#ifdef VIRTUAL
+ return 0;
+#endif
u_int32_t s = ((bus_r(STATUS_REG) & RUN_BUSY_MSK) >> RUN_BUSY_OFST);
#ifdef VERBOSE
printf("Status Register: %08x\n", s);
diff --git a/slsDetectorSoftware/moenchDetectorServer/moenchDetectorServerv3.0.1.0 b/slsDetectorSoftware/moenchDetectorServer/moenchDetectorServerv3.0.1.0
deleted file mode 100755
index 41adbc41a..000000000
Binary files a/slsDetectorSoftware/moenchDetectorServer/moenchDetectorServerv3.0.1.0 and /dev/null differ
diff --git a/slsDetectorSoftware/moenchDetectorServer/server_funcs.c b/slsDetectorSoftware/moenchDetectorServer/server_funcs.c
index 2463e7971..33f776c33 100755
--- a/slsDetectorSoftware/moenchDetectorServer/server_funcs.c
+++ b/slsDetectorSoftware/moenchDetectorServer/server_funcs.c
@@ -593,9 +593,11 @@ int get_id(int file_des) {
retval=getDetectorNumber();
break;
case DETECTOR_FIRMWARE_VERSION:
- return (getFirmwareVersion() & 0xFFFFFF);
+ retval = (getFirmwareVersion() & 0xFFFFFF);
+ break;
case DETECTOR_SOFTWARE_VERSION:
- return (GITDATE & 0xFFFFFF);
+ retval = (GITDATE & 0xFFFFFF);
+ break;
default:
printf("Required unknown id %d \n", arg);
ret=FAIL;
diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp
index 489de95ae..bd7b561f2 100644
--- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp
+++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp
@@ -1215,7 +1215,7 @@ int multiSlsDetector::getThresholdEnergy(int pos) {
if (ret1==-100)
ret1=ret;
else if (ret<(ret1-200) || ret>(ret1+200))
- ret1=FAIL;
+ ret1=-1;
}
@@ -1260,7 +1260,7 @@ int multiSlsDetector::setThresholdEnergy(int e_eV, int pos, detectorSettings ise
if(iret[idet] != NULL){
if (ret==-100)
ret=*iret[idet];
- else if (ret<(*iret[idet]-200) || ret>(*iret[idet]+200))
+ else if (*iret[idet]<(ret-200) || *iret[idet]>(ret+200))
ret=-1;
delete iret[idet];
}else ret=-1;
@@ -4912,16 +4912,16 @@ int multiSlsDetector::saveCalibrationFile(string fname, int imod) {
-int multiSlsDetector::writeRegister(int addr, int val){
+uint32_t multiSlsDetector::writeRegister(uint32_t addr, uint32_t val){
- int ret, ret1=-100;
+ uint32_t ret, ret1;
for (int i=0; inumberOfDetectors; ++i) {
if (detectors[i]) {
ret=detectors[i]->writeRegister(addr,val);
if(detectors[i]->getErrorMask())
setErrorMask(getErrorMask()|(1<numberOfDetectors; ++i) {
if (detectors[i]) {
ret=detectors[i]->readRegister(addr);
if(detectors[i]->getErrorMask())
setErrorMask(getErrorMask()|(1<numberOfDetectors; ++i) {
if (detectors[i]) {
ret1=detectors[i]->setBit(addr,n);
if(detectors[i]->getErrorMask())
setErrorMask(getErrorMask()|(1<numberOfDetectors; ++i) {
if (detectors[i]) {
ret1=detectors[i]->clearBit(addr,n);
if(detectors[i]->getErrorMask())
setErrorMask(getErrorMask()|(1<numberOfChannel[X];
+ maxY = thisMultiDetector->numberOfChannel[Y];
break;
default:
break;
@@ -6184,7 +6186,11 @@ void multiSlsDetector::readFrameFromReceiver(){
//assemble data with no interleaving, assumed detectors appended vertically
else{
- memcpy(multiframe+slsdatabytes*isocket,image,slsdatabytes);
+ for(int i=0;ioffsetY[isocket] + i) * maxX) + thisMultiDetector->offsetX[isocket])* (int)bytesperchannel,
+ (char*)image+ (i*slsmaxX*(int)bytesperchannel),
+ (slsmaxX*(int)bytesperchannel));
+ }
}
}
diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h
index d21faff38..a0875185d 100644
--- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h
+++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h
@@ -1100,13 +1100,13 @@ class multiSlsDetector : public slsDetectorUtils {
- int writeRegister(int addr, int val);
+ uint32_t writeRegister(uint32_t addr, uint32_t val);
int writeAdcRegister(int addr, int val);
- int readRegister(int addr);
+ uint32_t readRegister(uint32_t addr);
/**
sets a bit in a register
@@ -1116,7 +1116,7 @@ class multiSlsDetector : public slsDetectorUtils {
DO NOT USE!!! ONLY EXPERT USER!!!
*/
- int setBit(int addr, int n);
+ uint32_t setBit(uint32_t addr, int n);
/**
@@ -1127,7 +1127,7 @@ class multiSlsDetector : public slsDetectorUtils {
DO NOT USE!!! ONLY EXPERT USER!!!
*/
- int clearBit(int addr, int n);
+ uint32_t clearBit(uint32_t addr, int n);
@@ -1244,6 +1244,7 @@ class multiSlsDetector : public slsDetectorUtils {
slsDetector *operator()(int pos) {if (pos>=0 && pos< MAXDET) return detectors[pos]; return NULL;};
+
//receiver
/**
diff --git a/slsDetectorSoftware/slsDetector/gitInfoLib.h b/slsDetectorSoftware/slsDetector/gitInfoLib.h
index 49cbff9d1..9f727a80f 100644
--- a/slsDetectorSoftware/slsDetector/gitInfoLib.h
+++ b/slsDetectorSoftware/slsDetector/gitInfoLib.h
@@ -1,6 +1,14 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
+<<<<<<< HEAD
#define GITREPUUID "92b4b3324e09299663b9862bad26b38a3257dd60"
#define GITAUTH "Andrä_Marie"
#define GITREV 0x3570
#define GITDATE 0x20180119
#define GITBRANCH "developer"
+=======
+#define GITREPUUID "b389402d647e939342dbb2c9317c688c0eb6b105"
+#define GITAUTH "Erik_Frojdh"
+#define GITREV 0x3458
+#define GITDATE 0x20180312
+#define GITBRANCH "3.1.0-rc"
+>>>>>>> 3.1.0
diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp
index 2ac36450b..89d80025d 100644
--- a/slsDetectorSoftware/slsDetector/slsDetector.cpp
+++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp
@@ -2397,13 +2397,13 @@ int slsDetector::digitalTest( digitalTestMode mode, int imod){
/* write or read register */
-int slsDetector::writeRegister(int addr, int val){
+uint32_t slsDetector::writeRegister(uint32_t addr, uint32_t val){
- int retval=-1;
+ uint32_t retval = 0;
int fnum=F_WRITE_REGISTER;
int ret=FAIL;
char mess[MAX_STR_LENGTH]="";
- int arg[2];
+ uint32_t arg[2];
arg[0]=addr;
arg[1]=val;
@@ -2446,7 +2446,7 @@ int slsDetector::writeAdcRegister(int addr, int val){
int ret=FAIL;
char mess[MAX_STR_LENGTH]="";
- int arg[2];
+ uint32_t arg[2];
arg[0]=addr;
arg[1]=val;
@@ -2485,13 +2485,13 @@ int slsDetector::writeAdcRegister(int addr, int val){
-int slsDetector::readRegister(int addr){
+uint32_t slsDetector::readRegister(uint32_t addr){
- int retval=-1;
+ uint32_t retval = 0;
int fnum=F_READ_REGISTER;
int ret=FAIL;
char mess[MAX_STR_LENGTH]="";
- int arg;
+ uint32_t arg;
arg=addr;
@@ -2528,25 +2528,24 @@ int slsDetector::readRegister(int addr){
}
-int slsDetector::setBit(int addr, int n) {
+uint32_t slsDetector::setBit(uint32_t addr, int n) {
if (n<0 || n>31) {
std::cout << "Bit number out of Range" << std:: endl;
setErrorMask((getErrorMask())|(REGISER_WRITE_READ));
}
// normal bit range
+ //TODO! (Erik) Check for errors! cannot use value since reg is 32bits
else {
- int val = readRegister(addr);
- if (val != -1) {
- writeRegister(addr,val | 1<31) {
std::cout << "Bit number out of Range" << std:: endl;
setErrorMask((getErrorMask())|(REGISER_WRITE_READ));
@@ -2554,10 +2553,8 @@ int slsDetector::clearBit(int addr, int n) {
// normal bit range
else {
- int val = readRegister(addr);
- if (val != -1) {
- writeRegister(addr,val & ~(1<nOffset]=offsetval[i];
}
+ if (e_eV != -1)
+ thisDetector->currentThresholdEV = e_eV;
+
}
#ifdef VERBOSE
@@ -3549,7 +3549,7 @@ int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isetti
//currently only for eiger
if (thisDetector->myDetectorType == EIGER) {
setThresholdEnergyAndSettings(e_eV,isettings,tb);
- return thisDetector->currentThresholdEV;
+ return thisDetector->currentThresholdEV;
}
int fnum= F_SET_THRESHOLD_ENERGY;
@@ -6455,9 +6455,9 @@ string slsDetector::setReceiverUDPMAC(string udpmac){
#else
;
#endif
- else if(setUDPConnection()==FAIL){
+ /* else if(setUDPConnection()==FAIL){ commented out to be replaced by user defined udpmac
std::cout<< "Warning: UDP connection set up failed" << std::endl;
- }
+ }*/
}else{
setErrorMask((getErrorMask())|(COULDNOT_SET_NETWORK_PARAMETER));
std::cout << "Warning: receiver udp mac address should be in xx:xx:xx:xx:xx:xx format" << std::endl;
diff --git a/slsDetectorSoftware/slsDetector/slsDetector.h b/slsDetectorSoftware/slsDetector/slsDetector.h
index 3597f64d9..5dd98aafb 100644
--- a/slsDetectorSoftware/slsDetector/slsDetector.h
+++ b/slsDetectorSoftware/slsDetector/slsDetector.h
@@ -892,7 +892,7 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
\returns current register value
*/
- int writeRegister(int addr, int val);
+ uint32_t writeRegister(uint32_t addr, uint32_t val);
/**
@@ -910,7 +910,7 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
\returns current register value
*/
- int readRegister(int addr);
+ uint32_t readRegister(uint32_t addr);
/**
sets a bit in a register
@@ -920,7 +920,7 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
DO NOT USE!!! ONLY EXPERT USER!!!
*/
- int setBit(int addr, int n);
+ uint32_t setBit(uint32_t addr, int n);
/**
@@ -931,7 +931,7 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
DO NOT USE!!! ONLY EXPERT USER!!!
*/
- int clearBit(int addr, int n);
+ uint32_t clearBit(uint32_t addr, int n);
/**
set dacs value
diff --git a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp
index 4f95818b6..e5fe9c137 100644
--- a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp
+++ b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp
@@ -1650,7 +1650,7 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
/* temperature control */
/*! \page settings
- \section settingsadcs Temp Control
+ \section settingstmp Temp Control
commands to monitor and handle temperature overshoot (only JUNGFRAU)
*/
@@ -5829,6 +5829,9 @@ string slsDetectorCommand::cmdSpeed(int narg, char *args[], int action) {
return string("cannot scan speed value ")+string(args[1]);
}
+ // -1 could work
+ else if (cmd=="adcphase")
+ t = 65536;
myDet->setOnline(ONLINE_FLAG);
diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUtils.h b/slsDetectorSoftware/slsDetector/slsDetectorUtils.h
index 89ddeb07c..1ac5e5b14 100644
--- a/slsDetectorSoftware/slsDetector/slsDetectorUtils.h
+++ b/slsDetectorSoftware/slsDetector/slsDetectorUtils.h
@@ -537,7 +537,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
DO NOT USE!!! ONLY EXPERT USER!!!
*/
- virtual int writeRegister(int addr, int val)=0;
+ virtual uint32_t writeRegister(uint32_t addr, uint32_t val)=0;
/**
@@ -548,7 +548,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
DO NOT USE!!! ONLY EXPERT USER!!!
*/
- virtual int writeAdcRegister(int addr, int val)=0;
+ virtual int writeAdcRegister(int addr, int val)=0;
/**
@@ -558,7 +558,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
DO NOT USE!!! ONLY EXPERT USER!!!
*/
- virtual int readRegister(int addr)=0;
+ virtual uint32_t readRegister(uint32_t addr)=0;
/**
@@ -569,7 +569,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
DO NOT USE!!! ONLY EXPERT USER!!!
*/
- virtual int setBit(int addr, int n)=0;
+ virtual uint32_t setBit(uint32_t addr, int n)=0;
/**
@@ -580,7 +580,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
DO NOT USE!!! ONLY EXPERT USER!!!
*/
- virtual int clearBit(int addr, int n)=0;
+ virtual uint32_t clearBit(uint32_t addr, int n)=0;
/**
diff --git a/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp b/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp
index 9afe150f1..cb709058d 100644
--- a/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp
+++ b/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp
@@ -149,8 +149,8 @@ slsDetectorDefs::sls_detector_module* energyConversion::interpolateTrim(detector
enum eiger_DacIndex{SVP,VTR,VRF,VRS,SVN,VTGSTV,VCMP_LL,VCMP_LR,CAL,VCMP_RL,RXB_RB,RXB_LB,VCMP_RR,VCP,VCN,VIS};
//Copy other dacs
- int num_dacs_to_copy = 10;
- int dacs_to_copy[] = {SVP,VTR,VRS,SVN,VTGSTV,CAL,RXB_RB,RXB_LB,VCN,VIS};
+ int num_dacs_to_copy = 9;
+ int dacs_to_copy[] = {SVP,VTR,SVN,VTGSTV,CAL,RXB_RB,RXB_LB,VCN,VIS};
for (int i = 0; i < num_dacs_to_copy; ++i) {
if(a->dacs[dacs_to_copy[i]] != b->dacs[dacs_to_copy[i]]) {
deleteModule(myMod);
@@ -160,8 +160,8 @@ slsDetectorDefs::sls_detector_module* energyConversion::interpolateTrim(detector
}
//Interpolate vrf, vcmp, vcp
- int num_dacs_to_interpolate = 6;
- int dacs_to_interpolate[] = {VRF,VCMP_LL,VCMP_LR,VCMP_RL,VCMP_RR,VCP};
+ int num_dacs_to_interpolate = 7;
+ int dacs_to_interpolate[] = {VRF,VCMP_LL,VCMP_LR,VCMP_RL,VCMP_RR,VCP, VRS};
for (int i = 0; i < num_dacs_to_interpolate; ++i) {
myMod->dacs[dacs_to_interpolate[i]] = linearInterpolation(energy, e1, e2,
a->dacs[dacs_to_interpolate[i]], b->dacs[dacs_to_interpolate[i]]);
diff --git a/slsDetectorSoftware/slsDetectorServer/blackfin.h b/slsDetectorSoftware/slsDetectorServer/blackfin.h
index 312adfdc8..841dee257 100755
--- a/slsDetectorSoftware/slsDetectorServer/blackfin.h
+++ b/slsDetectorSoftware/slsDetectorServer/blackfin.h
@@ -9,7 +9,7 @@
/* global variables */
-u_int32_t CSP0BASE = 0;
+u_int64_t CSP0BASE = 0;
#define CSP0 0x20200000
#define MEM_SIZE 0x100000
#define MEM_MAP_SHIFT 1
@@ -123,10 +123,14 @@ u_int32_t writeRegister(u_int32_t offset, u_int32_t data) {
*/
int mapCSP0(void) {
// if not mapped
- if (!CSP0BASE) {
+ if (CSP0BASE == 0) {
printf("Mapping memory\n");
#ifdef VIRTUAL
CSP0BASE = malloc(MEM_SIZE);
+ if (CSP0BASE == NULL) {
+ cprintf(BG_RED, "Error: Could not allocate virtual memory.\n");
+ return FAIL;
+ }
printf("memory allocated\n");
#else
int fd;
@@ -138,14 +142,15 @@ int mapCSP0(void) {
#ifdef VERBOSE
printf("/dev/mem opened\n");
#endif
- CSP0BASE = (u_int32_t)mmap(0, MEM_SIZE, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, fd, CSP0);
- if (CSP0BASE == (u_int32_t)MAP_FAILED) {
+ CSP0BASE = mmap(0, MEM_SIZE, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, fd, CSP0);
+ if (CSP0BASE == MAP_FAILED) {
cprintf(BG_RED, "Error: Can't map memmory area\n");
return FAIL;
}
- printf("CSPOBASE mapped from %08x to %08x\n",CSP0BASE,CSP0BASE+MEM_SIZE);
#endif
- //printf("Status Register: %08x\n",bus_r(STATUS_REG));
+ printf("CSPOBASE mapped from 0x%llx to 0x%llx\n",CSP0BASE, CSP0BASE+MEM_SIZE);
+ printf("Status Register: %08x\n",bus_r(STATUS_REG));
+
}else
printf("Memory already mapped before\n");
return OK;
diff --git a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c
index 13d97e435..4da1ae734 100755
--- a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c
+++ b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c
@@ -1391,7 +1391,7 @@ int get_adc(int file_des) {
int write_register(int file_des) {
int ret=OK,ret1=OK;
int n=0;
- int retval=-1;
+ uint32_t retval=-1;
sprintf(mess,"write to register failed\n");
// receive arguments
@@ -1399,7 +1399,7 @@ int write_register(int file_des) {
n = receiveData(file_des,arg,sizeof(arg),INT32);
if (n < 0) return printSocketReadError();
int addr=arg[0];
- int val=arg[1];
+ uint32_t val=arg[1];
// execute action
if (differentClients && lockStatus) {
@@ -1449,7 +1449,7 @@ int write_register(int file_des) {
int read_register(int file_des) {
int ret=OK,ret1=OK;
int n=0;
- int retval=-1;
+ uint32_t retval=-1;
sprintf(mess,"read register failed\n");
// receive arguments
@@ -3167,7 +3167,7 @@ int set_speed(int file_des) {
#ifdef JUNGFRAUD
case ADC_PHASE:
retval = adcPhase(val);
- if ((retval!=val) && (val>=0)) {
+ if ((val != 65536) && (retval!=val) && (val>=0)) {
ret=FAIL;
sprintf(mess,"could not change set adc phase: should be %d but is %d \n", val, retval);
cprintf(RED, "Warning: %s", mess);
diff --git a/slsReceiverSoftware/gitInfo.txt b/slsReceiverSoftware/gitInfo.txt
index 12becbdbe..d85227f14 100644
--- a/slsReceiverSoftware/gitInfo.txt
+++ b/slsReceiverSoftware/gitInfo.txt
@@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsReceiverSoftware
-URL: origin git@git.psi.ch:sls_detectors_software/slsDetectorPackage.git
-Repository Root: origin git@git.psi.ch:sls_detectors_software/slsDetectorPackage.git
-Repsitory UUID: 7436d6c8d3538cef443e0fa76bc01762fd6cc246
-Revision: 688
-Branch: 3.0.1
-Last Changed Author: Dhanya_Maliakal
-Last Changed Rev: 3186
-Last Changed Date: 2017-12-06 08:45:14.000000002 +0100 ./src/UDPStandardImplementation.cpp
+URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
+Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
+Repsitory UUID: b389402d647e939342dbb2c9317c688c0eb6b105
+Revision: 708
+Branch: 3.1.0-rc
+Last Changed Author: Erik_Frojdh
+Last Changed Rev: 3458
+Last Changed Date: 2018-03-09 12:23:14.000000002 +0100 ./src/Listener.cpp
diff --git a/slsReceiverSoftware/include/gitInfoReceiver.h b/slsReceiverSoftware/include/gitInfoReceiver.h
index 12e1df72b..cbbcf49db 100644
--- a/slsReceiverSoftware/include/gitInfoReceiver.h
+++ b/slsReceiverSoftware/include/gitInfoReceiver.h
@@ -1,6 +1,6 @@
-#define GITURL "git@git.psi.ch:sls_detectors_software/slsDetectorPackage.git"
-#define GITREPUUID "7436d6c8d3538cef443e0fa76bc01762fd6cc246"
-#define GITAUTH "Dhanya_Maliakal"
-#define GITREV 0x3186
-#define GITDATE 0x20171206
-#define GITBRANCH "3.0.1"
+#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
+#define GITREPUUID "b389402d647e939342dbb2c9317c688c0eb6b105"
+#define GITAUTH "Erik_Frojdh"
+#define GITREV 0x3458
+#define GITDATE 0x20180309
+#define GITBRANCH "3.1.0-rc"
diff --git a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp
index 936a92bd1..22c123ce7 100644
--- a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp
+++ b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp
@@ -631,17 +631,18 @@ int slsReceiverTCPIPInterface::send_update() {
char defaultVal[MAX_STR_LENGTH];
memset(defaultVal, 0, sizeof(defaultVal));
char* path = NULL;
+ int n = 0;
- mySock->SendDataOnly(mySock->lastClientIP,sizeof(mySock->lastClientIP));
+ n += mySock->SendDataOnly(mySock->lastClientIP,sizeof(mySock->lastClientIP));
// filepath
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
path = receiverBase->getFilePath();
#endif
if (path == NULL)
- mySock->SendDataOnly(defaultVal,MAX_STR_LENGTH);
+ n += mySock->SendDataOnly(defaultVal,MAX_STR_LENGTH);
else {
- mySock->SendDataOnly(path,MAX_STR_LENGTH);
+ n += mySock->SendDataOnly(path,MAX_STR_LENGTH);
delete[] path;
}
@@ -650,9 +651,9 @@ int slsReceiverTCPIPInterface::send_update() {
path = receiverBase->getFileName();
#endif
if(path == NULL)
- mySock->SendDataOnly(defaultVal,MAX_STR_LENGTH);
+ n += mySock->SendDataOnly(defaultVal,MAX_STR_LENGTH);
else {
- mySock->SendDataOnly(path,MAX_STR_LENGTH);
+ n += mySock->SendDataOnly(path,MAX_STR_LENGTH);
delete[] path;
}
@@ -660,43 +661,43 @@ int slsReceiverTCPIPInterface::send_update() {
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=receiverBase->getFileIndex();
#endif
- mySock->SendDataOnly(&ind,sizeof(ind));
+ n += mySock->SendDataOnly(&ind,sizeof(ind));
//file format
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getFileFormat();
#endif
- mySock->SendDataOnly(&ind,sizeof(ind));
+ n += mySock->SendDataOnly(&ind,sizeof(ind));
// file write enable
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getFileWriteEnable();
#endif
- mySock->SendDataOnly(&ind,sizeof(ind));
+ n += mySock->SendDataOnly(&ind,sizeof(ind));
// file overwrite enable
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getOverwriteEnable();
#endif
- mySock->SendDataOnly(&ind,sizeof(ind));
+ n += mySock->SendDataOnly(&ind,sizeof(ind));
// receiver read frequency
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getFrameToGuiFrequency();
#endif
- mySock->SendDataOnly(&ind,sizeof(ind));
+ n += mySock->SendDataOnly(&ind,sizeof(ind));
// streaming port
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getStreamingPort();
#endif
- mySock->SendDataOnly(&ind,sizeof(ind));
+ n += mySock->SendDataOnly(&ind,sizeof(ind));
// data streaming enable
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getDataStreamEnable();
#endif
- mySock->SendDataOnly(&ind,sizeof(ind));
+ n += mySock->SendDataOnly(&ind,sizeof(ind));
// streaming source ip
#ifdef SLS_RECEIVER_UDP_FUNCTIONS