This commit is contained in:
maliakal_d 2020-09-22 18:39:46 +02:00
parent ca0192e27e
commit bb575c6017
4 changed files with 106 additions and 48 deletions

View File

@ -156,6 +156,13 @@ class Detector(CppDetectorApi):
@property
@element
def port(self):
"""
Port number of the control server on detector for detector-client tcp interface.
Note
----
Default is 1952. Normally unchanged. \n
Set different ports for virtual servers on same pc.
"""
return self.getControlPort()
@port.setter
@ -323,6 +330,14 @@ class Detector(CppDetectorApi):
@property
@element
def powerchip(self):
"""
[Jungfrau][Mythen3][Gotthard2][Moench] Power the chip.
Note
----
[Moench] Default is disabled. \n
[Jungfrau] Default is disabled. Get will return power status. Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled. \n
[Mythen3][Gotthard2] Default is 1. If module not connected or wrong module, powerchip will fail.
"""
return self.getPowerChip()
@powerchip.setter
@ -406,6 +421,20 @@ class Detector(CppDetectorApi):
@property
@element
def periodl(self):
"""
[Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] Period left for current frame.
Note
-----
[Gotthard2] only in continuous mode.
:getter: always returns in seconds. To get in datetime.delta, use getPeriodLeft
Example
-----------
>>> d.periodl
181.23
>>> d.getPeriodLeft()
[datetime.timedelta(seconds=181, microseconds=230000)]
"""
return self.getPeriodLeft()
@property
@ -753,7 +782,7 @@ class Detector(CppDetectorApi):
@property
def rx_framesperfile(self):
"""Sets the number of frames per file in receiver.
"""Sets the number of frames per file in receiver in an acquisition.
Note
-----
@ -1264,6 +1293,7 @@ class Detector(CppDetectorApi):
Note
-----
Advanced user Function! \n
Goes to stop server. Hence, can be called while calling blocking acquire(). \n
[Eiger] Address is +0x100 for only left, +0x200 for only right.
"""
return self._register
@ -1409,7 +1439,7 @@ class Detector(CppDetectorApi):
Note
-----
To set default rate correction, use setDefaultRateCorrection
To set default rate correction from trimbit file, use setDefaultRateCorrection
Known Issue
------------
@ -1478,6 +1508,7 @@ class Detector(CppDetectorApi):
@property
def rx_frameindex(self):
"""Current frame index received in receiver during acquisition"""
return self.getRxCurrentFrameIndex()
@property
@ -1573,6 +1604,7 @@ class Detector(CppDetectorApi):
@property
@element
def quad(self):
"""[Eiger] Sets detector size to a quad. 0 (disabled) is default. (Specific hardware required). """
return self.getQuad()
@quad.setter
@ -1607,6 +1639,13 @@ class Detector(CppDetectorApi):
@property
@element
def readnlines(self):
"""
[Eiger] Number of lines to read out per half module
Note
----
Options: 0 - 256. 256 is default. \n
The permissible values depend on dynamic range and 10Gbe enabled.
"""
return self.getPartialReadout()
@readnlines.setter

View File

@ -220,7 +220,7 @@ class Detector {
* [Gotthard2] only in continuous mode */
Result<int64_t> getNumberOfTriggersLeft(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3]
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2]
* [Gotthard2] only in continuous mode */
Result<ns> getPeriodLeft(Positions pos = {}) const;
@ -346,7 +346,13 @@ class Detector {
/** [Jungfrau][Mythen3][Gotthard2][Moench] */
Result<bool> getPowerChip(Positions pos = {}) const;
/** [Jungfrau][Mythen3][Gotthard2][Moench] */
/** [Jungfrau][Mythen3][Gotthard2][Moench] Power the chip. \n
* [Moench] Default is disabled. \n
* [Jungfrau] Default is disabled. Get will return power status. Can be off
* if temperature event occured (temperature over temp_threshold with
* temp_control enabled. \n [Mythen3][Gotthard2] Default is 1. If module not
* connected or wrong module, powerchip will fail.
*/
void setPowerChip(bool on, Positions pos = {});
/** [Gotthard][Eiger virtual] */
@ -677,7 +683,7 @@ class Detector {
Result<int> getRxFifoDepth(Positions pos = {}) const;
/** fifo between udp listening and processing threads */
/** Number of frames in fifo between udp listening and processing threads */
void setRxFifoDepth(int nframes, Positions pos = {});
Result<bool> getRxSilentMode(Positions pos = {}) const;
@ -777,8 +783,8 @@ class Detector {
Result<int> getFramesPerFile(Positions pos = {}) const;
/** Default depends on detector type. \n 0 will set frames per file to
* unlimited */
/** Default depends on detector type. \n 0 will set frames per file in an
* acquisition to unlimited */
void setFramesPerFile(int n, Positions pos = {});
///@{
@ -938,8 +944,8 @@ class Detector {
Result<int> 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.
* Options: 0 - 256. 256 is default. The permissible values depend on
* dynamic range and 10Gbe enabled.
*/
void setPartialReadout(const int lines, Positions pos = {});
@ -986,13 +992,16 @@ class Detector {
void pulsePixelNMove(int n, defs::xy pixel, Positions pos = {});
/** [Eiger] Advanced
* Pulse chip n times */
* Pulse chip n times. \n
* If n is -1, resets to normal mode (reset chip completely at start of
* acquisition, where partialreset = 0). */
void pulseChip(int n, Positions pos = {});
/** [Eiger] with specific quad hardware */
Result<bool> getQuad(Positions pos = {}) const;
/** [Eiger] with specific quad hardware */
/** [Eiger] Sets detector size to a quad. 0 (disabled) is default. (Specific
* hardware required). */
void setQuad(const bool enable);
///@{
@ -1080,10 +1089,10 @@ class Detector {
Result<defs::ROI> 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
* [Gotthard] Region of interest in detector \n
* Options: Only a single ROI per module \n
* Either all channels or a single adc or 2 chips (256 channels). Default is
* all channels enabled (-1 -1). \n module_id is position index
*/
void setROI(defs::ROI value, int module_id);
@ -1316,7 +1325,8 @@ class Detector {
/** [CTB] */
Result<defs::readoutMode> getReadoutMode(Positions pos = {}) const;
/** [CTB] Options: ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL */
/** [CTB] Options: ANALOG_ONLY (default), DIGITAL_ONLY, ANALOG_AND_DIGITAL
*/
void setReadoutMode(defs::readoutMode value, Positions pos = {});
/** [CTB] */
@ -1507,8 +1517,9 @@ class Detector {
* ************************************************/
/** Advanced user Function!
* [Jungfrau][CTB][Moench] fname is a pof file
* [Mythen3][Gotthard2] fname is an rbf file
* [Jungfrau][CTB][Moench] fname is a pof file, rebooting the controller is
* recommended \n [Mythen3][Gotthard2] fname is an rbf file, power cycling
* the detector is recommended
*/
void programFPGA(const std::string &fname, Positions pos = {});
@ -1544,11 +1555,15 @@ class Detector {
const std::string &fname, Positions pos = {});
/** Advanced user Function! \n
* [Eiger] Address is +0x100 for only left, +0x200 for only right. */
* Goes to stop server. Hence, can be called while calling blocking
* acquire(). \n [Eiger] Address is +0x100 for only left, +0x200 for only
* right. */
Result<uint32_t> readRegister(uint32_t addr, Positions pos = {}) const;
/** Advanced user Function! \n
* [Eiger] Address is +0x100 for only left, +0x200 for only right. */
* Goes to stop server. Hence, can be called while calling blocking
* acquire(). \n [Eiger] Address is +0x100 for only left, +0x200 for only
* right. */
void writeRegister(uint32_t addr, uint32_t val, Positions pos = {});
/** Advanced user Function! */
@ -1601,7 +1616,8 @@ class Detector {
Result<int> getControlPort(Positions pos = {}) const;
/** Detector Control TCP port (for client communication with Detector
* control server) */
* control server) Default is 1952. Normally unchanged. Set different ports
* for virtual servers on same pc */
void setControlPort(int value, Positions pos = {});
Result<int> getStopPort(Positions pos = {}) const;

View File

@ -1418,7 +1418,7 @@ std::string CmdProxy::PulsePixel(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[n_times] [x] [y]\n\t[Eiger] Pulse pixel n number of times at "
"coordinates (x, y)."
"coordinates (x, y). Advanced User!"
<< '\n';
} else if (action == defs::GET_ACTION) {
throw sls::RuntimeError("cannot get");
@ -1443,7 +1443,7 @@ std::string CmdProxy::PulsePixelAndMove(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[n_times] [x] [y]\n\t[Eiger] Pulse pixel n number of times and "
"moves relatively by (x, y)."
"moves relatively by (x, y). Advanced User!"
<< '\n';
} else if (action == defs::GET_ACTION) {
throw sls::RuntimeError("cannot get");
@ -1469,7 +1469,7 @@ std::string CmdProxy::PulseChip(int action) {
if (action == defs::HELP_ACTION) {
os << "[n_times] \n\t[Eiger] Pulse chip n times. If n is -1, resets to "
"normal mode (reset chip completely at start of acquisition, "
"where partialreset = 0)."
"where partialreset = 0). Advanced User!"
<< '\n';
} else if (action == defs::GET_ACTION) {
throw sls::RuntimeError("cannot get");
@ -1489,8 +1489,8 @@ std::string CmdProxy::Quad(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[0, 1]\n\t[Eiger] 0 is default. 1 sets detector size to a quad "
"(Specific hardware required)."
os << "[0, 1]\n\t[Eiger] Sets detector size to a quad. 0 (disabled) is "
"default. (Specific hardware required)."
<< '\n';
} else if (action == defs::GET_ACTION) {
if (!args.empty()) {
@ -1554,9 +1554,10 @@ std::string CmdProxy::ROI(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[xmin] [xmax] \n\t[Gotthard] Region of interest in detector. "
"Either all channels or a single adc or 2 chips (256 channels). "
"Default is all channels enabled (-1 -1). "
os << "[xmin] [xmax] \n\t[Gotthard] Region of interest in detector.\n\t"
"Options: Only a single ROI per module. \n\tEither all channels "
"or a single adc or 2 chips (256 channels). Default is all "
"channels enabled (-1 -1). "
<< '\n';
} else if (action == defs::GET_ACTION) {
if (!args.empty()) {
@ -2431,8 +2432,10 @@ std::string CmdProxy::ProgramFpga(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[fname.pof | fname.rbf]\n\t[Jungfrau][Ctb][Moench] Programs "
"FPGA from pof file."
<< "\n\t[Mythen3][Gotthard2] Programs FPGA from rbf file." << '\n';
"FPGA from pof file. Rebooting controller is recommended. "
"\n\t[Mythen3][Gotthard2] Programs FPGA from rbf file. Power "
"cycling the detector is recommended. "
<< '\n';
} else if (action == defs::GET_ACTION) {
throw sls::RuntimeError("Cannot get");
} else if (action == defs::PUT_ACTION) {
@ -2503,8 +2506,9 @@ std::string CmdProxy::Register(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[address] [32 bit value]\n\tReads/writes to a 32 bit register "
"in hex. Advanced Function!\n\t[Eiger] +0x100 for only left, "
"+0x200 for only right."
"in hex. Advanced Function!\n\tGoes to stop server. Hence, can "
"be called while calling blocking acquire(). \n\t[Eiger] +0x100 "
"for only left, +0x200 for only right."
<< '\n';
} else if (action == defs::GET_ACTION) {
if (args.size() != 1) {

View File

@ -1257,7 +1257,7 @@ class CmdProxy {
"\n\t[Gotthard2] only in continuous mode.");
TIME_GET_COMMAND(periodl, getPeriodLeft,
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench]"
"\n\t[Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2]"
" Period left for current frame."
"\n\t[Gotthard2] only in continuous mode.");
@ -1294,14 +1294,11 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID(
powerchip, getPowerChip, setPowerChip, StringTo<int>,
"[0, 1]\n\t[Jungfrau][Mythen3][Gotthard2][Moench] Power "
"the chip. Default 0."
"\n\t[Jungfrau] Get will return power status."
"Can be off if temperature event occured (temperature over "
"temp_threshold with temp_control enabled."
"\n\t[Mythen3] If module not connected or wrong module, 1 "
"will fail. By default, not powered on"
"\n\t[Gotthard2] If module not connected or wrong module, "
"1 will fail. By default, powered on at server start up.");
"the chip. \n\t[Moench] Default is 0. \n\t[Jungfrau] Default is 0. Get "
"will return power status. Can be off if temperature event occured "
"(temperature over temp_threshold with temp_control "
"enabled.\n\t[Mythen3][Gotthard2] Default is 1. If module not "
"connected or wrong module, powerchip will fail.");
INTEGER_COMMAND_VEC_ID(
imagetest, getImageTestMode, setImageTestMode, StringTo<int>,
@ -1930,8 +1927,9 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID(
rx_framesperfile, getFramesPerFile, setFramesPerFile, StringTo<int>,
"[n_frames]\n\tNumber of frames per file in receiver. 0 is "
"infinite or all frames in single file.");
"[n_frames]\n\tNumber of frames per file in receiver in an "
"acquisition. Default depends on detector type. 0 is infinite or all "
"frames in single file.");
/* ZMQ Streaming Parameters (Receiver<->Client) */
@ -2022,8 +2020,8 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID(
readnlines, getPartialReadout, setPartialReadout, StringTo<int>,
"[1 - 256]\n\t[Eiger] Number of rows to readout per half module "
"starting from the centre. 256 is default. The permissible values "
"depend on dynamic range and 10Gbe enabled.");
"starting from the centre. Options: 0 - 256. 256 is default. The "
"permissible values depend on dynamic range and 10Gbe enabled.");
INTEGER_COMMAND_VEC_ID(
interruptsubframe, getInterruptSubframe, setInterruptSubframe,
@ -2314,7 +2312,7 @@ class CmdProxy {
EXECUTE_SET_COMMAND(rebootcontroller, rebootController,
"\n\t[Jungfrau][Ctb][Moench][Gotthard][Mythen3]["
"Gotthard2] Reboot controler (blackfin) of detector.");
"Gotthard2] Reboot controller of detector.");
EXECUTE_SET_COMMAND(
firmwaretest, executeFirmwareTest,
@ -2337,7 +2335,8 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID(
port, getControlPort, setControlPort, StringTo<int>,
"[n]\n\tPort number of the control server on detector for "
"detector-client tcp interface. Default is 1952. Normally unchanged.");
"detector-client tcp interface. Default is 1952. Normally unchanged. "
"Set different ports for virtual servers on same pc.");
INTEGER_COMMAND_VEC_ID(
stopport, getStopPort, setStopPort, StringTo<int>,