mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-19 02:40:42 +02:00
* 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>
2162 lines
84 KiB
C++
2162 lines
84 KiB
C++
// SPDX-License-Identifier: LGPL-3.0-or-other
|
|
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
|
#pragma once
|
|
#include "sls/Pattern.h"
|
|
#include "sls/Result.h"
|
|
#include "sls/network_utils.h"
|
|
#include "sls/sls_detector_defs.h"
|
|
#include <chrono>
|
|
#include <map>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
namespace sls {
|
|
using ns = std::chrono::nanoseconds;
|
|
class detectorData;
|
|
class DetectorImpl;
|
|
class MacAddr;
|
|
class IpAddr;
|
|
|
|
// Free function to avoid dependence on class
|
|
// and avoid the option to free another objects
|
|
// shm by mistake
|
|
void freeSharedMemory(const int detectorIndex = 0, const int moduleIndex = -1);
|
|
|
|
/**
|
|
* \class Detector
|
|
*/
|
|
class Detector {
|
|
std::unique_ptr<DetectorImpl> pimpl;
|
|
|
|
public:
|
|
/** @name Configuration */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Configuration *
|
|
* *
|
|
* ************************************************/
|
|
|
|
/**
|
|
* @param shm_id detector shared memory id
|
|
* Default value is 0. Can be set to more values for
|
|
* multiple detectors.It is important only if you
|
|
* are controlling multiple detectors from the same pc.
|
|
*/
|
|
Detector(int shm_id = 0);
|
|
~Detector();
|
|
|
|
// 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 */
|
|
void loadConfig(const std::string &fname);
|
|
|
|
/** Shared memory not freed prior. Set up per measurement. */
|
|
void loadParameters(const std::string &fname);
|
|
|
|
void loadParameters(const std::vector<std::string> ¶meters);
|
|
|
|
Result<std::string> getHostname(Positions pos = {}) const;
|
|
|
|
/**Frees shared memory, adds detectors to the list. */
|
|
void setHostname(const std::vector<std::string> &hostname);
|
|
|
|
/** connects to n servers at local host starting at specific control port.
|
|
* Every virtual server will have a stop port (control port + 1) */
|
|
void setVirtualDetectorServers(int numServers, uint16_t startingPort);
|
|
|
|
/** Gets shared memory ID */
|
|
int getShmId() const;
|
|
|
|
std::string getPackageVersion() const;
|
|
|
|
std::string getClientVersion() const;
|
|
|
|
Result<int64_t> getFirmwareVersion(Positions pos = {}) const;
|
|
|
|
/** [Eiger] Options: FRONT_LEFT, FRONT_RIGHT */
|
|
Result<int64_t>
|
|
getFrontEndFirmwareVersion(const defs::fpgaPosition fpgaPosition,
|
|
Positions pos = {}) const;
|
|
|
|
Result<std::string> getDetectorServerVersion(Positions pos = {}) const;
|
|
|
|
Result<std::string> getHardwareVersion(Positions pos = {}) const;
|
|
|
|
Result<std::string> getKernelVersion(Positions pos = {}) const;
|
|
|
|
/* [Jungfrau][Moench][Gotthard][Mythen3][Gotthard2][CTB] */
|
|
Result<int64_t> getSerialNumber(Positions pos = {}) const;
|
|
|
|
/** [Eiger][Gotthard2][Mythen3][Jungfrau][Moench] 6 bit value (ideally
|
|
* unique) that is streamed out in the UDP header of the detector.*/
|
|
Result<int> getModuleId(Positions pos = {}) const;
|
|
|
|
Result<std::string> getReceiverVersion(Positions pos = {}) const;
|
|
|
|
/** Options: EIGER, JUNGFRAU, GOTTHARD, MOENCH, MYTHEN3, GOTTHARD2,
|
|
* CHIPTESTBOARD, XILINX_CHIPTESTBOARD */
|
|
Result<defs::detectorType> getDetectorType(Positions pos = {}) const;
|
|
|
|
/** Gets the total number of modules in shared memory */
|
|
int size() const;
|
|
|
|
bool empty() const;
|
|
|
|
defs::xy getModuleGeometry() const;
|
|
|
|
Result<defs::xy> getModuleSize(Positions pos = {}) const;
|
|
|
|
/** Gets the actual full detector size. It is the same even if ROI changes
|
|
*/
|
|
defs::xy getDetectorSize() const;
|
|
|
|
/**
|
|
* Sets the detector size in both dimensions (number of channels). \n
|
|
* This value is used to calculate row and column positions for each module
|
|
* and included into udp data packet header. \n By default, it adds modules
|
|
* in y dimension for 2d detectors and in x dimension for 1d detectors.
|
|
*/
|
|
void setDetectorSize(const defs::xy value);
|
|
|
|
/** list of possible settings for this detector */
|
|
std::vector<defs::detectorSettings> getSettingsList() const;
|
|
|
|
/** [Jungfrau][Moench][Gotthard][Gotthard2][Mythen3] */
|
|
Result<defs::detectorSettings> getSettings(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau] GAIN0, HIGHGAIN0 \n [Gotthard] DYNAMICGAIN, HIGHGAIN,
|
|
* LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n [Gotthard2] DYNAMICGAIN,
|
|
* FIXGAIN1, FIXGAIN2 \n [Mythen3] STANDARD, FAST,
|
|
* HIGHGAIN. Also changes vrshaper and vrpreamp \n [Eiger] Use threshold
|
|
* command. Settings loaded from file found in settingspath \n
|
|
* [Moench] G1_HIGHGAIN, G1_LOWGAIN, G2_HIGHCAP_HIGHGAIN,
|
|
* G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN, G2_LOWCAP_LOWGAIN, G4_HIGHGAIN,
|
|
* G4_LOWGAIN
|
|
*/
|
|
void setSettings(defs::detectorSettings value, Positions pos = {});
|
|
|
|
/** [Eiger] */
|
|
Result<int> getThresholdEnergy(Positions pos = {}) const;
|
|
|
|
/** Mythen3] threshold energy for the three counters */
|
|
Result<std::array<int, 3>> getAllThresholdEnergy(Positions pos = {}) const;
|
|
|
|
/** [Eiger][Mythen3] It loads trim files from settingspath */
|
|
void setThresholdEnergy(int threshold_ev,
|
|
defs::detectorSettings settings = defs::STANDARD,
|
|
bool trimbits = true, Positions pos = {});
|
|
|
|
/** [Mythen3] It loads trim files from settingspath. An energy of -1 will
|
|
* pick up values from detector */
|
|
void setThresholdEnergy(std::array<int, 3> threshold_ev,
|
|
defs::detectorSettings settings = defs::STANDARD,
|
|
bool trimbits = true, Positions pos = {});
|
|
|
|
/** [Eiger][Mythen3] */
|
|
Result<std::string> getSettingsPath(Positions pos = {}) const;
|
|
|
|
/** [Eiger][Mythen3] Directory where settings files are loaded from/to */
|
|
void setSettingsPath(const std::string &value, Positions pos = {});
|
|
|
|
/** [Eiger][Mythen3] If no extension specified, serial number of each module
|
|
* is attached. */
|
|
void loadTrimbits(const std::string &fname, Positions pos = {});
|
|
|
|
/** [Eiger][Mythen3] If no extension specified, serial number of each module
|
|
* is attached. */
|
|
void saveTrimbits(const std::string &fname, Positions pos = {});
|
|
|
|
/** [Eiger][Mythen3] -1 if they are all different */
|
|
Result<int> getAllTrimbits(Positions pos = {}) const;
|
|
|
|
/**[Eiger][Mythen3] */
|
|
void setAllTrimbits(int value, Positions pos = {});
|
|
|
|
/**[Eiger][Mythen3] Returns energies in eV where the module is trimmed */
|
|
Result<std::vector<int>> getTrimEnergies(Positions pos = {}) const;
|
|
|
|
/** [Eiger][Mythen3] List of trim energies, where corresponding default trim
|
|
* files exist in corresponding trim folders */
|
|
void setTrimEnergies(std::vector<int> energies, Positions pos = {});
|
|
|
|
/**[Eiger][Jungfrau][Moench] */
|
|
bool getGapPixelsinCallback() const;
|
|
|
|
/**
|
|
* [Eiger][Jungfrau][Moench]
|
|
* Include gap pixels in client data call back. Will not be in detector
|
|
* streaming, receiver file or streaming. Default is disabled.
|
|
*/
|
|
void setGapPixelsinCallback(const bool enable);
|
|
|
|
/** [Eiger][Jungfrau][Moench] */
|
|
Result<bool> getFlipRows(Positions pos = {}) const;
|
|
|
|
/** [Eiger] flips rows paramater sent to slsreceiver to stream as json
|
|
* parameter to flip rows in gui \n[Jungfrau][Moench] flips rows in the
|
|
* detector itself. For bottom module and number of interfaces must be set
|
|
* to 2. slsReceiver and slsDetectorGui does not handle.slsReceiver and
|
|
* slsDetectorGui does not handle
|
|
*/
|
|
void setFlipRows(bool value, Positions pos = {});
|
|
|
|
/** [Eiger][Mythen3][Gotthard1][Gotthard2][Jungfrau][Moench] via stop server
|
|
* **/
|
|
Result<bool> getMaster(Positions pos = {}) const;
|
|
|
|
/** [Eiger][Gotthard2][Jungfrau][Moench] Set (half) module to master and the
|
|
* other(s) to slaves */
|
|
void setMaster(bool value, int pos);
|
|
|
|
/** [Jungfrau][Moench] **/
|
|
Result<bool> getSynchronization(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau][Moench] Sync mode requires at least one master configured.
|
|
Also requires flatband cabling between master and slave with
|
|
termination board.
|
|
*/
|
|
void setSynchronization(bool value);
|
|
|
|
/** [Gotthard2][Mythen3] */
|
|
void getBadChannels(const std::string &fname, Positions pos = {}) const;
|
|
|
|
/** [Gotthard2][Mythen3]
|
|
* [Mythen3] Also does trimming
|
|
*/
|
|
void setBadChannels(const std::string &fname, Positions pos = {});
|
|
|
|
/** [Gotthard2][Mythen3] */
|
|
Result<std::vector<int>> getBadChannels(Positions pos = {}) const;
|
|
|
|
/** [Gotthard2][Mythen3] Empty list resets bad channel list */
|
|
void setBadChannels(const std::vector<int> list, Positions pos = {});
|
|
|
|
/** [Gotthard2][Mythen3] Size of list should match number of modules. Each
|
|
* value is at module level and can start at 0. Empty vector resets bad
|
|
* channel list. */
|
|
void setBadChannels(const std::vector<std::vector<int>> list);
|
|
|
|
Result<int> getRow(Positions pos = {}) const;
|
|
|
|
/** Set it in udp header. Gui uses it to rearrange for complete image */
|
|
void setRow(const int value, Positions pos = {});
|
|
|
|
Result<int> getColumn(Positions pos = {}) const;
|
|
|
|
/** Set it in udp header. Gui uses it to rearrange for complete image */
|
|
void setColumn(const int value, Positions pos = {});
|
|
|
|
Result<bool> isVirtualDetectorServer(Positions pos = {}) const;
|
|
///@}
|
|
|
|
/** @name Callbacks */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Callbacks *
|
|
* *
|
|
* ************************************************/
|
|
|
|
/** register callback for end of acquisition
|
|
* @param func function to be called with parameters:
|
|
* current progress in percentage, detector status, pArg pointer
|
|
* @param pArg pointer that is returned in call back
|
|
*/
|
|
void registerAcquisitionFinishedCallback(void (*func)(double, int, void *),
|
|
void *pArg);
|
|
|
|
/**
|
|
* register callback for accessing reconstructed complete images
|
|
* Receiver sends out images via zmq, the client reconstructs them into
|
|
* complete images. Therefore, it also enables zmq streaming from receiver
|
|
* and the client.
|
|
* @param func function to be called for each image with parameters:
|
|
* detector data structure, frame number, sub frame number (for eiger in 32
|
|
* bit mode), pArg pointer
|
|
* @param pArg pointer that is returned in call back
|
|
*/
|
|
void registerDataCallback(void (*func)(detectorData *, uint64_t, uint32_t,
|
|
void *),
|
|
void *pArg);
|
|
///@}
|
|
|
|
/** @name Acquisition Parameters */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Acquisition Parameters *
|
|
* *
|
|
* ************************************************/
|
|
|
|
Result<int64_t> getNumberOfFrames(Positions pos = {}) const;
|
|
|
|
/** In trigger mode, number of frames per trigger. In scan mode, number of
|
|
* frames is set to number of steps \n [Gotthard2] Burst mode has a maximum
|
|
* of 2720 frames. */
|
|
void setNumberOfFrames(int64_t value);
|
|
|
|
Result<int64_t> getNumberOfTriggers(Positions pos = {}) const;
|
|
|
|
void setNumberOfTriggers(int64_t value);
|
|
|
|
/** [Gotthard][Jungfrau][Moench][Eiger][CTB][Xilinx CTB][Gotthard2] \n
|
|
* [Mythen3] use function with gate index **/
|
|
Result<ns> getExptime(Positions pos = {}) const;
|
|
|
|
/** [Gotthard][Jungfrau][Moench][Eiger][CTB][Xilinx CTB][Gotthard2] \n
|
|
* [Mythen3] sets exptime for all gate signals. To specify gate index, use
|
|
* function with gate index **/
|
|
void setExptime(ns t, Positions pos = {});
|
|
|
|
Result<ns> getPeriod(Positions pos = {}) const;
|
|
|
|
void setPeriod(ns t, Positions pos = {});
|
|
|
|
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx CTB] */
|
|
Result<ns> getDelayAfterTrigger(Positions pos = {}) const;
|
|
|
|
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx CTB] */
|
|
void setDelayAfterTrigger(ns value, Positions pos = {});
|
|
|
|
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Xilinx CTB]
|
|
* [Gotthard2] only in continuous auto mode */
|
|
Result<int64_t> getNumberOfFramesLeft(Positions pos = {}) const;
|
|
|
|
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Xilinx CTB]
|
|
* Only when external trigger used */
|
|
Result<int64_t> getNumberOfTriggersLeft(Positions pos = {}) const;
|
|
|
|
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx CTB]
|
|
* [Gotthard2] only in continuous mode */
|
|
Result<ns> getPeriodLeft(Positions pos = {}) const;
|
|
|
|
/** [Gotthard][Jungfrau][Moench][CTB][Mythen3][Xilinx CTB]
|
|
* [Gotthard2] only in continuous mode */
|
|
Result<ns> getDelayAfterTriggerLeft(Positions pos = {}) const;
|
|
|
|
Result<int> getDynamicRange(Positions pos = {}) const;
|
|
|
|
/**
|
|
* [Eiger] Options: 4, 8, 12, 16, 32. If i is 32, also sets clkdivider to 2,
|
|
* else sets clkdivider to 1 \n [Mythen3] Options: 8, 16, 32 \n
|
|
* [Jungfrau][Moench][Gotthard][CTB][Mythen3][Gotthard2][Xilinx CTB] 16
|
|
*/
|
|
void setDynamicRange(int value);
|
|
|
|
/** list of possible dynamic ranges for this detector */
|
|
std::vector<int> getDynamicRangeList() const;
|
|
|
|
Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
|
|
|
|
/**
|
|
* [Gotthard][Jungfrau][Moench][Gotthard][CTB][Gotthard2][Xilinx CTB]
|
|
* Options: AUTO_TIMING, TRIGGER_EXPOSURE \n [Mythen3] Options: AUTO_TIMING,
|
|
* TRIGGER_EXPOSURE, GATED, TRIGGER_GATED \n [Eiger] Options: AUTO_TIMING,
|
|
* TRIGGER_EXPOSURE, GATED, BURST_TRIGGER
|
|
*/
|
|
void setTimingMode(defs::timingMode value, Positions pos = {});
|
|
|
|
/** list of possible timing modes for this detector */
|
|
std::vector<defs::timingMode> getTimingModeList() const;
|
|
|
|
/** [Eiger][Jungfrau][Moench][Gotthard2][Mythen3] */
|
|
Result<defs::speedLevel> getReadoutSpeed(Positions pos = {}) const;
|
|
|
|
/** [Eiger][Jungfrau][Moench][Gotthard2]
|
|
* [Jungfrau][Mythen3] Options: FULL_SPEED, HALF_SPEED (Default),
|
|
* QUARTER_SPEED \n [Moench] Options: FULL_SPEED (Default) \n [Eiger]
|
|
* Options: FULL_SPEED (Default), HALF_SPEED, QUARTER_SPEED \n [Gotthard2]
|
|
* Options: G2_108MHZ (Default), G2_144MHZ \n [Jungfrau][Moench] FULL_SPEED
|
|
* option only available from v2.0 boards and is recommended to set number
|
|
* of interfaces to 2. \n Also overwrites adcphase to recommended default.
|
|
*/
|
|
void setReadoutSpeed(defs::speedLevel value, Positions pos = {});
|
|
|
|
/** list of possible readoutspeed modes for this detector */
|
|
std::vector<defs::speedLevel> getReadoutSpeedList() const;
|
|
|
|
/** [Jungfrau][Moench][CTB] */
|
|
Result<int> getADCPhase(Positions pos = {}) const;
|
|
|
|
/** [Gotthard][Jungfrau][Moench][CTB]
|
|
* [Jungfrau][Moench] Absolute phase shift. Changing Speed also resets
|
|
* adcphase to recommended defaults. \n [Ctb] Absolute phase shift. Changing
|
|
* adcclk also resets adcphase and sets it to previous values. \n [Gotthard]
|
|
* Relative phase shift
|
|
*/
|
|
void setADCPhase(int value, Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench][CTB] */
|
|
Result<int> getMaxADCPhaseShift(Positions pos = {}) const;
|
|
|
|
/** [Gotthard][Jungfrau][Moench][CTB] */
|
|
Result<int> getADCPhaseInDegrees(Positions pos = {}) const;
|
|
|
|
/** [Gotthard][Jungfrau][Moench][CTB]
|
|
* [Jungfrau][Moench] Absolute phase shift. Changing Speed also resets
|
|
* adcphase to recommended defaults. \n [Ctb] Absolute phase shift. Changing
|
|
* adcclk also resets adcphase and sets it to previous values. \n [Gotthard]
|
|
* Relative phase shift
|
|
*/
|
|
void setADCPhaseInDegrees(int value, Positions pos = {});
|
|
|
|
/** [CTB][Jungfrau] */
|
|
Result<int> getDBITPhase(Positions pos = {}) const;
|
|
|
|
/** [CTB][Jungfrau] Absolute phase shift \n
|
|
* [CTB] changing dbitclk also resets dbitphase and sets to previous values.
|
|
*/
|
|
void setDBITPhase(int value, Positions pos = {});
|
|
|
|
/** [CTB][Jungfrau] */
|
|
Result<int> getMaxDBITPhaseShift(Positions pos = {}) const;
|
|
|
|
/** [CTB][Jungfrau] */
|
|
Result<int> getDBITPhaseInDegrees(Positions pos = {}) const;
|
|
|
|
/** [CTB][Jungfrau] Absolute phase shift \n
|
|
* [CTB] changing dbitclk also resets dbitphase and sets to previous values.
|
|
*/
|
|
void setDBITPhaseInDegrees(int value, Positions pos = {});
|
|
|
|
/** [Mythen3][Gotthard2] Hz */
|
|
Result<int> getClockFrequency(int clkIndex, Positions pos = {});
|
|
|
|
/** [Mythen3][Gotthard2] */
|
|
Result<int> getClockPhase(int clkIndex, Positions pos = {});
|
|
|
|
/** [Mythen3][Gotthard2] absolute phase shift \n
|
|
* [Gotthard2] clkIndex: 0-5, [Mythen3] clkIndex 0 only */
|
|
void setClockPhase(int clkIndex, int value, Positions pos = {});
|
|
|
|
/** [Mythen3][Gotthard2] */
|
|
Result<int> getMaxClockPhaseShift(int clkIndex, Positions pos = {});
|
|
|
|
/** [Mythen3][Gotthard2] */
|
|
Result<int> getClockPhaseinDegrees(int clkIndex, Positions pos = {});
|
|
|
|
/** [Mythen3][Gotthard2] \n
|
|
* [Gotthard2] clkIndex: 0-5, [Mythen3] clkIndex 0 only */
|
|
void setClockPhaseinDegrees(int clkIndex, int value, Positions pos = {});
|
|
|
|
/** [Mythen3][Gotthard2] */
|
|
Result<int> getClockDivider(int clkIndex, Positions pos = {});
|
|
|
|
/** [Mythen3][Gotthard2] Must be greater than 1. \n
|
|
* [Gotthard2] clkIndex: 0-5, [Mythen3] clkIndex 0 only */
|
|
void setClockDivider(int clkIndex, int value, Positions pos = {});
|
|
|
|
Result<int> getHighVoltage(Positions pos = {}) const;
|
|
|
|
/**
|
|
* [Gotthard] Options: 0, 90, 110, 120, 150, 180, 200
|
|
* [Jungfrau][Moench][CTB] Options: 0, 60 - 200
|
|
* [Eiger][Mythen3][Gotthard2] Options: 0 - 200
|
|
*/
|
|
void setHighVoltage(int value, Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench][Mythen3][Gotthard2][Xilinx Ctb] */
|
|
Result<bool> getPowerChip(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau][Moench][Mythen3][Gotthard2][Xilinx Ctb] Power the chip. \n
|
|
* Default is disabled. \n
|
|
* [Jungfrau][Moench] Default is disabled. Get will return power status. Can
|
|
* be off if temperature event occured (temperature over temp_threshold with
|
|
* temp_control enabled. Will configure chip (only chip v1.1)\n
|
|
* [Mythen3][Gotthard2] Default is 1. If module not connected or wrong
|
|
* module, powerchip will fail.\n
|
|
* [Xilinx CTB] Default is 0. Also configures chip if powered on.
|
|
*/
|
|
void setPowerChip(bool on, Positions pos = {});
|
|
|
|
/** [Gotthard][Eiger virtual] */
|
|
Result<int> getImageTestMode(Positions pos = {});
|
|
|
|
/** [Gotthard] If 1, adds channel intensity with precalculated values.
|
|
* Default is 0 \n
|
|
* [Eiger][Jungfrau][Moench] Only for virtual servers, if 1, pixels are
|
|
* saturated. If 0, increasing intensity */
|
|
void setImageTestMode(const int value, Positions pos = {});
|
|
|
|
/** gets list of temperature indices for this detector */
|
|
std::vector<defs::dacIndex> getTemperatureList() const;
|
|
|
|
/**
|
|
* (Degrees)
|
|
* [Mythen3][Gotthard2][Xilinx Ctb] Options: TEMPERATURE_FPGA
|
|
* [Gotthard] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA \n
|
|
* [Jungfrau][Moench] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA \n
|
|
* [Eiger] Options: TEMPERATURE_FPGA, TEMPERATURE_FPGAEXT, TEMPERATURE_10GE,
|
|
* TEMPERATURE_DCDC, TEMPERATURE_SODL, TEMPERATURE_SODR, TEMPERATURE_FPGA2,
|
|
* TEMPERATURE_FPGA3 \n [CTB] Options: SLOW_ADC_TEMP
|
|
*/
|
|
Result<int> getTemperature(defs::dacIndex index, Positions pos = {}) const;
|
|
|
|
/** gets list of dac enums for this detector */
|
|
std::vector<defs::dacIndex> getDacList() const;
|
|
|
|
/** [Eiger][Jungfrau][Moench][Gotthard][Gotthard2][Mythen3] */
|
|
Result<int> getDefaultDac(defs::dacIndex index, Positions pos = {});
|
|
|
|
/** [Eiger][Jungfrau][Moench][Gotthard][Gotthard2][Mythen3] */
|
|
void setDefaultDac(defs::dacIndex index, int defaultValue,
|
|
Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench][Mythen3] */
|
|
Result<int> getDefaultDac(defs::dacIndex index, defs::detectorSettings sett,
|
|
Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench][Mythen3] */
|
|
void setDefaultDac(defs::dacIndex index, int defaultValue,
|
|
defs::detectorSettings sett, Positions pos = {});
|
|
|
|
/** [Eiger][Jungfrau][Moench][Gotthard][Gotthard2][Mythen3]
|
|
reset to defaults, hardReset will reset to hardcoded defaults on on-board
|
|
server */
|
|
void resetToDefaultDacs(const bool hardReset, Positions pos = {});
|
|
|
|
Result<int> getDAC(defs::dacIndex index, bool mV = false,
|
|
Positions pos = {}) const;
|
|
|
|
void setDAC(defs::dacIndex index, int value, bool mV = false,
|
|
Positions pos = {});
|
|
|
|
/**[Gotthard2] */
|
|
Result<int> getOnChipDAC(defs::dacIndex index, int chipIndex,
|
|
Positions pos = {}) const;
|
|
|
|
/**[Gotthard2] */
|
|
void setOnChipDAC(defs::dacIndex index, int chipIndex, int value,
|
|
Positions pos = {});
|
|
|
|
/** [Gotthard] signal index is 0
|
|
* [Mythen3] signal index 0-3 for master input, 4-7 master output signals */
|
|
Result<defs::externalSignalFlag>
|
|
getExternalSignalFlags(int signalIndex, Positions pos = {}) const;
|
|
|
|
/** [Gotthard] signal index is 0
|
|
* Options: TRIGGER_IN_RISING_EDGE, TRIGGER_IN_FALLING_EDGE
|
|
* [Mythen3] signal index 0 is master input trigger signal, 1-3 for master
|
|
* input gate signals, 4 is busy out signal, 5-7 is master output gate
|
|
* signals.
|
|
* Options: TRIGGER_IN_RISING_EDGE, TRIGGER_IN_FALLING_EDGE (for
|
|
* master input trigger only), INVERSION_ON, INVERSION_OFF */
|
|
void setExternalSignalFlags(int signalIndex, defs::externalSignalFlag value,
|
|
Positions pos = {});
|
|
|
|
/** [Eiger][Mythen3][Gotthard2][Moench] */
|
|
Result<bool> getParallelMode(Positions pos = {}) const;
|
|
|
|
/** [Eiger][Mythen3][Gotthard2][Moench]
|
|
* [Mythen3] If exposure time is too short, acquisition will return with an
|
|
* ERROR and take fewer frames than expected \n
|
|
* [Mythen3][Eiger][Moench] Default: Non parallel \n
|
|
* [Gotthard2] Default: Parallel. Non parallel mode works only in continuous
|
|
* mode.*/
|
|
void setParallelMode(bool value, Positions pos = {});
|
|
|
|
/** [Gotthard2][Jungfrau] */
|
|
Result<int> getFilterResistor(Positions pos = {}) const;
|
|
|
|
/** [Gotthard2][Jungfrau] Set filter resistor. Increasing values for
|
|
* increasing resistance.\n[Gotthard2] Options: [0|1|2|3]. Default is
|
|
* 0.\n[Jungfrau] Options: [0|1]. Default is 1.*/
|
|
void setFilterResistor(int value, Positions pos = {});
|
|
|
|
/** [Gotthard2][Jungfrau] */
|
|
Result<defs::currentSrcParameters>
|
|
getCurrentSource(Positions pos = {}) const;
|
|
|
|
/** [Gotthard2][Jungfrau] Please refer documentation on
|
|
* currentSrcParameters (sls_detector_defs.h) on the structure and its
|
|
* members */
|
|
void setCurrentSource(defs::currentSrcParameters par, Positions pos = {});
|
|
|
|
/** [CTB][Gotthard2] */
|
|
Result<int> getDBITPipeline(Positions pos = {}) const;
|
|
|
|
/** [CTB] Options: 0-255 \n [Gotthard2] Options: 0-7 */
|
|
void setDBITPipeline(int value, Positions pos = {});
|
|
|
|
/** [Eiger][Jungfrau][Moench] */
|
|
Result<int> getReadNRows(Positions pos = {}) const;
|
|
|
|
/** [Eiger] Number of rows to read out per half module
|
|
* Options: 0 - 256. 256 is default. The permissible values depend on
|
|
* dynamic range and 10Gbe enabled. \n[Jungfrau][Moench] Number of rows per
|
|
* module starting from the centre. Options: 8 - 512, must be multiples
|
|
* of 8. Default is 512.
|
|
*/
|
|
void setReadNRows(const int lines, Positions pos = {});
|
|
|
|
///@}
|
|
|
|
/** @name Acquisition */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Acquisition *
|
|
* *
|
|
* ************************************************/
|
|
/**
|
|
* Blocking call: Acquire the number of frames set
|
|
* - sets acquiring flag
|
|
* - starts the receiver listener (if enabled)
|
|
* - starts detector acquisition for number of frames set
|
|
* - monitors detector status from running to idle
|
|
* - stops the receiver listener (if enabled)
|
|
* - increments file index if file write enabled
|
|
* - resets acquiring flag
|
|
* Control server is blocked and cannot accept other commands until
|
|
* acquisition is done.
|
|
*/
|
|
void acquire();
|
|
|
|
/** If acquisition aborted during blocking acquire, use this to clear
|
|
* acquiring flag in shared memory before starting next acquisition */
|
|
void clearAcquiringFlag();
|
|
|
|
/** Non Blocking: Start receiver listener and create data file if file write
|
|
* enabled */
|
|
void startReceiver();
|
|
|
|
/** Non Blocking: Stops receiver listener for detector data packets and
|
|
closes current data file (if file write enabled). */
|
|
void stopReceiver();
|
|
|
|
/** Non blocking: start detector acquisition. Status changes to RUNNING or
|
|
* WAITING and automatically returns to idle at the end of acquisition.
|
|
[Mythen3] Master starts acquisition first */
|
|
void startDetector(Positions pos = {});
|
|
|
|
/** [Mythen3] Non blocking: start detector readout of counters in chip.
|
|
* Status changes to TRANSMITTING and automatically returns to idle at the
|
|
* end of readout.
|
|
[Eiger] Master stops acquisition last */
|
|
void startDetectorReadout();
|
|
|
|
/** Non blocking: Abort detector acquisition. Status changes to IDLE or
|
|
* STOPPED. Goes to stop server. */
|
|
void stopDetector(Positions pos = {});
|
|
|
|
/** IDLE, ERROR, WAITING, RUN_FINISHED, TRANSMITTING, RUNNING, STOPPED \n
|
|
* Goes to stop server */
|
|
Result<defs::runStatus> getDetectorStatus(Positions pos = {}) const;
|
|
|
|
/** Options: IDLE, TRANSMITTING, RUNNING */
|
|
Result<defs::runStatus> getReceiverStatus(Positions pos = {}) const;
|
|
|
|
/** Gets the number of frames caught for each port in receiver. */
|
|
Result<std::vector<int64_t>> getFramesCaught(Positions pos = {}) const;
|
|
|
|
/** Gets the number of missing packets for each port in receiver. Negative
|
|
* number denotes extra packets. */
|
|
Result<std::vector<int64_t>> getNumMissingPackets(Positions pos = {}) const;
|
|
|
|
/** Gets frame index for each port in receiver. */
|
|
Result<std::vector<int64_t>>
|
|
getRxCurrentFrameIndex(Positions pos = {}) const;
|
|
|
|
/** [Eiger][Jungfrau][Moench][CTB][Xilinx CTB][Gotthard2] */
|
|
Result<uint64_t> getNextFrameNumber(Positions pos = {}) const;
|
|
|
|
/** [Eiger][Jungfrau][Moench][CTB][Xilinx CTB][Gotthard2] Stopping
|
|
* acquisition might result in different frame numbers for different
|
|
* modules. So, after stopping, next frame number (max + 1) is set for all
|
|
* the modules afterwards.*/
|
|
void setNextFrameNumber(uint64_t value, Positions pos = {});
|
|
|
|
/** [Eiger][Mythen3][Jungfrau][Moench] Sends an internal software trigger to
|
|
* the detector block true if command blocks till frames are sent out from
|
|
* that trigger [Eiger][Jungfrau][Moench] Block can be true
|
|
*/
|
|
void sendSoftwareTrigger(const bool block = false, Positions pos = {});
|
|
|
|
Result<defs::scanParameters> getScan(Positions pos = {}) const;
|
|
|
|
/** enables/ disables scans for dac and trimbits \n
|
|
* Enabling scan sets number of frames to number of steps in
|
|
* receiver. \n To cancel scan configuration, set dac to '0', which also
|
|
* sets number of frames to 1 \n [Eiger/ Mythen3] Trimbits using
|
|
* TRIMBIT_SCAN*/
|
|
void setScan(const defs::scanParameters t);
|
|
|
|
/** Gets Scan error message if scan ended in error for non blocking
|
|
* acquisitions.*/
|
|
Result<std::string> getScanErrorMessage(Positions pos = {}) const;
|
|
///@}
|
|
|
|
/** @name Network Configuration (Detector<->Receiver) */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Network Configuration (Detector<->Receiver) *
|
|
* *
|
|
* ************************************************/
|
|
|
|
/** [Jungfrau][Moench][Gotthard2][Eiger] */
|
|
Result<int> getNumberofUDPInterfaces(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau][Moench][Gotthard2] Number of udp interfaces to stream data
|
|
* from detector. Default is 1. \n Also enables second interface in receiver
|
|
* for listening (Writes a file per interface if writing enabled). \n Also
|
|
* restarts client and receiver zmq sockets if zmq streaming enabled. \n
|
|
* [Gotthard2] second interface enabled to send veto information via 10Gbps
|
|
* for debugging. By default, if veto enabled, it is sent via 2.5 gbps
|
|
* interface. */
|
|
void setNumberofUDPInterfaces(int n, Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench] */
|
|
Result<int> getSelectedUDPInterface(Positions pos = {}) const;
|
|
|
|
/**
|
|
* [Jungfrau][Moench]
|
|
* Effective only when number of interfaces is 1.
|
|
* Options: 0 (outer, default), 1(inner)] //TODO: enum?
|
|
*/
|
|
void selectUDPInterface(int interface, Positions pos = {});
|
|
|
|
Result<IpAddr> getSourceUDPIP(Positions pos = {}) const;
|
|
|
|
/**For Eiger 1G, the detector will replace with its own DHCP IP
|
|
* 10G Eiger and other detectors. The source UDP IP must be in the
|
|
* same subnet of the destination UDP IP
|
|
*/
|
|
void setSourceUDPIP(const IpAddr ip, Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench] bottom half [Gotthard2] veto debugging */
|
|
Result<IpAddr> getSourceUDPIP2(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau][Moench] bottom half [Gotthard2] veto debugging. \n The source
|
|
* UDP IP must be in the same subnet of the destination UDP IP2 */
|
|
void setSourceUDPIP2(const IpAddr ip, Positions pos = {});
|
|
|
|
Result<MacAddr> getSourceUDPMAC(Positions pos = {}) const;
|
|
|
|
/**For Eiger 1G, the detector will replace with its own DHCP MAC
|
|
* For Eiger 10G, the detector will replace with its own DHCP MAC + 1
|
|
* Others can be anything (beware of certain bits)
|
|
*/
|
|
void setSourceUDPMAC(const MacAddr mac, Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench] bottom half [Gotthard2] veto debugging */
|
|
Result<MacAddr> getSourceUDPMAC2(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau][Moench] bottom half [Gotthard2] veto debugging */
|
|
void setSourceUDPMAC2(const MacAddr mac, Positions pos = {});
|
|
|
|
Result<UdpDestination> getDestinationUDPList(const uint32_t entry,
|
|
Positions pos = {}) const;
|
|
|
|
void setDestinationUDPList(const UdpDestination, const int module_id);
|
|
|
|
/** [Jungfrau][Moench][Eiger][Mythen3][Gotthard2] */
|
|
Result<int> getNumberofUDPDestinations(Positions pos = {}) const;
|
|
|
|
void clearUDPDestinations(Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench][Mythen3][Gotthard2] */
|
|
Result<int> getFirstUDPDestination(Positions pos = {}) const;
|
|
|
|
/**[Jungfrau][Moench][Gotthard2] Options 0-31 (or number of udp
|
|
* destinations)\n [Mythen3] Options 0-63 (or number of udp destinations)
|
|
*/
|
|
void setFirstUDPDestination(const int value, Positions pos = {});
|
|
|
|
Result<IpAddr> getDestinationUDPIP(Positions pos = {}) const;
|
|
|
|
/** IP of the interface in receiver that the detector sends data to */
|
|
void setDestinationUDPIP(const IpAddr ip, Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench] bottom half \n [Gotthard2] veto debugging */
|
|
Result<IpAddr> getDestinationUDPIP2(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau][Moench] bottom half \n [Gotthard2] veto debugging */
|
|
void setDestinationUDPIP2(const IpAddr ip, Positions pos = {});
|
|
|
|
Result<MacAddr> getDestinationUDPMAC(Positions pos = {}) const;
|
|
|
|
/** Mac address of the receiver (destination) udp interface. Not mandatory
|
|
* to set as setDestinationUDPIP (udp_dstip) retrieves it from slsReceiver
|
|
* process but must be set if you use a custom receiver (not slsReceiver).\n
|
|
* Use router mac address if router in between detector and receiver.
|
|
*/
|
|
void setDestinationUDPMAC(const MacAddr mac, Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench] bottom half \n [Gotthard2] veto debugging */
|
|
Result<MacAddr> getDestinationUDPMAC2(Positions pos = {}) const;
|
|
|
|
/* [Jungfrau][Moench][Gotthard2] Mac address of the receiver (destination)
|
|
* udp interface 2. \n Not mandatory to set as udp_dstip2 retrieves it from
|
|
* slsReceiver process but must be set if you use a custom receiver (not
|
|
* slsReceiver). \n [Jungfrau][Moench] bottom half \n [Gotthard2] veto
|
|
* debugging \n Use router mac address if router in between detector and
|
|
* receiver.
|
|
*/
|
|
void setDestinationUDPMAC2(const MacAddr mac, Positions pos = {});
|
|
|
|
Result<uint16_t> getDestinationUDPPort(Positions pos = {}) const;
|
|
|
|
/** Default is 50001. \n If module_id is -1, ports for each module is
|
|
* calculated (incremented by 1 if no 2nd interface) */
|
|
void setDestinationUDPPort(uint16_t port, int module_id = -1);
|
|
|
|
/** [Eiger] right port[Jungfrau][Moench] bottom half [Gotthard2] veto
|
|
* debugging */
|
|
Result<uint16_t> getDestinationUDPPort2(Positions pos = {}) const;
|
|
|
|
/** [Eiger] right port[Jungfrau][Moench] bottom half [Gotthard2] veto
|
|
* debugging \n Default is 50002. \n If module_id is -1, ports for each
|
|
* module is calculated (incremented by 1 if no 2nd interface)*/
|
|
void setDestinationUDPPort2(uint16_t port, int module_id = -1);
|
|
|
|
/** Reconfigures Detector with UDP destination. More for debugging as the
|
|
* configuration is done automatically when the detector has sufficient UDP
|
|
* details. */
|
|
void reconfigureUDPDestination(Positions pos = {});
|
|
|
|
/** Validates that UDP configuration in the detector is valid. If not
|
|
* configured, it will throw with error message requesting missing udp
|
|
* information */
|
|
void validateUDPConfiguration(Positions pos = {});
|
|
|
|
Result<std::string> printRxConfiguration(Positions pos = {}) const;
|
|
|
|
/** [Eiger][CTB][Mythen3] */
|
|
Result<bool> getTenGiga(Positions pos = {}) const;
|
|
|
|
/** [Eiger][CTB][Mythen3] */
|
|
void setTenGiga(bool value, Positions pos = {});
|
|
|
|
/** [Eiger][Jungfrau][Moench] */
|
|
Result<bool> getTenGigaFlowControl(Positions pos = {}) const;
|
|
|
|
/** [Eiger][Jungfrau][Moench] */
|
|
void setTenGigaFlowControl(bool enable, Positions pos = {});
|
|
|
|
/** [Eiger][Jungfrau][Moench][Mythen3] */
|
|
Result<int> getTransmissionDelayFrame(Positions pos = {}) const;
|
|
|
|
/**
|
|
* Eiger][Jungfrau][Moench][Mythen3] Transmission delay of first udp packet
|
|
* being streamed out of the module.\n[Jungfrau][Moench] [0-31] Each value
|
|
* represents 1 ms\n[Eiger] Additional delay to txndelay_left and
|
|
* txndelay_right. Each value represents 10ns. Typical value is
|
|
* 50000.\n[Mythen3] [0-16777215] Each value represents 8 ns (125 MHz
|
|
* clock), max is 134 ms.
|
|
*/
|
|
void setTransmissionDelayFrame(int value, Positions pos = {});
|
|
|
|
/** [Eiger] */
|
|
Result<int> getTransmissionDelayLeft(Positions pos = {}) const;
|
|
|
|
/**[Eiger] Transmission delay of first packet in an image being streamed out
|
|
* of the module's left UDP port. Each value represents 10ns. Typical value
|
|
* is 50000.
|
|
*/
|
|
void setTransmissionDelayLeft(int value, Positions pos = {});
|
|
|
|
/** [Eiger] Transmission delay of first packet in an image being streamed
|
|
* out of the module's right UDP port. Each value represents 10ns. Typical
|
|
* value is 50000. */
|
|
Result<int> getTransmissionDelayRight(Positions pos = {}) const;
|
|
|
|
/**
|
|
* [Eiger]
|
|
* Sets the transmission delay of first packet streamed ut of the right UDP
|
|
* port
|
|
*/
|
|
void setTransmissionDelayRight(int value, Positions pos = {});
|
|
|
|
/** [Eiger][Jungfrau][Moench] */
|
|
int getTransmissionDelay() const;
|
|
|
|
/**
|
|
* [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.
|
|
*/
|
|
void setTransmissionDelay(int step);
|
|
|
|
///@}
|
|
|
|
/** @name Receiver Configuration */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Receiver Configuration *
|
|
* *
|
|
* ************************************************/
|
|
|
|
/** true when slsReceiver is used */
|
|
Result<bool> getUseReceiverFlag(Positions pos = {}) const;
|
|
|
|
Result<std::string> getRxHostname(Positions pos = {}) const;
|
|
|
|
/**
|
|
* Sets receiver hostname or IP address for each module. \n Used for TCP
|
|
* control communication between client and receiver to configure receiver.
|
|
* Also updates receiver with detector parameters. \n Also resets any prior
|
|
* receiver property (not on detector). \n receiver is receiver hostname or
|
|
* IP address, can include tcp port eg. hostname:port
|
|
*/
|
|
void setRxHostname(const std::string &receiver, Positions pos = {});
|
|
|
|
/** multiple rx hostnames. Single element will set it for all */
|
|
void setRxHostname(const std::vector<std::string> &name);
|
|
|
|
Result<uint16_t> getRxPort(Positions pos = {}) const;
|
|
|
|
/** TCP port for client-receiver communication. \n
|
|
* Default is 1954. \n Must be different if multiple receivers on same pc.
|
|
* \n Must be first command to set a receiver parameter to be able to
|
|
* communicate. \n Multi command will automatically increment port for
|
|
* individual modules.*/
|
|
void setRxPort(uint16_t port, int module_id = -1);
|
|
|
|
Result<int> getRxFifoDepth(Positions pos = {}) const;
|
|
|
|
/** Number of frames in fifo between udp listening and processing threads */
|
|
void setRxFifoDepth(int nframes, Positions pos = {});
|
|
|
|
Result<bool> getRxSilentMode(Positions pos = {}) const;
|
|
|
|
/** Switch on or off receiver text output during acquisition */
|
|
void setRxSilentMode(bool value, Positions pos = {});
|
|
|
|
Result<defs::frameDiscardPolicy>
|
|
getRxFrameDiscardPolicy(Positions pos = {}) const;
|
|
|
|
/**
|
|
* Options: NO_DISCARD, DISCARD_EMPTY_FRAMES, DISCARD_PARTIAL_FRAMES
|
|
* Default: NO_DISCARD
|
|
* discard partial frames is the fastest
|
|
*/
|
|
void setRxFrameDiscardPolicy(defs::frameDiscardPolicy f,
|
|
Positions pos = {});
|
|
|
|
Result<bool> getPartialFramesPadding(Positions pos = {}) const;
|
|
|
|
/** Default: padding enabled. Disabling padding is the fastest */
|
|
void setPartialFramesPadding(bool value, Positions pos = {});
|
|
|
|
Result<int> getRxUDPSocketBufferSize(Positions pos = {}) const;
|
|
|
|
/** UDP socket buffer size in receiver. Tune rmem_default and rmem_max
|
|
* accordingly. Max value is INT_MAX/2. */
|
|
void setRxUDPSocketBufferSize(int udpsockbufsize, Positions pos = {});
|
|
|
|
/** TODO:
|
|
* Gets actual udp socket buffer size. Double the size of rx_udpsocksize due
|
|
* to kernel bookkeeping.
|
|
*/
|
|
Result<int> getRxRealUDPSocketBufferSize(Positions pos = {}) const;
|
|
|
|
Result<bool> getRxLock(Positions pos = {});
|
|
|
|
/** Lock receiver to one client IP, 1 locks, 0 unlocks. Default is unlocked.
|
|
*/
|
|
void setRxLock(bool value, Positions pos = {});
|
|
|
|
/** Client IP Address that last communicated with the receiver */
|
|
Result<IpAddr> getRxLastClientIP(Positions pos = {}) const;
|
|
|
|
/** Get kernel thread ids from the receiver in order of [parent, tcp,
|
|
* listener 0, processor 0, streamer 0, listener 1, processor 1, streamer 1,
|
|
* arping]. If no streamer yet or there is no second interface, it gives 0
|
|
* in its place.
|
|
*/
|
|
Result<std::array<pid_t, NUM_RX_THREAD_IDS>>
|
|
getRxThreadIds(Positions pos = {}) const;
|
|
|
|
Result<bool> getRxArping(Positions pos = {}) const;
|
|
|
|
/** Starts a thread in slsReceiver to arping the interface it is listening
|
|
* every minute. Useful in 10G mode. */
|
|
void setRxArping(bool value, Positions pos = {});
|
|
|
|
/** at module level */
|
|
Result<defs::ROI> getIndividualRxROIs(Positions pos) const;
|
|
|
|
defs::ROI getRxROI() const;
|
|
|
|
/** only at multi module level without gap pixels */
|
|
void setRxROI(const defs::ROI value);
|
|
|
|
void clearRxROI();
|
|
|
|
///@}
|
|
|
|
/** @name File */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* File *
|
|
* *
|
|
* ************************************************/
|
|
Result<defs::fileFormat> getFileFormat(Positions pos = {}) const;
|
|
|
|
/** default binary, Options: BINARY, HDF5 (library must be compiled with
|
|
* this option) */
|
|
void setFileFormat(defs::fileFormat f, Positions pos = {});
|
|
|
|
Result<std::string> getFilePath(Positions pos = {}) const;
|
|
|
|
/** Default is "/". If path does not exist and fwrite enabled, it will try
|
|
* to create it at start of acquisition. */
|
|
void setFilePath(const std::string &fpath, Positions pos = {});
|
|
|
|
Result<std::string> getFileNamePrefix(Positions pos = {}) const;
|
|
|
|
/** default run
|
|
* File Name: [file name prefix]_d[module index]_f[file index]_[acquisition
|
|
* index].[file format] eg. run_d0_f0_5.raw
|
|
*/
|
|
void setFileNamePrefix(const std::string &fname, Positions pos = {});
|
|
|
|
Result<int64_t> getAcquisitionIndex(Positions pos = {}) const;
|
|
|
|
/** file or Acquisition index in receiver \n
|
|
* File name: [file name prefix]_d[detector index]_f[sub file
|
|
* index]_[acquisition/file index].[raw/h5].
|
|
*/
|
|
void setAcquisitionIndex(int64_t i, Positions pos = {});
|
|
|
|
Result<bool> getFileWrite(Positions pos = {}) const;
|
|
|
|
/** default disabled */
|
|
void setFileWrite(bool value, Positions pos = {});
|
|
|
|
bool getMasterFileWrite() const;
|
|
|
|
/**default enabled */
|
|
void setMasterFileWrite(bool value);
|
|
|
|
Result<bool> getFileOverWrite(Positions pos = {}) const;
|
|
|
|
/** default overwites */
|
|
void setFileOverWrite(bool value, Positions pos = {});
|
|
|
|
Result<int> getFramesPerFile(Positions pos = {}) const;
|
|
|
|
/** Default depends on detector type. \n 0 will set frames per file in an
|
|
* acquisition to unlimited */
|
|
void setFramesPerFile(int n, Positions pos = {});
|
|
///@}
|
|
|
|
/** @name ZMQ Streaming Parameters (Receiver<->Client) */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* ZMQ Streaming Parameters (Receiver<->Client)*
|
|
* *
|
|
* ************************************************/
|
|
// TODO callback functions
|
|
|
|
Result<bool> getRxZmqDataStream(Positions pos = {}) const;
|
|
|
|
/** Enable/ disable data streaming from receiver via zmq (eg. to GUI or to
|
|
* another process for further processing). \n This creates/ destroys zmq
|
|
* streamer threads in receiver. \n Switching to Gui automatically enables
|
|
* data streaming in receiver. \n Switching back to command line or API
|
|
* acquire will require disabling data streaming in receiver for fast
|
|
* applications (if not needed for client data call backs).
|
|
*/
|
|
void setRxZmqDataStream(bool value, Positions pos = {});
|
|
|
|
Result<int> getRxZmqFrequency(Positions pos = {}) const;
|
|
|
|
/** Frequency of frames streamed out from receiver via zmq. \n Default: 1,
|
|
* Means every frame is streamed out. \n If 2, every second frame is
|
|
* streamed out. \n If 0, streaming timer is the timeout, after which
|
|
* current frame is sent out. (default timeout is 500 ms). Usually used for
|
|
* gui purposes.
|
|
*/
|
|
void setRxZmqFrequency(int freq, Positions pos = {});
|
|
|
|
Result<int> getRxZmqTimer(Positions pos = {}) const;
|
|
|
|
/**
|
|
* If receiver streaming frequency is 0 (default), then this timer between
|
|
* each data stream is set. Default is 500 ms.
|
|
*/
|
|
void setRxZmqTimer(int time_in_ms, Positions pos = {});
|
|
|
|
Result<int> getRxZmqStartingFrame(Positions pos = {}) const;
|
|
|
|
/**
|
|
* The starting frame index to stream out. 0 by default, which streams
|
|
* the first frame in an acquisition, and then depending on the rx zmq
|
|
* frequency/ timer.
|
|
*/
|
|
void setRxZmqStartingFrame(int fnum, Positions pos = {});
|
|
|
|
Result<uint16_t> getRxZmqPort(Positions pos = {}) const;
|
|
|
|
/** Zmq port for data to be streamed out of the receiver. \n
|
|
* Also restarts receiver zmq streaming if enabled. \n Default is 30001. \n
|
|
* Must be different for every detector (and udp port). \n module_id is -1
|
|
* for all detectors, ports for each module is calculated (increment by 1 if
|
|
* no 2nd interface). \n Restarts receiver zmq sockets only if it was
|
|
* already enabled
|
|
*/
|
|
void setRxZmqPort(uint16_t port, int module_id = -1);
|
|
|
|
Result<uint16_t> getClientZmqPort(Positions pos = {}) const;
|
|
|
|
/** Port number to listen to zmq data streamed out from receiver or
|
|
* intermediate process. \n Must be different for every detector (and udp
|
|
* port). \n Module_id is -1 for all detectors, ports for each module is
|
|
* calculated (increment by 1 if no 2nd interface). \n Restarts client zmq
|
|
* sockets only if it was already enabled \n Default connects to receiver
|
|
* zmq streaming out port (30001).
|
|
*/
|
|
void setClientZmqPort(uint16_t port, int module_id = -1);
|
|
|
|
Result<IpAddr> getClientZmqIp(Positions pos = {}) const;
|
|
|
|
/** Ip Address to listen to zmq data streamed out from receiver or
|
|
* intermediate process. \n Default connects to receiver zmq Ip Address
|
|
* (from rx_hostname). \n Modified only when using an intermediate process
|
|
* between receiver and client(gui). \n Also restarts client zmq streaming
|
|
* if enabled.
|
|
*/
|
|
void setClientZmqIp(const IpAddr ip, Positions pos = {});
|
|
|
|
int getClientZmqHwm() const;
|
|
|
|
/** Client's zmq receive high water mark. \n Default is the zmq library's
|
|
* default (1000), can also be set here using -1. \n This is a high number
|
|
* and can be set to 2 for gui purposes. \n One must also set the receiver's
|
|
* send high water mark to similar value. Final effect is sum of them.
|
|
*/
|
|
void setClientZmqHwm(const int limit);
|
|
|
|
Result<int> getRxZmqHwm(Positions pos = {}) const;
|
|
|
|
/** Receiver's zmq send high water mark. \n Default is the zmq library's
|
|
* default (1000) \n This is a high number and can be set to 2 for gui
|
|
* purposes. \n One must also set the client's receive high water mark to
|
|
* similar value. Final effect is sum of them. Also restarts receiver zmq
|
|
* streaming if enabled. \n Can set to -1 to set default.
|
|
*/
|
|
void setRxZmqHwm(const int limit);
|
|
|
|
///@}
|
|
|
|
/** @name Eiger Specific */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Eiger Specific *
|
|
* *
|
|
* ************************************************/
|
|
|
|
/** [Eiger] in 32 bit mode */
|
|
Result<ns> getSubExptime(Positions pos = {}) const;
|
|
|
|
/** [Eiger] in 32 bit mode */
|
|
void setSubExptime(ns t, Positions pos = {});
|
|
|
|
/** [Eiger] in 32 bit mode */
|
|
Result<ns> getSubDeadTime(Positions pos = {}) const;
|
|
|
|
/** [Eiger] in 32 bit mode */
|
|
void setSubDeadTime(ns value, Positions pos = {});
|
|
|
|
/** [Eiger] */
|
|
Result<bool> getOverFlowMode(Positions pos = {}) const;
|
|
|
|
/** [Eiger] Overflow in 32 bit mode. Default is disabled.*/
|
|
void setOverFlowMode(bool value, Positions pos = {});
|
|
|
|
/** [Eiger] deadtime in ns, 0 = disabled */
|
|
Result<ns> getRateCorrection(Positions pos = {}) const;
|
|
|
|
/** [Eiger] Sets default rate correction from trimbit file */
|
|
void setDefaultRateCorrection(Positions pos = {});
|
|
|
|
/** //TODO: default, get, set
|
|
* [Eiger] Set Rate correction
|
|
* 0 disable correction, > 0 custom deadtime, cannot be -1
|
|
*/
|
|
void setRateCorrection(ns dead_time, Positions pos = {});
|
|
|
|
/** [Eiger] */
|
|
Result<bool> getInterruptSubframe(Positions pos = {}) const;
|
|
|
|
/** [Eiger] Enable last subframe interrupt at required exposure time.
|
|
* Disabling will wait for last sub frame to finish exposing. Default is
|
|
* disabled. */
|
|
void setInterruptSubframe(const bool enable, Positions pos = {});
|
|
|
|
/** [Eiger] minimum two frames */
|
|
Result<ns> getMeasuredPeriod(Positions pos = {}) const;
|
|
|
|
/** [Eiger] */
|
|
Result<ns> getMeasuredSubFramePeriod(Positions pos = {}) const;
|
|
|
|
/** [Eiger] */
|
|
Result<bool> getActive(Positions pos = {}) const;
|
|
|
|
/** [Eiger] activated by default at hostname command. Deactivated does not
|
|
* send data or communicated with FEB or BEB */
|
|
void setActive(const bool active, Positions pos = {});
|
|
|
|
/** [Eiger] Advanced */
|
|
Result<bool> getPartialReset(Positions pos = {}) const;
|
|
|
|
/** [Eiger] Advanced used for pulsing chips. Default is Complete reset */
|
|
void setPartialReset(bool value, Positions pos = {});
|
|
|
|
/** [Eiger] Advanced
|
|
* Pulse Pixel n times at x and y coordinates */
|
|
void pulsePixel(int n, defs::xy pixel, Positions pos = {});
|
|
|
|
/** [Eiger] Advanced
|
|
* Pulse Pixel n times and move by a relative value of x and y
|
|
* coordinates */
|
|
void pulsePixelNMove(int n, defs::xy pixel, Positions pos = {});
|
|
|
|
/** [Eiger] Advanced
|
|
* Pulse chip n times. \n
|
|
* If n is -1, resets to normal mode (reset chip completely at start of
|
|
* acquisition, where partialreset = 0). */
|
|
void pulseChip(int n, Positions pos = {});
|
|
|
|
/** [Eiger] with specific quad hardware */
|
|
Result<bool> getQuad(Positions pos = {}) const;
|
|
|
|
/** [Eiger] Sets detector size to a quad. 0 (disabled) is default. (Specific
|
|
* hardware required). */
|
|
void setQuad(const bool enable);
|
|
|
|
/** [Eiger] */
|
|
Result<bool> getDataStream(const defs::portPosition port,
|
|
Positions pos = {}) const;
|
|
|
|
/** [Eiger] enable or disable data streaming from left or right of detector
|
|
* for 10GbE. Default: enabled
|
|
*/
|
|
void setDataStream(const defs::portPosition port, const bool enable,
|
|
Positions pos = {});
|
|
|
|
/** [Eiger] Advanced */
|
|
Result<bool> getTop(Positions pos = {}) const;
|
|
|
|
/** [Eiger] Advanced. Default is hardware default */
|
|
void setTop(bool value, Positions pos = {});
|
|
|
|
///@}
|
|
|
|
/** @name Jungfrau/Moench Specific */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Jungfrau/Moench Specific *
|
|
* *
|
|
* ************************************************/
|
|
|
|
/** [Jungfrau] */
|
|
Result<double> getChipVersion(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau][Moench] */
|
|
Result<int> getThresholdTemperature(Positions pos = {}) const;
|
|
|
|
/**
|
|
* [Jungfrau][Moench]Set threshold temperature in degrees.
|
|
* If temperature crosses threshold temperature
|
|
* and temperature control is enabled (default is disabled), power to chip
|
|
* will be switched off and temperature event will be set. \n To power on
|
|
* chip again, temperature has to be less than threshold temperature and
|
|
* temperature event has to be cleared.
|
|
*/
|
|
void setThresholdTemperature(int temp, Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench] */
|
|
Result<bool> getTemperatureControl(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau][Moench] refer to setThresholdTemperature
|
|
* Default is disabled */
|
|
void setTemperatureControl(bool enable, Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench] refer to setThresdholdTemperature */
|
|
Result<int> getTemperatureEvent(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau][Moench] refer to setThresdholdTemperature */
|
|
void resetTemperatureEvent(Positions pos = {});
|
|
|
|
/** [Jungfrau] */
|
|
Result<bool> getAutoComparatorDisable(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau] Advanced
|
|
* //TODO naming
|
|
* By default, the on-chip gain switching is active during the
|
|
* entire exposure. This mode disables the on-chip gain switching comparator
|
|
* automatically after 93.75% of exposure time (only for longer than 100us).
|
|
* The % is for chipv1.0. One can set the duration for chipv1.1 using
|
|
* setComparatorDisableTime\n Default is false or this mode
|
|
* disabled(comparator enabled throughout). true enables mode. 0 disables
|
|
* mode.
|
|
*/
|
|
void setAutoComparatorDisable(bool value, Positions pos = {});
|
|
|
|
/** [Jungfrau] */
|
|
Result<ns> getComparatorDisableTime(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau] Time before end of exposure when comparator is
|
|
* disabled. It is only possible for chipv1.1.*/
|
|
void setComparatorDisableTime(ns t, Positions pos = {});
|
|
|
|
/** [Jungfrau] Advanced TODO naming */
|
|
Result<int> getNumberOfAdditionalStorageCells(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau] Advanced \n
|
|
* Only for chipv1.0. Options: 0 - 15. Default: 0. \n
|
|
* The #images = #frames x #triggers x (#storagecells + 1) */
|
|
void setNumberOfAdditionalStorageCells(int value);
|
|
|
|
/** [Jungfrau] Advanced */
|
|
Result<int> getStorageCellStart(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau] Advanced. Sets the storage cell storing the first
|
|
* acquisition of the series. Options: 0-max. max is 15 (default) for
|
|
* chipv1.0 and 3 (default) for chipv1.1.
|
|
*/
|
|
void setStorageCellStart(int cell, Positions pos = {});
|
|
|
|
/** [Jungfrau] Advanced*/
|
|
Result<ns> getStorageCellDelay(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau] Advanced \n Additional time delay between 2
|
|
* consecutive exposures in burst mode. \n Options: (0-1638375 ns
|
|
* (resolution of 25ns)\n Only applicable for chipv1.0.
|
|
*/
|
|
void setStorageCellDelay(ns value, Positions pos = {});
|
|
|
|
/** list of possible gainmode */
|
|
std::vector<defs::gainMode> getGainModeList() const;
|
|
|
|
/** [Jungfrau]*/
|
|
Result<defs::gainMode> getGainMode(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau] Options: DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2,
|
|
* FIX_G1, FIX_G2, FIX_G0 \n\CAUTION: Do not use FIX_G0 without caution, you
|
|
* can damage the detector!!!\n
|
|
*/
|
|
void setGainMode(const defs::gainMode mode, Positions pos = {});
|
|
|
|
/** [Jungfrau] Advanced */
|
|
Result<int> getNumberOfFilterCells(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau] Advanced Options[0-12], only for chip v1.1
|
|
*/
|
|
void setNumberOfFilterCells(int cell, Positions pos = {});
|
|
|
|
/** [Jungfrau] */
|
|
Result<defs::pedestalParameters> getPedestalMode(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau] In pedestal mode, the number of frames or triggers is
|
|
* overwritten by \n(#pedestal_frames x #pedestal_loops x 2). \nIn
|
|
* auto timing mode or in trigger mode with #frames > 1, #frames is
|
|
* overwritten and #triggers = 1, \nelse #triggers is overwritten and
|
|
* #frames = 1. One cannot set #frames, #triggers or timing mode in pedestal
|
|
* mode (it will throw an exception). Disabling pedestal mode will set back
|
|
* the original values of #frames and #triggers
|
|
*/
|
|
void setPedestalMode(const defs::pedestalParameters par,
|
|
Positions pos = {});
|
|
|
|
/** [Jungfrau] */
|
|
Result<defs::timingInfoDecoder>
|
|
getTimingInfoDecoder(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau] Advanced Command! */
|
|
void setTimingInfoDecoder(defs::timingInfoDecoder value,
|
|
Positions pos = {});
|
|
|
|
/** [Jungfrau] */
|
|
Result<defs::collectionMode> getCollectionMode(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau] */
|
|
void setCollectionMode(defs::collectionMode value, Positions pos = {});
|
|
|
|
///@}
|
|
|
|
/** @name Gotthard Specific */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Gotthard Specific *
|
|
* *
|
|
* ************************************************/
|
|
|
|
/** [Gotthard]*/
|
|
Result<defs::ROI> getROI(Positions pos = {}) const;
|
|
|
|
/**
|
|
* [Gotthard] Region of interest in detector \n
|
|
* Options: Only a single ROI per module \n
|
|
* Either all channels or a single adc or 2 chips (256 channels). Default is
|
|
* all channels enabled (-1 -1). \n module_id is position index
|
|
*/
|
|
void setROI(defs::ROI value, int module_id);
|
|
|
|
/** [Gotthard] Clear ROI to all channels enabled. Default is all channels
|
|
* enabled. */
|
|
void clearROI(Positions pos = {});
|
|
|
|
/** [Gotthard] */
|
|
Result<ns> getExptimeLeft(Positions pos = {}) const;
|
|
///@}
|
|
|
|
/** @name Gotthard2 Specific */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Gotthard2 Specific *
|
|
* *
|
|
* ************************************************/
|
|
|
|
/** [Gotthard2] only in burst mode and auto timing mode */
|
|
Result<int64_t> getNumberOfBursts(Positions pos = {}) const;
|
|
|
|
/** [Gotthard2] only in burst mode and auto timing mode */
|
|
void setNumberOfBursts(int64_t value);
|
|
|
|
/** [Gotthard2] only in burst mode and auto timing mode */
|
|
Result<ns> getBurstPeriod(Positions pos = {}) const;
|
|
|
|
/** [Gotthard2] Period between 2 bursts. Only in burst mode and auto timing
|
|
* mode */
|
|
void setBurstPeriod(ns value, Positions pos = {});
|
|
|
|
/** [Gotthard2] only in burst auto mode */
|
|
Result<int64_t> getNumberOfBurstsLeft(Positions pos = {}) const;
|
|
|
|
/** [Gotthard2] offset channel, increment channel */
|
|
Result<std::array<int, 2>> getInjectChannel(Positions pos = {});
|
|
|
|
/** [Gotthard2]
|
|
* Inject channels with current source for calibration.
|
|
* offsetChannel is starting channel to be injected
|
|
* incrementChannel is determines succeeding channels to be injected */
|
|
void setInjectChannel(const int offsetChannel, const int incrementChannel,
|
|
Positions pos = {});
|
|
|
|
/** [Gotthard2] gain indices and adu values for each channel */
|
|
void getVetoPhoton(const int chipIndex, const std::string &fname,
|
|
Positions pos = {});
|
|
|
|
/** [Gotthard2] energy in keV */
|
|
void setVetoPhoton(const int chipIndex, const int numPhotons,
|
|
const int energy, const std::string &fname,
|
|
Positions pos = {});
|
|
|
|
/** [Gotthard2] for all chips */
|
|
void setVetoReference(const int gainIndex, const int value,
|
|
Positions pos = {});
|
|
|
|
/** [Gotthard2] Set veto reference for each 128 channels for specific chip.
|
|
* The file should have 128 rows of gain index and 12 bit value in dec"*/
|
|
void setVetoFile(const int chipIndex, const std::string &fname,
|
|
Positions pos = {});
|
|
|
|
/** [Gotthard2] */
|
|
Result<defs::burstMode> getBurstMode(Positions pos = {});
|
|
|
|
/** [Gotthard2] BURST_INTERNAL (default), BURST_EXTERNAL,
|
|
* CONTINUOUS_INTERNAL, CONTINUOUS_EXTERNAL. Also changes clkdiv 2, 3, 4 */
|
|
void setBurstMode(defs::burstMode value, Positions pos = {});
|
|
|
|
/** [Gotthard2] */
|
|
Result<bool> getCDSGain(Positions pos = {}) const;
|
|
|
|
/** default disabled */
|
|
void setCDSGain(bool value, Positions pos = {});
|
|
|
|
/** [Gotthard2] */
|
|
Result<defs::timingSourceType> getTimingSource(Positions pos = {}) const;
|
|
|
|
/** [Gotthard2] Options: TIMING_INTERNAL (default), TIMING_EXTERNAL */
|
|
void setTimingSource(defs::timingSourceType value, Positions pos = {});
|
|
|
|
/** [Gotthard2] */
|
|
Result<bool> getVeto(Positions pos = {}) const;
|
|
|
|
/** [Gotthard2] Veto data in chip, Default disabled */
|
|
void setVeto(const bool enable, Positions pos = {});
|
|
|
|
/** [Gotthard2] */
|
|
Result<defs::streamingInterface> getVetoStream(Positions pos = {}) const;
|
|
|
|
/** [Gotthard2] Options: NONE (Default), LOW_LATENCY_LINK, ETHERNET_10GB
|
|
* (debugging), ALL Enable or disable the 2 veto streaming interfaces
|
|
* available. Can concatenate more than one interface. \nLOW_LATENCY_LINK is
|
|
* the default interface to work with. \nETHERNET_10GB is for debugging and
|
|
* also enables second interface in receiver for listening to veto packets
|
|
* (writes a separate file if writing enabled). Also restarts client and
|
|
* receiver zmq sockets if zmq streaming enabled.*/
|
|
void setVetoStream(const defs::streamingInterface value,
|
|
Positions pos = {});
|
|
|
|
/** [Gotthard2] */
|
|
Result<defs::vetoAlgorithm>
|
|
getVetoAlgorithm(const defs::streamingInterface value,
|
|
Positions pos = {}) const;
|
|
|
|
/** [Gotthard2] Options(vetoAlgorithm): ALG_HITS (default), ALG_RAW.
|
|
* Options(streamingInterface): LOW_LATENCY_LINK, ETHERNET_10GB */
|
|
void setVetoAlgorithm(const defs::vetoAlgorithm alg,
|
|
const defs::streamingInterface value,
|
|
Positions pos = {});
|
|
|
|
/** [Gotthard2] */
|
|
Result<int> getADCConfiguration(const int chipIndex, const int adcIndex,
|
|
Positions pos = {}) const;
|
|
|
|
/** [Gotthard2] configures one chip at a time for specific adc, chipIndex.
|
|
* -1 for all. Setting specific chip index not implemented in hardware yet
|
|
*/
|
|
void setADCConfiguration(const int chipIndex, const int adcIndex,
|
|
const int value, Positions pos = {});
|
|
|
|
///@}
|
|
|
|
/** @name Mythen3 Specific */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Mythen3 Specific *
|
|
* *
|
|
* ************************************************/
|
|
/** [Mythen3] */
|
|
Result<uint32_t> getCounterMask(Positions pos = {}) const;
|
|
|
|
/** [Mythen3] countermask bit set for each counter index enabled. Enabling
|
|
* counters sets vth dacs to remembered values and disabling sets them to
|
|
* disabled values. Setting vth dacs explicitly overwrites them. */
|
|
void setCounterMask(uint32_t countermask, Positions pos = {});
|
|
|
|
Result<int> getNumberOfGates(Positions pos = {}) const;
|
|
|
|
/** [Mythen3] external gates in gating or trigger_gating mode (external
|
|
* gating) */
|
|
void setNumberOfGates(int value, Positions pos = {});
|
|
|
|
/** [Mythen3] exptime for each gate signal in auto or trigger timing mode
|
|
* (internal gating). Gate index: 0-2 */
|
|
Result<ns> getExptime(int gateIndex, Positions pos = {}) const;
|
|
|
|
/** [Mythen3] exptime for each gate signal in auto or trigger timing mode
|
|
* (internal gating). Gate index: 0-2, -1 for all */
|
|
void setExptime(int gateIndex, ns t, Positions pos = {});
|
|
|
|
/** [Mythen3] exptime for each gate signal in auto or trigger timing mode
|
|
* (internal gating). Gate index: 0-2, -1 for all */
|
|
Result<std::array<ns, 3>> getExptimeForAllGates(Positions pos = {}) const;
|
|
|
|
/** [Mythen3] gate delay for each gate signal in auto or trigger timing mode
|
|
* (internal gating). Gate index: 0-2 */
|
|
Result<ns> getGateDelay(int gateIndex, Positions pos = {}) const;
|
|
|
|
/** [Mythen3] gate delay for each gate signal in auto or trigger timing mode
|
|
* (internal gating). Gate index: 0-2, -1 for all */
|
|
void setGateDelay(int gateIndex, ns t, Positions pos = {});
|
|
|
|
/** [Mythen3] gate delay for all gates in auto or trigger timing mode
|
|
* (internal gating). Gate index: 0-2, -1 for all */
|
|
Result<std::array<ns, 3>> getGateDelayForAllGates(Positions pos = {}) const;
|
|
|
|
// TODO! check if we really want to expose this !!!!!
|
|
Result<int> getChipStatusRegister(Positions pos = {}) const;
|
|
|
|
void setGainCaps(int caps, Positions pos = {});
|
|
|
|
Result<int> getGainCaps(Positions pos = {});
|
|
|
|
/** [Mythen3] */
|
|
Result<defs::polarity> getPolarity(Positions pos = {}) const;
|
|
|
|
/** [Mythen3] */
|
|
void setPolarity(defs::polarity value, Positions pos = {});
|
|
|
|
/** [Mythen3] */
|
|
Result<bool> getInterpolation(Positions pos = {}) const;
|
|
|
|
/** [Mythen3] interpolation mode enables all counters and disables vth3.
|
|
* Disabling sets back counter mask and vth3. */
|
|
void setInterpolation(bool value, Positions pos = {});
|
|
|
|
/** [Mythen3] */
|
|
Result<bool> getPumpProbe(Positions pos = {}) const;
|
|
|
|
/** [Mythen3] pump probe mode only enables vth2. Disabling sets back to
|
|
* previous value */
|
|
void setPumpProbe(bool value, Positions pos = {});
|
|
|
|
/** [Mythen3] */
|
|
Result<bool> getAnalogPulsing(Positions pos = {}) const;
|
|
|
|
/** [Mythen3] */
|
|
void setAnalogPulsing(bool value, Positions pos = {});
|
|
|
|
/** [Mythen3] */
|
|
Result<bool> getDigitalPulsing(Positions pos = {}) const;
|
|
|
|
/** [Mythen3] */
|
|
void setDigitalPulsing(bool value, Positions pos = {});
|
|
|
|
///@}
|
|
|
|
/** @name CTB Specific */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* CTB / Xilinx CTB Specific *
|
|
* *
|
|
* ************************************************/
|
|
/** [CTB] */
|
|
Result<int> getNumberOfAnalogSamples(Positions pos = {}) const;
|
|
|
|
/** [CTB] */
|
|
void setNumberOfAnalogSamples(int value, Positions pos = {});
|
|
|
|
/** [CTB] */
|
|
Result<int> getADCClock(Positions pos = {}) const;
|
|
|
|
/** [CTB] */
|
|
void setADCClock(int value_in_MHz, Positions pos = {});
|
|
|
|
/** [CTB] */
|
|
Result<int> getRUNClock(Positions pos = {}) const;
|
|
|
|
/** [CTB] */
|
|
void setRUNClock(int value_in_MHz, Positions pos = {});
|
|
|
|
/** [CTB] in MHZ */
|
|
Result<int> getSYNCClock(Positions pos = {}) const;
|
|
|
|
/** gets list of power enums */
|
|
std::vector<defs::dacIndex> getPowerList() const;
|
|
|
|
/** gets list of slow adc enums */
|
|
std::vector<defs::dacIndex> getSlowADCList() const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
Result<int> getPower(defs::dacIndex index, Positions pos = {}) const;
|
|
|
|
/**
|
|
* [CTB][Xilinx CTB] mV
|
|
* [Ctb][Xilinx CTB] Options: V_LIMIT, V_POWER_A, V_POWER_B, V_POWER_C,
|
|
* V_POWER_D, V_POWER_IO, V_POWER_CHIP
|
|
*/
|
|
void setPower(defs::dacIndex index, int value, Positions pos = {});
|
|
|
|
/**
|
|
* [CTB] Options: [0- 4] or [1V, 1.14V, 1.33V, 1.6V, 2V]
|
|
*/
|
|
Result<int> getADCVpp(bool mV = false, Positions pos = {}) const;
|
|
|
|
/** [CTB] */
|
|
void setADCVpp(int value, bool mV = false, Positions pos = {});
|
|
|
|
/** [CTB] */
|
|
Result<uint32_t> getADCEnableMask(Positions pos = {}) const;
|
|
|
|
/** [CTB] */
|
|
void setADCEnableMask(uint32_t mask, Positions pos = {});
|
|
|
|
/** [CTB] */
|
|
Result<uint32_t> getTenGigaADCEnableMask(Positions pos = {}) const;
|
|
|
|
/** [CTB] If any of a consecutive 4 bits are enabled, the "
|
|
"complete 4 bits are enabled */
|
|
void setTenGigaADCEnableMask(uint32_t mask, Positions pos = {});
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
Result<uint32_t> getTransceiverEnableMask(Positions pos = {}) const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
void setTransceiverEnableMask(uint32_t mask, Positions pos = {});
|
|
|
|
/** [CTB] */
|
|
Result<int> getNumberOfDigitalSamples(Positions pos = {}) const;
|
|
|
|
/** [CTB] */
|
|
void setNumberOfDigitalSamples(int value, Positions pos = {});
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
Result<int> getNumberOfTransceiverSamples(Positions pos = {}) const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
void setNumberOfTransceiverSamples(int value, Positions pos = {});
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
Result<defs::readoutMode> getReadoutMode(Positions pos = {}) const;
|
|
|
|
/** [CTB] Options: ANALOG_ONLY (default), DIGITAL_ONLY, ANALOG_AND_DIGITAL,
|
|
* TRANSCEIVER_ONLY, DIGITAL_AND_TRANSCEIVER
|
|
* [Xilinx CTB] Options: TRANSCEIVER_ONLY (default)
|
|
*/
|
|
void setReadoutMode(defs::readoutMode value, Positions pos = {});
|
|
|
|
/** [CTB] */
|
|
Result<int> getDBITClock(Positions pos = {}) const;
|
|
|
|
/** [CTB] */
|
|
void setDBITClock(int value_in_MHz, Positions pos = {});
|
|
|
|
/**
|
|
* [CTB] mV
|
|
* Options: V_POWER_A, V_POWER_B, V_POWER_C, V_POWER_D, V_POWER_IO */
|
|
Result<int> getMeasuredPower(defs::dacIndex index,
|
|
Positions pos = {}) const;
|
|
|
|
/**
|
|
* [CTB] mA
|
|
* Options: I_POWER_A, I_POWER_B, I_POWER_C, I_POWER_D, I_POWER_IO */
|
|
Result<int> getMeasuredCurrent(defs::dacIndex index,
|
|
Positions pos = {}) const;
|
|
|
|
/** [CTB][Xilinx CTB] Options: SLOW_ADC0 - SLOW_ADC7 in uV */
|
|
Result<int> getSlowADC(defs::dacIndex index, Positions pos = {}) const;
|
|
|
|
/** [CTB] */
|
|
Result<int> getExternalSamplingSource(Positions pos = {}) const;
|
|
|
|
/** [CTB] Value between 0-63 \n For advanced users only.*/
|
|
void setExternalSamplingSource(int value, Positions pos = {});
|
|
|
|
/** [CTB] */
|
|
Result<bool> getExternalSampling(Positions pos = {}) const;
|
|
|
|
/** [CTB] For advanced users only. */
|
|
void setExternalSampling(bool value, Positions pos = {});
|
|
|
|
/** [CTB] */
|
|
Result<std::vector<int>> getRxDbitList(Positions pos = {}) const;
|
|
|
|
/** [CTB] list contains the set of digital signal bits (0-63) to save, must
|
|
* be non repetitive */
|
|
void setRxDbitList(const std::vector<int> &list, Positions pos = {});
|
|
|
|
/** [CTB] */
|
|
Result<int> getRxDbitOffset(Positions pos = {}) const;
|
|
|
|
/** [CTB] Set number of bytes of digital data to skip in the Receiver */
|
|
void setRxDbitOffset(int value, Positions pos = {});
|
|
|
|
/**
|
|
* [CTB] Set Digital IO Delay
|
|
* cannot get
|
|
* pinMask is IO mask to select the pins
|
|
* delay is delay in ps(1 bit=25ps, max of 775 ps)
|
|
*/
|
|
void setDigitalIODelay(uint64_t pinMask, int delay, Positions pos = {});
|
|
|
|
/** [CTB] */
|
|
Result<bool> getLEDEnable(Positions pos = {}) const;
|
|
|
|
/** [CTB] Default is enabled. */
|
|
void setLEDEnable(bool enable, Positions pos = {});
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
void setDacNames(const std::vector<std::string> names);
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
std::vector<std::string> getDacNames() const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
defs::dacIndex getDacIndex(const std::string &name) const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
void setDacName(const defs::dacIndex i, const std::string &name);
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
std::string getDacName(const defs::dacIndex i) const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
void setAdcNames(const std::vector<std::string> names);
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
std::vector<std::string> getAdcNames() const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
int getAdcIndex(const std::string &name) const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
void setAdcName(const int i, const std::string &name);
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
std::string getAdcName(const int i) const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
void setSignalNames(const std::vector<std::string> names);
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
std::vector<std::string> getSignalNames() const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
int getSignalIndex(const std::string &name) const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
void setSignalName(const int i, const std::string &name);
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
std::string getSignalName(const int i) const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
void setPowerNames(const std::vector<std::string> names);
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
std::vector<std::string> getPowerNames() const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
defs::dacIndex getPowerIndex(const std::string &name) const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
void setPowerName(const defs::dacIndex i, const std::string &name);
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
std::string getPowerName(const defs::dacIndex i) const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
void setSlowADCNames(const std::vector<std::string> names);
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
std::vector<std::string> getSlowADCNames() const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
defs::dacIndex getSlowADCIndex(const std::string &name) const;
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
void setSlowADCName(const defs::dacIndex i, const std::string &name);
|
|
|
|
/** [CTB][Xilinx CTB] */
|
|
std::string getSlowADCName(const defs::dacIndex i) const;
|
|
|
|
///@}
|
|
|
|
/** @name Xilinx CTB Specific */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Xilinx CTB Specific *
|
|
* *
|
|
* ************************************************/
|
|
///@}
|
|
|
|
/** [Xilinx Ctb] */
|
|
void configureTransceiver(Positions pos = {});
|
|
|
|
/** @name Pattern */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Pattern *
|
|
* *
|
|
* ************************************************/
|
|
/** [CTB][Mythen3][Xilinx CTB] Gets the pattern file name including path of
|
|
* the last pattern uploaded. \n Returns an empty if nothing was uploaded or
|
|
* via a server default file*/
|
|
Result<std::string> getPatterFileName(Positions pos = {}) const;
|
|
|
|
/** [CTB][Mythen3][Xilinx CTB] Loads ASCII pattern file directly to server
|
|
* (instead of executing line by line)*/
|
|
void setPattern(const std::string &fname, Positions pos = {});
|
|
|
|
/** [CTB][Mythen3][Xilinx CTB] Loads pattern parameters structure directly
|
|
* to server */
|
|
void setPattern(const Pattern &pat, Positions pos = {});
|
|
|
|
/** [CTB][Mythen3][Xilinx CTB] Saves pattern to file
|
|
* (ascii). \n [Ctb] Also executes pattern.*/
|
|
void savePattern(const std::string &fname);
|
|
|
|
/** [Mythen3] Loads and runs default pattern */
|
|
void loadDefaultPattern(Positions pos = {});
|
|
|
|
/** [CTB] */
|
|
Result<uint64_t> getPatternIOControl(Positions pos = {}) const;
|
|
|
|
/** [CTB] */
|
|
void setPatternIOControl(uint64_t word, Positions pos = {});
|
|
|
|
/** [CTB][Mythen3][Xilinx CTB] same as executing for ctb */
|
|
Result<uint64_t> getPatternWord(int addr, Positions pos = {});
|
|
|
|
/** [CTB][Xilinx CTB] Caution: If word is -1 reads the addr (same as
|
|
* executing the pattern)
|
|
* [Mythen3] */
|
|
void setPatternWord(int addr, uint64_t word, Positions pos = {});
|
|
|
|
/**[CTB][Mythen3][Xilinx CTB] Options: level: -1 (complete pattern) and 0-2
|
|
* levels
|
|
* @returns array of start address and stop address
|
|
*/
|
|
Result<std::array<int, 2>>
|
|
getPatternLoopAddresses(int level, Positions pos = {}) const;
|
|
|
|
/** [CTB][Mythen3][Xilinx CTB] Options: level: -1 (complete pattern) and 0-2
|
|
* levels */
|
|
void setPatternLoopAddresses(int level, int start, int stop,
|
|
Positions pos = {});
|
|
|
|
/**[CTB][Mythen3][Xilinx CTB] Options: level: -1 (complete pattern) and 0-2
|
|
* levels */
|
|
Result<int> getPatternLoopCycles(int level, Positions pos = {}) const;
|
|
|
|
/** [CTB][Mythen3][Xilinx CTB] n: 0-2, level: -1 (complete pattern) and 0-2
|
|
* levels */
|
|
void setPatternLoopCycles(int level, int n, Positions pos = {});
|
|
|
|
/**[CTB][Mythen3][Xilinx CTB] */
|
|
Result<int> getPatternWaitAddr(int level, Positions pos = {}) const;
|
|
|
|
/** [CTB][Mythen3][Xilinx CTB] Options: level 0-2 */
|
|
void setPatternWaitAddr(int level, int addr, Positions pos = {});
|
|
|
|
/** [CTB][Mythen3][Xilinx CTB] */
|
|
Result<uint64_t> getPatternWaitTime(int level, Positions pos = {}) const;
|
|
|
|
/** [CTB][Mythen3][Xilinx CTB] Options: level 0-2 */
|
|
void setPatternWaitTime(int level, uint64_t t, Positions pos = {});
|
|
|
|
/** [CTB][Mythen3][Xilinx CTB] */
|
|
Result<uint64_t> getPatternMask(Positions pos = {});
|
|
|
|
/** [CTB][Mythen3][Xilinx CTB] Selects the bits that will have a pattern
|
|
* mask applied to the selected patmask for every pattern. */
|
|
void setPatternMask(uint64_t mask, Positions pos = {});
|
|
|
|
/** [CTB][Mythen3][Xilinx CTB] */
|
|
Result<uint64_t> getPatternBitMask(Positions pos = {}) const;
|
|
|
|
/** [CTB][Mythen3][Xilinx CTB] Sets the mask applied to every pattern to the
|
|
* selected bits */
|
|
void setPatternBitMask(uint64_t mask, Positions pos = {});
|
|
|
|
/** [Mythen3] */
|
|
void startPattern(Positions pos = {});
|
|
///@}
|
|
|
|
/** @name Json Header specific */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Json Header specific *
|
|
* *
|
|
* ************************************************/
|
|
|
|
Result<std::map<std::string, std::string>>
|
|
getAdditionalJsonHeader(Positions pos = {}) const;
|
|
|
|
/** If empty, reset additional json header. Default is empty. Max
|
|
* 20 characters for each key/value. Empty value deletes header. Use only if
|
|
* to be processed by an intermediate user process listening to receiver zmq
|
|
* packets such as in Moench */
|
|
void setAdditionalJsonHeader(
|
|
const std::map<std::string, std::string> &jsonHeader,
|
|
Positions pos = {});
|
|
|
|
Result<std::string> getAdditionalJsonParameter(const std::string &key,
|
|
Positions pos = {}) const;
|
|
/**
|
|
* Sets the value for additional json header parameters. If not found,
|
|
* the pair is appended. Empty value deletes parameter. Max 20 characters
|
|
* for each key/value.
|
|
*/
|
|
void setAdditionalJsonParameter(const std::string &key,
|
|
const std::string &value,
|
|
Positions pos = {});
|
|
///@}
|
|
|
|
/** @name Advanced */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Advanced *
|
|
* *
|
|
* ************************************************/
|
|
|
|
/** [CTB][Moench] */
|
|
Result<int> getADCPipeline(Positions pos = {}) const;
|
|
|
|
/** [CTB][Moench] */
|
|
void setADCPipeline(int value, Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench][Gotthard][CTB][Mythen3][Gotthard2]
|
|
* Advanced user Function!
|
|
* Program firmware from command line, after which detector controller is
|
|
* rebooted. forceDeleteNormalFile is true, if normal file found
|
|
* in device tree, it must be deleted, a new device drive created and
|
|
* programming continued.[Jungfrau][Moench][CTB] fname is a pof file (full
|
|
* path) \n [Mythen3][Gotthard2] fname is an rbf file (full path)
|
|
*/
|
|
void programFPGA(const std::string &fname, const bool forceDeleteNormalFile,
|
|
Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench][CTB][Xilinx CTB] Advanced user Function! */
|
|
void resetFPGA(Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench][Eiger][Ctb][Mythen3][Gotthard2] Copies detector
|
|
* server via TCP (without tftp).\nMakes a symbolic link with a shorter
|
|
* name (without vx.x.x).\nThen, detector controller reboots (except
|
|
* Eiger).\n[Jungfrau][Moench][Ctb] Also deletes old server binary and
|
|
* changes respawn server to the link, which is effective after a reboot.
|
|
*/
|
|
void updateDetectorServer(const std::string &fname, Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench][Ctb][Mythen3][Gotthard2] \n
|
|
* Advanced Command!! You could damage the detector. Please use with
|
|
* caution.\nUpdates the kernel image. Then, detector controller reboots
|
|
* with new kernel
|
|
*/
|
|
void updateKernel(const std::string &fname, Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench][Gotthard][CTB][Mythen3][Gotthard2][Xilinx CTB]
|
|
* Advanced user Function! */
|
|
void rebootController(Positions pos = {});
|
|
|
|
/**
|
|
* Advanced user Function!\n [Jungfrau][Moench][Gotthard][CTB] Updates the
|
|
* firmware, detector server, make a soft link and then reboots detector
|
|
* controller. \n [Mythen3][Gotthard2] Will require a script to start up the
|
|
* shorter named server link at start up \n sname is full path name of
|
|
* detector server \n fname is programming file name with full path to it
|
|
*/
|
|
void updateFirmwareAndServer(const std::string &sname,
|
|
const std::string &fname, Positions pos = {});
|
|
|
|
Result<bool> getUpdateMode(Positions pos = {}) const;
|
|
|
|
/** Restarts detector server in update mode. This is useful when
|
|
* server-firmware compatibility is at its worst and server cannot start up
|
|
* normally */
|
|
void setUpdateMode(const bool updatemode, Positions pos = {});
|
|
|
|
/** Advanced user Function! \n
|
|
* Goes to stop server. Hence, can be called while calling blocking
|
|
* acquire(). \n [Eiger] Address is +0x100 for only left, +0x200 for only
|
|
* right. */
|
|
Result<uint32_t> readRegister(uint32_t addr, Positions pos = {}) const;
|
|
|
|
/** Advanced user Function! \n
|
|
* Goes to stop server. Hence, can be called while calling blocking
|
|
* acquire(). \n [Eiger] Address is +0x100 for only left, +0x200 for only
|
|
* right. */
|
|
void writeRegister(uint32_t addr, uint32_t val, bool validate = false,
|
|
Positions pos = {});
|
|
|
|
/** Advanced user Function! */
|
|
void setBit(uint32_t addr, int bitnr, bool validate = false,
|
|
Positions pos = {});
|
|
|
|
/** Advanced user Function! */
|
|
void clearBit(uint32_t addr, int bitnr, bool validate = false,
|
|
Positions pos = {});
|
|
|
|
/** Advanced user Function! */
|
|
Result<int> getBit(uint32_t addr, int bitnr, Positions pos = {});
|
|
|
|
/** [Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] Advanced user
|
|
* Function! */
|
|
void executeFirmwareTest(Positions pos = {});
|
|
|
|
/** [Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] Advanced user
|
|
* Function! Writes different values in a R/W register and confirms the
|
|
* writes to check bus */
|
|
void executeBusTest(Positions pos = {});
|
|
|
|
/** [Gotthard][Jungfrau][Moench][CTB] Advanced user Function! not possible
|
|
* to read back */
|
|
void writeAdcRegister(uint32_t addr, uint32_t value, Positions pos = {});
|
|
|
|
/** Advanced user Function! */
|
|
bool getInitialChecks() const;
|
|
|
|
/** Enables/disabled initial compaibility and other server start up checks.
|
|
* \n Default is enabled. Must come before 'hostname' command to take
|
|
* effect. \n Can be used to reprogram fpga when current firmware is
|
|
* incompatible. \n Advanced user Function! */
|
|
void setInitialChecks(const bool value);
|
|
|
|
/** [CTB][Jungfrau][Moench] Advanced user Function! */
|
|
Result<uint32_t> getADCInvert(Positions pos = {}) const;
|
|
|
|
/** [CTB][Jungfrau][Moench] Advanced user Function! \n
|
|
[Jungfrau][Moench] Inversions on top of default mask */
|
|
void setADCInvert(uint32_t value, Positions pos = {});
|
|
///@}
|
|
|
|
/** @name Insignificant */
|
|
///@{
|
|
/**************************************************
|
|
* *
|
|
* Insignificant *
|
|
* *
|
|
* ************************************************/
|
|
|
|
Result<uint16_t> getControlPort(Positions pos = {}) const;
|
|
|
|
/** Detector Control TCP port (for client communication with Detector
|
|
* control server) Default is 1952. Normally unchanged. Set different ports
|
|
* for virtual servers on same pc */
|
|
void setControlPort(uint16_t value, Positions pos = {});
|
|
|
|
Result<uint16_t> getStopPort(Positions pos = {}) const;
|
|
|
|
/** Port number of the stop server on detector for detector-client tcp
|
|
* interface. Default is 1953. Normally unchanged. */
|
|
void setStopPort(uint16_t value, Positions pos = {});
|
|
|
|
Result<bool> getDetectorLock(Positions pos = {}) const;
|
|
|
|
/** lock detector to one client IP. default is unlocked */
|
|
void setDetectorLock(bool lock, Positions pos = {});
|
|
|
|
/** Client IP Address that last communicated with the detector */
|
|
Result<IpAddr> getLastClientIP(Positions pos = {}) const;
|
|
|
|
/** Execute a command on the detector server console */
|
|
Result<std::string> executeCommand(const std::string &value,
|
|
Positions pos = {});
|
|
|
|
/** [Jungfrau][Moench][Mythen3][CTB][Xilinx CTB]
|
|
* [Gotthard2] only in continuous mode */
|
|
Result<int64_t> getNumberOfFramesFromStart(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau][Moench][Mythen3][CTB][Xilinx CTB] Get time from detector
|
|
* start [Gotthard2] not in burst and auto mode */
|
|
Result<ns> getActualTime(Positions pos = {}) const;
|
|
|
|
/** [Jungfrau][Moench][Mythen3][CTB][Xilinx CTB] Get timestamp at a frame
|
|
* start [Gotthard2] not in burst and auto mode */
|
|
Result<ns> getMeasurementTime(Positions pos = {}) const;
|
|
|
|
/** get user details from shared memory (hostname, type, PID, User, Date)
|
|
*/
|
|
std::string getUserDetails() const;
|
|
|
|
///@}
|
|
|
|
private:
|
|
std::vector<uint16_t> getValidPortNumbers(uint16_t start_port);
|
|
void updateRxRateCorrections();
|
|
void setNumberofUDPInterfaces_(int n, Positions pos);
|
|
};
|
|
|
|
} // namespace sls
|