Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer

This commit is contained in:
Erik Frojdh
2020-09-23 15:09:25 +02:00
3 changed files with 58 additions and 38 deletions

View File

@ -930,8 +930,7 @@ class Detector(CppDetectorApi):
Also restarts client zmq streaming if enabled. \n Also restarts client zmq streaming if enabled. \n
Default connects to receiver zmq streaming out port (30001). \n Default connects to receiver zmq streaming out port (30001). \n
Must be different for every detector (and udp port). \n Must be different for every detector (and udp port). \n
Multi command will automatically increment for individual modules, use setClientZmqPort. \n Multi command will automatically increment for individual modules, use setClientZmqPort.
Example Example
-------- --------
>>> d.zmqport >>> d.zmqport
@ -1512,14 +1511,13 @@ class Detector(CppDetectorApi):
@property @property
def virtual(self): def virtual(self):
""" """
Setup with n virtual servers running on localhost Setup with n virtual servers running on localhost starting with control port p
starting with port p Note
----
Every virtual server will have a stop port (control port + 1)
Example Example
--------- ---------
>>> d.virtual = n, p >>> d.virtual = n, p
""" """
raise NotImplementedError('Virtual is set only') raise NotImplementedError('Virtual is set only')
@ -2182,8 +2180,8 @@ class Detector(CppDetectorApi):
@property @property
def vetofile(self): def vetofile(self):
""" """
[Gotthard2] Set veto reference for each 128 channels for specific chip. [Gotthard2] Set veto reference for each 128 channels for specific chip. \n
The file should have 128 rows of gain index and 12 bit value in dec The file should have 128 rows of gain index and 12 bit value in dec.
Example Example
--------- ---------
@ -2208,6 +2206,17 @@ class Detector(CppDetectorApi):
@property @property
def vetophoton(self): def vetophoton(self):
"""
[Gotthard2] Set veto reference for 128 channels for chip ichip according to reference file
and #photons and energy in keV.
Note
----
Arguments: (chip_index, n_photons, photon_energy, fname)
:getter: Not Implemented
Example
-------
>>> d.vetophoton = (2, 24, 2560, '/tmp/bla.txt')
"""
raise NotImplementedError('vetofile is set only') raise NotImplementedError('vetofile is set only')
@vetophoton.setter @vetophoton.setter
@ -2220,12 +2229,9 @@ class Detector(CppDetectorApi):
def vetoref(self): def vetoref(self):
""" """
[Gotthard2] Set veto reference for all 128 channels for all chips. [Gotthard2] Set veto reference for all 128 channels for all chips.
Example Example
---------- ----------
>>> d.vetoref = chip, value >>> d.vetoref = chip, value
""" """
raise NotImplementedError('vetoref is set only') raise NotImplementedError('vetoref is set only')
@ -2786,7 +2792,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def v_b(self): def v_b(self):
"""[Ctb] Voltage supply a in mV.""" """[Ctb] Voltage supply b in mV."""
return self.getDAC(dacIndex.V_POWER_B, True) return self.getDAC(dacIndex.V_POWER_B, True)
@v_b.setter @v_b.setter
@ -2796,7 +2802,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def v_c(self): def v_c(self):
"""[Ctb] Voltage supply a in mV.""" """[Ctb] Voltage supply c in mV."""
return self.getDAC(dacIndex.V_POWER_C, True) return self.getDAC(dacIndex.V_POWER_C, True)
@v_c.setter @v_c.setter
@ -2806,7 +2812,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def v_d(self): def v_d(self):
"""[Ctb] Voltage supply a in mV.""" """[Ctb] Voltage supply d in mV."""
return self.getDAC(dacIndex.V_POWER_D, True) return self.getDAC(dacIndex.V_POWER_D, True)
@v_d.setter @v_d.setter
@ -2816,7 +2822,11 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def v_io(self): def v_io(self):
"""[Ctb] Voltage supply a in mV.""" """[Ctb] Voltage supply io in mV. Minimum 1200 mV.
Note
----
Must be the first power regulator to be set after fpga reset (on-board detector server start up).
"""
return self.getDAC(dacIndex.V_POWER_IO, True) return self.getDAC(dacIndex.V_POWER_IO, True)
@v_io.setter @v_io.setter

View File

@ -61,7 +61,8 @@ class Detector {
/**Frees shared memory, adds detectors to the list. */ /**Frees shared memory, adds detectors to the list. */
void setHostname(const std::vector<std::string> &hostname); void setHostname(const std::vector<std::string> &hostname);
/** connects to n servers at local host starting at specific control port */ /** connects to n servers at local host starting at specific control port.
* Every virtual server will have a stop port (control port + 1) */
void setVirtualDetectorServers(int numServers, int startingPort); void setVirtualDetectorServers(int numServers, int startingPort);
/** Gets shared memory ID */ /** Gets shared memory ID */
@ -598,8 +599,14 @@ class Detector {
* calculated (incremented by 1 if no 2nd interface)*/ * calculated (incremented by 1 if no 2nd interface)*/
void setDestinationUDPPort2(int port, int module_id = -1); void setDestinationUDPPort2(int port, int module_id = -1);
/** Reconfigures Detector with UDP destination. More for debugging as the
* configuration is done automatically when the detector has sufficient UDP
* details. */
void reconfigureUDPDestination(Positions pos = {}); void reconfigureUDPDestination(Positions pos = {});
/** Validates that UDP configuration in the detector is valid. If not
* configured, it will throw with error message requesting missing udp
* information */
void validateUDPConfiguration(Positions pos = {}); void validateUDPConfiguration(Positions pos = {});
Result<std::string> printRxConfiguration(Positions pos = {}) const; Result<std::string> printRxConfiguration(Positions pos = {}) const;
@ -874,9 +881,10 @@ class Detector {
Result<IpAddr> getClientZmqIp(Positions pos = {}) const; Result<IpAddr> getClientZmqIp(Positions pos = {}) const;
/** Ip Address to listen to zmq data streamed out from receiver or /** Ip Address to listen to zmq data streamed out from receiver or
* intermediate process. Default connects to receiver zmq Ip Address (from * intermediate process. \n Default connects to receiver zmq Ip Address
* rx_hostname). Modified only when using an intermediate process between * (from rx_hostname). \n Modified only when using an intermediate process
* receiver and client(gui). Also restarts client zmq streaming if enabled. * between receiver and client(gui). \n Also restarts client zmq streaming
* if enabled.
*/ */
void setClientZmqIp(const IpAddr ip, Positions pos = {}); void setClientZmqIp(const IpAddr ip, Positions pos = {});
///@{ ///@{
@ -1151,11 +1159,12 @@ class Detector {
const int energy, const std::string &fname, const int energy, const std::string &fname,
Positions pos = {}); Positions pos = {});
/** [Gotthard2] */ /** [Gotthard2] for all chips */
void setVetoReference(const int gainIndex, const int value, void setVetoReference(const int gainIndex, const int value,
Positions pos = {}); Positions pos = {});
/** [Gotthard2] gain indices and adu values for each channel */ /** [Gotthard2] Set veto reference for each 128 channels for specific chip.
* The file should have 128 rows of gain index and 12 bit value in dec"*/
void setVetoFile(const int chipIndex, const std::string &fname, void setVetoFile(const int chipIndex, const std::string &fname,
Positions pos = {}); Positions pos = {});
@ -1549,15 +1558,12 @@ class Detector {
void rebootController(Positions pos = {}); void rebootController(Positions pos = {});
/** /**
* [Jungfrau][Gotthard][CTB][Moench] * Advanced user Function!\n [Jungfrau][Gotthard][CTB][Moench] Updates the
* Advanced user Function! \n * firmware, detector server and then reboots detector controller blackfin.
* Updates the firmware, detector server and then reboots detector * \n [Mythen3][Gotthard2] Will still have old server starting up as the new
* controller blackfin. \n * server is not respawned \n sname is name of detector server binary found
* [Mythen3][Gotthard2] Will still have old server starting up as the new * on tftp folder of host pc \n hostname is name of pc to tftp from \n fname
* server is not respawned \n * is programming file name
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, void updateFirmwareAndServer(const std::string &sname,
const std::string &hostname, const std::string &hostname,

View File

@ -161,7 +161,8 @@ std::string CmdProxy::VirtualServer(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[n_servers] [starting_port_number]\n\tConnecs to n virtual " os << "[n_servers] [starting_port_number]\n\tConnecs to n virtual "
"server at local host starting at specific control port." "server at local host starting at specific control port. Every "
"virtual server will have a stop port (control port + 1)"
<< '\n'; << '\n';
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {
throw sls::RuntimeError("cannot get"); throw sls::RuntimeError("cannot get");
@ -1639,9 +1640,8 @@ std::string CmdProxy::VetoPhoton(int action) {
os << "[ichip] [#photons] [energy in keV] [reference " os << "[ichip] [#photons] [energy in keV] [reference "
"file]\n\t[Gotthard2] Set veto reference for 128 channels for " "file]\n\t[Gotthard2] Set veto reference for 128 channels for "
"chip ichip according to reference file and #photons and energy " "chip ichip according to reference file and #photons and energy "
"in keV.\n\t" "in keV.\n[ichip] [output file]\n\t Get gain indices and veto "
<< "[ichip] [output file]\n\t Get gain indices and veto reference " "reference for 128 channels for chip ichip, saved to file."
"for 128 channels for chip ichip, saved to file."
<< '\n'; << '\n';
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {
if (args.size() != 2) { if (args.size() != 2) {
@ -2476,9 +2476,13 @@ std::string CmdProxy::UpdateFirmwareAndDetectorServer(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[server_name] [pc_host_name] " os << "[server_name] [pc_host_name] "
"[fname.pof]\n\t[Jungfrau][Ctb][Moench] " "[fname.pof]\n\t[Jungfrau][Gotthard][CTB][Moench] Updates the "
"Updates detector server via tftp from pc, updates firmware to " "firmware, detector server and then reboots detector controller "
"pof file and then reboots controller (blackfin)." "blackfin. \n\t[Mythen3][Gotthard2] Will still have old server "
"starting up as the new server is not respawned \n\tsname is "
"name of detector server binary found on tftp folder of host pc "
"\n\thostname is name of pc to tftp from \n\tfname is "
"programming file name"
<< '\n'; << '\n';
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {
throw sls::RuntimeError("Cannot get"); throw sls::RuntimeError("Cannot get");