Compare commits

..

459 Commits

Author SHA1 Message Date
641b40ffe0 fixed zmq path when building as submodule 2024-01-12 09:18:12 +01:00
bd1a125154 moench default speed set to after init readout configuration (half speed) (#886) 2024-01-11 18:07:34 +01:00
ffe7728966 formatting 2024-01-11 18:04:19 +01:00
b69e053bb4 updated commands generation 2024-01-11 18:03:34 +01:00
daec0dc389 minor 2024-01-11 18:02:30 +01:00
c8bb70f876 Dev/xilinx defaults and pattern (#888)
* implemented testbus, testfpga, set/get #frames, triggers, allowed that and for connection to client, also allowed, getnumchannels, configuremac, getrunstatus, setdetectorposition with dummy values

* connected kernelversion, hardwareversion, versions, framesl, triggersl, dr, timingmode, pattern (except patioctrl) thats there for altera ctb

* replaced set/get64Bit to set/getU64bit in all loadpattern.c for (ctb and m3 also)
2024-01-11 18:01:08 +01:00
9a08ecc5a5 Xilinx client tests (#887)
* implemented testbus, testfpga, set/get #frames, triggers, allowed that and for connection to client, also allowed, getnumchannels, configuremac, getrunstatus, setdetectorposition with dummy values

* allowing tests for xilinx

* binaries in
2024-01-10 16:23:52 +01:00
9738cb7d74 Xilinx ctb (#884)
* updated registers, arm64

* compiler set to aarch64 for xilinx server

* updated RegisterDefs.h

* merge into generate branch and resolving conflicts and adding the xilinx changes to callerspecial and commands.yaml

* compiles and can print firmware version (using a different csp0 address)

* fixing other servers (gotthard, jungfrau, moench, mythen3) that it returns in case of mapping failure, xilinxctb: added that it checks type, prints proper fw version, checks kernel date, added armprocessor define to use in common places, added specifiers to supress overflow and truncation warnings

* added detector ip and mac adddress to the printout

* fixed tests and recompiled servers
2024-01-04 17:10:16 +01:00
4f4125a3b2 Generate commands/fix detp detg command rename (#882)
* replacing detp with sls_Detector_put and detg with sls_detector_get

* sls_detector_not implemented, but extended message to ask user to use sls_detector_get or sls_detector_put

* autocompletion also for sls_detector or det
2023-12-13 17:01:10 +01:00
51412f40cf Generate commands/fix det command rename (#881)
* made a link to bash autocompletion script in main folder, and replaced all references to 'det' command with 'sls_detector'
2023-12-13 15:38:10 +01:00
ce7270e8a2 commands code generation (#871)
* commands code generation  (#803)

* commands code generation for only frames command

* fix cmake file and add Caller files

* working exptime, fully extended commands file and its variants

* start adding template commands

* add INT_CMD_VEC_ID template

* add list command, generate multiple bins, format code

* reach 208 commands using the cpp macros

* add tests for command parser

* start adding tests for commands parser

* fix typo to use commands.yaml

* add more tests for command_parser

* add all template functions (up to 218 commands)

* finish template functions and add more CmdProxy.cpp functions (250+)

* 257 commands

* 300 commands the rest are very special commands

* add special commands without generation

* separate special functions from generated c++ file

* implementing one command for put and get (buggy)

* add infer action in a separate file

* generate header for special commands from yaml

* allow only 0 or 1 for bool inputs

* group all commands in gen_commands.py

* add help to gen_commands.py

* add autocomplete bash script

* autocompletion: add support for module levels and help

* remove debugging line

* add autocompletion, help to commands, change int [0,1] to bool

* copy tests for Caller.cpp. Tests pass

* update with the new developer branch changes

* fix errors after merging (there is problems with tests)

* fixed port/stopport in yaml (intput typo), added '_caller' to the test dac and test on chip dac command in global test for cmdcaller

* undo previous test simulator debug change

* add documentation for the generated code

* reducing the comment to be replaced in length so formatting does not split into 2 lines

* removed formatting specific style of C++11 in gen_commands.py to keep with the top level clang format of the project
* regeneratign code for commands

* automation generated

* Redirect deprecated commands (#872)

* working implementation, need to fix dac

* fixed deprecation redirect for dac command

* Detector specific autocomplete (#873)

* working implementation, need to fix dac

* fixed deprecation redirect for dac command

* detector specific completion for dac

* added autocomplete using detector specific

* fixed error when autocompleting partial words

* Generate commands/fix commands (#875)

* fix vm_a, im_a etc have deg Celsius suffix, also help missing or changed in some places

* dac: require det id for all, arg0 to be printed at output, help for onchip dac and dac, onchipdac: spacing

* getscan detid and blocking trigger help

* udp_Dstlist det_id fixed, but rx_id invalid

* cmdApp in line with cmdLineApp (missing version, receiver_id, not creating det object in help action

* added set_command to differentiate between check_det_id and require_det_id (mixed up), args: -1 needs to check for at least one argument

* reordering

* reordering and checked till integer_command_hex

* fixed a lot more commands

* fix caller tests for eiger

* changes to tests after Bechir left

* changing .cmd to .cmdcall for the caller commands

* fixed tests for caller, still warning for setexptime about cast input

* autocomplete ran

* add moench test

* regenerating autocomplete and commands

* fixing other things from merge conflicts (renaming slsDetectorDefs to defs in commands.yaml)

* formatting

* added code injection to help (#876)

* updated 3 commands to have get output that can be put into put (#877)

* updated some commands to have get output that can be put into put

* fix tests for clkdiv

* adding help to free (#878)

* removing old commands and renaming them, (also making it work for parameters command as it was still calling cmdproxy) (#879)

* More helpful error messages for unsupported actions (#880)

* removing old commands and renaming them, (also making it work for parameters command as it was still calling cmdproxy)

* Added specific help for unsupported actions

* fixed a vetofile get special exception message. more specific warning for special exception message instead of no function warning

* added condition checking true in exceptions for special message

---------
Co-authored-by: Bechir Brahem <bachbrahem@gmail.com>
Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2023-12-13 14:43:38 +01:00
d72c9e29a4 dev: moench: min exptime (#865)
* moench: remove min clock cycles for setting exptime (had been ported from jf)
2023-11-27 15:22:16 +01:00
62dc0e1a34 removed zmq as dependency for slsdet (#870) 2023-11-24 09:09:29 +01:00
d7aa3305d1 forward declare zmq_msg_t and moved include (#869)
* forward declare zmq_msg_t and moved include

* removed zmq from pkg list
2023-11-20 11:43:30 +01:00
96ed74c47c formatting 2023-11-12 15:35:05 +01:00
4198db8365 documentation and examples 2023-11-12 15:34:58 +01:00
e2d7af28dc added python 3.12 to the conda build variants 2023-11-10 17:34:39 +01:00
66d57c1852 fixed doc 2023-11-10 17:34:32 +01:00
aa4bf6e7f9 updating docs 2023-11-10 17:34:28 +01:00
7f0868f344 minor fix for test_simulator 2023-11-10 11:39:03 +01:00
e57cf49c49 Dev: trigger signal issues handled at acquire (#864)
* if blocking and handling sync, only master gets blocking acq, slaves get non blocking as they are first and so dont get status or error caught when slaves dont get trigger (due to not connected etc) and acq returns with slaves still in waiting status. so check status of all in blocking acq

* for all dets with sync, ensure atleast one master when starting acq

* docs updated about sync
2023-11-10 11:38:06 +01:00
66baaf1ebd dev: fix server logic in checking detector idle (#861)
* fix buggy logic in checking detector idle and an argument check
2023-11-09 15:07:34 +01:00
7d7ac26c30 execute command inside server fixed (from fix simulator tests and exec command PR) (#857) 2023-11-08 09:26:11 +01:00
1a7c74fe4e tests for jf (#835) 2023-11-07 15:01:22 +01:00
01e4bcb47e formatting 2023-11-07 14:52:14 +01:00
397e846509 Dev: fix py virtual test (#846)
* draft to fix virtual test when it fails

* catching errors in tests and removing sigchild ignore so servers (process in background) executing commands will not fail (pclose no child processes, if sigchld is ignored) fixed

* uncommented python loading config

* somehow killal slsReciever in second detector test fails even though no receiver running

* fixing script for virtual simlator test:fixed issue with check if process running, fixed moench tests
2023-11-07 09:30:46 +01:00
314a8a0daa handling inconsistent fnums to be -1 in gui, so when one sets 0 (change of value) will also give an exception (#854) 2023-11-06 16:11:52 +01:00
ebb352b13a Dev: : gui acq finished callback for different status (#850)
* fix acquisition finished status to have different status for different modules, but does not have to be error. for eg. jf sync fw (2.4.1 gives idle for master and stopped for slaves when stopping acquiistion)
2023-11-06 16:08:07 +01:00
9b5d44f0b3 fix warning for prev_val (variable size array) in tests (#838) 2023-10-23 15:56:22 +02:00
1892963fcb eiger required fw version to 32: fix for blocking trigger in quad (#834) 2023-10-18 17:04:39 +02:00
62f45b15d2 dev jf: reconfigure chip when touching electron collection mode bit (#831)
* jf: if bit 14 in reg 0x5d (electron mode collection bit) is changed, configure chip if v1.1 and powered on. so touch writeregister (setbit/clearbit also calls write register in the end). replace when electroncollectionmode command introduced
2023-10-18 10:52:22 +02:00
82ac45873c dev jf: change status reg bits (#829)
* jf: rewrite of status reg bits, waiting state includes both wati for trigger and start frame, blocking trigger only waits if its not in waiting for trigger and run busy enabled, error state connected in firmware
2023-10-18 10:47:52 +02:00
2b2e50916c dev: jf sync: stopping master gives idle (#824)
* jf sync mode master could return idle when stopped and so not all modules return the same value and must check for 'stopped or idle', Also must throw if any of the module gives an error

* added contains_only to sls::Result (#827)

* added variadic template for checking if a result contains only specified values

* fix for gcc4.8

* renamed to Result::contains_only

* updated condition in Detector.cpp

* stop on only the positions

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-10-13 15:25:41 +02:00
d34f396ef8 Dev/jf/fix pedestal (#821)
* jf pedestal fix: touch enable bit last
2023-10-05 10:29:33 +02:00
f9c4405da6 dev: update 2d gain plot color map (if no x and ymin/max changes or window resizing): setFixedWidth was updating for window resize, updated virtual servers for g2 and jungfrau to keep changing gain and data for every frame. the data value (#819) 2023-10-03 17:22:32 +02:00
dad3dc3e46 3. Dev/voltage to power (#816)
* getVoltageList, getVoltage /set, getMeasuredVoltage, getVoltageNames /set, getVoltageIndex moved to 'Power' as its misleading

* added cstdint and names slowadc,  added division to mV

* changed uV to mV in command line slow adc help. removed all python slowadcs (as it was already implemented as slowadc

---------

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2023-10-02 11:11:28 +02:00
d003a6d8e0 2. Dev/add jf pedestal feature (#807) 2023-09-29 11:25:58 +02:00
72bec5d62e 1. Dev/update python bindings for port pr (#813)
* updated python bindings for port update from int to uint16_t

* user friendly error message for exception when python arg does not match uint16_t for ports
2023-09-29 11:12:02 +02:00
88c39ba702 removing the misleading word 'Simulating' when programmig fpga (#815) 2023-09-28 16:21:31 +02:00
9834b07b47 Dev/fix port size (#805)
* port datatype changing from int to uint16_t
* throwing for -1 given for uint16_t ports
2023-09-28 09:36:39 +02:00
77d13f0794 updated all servers as my3 was not updated and had api issues 2023-08-29 11:11:19 +02:00
dd1690d7a1 typo for slow adc list (#794) 2023-08-17 12:28:58 +02:00
1873cc9310 Moench dacs defaults (#788)
* merge fix from 7.0.2: new jungfrau fw versions, incremented binary, hdf5 and json versions

* moench: changed dac names and default values to old moench values

* moench: remove interface clk polarity at start up

* moench: default speed is half speed, default values for adc offset and adc phase for different speeds (only half speed confirmed), adc vref voltage to 2.0 like G1

* moench: connected adc pipeline to client

* moench: receiver- default frames per file is 100k and discard partial frames as default

* moench binary in

* using tostring in gui for dacs

* moved frame discard policy as a parameter to be configured with a default depending on detector

* moench: 300 degrees for adc phase in full speed
2023-07-31 14:02:30 +02:00
565858b6c6 Explicit constructors for exceptions (#791)
* silence warnings

* making constructors explicit to avoid unintended conversions

* changed struct to class since we already have public:

---------

Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2023-07-26 16:35:52 +02:00
7383b13f16 silence warnings (#790) 2023-07-26 15:54:51 +02:00
d5ce03918c ctb: allowing adc enable for 10g to be 0, romode changing bit from disable analog to enable analog, removing matterhorn specific (#789) 2023-07-25 10:33:18 +02:00
c9dfa408db Fix strixel mapping and interpolation (#787) 2023-07-20 16:49:31 +02:00
36a9bafbde merge fix from 7.0.2: new jungfrau fw versions, incremented binary, hdf5 and json versions (#786) 2023-07-20 09:30:42 +02:00
15643c2320 adding 7.0.2 to pmodules (#784) 2023-07-20 09:02:50 +02:00
71489b7106 2. Set row col (#779)
* set row and column
2023-07-18 15:51:22 +02:00
7394833710 fixing python get slow adc names typo 2023-07-18 14:41:22 +02:00
9c50a3ee1e Internalpybind (#782)
* using fetchcontent to get zmq

* local copy of libzmq

* added guard for policy setting

* removed the need to export by using build interface

* moved pybind11 to FetchContent

* removed zmq hint from cmk script

* Fixed comments

---------
authored-by: froejdh_e <erik.frojdh@psi.ch>
2023-07-17 14:38:39 +02:00
fd79d59f4e Internal zmq using FetchContent (#780)
* using fetchcontent to get zmq
* local copy of libzmq
* added guard for policy setting
* removed the need to export by using build interface
* removed zmq hint from cmk script
---------

Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
Co-authored-by: froejdh_e <erik.frojdh@psi.ch>
2023-07-17 14:20:22 +02:00
c628ae2192 1. Ctb transceiver ro (#773)
*  transceiverenable, tsamples, romode for tranceiver and digital_transceiver

* 202 spec instr only for transceiver mode

* removed check for empty in trans readout and clean memory before reading from fifo

* ctb read fifo strobe for all after reading all channels, adding 1us after selecting channel, changing fw date

* updated 10gb transceiver enable

----
* added transceiver (tsamples, romode(transceiver, digital_transceiver), transceiverenable (mask)

* clean memory before reading from fifo (for analog and digital as well)

* read fifo then read strobe (also corresp fw) fixes number of reads (also for analg and digital)-> increases all pipelines by 1

* fixed bug in rearranging digital data in receiver

* fixed bug in streaming size of data after rearranging

* fixed bug in setbit, clearbit,and getbit

* status checks fifo before returning idle (transmitting if data in fifo if transceiver more enabled)

* soem matterhorn specifics that will need to be put into pattern in a month or two. this is temporary.

* NOTE: breaking api. rxParameters struct has transceiverenabel and tsamples given from det to receiver
2023-07-14 16:29:21 +02:00
a56be25500 Pmodules (#777)
* Add pmodules build files for PSI

* Modified gitignore to accept build-file

* Fix error of not building virtual servers

* make everything stable
2023-07-14 16:11:14 +02:00
d74661a375 updated fw versions for moench 2023-07-10 16:15:28 +02:00
054e733cd5 Voltage and slow adc naming (#772)
* voltages in python 

* added voltage values in cmd line, added voltagelist in detector class

* voltage values in python

* slow adc list
2023-07-10 16:10:23 +02:00
fe4db54eb6 moench settings (#774)
* moench settings

* default value for asic ctrl reg for moench
2023-07-10 15:21:48 +02:00
5be503c1bd moench speeds (#776)
* added other speeds and updated readoutspeedlist, test, gui
2023-07-10 15:09:51 +02:00
58cdb5bd20 added patfname command to save the file the last pttern was loaded from (#770)
* added patfname command to save the file the last pttern was loaded from
2023-06-22 09:08:48 +02:00
e18c191247 Added pyat files as input, auto legend bug without wait and loop fixed (#769) 2023-06-20 12:28:14 +02:00
1a338346d5 2. Ctb fname voltage (#768)
* power and sense returning dac indices instead of int in Detector class

* power -> voltage, sense -> slowadc
2023-06-19 16:05:30 +02:00
d3d98db7e9 1. Ctb powerindices (#767)
* power and sense returning dac indices instead of int in Detector class
2023-06-19 15:19:50 +02:00
3f9ec695db 2. Patioctrl uint64 t (#766)
* when dbit list is enabled, the size of data in zmq stream is changed to only the digital bits enabled size. now fixed to also include analog size

* allowing to set 0xffffffffffffffff to pat io control. prevously was used to do a get. fixed also for pat bit mask and pat mask
2023-06-15 09:30:52 +02:00
6f50707cfb when dbit list is enabled, the size of data in zmq stream is changed to only the digital bits enabled size. now fixed to also include analog size (#764)
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-06-15 09:19:01 +02:00
a5f26252b8 ctb v_limit dac tristate (#761)
* ctb: allowing dac to tristate (-100) even if v_limit is set

* binary in

* formatting
2023-06-15 08:42:42 +02:00
d032f43f11 fixing tests to work and powername change bug fix from before 2023-06-14 17:19:37 +02:00
0d53f83a2f backward compatibility of alias file 2023-06-14 11:40:30 +02:00
a7dcfe4b31 Ctb sense power signal names (#759)
*  adc names

* added python functions in src

*  signal, power, sense names

* fix tests
2023-06-07 17:06:41 +02:00
b9a346a396 ctb adc names (#757)
* first draft of adc names

* fixed tests

* formatting

* added python functions in src

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-05-31 21:07:07 +02:00
225e5490d2 formatting 2023-05-30 15:46:30 +02:00
95d89522d8 formatting 2023-05-25 12:10:46 +02:00
6fcb880538 Merge fix from 7.0.2 (#756)
- start acq list: mixup with master pos #743 : fix that only master starts second and not all (for start acq), typo with pos and masters list
- synced master status running when setting to slave  #747: synced master status running when setting to slave
2023-05-25 11:20:41 +02:00
65b8c9c5c1 Moench rw3 (#745)
* moench, removed chip version, filter resistor, filter cells, currentsoures, gain mode, setttings(modes), dbitphase, maxdbitphase, autocompdisable, comparatordisabletime, made acq start and stop a pulse, removed unused registers

* added parallel command

* remove gain plot for moench

* moench: updated adc invert val

* moench: update adcoffset to 0xf and adcphase to 140 degrees

* removed sync clock in moench

* updated min fw version

* removing config file in moench server
2023-05-25 11:00:23 +02:00
0a7fd0a51a set bit and clear bit only verifies that bit (#746) 2023-05-25 10:35:17 +02:00
6834294437 2. Fix ctb ro to receiver (#755)
* fix for incorrect readout mode from detector to updating receiver (rx_hostname command)
2023-05-25 08:55:36 +02:00
afee45790f 1. allow 1gbe non blocking acquire by creating another thread (#753)
* allow 1gbe non blocking acquire by creating another thread

* removed unnnecessary print out in ctb
2023-05-24 13:39:40 +02:00
f0c789dc91 Revert "Ctb: allow adc mask enable to be 0 for 1 and 10GbE", and better error message (#751)
* Revert "Ctb: allow adc mask enable to be 0 for 1 and 10GbE (#750)"

This reverts commit a0f250a487.

* better error message about setting adc mask to 0. Cannot set it to 0 due to ram allocation
2023-05-22 12:26:07 +02:00
a0f250a487 Ctb: allow adc mask enable to be 0 for 1 and 10GbE (#750)
* ctb: allow adc mask enable to be 0 for 1 and 10GbE
2023-05-22 11:26:57 +02:00
fb25a01db5 Automate virtual test (#714)
* using argparse for parsing command line arguments

* added command line option to specify which servers to run

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-05-11 12:15:22 +02:00
da4dd0df7e Formatting (#742) 2023-05-11 10:17:24 +02:00
4c6be26846 Jf rawdataprocess txtfile (#732)
* Fix ROI mapping

* Formatting

* Minor edit

* intial draft of cmake for jungfrau executables Makefile.rawdataprocess

* added the cmake file

* missed Makefile

* added libfmt

* Fix some compiler warnings

* Fix some compiler warnings

* Create filename usining fmt::format

* Rewrite command line parsing with std::string and fmt::format

* Fix file reading

* Fix root string extraction

* Fix ifstream file reading

* Clean up comments

* Add version of rawdataprocess with bash wildcards

* Add version of rawdataprocess that reads inputs from txt-file, still buggy

* intermediate

* fix file loop

* fix const

* Circumevent bug with stuck threads

* Fix mutex bug

* cleanup

---------

Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-05-08 16:30:37 +02:00
74acbb15f5 enable fix g0 when in expert mode (when gain mode enabled and not just visible) (#736) (#741) 2023-05-08 16:13:09 +02:00
d65825e9ef Rx roi zmq (#726) (#740)
adding rx_roi also in the zmq header for external guis to put the "yellow box".. sending full roi instead of -1, and sending for each zmq port. "(multiple yellow boxes)".
2023-05-08 16:03:48 +02:00
e757e25fa1 merge fix #721 PR (sync 7.0.2.rc) to developer (#739)
* merge fix from #721 PR (sync) 7.0.2.rc -> developer
* row and column for jungfrau mixed up

* multi module jungfrau sync must do slaves first then master for start acquisition and send software trigger, and master first and then slaves for stopacquisition

* non blocking to slaves first and only then blocking/nonblocking to the master for sending software trigger(jungfrau multi mod sync)

* fixed get/set timing jungfrau when sync enabled, getsync during blocking acquire (for trigger or stop) will get stuck as it should ask the stop server

* switching between 1 and 2 interfaces did not set gui/client zmq port properly. Resulted in dummy streaming forever. fixed

* formatting, refactoring: const & for positions, multi mod M3 stop first master first

* adding missing cstdint for gcc 13

* Refactoring handle sync out, handling synchronization also for softwaretrigger for m3, for start/sync/stop for g2/g1

---------

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>

* fixed row and col for moench 2 interfaces

* fix moench getTiming and also allow moench to handle sync

---------

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2023-05-08 15:58:19 +02:00
14ec4cf1da added missing initialization of pthread_mutex (#728)
* added missing initialization of pthread_mutex

* fixed cut and past error
2023-05-05 14:45:56 +02:00
ea4aaf743f modified struct (#729) 2023-05-05 14:09:13 +02:00
61f290441e Local loop indicies in analogDetector (#709)
* making ix and iy local variables in analogDetector
2023-05-03 09:18:09 +02:00
80fc7eb220 3 - Jf rawdataprocess wildcards (#723)
* Fix ROI mapping

* Formatting

* Minor edit

* intial draft of cmake for jungfrau executables Makefile.rawdataprocess

* added the cmake file

* missed Makefile

* added libfmt

* Fix some compiler warnings

* Fix some compiler warnings

* Create filename usining fmt::format

* Rewrite command line parsing with std::string and fmt::format

* Fix file reading

* Fix root string extraction

* Fix ifstream file reading

* Clean up comments

* Add version of rawdataprocess with bash wildcards

* Add version of rawdataprocess that reads inputs from txt-file, still buggy

* fixing missing cstdint

---------

Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-05-03 09:10:53 +02:00
73a9c42f62 2 - Jf rawdataprocess makefile (#724)
* Fix ROI mapping

* Formatting

* Minor edit

* intial draft of cmake for jungfrau executables Makefile.rawdataprocess

* added the cmake file

* missed Makefile

* added libfmt

* Fix some compiler warnings

* Fix some compiler warnings

* Fix MAkefile for conda env pyclang_fmt

---------

Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-05-03 08:50:24 +02:00
72c992bc74 2 - Jf rawdataprocess fmt (#725)
* Fix ROI mapping

* Formatting

* Minor edit

* intial draft of cmake for jungfrau executables Makefile.rawdataprocess

* added the cmake file

* missed Makefile

* added libfmt

* Fix some compiler warnings

* Fix some compiler warnings

* Create filename usining fmt::format

* Rewrite command line parsing with std::string and fmt::format

* Fix file reading

* Fix root string extraction

* Fix ifstream file reading

* Clean up comments

* Add requested changes to helper functions

* fix const&

---------

Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2023-05-03 08:43:45 +02:00
f4e05f7a01 1 - Add cmake for jungfrauExecutables rawdataprocess (#717)
* Fix ROI mapping

* intial draft of cmake for jungfrau executables Makefile.rawdataprocess

* added the cmake file

* missed Makefile

* added libfmt

* Fix some compiler warnings


---------

Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2023-04-27 13:59:13 +02:00
cb4f733350 formatting (#716)
* formatting
2023-04-12 15:30:34 +02:00
a5022ff0ee Jf strixelmap with roi (#715)
* Fix ROI mapping, Formatting, Minor edit
---------

Co-authored-by: vhinger182 <viktoria.hinger@psi.ch>
Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain>
2023-04-12 14:03:04 +02:00
cab2b335dc Fix ctb slow adc fw (#713)
Firmware updated. spi moved to firmware. In Software, configuring, then a pulse to start, wait for done bit and convert the values read from a regiter.
2023-04-12 11:25:41 +02:00
b442b17415 Implement automatic strixel mapping according to rx_roi (#710)
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-03-31 17:14:35 +02:00
37e7471dc4 minor fixes (#708) 2023-03-31 11:56:09 +02:00
3b8c612103 Fixed build of the moenchZmqExecutables (#706)
* changed to pure virtual methods for Clone and setClusterSize

* added std::

* added moench to the github actions build
2023-03-29 15:01:22 +02:00
08c0c59a28 Added github actions for build and run unit tests (#705) 2023-03-28 16:27:01 +02:00
7e01095684 Fix tests (#698)
* fix firmwareversion to reqd version as fw version cannot be 0 for virtual
2023-03-28 15:22:36 +02:00
500442fd6b modified ZMQonline display for stripsel usage. (#699)
* modified ZMQonline display for stripsel usage. modified dataprocessor to overwrite header.detspec1 with ROI in case of ROI.
* Removing changes to the slsReceiver, moved to branch jf_zeromq_display_rxroi
2023-03-22 14:25:02 +01:00
b67c6dea08 ensuring no duplicate rx hostname port combo (#604)
* rx_hostname and port combo to one, or hostname to all, or a vector of hostnames and ports, ignoring none or empty, then verifying no duplicates for the host port combo including from shared memory

* extracted function for rx_hostname (#694)

* c++14 revert

* unique hostname-port combo for port, hostname, rx_tcpport (#696)

* verify unique combo for rx_port as well

* check unique hostname-port combo also when setting control port, hostname, rx_hostname and rx_tcpport

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
Co-authored-by: Erik Frojdh <erik.frojdh@psi.ch>
2023-03-20 12:30:12 +01:00
c9215a6d9b fix old server version in 64 bits (#697)
* check server version before initial checks, catch old server version exception, get old server version as 64 bit and print it alon gwith exception
2023-03-20 10:31:27 +01:00
1bdf83e101 Resolve merge conflict in jungfrauExecutables 2023-03-17 16:43:08 +01:00
1bd813d620 Fix bug to allow larger clusters 2023-03-17 15:34:08 +01:00
943a85cbd5 Update data structures and eta functions for JF strixels 2023-03-17 15:33:01 +01:00
fc24558314 formatting 2023-03-17 14:42:11 +01:00
d23722a4b7 Eiger: add hardware version (#688)
* eiger: hardwareversion, fix firmware version unable to read version scenarios, check to see if febl, febr and beb have same fw version

* feb versions can be picked up only after feb initialization
2023-03-16 11:59:06 +01:00
bc46d0f6ab rx_arping handle sigchld (#691)
* rx_arping pclose gave -1 due to sigchld being ignored, fixed with sig handler doing a wait
2023-03-16 11:57:30 +01:00
532f76ed4f fix hdf5 compilation using det spec fields in header (#693)
* fix hdf5 compilation using det spec fields in header
2023-03-16 09:23:27 +01:00
21db57dd89 binaries in 2023-02-24 10:44:17 +01:00
dc5db905d4 merge from 7.0.0 2023-02-24 10:39:51 +01:00
48a684b95f dev:Eiger febl febr (#601)
* eiger: get febl and febr versions in versions command, also added in python
2023-02-24 10:06:11 +01:00
276dc52196 dev:removed storage cells for moench (#603)
* removed storage cells for moench
* rxr: also setting moench like jungfrau in implementation of ports
2023-02-24 10:00:31 +01:00
e942678139 Merge branch 'main' into 7.0.0.rc 2023-02-24 09:48:22 +01:00
72a028eaf3 Update README.md 2023-02-23 17:30:47 +01:00
907257891d updated readme 2023-02-23 17:24:23 +01:00
0a79ae523b updating documentation 2023-02-23 16:52:04 +01:00
90496bcee8 updated release date and lib api date 2023-02-23 16:38:10 +01:00
ed2894dafd python additions (#686)
* python: fixed versions when no receiver, added clearbusy, serialnumber and readoutspeedlist. commandline: modified versions to look like python versions

* python: added clkphase, fixed clkdiv, maxphase

* python added adcvpp

* gaincaps for python

---------

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2023-02-23 16:29:54 +01:00
a74c9498e2 m3, individual chip index back in for hw 1.2, need the linux drivers for chipdac0-9 (#685) 2023-02-23 09:13:31 +01:00
403989e2f8 trigger, blockingtrigger in python and m3 timefix 2023-02-22 18:01:46 +01:00
7e8d11098a release date 2023-02-22 17:15:51 +01:00
f9c9a53c8c fix python compare script from g to sls_detector_get 2023-02-22 17:09:47 +01:00
90b1b97ffa release notes 2023-02-22 16:30:41 +01:00
50003cbc08 release notes 2023-02-22 16:30:27 +01:00
a799c4d2e2 minor 2023-02-22 15:37:13 +01:00
700f532b5a examples udp before rx_hostame 2023-02-22 15:16:00 +01:00
a098bc4674 fixes for tests for m3 2023-02-22 14:34:01 +01:00
13bbd54a21 formatting 2023-02-22 11:42:06 +01:00
d84e9652d3 updated versions for the servers 2023-02-22 11:36:47 +01:00
1ce39c48c7 updated client versions 2023-02-22 11:29:58 +01:00
9ddff523cd minor 2023-02-22 11:28:39 +01:00
f7618fbb93 error message 'unrecognized function enum' from detector or receiver prepended with Software version mismatch to handle enum start change between v6 and v7 (#680) 2023-02-22 11:11:46 +01:00
8501e1fb1f eiger server moved to fw 31 (#681)
* eiger server moved to fw 31
2023-02-22 11:10:56 +01:00
6faa4c821f udp_srcip auto to detector ip (#683)
* udp_srcip now points to detectorip for 'auto' argument. and not allowed for G1
2023-02-22 11:09:52 +01:00
da291d535e fix ctb test, non blocking will not return for 1g (#684)
* fix ctb test, non blocking will not return for 1g
2023-02-22 11:09:18 +01:00
adcde9fd49 user friendly message added from ' dangerous to continue' to 'check firmware' (#665) 2023-02-20 16:35:33 +01:00
dde99a16b3 fixed documentation for fw upgrade and cmk script show all options (#674)
* fixed documentation for fw upgrade and cmk script show all options

* much more clear definition of the sls receiver header
2023-02-20 15:24:09 +01:00
b200a2efc1 Fix jf softwre trigger and tests with real jungfrau detector (#673)
* jungfrau: software triggers do not work, fixed

* eiger test: get highvoltage must be read twice to get the real voltage
2023-02-20 15:22:46 +01:00
fe281bd1b1 Fix stop rx stuck (#669)
stop should really stop even if receiver had crashed, so check rx status after sending stop; also ensuring restream  in acquire happens only if thers a callback
2023-02-20 15:21:22 +01:00
878eab9fc3 Fix gui browse (#662)
Choosing file path in dialog should already set file path when returning from dialog, must not wait to press enter
2023-02-20 15:20:02 +01:00
4259d49b63 added release notes from 7.0.0.rc1 to rc2 (#639)
* added release notes from 7.0.0.rc1 to rc2
2023-02-17 08:51:05 +01:00
4dac9f2193 zmq4.3 changed default buffer size to -1 instead of 0 (#667) 2023-02-15 09:45:02 +01:00
cb8e4365e3 formatting 2023-02-14 15:08:31 +01:00
0251aa9e63 fixed linking issue in arping and shm test (#659)
Co-authored-by: Erik Frojdh <erik.frojdh@psi.ch>
2023-02-14 14:49:00 +01:00
7c047cab4a udpated version to rc4 2023-02-14 10:30:45 +01:00
572332f870 fix test for eiger half module for gap pixels (#658) 2023-02-14 09:22:32 +01:00
d90bf6c7df formatting 2023-02-13 11:36:41 +01:00
5c8c3ae3f3 fix to access to shared memory that doesnt exist (#638)
* fix to access to shared memory that doesnt exist

* fix for freeing shm and then setting hostname from API

* exception error message moved to private function

* refactoring to avoid allocating intermediate string
2023-02-13 11:29:54 +01:00
18136fed9d exception messages (#656)
* fix exception messages for more printout about sockets or more detail
2023-02-13 11:22:05 +01:00
fc42720208 allow half modules and odd number of half modules to use the gui with gap pixels disabled (#655) 2023-02-13 11:21:35 +01:00
e6505650cb proper update of client and rx versions to 7.0.0.rc3 2023-02-10 16:34:04 +01:00
ba6fdb9695 udpated client and rx versions to rc3 2023-02-10 16:04:32 +01:00
8361f2bb96 zmq: set zmq buffer size also to 0 if hwm >= 25 (#653) 2023-02-10 08:57:36 +01:00
4ee4d66977 Jf zeromq display (#644)
* modified ZmqSocket to expose the SO_RCVBUF and SO_SENDBUF parameters. Modified DataStreamer.cpp to change the SENDBUF to 1MB when HWL is <10. Modified Datastreamer.cpp so that when HWL is changed, socket is unbind/rebind. Added rebind to ZmqSocket.cpp.
Changed slot UpdatePlot() in qdrawplot.h from privat tto public, added plot->UpdatePlot() after every axis range change, so the plots are updated immediatly and not at the next image.
Added onlinedisp_zmq program which connects to the receiver ZMQ port and show images and histos. Compiled against  ROOT 6.22/02. Added examples files.

* added setbuffer size also for gui, moved hardcoded values to a macro, removed unnecessary return of ok or success, added actual zmq exception message to could not create sockets error

* zmq: changing buffer size done within hwm

---------

Co-authored-by: mozzanica <l_mozzanica@mpc2012.psi.ch>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2023-02-09 17:24:28 +01:00
e14f6981a0 Fix tests (#647)
* fixes tests
2023-02-09 15:57:05 +01:00
8158ef876c eiger: quad write/read reg (dr) and quad positions (#649)
* eiger: adding mask to read/write registers. useful for setting quad parameters as they might have different values for left and right fpga registers.
** fix quad position
* fix quad flipping
* formatting
2023-02-09 15:55:35 +01:00
ebb6f53b21 Fix rx arping socket bind (#646)
* first tries with a process intead of thread for rx_arping

* Moving delete pointer of udp socket to stopReciever,so rx_arping can only be set when udp socket is closed

* refactoring and formatting

* unused variable processId

* ignore sigchild to prevent zombie from child processes being killed
2023-02-03 17:18:09 +01:00
e172df79f3 format 2023-02-03 11:23:19 +01:00
55bf73f3b7 unicast udp_srcmac (#642)
* udp_srcmac can only be a unicast address (LSB of first octet must be 0)

* renamed binaries
2023-02-03 10:56:19 +01:00
c62ce0ce6b m3:changed str_clk (clkdiv 3) default to 166MHz (6) (#643) 2023-01-30 17:05:42 +01:00
3a3628c475 m3 firmware version change (#637)
* m3 firmware version change

* changed binary name to rc3
2023-01-27 10:54:45 +01:00
9ba907f9f7 added none or 0 to unset bad channels (#632)
* added none or 0 to unset bad channels

* free function split to get int array from string of arguments for badchannels

* missed a file

* allowing list for badchannels in command line

* added badchannels in python

* added size check

* more comments in Detector.h and added more tests for facny command line badchannels

* removeDuplicates accept any container, added tests

* corner cases: 1:5,6,7 or 5,6,7 or just 1:5

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2023-01-27 09:59:31 +01:00
3f7c9529dd m3: changed clk 0 1 2 to 100MHz (#636)
* m3: changed clk 0 1 2 to 100MHz

* m3:fix clk 2

* binaries in
2023-01-25 11:54:37 +01:00
c7af9c9f3e fix for versions command in python failing for eiger due to hardware version not implemented (#602) 2023-01-24 11:05:32 +01:00
0b17318f10 formatting 2023-01-24 10:37:52 +01:00
1f907b911e added documentation about zmq json header (#629)
* added documentation about zmq json header

* fix from 7.0.0 field name changes in zmq header
2023-01-23 14:15:14 +01:00
c5b621b684 intialize pattern addresses with default, else they are created with value 0 and overwrite the default in server (#628) 2023-01-23 10:59:18 +01:00
946e6aa817 badchannel segfault for multi module (#620)
* badchannels segfaults when there are no badchannels for next modules, fixed

* added example badchannels

* refactoring casting
2023-01-20 17:39:25 +01:00
3682644e15 incorrectly using detsize, caught and fixing it in background (#619) 2023-01-19 11:10:05 +01:00
a6aaa2c3c6 adding fliprows to python (#625) 2023-01-19 11:03:04 +01:00
ac64afe747 print also the level when using command line to set/get patloop, patnloop, patwait, patwaittime (#621) 2023-01-19 10:44:17 +01:00
d19f6a3d0d initialchecks werent being bypassed because of the wrong exception being caught. fixed (#623) 2023-01-19 10:43:27 +01:00
eb025b54ef Merge branch '7.0.0.rc' into developer 2023-01-18 13:59:04 +01:00
d77b353481 Corrected wrong coloring in plotPattern 2023-01-18 08:59:30 +01:00
3bf6be41b4 merge from 7.0.0.rc 2023-01-17 09:48:59 +01:00
7466c0bc8f M3 deserialize (#618)
* m3: updated serializing loop in trimming

* fixed the deserializing loop again
2023-01-17 09:39:58 +01:00
713639d001 Fix gotthard delay (#606)
* fix for set delay for gotthard1 (verification adds master delay even if its not master)

* binaries in

* binaries name
2023-01-17 09:16:43 +01:00
3cc4d25eb9 Merge branch '7.0.0.rc' of https://github.com/slsdetectorgroup/slsDetectorPackage into 7.0.0.rc 2023-01-16 15:05:59 +01:00
0d905923dd Corrected a typo in plotPattern.py 2023-01-16 15:03:16 +01:00
e747a5811f added missing equality operator for DurationWrapper in Python (M3 exptime fix) (#615) 2023-01-16 14:12:12 +01:00
22b3229d94 m3: updated serializing loop in trimming (#613) 2023-01-16 13:43:28 +01:00
7729e47685 also for rx_hostname 2023-01-16 13:34:07 +01:00
f31fa92516 fixed hostname not split (+) in python 2023-01-16 13:34:01 +01:00
d106109f6c fixed hostname not split (+) in python (#609)
* fixed hostname not split (+) in python

* also for rx_hostname
2023-01-16 13:33:11 +01:00
39b1f5bbf2 Moench rewrite (#597)
* copied jungfrau server to moench and adapted

* fixed image size and num packets

* read n rows allows 16

* commneted out configure_asic_timer at server startup. To be removed later the ASIC_CTRL_REG and storage cell options

* moench:removing the decrement (which was in jf)  in read n rows to register

* removed lblsamples from gui
2022-12-15 09:16:51 +01:00
7ab3b25f87 formatting 2022-12-13 10:07:13 +01:00
0f6f20a720 merge from 7.0.0.rc1 2022-12-13 10:03:57 +01:00
1340408c2d Merge branch '7.0.0.rc' into developer 2022-12-13 09:58:55 +01:00
b02bda053b fixed release notes 2022-12-12 12:43:21 +01:00
75c40ad069 updated release date 2022-12-12 12:29:12 +01:00
eaf05cfc44 troubleshooting document updated acc to jf (#596)
* doc on troubleshooting for failure of packets

* updated troubleshooting acc to jf manual
2022-12-12 12:19:32 +01:00
f1e0bda08d udpate documentation on qt5 gui (#591)
* documentaio on building qt5 gui

* added comment by erik about libgl
2022-12-12 11:39:43 +01:00
3fb22dc20a fix to not throw exception when stopping detector when it really stopped, expecting idle instead of stopped flag (#595) 2022-12-12 11:39:20 +01:00
ff5aa13073 Fix update mode hw version (#594)
* fix to add 'get hardware version' into allowed update mode functions in server
2022-12-12 11:39:08 +01:00
4ec70d7995 added back python versions 2022-12-12 09:10:02 +01:00
fb6d8fd5d8 Merge branch '7.0.0.rc' of github.com:slsdetectorgroup/slsDetectorPackage into 7.0.0.rc 2022-12-12 09:09:20 +01:00
018660f392 fixed conda builds 2022-12-12 09:09:06 +01:00
8ef032aecd Revert "added binaries for the fix"
This reverts commit f529428773.
2022-12-12 08:41:58 +01:00
f529428773 added binaries for the fix 2022-12-12 08:39:04 +01:00
006eff9213 minor 2022-12-09 12:30:03 +01:00
e865d8febf formatting 2022-12-08 10:11:28 +01:00
ae6c7f5841 updated server binary shortcuts 2022-12-08 09:27:44 +01:00
602c02f2f7 renaming of servers for version 2022-12-08 09:24:48 +01:00
f3f83de690 updated client, receiver and server versions to 7.0.0.rc1 2022-12-08 09:15:50 +01:00
7b7c4a2b86 Merge branch '7.0.0.rc' into developer 2022-12-08 09:01:03 +01:00
9154478702 formatting 2022-12-08 09:00:23 +01:00
8fc45676b9 Merge branch '7.0.0.rc' into developer 2022-12-07 16:22:30 +01:00
4ff0ef47eb binaries in 2022-12-07 16:22:04 +01:00
7dc3ed77c7 docs 2022-12-07 16:20:43 +01:00
e1e8ffe7b5 updated fw version for jungfrau to 1.4, 2.4 and g2 to 0.3 2022-12-07 16:16:58 +01:00
aa3542c1cb docs 2022-12-07 16:02:29 +01:00
ce6c8cddf1 docs 2022-12-07 13:09:17 +01:00
91c3926eca updated fw versions for m3 to 1.4, ctb to 1.1 and moench to 0.3 2022-12-07 12:47:26 +01:00
53fe5f5116 Merge branch '7.0.0.rc' into developer 2022-12-07 11:14:02 +01:00
cda59c4beb binaries in 2022-12-07 11:13:49 +01:00
77ca2c8a63 change in fw dates, release notes and docs 2022-12-07 11:11:00 +01:00
50f2165c55 Merge branch '7.0.0.rc' into developer 2022-12-06 11:30:14 +01:00
056f650b92 Test for moench done 2022-12-06 11:15:53 +01:00
3d54a4aa26 fix for tests ctb 2022-12-06 11:15:45 +01:00
3a89c2a61e fix tests for gottthard1 2022-12-06 11:15:31 +01:00
570a567a8c fix m3 tests 2022-12-06 11:15:22 +01:00
96e107221b Test for moench done 2022-12-06 11:14:42 +01:00
b8b9921914 fix for tests ctb 2022-12-06 11:08:49 +01:00
76d9890eea fix tests for gottthard1 2022-12-06 10:59:33 +01:00
8f68e395bd fix m3 tests 2022-12-06 10:52:33 +01:00
9874f596f6 fix to tests m3 2022-12-06 10:35:00 +01:00
984a59a9d7 fix tests to not allow setting veto stream at a single module level 2022-12-06 10:34:52 +01:00
4614e0873a fix to tests m3 2022-12-06 10:34:17 +01:00
bb01f90e1f fix tests to not allow setting veto stream at a single module level 2022-12-06 10:21:45 +01:00
e02b11fd1e fix tests to not allow setting udp interfaces at a single module level 2022-12-06 10:08:53 +01:00
f8a612c0e2 fix tests to not allow setting udp interfaces at a single module level 2022-12-06 10:08:23 +01:00
68beba732e tests: transmission delay cannot be got for a single module for jf and m3, resetting fpga is not an option to test others 2022-12-05 17:45:00 +01:00
104bc6f619 fixed tests to get headwareversion number instead of serial number to know ic 2.0 jf boards nd also the set master fail only if more than 1 detector (fix intests only) 2022-12-05 17:44:54 +01:00
66cf1825ea fixed tests 2022-12-05 17:44:48 +01:00
d8e497dbb3 fix for changing udp socket buffer size 2022-12-05 17:44:42 +01:00
60502cfa8f datastream help, versions fix for eiger (hardwareversion not impl), fix for tests 2022-12-05 17:44:33 +01:00
1cc7d512e0 tests: transmission delay cannot be got for a single module for jf and m3, resetting fpga is not an option to test others 2022-12-05 17:43:01 +01:00
dae07dabf3 fixed tests to get headwareversion number instead of serial number to know ic 2.0 jf boards nd also the set master fail only if more than 1 detector (fix intests only) 2022-12-05 17:07:46 +01:00
c5e0b9def8 fixed tests 2022-12-05 16:36:23 +01:00
b089dc90cd fix for changing udp socket buffer size 2022-12-05 16:34:13 +01:00
4caf10c12b datastream help, versions fix for eiger (hardwareversion not impl), fix for tests 2022-12-05 16:33:59 +01:00
964bdf5fc3 fix for changing udp socket buffer size 2022-12-05 13:17:16 +01:00
34a43bcb67 datastream help, versions fix for eiger (hardwareversion not impl), fix for tests 2022-12-05 13:09:52 +01:00
32cbb11bb6 Corrected typo 2022-12-05 12:49:04 +01:00
ad21d76af2 release notes updated 2022-12-05 11:08:58 +01:00
d4be1af378 release notes 2022-12-05 09:52:10 +01:00
51de419c2d reordered release notes 2022-12-02 12:59:21 +01:00
339cb925c7 removed decrement for sls detector header version number for virtual servers for ctb moench jungfrau g2 and m3 2022-12-02 12:13:13 +01:00
cac2c0b01d removed decrement for sls detector header version number for virtual servers for ctb moench jungfrau g2 and m3 2022-12-02 12:12:25 +01:00
f8a29c3000 reverted versions as the firmware dont increment (#590) 2022-11-29 16:37:28 +01:00
e71f68d31b reverted versions as the firmware dont increment (#590) 2022-11-29 16:36:54 +01:00
d431443dda allowing jungfrau to continue with just a waning if detid.txt file not found (#589) 2022-11-29 16:28:55 +01:00
4ada8c79ed allowing jungfrau to continue with just a waning if detid.txt file not found (#589) 2022-11-29 16:28:24 +01:00
843edfbf06 release notes 2022-11-29 16:12:43 +01:00
a42ef3b591 release notes 2022-11-28 16:25:22 +01:00
44d9294270 release notes 2022-11-28 16:24:56 +01:00
c472a8f547 release notes 2022-11-28 13:52:47 +01:00
aaab1e306c udate 2022-11-25 17:06:41 +01:00
ae0a54a774 Merge branch 'main' into 6.1.2.rc 2022-11-25 16:12:02 +01:00
ae33622da2 updated pybind and catch (#588)
* updated pybind and catch
* added to release notes
Co-authored-by: Erik Frojdh <erik.frojdh@psi.ch>
2022-11-25 16:08:36 +01:00
81cc6b0836 release notes and help on python exptime help 2022-11-25 16:02:59 +01:00
34acf553a1 updated det spec fields for jungfrau and g2 (#587) 2022-11-25 11:00:16 +01:00
a2f41c13b7 fixed clang compiler warnings (#586) 2022-11-25 11:00:02 +01:00
c4a453fdbd updated release version 2022-11-25 10:31:10 +01:00
672c0f4a07 updated client date 2022-11-25 10:26:23 +01:00
05af370883 update server bin 2022-11-25 10:23:49 +01:00
a6022b7cec updated release notes and eiger server 2022-11-25 10:18:37 +01:00
72316fa2ce release notes 2022-11-25 10:09:15 +01:00
65523dcc94 release notes 2022-11-25 10:08:17 +01:00
255a75a646 merge from 6.1.2.rc for stop detector (eiger) 2022-11-25 09:59:14 +01:00
df40665c5e Using a loop to stop (#585)
* loop for stop, 10 retries
  For example, if module A got a "stop" during an acquisition, it stops to an 'Idle' state. If module B gets a "stop" before an acquisition, it will return it is in 'Idle' state and continue to start the next acquisition, but module B then waits for "ready  for trigger" synchronization from module A, which it will never get. Since module B missed the asynchronous stop command, the workaround in the client is to send another "stop" command (upto 10 retries) till it returns Idle.
2022-11-25 09:55:51 +01:00
61c31ed44a txdelay for all modules (#584)
* setting txdelay for all modules for eiger, jungfrau and m3
* added txdelay in python and renamed txndelay_ to txdelay_
* call in parallel
2022-11-24 11:57:26 +01:00
928d778fb1 formatting 2022-11-24 11:25:47 +01:00
2ff5291f48 hardware version (#580)
* hardware version for all dets except eiger
Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2022-11-24 11:24:05 +01:00
cd270160d8 documentation about installation and python getting started (#582)
* updated installation documention, added Python find virtual env flag
2022-11-23 12:04:45 +01:00
911b2f678f jungfrau module id (#581)
* connected module id to detid_jungfrau.txt
* fixed module id register in jungfrau
2022-11-23 12:01:22 +01:00
8dbcfc2ca8 Static internal build of qwt (#583)
* static linking of qwt
* suppressed warning in qwt + added reason
2022-11-23 11:59:22 +01:00
2d6cb52dfa Modified moenchZmqProcess.cpp to reflect changes made to the detector header (bunchId -> detSpec1; debug -> detSpec3; roundRnumber -> detSpec4) 2022-11-23 10:58:55 +01:00
57e7b51704 Added command line options to plotPattern.py 2022-11-21 12:39:18 +01:00
f6241f7a5e formatting 2022-11-18 14:26:58 +01:00
2dcf4a7144 fixed warnings 2022-11-18 11:19:01 +01:00
33e2155db1 Added plotPattern.py for the new pattern generator for the new firmware (6 loops, 6 waits) 2022-11-18 10:30:25 +01:00
8472cca81f naming 2022-11-17 17:15:05 +01:00
39a87ffcd9 release notes 2022-11-17 16:57:35 +01:00
5ea2cdb83d fix to allow all clks for pll (totaldiv was float instead of int) (#579) 2022-11-17 16:39:17 +01:00
4bb1a612f1 changed detector header version to detector specific field names and incremented version number, also for zmq (#574) 2022-11-17 15:24:12 +01:00
110e57ff6c Eiger stop lock (#576)
* added a lock when stopping or starting state machine in eiger server

* added 5ms right after acq started to make sure it really started

* added 100ms right after acq started to make sure it really started
2022-11-17 15:23:41 +01:00
f108ec82ea destruct arping thread in Arping desturctor (#578) 2022-11-17 15:22:54 +01:00
74a2f07c7d merge from develpoer, locking complete set of start acq steps and stop steps in eiger server as it shouldnt be interrutped, moved prepare into startstatemachine (#577) 2022-11-17 14:58:53 +01:00
a921368dea Updated generator.c: patioctrl, loops and timeouts are only generated if they exist in the pattern source 2022-11-17 10:57:42 +01:00
b432c70076 Moved location of patternGenerator directory.
Updated generator.c to include 3 additional timers and loops
2022-11-16 17:47:54 +01:00
fdd6031add renaming for version 2022-11-15 08:50:39 +01:00
06fc48b115 update release notes 2022-11-11 17:16:34 +01:00
bf3333b97b show fpga temp in developer tab in gui, virtual servers just show warning if no temperature file in /tmp to read (dont throw exception) (#573) 2022-11-11 17:15:15 +01:00
e7c65f44cb returning empty fail message for eiger 2022-11-11 16:56:58 +01:00
0063cc8eb2 update release notes 2022-11-11 16:51:20 +01:00
27e6fc3c73 serverbin shortcuts 2022-11-11 16:02:57 +01:00
83e0eb8b01 removed the test for allow update for kernel and server as it is eligible if the kernel is booting up anyway 2022-11-11 16:02:17 +01:00
7f8b5ac6c0 blackfin nCE pin fix for new kernel 2022-11-11 15:31:30 +01:00
38cd10d4e6 Qt5 built in qwt (#570)
- qt4->qt5
- in built qt5 6.1.5 because rhel7 is not upto date with qt5, removed findqwt.cmake
- made a fix in qwt lib (qwt_plot_layout.h) to work with 5.15 and lower versions for qrect constr.
- qt5 forms fixed, qt4 many hard coding forms switched to forms including qtabwidget, scrolls etc, fonts moved to forms
 - docking option enabled by default, removed option to disable docking feature from "Mode"
- added qVersionResolve utility functions to handle compatibility before and after qt5.12
- qtplots (ian's code) takes in gain mode enable to set some settings within the class, with proper gain plot ticks
- ensure gain plots have no zooming of z axis in 2d and y axis in 1d
- removed placeholder text in qpalette in main window form as its not supportd until 5.12 (so using qt5.9 designer insted of qt5.15 to cope)
- tab order
Servers:
- fixed some error messages that were empty for fail in funcs (mostly minor as if this error, major issues)
2022-11-11 15:15:10 +01:00
05f657c106 Versioning (#568)
- removed getClientServerAPIVersion in server (not used)
- removed rxr side (clientversion compatibility check), removed enum as well as it is now done on the client side.
- versionAPI.h
   - GITBRANCH changed to RELEASE
   - dates for all API changed to "sem_version date". Scripts to compile servers modified for this. Empty "branch" name will end up with developer for sem_version.

- Version class with constructor taking in the long version (APILIB date). Other member functions including concise(to get sem_version for new releases and date for old releases), 
  
- bypassing initial tests, also now bypasses the client-rxr compatibility check (at rx_hostname command)

- previously, compatibility between client-det was ensuring both had the same detector API (eg. same APIJUNGFRAU)
   - Now, compatibility only checks APILIB (client side) and detector API(eg. APIJUNGFRAU) (detector side) have same major version. It only does backward compatibility test. Rest is upto user to ensure. 
   - If server is from an older release, it will compare dates like previous implementation (APIJUNGFRAU from both client and det)
 
- - previously, compatibility between client-rxr was ensuring both had the same APIRECEIVER
   - Now, compatibility only checks APILIB (client side) and APIRECEIVER (rxr side) have same major version. It only does backward compatibility test. Rest is upto user to ensure. 
   - If rxr is from an older release, it will compare dates like previous implementation (APIRECEIVER from both client and rxr)

- removed APIGUI, evalVersionVariables.sh, genVersionHeader.sh (not needed or not used)

- clientVersion, rxrversion and detectorserverversion all return strings and not integers (in hex) anymore. Depending if it has semantic versioning, it will print that or the date if it is too old.

- fixed in python (strings for versions)
- check_version function in detector server changed to "initial checks" as it only checks server-firmware compatibility and initial server checks. Client compatibilities are moved to client side.
- --version gives sem_version and date? Is date needed as well. The clientversion, detserverversion and rxrversion API gives only sem_version (no date)
- - formatting
2022-11-09 11:13:09 +01:00
b150db0fb3 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2022-11-08 11:27:54 +01:00
f0c0f07701 changed JF structures and tiff writer for rectangular detectors 2022-11-08 11:27:31 +01:00
4a95ee8362 format 2022-11-08 10:25:12 +01:00
16e9b272c7 release notes 2022-11-07 12:49:04 +01:00
340abec016 updated release txt 2022-11-07 12:47:52 +01:00
615d66d493 eiger server workaround fix for fw stop done signal (#571)
- eiger server: fix for fw workaround where stop acquisition processing done signal does not come up, by removing reset in stop acquisition and waiting for2 seconds for feb done processing signal to go down, if it doesnt, throw if status is not idle.
- error messages not setup for some eiger server errors
- quad fix (chip signals to trim quad, both left and right registers can be different)
- minor logical error of no consequence (stop acquisition returns a different enum than expected)
2022-11-07 12:42:54 +01:00
9f906a779e M3clk (#548)
* m3: clock update, cannot set clk 4 and 5 anymore
* updated firmware version
2022-11-07 11:21:37 +01:00
3560f81d8e cpupower added (#569) 2022-10-27 11:55:09 +02:00
4230517e69 pybind documentation (update) (#563)
* document pybind11 update and included in package

* updatng doc for pybind11
2022-10-27 10:50:00 +02:00
4f21ad5122 Corrected mistake for compiling moench04 with digital bits 2022-10-25 09:55:11 +02:00
2696b95014 Removed an extra bracket in slsDetectorCalibration/singlePhotonDetector.h wrongfully inserted in previous commit 2022-10-24 14:22:07 +02:00
bb0201385f fixed issue with cluster finder 2022-10-24 12:39:37 +02:00
22b16de6b5 added binary for moench04 and gain bits 2022-10-24 12:36:24 +02:00
9232776577 Merge branch 'developer' of https://github.com/slsdetectorgroup/slsDetectorPackage into developer 2022-10-24 12:11:27 +02:00
5096119ac3 some changes for JF with LGADs 2022-10-24 12:09:52 +02:00
876977392b Modified moench04CtbZmq10GbData.h for analog digital mode 2022-10-24 12:08:42 +02:00
9efb19a9b5 some changes for JF with LGADs 2022-10-24 12:07:26 +02:00
a8b37e3932 ensure eiger hot fix server version stays the same 2022-10-24 10:54:48 +02:00
0883c73e88 not updating the client versions for 'server only hot fix' 2022-10-24 10:51:50 +02:00
ef7e9d73a5 eiger server fixes:
- removed feb reset in stop acquisition as it caused processing bit to randomly not go high (leads to infinite loop waiting for it to go high). This is anyway done at prepare acquisition and set trimbits.
- left AND right registers monitored for processing bit done
- febProcessinginprogress returns STATUS_IDLE and not IDLE
- In feb stop acquisition, if processing bit is running forever, checks for 1 s, then if acq done bit is high, returns ok, else throws
- feb stop acquisition returns 1 if success and fucntion in list calling it compares properly instead of STATUS_IDLE (no effect, but incorrect logic)
- chipsignals to trimquad should only monitor right fpga (not both as it will throw)
- fixed error messages of readregister inconsistent values
- setmodule and read frame was returning fail without setting error messages (leading to broken tcp connection due to no error message)
-
2022-10-21 16:31:17 +02:00
65ad0bae51 update release notes 2022-10-20 13:52:29 +02:00
71c50e5f66 CtbGui (Root) removed printout of pixel value on draw 2022-10-20 12:06:03 +02:00
3fa3e05bfd Adcvpp2 (#567)
* fix for adcvpp p
2022-10-20 11:53:23 +02:00
f9f485c99e moench04CtbZmq10GbData.h aoff guess (l. 115 or 116) 2022-10-20 11:07:44 +02:00
b7cdfbb4d2 Adcvpp (#566)
* added api in detector class for adcvpp, taken out of dac list
2022-10-20 10:58:56 +02:00
af300e0276 fix compiler warning for ctb gui for moench getGain: aoff not declared (#565) 2022-10-20 10:50:31 +02:00
a84fcd2c82 pybind11 release update 2022-10-18 17:24:47 +02:00
6fc43fa06a binaries in 2022-10-18 15:52:05 +02:00
e7879ee365 g2 and m3 round robin (#559)
* g2 and m3: round robin
2022-10-18 15:51:23 +02:00
46bb9bc2d7 nios temp (#557)
* fixed temp read nios

* divide for eiger and dont print
2022-10-18 15:47:23 +02:00
4a7cd051c1 Gainzoom (#556)
* gain plot: dont allow zoom, only zoom on main plot

* fixed gain plot zooming

* fixing panning for gainplots
2022-10-18 15:27:44 +02:00
d2c4827b31 increasing default rx tcp port (#562)
* increasing rx tcp port by default when creating shm
2022-10-18 15:24:04 +02:00
d9e34e1657 Pllreset (#560)
* ctb, moench and jungfrau: pll reset at start not happening as no defines
2022-09-29 14:03:26 +02:00
bac32dcba9 ctb 1g non blocking acquire (#555)
* allowing ctb and moench 1g to have non blocking acquisition also send data, refactoring wait for acquisition finished for all others
2022-09-16 17:45:51 +02:00
e385618d09 gui crash qtimer (#551)
* locks when qtimer runs out same time as acquisitionfinished

* fix for newer gcc
2022-09-16 17:02:03 +02:00
1df4aba8ec updated g2 version for new fw (#554)
* updated g2 version for new fw
2022-09-12 15:04:11 +02:00
fdfdfd9f43 Option to install slsdet python extension in the install tree (#553)
* added option to install python ext
2022-09-09 13:47:27 +02:00
c0c8c8e21a Hardcopy of pybind11 instead of using git submodules (#552)
* removed pybind as submodule
* added hardcopy of pybind11 2.10.0
* rename pybind11 folder to avoid conflicts when changing branch

Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2022-09-09 10:42:43 +02:00
236f00c810 only get dacnames if modules are attached (#550) 2022-09-08 13:48:05 +02:00
afff85b44b fix for broken build of zmq and ctb 2022-09-07 11:58:26 +02:00
1425382dbb G2clkdiv (#547)
* g2 changing clkdivs 2 3 4 to defaults for burst and cw mode
2022-09-05 17:00:01 +02:00
76c18f3303 setting rx_hostname (or udp_dstip with rx_hostname not none) will always set udp_dstmac. solves problem of chaing udp_dstip and udp_dstmac stays the same (#544) 2022-09-05 16:57:54 +02:00
7de6f157b5 M3badchannels (#526)
* badchannels for m3 and modify for g2 (file from single and multi)

* m3: invert polarity of bit 7 and 11 signals from setmodule, allow commas in bad channel file

* badchannel file can take commas, colons and comments (also taking care of spaces at the end of channel numbers)

* tests 'badchannels' and 'Channel file reading' added, removing duplicates in badchannel list, defining macro for num counters in client side

* fix segfault when list from file is empty, 

* fix tests assertion for ctbconfig (adding message) for c++11

* fixed badchannels in m3server (clocking in trimming) 

* badchannel tests can be run from any folder (finds the file)
2022-09-01 15:30:04 +02:00
02322bb3c2 jungfrau reset core and usleep (fix for 6.1.1 now fixed in firmware) removed (#545) 2022-09-01 15:05:41 +02:00
4913c9c0b0 incorrect check for fwrite fail (#541) 2022-08-31 15:53:24 +02:00
d73d8994c0 g2 hdi type tolerance changed from 5 to 10 (#542) 2022-08-30 15:54:32 +02:00
aeb3e222c6 format 2022-08-30 15:31:38 +02:00
045a28b5de Nanosecond times in Python (#522)
* initital implementation

* datetime replaces with sls::Duration in Python C bindings

* using custom type caster

* fix for conversion to seconds

* added set_count in python

* common header for pybind11 includes

authored-by: Erik Frojdh <erik.frojdh@psi.ch>
2022-08-26 11:48:40 +02:00
3970ed2560 Suppress -Wdeprecated-declarations for gcc (#536)
* Supress gcc warning from rapidjson include

Co-authored-by: Erik Frojdh <erik.frojdh@psi.ch>
2022-08-26 09:23:05 +02:00
5a22e8b926 ctb and moench fw fixed to work with pattern length so pattern command works (#535) 2022-08-25 15:01:59 +02:00
4638bf7cf8 Jungfrausync (#519)
* jungfrau sync
2022-08-23 10:29:16 +02:00
da16c1101c G2 hdi id (#521)
* g2: hdi value in fpga is 3 bits, so using appropriate enum for it

* hdi id bits are determined

* fw date changed (g2)
2022-08-23 08:02:11 +02:00
67eea7ac36 Patdefault (#524)
* m3, ctb, moench set wait and loop addresses to 0x1fff

* update default pattern file for moench
2022-08-23 07:59:39 +02:00
c8e31ae6d7 formatting 2022-08-16 09:53:09 +02:00
809b0bdeb8 Jungfraumaster (#518)
* set jungfrau master only from client
* added tests, fixed a bug in ctb and moench (infinite recursion) that will never happen atm
2022-08-16 09:51:18 +02:00
01696ca89b Jungfrautrigger (#516)
* jungfrau trigger added
* added blocking trigger
2022-08-16 09:41:47 +02:00
1bc4994be6 G2parallel (#514)
* g2: non parallel added
2022-08-16 09:35:39 +02:00
22b9562629 G2hdi (#510)
* g2: new hdi values, write hdi value to reg, set slave/master to reg, able to set master from server config file, server command line and client

* print versions for virtual as well
2022-08-16 09:31:13 +02:00
409a3977db Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2022-08-15 12:58:18 +02:00
81fbc45488 moench04CtbZmq10GbData.h corrected 2022-08-15 12:57:55 +02:00
9980a419f3 G2minor (#512)
* minor refactoring from old code

* binaries in
2022-08-11 09:17:35 +02:00
e0207cfac1 Udpsocket (#507)
* udp socket refactor from reuss: closing socket before throwing for bind error in constructor, closing socket at destructor and not at shutdown to allow other thread to read with a -1, so the object can still be accessed

* check for size of packet for every detector

* nullptr to unique ptr to call its destructor, when deallocating resources moved out of shutdown

* minor
2022-08-11 09:14:29 +02:00
07ff28e9e5 help should doesn't create detector object (#508)
* help should doesn't create detector object instead passing nullptr to the Proxy
2022-08-10 12:27:17 +02:00
6bf9dbf6d3 Format (#506)
Formatted package
2022-08-05 15:39:34 +02:00
7173785b29 Hdf5 para (#505)
* incorrect dimensions for virtual hdf5 parameter set

* fix for corner case bug in hdf5 virtual parameter dataset when frames caught is not a multiple of framesperfile

* reafctoring for readability and error prone hard numbers
2022-08-05 09:09:00 +02:00
89e293cb5a Rxpointers (#504)
* gui message doesnt show if it has a '>' symbol in error msg

* minor refactoring for readability (size_t calc fifo size)

* refactoring listening udp socket code: activated and datastream dont create udp sockets anyway, rc<=- should be discarded in any case

* wip

* refactoring memory structure access

* wip: bugfix write header + data to binary

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* portRoi no roi effecto on progress

* fail at receiver progress, wip

* segfaults for char pointer in struct

* reference to header to get header and data

* refactoring

* use const defined for size of header of fifo

* updated release notes

* remove pointer in callback for sls_receiver_header pointer

* rx same name arguments in constructors

* rx: same name arguments in constructor

* rx: removing the '_' suffix in class data members

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* diff undo for clang later

* wip

* Wip

* const string&
2022-08-05 09:08:18 +02:00
9ac8dab8af Rxclassmembers (#503)
* gui message doesnt show if it has a '>' symbol in error msg

* minor refactoring for readability (size_t calc fifo size)

* refactoring listening udp socket code: activated and datastream dont create udp sockets anyway, rc<=- should be discarded in any case

* wip

* refactoring memory structure access

* wip: bugfix write header + data to binary

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* portRoi no roi effecto on progress

* fail at receiver progress, wip

* segfaults for char pointer in struct

* reference to header to get header and data

* refactoring

* use const defined for size of header of fifo

* updated release notes

* remove pointer in callback for sls_receiver_header pointer

* rx same name arguments in constructors

* rx: same name arguments in constructor

* rx: removing the '_' suffix in class data members

* merge fix

* merge fix

* review fix refactoring
2022-07-25 14:02:11 +02:00
d132ad8d02 Callback rxheader (#502)
* gui message doesnt show if it has a '>' symbol in error msg

* minor refactoring for readability (size_t calc fifo size)

* refactoring listening udp socket code: activated and datastream dont create udp sockets anyway, rc<=- should be discarded in any case

* wip

* refactoring memory structure access

* wip: bugfix write header + data to binary

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* portRoi no roi effecto on progress

* fail at receiver progress, wip

* segfaults for char pointer in struct

* reference to header to get header and data

* refactoring

* use const defined for size of header of fifo

* updated release notes

* remove pointer in callback for sls_receiver_header pointer

* passing reference header for callback instead of copying it
2022-07-22 16:15:21 +02:00
4117cda79b Rx: refactor memory structure and listener (#496)
* gui message doesnt show if it has a '>' symbol in error msg

* minor refactoring for readability (size_t calc fifo size)

* refactoring listening udp socket code: activated and datastream dont create udp sockets anyway, rc<=- should be discarded in any case

* wip

* refactoring memory structure access

* wip: bugfix write header + data to binary

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* portRoi no roi effecto on progress

* fail at receiver progress, wip

* segfaults for char pointer in struct

* reference to header to get header and data

* refactoring

* use const defined for size of header of fifo

* updated release notes

* refactoring from review: fwrite, static_cast
2022-07-22 15:32:41 +02:00
26cbfbdb30 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2022-07-14 12:19:45 +02:00
3b9df5868e Added JF strixels cluster finder and gain bit for Moench04 2022-07-14 12:18:34 +02:00
8fcec81a67 Pattern 6 levels (#493)
* separating pattern levels from command name: command line done

* separated patten level from command in examples and default pattern files in servers

* command line and server works

* python: patnloop not verified, wip

* works except for patloop (set, and get does not list properly)

* minor

* fixed tests

* added 3 more levels for ctb and moench

* wip

* minor err msg

* minor

* binaries in

* separating pattern levels from command name: command line done

* separated patten level from command in examples and default pattern files in servers

* command line and server works

* python: patnloop not verified, wip

* works except for patloop (set, and get does not list properly)

* minor

* fixed tests

* added 3 more levels for ctb and moench

* wip

* minor err msg

* minor

* binaries in

* python working

* import fix

* changed fw version for ctb and moench. binaries in

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2022-07-14 12:00:07 +02:00
5be50785fb rx noRoi should not create files for port (#499) 2022-07-14 10:09:48 +02:00
3d3e70c718 added defines for python (#498) 2022-07-14 10:07:26 +02:00
f1051246ad Configfree (#492)
* prevent mem size check before Detector constructed (for loading config files), allowing freeing shm for submodules

* back to not allowing free submodules - consistency issues
2022-07-12 11:01:44 +02:00
0fc76a81b0 Zmqhint (#495)
* sorted the arguments of cmk.sh

* sorted arguments

* sorting arguments

* added q for zmq hint
2022-07-12 11:01:00 +02:00
b6db097800 udp_cleardst in fpga (#490)
* set number of destination in fpga as well when using udp_cleardst

* ensures fpga destinations are also cleared up

* binaries in
2022-07-05 16:09:41 +02:00
c414d92b86 help script to update submodule 2022-07-05 14:52:23 +02:00
0358838dfb fixed ctb gui for namespace fix 2022-07-05 11:29:23 +02:00
704b67c846 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2022-06-13 16:52:39 +02:00
9ecafbf8d5 some updates to the moench data processing 2022-06-13 16:50:30 +02:00
aa93aed4ed updated client versioning 2022-06-09 13:50:41 +02:00
5490daa0a1 storagecells not updated in rx and allowing it in idle mode (#485) 2022-06-09 13:42:18 +02:00
8ca8185d41 H5 one dataset name (#484)
* rename all datasets in hdf5 files to just 'data'

* removing the global qualifier H5

* update release notes
2022-06-09 12:35:33 +02:00
89aa0760c6 Hdf5fix (#483)
* hdf5 fix for string reference

* fix hdf5 compilation after namespace change
2022-06-09 11:42:32 +02:00
3cee36a3db gui hv moved to settings tab from developer tab, allowed also for eiger (#482) 2022-06-08 17:06:08 +02:00
364e0c6268 Udp srcip auto (#480)
* able to set udp_srcip and udp_srcip2 to auto

* minor

* minor
2022-06-08 12:26:49 +02:00
728cb35c37 rxMemsize (#479)
* changing fifo header size to 16 to fix the rxr header (112) to be a power of 2 to make it more efficient and reduce packet loss

* release notes
2022-06-08 12:03:13 +02:00
1fb90ab98c M3threshold (#475)
* vicin default changed to 800, only setting vthx directly allows to set dac even if counter disabled, else disable counter, setallthresholdenergy if an energy is -1, get module value, fix that reg was repaced by isettings

* vth3 disabled for interpolation enable, interpolation disable sets counter mask to what it was before (updating old mask whn setting counter mask except for setting all counters for interpolation enable) and enabling vth3 if counter was enabled

* refactor and test for previous commit

* pump probe only has vth2 enabled, handles both pump probe mode and interpolation mode as well

* wip

* refactored pump probe and interpolation and added to setmodule

* check dacs and trimbits out of range for setmodule (not just threshold)

* binaries in

* m3: pump probe and interpolation mutually exclusive

* minor
2022-06-07 16:55:33 +02:00
25b5b02302 m3 and g2: change in system clock (clkdiv2) should also change the time settings(exptime, period, gate delay etc.), g2: sys freq same irrespective of external or internal timing source (#470) 2022-06-02 11:02:10 +02:00
365ac835eb Get trimbits (#462)
* added the possibility to save settings file for m3 and eiger

* added save trimbits to gui

* update release notes

* python wip

* moved location of trimbits save option in gui

* python works

* updating getModule with all its parameters in the server side

* updating binaries
2022-05-24 11:08:08 +02:00
d61741c28b tests add to namespace sls (#466)
* tests add to namespace sls

* fixed for tests

* finish up namespace sls for tests
2022-05-23 16:17:32 +02:00
8656eeec25 Revert "tests add to namespace sls (#464)" (#465)
This reverts commit f5745fcf18.
2022-05-20 15:43:48 +02:00
f5745fcf18 tests add to namespace sls (#464) 2022-05-20 15:41:37 +02:00
c7ba79644a minor 2022-05-20 12:01:42 +02:00
70aed474dc fedora cant compile as make_unique in Implementation points to std and not sls namespace, but it compiles for DetectorImpl (#463) 2022-05-20 12:00:24 +02:00
f3edd4dc56 Not allowing / or spaces in file name prefix (#461) 2022-05-18 12:37:44 +02:00
a4bd2f1be7 updated release 2022-05-18 12:19:32 +02:00
73a45e1b5c nCe made high before programming blackfin to ensure seamless programming (#460) 2022-05-18 12:17:44 +02:00
4259363169 rxr sls namespace (#457)
* rxr src files and classes (detectordata, ZmqSocket) added to sls namespace

* moving defines inside namespace

* moving defines inside namespace, added helpdacs to namespace

* added namespace to gui

* gui also updated

* removed unnecessary sls:: when already in sls namespace for slsDetectoSoftware, receverSoftware, slsDetectorGui and slsSupportlib
2022-05-18 11:48:38 +02:00
fcc7f7aef8 Rx roi (#428)
* roi structure expanded to have ymin and ymax

* compile with 'detector roi'

* wip

* wip, rx_roi, rx_clearroi

* wip rxroi

* rxroi wip

* wip rxroi

* merge fix

* wip

* rx_roi works, impl wip, test

* tests in, impl left

* wip, rxroi impl

* wip, rxroi impl

* wip

* setrx_Roi works, getrx_roi, wip

* rx_roi impl done

* wip, rxroi

* wip, getrx_roi rxr ports

* fix ports

* wip

* wip

* fix positions on server side

* wip

* numports wip

* wip

* jungfrau top inner interface row increment

* x, y detpos, wip

* removed eiger row indices flipping in gui (bottom flipping maintained)

* wip

* wip, jungfrau numinterfaces2

* jungfrau virtual works

* eiger, jungfrau, g2 virtual server works

* eiger positions fix, wip

* binaries in

* minor printout

* binaries in

* merge fix

* merge fix

* removing getposition

* setrxroi wip

* set upto port

* get messed, wip

* roi multi to module works, wip

* wip

* roi dont return -1

* added rxroi metadata in master file

* added rxroifromshm, not yet in detector

* rx roi in gui with box, also for gap pixels (gappixels for jungfrau mess)

* fix for segfault in gui with detaching roi box in gui

* wip

* m3 gui: slave timing modes should be discarded when squashing

* fixed m3 virtual data, and fixed counters in gui asthetics

* m3 roi works

* wip, g2

* wip

* handling g225um boards, and showing roi for gainplot as well

* udpate python functions

* fix for 1d and a2d roi written

* fixed actual roi written to file

* no virtual hdf5 when handling rx roi

* test

* minor

* binarie in
2022-05-16 12:35:06 +02:00
9808376207 release notes 2022-05-16 12:33:07 +02:00
be617577c9 always enable gap pixels if they exist for detector in gui (#450) 2022-05-16 12:31:46 +02:00
e30ee445a1 m3 gui: slave timing modes should be discarded when squashing (#449) 2022-05-16 12:29:17 +02:00
8d6b8d66cc size of shm needs to be only sometimes checked when opening shared memory (#443) 2022-05-16 12:27:48 +02:00
88649a00b6 M3vtrim min (#454)
* Remove the vtrim min 600 check when setting threshold energy. vth1-3:200 - 2400, others 0-2800

* compile fix
2022-05-12 11:41:05 +02:00
b122c2fbdf Revert "Remove the vtrim min 600 check when setting threshold energy. vth1-3:200 - 2400, others 0-2800 (#452)" (#453)
This reverts commit 7d574375b4.
2022-05-12 11:38:34 +02:00
7d574375b4 Remove the vtrim min 600 check when setting threshold energy. vth1-3:200 - 2400, others 0-2800 (#452) 2022-05-12 11:06:14 +02:00
466d431081 update release notes 2022-05-10 15:35:44 +02:00
cd4520b051 not validating settings for dacs temporarily (#447) 2022-05-10 15:30:34 +02:00
0129c2c686 M3: master starts twice (non blocking) part 2 (#445)
* slaves and master vectors empty means all positions included: fixing double acquisition in masters

* debug print out
2022-05-10 15:23:39 +02:00
f55bdd6eae M3: master starts twice (non blocking) (#444)
* start acq for master m3 was sent twice (non blocking), removed redundant code, check that there is only one master

* m3 can have more than 1 master (when many master modules used independently)

* fix for singe mod m3 or other dets
2022-05-10 14:27:40 +02:00
36a1159f38 updated pybind11 from 2.6.2 to 2.9.2 2022-04-28 16:39:39 +02:00
98e2ddbb74 indent 2022-04-28 16:37:52 +02:00
fa12ab2858 Support external builds of python bindings, gui, ctbgui and moench stuff (#440)
Use already installed version of the slsDetectorPackage. Assumes that the library has already been built and installed either on a system wide location or pointed to by CMAKE_PREFIX_PATH
2022-04-28 16:35:29 +02:00
afeee5501c Fixpositions (#436)
* fix positions on server side

* wip

* numports wip

* wip

* jungfrau top inner interface row increment

* x, y detpos, wip

* removed eiger row indices flipping in gui (bottom flipping maintained)

* wip

* wip, jungfrau numinterfaces2

* jungfrau virtual works

* eiger, jungfrau, g2 virtual server works

* eiger positions fix, wip

* binaries in

* minor printout

* binaries in

* pointer bug

* comment to define test_mod_geometry define
2022-04-28 16:32:26 +02:00
b7153fe3e0 cmake fix 2022-04-27 11:29:04 +02:00
2db2694660 m3 rxr: inconsistent generaldata default (#435)
* inconsistent copy with generalData and implementation members, especially for m3 (non default rxr generic values), issue caught on second configure with non m3 default values, eg tengiga 0

* removing test
2022-04-22 16:02:10 +02:00
e1642cf37c bugfix cmake zeromq 2022-04-19 20:11:31 +02:00
086d22f1a3 Cleaning up the find zmq (#431) 2022-04-19 17:17:31 +02:00
52882cba20 M3: polarity, interpolation, pump probe (#421)
* wip, adding m3 functions: polarity, inerpolation, pumpprobe

* added interpol, polarity, pump probe, analog pulsing, digital pulsing

* tests

* binaries in

* update release

* added python polarity enum

* fixed python and minor readability in mythen3.c

* binarie sin

* added all the m3 funcs also in list.c and enablingall counters for enabling interpolation

* binarie sin
2022-04-08 15:18:01 +02:00
27c7fd9a97 Merge pull request #423 from slsdetectorgroup/rmoldserver
copy detector server: rm old server
2022-04-08 14:56:50 +02:00
5d16ba7e16 update release 2022-04-08 11:10:15 +02:00
d8c6f9141d Fixed crash on gendoc (#430)
Fixed by checking for help action before using the detector
added test that checks that for all helps this doesn't crash
Disabled Timer tests by default since they take ~2s
2022-04-07 16:20:54 +02:00
e9dc3d8c38 minor changes (#429)
Various small changes to the data processor
2022-04-07 14:39:26 +02:00
62418c1316 sls_receiver_header* in callbacks (#425)
* char* to sls_receiver_header* in receiver data call backs

* uint32_t to size_t in callbacks

* string to const std::string & for callbacks
2022-04-07 10:19:47 +02:00
835aa575b0 remaining for removing copydetectorserver 2022-04-05 14:55:45 +02:00
b42d65c5e2 merge fix 2022-04-05 14:33:43 +02:00
150d27cf95 removed copydetectorserver 2022-04-05 14:11:04 +02:00
11bf6a5c58 update release notes 2022-04-04 15:44:34 +02:00
8bce87c082 delete old servers also for copy detector server (via tftp) 2022-04-04 15:41:58 +02:00
61f38bf5a9 clearer error message for unknown detector type when hostname error 2022-04-04 13:10:27 +02:00
cbc7066620 Merge branch 'rmoldserver' of github.com:slsdetectorgroup/slsDetectorPackage into rmoldserver 2022-04-04 12:47:19 +02:00
509ed9101f comments 2022-04-04 12:47:12 +02:00
191cfa0abe binaries in 2022-04-04 12:46:14 +02:00
f712847061 minor 2022-04-04 12:45:19 +02:00
b875a95bd5 binaries in 2022-04-04 12:44:03 +02:00
45f57ebeb7 compile, wip 2022-04-04 12:41:30 +02:00
0309eba3c6 redundant of getting abs path starting with '/' 2022-04-04 12:40:10 +02:00
f0448b3cec binaries in 2022-04-04 12:36:47 +02:00
a18af0b726 fix inittab to minimum, wip 2022-04-04 12:31:26 +02:00
6aa5cb8d3e abs path of abs path, wip 2022-04-04 12:26:02 +02:00
479906a9eb minor 2022-04-04 12:16:24 +02:00
28a503ed5a minor 2022-04-04 12:12:21 +02:00
b3c5a431d0 resolve abs path in root dir, wip 2022-04-04 11:58:36 +02:00
43cde3609a minor 2022-04-04 11:27:34 +02:00
9d2d8fe1d7 resolve for doubel slashes, wip 2022-04-04 11:17:41 +02:00
1826dd46cb minor 2022-04-04 10:57:27 +02:00
cf6423dbbe delete old servers, wip 2022-04-04 10:45:44 +02:00
8b1851e652 wip, copy server delete old name 2022-04-01 17:52:27 +02:00
a8bdc1495c Update issue templates 2022-03-01 10:19:57 +01:00
1c54dea9c7 Update issue templates 2022-03-01 10:18:52 +01:00
cee286b6ad Update issue templates 2022-03-01 10:16:41 +01:00
da8e0060d3 updated release notes and project version 2022-01-04 10:44:07 +01:00
85da65ca15 update versioning (prev commit) 2022-01-04 10:38:45 +01:00
4fe067363a This commit fixes the issue #336
A delay of 100ms has been added between the generation of the stop pulse and the resetCore function call. This should give enough time to the detector to readout and streamout the ongoing frame before the internal logic is reset (even after the transmission is delayed with txndelay_frame).

Conflicts:
	slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv6.1.0
2022-01-04 10:37:57 +01:00
488 changed files with 226782 additions and 34580 deletions

View File

@ -1,16 +1,24 @@
---
Checks: '*,
-altera-*,
-android-cloexec-fopen,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-fuchsia*,
-readability-else-after-return,
-readability-avoid-const-params-in-decls,
-readability-identifier-length,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-type-reinterpret-cast,
-llvm-header-guard,
-modernize-use-nodiscard,
-misc-non-private-member-variables-in-classes,
-readability-static-accessed-through-instance,
-readability-braces-around-statements,
-readability-isolate-declaration,
-readability-implicit-bool-conversion,
-readability-identifier-length,
-readability-identifier-naming,
-hicpp-signed-bitwise,
-hicpp-no-array-decay,
-hicpp-braces-around-statements,
@ -18,7 +26,6 @@ Checks: '*,
-google-readability-todo,
-google-readability-braces-around-statements,
-modernize-use-trailing-return-type,
-readability-isolate-declaration,
-llvmlibc-*'
HeaderFilterRegex: \.h

38
.github/workflows/cmake.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: CMake
on: [push, pull_request]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
name: Configure and build using cmake
steps:
- uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libhdf5-dev qtbase5-dev qt5-qmake libqt5svg5-dev
version: 1.0
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSLS_USE_TESTS=ON -DSLS_USE_HDF5=ON -DSLS_USE_GUI=ON -DSLS_USE_MOENCH=ON -DSLS_USE_PYTHON=ON
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build -j2 --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}} -j1

2
.gitignore vendored
View File

@ -9,7 +9,7 @@ bin/
*.o
*.so
.*
build
build/
RELEASE.txt
Testing/

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "python/pybind11"]
path = libs/pybind11
url = https://github.com/pybind/pybind11.git

View File

@ -0,0 +1 @@
# This file is generated by cmake for dependency checking of the CMakeCache.txt file

View File

@ -1,18 +1,62 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.14)
project(slsDetectorPackage)
set(PROJECT_VERSION 6.1.1)
set(PROJECT_VERSION 7.0.0)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
cmake_policy(SET CMP0074 NEW)
include(cmake/project_version.cmake)
#functions to add compiler flags
if (${CMAKE_VERSION} VERSION_GREATER "3.24")
cmake_policy(SET CMP0135 NEW) #Fetch content download timestamp
endif()
include(cmake/project_version.cmake)
include(cmake/SlsAddFlag.cmake)
# Include additional modules that are used unconditionally
# Using FetchContent to get libzmq
include(FetchContent)
option(SLS_FETCH_ZMQ_FROM_GITHUB "Fetch zmq from github" OFF)
option(SLS_FETCH_PYBIND11_FROM_GITHUB "Fetch pybind11 from github" OFF)
if(SLS_FETCH_ZMQ_FROM_GITHUB)
# Opt in to pull down a zmq version from github instead of
# using the bundled verison
FetchContent_Declare(
libzmq
GIT_REPOSITORY https://github.com/zeromq/libzmq.git
GIT_TAG v4.3.4
)
else()
# Standard behaviour use libzmq included in this repo (libs/libzmq)
FetchContent_Declare(
libzmq
URL ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq-4.3.4.tar.gz
URL_HASH MD5=cc20b769ac10afa352e5ed2769bb23b3
)
endif()
# Disable unwanted options from libzmq
set(BUILD_TESTS OFF CACHE BOOL "Switch off libzmq test build")
set(BUILD_SHARED OFF CACHE BOOL "Switch off libzmq shared libs")
set(WITH_PERF_TOOL OFF CACHE BOOL "")
set(ENABLE_CPACK OFF CACHE BOOL "")
set(ENABLE_CLANG OFF CACHE BOOL "")
set(ENABLE_CURVE OFF CACHE BOOL "")
set(ENABLE_DRAFTS OFF CACHE BOOL "")
# Using GetProperties and Populate to be able to exclude zmq
# from install (not possible with FetchContent_MakeAvailable(libzmq))
FetchContent_GetProperties(libzmq)
if(NOT libzmq_POPULATED)
FetchContent_Populate(libzmq)
add_subdirectory(${libzmq_SOURCE_DIR} ${libzmq_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
include(GNUInstallDirs)
# If conda build, always set lib dir to 'lib'
@ -26,7 +70,7 @@ string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER)
# Set targets export name (used by slsDetectorPackage and dependencies)
set(TARGETS_EXPORT_NAME "${PROJECT_NAME_LOWER}-targets")
#set(namespace "${PROJECT_NAME}::")
set(namespace "sls::")
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
@ -37,6 +81,8 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(SLS_MASTER_PROJECT ON)
endif()
option(SLS_USE_HDF5 "HDF5 File format" OFF)
option(SLS_BUILD_SHARED_LIBRARIES "Build shared libaries" ON)
option(SLS_USE_TEXTCLIENT "Text Client" ON)
@ -49,12 +95,14 @@ option(SLS_USE_TESTS "TESTS" OFF)
option(SLS_USE_INTEGRATION_TESTS "Integration Tests" OFF)
option(SLS_USE_SANITIZER "Sanitizers for debugging" OFF)
option(SLS_USE_PYTHON "Python bindings" OFF)
option(SLS_INSTALL_PYTHONEXT "Install the python extension in the install tree under CMAKE_INSTALL_PREFIX/python/" OFF)
option(SLS_USE_CTBGUI "ctb GUI" OFF)
option(SLS_BUILD_DOCS "docs" OFF)
option(SLS_BUILD_EXAMPLES "examples" OFF)
option(SLS_TUNE_LOCAL "tune to local machine" OFF)
option(SLS_DEVEL_HEADERS "install headers for devel" OFF)
option(SLS_USE_MOENCH "compile zmq and post processing for Moench" OFF)
option(SLS_USE_JUNGFRAU "compile post processing for Jungfrau" OFF)
#Convenience option to switch off defaults when building Moench binaries only
option(SLS_BUILD_ONLY_MOENCH "compile only Moench" OFF)
@ -68,6 +116,34 @@ if(SLS_BUILD_ONLY_MOENCH)
set(SLS_USE_MOENCH ON CACHE BOOL "Enable" FORCE)
endif()
#Convenience option to switch off defaults when building Jungfrau binaries only
option(SLS_BUILD_ONLY_JUNGFRAU "compile only Jungfrau" OFF)
if(SLS_BUILD_ONLY_JUNGFRAU)
message(STATUS "Build JUNGFRAU binaries only!")
set(SLS_BUILD_SHARED_LIBRARIES OFF CACHE BOOL "Disabled for JUNGFRAU_ONLY" FORCE)
set(SLS_USE_TEXTCLIENT OFF CACHE BOOL "Disabled for JUNGFRAU_ONLY" FORCE)
set(SLS_USE_DETECTOR OFF CACHE BOOL "Disabled for JUNGFRAU_ONLY" FORCE)
set(SLS_USE_RECEIVER OFF CACHE BOOL "Disabled for JUNGFRAU_ONLY" FORCE)
set(SLS_USE_RECEIVER_BINARIES OFF CACHE BOOL "Disabled for JUNGFRAU_ONLY" FORCE)
set(SLS_USE_JUNGFRAU ON CACHE BOOL "Enable" FORCE)
endif()
option(SLS_EXT_BUILD "external build of part of the project" OFF)
if(SLS_EXT_BUILD)
message(STATUS "External build using already installed libraries")
set(SLS_BUILD_SHARED_LIBRARIES OFF CACHE BOOL "Should already exist" FORCE)
set(SLS_USE_TEXTCLIENT OFF CACHE BOOL "Should already exist" FORCE)
set(SLS_USE_DETECTOR OFF CACHE BOOL "Should already exist" FORCE)
set(SLS_USE_RECEIVER OFF CACHE BOOL "Should already exist" FORCE)
set(SLS_USE_RECEIVER_BINARIES OFF CACHE BOOL "Should already exist" FORCE)
set(SLS_MASTER_PROJECT OFF CACHE BOOL "No master proj in case of extbuild" FORCE)
endif()
#Maybe have an option guarding this?
set(SLS_INTERNAL_RAPIDJSON_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/rapidjson)
set(SLS_INTERNAL_QWT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/qwt-6.1.5)
set(ClangFormat_EXCLUDE_PATTERNS "build/"
"libs/"
@ -79,9 +155,6 @@ set(ClangFormat_EXCLUDE_PATTERNS "build/"
${CMAKE_BINARY_DIR})
find_package(ClangFormat)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
@ -100,62 +173,68 @@ else()
endif()
#Add two fake libraries to manage options
add_library(slsProjectOptions INTERFACE)
add_library(slsProjectWarnings INTERFACE)
target_compile_features(slsProjectOptions INTERFACE cxx_std_11)
target_compile_options(slsProjectWarnings INTERFACE
-Wall
-Wextra
-Wno-unused-parameter
# -Wold-style-cast
-Wnon-virtual-dtor
-Woverloaded-virtual
-Wdouble-promotion
-Wformat=2
-Wredundant-decls
# -Wconversion
-Wvla
-Wdouble-promotion
-Werror=return-type
)
#Settings for C code
add_library(slsProjectCSettings INTERFACE)
target_compile_options(slsProjectCSettings INTERFACE
-std=gnu99 #fixed
-Wall
-Wextra
-Wno-unused-parameter
-Wdouble-promotion
-Wformat=2
-Wredundant-decls
-Wdouble-promotion
-Werror=return-type
)
#Testing for minimum version for compilers
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.2)
message(FATAL_ERROR "Clang version must be at least 3.2!")
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
message(FATAL_ERROR "GCC version must be at least 4.8!")
endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
target_compile_options(slsProjectWarnings INTERFACE
-Wno-missing-field-initializers)
endif()
if(SLS_EXT_BUILD)
# Find ourself in case of external build
find_package(slsDetectorPackage ${PROJECT_VERSION} REQUIRED)
endif()
# Add or disable warnings depending on if the compiler supports them
# The function checks internally and sets HAS_warning-name
sls_enable_cxx_warning("-Wnull-dereference")
sls_enable_cxx_warning("-Wduplicated-cond")
sls_disable_cxx_warning("-Wclass-memaccess")
sls_disable_c_warning("-Wstringop-truncation")
# slsProjectOptions and slsProjectWarnings are used
# to control options for the libraries
if(NOT TARGET slsProjectOptions)
add_library(slsProjectOptions INTERFACE)
target_compile_features(slsProjectOptions INTERFACE cxx_std_11)
endif()
if (NOT TARGET slsProjectWarnings)
add_library(slsProjectWarnings INTERFACE)
target_compile_options(slsProjectWarnings INTERFACE
-Wall
-Wextra
-Wno-unused-parameter
# -Wold-style-cast
-Wnon-virtual-dtor
-Woverloaded-virtual
-Wdouble-promotion
-Wformat=2
-Wredundant-decls
# -Wconversion
-Wvla
-Wdouble-promotion
-Werror=return-type
)
# Add or disable warnings depending on if the compiler supports them
# The function checks internally and sets HAS_warning-name
sls_enable_cxx_warning("-Wnull-dereference")
sls_enable_cxx_warning("-Wduplicated-cond")
sls_disable_cxx_warning("-Wclass-memaccess")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(slsProjectWarnings INTERFACE
-Wno-missing-field-initializers)
endif()
endif()
if (NOT TARGET slsProjectCSettings)
#Settings for C code
add_library(slsProjectCSettings INTERFACE)
target_compile_options(slsProjectCSettings INTERFACE
-std=gnu99 #fixed
-Wall
-Wextra
-Wno-unused-parameter
-Wdouble-promotion
-Wformat=2
-Wredundant-decls
-Wdouble-promotion
-Werror=return-type
)
sls_disable_c_warning("-Wstringop-truncation")
endif()
if(SLS_USE_SANITIZER)
@ -165,72 +244,34 @@ if(SLS_USE_SANITIZER)
# target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread)
endif()
if(SLS_TUNE_LOCAL)
target_compile_options(slsProjectOptions INTERFACE -mtune=native -march=native)
endif()
#rapidjson
add_library(rapidjson INTERFACE)
target_include_directories(rapidjson INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libs/rapidjson>
)
# Install fake the libraries
install(TARGETS slsProjectOptions slsProjectWarnings rapidjson
if(SLS_MASTER_PROJECT)
install(TARGETS slsProjectOptions slsProjectWarnings
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INSTALL_RPATH $ORIGIN)
# set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(ZeroMQ_HINT "" CACHE STRING "Hint where ZeroMQ could be found")
#Adapted from: https://github.com/zeromq/cppzmq/
if (NOT TARGET libzmq)
if(ZeroMQ_HINT)
message(STATUS "Looking for ZeroMQ in: ${ZeroMQ_HINT}")
find_package(ZeroMQ 4
NO_DEFAULT_PATH
HINTS ${ZeroMQ_DIR}
)
else()
find_package(ZeroMQ 4 QUIET)
endif()
# libzmq autotools install: fallback to pkg-config
if(NOT ZeroMQ_FOUND)
message(STATUS "CMake libzmq package not found, trying again with pkg-config (normal install of zeromq)")
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/libzmq-pkg-config)
find_package(ZeroMQ 4 REQUIRED)
endif()
# TODO "REQUIRED" above should already cause a fatal failure if not found, but this doesn't seem to work
if(NOT ZeroMQ_FOUND)
message(FATAL_ERROR "ZeroMQ was not found, neither as a CMake package nor via pkg-config")
endif()
if (ZeroMQ_FOUND AND NOT TARGET libzmq)
message(FATAL_ERROR "ZeroMQ version not supported!")
endif()
endif()
get_target_property(VAR libzmq INTERFACE_INCLUDE_DIRECTORIES)
message(STATUS "zmq: ${VAR}")
if (SLS_USE_TESTS)
enable_testing()
add_subdirectory(tests)
endif(SLS_USE_TESTS)
# Common functionallity to detector and receiver
add_subdirectory(slsSupportLib)
if(NOT SLS_EXT_BUILD)
add_subdirectory(slsSupportLib)
endif()
if (SLS_USE_DETECTOR OR SLS_USE_TEXTCLIENT)
add_subdirectory(slsDetectorSoftware)
@ -241,6 +282,7 @@ if (SLS_USE_RECEIVER)
endif (SLS_USE_RECEIVER)
if (SLS_USE_GUI)
add_subdirectory(libs/qwt)
add_subdirectory(slsDetectorGui)
endif (SLS_USE_GUI)
@ -254,7 +296,22 @@ endif (SLS_USE_INTEGRATION_TESTS)
if (SLS_USE_PYTHON)
find_package (Python 3.6 COMPONENTS Interpreter Development)
add_subdirectory(libs/pybind11)
if(SLS_FETCH_PYBIND11_FROM_GITHUB)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v2.11.0
)
else()
FetchContent_Declare(
pybind11
URL ${CMAKE_SOURCE_DIR}/libs/pybind11/v2.11.0.tar.gz
URL_HASH MD5=90c4946e87c64d8d8fc0ae4edf35d780
)
endif()
FetchContent_MakeAvailable(pybind11)
add_subdirectory(python)
endif(SLS_USE_PYTHON)
@ -279,6 +336,11 @@ if(SLS_USE_MOENCH)
add_subdirectory(slsDetectorCalibration/moenchExecutables)
endif(SLS_USE_MOENCH)
if(SLS_USE_JUNGFRAU)
add_subdirectory(slsDetectorCalibration/tiffio)
add_subdirectory(slsDetectorCalibration/jungfrauExecutables)
endif(SLS_USE_JUNGFRAU)
if(SLS_MASTER_PROJECT)
set(CMAKE_INSTALL_DIR "share/cmake/${PROJECT_NAME}")
set(PROJECT_LIBRARIES slsSupportShared slsDetectorShared slsReceiverShared)

279
README.md
View File

@ -1,102 +1,233 @@
### Note
## Dependencies
Before building from source make sure that you have the [software wiki](https://slsdetectorgroup.github.io/devdoc/dependencies.html) installed. If installing using conda, conda will manage the dependencies. Avoid also installing packages with pip.
Please do not update to any xxxx.xx.xx.dev0 tags. They are not releases, but tags for internal usage.
Use only releases with tags such as x.x.x or x.x.x-rcx.
## Documentaion
Detailed documentation can be found in the [software wiki](https://slsdetectorgroup.github.io/devdoc/index.html) and on the [official site](https://www.psi.ch/en/detectors/software).
### Documentation
##### 5.0.0 - Latest Release
Detailed documentation on the latest release can be found in the [software wiki](https://slsdetectorgroup.github.io/devdoc/index.html) and on the [official site](https://www.psi.ch/en/detectors/software).
## Installation
##### Older Releases
Documentation is found in the package.
### 1. Install binaries using conda
Conda is not only useful to manage python environments but can also
be used as a user space package manager. Dates in the tag (for eg. 2020.07.23.dev0)
are from the developer branch. Please use released tags for stability.
We have three different packages available:
* **slsdetlib** shared libraries and command line utilities
* **slsdetgui** GUI
* **slsdet** Python bindings
### Binaries
Binaries for the slsDetectorPackage are available through conda.
```
#Add conda channels
#Add channels for dependencies and our library
conda config --add channels conda-forge
conda config --add channels slsdetectorgroup
conda config --set channel_priority strict
conda install slsdetlib #only shared lib and command line
conda install slsdet #python bindings (includes slsdetlib)
conda install slsdetgui #gui (includes qt4)
#Install specific version
conda install slsdet=2020.03.02.dev0 #developer version from 3 March 2020
#create and activate an environment with our library
#replace 6.1.1 with the required tag
conda create -n myenv slsdetlib=6.1.1
conda activate myenv
#ready to use
sls_detector_get exptime
etc ...
```
### Source code
One can also obtain the source code from this repository and compile.
```
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git
# List available versions
# lib and binaries
conda search slsdetlib
# python
conda search slsdet
# gui
conda search slsdetgui
```
### 2. Build from source
##### 2.1 Download Source Code from github
```
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git --branch 7.0.0
```
**Pybind for Python**<br>
* **v7.0.0+**:
pybind11 packaged into 'libs/pybind'. No longer a submodule. No need for "recursive" or "submodule update".
* **Older versions**:
pybind11 is a submodule. Must be cloned using "recursive" and updated when switching between versions using the following commands.
```
#### Dependencies
# clone using recursive to get pybind11 submodule
git clone --recursive https://github.com/slsdetectorgroup/slsDetectorPackage.git
Refer [this page](https://slsdetectorgroup.github.io/devdoc/dependencies.html) for dependencies.
#### Compilation
Compiling can be done in two ways. Either with the convenience script
cmk.sh or directly with cmake for more control.
**1. Compile using script cmk.sh**<br>
These are mainly aimed at those not familiar with using ccmake and cmake.
# update submodule when switching between releases
cd slsDetectorPackage
git submodule update --init
```
The binaries are generated in slsDetectorPackage/build/bin directory.
Usage: ./cmk.sh [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [n] [-h] [z] [-d <HDF5 directory>] [-l Install directory] [-k <CMake command>] [-j <Number of threads>]
-[no option]: only make
-c: Clean
-b: Builds/Rebuilds CMake files normal mode
-p: Builds/Rebuilds Python API
-h: Builds/Rebuilds Cmake files with HDF5 package
-d: HDF5 Custom Directory
-k: CMake command
-l: Install directory
-t: Build/Rebuilds only text client
-r: Build/Rebuilds only receiver
-g: Build/Rebuilds only gui
-s: Simulator
-u: Chip Test Gui
-j: Number of threads to compile through
-e: Debug mode
-i: Builds tests
-m: Manuals
-n: Manuals without compiling doxygen (only rst)
-z: Moench zmq processor
##### 2.2 Build from source
###### Build using CMake
```
# outside slsDetecorPackage folder
mkdir build && cd build
# configure & generate Makefiles using cmake
# by listing all your options (alternately use ccmake described below)
# cmake3 for some systems
cmake ../slsDetectorPackage -DCMAKE_INSTALL_PREFIX=/your/install/path
# compiled to the build/bin directory
make -j12 #or whatever number of cores you are using to build
# install headers and libs in /your/install/path directory
make install
```
Instead of the cmake command, one can use ccmake to get a list of options to configure and generate Makefiles at ease.
```
# ccmake3 for some systems
ccmake ..
# choose the options
# first press [c] - configure
# then press [g] - generate
```
|Example cmake options|Comment|
|---|---|
| -DSLS_USE_PYTHON=ON | Python |
| -DPython_FIND_VIRTUALENV=ONLY | Python from only the conda environment |
| -DZeroMQ_HINT=/usr/lib64 | Use system zmq instead |
| -DSLS_USE_GUI=ON | GUI |
###### Build using in-built cmk.sh script
```
The binaries are generated in slsDetectorPackage/build/bin directory.
Usage: ./cmk.sh [-b] [-c] [-d <HDF5 directory>] [e] [g] [-h] [i] [-j <Number of threads>]
[-k <CMake command>] [-l <Install directory>] [m] [n] [-p] [-q <Zmq hint directory>]
[r] [s] [t] [u] [z]
-[no option]: only make
-b: Builds/Rebuilds CMake files normal mode
-c: Clean
-d: HDF5 Custom Directory
-e: Debug mode
-g: Build/Rebuilds gui
-h: Builds/Rebuilds Cmake files with HDF5 package
-i: Builds tests
-j: Number of threads to compile through
-k: CMake command
-l: Install directory
-m: Manuals
-n: Manuals without compiling doxygen (only rst)
-p: Builds/Rebuilds Python API
-q: Zmq hint directory
-r: Build/Rebuilds only receiver
-s: Simulator
-t: Build/Rebuilds only text client
-u: Chip Test Gui
-z: Moench zmq processor
# get all options
./cmk.sh -?
# display all options
./cmk.sh -?
# new build and compile in parallel:
./cmk.sh -bj5
```
**2. Compile without script**<br>
Use cmake to create out-of-source builds, by creating a build folder parallel to source directory. This would create a debug build with address sanitizers.
```
$ mkdir build
$ cd build
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON
$ make -j12 #or whatever number of threads wanted
# new build and compile in parallel (recommended basic option):
./cmk.sh -cbj5
# new build, python and compile in parallel:
./cmk.sh -cbpj5
#To use the system zmq (/usr/lib64) instead
./cmk.sh -cbj5 -q /usr/lib64
```
To install binaries using CMake
###### Build on old distributions
If your linux distribution doesn't come with a C++11 compiler (gcc>4.8) then
it's possible to install a newer gcc using conda and build the slsDetectorPackage
using this compiler
```
git clone --recursive https://github.com/slsdetectorgroup/slsDetectorPackage.git
mkdir build && cd build
cmake ../slsDetectorPackage -DCMAKE_INSTALL_PREFIX=/your/install/path
make -j12 #or whatever number of cores you are using to build
make install
#Create an environment with the dependencies
conda create -n myenv gxx_linux-64 cmake zmq
conda activate myenv
# outside slsDetecorPackage folder
mkdir build && cd build
cmake ../slsDetectorPackage -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
make -j12
```
###### Build slsDetectorGui (Qt5)
1. Using pre-built binary on conda
```
conda create -n myenv slsdetgui=7.0.0
conda activate myenv
```
2. Using system installation on RHEL7
```
yum install qt5-qtbase-devel.x86_64
yum install qt5-qtsvg-devel.x86_64
```
3. Using conda
```
#Add channels for dependencies and our library
conda config --add channels conda-forge
conda config --add channels slsdetectorgroup
conda config --set channel_priority strict
# create environment to compile
# on rhel7
conda create -n slsgui zeromq gxx_linux-64 gxx_linux-64 mesa-libgl-devel-cos6-x86_64 qt
# on fedora or newer systems
conda create -n slsgui zeromq qt
# when using conda compilers, would also need libgl, but no need for it on fedora unless maybe using it with ROOT
# activate environment
conda activate slsgui
# compile with cmake outside slsDetecorPackage folder
mkdir build && cd build
cmake ../slsDetectorPackage -DSLS_USE_GUI=ON
make -j12
# or compile with cmk.sh
cd slsDetectorPackage
./cmk.sh -cbgj9
```
###### Build documentation from package
The documentation for the slsDetectorPackage is build using a combination
of Doxygen, Sphinx and Breathe. The easiest way to install the dependencies
is to use conda
```
conda create -n myenv python sphinx_rtd_theme breathe
```
```
# using cmake or ccmake to enable DSLS_BUILD_DOCS
# outside slsDetecorPackage folder
mkdir build && cd build
cmake ../slsDetectorPackage -DSLS_BUILD_DOCS=ON
make docs # generate API docs and build Sphinx RST
make rst # rst only, saves time in case the API did not change
```
### Support
## Support
dhanya.thattil@psi.ch
erik.frojdh@psi.ch
erik.frojdh@psi.ch

215
RELEASE.txt Executable file → Normal file
View File

@ -1,138 +1,131 @@
SLS Detector Package Minor Release 7.0.0 released on 25.11.2021
SLS Detector Package Major Release 7.x.x released on xx.xx.2023
===============================================================
This document describes the differences between v7.0.0 and v6.x.x
This document describes the differences between v7.x.x and v7.0.2
CONTENTS
--------
1. New or Changed Features
2. Resolved Issues
3. Firmware Requirements
4. Kernel Requirements
5. Download, Documentation & Support
1 New, Changed or Resolved Features
1.1 Compilation
1.2 Callback
1.3 Python
1.4 Client
1.5 Detector Server
1.6 Simulator
1.7 Receiver
1.8 Gui
2 On-board Detector Server Compatibility
3 Firmware Requirements
4 Kernel Requirements
5 Download, Documentation & Support
1. New or Changed Features
==========================
- Fixed minor warnings (will fix commandline print of excess packets for missing packets)
- ctb slow adcs and any other adcs (other than temp) goes to the control Server
- number of udp interfaces is 2 for Eiger (CHANGE IN API??)
- added module id for virtual servers into the udp header
- refactoring (rxr)
- fixed patsetbit and patsetmask for moench
- changed default vref of adc9257 to 2V for moench (from 1.33V)
- moench and ctb - can set the starting frame number of next acquisition
- mythen server kernel check incompatible (cet timezone)
- rx_arping
- rx_threadsids max is now 9 (breaking api)
- fixed datastream disabling for eiger. Its only available in 10g mode.
- m3 server crash (vthrehsold dac names were not provided)
- allow vtrim to be interpolated for Eiger settings
- m3 setThresholdEnergy and setAllThresholdEnergy was overwriting gaincaps with settings enum
- can set localhost with virtual server with minimum configuration: (hostname localhost, rx_hostname localhost, udp_dstip auto)
- increases the progress according to listened index. (not processed index)
- current frame index points to listened frame index (not processed index)
- when in discard partial frames or empty mode, the frame number doesnt increase by 1, it increases to that number (so its faster)
- file write disabled by default
- eiger 12 bit mode
- start non blocking acquisition at modular level
- connect master commands to api (allow set master for eiger)
--ignore-config command line
- command line argument 'master' mainly for virtual servers (also master/top for real eiger), only one virtual server for eiger, use command lines for master/top
- stop servers also check for errors at startup( in case it was running with an older version)
- hostname cmd failed when connecting to servers in update mode (ctb, moench, jungfrau, eiger)
- missingpackets signed (negative => extra packets)
- framescaught and frameindex now returns a vector for each port
- progress looks at activated or enabled ports, so progress does not stagnate
- (eiger) disable datastreaming also for virtual servers only for 10g
- missing packets also takes care of disabled ports
- added geometry to metadata
- 10g eiger nextframenumber get fixed.
- stop, able to set nextframenumber to a consistent (max + 1) for all modules if different (eiger/ctb/jungfrau/moench)
- ctb: can set names for all the dacs
- fpga/kernel programming, checks if drive is a special file and not a normal file
- gotthard 25 um image reconstructed in gui and virtual hdf5 (firmware updated for slave to reverse channels)
- master binary file in json format now
- fixed bug introduced in 6.0.0: hdf5 files created 1 file per frame after the initial file which had maxframesperfile
2. Resolved Issues
==================
1 New, Changed or Resolved Features
=====================================
3. Firmware Requirements
========================
Eiger
=====
Compatible version : 08.10.2021 (v29)
- moench being made compatible with jungfrau 2.0 boards (jungfrau structure, away from ctb)
- eiger febl and feb in versions
- fix ctb slow adcs
2 On-board Detector Server Compatibility
==========================================
Eiger 7.0.0
Jungfrau 7.0.2
Mythen3 7.0.0
Gotthard2 7.0.0
Gotthard 7.0.0
Moench 7.0.0
Ctb 7.0.0
Jungfrau
========
Compatible version : 31.08.2021 (v1.2, PCB v1.0)
: 08.10.2021 (v2.2, PCB v2.0)
Gotthard
========
Compatible version : 08.02.2018 (50um and 25um Master)
: 09.02.2018 (25 um Slave)
On-board Detector Server Upgrade
--------------------------------
Mythen3
=======
Compatible version : 10.09.2021 (v1.1)
Gotthard2
=========
Compatible version : 27.05.2021 (v0.1)
Moench
======
Compatible version : 05.10.2020 (v1.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
From v6.1.0 (without tftp):
Using command 'updatedetectorserver'
From 5.0.0 (with tftp):
Using command 'copydetectorserver'
Instructions available at
https://slsdetectorgroup.github.io/devdoc/firmware.html
and
https://slsdetectorgroup.github.io/devdoc/serverupgrade.html
4. Kernel Requirements
3 Firmware Requirements
========================
Eiger 20.02.2023 (v31)
Jungfrau 04.11.2022 (v1.4, HW v1.0)
03.11.2022 (v2.4, HW v2.0)
Mythen3 24.01.2023 (v1.4)
Gotthard2 23.11.2022 (v0.3)
Gotthard 08.02.2018 (50um and 25um Master)
09.02.2018 (25 um Slave)
Moench 05.12.2022 (v0.3)
Ctb 03.04.2023 (v1.2?)
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>
Gotthard cannot be upgraded remotely
Except Eiger,
upgrade
Using command 'programfpga' or
udpate both server and firmware simultaneously
Using command 'update'
Instructions available at
https://slsdetectorgroup.github.io/devdoc/firmware.html
4 Kernel Requirements
======================
Blackfin
========
--------
Latest version: Fri Oct 29 00:00:00 2021
Older ones will work, but might have issues with programming firmware via
the package.
Nios
====
-----
Compatible version: Mon May 10 18:00:21 CEST 2021
Kernel Upgrade
==============
---------------
Eiger via bit files
Others via command
@ -144,7 +137,8 @@ This document describes the differences between v7.0.0 and v6.x.x
5. Download, Documentation & Support
5 Download, Documentation & Support
====================================
Download
@ -157,7 +151,10 @@ This document describes the differences between v7.0.0 and v6.x.x
-------------
Installation:
https://slsdetectorgroup.github.io/devdoc/installation.html#
https://slsdetectorgroup.github.io/devdoc/installation.html
Quick Start Guide:
https://slsdetectorgroup.github.io/devdoc/quick_start_guide.html
Firmware Upgrade:
https://slsdetectorgroup.github.io/devdoc/firmware.html
@ -177,9 +174,6 @@ This document describes the differences between v7.0.0 and v6.x.x
Command Line Documentation:
https://slsdetectorgroup.github.io/devdoc/commandline.html
Quick Start Guide:
https://slsdetectorgroup.github.io/devdoc/quick_start_guide.html
C++ API Documentation:
https://slsdetectorgroup.github.io/devdoc/detector.html
@ -196,8 +190,16 @@ This document describes the differences between v7.0.0 and v6.x.x
https://slsdetectorgroup.github.io/devdoc/receivers.html
https://slsdetectorgroup.github.io/devdoc/slsreceiver.html
Detector UDP Header:
https://slsdetectorgroup.github.io/devdoc/udpheader.html
https://slsdetectorgroup.github.io/devdoc/udpdetspec.html
slsReceiver Zmq Format:
https://slsdetectorgroup.github.io/devdoc/slsreceiver.html#zmq-json-header-format
TroubleShooting:
https://slsdetectorgroup.github.io/devdoc/troubleshooting.html
https://slsdetectorgroup.github.io/devdoc/troubleshooting.html#receiver-pc-tuning-options
Further Documentation:
https://www.psi.ch/en/detectors/documentation
@ -211,4 +213,3 @@ This document describes the differences between v7.0.0 and v6.x.x
dhanya.thattil@psi.ch
erik.frojdh@psi.ch

1
bash_autocomplete.sh Symbolic link
View File

@ -0,0 +1 @@
slsDetectorSoftware/generator/autocomplete/bash_autocomplete.sh

View File

@ -1,118 +0,0 @@
# Qt Widgets for Technical Applications
# available at http://www.http://qwt.sourceforge.net/
#
# The module defines the following variables:
# QWT_FOUND - the system has Qwt
# QWT_INCLUDE_DIR - where to find qwt_plot.h
# QWT_INCLUDE_DIRS - qwt includes
# QWT_LIBRARY - where to find the Qwt library
# QWT_LIBRARIES - aditional libraries
# QWT_MAJOR_VERSION - major version
# QWT_MINOR_VERSION - minor version
# QWT_PATCH_VERSION - patch version
# QWT_VERSION_STRING - version (ex. 5.2.1)
# QWT_ROOT_DIR - root dir (ex. /usr/local)
#=============================================================================
# Copyright 2010-2013, Julien Schueller
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# The views and conclusions contained in the software and documentation are those
# of the authors and should not be interpreted as representing official policies,
# either expressed or implied, of the FreeBSD Project.
#=============================================================================
find_path ( QWT_INCLUDE_DIR
NAMES qwt_plot.h
HINTS $ENV{QWTDIR} $ENV{QWTDIR}/src ${QT_INCLUDE_DIR}
PATH_SUFFIXES qwt qwt-qt3 qwt-qt4 qwt-qt5
)
set ( QWT_INCLUDE_DIRS ${QWT_INCLUDE_DIR} )
# version
set ( _VERSION_FILE ${QWT_INCLUDE_DIR}/qwt_global.h )
if ( EXISTS ${_VERSION_FILE} )
file ( STRINGS ${_VERSION_FILE} _VERSION_LINE REGEX "define[ ]+QWT_VERSION_STR" )
if ( _VERSION_LINE )
string ( REGEX REPLACE ".*define[ ]+QWT_VERSION_STR[ ]+\"(.*)\".*" "\\1" QWT_VERSION_STRING "${_VERSION_LINE}" )
string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" QWT_MAJOR_VERSION "${QWT_VERSION_STRING}" )
string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" QWT_MINOR_VERSION "${QWT_VERSION_STRING}" )
string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\3" QWT_PATCH_VERSION "${QWT_VERSION_STRING}" )
endif ()
endif ()
# check version
set ( _QWT_VERSION_MATCH TRUE )
if ( Qwt_FIND_VERSION AND QWT_VERSION_STRING )
if ( Qwt_FIND_VERSION_EXACT )
if ( NOT Qwt_FIND_VERSION VERSION_EQUAL QWT_VERSION_STRING )
set ( _QWT_VERSION_MATCH FALSE )
endif ()
else ()
if ( QWT_VERSION_STRING VERSION_LESS Qwt_FIND_VERSION )
set ( _QWT_VERSION_MATCH FALSE )
endif ()
endif ()
endif ()
find_library ( QWT_LIBRARY
NAMES qwt qwt-qt3 qwt-qt4 qwt-qt5
HINTS $ENV{QWTDIR}/lib ${QT_LIBRARY_DIR}
)
set ( QWT_LIBRARIES ${QWT_LIBRARY} )
# try to guess root dir from include dir
if ( QWT_INCLUDE_DIR )
string ( REGEX REPLACE "(.*)/include.*" "\\1" QWT_ROOT_DIR ${QWT_INCLUDE_DIR} )
# try to guess root dir from library dir
elseif ( QWT_LIBRARY )
string ( REGEX REPLACE "(.*)/lib[/|32|64].*" "\\1" QWT_ROOT_DIR ${QWT_LIBRARY} )
endif ()
# handle the QUIETLY and REQUIRED arguments
include ( FindPackageHandleStandardArgs )
if ( CMAKE_VERSION LESS 2.8.3 )
find_package_handle_standard_args( Qwt DEFAULT_MSG QWT_LIBRARY QWT_INCLUDE_DIR _QWT_VERSION_MATCH )
else ()
find_package_handle_standard_args( Qwt REQUIRED_VARS QWT_LIBRARY QWT_INCLUDE_DIR _QWT_VERSION_MATCH VERSION_VAR QWT_VERSION_STRING )
endif ()
mark_as_advanced (
QWT_LIBRARY
QWT_LIBRARIES
QWT_INCLUDE_DIR
QWT_INCLUDE_DIRS
QWT_MAJOR_VERSION
QWT_MINOR_VERSION
QWT_PATCH_VERSION
QWT_VERSION_STRING
QWT_ROOT_DIR
)

View File

@ -25,11 +25,6 @@ install(FILES
DESTINATION ${CMAKE_INSTALL_DIR}
)
install(FILES
"${CMAKE_SOURCE_DIR}/libzmq-pkg-config/FindZeroMQ.cmake"
COMPONENT devel
DESTINATION ${CMAKE_INSTALL_DIR}/libzmq-pkg-config
)
if (PROJECT_LIBRARIES OR PROJECT_STATIC_LIBRARIES)
install(

View File

@ -13,17 +13,6 @@ include(CMakeFindDependencyMacro)
set(SLS_USE_HDF5 "@SLS_USE_HDF5@")
find_package(ZeroMQ 4 QUIET)
# libzmq autotools install: fallback to pkg-config
if(NOT ZeroMQ_FOUND)
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/libzmq-pkg-config)
find_package(ZeroMQ 4 REQUIRED)
endif()
if(NOT ZeroMQ_FOUND)
message(FATAL_ERROR "ZeroMQ was NOT found!")
endif()
find_dependency(Threads)
# Add optional dependencies here

119
cmk.sh
View File

@ -26,25 +26,25 @@ CMAKE_PRE=""
CMAKE_POST=""
usage() { echo -e "
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [n] [-h] [z] [-d <HDF5 directory>] [-l Install directory] [-k <CMake command>] [-j <Number of threads>]
Usage: $0 [-b] [-c] [-d <HDF5 directory>] [-e] [-g] [-h] [-i] [-j <Number of threads>] [-k <CMake command>] [-l <Install directory>] [-m] [-n] [-p] [-r] [-s] [-t] [-u] [-z]
-[no option]: only make
-c: Clean
-b: Builds/Rebuilds CMake files normal mode
-p: Builds/Rebuilds Python API
-h: Builds/Rebuilds Cmake files with HDF5 package
-c: Clean
-d: HDF5 Custom Directory
-e: Debug mode
-g: Build/Rebuilds gui
-h: Builds/Rebuilds Cmake files with HDF5 package
-i: Builds tests
-j: Number of threads to compile through
-k: CMake command
-l: Install directory
-t: Build/Rebuilds only text client
-r: Build/Rebuilds only receiver
-g: Build/Rebuilds only gui
-s: Simulator
-u: Chip Test Gui
-j: Number of threads to compile through
-e: Debug mode
-i: Builds tests
-m: Manuals
-n: Manuals without compiling doxygen (only rst)
-p: Builds/Rebuilds Python API
-r: Build/Rebuilds only receiver
-s: Simulator
-t: Build/Rebuilds only text client
-u: Chip Test Gui
-z: Moench zmq processor
Rebuild when you switch to a new build and compile in parallel:
@ -81,69 +81,50 @@ For rebuilding only certain sections
" ; exit 1; }
while getopts ":bpchd:k:l:j:trgeisumnz" opt ; do
while getopts ":bcd:eghij:k:l:mnpq:rstuz" opt ; do
case $opt in
b)
echo "Building of CMake files Required"
REBUILD=1
;;
p)
echo "Compiling Options: Python"
PYTHON=1
REBUILD=1
;;
c)
echo "Clean Required"
CLEAN=1
;;
h)
echo "Building of CMake files with HDF5 option Required"
HDF5=1
REBUILD=1
;;
d)
echo "New HDF5 directory: $OPTARG"
HDF5DIR=$OPTARG
;;
l)
echo "CMake install directory: $OPTARG"
INSTALLDIR="$OPTARG"
e)
echo "Compiling Options: Debug"
DEBUG=1
;;
g)
echo "Compiling Options: GUI"
GUI=1
REBUILD=1
;;
h)
echo "Building of CMake files with HDF5 option Required"
HDF5=1
REBUILD=1
;;
i)
echo "Compiling Options: Tests"
TESTS=1
;;
j)
echo "Number of compiler threads: $OPTARG"
COMPILERTHREADS=$OPTARG
;;
k)
echo "CMake command: $OPTARG"
CMAKE="$OPTARG"
;;
j)
echo "Number of compiler threads: $OPTARG"
COMPILERTHREADS=$OPTARG
l)
echo "CMake install directory: $OPTARG"
INSTALLDIR="$OPTARG"
;;
t)
echo "Compiling Options: Text Client"
TEXTCLIENT=1
REBUILD=1
;;
r)
echo "Compiling Options: Receiver"
RECEIVER=1
REBUILD=1
;;
g)
echo "Compiling Options: GUI"
GUI=1
REBUILD=1
;;
e)
echo "Compiling Options: Debug"
DEBUG=1
;;
i)
echo "Compiling Options: Tests"
TESTS=1
;;
s)
echo "Compiling Options: Simulator"
SIMULATOR=1
;;
m)
echo "Compiling Manuals"
MANUALS=1
@ -152,14 +133,33 @@ while getopts ":bpchd:k:l:j:trgeisumnz" opt ; do
echo "Compiling Manuals (Only RST)"
MANUALS_ONLY_RST=1
;;
z)
echo "Compiling Moench Zmq Processor"
MOENCHZMQ=1
p)
echo "Compiling Options: Python"
PYTHON=1
REBUILD=1
;;
r)
echo "Compiling Options: Receiver"
RECEIVER=1
REBUILD=1
;;
s)
echo "Compiling Options: Simulator"
SIMULATOR=1
;;
t)
echo "Compiling Options: Text Client"
TEXTCLIENT=1
REBUILD=1
;;
u)
echo "Compiling Options: Chip Test Gui"
CTBGUI=1
;;
z)
echo "Compiling Moench Zmq Processor"
MOENCHZMQ=1
;;
\?)
echo "Invalid option: -$OPTARG"
usage
@ -254,7 +254,6 @@ if [ $TESTS -eq 1 ]; then
echo "Tests Option enabled"
fi
#hdf5 rebuild
if [ $HDF5 -eq 1 ]; then
# CMAKE_PRE+="HDF5_ROOT="$HDF5DIR

View File

@ -21,4 +21,4 @@ echo "Building using: ${NCORES} cores"
cmake --build . -- -j${NCORES}
cmake --build . --target install
CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2
CTEST_OUTPUT_ON_FAILURE=1 ctest -j 1

View File

@ -1,9 +1,7 @@
python:
- 3.6
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
numpy:
- 1.17

View File

@ -19,4 +19,4 @@ cp build/install/bin/slsMultiReceiver $PREFIX/bin/.
cp build/install/include/sls/* $PREFIX/include/sls
cp -r build/install/share/ $PREFIX/share
cp -rv build/install/share $PREFIX

View File

@ -17,9 +17,7 @@ requirements:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- cmake
- qwt 6.*
- qt 4.8.*
- zeromq
- qt 5.*
- xorg-libx11
- xorg-libice
- xorg-libxext
@ -38,7 +36,6 @@ requirements:
host:
- libstdcxx-ng
- libgcc-ng
- zeromq
- xorg-libx11
- xorg-libice
- xorg-libxext
@ -49,7 +46,6 @@ requirements:
- expat
run:
- zeromq
- libstdcxx-ng
- libgcc-ng
@ -64,15 +60,11 @@ outputs:
- {{compiler('cxx')}}
- libstdcxx-ng
- libgcc-ng
- zeromq
host:
- zeromq
run:
- libstdcxx-ng
- libgcc-ng
- zeromq
- name: slsdet
@ -85,10 +77,12 @@ outputs:
- {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }}
- setuptools
- pybind11=2.11
host:
- python
- {{ pin_subpackage('slsdetlib', exact=True) }}
- pybind11=2.11
run:
@ -111,12 +105,10 @@ outputs:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }}
- qwt 6.*
run:
- {{ pin_subpackage('slsdetlib', exact=True) }}
- qwt 6.*
- qt 4.8.*
- qt 5.*
- expat
- name: moenchzmq

View File

@ -828,14 +828,14 @@ void ctbAcquisition::setCanvas(TCanvas* c) {
myCanvas->AddExec("dynamic",Form("((ctbAcquisition*)%p)->canvasClicked()",this));
// myCanvas->AddExec("ex","canvasClicked()");
}
void ctbAcquisition::dataCallback(detectorData *data, long unsigned int index, unsigned int dum, void* pArgs) {
void ctbAcquisition::dataCallback(sls::detectorData *data, long unsigned int index, unsigned int dum, void* pArgs) {
// return
((ctbAcquisition*)pArgs)->plotData(data,index);
}
int ctbAcquisition::plotData(detectorData *data, int index) {
int ctbAcquisition::plotData(sls::detectorData *data, int index) {
/*
******************************************************************
@ -988,7 +988,7 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
ped=0;
aval=dataStructure->getValue(data->data,x,y);
//aval=dataStructure->getChannel(data->data,x,y);
cout << x << " " <<y << " "<< aval << endl;
// cout << x << " " <<y << " "<< aval << endl;
if (cbGetPedestal->IsOn()) {
if (photonFinder) {
photonFinder->addToPedestal(aval,x,y);

View File

@ -28,8 +28,8 @@ class TGTextButton;
namespace sls
{
class Detector;
class detectorData;
};
class detectorData;
template <class dataType> class slsDetectorData;
@ -201,10 +201,10 @@ class ctbAcquisition : public TGGroupFrame {
void setBitGraph (int i ,int en, Pixel_t col);
void startAcquisition();
static void progressCallback(double,void*);
static void dataCallback(detectorData*, long unsigned int, unsigned int, void*);
static void dataCallback(sls::detectorData*, long unsigned int, unsigned int, void*);
int StopFlag;
int plotData(detectorData*, int);
int plotData(sls::detectorData*, int);
void setPatternFile(const char* t);

View File

@ -1,112 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/utsname.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <math.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
int iarg;
char fname[10000];
uint64_t word;
int val[64];
int bit[64];
FILE *fdin;
int nb=2;
int off=0;
int ioff=0;
int dr=24;
int idr=0;
int ib=0;
int iw=0;
bit[0]=19;
bit[1]=8;
// for (iarg=0; iarg<argc; iarg++) printf("%d %s\n",iarg, argv[iarg]);
if (argc<2) printf("Error: usage is %s fname [dr off b0 b1 bn]\n");
if (argc>2) dr=atoi(argv[2]);
if (argc>3) off=atoi(argv[3]);
if (argc>4) {
for (ib=0; ib<64; ib++) {
if (argc>4+ib) {
bit[ib]=atoi(argv[4+ib]);
nb++;
}
}
}
idr=0;
for (ib=0; ib<nb; ib++) {
val[ib]=0;
}
fdin=fopen(argv[1],"rb");
if (fdin==NULL) {
printf("Cannot open input file %s for reading\n",argv[1]);
return 200;
}
while (fread((void*)&word, 8, 1, fdin)) {
// printf("%llx\n",word);
if (ioff<off) ioff++;
else {
for (ib=0; ib<nb; ib++) {
if (word&(1<<bit[ib])) val[ib]|=(1<<idr);
}
idr++;
if (idr==dr) {
idr=0;
fprintf(stdout,"%d\t",iw++);
for (ib=0; ib<nb; ib++) {
#ifdef HEX
fprintf(stdout,"%08llx\t",val[ib]);
#else
fprintf(stdout,"%lld\t",val[ib]);
#endif
val[ib]=0;
}
fprintf(stdout,"\n");
}
}
}
if (idr!=0) {
fprintf(stdout,"%d\t",iw++);
for (ib=0; ib<nb; ib++) {
#ifdef HEX
fprintf(stdout,"%08llx\t",val[ib]);
#else
fprintf(stdout,"%lld\t",val[ib]);
#endif
val[ib]=0;
}
fprintf(stdout,"\n");
}
fclose(fdin);
return 0;
}

View File

@ -1,179 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
/****************************************************************************
usage to generate a patter test.pat from test.p
gcc -DINFILE="\"test.p\"" -DOUTFILE="\"test.pat\"" -o test.exe generator.c ; ./test.exe ; rm test.exe
*************************************************************************/
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/utsname.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <math.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define MAXLOOPS 3
#define MAXTIMERS 3
#define MAXWORDS 1024
uint64_t pat=0;
uint64_t iopat=0;
uint64_t clkpat=0;
int iaddr=0;
int waitaddr[3]={MAXWORDS,MAXWORDS,MAXWORDS};
int startloopaddr[3]={MAXWORDS,MAXWORDS,MAXWORDS};
int stoploopaddr[3]={MAXWORDS,MAXWORDS,MAXWORDS};
int start=0, stop=0;
uint64_t waittime[3]={0,0,0};
int nloop[3]={0,0,0};
char infile[10000], outfile[10000];
FILE *fd, *fd1;
uint64_t PAT[MAXWORDS];
int i,ii,iii,j,jj,jjj,pixx,pixy,memx,memy,muxout,memclk,colclk,rowclk,muxclk,memcol,memrow,loopcounter;
void setstart() {
start=iaddr;
}
void setstop() {
stop=iaddr;
}
void setinput(int bit) {
uint64_t mask=1;
mask=mask<<bit;
iopat &= ~mask;
}
void setoutput(int bit) {
uint64_t mask=1;
mask=mask<<bit;
iopat |= mask;
}
/*
void setclk(int bit) {
uint64_t mask=1;
mask=mask<<bit;
iopat |= mask;
clkpat |= mask;
}
*/
void clearbit(int bit){
uint64_t mask=1;
mask=mask<<bit;
pat &= ~mask;
}
void setbit(int bit){
uint64_t mask=1;
mask=mask<<bit;
pat |= mask;
}
int checkbit(int bit) {
uint64_t mask=1;
mask=mask<<bit;
return (pat & mask ) >>bit;
}
void setstartloop(int iloop) {
if (iloop>=0 && iloop<MAXLOOPS)
startloopaddr[iloop]=iaddr;
}
void setstoploop(int iloop) {
if (iloop>=0 && iloop<MAXLOOPS)
stoploopaddr[iloop]=iaddr;
}
void setnloop(int iloop, int n) {
if (iloop>=0 && iloop<MAXLOOPS)
nloop[iloop]=n;
}
void setwaitpoint(int iloop) {
if (iloop>=0 && iloop<MAXTIMERS)
waitaddr[iloop]=iaddr;
}
void setwaittime(int iloop, uint64_t t) {
if (iloop>=0 && iloop<MAXTIMERS)
waittime[iloop]=t;
}
void pw(){
if (iaddr<MAXWORDS)
PAT[iaddr]= pat;
fprintf(fd,"patword 0x%04x 0x%016llx\n",iaddr, pat);
iaddr++;
if (iaddr>=MAXWORDS) printf("ERROR: too many word in the pattern (%d instead of %d)!",iaddr, MAXWORDS);
}
int parseCommand(int clk, int cmdbit, int cmd, int length) {
int ibit;
clearbit(clk);
for (ibit=0; ibit<length; ibit++) {
if (cmd&(1>>ibit))
setbit(cmdbit);
else
clearbit(cmdbit);
pw();
/******/
setbit(clk);
pw();
/******/
}
};
main(void) {
int iloop=0;
fd=fopen(OUTFILE,"w");
#include INFILE
fprintf(fd,"patioctrl 0x%016llx\n",iopat);
//fprintf(fd,"patclkctrl 0x%016llx\n",clkpat);
fprintf(fd,"patlimits 0x%04x 0x%04x\n",start, stop);
for (iloop=0; iloop<MAXLOOPS; iloop++) {
fprintf(fd,"patloop%d 0x%04x 0x%04x\n",iloop, startloopaddr[iloop], stoploopaddr[iloop]);
if ( startloopaddr[iloop]<0 || stoploopaddr[iloop]<= startloopaddr[iloop]) nloop[iloop]=0;
fprintf(fd,"patnloop%d %d\n",iloop, nloop[iloop]);
}
for (iloop=0; iloop<MAXTIMERS; iloop++) {
fprintf(fd,"patwait%d 0x%04x\n",iloop, waitaddr[iloop]);
if (waitaddr[iloop]<0) waittime[iloop]=0;
fprintf(fd,"patwaittime%d %lld\n",iloop, waittime[iloop]);
}
close((int)fd);
fd1=fopen(OUTFILEBIN,"w");
fwrite(PAT,sizeof(uint64_t),iaddr, fd1);
close((int)fd1);
}

View File

@ -1,201 +0,0 @@
//define signals and directions (Input, outputs, clocks)
#define compTestIN 1
setoutput(compTestIN);
#define curON 32
setoutput(curON);
#define side_clk 2
setclk(side_clk);
#define side_din 3
setoutput(side_din);
#define clear_shr 4
setoutput(clear_shr);
#define bottom_din 5
setoutput(bottom_din);
#define bottom_clk 6
setclk(bottom_clk);
#define gHG 7
setoutput(gHG);
#define bypassCDS 31
setoutput(bypassCDS);
#define ENprechPRE 8
setoutput(ENprechPRE);
#define res 9
setoutput(res);
#define pulseOFF 30
setoutput(pulseOFF);
#define connCDS 27
setoutput(connCDS);
#define Dsg_1 24
setoutput(Dsg_1);
#define Dsg_2 25
setoutput(Dsg_2);
#define Dsg_3 23
setoutput(Dsg_3);
#define sto0 10
setoutput(sto0);
#define sto1 11
setoutput(sto1);
#define sto2 12
setoutput(sto2);
#define resCDS 13
setoutput(resCDS);
#define prechargeConnect 14
setoutput(prechargeConnect);
#define pulse 15
setoutput(pulse);
#define PCT_mode 21
setoutput(PCT_mode);
#define res_DGS 16
setoutput(res_DGS);
#define adc_ena 17
setoutput(adc_ena);
#define CLKBIT 18
setclk(CLKBIT);
#define adc_sync 63
setoutput(adc_sync);
#define PW pw()
#define SB(x) setbit(x)
#define CB(x) clearbit(x)
#define CLOCK clearbit(CLKBIT); pw();setbit(CLKBIT);pw()
#define LCLOCK clearbit(CLKBIT); pw();setbit(CLKBIT);pw();clearbit(CLKBIT); pw()
#define CLOCKS(x) for (i=0;i<x;i++) {clearbit(CLKBIT);pw(); setbit(CLKBIT); pw();}
#define STOP setstop();
#define START setstart();
#define REPEAT(x) for (i=0;i<(x);i++) {pw();}
#define DOFOR(x) for (j=0;j<(x);j++) {
// }
#define STARTUP1 CB(compTestIN);SB(clear_shr);CB(side_clk);CB(side_din);CB(bottom_din);CB(bottom_clk);
#define STARTUP2 CB(pulse);SB(PCT_mode);SB(pulseOFF);CB(curON);
#define STARTUP3 SB(res);SB(gHG);SB(ENprechPRE);
#define STARTUP4 SB(bypassCDS); CB(connCDS);CB(sto0);SB(sto1);SB(sto2);
#define STARTUP5 SB(resCDS);CB(Dsg_1);CB(Dsg_2);SB(Dsg_3);CB(prechargeConnect);SB(res_DGS);
#define STARTUP STARTUP1 STARTUP2 STARTUP3 STARTUP4 STARTUP5 PW;
//****NOTES****//
//FUNCTIONS
//Declare functions at the beginning
void load_pix(int nx, int ny)
{//SELECT PIXEL 1,1 for readout
SB(clear_shr);PW;PW;
CB(clear_shr);PW;PW;PW;PW;
SB(side_din);PW;
SB(side_clk);PW;
CB(side_din);
setstartloop(0); //loop on the rows
SB(side_clk);PW;
setstoploop(0); //finish loop on the rows
setnloop(0,ny); //set number row selected -can be changed dynamically
CB(side_clk);PW;
SB(bottom_din);PW;
SB(bottom_clk);PW;
CB(bottom_din);
setstartloop(1); //loop on the columns
SB(bottom_clk);PW;
setstoploop(1); //loop on the columns
setnloop(1,ny); //set number columns selected -can be changed dynamically
}
void load_col(void)
{//SELECT COLUMN 1 for readout
SB(clear_shr);PW;PW;
CB(clear_shr);PW;PW;PW;PW;
SB(bottom_din);PW;
SB(bottom_clk);PW;
CB(bottom_clk);PW;
CB(bottom_din);PW;
}
//END of FUNCTIONS
////////////////////////////////////////////////////////
//LET BYPASS PREAMP AND CDS and write on preamp out.//
//THIS ALLOWS CHECKING SOURCE FOLLOWERS //
////////////////////////////////////////////////////////
PW;
SB(5); PW;
CB(5); PW;
START; //pattern starts from here
STARTUP;
setwaitpoint(0); //set wait points
PW;
setwaittime(0,20); //wait time - can be changed dynamically
SB(adc_ena);PW;
printf("ADC sync %x %d %llx\n",iaddr,adc_sync, pat);
SB(adc_sync);PW;
printf("ADC sync %x %d %llx\n",iaddr, adc_sync, pat);
CB(gHG);
setwaitpoint(1); //set wait points
setwaittime(1,16); //wait time - can be changed dynamically
CB(adc_sync);PW;
load_pix(10, 20);
CB(res);
//CB(Dsg_3);PW;
CB(res_DGS);
setwaitpoint(2); //set wait points
setwaittime(2,1000); //wait time - can be changed dynamically
//SB(res_DGS);
//PW;
//SB(Dsg_3);
//
//CB(connCDS);
//TEST SIGNALS END
//
REPEAT(20)
//****************//
//*FINAL COMMANDS*//
//****************//
CB(adc_ena);PW;
//STARTUP;
STOP; PW; //stops here
//REPEAT(4);

View File

@ -55,6 +55,9 @@ set(SPHINX_SOURCE_FILES
src/troubleshooting.rst
src/receivers.rst
src/slsreceiver.rst
src/udpheader.rst
src/udpconfig.rst
src/udpdetspec.rst
)
foreach(filename ${SPHINX_SOURCE_FILES})

View File

@ -19,7 +19,7 @@ A minimal CMakeLists.txt could look like this:
.. code-block:: cmake
project(myDetectorIntegration)
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.14)
add_subdirectory(slsDetectorPackage)
#Add your executable
@ -43,7 +43,7 @@ should be needed, otherwise specify cmake prefix path.
.. code-block:: cmake
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.14)
project(myintegration)
find_package(slsDetectorPackage 5.0 REQUIRED)

View File

@ -13,26 +13,36 @@ To use the basic building blocks, meaning sls_detector_get/put and
the shared libraries these are needed:
* Linux, preferably recent kernel (currently no cross platform support)
* CMake > 3.12
* CMake >= 3.14
* C++11 compatible compiler. (We test with gcc and clang)
* ZeroMQ version 4
-----------------------
GUI
-----------------------
The GUI is currently using Qt4 but watch out for an upgrade to 5.
* Qt 4.8
* Qwt 6.1
-----------------------
Python bindings
-----------------------
* Python > 3.6
* pybind11 (packaged in libs/)
* pybind11 2.11.0 (packaged in libs)
.. note ::
Refer :ref:`pybind11 notes. <pybind for different slsDetectorPackage versions>`
-----------------------
ZeroMQ
-----------------------
* Zeromq 4.3.4 (packaged in libs)
.. note ::
Refer :ref:`zeromq notes. <zeromq for different slsDetectorPackage versions>`
-----------------------
GUI
-----------------------
* Qt 5.9
* Qwt 6.1.5 (packaged in libs)
-----------------------
Moench executables
@ -56,4 +66,6 @@ Packaged in libs/
* catch2 (unit testing)
* rapidjson (streaming from receiver)
* pybind11 (python bindings)
* pybind11 (python bindings)
* qwt (gui plotting)
* libzmq (streaming to/from receiver)

View File

@ -1,16 +1,19 @@
Detector
==============================================
The sls::Detector is the new public API to control
The sls::Detector is the public API to control
detectors from C++. This API is also used internally
for the Python bindings and the command line interface.
If a receiver has been configured this is also controlled
If a receiver has been configured, this is also controlled
through this class.
Most, if not all, functions are called in parallel
and the return value is a thin std::vector wrapper
containing results from all modules. (Result<T>)
containing results from all modules. (:ref:`Result class<Result Class>`)
Here are some :ref:`examples <Cplusplus Api Examples>` on how to use the API.
.. _Cplusplus Api Examples:
.. doxygenclass:: sls::Detector
:members:
:undoc-members:

View File

@ -1,3 +1,4 @@
.. _Cplusplus Api Examples:
@ -53,8 +54,8 @@ then set up the detector.
jungfrauDetectorServer_virtual
This launches a virtual Jungfrau detector server. As default is uses port 1952 and 1953
for communication over TCP. Most commands go on 1952 and only stop and status on 1953.
This launches a virtual Jungfrau detector server. As default it uses port 1952 and 1953
for communication over TCP. Most commands go on 1952 and only a few such as stop and status on 1953.
**Run example to configure**
@ -90,7 +91,10 @@ std::vector.
sls::Result<int> res1{1, 1, 1};
std::cout << "res1: " << res1 << '\n';
res1.squash();
# return -1 if different
res1.squash(-1);
# throw exception with custom message if different
res1.tsquash("Values are different);

View File

@ -92,25 +92,40 @@ Download
Upgrade
^^^^^^^^
.. note ::
.. warning ::
In case you have had issues in the past with programming via software:
* 6.1.2 server has a fix for seamless fpga programming
* We recommend first updating the on-board detector server to 6.1.2 (with client 6.1.x) using command 'updatedetectorserver' or 'copydetectorserver'.
* Then use command 'programfpga' to only update firmware or use command 'update' to update firmware and server to the latest release.
These instructions are for upgrades from v5.0.0. For earlier versions, contact us.
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
Always ensure that the client and server software are of the same release.
Program from console
.. code-block:: bash
# copies server from tftp folder of pc, links new server to jungfrauDetectorServer,
# These instructions are for upgrades from v5.0.0. For earlier versions, please contact us.
# Always ensure that the client and server software are of the same release.
# copies server, links new server to jungfrauDetectorServer,
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga,
# reboots
# programs fpga, reboots
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update jungfrauDetectorServervxxx pcxxx xx.pof
# v6.1.1 - present (copies server from the full path provided)
sls_detector_put update jungfrauDetectorServervxxx xx.pof
# Or only program firmware
sls_detector_put programfpga xxx.pof
@ -155,10 +170,6 @@ Upgrade
Mythen III
-----------
.. note ::
As it is still in development, the rbf files must be picked up from us.
Download
^^^^^^^^^^^^^
@ -170,16 +181,21 @@ Download
Upgrade
^^^^^^^^
Always ensure that the client and server software are of the same release.
Program from console
.. code-block:: bash
# copies server from tftp folder of pc, links new server to mythen3DetectorServer,
# programs fpga,
# reboots
# Always ensure that the client and server software are of the same release.
# copies server, links new server to mythen3DetectorServer,
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga, reboots
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update mythen3DetectorServervxxx pcxxx xxx.rbf
# v6.1.1 - present (copies server from the full path provided)
sls_detector_put update mythen3DetectorServervxxx xxx.rbf
# Or only program firmware
sls_detector_put programfpga xxx.rbf
@ -199,16 +215,21 @@ Download
Upgrade
^^^^^^^^
Always ensure that the client and server software are of the same release.
Program from console
.. code-block:: bash
# copies server from tftp folder of pc, links new server to gotthard2DetectorServer,
# programs fpga,
# reboots
# Always ensure that the client and server software are of the same release.
# copies server, links new server to gotthard2DetectorServer,
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga, reboots
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update gotthard2DetectorServervxxx pcxxx xxx.rbf
# v6.1.1 - present (copies server from the full path provided)
sls_detector_put update gotthard2DetectorServervxxx xxx.rbf
# Or only program firmware
sls_detector_put programfpga xxx.rbf
@ -230,19 +251,36 @@ Download
Upgrade
^^^^^^^^
.. warning ::
In case you have had issues in the past with programming via software:
* 6.1.2 server has a fix for seamless fpga programming
* We recommend first updating the on-board detector server to 6.1.2 (with client 6.1.x) using command 'updatedetectorserver' or 'copydetectorserver'.
* Then use command 'programfpga' to only update firmware or use command 'update' to update firmware and server to the latest release.
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
Always ensure that the client and server software are of the same release.
Program from console
.. code-block:: bash
# copies server from tftp folder of pc, links new server to moenchDetectorServer,
# Always ensure that the client and server software are of the same release.
# copies server, links new server to moenchDetectorServer,
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga,
# reboots
# programs fpga, reboots
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update moenchDetectorServervxxx pcxxx xx.pof
# v6.1.1 - present (copies server from the full path provided)
sls_detector_put update moenchDetectorServervxxx xx.pof
# Or only program firmware
sls_detector_put programfpga xxx.pof
@ -262,17 +300,22 @@ Upgrade
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
Always ensure that the client and server software are of the same release.
Program from console
.. code-block:: bash
# copies server from tftp folder of pc, links new server to ctbDetectorServer,
# Always ensure that the client and server software are of the same release.
# copies server, links new server to ctbDetectorServer,
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga,
# reboots
# programs fpga, reboots
# older versions: v5.0.0 - 6.0.0 using tftp from tftp folder of pc
sls_detector_put update ctbDetectorServervxxx pcxxx xx.pof
# v6.1.1 - present (copies server from the full path provided)
sls_detector_put update ctbDetectorServervxxx xx.pof
# Or only program firmware
sls_detector_put programfpga xxx.pof

View File

@ -45,6 +45,7 @@ int main() {
for (const auto &cmd : commands) {
std::ostringstream os;
std::cout << cmd << '\n';
proxy.Call(cmd, {}, -1, slsDetectorDefs::HELP_ACTION, os);
auto tmp = os.str().erase(0, cmd.size());

View File

@ -8,8 +8,8 @@ Welcome to slsDetectorPackage's documentation!
.. note ::
This is the documentation for the latest development version of slsDetectorPackage
For documentation on current and previous releases visit the official page: https://www.psi.ch/en/detectors/documentation
This is the documentation for the latest development version of slsDetectorPackage.
For further documentation, visit the official page: https://www.psi.ch/en/detectors/documentation
.. toctree::
:maxdepth: 1
@ -66,6 +66,15 @@ Welcome to slsDetectorPackage's documentation!
virtualserver
serverdefaults
.. toctree::
:caption: Detector UDP Header
:maxdepth: 2
udpheader
udpconfig
udpdetspec
.. toctree::
:caption: Receiver
:maxdepth: 2

View File

@ -1,100 +1,28 @@
.. note ::
The default branch of our git repository is developer. It contains the
latest development version. It is expected to compile and work but
features might be added or tweaked. In some cases the API might also change
without being communicated. If absolute stability of the API is needed please
use one of the release versions.
.. warning ::
Before building from source make sure that you have the
:doc:`dependencies <../dependencies>` installed. If installing using conda, conda will
manage the dependencies.
manage the dependencies. Avoid also installing packages with pip.
.. _Installation:
Installation
==============================================
.. _build from source using cmake:
Build from source using CMake
---------------------------------
Note that on some systems, for example RH7, cmake v3+ is available under the cmake3 alias.
It is also required to clone with the option --recursive to get the git submodules used
in the package.
.. code-block:: bash
git clone --recursive https://github.com/slsdetectorgroup/slsDetectorPackage.git
mkdir build && cd build
cmake ../slsDetectorPackage -DCMAKE_INSTALL_PREFIX=/your/install/path
make -j12 #or whatever number of cores you are using to build
make install
The easiest way to configure options is to use the ccmake utility.
.. code-block:: bash
#from the build directory
ccmake .
Build using cmk.sh script
-------------------------
These are mainly aimed at those not familiar with using ccmake and cmake.
.. code-block:: bash
The binaries are generated in slsDetectorPackage/build/bin directory.
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [n] [-h] [z] [-d <HDF5 directory>] [-l Install directory] [-k <CMake command>] [-j <Number of threads>]
-[no option]: only make
-c: Clean
-b: Builds/Rebuilds CMake files normal mode
-p: Builds/Rebuilds Python API
-h: Builds/Rebuilds Cmake files with HDF5 package
-d: HDF5 Custom Directory
-k: CMake command
-l: Install directory
-t: Build/Rebuilds only text client
-r: Build/Rebuilds only receiver
-g: Build/Rebuilds only gui
-s: Simulator
-u: Chip Test Gui
-j: Number of threads to compile through
-e: Debug mode
-i: Builds tests
-m: Manuals
-n: Manuals without compiling doxygen (only rst)
-z: Moench zmq processor
# get all options
./cmk.sh -?
# new build and compile in parallel:
./cmk.sh -bj5
===============
Install binaries using conda
--------------------------------
-------------------------------
Conda is not only useful to manage python environments but can also
be used as a user space package manager.
be used as a user space package manager. Dates in the tag (for eg. 2020.07.23.dev0)
are from the developer branch. Please use released tags for stability.
We have three different packages available:
* **slsdetlib**, shared libraries and command line utilities
* **slsdetgui**, GUI
* **slsdet**, Python bindings
* **slsdetlib** shared libraries and command line utilities
* **slsdetgui** GUI
* **slsdet** Python bindings
.. code-block:: bash
@ -103,9 +31,9 @@ We have three different packages available:
conda config --add channels slsdetectorgroup
conda config --set channel_priority strict
#cerate an environment with our library, then activate
#replace 2020.07.20.dev0 with the required tag
conda create -n myenv slsdetlib=2020.07.23.dev0
#create and activate an environment with our library
#replace 6.1.1 with the required tag
conda create -n myenv slsdetlib=6.1.1
conda activate myenv
#ready to use
@ -116,11 +44,136 @@ We have three different packages available:
.. code-block:: bash
#List available versions
# lib and binaries
conda search slsdetlib
# python
conda search slsdet
# gui
conda search slsdetgui
Build from source on old distributions
-----------------------------------------
Build from source
-------------------
1. Download Source Code from github
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git --branch 6.1.1
.. note ::
For v6.x.x of slsDetectorPackage and older, refer :ref:`pybind11 notes on cloning. <pybind for different slsDetectorPackage versions>`
.. _build from source using cmake:
2. Build from Source
^^^^^^^^^^^^^^^^^^^^^^^^^^
Build using CMake
^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
# outside slsDetecorPackage folder
mkdir build && cd build
# configure & generate Makefiles using cmake
# by listing all your options (alternately use ccmake described below)
# cmake3 for some systems
cmake ../slsDetectorPackage -DCMAKE_INSTALL_PREFIX=/your/install/path
# compiled to the build/bin directory
make -j12 #or whatever number of cores you are using to build
# install headers and libs in /your/install/path directory
make install
Instead of the cmake command, one can use ccmake to get a list of options to configure and generate Makefiles at ease.
.. code-block:: bash
# ccmake3 for some systems
ccmake ..
# choose the options
# first press [c] - configure (maybe multiple times till you see [g])
# then press [g] - generate
=============================== ===============================
Example cmake options Comment
=============================== ===============================
-DSLS_USE_PYTHON=ON Python
-DPython_FIND_VIRTUALENV=ONLY Python from the conda env
-DSLS_USE_GUI=ON GUI
-DSLS_USE_HDF5=ON HDF5
-DSLS_USE_SIMULATOR=ON Simulator
=============================== ===============================
.. note ::
For v7.x.x of slsDetectorPackage and older, refer :ref:`zeromq notes for cmake option to hint library location. <zeromq for different slsDetectorPackage versions>`
Build using in-built cmk.sh script
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
The binaries are generated in slsDetectorPackage/build/bin directory.
Usage: $0 [-b] [-c] [-d <HDF5 directory>] [-e] [-g] [-h] [-i]
[-j <Number of threads>] [-k <CMake command>] [-l <Install directory>]
[-m] [-n] [-p] [-r] [-s] [-t] [-u] [-z]
-[no option]: only make
-b: Builds/Rebuilds CMake files normal mode
-c: Clean
-d: HDF5 Custom Directory
-e: Debug mode
-g: Build/Rebuilds gui
-h: Builds/Rebuilds Cmake files with HDF5 package
-i: Builds tests
-j: Number of threads to compile through
-k: CMake command
-l: Install directory
-m: Manuals
-n: Manuals without compiling doxygen (only rst)
-p: Builds/Rebuilds Python API
-r: Build/Rebuilds only receiver
-s: Simulator
-t: Build/Rebuilds only text client
-u: Chip Test Gui
-z: Moench zmq processor
# display all options
./cmk.sh -?
# new build and compile in parallel (recommended basic option):
./cmk.sh -cbj5
# new build, python and compile in parallel:
./cmk.sh -cbpj5
#For rebuilding only certain sections
./cmk.sh -tg #only text client and gui
./cmk.sh -r #only receiver
.. note ::
For v7.x.x of slsDetectorPackage and older, refer :ref:`zeromq notes for cmk script option to hint library location. <zeromq for different slsDetectorPackage versions>`
Build on old distributions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If your linux distribution doesn't come with a C++11 compiler (gcc>4.8) then
it's possible to install a newer gcc using conda and build the slsDetectorPackage
@ -129,14 +182,74 @@ using this compiler
.. code-block:: bash
#Create an environment with the dependencies
conda create -n myenv gxx_linux-64 cmake zmq
conda create -n myenv gxx_linux-64 cmake
conda activate myenv
# outside slsDetecorPackage folder
mkdir build && cd build
cmake ../slsDetectorPackage -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
make -j12
.. note ::
For v7.x.x of slsDetectorPackage and older, refer :ref:`zeromq notes for dependencies for conda. <zeromq for different slsDetectorPackage versions>`
Build slsDetectorGui (Qt5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. Using pre-built binary on conda
.. code-block:: bash
conda create -n myenv slsdetgui=7.0.0
conda activate myenv
2. Using system installation on RHEL7
.. code-block:: bash
yum install qt5-qtbase-devel.x86_64
yum install qt5-qtsvg-devel.x86_64
3. Using conda
.. code-block:: bash
#Add channels for dependencies and our library
conda config --add channels conda-forge
conda config --add channels slsdetectorgroup
conda config --set channel_priority strict
# create environment to compile
# on rhel7
conda create -n slsgui gxx_linux-64 gxx_linux-64 mesa-libgl-devel-cos6-x86_64 qt
# on fedora or newer systems
conda create -n slsgui qt
# when using conda compilers, would also need libgl, but no need for it on fedora unless maybe using it with ROOT
# activate environment
conda activate slsgui
# compile with cmake outside slsDetecorPackage folder
mkdir build && cd build
cmake ../slsDetectorPackage -DSLS_USE_GUI=ON
make -j12
# or compile with cmk.sh
cd slsDetectorPackage
./cmk.sh -cbgj9
.. note ::
For v7.x.x of slsDetectorPackage and older, refer :ref:`zeromq notes for dependencies for conda. <zeromq for different slsDetectorPackage versions>`
Build this documentation
-------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^
The documentation for the slsDetectorPackage is build using a combination
of Doxygen, Sphinx and Breathe. The easiest way to install the dependencies
@ -144,11 +257,63 @@ is to use conda
.. code-block:: bash
conda create -n myenv python sphinx sphinx_rtd_theme
conda create -n myenv python=3.12 sphinx sphinx_rtd_theme breathe doxygen numpy
Then enable the option SLS_BUILD_DOCS to create the targets
.. code-block:: bash
# using cmake or ccmake to enable DSLS_BUILD_DOCS
# outside slsDetecorPackage folder
mkdir build && cd build
cmake ../slsDetectorPackage -DSLS_BUILD_DOCS=ON
make docs # generate API docs and build Sphinx RST
make rst # rst only, saves time in case the API did not change
make rst # rst only, saves time in case the API did not change
Pybind and Zeromq
^^^^^^^^^^^^^^^^^^^
.. _pybind for different slsDetectorPackage versions:
| **Pybind for Python**
| v8.0.0+:
| pybind11 (v2.11.0) is built
| * by default from tar file in repo (libs/pybind/v2.11.0.tar.gz)
| * or use advanced option SLS_FETCH_PYBIND11_FROM_GITHUB [`link <https://github.com/pybind/pybind11>`__].
|
| v7.x.x:
| pybind11 packaged into 'libs/pybind'. No longer a submodule. No need for "recursive" or "submodule update".
|
| Older versions:
| pybind11 is a submodule. Must be cloned using "recursive" and updated when switching between versions using the following commands.
.. code-block:: bash
# Note: Only for v6.x.x versions and older
# clone using recursive to get pybind11 submodule
git clone --recursive https://github.com/slsdetectorgroup/slsDetectorPackage.git
# update submodule when switching between releases
cd slsDetectorPackage
git submodule update --init
.. _zeromq for different slsDetectorPackage versions:
| **Zeromq**
| v8.0.0+:
| zeromq (v4.3.4) is built
| * by default from tar file in repo (libs/libzmq/libzmq-4.3.4.tar.gz)
| * or use advanced option SLS_FETCH_ZMQ_FROM_GITHUB [`link <https://github.com/zeromq/libzmq.git>`__].
|
| v7.x.x and older:
| zeromq must be installed and one can hint its location using
| * cmake option:'-DZeroMQ_HINT=/usr/lib64' or
| * option '-q' in cmk.sh script: : ./cmk.sh -cbj5 -q /usr/lib64
| * 'zeromq' dependency added when installing using conda

View File

@ -10,27 +10,46 @@ open an issue in our our `github repo
Setting exposure time
------------------------------------
Setting and reading back exposure time can be done either using a Python datetime.timedelta
or by setting the time in seconds.
Setting and reading back exposure time can be done either using a Python
datetime.timedelta, DurationWrapper or by setting the time in seconds.
::
# Set exposure time to 1.2 seconds
>>> d.exptime = 1.2
>>> d.exptime = 5e-07
# Setting exposure time using timedelta
# Setting exposure time using timedelta (upto microseconds precision)
import datetime as dt
>>> d.exptime = dt.timedelta(seconds = 1.2)
>>> d.exptime = dt.timedelta(seconds = 1, microseconds = 3)
# With timedelta any arbitrary combination of units can be used
>>> t = dt.timedelta(microseconds = 100, seconds = 5.3, minutes = .3)
# using DurationWrapper to set in seconds
>>> from slsdet import DurationWrapper
>>> d.exptime = DurationWrapper(1.2)
# using DurationWrapper to set in ns
>>> t = DurationWrapper()
>>> t.set_count(500)
>>> d.exptime = t
# To set exposure time for individual detector one have to resort
# to the C++ style API.
# Sets exposure time to 1.2 seconds for module 0, 6 and 12
>>> d.setExptime(1.2, [0, 6, 12])
>>> d.setExptime(dt.timedelta(seconds = 1.2), [0, 6, 12])
# to get in seconds
>>> d.period
181.23
# to get in DurationWrapper
>>> d.getExptime()
[sls::DurationWrapper(total_seconds: 181.23 count: 181230000000)]
------------------------------------
@ -220,8 +239,7 @@ Setting and getting times
# This sets the exposure time for all modules
d.exptime = 0.5
# exptime also accepts a python datetime.timedelta
# which can be used to set the time in almost any unit
# exptime also accepts a python datetime.timedelta (upto microseconds resolution)
t = dt.timedelta(milliseconds = 2.3)
d.exptime = t
@ -229,16 +247,25 @@ Setting and getting times
t = dt.timedelta(minutes = 3, seconds = 1.23)
d.exptime = t
# using DurationWrapper to set in seconds
>>> from slsdet import DurationWrapper
>>> d.exptime = DurationWrapper(1.2)
# using DurationWrapper to set in ns
>>> t = DurationWrapper()
>>> t.set_count(500)
>>> d.exptime = t
# exptime however always returns the time in seconds
>>> d.exptime
181.23
# To get back the exposure time for each module
# it's possible to use getExptime, this also returns
# the values as datetime.timedelta
# the values as DurationWrapper
>>> d.getExptime()
[datetime.timedelta(seconds=181, microseconds=230000), datetime.timedelta(seconds=181, microseconds=230000)]
[sls::DurationWrapper(total_seconds: 181.23 count: 181230000000)]
# In case the values are the same it's possible to use the
# element_if_equal function to reduce the values to a single
@ -246,7 +273,8 @@ Setting and getting times
>>> t = d.getExptime()
>>> element_if_equal(t)
datetime.timedelta(seconds=1)
sls::DurationWrapper(total_seconds: 1.2 count: 1200000000)
--------------
Reading dacs

View File

@ -6,7 +6,7 @@ Getting Started
Which Python?
--------------------
We require at lest Python 3.6 and strongly recommended that you don't use the system
We require at least Python 3.6 and strongly recommended that you don't use the system
Python installation. The examples in this documentation uses `conda
<https://docs.conda.io/en/latest/miniconda.html>`_ since it provides good support
also for non Python packages but there are also other alternatives like, pyenv.
@ -14,28 +14,35 @@ also for non Python packages but there are also other alternatives like, pyenv.
Using something like conda also allows you to quickly switch beteen different Python
environments.
.. warning ::
---------------------
Building from Source
---------------------
If you are not installing slsdet binaries from conda, but instead building from
source, please refer to :ref:`the installation section<Installation>` for details.
Don't forget to compile with the option SLS_USE_PYTHON=ON to enable the Python
bindings or if you use the cmk.sh script -p.
.. note ::
Ensure that the sls det python lib compiled is for the expected python version.
For example, build/bin/_slsdet.cpython-39-x86_64-linux-gnu.so for Python v3.9.x
If you use conda avoid also installing packages with pip.
---------------------
PYTHONPATH
---------------------
If you install slsdet using conda everything is set up and you can
If you install slsdet binaries using conda everything is set up and you can
directly start using the Python bindings. However, if you build
from source you need to tell Python where to find slsdet. This
is be done by adding your build/bin directory to PYTHONPATH.
from source you need to tell Python where to find slsdet to use it. This
can be done by adding your build/bin directory to PYTHONPATH.
.. code-block:: bash
export PYTHONPATH = /path/to/your/build/bin:$PYTHONPATH
.. note ::
Don't forget to compile with the option SLS_USE_PYTHON=ON to enable
the Python bindings or if you use the cmk.sh script -p.
--------------------------------------
Which detector class should I use?
--------------------------------------
@ -136,7 +143,7 @@ can use dir()
'__str__', '__subclasshook__', '_adc_register', '_frozen',
'_register', 'acquire', 'adcclk', 'adcphase', 'adcpipeline',
'adcreg', 'asamples', 'auto_comp_disable', 'clearAcquiringFlag',
'clearBit', 'clearROI', 'client_version', 'config', 'copyDetectorServer',
'clearBit', 'clearROI', 'client_version', 'config',
'counters', 'daclist', 'dacvalues', 'dbitclk', 'dbitphase' ...
Since the list for Detector is rather long it's an good idea to filter it.
@ -146,9 +153,11 @@ their name.
::
>>> [item for item in dir(d) if 'time' in item]
['exptime', 'getExptime', 'getExptimeForAllGates', 'getExptimeLeft',
'getSubExptime', 'patwaittime0', 'patwaittime1', 'patwaittime2',
'setExptime', 'setSubExptime', 'subdeadtime', 'subexptime']
['compdisabletime', 'exptime', 'exptimel', 'frametime', 'getExptime',
'getExptimeForAllGates', 'getExptimeLeft', 'getSubExptime', 'patwaittime',
'patwaittime0', 'patwaittime1', 'patwaittime2', 'runtime', 'setExptime',
'setSubExptime', 'subdeadtime', 'subexptime']
The above method works on any Python object but for convenience we also
included two functions to find names. View prints the names one per line
@ -160,6 +169,7 @@ while find returns a list of names.
>>> view('exptime')
exptime
exptimel
getExptime
getExptimeForAllGates
getExptimeLeft
@ -168,6 +178,7 @@ while find returns a list of names.
setSubExptime
subexptime
>>> find('exptime')
['exptime', 'getExptime', 'getExptimeForAllGates', 'getExptimeLeft',
'getSubExptime', 'setExptime', 'setSubExptime', 'subexptime']
@ -185,19 +196,39 @@ To access the documentation of a function directly from the Python prompt use he
Help on property:
Period between frames, accepts either a value in seconds or datetime.timedelta
Note
-----
:getter: always returns in seconds. To get in datetime.delta, use getPeriod
Examples
:getter: always returns in seconds. To get in DurationWrapper, use getPeriod
Example
-----------
>>> # setting directly in seconds
>>> d.period = 1.05
>>> d.period = datetime.timedelta(minutes = 3, seconds = 1.23)
>>>
>>> # setting directly in seconds
>>> d.period = 5e-07
>>>
>>> # using timedelta (up to microseconds precision)
>>> from datatime import timedelta
>>> d.period = timedelta(seconds = 1, microseconds = 3)
>>>
>>> # using DurationWrapper to set in seconds
>>> from slsdet import DurationWrapper
>>> d.period = DurationWrapper(1.2)
>>>
>>> # using DurationWrapper to set in ns
>>> t = DurationWrapper()
>>> t.set_count(500)
>>> d.period = t
>>>
>>> # to get in seconds
>>> d.period
181.23
>>> d.getPeriod()
[datetime.timedelta(seconds=181, microseconds=230000)]
>>>
>>> d.getExptime()
[sls::DurationWrapper(total_seconds: 181.23 count: 181230000000)]
----------------------
@ -217,11 +248,12 @@ The enums can be found in slsdet.enums
import slsdet
>>> [e for e in dir(slsdet.enums) if not e.startswith('_')]
['burstMode', 'clockIndex', 'dacIndex',
'detectorSettings', 'detectorType', 'dimension', 'externalSignalFlag',
'fileFormat', 'frameDiscardPolicy',
'readoutMode', 'runStatus', 'speedLevel', 'timingMode',
'timingSourceType']
['M3_GainCaps', 'burstMode', 'clockIndex', 'cls', 'dacIndex', 'detectorSettings',
'detectorType', 'dimension', 'externalSignalFlag', 'fileFormat',
'frameDiscardPolicy', 'gainMode', 'name', 'polarity', 'portPosition',
'readoutMode', 'runStatus', 'speedLevel', 'streamingInterface', 'timingMode',
'timingSourceType', 'vetoAlgorithm']
# Even though importing using * is not recommended one could
# get all the enums like this:

View File

@ -66,11 +66,15 @@ For a Single Module
# sets destination udp ports (not needed, default is 50001)
udp_dstport 50012
# 1g data out
# source udp ips must be same subnet at destintaion udp ips
udp_srcip 192.168.1.112
# udp_srcip 192.168.1.112
# destination udp ip picked up from rx_hostname (if auto)
udp_dstip auto
# udp_dstip auto
# 10g data out
udp_srcip 10.30.20.200
udp_dstip 10.30.20.6
# set file path
fpath /tmp
@ -105,12 +109,14 @@ For Multiple Modules
# connects to mulitple modules
hostname bchipxxx+bchipyyy+
# connects to receivers at ports 2012 and 2014
rx_hostname mpc1922:2012+mpc1922:2013+
# tcp port increases for each module (multi detector command)
rx_tcpport 2012
# sets differernt destination udp ports
0:udp_dstport 50012
1:udp_dstport 50014
# connects to receivers at ports 2012 and 2014
rx_hostname mpc1922
# increasing udp ports (multi detector command)
udp_dstport 50012
# source udp ips must be same subnet at destintaion udp ips
0:udp_srcip 192.168.1.112

View File

@ -4,41 +4,8 @@ Receivers
Receiver processes can be run on same or different machines as the client, receives the data from the detector (via UDP packets).
When using the slsReceiver/ slsMultiReceiver, they can be further configured by the client control software (via TCP/IP) to set file name, file path, progress of acquisition etc.
Detector UDP Header
---------------------
| The UDP data format for the packets consist of a common header for all detectors, followed by the data for that one packet.
**The SLS Detector Header**
.. table:: <-------------------------------- 8 bytes -------------------------------->
:align: center
:widths: 30,30,30,30
+--------------------------------------------------------------------+
|frameNumber |
+---------------------------------+----------------------------------+
|expLength |packetNumber |
+---------------------------------+----------------------------------+
|bunchId |
+--------------------------------------------------------------------+
|timestamp |
+----------------+----------------+----------------+-----------------+
|modId |row |column |reserved |
+----------------+----------------+----------------+--------+--------+
|debug |roundRNumber |detType |version |
+---------------------------------+----------------+--------+--------+
UDP configuration in Config file
----------------------------------
#. UDP source port is hardcoded in detector server, starting at 32410.
#. **udp_dstport** : UDP destination port number. Port in receiver pc to listen to packets from the detector.
#. **udp_dstip** : IP address of UDP destination interface. IP address of interface in receiver pc to listen to packets from detector. If **auto** is used (only when using slsReceiver/ slsMultiReceiver), the IP of **rx_hostname** is picked up.
#. **udp_dstmac** : Mac address of UDP destination interface. MAC address of interface in receiver pc to list to packets from detector. Only required when using custom receiver, else slsReceiver/slsMultiReceiver picks it up from **udp_dstip**.
#. **udp_srcip** : IP address of UDP source interface. IP address of detector UDP interface to send packets from. Do not use for Eiger 1Gb interface (uses its hardware IP). For others, must be in the same subnet as **udp_dstip**.
#. **udp_srcmac** : MAC address of UDP source interface. MAC address of detector UDP interface to send packets from. Do not use for Eiger (uses hardware mac). For others, it is not necessary, but can help for switch and debugging to put unique values for each module.
To know more about detector receiver configuration, please check out :ref:`detector udp header and udp commands in the config file <detector udp header>`
Custom Receiver
----------------

View File

@ -1,3 +1,5 @@
.. _Result Class:
Result
==============================================

View File

@ -1,5 +1,14 @@
Detector Servers
=================
Getting Started
===============
Detector Servers include:
* Control server [default port: 1952]
* Almost all client communication.
* Stop server [default port: 1953]
* Client requests for detector status, stop acquisition, temperature, advanced read/write registers.
When using a blocking acquire command (sls_detector_acquire or Detector::acquire), the control server is blocked until end of acquisition. However, stop server commands could be used in parallel.
Location
---------
@ -14,26 +23,19 @@ Arguments
.. code-block:: bash
Possible arguments are:
-v, --version : Software version
-p, --port <port> : TCP communication port with client.
-g, --nomodule : [Mythen3][Gotthard2] Generic or No Module mode.
Skips detector type checks.
-f, --phaseshift <value> : [Gotthard] only. Sets phase shift.
-d, --devel : Developer mode. Skips firmware checks.
-u, --update : Update mode. Skips firmware checks and initial detector setup.
-s, --stopserver : Stop server. Do not use as it is created by control server
Basics
------------
Detector Servers include:
* Control server [default port: 1952]
* Almost all client communication.
* Stop server [default port: 1953]
* Client requests for detector status, stop acquisition, temperature, advanced read/write registers.
When using a blocking acquire command (sls_detector_acquire or Detector::acquire), the control server is blocked until end of acquisition. However, stop server commands could be used in parallel.
-v, --version : Software version
-p, --port <port> : TCP communication port with client.
-g, --nomodule : [Mythen3][Gotthard2]
Generic or No Module mode. Skips detector type checks.
-f, --phaseshift <value> : [Gotthard] only. Sets phase shift.
-d, --devel : Developer mode. Skips firmware checks.
-u, --update : Update mode. Skips firmware checks and initial detector setup.
-i, --ignore-config : [Eiger][Jungfrau][Gotthard][Gotthard2][Moench]
Ignore config file.
-m, --master <master> : [Eiger][Mythen3][Gotthard][Gotthard2]
Set Master to 0 or 1. Precedence over config file. Only for virtual servers except Eiger.
-t, --top <top> : [Eiger] Set Top to 0 or 1. Precedence over config file.
-s, --stopserver : Stop server. Do not use as it is created by control server
.. _Automatic start servers:
@ -90,6 +92,8 @@ One can start the on-board detector server automatically upon powering on the bo
.. code-block:: bash
sync
# physically reboot for Gotthard II or Mythen III
reboot
# verify

View File

@ -1,21 +1,46 @@
.. _Detector Server Upgrade:
Detector Server Upgrade
=======================
Upgrade
========
**Location:** slsDetectorPackage/serverBin/ folder for every release.
.. note ::
For Mythen3, Gotthard2 and Eiger, you need to add scripts to automatically start detector server upon power on. See :ref:`Automatic start<Automatic start servers>` for more details.
.. note ::
Eiger requires a manual reboot. Or killall the servers and restart the new linked one. If you are in the process of updating firmware, then don't reboot yet.
6.1.1+ (no tftp required)
---------------------------------------
#. Program from console
.. code-block:: bash
# the following command copies new server, creates a soft link to xxxDetectorServerxxx
# [Jungfrau][CTB][Moench] also deletes the old server binary and edits initttab to respawn server on reboot
# Then, the detector controller will reboot (except Eiger)
sls_detector_put updatedetectorserver /complete-path-to-binary/xxxDetectorServerxxx
#. Copy the detector server specific config files or any others required to the detector:
.. code-block:: bash
sls_detector_put execcommand "tftp pcxxx -r configxxx -g"
5.0.0 - 6.1.1
--------------
#. Install tftp and copy detector server binary to tftp folder
#. Program from console
.. note ::
These instructions are for upgrades from v5.0.0. For earlier versions, contact us.
.. code-block:: bash
# copies new server from pc tftp folder, creates a soft link to xxxDetectorServerxxx
# the following command copies new server from pc tftp folder, creates a soft link to xxxDetectorServerxxx
# [Jungfrau][CTB][Moench] also edits initttab to respawn server on reboot
# Then, the detector controller will reboot (except Eiger)
sls_detector_put copydetectorserver xxxDetectorServerxxx pcxxx
@ -27,18 +52,15 @@ Detector Server Upgrade
sls_detector_put execcommand "tftp pcxxx -r configxxx -g"
.. note ::
For Mythen3, Gotthard2 and Eiger, you need to add scripts to automatically start detector server upon power on. See :ref:`Automatic start<Automatic start servers>` for more details.
.. note ::
Eiger requires a manual reboot. Or killall the servers and restart the new linked one. If you are in the process of updating firmware, then don't reboot yet.
Errors
------
Troubleshooting with tftp
^^^^^^^^^^^^^^^^^^^^^^^^^
#. tftp write error: There is no space left. Please delete some old binaries and try again.
#. text file busy: You are trying to copy the same server.
#. text file busy: You are trying to copy the same server.
< 5.0.0
--------
Please contact us.

View File

@ -52,8 +52,13 @@ Client Commands
# multi modules with custom ports
rx_hostname xxx:1955+xxx:1956+
# multi modules using increasing tcp ports when using multi detector command
rx_tcpport 1955
rx_hostname xxx
# multi modules with custom ports on same rxr pc
# or specify multi modules with custom ports on same rxr pc
0:rx_tcpport 1954
1:rx_tcpport 1955
2:rx_tcpport 1956
@ -86,16 +91,199 @@ Client Commands
sls_detector_get -h rx_framescaught
ZMQ: Json Header Format
------------------------
**Change in field names from slsDetectorPackage v6.x.x to v7.0.0**
* detSpec1 <- bunchId
* detSpec2 <- reserved
* detSpec3 <- debug
* detSpec4 <- roundRNumber
**Format**
.. code-block:: bash
{
"jsonversion": unsigned int,
"bitmode": unsigned int,
"fileIndex": unsigned long int,
"detshape": [
unsigned int,
unsigned int
],
"shape": [
unsigned int,
unsigned int
],
"size": unsigned int,
"acqIndex": unsigned long int,
"frameIndex": unsigned long int,
"progress": double,
"fname": string,
"data": unsigned int,
"completeImage": unsigned int,
"frameNumber": unsigned long long int,
"expLength": unsigned int,
"packetNumber": unsigned int,
"detSpec1": unsigned long int,
"timestamp": unsigned long int,
"modId": unsigned int,
"row": unsigned int,
"column": unsigned int,
"detSpec2": unsigned int,
"detSpec3": unsigned int,
"detSpec4": unsigned int,
"detType": unsigned int,
"version": unsigned int,
"flipRows": unsigned int,
"quad": unsigned int,
"addJsonHeader": {
string : string
}
}
+--------------+----------------------------------------------+
| Field | Description |
+--------------+----------------------------------------------+
| jsonversion | Version of the json header. |
| | Value at 4 for v6.x.x and v7.x.x |
+--------------+----------------------------------------------+
| bitmode | Bits per pixel [4|8|16|32] |
+--------------+----------------------------------------------+
| fileIndex | Current file acquisition index |
+--------------+----------------------------------------------+
| detshape | Geometry of the entire detector |
+--------------+----------------------------------------------+
| shape | Geometry of the current port streamed out |
+--------------+----------------------------------------------+
| size | Size of image of current port in bytesout |
+--------------+----------------------------------------------+
| acqIndex | Frame number from the detector (redundant) |
+--------------+----------------------------------------------+
| frameIndex | Frame number of current acquisition |
| | (Starting at 0) |
+--------------+----------------------------------------------+
| progress | Progress of current acquisition in % |
+--------------+----------------------------------------------+
| fname | Current file name |
+--------------+----------------------------------------------+
| data | 1 if there is data following |
| | 0 if dummy header |
+--------------+----------------------------------------------+
| completeImage| 1 if no missing packets for this frame |
| | in this port, else 0 |
+--------------+----------------------------------------------+
| frameNumber | Frame number |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| expLength | subframe number (32 bit eiger) |
| | or real time exposure time in 100ns (others) |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| packetNumber | Number of packets caught for that frame |
+--------------+----------------------------------------------+
| detSpec1 | See :ref:`here<Detector Specific Fields>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| timestamp | Timestamp with 10 MHz clock |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| modId | Module Id |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| row | Row number in detector |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| column | Column number in detector |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| detSpec2 | See :ref:`here<Detector Specific Fields>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| detSpec3 | See :ref:`here<Detector Specific Fields>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| detSpec4 | See :ref:`here<Detector Specific Fields>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| detType | Detector type enum |
| detSpec3 | See :ref:`Detector enum<Detector Enum>` |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| version | Detector header version. At 2 |
| | [From detector udp header] |
+--------------+----------------------------------------------+
| flipRows | 1 if rows should be flipped. |
| | Usually for Eiger bottom. |
+--------------+----------------------------------------------+
| quad | 1 if its an Eiger quad. |
+--------------+----------------------------------------------+
| addJsonHeader| Optional custom parameters that is required |
| | for processing code. |
+--------------+----------------------------------------------+
SLS Receiver Header Format
--------------------------
It is 112 bytes and consists of:
* 48 bytes of the SLS Detector Header (described in :ref:`the current detector header <detector udp header>`)
* 64 bytes of packet mask
.. code-block:: cpp
typedef struct {
uint64_t frameNumber;
uint32_t expLength;
uint32_t packetNumber;
uint64_t detSpec1;
uint64_t timestamp;
uint16_t modId;
uint16_t row;
uint16_t column;
uint16_t detSpec2;
uint32_t detSpec3;
uint16_t detSpec4;
uint8_t detType;
uint8_t version;
} sls_detector_header;
struct sls_receiver_header {
sls_detector_header detHeader; /**< is the detector header */
sls_bitset packetsMask; /**< is the packets caught bit mask */
};
.. note ::
| The packetNumber in the SLS Receiver Header will be modified to number of packets caught by receiver for that frame. For eg. Jungfrau will have 128 packets per frame. If it is less, then this is a partial frame due to missing packets.
| Furthermore, the bit mask will specify which packets have been received.
File format
--------------
* The file name format is [fpath]/[fname]_dx_fy_[findex].raw, where x is module index and y is file index. **fname** is file name prefix and by default "run". **fpath** is '/' by default.
Master file is in json format.
* Each acquisition will have an increasing acquisition index or findex (if file write enabled). This can be retrieved by using **findex** command.
The file name format is [fpath]/[fname]_dx_fy_[findex].raw, where x is module index and y is file index. **fname** is file name prefix and by default "run". **fpath** is '/' by default.
* Each acquisition can have multiple files (the file index number **y**), with **rx_framesperfile** being the maximum number of frames per file. The default varies for each detector type.
* Some file name examples:
Each acquisition will have an increasing acquisition index or findex (if file write enabled). This can be retrieved by using **findex** command.
Each acquisition can have multiple files (the file index number **y**), with **rx_framesperfile** being the maximum number of frames per file. The default varies for each detector type.
Some file name examples:
.. code-block:: bash
@ -108,17 +296,19 @@ File format
# second acquisition, first file
path-to-file/run_d0_f0_1.raw
* Each acquisition will create a master file that can be enabled/disabled using **fmaster**. This should have parameters relevant to the acquisition.
* SLS Receiver Header consist of SLS Detector Header + 64 bytes of bitmask, altogether 112 bytes. The packetNumber in the sls detector header part, will be updated to number of packets caught by receiver for that frame. Furthermore, the bit mask will specify which packets have been received.
Each acquisition will create a master file that can be enabled/disabled using **fmaster**. This should have parameters relevant to the acquisition.
**Binary file format**
* This is the default file format.
This is the default file format.
* Each data file will consist of frames, each consisting of slsReceiver Header followed by data for 1 frame.
* Master file is of ASCII format and will also include the format of the slsReceiver Header.
Each data file will consist of frames, each consisting of slsReceiver Header followed by data for 1 frame.
Master file is of ASCII format and will also include the format of the slsReceiver Header.
**HDF5 file formats**
@ -160,7 +350,7 @@ When handling callbacks, the control should be returned as soon as possible, to
**Example**
* `main cpp file <https://github.com/slsdetectorgroup/api-examples/blob/master/e4-receiver_callbacks.cpp>`_
* `cmake file <https://github.com/slsdetectorgroup/api-examples/blob/master/CMakeLists.txt>`_.
* how to install the slsDetectorPackage is provided :ref:`here <build from source using cmake>`.
* how to install the slsDetectorPackage with cmake is provided :ref:`here <build from source using cmake>`.
* compile the example **e4-rxr** by:
.. code-block:: bash

View File

@ -8,21 +8,24 @@ open an issue at our `github repo issues
Common
------
Missing Packets
^^^^^^^^^^^^^^^
Possible causes could be the following:
#. Receiver PC is not tuned for socket buffer size and input packet queue.
* Refer to :ref:`Increase rmem_default, rmem_max and max_backlog<Receiver PC Tuning>`
1. Total Failure of Packet Delivery
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#. Wiring
* Faulty wiring or connecting cable to incorrect interface.
#. Data cable plugged into the wrong interface on board (Jungfrau)
* Please ensure that the data cable is plugged into the rightmost interface (default for single interface). The inner one is disabled for PCB v1.0 and must be selected via command for PCB v2.0.
#. Link up and speed
* Check to see if there is a blue LED on board to signal that the link is up. Check ethtool and find if Link Deteced:Yes and Speed is acceptable (>10k).
* Check ethtool and find if Link Deteced:Yes and Speed is acceptable (>10k).
* Check to see if the 10G link is up (blue or red LED on board, close to SFP+). If not:
* Check transeiver and fibers are compatible (all MMF 850nm or all SMF 1030nm)
* Check fiber
* Check fiber polarity (if short range, unplug the link anywhere, and look at the light/dark pattern: dark has to mate with light)
#. Detector is not acquiring (Not Eiger)
* Take an acquisition with many images and using the following steps instead of acquire:
.. code-block:: bash
sls_detector_put status start
@ -30,44 +33,79 @@ Possible causes could be the following:
# which means the detector is acquiring.
sls_detector_get framesl
.. note ::
If you are using multiple modules, the previous command can return -1 because each module will return different values. Then, check for a single module instead: sls_detector_get 0:framesl
# If you are using multiple modules, the previous command can return -1 because each module will return different values. Then, check for a single module instead: sls_detector_get 0:framesl
#. Data cable plugged into the wrong interface on board (Jungfrau)
* Please ensure that the data cable is plugged into the rightmost interface. The middle one is disabled for PCB v1.0 and must be selected via command for PCB v2.0.
#. Detector is not sending data
* Check the board to see if the green LED is blinking next to the data cable, which means that the detector is sending data.
#. Detector is not sending data (Except Eiger)
* Check the board to see if the green LED close to SFP is blinking (detector is sending data). If not, detector is not operated properly (period too short/long, no trigger in trigger mode) or misconfigured and needs reboot.
#. Firewall or security feature
* A firewall or some security feature could be blocking the reception of data.
#. Ethernet interface not configured properly
* Ensure that the interfaces used are configured properly with the right mask and ip. Eg. use ifconfig and route commands to verify.
#. Power supply
* Check if power supply has enough current.
* For Jungfrau, refer to :ref:`Jungfrau Power Supply Troubleshooting<Jungfrau Troubleshooting Power Supply>`.
#. Ethernet interface not configured for Jumbo frames (10Gb)
* Ensure that the interfaces used in receiver pc have MTU 9000 (jumbo frames) enabled.
* Ensure that the interfaces (on NIC and the switch) used in receiver pc have MTU 9000 (jumbo frames) enabled.
#. Detector IP (Not Eiger)
* Ensure it is valid and does not end if 0 or 255. Also ensure that the detector ip is in the same subnet as rx_udpip and the masking in the interface configuration ensures this rule.
#. Tcpdump or wireshark
#. Check if 'rx_frames' counter in 'ifconfig' do not increment for interface.
* If no, check switch configuration if present. Port counters of switch can also help to identify problem.
* If yes, but receiver software does not see it:
* Check no firewall (eg. firewalld) is present or add rules
* Check that selinux is disabled ( or add rules)
#. Source UDP IP in config file (Not Eiger)
* Ensure it is valid and does not end if 0 or 255. Also ensure that the source ip 'udp_srcip' is in the same subnet as destination ip 'udp_dstip' and the masking in the interface configuration ensures this rule.
* Eg. If interface IP is 102.10.10.110 and mask is 255.255.255.0, udp_srcip has to be 102.10.10.xxx (same subnet)
* Use ifconfig and route commands to verify etheret interface configuration
#. Netstat and netcat
* Try with netstat to see if its really listening to the right interface. Or netcat to see if you get packets.
#. Wireshark or Tcpdump
* Use one of these to confirm that you receive packets (with the right filtering ie. source and destination ports, ip).
#. Check SFP modules
* Check if the SFP modules on both sides of the fiber are of same type.
2. Partial or Random Packet Loss (Performance)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. note ::
The following suggestions are for convenience. Please do not follow blindly, research each parameter and adapt it to your system.
#. Receiver PC is not tuned for socket buffer size and input packet queue or other parameters.
* Refer to :ref:`Receiver PC Tuning<Receiver PC Tuning>`
#. Wiring
* Faulty wiring or connecting cable to incorrect interface.
#. Pinging the subnet (receiving only a few number of packets each time)
* If a switch is used between a receiver pc and detector instead of plugging the cables directly, one might have to ping any ip in the subnet of the Ethernet interface constantly so that it does not forget the ip during operation.
* Eg. if rx_udpip is 10.2.3.100, then ping constantly 10.2.3.xxx, where xxx is any ip other than 100.
* Using slsReceiver, you can use a command that does this for you:
.. code-block:: bash
# arping the interface in a separate thread every minute
sls_detector_put rx_arping 1
#. Only the slaves get no data
* Check trigger cabling and trigger configuration
* When you cannot stop Jungfrau slaves in sync mode, refer to :ref:`Cannot stop slaves<Jungfrau Troubleshooting Sync Slaves Cannot Stop>`.
.. _Receiver PC Tuning:
Receiver PC Tuning Options
^^^^^^^^^^^^^^^^^^^^^^^^^^
.. note ::
| xth1 is example interface name in the following examples.
| These settings are lost at pc reboot.
#. Increase maximum receive socket buffer size and socket input packet queue.
* Temporarily (until shut down)
.. code-block:: bash
@ -111,6 +149,7 @@ Receiver PC Tuning Options
# check how many GB memory you can allocate, to avoid swapping otherwise
#. Modify ethtool settings.
* rx ring parameters
.. code-block:: bash
@ -127,6 +166,9 @@ Receiver PC Tuning Options
# check
ethtool -c xth1
# enable adaptive xoalescence parameters
ethtool -C xth1 adaptive-rx on
# set to max value in your pc settings
ethtool -C xth1 rx-usecs 100
@ -138,11 +180,43 @@ Receiver PC Tuning Options
# set to max value in your pc settings
ethtool -A xth1 rx on
.. note ::
* generic receiver offload (might not always work)
.. code-block:: bash
| xth1 is example interface name.
| These settings are lost at pc reboot.
# check
ethtool -k xth1
# enable generic receiver offload
ethtool -K xth1 gro
#. Disable power saving in CPU frequency scaling and set system to performance
* Check current policy (default might be powersave or schedutil)
.. code-block:: bash
# check current active governor and range of cpu freq policy
cpupower frequency-info --policy
# list all available governors for this kernel
cpupower frequency-info --governors
* Temporarily (until shut down)
.. code-block:: bash
# set to performance
sudo cpupower frequency-set -g performance
# or
cpufreq-info
for i in seq 0 7; do cpufreq-set -c $i -g performance; done
* Permanently
.. code-block:: bash
# edit /etc/sysconfig/cpupower to preference
# enable or disable permanently
sudo systemctl enable cpupower
#. Give user speicific user scheduling privileges.
.. code-block:: bash
@ -155,18 +229,29 @@ Receiver PC Tuning Options
This is also set if slsReceiver is run as root user.
#. Some more advanced options:
.. warning ::
#. Disable power saving in CPU frequency
.. code-block:: bash
Please do not try if you do not understand
# or similar command depending on your distribution
cpupower frequency-info
cpupower frequency-set -g performance
#. reduce the number of queue per NIC to the number of expected streams: ethtool -L xth0 combined 2
#. assign each queue to its stream: ethtool -U xth0 flow-type tcp4 dst-port 50004 action 1
#. assign to each queue (IRQ) one CPU on the right socket: echo "3"> /proc/irq/47/smp_affinity_list #change the numbers looking at /proc/interrupts
#. disable irqbalance service
#. Be sure that the switch knows the receiver mac address. Most switches reset the mac lists every few minutes, and since the receiver only receives, there is not a periodic refresh of the mac list. In this case, one can set a fixed mac list in the switch, or setup some kind of script arping or pinging out from that interface (will be available in 7.0.0).
#. assign the receiver numa node (also with -m) to the socket where the NIC is attached. To know it, cat /sys/class/net/ethxxx/device/numa_node
#. ensure file system performance can handle sustained high data rate:
* One can use dd:
# or
cpufreq-info
for i in seq 0 7; do cpufreq-set -c $i -g performance; done
.. code-block:: bash
dd if=/dev/zero of=/testpath/testfile bs=1M count=100000
* Or better fio (which needs to be installed)
.. code-block:: bash
fio --name=global directory=/testpath/ --rw=write --ioengine=libaio --direct=0 --size=200G -- numjobs=2 --iodepth=1 --bs=1M name=job
slsReceiver Tuning
^^^^^^^^^^^^^^^^^^
@ -174,18 +259,25 @@ slsReceiver Tuning
#. Starting receiver as root to have scheduling privileges.
#. For 10g, enable flow control
.. code-block:: bash
sls_detector_put flowcontrol10g 1
#. Increase slsReceiver fifo depth between listening and processing threads.
#. Increase slsReceiver ring buffer depth
This can be tuned depending on the number of receivers (modules) and memory available.
.. code-block:: bash
sls_detector_get rx_fifodepth
# sets number of frames in fifo to 5000
sls_detector_put rx_fifodepth 5000
# sugggested not to use more than half memory of CPU socket in case of NUMA systems) for this
sls_detector_get rx_fifodepth
# sets number of frames in fifo to 1024 ~1GB per receiver. Default is 2500
sls_detector_put rx_fifodepth 1024
#. Increase number of frames per file
This can reduce time taken to open and close files.
#. Increase number of frames per file to reduce time taken to open and close files.
.. code-block:: bash
sls_detector_get rx_framesperfile
@ -193,10 +285,31 @@ slsReceiver Tuning
# writes all frames into a single file
sls_detector_put rx_framesperfile 0
#. Disable file write
This can ensure it is not the file system performance hampering high date rate.
.. code-block:: bash
sls_detector_put fwrite 0
Shared memory error
^^^^^^^^^^^^^^^^^^^
| For errors due to access or size, delete shared memory files nd try again.
For errors due to access or size, use any of the following suggestions.
#. Delete shared memory files and try again
#. Use environment variable to use a different shared memory ending in jfxx
.. code-block:: bash
# shared memory ending in jfxx
export SLSDETNAME=jfxx
#. USe a different multi shared memory ID
.. code-block:: bash
sls_detector_put 2-config xxxx.config
# or
sls_detector_put 2-hostname bchipxxx
To list all shared memory files of sls detector package.
.. code-block:: bash
@ -307,6 +420,24 @@ Cannot get multi module data
#. Check :ref:`Common Multi Module Troubleshooting<common troubleshooting multi module data>`
#. Power Supply
* Jungfrau needs a ~4A per module for a short time at startup. If not, it reboots misconfigured.
* Comment out this line in the config file: powerchip 1
* Powering on the chip increases the power consumption by a considerable amount. If commenting out this line aids in getting data (strange data due to powered off chip), then it could be the power supply current limit. Fix it (possibly to 8A current limit) and uncomment the powerchip line back in config file.
.. _Jungfrau Troubleshooting Sync Slaves Cannot Stop:
Cannot stop slaves in sync mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#. If cabling is accessible, ensure termination board and flatband cable between the masters and the slaves are connnected properly. Then try to stop.
#. If cabling is inaccessible, unsync first so that the slaves can get the stop directly from the client using the command. Then, don't use sync mode until the cabling is fixed.
.. code-block:: bash
# unsync, slaves command will fail as it is still in waiting state
sls_detector_put sync 0
# stop should now be successful as master does not determine the stop anymore
sls_detector_put stop

37
docs/src/udpconfig.rst Normal file
View File

@ -0,0 +1,37 @@
.. _detector udp header:
Config file
============
Commands to configure the UDP in the config file:
.. note ::
These command are recommended to be placed before "rx_hostname" if it is used.
Source Port
-----------
Hardcoded in detector server, starting at 32410.
udp_srcip - Source IP
---------------------
IP address of detector UDP interface to send packets from. Do not use for Eiger 1Gb interface (uses its hardware IP). For others, must be in the same subnet as **udp_dstip**.
udp_srcmac - Source MAC
-----------------------
MAC address of detector UDP interface to send packets from. Do not use for Eiger (uses hardware mac). For others, it is not necessary, but can help for switch and debugging to put unique values for each module.
udp_dstport - Desintation Port
-------------------------------
Port in receiver pc to listen to packets from the detector.
udp_dstip - Destination IP
--------------------------
IP address of interface in receiver pc to listen to packets from detector. If **auto** is used (only when using slsReceiver/ slsMultiReceiver), the IP of **rx_hostname** is picked up.
udp_dstmac - Destination MAC
----------------------------
MAC address of interface in receiver pc to list to packets from detector. Only required when using custom receiver, else slsReceiver/slsMultiReceiver picks it up from **udp_dstip**.

152
docs/src/udpdetspec.rst Normal file
View File

@ -0,0 +1,152 @@
.. _detector specific fields:
Detector Specific Fields
========================
Please check out :ref:`the current detector header <detector udp header>` to see
where the detector specific fields are placed.
Eiger
------
.. table:: Detector Specific Field
+----------+------------------------------+
| expLength| Sub Frame Number |
+----------+------------------------------+
| detSpec1 | 0x0 |
+----------+------------------------------+
| detSpec2 | 0x0 |
+----------+------------------------------+
| detSpec3 | e14a |
+----------+------------------------------+
| detSpec4 | Round Robin Interface Number |
+----------+------------------------------+
Jungfrau
---------
.. table:: Detector Specific Field
+----------+------------------------------+
| detSpec1 | Bunch Id [#]_ |
+----------+------------------------------+
| detSpec2 | 0 |
+----------+------------------------------+
| detSpec3 | DAQ info |
+----------+------------------------------+
| detSpec4 | 0 |
+----------+------------------------------+
.. table:: DAQ Info Field
+----------+--------------------+----------------------------------------------+
| Bits | Name | Description |
+----------+--------------------+-----+----------------------------------------+
| 0 | High gain | 1 | High Gain enabled |
| | +-----+----------------------------------------+
| | | 0 | High Gain disabled |
+----------+--------------------+-----+----------------------------------------+
| 1 | Fix gain stage 1 | 1 | Gain stage 1 fixed. The switch that |
| | | | selects the gains stage 1 is active all|
| | | | the time. |
| | +-----+----------------------------------------+
| | | 0 | Gain stage 1 unset. The switch that |
| | | | selects the gains stage 1 is inactive |
| | | | all the time. |
+----------+--------------------+-----+----------------------------------------+
| 2 | Fix gain stage 2 | 1 | Gain stage 2 fixed. The switch that |
| | | | selects the gains stage 2 is active all|
| | | | the time. |
| | +-----+----------------------------------------+
| | | 0 | Gain stage 2 unset. The switch that |
| | | | selects the gains stage 2 is inactive |
| | | | all the time. |
+----------+--------------------+-----+----------------------------------------+
| 4 | Comparator reset | 1 | On-chip comparator in reset state. |
| | | | Dynamic-gain switching is therefore |
| | | | disabled. |
| | +-----+----------------------------------------+
| | | 0 | On-chip comparator active. |
+----------+--------------------+-----+-----+-----+----------------------------+
| 7-5 | Jungfrau chip |Bit 7|Bit 6|Bit 5| Description |
| | version +-----+-----+-----+----------------------------+
| | | 0 | 0 | 0 | v1.0 |
| | +-----+-----+-----+----------------------------+
| | | 0 | 0 | 1 | v1.1 |
| | +-----+-----+-----+----------------------------+
| | | 0 | 1 | X | Reserved |
| | +-----+-----+-----+----------------------------+
| | | 1 | X | X | Reserved |
+----------+--------------------+-----+-----+-----+----------------------------+
| 11-8 | Storage cell select|Storage cell used for this exposure. This |
| | |field defines the storage cell that was used |
| | |to acquire the data of this frame |
+----------+--------------------+-----+----------------------------------------+
| 12 | Force switching | 1 | Forced switching to gain stage 1 at the|
| | to gain stage 1 | | start of the exposure period. |
| | +-----+----------------------------------------+
| | | 0 | Disabled forced gain switching to gain |
| | | | stage 1. Dynamic gain switching |
| | | | conditions apply. |
+----------+--------------------+-----+----------------------------------------+
| 13 | Force switching | 1 | Forced switching to gain stage 2 at the|
| | to gain stage 2 | | start of the exposure period. |
| | +-----+----------------------------------------+
| | | 0 | Disabled forced gain switching to gain |
| | | | stage 2. Dynamic gain switching |
| | | | conditions apply. |
+----------+--------------------+-----+-----+-----+----------------------------+
| 23-16 | 10-Gigabit event |The 8-bit event code contains value of the |
| | code |event received over the 10 GbE interface by |
| | |JUNGFRAU detector at the moment of the frame |
| | |acquisition. |
+----------+--------------------+-----+----------------------------------------+
| 31 | External input flag| 1 | External input flag detected in the |
| | | | last exposure. |
| | +-----+----------------------------------------+
| | | 0 | External input flag not detected in the|
| | | | last exposure. |
+----------+--------------------+-----+----------------------------------------+
Gotthard2
----------
.. table:: Detector Specific Field
+----------+------------------------------+
| detSpec1 | Train Id [#]_ |
+----------+------------------------------+
| detSpec2 | Bunch Id [#]_ |
+----------+------------------------------+
| detSpec3 | 0 |
+----------+------------------------------+
| detSpec4 | 0 |
+----------+------------------------------+
Mythen3
----------
.. table:: Detector Specific Field
+----------+------------------------------+
| detSpec1 | 0 |
+----------+------------------------------+
| detSpec2 | 0 |
+----------+------------------------------+
| detSpec3 | 0 |
+----------+------------------------------+
| detSpec4 | 0 |
+----------+------------------------------+
.. [#] **Bunch Id**: bunch identification number received by the detector at the moment of frame acquisition.
.. [#] **Train Id**: train identification number received by the detector at the moment of frame acquisition.
.. [#] **Bunch Id**: bunch identification number to identify every single exposure during a burst acquisition.

125
docs/src/udpheader.rst Normal file
View File

@ -0,0 +1,125 @@
.. _detector udp header:
Format
=======
The UDP data format for the packets consist of a common header for all detectors, followed by the data for that one packet.
Current Version
---------------------------
**v2.0 (slsDetectorPackage v7.0.0+)**
.. table:: <---------------------------------------------------- 8 bytes per row --------------------------------------------->
:align: center
:widths: 30,30,30,15,15
+---------------------------------------------------------------+
| frameNumber |
+-------------------------------+-------------------------------+
| expLength | packetNumber |
+-------------------------------+-------------------------------+
| **detSpec1** |
+---------------------------------------------------------------+
| timestamp |
+---------------+---------------+---------------+---------------+
| modId | row | column | **detSpec2** |
+---------------+---------------+---------------+-------+-------+
| **detSpec3** | **detSpec4** |detType|version|
+-------------------------------+---------------+-------+-------+
.. note ::
Since there is no difference in the format of the UDP header from the detector
from the previous version (v2.0), the version number stays the same.
Only the struture member names have changed in sls_detector_defs.h
Description
------------
* **Detector specific field** descriptions are found :ref:`here<detector specific fields>`.
* **frameNumber**: framenumber to which the current packet belongs to.
* **expLength**: measured exposure time of the frame in tenths of microsecond. It is instead the sub frame number for Eiger.
* **packetNumber**: packet number of the frame to which the current data belongs to.
* **timestamp**: time measured at the start of frame exposure since the start of the current measurement. It is expressed in tenths of microsecond.
* **modId**: module ID picked up from det_id_[detector type].txt on the detector cpu.
* **row**: row position of the module in the detector system. It is calculated by the order of the module in hostname command, as well as the detsize command.
* **column**: column position of the module in the detector system. It is calculated by the order of the module in hostname command, as well as the detsize command.
* **detType**: detector type from enum of detectorType in the package.
* **version**: current version of the detector header (0x2).
Detector Enum
--------------
================ ========
Detector Type Value
================ ========
GENERIC 0
EIGER 1
GOTTHARD 2
JUNGFRAU 3
CHIPTESTBOARD 4
MOENCH 5
MYTHEN3 6
GOTTHARD2 7
================ ========
Previous Versions
-----------------
**v2.0 (Package v4.0.0 - 6.x.x)**
.. table:: <---------------------------------------------------- 8 bytes ---------------------------------------------------->
:align: center
:widths: 30,30,30,15,15
+---------------------------------------------------------------+
| frameNumber |
+-------------------------------+-------------------------------+
| expLength | packetNumber |
+-------------------------------+-------------------------------+
| bunchid |
+---------------------------------------------------------------+
| timestamp |
+---------------+---------------+---------------+---------------+
| modId | **row** | **column** | **reserved** |
+---------------+---------------+---------------+-------+-------+
| debug | roundRNumber |detType|version|
+-------------------------------+---------------+-------+-------+
**v1.0 (Package v3.0.0 - 3.1.5)**
.. table:: <---------------------------------------------------- 8 bytes ---------------------------------------------------->
:align: center
:widths: 30,30,30,15,15
+---------------------------------------------------------------+
| frameNumber |
+-------------------------------+-------------------------------+
| expLength | packetNumber |
+-------------------------------+-------------------------------+
| bunchid |
+---------------------------------------------------------------+
| timestamp |
+---------------+---------------+---------------+---------------+
| modId | xCoord | yCoord | zCoord |
+---------------+---------------+---------------+-------+-------+
| debug | roundRNumber |detType|version|
+-------------------------------+---------------+-------+-------+

View File

@ -1,6 +1,6 @@
.. _Virtual Detector Servers:
Detector Simulators
===================
Simulators
===========
Compilation
-----------
@ -13,16 +13,14 @@ Compilation
* Using cmk.sh script,
.. code-block:: bash
./cmk.sh -bsj9 #option s is for simulator
./cmk.sh -bsj9 # option -s is for simulator
Binaries
^^^^^^^^
.. code-block:: bash
eigerDetectorServerMaster_virtual
eigerDetectorServerSlaveTop_virtual
eigerDetectorServerSlaveBottom_virtual
eigerDetectorServer_virtual
jungfrauDetectorServer_virtual
gotthardDetectorServer_virtual
gotthard2DetectorServer_virtual
@ -67,7 +65,15 @@ Sample Config file
^^^^^^^^^^^^^^^^^^
There are sample config files for each detector in slsDetectorPackage/examples folder.
For a Single Module
For a Single Module (Basic)
.. code-block:: bash
hostname localhost
rx_hostname localhost
udp_dstip auto
For a Single Module (With Options)
.. code-block:: bash
# connects to control port 1912
@ -80,7 +86,8 @@ For a Single Module
udp_dstport 50012
# source udp ips must be same subnet at destintaion udp ips
udp_srcip 192.168.1.112
# takes the same ip as hostname
udp_srcip auto
# destination udp ip picked up from rx_hostname (if auto)
udp_dstip auto
@ -95,12 +102,14 @@ For Multiple Modules
virtual 2 1912
# or hostname localhost:1912+localhost:1914+
# connects to receivers at ports 2012 and 2014
rx_hostname mpc1922:2012+mpc1922:2013+
# increasing receiver tcp ports (multi detector command)
rx_tcpport 2012
# sets differernt destination udp ports
0:udp_dstport 50012
1:udp_dstport 50014
# connects to reciever at port 2012 and 2013
rx_hostname mpc1922
# sets increasing destination udp ports
udp_dstport 50012
# source udp ips must be same subnet at destintaion udp ips
0:udp_srcip 192.168.1.112
@ -140,7 +149,7 @@ Gui
Limitations
-----------
#. Data coming out of virtual server is fake. Value at each pixel/ channel is incremented by 1.
#. Data coming out of virtual server is fake.
#. A stop will stop the virtual acquisition only at the start of every new frame.

View File

@ -1,4 +1,4 @@
/* override table no-wrap */
.wy-table-responsive table td, .wy-table-responsive table th {
white-space: normal;
}
}

View File

@ -1,24 +0,0 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
GITREPO1='git remote -v'
GITREPO2=" | grep \"fetch\" | cut -d' ' -f1"
BRANCH1='git branch -v'
BRANCH2=" | grep '*' | cut -d' ' -f2"
REPUID1='git log --pretty=format:"%H" -1'
AUTH1_1='git log --pretty=format:"%cn" -1'
AUTH1_2=" | cut -d' ' -f1"
AUTH2_1='git log --pretty=format:"%cn" -1'
AUTH2_2=" | cut -d' ' -f2"
FOLDERREV1='git log --oneline . ' #used for all the individual server folders
FOLDERREV2=" | wc -l" #used for all the individual server folders
REV1='git log --oneline '
REV2=" | wc -l"
GITREPO=`eval $GITREPO1 $GITREPO2`
BRANCH=`eval $BRANCH1 $BRANCH2`
REPUID=`eval $REPUID1`
AUTH1=`eval $AUTH1_1 $AUTH1_2`
AUTH2=`eval $AUTH2_1 $AUTH2_2`
REV=`eval $REV1 $REV2`
FOLDERREV=`eval $FOLDERREV1 $FOLDERREV2`

6
examples/badchannel.txt Normal file
View File

@ -0,0 +1,6 @@
0
10, 30
40:45 50:52
1279
# all bad channels are applied for all counters in deector

View File

@ -4,27 +4,33 @@ detsize 1024 512
# detector hostname for controls
hostname beb059+beb058+
# 1Gb receiver pc hostname with tcp port to configure receiver
rx_hostname x12sa-vcons:1991+x12sa-vcons:1992
# increasing receiver tcp port (multi detector command)
rx_tcpport 1991
# 1Gb receiver pc hostname to configure receiver
rx_hostname x12sa-vcons
# or 1Gb receiver pc hostname with tcp port to configure receiver
#rx_hostname x12sa-vcons:1991+x12sa-vcons:1992
# increasing udp destination ports for all half modules
udp_dstport 50011
# udp port first quadrant, first halfmodule
0:udp_dstport 50011
#0:udp_dstport 50011
# udp port second quadrant, first halfmodule
0:udp_dstport2 50012
#0:udp_dstport2 50012
# udp port first quadrant, second halfmodule
#1:udp_dstport 50013
# udp port second quadrant, second halfmodule
#1:udp_dstport2 50014
# udp IP of the receiver over 10Gb
0:udp_dstip 10.0.30.210
# first half module 10 Gb IP (same subnet as 0:udp_dstip)
0:udp_srcip 10.0.30.100
# udp port first quadrant, second halfmodule
1:udp_dstport 50013
# udp port second quadrant, second halfmodule
1:udp_dstport2 50014
# udp IP of the receiver over 10Gb,
1:udp_dstip 10.0.40.210

View File

@ -4,18 +4,23 @@ detsize 1024 512
# detector hostname for controls
hostname beb059+beb058+
# 1Gb receiver pc hostname with tcp port to configure receiver
rx_hostname x12sa-vcons:1991+x12sa-vcons:1992
# increasing receiver tcp port (multi detector command)
rx_tcpport 1991
# 1Gb receiver pc hostname to configure receiver
rx_hostname x12sa-vcons
# increasing udp destination ports for all half modules
udp_dstport 50011
# udp port first quadrant, first halfmodule
0:udp_dstport 50011
#0:udp_dstport 50011
#udp port second quadrant, first halfmodule
0:udp_dstport2 50012
#0:udp_dstport2 50012
# udp port first quadrant, second halfmodule
1:udp_dstport 50013
#1:udp_dstport 50013
# udp port second quadrant, second halfmodule
1:udp_dstport2 50014
#1:udp_dstport2 50014
# output directory
fpath /sls/X12SA/data/x12saop/Data10/Eiger0.5M

View File

@ -409,18 +409,18 @@ patword 018d 0008599f0008503a
patioctrl 8f0effff6dbffdbf
patclkctrl 0000000000000000
patlimits 0000 018c
patloop0 013a 016b
patnloop0 199
patloop1 0400 0400
patnloop1 0
patloop2 0400 0400
patnloop2 0
patwait0 00aa
patwaittime0 10000
patwait1 0400
patwaittime1 0
patwait2 0400
patwaittime2 0
patloop 0 013a 016b
patnloop 0 199
patloop 1 0400 0400
patnloop 1 0
patloop 2 0400 0400
patnloop 2 0
patwait 0 00aa
patwaittime 0 10000
patwait 1 0400
patwaittime 1 0
patwait 2 0400
patwaittime 2 0
#############################################
### edit with hostname or 1Gbs IP address of your server

View File

@ -4,14 +4,18 @@ detsize 1024 1024
# detector hostname
hostname bchip048+bchip052+
# 1Gb receiver pc hostname (default tcpport: 1954)
rx_hostname pcmoench01+pcmoench01:1955
# increasing receiver ports 1954 and 1955 (multi detector command)
rx_tcpport 1954
# 1Gb receiver pc hostname
rx_hostname pcmoench01
# increasing udp ports 50004 and 50005 (multi detector command)
udp_dstport 50004
# or custom udp destination port (receiver) for 1st module
#0:udp_dstport 50014
# udp configurations for 1st module
# udp destination port (receiver)
0:udp_dstport 50004
# udp destination ip (receiver)
0:udp_dstip 10.1.1.100
@ -19,17 +23,11 @@ rx_hostname pcmoench01+pcmoench01:1955
# udp source ip (same subnet as 0:udp_dstip)
0:udp_srcip 10.1.1.10
# udp configurations for 2nd module
# udp destination port (receiver)
1:udp_dstport 50005
# udp destination ip (receiver)
1:udp_dstip 10.1.1.100
1:udp_dstip 10.1.2.100
# udp source ip (same subnet as 1:udp_dstip)
1:udp_srcip 10.1.1.11
1:udp_srcip 10.1.2.11
@ -45,5 +43,5 @@ timing trigger
# output file directory
fpath /external_pool/jungfrau_data/softwaretest
# disable file writing
# disable file writing (default)
fwrite 0

View File

@ -3,33 +3,33 @@
### edit with hostname or IP address of your detector
############################################
#hostname bchip181+
hostname bchip119.psi.ch
hostname bchip135
#############################################
### edit with hostname or 1Gbs IP address of your server
############################################
rx_hostname mpc2011:1777
rx_hostname mpc2011
#############################################
### edit with 10 Gbs IP of your server
############################################
udp_dstip 10.1.2.102
udp_dstip 10.1.1.102
#############################################
### edit with any number in the subnet of your server (first 3 numbers as above)
############################################
udp_srcip 10.1.2.19
udp_dstport 32000
udp_srcip 10.1.1.19
udp_dstport 32411
#############################################
### edit with 10 Gbs IP of your server
############################################
rx_zmqip 10.1.2.102
rx_zmqport 77000
rx_zmqip 10.1.1.102
rx_zmqport 50003
#############################################
### edit with 1 Gbs IP of PC where you will run the GUI
############################################
zmqip 129.129.202.132
zmqport 77001
zmqip 129.129.202.57
zmqport 50001
@ -38,7 +38,7 @@ rx_zmqstream 1
frames 1000
frames 100000
period 0.0006
exptime 0.00035
@ -62,9 +62,3 @@ highvoltage 90
#adcreg 0x14 0x40
frames 10
period 0.1
rx_jsonpara subframes 1
rx_jsonpara frameMode raw
rx_jsonpara detectorMode analog

View File

@ -1,18 +1,18 @@
# detector hostname
hostname localhost:1910
# receiver hostname
rx_hostname mpc1922:2010
# udp destination ports
udp_dstport 50010
# udp destination ip from rx_hostname
udp_dstip auto
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
# receiver hostname
rx_hostname mpc1922:2010
# udp destination ip from rx_hostname
udp_dstip auto
# output file directory
fpath /tmp
@ -27,418 +27,7 @@ dbitclk 40
# patterns
patword 0x0000 0x0000000000000000
patword 0x0001 0x0000000000000000
patword 0x0002 0x0008000900080000
patword 0x0003 0x0008000900080000
patword 0x0004 0x0008000900080000
patword 0x0005 0x0008000900080000
patword 0x0006 0x0008000900080000
patword 0x0007 0x0008000900080000
patword 0x0008 0x0008000900080000
patword 0x0009 0x0008000900080000
patword 0x000a 0x0008000900080000
patword 0x000b 0x0008000900080000
patword 0x000c 0x0008000900080000
patword 0x000d 0x0008000900080000
patword 0x000e 0x0008000900080000
patword 0x000f 0x0008000900080000
patword 0x0010 0x0008000900080000
patword 0x0011 0x0008000900080000
patword 0x0012 0x0008000900080000
patword 0x0013 0x0008000900080000
patword 0x0014 0x0008000900080000
patword 0x0015 0x0008000900080000
patword 0x0016 0x0008400900080020
patword 0x0017 0x0008400900080020
patword 0x0018 0x0008599f0418503a
patword 0x0019 0x0008599f0418503a
patword 0x001a 0x0108599f0418503a
patword 0x001b 0x0108599f0418503a
patword 0x001c 0x0108599f0418503a
patword 0x001d 0x0108599f0418503a
patword 0x001e 0x0108599f0418503a
patword 0x001f 0x0108599f0418503a
patword 0x0020 0x0108599f0418503a
patword 0x0021 0x0108599f0418503a
patword 0x0022 0x0108599f0418503a
patword 0x0023 0x0108599f0418503a
patword 0x0024 0x0108599f0418503a
patword 0x0025 0x0108599f0418503a
patword 0x0026 0x0108599f0418503a
patword 0x0027 0x0108599f0418503a
patword 0x0028 0x0108599f0418503a
patword 0x0029 0x0108599f0418503a
patword 0x002a 0x0108599f0418503a
patword 0x002b 0x0108599f0418503a
patword 0x002c 0x0108599f0418503a
patword 0x002d 0x0108599f0418503a
patword 0x002e 0x0108599f0418503a
patword 0x002f 0x0108599f0418503a
patword 0x0030 0x0108599f0418503a
patword 0x0031 0x0108599f0418503a
patword 0x0032 0x0108599f0418503a
patword 0x0033 0x0108599f0418503a
patword 0x0034 0x0108599f0418503a
patword 0x0035 0x0108599f0418503a
patword 0x0036 0x0108599f0418503a
patword 0x0037 0x0108599f0418503a
patword 0x0038 0x0108599f0418503a
patword 0x0039 0x0108599f0418503a
patword 0x003a 0x0108599f0418503a
patword 0x003b 0x0108599f0418503a
patword 0x003c 0x0108599f0418503a
patword 0x003d 0x0108599f0418503a
patword 0x003e 0x0108599f0418503a
patword 0x003f 0x0108599f0418503a
patword 0x0040 0x0108599f0418503a
patword 0x0041 0x0108599f0418503a
patword 0x0042 0x0108599f0418503a
patword 0x0043 0x0108599f0418503a
patword 0x0044 0x0108599f0418503a
patword 0x0045 0x0108599f0418503a
patword 0x0046 0x0108599f0418503a
patword 0x0047 0x0108599f0418503a
patword 0x0048 0x0108599f0418503a
patword 0x0049 0x0108599f0418503a
patword 0x004a 0x0108599f0418503a
patword 0x004b 0x0108599f0418503a
patword 0x004c 0x0108599f0418503a
patword 0x004d 0x0108599f0418503a
patword 0x004e 0x0108599f0418503a
patword 0x004f 0x0108599f0418503a
patword 0x0050 0x0108599f0418503a
patword 0x0051 0x0108599f0418503a
patword 0x0052 0x0108599f0418503a
patword 0x0053 0x0108599f0418503a
patword 0x0054 0x0108599f0418503a
patword 0x0055 0x0108599f0418503a
patword 0x0056 0x0108599f0418503a
patword 0x0057 0x0108599f0418503a
patword 0x0058 0x0108599f0418503a
patword 0x0059 0x0108599f0418503a
patword 0x005a 0x0108599f0418503a
patword 0x005b 0x0108599f0418503a
patword 0x005c 0x0108599f0418503a
patword 0x005d 0x0108599f0418503a
patword 0x005e 0x0108599f0418503a
patword 0x005f 0x0108599f0418503a
patword 0x0060 0x0108599f0418503a
patword 0x0061 0x0108599f0418503a
patword 0x0062 0x0108599f0418503a
patword 0x0063 0x0108599f0418503a
patword 0x0064 0x0108599f0418503a
patword 0x0065 0x0108599f0418503a
patword 0x0066 0x0108599f0418503a
patword 0x0067 0x0108599f0418503a
patword 0x0068 0x0108599f0418503a
patword 0x0069 0x0108599f0418503a
patword 0x006a 0x0108599f0418503a
patword 0x006b 0x0108599f0418503a
patword 0x006c 0x0108599f0418503a
patword 0x006d 0x0108599f0418503a
patword 0x006e 0x0108599f0418503a
patword 0x006f 0x0108599f0418503a
patword 0x0070 0x0108599f0418503a
patword 0x0071 0x0108599f0418503a
patword 0x0072 0x0108599f0418503a
patword 0x0073 0x0108599f0418503a
patword 0x0074 0x0108599f0418503a
patword 0x0075 0x0108599f0418503a
patword 0x0076 0x0108599f0418503a
patword 0x0077 0x0108599f0418503a
patword 0x0078 0x0108599f0418503a
patword 0x0079 0x0108599f0418503a
patword 0x007a 0x0108599f0418503a
patword 0x007b 0x0108599f0418503a
patword 0x007c 0x0108599f0418503a
patword 0x007d 0x0108599f0418503a
patword 0x007e 0x010859960418503a
patword 0x007f 0x010859960418503a
patword 0x0080 0x010859960418503a
patword 0x0081 0x010859960418503a
patword 0x0082 0x010859960418503a
patword 0x0083 0x010859960418503a
patword 0x0084 0x010859960418503a
patword 0x0085 0x010859960418503a
patword 0x0086 0x010859960418503a
patword 0x0087 0x010859960418503a
patword 0x0088 0x010859960418503a
patword 0x0089 0x010859960418503a
patword 0x008a 0x010859960418503a
patword 0x008b 0x010859960418503a
patword 0x008c 0x010859960418503a
patword 0x008d 0x010859960418503a
patword 0x008e 0x010859960418503a
patword 0x008f 0x010859960418503a
patword 0x0090 0x010859960418503a
patword 0x0091 0x010859960418503a
patword 0x0092 0x010819960418501a
patword 0x0093 0x010819960418501a
patword 0x0094 0x010819960418501a
patword 0x0095 0x010819960418501a
patword 0x0096 0x030819960418501a
patword 0x0097 0x030819960418501a
patword 0x0098 0x030819960418501a
patword 0x0099 0x030819960418501a
patword 0x009a 0x030819960418501a
patword 0x009b 0x030819960418501a
patword 0x009c 0x030819960418501a
patword 0x009d 0x030819960418501a
patword 0x009e 0x030819960418501a
patword 0x009f 0x030819960418501a
patword 0x00a0 0x030819960418501a
patword 0x00a1 0x030819960418501a
patword 0x00a2 0x030819960418501a
patword 0x00a3 0x030819960418501a
patword 0x00a4 0x030819960418501a
patword 0x00a5 0x030819960418501a
patword 0x00a6 0x030819960418501a
patword 0x00a7 0x030819960418501a
patword 0x00a8 0x030819960418501a
patword 0x00a9 0x030819960418501a
patword 0x00aa 0x030819960418501a
patword 0x00ab 0x030819960418501a
patword 0x00ac 0x030819960008501a
patword 0x00ad 0x030819960008501a
patword 0x00ae 0x030819960008501a
patword 0x00af 0x030819960008501a
patword 0x00b0 0x030819960008501a
patword 0x00b1 0x030819960008501a
patword 0x00b2 0x030819960008501a
patword 0x00b3 0x030819960008501a
patword 0x00b4 0x030819960008501a
patword 0x00b5 0x030819960008501a
patword 0x00b6 0x030819960008501a
patword 0x00b7 0x030819960008501a
patword 0x00b8 0x030819960008501a
patword 0x00b9 0x030819960008501a
patword 0x00ba 0x030819960008501a
patword 0x00bb 0x030819960008501a
patword 0x00bc 0x030819960008501a
patword 0x00bd 0x030819960008501a
patword 0x00be 0x030819960008501a
patword 0x00bf 0x030819960008501a
patword 0x00c0 0x0308199f0008501a
patword 0x00c1 0x0308199f0008501a
patword 0x00c2 0x0308199f0008501a
patword 0x00c3 0x0308199f0008501a
patword 0x00c4 0x0308199f0008501a
patword 0x00c5 0x0308199f0008501a
patword 0x00c6 0x0308199f0008501a
patword 0x00c7 0x0308199f0008501a
patword 0x00c8 0x0308199f0008501a
patword 0x00c9 0x0308199f0008501a
patword 0x00ca 0x0308199f0008501a
patword 0x00cb 0x0308199f0008501a
patword 0x00cc 0x0308199f0008501a
patword 0x00cd 0x0308199f0008501a
patword 0x00ce 0x0308199f0008501a
patword 0x00cf 0x0308199f0008501a
patword 0x00d0 0x0308199f0008501a
patword 0x00d1 0x0308199f0008501a
patword 0x00d2 0x0308199f0008501a
patword 0x00d3 0x0308199f0008501a
patword 0x00d4 0x0308599f0008503a
patword 0x00d5 0x0308599f0008503a
patword 0x00d6 0x030c599f000850ba
patword 0x00d7 0x030c599f000850ba
patword 0x00d8 0x030c599f000850ba
patword 0x00d9 0x030c599f000850ba
patword 0x00da 0x030c599f000850ba
patword 0x00db 0x030c599f000850ba
patword 0x00dc 0x030c599f000850ba
patword 0x00dd 0x030c599f000850ba
patword 0x00de 0x030c599f000850ba
patword 0x00df 0x030c599f000850ba
patword 0x00e0 0x030c599f000850ba
patword 0x00e1 0x030c599f000850ba
patword 0x00e2 0x030c599f000850ba
patword 0x00e3 0x030c599f000850ba
patword 0x00e4 0x030c599f000850ba
patword 0x00e5 0x030c599f000850ba
patword 0x00e6 0x030c599f000850ba
patword 0x00e7 0x030c599f000850ba
patword 0x00e8 0x030c599f000850ba
patword 0x00e9 0x030c599f000850ba
patword 0x00ea 0x030c799f010858ba
patword 0x00eb 0x030c799f010858ba
patword 0x00ec 0x030c599f000850ba
patword 0x00ed 0x030c599f000850ba
patword 0x00ee 0x030c599f000850ba
patword 0x00ef 0x030c599f000850ba
patword 0x00f0 0x030c599f000850ba
patword 0x00f1 0x030c599f000850ba
patword 0x00f2 0x030c599f000850ba
patword 0x00f3 0x030c599f000850ba
patword 0x00f4 0x030c599f000850ba
patword 0x00f5 0x030c599f000850ba
patword 0x00f6 0x030c599f000850ba
patword 0x00f7 0x030c599f000850ba
patword 0x00f8 0x030c599f000850ba
patword 0x00f9 0x030c599f000850ba
patword 0x00fa 0x030c599f000850ba
patword 0x00fb 0x030c599f000850ba
patword 0x00fc 0x030c599f000850ba
patword 0x00fd 0x030c599f000850ba
patword 0x00fe 0x030c599f000850ba
patword 0x00ff 0x030c599f000850ba
patword 0x0100 0x030c599f000850ba
patword 0x0101 0x030c599f000850ba
patword 0x0102 0x030c599f400850ba
patword 0x0103 0x030c599f400850ba
patword 0x0104 0x030c599f600850ba
patword 0x0105 0x030c599f400850ba
patword 0x0106 0x030c599f400850ba
patword 0x0107 0x030c599f400850ba
patword 0x0108 0x870c599f682e50ba
patword 0x0109 0x870c599f482850ba
patword 0x010a 0x870c599f000e50ba
patword 0x010b 0x870c599f000850ba
patword 0x010c 0x870c599f000e50ba
patword 0x010d 0x870c599f000850ba
patword 0x010e 0x870c599f000e50ba
patword 0x010f 0x870c599f000850ba
patword 0x0110 0x870c599f000e50ba
patword 0x0111 0x870c599f000850ba
patword 0x0112 0x870c599f000e50ba
patword 0x0113 0x870c599f000850ba
patword 0x0114 0x870c599f000e50ba
patword 0x0115 0x870c599f000850ba
patword 0x0116 0x870c599f000e50ba
patword 0x0117 0x870c599f000850ba
patword 0x0118 0x870c599f000e50ba
patword 0x0119 0x870c599f000850ba
patword 0x011a 0x870c599f000e50ba
patword 0x011b 0x870c599f000850ba
patword 0x011c 0x870c599f000e50ba
patword 0x011d 0x870c599f000850ba
patword 0x011e 0x870c599f000e50ba
patword 0x011f 0x870c599f000850ba
patword 0x0120 0x870c599f000e50ba
patword 0x0121 0x870c599f000850ba
patword 0x0122 0x870c599f200e50ba
patword 0x0123 0x870c599f000850ba
patword 0x0124 0x870c599f000e50ba
patword 0x0125 0x870c599f000850ba
patword 0x0126 0x870c599f000e50ba
patword 0x0127 0x870c599f000850ba
patword 0x0128 0x870c599f000e50ba
patword 0x0129 0x870c599f000850ba
patword 0x012a 0x870c599f000e50ba
patword 0x012b 0x870c599f000850ba
patword 0x012c 0x870c599f000e50ba
patword 0x012d 0x870c599f000850ba
patword 0x012e 0x870c599f000e50ba
patword 0x012f 0x870c599f000850ba
patword 0x0130 0x870c599f000e50ba
patword 0x0131 0x870c599f000850ba
patword 0x0132 0x870c599f000e50ba
patword 0x0133 0x870c599f000850ba
patword 0x0134 0x870c599f000e50ba
patword 0x0135 0x870c599f000850ba
patword 0x0136 0x870c599f000e50ba
patword 0x0137 0x870c599f000850ba
patword 0x0138 0x870c599f000e50ba
patword 0x0139 0x870c599f000850ba
patword 0x013a 0x870c599f282e50ba
patword 0x013b 0x870c599f082850ba
patword 0x013c 0x870c599f000e50ba
patword 0x013d 0x870c599f000850ba
patword 0x013e 0x870c599f000e50ba
patword 0x013f 0x870c599f000850ba
patword 0x0140 0x870c599f000e50ba
patword 0x0141 0x870c599f000850ba
patword 0x0142 0x870c599f000e50ba
patword 0x0143 0x870c599f000850ba
patword 0x0144 0x870c599f000e50ba
patword 0x0145 0x870c599f000850ba
patword 0x0146 0x870c599f000e50ba
patword 0x0147 0x870c599f000850ba
patword 0x0148 0x870c599f000e50ba
patword 0x0149 0x870c599f000850ba
patword 0x014a 0x870c599f000e50ba
patword 0x014b 0x870c599f000850ba
patword 0x014c 0x870c599f000e50ba
patword 0x014d 0x870c599f000850ba
patword 0x014e 0x870c599f000e50ba
patword 0x014f 0x870c599f000850ba
patword 0x0150 0x870c599f000e50ba
patword 0x0151 0x870c599f000850ba
patword 0x0152 0x870c599f000e50ba
patword 0x0153 0x870c599f000850ba
patword 0x0154 0x870c599f200e50ba
patword 0x0155 0x870c599f000850ba
patword 0x0156 0x870c599f000e50ba
patword 0x0157 0x870c599f000850ba
patword 0x0158 0x870c599f000e50ba
patword 0x0159 0x870c599f000850ba
patword 0x015a 0x870c599f000e50ba
patword 0x015b 0x870c599f000850ba
patword 0x015c 0x870c599f000e50ba
patword 0x015d 0x870c599f000850ba
patword 0x015e 0x870c599f000e50ba
patword 0x015f 0x870c599f000850ba
patword 0x0160 0x870c599f000e50ba
patword 0x0161 0x870c599f000850ba
patword 0x0162 0x870c599f000e50ba
patword 0x0163 0x870c599f000850ba
patword 0x0164 0x870c599f000e50ba
patword 0x0165 0x870c599f000850ba
patword 0x0166 0x870c599f000e50ba
patword 0x0167 0x870c599f000850ba
patword 0x0168 0x870c599f000e50ba
patword 0x0169 0x870c599f000850ba
patword 0x016a 0x870c599f000e50ba
patword 0x016b 0x870c599f000850ba
patword 0x016c 0x070c599f000850ba
patword 0x016d 0x070c599f000850ba
patword 0x016e 0x000c599f000850ba
patword 0x016f 0x000c599f000850ba
patword 0x0170 0x0008599f200e503a
patword 0x0171 0x0008599f0008503a
patword 0x0172 0x0008599f200e503a
patword 0x0173 0x0008599f0008503a
patword 0x0174 0x0008599f0008503a
patword 0x0175 0x0008599f0008503a
patword 0x0176 0x0008599f0008503a
patword 0x0177 0x0008599f0008503a
patword 0x0178 0x0008599f0008503a
patword 0x0179 0x0008599f0008503a
patword 0x017a 0x0008599f0008503a
patword 0x017b 0x0008599f0008503a
patword 0x017c 0x0008599f0008503a
patword 0x017d 0x0008599f0008503a
patword 0x017e 0x0008599f0008503a
patword 0x017f 0x0008599f0008503a
patword 0x0180 0x0008599f0008503a
patword 0x0181 0x0008599f0008503a
patword 0x0182 0x0008599f0008503a
patword 0x0183 0x0008599f0008503a
patword 0x0184 0x0008599f0008503a
patword 0x0185 0x0008599f0008503a
patword 0x0186 0x0008599f0008503a
patword 0x0187 0x0008599f0008503a
patword 0x0188 0x0008599f0008503a
patword 0x0189 0x0008599f0008503a
patword 0x018a 0x0008599f0008503a
patword 0x018b 0x0008599f0008503a
patword 0x018c 0x0008599f0008503a
patword 0x018d 0x0008599f0008503a
patioctrl 0x8f0effff6dbffdbf
patlimits 0x0000 0x018c
patloop0 0x013a 0x016b
patnloop0 0x199
patloop1 0x0400 0x0400
patnloop1 0
patloop2 0x0400 0x0400
patnloop2 0
patwait0 0x00aa
patwaittime0 10000
patwait1 0x0400
patwaittime1 0
patwait2 0x0400
patwaittime2 0
pattern /tmp/pattern.pat
# dacs
dac 6 800

View File

@ -1,13 +1,13 @@
# detector hostname
hostname localhost:1900
# receiver hostname
rx_hostname mpc1922:2000
# udp destination ports
udp_dstport 50000
udp_dstport2 50001
# receiver hostname
rx_hostname mpc1922:2000
# udp destination ip from rx_hostname
udp_dstip auto

View File

@ -1,15 +1,13 @@
# detector hostname
hostname localhost:1900+localhost:1902+
# udp destination ports
udp_dstport 50000
udp_dstport2 50001
# receiver hostname
rx_hostname mpc1922:2000+mpc1922:2001+
# udp destination ports
0:udp_dstport 50000
0:udp_dstport2 50001
1:udp_dstport 50002
1:udp_dstport2 50003
# udp destination ip from rx_hostname
udp_dstip auto

View File

@ -1,18 +1,18 @@
# detector hostname
hostname localhost:1904
# receiver hostname
rx_hostname mpc1922:2004
# udp destination ports
udp_dstport 50004
# udp destination ip from rx_hostname
udp_dstip auto
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
# receiver hostname
rx_hostname mpc1922:2004
# udp destination ip from rx_hostname
udp_dstip auto
# output file directory
fpath /tmp

View File

@ -1,24 +1,12 @@
# detector hostname
hostname localhost:1914
# receiver hostname
rx_hostname mpc1922:2014
# udp destination ports
udp_dstport 50014
# udp destination ip from rx_hostname
udp_dstip auto
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
# output file directory
fpath /tmp
# disable file writing
fwrite 0
# enable 2nd interface for veto debugging
# udp destination port for veto
udp_dstport2 50015
@ -27,6 +15,18 @@ udp_dstip2 auto
# udp source ip (same subnet as udp_dstip)
udp_srcip2 192.168.1.100
# receiver hostname
rx_hostname mpc1922:2014
# udp destination ip from rx_hostname
udp_dstip auto
# output file directory
fpath /tmp
# disable file writing
fwrite 0
# to enable 2nd interface for veto debugging
numinterfaces 2

View File

@ -1,21 +1,21 @@
# detector hostname
hostname localhost:1906
# receiver hostname
rx_hostname mpc1922:2006
# udp destination ports
udp_dstport 50006
udp_dstport2 50007
# udp destination ip from rx_hostname
udp_dstip auto
udp_dstip2 auto
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
udp_srcip2 192.168.1.100
# receiver hostname
rx_hostname mpc1922:2006
# udp destination ip from rx_hostname
udp_dstip auto
udp_dstip2 auto
# output file directory
fpath /tmp

View File

@ -4,31 +4,33 @@ detsize 2048 1024
# detector hostname
virtual 4 1952
# receiver hostname and tcpports
0:rx_tcpport 1970
1:rx_tcpport 1971
2:rx_tcpport 1972
3:rx_tcpport 1973
rx_hostname mpc1922
# udp destination ports
0:udp_dstport2 50001
0:udp_dstport2 50002
1:udp_dstport 50003
1:udp_dstport2 50004
2:udp_dstport 50005
2:udp_dstport2 50006
3:udp_dstport 50007
3:udp_dstport2 50008
# udp destination ip from rx_hostname
udp_dstip auto
udp_dstip2 auto
udp_dstport 50001
#0:udp_dstport2 50001
#0:udp_dstport2 50002
#1:udp_dstport 50003
#1:udp_dstport2 50004
#2:udp_dstport 50005
#2:udp_dstport2 50006
#3:udp_dstport 50007
#3:udp_dstport2 50008
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
udp_srcip2 192.168.1.100
# receiver hostname and tcpports
rx_tcpport 1970
#0:rx_tcpport 1970
#1:rx_tcpport 1971
#2:rx_tcpport 1972
#3:rx_tcpport 1973
rx_hostname mpc1922
# udp destination ip from rx_hostname
udp_dstip auto
udp_dstip2 auto
# transmission delay frame
0:txndelay_frame 0
1:txndelay_frame 1

View File

@ -1,18 +1,18 @@
# detector hostname
hostname localhost:1908
# receiver hostname
rx_hostname mpc1922:2008
# udp destination ports
udp_dstport 50008
# udp destination ip from rx_hostname
udp_dstip auto
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
# receiver hostname
rx_hostname mpc1922:2008
# udp destination ip from rx_hostname
udp_dstip auto
# output file directory
fpath /tmp

View File

@ -1,18 +1,18 @@
# detector hostname
hostname localhost:1912
# receiver hostname
rx_hostname mpc1922:2012
# udp destination ports
udp_dstport 50012
# udp destination ip from rx_hostname
udp_dstip auto
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
# receiver hostname
rx_hostname mpc1922:2012
# udp destination ip from rx_hostname
udp_dstip auto
# output file directory
fpath /tmp

View File

@ -1,27 +0,0 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
#####! /bin/awk -f
if [ $# -lt 3 ]
then
echo "wrong usage"
exit -1
fi
fin=$1
ftmp=$2
fout=$3
#dat=echo "date '+%Y%m%d'"
echo "Updating $fout"
#echo "in: $fin tmp: $ftmp out: $fout"
#awk 'NR==FNR {if ($3=="Date:") {l[FNR]=$4; gsub("-","",l[FNR]);} else { if (match($0,"Rev")) {l[FNR]=$(NF);} else {l[FNR]="\""$(NF)"\"";};};next} {$0=$1" "$2" "l[FNR]}1' $fin $ftmp > $fout
awk 'BEGIN {l[0]=0; "date +%Y%m%d" | getline l[1]; l[2]="\"/\""; l[3]="\"nobody\""; l[3]="\"nobody\""; l[4]="\"0000-0000-0000\"";} \
NR==FNR {if (match($0,"Rev")) {l[0]="0x"$(NF);} else if (match($0,"Date")) {l[1]="0x"$4; gsub("-","",l[1]);} else if (match($0,"URL")) {l[2]="\""$(NF)"\"";} else if (match($0,"Author")) {l[3]="\""$(NF)"\"";} else if (match($0,"UUID")) {l[4]="\""$(NF)"\"";} else if (match($0,"Branch")) {l[5]="\""$(NF)"\"";};next;}
{if (match($2,"REV")) {$0=$1" "$2" "l[0];} else if (match($2,"DATE")) {$0=$1" "$2" "l[1];} else if (match($2,"URL")) {$0=$1" "$2" "l[2];} else if (match($2,"AUTH")) {$0=$1" "$2" "l[3];} else if (match($2,"UUID")) {$0=$1" "$2" "l[4];} else if (match($2,"BRANCH")) {$0=$1" "$2" "l[5];}}1' $fin $ftmp > $fout

View File

@ -6,6 +6,8 @@
#include "tests/globals.h"
#include <iostream>
namespace sls {
class MultiDetectorFixture {
protected:
DetectorImpl d;
@ -136,7 +138,7 @@ TEST_CASE_METHOD(MultiDetectorFixture, "Get ID", "[.eigerintegration][cli]") {
std::string hn = test::hostname;
hn.erase(std::remove(begin(hn), end(hn), 'b'), end(hn));
hn.erase(std::remove(begin(hn), end(hn), 'e'), end(hn));
auto hostnames = sls::split(hn, '+');
auto hostnames = split(hn, '+');
CHECK(hostnames.size() == d.getNumberOfDetectors());
for (int i = 0; i != d.getNumberOfDetectors(); ++i) {
CHECK(d.getId(defs::DETECTOR_SERIAL_NUMBER, 0) ==
@ -198,3 +200,5 @@ TEST_CASE_METHOD(MultiDetectorFixture, "rate correction",
d.setRateCorrection(200);
CHECK(d.getRateCorrection() == 200);
}
} // namespace sls

View File

@ -24,6 +24,8 @@
// extern std::string detector_type;
// extern dt type;
namespace sls {
TEST_CASE("Single detector no receiver", "[.integration][.single]") {
auto t = Module::getTypeFromDetector(test::hostname);
CHECK(t == test::type);
@ -48,8 +50,8 @@ TEST_CASE("Set control port then create a new object with this control port",
Is this the best way to initialize the detectors
Using braces to make the object go out of scope
*/
int old_cport = DEFAULT_PORTNO;
int old_sport = DEFAULT_PORTNO + 1;
int old_cport = DEFAULT_TCP_CNTRL_PORTNO;
int old_sport = DEFAULT_TCP_STOP_PORTNO;
int new_cport = 1993;
int new_sport = 2000;
{
@ -77,7 +79,7 @@ TEST_CASE("Set control port then create a new object with this control port",
Module d(test::type);
d.setHostname(test::hostname);
CHECK(d.getStopPort() == DEFAULT_PORTNO + 1);
CHECK(d.getStopPort() == DEFAULT_TCP_STOP_PORTNO);
d.freeSharedMemory();
}
@ -283,14 +285,14 @@ TEST_CASE(
CHECK(m.getRateCorrection() == ratecorr);
// ratecorr fail with dr 4 or 8
CHECK_THROWS_AS(m.setDynamicRange(8), sls::RuntimeError);
CHECK_THROWS_AS(m.setDynamicRange(8), RuntimeError);
CHECK(m.getRateCorrection() == 0);
m.setDynamicRange(16);
m.setDynamicRange(16);
m.setRateCorrection(ratecorr);
m.setDynamicRange(16);
m.setRateCorrection(ratecorr);
CHECK_THROWS_AS(m.setDynamicRange(4), sls::RuntimeError);
CHECK_THROWS_AS(m.setDynamicRange(4), RuntimeError);
CHECK(m.getRateCorrection() == 0);
}
@ -329,11 +331,11 @@ TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
m.setPatternWord(addr, word);
CHECK(m.setPatternWord(addr, -1) == word);
addr = MAX_ADDR;
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::RuntimeError);
CHECK_THROWS_AS(m.setPatternWord(addr, word), RuntimeError);
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
Catch::Matchers::Contains("be between 0 and"));
addr = -1;
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::RuntimeError);
CHECK_THROWS_AS(m.setPatternWord(addr, word), RuntimeError);
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
Catch::Matchers::Contains("be between 0 and"));
@ -408,7 +410,7 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
CHECK(m.getReceiverDbitList().size() == 10);
list.push_back(64);
CHECK_THROWS_AS(m.setReceiverDbitList(list), sls::RuntimeError);
CHECK_THROWS_AS(m.setReceiverDbitList(list), RuntimeError);
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
Catch::Matchers::Contains("be between 0 and 63"));
@ -476,7 +478,7 @@ TEST_CASE("Eiger or Jungfrau nextframenumber",
CHECK(m.acquire() == slsDetectorDefs::OK);
CHECK(m.getReceiverCurrentFrameIndex() == val);
CHECK_THROWS_AS(m.setNextFrameNumber(0), sls::RuntimeError);
CHECK_THROWS_AS(m.setNextFrameNumber(0), RuntimeError);
if (m.getDetectorTypeAsString() == "Eiger") {
val = 281474976710655;
@ -511,8 +513,10 @@ TEST_CASE("Eiger partialread", "[.eigerintegration][partialread]") {
m.setDynamicRange(8);
m.setPartialReadout(256);
CHECK(m.getPartialReadout() == 256);
CHECK_THROWS_AS(m.setPartialReadout(1), sls::RuntimeError);
CHECK_THROWS_AS(m.setPartialReadout(1), RuntimeError);
CHECK(m.getPartialReadout() == 256);
CHECK_THROWS_AS(m.setPartialReadout(0), sls::RuntimeError);
CHECK_THROWS_AS(m.setPartialReadout(0), RuntimeError);
m.setPartialReadout(256);
}
}
} // namespace sls

View File

@ -6,10 +6,12 @@
#include "tests/globals.h"
#include <iostream>
namespace sls {
using namespace Catch::literals;
TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
auto hostnames = sls::split(test::hostname, '+');
auto hostnames = split(test::hostname, '+');
DetectorImpl d(0, true, true);
d.setHostname(test::hostname.c_str());
@ -102,3 +104,5 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
d.freeSharedMemory();
}
} // namespace sls

Binary file not shown.

Submodule libs/pybind11 deleted from 8de7772cc7

Binary file not shown.

57
libs/qwt/CMakeLists.txt Normal file
View File

@ -0,0 +1,57 @@
#inspired by: https://github.com/ericriff/qwt/blob/master/CMakeLists.txt
# Build a static version of qwt from tar file
cmake_minimum_required(VERSION 3.12)
project(qwt)
set(PROJECT_VERSION 6.1.5)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
# Extract qwt sources from the supplied source file
set(INTERNALQWTDIR "qwt-source/")
set(QWTBASE ${CMAKE_CURRENT_BINARY_DIR}/${INTERNALQWTDIR})
file(MAKE_DIRECTORY ${QWTBASE})
execute_process(
COMMAND tar -xf ${CMAKE_CURRENT_SOURCE_DIR}/qwt-6.1.5.tar.bz2 -C ${QWTBASE} --strip-components=1
RESULT_VARIABLE ret
)
if(ret AND NOT ret EQUAL 0)
message( FATAL_ERROR "Could not unpack qwt")
endif()
# Without this define moc files are not included and linking of examples fails.
add_definitions(-DQWT_MOC_INCLUDE)
find_package(Qt5 REQUIRED
COMPONENTS
Core
Gui
Widgets
OpenGL
Concurrent
PrintSupport
Svg
)
file(GLOB QWT_SOURCES ${QWTBASE}src/*.cpp)
file(GLOB QWT_HEADERS ${QWTBASE}src/*.h)
add_library(qwt STATIC ${QWT_SOURCES} ${QWT_HEADERS} )
target_include_directories(qwt PUBLIC
$<BUILD_INTERFACE:${QWTBASE}/src>
)
target_link_libraries(qwt PUBLIC
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::OpenGL
Qt5::Concurrent
Qt5::PrintSupport
Qt5::Svg
)
# Disable all warnings in QWT since we dont want to patch the library
target_compile_options(qwt PRIVATE -w)

BIN
libs/qwt/qwt-6.1.5.tar.bz2 Normal file

Binary file not shown.

View File

@ -1,27 +0,0 @@
#From: https://github.com/zeromq/cppzmq/
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
find_package(PkgConfig)
pkg_check_modules(PC_LIBZMQ QUIET libzmq)
set(ZeroMQ_VERSION ${PC_LIBZMQ_VERSION})
find_library(ZeroMQ_LIBRARY NAMES libzmq.so libzmq.dylib libzmq.dll
PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS})
find_library(ZeroMQ_STATIC_LIBRARY NAMES libzmq-static.a libzmq.a libzmq.dll.a
PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS})
if(ZeroMQ_LIBRARY OR ZeroMQ_STATIC_LIBRARY)
set(ZeroMQ_FOUND ON)
endif()
if (TARGET libzmq)
# avoid errors defining targets twice
return()
endif()
add_library(libzmq SHARED IMPORTED)
set_property(TARGET libzmq PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PC_LIBZMQ_INCLUDE_DIRS})
set_property(TARGET libzmq PROPERTY IMPORTED_LOCATION ${ZeroMQ_LIBRARY})
add_library(libzmq-static STATIC IMPORTED ${PC_LIBZMQ_INCLUDE_DIRS})
set_property(TARGET libzmq-static PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PC_LIBZMQ_INCLUDE_DIRS})
set_property(TARGET libzmq-static PROPERTY IMPORTED_LOCATION ${ZeroMQ_STATIC_LIBRARY})

View File

@ -0,0 +1,110 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include <errno.h>
#include <fcntl.h>
#include <math.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
int iarg;
char fname[10000];
uint64_t word;
int val[64];
int bit[64];
FILE *fdin;
int nb = 2;
int off = 0;
int ioff = 0;
int dr = 24;
int idr = 0;
int ib = 0;
int iw = 0;
bit[0] = 19;
bit[1] = 8;
// for (iarg=0; iarg<argc; iarg++) printf("%d %s\n",iarg, argv[iarg]);
if (argc < 2)
printf("Error: usage is %s fname [dr off b0 b1 bn]\n");
if (argc > 2)
dr = atoi(argv[2]);
if (argc > 3)
off = atoi(argv[3]);
if (argc > 4) {
for (ib = 0; ib < 64; ib++) {
if (argc > 4 + ib) {
bit[ib] = atoi(argv[4 + ib]);
nb++;
}
}
}
idr = 0;
for (ib = 0; ib < nb; ib++) {
val[ib] = 0;
}
fdin = fopen(argv[1], "rb");
if (fdin == NULL) {
printf("Cannot open input file %s for reading\n", argv[1]);
return 200;
}
while (fread((void *)&word, 8, 1, fdin)) {
// printf("%llx\n",word);
if (ioff < off)
ioff++;
else {
for (ib = 0; ib < nb; ib++) {
if (word & (1 << bit[ib]))
val[ib] |= (1 << idr);
}
idr++;
if (idr == dr) {
idr = 0;
fprintf(stdout, "%d\t", iw++);
for (ib = 0; ib < nb; ib++) {
#ifdef HEX
fprintf(stdout, "%08llx\t", val[ib]);
#else
fprintf(stdout, "%lld\t", val[ib]);
#endif
val[ib] = 0;
}
fprintf(stdout, "\n");
}
}
}
if (idr != 0) {
fprintf(stdout, "%d\t", iw++);
for (ib = 0; ib < nb; ib++) {
#ifdef HEX
fprintf(stdout, "%08llx\t", val[ib]);
#else
fprintf(stdout, "%lld\t", val[ib]);
#endif
val[ib] = 0;
}
fprintf(stdout, "\n");
}
fclose(fdin);
return 0;
}

View File

@ -0,0 +1,4 @@
BIT0 output0 1
BIT1 output1 1
BIT2 output2 1
BIT3 output3 1

View File

@ -0,0 +1,97 @@
//define signals and directions (Input, outputs, clocks)
#define output0 0
setoutput(output0);
#define output1 1
setoutput(output1);
#define output2 2
setoutput(output2);
#define output3 3
setoutput(output3);
#define input0 4
setinput(input0);
#define input1 5
setinput(input1);
#define input2 6
setinput(input2);
#define input3 7
setinput(input3);
#define PW pw()
#define SB(x) setbit(x)
#define CB(x) clearbit(x)
#define CLOCK clearbit(CLKBIT); pw();setbit(CLKBIT);pw()
#define LCLOCK clearbit(CLKBIT); pw();setbit(CLKBIT);pw();clearbit(CLKBIT); pw()
#define CLOCKS(x) for (i=0;i<x;i++) {clearbit(CLKBIT);pw(); setbit(CLKBIT); pw();}
#define STOP setstop();
#define START setstart();
#define REPEAT(x) for (i=0;i<(x);i++) {pw();}
#define DOFOR(x) for (j=0;j<(x);j++) {
// }
#define INST0 CB(output3);CB(output2);CB(output1);CB(output0);PW;
#define INST1 CB(output3);CB(output2);CB(output1);SB(output0);PW;
#define INST2 CB(output3);CB(output2);SB(output1);CB(output0);PW;
#define INST3 CB(output3);CB(output2);SB(output1);SB(output0);PW;
#define INST4 CB(output3);SB(output2);CB(output1);CB(output0);PW;
#define INST5 CB(output3);SB(output2);CB(output1);SB(output0);PW;
#define INST6 CB(output3);SB(output2);SB(output1);CB(output0);PW;
#define INST7 CB(output3);SB(output2);SB(output1);SB(output0);PW;
#define INST8 SB(output3);CB(output2);CB(output1);CB(output0);PW;
#define INST9 SB(output3);CB(output2);CB(output1);SB(output0);PW;
#define INST10 SB(output3);CB(output2);SB(output1);CB(output0);PW;
#define INST11 SB(output3);CB(output2);SB(output1);SB(output0);PW;
#define INST12 SB(output3);SB(output2);CB(output1);CB(output0);PW;
START;
INST0;
setwaitpoint(0);
setwaittime(0,5);
INST1;
setstartloop(5);
setnloop(5,2);
INST2;
setstartloop(0);
setnloop(0,2);
INST3;
INST4;
setstoploop(0);
setstoploop(5);
INST5;
INST6;
setwaitpoint(4);
setwaittime(1,0);
INST7;
INST8;
setstartloop(2);
setnloop(2,0);
INST9;
INST10;
setstoploop(2);
INST11;
STOP;
INST12;

View File

@ -0,0 +1,25 @@
patword 0x0000 0x0000000000000000
patword 0x0001 0x0000000000000001
patword 0x0002 0x0000000000000002
patword 0x0003 0x0000000000000003
patword 0x0004 0x0000000000000004
patword 0x0005 0x0000000000000005
patword 0x0006 0x0000000000000006
patword 0x0007 0x0000000000000007
patword 0x0008 0x0000000000000008
patword 0x0009 0x0000000000000009
patword 0x000a 0x000000000000000a
patword 0x000b 0x000000000000000b
patword 0x000c 0x000000000000000c
patlimits 0x0000 0x000c
patioctrl 0x000000000000000f
patloop 0 0x0003 0x0005
patnloop 0 2
patloop 2 0x0009 0x000b
patnloop 2 0
patloop 5 0x0002 0x0005
patnloop 5 2
patwait 0 0x0001
patwaittime 0 5
patwait 4 0x0007
patwaittime 4 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 KiB

View File

@ -0,0 +1,183 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
/****************************************************************************
usage to generate a patter test.pat from test.p
gcc -DINFILE="\"test.p\"" -DOUTFILE="\"test.pat\"" -o test.exe generator.c ;
./test.exe ; rm test.exe
*************************************************************************/
#include <errno.h>
#include <fcntl.h>
#include <math.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <unistd.h>
#define MAXLOOPS 6
#define MAXTIMERS 6
#define MAXWORDS 8191
uint64_t pat = 0;
uint64_t iopat = 0;
uint64_t clkpat = 0;
unsigned iaddr = 0;
unsigned waitaddr[MAXTIMERS] = {MAXWORDS, MAXWORDS, MAXWORDS,
MAXWORDS, MAXWORDS, MAXWORDS};
unsigned startloopaddr[MAXLOOPS] = {MAXWORDS, MAXWORDS, MAXWORDS,
MAXWORDS, MAXWORDS, MAXWORDS};
unsigned stoploopaddr[MAXLOOPS] = {MAXWORDS, MAXWORDS, MAXWORDS,
MAXWORDS, MAXWORDS, MAXWORDS};
unsigned start = 0, stop = 0;
uint64_t waittime[MAXTIMERS] = {0, 0, 0, 0, 0, 0};
unsigned nloop[MAXLOOPS] = {0, 0, 0, 0, 0, 0};
char infile[10000], outfile[10000];
FILE *fd, *fd1;
uint64_t PAT[MAXWORDS];
int iopat_enable = 0;
int i, ii, iii, j, jj, jjj, pixx, pixy, memx, memy, muxout, memclk, colclk,
rowclk, muxclk, memcol, memrow, loopcounter;
void setstart() { start = iaddr; }
void setstop() { stop = iaddr; }
void setinput(int bit) {
uint64_t mask = 1;
mask = mask << bit;
iopat &= ~mask;
iopat_enable = 1;
}
void setoutput(int bit) {
uint64_t mask = 1;
mask = mask << bit;
iopat |= mask;
iopat_enable = 1;
}
void clearbit(int bit) {
uint64_t mask = 1;
mask = mask << bit;
pat &= ~mask;
}
void setbit(int bit) {
uint64_t mask = 1;
mask = mask << bit;
pat |= mask;
}
int checkbit(int bit) {
uint64_t mask = 1;
mask = mask << bit;
return (pat & mask) >> bit;
}
void setstartloop(int iloop) {
if (iloop >= 0 && iloop < MAXLOOPS) {
startloopaddr[iloop] = iaddr;
}
}
void setstoploop(int iloop) {
if (iloop >= 0 && iloop < MAXLOOPS) {
stoploopaddr[iloop] = iaddr;
}
}
void setnloop(int iloop, int n) {
if (iloop >= 0 && iloop < MAXLOOPS) {
nloop[iloop] = n;
}
}
void setwaitpoint(int iloop) {
if (iloop >= 0 && iloop < MAXTIMERS) {
waitaddr[iloop] = iaddr;
}
}
void setwaittime(int iloop, uint64_t t) {
if (iloop >= 0 && iloop < MAXTIMERS) {
waittime[iloop] = t;
}
}
void pw() {
if (iaddr < MAXWORDS) {
PAT[iaddr] = pat;
}
fprintf(fd, "patword 0x%04x 0x%016llx\n", iaddr, pat);
iaddr++;
if (iaddr >= MAXWORDS) {
printf("ERROR: too many word in the pattern (%d instead of %d)!", iaddr,
MAXWORDS);
}
}
int parseCommand(int clk, int cmdbit, int cmd, int length) {
int ibit;
clearbit(clk);
for (ibit = 0; ibit < length; ibit++) {
if (cmd & (1 >> ibit)) {
setbit(cmdbit);
} else {
clearbit(cmdbit);
}
pw();
/******/
setbit(clk);
pw();
/******/
}
};
int main() {
int iloop = 0;
fd = fopen(OUTFILE, "w");
#include INFILE
fprintf(fd, "patlimits 0x%04x 0x%04x\n", start, stop);
if (iopat_enable == 1) {
fprintf(fd, "patioctrl 0x%016llx\n", iopat);
}
for (iloop = 0; iloop < MAXLOOPS; iloop++) {
if ((startloopaddr[iloop] != MAXWORDS) &&
(stoploopaddr[iloop] != MAXWORDS)) {
fprintf(fd, "patloop %d 0x%04x 0x%04x\n", iloop,
startloopaddr[iloop], stoploopaddr[iloop]);
if (stoploopaddr[iloop] <= startloopaddr[iloop]) {
nloop[iloop] = 0;
}
fprintf(fd, "patnloop %d %u\n", iloop, nloop[iloop]);
}
}
for (iloop = 0; iloop < MAXTIMERS; iloop++) {
if (waitaddr[iloop] != MAXWORDS) {
fprintf(fd, "patwait %d 0x%04x\n", iloop, waitaddr[iloop]);
fprintf(fd, "patwaittime %d %llu\n", iloop, waittime[iloop]);
}
}
fclose(fd);
fd1 = fopen(OUTFILEBIN, "w");
fwrite(PAT, sizeof(uint64_t), iaddr, fd1);
fclose(fd1);
return 0;
}

610
patternGenerator/plotPattern.py Executable file
View File

@ -0,0 +1,610 @@
#!/usr/bin/env python3
"""
Created on Wed May 24 09:44:53 2017
Plot the pattern for New Chip Test Box (.pat)
Changes:
- 2017-11-21 Adapt it to python-3
- 2017-09-25 All can be plotted
- 2017-09-22 Can be plotted but the loop and wait not work yet
@author: zhang_j1
"""
import matplotlib.pyplot as plt
from numpy import *
from matplotlib.pyplot import *
from matplotlib.patches import Rectangle
import os
import argparse
###############################################################################
# COLORS AND LINE STYLES
# alternating colors of the plots (2 needed)
colors_plot = ['tab:blue', 'tab:orange']
# Wait colors and line styles (6 needed from 0 to 5)
colors_wait = ['b', 'g', 'r', 'c', 'm', 'y']
linestyles_wait = ['--', '--', '--', '--', '--', '--']
alpha_wait = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5]
alpha_wait_rect = [0.2, 0.2, 0.2, 0.2, 0.2, 0.2]
# Loop colors and line styles (6 needed from 0 to 5)
colors_loop = ['tab:green', 'tab:red', 'tab:purple', 'tab:brown', 'tab:pink', 'tab:grey']
linestyles_loop = ['-.', '-.', '-.', '-.', '-.', '-.']
alpha_loop = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5]
alpha_loop_rect = [0.2, 0.2, 0.2, 0.2, 0.2, 0.2]
# Display the count of clocks
clock_vertical_lines_spacing = 1
show_clocks_number = True
###############################################################################
# Define a hex to binary function
# global definition
# base = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F]
base = [str(x) for x in range(10)] + [chr(x) for x in range(ord('A'), ord('A')+6)]
# dec2bin
def dec2bin(string_num):
num = int(string_num)
mid = []
while True:
if num == 0:
break
num, rem = divmod(num, 2)
mid.append(base[rem])
return ''.join([str(x) for x in mid[::-1]])
# dec2binary: better than dec2bin
def dec2binary(dec_num, width=None):
return binary_repr(int(dec_num), width=width)
# hex2dec
def hex2dec(string_num):
return str(int(string_num.upper(), 16))
# hex2bin
def hex2bin(string_num):
return dec2bin(hex2dec(string_num.upper()))
# hex2bin
def hex2binary(string_num, width=None):
return dec2binary(hex2dec(string_num.upper()), width=width)
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--directory', required = True, help = "Working directory where the pattern is located")
parser.add_argument('-p', '--pattern', required = True, help = "Pattern name")
parser.add_argument('-a', '--alias', help = "Alias name")
parser.add_argument('-v', '--verbose', action='store_true')
args = parser.parse_args()
Folder = args.directory
File_pat = args.pattern
File_alias = args.alias
verbose = args.verbose
# Look at the alias file and generate the lookup table for pin names
# Create a 64 bit look up table
table = []
for i in range(64):
# for special bit
if i+1 == 59:
table.append([str(i+1), "external_trigger"])
elif i+1 == 63:
table.append([str(i+1), "adc_enable"])
elif i+1 == 62:
table.append([str(i+1), "dbit_enable"])
else:
table.append([str(i+1), ""])
# Loop all lines
try:
with open(Folder + "/" + File_alias + ".alias") as f:
lines = f.readlines()
f.close()
nlines = len(lines)
except:
nlines = 0
if nlines > 0:
for i in range(nlines):
# whether the line is bit definition
if lines[i][0:3] == "BIT":
# split words
words = lines[i].split()
bit_num = int(words[0][3:])
table[bit_num][0] = words[0][3:]
table[bit_num][1] = words[1]
else:
for i in range(64):
table[i][0] = i
table[i][1] = f'BIT#{i}'
if verbose:
print(table)
# Load the pattern and get all lines
# Loop all lines
if os.path.exists(Folder + "/" + File_pat + ".pat"):
with open(Folder + "/" + File_pat + ".pat") as f_pat:
lines_pat = f_pat.readlines()
elif os.path.exists(Folder + "/" + File_pat + ".pyat"):
with open(Folder + "/" + File_pat + ".pyat") as f_pat:
lines_pat = f_pat.readlines()
else:
print("No file found - Check it")
exit()
f_pat.close()
# number of lines for pattern file
nlines_pat = len(lines_pat)
# a counter
cnt = 0
if verbose:
print("The total number of lines of pattern:", nlines_pat)
# Loop all lines of pattern
waittime0 = None
waittime1 = None
waittime2 = None
waittime3 = None
waittime4 = None
waittime5 = None
nloop0 = None
nloop1 = None
nloop2 = None
nloop3 = None
nloop4 = None
nloop5 = None
for k in range(nlines_pat):
# content of line
words_line = lines_pat[k].split()
if words_line[0] == "patword":
# print words_line from b0 to b63
bits = hex2binary(words_line[-1], 64)[::-1]
if verbose:
print("The bits for line-", k+1, "is:", bits)
# convert string bits to decimal array
num_bits = array(list(map(str, bits)), dtype="uint16")
if cnt == 0:
mat_pat = num_bits
else:
# add bits to matrix
mat_pat = concatenate((mat_pat, num_bits), axis=0)
cnt = cnt + 1
# print("The matrix of pattern:", mat_pat.reshape(int(cnt), int(len(num_bits))))
# Look at the io: 0 for sending to ASIC, 1 for reading from ASIC
if words_line[0] == "patioctrl":
# print words_line
if verbose:
print(words_line[-1])
bits = hex2binary(words_line[-1], 64)[::-1]
if verbose:
print(bits)
# convert string bits to decimal array
out_bits = array(list(map(str, bits)), dtype="uint16")
if verbose:
print(words_line)
# Deal with waiting point
# ====== WAIT ======
if words_line[0] == "patwait" and words_line[1] == "0":
wait0 = int(hex2dec(words_line[2]))
if verbose:
print("wait 0 at:", wait0)
if words_line[0] == "patwaittime" and words_line[1] == "0":
waittime0 = int(words_line[2])
if verbose:
print("wait 0 for:", waittime0)
if words_line[0] == "patwait" and words_line[1] == "1":
wait1 = int(hex2dec(words_line[2]))
if verbose:
print("wait 1 at:", wait1)
if words_line[0] == "patwaittime" and words_line[1] == "1":
waittime1 = int(words_line[2])
if verbose:
print("wait 1 for:", waittime1)
if words_line[0] == "patwait" and words_line[1] == "2":
wait2 = int(hex2dec(words_line[2]))
if verbose:
print("wait 2 at:", wait2)
if words_line[0] == "patwaittime" and words_line[1] == "2":
waittime2 = int(words_line[2])
if verbose:
print("wait 2 for:", waittime2)
if words_line[0] == "patwait" and words_line[1] == "3":
wait3 = int(hex2dec(words_line[2]))
if verbose:
print("wait 0 at:", wait3)
if words_line[0] == "patwaittime" and words_line[1] == "3":
waittime3 = int(words_line[2])
if verbose:
print("wait 0 for:", waittime3)
if words_line[0] == "patwait" and words_line[1] == "4":
wait4 = int(hex2dec(words_line[2]))
if verbose:
print("wait 1 at:", wait4)
if words_line[0] == "patwaittime" and words_line[1] == "4":
waittime4 = int(words_line[2])
if verbose:
print("wait 1 for:", waittime4)
if words_line[0] == "patwait" and words_line[1] == "5":
wait5 = int(hex2dec(words_line[2]))
if verbose:
print("wait 2 at:", wait5)
if words_line[0] == "patwaittime" and words_line[1] == "5":
waittime5 = int(words_line[2])
if verbose:
print("wait 2 for:", waittime5)
# ====== LOOPS ======
if words_line[0] == "patloop" and words_line[1] == "0":
loop0_start = int(hex2dec(words_line[2]))
loop0_end = int(hex2dec(words_line[3]))
if verbose:
print("loop 0 start:", loop0_start, ", end:", loop0_end)
if words_line[0] == "patnloop" and words_line[1] == "0":
nloop0 = int(words_line[2])
if verbose:
print("loop 0 times:", nloop0)
if words_line[0] == "patloop" and words_line[1] == "1":
loop1_start = int(hex2dec(words_line[2]))
loop1_end = int(hex2dec(words_line[3]))
if verbose:
print("loop 1 start:", loop1_start, ", end:", loop1_end)
if words_line[0] == "patnloop" and words_line[1] == "1":
nloop1 = int(words_line[2])
if verbose:
print("loop 1 times:", nloop1)
if words_line[0] == "patloop" and words_line[1] == "2":
loop2_start = int(hex2dec(words_line[2]))
loop2_end = int(hex2dec(words_line[3]))
if verbose:
print("loop 2 start:", loop2_start, ", end:", loop2_end)
if words_line[0] == "patnloop" and words_line[1] == "2":
nloop2 = int(words_line[2])
if verbose:
print("loop 2 times:", nloop2)
if words_line[0] == "patloop" and words_line[1] == "3":
loop3_start = int(hex2dec(words_line[2]))
loop3_end = int(hex2dec(words_line[3]))
if verbose:
print("loop 3 start:", loop3_start, ", end:", loop3_end)
if words_line[0] == "patnloop" and words_line[1] == "3":
nloop3 = int(words_line[2])
if verbose:
print("loop 3 times:", nloop3)
if words_line[0] == "patloop" and words_line[1] == "4":
loop4_start = int(hex2dec(words_line[2]))
loop4_end = int(hex2dec(words_line[3]))
if verbose:
print("loop 4 start:", loop4_start, ", end:", loop4_end)
if words_line[0] == "patnloop" and words_line[1] == "4":
nloop4 = int(words_line[2])
if verbose:
print("loop 4 times:", nloop4)
if words_line[0] == "patloop" and words_line[1] == "5":
loop5_start = int(hex2dec(words_line[2]))
loop5_end = int(hex2dec(words_line[3]))
if verbose:
print("loop 5 start:", loop5_start, ", end:", loop5_end)
if words_line[0] == "patnloop" and words_line[1] == "5":
nloop5 = int(words_line[2])
if verbose:
print("loop 5 times:", nloop5)
# print(out_bits)
# internal counter
avail_index = []
avail_name = []
# Remove non-used bits
for i in range(64):
# if out_bits[0][i] == 1:
if out_bits[i] == 1:
avail_index.append(i)
avail_name.append(table[i][1])
if verbose:
print(avail_index)
print(avail_name)
# number of effective used bits
nbiteff = len(avail_name)
# subMat = mat_ext[:,index]
# print(mat_pat.shape)
subMat = mat_pat.reshape(int(cnt), int(len(num_bits)))[0:, avail_index]
# subMat = mat_pat[avail_index]
timing = linspace(0, subMat.shape[0]-1, subMat.shape[0])
rcParams['figure.figsize'] = 15, 5
# ============= PLOTTING =============
rcParams["font.weight"] = "bold"
rcParams["axes.labelweight"] = "bold"
fig2, axs2 = subplots(nbiteff, sharex='all')
subplots_adjust(wspace=0, hspace=0)
# axs2[nbiteff - 1].set(xlabel='Timing [clk]')
for idx, i in enumerate(range(nbiteff)):
axs2[idx].plot(subMat.T[i], "-", drawstyle="steps-post", linewidth=2.0, color=colors_plot[idx % 2])
x_additional = range(len(subMat.T[i]) - 1, len(subMat.T[i]) + 2)
additional_stuff = [subMat.T[i][-1]] * 3
axs2[idx].plot(x_additional, additional_stuff,
"--", drawstyle="steps-post", linewidth=2.0, color=colors_plot[idx % 2], alpha=0.5)
axs2[idx].yaxis.set_ticks([0.5], minor=False)
axs2[idx].xaxis.set_ticks(arange(0, len(subMat.T[i]) + 10, clock_vertical_lines_spacing))
axs2[idx].yaxis.set_ticklabels([avail_name[i]])
axs2[idx].get_yticklabels()[0].set_color(colors_plot[idx % 2])
axs2[idx].grid(1, 'both', 'both', alpha=0.5)
axs2[idx].yaxis.grid(which="both", color=colors_plot[idx % 2], alpha=0.2)
if idx != nbiteff - 1:
if not show_clocks_number:
axs2[idx].xaxis.set_ticklabels([])
axs2[idx].set(xlabel=' ', ylim=(-0.2, 1.2))
else:
axs2[idx].set(xlabel='Timing [clk]', ylim=(-0.2, 1.2))
# axs2[idx].set_xlim(left=0)
axs2[idx].set_xlim(left=0, right=len(subMat.T[i]) + 1)
axs2[idx].spines['top'].set_visible(False)
axs2[idx].spines['right'].set_alpha(0.2)
axs2[idx].spines['right'].set_visible(True)
axs2[idx].spines['bottom'].set_visible(False)
axs2[idx].spines['left'].set_visible(False)
# =====================================================================================================
# Plot the wait lines
# Wait 0
if waittime0 is not None:
if waittime0 == 0:
axs2[idx].plot([wait0, wait0], [-10, 10],
linestyle=linestyles_wait[0], color=colors_wait[0], alpha=alpha_wait[0], linewidth=2.0)
axs2[idx].plot([wait0 + 1, wait0 + 1], [-10, 10],
linestyle=linestyles_wait[0], color=colors_wait[0], linewidth=2.0, alpha=alpha_wait[0])
axs2[idx].add_patch(Rectangle((wait0, -10), 1, 20,
label="wait 0: skipped" if idx == 0 else "",
facecolor=colors_wait[0], alpha=alpha_wait_rect[0], hatch='\\\\'))
else:
axs2[idx].plot([wait0, wait0], [-10, 10],
linestyle=linestyles_wait[0], color=colors_wait[0],
label="wait 0: " + str(waittime0) + " clk" if idx == 0 else "",
linewidth=2.0, alpha=alpha_wait[0])
# Wait 1
if waittime1 is not None:
if waittime1 == 0:
axs2[idx].plot([wait1, wait1], [-10, 10],
linestyle=linestyles_wait[1], color=colors_wait[1], alpha=alpha_wait[1], linewidth=2.0)
axs2[idx].plot([wait1 + 1, wait1 + 1], [-10, 10],
linestyle=linestyles_wait[1], color=colors_wait[1], linewidth=2.0, alpha=alpha_wait[1])
axs2[idx].add_patch(Rectangle((wait1, -10), 1, 20,
label="wait 1: skipped" if idx == 0 else "",
facecolor=colors_wait[1], alpha=alpha_wait_rect[1], hatch='\\\\'))
else:
axs2[idx].plot([wait1, wait1], [-10, 10],
linestyle=linestyles_wait[1], color=colors_wait[1],
label="wait 1: " + str(waittime1) + " clk" if idx == 0 else "",
linewidth=2.0, alpha=alpha_wait[1])
# Wait 2
if waittime2 is not None:
if waittime2 == 0:
axs2[idx].plot([wait2, wait2], [-10, 10],
linestyle=linestyles_wait[2], color=colors_wait[2], alpha=alpha_wait[2], linewidth=2.0)
axs2[idx].plot([wait2 + 1, wait2 + 1], [-10, 10],
linestyle=linestyles_wait[2], color=colors_wait[2], linewidth=2.0, alpha=alpha_wait[2])
axs2[idx].add_patch(Rectangle((wait2, -10), 1, 20,
label="wait 2: skipped" if idx == 0 else "",
facecolor=colors_wait[2], alpha=alpha_wait_rect[2], hatch='\\\\'))
else:
axs2[idx].plot([wait2, wait2], [-10, 10],
linestyle=linestyles_wait[2], color=colors_wait[2],
label="wait 2: " + str(waittime2) + " clk" if idx == 0 else "",
linewidth=2.0, alpha=alpha_wait[2])
# Wait 3
if waittime3 is not None:
if waittime3 == 0:
axs2[idx].plot([wait3, wait3], [-10, 10],
linestyle=linestyles_wait[3], color=colors_wait[3], alpha=alpha_wait[3], linewidth=2.0)
axs2[idx].plot([wait3 + 1, wait3 + 1], [-10, 10],
linestyle=linestyles_wait[3], color=colors_wait[3], linewidth=2.0, alpha=alpha_wait[3])
axs2[idx].add_patch(Rectangle((wait3, -10), 1, 20,
label="wait 3: skipped" if idx == 0 else "",
facecolor=colors_wait[3], alpha=alpha_wait_rect[3], hatch='\\\\'))
else:
axs2[idx].plot([wait3, wait3], [-10, 10],
linestyle=linestyles_wait[3], color=colors_wait[3],
label="wait 3: " + str(waittime3) + " clk" if idx == 0 else "",
linewidth=2.0, alpha=alpha_wait[3])
# Wait 4
if waittime4 is not None:
if waittime4 == 0:
axs2[idx].plot([wait4, wait4], [-10, 10],
linestyle=linestyles_wait[4], color=colors_wait[4], alpha=alpha_wait[4], linewidth=2.0)
axs2[idx].plot([wait4 + 1, wait4 + 1], [-10, 10],
linestyle=linestyles_wait[4], color=colors_wait[4], linewidth=2.0, alpha=alpha_wait[4])
axs2[idx].add_patch(Rectangle((wait4, -10), 1, 20,
label="wait 4: skipped" if idx == 0 else "",
facecolor=colors_wait[4], alpha=alpha_wait_rect[4], hatch='\\\\'))
else:
axs2[idx].plot([wait4, wait4], [-10, 10],
linestyle=linestyles_wait[4], color=colors_wait[4],
label="wait 4: " + str(waittime4) + " clk" if idx == 0 else "",
linewidth=2.0, alpha=alpha_wait[4])
# Wait 5
if waittime5 is not None:
if waittime5 == 0:
axs2[idx].plot([wait5, wait5], [-10, 10],
linestyle=linestyles_wait[5], color=colors_wait[5], alpha=alpha_wait[5], linewidth=2.0)
axs2[idx].plot([wait5 + 1, wait5 + 1], [-10, 10],
linestyle=linestyles_wait[5], color=colors_wait[5], linewidth=2.0, alpha=alpha_wait[5])
axs2[idx].add_patch(Rectangle((wait5, -10), 1, 20,
label="wait 5: skipped" if idx == 0 else "",
facecolor=colors_wait[5], alpha=alpha_wait_rect[5], hatch='\\\\'))
else:
axs2[idx].plot([wait5, wait5], [-10, 10],
linestyle=linestyles_wait[5], color=colors_wait[5],
label="wait 5: " + str(waittime5) + " clk" if idx == 0 else "",
linewidth=2.0, alpha=alpha_wait[5])
# =====================================================================================================
# Plot the loop lines
# Loop 0
if nloop0 is not None:
if nloop0 == 0:
axs2[idx].plot([loop0_start, loop0_start], [-10, 10],
linestyle=linestyles_loop[0], color=colors_loop[0],
alpha=alpha_loop[0], linewidth=2.0)
axs2[idx].plot([loop0_end + 1, loop0_end + 1], [-10, 10],
linestyle=linestyles_loop[0], color=colors_loop[0], alpha=alpha_loop[0], linewidth=2.0)
axs2[idx].add_patch(Rectangle((loop0_start, -10), loop0_end + 1 - loop0_start, 20,
label="loop 0: skipped" if idx == 0 else "",
facecolor=colors_loop[0], alpha=alpha_loop_rect[0], hatch='//'))
else:
axs2[idx].plot([loop0_start, loop0_start], [-10, 10],
linestyle=linestyles_loop[0], color=colors_loop[0], alpha=alpha_loop[0],
label="loop 0: " + str(nloop0) + " times" if idx == 0 else "", linewidth=2.0)
axs2[idx].plot([loop0_end, loop0_end], [-10, 10],
linestyle=linestyles_loop[0], color=colors_loop[0], alpha=alpha_loop[0], linewidth=2.0)
# Loop 1
if nloop1 is not None:
if nloop1 == 0:
axs2[idx].plot([loop1_start, loop1_start], [-10, 10],
linestyle=linestyles_loop[1], color=colors_loop[1],
alpha=alpha_loop[1], linewidth=2.0)
axs2[idx].plot([loop1_end + 1, loop1_end + 1], [-10, 10],
linestyle=linestyles_loop[1], color=colors_loop[1], alpha=alpha_loop[1], linewidth=2.0)
axs2[idx].add_patch(Rectangle((loop1_start, -10), loop1_end + 1 - loop1_start, 20,
label="loop 1: skipped" if idx == 0 else "",
facecolor=colors_loop[1], alpha=alpha_loop_rect[1], hatch='//'))
else:
axs2[idx].plot([loop1_start, loop1_start], [-10, 10],
linestyle=linestyles_loop[1], color=colors_loop[1], alpha=alpha_loop[1],
label="loop 1: " + str(nloop1) + " times" if idx == 0 else "", linewidth=2.0)
axs2[idx].plot([loop1_end, loop1_end], [-10, 10],
linestyle=linestyles_loop[1], color=colors_loop[1], alpha=alpha_loop[1], linewidth=2.0)
# Loop 2
if nloop2 is not None:
if nloop2 == 0:
axs2[idx].plot([loop2_start, loop2_start], [-10, 10],
linestyle=linestyles_loop[2], color=colors_loop[2],
alpha=alpha_loop[2], linewidth=2.0)
axs2[idx].plot([loop2_end + 1, loop2_end + 1], [-10, 10],
linestyle=linestyles_loop[2], color=colors_loop[2], alpha=alpha_loop[2], linewidth=2.0)
axs2[idx].add_patch(Rectangle((loop2_start, -10), loop2_end + 1 - loop2_start, 20,
label="loop 2: skipped" if idx == 0 else "",
facecolor=colors_loop[2], alpha=alpha_loop_rect[2], hatch='//'))
else:
axs2[idx].plot([loop2_start, loop2_start], [-10, 10],
linestyle=linestyles_loop[2], color=colors_loop[2], alpha=alpha_loop[2],
label="loop 2: " + str(nloop2) + " times" if idx == 0 else "", linewidth=2.0)
axs2[idx].plot([loop2_end, loop2_end], [-10, 10],
linestyle=linestyles_loop[2], color=colors_loop[2], alpha=alpha_loop[2], linewidth=2.0)
# Loop 3
if nloop3 is not None:
if nloop3 == 0:
axs2[idx].plot([loop3_start, loop3_start], [-10, 10],
linestyle=linestyles_loop[3], color=colors_loop[3],
alpha=alpha_loop[3], linewidth=2.0)
axs2[idx].plot([loop3_end + 1, loop3_end + 1], [-10, 10],
linestyle=linestyles_loop[3], color=colors_loop[3], alpha=alpha_loop[3], linewidth=2.0)
axs2[idx].add_patch(Rectangle((loop3_start, -10), loop3_end + 1 - loop3_start, 20,
label="loop 3: skipped" if idx == 0 else "",
facecolor=colors_loop[3], alpha=alpha_loop_rect[3], hatch='//'))
else:
axs2[idx].plot([loop3_start, loop3_start], [-10, 10],
linestyle=linestyles_loop[3], color=colors_loop[3], alpha=alpha_loop[3],
label="loop 3: " + str(nloop3) + " times" if idx == 0 else "", linewidth=2.0)
axs2[idx].plot([loop3_end, loop3_end], [-10, 10],
linestyle=linestyles_loop[3], color=colors_loop[3], alpha=alpha_loop[3], linewidth=2.0)
# Loop 4
if nloop4 is not None:
if nloop4 == 0:
axs2[idx].plot([loop4_start, loop4_start], [-10, 10],
linestyle=linestyles_loop[4], color=colors_loop[4],
alpha=alpha_loop[4], linewidth=2.0)
axs2[idx].plot([loop4_end + 1, loop4_end + 1], [-10, 10],
linestyle=linestyles_loop[4], color=colors_loop[4], alpha=alpha_loop[4], linewidth=2.0)
axs2[idx].add_patch(Rectangle((loop4_start, -10), loop4_end + 1 - loop4_start, 20,
label="loop 4: skipped" if idx == 0 else "",
facecolor=colors_loop[4], alpha=alpha_loop_rect[4], hatch='//'))
else:
axs2[idx].plot([loop4_start, loop4_start], [-10, 10],
linestyle=linestyles_loop[4], color=colors_loop[4], alpha=alpha_loop[4],
label="loop 4: " + str(nloop4) + " times" if idx == 0 else "", linewidth=2.0)
axs2[idx].plot([loop4_end, loop4_end], [-10, 10],
linestyle=linestyles_loop[4], color=colors_loop[4], alpha=alpha_loop[4], linewidth=2.0)
# Loop 5
if nloop5 is not None:
if nloop5 == 0:
axs2[idx].plot([loop5_start, loop5_start], [-10, 10],
linestyle=linestyles_loop[5], color=colors_loop[5],
alpha=alpha_loop[5], linewidth=2.0)
axs2[idx].plot([loop5_end + 1, loop5_end + 1], [-10, 10],
linestyle=linestyles_loop[5], color=colors_loop[5], alpha=alpha_loop[5], linewidth=2.0)
axs2[idx].add_patch(Rectangle((loop5_start, -10), loop5_end + 1 - loop5_start, 20,
label="loop 5: skipped" if idx == 0 else "",
facecolor=colors_loop[5], alpha=alpha_loop_rect[5], hatch='//'))
else:
axs2[idx].plot([loop5_start, loop5_start], [-10, 10],
linestyle=linestyles_loop[5], color=colors_loop[5], alpha=alpha_loop[5],
label="loop 5: " + str(nloop5) + " times" if idx == 0 else "", linewidth=2.0)
axs2[idx].plot([loop5_end, loop5_end], [-10, 10],
linestyle=linestyles_loop[5], color=colors_loop[5], alpha=alpha_loop[5], linewidth=2.0)
n_cols = count_nonzero([waittime0 != 0, waittime1 != 0, waittime2 != 0, waittime3 != 0, waittime4 != 0, waittime5 != 0,
nloop0 != 0, nloop1 != 0, nloop2 != 0, nloop3 != 0, nloop4 != 0, nloop5 != 0])
if n_cols > 0:
fig2.legend(loc="upper center", ncol=n_cols)
# manager = get_current_fig_manager()
# manager.window.showMaximized()
figure = plt.gcf() # get current figure
figure.set_size_inches(20, 10)
# when saving, specify the DPI
# tight_layout()
plt.savefig(Folder+"/"+File_pat+".png", dpi=300)
# Remove the white space around the plot -- only works on Unix (ImageMagick command)
os.system(f'mogrify -trim {Folder}/{File_pat}.png')
show()

View File

@ -0,0 +1,17 @@
#!/usr/bin/env modbuild
pbuild::set_download_url "https://github.com/slsdetectorgroup/$P/archive/refs/tags/${V_PKG}.tar.gz"
pbuild::add_to_group 'DetectorSoftware'
pbuild::add_configure_args '-DSLS_USE_SIMULATOR=ON'
pbuild::add_configure_args '-DSLS_USE_GUI=ON'
if (( V_MAJOR < 7 )); then
pbuild::add_patch 'files/fname-fix.patch'
fi
# Local Variables:
# mode: sh
# sh-basic-offset: 8
# tab-width: 8
# End:

View File

@ -0,0 +1,13 @@
diff --git a/slsSupportLib/CMakeLists.txt b/slsSupportLib/CMakeLists.txt
index efa8010..e842b3d 100755
--- a/slsSupportLib/CMakeLists.txt
+++ b/slsSupportLib/CMakeLists.txt
@@ -46,7 +46,7 @@ if(SLS_DEVEL_HEADERS)
include/sls/versionAPI.h
include/sls/ZmqSocket.h
include/sls/bit_utils.h
- include/sls/mdf5.h
+ include/sls/md5.h
include/sls/md5_helper.h
)
endif()

View File

@ -0,0 +1,5 @@
slsDetectorPackage/6.1.1 stable cmake/3.15.5 zeromq/4.3.4
slsDetectorPackage/7.0.1_rh7 stable cmake/3.15.5 zeromq/4.3.4 Qt/5.12.10
slsDetectorPackage/7.0.1_rh8 stable cmake/3.15.5 zeromq/4.3.4 Qt/5.12.10
slsDetectorPackage/7.0.2_rh7 stable cmake/3.15.5 zeromq/4.3.4 Qt/5.12.10
slsDetectorPackage/7.0.2_rh8 stable cmake/3.15.5 zeromq/4.3.4 Qt/5.12.10

View File

@ -0,0 +1,3 @@
slsDetectorPackage/6.1.1:
- relstage: unstable
build_requires: cmake/3.15.5 zeromq/4.3.4

View File

@ -0,0 +1,9 @@
#%Module1.0
module-whatis "SLS detector package"
module-url "https://www.psi.ch/en/lxn/software-releases"
module-license "GNU LGPL 3.0"
module-maintainer "Lars Erik Froejdh <erik.froejdh@psi.ch>"
module-help "
"

View File

@ -9,6 +9,9 @@ pybind11_add_module(_slsdet
src/pattern.cpp
src/scan.cpp
src/current.cpp
src/duration.cpp
src/DurationWrapper.cpp
src/pedestal.cpp
)
target_link_libraries(_slsdet PUBLIC
@ -16,40 +19,42 @@ target_link_libraries(_slsdet PUBLIC
)
set_target_properties(_slsdet PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
#Copy Python code
set( PYTHON_FILES
__init__.py
adcs.py
dacs.py
decorators.py
detector_property.py
detector.py
eiger.py
enums.py
errors.py
gotthard.py
pattern.py
gotthard2.py
moench.py
proxy.py
ctb.py
jungfrau.py
mythen3.py
registers.py
temperature.py
lookup.py
utils.py
slsdet/__init__.py
slsdet/adcs.py
slsdet/dacs.py
slsdet/powers.py
slsdet/decorators.py
slsdet/detector_property.py
slsdet/detector.py
slsdet/defines.py
slsdet/eiger.py
slsdet/enums.py
slsdet/errors.py
slsdet/gaincaps.py
slsdet/gotthard.py
slsdet/pattern.py
slsdet/gotthard2.py
slsdet/moench.py
slsdet/proxy.py
slsdet/ctb.py
slsdet/jungfrau.py
slsdet/mythen3.py
slsdet/registers.py
slsdet/temperature.py
slsdet/lookup.py
slsdet/utils.py
)
foreach(FILE ${PYTHON_FILES})
configure_file( slsdet/${FILE}
${CMAKE_BINARY_DIR}/bin/slsdet/${FILE} )
configure_file( ${FILE}
${CMAKE_BINARY_DIR}/bin/${FILE} )
endforeach(FILE ${PYTHON_FILES})
@ -59,4 +64,14 @@ configure_file( scripts/basic.py
)
configure_file( scripts/test_virtual.py
${CMAKE_BINARY_DIR}/test_virtual.py
)
)
if(SLS_INSTALL_PYTHONEXT)
install(TARGETS _slsdet
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/python
)
install(FILES ${PYTHON_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/python/slsdet)
endif()

View File

@ -0,0 +1,12 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
from slsdet import Detector, pedestalParameters
p = pedestalParameters()
p.frames = 10
p.loops= 20
d = Detector()
d.pedestalmode = p

View File

@ -3,22 +3,20 @@
import os
import sys
import numpy as np
from pathlib import Path
sys.path.append(os.path.join(os.getcwd(), 'bin'))
# from pathlib import Path
# sys.path.append(os.path.join(os.getcwd(), 'bin'))
from slsdet import Detector, Mythen3, Eiger, Jungfrau, DetectorDacs, Dac, Ctb, Gotthard2, Moench
from slsdet import dacIndex, readoutMode
from slsdet.lookup import view, find
import slsdet
from slsdet import DurationWrapper
d = Detector()
e = Eiger()
c = Ctb()
g = Gotthard2()
# j = Jungfrau()
# m = Mythen3()
m = Moench()
t = DurationWrapper(1.0)
d.setExptime(t)
# d.setExptime(0.3)

View File

@ -2,7 +2,7 @@
# Copyright (C) 2021 Contributors to the SLS Detector Package
import subprocess
import locale
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
out = subprocess.run(['sls_detector_get', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
cmd = out.stdout.splitlines()
cmd.pop(0)
@ -14,7 +14,6 @@ pycmd = dir(Detector)
# dacs are in general not included in the python commands and we expect to
# set them from the specialized class or using an enum
dacs = [
'adcvpp',
'iodelay',
'list',
'rxb_lb',
@ -100,7 +99,6 @@ intentionally_missing = [
'temp_slowadc',
'temp_sodl',
'temp_sodr',
'trigger', #use sendSoftwareTrigger
'update', #use updateServerAndFirmare
'udp_validate', #use validateUdpConfiguration
'udp_reconfigure', #use reconfigureUdpDestination

View File

@ -11,7 +11,7 @@ enums.cpp
import re
import subprocess
from parse import remove_comments
from parse import remove_comments, remove_ifdefs
allow_bitwise_op = ["streamingInterface", "M3_GainCaps"]
@ -98,25 +98,25 @@ def generate_enum_string(enums):
return ''.join(data)
def remove_ifdefs(lines):
"""Keeps C++ version of the code"""
out = []
it = iter(lines)
skip = False
for line in it:
# def remove_ifdefs(lines):
# """Keeps C++ version of the code"""
# out = []
# it = iter(lines)
# skip = False
# for line in it:
if "#ifdef __cplusplus" in line:
line = next(it)
# if "#ifdef __cplusplus" in line:
# line = next(it)
if "#else" in line:
skip = True
# if "#else" in line:
# skip = True
if "#endif" in line:
skip = False
# if "#endif" in line:
# skip = False
if not skip and "#endif" not in line:
out.append(line)
return out
# if not skip and "#endif" not in line:
# out.append(line)
# return out
with open('../../slsSupportLib/include/sls/sls_detector_defs.h') as f:

View File

@ -16,33 +16,40 @@ import time
from pathlib import Path
from parse import system_include_paths, clang_format_version
REDC = '\033[91m'
GREENC = '\033[92m'
ENDC = '\033[0m'
REDC = "\033[91m"
GREENC = "\033[92m"
ENDC = "\033[0m"
def red(msg):
return f'{REDC}{msg}{ENDC}'
return f"{REDC}{msg}{ENDC}"
def green(msg):
return f'{GREENC}{msg}{ENDC}'
return f"{GREENC}{msg}{ENDC}"
def check_clang_format_version(required_version):
if (ver := clang_format_version()) != required_version:
msg = red(f'Clang format version {required_version} required, detected: {ver}. Bye!')
msg = red(
f"Clang format version {required_version} required, detected: {ver}. Bye!"
)
print(msg)
sys.exit(1)
else:
msg = green(f'Found clang-format version {ver}')
msg = green(f"Found clang-format version {ver}")
print(msg)
def check_for_compile_commands_json(path):
# print(f"Looking for compile data base in: {path}")
compile_data_base_file = path/'compile_commands.json'
compile_data_base_file = path / "compile_commands.json"
if not compile_data_base_file.exists():
msg = red(f"No compile_commands.json file found in {path}. Bye!")
print(msg)
sys.exit(1)
else:
msg = green(f'Found: {compile_data_base_file}')
msg = green(f"Found: {compile_data_base_file}")
print(msg)
@ -50,15 +57,13 @@ default_build_path = "/home/l_frojdh/sls/build/"
fpath = "../../slsDetectorSoftware/src/Detector.cpp"
m = []
ag = []
lines = []
ag2 = []
cn = []
def get_arguments(node):
args = [a.type.spelling for a in node.get_arguments()]
args = [
@ -70,18 +75,19 @@ def get_arguments(node):
args = f", {args}"
return args
def get_arguments_with_default(node):
args = []
for arg in node.get_arguments():
tokens = [t.spelling for t in arg.get_tokens()]
# print(tokens)
if '=' in tokens:
if arg.type.spelling == "sls::Positions": #TODO! automate
if "=" in tokens:
if arg.type.spelling == "sls::Positions": # TODO! automate
args.append("py::arg() = Positions{}")
else:
args.append('py::arg()' + ''.join(tokens[tokens.index('='):]))
args.append("py::arg()" + "".join(tokens[tokens.index("=") :]))
else:
args.append('py::arg()')
args.append("py::arg()")
args = ", ".join(args)
if args:
args = f", {args}"
@ -93,17 +99,26 @@ def get_fdec(node):
if node.result_type.spelling:
return_type = node.result_type.spelling
else:
return_type = 'void'
return_type = "void"
if node.is_const_method():
const = 'const'
const = "const"
else:
const = ''
const = ""
args = ", ".join(args)
args = f'({return_type}(Detector::*)({args}){const})'
args = f"({return_type}(Detector::*)({args}){const})"
return args
def time_return_lambda(node, args):
names = ['a', 'b', 'c', 'd']
fa = [a.type.spelling for a in node.get_arguments()]
ca = ','.join(f'{arg} {n}' for arg, n in zip(fa, names))
na = ','.join(names[0:len(fa)])
s = f'CppDetectorApi.def("{node.spelling}",[](sls::Detector& self, {ca}){{ auto r = self.{node.spelling}({na}); \n return std::vector<sls::Duration>(r.begin(), r.end()); }}{args});'
return s
def visit(node):
if node.kind == cindex.CursorKind.CLASS_DECL:
if node.displayname == "Detector":
@ -113,15 +128,15 @@ def visit(node):
and child.access_specifier == cindex.AccessSpecifier.PUBLIC
):
m.append(child)
# args = get_arguments(child)
args = get_arguments_with_default(child)
fs = get_fdec(child)
lines.append(
f'.def("{child.spelling}",{fs} &Detector::{child.spelling}{args})'
f'CppDetectorApi.def("{child.spelling}",{fs} &Detector::{child.spelling}{args});'
)
if cargs.verbose:
print(f'&Detector::{child.spelling}{args})')
print(f"&Detector::{child.spelling}{args})")
cn.append(child)
for child in node.get_children():
visit(child)
@ -139,16 +154,16 @@ if __name__ == "__main__":
"-v",
"--verbose",
help="more output",
action='store_true',
action="store_true",
)
cargs = parser.parse_args()
check_clang_format_version(12)
check_for_compile_commands_json(cargs.build_path)
print("Parsing functions in Detector.h - ", end = "", flush = True)
print("Parsing functions in Detector.h - ", end="", flush=True)
t0 = time.perf_counter()
#parse functions
# parse functions
db = cindex.CompilationDatabase.fromDirectory(cargs.build_path)
index = cindex.Index.create()
args = db.getCompileCommands(fpath)
@ -159,10 +174,10 @@ if __name__ == "__main__":
args = args + incargs
tu = index.parse(fpath, args=args)
visit(tu.cursor)
print(green('OK'))
print(f'Parsing took {time.perf_counter()-t0:.3f}s')
print(green("OK"))
print(f"Parsing took {time.perf_counter()-t0:.3f}s")
print("Read detector_in.cpp - ", end = "")
print("Read detector_in.cpp - ", end="")
with open("../src/detector_in.cpp") as f:
data = f.read()
s = "".join(lines)
@ -170,16 +185,16 @@ if __name__ == "__main__":
text = data.replace("[[FUNCTIONS]]", s)
warning = "/* WARINING This file is auto generated any edits might be overwritten without warning */\n\n"
print(green("OK"))
print("Writing to detector.cpp - ", end = "")
print("Writing to detector.cpp - ", end="")
with open("../src/detector.cpp", "w") as f:
f.write(warning)
f.write(text)
print(green('OK'))
print(green("OK"))
# run clang format on the output
print('Running clang format on generated source -', end = "")
print("Running clang format on generated source -", end="")
subprocess.run(["clang-format", "../src/detector.cpp", "-i"])
print(green(" OK"))
print("Changes since last commit:")
subprocess.run(['git', 'diff', '../src/detector.cpp'])
subprocess.run(["git", "diff", "../src/detector.cpp"])

View File

@ -0,0 +1,30 @@
import re
import subprocess
from parse import remove_comments, remove_ifdefs
with open('../../slsSupportLib/include/sls/sls_detector_defs.h') as f:
data = f.read()
data = remove_comments(data)
data = data.splitlines()
# data = remove_ifdefs(data)
ignore = ['#define MYROOT', '#define __cplusplus']
defines = {}
for i, line in enumerate(data):
if line.startswith('#define') and line not in ignore:
_, name, value = line.split(maxsplit = 2)
print(f'{name}={value}')
defines[name]=value
warning = '#WARINING This file is auto generated any edits might be overwritten without warning\n\n'
with open('../slsdet/defines.py', 'w') as f:
f.write(warning)
for key, value in defines.items():
f.write(f'{key}={value}\n')

View File

@ -25,7 +25,25 @@ def remove_comments(text):
)
return re.sub(pattern, replacer, text)
def remove_ifdefs(lines):
"""Keeps C++ version of the code"""
out = []
it = iter(lines)
skip = False
for line in it:
if "#ifdef __cplusplus" in line:
line = next(it)
if "#else" in line:
skip = True
if "#endif" in line:
skip = False
if not skip and "#endif" not in line:
out.append(line)
return out
#based on ccsyspath: https://github.com/AndrewWalker/ccsyspath

View File

@ -7,7 +7,6 @@ Build upon the pybind11 example found here: https://github.com/pybind/python_exa
import os
import sys
sys.path.append('../libs/pybind11')
from setuptools import setup, find_packages
from pybind11.setup_helpers import Pybind11Extension, build_ext
@ -22,23 +21,29 @@ def get_conda_path():
return os.environ['CONDA_PREFIX']
#TODO migrate to CMake build?
#TODO migrate to CMake build or fetch files from cmake?
ext_modules = [
Pybind11Extension(
'_slsdet',
['src/main.cpp',
'src/current.cpp',
'src/enums.cpp',
'src/current.cpp',
'src/detector.cpp',
'src/network.cpp',
'src/pattern.cpp',
'src/scan.cpp',],
'src/scan.cpp',
'src/duration.cpp',
'src/DurationWrapper.cpp',
'src/pedestal.cpp',
]
,
include_dirs=[
os.path.join('../libs/pybind11/include'),
os.path.join(get_conda_path(), 'include'),
],
libraries=['SlsDetector', 'SlsSupport', 'SlsReceiver', 'zmq'],
libraries=['SlsDetector', 'SlsSupport', 'SlsReceiver'],
library_dirs=[
os.path.join(get_conda_path(), 'lib'),
],

View File

@ -4,6 +4,7 @@
from .eiger import Eiger
from .ctb import Ctb
from .dacs import DetectorDacs, Dac
from .powers import DetectorPowers, Power
from .detector import Detector
from .jungfrau import Jungfrau
from .mythen3 import Mythen3
@ -11,16 +12,19 @@ from .gotthard2 import Gotthard2
from .gotthard import Gotthard
from .moench import Moench
from .pattern import Pattern, patternParameters
from .gaincaps import Mythen3GainCapsWrapper
import _slsdet
xy = _slsdet.xy
defs = _slsdet.slsDetectorDefs
#Make enums and #defines available at top level
from .enums import *
from .defines import *
IpAddr = _slsdet.IpAddr
MacAddr = _slsdet.MacAddr
scanParameters = _slsdet.scanParameters
currentSrcParameters = _slsdet.currentSrcParameters
currentSrcParameters = _slsdet.currentSrcParameters
DurationWrapper = _slsdet.DurationWrapper
pedestalParameters = _slsdet.pedestalParameters

View File

@ -3,34 +3,11 @@
from .detector import Detector, freeze
from .utils import element_if_equal
from .dacs import DetectorDacs, NamedDacs
from .powers import DetectorPowers, NamedPowers
import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty
# class CtbDacs(DetectorDacs):
# """
# Ctb dacs
# """
# _dacs = [('dac0', dacIndex(0), 0, 4000, 1400),
# ('dac1', dacIndex(1), 0, 4000, 1200),
# ('dac2', dacIndex(2), 0, 4000, 900),
# ('dac3', dacIndex(3), 0, 4000, 1050),
# ('dac4', dacIndex(4), 0, 4000, 1400),
# ('dac5', dacIndex(5), 0, 4000, 655),
# ('dac6', dacIndex(6), 0, 4000, 2000),
# ('dac7', dacIndex(7), 0, 4000, 1400),
# ('dac8', dacIndex(8), 0, 4000, 850),
# ('dac9', dacIndex(9), 0, 4000, 2000),
# ('dac10', dacIndex(10), 0, 4000, 2294),
# ('dac11', dacIndex(11), 0, 4000, 983),
# ('dac12', dacIndex(12), 0, 4000, 1475),
# ('dac13', dacIndex(13), 0, 4000, 1200),
# ('dac14', dacIndex(14), 0, 4000, 1600),
# ('dac15', dacIndex(15), 0, 4000, 1455),
# ('dac16', dacIndex(16), 0, 4000, 0),
# ('dac17', dacIndex(17), 0, 4000, 1000),
# ]
# _dacnames = [_d[0] for _d in _dacs]
from .utils import element
@freeze
@ -38,10 +15,13 @@ class Ctb(Detector):
def __init__(self, id = 0):
super().__init__(id)
self._frozen = False
# self._dacs = CtbDacs(self)
self._dacs = NamedDacs(self)
self._powers = NamedPowers(self)
@property
def dacs(self):
return self._dacs
@property
def powers(self):
return self._powers

View File

@ -38,7 +38,7 @@ class Dac(DetectorProperty):
class NamedDacs:
"""
New implementation of the detector dacs. Used at the momen for
New implementation of the detector dacs. Used at the moment for
Ctb but should replace the old one for all detectors
"""
_frozen = False
@ -47,8 +47,13 @@ class NamedDacs:
self._detector = detector
self._current = 0
self._dacnames = [n.replace(" ", "") for n in detector.getDacNames()]
# # Populate the dacs
#only get the dacnames if we have modules attached
if detector.size() == 0:
self._dacnames = [f"dac{i}" for i in range(18)]
else:
self._dacnames = [n.replace(" ", "") for n in detector.getDacNames()]
# Populate the dacs
for i,name in enumerate(self._dacnames):
#name, enum, low, high, default, detector
setattr(self, name, Dac(name, dacIndex(i), 0, 4000, 1000, detector))
@ -60,7 +65,7 @@ class NamedDacs:
def __setattr__(self, name, value):
if not self._frozen:
#durining init we need to be able to set up the class
#durning init we need to be able to set up the class
super().__setattr__(name, value)
else:
#Later we restrict us to manipulate dacs and a few fields

33
python/slsdet/defines.py Normal file
View File

@ -0,0 +1,33 @@
#WARINING This file is auto generated any edits might be overwritten without warning
BIT32_MASK=0xFFFFFFFF
MAX_RX_DBIT=64
DEFAULT_TCP_CNTRL_PORTNO=1952
DEFAULT_TCP_STOP_PORTNO=1953
DEFAULT_TCP_RX_PORTNO=1954
DEFAULT_ZMQ_CL_PORTNO=30001
DEFAULT_ZMQ_RX_PORTNO=30001
DEFAULT_UDP_SRC_PORTNO=32410
DEFAULT_UDP_DST_PORTNO=50001
MAX_UDP_DESTINATION=32
SLS_DETECTOR_HEADER_VERSION=0x2
SLS_DETECTOR_JSON_HEADER_VERSION=0x4
UDP_PACKET_DATA_BYTES=(1344)
MAX_TRIMEN=100
MAX_BLACKFIN_PROGRAM_SIZE=(128 * 1024)
GET_FLAG=-1
DEFAULT_DET_MAC="00:aa:bb:cc:dd:ee"
DEFAULT_DET_IP="129.129.202.45"
DEFAULT_DET_MAC2="00:aa:bb:cc:dd:ff"
DEFAULT_DET_IP2="129.129.202.46"
LOCALHOST_IP="127.0.0.1"
MAX_STR_LENGTH=1000
SHORT_STR_LENGTH=20
MAX_PATTERN_LENGTH=0x2000
MAX_PATTERN_LEVELS=6
M3_MAX_PATTERN_LEVELS=3
MAX_NUM_COUNTERS=3
DEFAULT_STREAMING_TIMER_IN_MS=500
NUM_RX_THREAD_IDS=9
MAX_NUM_PACKETS=512
TRIMBITMASK=0x3f

File diff suppressed because it is too large Load Diff

42
python/slsdet/gaincaps.py Normal file
View File

@ -0,0 +1,42 @@
import _slsdet
gc = _slsdet.slsDetectorDefs.M3_GainCaps
class Mythen3GainCapsWrapper:
"""Holds M3_GainCaps enums and facilitates printing"""
# 'M3_C10pre', 'M3_C15pre', 'M3_C15sh', 'M3_C225ACsh', 'M3_C30sh', 'M3_C50sh'
all_bits = gc.M3_C10pre | gc.M3_C15pre | gc.M3_C15sh | gc.M3_C225ACsh | gc.M3_C30sh | gc.M3_C50sh
all_caps = (gc.M3_C10pre, gc.M3_C15pre, gc.M3_C15sh, gc.M3_C225ACsh, gc.M3_C30sh, gc.M3_C50sh)
def __init__(self, value = 0):
self._validate(value)
self.value = value
def __eq__(self, other) -> bool:
if isinstance(other, Mythen3GainCapsWrapper):
return self.value == other.value
else:
return self.value == other
def __ne__(self, other) -> bool:
return not self.__eq__(other)
def __str__(self) -> str:
s = ', '.join(str(c).rsplit('_', 1)[1] for c in self.all_caps if self.value & c)
return s
def __repr__(self) -> str:
return self.__str__()
def _validate(self, value):
"""Check that only bits representing real capacitors are set"""
if isinstance(value, gc):
return True
elif isinstance(value, int):
if value & (~self.all_bits):
raise ValueError(f"The value: {value} is not allowed for Mythen3GainCapsWrapper")
else:
raise ValueError("GainCaps can only be initialized from int or M3_GainCaps enum")

View File

@ -13,6 +13,7 @@ from .detector import Detector, freeze
from .dacs import DetectorDacs
import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex
gc_enums = _slsdet.slsDetectorDefs.M3_GainCaps
from .detector_property import DetectorProperty
@ -62,4 +63,6 @@ class Mythen3(Detector):
@property
def dacs(self):
return self._dacs
return self._dacs

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