diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index ccea0e58e..969db6e87 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -27,7 +27,7 @@ class Detector { /************************************************** * * - * CONFIG * + * CONFIGURATIOn * * * * ************************************************/ /** @@ -39,410 +39,155 @@ class Detector { Result getHostname(Positions pos = {}) const; /** * Frees shared memory and adds detectors to the list - * Also updates local detector cache - * @param name hostnames for the positions given - */ + * Also updates local detector cache */ void setHostname(const std::vector &value); - /** - * Get multidetector Id - * @returns multidetector Id - */ int getMultiId() const; - /** - * Check version compatibility with detector software - * @param pos detector position - */ void checkDetectorVersionCompatibility(Positions pos = {}) const; - /** - * Check version compatibility with receiver software - * @param pos detector position - */ void checkReceiverVersionCompatibility(Positions pos = {}) const; - /** - * Get detector firmware version - * @param pos detector position - * @returns detector firmware version - */ Result getDetectorFirmwareVersion(Positions pos = {}) const; - /** - * Get detector server version - * @param pos detector position - * @returns detector server version - */ Result getDetectorServerVersion(Positions pos = {}) const; - /** - * Get detector serial number - * @param pos detector position - * @returns detector serial number - */ Result getDetectorSerialNumber(Positions pos = {}) const; - /** - * Get Client Software version - * @returns client software version - */ int64_t getClientSoftwareVersion() const; - /** - * Get Receiver software version - * @param pos detector position - * @return receiver software version - */ Result getReceiverSoftwareVersion(Positions pos = {}) const; - /** - * Get user details of shared memory - * @returns string with user details - */ - std::string getUserDetails() const; + /** Get user details of shared memory */ + std::string getUserDetailsFromSharedMemory() const; - /** - * Get Detector type as an enum - * @returns detector type - */ defs::detectorType getDetectorType() const; - /** - * Get Detector type as an enum - * @param pos detector position - * @returns detector type - */ Result getDetectorTypeAsEnum(Positions pos = {}) const; - /** - * Returns detector type as a string - * @param pos detector position - * @returns detector type as string - */ Result getDetectorTypeAsString(Positions pos = {}) const; - /** - * Returns the total number of detectors in the multidetector structure - * @returns total number of detectors in the multidetector structure - */ + /** @returns the total number of detectors in the multidetector structure */ int size() const; - /** - * Returns the number of detectors in the multidetector structure - * @returns number of detectors in the multidetector structure - */ defs::coordinates getNumberOfDetectors() const; - /** - * Returns the number of channels - * @param pos detector position - * @returns the number of channels - */ Result getNumberOfChannels(Positions pos = {}) const; - /** - * Returns the number of channels including gap pixels - * @param pos detector position - * @returns the number of channels including gap pixels - */ - Result + Result getNumberOfChannelsInclGapPixels(Positions pos = {}) const; - /** - * Returns the maximum number of channels of complete detector in both - * dimensions. -1 means no limit in this dimension. This value is used to - * calculate row and column offsets for each module. - * @returns the maximum number of channels of complete detector - */ defs::coordinates getMaxNumberOfChannels() const; /** * Sets the maximum number of channels of complete detector in both * dimensions. -1 means no limit in this dimension. This value is used to * calculate row and column offsets for each module. - * @param value the maximum number of channels of complete detector */ void setMaxNumberOfChannels(const defs::coordinates value); - /** - * Get Detector offset from shared memory (Gotthard only) - * @param pos detector position - * @returns offset in both dimensions - */ + /** [Gotthard] */ Result getDetectorOffsets(Positions pos = {}) const; - /** - * Set Detector offset in shared memory for each module - * @param value offset for detector in both dimensions - * @param pos detector position - */ + /** [Gotthard] */ void setDetectorOffsets(defs::coordinates value, Positions pos = {}); - /** - * Get Quad Type (Only for Eiger Quad detector hardware) - * @param pos detector position - * @returns quad type - */ + /** [Eiger with specific quad hardware] */ Result getQuad(Positions pos = {}) const; - /** - * Set Quad Type (Only for Eiger Quad detector hardware) - * @param enable true if quad type set, else false - * @param pos detector position - */ + /** [Eiger with specific quad hardware] */ void setQuad(const bool enable, Positions pos = {}); - /** - * Get number of rows to read out (Only for Eiger) - * @param pos detector position - * @returns number of lines - */ + /** [Eiger] */ Result getReadNLines(Positions pos = {}) const; - /** - * Set number of rows to read out (Only for Eiger) - * @param value number of lines - * @param pos detector position - */ + /** [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 setReadNLines(const int value, Positions pos = {}); - /** - * Get Detector Control TCP port (for client communication with Detector - * control server) - * @param pos detector position - * @returns control TCP port - */ - Result getControlPort(Positions pos = {}) const; + Result getControlPort(Positions pos = {}) const; - /** - * Set Detector Control TCP port (for client communication with Detector - * control server) - * @param value port number - * @param pos detector position - */ + /** Detector Control TCP port (for client communication with Detector + * control server) */ void setControlPort(int value, Positions pos = {}); - /** - * Get Detector Stop TCP port (for client communication with Detector Stop - * server) - * @param pos detector position - * @returns Stop TCP port - */ Result getStopPort(Positions pos = {}) const; - /** - * Set Detector Stop TCP port (for client communication with Detector Stop - * server) - * @param value port number - * @param pos detector position - */ + /** Detector Stop TCP port (for client communication with Detector Stop + * server) */ void setStopPort(int value, Positions pos = {}); - /** - * Get Receiver TCP port (for client communication with Receiver) - * @param pos detector position - * @returns Receiver TCP port - */ - Result getReceiverPort(Positions pos = {}) const; - - /** - * Set Receiver TCP port (for client communication with Receiver) - * @param value port number - * @param pos detector position - */ - void setReceiverPort(int value, Positions pos = {}); - - /** - * Gets Lock for detector control server to this client IP - * @param pos detector position - * @returns lock - */ Result getLockServer(Positions pos = {}) const; - /** - * Sets Lock for detector control server to this client IP - * @param value lock - * @param pos detector position - */ + /** Lock for detector control server to this client IP */ void setLockServer(bool value, Positions pos = {}); - /** - * Get last client IP saved on detector server - * @param pos detector position - * @returns last client IP saved on detector server - */ + /** Get last client IP saved on detector server */ Result getLastClientIP(Positions pos = {}) const; - /** - * Exit detector server - * @param pos detector position - */ void exitServer(Positions pos = {}); - /** - * Execute a command on the detector server - * @param value command - * @param pos detector position - */ + /** Execute a command on the detector server */ void execCommand(const std::string &value, Positions pos = {}); - /** - * Write current configuration to a file - * @param value configuration file name - */ void writeConfigurationFile(const std::string &value); - /** - * Get detector settings - * @param pos detector position - * @returns current settings - */ + /** [Not CTB] */ Result getSettings(Positions pos = {}) const; /** + * [Not CTB] * Load detector settings from the settings file picked from the * trimdir/settingsdir * Eiger only stores in shared memory ( a get will - * overwrite this) For Eiger, one must use threshold - * @param value settings - * @param pos detector position + * overwrite this) For Eiger, one must use setThresholdEnergy */ void setSettings(defs::detectorSettings value, Positions pos = {}); - /** - * Get threshold energy (Eiger) - * @param pos detector position - * @returns current threshold value for imod in ev (-1 failed) - */ + /** [Eiger] */ Result getThresholdEnergy(Positions pos = {}) const; /** - * Set threshold energy (Eiger) + * [Eiger] + * Set threshold energy * @param value threshold in eV * @param sett ev. change settings * @param tb 1 to include trimbits, 0 to exclude - * @param pos detector position */ void setThresholdEnergy(int value, defs::detectorSettings sett = defs::GET_SETTINGS, int tb = 1, Positions pos = {}); - /** - * Returns the detector trimbit/settings directory - * @param pos detector position - * @returns the trimbit/settings directory - */ Result getSettingsDir(Positions pos = {}) const; - /** - * Sets the detector trimbit/settings directory - * @param value trimbits/settings directory - * @param pos detector position - */ + /** [Not CTB] Sets the detector trimbit/settings directory */ void setSettingsDir(const std::string &value, Positions pos = {}); - /** - * Loads the modules settings/trimbits reading from a specific file - * file name extension is automatically generated. - * @param value specific settings/trimbits file - * @param pos detector position - */ + /** [Not CTB] Loads the modules settings/trimbits reading from a specific file + * file name extension is automatically generated from detector serial number */ void loadSettingsFile(const std::string &value, Positions pos = {}); - /** - * Saves the modules settings/trimbits to a specific file - * file name extension is automatically generated. - * @param value specific settings/trimbits file - * @param pos detector position - */ + /** [Not CTB] Saves the modules settings/trimbits to a specific file + * file name extension is automatically generated from detector serial number */ void saveSettingsFile(const std::string &value, Positions pos = {}); - /** - * Get Detector run status - * @param pos detector position - * @returns status - */ - Result getRunStatus(Positions pos = {}); - - /** - * Prepares detector for acquisition (Eiger) - */ - void prepareAcquisition(); - - /** - * Start detector acquisition (Non blocking) - */ - void startAcquisition(); - - /** - * Stop detector acquisition - */ - void stopAcquisition(); - - /** - * Give an internal software trigger to the detector (Eiger only) - * @param pos detector position - */ - void sendSoftwareTrigger(Positions pos = {}); - - /** - * Start detector acquisition and read all data (Blocking until end of - * acquisition) - */ - void startAndReadAll(); - - /** - * Start readout (without exposure or interrupting exposure) (Eiger store in - * ram) - */ - void startReadOut(); - - /** - * Requests and receives all data from the detector (Eiger store in ram) - */ - void readAll(); - - /** - * Configures in detector the destination for UDP packets - * @param pos detector position - */ + /** Configures in detector the destination for UDP packets */ void configureMAC(Positions pos = {}); - /** - * Get number of Frames - * @returns number of Frames - */ Result getNumberOfFrames() const; - /** - * Set number of Frames - * @param value number of Frames - */ void setNumberOfFrames(int64_t value); - /** - * Get number of Cycles - * @returns number of Cycles - */ Result getNumberOfCycles() const; - /** - * Set number of Cycles - * @param value number of Cycles - */ void setNumberOfCycles(int64_t value); - /** - * Get number of additional storage cells (Jungfrau) - * @returns number of additional storage cells - */ - Result getNumberOfStorageCells() const; + /** [Jungfrau] */ + Result getNumberOfAdditionalStorageCells() const; - /** - * Set number of additional storage cells (Jungfrau) - * @param value number of additional storage cells - */ + /** [Jungfrau] */ void setNumberOfStorageCells(int64_t value); /** [Jungfrau] */ @@ -454,384 +199,206 @@ class Detector { */ void setStoragecellStart(int cell, Positions pos = {}); - /** - * Get number of analog samples (CTB) - * @param pos detector position - * @returns number of analog samples - */ + /** [CTB] */ Result getNumberOfAnalogSamples(Positions pos = {}) const; - /** - * Set number of analog samples (CTB) - * @param value number of analog samples (CTB) - * @param pos detector position - */ + /** [CTB] */ void setNumberOfAnalogSamples(int64_t value, Positions pos = {}); - /** - * Get number of digital samples (CTB) - * @param pos detector position - * @returns number of digital samples - */ + /** [CTB] */ Result getNumberOfDigitalSamples(Positions pos = {}) const; - /** - * Set number of digital samples (CTB) - * @param value number of digital samples (CTB) - * @param pos detector position - */ + /** [CTB] */ void setNumberOfDigitalSamples(int64_t value, Positions pos = {}); - /** - * Get exposure time in ns - * @param pos detector position - * @returns exposure time in ns - */ Result getExptime(Positions pos = {}) const; - /** - * Set exposure time in ns - * @param value exposure time in ns - * @param pos detector position - */ void setExptime(ns t, Positions pos = {}); - /** - * Get period in ns - * @param pos detector position - * @returns period in ns - */ Result getPeriod(Positions pos = {}) const; - /** - * Set period in ns - * @param value period in ns - * @param pos detector position - */ void setPeriod(ns t, Positions pos = {}); - /** - * Get delay after trigger in ns(Gotthard, Jungfrau) - * @param pos detector position - * @returns delay after trigger in ns - */ + + /** [Gotthard][Jungfrau] */ Result getDelayAfterTrigger(Positions pos = {}) const; - /** - * Set delay after trigger (Gotthard, Jungfrau) - * @param value delay after trigger in ns - * @param pos detector position - */ + /** [Gotthard][Jungfrau] */ void setDelayAfterTrigger(ns value, Positions pos = {}); - /** - * Get sub frame exposure time in ns (Eiger in 32 bit mode) - * @param pos detector position - * @returns sub frame exposure time in ns - */ + /** [Eiger in 32 bit mode] */ Result getSubExptime(Positions pos = {}) const; - /** - * Set sub frame exposure time after trigger (Eiger in 32 bit mode) - * @param value sub frame exposure time in ns - * @param pos detector position - */ + /** [Eiger in 32 bit mode] */ void setSubExptime(ns t, Positions pos = {}); - /** - * Get sub frame dead time in ns (Eiger in 32 bit mode) - * @param pos detector position - * @returns sub frame dead time in ns - */ + + /** [Eiger in 32 bit mode] */ Result getSubDeadTime(Positions pos = {}) const; - /** - * Set sub frame dead time after trigger (Eiger in 32 bit mode) - * @param value sub frame dead time in ns - * @param pos detector position - */ + /** [Eiger in 32 bit mode] */ void setSubDeadTime(ns value, Positions pos = {}); - /** - * Get storage cell delay (Jungfrau) - * @param pos detector position - * @returns storage cell delay in ns. Range: (0-1638375 ns (resolution of - * 25ns) - */ + /** [Jungfrau] */ Result getStorageCellDelay(Positions pos = {}) const; - /** - * Set storage cell delay (Jungfrau) - * @param value storage cell delay in ns. Range: (0-1638375 ns (resolution - * of 25ns) - * @param pos detector position - */ + /** [Jungfrau] + * Options: (0-1638375 ns (resolution of 25ns) */ void setStorageCellDelay(ns value, Positions pos = {}); - /** - * Get number of Frames left (Gotthard, Jungfrau, CTB) - * @param pos detector position - * @returns number of Frames left - */ + /** [Gotthard][Jungfrau][CTB] */ Result getNumberOfFramesLeft(Positions pos = {}) const; - /** - * Get number of Cycles left (Gotthard, Jungfrau, CTB) - * @param pos detector position - * @returns number of Cycles left - */ + /** [Gotthard][Jungfrau][CTB] */ Result getNumberOfCyclesLeft(Positions pos = {}) const; - /** - * Get exposure time left in ns (Gotthard) - * @param pos detector position - * @returns exposure time left in ns - */ + + /** [Gotthard] */ Result getExptimeLeft(Positions pos = {}) const; - /** - * Get period left in ns (Gotthard, Jungfrau, CTB) - * @param pos detector position - * @returns period left in ns - */ + /** [Gotthard] */ Result getPeriodLeft(Positions pos = {}) const; - /** - * Get delay after trigger left in ns(Gotthard, Jungfrau, CTB) - * @param pos detector position - * @returns delay after trigger left in ns - */ + /** [Gotthard][Jungfrau][CTB] */ Result getDelayAfterTriggerLeft(Positions pos = {}) const; - /** - * Get number of frames from start up of detector (Jungfrau, CTB) - * @param pos detector position - * @returns number of frames from start up of detector - */ + /** [Gotthard][Jungfrau][CTB] */ Result getNumberOfFramesFromStart(Positions pos = {}) const; - /** - * Get time from detector start in ns (Jungfrau, CTB) - * @param pos detector position - * @returns time from detector start in ns - */ + /** [Jungfrau][CTB] Get time from detector start */ Result getActualTime(Positions pos = {}) const; - /** - * Get timestamp at a frame start in ns(Jungfrau, CTB) - * @param pos detector position - * @returns timestamp at a frame start in ns - */ + /** [Jungfrau][CTB] Get timestamp at a frame start */ Result getMeasurementTime(Positions pos = {}) const; - /** - * Get measured period between previous two frames in ns (Eiger) - * @param pos detector position - * @returns measured period between previous two frames in ns - */ + /** [Eiger] Get measured period between previous two frames */ Result getMeasuredPeriod(Positions pos = {}) const; - /** - * Get measured sub frame period between previous two frames in ns (Eiger in - * 32 bit mode) - * @param pos detector position - * @returns measured sub frame period between previous two frames in ns - */ + /** [Eiger] Get measured sub frame period between previous two frames */ Result getMeasuredSubFramePeriod(Positions pos = {}) const; - /** - * Get speed (Eiger, Jungfrau) - * @param pos detector position - * @returns speed (0 full speed, 1 half speed, 2 quarter speed) - */ + /** [Eiger][Jungfrau] */ Result getSpeed(Positions pos = {}) const; - /** - * Set speed (Eiger, Jungfrau) + /** [Eiger][Jungfrau] * @param value speed (0 full speed, 1 half speed, 2 quarter speed) - * @param pos detector position */ void setSpeed(int value, Positions pos = {}); - /** - * Get ADC Phase (Gotthard, Jungfrau, CTB) - * @param inDeg in degrees (Jungfrau, CTB) - * @returns ADC Phase - */ + /** [Gotthard][Jungfrau][CTB] */ Result getADCPhase(bool inDeg, Positions pos = {}) const; - /** - * Set sADC Phase (Gotthard, Jungfrau, CTB) - * @param value ADC Phase - * @param inDeg in degrees (Jungfrau, CTB) - */ + /** [Gotthard][Jungfrau][CTB] */ void setADCPhase(int value, bool inDeg, Positions pos = {}); - /** - * Get Max ADC Phase Shift (Jungfrau, CTB) - * @returns Max ADC Phase Shift - */ + /** [Jungfrau][CTB] */ Result getMaxADCPhaseShift(Positions pos = {}) const; - /** - * Get DBIT Phase (Jungfrau, CTB) - * @param inDeg in degrees - * @returns DBIT Phase - */ + /** [CTB] */ Result getDBITPhase(bool inDeg, Positions pos = {}) const; - /** - * Set DBIT Phase (CTB) - * @param value DBIT Phase - * @param inDeg in degrees - */ + /** [CTB] */ void setDBITPhase(int value, bool inDeg, Positions pos = {}); - /** - * Get Max DBIT Phase Shift (CTB) - * @returns Max DBIT Phase Shift - */ + /** [CTB] */ Result getMaxDBITPhaseShift(Positions pos = {}) const; - /** - * Get ADC Clock in MHz (CTB) - * @returns ADC Clock in MHz - */ + /** [CTB] */ Result getADCClock(Positions pos = {}) const; - /** - * Set ADC Clock in MHz (CTB) - * @param value ADC Clock in MHz - */ - void setADCClock(int value, Positions pos = {}); + /** [CTB] */ + void setADCClock(int value_in_MHz, Positions pos = {}); - /** - * Get DBIT Clock in MHz (CTB) - * @returns DBIT Clock in MHz - */ + /** [CTB] */ Result getDBITClock(Positions pos = {}) const; - /** - * Set DBIT Clock in MHz (CTB) - * @param value DBIT Clock in MHz - */ - void setDBITClock(int value, Positions pos = {}); + /** [CTB] */ + void setDBITClock(int value_in_MHz, Positions pos = {}); - /** - * Get RUN Clock in MHz (CTB) - * @returns RUN Clock in MHz - */ + /** [CTB] */ Result getRUNClock(Positions pos = {}) const; - /** - * Set RUN Clock in MHz (CTB) - * @param value RUN Clock in MHz - */ - void setRUNClock(int value, Positions pos = {}); + /** [CTB] */ + void setRUNClock(int value_in_MHz, Positions pos = {}); - /** - * Get SYNC Clock in MHz (CTB) - * @returns SYNC Clock in MHz - */ + /** [CTB] */ Result getSYNCClock(Positions pos = {}) const; - /** - * Get ADC Pipeline (CTB) - * @returns ADC Pipeline - */ + /** [CTB] */ Result getADCPipeline(Positions pos = {}) const; - /** - * Set ADC Pipeline (CTB) - * @param value ADC Pipeline - */ + /** [CTB] */ void setADCPipeline(int value, Positions pos = {}); - /** - * Get DBIT Pipeline (CTB) - * @returns DBIT Pipeline - */ + /** [CTB] */ Result getDBITPipeline(Positions pos = {}) const; - /** - * Set DBIT Pipeline (CTB) - * @param value DBIT Pipeline - */ + /** [CTB] */ void setDBITPipeline(int value, Positions pos = {}); Result getDynamicRange(Positions pos = {}) const; /** - * (Eiger: + * [Eiger] * Options: 4, 8, 16, 32 - * If i is 32, also sets clkdivider to 2, if 16, sets clkdivider to 1) + * If i is 32, also sets clkdivider to 2, if 16, sets clkdivider to 1 */ void setDynamicRange(int value); Result getHighVoltage(Positions pos = {}) const; /** - * (Gotthard Options: 0, 90, 110, 120, 150, 180, 200) - * (Jungfrau, CTB Options: 0, 60 - 200) - * (Eiger Options: 0 - 200) + * [Gotthard Options: 0, 90, 110, 120, 150, 180, 200] + * [Jungfrau, CTB Options: 0, 60 - 200] + * [Eiger Options: 0 - 200] */ void setHighVoltage(int value, Positions pos = {}); - /** - * (Eiger) - */ + /** [Eiger] */ Result getIODelay(Positions pos = {}) const; - /** - * (Eiger) - */ + /** [Eiger] */ void setIODelay(int value, Positions pos = {}); /** * (Degrees) - * (Gotthard Options: TEMPERATURE_ADC, TEMPERATURE_FPGA) - * (Jungfrau Options: TEMPERATURE_ADC, TEMPERATURE_FPGA) - * (Eiger Options: TEMPERATURE_FPGA, TEMPERATURE_FPGAEXT, TEMPERATURE_10GE, + * [Gotthard Options: TEMPERATURE_ADC, TEMPERATURE_FPGA] + * [Jungfrau Options: TEMPERATURE_ADC, TEMPERATURE_FPGA] + * [Eiger Options: TEMPERATURE_FPGA, TEMPERATURE_FPGAEXT, TEMPERATURE_10GE, * TEMPERATURE_DCDC, TEMPERATURE_SODL, TEMPERATURE_SODR, TEMPERATURE_FPGA2, - * TEMPERATURE_FPGA3) (CTB Options: SLOW_ADC_TEMP) + * TEMPERATURE_FPGA3) (CTB Options: SLOW_ADC_TEMP] */ Result getTemp(defs::dacIndex index, Positions pos = {}) const; - /** - * (CTB mV) - */ + /** [CTB] */ Result getVrefVoltage(bool mV, Positions pos = {}) const; - /** - * (CTB mV) - */ + /** [CTB] */ void setVrefVoltage(int value, bool mV, Positions pos = {}); - /** - * (CTB mV Options: V_LIMIT, V_POWER_A, V_POWER_B, V_POWER_C, - * V_POWER_D, V_POWER_IO, V_POWER_CHIP)) - */ + /** [CTB] */ Result getVoltage(defs::dacIndex index, Positions pos = {}) const; /** - * (CTB mV Options: V_LIMIT, V_POWER_A, V_POWER_B, V_POWER_C, - * V_POWER_D, V_POWER_IO, V_POWER_CHIP) + * [CTB] mV + * Options: V_LIMIT, V_POWER_A, V_POWER_B, V_POWER_C, + * V_POWER_D, V_POWER_IO, V_POWER_CHIP */ void setVoltage(int value, defs::dacIndex index, Positions pos = {}); /** - * (CTB mV Options: V_POWER_A, V_POWER_B, V_POWER_C, V_POWER_D, V_POWER_IO, - * V_POWER_CHIP) + * [CTB] mV + * Options: V_POWER_A, V_POWER_B, V_POWER_C, V_POWER_D, V_POWER_IO, + * V_POWER_CHIP */ 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) + * [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) - */ + /** [CTB] Options: SLOW_ADC0 - SLOW_ADC7 */ Result getSlowADC(defs::dacIndex index, Positions pos = {}) const; Result getDAC(defs::dacIndex index, bool mV, Positions pos = {}) const; @@ -841,53 +408,35 @@ class Detector { Result getTimingMode(Positions pos = {}) const; /** - * (Gotthard, Jungfrau, CTB Options: AUTO_TIMING, TRIGGER_EXPOSURE) - * (Eiger Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER) + * [Gotthard, Jungfrau, CTB Options: AUTO_TIMING, TRIGGER_EXPOSURE] + * [Eiger Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER] */ void setTimingMode(defs::externalCommunicationMode value, Positions pos = {}); - /** - * (Gotthard) - */ + /** [Gotthard] */ Result getExternalSignalFlags(Positions pos = {}) const; - /** - * (Gotthard Options: TRIGGER_IN_RISING_EDGE, TRIGGER_IN_FALLING_EDGE) - */ + /** [Gotthard] Options: TRIGGER_IN_RISING_EDGE, TRIGGER_IN_FALLING_EDGE */ void setExternalSignalFlags(defs::externalSignalFlag value, Positions pos = {}); - /** - * (Eiger) - */ + /** [Eiger] */ Result getParallelMode(Positions pos = {}) const; - /** - * (Eiger) - */ + /** [Eiger] */ void setParallelMode(bool value, Positions pos = {}); - /** - * (Eiger) - */ + /** [Eiger] */ Result getOverFlowMode(Positions pos = {}) const; - /** - * (Eiger) - */ + /** [Eiger] */ void setOverFlowMode(bool value, Positions pos = {}); - /** - * (CTB Options: NORMAL_READOUT = 0, DIGITAL_ONLY = 1, ANALOG_AND_DIGITAL = 2) - */ + /** [CTB] */ Result getSignalType(Positions pos = {}) const; - /** - * (CTB Options: NORMAL_READOUT = 0, DIGITAL_ONLY = 1, ANALOG_AND_DIGITAL = 2) - */ + /** [CTB] Options: NORMAL_READOUT = 0, DIGITAL_ONLY = 1, ANALOG_AND_DIGITAL = 2 */ void setSignalType(int value, Positions pos = {}); - // Erik - /** [Eiger] */ Result getInterruptSubframe(Positions pos = {}) const; @@ -933,6 +482,7 @@ class Detector { void setReceiverHostname(const std::string &receiver, Positions pos = {}); Result getReceiverUDPIP(Positions pos = {}) const; + void setReceiverUDPIP(const std::string &udpip, Positions pos = {}); /** [Jungfrau bottom half] */ @@ -942,28 +492,34 @@ class Detector { void setReceiverUDPIP2(const std::string &udpip, Positions pos = {}); Result getReceiverUDPMAC(Positions pos = {}) const; + void setReceiverUDPMAC(const std::string &udpmac, Positions pos = {}); /** [Jungfrau bottom half] */ Result getReceiverUDPMAC2(Positions pos = {}) const; + /** [Jungfrau bottom half] */ void setReceiverUDPMAC2(const std::string &udpmac, Positions pos = {}); Result getReceiverUDPPort(Positions pos = {}) const; + void setReceiverUDPPort(int udpport, Positions pos = {}); /** [Eiger right port][Jungfrau bottom half] */ Result getReceiverUDPPort2(Positions pos = {}) const; + /** [Eiger right port][Jungfrau bottom half] */ void setReceiverUDPPort2(int udpport, Positions pos = {}); /** [Jungfrau] */ Result getNumberofUDPInterfaces(Positions pos = {}) const; + /** [Jungfrau] Also restarts client and receiver sockets */ void setNumberofUDPInterfaces(int n, Positions pos = {}); /** [Jungfrau] */ Result getSelectedUDPInterface(Positions pos = {}) const; + /** * [Jungfrau: * Effective only when number of interfaces is 1. @@ -988,20 +544,24 @@ class Detector { void setReceiverDataStreamingOutPort(int port, Positions pos = {}); Result getClientStreamingIP(Positions pos = {}) const; + // TODO these should probably be the same ?? same as what? void setClientDataStreamingInIP(const std::string &ip, Positions pos = {}); Result getReceiverStreamingIP(Positions pos = {}) const; + void setReceiverDataStreamingOutIP(const std::string &ip, Positions pos = {}); /** [Eiger, Jungfrau] */ Result getFlowControl10G(Positions pos = {}) const; + /** [Eiger, Jungfrau] */ void setFlowControl10G(bool enable, Positions pos = {}); /** [Eiger, Jungfrau] */ 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 ] @@ -1019,6 +579,7 @@ class Detector { /** [Eiger] */ Result getTransmissionDelayRight(Positions pos = {}) const; + /** * [Eiger] * Sets the transmission delay of first packet streamed ut of the right UDP port @@ -1027,6 +588,7 @@ class Detector { /** [Moench] */ Result getAdditionalJsonHeader(Positions pos = {}) const; + /** [Moench] */ void setAdditionalJsonHeader(const std::string &jsonheader, Positions pos = {}); @@ -1049,34 +611,46 @@ class Detector { * For now limiting to all detectors working the same*/ /** [Moench: -1 if not found or cannot convert to int] */ Result getDetectorMinMaxEnergyThreshold(const bool isEmax, Positions pos = {}) const; + /** [Moench] */ void setDetectorMinMaxEnergyThreshold(const bool isEmax, const int value, Positions pos = {}); + /** [Moench: -1 if unknown mode] */ Result getFrameMode(Positions pos = {}) const; + /** [Moench] */ void setFrameMode(defs::frameModeType value, Positions pos = {}); + /** [Moench: -1 if unknown mode] */ Result getDetectorMode(Positions pos = {}) const; + /** [Moench] */ void setDetectorMode(defs::detectorModeType value, Positions pos = {}); /** [Gotthard] */ Result getDigitalTestBit(Positions pos = {}); + /** [Gotthard] */ Result setDigitalTestBit(const int value, Positions pos = {}); - /** [Gotthard, Jungfrau, CTB] */ + + /** [Gotthard][Jungfrau][CTB] */ Result executeFirmwareTest(Positions pos = {}); - /** [Gotthard, Jungfrau, CTB] */ + + /** [Gotthard][Jungfrau][CTB] */ Result executeBusTest(Positions pos = {}); + /** [Gotthard] subset modules not allowed */ void loadDarkImage(const std::string &fname, Positions pos = {}); + /** [Gotthard] subset modules not allowed */ void loadGainImage(const std::string &fname, Positions pos = {}); + /** * [Gotthard] subset modules not allowed * @param startACQ if start acq after reading counter */ void getCounterMemoryBlock(const std::string &fname, bool startACQ, Positions pos = {}); + /** * [Gotthard] * @param startACQ if start acq after resetting counter @@ -1086,11 +660,13 @@ class Detector { /** [Eiger] */ Result getCounterBit(Positions pos = {}) const; + /** [Eiger] If it is set, it resets chips completely (else partially) before an acquisition TODO: if it makes sense */ void setCounterBit(bool value, Positions pos = {}); /** [Gotthard, CTB]*/ Result> getROI(Positions pos = {}) const; + /** * [Gotthard Options: Only a single chip or all chips, only 1 ROI allowed] * [CTB: multiple ROIs allowed] @@ -1263,16 +839,19 @@ class Detector { /** [Eiger][Jungfrau] */ Result getStartingFrameNumber(Positions pos = {}) const; + /** [Eiger][Jungfrau] */ void setStartingFrameNumber(uint64_t value, Positions pos); /** [Eiger] */ Result getTenGigaEnabled(Positions pos = {}) const; + /** [Eiger] */ void setTenGigaEnabled(bool value, Positions pos = {}); /** [CTB] */ Result getLEDEnable(Positions pos = {}) const; + /** [CTB] */ void setLEDEnable(bool enable, Positions pos = {}); @@ -1291,24 +870,40 @@ class Detector { * * * ************************************************/ 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; + void setFilePath(const std::string &fname, Positions pos = {}); + Result getFileNamePrefix(Positions pos = {}) const; + /** default run */ void setFileNamePrefix(const std::string &fname, Positions pos = {}); + Result getFileIndex(Positions pos = {}) const; + void setFileIndex(int i, Positions pos = {}); + Result getFileWrite(Positions pos = {}) const; + /** default writes */ + void setFileWrite(bool value, Positions pos = {}); + Result getMasterFileWrite(Positions pos = {}) const; + void setMasterFileWrite(bool value, Positions pos = {}); + Result getFileOverWrite(Positions pos = {}) const; + /** default overwites */ void setFileOverWrite(bool value, Positions pos = {}); + Result getFramesPerFile(Positions pos = {}) const; + void setFramesPerFile(int n, Positions pos = {}); @@ -1322,6 +917,11 @@ class Detector { Result printReceiverConfiguration(Positions pos = {}) const; + Result getReceiverPort(Positions pos = {}) const; + + /** Receiver TCP port (for client communication with Receiver) */ + void setReceiverPort(int value, Positions pos = {}); + Result getReceiverLock(Positions pos = {}); /** locks receiver server to client IP */ @@ -1334,6 +934,7 @@ class Detector { void execReceiverCommand(const std::string &cmd, Positions pos = {}); Result getReceiverStreamingFrequency(Positions pos = {}) const; + /** @param freq nth frame streamed out of receiver. * If 0, streaming timer is the timeout, * after which current frame sent out. Default is 0 at 200 ms. @@ -1342,6 +943,7 @@ class Detector { void setReceiverStreamingFrequency(int freq, Positions pos = {}); Result getReceiverStreamingTimer(Positions pos = {}) const; + /** * If receiver streaming frequency is 0 (default), then this timer between each * data stream is set. Default is 200 ms. @@ -1349,17 +951,24 @@ class Detector { void setReceiverStreamingTimer(int time_in_ms, Positions pos = {}); bool getDataStreamingToClient() const; + void setDataStreamingToClient(bool value); + Result getDataStreamingFromReceiver(Positions pos = {}) const; + void setDataStreamingFromReceiver(bool value, Positions pos = {}); Result getReceiverFifoDepth(Positions pos = {}) const; + void setReceiverFifoDepth(int nframes, Positions pos = {}); + Result getReceiverSilentMode(Positions pos = {}) const; + void setReceiverSilentMode(bool value, Positions pos = {}); - Result + Result getReceiverFrameDiscardPolicy(Positions pos = {}) const; + /** * default NO_DISCARD * Options: NO_DISCARD, DISCARD_EMPTY_FRAMES, DISCARD_PARTIAL_FRAMES @@ -1367,6 +976,7 @@ class Detector { void setReceiverFrameDiscardPolicy(defs::frameDiscardPolicy f, Positions pos = {}); Result getPartialFramesPadding(Positions pos = {}) const; + /** padding enabled */ void setPartialFramesPadding(bool value, Positions pos = {}); @@ -1378,7 +988,6 @@ class Detector { */ void setRxPadDeactivatedMod(bool pad, Positions pos = {}); - Result getReceiverUDPSocketBufferSize(Positions pos = {}) const; void setReceiverUDPSocketBufferSize(int64_t udpsockbufsize, @@ -1410,15 +1019,32 @@ class Detector { */ void setAcquiringFlag(bool value); + Result getRunStatus(Positions pos = {}); + + /** [Eiger] */ + void prepareAcquisition(); + + /** Start detector acquisition (Non blocking) */ + void startAcquisition(); + + void stopAcquisition(); + + /** [Eiger] Sends an internal software trigger to the detector */ + void sendSoftwareTrigger(Positions pos = {}); + /** Receiver starts listening to UDP packets from detector */ void startReceiver(Positions pos = {}); + /** Receiver stops listening to UDP packets from detector */ void stopReceiver(Positions pos = {}); + /** Read back the run status of the receiver */ Result getReceiverStatus(Positions pos = {}); Result getFramesCaughtByReceiver(Positions pos = {}) const; + Result getReceiverCurrentFrameIndex(Positions pos = {}) const; + void resetFramesCaught(Positions pos = {}); /************************************************** @@ -1442,45 +1068,31 @@ class Detector { /** [CTB] */ void setPatternClockControl(uint64_t word, Positions pos = {}); - /** - * [CTB] - * Caution: If word is -1 reads the addr (same as - * executing the pattern) - */ + /** [CTB] Caution: If word is -1 reads the addr (same as + * executing the pattern) */ void setPatternWord(int addr, uint64_t word, Positions pos = {}); - /** - * [CTB] - * Options: level: -1 (complete pattern) and 0-2 levels + /**[CTB] Options: level: -1 (complete pattern) and 0-2 levels * @returns array of start address, stop address and number of loops */ Result> getPatternLoops(int level, Positions pos = {}) const; - /** - * [CTB] - * Options: start, stop, n : 0-2 - * level: -1 (complete pattern) and 0-2 levels - */ + /** [CTB] Options: start, stop, n : 0-2 + * level: -1 (complete pattern) and 0-2 levels */ void setPatternLoops(int level, int start, int stop, int n, Positions pos = {}); /* [CTB] */ Result getPatternWaitAddr(int level, Positions pos = {}) const; - - /** - * [CTB] - * Options: level 0-2 - */ + + /** [CTB] Options: level 0-2 */ void setPatternWaitAddr(int level, int addr, Positions pos = {}); /** [CTB] */ Result getPatternWaitTime(int level, Positions pos = {}) const; - /** - * [CTB] - * Options: level 0-2 - */ + /** [CTB] Options: level 0-2 */ void setPatternWaitTime(int level, uint64_t t, Positions pos = {}); /** [CTB] */ @@ -1492,8 +1104,7 @@ class Detector { /** [CTB] */ Result getPatternBitMask(Positions pos = {}) const; - /** - * [CTB] Sets the bitmask that the mask will be applied to for every + /** [CTB] Sets the bitmask that the mask will be applied to for every * pattern */ void setPatternBitMask(uint64_t mask, Positions pos = {}); diff --git a/slsDetectorSoftware/include/multiSlsDetector.h b/slsDetectorSoftware/include/multiSlsDetector.h index 77dedac81..611d93ae3 100755 --- a/slsDetectorSoftware/include/multiSlsDetector.h +++ b/slsDetectorSoftware/include/multiSlsDetector.h @@ -680,26 +680,6 @@ class multiSlsDetector : public virtual slsDetectorDefs { */ void sendSoftwareTrigger(int detPos = -1);// - /** - * Start detector acquisition and read all data (Blocking until end of - * acquisition) - * @param detPos -1 for all detectors in list or specific detector position - */ - void startAndReadAll(int detPos = -1);// - - /** - * Start readout (without exposure or interrupting exposure) (Eiger store in - * ram) - * @param detPos -1 for all detectors in list or specific detector position - */ - void startReadOut(int detPos = -1);// - - /** - * Requests and receives all data from the detector (Eiger store in ram) - * @param detPos -1 for all detectors in list or specific detector position - */ - void readAll(int detPos = -1);// - /** * Configures in detector the destination for UDP packets * @param detPos -1 for all detectors in list or specific detector position @@ -2320,6 +2300,26 @@ class multiSlsDetector : public virtual slsDetectorDefs { */ void startProcessingThread(); + /** + * Start detector acquisition and read all data (Blocking until end of + * acquisition) + * @param detPos -1 for all detectors in list or specific detector position + */ + void startAndReadAll(int detPos = -1);// + + /** + * Start readout (without exposure or interrupting exposure) (Eiger store in + * ram) + * @param detPos -1 for all detectors in list or specific detector position + */ + void startReadOut(int detPos = -1);// + + /** + * Requests and receives all data from the detector (Eiger store in ram) + * @param detPos -1 for all detectors in list or specific detector position + */ + void readAll(int detPos = -1);// + /** * Check if processing thread is ready to join main thread * @returns true if ready, else false diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index a8bd836e6..7a34f4621 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -60,7 +60,7 @@ Result Detector::getReceiverSoftwareVersion(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverSoftwareVersion, pos); } -std::string Detector::getUserDetails() const { return pimpl->getUserDetails(); } +std::string Detector::getUserDetailsFromSharedMemory() const { return pimpl->getUserDetails(); } defs::detectorType Detector::getDetectorType() const { return pimpl->getDetectorTypeAsEnum(); @@ -152,14 +152,6 @@ void Detector::setStopPort(int value, Positions pos) { pimpl->Parallel(&slsDetector::setStopPort, pos, value); } -Result Detector::getReceiverPort(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReceiverPort, pos); -} - -void Detector::setReceiverPort(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setReceiverPort, pos, value); -} - Result Detector::getLockServer(Positions pos) const { return pimpl->Parallel(&slsDetector::lockServer, pos, -1); } @@ -217,40 +209,6 @@ void Detector::saveSettingsFile(const std::string &value, Positions pos) { pimpl->Parallel(&slsDetector::saveSettingsFile, pos, value); } -Result Detector::getRunStatus(Positions pos) { - return pimpl->Parallel(&slsDetector::getRunStatus, pos); -} - -void Detector::prepareAcquisition() { - pimpl->Parallel(&slsDetector::prepareAcquisition, {}); -} - -void Detector::startAcquisition() { - if (getDetectorType() == defs::EIGER) { - prepareAcquisition(); - } - pimpl->Parallel(&slsDetector::startAcquisition, {}); -} - -void Detector::stopAcquisition() { pimpl->stopAcquisition(); } - -void Detector::sendSoftwareTrigger(Positions pos) { - pimpl->Parallel(&slsDetector::sendSoftwareTrigger, pos); -} - -void Detector::startAndReadAll() { - if (getDetectorType() == defs::EIGER) { - prepareAcquisition(); - } - pimpl->Parallel(&slsDetector::startAndReadAll, {}); -} - -void Detector::startReadOut() { - pimpl->Parallel(&slsDetector::startReadOut, {}); -} - -void Detector::readAll() { pimpl->Parallel(&slsDetector::readAll, {}); } - void Detector::configureMAC(Positions pos) { pimpl->Parallel(&slsDetector::configureMAC, pos); } @@ -271,7 +229,7 @@ void Detector::setNumberOfCycles(int64_t value) { pimpl->Parallel(&slsDetector::setTimer, {}, defs::CYCLES_NUMBER, value); } -Result Detector::getNumberOfStorageCells() const { +Result Detector::getNumberOfAdditionalStorageCells() const { return pimpl->Parallel(&slsDetector::setTimer, {}, defs::STORAGE_CELL_NUMBER, -1); } @@ -454,8 +412,8 @@ Result Detector::getADCClock(Positions pos) const { return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_CLOCK, -1, 0); } -void Detector::setADCClock(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_CLOCK, value, 0); +void Detector::setADCClock(int value_in_MHz, Positions pos) { + pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_CLOCK, value_in_MHz, 0); } Result Detector::getDBITClock(Positions pos) const { @@ -463,8 +421,8 @@ Result Detector::getDBITClock(Positions pos) const { 0); } -void Detector::setDBITClock(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_CLOCK, value, 0); +void Detector::setDBITClock(int value_in_MHz, Positions pos) { + pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_CLOCK, value_in_MHz, 0); } Result Detector::getRUNClock(Positions pos) const { @@ -472,8 +430,8 @@ Result Detector::getRUNClock(Positions pos) const { 0); } -void Detector::setRUNClock(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, value, 0); +void Detector::setRUNClock(int value_in_MHz, Positions pos) { + pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, value_in_MHz, 0); } Result Detector::getSYNCClock(Positions pos) const { @@ -1440,6 +1398,14 @@ Result Detector::printReceiverConfiguration(Positions pos) const { return pimpl->Parallel(&slsDetector::printReceiverConfiguration, pos); } +Result Detector::getReceiverPort(Positions pos) const { + return pimpl->Parallel(&slsDetector::getReceiverPort, pos); +} + +void Detector::setReceiverPort(int value, Positions pos) { + pimpl->Parallel(&slsDetector::setReceiverPort, pos, value); +} + Result Detector::getReceiverLock(Positions pos) { return pimpl->Parallel(&slsDetector::lockReceiver, pos, -1); } @@ -1561,6 +1527,27 @@ bool Detector::getAcquiringFlag() const { return pimpl->getAcquiringFlag(); } void Detector::setAcquiringFlag(bool value) { pimpl->setAcquiringFlag(value); } +Result Detector::getRunStatus(Positions pos) { + return pimpl->Parallel(&slsDetector::getRunStatus, pos); +} + +void Detector::prepareAcquisition() { + pimpl->Parallel(&slsDetector::prepareAcquisition, {}); +} + +void Detector::startAcquisition() { + if (getDetectorType() == defs::EIGER) { + prepareAcquisition(); + } + pimpl->Parallel(&slsDetector::startAcquisition, {}); +} + +void Detector::stopAcquisition() { pimpl->stopAcquisition(); } + +void Detector::sendSoftwareTrigger(Positions pos) { + pimpl->Parallel(&slsDetector::sendSoftwareTrigger, pos); +} + void Detector::startReceiver(Positions pos) { pimpl->Parallel(&slsDetector::startReceiver, pos); }