From b23410bc5e5c65bdf275883a45ab38eb320e7405 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 23 Sep 2020 14:58:25 +0200 Subject: [PATCH 1/5] wip, doc --- python/slsdet/detector.py | 26 ++++++++++++++++++++------ slsDetectorSoftware/include/Detector.h | 24 ++++++++++++++---------- slsDetectorSoftware/src/CmdProxy.cpp | 15 +++++++++------ 3 files changed, 43 insertions(+), 22 deletions(-) diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 5a49442bc..6c9890efc 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -2172,8 +2172,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 --------- @@ -2198,6 +2198,16 @@ 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 @@ -2776,7 +2786,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 @@ -2786,7 +2796,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 @@ -2796,7 +2806,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 @@ -2806,7 +2816,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..f84fab015 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -598,8 +598,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; @@ -1155,7 +1161,8 @@ class Detector { 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 +1556,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..9e2598097 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -1639,9 +1639,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\t[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 +2475,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"); From 40a1d27e3aadfef3ad344565caaec05c097236f9 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 23 Sep 2020 14:58:30 +0200 Subject: [PATCH 2/5] wip, doc --- slsDetectorSoftware/src/CmdProxy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index 9e2598097..1a4db9526 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -1639,7 +1639,7 @@ 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 " + "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) { From 0b02fabaf8971d3cc8b98df67be8d1ecb9dff3b6 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 23 Sep 2020 14:59:27 +0200 Subject: [PATCH 3/5] wip, doc --- python/slsdet/detector.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index d095289d9..bba768899 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -2210,6 +2210,7 @@ class Detector(CppDetectorApi): Example ------- >>> d.vetophoton = (2, 24, 2560, '/tmp/bla.txt') + """ raise NotImplementedError('vetofile is set only') @vetophoton.setter From 750adffe6aad8bf2a13725605748828c74dac8fe Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 23 Sep 2020 15:07:03 +0200 Subject: [PATCH 4/5] wip, doc --- python/slsdet/detector.py | 15 +++++---------- slsDetectorSoftware/include/Detector.h | 5 +++-- slsDetectorSoftware/src/CmdProxy.cpp | 3 ++- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index bba768899..8e027bb2e 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -922,8 +922,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 @@ -1504,14 +1503,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') @@ -2223,12 +2221,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') diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index f84fab015..93e7d4ed7 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 */ @@ -1157,7 +1158,7 @@ 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 = {}); diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index 1a4db9526..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"); From d06e0d1e7f3fcaec1be44e03d641efcb1f58618a Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 23 Sep 2020 15:07:12 +0200 Subject: [PATCH 5/5] wip, doc --- slsDetectorSoftware/include/Detector.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 93e7d4ed7..d0a2648c3 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -881,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 = {}); ///@{