Compare commits

...

54 Commits

Author SHA1 Message Date
7aeb394514 Pattern.h as a public header files (#229)
It is used in Detector.h.
2021-01-18 08:30:34 +01:00
f9f50f1d84 M3settings (#228)
* added temp m3 settings files

* renames settings noise to trim

* get threshold for M3

* some changes to compile on RH7 and in the server to load the default chip status register at startup

* Updated mythen3DeectorServer_developer executable with correct initialization at startup

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
Co-authored-by: Anna Bergamaschi <anna.bergamaschi@psi.ch>
2021-01-14 12:34:13 +01:00
a62e068a9a M3defaultpattern (#227)
* default pattern for m3 and moench including Python bindings

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2020-12-09 13:28:39 +01:00
85bc37f04d release updated 2020-12-04 17:01:57 +01:00
a3f5315015 updated RELEASE.txt 2020-12-04 16:49:49 +01:00
d63a182996 updated RELEASE.txt 2020-12-04 14:37:29 +01:00
f147c7bfcb updated RELEASE.txt 2020-12-04 14:36:08 +01:00
4218fe5f2f bugfix from 5.0.2: potentital memory leak in receiver if setDetectorType called directly from outside 2020-12-04 14:33:53 +01:00
511f5a7ca5 Update RELEASE.txt 2020-12-04 14:33:11 +01:00
a5ab5c1fa0 additional constructors for scanPrameters in python 2020-12-04 14:31:08 +01:00
8b7023d9a3 added scanParameters in Python 2020-12-04 14:27:57 +01:00
c8c7bca6e0 bugfix: avoid potentital memory leak in receiver if called outside constructor context 2020-12-04 14:18:16 +01:00
8ddc407e62 Merge pull request #226 from esrf-bliss/potential-generaldata-memory-leak
slsReceiver: avoid potential memory leak: Implementation::generalData
2020-12-04 14:15:12 +01:00
7a2827f693 additional constructors for scanPrameters in python 2020-12-04 13:50:08 +01:00
f4be0b8efa slsReceiver: avoid potential memory leak around Implementation::generalData 2020-12-04 13:20:50 +01:00
a6e23b0509 added scanParameters in Python 2020-12-01 18:40:45 +01:00
64de9f3ad0 Merge branch 'main-rc' into b5.0.1 2020-11-30 17:24:50 +01:00
9048e7f6c4 Merge pull request #223 from slsdetectorgroup/savepatternbackup
Savepatternbackup
2020-11-30 14:00:31 +01:00
1ce56764fa binaries in 2020-11-30 13:59:55 +01:00
8c091eece2 WIP 2020-11-27 17:06:07 +01:00
d69e238e67 Python binding for Pattern 2020-11-27 17:05:39 +01:00
95fe1720c0 removed commented out lines 2020-11-27 14:44:15 +01:00
69f558c072 constexpr not compiling for rhel7 and warning left 2020-11-27 14:31:43 +01:00
e382df21b9 updated binaries, links in serverBin and deleted v5.0.0 binaries 2020-11-27 14:26:15 +01:00
8e773c97dd pattern load and save works 2020-11-27 14:19:38 +01:00
c043e74c07 wIP 2020-11-27 14:08:06 +01:00
d4518b2ca3 WIP 2020-11-27 13:56:57 +01:00
fd3108a61b WIP 2020-11-27 12:46:54 +01:00
e8fedfa55f uncommented WIP 2020-11-27 12:45:16 +01:00
0eb204bfd3 compile for servers too 2020-11-27 12:37:22 +01:00
d9b2a90651 Introduced pattern class 2020-11-27 10:03:15 +01:00
8ca1d9c50c python wrapper 2020-11-26 14:44:39 +01:00
baff0518bb WIP 2020-11-26 14:13:04 +01:00
2e669c585b WIP 2020-11-26 11:25:29 +01:00
ca0bc3e0f3 WIP 2020-11-26 10:29:09 +01:00
08ea179519 update client version to 5.0.1 2020-11-25 16:27:28 +01:00
557cab9c50 Merge branch '5.0.1-rc' into developer 2020-11-25 16:24:35 +01:00
8e6dfe9b0f update docs 2020-11-25 16:22:24 +01:00
6901368fd6 release update 2020-11-25 15:42:41 +01:00
3f1dbb7d67 release update 2020-11-25 15:32:57 +01:00
a12dd153ef WIP 2020-11-25 15:29:46 +01:00
f6126abe31 added cmake in release notes 2020-11-25 10:22:58 +01:00
8bf9f974a3 fixing typo 2020-11-24 20:39:36 +01:00
e63fa1d7c2 Setting pattern from memory (#218)
* ToString accepts c-style arrays

* added patternParameters to python

* fixed patwait time bug in validation

* moved load from file function to patterParameters

* server using patternparamters structure to get pattern

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2020-11-24 20:32:07 +01:00
1e8dacf9b8 update release 2020-11-24 20:01:37 +01:00
58fb5321f0 WIP 2020-11-23 15:33:10 +01:00
9e8c8f4bbc Merge branch '5.0.1-rc' into developer 2020-11-23 11:55:30 +01:00
faf885d2e0 python change from tiemstamp to frametime 2020-11-23 11:26:59 +01:00
c120c70678 Merge branch '5.0.1-rc' into developer 2020-11-23 09:20:22 +01:00
d5dcc8e138 runtime, zmqwhm rx_zmqhwm in python 2020-11-23 09:15:10 +01:00
90a9cea670 better cmake for python and pybind11 2.6.1 2020-11-23 08:57:00 +01:00
2eea1882d2 updated broken python bindings 2020-11-23 08:42:05 +01:00
10fa57ebb9 binaries updated to reflected developer branch 2020-11-19 16:44:40 +01:00
0ca9115cb8 updating client api branch back to developer 2020-11-19 16:43:58 +01:00
147 changed files with 2743 additions and 9249 deletions

View File

@ -192,7 +192,7 @@ if (SLS_USE_INTEGRATION_TESTS)
endif (SLS_USE_INTEGRATION_TESTS)
if (SLS_USE_PYTHON)
set(PYBIND11_CPP_STANDARD -std=c++11)
find_package (Python 3.6 COMPONENTS Interpreter Development)
add_subdirectory(libs/pybind11)
add_subdirectory(python)
endif(SLS_USE_PYTHON)

View File

@ -1,49 +1,28 @@
SLS Detector Package 5.0.0 released on 18.11.2020 (Major Release)
=================================================================
SLS Detector Package 5.1.0 released on xx.xx.2020 (Minor Release)
===================================================================
This document describes the differences between 5.1.0 and 5.x.x releases.
CONTENTS
--------
1. Topics Concerning
1. Topics Concerning
2. New Features
3. Resolved Issues
4. Known Issues
5. Firmware Requirements
6. Download, Documentation & Support
2. Resolved Issues
3. Known Issues
4. Firmware Requirements
5. Download, Documentation & Support
1. Topics Concerning
====================
- Compilation requirements
- Manuals
- Client API complete change
- Exceptions
- Scan mode (dacs and trimbit)
- Timing commands
- Enum list (daclist, dacvalues, settingslist, drlist etc.)
- Command line (return code)
- Command line (dac)
- UDP configuration change
- Gappixels
- Detector Simulators
- (Jungfrau server) settings and default dacs
- (Servers) Shared Memory
- (Jungfrau) two interfaces
- (Eiger, Jungfrau server) starting frame number
- (Eiger server) Server Config File
- (Eiger server) Partial Readout
- (Eiger server) Removed Features
- (Eiger server) Deactivation
- Zmq interface (ZmqSocket.h)
- slsReceiver (Metadata)
- slsReceiver (Shared Memory)
- slsReceiver (UDP IP)
- (Eiger Custom Receiver) Header packet
- Gui (zmq high water mark)
- (Eiger Server) Blocked server
- (Eiger Firmware) Extra 8 byte Packets
- potentital memory leak in receiver
- scanParameters in Python
- cmk.sh refactored
- m3 settings and threshold
2. New Features
@ -51,275 +30,45 @@ SLS Detector Package 5.0.0 released on 18.11.2020 (Major Release)
Client
------
1. Compilation requirements
They are very different now and can be accessed at
https://slsdetectorgroup.github.io/devdoc/dependencies.html
Gui not included in default cmk.sh script. Must be explicitly asked for.
2. Manuals
They can be compiled in the package.
https://slsdetectorgroup.github.io/devdoc/installation.html#build-this-documentation
Or refer to the documentation provided in
https://slsdetectorgroup.github.io/devdoc/index.html
3. API
Changed to Detector class.
C++: Detector.h
Documentation:
https://slsdetectorgroup.github.io/devdoc/detector.html
Examples to use the Detector class:
https://github.com/slsdetectorgroup/api-examples
Python API Documentation:
https://slsdetectorgroup.github.io/devdoc/pydetector.html
Command line:
Many commands have become deprecated. They will still execute,
but give a warning.
Documentation:
https://slsdetectorgroup.github.io/devdoc/commandline.html
Help on a command:
sls_detector_help [command], or
sls_detector_get -h [command]
4. Exceptions
They are thrown instead of providing error codes.
sls_detector_exceptions.h
Make sure you catch all exceptions in custom gui and handle them or
inform the user.
Exceptions thrown in callbacks are also handled.
- An exception in startAcquisitionCallBack will need to be handled in
startReceiver or acquire()
- An exception in acquisitionFinishedCallBack will need to be handled in
stopReceiver or acquire()
- An exception in rawDataReadyCallBack or rawDataModifyReadyCallBack
will only print and skip image to free it in memory. If address is
incorrect after callback, expect undefined behavior.
5. Scan mode
One can do scans for dacs or trimbits. Trimbits are only for Eiger or
Mythen3. Enable scan mode and then acquire using blocking or non blocking
method. Command: scan.
6. Timing Commands
In command line, all timing commands (eg. peiod) can now specify unit.
eg 100ms 10us, 1s, 100ns
In C++ API, one must use chrono library.
eg. std::chrono::duration<double, std::milli> t1{232.57};
det.setExptime(std::chrono::duration_cast<std::chrono::nanoseconds>(t1));
In Python API, one must use timedelta library.
eg. d.exptime = dt.timedelta(seconds = 1.2)
7. Enum list (daclist)
Command line and API now has features to get the list of enums/commands
for dacs, settings, dynamic range, timing modes and temperatures for
the detector in shared memory.
eg. daclist, settingslist, drlist, timinglist, templist
Command line also has commands to get their values.
eg. dacvalues, tempvalues
Python has commands to get their values (detector specific class).
eg. d.temp, d.dacs
8. Command Line (return code)
Return code of the client command line applications now return 0 for
success and 1 for failure.
9. Command Line (Dac)
All dac commands have been converted to a single "dac" command with
the previous dac commands as arguments.
eg. sls_detector_get vcmp_ll
is now
sls_detector_get dac vcmp_ll
10. UDP Configuration
Once all the udp details are set in the detector, the detector's
destination is then configured automatically. If the detector is not
configured, it will fail when acquiring. If any of these parameters
are also changed, then this is configured again. Hence, configuremac
command has been removed. Instead, there are commands such as
udp_validate (to validate if it has been configured) and
udp_reconfigure (to reconfigure).
11. Gap Pixels
Gap pixels are now only available in client call back or gui (not in
receiver anymore). It can be enabled for Eiger and Jungfrau and
includes inter chip and inter module gap pixels.
Detector Servers
----------------
1. Detector Simulators
Or virtual detector servers for every detector have been provided.
They are compiled along with the client by enabling its option.
They should also send fake data (increasing pixel/channel value).
2. (Jungfrau) settings
Settings command do not implicitly set default dacs from now on.
One can use the command 'defaultdacs' to set them explicitly.
3. Shared Memory
Almost all the detector parameters removed from shared memory.
Therefore, they are all fetched directly from detector.
4. (Jungfrau) Two 10G data interfaces
Only Jungfrau PCBs with version 2.0 can run at full speed using both
the 10G UDP interfaces to stream out data. This is available from
the current firmware and software. To enable two interfaces, one has
to enable two interfaces using "numinterfaces" to 2 and set corresponding
udp_dstip2, udp_dstport2 etc. One can also decide to select which of
the two interfaces to use, when using only 1 interface.
5. (Eiger, Jungfrau) Next Frame number
Both now have running frame numbers that is only reset at boot up
and increments continuously through acquisitions. One is able to
set the next frame number now. Command: nextframenumber.
6. (Eiger) Server Config file (config_eiger.txt)
A config file on the detector can take in 2 parameters "master"
and "top" being set to 1 or 0 to enable or disable the same.
When server is started without this file, it is set to hardware
settings.
7. (Eiger) Partial readout
It is possible for partial readouts, where you specify the number
of pixel rows to read out. Not all values are allowed. The current
slsReceiver does not complain about missing packets, but only puts
this partial image into the complete image (padding the rest). One
can cut out required subimage using callbacks, but this feature
is probably more useful for custom receivers. Command: readnlines.
8. (Eiger) Removed Features
storeinram, safe speed and ability to set settings via the settings
command has been removed.
9. (Eiger) Deactivation
The detector is deactivated by default upon boot up and activated only
upon setting hostname in the client. This is to ensure if the
network of a board or a board is broken and one cannot connect
to this board, then it is deactivated by default upon reboot.
Therefore, one can use other half modules of the detector.
Receiver
--------
1. Zmq
The static library and the zmq.h is no longer provided with package.
One must install ZeroMQ version 4.
ZmqSocket.h API has changed, especially in parsing receiving JSON header.
One must pick up needed parameters from exposed struct zmqHeader in
ZmqSocket.h.
2. Metadata
Detector dependant metadata has been added to the master files.
3. Shared Memory
Almost all receiver parameters have been removed from client shared memory.
Therefore the receiver process needs to be alive to access any receiver
parameter as they are now fetched directly from the receiver.
4. UDP IP
Since all the parameters are fetched from receiver or detector directly
(not shared memory), the udp desintation ip (previously rx_udpip) is safer
to be specified before setting rx_hostname. Setting it before has the
advantage that the detector is updated first before the receiver is
requested for the udp mac. This helps when changing pc and the receiver
cannot find the udp ip to get the udp mac.
5. (Eiger) Header packet
The header packets of Eiger are not sent in this firmware version. So,
custom receivers should handle accordingly.
Gui
---
1. Zmq high water mark
When opening the Gui, the zmq send and receiver high water mark is set to 2
instead of default (1000 for zmq library version 4). This is to ensure
fast and large detectors can still see latest data on the gui at the cost of
losing images in between.
When using a different processor or client data call back to handle zmq data,
please ensure this is set back to default to get every zmq packet. Setting it to
-1 sets it to library defaults.
1. Aded settings and threshold features for Mythen3.
3. Resolved Issues
==================
Detector Server
---------------
1. (Eiger) Blocked Server
Very rarely, Eiger control or stop server would block and would require a restart
of server. This is due to both servers accessing the same link to get to FEB
registers. Locking has been implemented in server shared memory to resolve.
Receiver
--------
1. Current code only calls Implementation::setDetectorType from constructor,
but potential memory leak if called out of constructor context. Fixed.
Client
------
1. Fixed missing scanParameters class in Python
2. cmk.sh refactored to have better option handling
4. Known Issues
===============
1. (Eiger) Extra 8 byte Packets
When stopping detector acquisition while acquiring for more than 128 frames,
the next acquisition sends out first an 8 byte packet. This is discarded
by the slsReceiver/slsMultiReceiver. Please handle this in custom receivers.
5. Firmware Requirements
4. Firmware Requirements
========================
Eiger
=====
Compatible version : 08.09.2020 (v27)
Jungfrau
========
Compatible version : 24.07.2020 (v1.1, PCB v1.0)
: 21.07.2020 (v2.1, PCB v2.0)
No updates from 5.0.0
Gotthard
========
Compatible version : 08.02.2018 (50um and 25um Master)
: 09.02.2018 (25 um Slave)
Mythen3
=======
Compatible version : 25.09.2020 (development)
Gotthard2
=========
Compatible version : 25.09.2020 (development)
5. Known Issues
===============
Moench
======
Compatible version : 05.10.2020 (v1.0)
No updates from 5.0.0
Ctb
===
Compatible version : 05.10.2020 (v1.0)
Detector Upgrade
================
The following can be upgraded remotely:
Eiger via bit files
Jungfrau via command <.pof>
Mythen3 via command <.rbf>
Gotthard2 via command <.rbf>
Moench via command <.pof>
Ctb via command <.pof>
The following cannot be upgraded remotely:
Gotthard
Instructions available at
https://slsdetectorgroup.github.io/devdoc/firmware.html
and
https://slsdetectorgroup.github.io/devdoc/serverupgrade.html
6. Download, Documentation & Support
====================================

View File

@ -9,7 +9,7 @@ CMake approaches.
One can test with :ref:`detector simulators<Virtual Detector Servers>` before testing the API with a real detector or when a real detector is not at hand.
CMake: slsDetectorPackage as submodule in your project
---------------------------------------
---------------------------------------------------------------
If you are using CMake to build your integration and want to build everything
in one go, we support adding slsDetectorPackage as a subfolder in your cmake project.

View File

@ -12,32 +12,7 @@ Download
- detector server corresponding to package in slsDetectorPackage/serverBin
- bit files
.. list-table::
:widths: 25 10 30 25 10
:header-rows: 1
* - Software
- Hardware
- Firmware Date
- Firmware Link
- Comments
* - v5.0.0-rcx
-
- 08.09.2020
- `v27 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/eiger/v27/>`__
-
* - v4.0.0 - v4.2.0
-
- 30.07.2019
- `v24 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/eiger/v24/>`__
-
* - v3.1.0 - v3.1.5
-
- 17.08.2017
- `v20 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/eiger/v20/>`__
-
- `bit files <https://github.com/slsdetectorgroup/slsDetectorFirmware>`__
Upgrade
^^^^^^^^
@ -116,37 +91,7 @@ Download
^^^^^^^^^^^^^
- detector server corresponding to package in slsDetectorPackage/serverBin
- pof files
.. list-table::
:widths: 25 10 30 25 10
:header-rows: 1
* - Software
- Hardware
- Firmware Date
- Firmware Link
- Comments
* - v5.0.0-rcx
- 2.0
- 21.07.2020
- `v2.1 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/jungfrau/v2_1/jungfrau_v2_1.pof>`__
-
* - v5.0.0-rcx
- 1.0
- 24.07.2020
- `v1.1 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/jungfrau/v1_1/jungfrau_v1_1.pof>`__
-
* - v4.0.1 - v4.2.0
- 1.0
- 06.12.2018
- `v0.7 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/jungfrau/v0_7/jungfrau_v0_7.pof>`__
-
* - v3.1.0 - v3.1.5
- 1.0
- 13.11.2017
- `v0.6 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/jungfrau/v0_6/jungfrau_v0_6.pof>`__
-
- `pof files <https://github.com/slsdetectorgroup/slsDetectorFirmware>`__
Upgrade (from v4.x.x)
@ -156,7 +101,7 @@ Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you
#. Tftp must be installed on pc.
#. Update client package to the latest (5.0.0-rc1).
#. Update client package to the latest (5.x.x).
#. Disable server respawning or kill old server
.. code-block:: bash
@ -204,7 +149,7 @@ Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you
jungfrauDetectorServervxxx --stop-server 1953
Upgrade (from v5.0.0-rcx)
Upgrade (from v5.0.0)
^^^^^^^^^^^^^^^^^^^^^^^^^^
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
@ -230,31 +175,8 @@ Download
^^^^^^^^^^^^^
- detector server corresponding to package in slsDetectorPackage/serverBin
- pof files
.. list-table::
:widths: 15 15 15 15 5
:header-rows: 1
- `pof files <https://github.com/slsdetectorgroup/slsDetectorFirmware>`__
* - Software
- Hardware
- Firmware Date
- Firmware Link
- Comments
* - All versions
- 50um
- 08.02.2018
- `50um <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/gotthard_I/50um/gotthard_I_50um.pof>`__
-
* - All versions
- 25um (master)
- 08.02.2018
- `25um (master) <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/gotthard_I/25um/master/gotthard_I_25um_master.pof>`__
-
* - All versions
- 25um (slave)
- 09.02.2018
- `25um (slave) <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/gotthard_I/25um/slave/gotthard_I_25um_slave.pof>`__
-
.. _firmware upgrade using blaster for blackfin:
@ -294,24 +216,10 @@ Download
- detector server corresponding to package in slsDetectorPackage/serverBin
- rbf files
.. list-table::
:widths: 25 10 30 25 10
:header-rows: 1
* - Software
- Hardware
- Firmware Date
- Firmware Link
- Comments
* - v5.0.0-rcx
-
- 25.09.2020
-
- development
- rbf files (in developement)
Upgrade (from v5.0.0-rcx)
Upgrade (from v5.0.0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
#. Program from console
@ -337,23 +245,10 @@ Download
^^^^^^^^^^^^^
- detector server corresponding to package in slsDetectorPackage/serverBin
- rbf files
.. list-table::
:widths: 25 10 30 25 10
:header-rows: 1
- rbf files (in development)
* - Software
- Hardware
- Firmware Date
- Firmware Link
- Comments
* - v5.0.0-rcx
-
- 25.09.2020
-
- development
Upgrade (from v5.0.0-rcx)
Upgrade (from v5.0.0)
^^^^^^^^^^^^^^^^^^^^^^^^^^
#. Program from console
@ -375,28 +270,10 @@ Download
^^^^^^^^^^^^^
- detector server corresponding to package in slsDetectorPackage/serverBin
- pof files
.. list-table::
:widths: 25 10 30 25 10
:header-rows: 1
- `pof files <https://github.com/slsdetectorgroup/slsDetectorFirmware>`__
* - Software
- Hardware
- Firmware Date
- Firmware Link
- Comments
* - v5.0.0-rcx
- EPCQ128
- 05.10.2020
- `v1.0 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/moench/EPCQ128/v1_0/moench_v1_0_201005.pof>`__
-
* - v5.0.0-rcx
- EPCS128
- 05.10.2020
- `v1.0 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/moench/EPCS128/v1_0/moench_v1_0_201005.pof>`__
-
Upgrade (from v5.0.0-rcx)
Upgrade (from v5.0.0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
@ -419,28 +296,10 @@ Download
^^^^^^^^^^^^^
- detector server corresponding to package in slsDetectorPackage/serverBin
- pof files
.. list-table::
:widths: 25 10 30 25 10
:header-rows: 1
- `pof files <https://github.com/slsdetectorgroup/slsDetectorFirmware>`__
* - Software
- Hardware
- Firmware Date
- Firmware Link
- Comments
* - v5.0.0-rcx
- EPCQ128
- 05.10.2020
- `v1.0 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/ctb/EPCQ128/v1_0/ctb_v1_0_201005.pof>`__
-
* - v5.0.0-rcx
- EPCS128
- 05.10.2020
- `v1.0 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/ctb/EPCS128/v1_0/ctb_v1_0_201005.pof>`__
-
Upgrade (from v5.0.0-rcx)
Upgrade (from v5.0.0)
^^^^^^^^^^^^^^^^^^^^^^^^^^
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
@ -462,11 +321,12 @@ Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you
Firmware Troubleshooting with blackfin
----------------------------------------
#. v4.x.x client after programming will most likely reboot the blackfin processor, regardless of error.
1. v4.x.x client after programming will most likely reboot the blackfin processor, regardless of error.
#. v5.x.x-rcx client after programming will not reboot the blackfin processor, if error occurred.
2. v5.x.x-rcx client after programming will not reboot the blackfin processor, if error occurred.
3. If a reboot occured with an incomplete firmware in flash, the blackfin will most likely not find the mtd3 drive. To see if this drive exists:
#. If a reboot occured with an incomplete firmware in flash, the blackfin will most likely not find the mtd3 drive. To see if this drive exists:
.. code-block:: bash
# connect to the board
@ -482,7 +342,7 @@ Firmware Troubleshooting with blackfin
4. If one can see the mtd3 drive, one can already try to flash again using the **programfpga** command (without rebooting blackfin or detector).
#. If one can't list it, read the next section to try to get the blackfin to list it.
5. If one can't list it, read the next section to try to get the blackfin to list it.
How to get back mtd3 drive remotely
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,19 +1,16 @@
# find_package (Python COMPONENTS Interpreter Development)
pybind11_add_module(_slsdet
src/main.cpp
src/enums.cpp
src/detector.cpp
src/network.cpp
src/pattern.cpp
src/scan.cpp
)
target_link_libraries(_slsdet PUBLIC
slsDetectorShared
slsReceiverShared
slsSupportShared
${ZeroMQ_LIBRARIES}
)
slsDetectorStatic
)
@ -33,6 +30,7 @@ set( PYTHON_FILES
enums.py
errors.py
gotthard.py
pattern.py
gotthard2.py
moench.py
proxy.py

View File

@ -0,0 +1,14 @@
from slsdet import Detector, patternParameters
d = Detector()
pat = patternParameters()
#Access to members of the structure using numpy arrays
pat.patlimits = 0x0, 0xa
d.setPattern(pat)
#Load pattern from file
pat.load("/some/dir/some.pat")

View File

@ -6,7 +6,7 @@ d = Detector()
d.fformat = fileFormat.BINARY
# Altough not recommended for convenience all enums
# and some other things can be impored using *
# and some other things can be imported using *
from slsdet import *
d.speed = speedLevel.FULL_SPEED
@ -15,6 +15,6 @@ d.speed = speedLevel.FULL_SPEED
import slsdet.enums
for enum in dir(slsdet.enums):
# filter out special memebers
# filter out special members
if not enum.startswith('_'):
print(enum)

View File

@ -0,0 +1,19 @@
from slsdet import Mythen3, scanParameters, dacIndex
#Configure scan
sp = scanParameters()
sp.enable = 1
sp.dacInd = dacIndex.VTH1
sp.startOffset = 0
sp.stopOffset = 1000
sp.stepSize = 100
sp.dacSettleTime_ns = int(1e9)
# Send scan to detector
d = Mythen3()
d.setScan(sp)

View File

@ -10,6 +10,8 @@ from slsdet.lookup import view, find
import slsdet
d = Detector()
e = Eiger()
c = Ctb()

View File

@ -55,7 +55,7 @@ def generate_enum_string(enums):
data.append('.export_values();\n\n')
return ''.join(data)
with open('../../slsSupportLib/include/sls_detector_defs.h') as f:
with open('../../slsSupportLib/include/sls/sls_detector_defs.h') as f:
data = f.read()
data = remove_comments(data)

View File

@ -8,6 +8,8 @@ from .mythen3 import Mythen3
from .gotthard2 import Gotthard2
from .gotthard import Gotthard
from .moench import Moench
from .pattern import Pattern, patternParameters
import _slsdet
xy = _slsdet.xy
@ -18,3 +20,4 @@ from .enums import *
IpAddr = _slsdet.IpAddr
MacAddr = _slsdet.MacAddr
scanParameters = _slsdet.scanParameters

View File

@ -349,7 +349,7 @@ class Detector(CppDetectorApi):
@property
@element
def nframes(self):
def framecounter(self):
"""
[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Number of frames from start run control.
Note
@ -1009,6 +1009,32 @@ class Detector(CppDetectorApi):
ip = ut.make_ip(ip) #Convert from int or string to IpAddr
ut.set_using_dict(self.setClientZmqIp, ip)
@property
def zmqhwm(self):
"""
Client's zmq receive high water mark. Default is the zmq library's default (1000), can also be set here using -1.
This is a high number and can be set to 2 for gui purposes.
One must also set the receiver's send high water mark to similar value. Final effect is sum of them.
Setting it via command line is useful only before zmq enabled (before opening gui).
"""
return self.getClientZmqHwm()
@zmqhwm.setter
def zmqhwm(self, n_frames):
self.setClientZmqHwm(n_frames)
@property
def rx_zmqhwm(self):
"""
Receiver's zmq send high water mark. Default is the zmq library's default (1000). This is a high number and can be set to 2 for gui purposes. One must also set the client's receive high water mark to similar value. Final effect is sum of them. Also restarts receiver zmq streaming if enabled. Can set to -1 to set default value.
"""
return self.getRxZmqHwm()
@rx_zmqhwm.setter
def rx_zmqhwm(self, n_frames):
self.setRxZmqHwm(n_frames)
@property
@element
def udp_dstip(self):
@ -1499,7 +1525,7 @@ class Detector(CppDetectorApi):
@property
@element
def timestamp(self):
def frametime(self):
"""[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Timestamp at a frame start.
Note
----
@ -1670,6 +1696,8 @@ class Detector(CppDetectorApi):
To change settings as well or set threshold without trimbits, use setThresholdEnergy.
:setter: It loads trim files from settingspath.
"""
if self.type == detectorType.MYTHEN3:
return self.getAllThresholdEnergy()
return self.getThresholdEnergy()
@threshold.setter
@ -1965,7 +1993,7 @@ class Detector(CppDetectorApi):
@property
@element
def now(self):
def runtime(self):
"""[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Time from detector start up.
Note
-----
@ -3079,6 +3107,14 @@ class Detector(CppDetectorApi):
"""
return ClkFreqProxy(self)
def readout(self):
"""
Mythen3] Starts detector readout. Status changes to TRANSMITTING and automatically returns to idle at the end of readout.
"""
self.startDetectorReadout()
"""
---------------------------<<<Debug>>>---------------------------
"""

53
python/slsdet/pattern.py Normal file
View File

@ -0,0 +1,53 @@
import _slsdet
from _slsdet import Pattern
class patternParameters(_slsdet.patternParameters):
def __init__(self):
super().__init__()
self.view = self.numpy_view()
self.names = self.view.dtype.names
def __getattr__(self, name):
if name in self.names:
return self.view[name][0]
else:
raise KeyError(f"Key: {name} not found")
def __setattr__(self, name, value):
if name in ["view", "names"]:
self.__dict__[name] = value
elif name in self.names:
self.view[name] = value
else:
raise KeyError(f"Key: {name} not found")
# Provide custom dir for tab completion
def __dir__(self):
return self.names
class Pattern(_slsdet.Pattern):
def __init__(self):
super().__init__()
self.view = self.data().numpy_view()
self.names = self.view.dtype.names
def __getattr__(self, name):
if name in self.names:
return self.view[name][0]
else:
raise KeyError(f"Key: {name} not found")
def __setattr__(self, name, value):
if name in ["view", "names"]:
self.__dict__[name] = value
elif name in self.names:
self.view[name] = value
else:
raise KeyError(f"Key: {name} not found")
# Provide custom dir for tab completion
def __dir__(self):
return self.names

View File

@ -102,6 +102,34 @@ void init_det(py::module &m) {
(void (Detector::*)(defs::detectorSettings, sls::Positions)) &
Detector::setSettings,
py::arg(), py::arg() = Positions{})
.def("getThresholdEnergy",
(Result<int>(Detector::*)(sls::Positions) const) &
Detector::getThresholdEnergy,
py::arg() = Positions{})
.def("getAllThresholdEnergy",
(Result<std::array<int, 3>>(Detector::*)(sls::Positions) const) &
Detector::getAllThresholdEnergy,
py::arg() = Positions{})
.def("setThresholdEnergy",
(void (Detector::*)(int, defs::detectorSettings, bool,
sls::Positions)) &
Detector::setThresholdEnergy,
py::arg(), py::arg() = defs::STANDARD, py::arg() = true,
py::arg() = Positions{})
.def("setThresholdEnergy",
(void (Detector::*)(std::array<int, 3>, defs::detectorSettings,
bool, sls::Positions)) &
Detector::setThresholdEnergy,
py::arg(), py::arg() = defs::STANDARD, py::arg() = true,
py::arg() = Positions{})
.def("getSettingsPath",
(Result<std::string>(Detector::*)(sls::Positions) const) &
Detector::getSettingsPath,
py::arg() = Positions{})
.def("setSettingsPath",
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::setSettingsPath,
py::arg(), py::arg() = Positions{})
.def("loadTrimbits",
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::loadTrimbits,
@ -114,12 +142,24 @@ void init_det(py::module &m) {
(void (Detector::*)(int, sls::Positions)) &
Detector::setAllTrimbits,
py::arg(), py::arg() = Positions{})
.def("getTrimEnergies",
(Result<std::vector<int>>(Detector::*)(sls::Positions) const) &
Detector::getTrimEnergies,
py::arg() = Positions{})
.def("setTrimEnergies",
(void (Detector::*)(std::vector<int>, sls::Positions)) &
Detector::setTrimEnergies,
py::arg(), py::arg() = Positions{})
.def("getGapPixelsinCallback",
(bool (Detector::*)() const) & Detector::getGapPixelsinCallback)
.def("setGapPixelsinCallback",
(void (Detector::*)(const bool)) &
Detector::setGapPixelsinCallback,
py::arg())
.def("isVirtualDetectorServer",
(Result<bool>(Detector::*)(sls::Positions) const) &
Detector::isVirtualDetectorServer,
py::arg() = Positions{})
.def("registerAcquisitionFinishedCallback",
(void (Detector::*)(void (*)(double, int, void *), void *)) &
Detector::registerAcquisitionFinishedCallback,
@ -314,6 +354,9 @@ void init_det(py::module &m) {
py::arg(), py::arg() = Positions{})
.def("getDacList", (std::vector<defs::dacIndex>(Detector::*)() const) &
Detector::getDacList)
.def("setDefaultDacs",
(void (Detector::*)(sls::Positions)) & Detector::setDefaultDacs,
py::arg() = Positions{})
.def("getDAC",
(Result<int>(Detector::*)(defs::dacIndex, bool, sls::Positions)
const) &
@ -356,6 +399,8 @@ void init_det(py::module &m) {
.def("startReceiver", (void (Detector::*)()) & Detector::startReceiver)
.def("stopReceiver", (void (Detector::*)()) & Detector::stopReceiver)
.def("startDetector", (void (Detector::*)()) & Detector::startDetector)
.def("startDetectorReadout",
(void (Detector::*)()) & Detector::startDetectorReadout)
.def("stopDetector", (void (Detector::*)()) & Detector::stopDetector)
.def("getDetectorStatus",
(Result<defs::runStatus>(Detector::*)(sls::Positions) const) &
@ -599,15 +644,15 @@ void init_det(py::module &m) {
Detector::setPartialFramesPadding,
py::arg(), py::arg() = Positions{})
.def("getRxUDPSocketBufferSize",
(Result<int64_t>(Detector::*)(sls::Positions) const) &
(Result<int>(Detector::*)(sls::Positions) const) &
Detector::getRxUDPSocketBufferSize,
py::arg() = Positions{})
.def("setRxUDPSocketBufferSize",
(void (Detector::*)(int64_t, sls::Positions)) &
(void (Detector::*)(int, sls::Positions)) &
Detector::setRxUDPSocketBufferSize,
py::arg(), py::arg() = Positions{})
.def("getRxRealUDPSocketBufferSize",
(Result<int64_t>(Detector::*)(sls::Positions) const) &
(Result<int>(Detector::*)(sls::Positions) const) &
Detector::getRxRealUDPSocketBufferSize,
py::arg() = Positions{})
.def("getRxLock",
@ -747,6 +792,17 @@ void init_det(py::module &m) {
(void (Detector::*)(const sls::IpAddr, sls::Positions)) &
Detector::setClientZmqIp,
py::arg(), py::arg() = Positions{})
.def("getClientZmqHwm",
(int (Detector::*)() const) & Detector::getClientZmqHwm)
.def("setClientZmqHwm",
(void (Detector::*)(const int)) & Detector::setClientZmqHwm,
py::arg())
.def("getRxZmqHwm",
(Result<int>(Detector::*)(sls::Positions) const) &
Detector::getRxZmqHwm,
py::arg() = Positions{})
.def("setRxZmqHwm",
(void (Detector::*)(const int)) & Detector::setRxZmqHwm, py::arg())
.def("getSubExptime",
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
Detector::getSubExptime,
@ -763,24 +819,6 @@ void init_det(py::module &m) {
(void (Detector::*)(sls::ns, sls::Positions)) &
Detector::setSubDeadTime,
py::arg(), py::arg() = Positions{})
.def("getThresholdEnergy",
(Result<int>(Detector::*)(sls::Positions) const) &
Detector::getThresholdEnergy,
py::arg() = Positions{})
.def("setThresholdEnergy",
(void (Detector::*)(int, defs::detectorSettings, bool,
sls::Positions)) &
Detector::setThresholdEnergy,
py::arg(), py::arg() = defs::STANDARD, py::arg() = true,
py::arg() = Positions{})
.def("getSettingsPath",
(Result<std::string>(Detector::*)(sls::Positions) const) &
Detector::getSettingsPath,
py::arg() = Positions{})
.def("setSettingsPath",
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::setSettingsPath,
py::arg(), py::arg() = Positions{})
.def("getOverFlowMode",
(Result<bool>(Detector::*)(sls::Positions) const) &
Detector::getOverFlowMode,
@ -796,14 +834,6 @@ void init_det(py::module &m) {
.def("setBottom",
(void (Detector::*)(bool, sls::Positions)) & Detector::setBottom,
py::arg(), py::arg() = Positions{})
.def("getTrimEnergies",
(Result<std::vector<int>>(Detector::*)(sls::Positions) const) &
Detector::getTrimEnergies,
py::arg() = Positions{})
.def("setTrimEnergies",
(void (Detector::*)(std::vector<int>, sls::Positions)) &
Detector::setTrimEnergies,
py::arg(), py::arg() = Positions{})
.def("getRateCorrection",
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
Detector::getRateCorrection,
@ -1251,9 +1281,17 @@ void init_det(py::module &m) {
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::setPattern,
py::arg(), py::arg() = Positions{})
.def("setPattern",
(void (Detector::*)(const sls::Pattern &, sls::Positions)) &
Detector::setPattern,
py::arg(), py::arg() = Positions{})
.def("savePattern",
(void (Detector::*)(const std::string &)) & Detector::savePattern,
py::arg())
.def("loadDefaultPattern",
(void (Detector::*)(sls::Positions)) &
Detector::loadDefaultPattern,
py::arg() = Positions{})
.def("getPatternIOControl",
(Result<uint64_t>(Detector::*)(sls::Positions) const) &
Detector::getPatternIOControl,

View File

@ -2,10 +2,12 @@
* warning */
#include <pybind11/chrono.h>
#include <pybind11/numpy.h>
#include <pybind11/operators.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "sls/Pattern.h"
#include "sls/sls_detector_defs.h"
namespace py = pybind11;
void init_enums(py::module &m) {

View File

@ -1,18 +1,19 @@
#include <pybind11/chrono.h>
#include <pybind11/numpy.h>
#include <pybind11/operators.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "sls/sls_detector_defs.h"
#include "sls/Pattern.h"
namespace py = pybind11;
void init_enums(py::module &m) {
py::class_<slsDetectorDefs> Defs(m, "slsDetectorDefs");
py::class_<slsDetectorDefs::xy> xy(m, "xy");
xy.def(py::init());
xy.def(py::init<int,int>());
xy.def(py::init<int, int>());
xy.def_readwrite("x", &slsDetectorDefs::xy::x);
xy.def_readwrite("y", &slsDetectorDefs::xy::y);
[[ENUMS]]
[[ENUMS]]
}

View File

@ -19,6 +19,8 @@ void init_enums(py::module &);
void init_experimental(py::module &);
void init_det(py::module &);
void init_network(py::module &);
void init_pattern(py::module &);
void init_scan(py::module &);
PYBIND11_MODULE(_slsdet, m) {
m.doc() = R"pbdoc(
C/C++ API
@ -33,6 +35,8 @@ PYBIND11_MODULE(_slsdet, m) {
init_enums(m);
init_det(m);
init_network(m);
init_pattern(m);
init_scan(m);
// init_experimental(m);

29
python/src/pattern.cpp Normal file
View File

@ -0,0 +1,29 @@
#include <pybind11/chrono.h>
#include <pybind11/numpy.h>
#include <pybind11/operators.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "sls/Pattern.h"
#include "sls/sls_detector_defs.h"
namespace py = pybind11;
void init_pattern(py::module &m) {
using pat = sls::patternParameters;
py::class_<pat> patternParameters(m, "patternParameters");
PYBIND11_NUMPY_DTYPE(pat, word, ioctrl, limits, loop, nloop, wait,
waittime);
patternParameters.def(py::init());
patternParameters.def("numpy_view", [](py::object &obj) {
pat &o = obj.cast<pat &>();
return py::array_t<pat>(1, &o, obj);
});
py::class_<sls::Pattern> Pattern(m, "Pattern");
Pattern.def(py::init());
Pattern.def("load", &sls::Pattern::load);
Pattern.def("data", (pat * (sls::Pattern::*)()) & sls::Pattern::data,
py::return_value_policy::reference);
}

39
python/src/scan.cpp Normal file
View File

@ -0,0 +1,39 @@
#include <pybind11/chrono.h>
#include <pybind11/numpy.h>
#include <pybind11/operators.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <sstream>
#include "sls/sls_detector_defs.h"
namespace py = pybind11;
void init_scan(py::module &m) {
using sp = slsDetectorDefs::scanParameters;
py::class_<sp> scanParameters(m, "scanParameters");
scanParameters.def(py::init());
scanParameters.def(py::init<slsDetectorDefs::dacIndex, int, int, int>());
scanParameters.def(py::init<slsDetectorDefs::dacIndex, int, int, int, std::chrono::nanoseconds>());
scanParameters.def_readwrite("enable", &sp::enable);
scanParameters.def_readwrite("dacInd", &sp::dacInd);
scanParameters.def_readwrite("startOffset", &sp::startOffset);
scanParameters.def_readwrite("stopOffset", &sp::stopOffset);
scanParameters.def_readwrite("stepSize", &sp::stepSize);
scanParameters.def_readwrite("dacSettleTime_ns", &sp::dacSettleTime_ns);
scanParameters.def("__repr__", [](const sp &a){
std::ostringstream oss;
auto indent = " ";
oss << "<scanParameters>\n";
oss << indent << "enable: " << a.enable << '\n';
oss << indent << "dacInd: " << a.dacInd << '\n';
oss << indent << "startOffset: " << a.startOffset << '\n';
oss << indent << "stopOffset: " << a.stopOffset << '\n';
oss << indent << "stepSize: " << a.stepSize << '\n';
oss << indent << "dacSettleTime_ns: " << a.dacSettleTime_ns;
return oss.str();
});
}

View File

@ -0,0 +1 @@
../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer

View File

@ -1 +0,0 @@
../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv5.0.0

View File

@ -0,0 +1 @@
../slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer

View File

@ -1 +0,0 @@
../slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv5.0.0

View File

@ -0,0 +1 @@
../slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer

View File

@ -1 +0,0 @@
../slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv5.0.0

View File

@ -0,0 +1 @@
../slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer

View File

@ -1 +0,0 @@
../slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServerv5.0.0

View File

@ -0,0 +1 @@
../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer

View File

@ -1 +0,0 @@
../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv5.0.0

View File

@ -0,0 +1 @@
../slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer

View File

@ -1 +0,0 @@
../slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv5.0.0

View File

@ -0,0 +1 @@
../slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer

View File

@ -1 +0,0 @@
../slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServerv5.0.0

View File

@ -1 +0,0 @@
800 10

View File

@ -1 +0,0 @@
829 9.3

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
800 10

View File

@ -1 +0,0 @@
804 15.0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
800 10

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
817 11.6

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -32,17 +32,23 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="2">
<widget class="QSpinBox" name="spinThreshold">
<item row="1" column="4">
<widget class="QSpinBox" name="spinThreshold3">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<width>140</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
@ -63,10 +69,69 @@
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer">
<item row="1" column="2">
<widget class="QSpinBox" name="spinThreshold">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string> eV</string>
</property>
<property name="minimum">
<number>-100000</number>
</property>
<property name="maximum">
<number>100000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>-1</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lblDynamicRange">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>110</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Dynamic Range:</string>
</property>
</widget>
</item>
<item row="3" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
@ -74,7 +139,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
<height>190</height>
</size>
</property>
</spacer>
@ -86,10 +151,16 @@
</property>
<property name="minimumSize">
<size>
<width>0</width>
<width>140</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<item>
<property name="text">
<string>1.67772e+07</string>
@ -112,21 +183,102 @@
</item>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="1" column="6">
<widget class="QPushButton" name="btnSetThreshold">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeHint" stdset="0">
<property name="minimumSize">
<size>
<width>20</width>
<height>20</height>
<width>100</width>
<height>30</height>
</size>
</property>
</spacer>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>20</green>
<blue>20</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>20</green>
<blue>20</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>20</green>
<blue>20</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
<property name="text">
<string>Set</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/rightArrow.png</normaloff>:/icons/images/rightArrow.png</iconset>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblSettings">
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
<width>110</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Settings:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="comboSettings">
@ -141,10 +293,16 @@
</property>
<property name="minimumSize">
<size>
<width>0</width>
<width>140</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Settings of the detector.
#settings#</string>
@ -266,40 +424,10 @@
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblThreshold">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Threshold:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lblDynamicRange">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Dynamic Range:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblSettings">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Settings:</string>
</property>
</widget>
</item>
<item row="3" column="2">
<spacer name="verticalSpacer">
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
@ -307,7 +435,82 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>190</height>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblThreshold">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>110</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Threshold:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QSpinBox" name="spinThreshold2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string> eV</string>
</property>
<property name="minimum">
<number>-100000</number>
</property>
<property name="maximum">
<number>100000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>-1</number>
</property>
</widget>
</item>
<item row="1" column="7">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
@ -317,6 +520,9 @@
<tabstops>
<tabstop>comboSettings</tabstop>
<tabstop>spinThreshold</tabstop>
<tabstop>spinThreshold2</tabstop>
<tabstop>spinThreshold3</tabstop>
<tabstop>btnSetThreshold</tabstop>
<tabstop>comboDynamicRange</tabstop>
</tabstops>
<resources>

View File

@ -14,6 +14,7 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
void SetSettings(int index);
void SetDynamicRange(int index);
void SetThresholdEnergy(int index);
void SetThresholdEnergies();
private:
void SetupWidgetWindow();
@ -23,6 +24,7 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
void GetSettings();
void GetDynamicRange();
void GetThresholdEnergy();
void GetThresholdEnergies();
sls::Detector *det;
enum {

View File

@ -14,14 +14,24 @@ qTabSettings::~qTabSettings() {}
void qTabSettings::SetupWidgetWindow() {
spinThreshold2->hide();
spinThreshold3->hide();
btnSetThreshold->hide();
btnSetThreshold->setEnabled(false);
// enabling according to det type
slsDetectorDefs::detectorType detType = det->getDetectorType().squash();
if (detType == slsDetectorDefs::MYTHEN3) {
lblSettings->setEnabled(false);
comboSettings->setEnabled(false);
lblDynamicRange->setEnabled(true);
comboDynamicRange->setEnabled(true);
spinThreshold2->show();
spinThreshold3->show();
lblThreshold->setEnabled(true);
spinThreshold->setEnabled(true);
spinThreshold2->setEnabled(true);
spinThreshold3->setEnabled(true);
btnSetThreshold->setEnabled(true);
btnSetThreshold->show();
// disable dr
QStandardItemModel *model =
qobject_cast<QStandardItemModel *>(comboDynamicRange->model());
@ -34,7 +44,6 @@ void qTabSettings::SetupWidgetWindow() {
item = model->itemFromIndex(index);
item->setEnabled(false);
}
} else if (detType == slsDetectorDefs::EIGER) {
lblDynamicRange->setEnabled(true);
comboDynamicRange->setEnabled(true);
@ -48,6 +57,10 @@ void qTabSettings::SetupWidgetWindow() {
SetupDetectorSettings();
}
spinThreshold->setValue(-1);
if (detType == slsDetectorDefs::MYTHEN3) {
spinThreshold2->setValue(-1);
spinThreshold3->setValue(-1);
}
Initialization();
// default for the disabled
GetDynamicRange();
@ -104,6 +117,11 @@ void qTabSettings::SetupDetectorSettings() {
item[(int)G4_HIGHGAIN]->setEnabled(true);
item[(int)G4_LOWGAIN]->setEnabled(true);
break;
case slsDetectorDefs::MYTHEN3:
item[(int)STANDARD]->setEnabled(true);
item[(int)FAST]->setEnabled(true);
item[(int)HIGHGAIN]->setEnabled(true);
break;
default:
LOG(logDEBUG) << "Unknown detector type. Exiting GUI.";
qDefs::Message(qDefs::CRITICAL,
@ -126,7 +144,13 @@ void qTabSettings::Initialization() {
SLOT(SetDynamicRange(int)));
// Threshold
if (spinThreshold->isEnabled())
// m3
if (btnSetThreshold->isEnabled()) {
connect(btnSetThreshold, SIGNAL(clicked()), this,
SLOT(SetThresholdEnergies()));
}
// eiger
else if (spinThreshold->isEnabled())
connect(spinThreshold, SIGNAL(valueChanged(int)), this,
SLOT(SetThresholdEnergy(int)));
}
@ -169,7 +193,7 @@ void qTabSettings::SetSettings(int index) {
CATCH_HANDLE("Could not set settings.", "qTabSettings::SetSettings", this,
&qTabSettings::GetSettings)
// threshold
if (spinThreshold->isEnabled()) {
if (det->getDetectorType().squash() == slsDetectorDefs::EIGER) {
SetThresholdEnergy(spinThreshold->value());
}
}
@ -233,6 +257,23 @@ void qTabSettings::SetDynamicRange(int index) {
&qTabSettings::GetDynamicRange)
}
void qTabSettings::GetThresholdEnergies() {
LOG(logDEBUG) << "Getting theshold energies";
disconnect(btnSetThreshold, SIGNAL(clicked()), this,
SLOT(SetThresholdEnergies()));
try {
auto retval = det->getAllThresholdEnergy().tsquash(
"Inconsistent threhsold energies for all detectors.");
spinThreshold->setValue(retval[0]);
spinThreshold2->setValue(retval[1]);
spinThreshold3->setValue(retval[2]);
}
CATCH_DISPLAY("Could not get threshold energy.",
"qTabDataOutput::GetThresholdEnergies")
connect(btnSetThreshold, SIGNAL(clicked()), this,
SLOT(SetThresholdEnergies()));
}
void qTabSettings::GetThresholdEnergy() {
LOG(logDEBUG) << "Getting theshold energy";
disconnect(spinThreshold, SIGNAL(valueChanged(int)), this,
@ -248,6 +289,23 @@ void qTabSettings::GetThresholdEnergy() {
SLOT(SetThresholdEnergy(int)));
}
void qTabSettings::SetThresholdEnergies() {
std::array<int, 3> eV = {spinThreshold->value(), spinThreshold2->value(),
spinThreshold3->value()};
slsDetectorDefs::detectorSettings sett =
static_cast<slsDetectorDefs::detectorSettings>(
comboSettings->currentIndex());
LOG(logINFO) << "Setting Threshold Energies to " << sls::ToString(eV)
<< " (eV)";
try {
det->setThresholdEnergy(eV, sett);
}
CATCH_DISPLAY("Could not get threshold energies.",
"qTabSettings::SetThresholdEnergies")
// set the right value anyway (due to tolerance)
GetThresholdEnergies();
}
void qTabSettings::SetThresholdEnergy(int index) {
LOG(logINFO) << "Setting Threshold Energy to " << index << " eV";
try {
@ -270,8 +328,14 @@ void qTabSettings::Refresh() {
GetDynamicRange();
}
if (spinThreshold->isEnabled())
// m3
if (btnSetThreshold->isEnabled())
GetThresholdEnergies();
// eiger
else if (spinThreshold->isEnabled()) {
LOG(logINFOBLUE) << "calling it!";
GetThresholdEnergy();
}
LOG(logDEBUG) << "**Updated Settings Tab";
}

View File

@ -22,6 +22,7 @@ add_executable(ctbDetectorServer_virtual
include_directories(
../slsDetectorServer/include
../../slsSupportLib/include
../../slsDetectorSoftware/include/sls/
)
target_include_directories(ctbDetectorServer_virtual

View File

@ -2,10 +2,11 @@ current_dir = $(shell pwd)
main_inc = ../slsDetectorServer/include/
main_src = ../slsDetectorServer/src/
support_lib = ../../slsSupportLib/include/
det_lib = ../../slsDetectorSoftware/include/sls/
CROSS = bfin-uclinux-
CC = $(CROSS)gcc
CFLAGS += -Wall -std=gnu99 -DCHIPTESTBOARDD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(current_dir) #-DDEBUG1 #-DVERBOSEI #-DVERBOSE
CFLAGS += -Wall -std=gnu99 -DCHIPTESTBOARDD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(det_lib) -I$(current_dir) #-DDEBUG1 #-DVERBOSEI #-DVERBOSE
LDLIBS += -lm -lrt -pthread
PROGS = ctbDetectorServer
DESTDIR ?= bin

View File

@ -669,7 +669,9 @@ void allocateDetectorStructureMemory() {
(detectorModules)->reg = 0;
(detectorModules)->iodelay = 0;
(detectorModules)->tau = 0;
(detectorModules)->eV = 0;
(detectorModules)->eV[0] = 0;
(detectorModules)->eV[1] = 0;
(detectorModules)->eV[2] = 0;
thisSettings = UNINITIALIZED;
// if trimval requested, should return -1 to acknowledge unknown
@ -1090,8 +1092,8 @@ int setModule(sls_detector_module myMod, char *mess) {
}
// threshold
if (myMod.eV >= 0)
setThresholdEnergy(myMod.eV);
if (myMod.eV[0] >= 0)
setThresholdEnergy(myMod.eV[0]);
else {
// (loading a random trim file) (dont return fail)
setSettings(UNDEFINED);
@ -2554,8 +2556,8 @@ int copyModule(sls_detector_module *destMod, sls_detector_module *srcMod) {
destMod->iodelay = srcMod->iodelay;
if (srcMod->tau >= 0)
destMod->tau = srcMod->tau;
if (srcMod->eV >= 0)
destMod->eV = srcMod->eV;
if (srcMod->eV[0] >= 0)
destMod->eV[0] = srcMod->eV[0];
LOG(logDEBUG1, ("Copying register %x (%x)\n", destMod->reg, srcMod->reg));
if (destMod->nchan != 0) {

View File

@ -409,9 +409,9 @@ void setupDetector() {
// pll defines
ALTERA_PLL_C10_SetDefines(REG_OFFSET, BASE_READOUT_PLL, BASE_SYSTEM_PLL,
PLL_RESET_REG, PLL_RESET_REG,
PLL_RESET_READOUT_MSK, PLL_RESET_SYSTEM_MSK,
READOUT_PLL_VCO_FREQ_HZ, SYSTEM_PLL_VCO_FREQ_HZ);
PLL_RESET_REG, PLL_RESET_READOUT_MSK,
PLL_RESET_SYSTEM_MSK, READOUT_PLL_VCO_FREQ_HZ,
SYSTEM_PLL_VCO_FREQ_HZ);
ALTERA_PLL_C10_ResetPLL(READOUT_PLL);
ALTERA_PLL_C10_ResetPLL(SYSTEM_PLL);
// hv

View File

@ -20,6 +20,7 @@ add_executable(moenchDetectorServer_virtual
include_directories(
../slsDetectorServer/include
../../slsSupportLib/include
../../slsDetectorSoftware/include/sls/
)
target_include_directories(moenchDetectorServer_virtual

View File

@ -2,10 +2,11 @@ current_dir = $(shell pwd)
main_inc = ../slsDetectorServer/include/
main_src = ../slsDetectorServer/src/
support_lib = ../../slsSupportLib/include/
det_lib = ../../slsDetectorSoftware/include/sls/
CROSS = bfin-uclinux-
CC = $(CROSS)gcc
CFLAGS += -Wall -std=gnu99 -DMOENCHD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(current_dir)#-DVERBOSEI #-DVERBOSE
CFLAGS += -Wall -std=gnu99 -DMOENCHD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(det_lib) -I$(current_dir)#-DVERBOSEI #-DVERBOSE
LDLIBS += -lm -lrt -pthread
PROGS = moenchDetectorServer
DESTDIR ?= bin

Some files were not shown because too many files have changed in this diff Show More