3369 Commits

Author SHA1 Message Date
5f805f8789
Dev/jf firmware rollback (#1011)
* 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

* formatting, merge fix

* fixed python test simulator to kill previous servers

* rmeoved merge binary
2024-10-24 15:53:49 +02:00
60868ae74e
Dev/rm volatile (#1007)
* Removing volatile and replacing with atomic to ensure atomicity

* compiling header include issue
2024-10-23 12:39:03 +02:00
6fcdba56a4
Dev/document autocomplete (#1004)
* 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

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2024-10-21 16:39:50 +02:00
0b9fd0664e
setting detsize after hostname should throw also for single module for consistency (#1000)
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2024-10-21 16:33:13 +02:00
6add9aad5d
Dev/proper free (#1005)
* 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

* minor fix for readme autocomplete

* updated client version date
2024-10-21 16:25:07 +02:00
270ee48148 formatting 2024-10-11 15:44:59 +02:00
0f88617477
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
2024-10-04 16:53:14 +02:00
04eed990c7
fix the command help in the command help generator for Gotthard2 about nextframenumber (#994) 2024-10-03 11:50:42 +02:00
5e024153bc
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
2024-10-02 15:26:06 +02:00
e59de85a33 formatting 2024-10-01 14:44:59 +02:00
fd010b9aa5
removed 'Caller/CALLER' from test names as there is only one command line now (#993) 2024-10-01 12:25:05 +02:00
f43bb8eea4
jf: timing info decoder (#987)
* timing_info_decoder command with options swissfel (default) and shine. added to python, command line generation, autocomplete, tostring, tests.
2024-10-01 11:17:35 +02:00
8a7ed30676
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
2024-09-30 17:22:24 +02:00
5b832cb6aa
Jf: Electron collection mode (#983)
* electron collection mode for jungfrau. also removing the config chip when using register command
* collectionMode: HOLE/ELECTRON (enum)
2024-09-30 17:15:22 +02:00
7fa5b5d70a
fixing python version. allowing versions to execute even if no detector connected or in shared memory (#990) 2024-09-30 17:10:20 +02:00
6348ccd05b
change gain mode help from dynamicgain to dynamic (#988) 2024-09-30 17:04:15 +02:00
8144397b2c
sleep implemented for command line, mainly for config files for firmware developers (#982) 2024-09-30 16:57:53 +02:00
2dc0963c56
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
2024-09-30 16:54:12 +02:00
33b8e0817e
missed the rx_zmqip implementations in detector.h and python bindings (#975) 2024-09-18 13:41:58 +02:00
c6477e0ed6
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
2024-09-10 15:24:51 +02:00
e848293916
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
2024-09-10 15:19:08 +02:00
782c8abd9a
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) 2024-09-03 17:32:01 +02:00
9c57571a41 formatting 2024-08-20 16:28:09 +02:00
d57643434d
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
2024-08-15 17:09:36 +02:00
de33aff077
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
2024-08-13 11:27:06 +02:00
c13049f144
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)
2024-08-02 12:46:39 +02:00
1efd106c6a
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
2024-07-16 15:43:31 +02:00
08dc8e3cbb
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>
2024-07-16 11:59:17 +02:00
3d21bb64c4
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
2024-02-07 13:23:08 +01:00
f6b0ba9703
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>
2024-02-07 10:27:03 +01:00
ffe7728966 formatting 2024-01-11 18:04:19 +01:00
b69e053bb4 updated commands generation 2024-01-11 18:03:34 +01:00
c8bb70f876
Dev/xilinx defaults and pattern (#888)
* implemented testbus, testfpga, set/get #frames, triggers, allowed that and for connection to client, also allowed, getnumchannels, configuremac, getrunstatus, setdetectorposition with dummy values

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

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

* allowing tests for xilinx

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

* compiler set to aarch64 for xilinx server

* updated RegisterDefs.h

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

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

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

* added detector ip and mac adddress to the printout

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

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

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

* commands code generation for only frames command

* fix cmake file and add Caller files

* working exptime, fully extended commands file and its variants

* start adding template commands

* add INT_CMD_VEC_ID template

* add list command, generate multiple bins, format code

* reach 208 commands using the cpp macros

* add tests for command parser

* start adding tests for commands parser

* fix typo to use commands.yaml

* add more tests for command_parser

* add all template functions (up to 218 commands)

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

* 257 commands

* 300 commands the rest are very special commands

* add special commands without generation

* separate special functions from generated c++ file

* implementing one command for put and get (buggy)

* add infer action in a separate file

* generate header for special commands from yaml

* allow only 0 or 1 for bool inputs

* group all commands in gen_commands.py

* add help to gen_commands.py

* add autocomplete bash script

* autocompletion: add support for module levels and help

* remove debugging line

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

* copy tests for Caller.cpp. Tests pass

* update with the new developer branch changes

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

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

* undo previous test simulator debug change

* add documentation for the generated code

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

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

* automation generated

* Redirect deprecated commands (#872)

* working implementation, need to fix dac

* fixed deprecation redirect for dac command

* Detector specific autocomplete (#873)

* working implementation, need to fix dac

* fixed deprecation redirect for dac command

* detector specific completion for dac

* added autocomplete using detector specific

* fixed error when autocompleting partial words

* Generate commands/fix commands (#875)

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

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

* getscan detid and blocking trigger help

* udp_Dstlist det_id fixed, but rx_id invalid

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

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

* reordering

* reordering and checked till integer_command_hex

* fixed a lot more commands

* fix caller tests for eiger

* changes to tests after Bechir left

* changing .cmd to .cmdcall for the caller commands

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

* autocomplete ran

* add moench test

* regenerating autocomplete and commands

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

* formatting

* added code injection to help (#876)

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

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

* fix tests for clkdiv

* adding help to free (#878)

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

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

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

* Added specific help for unsupported actions

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

* added condition checking true in exceptions for special message

---------
Co-authored-by: Bechir Brahem <bachbrahem@gmail.com>
Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2023-12-13 14:43:38 +01:00
96ed74c47c formatting 2023-11-12 15:35:05 +01:00
4198db8365 documentation and examples 2023-11-12 15:34:58 +01:00
e57cf49c49
Dev: trigger signal issues handled at acquire (#864)
* if blocking and handling sync, only master gets blocking acq, slaves get non blocking as they are first and so dont get status or error caught when slaves dont get trigger (due to not connected etc) and acq returns with slaves still in waiting status. so check status of all in blocking acq

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

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

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

* uncommented python loading config

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

* fixing script for virtual simlator test:fixed issue with check if process running, fixed moench tests
2023-11-07 09:30:46 +01:00
ebb352b13a
Dev: : gui acq finished callback for different status (#850)
* fix acquisition finished status to have different status for different modules, but does not have to be error. for eg. jf sync fw (2.4.1 gives idle for master and stopped for slaves when stopping acquiistion)
2023-11-06 16:08:07 +01:00
9b5d44f0b3
fix warning for prev_val (variable size array) in tests (#838) 2023-10-23 15:56:22 +02:00
2b2e50916c
dev: jf sync: stopping master gives idle (#824)
* jf sync mode master could return idle when stopped and so not all modules return the same value and must check for 'stopped or idle', Also must throw if any of the module gives an error

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

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

* fix for gcc4.8

* renamed to Result::contains_only

* updated condition in Detector.cpp

* stop on only the positions

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2023-10-13 15:25:41 +02:00
dad3dc3e46
3. Dev/voltage to power (#816)
* getVoltageList, getVoltage /set, getMeasuredVoltage, getVoltageNames /set, getVoltageIndex moved to 'Power' as its misleading

* added cstdint and names slowadc,  added division to mV

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

---------

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2023-10-02 11:11:28 +02:00
d003a6d8e0
2. Dev/add jf pedestal feature (#807) 2023-09-29 11:25:58 +02:00