#pragma once #include "Result.h" #include "network_utils.h" #include "sls_detector_defs.h" #include #include #include #include class detectorData; namespace sls { using ns = std::chrono::nanoseconds; 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(int multiId, int detPos = -1); /** * \class Detector */ class Detector { std::unique_ptr pimpl; public: /** * @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(); /** @name Configuration */ ///@{ /************************************************** * * * Configuration * * * * ************************************************/ /** Free the shared memory of this detector and all modules belonging to it */ void freeSharedMemory(); /** 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 ¶meters); Result getHostname(Positions pos = {}) const; /**Frees shared memory, adds detectors to the list */ void setHostname(const std::vector &hostname); /** connects to n servers at local host starting at specific control port */ void setVirtualDetectorServers(int numServers, int startingPort); /** Gets shared memory ID */ int getShmId() const; /** package git branch */ std::string getPackageVersion() const; int64_t getClientVersion() const; Result getFirmwareVersion(Positions pos = {}) const; Result getDetectorServerVersion(Positions pos = {}) const; Result getSerialNumber(Positions pos = {}) const; Result getReceiverVersion(Positions pos = {}) const; /** Options: EIGER, JUNGFRAU, GOTTHARD, MOENCH, MYTHEN3, GOTTHARD2, * CHIPTESTBOARD */ Result getDetectorType(Positions pos = {}) const; /** Gets the total number of detectors */ int size() const; bool empty() const; defs::xy getModuleGeometry() const; Result 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. \n * This value is used to calculate row and column positions for each module. */ void setDetectorSize(const defs::xy value); /** list of possible settings for this detector */ std::vector getSettingsList() const; /** [Jungfrau][Gotthard][Gotthard2] */ Result getSettings(Positions pos = {}) const; /** [Jungfrau] DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2, * FORCESWITCHG1, FORCESWITCHG2 \n [Gotthard] DYNAMICGAIN, HIGHGAIN, * LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n [Gotthard2] DYNAMICGAIN, * FIXGAIN1, FIXGAIN2 \n [Moench] G1_HIGHGAIN, G1_LOWGAIN, * G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN, * G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN \n [Eiger] Use threshold * command. Settings loaded from file found in * settingspath */ void setSettings(defs::detectorSettings 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] -1 if they are all different */ Result getAllTrimbits(Positions pos = {}) const; /**[Eiger][Mythen3] */ void setAllTrimbits(int value, Positions pos = {}); /**[Eiger][Jungfrau] */ bool getGapPixelsinCallback() const; /** * [Eiger][Jungfrau] * 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); ///@{ /** @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 getNumberOfFrames(Positions pos = {}) const; /** In trigger mode, number of frames per trigger. In scan mode, number of * frames is set to number of steps */ void setNumberOfFrames(int64_t value); Result getNumberOfTriggers(Positions pos = {}) const; void setNumberOfTriggers(int64_t value); /** [Gotthard][Jungfrau][Eiger][CTB][Moench][Gotthard2] \n * [Mythen3] use function with gate index **/ Result getExptime(Positions pos = {}) const; /** [Gotthard][Jungfrau][Eiger][CTB][Moench][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 getPeriod(Positions pos = {}) const; void setPeriod(ns t, Positions pos = {}); /** [Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] */ Result getDelayAfterTrigger(Positions pos = {}) const; /** [Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] */ void setDelayAfterTrigger(ns value, Positions pos = {}); /** [Gotthard][Jungfrau][CTB][Moench][Mythen3] * [Gotthard2] only in continuous mode */ Result getNumberOfFramesLeft(Positions pos = {}) const; /** [Gotthard][Jungfrau][CTB][Moench][Mythen3] * [Gotthard2] only in continuous mode */ Result getNumberOfTriggersLeft(Positions pos = {}) const; /** [Gotthard][Jungfrau][CTB][Moench][Mythen3] * [Gotthard2] only in continuous mode */ Result getPeriodLeft(Positions pos = {}) const; /** [Gotthard][Jungfrau][CTB][Moench][Mythen3] * [Gotthard2] only in continuous mode */ Result getDelayAfterTriggerLeft(Positions pos = {}) const; Result getDynamicRange(Positions pos = {}) const; /** * [Eiger] Options: 4, 8, 16, 32. If i is 32, also sets clkdivider to 2, if * 16, sets clkdivider to 1 \n [Mythen3] Options: 8, 16, 32 \n * [Jungfrau][Gotthard][Ctb][Moench][Mythen3][Gotthard2] 16 */ void setDynamicRange(int value); /** list of possible dynamic ranges for this detector */ std::vector getDynamicRangeList() const; Result getTimingMode(Positions pos = {}) const; /** * [Gotthard][Jungfrau][Gotthard][CTB][Moench][Gotthard2] 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 getTimingModeList() const; /** [Eiger][Jungfrau] */ Result getSpeed(Positions pos = {}) const; /** [Eiger][Jungfrau] * Options: FULL_SPEED, HALF_SPEED, QUARTER_SPEED \n * [Jungfrau] FULL_SPEED option only available from v2.0 boards and with * setting number of interfaces to 2. \n Also overwrites adcphase to * recommended default. */ void setSpeed(defs::speedLevel value, Positions pos = {}); /** [Jungfrau][CTB][Moench] */ Result getADCPhase(Positions pos = {}) const; /** [Gotthard][Jungfrau][CTB][Moench] * [Jungfrau] Absolute phase shift. Changing Speed also resets adcphase to * recommended defaults. \n * [Ctb][Moench] 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][CTB][Moench] */ Result getMaxADCPhaseShift(Positions pos = {}) const; /** [Gotthard][Jungfrau][CTB][Moench] */ Result getADCPhaseInDegrees(Positions pos = {}) const; /** [Gotthard][Jungfrau][CTB][Moench] * [Jungfrau] Absolute phase shift. Changing Speed also resets adcphase to * recommended defaults. \n * [Ctb][Moench] 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 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 getMaxDBITPhaseShift(Positions pos = {}) const; /** [CTB][Jungfrau] */ Result 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 getClockFrequency(int clkIndex, Positions pos = {}); /** [not implemented] Hz */ void setClockFrequency(int clkIndex, int value, Positions pos = {}); /** [Mythen3][Gotthard2] */ Result getClockPhase(int clkIndex, Positions pos = {}); /** [Mythen3][Gotthard2] */ void setClockPhase(int clkIndex, int value, Positions pos = {}); /** [Mythen3][Gotthard2] */ Result getMaxClockPhaseShift(int clkIndex, Positions pos = {}); /** [Mythen3][Gotthard2] */ Result getClockPhaseinDegrees(int clkIndex, Positions pos = {}); /** [Mythen3][Gotthard2] */ void setClockPhaseinDegrees(int clkIndex, int value, Positions pos = {}); /** [Mythen3][Gotthard2] */ Result getClockDivider(int clkIndex, Positions pos = {}); /** [Mythen3][Gotthard2] */ void setClockDivider(int clkIndex, int value, Positions pos = {}); Result getHighVoltage(Positions pos = {}) const; /** * [Gotthard] Options: 0, 90, 110, 120, 150, 180, 200 * [Jungfrau][CTB][Moench] Options: 0, 60 - 200 * [Eiger][Mythen3][Gotthard2] Options: 0 - 200 */ void setHighVoltage(int value, Positions pos = {}); /** [Jungfrau][Mythen3][Gotthard2][Moench] */ Result getPowerChip(Positions pos = {}) const; /** [Jungfrau][Mythen3][Gotthard2][Moench] */ void setPowerChip(bool on, Positions pos = {}); /** [Gotthard][Eiger virtual] */ Result getImageTestMode(Positions pos = {}); /** [Gotthard] If 1, adds channel intensity with precalculated values. * Default is 0 * [Eiger virtual] If 1, pixels are saturated. If 0, increasing intensity * Only for virtual servers */ void setImageTestMode(const int value, Positions pos = {}); /** gets list of temperature indices for this detector */ std::vector getTemperatureList() const; /** * (Degrees) * [Gotthard] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA \n * [Jungfrau] 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 * Cannot call TEMPERATURE_FPGA2 and TEMPERATURE_FPGA3 when blocking acquire * in progress \n [CTB] Options: SLOW_ADC_TEMP */ Result getTemperature(defs::dacIndex index, Positions pos = {}) const; /** gets list of dac enums for this detector */ std::vector getDacList() const; Result getDAC(defs::dacIndex index, bool mV = false, Positions pos = {}) const; void setDAC(defs::dacIndex index, int value, bool mV = false, Positions pos = {}); /**[Gotthard2] */ Result 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 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] */ Result getParallelMode(Positions pos = {}) const; /** [Eiger][Mythen3] * [Mythen3] If exposure time is too short, acquisition will return with an * ERROR and take fewer frames than expected */ void setParallelMode(bool value, 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, use this to clear 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. */ void startDetector(); /** Non blocking: Abort detector acquisition. Status changes to IDLE or * STOPPED */ void stopDetector(); /** IDLE, ERROR, WAITING, RUN_FINISHED, TRANSMITTING, RUNNING, STOPPED */ Result getDetectorStatus(Positions pos = {}) const; /** Options: IDLE, TRANSMITTING, RUNNING */ Result getReceiverStatus(Positions pos = {}) const; Result getFramesCaught(Positions pos = {}) const; /** Gets the number of missing packets for each port in receiver. */ Result> getNumMissingPackets(Positions pos = {}) const; /** [Eiger][Jungfrau] */ Result getStartingFrameNumber(Positions pos = {}) const; /** [Eiger][Jungfrau] Stopping acquiistion might result in different frame * numbers for different modules.*/ void setStartingFrameNumber(uint64_t value, Positions pos = {}); /** [Eiger][Mythen3] Sends an internal software trigger to the detector */ void sendSoftwareTrigger(Positions pos = {}); Result getScan(Positions pos = {}) const; /** enables/ disables scans for dac, trimbits [Eiger/ Mythen3] * TRIMBIT_SCAN. Enabling scan sets number of frames to number of steps in * receiver. Disabling scan sets number of frames to 1 */ void setScan(const defs::scanParameters t); /** gets scan error message in case of error during scan in case of non * blocking acquisition (startDetector, not acquire) */ Result getScanErrorMessage(Positions pos = {}) const; ///@{ /** @name Network Configuration (Detector<->Receiver) */ ///@{ /************************************************** * * * Network Configuration (Detector<->Receiver) * * * * ************************************************/ /** [Jungfrau][Gotthard2] */ Result getNumberofUDPInterfaces(Positions pos = {}) const; /** [Jungfrau][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] */ Result getSelectedUDPInterface(Positions pos = {}) const; /** * [Jungfrau: * Effective only when number of interfaces is 1. * Options: 0 (outer, default), 1(inner)] //TODO: enum? */ void selectUDPInterface(int interface, Positions pos = {}); Result 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] bottom half [Gotthard2] veto debugging */ Result getSourceUDPIP2(Positions pos = {}) const; /** [Jungfrau] 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 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] bottom half [Gotthard2] veto debugging */ Result getSourceUDPMAC2(Positions pos = {}) const; /** [Jungfrau] bottom half [Gotthard2] veto debugging */ void setSourceUDPMAC2(const MacAddr mac, Positions pos = {}); Result getDestinationUDPIP(Positions pos = {}) const; /** IP of the interface in receiver that the detector sends data to */ void setDestinationUDPIP(const IpAddr ip, Positions pos = {}); /** [Jungfrau] bottom half \n [Gotthard2] veto debugging */ Result getDestinationUDPIP2(Positions pos = {}) const; /** [Jungfrau] bottom half \n [Gotthard2] veto debugging */ void setDestinationUDPIP2(const IpAddr ip, Positions pos = {}); Result 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). */ void setDestinationUDPMAC(const MacAddr mac, Positions pos = {}); /** [Jungfrau] bottom half \n [Gotthard2] veto debugging */ Result getDestinationUDPMAC2(Positions pos = {}) const; /* [Jungfrau][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] bottom half \n [Gotthard2] veto debugging \n */ void setDestinationUDPMAC2(const MacAddr mac, Positions pos = {}); Result 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(int port, int module_id = -1); /** [Eiger] right port[Jungfrau] bottom half [Gotthard2] veto debugging */ Result getDestinationUDPPort2(Positions pos = {}) const; /** [Eiger] right port[Jungfrau] 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(int port, int module_id = -1); void reconfigureUDPDestination(Positions pos = {}); void validateUDPConfiguration(Positions pos = {}); Result printRxConfiguration(Positions pos = {}) const; /** [Eiger][CTB][Moench][Mythen3] */ Result getTenGiga(Positions pos = {}) const; /** [Eiger][CTB][Moench][Mythen3] */ void setTenGiga(bool value, Positions pos = {}); /** [Eiger][Jungfrau] */ Result getTenGigaFlowControl(Positions pos = {}) const; /** [Eiger][Jungfrau] */ void setTenGigaFlowControl(bool enable, Positions pos = {}); /** [Eiger][Jungfrau][Mythen3] */ Result getTransmissionDelayFrame(Positions pos = {}) const; /** * [Jungfrau]: Sets the transmission delay of the first UDP packet being * streamed out of the module. Options: 0 - 31, each value represenets 1 ms * [Eiger]: Sets the transmission delay of entire frame streamed out for * both left and right UDP ports. Options: //TODO possible values * [Mythen3] Options: [0-16777215] Each value represents 8 ns (125 MHz * clock), max is 134 ms. */ void setTransmissionDelayFrame(int value, Positions pos = {}); /** [Eiger] */ Result getTransmissionDelayLeft(Positions pos = {}) const; /** * [Eiger] * Sets the transmission delay of first packet streamed out of the left UDP * port */ void setTransmissionDelayLeft(int value, Positions pos = {}); /** [Eiger] */ Result 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 = {}); ///@{ /** @name Receiver Configuration */ ///@{ /************************************************** * * * Receiver Configuration * * * * ************************************************/ /** true when slsReceiver is used */ Result getUseReceiverFlag(Positions pos = {}) const; Result 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 &name); Result 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(int port, int module_id = -1); Result getRxFifoDepth(Positions pos = {}) const; /** fifo between udp listening and processing threads */ void setRxFifoDepth(int nframes, Positions pos = {}); Result getRxSilentMode(Positions pos = {}) const; /** Switch on or off receiver text output during acquisition */ void setRxSilentMode(bool value, Positions pos = {}); Result 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 getPartialFramesPadding(Positions pos = {}) const; /** Default: padding enabled. Disabling padding is the fastest */ void setPartialFramesPadding(bool value, Positions pos = {}); Result getRxUDPSocketBufferSize(Positions pos = {}) const; /** UDP socket buffer size in receiver. Tune rmem_default and rmem_max * accordingly */ void setRxUDPSocketBufferSize(int64_t udpsockbufsize, Positions pos = {}); /** TODO: * Gets actual udp socket buffer size. Double the size of rx_udpsocksize due * to kernel bookkeeping. */ Result getRxRealUDPSocketBufferSize(Positions pos = {}) const; Result 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 getRxLastClientIP(Positions pos = {}) const; Result> getRxThreadIds(Positions pos = {}) const; ///@{ /** @name File */ ///@{ /************************************************** * * * File * * * * ************************************************/ Result getFileFormat(Positions pos = {}) const; /** default binary, Options: BINARY, HDF5 (library must be compiled with * this option) */ void setFileFormat(defs::fileFormat f, Positions pos = {}); Result getFilePath(Positions pos = {}) const; /** If path does not exist, it will try to create it */ void setFilePath(const std::string &fpath, Positions pos = {}); Result 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 getAcquisitionIndex(Positions pos = {}) const; /** file or Acquisition index in receiver */ void setAcquisitionIndex(int64_t i, Positions pos = {}); Result getFileWrite(Positions pos = {}) const; /** default enabled */ void setFileWrite(bool value, Positions pos = {}); Result getMasterFileWrite(Positions pos = {}) const; /**default enabled */ void setMasterFileWrite(bool value, Positions pos = {}); Result getFileOverWrite(Positions pos = {}) const; /** default overwites */ void setFileOverWrite(bool value, Positions pos = {}); Result getFramesPerFile(Positions pos = {}) const; /** Default depends on detector type. \n 0 will set frames per file to * unlimited */ void setFramesPerFile(int n, Positions pos = {}); ///@{ /** @name ZMQ Streaming Parameters (Receiver<->Client) */ ///@{ /************************************************** * * * ZMQ Streaming Parameters (Receiver<->Client)* * * * ************************************************/ // TODO callback functions Result 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 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 200 ms). Usually used for * gui purposes. */ void setRxZmqFrequency(int freq, Positions pos = {}); Result getRxZmqTimer(Positions pos = {}) const; /** * If receiver streaming frequency is 0 (default), then this timer between * each data stream is set. Default is 200 ms. */ void setRxZmqTimer(int time_in_ms, Positions pos = {}); Result 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 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(int port, int module_id = -1); Result getRxZmqIP(Positions pos = {}) const; /** Zmq Ip Address from which data is to be streamed out of the receiver. \n * Also restarts receiver zmq streaming if enabled. \n Default is from * rx_hostname. \n Modified only when using an intermediate process between * receiver. */ void setRxZmqIP(const IpAddr ip, Positions pos = {}); Result 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(int port, int module_id = -1); Result getClientZmqIp(Positions pos = {}) const; /** Ip Address to listen to zmq data streamed out from receiver or * intermediate process. Default connects to receiver zmq Ip Address (from * rx_hostname). Modified only when using an intermediate process between * receiver and client(gui). Also restarts client zmq streaming if enabled. */ void setClientZmqIp(const IpAddr ip, Positions pos = {}); ///@{ /** @name Eiger Specific */ ///@{ /************************************************** * * * Eiger Specific * * * * ************************************************/ /** [Eiger] in 32 bit mode */ Result getSubExptime(Positions pos = {}) const; /** [Eiger] in 32 bit mode */ void setSubExptime(ns t, Positions pos = {}); /** [Eiger] in 32 bit mode */ Result getSubDeadTime(Positions pos = {}) const; /** [Eiger] in 32 bit mode */ void setSubDeadTime(ns value, Positions pos = {}); /** [Eiger] */ Result getThresholdEnergy(Positions pos = {}) const; /** [Eiger] It loads trim files from settingspath */ void setThresholdEnergy(int threshold_ev, defs::detectorSettings settings = defs::STANDARD, bool trimbits = true, Positions pos = {}); /** [Eiger] */ Result getSettingsPath(Positions pos = {}) const; /** [Eiger] Directory where settings files are loaded from/to */ void setSettingsPath(const std::string &value, Positions pos = {}); /** [Eiger] */ Result getOverFlowMode(Positions pos = {}) const; /** [Eiger] Overflow in 32 bit mode. Default is disabled.*/ void setOverFlowMode(bool value, Positions pos = {}); /** [Eiger] */ Result getBottom(Positions pos = {}) const; /** [Eiger] for client call back (gui) purposes */ void setBottom(bool value, Positions pos = {}); /**[Eiger] Returns energies in eV where the module is trimmed */ Result> getTrimEnergies(Positions pos = {}) const; /** [Eiger] List of trim energies, where corresponding default trim files * exist in corresponding trim folders */ void setTrimEnergies(std::vector energies, Positions pos = {}); /** [Eiger] deadtime in ns, 0 = disabled */ Result 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 getPartialReadout(Positions pos = {}) const; /** [Eiger] Number of lines to read out per half module * Options: 0 - 256. Depending on dynamic range and * 10 GbE enabled, only specific values are accepted. */ void setPartialReadout(const int lines, Positions pos = {}); /** [Eiger] */ Result 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 getMeasuredPeriod(Positions pos = {}) const; /** [Eiger] */ Result getMeasuredSubFramePeriod(Positions pos = {}) const; /** [Eiger] */ Result getActive(Positions pos = {}) const; /** [Eiger] */ void setActive(const bool active, Positions pos = {}); /** [Eiger] */ Result getRxPadDeactivatedMode(Positions pos = {}) const; /** [Eiger] Pad deactivated modules in receiver */ void setRxPadDeactivatedMode(bool pad, Positions pos = {}); /** [Eiger] Advanced */ Result 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 */ void pulseChip(int n, Positions pos = {}); /** [Eiger] with specific quad hardware */ Result getQuad(Positions pos = {}) const; /** [Eiger] with specific quad hardware */ void setQuad(const bool enable); ///@{ /** @name Jungfrau Specific */ ///@{ /************************************************** * * * Jungfrau Specific * * * * ************************************************/ /** [Jungfrau] */ Result getThresholdTemperature(Positions pos = {}) const; /** * [Jungfrau]Set threshold temperature * 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. val is value in degrees */ void setThresholdTemperature(int temp, Positions pos = {}); /** [Jungfrau] */ Result getTemperatureControl(Positions pos = {}) const; /** [Jungfrau] refer to setThresholdTemperature * Default is disabled */ void setTemperatureControl(bool enable, Positions pos = {}); /** [Jungfrau] refer to setThresdholdTemperature */ Result getTemperatureEvent(Positions pos = {}) const; /** [Jungfrau] refer to setThresdholdTemperature */ void resetTemperatureEvent(Positions pos = {}); /** [Jungfrau] */ Result getAutoCompDisable(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).\n * Default is false or this mode disabled(comparator enabled throughout). * true enables " "mode. 0 disables mode. */ void setAutoCompDisable(bool value, Positions pos = {}); /** [Jungfrau] Advanced TODO naming */ Result getNumberOfAdditionalStorageCells(Positions pos = {}) const; /** [Jungfrau] Advanced \n * Options: 0 - 15. Default: 0. \n * The #images = #frames x #triggers x (#storagecells + 1) */ void setNumberOfAdditionalStorageCells(int value); /** [Jungfrau] Advanced */ Result getStorageCellStart(Positions pos = {}) const; /** [Jungfrau] Advanced. Sets the storage cell storing the first acquisition * of the series. Options: 0-15. Default: 15. */ void setStorageCellStart(int cell, Positions pos = {}); /** [Jungfrau] Advanced*/ Result getStorageCellDelay(Positions pos = {}) const; /** [Jungfrau] Advanced \n * Options: (0-1638375 ns (resolution of 25ns) */ void setStorageCellDelay(ns value, Positions pos = {}); ///@{ /** @name Gotthard Specific */ ///@{ /************************************************** * * * Gotthard Specific * * * * ************************************************/ /** [Gotthard]*/ Result getROI(Positions pos = {}) const; /** * [Gotthard] * Options: Only a single ROI per module * Can set only a single ROI at a time * module_id is position index */ void setROI(defs::ROI value, int module_id); /** [Gotthard] Clear ROI */ void clearROI(Positions pos = {}); /** [Gotthard] */ Result getExptimeLeft(Positions pos = {}) const; ///@{ /** @name Gotthard2 Specific */ ///@{ /************************************************** * * * Gotthard2 Specific * * * * ************************************************/ /** [Gotthard2] only in burst mode and auto timing mode */ Result 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 getBurstPeriod(Positions pos = {}) const; /** [Gotthard2] only in burst mode and auto timing mode */ void setBurstPeriod(ns value, Positions pos = {}); /** [Gotthard2] offset channel, increment channel */ Result> getInjectChannel(Positions pos = {}); /** [Gotthard2] * 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] */ void setVetoReference(const int gainIndex, const int value, Positions pos = {}); /** [Gotthard2] gain indices and adu values for each channel */ void setVetoFile(const int chipIndex, const std::string &fname, Positions pos = {}); /** [Gotthard2] */ Result getBurstMode(Positions pos = {}); /** [Gotthard2] BURST_INTERNAL (default), BURST_EXTERNAL, * CONTINUOUS_INTERNAL, CONTINUOUS_EXTERNAL */ void setBurstMode(defs::burstMode value, Positions pos = {}); /** [Gotthard2] */ Result getCDSGain(Positions pos = {}) const; /** default disabled */ void setCDSGain(bool value, Positions pos = {}); /** [Gotthard2] */ Result getFilter(Positions pos = {}) const; /** default 0 */ void setFilter(int value, Positions pos = {}); /** [Gotthard2] */ Result getCurrentSource(Positions pos = {}) const; /** default disabled */ void setCurrentSource(bool value, Positions pos = {}); /** [Gotthard2] */ Result getTimingSource(Positions pos = {}) const; /** [Gotthard2] Options: TIMING_INTERNAL, TIMING_EXTERNAL */ void setTimingSource(defs::timingSourceType value, Positions pos = {}); /** [Gotthard2] */ Result getVeto(Positions pos = {}) const; /** [Gotthard2] Default disabled */ void setVeto(const bool enable, Positions pos = {}); /** [Gotthard2] */ Result getADCConfiguration(const int chipIndex, const int adcIndex, Positions pos = {}) const; /** [Gotthard2] */ void setADCConfiguration(const int chipIndex, const int adcIndex, const int value, Positions pos = {}); /** [Gotthard2] */ void getBadChannels(const std::string &fname, Positions pos = {}) const; /** [Gotthard2] */ void setBadChannels(const std::string &fname, Positions pos = {}); ///@{ /** @name Mythen3 Specific */ ///@{ /************************************************** * * * Mythen3 Specific * * * * ************************************************/ /** [Mythen3] */ Result getCounterMask(Positions pos = {}) const; /** [Mythen3] countermask bit set for each counter index enabled */ void setCounterMask(uint32_t countermask, Positions pos = {}); Result 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 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> getExptimeForAllGates(Positions pos = {}) const; /** [Mythen3] gate delay for each gate signal in auto or trigger timing mode * (internal gating). Gate index: 0-2 */ Result 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> getGateDelayForAllGates(Positions pos = {}) const; ///@{ /** @name CTB / Moench Specific */ ///@{ /************************************************** * * * CTB / Moench Specific * * * * ************************************************/ /** [CTB][Moench] */ Result getNumberOfAnalogSamples(Positions pos = {}) const; /** [CTB][Moench] */ void setNumberOfAnalogSamples(int value, Positions pos = {}); /** [CTB][Moench] */ Result getADCClock(Positions pos = {}) const; /** [CTB][Moench] */ void setADCClock(int value_in_MHz, Positions pos = {}); /** [CTB][Moench] */ Result getRUNClock(Positions pos = {}) const; /** [CTB][Moench] */ void setRUNClock(int value_in_MHz, Positions pos = {}); /** [CTB][Moench] in MHZ */ Result getSYNCClock(Positions pos = {}) const; /** [CTB][Moench] */ Result getADCPipeline(Positions pos = {}) const; /** [CTB][Moench] */ void setADCPipeline(int value, Positions pos = {}); /** [CTB][Moench] */ Result getVoltage(defs::dacIndex index, Positions pos = {}) const; /** * [CTB][Moench] mV * [Ctb] Options: V_LIMIT, V_POWER_A, V_POWER_B, V_POWER_C, * V_POWER_D, V_POWER_IO, V_POWER_CHIP * [Moench] Options: V_LIMIT */ void setVoltage(defs::dacIndex index, int value, Positions pos = {}); /** [CTB][Moench] */ Result getADCEnableMask(Positions pos = {}) const; /** [CTB][Moench] */ void setADCEnableMask(uint32_t mask, Positions pos = {}); /** [CTB][Moench] */ Result getTenGigaADCEnableMask(Positions pos = {}) const; /** [CTB][Moench] */ void setTenGigaADCEnableMask(uint32_t mask, Positions pos = {}); ///@{ /** @name CTB Specific */ ///@{ /************************************************** * * * CTB Specific * * * * ************************************************/ /** [CTB] */ Result getNumberOfDigitalSamples(Positions pos = {}) const; /** [CTB] */ void setNumberOfDigitalSamples(int value, Positions pos = {}); /** [CTB] */ Result getReadoutMode(Positions pos = {}) const; /** [CTB] Options: ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL */ void setReadoutMode(defs::readoutMode value, Positions pos = {}); /** [CTB] */ Result getDBITClock(Positions pos = {}) const; /** [CTB] */ void setDBITClock(int value_in_MHz, Positions pos = {}); /** [CTB] */ Result getDBITPipeline(Positions pos = {}) const; /** [CTB] */ void setDBITPipeline(int value, Positions pos = {}); /** * [CTB] mV * Options: V_POWER_A, V_POWER_B, V_POWER_C, V_POWER_D, V_POWER_IO */ Result getMeasuredVoltage(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 getMeasuredCurrent(defs::dacIndex index, Positions pos = {}) const; /** [CTB] Options: SLOW_ADC0 - SLOW_ADC7 in uV */ Result getSlowADC(defs::dacIndex index, Positions pos = {}) const; /** [CTB] */ Result getExternalSamplingSource(Positions pos = {}) const; /** [CTB] Value between 0-63 */ void setExternalSamplingSource(int value, Positions pos = {}); /** [CTB] */ Result getExternalSampling(Positions pos = {}) const; /** [CTB] */ void setExternalSampling(bool value, Positions pos = {}); /** [CTB] */ Result> 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 &list, Positions pos = {}); /** [CTB] */ Result 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 getLEDEnable(Positions pos = {}) const; /** [CTB] Default is enabled. */ void setLEDEnable(bool enable, Positions pos = {}); ///@{ /** @name Pattern */ ///@{ /************************************************** * * * Pattern * * * * ************************************************/ /** [CTB][Moench][Mythen3] */ void setPattern(const std::string &fname, Positions pos = {}); /** [CTB][Moench][Mythen3] */ void savePattern(const std::string &fname); /** [CTB][Moench] */ Result getPatternIOControl(Positions pos = {}) const; /** [CTB][Moench] */ void setPatternIOControl(uint64_t word, Positions pos = {}); /** [CTB][Moench][Mythen3] same as executing for ctb and moench */ Result getPatternWord(int addr, Positions pos = {}); /** [CTB] Caution: If word is -1 reads the addr (same as * executing the pattern) * [Mythen3][Moench] */ void setPatternWord(int addr, uint64_t word, Positions pos = {}); /**[CTB][Moench][Mythen3] Options: level: -1 (complete pattern) and 0-2 * levels * @returns array of start address and stop address */ Result> getPatternLoopAddresses(int level, Positions pos = {}) const; /** [CTB][Moench][Mythen3] Options: level: -1 (complete pattern) and 0-2 * levels */ void setPatternLoopAddresses(int level, int start, int stop, Positions pos = {}); /**[CTB][Moench][Mythen3] Options: level: -1 (complete pattern) and 0-2 * levels * @returns number of loops */ Result getPatternLoopCycles(int level, Positions pos = {}) const; /** [CTB][Moench][Mythen3] n: 0-2, level: -1 (complete pattern) and 0-2 * levels */ void setPatternLoopCycles(int level, int n, Positions pos = {}); /**[CTB][Moench][Mythen3] */ Result getPatternWaitAddr(int level, Positions pos = {}) const; /** [CTB][Moench][Mythen3] Options: level 0-2 */ void setPatternWaitAddr(int level, int addr, Positions pos = {}); /** [CTB][Moench][Mythen3] */ Result getPatternWaitTime(int level, Positions pos = {}) const; /** [CTB][Moench][Mythen3] Options: level 0-2 */ void setPatternWaitTime(int level, uint64_t t, Positions pos = {}); /** [CTB][Moench][Mythen3] */ Result getPatternMask(Positions pos = {}); /** [CTB][Moench][Mythen3] Sets the mask applied to every pattern to the * selected bits */ void setPatternMask(uint64_t mask, Positions pos = {}); /** [CTB][Moench][Mythen3] */ Result getPatternBitMask(Positions pos = {}) const; /** [CTB][Moench][Mythen3] Selects the bits that will have a pattern mask * applied to the selected patmask for every pattern. */ void setPatternBitMask(uint64_t mask, Positions pos = {}); /** [Mythen3] */ void startPattern(Positions pos = {}); ///@{ /** @name Moench specific */ ///@{ /************************************************** * * * Moench specific * * * * ************************************************/ /** [Moench] */ Result> getAdditionalJsonHeader(Positions pos = {}) const; /** [Moench] If empty, reset additional json header. Max 20 characters for * each key/value */ void setAdditionalJsonHeader( const std::map &jsonHeader, Positions pos = {}); /** [Moench] */ Result getAdditionalJsonParameter(const std::string &key, Positions pos = {}) const; /** * [Moench] * Sets the value for additional json header parameters if found, * else appends the parameter key and value * If empty, deletes parameter. Max 20 characters for each key/value */ void setAdditionalJsonParameter(const std::string &key, const std::string &value, Positions pos = {}); ///@{ /** @name Advanced */ ///@{ /************************************************** * * * Advanced * * * * ************************************************/ /** Advanced user Function! * [Jungfrau][CTB][Moench] fname is a pof file * [Mythen3][Gotthard2] fname is an rbf file */ void programFPGA(const std::string &fname, Positions pos = {}); /** [Jungfrau][CTB][Moench] Advanced user Function! */ void resetFPGA(Positions pos = {}); /** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2] * Advanced user Function! * Copy detector server fname from tftp folder of hostname to detector * Also changes respawn server, which is effective after a reboot. */ void copyDetectorServer(const std::string &fname, const std::string &hostname, Positions pos = {}); /** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2] Advanced user * Function! */ void rebootController(Positions pos = {}); /** * [Jungfrau][Gotthard][CTB][Moench] * Advanced user Function! * Updates the firmware, detector server and then reboots detector * controller blackfin. * sname is name of detector server binary found on tftp folder of host * pc * hostname is name of pc to tftp from * fname is programming file name */ void updateFirmwareAndServer(const std::string &sname, const std::string &hostname, const std::string &fname, Positions pos = {}); /** Advanced user Function! \n * [Eiger] Address is +0x100 for only left, +0x200 for only right. */ Result readRegister(uint32_t addr, Positions pos = {}) const; /** Advanced user Function! \n * [Eiger] Address is +0x100 for only left, +0x200 for only right. */ void writeRegister(uint32_t addr, uint32_t val, Positions pos = {}); /** Advanced user Function! */ void setBit(uint32_t addr, int bitnr, Positions pos = {}); /** Advanced user Function! */ void clearBit(uint32_t addr, int bitnr, Positions pos = {}); /** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] Advanced user * Function! */ void executeFirmwareTest(Positions pos = {}); /** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] Advanced user * Function! */ void executeBusTest(Positions pos = {}); /** [Gotthard][Jungfrau][CTB][Moench] Advanced user Function! not possible * to read back */ void writeAdcRegister(uint32_t addr, uint32_t value, Positions pos = {}); /** Advanced user Function! */ bool getInitialChecks() const; /** initial compaibility and other server start up checks * default enabled Advanced user Function! */ void setInitialChecks(const bool value); /** [CTB][Moench][Jungfrau] Advanced user Function! */ Result getADCInvert(Positions pos = {}) const; /** [CTB][Moench][Jungfrau] Advanced user Function! */ void setADCInvert(uint32_t value, Positions pos = {}); ///@{ /** @name Insignificant */ ///@{ /************************************************** * * * Insignificant * * * * ************************************************/ Result getControlPort(Positions pos = {}) const; /** Detector Control TCP port (for client communication with Detector * control server) */ void setControlPort(int value, Positions pos = {}); Result getStopPort(Positions pos = {}) const; /** Detector Stop TCP port (for client communication with Detector Stop * server) */ void setStopPort(int value, Positions pos = {}); Result getDetectorLock(Positions pos = {}) const; /** lock detector to one client IP. default is unlocked */ void setDetectorLock(bool lock, Positions pos = {}); /** Get last client IP saved on detector server */ Result getLastClientIP(Positions pos = {}) const; /** Execute a command on the detector server console */ Result executeCommand(const std::string &value, Positions pos = {}); /** [Jungfrau][Mythen3][CTB][Moench] * [Gotthard2] only in continuous mode */ Result getNumberOfFramesFromStart(Positions pos = {}) const; /** [Jungfrau][Mythen3][CTB][Moench] Get time from detector start * [Gotthard2] only in continuous mode */ Result getActualTime(Positions pos = {}) const; /** [Jungfrau][Mythen3][CTB][Moench] Get timestamp at a frame start * [Gotthard2] only in continuous mode */ Result getMeasurementTime(Positions pos = {}) const; /** get user details from shared memory (hostname, type, PID, User, Date) */ std::string getUserDetails() const; Result getRxCurrentFrameIndex(Positions pos = {}) const; ///@{ private: std::vector getPortNumbers(int start_port); void updateRxRateCorrections(); }; } // namespace sls