Compare commits

..

86 Commits

Author SHA1 Message Date
1b41e39ad1 updated client versioning (#1061) 2024-11-26 15:14:03 +01:00
64fea22c2b back to getting version for conda from tag (#1059) 2024-11-26 14:35:46 +01:00
9beaed7813 release notes 2024-11-26 11:16:33 +01:00
0aeb7e4417 9.0.0.rc (#1058)
* 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)

* Dev/jf/fix pedestal (#821)

* jf pedestal fix: touch enable bit last

* 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>

* 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

* 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

* eiger required fw version to 32: fix for blocking trigger in quad (#834)

* fix warning for prev_val (variable size array) in tests (#838)

* 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)

* handling inconsistent fnums to be -1 in gui, so when one sets 0 (change of value) will also give an exception (#854)

* 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

* formatting

* tests for jf (#835)

* execute command inside server fixed (from fix simulator tests and exec command PR) (#857)

* dev: fix server logic in checking detector idle  (#861)

* fix buggy logic in checking detector idle and an argument check

* 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

* minor fix for test_simulator

* updating docs

* fixed doc

* added python 3.12 to the conda build variants

* documentation and examples

* formatting

* forward declare zmq_msg_t and moved include (#869)

* forward declare zmq_msg_t and moved include

* removed zmq from pkg list

* removed zmq as dependency for slsdet (#870)

* dev: moench: min exptime (#865)

* moench: remove min clock cycles for setting exptime (had been ported from jf)

* 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>

* 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'

* 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

* 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

* 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

* 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)

* minor

* updated commands generation

* formatting

* moench default speed set to after init readout configuration (half speed) (#886)

* Fixed path when building as submodule

* Moench v8 (#892)

* new rct structure for moench03

* new moench data structure for offline processing

* meonch raw data and zmq process files updated to 7.0.3 version

* implemented config file for Zmq file

* raw data and zmq work with config file, but only with one file/interface

* zmq config change

* added config examples for zmq and rawdata

* pmod for 7.0.3 and 8.0.0 from previous releases

* updated pmod 8.0.1 for rh7 and rh8

* m3 fix to get kernel version properly on nios without an incorrect error msg (#898)

* moench: changed max shifts of adc clk from 240 to 200 (#900)

* Protect from getenv("HOME") returning nullptr  (#907) (#908)

* Protect from getenv("HOME") returning nullptr (e.g., in case running in systemd)

* Write proper warning in Module.cpp

Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>

* Dev/xilinx acq (#901)

* period and exptime(patternwaittime level 0)

* added new regsieterdefs and updated api version and fixedpattern reg

* autogenerate commands

* formatting

* minor

* wip resetflow, readout mode, transceiver mask, transceiver enable

* acquisition, but streaming done bit and busy (exposing + read chip to fifo) not known yet from fw

* programming fpga and device tree done

* most configuration done, need to connect configuretransceiver to client

* stuck at resetting transciever timed out

* minor

* fixed virtual, added chip busyto fifo, streaming busy, set/getnext framenumber

* configuretransceiver from client, added help in client

* make formatt and command generation

* tests for xilinx ctb works

* command generation

* dacs added and tested, power not done

* power added

* added temp_fpga

* binaries in

* ctrlreg is 0 to enable chip=fixed, high dac val = min val= fixed, power regulators in weird order=fixed, device tree could be loaded with dacs before adcs=fixed

* start works

* virtual server sends

* receiver works

* tests

* python function and enum generation, commands generatorn and autocomplete, formatting, tests

* tests fail at start(transceiver not aligned)

* tests passed

* all binaries compiled

* eiger binary in

* added --nomodule cehck for xilinx

* updated binaries

* formatting

* moench server: changed default values of adcphase for full speed from 300 to 150 and dac vipre_cds from 800 to 1280 (#922)

* client bug fix: m3 multi module bad channel file throws bad allocation when modules skipped, needed to add vectors in 2d vector of bad channel list (#920)

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>

* developer: blocking acquire stop with slave temporarily in waiting (#926)

* client: stopping a blocking acquire of multi modules checks status to catch slaves that might still be in waiting. Problem is (gotthard2 25um at least) slave is in waiting only temporarily before going go idle/stopped. So a 50ms sleep is necessary ot not throw an unnecessary error

* client: when stopping blocking acquire, wait up to 1s in 50ms increments for slave to stop waiting temporarily

* fix to rapidjson for build with gcc 14 (#929)

* Dev: m3 clkdiv0 20 (#924)

* m3: clk 0 changed from 10 to 20 (100MHz to 50MHz)

* g2: startup clk div back to 10 as in firmware but setting in software startup to 20

* m3: minor print error if clk divider > max

* G2: reconfigure chip (#927)

* changed common.c readADCFromFile to make it more general and move temperature calculation for Eiger out of this function and inside whereever it is called.
* g2 and m2: gethighvoltage was just a variable set in server, it is now moved to a get inside DAC5671 implementation (but not reading a measured value, instead what is set from a file), high voltage variable used inside DAC5671 for virtual servers
* g2: switching off hv (ifrom non zero to zero value) will wait for 10s; powering on chip reconfigures chip; powering off chip unconfigures chip; powering off chip also includes check if hv = 0, if not throw exception; chip configuration checked before acquring; at start up: hv switched off and chip powered on, so does not wait 10s to switch off hv;
* included test to check powering off chip when hv is on should throw an exception
* g2:  check if chip configured before acquiring

* nios: read hv value set from file and virtual still goes into DAC5671 for conversions to and fro dac to V, change common readadc to readparameter to generalize, make sethighvoltage into a get and set to catch errors in get as well, g2: if not at startup, remmeber hv value before setting it and after check if value was being switched off (from a non zero value) and wait 10s if it was (10s wait only for switching off from non zero and not at startup)

* developer: moench empty data callback  (#936)

* moench (feature to wait for post processing to be done in new sls_detector_acquire_zmq executable)

READOUT_ACTION_ZMQ added to action enums
sls_detector_acquire_zmq added to executables
empty data call back so that client listens to last dummy zmq packet from moench post processor
processor: remove NEWZMQ ifdefs and remove connect for zmq publisher socket

* fix to compile

* cmds generated and parsed

* dev: client: status for blocking acquire stop with slave temporarily in waiting (#944)

* acq finish call back gets status squashed with default error but before that need to wait for gotthard slaves to catch up from waiting to stopped

* bug fixes related to file saving (#931) (#946)

* fix the file path resetting issue of GUI in the case where different modules have different fpath setting.

* fix stack-buffer-overflow issue when using HDF5 HDF5DataFile::parameterDataTypes have 64bit type (i.e. STD_U64LE), the size of fill_value should be at least 8 bytes.

* change the type of fill_value to uint64_t

Co-authored-by: Z.H. Li <zhenghenge@gmail.com>

* updated documentation from martin (#948)

* Dev/xilinx ctb test (#942)

* voltage regulators only looks at dac and not at ctrl_reg

* xilinx: change dac max to 2048, setting dac ist not inverse conversion from dac to voltage anymore, but setting power is inverse, also there is max and min to power, a different min for vio and this is checked at funcs interface, not printign or converting to mv in dac for power regulators (as its conversion max and min are different)

* Use links for dacs/adc and adapt power rglt thresholds

* Remove wait for transceiver reset

* adc and dac device not used anymore and hence removed

* udp restucturing: arm has to be multiple of 16 and no byteswap in udp_gen, option to compile locally in arm architecture, memsize of the second udp memory has to be limited

---------

Co-authored-by: Martin Brückner <martin.brueckner@psi.ch>

* formatting

* dev: jungfrau HW 1.0: adc output clock phase to 120 (#952)

* jungfrau: change adc output clock phase from 180 to 120 for v1.0 boards for reliable readout of adc #2

* versioning

* formatting

* rx: moved creating fpath (if it doesnt exist) from setting file path to at the start of acquisition when creating file. This is done here so that it does not fail if fwrite is disabled anyway. Also fixed it in documentation. Changed in documentation that the default for fwrite is disabled (#957)

* added keepalive zmq socket option (after 60s of idle time, 10 probes every sec. Mainly because an issue at Max IV (#956)

* Moench mess from developer (#953)

* new moench data structure for offline processing

* Dev/zmq stream all ipv6 adn remove rx_zmqip (#958)

* enable ipv6 in zmq socket

* removed rx_zmqip API and field in gui, changed client updaterxrzip to updateclientzmqip to have the rx_hostname ip if 0. 

* updated command line for rx_zmqip to give a warning. 

* Replaced 'depreciated' to 'deprecated' everywhere

* switching from * to 0.0.0.0 works for rebinding zmq sockets

* fixed help in command line for rx_zmqip * to 0.0.0.0 and removed cmd in python

* remove publisher zmq socket ip also for moench post processing

* fixed tests

* publisher zmq ip macros to be reused

* fixed a warning about narrowing conversion from size_t to int (#963)

* fixed stop server not starting up with setup variables (#949)

* m3: fixed stop server not starting up with setup variables

* all servers except eiger fixed for virtual stop server to start up with setupDetector function called

* virtual tests work

* eiger: versions print neednt be in stop server

* jungfrau: stop server (not virtual) also needs to read config file

* ensuring master is setup for virtual and real servers

* Dev/pyctbgui merge (#960)

* added empty c extension

* added rotation to the decoding

* added color map, options and findex

* minor

* move checks to before acquisition

* added pixel map based decoder

* cleanup

* no thread creation for single thread processing

* added rotation and test to compare

* allow high and low water mark for zmq (also buffer size) for fast readouts

* removed roatation during decoding

* added Transpose to image and invert Y False to invert it

* retains the zoomed state after the first image of gui, catch and display exception if no detector connected

* moved start frame to dockable widget, removed extra frame number label, moved current measurement also to dockable widget, hide frame plot entirely when showing patternviewer

* first image dependin on which plot

* remember settings of main window size and position, dockewidget if docked, its size and posisiotn as well, then update it next time the gui is opened

* change in comment

* using c decoder for moench 04 and matterhorn

* catch exception from invalid image from decoder

* clean up

* update row and col when choosing image type, neeeded to show values

* fix for previous PR

* disable resetting colormap values
keep the range selected for every new acquisition

* fix typos + tested on virtual matterhorn

* minor print

* refactored Slow ADCs Tab

* refactored DAC tab

* refactored power supplies

* refactored signals tab

* refactored transceiver tab

* fix typo

* fix typo2

* remove commented code

* delete commented code

* delete commented code

* delete commented signals code

* remove commented code for transceiver tab

* refactor adc tab

* refactor Pattern Tab

* Refactor transceivers tab (PR#5) (#118)

* refactored transceiver tab

* remove commented code for transceiver tab

---------

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

* refactor adc tab (PR#6) (#119)


* refactor adc tab

* refactored Plot and Acquisition Tabs

* fix the regression issue

* restructure project files

* applying singleton and renaming tabs to services

* working install using pip

* applies singleton to tab classes and remove CI erros

* added pyzmq and pillow

* remove the singleton implementation and keep changes

* fix merge errors in mainWindow

* moved misplaced init file

* rename service to tab

* reorganize imports

* iterate over tabs

* reorder tabs

* add slowadc to the list

* saving changes (buggy)
power supply ui not showing in the gui

* split power supply tab

* fixed tests

* add hardcoded values to defines file

* fix error

* separate power supply

* fix errors for powerSuppliesTab

* split dacs

* split slow adcs

* split signals tab

* added tests for bit_utils

* add slowAdc class to defines

* split transceiver ui file

* split adc.ui

* split pattern ui file

* split plot and acquisition ui file

* added basic test for parsing bit names

* removed redundant code in read_alias_file

* fix dacs ui position

* testing for correct exception

* cmd and args at split

* group radio buttons

* fix comments from PR#1

* show legend

* added python version and dev requirements to setup.py

* fix dac issue

* moved _decoder into pkg

* added inplace build

* removed clear

* fixed dependencies

* make tests run without slsdet

* updated name of action

* define colcount

* fixed loading of alias file

* add yapf and ruff

* apply formatting

* fix E and F rules

* add more ruff rules

* change variable name

* squashing gh debugging commits and add pre-commit

* update label values to mv units

* add hook for yapf

* reconfigure yapf precommit hook

* add format and check_format to makefile

* change gh actions

* update readme

* added check_format

* WIP

* added linting in github action

* updated readme]

* add more control for color choice

* remove useless file

* fix un-updated line after refactoring Defines
BIT0_31_MASK is not found in Defines.signals

* visually improve the interface

* fix last commit

* add only selected plots for legend

* add hide legend button

* change hide legend to show legend
checkbox show legend is checked by default

* add support for saving in numpy

* solve conversations

* fix acq index offset

* fix browse button in pattern error

* fix other browse button errors

* finish tests and add usage.md

* remove buffer

* add file,numpy-like interface and tests

* remove useless .npy files

* subscriptible npz files

* remove useless files

* remove repetetive tests

* save changes

* add mode r+, add with support,remove logging

* remove offset of acqIndex between raw and numpy saving

* fix only saving last frame

* save signals of multiple devices

* add comments and move condition for clearer code

* fix bug when vieweing pattern file

* iterate over enabled and plotted plots

* add padestal substraction to transceiver and analog data

* init pedestal frames to detector.frames

* restore old exception

* add pedestal substraction for digital signals

* remove frames spinbox from plotTab

* remove comments and use str instead of Path

* avoid saving all frames

* correct exception and log error's trace

* add gui tests

* add waveform test

* add pedestal test

* refactor by using fixtures

* add tests for moench analog and pattern

* add pytest-qt to dependencies

* add save and load gui parameters

* remove nohup file

* fix old bug IndexError

* save plot type

* a

* handle canceling load, loading matterhorn pedestal for moench

* remove comparing .png files for pattern test

* save plot type

* red error on status bar when shape mismatch for loaded pedestal

* fix makefile and docstrings

* fix PRs conversation

* move code into different function

* fix wrong function names for power supply

* removed old ctbgui

* removed unnecessary files

---------

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
Co-authored-by: Braham Bechir <braham_b@pc11979.psi.ch>
Co-authored-by: Bechir <bechir.braham@psi.ch>
Co-authored-by: Bechir <bechir.brahem420@gmail.com>

* Dev/xilinx mat update (#959)

* put back code to obtain adc and dac device indexafter loading device tree and then create folder iio_device_links and create symbolic links there according to device indices found. ln -sf operation not permitted, so folder has to be deleted and created everytime. Also refactored definitions to have all the xilinx name or detector specific stuff out of programbyArm.c

* uncommented waittransceiverreset at startup (should work now) and return of powering off chip at startup (error for transceiver alignment reset)

* updated registerdefs from firmware

* minor prints and updating names from registerdefs

* waittransceiverreset has been fixed in firmware and removing warnign for that, transceiver alignment check for powering off chip is not done in fw (giving a warning and returning ok for now)

* fixing ipchecksum (not done), removed startperiphery, allowing readout command to be allowed for xilinx when acquiring

* dont build doc for Tobi Schluter from libzmq, which uses iso-8859-1 and the umlaut cause compilation to fail on some machines (#973)

* 8.0.2 psi modules

* missed the rx_zmqip implementations in detector.h and python bindings (#975)

* rx_zmqip has been removed. Remove it also for pyctbgui (#979)

* format

* Dev/rx callbacks (#966)

* changed rxr callback signatures to all include structs
* removed datamodify call back as size can be changed in the original data call back now
* bringing some parameters (set functions) to dataProcessor class for its callback (namely udpport, quad, fliprows, totalframes, jsonheader), resulting in also removing totalframes from 2 other function signatures

* updated MultiReceiverApp to reflect the new callback signatures

* Dev/reg bit change no validate (#970)

- do not validate write reg, setbit and clearbit by default anymore
- --validate will force validation on the bitmask or entire reg
- remove return value for write reg (across server to client, but thankfully not in the Detector class)
- extend validation into writereg, setbit and clearbit for Eiger (always special)
-  need to check python (TODO)
- missed the rx_zmqip implementations in detector.h and python bindings

* sleep implemented for command line, mainly for config files for firmware developers (#982)

* change gain mode help from dynamicgain to dynamic (#988)

* fixing python version. allowing versions to execute even if no detector connected or in shared memory (#990)

* Jf: Electron collection mode (#983)

* electron collection mode for jungfrau. also removing the config chip when using register command
* collectionMode: HOLE/ELECTRON (enum)

* Dev/m3 readout speed (#985)

* added readoutspeed command to m3 (fullspeed - 10, half speed - 20, quarter speed - 40), removed reaodut pll, moved up system pll clock indices, leaving pll index in common altera code, default speed is half speed, allow only system_c0 to be set, the others can be obtained, same for clkphase, maxclkphaseshift, clkfreq. added to readoutspeedlist commands, updated help and updated tests

* updated readoutspeedlist command

* jf: timing info decoder (#987)

* timing_info_decoder command with options swissfel (default) and shine. added to python, command line generation, autocomplete, tostring, tests.

* updated jungfrau timing info decoder mask (#991)

* minor. removed warning print at startup for empty eth udp to listen to (#992)

* removed 'Caller/CALLER' from test names as there is only one command line now (#993)

* formatting

* Dev/g2 stop frame number (#980)

* get/set next frame number in G2 (firmware only has set, no get)
* firmware has issues: each stop keeps 2 frame header in fifo and the resetting frame number happens after that
* removed the option to set burstmode to burst external or continuwous internal
* needs to be revisited before 9.0.0

* formatting

* fix the command help in the command help generator for Gotthard2 about nextframenumber (#994)

* first draft at fixing nextframenumber properly with firmware (#995)

* fixing nextframenumber properly with firmware

* updated firmware to have getnextframenumber and fixed setnextframenumber to reset also the header fifo when stopping

* fix tests for gotthard2

* Dev/g2 fix next frame number (#996)

* binaries in

* formatting

* release notes

* release notes

* updating firmware dates

* release notes

* package release version and renaming server names

* updated client versioning

* updated moench fw release version

* 900/proper free (#1002)

* first draft of fixing the free function available within the class

* removed class member function freeSharedmemory for both Detector and Module; made the free function freeSharedmemory accessible to python interface; setHostname if there is already a module in shm will recreate the Detector object while freeing shm completely and keeping detsize and intitialchecks (previous commit), sethostname called from DetectorClass in virtual command to have one point of entry (previous commit), testing Module class frees shared memory using free function

* Detector class: added copy and move constructor and assignmentoperators due to explicit destructor (DetectorImpl fwd declared), DetectorImpl class: included ZmqSocket to remove destructor (should not be virtual in any case), Module class: removed explciit destructor to allow compiler generated constructor and operators

* formatting

* updated client version date

* minor fix for readme autocomplete

* setting detsize after hostname should throw also for single module for consistency (#999)

* 900/autocomplete documentation (#1003)

* fixed the gendoc to reflect the new parser, updated documentation to include info about autocomplete in the command line part, error in createing docs

* fixed list deprecated, fixed command help (to show properly on a html, fixed other help warnings

* minor indents

* 900/g2 chip configure at startup (#1008)

* g2: chip reconfigure variable not set when powering on at startup because readconfig is the one configuring the chip the first time to default chip settings

* cleaning up code

* 900/rm volatile (#1006)

* Removing volatile and replacing with atomic to ensure atomicity

* compiling header include issue

* 900/jf firmware rollback (#1010)

* jf: rolling back firmware required to v1.5 and 2.5, updated release notes, fixed a bug when updating server (when server name same as link name:throws with no message, pedestal mode check changed for the time being for loops to be 0xFF size

* compensating for jf fw bug for pedestalmode where loops should be 16 bit, but is 8 bit in fw. to be fixed in next version

* formatting

* fixed python test simulator to kill previous servers

* gui: hide 'complete image' and just show 'missing packets' when there are missing packets in that image form the receiver (#1013)

* release notes update (#1015)

* 900/detach pthreads not joining (#1017)

* detach the pthreads that are not joining else memory leak

* release notes

* removed the clean up comment, also refactored the pthread join/detach for ctb 1g

* 900/server malloc check (#1020)

* usleep in communication to actually relay the err message of memory allocation to the client (weird but test for now), function in server to handle memory allcoation issues (updates mess, ret and sendsit to the client and returns prior from function implementatin, setting fnum in client for the speicific functions that send to detector each argument separtely, they need to remember the fnum else they throw with the incorrect fnum

* server: every malloc must check if it succeeded, rearranging so that the free is clear as well (only in funcs so far)

* formatting

* fixed malloc checks in other places other than funcs.c

* bug fix return from previous commit

* pointer bug from previous commit

* formatting

* binaries in

* 900/document json ctb file format (#1027)

* docs receiver formats rewrite

* added documentation for all the receiver files, updated release notes, udpated help in commands help for timing, fixed by throwing exception for aa dividy by 0 error caused by not freeing memory (detsize) when switching between 1d and 2d detectors, removed unnecessary 'recevier up' printout, fixed dbit list 64 bit mask error in master json file (was not 64 bit before), fixed bug in reading gotthard1 data (needs to be tested)

* generating commands help and formatting, also fix help for trimen command line

* added ctb frame format documentation, added some links to some commands, added documentation about adding expat-devel in installation for rhel8 gui, fixed some indentation issues that screwed up command line help documentation

* added ctb frame format documentation

* updated documentation about zeromq-devel for <8.0.0 versions

* fixed typo in python for vb_pixbuf Jungfrau dac (#1030)

* fixed cli documentation (#1037)

* 900: legal gain values in jungfrau simulator (#1043)

* legal gain values in jungfrau simulator

* typo

* release notes

* 900/jungfrau temp control default enable (#1041)

* jungfrau: enabling temp control by default at server startup

* 900: fixed invalid arguments to slsmultireceiver (#1039)

* wasnt showing error message for invalid arguments to slsmultireceiver
* allow 0 arguments to act like an slsReceiver with start tcp port 1954 and just 1 receiver

* 9.0.0: version from file to cmake and python (#1024)

- renamed conda-recipe folder
- added a check to see if build and install folder exists in build.sh (conda recipe)
- created VERSION file that has '0.0.0'for developer but can be updated using update_version.py that takes in a version. The script checks for semantic versioning and updates VERSION file
- VERSION file also copied along with py files to slsdet in python cmakelist and build_pylib.sh (for conda), also copied in root folder for installations (for no coding purpose)
- init.py and setup.py reads this file to get the version (a bit differently to find the VERSION file)
- VERSION file read into cmake to get the version and also added to compile definition. So RELEASE removed from versionAPI.h (using SLS_DET_VERSION compile definiton instead) and also removed updateRelease script.
- conda getting project version from environment variable SLS_DET_VERSION that is set in build_pylib.sh prior.
- added 3.13 python to conda build
- anything related to ctb removed from release notes as users will always use developer
- sets 9.0.0 to VERSION file  by running update_version.py without an argument

* formatting

* finalized binaries

* updated m3 fw version (#1046)

* release notes

* fix cmake (cannot find VERSION file) when using package as subfolder as cmake_source_dir is not same anymore, add troubleshooting doc for m3 regarding loose control board for waiting status in auto timing mode, fix m3 tests to test register write (previously was read only) (#1047)

* 900: bumped pybind11 version and added setuptools on host (#1050)

* bumped pybind11 version and added setuptools on host

* updated pybind11 tarball to 2.13 and in cmakefile to get 2.13 frpm github, also updated documentation about pybind 2.13

* update release notes, doc

* updating readme

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>

* 900 cmake_source_dir (#1053)

* when package used as subdirectory (cmake-subfolder-example) it fails when python is used because the cmake_source_dir is now the one above package.

* changed cmake_current_list_dir to cmake_current_source_dir

* removing the unnecessary VERSION file installed in the root directory (from PR #1020)

* 900: pybind 2.13.6 and python 3.8 (#1054)

* changed pybind 2.13.0 to 2.13.6, kept conda at min 2.13.0

* changed min python version from 3.6 to 3.8

* 900/docs (#1056)

* minimum python is 3.8, so >=

* removed ctb frame documentation. should be in internal wiki

* updated release notes

* updated releate date

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
Co-authored-by: froejdh_e <erik.frojdh@psi.ch>
Co-authored-by: anberga <34126852+anberga@users.noreply.github.com>
Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
Co-authored-by: Z.H. Li <zhenghenge@gmail.com>
Co-authored-by: Martin Brückner <martin.brueckner@psi.ch>
Co-authored-by: Braham Bechir <braham_b@pc11979.psi.ch>
Co-authored-by: Bechir <bechir.braham@psi.ch>
Co-authored-by: Bechir <bechir.brahem420@gmail.com>
2024-11-26 11:13:45 +01:00
4880f87791 8.0.2.rc (#974)
* moench: changed max shifts of adc clk from 240 to 200 (#909)

* moench server name and version renaming

* 802/moench default speed (#910)

* moench:change default speed to half speed

* Protect from getenv("HOME") returning nullptr  (#907)

* Protect from getenv("HOME") returning nullptr (e.g., in case running in systemd)

* Write proper warning in Module.cpp

* moench: min exptime and also a firmware update required (#911)

* moench server: changed default values of adcphase for full speed from 300 to 150 and dac vipre_cds from 800 to 1280 (#921)

* client bug fix: m3 multi module bad channel file throws bad allocation when modules skipped, needed to add vectors in 2d vector of bad channel list (#919)

* 8.0.2.rc: client: blocking acquire stop with slave temporarily in waiting (#925)

* client: stopping a blocking acquire of multi modules checks status to catch slaves that might still be in waiting. Problem is (gotthard2 25um at least) slave is in waiting only temporarily before going go idle/stopped. So a 50ms sleep is necessary ot not throw an unnecessary error

* client: when stopping blocking acquire, wait up to 1s in 50ms increments for slave to stop waiting temporarily

* fix to rapidjson for build with gcc 14 (#928)

* 8.0.2.rc: m3 clkdiv0 20 (#923)

* m3: clk 0 changed from 10 to 20 (100MHz to 50MHz)

* g2: startup clk div back to 10 as in firmware but setting in software startup to 20

* 8.0.2.rc: moench empty data callback (#935)

* moench: empty data call back so that zmq sockets are still made and listened to in acquire that it waits for the dummy packet to be done

* moench zmq postprocessor: remove NEWZMQ ifdefs and remove connect for publisher socket

* changed enum from READOUT_ACTION_ZMQ to READOUT_ZMQ_ACTION for consistency

* 8.0.2.rc: client: status for blocking acquire stop with slave temporarily in waiting (#943)

* acq finish call back gets status squashed with default error but before that need to wait for gotthard slaves to catch up from waiting to stopped

* bug fixes related to file saving (#931)

* fix the file path resetting issue of GUI in the case where different modules have different fpath setting.

* fix stack-buffer-overflow issue when using HDF5 HDF5DataFile::parameterDataTypes have 64bit type (i.e. STD_U64LE), the size of fill_value should be at least 8 bytes.

* change the type of fill_value to uint64_t

* updated documentation from martin (#947)

* 802: jungfrau HW 1.0: adc output clock phase to 120  (#951)

* jungfrau: change adc output clock phase from 180 to 120 for v1.0 boards for reliable readout of adc #2

* formatting

* 802/release notes (#954)

* updated release notes

* versioning

* fixed a warning about narrowing conversion from size_t to int (#962)

* updating client versioning

* dont build doc for Tobi Schluter from libzmq, which uses iso-8859-1 and the umlaut cause compilation to fail on some machines (#972)

* updated release notes

---------

Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
Co-authored-by: Z.H. Li <zhenghenge@gmail.com>
2024-09-17 09:44:14 +02:00
97f0c1fe46 8.0.1.rc (#891)
* forward declare zmq_msg_t and moved include

* removed zmq as dependency for slsdet (#870)

* Fixed path when building as submodule

* new moench data structure for offline processing

* meonch raw data and zmq process files updated to 7.0.3 version

* implemented config file for Zmq file

* raw data and zmq work with config file, but only with one file/interface

* zmq config change

* added config examples for zmq and rawdata

* update release notes, release versions

---------

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
Co-authored-by: froejdh_e <erik.frojdh@psi.ch>
Co-authored-by: Anna Bergamaschi <anna.bergamaschi@psi.ch>
Co-authored-by: anberga <34126852+anberga@users.noreply.github.com>
2024-01-16 15:31:25 +01:00
a86fd00e59 Merge branch 'main' into 8.0.0.rc 2023-11-13 16:38:25 +01:00
24894667b7 release fw for ctb 2023-11-13 16:03:52 +01:00
4b414bfddb release notes 2023-11-12 15:39:58 +01:00
15d357d9ab release notes 2023-11-12 15:32:28 +01:00
f95de054f9 formatting 2023-11-12 15:29:34 +01:00
0aef8113dd documentation and examples 2023-11-12 15:11:36 +01:00
9785a41048 Merge branch '8.0.0.rc' of github.com:slsdetectorgroup/slsDetectorPackage into 8.0.0.rc 2023-11-10 17:29:47 +01:00
417e1a88a5 fixed doc 2023-11-10 17:29:35 +01:00
9c0dd0385d updating docs 2023-11-10 16:02:21 +01:00
5ab64efe3e added python 3.12 to the conda build variants 2023-11-10 14:18:38 +01:00
8f77e4d4fe added python 3.12 to the conda build variants 2023-11-10 14:17:40 +01:00
41c5b75b10 trigger signal issues handled at acquire (#862)
* 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:24:18 +01:00
bfe53c6693 udpated release notes 2023-11-09 15:10:17 +01:00
f7997dd09a 8.0.0.rc: fix server logic in checking detector idle (#860)
* fix buggy logic in checking detector idle and an argument check
2023-11-09 15:07:03 +01:00
c64e87a2b6 7.0.3.rc: fix server logic in checking detector idle (#859)
* fix buggy logic in checking detector idle and an argument check
2023-11-09 14:21:11 +01:00
5eeb8e29c1 project version change 2023-11-08 17:31:29 +01:00
09697fa325 updated release notes 2023-11-08 17:30:07 +01:00
90b4daef39 updated release notes 2023-11-08 17:28:48 +01:00
2082f1eee7 updated release notes 2023-11-08 17:28:17 +01:00
d3a636b563 updated release notes 2023-11-08 17:24:56 +01:00
50b9b6ca39 update release notes 2023-11-08 14:14:04 +01:00
e86b57cdfc versioning, format, release notes, update test simulator (no need for psutil) 2023-11-08 12:12:17 +01:00
14e11e8b5b formatting and versioning 2023-11-08 11:43:09 +01:00
beafe86554 execute command inside server fixed (from fix simulator tests and exec command PR) (#856) 2023-11-08 09:26:00 +01:00
af3dc1e7f4 7.0.3.rc: execute command inside server fixed (from fix simulator tests and exec command PR) (#855)
* execute command inside server fixed (from fix simulator tests and exec command PR)
2023-11-08 09:25:52 +01:00
573177203b formatting 2023-11-07 14:51:15 +01:00
a3ca9ebce5 updating release notes 2023-11-07 14:35:42 +01:00
8174fc9691 Update RELEASE.txt 2023-11-07 12:34:10 +01:00
d6eac6da71 updated release notes 2023-11-07 11:22:09 +01:00
56c7ae4852 8.0.0.rc: fix py virtual test (#841)
* 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:24 +01:00
9b9b09ceaf 703rc/tests/fix execute command (#842)
* fix execute command
* fix for tests for ctb
2023-11-07 09:29:48 +01:00
cfebaee2a5 handling inconsistent fnums to be -1 in gui, so when one sets 0 (change of value) will also give an exception (#853) 2023-11-06 16:11:40 +01:00
4613c54f57 handling inconsistent fnums to be -1 in gui, so when one sets 0 (change of value) will also give an exception (#852) 2023-11-06 16:11:25 +01:00
51f9d6f011 8.0.0rc: : gui acq finished callback for different status (#851)
* 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:23 +01:00
58ac7ac280 7.0.3.rc: gui acq finished callback for different status (#847)
* 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:07:38 +01:00
82edfa75d3 7.0.3.rc: process the raw data files as a list (#848)
* Added file list option for moenchRawDataProcess
2023-11-03 12:10:20 +01:00
35ed926047 formatting 2023-10-25 09:36:51 +02:00
4023ed0775 updated versioning 2023-10-25 09:36:04 +02:00
b6ef3bc39e updated release notest 2023-10-25 09:15:10 +02:00
2035666792 versioning and binaries updated 2023-10-25 08:43:23 +02:00
1ff4d806e7 minor 2023-10-25 08:25:02 +02:00
3861379653 updated release notes 2023-10-24 17:39:47 +02:00
91140bbb71 formatting 2023-10-24 11:17:18 +02:00
a5632fcbea fix warning for prev_val (variable size array) in tests (#837) 2023-10-23 15:55:13 +02:00
d44329117d fix warning for prev_val (variable size array) in tests (#836) 2023-10-23 15:52:59 +02:00
4a454aa698 tests for jf (#835) 2023-10-19 16:55:29 +02:00
0e43072db8 eiger required fw version to 32: fix for blocking trigger in quad (#833) 2023-10-18 17:04:26 +02:00
6c67025ea8 7.0.3.rc eiger: fw version to 32 (quad blocking trigger) (#832)
* eiger required fw version to 32: fix for blocking trigger in quad
2023-10-18 16:51:17 +02:00
e5ee27dbfa 8.0.0.rc jf: reconfigure chip when touching electron collection mode bit (#830)
* 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:49:44 +02:00
601249cc71 8.0.0.rc jf: change status reg bits (#828)
* 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:36:56 +02:00
ff60b8c379 8.0.0.rc: jf sync: stopping master gives idle (#823)
* 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

* stop on only the positions

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-10-13 15:25:19 +02:00
37ce3d6f59 7.0.3.rc: jf sync: stopping master gives idle (#822)
* 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 ( not jungfrau, but eiger could)

* 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

* stop on only the positions

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-10-13 12:27:43 +02:00
bf26533fd8 8.0.0.rc: jf fix pedestal (#820)
* jf pedestal fix: touch enable bit last
2023-10-05 10:28:51 +02:00
7106273521 update 2d gain plot (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 (#817) 2023-10-03 17:22:14 +02:00
1484d038de 7.03.rc: 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 (#818) 2023-10-03 17:22:03 +02:00
fb0090c79e removing the misleading word 'Simulating' when programmig fpga (#814) 2023-09-28 16:20:59 +02:00
adc68cd519 formatting 2023-09-28 15:51:40 +02:00
1566eef247 703rc/fix numeric limits (#812)
* fixed compilation for fedora for numeric_limits

* formatting
2023-09-28 10:49:02 +02:00
e7cd90db78 fixed crashing of moench03RawDataProcess when nframes>0 (#810) 2023-09-27 09:22:40 +02:00
45414149fe binaries in for the previous PR 2023-09-22 15:59:35 +02:00
48759f440e 703rc/fix port size (#802)
* validate port numbers in client

* validate port numbers created at virtual servers and receiver process as tcp ports
2023-09-18 08:59:53 +02:00
b367b7e431 fixed some interpolation issues (#796) 2023-08-28 13:38:19 +02:00
f0b2a6f6f9 update release notes 2023-08-25 14:02:50 +02:00
f761046bfc updated docs and versions 2023-07-12 16:50:13 +02:00
1a859b83db formatting 2023-07-12 16:06:31 +02:00
70bfc875a6 updating release notes 2023-07-11 17:02:27 +02:00
c0755308a4 updating release notes 2023-07-11 17:01:14 +02:00
ab5509e10c updating release notes 2023-07-11 17:00:42 +02:00
004cb26646 updated firmware versions for 7.0.2 2023-07-10 12:21:19 +02:00
a4f47a5945 synced master status running when setting to slave (#747)
* jf: unsync before setting master/slave and then sync (if it was set) to overcome master going into running state when making it a slave and synced

* add tests for this condition

* updated release notes, updated min fw version requirement for v1.0 boards
2023-05-25 11:04:05 +02:00
312f3f473d fix that only master starts second and not all (for start acq), typo with pos and masters list (#743) 2023-05-11 10:20:17 +02:00
5871086cd6 formatting 2023-05-08 17:04:04 +02:00
6a0fe823b3 enable fix g0 when in expert mode (when gain mode enabled and not just visible) (#736) 2023-05-08 14:20:21 +02:00
5912aae53e Rx roi zmq (#726)
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 12:23:05 +02:00
8833ccf5cc 7.0.2.rc (#721)
* 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>
2023-05-08 12:11:19 +02:00
77c558a7be formatting 2023-03-24 12:54:55 +01:00
378fc301b8 updating client version, release version and project_version in CMakeLists.txt 2023-03-23 15:43:17 +01:00
87d6e16090 7.0.1 fix det server version (#702)
* check server version before initial checks, catch old server version exception, get old server version as 64 bit and print it along with exception
2023-03-23 15:37:01 +01:00
2ef021041c rx_arping sigchld (#701)
* rx_arping pclose gave -1 due to sigchld being ignored, fixed with sig handler doing a wait
2023-03-23 13:58:40 +01:00
574127b5ac fix hdf5 compilation using det spec fields in header (#700)
* fix hdf5 compilation using det spec fields in header
2023-03-23 12:30:38 +01:00
120 changed files with 2534 additions and 1297 deletions

View File

@ -2,7 +2,15 @@
# Copyright (C) 2021 Contributors to the SLS Detector Package
cmake_minimum_required(VERSION 3.14)
project(slsDetectorPackage)
set(PROJECT_VERSION 9.0.0)
# Read VERSION file into project version
set(VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/VERSION")
file(READ "${VERSION_FILE}" VERSION_CONTENT)
string(STRIP "${VERSION_CONTENT}" PROJECT_VERSION_STRING)
set(PROJECT_VERSION ${PROJECT_VERSION_STRING})
# Pass it to the compiler
add_compile_definitions(SLS_DET_VERSION="${PROJECT_VERSION}")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
@ -296,19 +304,20 @@ if (SLS_USE_INTEGRATION_TESTS)
endif (SLS_USE_INTEGRATION_TESTS)
if (SLS_USE_PYTHON)
find_package (Python 3.6 COMPONENTS Interpreter Development)
find_package (Python 3.8 COMPONENTS Interpreter Development)
if(SLS_FETCH_PYBIND11_FROM_GITHUB)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v2.11.0
GIT_TAG v2.13.6
)
else()
# https://github.com/pybind/pybind11/releases
FetchContent_Declare(
pybind11
URL ${CMAKE_SOURCE_DIR}/libs/pybind11/v2.11.0.tar.gz
URL_HASH MD5=90c4946e87c64d8d8fc0ae4edf35d780
URL ${CMAKE_CURRENT_SOURCE_DIR}/libs/pybind11/v2.13.6.tar.gz
URL_HASH MD5=a04dead9c83edae6d84e2e343da7feeb
)
endif()
FetchContent_MakeAvailable(pybind11)
@ -346,4 +355,4 @@ if(SLS_MASTER_PROJECT)
set(CMAKE_INSTALL_DIR "share/cmake/${PROJECT_NAME}")
set(PROJECT_LIBRARIES slsSupportShared slsDetectorShared slsReceiverShared)
include(cmake/package_config.cmake)
endif()
endif()

124
README.md
View File

@ -2,7 +2,11 @@
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.
## 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).
Detailed documentation including installation can be found in the [software wiki](https://slsdetectorgroup.github.io/devdoc/index.html).
Different releases can be found on the [official site](https://www.psi.ch/en/lxn/software-releases).
Firmware compatiblity can be found in [firmware page](https://github.com/slsdetectorgroup/slsDetectorFirmware)
## Installation
@ -42,33 +46,20 @@ conda search slsdet
conda search slsdetgui
```
### 2. Build from source
## 2. Build from source
##### 2.1 Download Source Code from github
### 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.
```
# 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
```
##### 2.2 Build from source
> **Note:** For v6.x.x of slsDetectorPackage and older, refer [pybind11 notes on cloning](#Pybind-and-Zeromq).
###### Build using CMake
### 2.2 Build from source
### Build using CMake
```
# outside slsDetecorPackage folder
@ -94,26 +85,28 @@ Instead of the cmake command, one can use ccmake to get a list of options to con
ccmake ..
# choose the options
# first press [c] - configure
# first press [c] - configure (unil you see [g])
# 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 |
| -DPython_FIND_VIRTUALENV=ONLY | Python from only 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 [zeromq notes for cmake option to hint library location](#Pybind-and-Zeromq).
###### Build using in-built cmk.sh script
### 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]
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
@ -128,14 +121,13 @@ Usage: ./cmk.sh [-b] [-c] [-d <HDF5 directory>] [e] [g] [-h] [i] [-j <Number of
-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
# display all options
./cmk.sh -?
@ -145,11 +137,14 @@ Usage: ./cmk.sh [-b] [-c] [-d <HDF5 directory>] [e] [g] [-h] [i] [-j <Number of
# new build, python and compile in parallel:
./cmk.sh -cbpj5
#To use the system zmq (/usr/lib64) instead
./cmk.sh -cbj5 -q /usr/lib64
#For rebuilding only certain sections
./cmk.sh -tg #only text client and gui
./cmk.sh -r #only receiver
```
###### Build on old distributions
> **Note:** For v7.x.x of slsDetectorPackage and older, refer [zeromq notes for cmk script option to hint library location](#Pybind-and-Zeromq).
### 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
@ -166,7 +161,10 @@ cmake ../slsDetectorPackage -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
make -j12
```
###### Build slsDetectorGui (Qt5)
> **Note:** For v7.x.x of slsDetectorPackage and older, refer [zeromq notes for dependencies for conda](#Pybind-and-Zeromq).
### Build slsDetectorGui (Qt5)
1. Using pre-built binary on conda
```
@ -180,7 +178,14 @@ yum install qt5-qtbase-devel.x86_64
yum install qt5-qtsvg-devel.x86_64
```
3. Using conda
3. Using system installation on RHEL8
```
yum install qt5-qtbase-devel.x86_64
yum install qt5-qtsvg-devel.x86_64
yum install expat-devel.x86_64
```
4. Using conda
```
#Add channels for dependencies and our library
conda config --add channels conda-forge
@ -208,13 +213,15 @@ cd slsDetectorPackage
./cmk.sh -cbgj9
```
###### Build documentation from package
> **Note:** For v7.x.x of slsDetectorPackage and older, refer [zeromq notes for dependencies for conda](#Pybind-and-Zeromq).
### 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
conda create -n myenv python=3.12 sphinx sphinx_rtd_theme breathe doxygen numpy
```
```
@ -228,6 +235,47 @@ make rst # rst only, saves time in case the API did not change
```
## Pybind and Zeromq
### Pybind11 for Python
**v8.0.0+**:
pybind11 is built
* by default from tar file in repo (libs/pybind/v2.1x.0.tar.gz)
* or use advanced option SLS_FETCH_PYBIND11_FROM_GITHUB [link].
* v9.0.0+: pybind11 (v2.13.6)
* v8.x.x : pybind11 (v2.11.0)
**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.
```
# 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
**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].
**v7.x.x and older**:
zeromq-devel 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
## Support
dhanya.thattil@psi.ch
erik.frojdh@psi.ch
erik.frojdh@psi.ch

View File

@ -1,34 +1,285 @@
SLS Detector Package Major Release x.x.x released on xx.xx.202x
SLS Detector Package Major Release 9.0.0 released on 26.11.2024
===============================================================
This document describes the differences between vx.x.x and vx.0.2
This document describes the differences between v9.0.0 and v8.0.2
CONTENTS
--------
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 Compilation Changes
2 New or Changed Features
2.1 Breaking API
2.2 Resolved or Changed Features
2.3 New Features
3 On-board Detector Server Compatibility
4 Firmware Requirements
5 Kernel Requirements
6 Download, Documentation & Support
1 New, Changed or Resolved Features
2 Compilation Changes
=====================
* Python version
Minimum python version is changed from 3.6 to 3.8
* Pybind11 version
In-built version and the one picked up from github
updated from v2.11.0 to v2.13.6
* Python lib versioning
slsdet.__version__ now returns the package release version.
* Python version in conda build
Added python 3.13 also to conda build
2 New, Changed or Resolved Features
=====================================
2.1 Breaking API
==================
Receiver
--------
* Receiver callbacks
Brought much more metadata to receiver callbacks to construct the image.
Update MultiReceiverApp to reflect this change.
* File path
At start of acquisition or at rx_start command, the file path is only
then verified if it exists and created if it does not.
Client
------
* Removed receiver/publisher ZMQ IP
Command line: rx_zmqip gives a warning and does nothing
Python : rx_zmqip removed
C++ API: get/setRxZmqIP removed
Publisher zmq IP set to '0.0.0.0' or to listen on all interfaces.
The publisher will determine which interface to stream out from based on
the network route to the subscriber IP. Hence, receiver zmq IP is not
required.
* Write register, Set or Clear bit
Validation for this advanced feature has been removed by default.
One can force validation by using --validate in the command line or by
setting the validate option in the API.
ZMQ
---
* Publisher socket constructor does not take an IP anymore.
The details are above under 'Removed receiver/publisher ZMQ IP'.
GUI/ Client Callback
--------------------
* completeImage member in detectorData attribute now returns false only
if any the sub images (from different udp ports) have completeImage
set to false in the JSON header. This is set if therea are any missing
packets for that udp port on slsReceiver/slsMultiReceiver.
The different subimages are anyway not synchronized. This errs when
there are different missing images across multiple UDP ports.
The Gui does not show "complete image" in the status bar anymore.
If any of the udp ports have missing packets for that current disaplayed
image, then the "missing packets" will show in red in the status bar.
Detector Server
---------------
* [Mythen3] Only run clock can be set
Clock 0 is now the run clock and the only one that can be set.
The others are be read only.
This affects the following commands:
Command line or python API: clkdiv, clkfreq, clkphase, maxclkphaseshift
C++ API: get/setClockDivider, getClockFrequency, get/setClockPhase,
getMaxClockPhaseShift
* [Jungfrau] Temperature Control
Temperature control is enabled by default at on-board detector server
startup.
As before, the default temperature threshold is 65°C and crossing this
value will set a temperature event.
2.2 Resolved or Changed Features
================================
Compilation
-----------
* cmake_source_dir
Fixed compilation error when using python and adding the slsDetectorPackage
as a subfolder due to cmake source directory changing.
Client
------
* Command line Code Generation
The command line parsing code is now generated from a yaml file. This is
transparent to the user.
* Clearer error message about freeing shared memory.
Detector Server
---------------
* [Gotthard2] Chip reconfiguration
- Powering off/on the chip will now switch off chip configuration
property/ configure the chip every time.
- Switching off high voltage from a non zero value will now wait
10s to return for safety reasons.
- Powering off the chip requires high voltage to have been
switched off prior.
- Acquisition requires chip to have been configured prior.
* [Gotthard2] Burst mode options restricted
Burst mode external and continuous mode internal are not allowed to be set
anymore as they are anyway not implemented.
Receiver
--------
* [Gotthard I] fixed header stripping fixing segfault.
* Error or help message for invalid arguments to slsMultiReceiver.
Simulator
---------
* Refactored stop server to have better start up.
* Fixed possible memory leak when taking non blocking acquisitions.
* [Jungfrau] Valid gain values in data sent out. Previously, 2 was also sent out.
ZMQ
---
* Publiser socket constructor
- enables keep alive socket options to send heartbeat messages to prevent
discarded TCP flows if there is no packet for a longer period.
- enables IPv6 interfaces
* Prints specific error for ENOENT (endpoint does not exist)
2.3 New Features
================
Client
------
* Auto completion
bash_autocomplete.sh or zsh_autocomplete.sh must be sourced from the
main package folder to enable auto completion of commands and arguments
for the command line on that shell.
* sls_detector
New executable that can be used instead of 'sls_detector_get' and
'sls_detector_put' for most commands. It will infer from the number of
arguments, which executable (sls_detector_put or sls_detector_get) to use.
For the rare commands that cannot be inferred from the number of arguments,
it will complain accordingly.
* [Jungfrau] Timing Info Decoder (Advanced configuration)
Command line or python API: timing_info_decoder
C++ API: get/setTimingInfoDecoder. Options: SWISSFEL (Default), SHINE
* [Jungfrau] Collection Mode (Advanced configuration)
Command line or python API: collectionmode
C++ API: get/setCollectionMode. Options: ELECTRON, HOLE (Default)
If chip v1.1, also configures the chip afterwards.
* [Gotthard2] Next frame number
'Stop' in G2 25um is not synchronous and hence might trigger an extra set
of frames in the slave module, resulting in the next acquiistion starting
with inconsistent frame numbers between master and slave. Solved by
setting next frame number to the larger value (max + 1) after a stop command.
Requires a firmware update.
Command line or python API: nextframenumber
C++ API: get/setNextFrameNumber
Can set/get the starting frame number for the next acquistion.
* [Mythen3] Readout speed
Command line, python API: readoutspeed. Options: full_speed (10MHz),
half_speed (20MHz, default), quarter_speed (40MHz)
C++ API: get/setReadoutSpeed
Also affect:
Command line, python API: readoutspeedlist
C++ API: getReadoutSpeedList
* Sleep
Command line, python/ C++ API: sleep
Client sleeps for required time. Advanced command mainly for firmware
developers to use in config files.
* Xilinx Chip Test Board added
2 On-board Detector Server Compatibility
@ -66,14 +317,14 @@ This document describes the differences between vx.x.x and vx.0.2
Eiger 02.10.2023 (v32) (updated in 7.0.3)
Jungfrau 01.10.2024 (v1.6, HW v1.0) (updated in 9.0.0)
01.10.2024 (v2.6, HW v2.0) (updated in 9.0.0)
Jungfrau 20.09.2023 (v1.5, HW v1.0) (updated in 8.0.0)
21.09.2023 (v2.5, HW v2.0) (updated in 8.0.0)
Mythen3 11.10.2024 (v1.5) (updated in 9.0.0)
Mythen3 13.11.2024 (v2.0) (updated in 9.0.0)
Gotthard2 03.10.2024 (v1.0) (updated in 9.0.0)
Moench 26.10.2023 (v2.0) (updated in 9.0.0)
Moench 26.10.2023 (v2.0) (updated in 8.0.2)
Gotthard 08.02.2018 (50um and 25um Master)
09.02.2018 (25 um Slave)
@ -109,7 +360,6 @@ This document describes the differences between vx.x.x and vx.0.2
4 Kernel Requirements
======================
Blackfin
--------
Latest version: Fri Oct 29 00:00:00 2021
@ -117,12 +367,10 @@ This document describes the differences between vx.x.x and vx.0.2
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
@ -211,4 +459,4 @@ This document describes the differences between vx.x.x and vx.0.2
-------
dhanya.thattil@psi.ch
erik.frojdh@psi.ch
erik.frojdh@psi.ch

1
VERSION Normal file
View File

@ -0,0 +1 @@
9.0.0

View File

@ -1,8 +1,12 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
mkdir build
mkdir install
if [ ! -d "build" ]; then
mkdir build
fi
if [ ! -d "install" ]; then
mkdir install
fi
cd build
cmake .. \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \

View File

@ -2,5 +2,10 @@
# Copyright (C) 2021 Contributors to the SLS Detector Package
echo "|<-------- starting python build"
cd python
${PYTHON} setup.py install
# copy VERSION into slsdet for installation
cp ../VERSION slsdet/VERSION
${PYTHON} setup.py install

View File

@ -4,4 +4,5 @@ python:
- 3.10
- 3.11
- 3.12
- 3.13

View File

@ -1,15 +1,15 @@
package:
name: sls_detector_software
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
source:
- path: ..
path: ..
build:
number: 0
binary_relocation: True
rpaths:
rpaths:
- lib/
requirements:
@ -61,13 +61,11 @@ outputs:
- libstdcxx-ng
- libgcc-ng
run:
- libstdcxx-ng
- libgcc-ng
- name: slsdet
script: build_pylib.sh
requirements:
@ -77,12 +75,13 @@ outputs:
- {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }}
- setuptools
- pybind11=2.11
- pybind11=2.13
host:
- python
- {{ pin_subpackage('slsdetlib', exact=True) }}
- pybind11=2.11
- setuptools
- pybind11=2.13
run:
@ -92,11 +91,11 @@ outputs:
- numpy
- {{ pin_subpackage('slsdetlib', exact=True) }}
test:
imports:
- slsdet
- name: slsdetgui
script: copy_gui.sh
requirements:

View File

@ -58,6 +58,12 @@ set(SPHINX_SOURCE_FILES
src/udpheader.rst
src/udpconfig.rst
src/udpdetspec.rst
src/fileformat.rst
src/slsreceiverheaderformat.rst
src/masterfileattributes.rst
src/binaryfileformat.rst
src/hdf5fileformat.rst
src/zmqjsonheaderformat.rst
)
foreach(filename ${SPHINX_SOURCE_FILES})

View File

@ -0,0 +1,438 @@
Binary File Format
====================
This is the default file format that can be configured using command `fformat <commandline.html#term-fformat-binary-hdf5>`_.
.. code-block:: bash
sls_detector_put fformat binary
Master File
--------------
* File Name: [fpath]/[fname]_master_[findex].json :ref:`Details here<file name format>`
* It is in json format and created for every acquisition.
* It contains :ref:`attributes<master file attributes>` relevant to the acquisition. This can vary with detector type shown in :ref:`master json file examples <json master file examples>` here.
* It shows the :ref:`**SLS Receiver Header** <sls receiver header format>` format used in data files.
* Enabled/disabled using command `fmaster <commandline.html#term-fmaster-0-1>`_.
Data File
----------
* File Name: [fpath]/[fname]_dx_fy_[findex].raw :ref:`Details here<file name format>`
* It store multiple frames sequentially, with total number of frames determined by `rx_framesperfile <commandline.html#term-rx_framesperfile-n_frames>`_ parameter.
* Each frame includes a :ref:`**sls_receiver_header** <sls receiver header format>` structure, followed by the actual frame data.
.. _json master file examples:
JSON Master File Examples
---------------------------------------------------
Eiger
^^^^^
.. code-block:: text
{
"Version": 7.2,
"Timestamp": "Wed Nov 13 15:46:30 2024",
"Detector Type": "Eiger",
"Timing Mode": "auto",
"Geometry": {
"x": 2,
"y": 1
},
"Image Size in bytes": 262144,
"Pixels": {
"x": 512,
"y": 256
},
"Max Frames Per File": 10000,
"Frame Discard Policy": "nodiscard",
"Frame Padding": 1,
"Scan Parameters": "[disabled]",
"Total Frames": 1,
"Receiver Roi": {
"xmin": 4294967295,
"xmax": 4294967295,
"ymin": 4294967295,
"ymax": 4294967295
},
"Dynamic Range": 16,
"Ten Giga": 0,
"Exptime": "1s",
"Period": "1s",
"Threshold Energy": -1,
"Sub Exptime": "2.62144ms",
"Sub Period": "2.62144ms",
"Quad": 0,
"Number of rows": 256,
"Rate Corrections": "[0]",
"Frames in File": 1,
"Frame Header Format": {
"Frame Number": "8 bytes",
"SubFrame Number/ExpLength": "4 bytes",
"Packet Number": "4 bytes",
"Bunch ID": "8 bytes",
"Timestamp": "8 bytes",
"Module Id": "2 bytes",
"Row": "2 bytes",
"Column": "2 bytes",
"Reserved": "2 bytes",
"Debug": "4 bytes",
"Round Robin Number": "2 bytes",
"Detector Type": "1 byte",
"Header Version": "1 byte",
"Packets Caught Mask": "64 bytes"
}
}
Jungfrau
^^^^^^^^
.. code-block:: text
{
"Version": 7.2,
"Timestamp": "Wed Nov 13 13:03:53 2024",
"Detector Type": "Jungfrau",
"Timing Mode": "auto",
"Geometry": {
"x": 1,
"y": 1
},
"Image Size in bytes": 1048576,
"Pixels": {
"x": 1024,
"y": 512
},
"Max Frames Per File": 10000,
"Frame Discard Policy": "nodiscard",
"Frame Padding": 1,
"Scan Parameters": "[disabled]",
"Total Frames": 1000,
"Receiver Roi": {
"xmin": 4294967295,
"xmax": 4294967295,
"ymin": 4294967295,
"ymax": 4294967295
},
"Exptime": "10us",
"Period": "2ms",
"Number of UDP Interfaces": 1,
"Number of rows": 512,
"Frames in File": 10,
"Frame Header Format": {
"Frame Number": "8 bytes",
"SubFrame Number/ExpLength": "4 bytes",
"Packet Number": "4 bytes",
"Bunch ID": "8 bytes",
"Timestamp": "8 bytes",
"Module Id": "2 bytes",
"Row": "2 bytes",
"Column": "2 bytes",
"Reserved": "2 bytes",
"Debug": "4 bytes",
"Round Robin Number": "2 bytes",
"Detector Type": "1 byte",
"Header Version": "1 byte",
"Packets Caught Mask": "64 bytes"
}
}
Gotthard2
^^^^^^^^^^^^
.. code-block:: text
{
"Version": 7.2,
"Timestamp": "Wed Nov 13 14:18:17 2024",
"Detector Type": "Gotthard2",
"Timing Mode": "auto",
"Geometry": {
"x": 1,
"y": 1
},
"Image Size in bytes": 2560,
"Pixels": {
"x": 1280,
"y": 1
},
"Max Frames Per File": 20000,
"Frame Discard Policy": "nodiscard",
"Frame Padding": 1,
"Scan Parameters": "[disabled]",
"Total Frames": 10,
"Receiver Roi": {
"xmin": 4294967295,
"xmax": 4294967295,
"ymin": 4294967295,
"ymax": 4294967295
},
"Exptime": "0ns",
"Period": "0ns",
"Burst Mode": "burst_internal",
"Frames in File": 10,
"Frame Header Format": {
"Frame Number": "8 bytes",
"SubFrame Number/ExpLength": "4 bytes",
"Packet Number": "4 bytes",
"Bunch ID": "8 bytes",
"Timestamp": "8 bytes",
"Module Id": "2 bytes",
"Row": "2 bytes",
"Column": "2 bytes",
"Reserved": "2 bytes",
"Debug": "4 bytes",
"Round Robin Number": "2 bytes",
"Detector Type": "1 byte",
"Header Version": "1 byte",
"Packets Caught Mask": "64 bytes"
}
}
Mythen3
^^^^^^^
.. code-block:: text
{
"Version": 7.2,
"Timestamp": "Wed Nov 13 14:39:14 2024",
"Detector Type": "Mythen3",
"Timing Mode": "auto",
"Geometry": {
"x": 1,
"y": 1
},
"Image Size in bytes": 15360,
"Pixels": {
"x": 3840,
"y": 1
},
"Max Frames Per File": 10000,
"Frame Discard Policy": "nodiscard",
"Frame Padding": 1,
"Scan Parameters": "[disabled]",
"Total Frames": 1,
"Receiver Roi": {
"xmin": 4294967295,
"xmax": 4294967295,
"ymin": 4294967295,
"ymax": 4294967295
},
"Dynamic Range": 32,
"Ten Giga": 1,
"Period": "2ms",
"Counter Mask": "0x7",
"Exptime1": "0.1s",
"Exptime2": "0.1s",
"Exptime3": "0.1s",
"GateDelay1": "0ns",
"GateDelay2": "0ns",
"GateDelay3": "0ns",
"Gates": 1,
"Threshold Energies": "[-1, -1, -1]",
"Frames in File": 1,
"Frame Header Format": {
"Frame Number": "8 bytes",
"SubFrame Number/ExpLength": "4 bytes",
"Packet Number": "4 bytes",
"Bunch ID": "8 bytes",
"Timestamp": "8 bytes",
"Module Id": "2 bytes",
"Row": "2 bytes",
"Column": "2 bytes",
"Reserved": "2 bytes",
"Debug": "4 bytes",
"Round Robin Number": "2 bytes",
"Detector Type": "1 byte",
"Header Version": "1 byte",
"Packets Caught Mask": "64 bytes"
}
}
Moench
^^^^^^
.. code-block:: text
{
"Version": 7.2,
"Timestamp": "Wed Nov 13 14:41:32 2024",
"Detector Type": "Moench",
"Timing Mode": "auto",
"Geometry": {
"x": 1,
"y": 1
},
"Image Size in bytes": 320000,
"Pixels": {
"x": 400,
"y": 400
},
"Max Frames Per File": 100000,
"Frame Discard Policy": "discardpartial",
"Frame Padding": 1,
"Scan Parameters": "[disabled]",
"Total Frames": 1,
"Receiver Roi": {
"xmin": 4294967295,
"xmax": 4294967295,
"ymin": 4294967295,
"ymax": 4294967295
},
"Exptime": "10us",
"Period": "2ms",
"Number of UDP Interfaces": 1,
"Number of rows": 400,
"Frames in File": 1,
"Frame Header Format": {
"Frame Number": "8 bytes",
"SubFrame Number/ExpLength": "4 bytes",
"Packet Number": "4 bytes",
"Bunch ID": "8 bytes",
"Timestamp": "8 bytes",
"Module Id": "2 bytes",
"Row": "2 bytes",
"Column": "2 bytes",
"Reserved": "2 bytes",
"Debug": "4 bytes",
"Round Robin Number": "2 bytes",
"Detector Type": "1 byte",
"Header Version": "1 byte",
"Packets Caught Mask": "64 bytes"
}
}
Gotthard I
^^^^^^^^^^^
.. code-block:: text
{
"Version": 7.2,
"Timestamp": "Wed Nov 13 15:16:19 2024",
"Detector Type": "Gotthard",
"Timing Mode": "auto",
"Geometry": {
"x": 1,
"y": 1
},
"Image Size in bytes": 2560,
"Pixels": {
"x": 1280,
"y": 1
},
"Max Frames Per File": 20000,
"Frame Discard Policy": "nodiscard",
"Frame Padding": 1,
"Scan Parameters": "[disabled]",
"Total Frames": 1,
"Receiver Roi": {
"xmin": 4294967295,
"xmax": 4294967295,
"ymin": 4294967295,
"ymax": 4294967295
},
"Exptime": "1.00001ms",
"Period": "1s",
"Detector Roi": {
"xmin": 4294967295,
"xmax": 4294967295
},
"Frames in File": 1,
"Frame Header Format": {
"Frame Number": "8 bytes",
"SubFrame Number/ExpLength": "4 bytes",
"Packet Number": "4 bytes",
"Bunch ID": "8 bytes",
"Timestamp": "8 bytes",
"Module Id": "2 bytes",
"Row": "2 bytes",
"Column": "2 bytes",
"Reserved": "2 bytes",
"Debug": "4 bytes",
"Round Robin Number": "2 bytes",
"Detector Type": "1 byte",
"Header Version": "1 byte",
"Packets Caught Mask": "64 bytes"
}
}
Chip Test Board
^^^^^^^^^^^^^^^
.. code-block:: text
{
"Version": 7.2,
"Timestamp": "Wed Nov 13 15:32:59 2024",
"Detector Type": "ChipTestBoard",
"Timing Mode": "auto",
"Geometry": {
"x": 1,
"y": 1
},
"Image Size in bytes": 48018,
"Pixels": {
"x": 3,
"y": 1
},
"Max Frames Per File": 20000,
"Frame Discard Policy": "nodiscard",
"Frame Padding": 1,
"Scan Parameters": "[disabled]",
"Total Frames": 1,
"Receiver Roi": {
"xmin": 4294967295,
"xmax": 4294967295,
"ymin": 4294967295,
"ymax": 4294967295
},
"Exptime": "0ns",
"Period": "0.18s",
"Ten Giga": 0,
"ADC Mask": "0x2202",
"Analog Flag": 1,
"Analog Samples": 8003,
"Digital Flag": 0,
"Digital Samples": 1000,
"Dbit Offset": 0,
"Dbit Bitset": 0,
"Transceiver Mask": "0x3",
"Transceiver Flag": 0,
"Transceiver Samples": 1,
"Frames in File": 1,
"Frame Header Format": {
"Frame Number": "8 bytes",
"SubFrame Number/ExpLength": "4 bytes",
"Packet Number": "4 bytes",
"Bunch ID": "8 bytes",
"Timestamp": "8 bytes",
"Module Id": "2 bytes",
"Row": "2 bytes",
"Column": "2 bytes",
"Reserved": "2 bytes",
"Debug": "4 bytes",
"Round Robin Number": "2 bytes",
"Detector Type": "1 byte",
"Header Version": "1 byte",
"Packets Caught Mask": "64 bytes"
}
}

View File

@ -8,7 +8,7 @@ Commands can be used either with sls_detector_get or sls_detector_put
.. code-block::
sls_detector_get vrf
sls_detector_get exptime
Help
--------
@ -24,6 +24,16 @@ Help
# get help for a particular command
sls_detector_get -h fpath
sls_detector_help fpath
# list of deprecated commands
list deprecated
# autocompletion
# bash_autocomplete.sh or zsh_autocomplete.sh must be sourced from the
# main package folder to enable auto completion of commands and arguments
# for the command line on that shell.
source bash_autocomplete.sh
Commands

View File

@ -20,8 +20,8 @@ the shared libraries these are needed:
Python bindings
-----------------------
* Python > 3.6
* pybind11 2.11.0 (packaged in libs)
* Python >= 3.8
* pybind11 2.13.6 (packaged in libs)
.. note ::

62
docs/src/fileformat.rst Normal file
View File

@ -0,0 +1,62 @@
File format
================================
If `fwrite <commandline.html#term-fwrite-0-1>`_ is enabled, the receiver will write data to files.
Number of Files
----------------
Every acquisition will create a master file and data files.
An acquisition can have multiple data files for a single frame. The number of files is determined by the number of UDP ports per module and the number of modules.
* Every modules has its own receiver process. Every receiver process can have 1 or 2 UDP ports.
* Each UDP port will create its own file. Therefore, each receiver can write 1 or 2 files.
* So, for example a detector with 4 modules with 2 UDP ports each will create a total of 8 files with file names containing UDP port index **'_d0'** to **'_d7'**.
A new file containing **'_f[file_index]'** in file name is also created when reaching the maximum frames per file. Configured using `rx_framesperfile <commandline.html#term-rx_framesperfile-n_frames>`_.
.. _file name format:
Naming
-------
| Master File Name: [fpath]/[fname]_master_[findex].[ext]
| Data File Name: [fpath]/[fname]_dx_fy_[findex].[ext]
* fpath: file path set using command `fpath <commandline.html#term-fpath-path>`_. Default: '/'
* fname: file name prefix using command `fname <commandline.html#term-fname-name>`_. Default: "run"
* findex: acquisition index using command `findex <commandline.html#term-findex-n_value>`_. Automatically incremented for every acquisition with `sls_detector_acquire <commandline.html#term-acquire>`_ (if `fwrite <commandline.html#term-fwrite-0-1>`_ enabled).
* x: unique udp port index. New file per UDP port.
* y: file index. New file created after reaching max frames per file.
* ext: file extension. Default: "raw"(data file) or "json"(master file)
Some file name examples:
.. code-block:: bash
# first file
path-to-file/run_d0_f0_0.raw
# first file for second UDP port
path-to-file/run_d1_f0_0.raw
# second file after reaching max frames in first file
path-to-file/run_d0_f1_0.raw
# second acquisition, first file
path-to-file/run_d0_f0_1.raw
Formats
--------
There are 2 file formats supported by the receiver:
* Binary - extension .json (master file) or .raw (data files)
* HDF5 - extension .h5
The default is binary. HDF5 can be enabled by compiling the package with HDF5 option enabled. The file format is set using the command `fformat <commandline.html#term-fformat-binary-hdf5>`_.

View File

@ -98,7 +98,7 @@ Upgrade
* 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'.
* We recommend first updating the on-board detector server to 6.1.2 (with client 6.1.x) using command `updatedetectorserver <commandline.html#term-updatedetectorserver-server_name-with-full-path>`_.
* Then use command 'programfpga' to only update firmware or use command 'update' to update firmware and server to the latest release.
@ -257,7 +257,7 @@ Upgrade
* 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'.
* We recommend first updating the on-board detector server to 6.1.2 (with client 6.1.x) using command `updatedetectorserver <commandline.html#term-updatedetectorserver-server_name-with-full-path>`_.
* Then use command 'programfpga' to only update firmware or use command 'update' to update firmware and server to the latest release.

View File

@ -11,7 +11,7 @@
#include <string>
#include <vector>
#include "CmdProxy.h"
#include "Caller.h"
#include "sls/Detector.h"
#include "sls/sls_detector_defs.h"
@ -37,8 +37,8 @@ int main() {
std::cout << "Generating command line documentation!\n";
sls::CmdProxy proxy(nullptr);
auto commands = proxy.GetProxyCommands();
sls::Caller caller(nullptr);
auto commands = caller.getAllCommands();
std::ofstream fs("commands.rst");
fs << ".. glossary::\n";
@ -46,7 +46,7 @@ int main() {
for (const auto &cmd : commands) {
std::ostringstream os;
std::cout << cmd << '\n';
proxy.Call(cmd, {}, -1, slsDetectorDefs::HELP_ACTION, os);
caller.call(cmd, {}, -1, slsDetectorDefs::HELP_ACTION, os);
auto tmp = os.str().erase(0, cmd.size());
auto usage = tmp.substr(0, tmp.find_first_of('\n'));
@ -57,7 +57,7 @@ int main() {
std::ofstream fs2("deprecated.csv");
fs2 << "Old, New\n";
auto cmds = proxy.GetDeprecatedCommands();
auto cmds = caller.GetDeprecatedCommands();
for (auto it : cmds) {
fs2 << it.first << ", " << it.second << '\n';
}

View File

@ -0,0 +1,89 @@
HDF5 File Format
================================
Compilation
-------------
#. Compile the package with HDF5 option enabled
#. Using cmk script: ./cmk.sh -hj9 -d [path of hdf5 dir] (-d is optional and for custom installation folder)
#. Enable using cmake option **-DSLS_USE_HDF5=ON** and **-DCMAKE_INSTALL_PREFIX=/path/to/custom/hdf/installation** (optional).
Setup
-------
#. Start Receiver process
#. Load config file
#. Set file format using command `fformat <commandline.html#term-fformat-binary-hdf5>`_.
.. code-block:: bash
sls_detector_put fformat hdf5
Master File
-------------
* File Name: [fpath]/[fname]_master_[findex].h5 :ref:`Details here<file name format>`
* It contains :ref:`attributes<master file attributes>` relevant to the acquisition. This can vary with detector type.
.. code-block:: text
/ # Root level
|---> entry # entry group
| |---> data # data group
| |---> column # dataset of each sls_receiver_header member
| |---> data
| |---> detector header version
| |---> detector specific 1
| |---> detector specific 2
| |---> detector specific 3
| |---> detector specific 4
| |---> detector type
| |---> exp length or sub exposure time
| |---> frame number
| |---> mod id
| |---> packets caught
| |---> packets caught bit mask
| |---> row
| |---> timestamp
| |---> instrument # instrument group
| |---> beam # beam group
| |---> detector # detector group
| |---> Master File Attribute 1 # dataset of each master file attribute
| |---> Master File Attribute 2
| |---> Master File Attribute 3
| |---> Master File Attribute ..
| |---> sample # sample group
If more than 1 data file per frame:
* The dataset of each :ref:`**SLS Receiver Header** <sls receiver header format>` member is a virtual dataset.
* **data** dataset is a virtual dataset.
More details regarding master file attributes can be found :ref:`here<master file attributes>`.
Data File
-----------
* File Name: [fpath]/[fname]_dx_fy_[findex].h5 :ref:`Details here<file name format>`
Virtual Data File
------------------
* File Name: [fpath]/[fname]_virtual_[findex].h5 :ref:`Details here<file name format>`
* For multiple modules, a virtual file linking data from all the modules is created. The individual files are expected to be present.
* It is linked in the master file.

View File

@ -12,7 +12,7 @@ Welcome to slsDetectorPackage's documentation!
For further documentation, visit the official page: https://www.psi.ch/en/detectors/documentation
.. toctree::
:maxdepth: 1
:maxdepth: 3
:caption: Installation:
installation
@ -82,6 +82,22 @@ Welcome to slsDetectorPackage's documentation!
receivers
slsreceiver
.. toctree::
:caption: Receiver Files
:maxdepth: 3
fileformat
slsreceiverheaderformat
masterfileattributes
binaryfileformat
hdf5fileformat
.. toctree::
:caption: Receiver ZMQ Stream
:maxdepth: 2
zmqjsonheaderformat
.. toctree::
:caption: Troubleshooting

View File

@ -1,9 +1,4 @@
.. warning ::
Before building from source make sure that you have the
:doc:`dependencies <../dependencies>` installed. If installing using conda, conda will
manage the dependencies. Avoid also installing packages with pip.
.. _Installation:
@ -11,8 +6,18 @@
Installation
===============
One can either install pre-built binaries using conda or build from source.
.. warning ::
Before building from source make sure that you have the
:doc:`dependencies <../dependencies>` installed. If installing using conda, conda will
manage the dependencies. Avoid also installing packages with pip.
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)
@ -55,7 +60,7 @@ We have three different packages available:
Build from source
-------------------
----------------------
1. Download Source Code from github
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -75,8 +80,10 @@ Build from source
2. Build from Source
^^^^^^^^^^^^^^^^^^^^^^^^^^
One can either build using cmake or use the in-built cmk.sh script.
Build using CMake
^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
@ -103,7 +110,7 @@ Instead of the cmake command, one can use ccmake to get a list of options to con
ccmake ..
# choose the options
# first press [c] - configure (maybe multiple times till you see [g])
# first press [c] - configure (until you see [g])
# then press [g] - generate
@ -123,7 +130,7 @@ Example cmake options Comment
Build using in-built cmk.sh script
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
@ -173,7 +180,7 @@ Build using in-built cmk.sh script
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
@ -198,9 +205,10 @@ using this compiler
Build slsDetectorGui (Qt5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. Using pre-built binary on conda
.. code-block:: bash
conda create -n myenv slsdetgui=7.0.0
@ -208,13 +216,22 @@ Build slsDetectorGui (Qt5)
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 system installation on RHEL8
.. code-block:: bash
yum install qt5-qtbase-devel.x86_64
yum install qt5-qtsvg-devel.x86_64
yum install expat-devel.x86_64
4. Using conda
3. Using conda
.. code-block:: bash
#Add channels for dependencies and our library
@ -249,7 +266,7 @@ Build slsDetectorGui (Qt5)
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
@ -272,16 +289,18 @@ is to use conda
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)
| **Pybind11 for Python**
| v8.0.0+:
| pybind11 is built
| * by default from tar file in repo (libs/pybind/v2.1x.0.tar.gz)
| * or use advanced option SLS_FETCH_PYBIND11_FROM_GITHUB [`link <https://github.com/pybind/pybind11>`__].
| * v9.0.0+: pybind11 (v2.13.6)
| * v8.x.x : pybind11 (v2.11.0)
|
| v7.x.x:
| pybind11 packaged into 'libs/pybind'. No longer a submodule. No need for "recursive" or "submodule update".
@ -312,7 +331,7 @@ Pybind and Zeromq
| * 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
| zeromq-devel 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

@ -0,0 +1,408 @@
.. _master file attributes:
Master File Attributes
=======================
These attributes are the same in binary and HDF5 file, but vary depending on detector type.
Eiger
^^^^^
+-----------------------+-------------------------------------------------+
| **Key** | **Description** |
+-----------------------+-------------------------------------------------+
| Version | Version of the master file |
| | Current value:8.0 |
+-----------------------+-------------------------------------------------+
| Timestamp | Timestamp of creation of master file |
+-----------------------+-------------------------------------------------+
| Detector Type | Detector type |
+-----------------------+-------------------------------------------------+
| Timing Mode | Timing Mode |
+-----------------------+-------------------------------------------------+
| Geometry | Number of UDP ports in x and y dimension for |
| | complete detector |
+-----------------------+-------------------------------------------------+
| Image Size in bytes | Image size in bytes per UDP port |
+-----------------------+-------------------------------------------------+
| Pixels | Number of pixels in x and y dimension |
| | per UDP port |
+-----------------------+-------------------------------------------------+
| Max Frames Per File | Maximum frames per file |
+-----------------------+-------------------------------------------------+
| Frame Discard Policy | Receiever Frame discard policy |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Frame Padding | Receiver Frame padding enable |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Scan Parameters | Scanning mode on detector |
+-----------------------+-------------------------------------------------+
| Total Frames | Total number of frames and triggers expected |
+-----------------------+-------------------------------------------------+
| Receiver Roi | Receiver ROI in file including xmax and ymax |
+-----------------------+-------------------------------------------------+
| Dynamic Range | Bits per pixel |
+-----------------------+-------------------------------------------------+
| Ten Giga | 10GbE enable for data |
+-----------------------+-------------------------------------------------+
| Exptime | Exposure time |
+-----------------------+-------------------------------------------------+
| Period | Period between frames |
+-----------------------+-------------------------------------------------+
| Threshold Energy | Threshold energy |
+-----------------------+-------------------------------------------------+
| Sub Exptime | Sub exposure time in 32 bit mode |
+-----------------------+-------------------------------------------------+
| Sub Period | Sub period between frames in 32 bit mode |
+-----------------------+-------------------------------------------------+
| Quad | Quad enable (hardware) |
+-----------------------+-------------------------------------------------+
| Number of rows | Number of rows enabled for readout |
+-----------------------+-------------------------------------------------+
| Rate Corrections | Rate Corrections |
+-----------------------+-------------------------------------------------+
| Frames in File | Number of frames written to file by Receiver 0 |
+-----------------------+-------------------------------------------------+
| Frame Header Format | Expected frame header format for the data files |
+-----------------------+-------------------------------------------------+
Jungfrau
^^^^^^^^
+-----------------------+-------------------------------------------------+
| **Key** | **Description** |
+-----------------------+-------------------------------------------------+
| Version | Version of the master file |
| | Current value:8.0 |
+-----------------------+-------------------------------------------------+
| Timestamp | Timestamp of creation of master file |
+-----------------------+-------------------------------------------------+
| Detector Type | Detector type |
+-----------------------+-------------------------------------------------+
| Timing Mode | Timing Mode |
+-----------------------+-------------------------------------------------+
| Geometry | Number of UDP ports in x and y dimension for |
| | complete detector |
+-----------------------+-------------------------------------------------+
| Image Size in bytes | Image size in bytes per UDP port |
+-----------------------+-------------------------------------------------+
| Pixels | Number of pixels in x and y dimension |
| | per UDP port |
+-----------------------+-------------------------------------------------+
| Max Frames Per File | Maximum frames per file |
+-----------------------+-------------------------------------------------+
| Frame Discard Policy | Receiever Frame discard policy |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Frame Padding | Receiver Frame padding enable |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Scan Parameters | Scanning mode on detector |
+-----------------------+-------------------------------------------------+
| Total Frames | Total number of frames and triggers expected |
+-----------------------+-------------------------------------------------+
| Receiver Roi | Receiver ROI in file including xmax and ymax |
+-----------------------+-------------------------------------------------+
| Exptime | Exposure time |
+-----------------------+-------------------------------------------------+
| Period | Period between frames |
+-----------------------+-------------------------------------------------+
| Number of UDP | Number of UDP Interfaces enabled per module |
| Interfaces | |
+-----------------------+-------------------------------------------------+
| Number of rows | Number of rows enabled for readout |
+-----------------------+-------------------------------------------------+
| Frames in File | Number of frames written to file by Receiver 0 |
+-----------------------+-------------------------------------------------+
| Frame Header Format | Expected frame header format for the data files |
+-----------------------+-------------------------------------------------+
Gotthard II
^^^^^^^^^^^^
+-----------------------+-------------------------------------------------+
| **Key** | **Description** |
+-----------------------+-------------------------------------------------+
| Version | Version of the master file |
| | Current value:8.0 |
+-----------------------+-------------------------------------------------+
| Timestamp | Timestamp of creation of master file |
+-----------------------+-------------------------------------------------+
| Detector Type | Detector type |
+-----------------------+-------------------------------------------------+
| Timing Mode | Timing Mode |
+-----------------------+-------------------------------------------------+
| Geometry | Number of UDP ports in x and y dimension for |
| | complete detector |
+-----------------------+-------------------------------------------------+
| Image Size in bytes | Image size in bytes per UDP port |
+-----------------------+-------------------------------------------------+
| Pixels | Number of pixels in x and y dimension |
| | per UDP port |
+-----------------------+-------------------------------------------------+
| Max Frames Per File | Maximum frames per file |
+-----------------------+-------------------------------------------------+
| Frame Discard Policy | Receiever Frame discard policy |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Frame Padding | Receiver Frame padding enable |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Scan Parameters | Scanning mode on detector |
+-----------------------+-------------------------------------------------+
| Total Frames | Total number of frames and triggers expected |
+-----------------------+-------------------------------------------------+
| Receiver Roi | Receiver ROI in file including xmax and ymax |
+-----------------------+-------------------------------------------------+
| Exptime | Exposure time |
+-----------------------+-------------------------------------------------+
| Period | Period between frames |
+-----------------------+-------------------------------------------------+
| Burst Mode | Burst mode of detector |
+-----------------------+-------------------------------------------------+
| Frames in File | Number of frames written to file by Receiver 0 |
+-----------------------+-------------------------------------------------+
| Frame Header Format | Expected frame header format for the data files |
+-----------------------+-------------------------------------------------+
Mythen3
^^^^^^^
+-----------------------+-------------------------------------------------+
| **Key** | **Description** |
+-----------------------+-------------------------------------------------+
| Version | Version of the master file |
| | Current value:8.0 |
+-----------------------+-------------------------------------------------+
| Timestamp | Timestamp of creation of master file |
+-----------------------+-------------------------------------------------+
| Detector Type | Detector type |
+-----------------------+-------------------------------------------------+
| Timing Mode | Timing Mode |
+-----------------------+-------------------------------------------------+
| Geometry | Number of UDP ports in x and y dimension for |
| | complete detector |
+-----------------------+-------------------------------------------------+
| Image Size in bytes | Image size in bytes per UDP port |
+-----------------------+-------------------------------------------------+
| Pixels | Number of pixels in x and y dimension |
| | per UDP port |
+-----------------------+-------------------------------------------------+
| Max Frames Per File | Maximum frames per file |
+-----------------------+-------------------------------------------------+
| Frame Discard Policy | Receiever Frame discard policy |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Frame Padding | Receiver Frame padding enable |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Scan Parameters | Scanning mode on detector |
+-----------------------+-------------------------------------------------+
| Total Frames | Total number of frames and triggers expected |
+-----------------------+-------------------------------------------------+
| Receiver Roi | Receiver ROI in file including xmax and ymax |
+-----------------------+-------------------------------------------------+
| Dynamic Range | Bits per pixel |
+-----------------------+-------------------------------------------------+
| Ten Giga | 10GbE enable for data |
+-----------------------+-------------------------------------------------+
| Period | Period between frames |
+-----------------------+-------------------------------------------------+
| Counter Mask | Mask of counters enabled |
+-----------------------+-------------------------------------------------+
| Exptime1 | Exposure time of counter 1 |
+-----------------------+-------------------------------------------------+
| Exptime2 | Exposure time of counter 2 |
+-----------------------+-------------------------------------------------+
| Exptime3 | Exposure time of counter 3 |
+-----------------------+-------------------------------------------------+
| GateDelay1 | Gate delay of counter 1 |
+-----------------------+-------------------------------------------------+
| GateDelay2 | Gate delay of counter 2 |
+-----------------------+-------------------------------------------------+
| GateDelay3 | Gate delay of counter 3 |
+-----------------------+-------------------------------------------------+
| Gates | Number of gates |
+-----------------------+-------------------------------------------------+
| Threshold energies | Threshold energy of all 3 counters |
+-----------------------+-------------------------------------------------+
| Frames in File | Number of frames written to file by Receiver 0 |
+-----------------------+-------------------------------------------------+
| Frame Header Format | Expected frame header format for the data files |
+-----------------------+-------------------------------------------------+
Moench
^^^^^^
+-----------------------+-------------------------------------------------+
| **Key** | **Description** |
+-----------------------+-------------------------------------------------+
| Version | Version of the master file |
| | Current value:8.0 |
+-----------------------+-------------------------------------------------+
| Timestamp | Timestamp of creation of master file |
+-----------------------+-------------------------------------------------+
| Detector Type | Detector type |
+-----------------------+-------------------------------------------------+
| Timing Mode | Timing Mode |
+-----------------------+-------------------------------------------------+
| Geometry | Number of UDP ports in x and y dimension for |
| | complete detector |
+-----------------------+-------------------------------------------------+
| Image Size in bytes | Image size in bytes per UDP port |
+-----------------------+-------------------------------------------------+
| Pixels | Number of pixels in x and y dimension |
| | per UDP port |
+-----------------------+-------------------------------------------------+
| Max Frames Per File | Maximum frames per file |
+-----------------------+-------------------------------------------------+
| Frame Discard Policy | Receiever Frame discard policy |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Frame Padding | Receiver Frame padding enable |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Scan Parameters | Scanning mode on detector |
+-----------------------+-------------------------------------------------+
| Total Frames | Total number of frames and triggers expected |
+-----------------------+-------------------------------------------------+
| Receiver Roi | Receiver ROI in file including xmax and ymax |
+-----------------------+-------------------------------------------------+
| Exptime | Exposure time |
+-----------------------+-------------------------------------------------+
| Period | Period between frames |
+-----------------------+-------------------------------------------------+
| Number of UDP | Number of UDP Interfaces enabled per module |
| Interfaces | |
+-----------------------+-------------------------------------------------+
| Number of rows | Number of rows enabled for readout |
+-----------------------+-------------------------------------------------+
| Frames in File | Number of frames written to file by Receiver 0 |
+-----------------------+-------------------------------------------------+
| Frame Header Format | Expected frame header format for the data files |
+-----------------------+-------------------------------------------------+
Gotthard I
^^^^^^^^^^^
+-----------------------+-------------------------------------------------+
| **Key** | **Description** |
+-----------------------+-------------------------------------------------+
| Version | Version of the master file |
| | Current value:8.0 |
+-----------------------+-------------------------------------------------+
| Timestamp | Timestamp of creation of master file |
+-----------------------+-------------------------------------------------+
| Detector Type | Detector type |
+-----------------------+-------------------------------------------------+
| Timing Mode | Timing Mode |
+-----------------------+-------------------------------------------------+
| Geometry | Number of UDP ports in x and y dimension for |
| | complete detector |
+-----------------------+-------------------------------------------------+
| Image Size in bytes | Image size in bytes per UDP port |
+-----------------------+-------------------------------------------------+
| Pixels | Number of pixels in x and y dimension |
| | per UDP port |
+-----------------------+-------------------------------------------------+
| Max Frames Per File | Maximum frames per file |
+-----------------------+-------------------------------------------------+
| Frame Discard Policy | Receiever Frame discard policy |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Frame Padding | Receiver Frame padding enable |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Scan Parameters | Scanning mode on detector |
+-----------------------+-------------------------------------------------+
| Total Frames | Total number of frames and triggers expected |
+-----------------------+-------------------------------------------------+
| Receiver Roi | Receiver ROI in file including xmax and ymax |
+-----------------------+-------------------------------------------------+
| Exptime | Exposure time |
+-----------------------+-------------------------------------------------+
| Period | Period between frames |
+-----------------------+-------------------------------------------------+
| Detector Roi | Roi in detector restricted to an ADC. |
| | Includes xmax |
+-----------------------+-------------------------------------------------+
| Burst Mode | Burst mode of detector |
+-----------------------+-------------------------------------------------+
| Frames in File | Number of frames written to file by Receiver 0 |
+-----------------------+-------------------------------------------------+
| Frame Header Format | Expected frame header format for the data files |
+-----------------------+-------------------------------------------------+
Chip Test Board
^^^^^^^^^^^^^^^
+-----------------------+-------------------------------------------------+
| **Key** | **Description** |
+-----------------------+-------------------------------------------------+
| Version | Version of the master file |
| | Current value:8.0 |
+-----------------------+-------------------------------------------------+
| Timestamp | Timestamp of creation of master file |
+-----------------------+-------------------------------------------------+
| Detector Type | Detector type |
+-----------------------+-------------------------------------------------+
| Timing Mode | Timing Mode |
+-----------------------+-------------------------------------------------+
| Geometry | Number of UDP ports in x and y dimension for |
| | complete detector |
+-----------------------+-------------------------------------------------+
| Image Size in bytes | Image size in bytes per UDP port |
+-----------------------+-------------------------------------------------+
| Pixels | Number of pixels in x and y dimension |
| | per UDP port |
+-----------------------+-------------------------------------------------+
| Max Frames Per File | Maximum frames per file |
+-----------------------+-------------------------------------------------+
| Frame Discard Policy | Receiever Frame discard policy |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Frame Padding | Receiver Frame padding enable |
| | for partial frames |
+-----------------------+-------------------------------------------------+
| Scan Parameters | Scanning mode on detector |
+-----------------------+-------------------------------------------------+
| Total Frames | Total number of frames and triggers expected |
+-----------------------+-------------------------------------------------+
| Receiver Roi | Receiver ROI in file including xmax and ymax |
+-----------------------+-------------------------------------------------+
| Exptime | Exposure time |
+-----------------------+-------------------------------------------------+
| Period | Period between frames |
+-----------------------+-------------------------------------------------+
| Ten Giga | Ten giga enable |
+-----------------------+-------------------------------------------------+
| ADC Mask | Mask of channels enabled in ADC |
+-----------------------+-------------------------------------------------+
| Analog Flag | Analog readout enable |
+-----------------------+-------------------------------------------------+
| Analog Samples | Number of analog samples |
+-----------------------+-------------------------------------------------+
| Digital Flag | Digital readout enable |
+-----------------------+-------------------------------------------------+
| Digital Samples | Number of digital samples |
+-----------------------+-------------------------------------------------+
| Dbit Offset | Digital offset of valid data in bytes |
+-----------------------+-------------------------------------------------+
| Dbit Bitset | Digital 64 bit mask of bits enabled in receiver |
+-----------------------+-------------------------------------------------+
| Transceiver Mask | Mask of channels enabled in Transceiver |
+-----------------------+-------------------------------------------------+
| Transceiver Flag | Transceiver readout enable |
+-----------------------+-------------------------------------------------+
| Transceiver Samples | Number of transceiver samples |
+-----------------------+-------------------------------------------------+
| Frames in File | Number of frames written to file by Receiver 0 |
+-----------------------+-------------------------------------------------+
| Frame Header Format | Expected frame header format for the data files |
+-----------------------+-------------------------------------------------+

View File

@ -6,7 +6,7 @@ Getting Started
Which Python?
--------------------
We require at least Python 3.6 and strongly recommended that you don't use the system
We require at least Python 3.8 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.

View File

@ -91,245 +91,6 @@ 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
--------------
Master file is in json 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.
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
# first file
path-to-file/run_d0_f0_0.raw
# second file after reaching max frames in first file
path-to-file/run_d0_f1_0.raw
# 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.
**Binary 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.
**HDF5 file formats**
#. Compile the package with HDF5 option enabled
#. Using cmk script: ./cmk.sh -hj9 -d [path of hdf5 dir]
#. Enable using cmake **-DCMAKE_INSTALL_PREFIX=/path/to/hdf/installation** and **-DSLS_USE_HDF5=ON**
#. Start Receiver process
#. Load config file
#. Set file format from client or in config file
.. code-block:: bash
sls_detector_put fformat hdf5
| For multiple, modules, a virtual file linking all the modules is created. Both the data files and virtual files are linked in the master file.
Performance

View File

@ -0,0 +1,40 @@
.. _sls receiver header format:
SLS Receiver Header Format
====================================================
It is 112 bytes and consists of:
* 48 bytes of the SLS Detector 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 */
};
| **sls_detector_header** (described in :ref:`the current detector header <detector udp header>`)
| The **packetNumber** from detector UDP header is modified in **sls_receiver_header** to number of packets caught by receiver for that frame and the bit mask for each packet caught is the **packetsMask**. The packetsMask is a total of 512 bits due to the largest number of packets per frame among our detectors.
| For eg. Jungfrau has 128 packets per frame. If **packetNumeber** is 128, then this frame is complete. If it is 127 or less, it is a partial frame due to missing packets. If one would still like to use it, the **packetsMask** will specify which packet has been received or is missing.

View File

@ -394,6 +394,14 @@ Missing first frame or next frame after a delay
Connect the data link from the Module directly to receiver pc or to a private network.
Mythen3
--------
Detector status is waiting even in auto timing mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check if the control board or the flat band cable is connected properly. If not, connect them properly and try again.
Jungfrau
---------

View File

@ -3,7 +3,7 @@
Format
=======
The UDP data format for the packets consist of a common header for all detectors, followed by the data for that one packet.
The UDP data format for the packets consist of a common header of 48 bytes for all detectors, followed by the data for that one packet.
Current Version
@ -11,6 +11,25 @@ Current Version
**v2.0 (slsDetectorPackage v7.0.0+)**
.. 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;
.. table:: <---------------------------------------------------- 8 bytes per row --------------------------------------------->
:align: center
:widths: 30,30,30,15,15
@ -63,6 +82,8 @@ Description
* **version**: current version of the detector header (0x2).
.. _detector enum:
Detector Enum
--------------

View File

@ -0,0 +1,137 @@
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. |
+--------------+----------------------------------------------+

Binary file not shown.

Binary file not shown.

View File

@ -49,7 +49,6 @@ set( PYTHON_FILES
slsdet/temperature.py
slsdet/lookup.py
slsdet/utils.py
)
foreach(FILE ${PYTHON_FILES})
@ -58,7 +57,6 @@ foreach(FILE ${PYTHON_FILES})
endforeach(FILE ${PYTHON_FILES})
configure_file( scripts/basic.py
${CMAKE_BINARY_DIR}/basic.py
)
@ -66,6 +64,9 @@ configure_file( scripts/test_virtual.py
${CMAKE_BINARY_DIR}/test_virtual.py
)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/../VERSION
${CMAKE_BINARY_DIR}/bin/slsdet/VERSION
)
if(SLS_INSTALL_PYTHONEXT)
install(TARGETS _slsdet
@ -74,4 +75,5 @@ if(SLS_INSTALL_PYTHONEXT)
)
install(FILES ${PYTHON_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/python/slsdet)
install(FILES ../VERSION DESTINATION ${CMAKE_INSTALL_PREFIX}/python/slsdet)
endif()

View File

@ -10,14 +10,15 @@ import sys
from setuptools import setup, find_packages
from pybind11.setup_helpers import Pybind11Extension, build_ext
import subprocess
def get_git_tag():
def read_version():
try:
return subprocess.check_output(['git', 'describe', '--tags', '--abbrev=0']).strip().decode('utf-8')
except subprocess.CalledProcessError:
return 'developer'
__version__ = get_git_tag()
version_file = os.path.join(os.path.dirname(__file__), 'slsdet', 'VERSION')
with open(version_file, "r") as f:
return f.read().strip()
except:
raise RuntimeError("VERSION file not found in slsdet package from setup.py.")
__version__ = read_version()
def get_conda_path():
@ -67,6 +68,9 @@ setup(
description='Detector API for SLS Detector Group detectors',
long_description='',
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
package_data={
'slsdet': ['VERSION'],
},
ext_modules=ext_modules,
cmdclass={"build_ext": build_ext},
zip_safe=False,

View File

@ -22,6 +22,7 @@ defs = _slsdet.slsDetectorDefs
from .enums import *
from .defines import *
IpAddr = _slsdet.IpAddr
MacAddr = _slsdet.MacAddr
scanParameters = _slsdet.scanParameters
@ -29,12 +30,14 @@ currentSrcParameters = _slsdet.currentSrcParameters
DurationWrapper = _slsdet.DurationWrapper
pedestalParameters = _slsdet.pedestalParameters
import subprocess
def get_git_tag():
import os
def read_version():
try:
return subprocess.check_output(['git', 'describe', '--tags', '--abbrev=0']).strip().decode('utf-8')
except subprocess.CalledProcessError:
return 'developer'
__version__ = get_git_tag()
version_file = os.path.join(os.path.dirname(__file__), 'VERSION')
with open(version_file, "r") as f:
return f.read().strip()
except:
raise RuntimeError("VERSION file not found in slsdet package from init.py")
__version__ = read_version()

View File

@ -24,7 +24,7 @@ class JungfrauDacs(DetectorDacs):
('vdd_prot', dacIndex.VDD_PROT, 0, 4000, 3000),
('vin_com', dacIndex.VIN_COM, 0, 4000, 1053),
('vref_prech', dacIndex.VREF_PRECH, 0, 4000, 1450),
('vb_pixbuff', dacIndex.VB_PIXBUF, 0, 4000, 750),
('vb_pixbuf', dacIndex.VB_PIXBUF, 0, 4000, 750),
('vb_ds', dacIndex.VB_DS, 0, 4000, 1000),
('vref_ds', dacIndex.VREF_DS, 0, 4000, 480),
('vref_comp', dacIndex.VREF_COMP, 0, 4000, 420),

View File

@ -21,11 +21,13 @@ void init_det(py::module &m) {
using sls::Positions;
using sls::Result;
m.def("freeSharedMemory",
(void (*)(const int, const int)) & sls::freeSharedMemory,
py::arg() = 0, py::arg() = -1);
py::class_<Detector> CppDetectorApi(m, "CppDetectorApi");
CppDetectorApi.def(py::init<int>());
CppDetectorApi.def("freeSharedMemory",
(void (Detector::*)()) & Detector::freeSharedMemory);
CppDetectorApi.def("loadConfig",
(void (Detector::*)(const std::string &)) &
Detector::loadConfig,

View File

@ -18,8 +18,10 @@ void init_det(py::module &m) {
using sls::Positions;
using sls::Result;
m.def("freeSharedMemory", (void (*)(const int, const int)) &sls::freeSharedMemory, py::arg() = 0, py::arg() = -1);
py::class_<Detector> CppDetectorApi(m, "CppDetectorApi");
CppDetectorApi.def(py::init<int>());
[[FUNCTIONS]]
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1 @@
../slsDetectorServers/xilinx_ctbDetectorServer/bin/xilinx_ctbDetectorServerv9.0.0

View File

@ -457,7 +457,7 @@
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If sub images have missing packets&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Complete Image</string>
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@ -523,6 +523,7 @@
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>

View File

@ -123,7 +123,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
QString zTitle2d{"Intensity"};
QString plotTitle{""};
QString indexTitle{""};
bool completeImage{false};
bool completeImage{true};
bool xyRangeChanged{false};
double xyRange[4]{0, 0, 0, 0};
bool isXYRange[4]{false, false, false, false};

View File

@ -107,7 +107,7 @@ void qDrawPlot::SetupPlots() {
LOG(logINFO) << "nPixelsY:" << nPixelsY;
widgetStatistics->hide();
lblCompleteImage->hide();
lblCompleteImage->show();
lblInCompleteImage->hide();
lblRxRoiEnabled->hide();

View File

@ -51,12 +51,12 @@ int dataBytes = 0;
int analogDataBytes = 0;
int digitalDataBytes = 0;
int transceiverDataBytes = 0;
char *analogData = 0;
char *digitalData = 0;
char *transceiverData = 0;
char volatile *analogDataPtr = 0;
char volatile *digitalDataPtr = 0;
char volatile *transceiverDataPtr = 0;
char *analogData = NULL;
char *digitalData = NULL;
char *transceiverData = NULL;
char volatile *analogDataPtr = NULL;
char volatile *digitalDataPtr = NULL;
char volatile *transceiverDataPtr = NULL;
char udpPacketData[UDP_PACKET_DATA_BYTES + sizeof(sls_detector_header)];
uint32_t adcEnableMask_1g = BIT32_MSK;
// 10g readout
@ -475,21 +475,15 @@ void setupDetector() {
analogDataBytes = 0;
digitalDataBytes = 0;
transceiverDataBytes = 0;
if (analogData) {
free(analogData);
analogData = 0;
}
if (digitalData) {
free(digitalData);
digitalData = 0;
}
if (transceiverData) {
free(transceiverData);
transceiverData = 0;
}
analogDataPtr = 0;
digitalDataPtr = 0;
transceiverData = 0;
free(analogData);
analogData = NULL;
free(digitalData);
digitalData = NULL;
free(transceiverData);
transceiverData = NULL;
analogDataPtr = NULL;
digitalDataPtr = NULL;
transceiverData = NULL;
{
for (int i = 0; i < NUM_CLOCKS; ++i) {
clkPhase[i] = 0;
@ -640,22 +634,15 @@ int updateDatabytesandAllocateRAM() {
return FAIL;
}
// clear RAM
if (analogData) {
free(analogData);
analogData = 0;
}
if (digitalData) {
free(digitalData);
digitalData = 0;
}
if (transceiverData) {
free(transceiverData);
transceiverData = 0;
}
free(analogData);
analogData = NULL;
free(digitalData);
digitalData = NULL;
free(transceiverData);
transceiverData = NULL;
// allocate RAM
if (analogDataBytes) {
analogData = malloc(analogDataBytes);
// cannot malloc
if (analogData == NULL) {
LOG(logERROR, ("Can not allocate analog data RAM for even 1 frame. "
"Probable cause: Memory Leak.\n"));
@ -665,7 +652,6 @@ int updateDatabytesandAllocateRAM() {
}
if (digitalDataBytes) {
digitalData = malloc(digitalDataBytes);
// cannot malloc
if (digitalData == NULL) {
LOG(logERROR,
("Can not allocate digital data RAM for even 1 frame. "
@ -677,7 +663,6 @@ int updateDatabytesandAllocateRAM() {
}
if (transceiverDataBytes) {
transceiverData = malloc(transceiverDataBytes);
// cannot malloc
if (transceiverData == NULL) {
LOG(logERROR,
("Can not allocate transceiver data RAM for even 1 frame. "
@ -2209,7 +2194,8 @@ int startStateMachine() {
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
sharedMemory_setStatus(IDLE);
return FAIL;
}
} else
pthread_detach(pthread_virtual_tid);
LOG(logINFOGREEN, ("Virtual Acquisition started\n"));
return OK;
#endif
@ -2551,7 +2537,8 @@ int readSample(int ns) {
// read digital output
if (digitalEnable && ns < ndSamples) {
/*if (!(ns % 1000)) {
if (!(ns % 1000)) {
LOG(logDEBUG1,
("Reading sample ns:%d of %d DEmtpy:%d DFull:%d Status:0x%x\n",
ns, ndSamples,
@ -2562,25 +2549,6 @@ int readSample(int ns) {
FIFO_DIN_STATUS_FIFO_FULL_MSK) >>
FIFO_DIN_STATUS_FIFO_FULL_OFST),
bus_r(STATUS_REG)));
}*/
// wait for data
int fifoEmtpy = 1;
int times = 0;
while (fifoEmtpy) {
fifoEmtpy = ((bus_r(FIFO_DIN_STATUS_REG) &
FIFO_DIN_STATUS_FIFO_EMPTY_MSK) >>
FIFO_DIN_STATUS_FIFO_EMPTY_OFST);
if (!fifoEmtpy)
break;
if (times == 0)
printf("\n");
++times;
printf(".");
usleep(200);
/*if (times % 10 == 0) {
printf(".");
}*/
}
// read fifo and write it to current position of data pointer

View File

@ -46,17 +46,27 @@ int Beb_deactivated_left_datastream = 1;
int Beb_deactivated_right_datastream = 1;
int Beb_deactivated_num_destinations = 1;
void Beb_Beb() {
int Beb_Beb() {
Beb_send_ndata = 0;
Beb_send_buffer_size = 1026;
Beb_send_data_raw =
malloc((Beb_send_buffer_size + 1) * sizeof(unsigned int));
if (Beb_send_data_raw == NULL) {
LOG(logERROR, ("Could not allocate memory for beb (send_data_raw)\n"));
return 0;
}
Beb_send_data = &Beb_send_data_raw[1];
Beb_recv_ndata = 0;
Beb_recv_buffer_size = 1026;
Beb_recv_data_raw =
malloc((Beb_recv_buffer_size + 1) * sizeof(unsigned int));
if (Beb_recv_data_raw == NULL) {
LOG(logERROR, ("Could not allocate memory for beb (recv_data_raw)\n"));
return 0;
}
Beb_recv_data = &Beb_recv_data_raw[1];
udp_header = (struct udp_header_type){
@ -83,6 +93,7 @@ void Beb_Beb() {
Beb_ClearHeaderData(1);
Beb_bit_mode = 4;
return 1;
}
void Beb_ClearHeaderData(int ten_gig) {

View File

@ -6,7 +6,7 @@
#include "slsDetectorServer_defs.h"
#include <stdlib.h>
void Beb_Beb();
int Beb_Beb();
void Beb_ClearHeaderData(int ten_gig);
int Beb_SetUpUDPHeader(unsigned int header_number, int ten_gig,
uint64_t src_mac, uint32_t src_ip, uint16_t src_port,

View File

@ -57,11 +57,19 @@ int Feb_Control_FebControl(int normal) {
Feb_Control_externalEnableMode = 0;
Feb_Control_subFrameMode = 0;
Feb_Control_trimbit_size = 263680;
Feb_Control_last_downloaded_trimbits =
malloc(Feb_Control_trimbit_size * sizeof(int));
if (Feb_Control_last_downloaded_trimbits == NULL) {
LOG(logERROR,
("Could not allocate memory for last downloaded trimbits\n"));
return 0;
}
Feb_Control_normal = normal;
Feb_Interface_SetAddress(Feb_Control_rightAddress, Feb_Control_leftAddress);
if (!Feb_Interface_SetAddress(Feb_Control_rightAddress,
Feb_Control_leftAddress))
return 0;
if (Feb_Control_activated) {
return Feb_Interface_SetByteOrder();
}

View File

@ -22,34 +22,57 @@ unsigned int Feb_Interface_recv_buffer_size;
unsigned int *Feb_Interface_recv_data_raw;
unsigned int *Feb_Interface_recv_data;
void Feb_Interface_FebInterface() {
int Feb_Interface_FebInterface() {
ll = &ll_local;
Feb_Interface_nfebs = 0;
Feb_Interface_feb_numb = 0;
Feb_Interface_send_ndata = 0;
Feb_Interface_send_buffer_size = 1026;
Feb_Interface_send_data_raw =
malloc((Feb_Interface_send_buffer_size + 1) * sizeof(unsigned int));
if (Feb_Interface_send_data_raw == NULL) {
LOG(logERROR,
("Could not allocate memory for feb interface (send_data_raw)\n"));
return 0;
}
Feb_Interface_send_data = &Feb_Interface_send_data_raw[1];
Feb_Interface_recv_ndata = 0;
Feb_Interface_recv_buffer_size = 1026;
Feb_Interface_recv_data_raw =
malloc((Feb_Interface_recv_buffer_size + 1) * sizeof(unsigned int));
if (Feb_Interface_recv_data_raw == NULL) {
LOG(logERROR,
("Could not allocate memory for feb interface (recv_data_raw)\n"));
return 0;
}
Feb_Interface_recv_data = &Feb_Interface_recv_data_raw[1];
Local_LocalLinkInterface(
ll, XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_BASEADDR);
return 1;
}
void Feb_Interface_SetAddress(unsigned int leftAddr, unsigned int rightAddr) {
if (Feb_Interface_feb_numb)
free(Feb_Interface_feb_numb);
int Feb_Interface_SetAddress(unsigned int leftAddr, unsigned int rightAddr) {
free(Feb_Interface_feb_numb);
Feb_Interface_nfebs = 2;
Feb_Interface_feb_numb = malloc(2 * sizeof(unsigned int));
if (Feb_Interface_feb_numb == NULL) {
LOG(logERROR,
("Could not allocate memory for feb interface (feb_numb)\n"));
Feb_Interface_nfebs = 0;
return 0;
}
Feb_Interface_feb_numb[0] = leftAddr;
Feb_Interface_feb_numb[1] = rightAddr;
return 1;
}
int Feb_Interface_WriteTo(unsigned int ch) {

View File

@ -4,8 +4,8 @@
int Feb_Interface_WriteTo(unsigned int ch);
int Feb_Interface_ReadFrom(unsigned int ch, unsigned int ntrys);
void Feb_Interface_FebInterface();
void Feb_Interface_SetAddress(unsigned int leftAddr, unsigned int rightAddr);
int Feb_Interface_FebInterface();
int Feb_Interface_SetAddress(unsigned int leftAddr, unsigned int rightAddr);
int Feb_Interface_SetByteOrder();
int Feb_Interface_ReadRegister(unsigned int sub_num, unsigned int reg_num,
unsigned int *value_read);

View File

@ -662,7 +662,15 @@ int checkCommandLineConfiguration() {
#ifndef VIRTUAL
void setupFebBeb() {
sharedMemory_lockLocalLink();
Feb_Interface_FebInterface();
if (!Feb_Interface_FebInterface()) {
initError = FAIL;
sprintf(initErrorMessage,
"Could not intitalize eiger detector sever: feb interface\n");
LOG(logERROR, (initErrorMessage));
initCheckDone = 1;
sharedMemory_unlockLocalLink();
return;
}
if (!Feb_Control_FebControl(normal)) {
initError = FAIL;
sprintf(initErrorMessage,
@ -686,7 +694,14 @@ void setupFebBeb() {
LOG(logDEBUG1, ("%s server: FEB Initialization done\n",
isControlServer ? "Control" : "Stop"));
Beb_SetTopVariable(top);
Beb_Beb();
if (!Beb_Beb()) {
initError = FAIL;
sprintf(initErrorMessage,
"Could not intitalize eiger detector sever: beb\n");
LOG(logERROR, (initErrorMessage));
initCheckDone = 1;
return;
}
LOG(logDEBUG1, ("%s server: BEB Initialization done\n",
isControlServer ? "Control" : "Stop"));
@ -724,17 +739,23 @@ void setupFebBeb() {
}
#endif
void allocateDetectorStructureMemory() {
LOG(logINFO, ("This Server is for 1 Eiger half module (250k)\n\n"));
// Allocation of memory
int allocateDetectorStructureMemory() {
detectorModules = malloc(sizeof(sls_detector_module));
detectorChans = malloc(NCHIP * NCHAN * sizeof(int));
detectorDacs = malloc(NDAC * sizeof(int));
if (detectorModules == NULL || detectorChans == NULL ||
detectorDacs == NULL) {
initError = FAIL;
strcpy(initErrorMessage,
"Could not allocate memory for dacs or channels in detector\n");
LOG(logERROR, (initErrorMessage));
return FAIL;
}
LOG(logDEBUG1,
("modules from 0x%x to 0x%x\n", detectorModules, detectorModules));
LOG(logDEBUG1, ("chans from 0x%x to 0x%x\n", detectorChans, detectorChans));
LOG(logDEBUG1, ("dacs from 0x%x to 0x%x\n", detectorDacs, detectorDacs));
detectorModules->dacs = detectorDacs;
detectorModules->chanregs = detectorChans;
detectorModules->ndac = NDAC;
@ -748,14 +769,21 @@ void allocateDetectorStructureMemory() {
detectorModules->eV[2] = -1;
thisSettings = UNINITIALIZED;
// if trimval requested, should return -1 to acknowledge unknown
// initialize (trimbits at -1 for unknown)
for (int idac = 0; idac < (detectorModules)->ndac; ++idac) {
detectorDacs[idac] = 0;
}
for (int ichan = 0; ichan < (detectorModules->nchan); ichan++) {
*((detectorModules->chanregs) + ichan) = -1;
}
return OK;
}
void setupDetector() {
allocateDetectorStructureMemory();
LOG(logINFO, ("This Server is for 1 Eiger half module (250k)\n\n"));
if (allocateDetectorStructureMemory() == FAIL)
return;
// force top or master if in config file
if (readConfigFile() == FAIL)
@ -2572,7 +2600,8 @@ int startStateMachine() {
sharedMemory_setStatus(IDLE);
sharedMemory_unlockAcqFlag();
return FAIL;
}
} else
pthread_detach(virtual_tid);
LOG(logINFO, ("Virtual Acquisition started\n"));
sharedMemory_unlockAcqFlag();
return OK;

View File

@ -987,6 +987,8 @@ int readConfigFile() {
// to inform powerchip config parameters are set
startupPowerChipConfigDone = 1;
chipConfigured = 1;
LOG(logINFOBLUE, ("Chip configured\n"));
}
return initError;
}
@ -2278,8 +2280,7 @@ int powerChip(int on, char *mess) {
if (on) {
LOG(logINFO, ("Powering chip: on\n"));
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_PWR_CHIP_MSK);
// only if power chip config done, configure chip with current set up
if (startupPowerChipConfigDone == 1 && configureChip(mess) == FAIL)
if (configureChip(mess) == FAIL)
return FAIL;
} else {
// throw if high voltage on
@ -2310,6 +2311,12 @@ int getPowerChip() {
int isChipConfigured() { return chipConfigured; }
int configureChip(char *mess) {
if (!startupPowerChipConfigDone) {
LOG(logINFOBLUE,
("Startup: Chip to be configured when reading config file\n"));
return OK;
}
LOG(logINFOBLUE, ("\tConfiguring chip\n"));
// on chip dacs
@ -3319,11 +3326,12 @@ int *getBadChannels(int *numChannels) {
if (*numChannels > 0) {
// get list of bad channels
retvals = malloc(*numChannels * sizeof(int));
memset(retvals, 0, *numChannels * sizeof(int));
if (retvals == NULL) {
LOG(logERROR, ("Could not allocate memory to get bad channels\n"));
*numChannels = -1;
return NULL;
}
memset(retvals, 0, *numChannels * sizeof(int));
int chIndex = 0;
int numAddr = MASK_STRIP_NUM_REGS;
// loop through registers
@ -3373,7 +3381,8 @@ int startStateMachine() {
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
sharedMemory_setStatus(IDLE);
return FAIL;
}
} else
pthread_detach(pthread_virtual_tid);
LOG(logINFOGREEN, ("Virtual Acquisition started\n"));
return OK;
#endif

View File

@ -1667,7 +1667,8 @@ int startStateMachine() {
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
sharedMemory_setStatus(IDLE);
return FAIL;
}
} else
pthread_detach(pthread_virtual_tid);
LOG(logINFOGREEN, ("Virtual Acquisition started\n"));
return OK;
#endif

View File

@ -555,6 +555,7 @@ void setupDetector() {
setNextFrameNumber(DEFAULT_STARTING_FRAME_NUMBER);
// temp threshold and reset event
setTemperatureControl(DEFAULT_TMP_CNTRL);
setThresholdTemperature(DEFAULT_TMP_THRSHLD);
setTemperatureEvent(0);
if (getChipVersion() == 11) {
@ -2254,7 +2255,6 @@ int setThresholdTemperature(int val) {
double ftemp = (double)temp / 1000.00;
LOG(logDEBUG1, ("Threshold Temperature read %f °C\n", ftemp));
return temp;
}
@ -2555,6 +2555,7 @@ void getPedestalParameters(uint8_t *frames, uint16_t *loops) {
}
void setPedestalMode(int enable, uint8_t frames, uint16_t loops) {
// Note: loops is 8 bit in firmware as a bug.To be fixed in next version
int prevPedestalEnable = getPedestalMode();
uint32_t addr = PEDESTAL_MODE_REG;
@ -2733,7 +2734,8 @@ int startStateMachine() {
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
sharedMemory_setStatus(IDLE);
return FAIL;
}
} else
pthread_detach(pthread_virtual_tid);
LOG(logINFOGREEN, ("Virtual Acquisition started\n"));
return OK;
#endif
@ -2789,9 +2791,9 @@ void *start_timer(void *arg) {
}
if ((i % 1024) < 300) {
gainVal = 1;
gainVal = 0;
} else if ((i % 1024) < 600) {
gainVal = 2;
gainVal = 1;
} else {
gainVal = 3;
}
@ -2828,17 +2830,29 @@ void *start_timer(void *arg) {
clock_gettime(CLOCK_REALTIME, &begin);
usleep(expUs);
#ifdef TEST_CHANGE_GAIN_EVERY_FRAME
// change gain and data for every frame
{
const int npixels = (NCHAN * NCHIP);
// random gain values, 2 becomes 3 as 2 is invalid
int randomGainValues[3] = {0};
srand(time(0));
for (int i = 0; i != 3; ++i) {
int r = rand() % 3;
if (r == 2)
r = 3;
randomGainValues[i] = r;
}
for (int i = 0; i < npixels; ++i) {
int gainVal = 0;
if ((i % 1024) < 300) {
gainVal = 1 + iframes;
gainVal = randomGainValues[0];
} else if ((i % 1024) < 600) {
gainVal = 2 + iframes;
gainVal = randomGainValues[1];
} else {
gainVal = 3 + iframes;
gainVal = randomGainValues[2];
}
int dataVal =
*((uint16_t *)(imageData + i * sizeof(uint16_t)));
@ -2849,7 +2863,7 @@ void *start_timer(void *arg) {
(uint16_t)pixelVal;
}
}
#endif
int srcOffset = 0;
int srcOffset2 = DATA_BYTES / 2;
int row0 = (numInterfaces == 1 ? detPos[1] : detPos[3]);

View File

@ -5,8 +5,8 @@
#include "sls/sls_detector_defs.h"
#define MIN_REQRD_VRSN_T_RD_API 0x171220
#define REQRD_FRMWRE_VRSN_BOARD2 0x241001 // 1.0 pcb (version = 010)
#define REQRD_FRMWRE_VRSN 0x241001 // 2.0 pcb (version = 011)
#define REQRD_FRMWRE_VRSN_BOARD2 0x230920 // 1.0 pcb (version = 010)
#define REQRD_FRMWRE_VRSN 0x230921 // 2.0 pcb (version = 011)
#define NUM_HARDWARE_VERSIONS (2)
#define HARDWARE_VERSION_NUMBERS \
@ -48,6 +48,7 @@
#define DEFAULT_SETTINGS (GAIN0)
#define DEFAULT_GAINMODE (DYNAMIC)
#define DEFAULT_TX_UDP_PORT (0x7e9a)
#define DEFAULT_TMP_CNTRL (1)
#define DEFAULT_TMP_THRSHLD (65 * 1000) // milli degree Celsius
#define DEFAULT_NUM_STRG_CLLS (0)
#define DEFAULT_STRG_CLL_STRT (0xf)
@ -62,6 +63,7 @@
#define DEFAULT_TIMING_INFO_DECODER (SWISSFEL)
#define DEFAULT_ELECTRON_COLLECTION_MODE (0)
#define MAX_PEDESTAL_LOOPS (0xFF) // until fixed in firmware
#define HIGHVOLTAGE_MIN (60)
#define HIGHVOLTAGE_MAX (200)
#define DAC_MIN_MV (0)

View File

@ -1858,7 +1858,8 @@ int startStateMachine() {
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
sharedMemory_setStatus(IDLE);
return FAIL;
}
} else
pthread_detach(pthread_virtual_tid);
LOG(logINFOGREEN, ("Virtual Acquisition started\n"));
return OK;
#endif

View File

@ -404,18 +404,24 @@ void initStopServer() {
/* set up detector */
void allocateDetectorStructureMemory() {
// Allocation of memory
int allocateDetectorStructureMemory() {
detectorModules = malloc(sizeof(sls_detector_module));
detectorChans = malloc(NCHAN_PER_MODULE * sizeof(int));
badChannelMask = malloc(NCHAN_PER_MODULE * sizeof(char));
memset(badChannelMask, 0, NCHAN_PER_MODULE * sizeof(char));
detectorDacs = malloc(NDAC * sizeof(int));
badChannelMask = malloc(NCHAN_PER_MODULE * sizeof(char));
if (detectorModules == NULL || detectorChans == NULL ||
detectorDacs == NULL || badChannelMask == NULL) {
initError = FAIL;
strcpy(initErrorMessage, "Could not allocate memory for dacs, channels "
"or bad channel mask in detector\n");
LOG(logERROR, (initErrorMessage));
return FAIL;
}
LOG(logDEBUG1,
("modules from 0x%x to 0x%x\n", detectorModules, detectorModules));
LOG(logDEBUG1, ("chans from 0x%x to 0x%x\n", detectorChans, detectorChans));
LOG(logDEBUG1, ("dacs from 0x%x to 0x%x\n", detectorDacs, detectorDacs));
(detectorModules)->dacs = detectorDacs;
(detectorModules)->chanregs = detectorChans;
(detectorModules)->ndac = NDAC;
@ -429,21 +435,22 @@ void allocateDetectorStructureMemory() {
(detectorModules)->eV[2] = 0;
thisSettings = UNINITIALIZED;
// initialize dacs
// initialize
for (int idac = 0; idac < (detectorModules)->ndac; ++idac) {
detectorDacs[idac] = 0;
}
// trimbits start at 0
for (int ichan = 0; ichan < (detectorModules->nchan); ichan++) {
*((detectorModules->chanregs) + ichan) = 0;
}
memset(badChannelMask, 0, NCHAN_PER_MODULE * sizeof(char));
return OK;
}
void setupDetector() {
LOG(logINFO, ("This Server is for 1 Mythen3 module \n"));
allocateDetectorStructureMemory();
if (allocateDetectorStructureMemory() == FAIL)
return;
if (checkCommandLineConfiguration() == FAIL)
return;
@ -1412,6 +1419,10 @@ int setTrimbits(int *trimbits) {
int setAllTrimbits(int val) {
LOG(logINFO, ("Setting all trimbits to %d\n", val));
int *trimbits = malloc(sizeof(int) * ((detectorModules)->nchan));
if (trimbits == NULL) {
LOG(logERROR, ("Could not allocate memory to set all trimbits\n"));
return FAIL;
}
for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) {
trimbits[ichan] = val;
}
@ -2469,11 +2480,12 @@ int *getBadChannels(int *numChannels) {
}
if (*numChannels > 0) {
retvals = malloc(*numChannels * sizeof(int));
memset(retvals, 0, *numChannels * sizeof(int));
if (retvals == NULL) {
LOG(logERROR, ("Could not allocate memory to get bad channels\n"));
*numChannels = -1;
return NULL;
}
memset(retvals, 0, *numChannels * sizeof(int));
// return only 1 channel for all counters
int ich = 0;
for (int i = 0; i != NCHAN_PER_MODULE; i = i + NCOUNTERS) {
@ -2532,7 +2544,8 @@ int startStateMachine() {
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
sharedMemory_setStatus(IDLE);
return FAIL;
}
} else
pthread_detach(pthread_virtual_tid);
LOG(logINFOGREEN, ("Virtual Acquisition started\n"));
return OK;
#endif

View File

@ -3,7 +3,7 @@
#pragma once
#include "sls/sls_detector_defs.h"
#define REQRD_FRMWRE_VRSN (0x230124)
#define REQRD_FRMWRE_VRSN (0x241113)
#define KERNEL_DATE_VRSN "Mon May 10 18:00:21 CEST 2021"
#define ID_FILE "detid_mythen3.txt"

View File

@ -91,7 +91,7 @@ static inline void FILELOG_PrintLog(enum TLogLevel level, char *m) {
}
static inline char *FILELOG_BuildLog(const char *fmt, ...) {
char *p;
char *p = NULL;
va_list ap;
p = malloc(ERROR_MSG_LENGTH);
va_start(ap, fmt);

View File

@ -140,7 +140,7 @@ void checkVirtual9MFlag();
void setupFebBeb();
#endif
#if defined(EIGERD) || defined(MYTHEN3D)
void allocateDetectorStructureMemory();
int allocateDetectorStructureMemory();
#endif
void setupDetector();
#if defined(CHIPTESTBOARDD)

View File

@ -11,6 +11,8 @@
// initialization functions
int updateModeAllowedFunction(int file_des);
int printSocketReadError();
int sendError(int file_des);
void setMemoryAllocationErrorMessage();
void init_detector();
int decode_function(int);
const char *getRetName();

View File

@ -590,13 +590,16 @@ int Server_SendResult(int fileDes, intType itype, void *retval,
sendData(fileDes, &ret1, sizeof(ret1), INT32);
if (ret == FAIL) {
// send error message
if (strlen(mess))
if (strlen(mess)) {
sendData(fileDes, mess, MAX_STR_LENGTH, OTHER);
usleep(0); // test
}
// debugging feature. should not happen.
else
else {
LOG(logERROR, ("No error message provided for this failure in %s "
"server. Will mess up TCP.\n",
(isControlServer ? "control" : "stop")));
}
}
// send return value
sendData(fileDes, retval, retvalSize, itype);

View File

@ -115,6 +115,28 @@ int printSocketReadError() {
return FAIL;
}
int sendError(int file_des) {
ret = FAIL;
LOG(logERROR, (mess));
Server_SendResult(file_des, INT32, NULL, 0);
return ret;
}
void setMemoryAllocationErrorMessage() {
struct sysinfo info;
sysinfo(&info);
sprintf(
mess,
"Memory allocation error (%s). Available space: %d MB. Please reboot",
getFunctionNameFromEnum((enum detFuncs)fnum),
(int)(info.freeram / (1024 * 1024)));
#ifdef EIGERD
strcat(mess, ".\n");
#else
strcat(mess, " using sls_detector_put rebootcontroller.\n");
#endif
}
void init_detector() {
memset(udpDetails, 0, sizeof(udpDetails));
#ifdef VIRTUAL
@ -1728,67 +1750,45 @@ int get_module(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
sls_detector_module module;
int *myDac = NULL;
int *myChan = NULL;
module.dacs = NULL;
module.chanregs = NULL;
#if !defined(MYTHEN3D) && !defined(EIGERD)
functionNotImplemented();
return Server_SendResult(file_des, INT32, NULL, 0);
#else
// allocate to receive module structure
// allocate dacs
myDac = malloc(getNumberOfDACs() * sizeof(int));
// error
if (getNumberOfDACs() > 0 && myDac == NULL) {
ret = FAIL;
sprintf(mess, "Could not allocate dacs\n");
LOG(logERROR, (mess));
} else
module.dacs = myDac;
// allocate chans
if (ret == OK) {
myChan = malloc(getTotalNumberOfChannels() * sizeof(int));
if (getTotalNumberOfChannels() > 0 && myChan == NULL) {
ret = FAIL;
strcpy(mess, "Could not allocate chans\n");
LOG(logERROR, (mess));
} else
module.chanregs = myChan;
int ndac = getNumberOfDACs();
int nchan = getTotalNumberOfChannels();
if (ndac <= 0 || nchan <= 0) {
strcpy(mess, "Invalid number of dacs/channels to set module\n");
return sendError(file_des);
}
// receive module structure
if (ret == OK) {
module.nchip = getNumberOfChips();
module.nchan = getTotalNumberOfChannels();
module.ndac = getNumberOfDACs();
// ensure nchan is not 0, else trimbits not copied
if (module.nchan == 0) {
strcpy(mess, "Could not get module as the number of channels to "
"copy is 0\n");
LOG(logERROR, (mess));
return FAIL;
}
getModule(&module);
}
#endif
Server_SendResult(file_des, INT32, NULL, 0);
if (ret != FAIL) {
if (sendModule(file_des, &module) < 0) {
ret = FAIL;
strcpy(mess, "Could not send module data\n");
LOG(logERROR, (mess));
}
}
if (myChan != NULL)
free(myChan);
if (myDac != NULL)
sls_detector_module module;
module.dacs = NULL;
module.chanregs = NULL;
int *myDac = malloc(ndac * sizeof(int));
int *myChan = malloc(nchan * sizeof(int));
if (myDac == NULL || myChan == NULL) {
free(myDac);
free(myChan);
setMemoryAllocationErrorMessage();
return sendError(file_des);
}
module.dacs = myDac;
module.ndac = ndac;
module.chanregs = myChan;
module.nchan = nchan;
module.nchip = getNumberOfChips();
getModule(&module);
Server_SendResult(file_des, INT32, NULL, 0);
if (ret == OK && sendModule(file_des, &module) < 0) {
strcpy(mess, "Could not send module data\n");
ret = FAIL;
LOG(logERROR, (mess));
}
free(myChan);
free(myDac);
return ret;
#endif
}
int set_module(int file_des) {
@ -1798,63 +1798,53 @@ int set_module(int file_des) {
#if !(defined(MYTHEN3D) || defined(EIGERD))
functionNotImplemented();
#else
int ndac = getNumberOfDACs();
int nchan = getTotalNumberOfChannels();
if (ndac <= 0 || nchan <= 0) {
strcpy(mess, "Invalid number of dacs/channels to set module\n");
return sendError(file_des);
}
sls_detector_module module;
int *myDac = NULL;
int *myChan = NULL;
module.dacs = NULL;
module.chanregs = NULL;
// allocate to receive arguments
// allocate dacs
myDac = malloc(getNumberOfDACs() * sizeof(int));
// error
if (getNumberOfDACs() > 0 && myDac == NULL) {
ret = FAIL;
strcpy(mess, "Could not allocate dacs\n");
LOG(logERROR, (mess));
} else
module.dacs = myDac;
// allocate chans
if (ret == OK) {
myChan = malloc(getTotalNumberOfChannels() * sizeof(int));
if (getTotalNumberOfChannels() > 0 && myChan == NULL) {
ret = FAIL;
strcpy(mess, "Could not allocate chans\n");
LOG(logERROR, (mess));
} else
module.chanregs = myChan;
int *myDac = malloc(ndac * sizeof(int));
int *myChan = malloc(nchan * sizeof(int));
if (myDac == NULL || myChan == NULL) {
free(myDac);
free(myChan);
setMemoryAllocationErrorMessage();
return sendError(file_des);
}
// receive arguments
if (ret == OK) {
module.nchip = getNumberOfChips();
module.nchan = getTotalNumberOfChannels();
module.ndac = getNumberOfDACs();
int ts = receiveModule(file_des, &module);
if (ts < 0) {
free(myChan);
free(myDac);
return printSocketReadError();
}
LOG(logDEBUG1, ("module register is %d, nchan %d, nchip %d, "
"ndac %d, iodelay %d, tau %d, eV %d\n",
module.reg, module.nchan, module.nchip, module.ndac,
module.iodelay, module.tau, module.eV[0]));
// should at least have a dac
if (ts <= (int)sizeof(sls_detector_module)) {
ret = FAIL;
strcpy(mess, "Cannot set module. Received incorrect number of "
"dacs or channels\n");
LOG(logERROR, (mess));
}
module.dacs = myDac;
module.ndac = ndac;
module.chanregs = myChan;
module.nchan = nchan;
module.nchip = getNumberOfChips();
int ts = receiveModule(file_des, &module);
if (ts < 0) {
free(myChan);
free(myDac);
return printSocketReadError();
}
LOG(logDEBUG1, ("module register is %d, nchan %d, nchip %d, "
"ndac %d, iodelay %d, tau %d, eV %d\n",
module.reg, module.nchan, module.nchip, module.ndac,
module.iodelay, module.tau, module.eV[0]));
// should at least have a dac
if (ts <= (int)sizeof(sls_detector_module)) {
strcpy(mess, "Cannot set module. Received incorrect number of "
"dacs or channels\n");
free(myChan);
free(myDac);
return sendError(file_des);
}
// only set
if (ret == OK && Server_VerifyLock() == OK) {
if (Server_VerifyLock() == OK) {
// check index
// setsettings
// setsettings
#ifndef MYTHEN3D
// m3 uses reg for chip (not settings)
validate_settings((enum detectorSettings)(module.reg));
@ -1867,10 +1857,8 @@ int set_module(int file_des) {
#endif
LOG(logDEBUG1, ("Settings: %d\n", retval));
}
if (myChan != NULL)
free(myChan);
if (myDac != NULL)
free(myDac);
free(myChan);
free(myDac);
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
@ -2117,7 +2105,8 @@ int acquire(int blocking, int file_des) {
// scanErrorMessage)
if (blocking || !scan) {
pthread_join(pthread_tid, NULL);
}
} else
pthread_detach(pthread_tid);
}
}
}
@ -2213,6 +2202,13 @@ void *start_state_machine(void *arg) {
ret = FAIL;
strcpy(mess, "Could not start read frames thread!\n");
LOG(logERROR, (mess));
} else {
// blocking or scan
// wait to finish reading from fifo (1g real ctb)
if (*blocking || times > 1)
pthread_join(pthread_tid_ctb_1g, NULL);
else
pthread_detach(pthread_tid_ctb_1g);
}
}
// add scan error message
@ -2229,12 +2225,6 @@ void *start_state_machine(void *arg) {
#endif
// blocking or scan
if (*blocking || times > 1) {
// wait to finish reading from fifo (1g real ctb)
#if defined(CHIPTESTBOARDD) && !defined(VIRTUAL)
if (!enableTenGigabitEthernet(-1)) {
pthread_join(pthread_tid_ctb_1g, NULL);
}
#endif
#ifdef EIGERD
waitForAcquisitionEnd(&ret, mess);
if (ret == FAIL && scan) {
@ -2955,6 +2945,7 @@ int get_frames_left(int file_des) {
retval = getNumFramesLeft();
LOG(logDEBUG1, ("retval num frames left %lld\n", (long long int)retval));
#endif
return Server_SendResult(file_des, INT64, &retval, sizeof(retval));
}
@ -6547,6 +6538,10 @@ int set_veto_photon(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
#ifndef GOTTHARD2D
functionNotImplemented();
#else
int args[2] = {-1, -1};
if (receiveData(file_des, args, sizeof(args), INT32) < 0)
return printSocketReadError();
@ -6554,14 +6549,17 @@ int set_veto_photon(int file_des) {
const int numChannels = args[1];
int *gainIndices = malloc(sizeof(int) * numChannels);
if (receiveData(file_des, gainIndices, sizeof(int) * numChannels, INT32) <
0) {
int *values = malloc(sizeof(int) * numChannels);
if (gainIndices == NULL || values == NULL) {
free(gainIndices);
return printSocketReadError();
free(values);
setMemoryAllocationErrorMessage();
return sendError(file_des);
}
int *values = malloc(sizeof(int) * numChannels);
if (receiveData(file_des, values, sizeof(int) * numChannels, INT32) < 0) {
if ((receiveData(file_des, gainIndices, sizeof(int) * numChannels, INT32) <
0) ||
(receiveData(file_des, values, sizeof(int) * numChannels, INT32)) < 0) {
free(gainIndices);
free(values);
return printSocketReadError();
@ -6570,9 +6568,6 @@ int set_veto_photon(int file_des) {
LOG(logINFO, ("Setting Veto Photon: [chipIndex:%d, nch:%d]\n", chipIndex,
numChannels));
#ifndef GOTTHARD2D
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
if (numChannels != NCHAN) {
@ -6619,66 +6614,60 @@ int set_veto_photon(int file_des) {
}
}
}
free(gainIndices);
free(values);
#endif
if (gainIndices != NULL) {
free(gainIndices);
}
if (values != NULL) {
free(values);
}
return Server_SendResult(file_des, INT32, NULL, 0);
}
int get_veto_photon(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
int arg = -1;
int *retvals = NULL;
int *gainRetvals = NULL;
#ifndef GOTTHARD2D
functionNotImplemented();
return Server_SendResult(file_des, INT32, NULL, 0);
#else
int arg = -1;
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
return printSocketReadError();
LOG(logDEBUG1, ("Getting veto photon [chip Index:%d]\n", arg));
#ifndef GOTTHARD2D
functionNotImplemented();
#else
retvals = malloc(sizeof(int) * NCHAN);
gainRetvals = malloc(sizeof(int) * NCHAN);
int *retvals = malloc(sizeof(int) * NCHAN);
int *gainRetvals = malloc(sizeof(int) * NCHAN);
if (gainRetvals == NULL || retvals == NULL) {
free(gainRetvals);
free(retvals);
setMemoryAllocationErrorMessage();
return sendError(file_des);
}
memset(retvals, 0, sizeof(int) * NCHAN);
memset(gainRetvals, 0, sizeof(int) * NCHAN);
if (retvals == NULL || gainRetvals == NULL) {
// get only
int chipIndex = arg;
if (chipIndex < -1 || chipIndex >= NCHIP) {
ret = FAIL;
strcpy(
mess,
"Could not get veto photon. Could not allocate memory in server\n");
sprintf(mess, "Could not get veto photon. Invalid chip index %d\n",
chipIndex);
LOG(logERROR, (mess));
} else {
// get only
int chipIndex = arg;
if (chipIndex < -1 || chipIndex >= NCHIP) {
ret = FAIL;
sprintf(mess, "Could not get veto photon. Invalid chip index %d\n",
chipIndex);
ret = getVetoPhoton(chipIndex, retvals, gainRetvals);
if (ret == FAIL) {
strcpy(mess, "Could not get veto photon for chipIndex -1. Not the "
"same for all chips. Select specific chip index "
"instead.\n");
LOG(logERROR, (mess));
} else {
ret = getVetoPhoton(chipIndex, retvals, gainRetvals);
if (ret == FAIL) {
strcpy(mess,
"Could not get veto photon for chipIndex -1. Not the "
"same for all chips. Select specific chip index "
"instead.\n");
LOG(logERROR, (mess));
} else {
for (int i = 0; i < NCHAN; ++i) {
LOG(logDEBUG1,
("%d:[%d, %d]\n", i, retvals[i], gainRetvals[i]));
}
for (int i = 0; i < NCHAN; ++i) {
LOG(logDEBUG1,
("%d:[%d, %d]\n", i, retvals[i], gainRetvals[i]));
}
}
}
#endif
Server_SendResult(file_des, INT32, NULL, 0);
if (ret != FAIL) {
int nch = NCHAN;
@ -6686,13 +6675,10 @@ int get_veto_photon(int file_des) {
sendData(file_des, gainRetvals, sizeof(int) * NCHAN, INT32);
sendData(file_des, retvals, sizeof(int) * NCHAN, INT32);
}
if (retvals != NULL) {
free(retvals);
}
if (gainRetvals != NULL) {
free(gainRetvals);
}
free(retvals);
free(gainRetvals);
return ret;
#endif
}
int set_veto_reference(int file_des) {
@ -7861,18 +7847,20 @@ int set_pattern(int file_des) {
!defined(MYTHEN3D)
functionNotImplemented();
#else
patternParameters *pat = malloc(sizeof(patternParameters));
if (pat == NULL) {
setMemoryAllocationErrorMessage();
return sendError(file_des);
}
memset(pat, 0, sizeof(patternParameters));
// ignoring endianness for eiger
if (receiveData(file_des, pat, sizeof(patternParameters), INT32) < 0) {
if (pat != NULL)
free(pat);
free(pat);
return printSocketReadError();
}
if (receiveData(file_des, args, MAX_STR_LENGTH, OTHER) < 0) {
if (pat != NULL)
free(pat);
free(pat);
return printSocketReadError();
}
@ -7880,8 +7868,7 @@ int set_pattern(int file_des) {
LOG(logDEBUG1, ("Setting Pattern from structure\n"));
ret = loadPattern(mess, logINFO, pat, args);
}
if (pat != NULL)
free(pat);
free(pat);
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
@ -7917,6 +7904,10 @@ int get_pattern(int file_des) {
#else
patternParameters *pat = malloc(sizeof(patternParameters));
if (pat == NULL) {
setMemoryAllocationErrorMessage();
return sendError(file_des);
}
memset(pat, 0, sizeof(patternParameters));
if (Server_VerifyLock() == OK) {
@ -7926,8 +7917,7 @@ int get_pattern(int file_des) {
// ignoring endianness for eiger
int ret =
Server_SendResult(file_des, INT32, pat, sizeof(patternParameters));
if (pat != NULL)
free(pat);
free(pat);
return ret;
#endif
}
@ -8035,10 +8025,13 @@ int set_scan(int file_des) {
if (ret == OK) {
scan = 1;
numScanSteps = (abs(stop - start) / abs(step)) + 1;
if (scanSteps != NULL) {
free(scanSteps);
}
// freed only at startup of the next scan
free(scanSteps);
scanSteps = malloc(numScanSteps * sizeof(int));
if (scanSteps == NULL) {
setMemoryAllocationErrorMessage();
return sendError(file_des);
}
for (int i = 0; i != numScanSteps; ++i) {
scanSteps[i] = start + i * step;
LOG(logDEBUG1, ("scansteps[%d]:%d\n", i, scanSteps[i]));
@ -8312,55 +8305,54 @@ int set_adc_config(int file_des) {
int get_bad_channels(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
int nretvals = 0;
int *retvals = NULL;
LOG(logDEBUG1, ("Getting bad channels\n"));
#if !defined(GOTTHARD2D) && !defined(MYTHEN3D)
functionNotImplemented();
return Server_SendResult(file_des, INT32, NULL, 0);
#else
// get only
retvals = getBadChannels(&nretvals);
int nretvals = 0;
int *retvals = getBadChannels(&nretvals);
if (nretvals == -1) {
ret = FAIL;
strcpy(mess, "Could not get bad channels. Memory allcoation error\n");
LOG(logERROR, (mess));
setMemoryAllocationErrorMessage();
return sendError(file_des);
}
#endif
Server_SendResult(file_des, INT32, NULL, 0);
if (ret != FAIL) {
sendData(file_des, &nretvals, sizeof(nretvals), INT32);
if (nretvals > 0) {
sendData(file_des, retvals, sizeof(int) * nretvals, INT32);
}
}
if (retvals != NULL) {
free(retvals);
sendData(file_des, &nretvals, sizeof(nretvals), INT32);
if (nretvals > 0) {
sendData(file_des, retvals, sizeof(int) * nretvals, INT32);
}
free(retvals);
return ret;
#endif
}
int set_bad_channels(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
int nargs = 0;
int *args = NULL;
if (receiveData(file_des, &nargs, sizeof(nargs), INT32) < 0)
return printSocketReadError();
if (nargs > 0) {
args = malloc(nargs * sizeof(int));
if (receiveData(file_des, args, nargs * sizeof(int), INT32) < 0)
return printSocketReadError();
}
LOG(logDEBUG1, ("Setting %d bad channels\n", nargs));
#if !defined(GOTTHARD2D) && !defined(MYTHEN3D)
functionNotImplemented();
#else
int nargs = 0;
if (receiveData(file_des, &nargs, sizeof(nargs), INT32) < 0)
return printSocketReadError();
int *args = NULL;
if (nargs > 0) {
args = malloc(nargs * sizeof(int));
if (args == NULL) {
setMemoryAllocationErrorMessage();
return sendError(file_des);
}
if (receiveData(file_des, args, nargs * sizeof(int), INT32) < 0) {
free(args);
return printSocketReadError();
}
}
LOG(logDEBUG1, ("Setting %d bad channels\n", nargs));
// only set
if (Server_VerifyLock() == OK) {
// validate bad channel number
@ -8389,11 +8381,11 @@ int set_bad_channels(int file_des) {
int nretvals = 0;
int *retvals = getBadChannels(&nretvals);
if (nretvals == -1) {
ret = FAIL;
strcpy(mess, "Could not get bad channels. Memory "
"allcoation error\n");
LOG(logERROR, (mess));
} else if (nretvals != nargs) {
free(args);
setMemoryAllocationErrorMessage();
return sendError(file_des);
}
if (nretvals != nargs) {
ret = FAIL;
sprintf(mess,
"Could not set bad channels. Set %d channels, but "
@ -8402,15 +8394,11 @@ int set_bad_channels(int file_des) {
nargs, nretvals);
LOG(logERROR, (mess));
}
if (retvals != NULL) {
free(retvals);
}
free(retvals);
}
}
}
if (args != NULL) {
free(args);
}
free(args);
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
}
@ -8515,7 +8503,8 @@ int start_readout(int file_des) {
ret = FAIL;
strcpy(mess, "Could not start read frames thread!\n");
LOG(logERROR, (mess));
}
} else
pthread_detach(pthread_tid_ctb_1g);
}
}
#endif
@ -9863,11 +9852,12 @@ int receive_program(int file_des, enum PROGRAM_INDEX index) {
strcpy(mess, "Server name is the same as the symbolic link. Please "
"use a different server name\n");
LOG(logERROR, (mess));
Server_SendResult(file_des, INT32, NULL, 0);
}
// in same folder as current process (will also work for virtual then
// with write permissions)
{
if (ret == OK) {
const int fileNameSize = 128;
char fname[fileNameSize];
if (getAbsPath(fname, fileNameSize, serverName) == FAIL) {
@ -9937,14 +9927,9 @@ void receive_program_via_blackfin(int file_des, enum PROGRAM_INDEX index,
src = malloc(MAX_BLACKFIN_PROGRAM_SIZE);
if (src == NULL) {
fclose(fd);
struct sysinfo info;
sysinfo(&info);
sprintf(mess,
"Could not %s. Memory allocation failure. Free "
"space: %d MB\n",
functionType, (int)(info.freeram / (1024 * 1024)));
LOG(logERROR, (mess));
setMemoryAllocationErrorMessage();
ret = FAIL;
LOG(logERROR, (mess));
}
}
Server_SendResult(file_des, INT32, NULL, 0);
@ -10087,6 +10072,7 @@ void receive_program_default(int file_des, enum PROGRAM_INDEX index,
}
Server_SendResult(file_des, INT32, NULL, 0);
if (ret == FAIL) {
free(src);
return;
}
@ -11038,6 +11024,13 @@ int set_pedestal_mode(int file_des) {
"be 0. [%hhu, %hu].\n",
frames, loops);
LOG(logERROR, (mess));
} else if (loops > MAX_PEDESTAL_LOOPS) {
ret = FAIL;
sprintf(mess,
"Could not set pedestal mode. Loops [%hu] cannot be "
"greater than %d.\n",
loops, MAX_PEDESTAL_LOOPS);
LOG(logERROR, (mess));
} else {
setPedestalMode(enable, frames, loops);
int retvalEnable = getPedestalMode();

View File

@ -1329,7 +1329,8 @@ int startStateMachine() {
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
sharedMemory_setStatus(IDLE);
return FAIL;
}
} else
pthread_detach(pthread_virtual_tid);
LOG(logINFOGREEN, ("Virtual Acquisition started\n"));
return OK;
#endif

View File

@ -55,6 +55,7 @@ class Caller {
}
std::vector<std::string> getAllCommands();
std::map<std::string, std::string> GetDeprecatedCommands();
std::string list(int action);
// THIS COMMENT TO BE REPLACED BY THE ACTUAL CODE (1)

View File

@ -688,7 +688,7 @@ column:
function: setColumn
timing:
help: "[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Moench][Gotthard][Ctb][Gotthard2][Xilinx Ctb] [auto|trigger]\n\t[Mythen3] [auto|trigger|gating|trigger_gating]\n\t[Eiger] [auto|trigger|gating|burst_trigger]"
help: "[auto|trigger|gating|burst_trigger|trigger_gating]\n\tTiming Mode of detector.\n\t[Jungfrau][Moench][Gotthard][Ctb][Gotthard2][Xilinx Ctb] [auto|trigger]\n\t[Mythen3] [auto|trigger|gating|trigger_gating]\n\t[Eiger] [auto|trigger|gating|burst_trigger]"
inherit_actions: INTEGER_COMMAND_VEC_ID
actions:
GET:
@ -793,7 +793,7 @@ selinterface:
input_types: [ bool ]
udp_firstdst:
help: "\n[0 - 31 (or number of udp destinations)]\n\t[Jungfrau][Moench][Gotthard2]\n[0-63]\n\t[Mythen3]\n\n\t One can set which is the first destination that the detector will stream images out from in a round robin fashion. The entry must not have been empty. Default: 0"
help: "\n\t[0 - N]\n\twhere N is the max number of udp destinations - 1.\n\t[Jungfrau][Moench][Gotthard2] Max number of udp destinations is 32.\n\t[Mythen3] Max number of udp destination is 64.\n\t One can set which is the first destination that the detector will stream images out from in a round robin fashion. The entry must not have been empty. Default: 0"
inherit_actions: INTEGER_COMMAND_VEC_ID
actions:
GET:
@ -1074,7 +1074,7 @@ interruptsubframe:
input_types: [ bool ]
activate:
help: "[0, 1] \n\t[Eiger] 1 is default. 0 deactivates readout and does not send data."
help: "[0, 1]\n\t[Eiger] 1 is default. 0 deactivates readout and does not send data."
inherit_actions: INTEGER_COMMAND_VEC_ID
actions:
GET:
@ -1736,7 +1736,7 @@ readout:
rx_clearroi:
inherit_actions: EXECUTE_SET_COMMAND_NOID
help: "Resets Region of interest in receiver. Default is all channels/pixels enabled."
help: "\n\tResets Region of interest in receiver. Default is all channels/pixels enabled."
actions:
PUT:
function: clearRxROI
@ -1779,7 +1779,7 @@ udp_validate:
clearroi:
inherit_actions: EXECUTE_SET_COMMAND
help: "[Gotthard] Resets Region of interest in detector. All channels enabled. Default is all channels enabled."
help: "\n\t[Gotthard] Resets Region of interest in detector. All channels enabled. Default is all channels enabled."
actions:
PUT:
function: clearROI
@ -2034,7 +2034,7 @@ framecounter:
################# GET_COMMAND_HEX ############################
serialnumber:
inherit_actions: GET_COMMAND
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb]\nSerial number of detector."
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb]\n\tSerial number of detector."
actions:
GET:
function: getSerialNumber
@ -3147,7 +3147,7 @@ maxclkphaseshift:
function: getMaxClockPhaseShift
clkdiv:
help: "[n_clock] [n_divider]\n\t[Gotthard2][Mythen3] Clock Divider of clock n_clock. Must be greater than 1.n\t[Gotthard2] Clock index range: 0-5\n\t[Mythen3] Clock index range: 0"
help: "[n_clock] [n_divider]\n\t[Gotthard2][Mythen3] Clock Divider of clock n_clock. Must be greater than 1.\n\t[Gotthard2] Clock index range: 0-5\n\t[Mythen3] Clock index range: 0"
actions:
GET:
extra_variables:
@ -3429,7 +3429,7 @@ udp_dstlist:
output: [ ToString(args) ]
txdelay:
help: "[n_delay]\n\t[Eiger][Jungfrau][Moench][Mythen3] Set transmission delay for all modules in the detector using the step size provided.Sets up \n\t\t[Eiger] txdelay_left to (2 * mod_index * n_delay), \n\t\t[Eiger] txdelay_right to ((2 * mod_index + 1) * n_delay) and \n\t\t[Eiger] txdelay_frame to (2 *num_modules * n_delay) \n\t\t[Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules * n_delay) \nfor every module."
help: "[n_delay]\n\t[Eiger][Jungfrau][Moench][Mythen3] Set transmission delay for all modules in the detector using the step size provided.Sets up \n\t[Eiger] txdelay_left to (2 * mod_index * n_delay), \n\t[Eiger] txdelay_right to ((2 * mod_index + 1) * n_delay) and \n\t[Eiger] txdelay_frame to (2 *num_modules * n_delay)\n\t[Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules * n_delay) for every module."
actions:
GET:
argc: 0
@ -3560,7 +3560,7 @@ temp_event:
output: [ '"cleared"' ]
pedestalmode:
help: " [frames<uint8_t>] [loops<uint16_t>]\n\t\t[Jungfrau] Enable pedestal mode. \n\t\tThe number of frames or triggers is overwritten by: \n\t\t(#pedestal_frames x #pedestal_loops x 2). \n\t\tIn auto timing mode or in trigger mode with #frames > 1, \n\t\t#frames is overwritten and #triggers = 1, \n\t\telse #triggers is overwritten and #frames = 1. \n\t\tOne cannot set #frames, #triggers or timing mode in pedestal mode (exception thrown).\n\npedestalmode [0]\n\t\t[Jungfrau] Disable pedestal mode.\n\t\tDisabling pedestal mode will set back the normal mode values of #frames and #triggers."
help: " [frames<uint8_t>] [loops<uint16_t>]\n\t\t[Jungfrau] Enable pedestal mode. \n\t\tThe number of frames or triggers is overwritten by: \n\t\t(#pedestal_frames x #pedestal_loops x 2). \n\t\tIn auto timing mode or in trigger mode with #frames > 1, \n\t\t#frames is overwritten and #triggers = 1, \n\t\telse #triggers is overwritten and #frames = 1. \n\t\tOne cannot set #frames, #triggers or timing mode in pedestal mode (exception thrown).\n\tpedestalmode [0]\n\t\t[Jungfrau] Disable pedestal mode.\n\t\tDisabling pedestal mode will set back the normal mode values of #frames and #triggers."
actions:
GET:
argc: 0
@ -3627,7 +3627,7 @@ inj_ch:
output: [ ToString(args) ]
vetophoton:
help: "[ichip] [#photons] [energy in keV] [reference file]\n\t[Gotthard2] Set veto reference for 128 channels for chip ichip according to reference file and #photons and energy in keV.\n[ichip] [output file]\n\t Get gain indices and veto reference for 128 channels for chip ichip, saved to file."
help: "[ichip] [#photons] [energy in keV] [reference file]\n\t[Gotthard2] Set veto reference for 128 channels for chip ichip according to reference file and #photons and energy in keV.\n\t[ichip] [output file]\n\t Get gain indices and veto reference for 128 channels for chip ichip, saved to file."
actions:
GET:
argc: 2
@ -3963,7 +3963,7 @@ patloop:
output: [level,"' '" , "'['" , "ToStringHex(start, 4)" , '", "' , "ToStringHex(stop, 4)", "']'" ]
patloop0:
help: "Deprecated command. Use patloop."
help: "\n\tDeprecated command. Use patloop."
inherit_actions: patloop
actions:
GET:
@ -4010,7 +4010,7 @@ patnloop:
output: [ level,"' '" , nloops ]
patnloop0:
help: "Deprecated command. Use patnloop."
help: "\n\tDeprecated command. Use patnloop."
inherit_actions: patnloop
actions:
GET:
@ -4056,7 +4056,7 @@ patwait:
output: [level,"' '" , "ToStringHex(addr, 4)" ]
patwait0:
help: "Deprecated command. Use patwait."
help: "\n\tDeprecated command. Use patwait."
inherit_actions: patwait
actions:
GET:
@ -4102,7 +4102,7 @@ patwaittime:
output: [level,"' '" , "waittime" ]
patwaittime0:
help: "Deprecated command. Use patwaittime."
help: "\n\tDeprecated command. Use patwaittime."
inherit_actions: patwaittime
actions:
GET:

View File

@ -67,8 +67,7 @@ activate:
store_result_in_t: false
command_name: activate
function_alias: activate
help: "[0, 1] \n\t[Eiger] 1 is default. 0 deactivates readout and does not send\
\ data."
help: "[0, 1]\n\t[Eiger] 1 is default. 0 deactivates readout and does not send data."
infer_action: true
template: true
adcclk:
@ -1206,8 +1205,8 @@ clearroi:
store_result_in_t: false
command_name: clearroi
function_alias: clearroi
help: '[Gotthard] Resets Region of interest in detector. All channels enabled. Default
is all channels enabled.'
help: "\n\t[Gotthard] Resets Region of interest in detector. All channels enabled.\
\ Default is all channels enabled."
infer_action: true
template: true
clientversion:
@ -1293,7 +1292,7 @@ clkdiv:
command_name: clkdiv
function_alias: clkdiv
help: "[n_clock] [n_divider]\n\t[Gotthard2][Mythen3] Clock Divider of clock n_clock.\
\ Must be greater than 1.n\t[Gotthard2] Clock index range: 0-5\n\t[Mythen3] Clock\
\ Must be greater than 1.\n\t[Gotthard2] Clock index range: 0-5\n\t[Mythen3] Clock\
\ index range: 0"
infer_action: true
clkfreq:
@ -6078,7 +6077,7 @@ patloop0:
store_result_in_t: false
command_name: patloop0
function_alias: patloop0
help: Deprecated command. Use patloop.
help: "\n\tDeprecated command. Use patloop."
infer_action: true
patloop1:
actions:
@ -6147,7 +6146,7 @@ patloop1:
store_result_in_t: false
command_name: patloop1
function_alias: patloop1
help: Deprecated command. Use patloop.
help: "\n\tDeprecated command. Use patloop."
infer_action: true
patloop2:
actions:
@ -6216,7 +6215,7 @@ patloop2:
store_result_in_t: false
command_name: patloop2
function_alias: patloop2
help: Deprecated command. Use patloop.
help: "\n\tDeprecated command. Use patloop."
infer_action: true
patmask:
actions:
@ -6377,7 +6376,7 @@ patnloop0:
store_result_in_t: false
command_name: patnloop0
function_alias: patnloop0
help: Deprecated command. Use patnloop.
help: "\n\tDeprecated command. Use patnloop."
infer_action: true
patnloop1:
actions:
@ -6435,7 +6434,7 @@ patnloop1:
store_result_in_t: false
command_name: patnloop1
function_alias: patnloop1
help: Deprecated command. Use patnloop.
help: "\n\tDeprecated command. Use patnloop."
infer_action: true
patnloop2:
actions:
@ -6493,7 +6492,7 @@ patnloop2:
store_result_in_t: false
command_name: patnloop2
function_alias: patnloop2
help: Deprecated command. Use patnloop.
help: "\n\tDeprecated command. Use patnloop."
infer_action: true
patsetbit:
actions:
@ -6700,7 +6699,7 @@ patwait0:
store_result_in_t: false
command_name: patwait0
function_alias: patwait0
help: Deprecated command. Use patwait.
help: "\n\tDeprecated command. Use patwait."
infer_action: true
patwait1:
actions:
@ -6758,7 +6757,7 @@ patwait1:
store_result_in_t: false
command_name: patwait1
function_alias: patwait1
help: Deprecated command. Use patwait.
help: "\n\tDeprecated command. Use patwait."
infer_action: true
patwait2:
actions:
@ -6816,7 +6815,7 @@ patwait2:
store_result_in_t: false
command_name: patwait2
function_alias: patwait2
help: Deprecated command. Use patwait.
help: "\n\tDeprecated command. Use patwait."
infer_action: true
patwaittime:
actions:
@ -6937,7 +6936,7 @@ patwaittime0:
store_result_in_t: false
command_name: patwaittime0
function_alias: patwaittime0
help: Deprecated command. Use patwaittime.
help: "\n\tDeprecated command. Use patwaittime."
infer_action: true
patwaittime1:
actions:
@ -6995,7 +6994,7 @@ patwaittime1:
store_result_in_t: false
command_name: patwaittime1
function_alias: patwaittime1
help: Deprecated command. Use patwaittime.
help: "\n\tDeprecated command. Use patwaittime."
infer_action: true
patwaittime2:
actions:
@ -7053,7 +7052,7 @@ patwaittime2:
store_result_in_t: false
command_name: patwaittime2
function_alias: patwaittime2
help: Deprecated command. Use patwaittime.
help: "\n\tDeprecated command. Use patwaittime."
infer_action: true
patword:
actions:
@ -7172,7 +7171,7 @@ pedestalmode:
\ x #pedestal_loops x 2). \n\t\tIn auto timing mode or in trigger mode with #frames\
\ > 1, \n\t\t#frames is overwritten and #triggers = 1, \n\t\telse #triggers is\
\ overwritten and #frames = 1. \n\t\tOne cannot set #frames, #triggers or timing\
\ mode in pedestal mode (exception thrown).\n\npedestalmode [0]\n\t\t[Jungfrau]\
\ mode in pedestal mode (exception thrown).\n\tpedestalmode [0]\n\t\t[Jungfrau]\
\ Disable pedestal mode.\n\t\tDisabling pedestal mode will set back the normal\
\ mode values of #frames and #triggers."
infer_action: true
@ -8442,7 +8441,8 @@ rx_clearroi:
store_result_in_t: false
command_name: rx_clearroi
function_alias: rx_clearroi
help: Resets Region of interest in receiver. Default is all channels/pixels enabled.
help: "\n\tResets Region of interest in receiver. Default is all channels/pixels\
\ enabled."
infer_action: true
template: true
rx_dbitlist:
@ -9754,7 +9754,7 @@ serialnumber:
store_result_in_t: true
command_name: serialnumber
function_alias: serialnumber
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb]\nSerial number\
help: "\n\t[Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][Ctb]\n\tSerial number\
\ of detector."
infer_action: true
template: true
@ -11446,9 +11446,9 @@ timing:
store_result_in_t: false
command_name: timing
function_alias: timing
help: "[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Moench][Gotthard][Ctb][Gotthard2][Xilinx\
\ Ctb] [auto|trigger]\n\t[Mythen3] [auto|trigger|gating|trigger_gating]\n\t[Eiger]\
\ [auto|trigger|gating|burst_trigger]"
help: "[auto|trigger|gating|burst_trigger|trigger_gating]\n\tTiming Mode of detector.\n\
\t[Jungfrau][Moench][Gotthard][Ctb][Gotthard2][Xilinx Ctb] [auto|trigger]\n\t\
[Mythen3] [auto|trigger|gating|trigger_gating]\n\t[Eiger] [auto|trigger|gating|burst_trigger]"
infer_action: true
template: true
timing_info_decoder:
@ -11913,11 +11913,11 @@ txdelay:
command_name: txdelay
function_alias: txdelay
help: "[n_delay]\n\t[Eiger][Jungfrau][Moench][Mythen3] Set transmission delay for\
\ all modules in the detector using the step size provided.Sets up \n\t\t[Eiger]\
\ txdelay_left to (2 * mod_index * n_delay), \n\t\t[Eiger] txdelay_right to ((2\
\ * mod_index + 1) * n_delay) and \n\t\t[Eiger] txdelay_frame to (2 *num_modules\
\ * n_delay) \n\t\t[Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules\
\ * n_delay) \nfor every module."
\ all modules in the detector using the step size provided.Sets up \n\t[Eiger]\
\ txdelay_left to (2 * mod_index * n_delay), \n\t[Eiger] txdelay_right to ((2\
\ * mod_index + 1) * n_delay) and \n\t[Eiger] txdelay_frame to (2 *num_modules\
\ * n_delay)\n\t[Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules * n_delay)\
\ for every module."
infer_action: true
txdelay_frame:
actions:
@ -12417,10 +12417,11 @@ udp_firstdst:
store_result_in_t: false
command_name: udp_firstdst
function_alias: udp_firstdst
help: "\n[0 - 31 (or number of udp destinations)]\n\t[Jungfrau][Moench][Gotthard2]\n\
[0-63]\n\t[Mythen3]\n\n\t One can set which is the first destination that the\
\ detector will stream images out from in a round robin fashion. The entry must\
\ not have been empty. Default: 0"
help: "\n\t[0 - N]\n\twhere N is the max number of udp destinations - 1.\n\t[Jungfrau][Moench][Gotthard2]\
\ Max number of udp destinations is 32.\n\t[Mythen3] Max number of udp destination\
\ is 64.\n\t One can set which is the first destination that the detector will\
\ stream images out from in a round robin fashion. The entry must not have been\
\ empty. Default: 0"
infer_action: true
template: true
udp_numdst:
@ -13710,7 +13711,7 @@ vetophoton:
function_alias: vetophoton
help: "[ichip] [#photons] [energy in keV] [reference file]\n\t[Gotthard2] Set veto\
\ reference for 128 channels for chip ichip according to reference file and #photons\
\ and energy in keV.\n[ichip] [output file]\n\t Get gain indices and veto reference\
\ and energy in keV.\n\t[ichip] [output file]\n\t Get gain indices and veto reference\
\ for 128 channels for chip ichip, saved to file."
infer_action: true
vetoref:

View File

@ -60,7 +60,6 @@ def generate(
if command["help"].startswith('code:'):
codegen.write_line(command["help"].strip('code:'))
else:
codegen.write_line(f'os << "Command: {command_name}" << std::endl;')
codegen.write_line(f'os << R"V0G0N({command["help"]} )V0G0N" << std::endl;')
codegen.write_line('return os.str();')

View File

@ -28,7 +28,7 @@ The dump.json is the AST of the file `slsDetectorPackage/slsSupportLib/src/ToStr
```sh
# to generate the dump.json file
cd slsSupportLib/src
clang++ -Xclang -ast-dump=json -Xclang -ast-dump-filter -Xclang StringTo -c ToString.cpp -I ../include/ -std=gnu++11 > ../../slsDetectorSoftware/generator/autocomplete/dump.json
clang++ -Xclang -ast-dump=json -Xclang -ast-dump-filter -Xclang StringTo -c ToString.cpp -I ../include/ -std=gnu++11 > ../../slsDetectorSoftware/generator/autocomplete/dump.json
# clang version used: 14.0.0-1ubuntu1.1
```

View File

@ -20,7 +20,7 @@ class IpAddr;
// Free function to avoid dependence on class
// and avoid the option to free another objects
// shm by mistake
void freeSharedMemory(int detectorIndex, int moduleIndex = -1);
void freeSharedMemory(const int detectorIndex = 0, const int moduleIndex = -1);
/**
* \class Detector
@ -46,9 +46,13 @@ class Detector {
Detector(int shm_id = 0);
~Detector();
/** Free the shared memory of this detector and all modules
belonging to it */
void freeSharedMemory();
// Disable copy since SharedMemory object is unique in DetectorImpl
Detector(const Detector &other) = delete;
Detector &operator=(const Detector &other) = delete;
// Move constructor and assignment operator
Detector(Detector &&other) noexcept;
Detector &operator=(Detector &&other) noexcept;
/** Frees shared memory before loading configuration file. Set up once
normally */

File diff suppressed because it is too large Load Diff

View File

@ -55,6 +55,7 @@ class Caller {
}
std::vector<std::string> getAllCommands();
std::map<std::string, std::string> GetDeprecatedCommands();
std::string list(int action);
std::string acquire(int action);

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