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 @property
@element @element
def port(self): 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() return self.getControlPort()
@port.setter @port.setter
@ -323,6 +330,14 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def powerchip(self): 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() return self.getPowerChip()
@powerchip.setter @powerchip.setter
@ -406,6 +421,20 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def periodl(self): 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() return self.getPeriodLeft()
@property @property
@ -753,7 +782,7 @@ class Detector(CppDetectorApi):
@property @property
def rx_framesperfile(self): 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 Note
----- -----
@ -1264,6 +1293,7 @@ class Detector(CppDetectorApi):
Note Note
----- -----
Advanced user Function! \n 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. [Eiger] Address is +0x100 for only left, +0x200 for only right.
""" """
return self._register return self._register
@ -1409,7 +1439,7 @@ class Detector(CppDetectorApi):
Note Note
----- -----
To set default rate correction, use setDefaultRateCorrection To set default rate correction from trimbit file, use setDefaultRateCorrection
Known Issue Known Issue
------------ ------------
@ -1478,6 +1508,7 @@ class Detector(CppDetectorApi):
@property @property
def rx_frameindex(self): def rx_frameindex(self):
"""Current frame index received in receiver during acquisition"""
return self.getRxCurrentFrameIndex() return self.getRxCurrentFrameIndex()
@property @property
@ -1573,6 +1604,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def quad(self): def quad(self):
"""[Eiger] Sets detector size to a quad. 0 (disabled) is default. (Specific hardware required). """
return self.getQuad() return self.getQuad()
@quad.setter @quad.setter
@ -1607,6 +1639,13 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def readnlines(self): 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() return self.getPartialReadout()
@readnlines.setter @readnlines.setter

View File

@ -220,7 +220,7 @@ class Detector {
* [Gotthard2] only in continuous mode */ * [Gotthard2] only in continuous mode */
Result<int64_t> getNumberOfTriggersLeft(Positions pos = {}) const; Result<int64_t> getNumberOfTriggersLeft(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3] /** [Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2]
* [Gotthard2] only in continuous mode */ * [Gotthard2] only in continuous mode */
Result<ns> getPeriodLeft(Positions pos = {}) const; Result<ns> getPeriodLeft(Positions pos = {}) const;
@ -346,7 +346,13 @@ class Detector {
/** [Jungfrau][Mythen3][Gotthard2][Moench] */ /** [Jungfrau][Mythen3][Gotthard2][Moench] */
Result<bool> getPowerChip(Positions pos = {}) const; 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 = {}); void setPowerChip(bool on, Positions pos = {});
/** [Gotthard][Eiger virtual] */ /** [Gotthard][Eiger virtual] */
@ -677,7 +683,7 @@ class Detector {
Result<int> getRxFifoDepth(Positions pos = {}) const; 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 = {}); void setRxFifoDepth(int nframes, Positions pos = {});
Result<bool> getRxSilentMode(Positions pos = {}) const; Result<bool> getRxSilentMode(Positions pos = {}) const;
@ -777,8 +783,8 @@ class Detector {
Result<int> getFramesPerFile(Positions pos = {}) const; Result<int> getFramesPerFile(Positions pos = {}) const;
/** Default depends on detector type. \n 0 will set frames per file to /** Default depends on detector type. \n 0 will set frames per file in an
* unlimited */ * acquisition to unlimited */
void setFramesPerFile(int n, Positions pos = {}); void setFramesPerFile(int n, Positions pos = {});
///@{ ///@{
@ -938,8 +944,8 @@ class Detector {
Result<int> getPartialReadout(Positions pos = {}) const; Result<int> getPartialReadout(Positions pos = {}) const;
/** [Eiger] Number of lines to read out per half module /** [Eiger] Number of lines to read out per half module
* Options: 0 - 256. Depending on dynamic range and * Options: 0 - 256. 256 is default. The permissible values depend on
* 10 GbE enabled, only specific values are accepted. * dynamic range and 10Gbe enabled.
*/ */
void setPartialReadout(const int lines, Positions pos = {}); void setPartialReadout(const int lines, Positions pos = {});
@ -986,13 +992,16 @@ class Detector {
void pulsePixelNMove(int n, defs::xy pixel, Positions pos = {}); void pulsePixelNMove(int n, defs::xy pixel, Positions pos = {});
/** [Eiger] Advanced /** [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 = {}); void pulseChip(int n, Positions pos = {});
/** [Eiger] with specific quad hardware */ /** [Eiger] with specific quad hardware */
Result<bool> getQuad(Positions pos = {}) const; 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); void setQuad(const bool enable);
///@{ ///@{
@ -1080,10 +1089,10 @@ class Detector {
Result<defs::ROI> getROI(Positions pos = {}) const; Result<defs::ROI> getROI(Positions pos = {}) const;
/** /**
* [Gotthard] * [Gotthard] Region of interest in detector \n
* Options: Only a single ROI per module * Options: Only a single ROI per module \n
* Can set only a single ROI at a time * Either all channels or a single adc or 2 chips (256 channels). Default is
* module_id is position index * all channels enabled (-1 -1). \n module_id is position index
*/ */
void setROI(defs::ROI value, int module_id); void setROI(defs::ROI value, int module_id);
@ -1316,7 +1325,8 @@ class Detector {
/** [CTB] */ /** [CTB] */
Result<defs::readoutMode> getReadoutMode(Positions pos = {}) const; 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 = {}); void setReadoutMode(defs::readoutMode value, Positions pos = {});
/** [CTB] */ /** [CTB] */
@ -1507,8 +1517,9 @@ class Detector {
* ************************************************/ * ************************************************/
/** Advanced user Function! /** Advanced user Function!
* [Jungfrau][CTB][Moench] fname is a pof file * [Jungfrau][CTB][Moench] fname is a pof file, rebooting the controller is
* [Mythen3][Gotthard2] fname is an rbf file * recommended \n [Mythen3][Gotthard2] fname is an rbf file, power cycling
* the detector is recommended
*/ */
void programFPGA(const std::string &fname, Positions pos = {}); void programFPGA(const std::string &fname, Positions pos = {});
@ -1544,11 +1555,15 @@ class Detector {
const std::string &fname, Positions pos = {}); const std::string &fname, Positions pos = {});
/** Advanced user Function! \n /** 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; Result<uint32_t> readRegister(uint32_t addr, Positions pos = {}) const;
/** Advanced user Function! \n /** 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 = {}); void writeRegister(uint32_t addr, uint32_t val, Positions pos = {});
/** Advanced user Function! */ /** Advanced user Function! */
@ -1601,7 +1616,8 @@ class Detector {
Result<int> getControlPort(Positions pos = {}) const; Result<int> getControlPort(Positions pos = {}) const;
/** Detector Control TCP port (for client communication with Detector /** 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 = {}); void setControlPort(int value, Positions pos = {});
Result<int> getStopPort(Positions pos = {}) const; Result<int> getStopPort(Positions pos = {}) const;

View File

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

View File

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