diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 928bae37d..2723fdb7c 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -930,8 +930,7 @@ class Detector(CppDetectorApi): Also restarts client zmq streaming if enabled. \n Default connects to receiver zmq streaming out port (30001). \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 -------- >>> d.zmqport @@ -1512,14 +1511,13 @@ class Detector(CppDetectorApi): @property def virtual(self): """ - Setup with n virtual servers running on localhost - starting with port p - + Setup with n virtual servers running on localhost starting with control port p + Note + ---- + Every virtual server will have a stop port (control port + 1) Example --------- - >>> d.virtual = n, p - """ raise NotImplementedError('Virtual is set only') @@ -2182,8 +2180,8 @@ class Detector(CppDetectorApi): @property def vetofile(self): """ - [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 + [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. Example --------- @@ -2208,6 +2206,17 @@ class Detector(CppDetectorApi): @property 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') @vetophoton.setter @@ -2220,12 +2229,9 @@ class Detector(CppDetectorApi): def vetoref(self): """ [Gotthard2] Set veto reference for all 128 channels for all chips. - Example ---------- - >>> d.vetoref = chip, value - """ raise NotImplementedError('vetoref is set only') @@ -2786,7 +2792,7 @@ class Detector(CppDetectorApi): @property @element def v_b(self): - """[Ctb] Voltage supply a in mV.""" + """[Ctb] Voltage supply b in mV.""" return self.getDAC(dacIndex.V_POWER_B, True) @v_b.setter @@ -2796,7 +2802,7 @@ class Detector(CppDetectorApi): @property @element def v_c(self): - """[Ctb] Voltage supply a in mV.""" + """[Ctb] Voltage supply c in mV.""" return self.getDAC(dacIndex.V_POWER_C, True) @v_c.setter @@ -2806,7 +2812,7 @@ class Detector(CppDetectorApi): @property @element def v_d(self): - """[Ctb] Voltage supply a in mV.""" + """[Ctb] Voltage supply d in mV.""" return self.getDAC(dacIndex.V_POWER_D, True) @v_d.setter @@ -2816,7 +2822,11 @@ class Detector(CppDetectorApi): @property @element 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) @v_io.setter diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index fcd166bd8..d0a2648c3 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -61,7 +61,8 @@ class Detector { /**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 */ + /** 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); /** Gets shared memory ID */ @@ -598,8 +599,14 @@ class Detector { * calculated (incremented by 1 if no 2nd interface)*/ 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 = {}); + /** 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 = {}); Result printRxConfiguration(Positions pos = {}) const; @@ -874,9 +881,10 @@ class Detector { 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. + * intermediate process. \n Default connects to receiver zmq Ip Address + * (from rx_hostname). \n Modified only when using an intermediate process + * between receiver and client(gui). \n Also restarts client zmq streaming + * if enabled. */ void setClientZmqIp(const IpAddr ip, Positions pos = {}); ///@{ @@ -1151,11 +1159,12 @@ class Detector { const int energy, const std::string &fname, Positions pos = {}); - /** [Gotthard2] */ + /** [Gotthard2] for all chips */ void setVetoReference(const int gainIndex, const int value, 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, Positions pos = {}); @@ -1549,15 +1558,12 @@ class Detector { void rebootController(Positions pos = {}); /** - * [Jungfrau][Gotthard][CTB][Moench] - * Advanced user Function! \n - * Updates the firmware, detector server and then reboots detector - * controller blackfin. \n - * [Mythen3][Gotthard2] Will still have old server starting up as the new - * server is not respawned \n - 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 + * Advanced user Function!\n [Jungfrau][Gotthard][CTB][Moench] Updates the + * firmware, detector server and then reboots detector controller blackfin. + * \n [Mythen3][Gotthard2] Will still have old server starting up as the new + * server is not respawned \n sname is name of detector server binary found + * on tftp folder of host pc \n hostname is name of pc to tftp from \n fname + * is programming file name */ void updateFirmwareAndServer(const std::string &sname, const std::string &hostname, diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index 9df334c54..e59c05756 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -161,7 +161,8 @@ std::string CmdProxy::VirtualServer(int action) { os << cmd << ' '; if (action == defs::HELP_ACTION) { 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'; } else if (action == defs::GET_ACTION) { throw sls::RuntimeError("cannot get"); @@ -1639,9 +1640,8 @@ std::string CmdProxy::VetoPhoton(int action) { os << "[ichip] [#photons] [energy in keV] [reference " "file]\n\t[Gotthard2] Set veto reference for 128 channels for " "chip ichip according to reference file and #photons and energy " - "in keV.\n\t" - << "[ichip] [output file]\n\t Get gain indices and veto reference " - "for 128 channels for chip ichip, saved to file." + "in keV.\n[ichip] [output file]\n\t Get gain indices and veto " + "reference for 128 channels for chip ichip, saved to file." << '\n'; } else if (action == defs::GET_ACTION) { if (args.size() != 2) { @@ -2476,9 +2476,13 @@ std::string CmdProxy::UpdateFirmwareAndDetectorServer(int action) { os << cmd << ' '; if (action == defs::HELP_ACTION) { os << "[server_name] [pc_host_name] " - "[fname.pof]\n\t[Jungfrau][Ctb][Moench] " - "Updates detector server via tftp from pc, updates firmware to " - "pof file and then reboots controller (blackfin)." + "[fname.pof]\n\t[Jungfrau][Gotthard][CTB][Moench] Updates the " + "firmware, detector server and then reboots detector controller " + "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'; } else if (action == defs::GET_ACTION) { throw sls::RuntimeError("Cannot get");