From f061d2273a5d0280cf5a9c6f6a445c414da2f3a1 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Mon, 14 Sep 2020 15:18:48 +0200 Subject: [PATCH] wip, doc --- python/slsdet/detector.py | 242 +++++++++++++++++++------ slsDetectorSoftware/include/Detector.h | 53 +++--- slsDetectorSoftware/src/CmdProxy.cpp | 4 +- slsDetectorSoftware/src/CmdProxy.h | 60 +++--- 4 files changed, 250 insertions(+), 109 deletions(-) diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 732f7e7ef..a89da6f0b 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -91,7 +91,7 @@ class Detector(CppDetectorApi): :getter: Not implemented :setter: Loads config file - Examples + Example ----------- >>> d.config = "/path/to/config/file.config" @@ -219,7 +219,7 @@ class Detector(CppDetectorApi): def settings(self): """ Detector settings. Enum: detectorSettings - Notes + Note ----- [Eiger] Use threshold command to load settings @@ -239,7 +239,7 @@ class Detector(CppDetectorApi): def frames(self): """Number of frames per acquisition. In trigger mode, number of frames per trigger. - Notes + Note ----- Cannot be set in modular level. ???? In scan mode, number of frames is set to number of steps. @@ -290,7 +290,7 @@ class Detector(CppDetectorApi): :getter: always returns in seconds. To get in datetime.delta, use getExptime - Examples + Example ----------- >>> d.exptime = 1.05 >>> d.exptime = datetime.timedelta(minutes = 3, seconds = 1.23) @@ -327,7 +327,7 @@ class Detector(CppDetectorApi): ----- :getter: always returns in seconds. To get in datetime.delta, use getPeriod - Examples + Example ----------- >>> d.period = 1.05 >>> d.period = datetime.timedelta(minutes = 3, seconds = 1.23) @@ -353,7 +353,7 @@ class Detector(CppDetectorApi): ----- :getter: always returns in seconds. To get in datetime.delta, use getDelayAfterTrigger - Examples + Example ----------- >>> d.delay = 1.05 >>> d.delay = datetime.timedelta(minutes = 3, seconds = 1.23) @@ -379,7 +379,7 @@ class Detector(CppDetectorApi): [Gotthard2] only in continuous mdoe. :getter: always returns in seconds. To get in datetime.delta, use getDelayAfterTriggerLeft - Examples + Example ----------- >>> d.delay 181.23 @@ -455,7 +455,7 @@ class Detector(CppDetectorApi): @property def rx_hostname(self): """ Sets receiver hostname or IP address. Used for TCP control communication between client and receiver to configure receiver. Also updates receiver with detector parameters. - Notes + Note ----- Also resets any prior receiver property (not on detector). \n Can concatenate receiver hostnames for every module. \n @@ -482,7 +482,7 @@ class Detector(CppDetectorApi): def rx_tcpport(self): """ TCP port for client-receiver communication. - Notes + Note ----- Default is 1954. \n Must be different if multiple receivers on same pc. \n @@ -523,7 +523,7 @@ class Detector(CppDetectorApi): def rx_discardpolicy(self): """ Frame discard policy of receiver. Enum: frameDiscardPolicy - Notes + Note ----- Options: NO_DISCARD, DISCARD_EMPTY_FRAMES, DISCARD_PARTIAL_FRAMES \n Default: NO_DISCARD \n @@ -544,7 +544,7 @@ class Detector(CppDetectorApi): @property def rx_padding(self): """Partial frames padding enable in the receiver. - Notes + Note ------ Default: enabled \n Disabling is fastest. @@ -626,7 +626,7 @@ class Detector(CppDetectorApi): ----- File name: [file name prefix]_d[detector index]_f[sub file index]_[acquisition/file index].[raw/h5]. - Examples + Example -------- d.fname = 'run' eg. file name: run_d0_f0_5.raw @@ -645,7 +645,7 @@ class Detector(CppDetectorApi): ---- If path does not exist, it will try to create it. - Examples + Example -------- d.fpath = '/tmp/run_20201705' """ @@ -687,7 +687,7 @@ class Detector(CppDetectorApi): def rx_framesperfile(self): """Sets the number of frames per file in receiver. - Notes + Note ----- Default: depends on detector type. \n 0 is infinite or all frames in single file. @@ -718,7 +718,7 @@ class Detector(CppDetectorApi): @property def rx_zmqfreq(self): """Frequency of frames streamed out from receiver via zmq. - Notes + Note ----- Default: 1, Means every frame is streamed out. \n If 2, every second frame is streamed out. \n @@ -734,17 +734,15 @@ class Detector(CppDetectorApi): def rx_zmqport(self): """ Zmq port for data to be streamed out of the receiver. - Notes + Note ----- Also restarts receiver zmq streaming if enabled. \n Default is 30001. \n - Modified only when using an intermediate process after receiver. \n Must be different for every detector (and udp port). \n Multi command will automatically increment for individual modules, use setRxZmqPort. - Examples + Example -------- - >>> d.rx_zmqport [30001, 30002, 30003, 300004] >>> d.rx_zmqport = 30001 @@ -765,6 +763,22 @@ class Detector(CppDetectorApi): @property def zmqport(self): + """ + Port number to listen to zmq data streamed out from receiver or intermediate process. + Note + ----- + 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 + + Example + -------- + >>> d.zmqport + [30001, 30003] + >>> d.zmqport = 30002 + >>> d.zmqport = [30002, 30004] #Set ports for the two first detectors + """ return element_if_equal(self.getClientZmqPort()) @zmqport.setter @@ -781,7 +795,7 @@ class Detector(CppDetectorApi): def rx_zmqip(self): """ Zmq Ip Address from which data is to be streamed out of the receiver. - Notes + Note ----- Also restarts receiver zmq streaming if enabled. \n Default is from rx_hostname. \n @@ -791,7 +805,7 @@ class Detector(CppDetectorApi): ------- >>> d.rx_zmqip 192.168.0.101 - >>> d.rx_zmqip = ????? + >>> d.rx_zmqip = '192.168.0.101' """ return element_if_equal(self.getRxZmqIP()) @@ -801,6 +815,20 @@ class Detector(CppDetectorApi): @property def zmqip(self): + """ + Ip Address to listen to zmq data streamed out from receiver or intermediate process. + Note + ----- + Also restarts client zmq streaming if enabled. \n + Default is from rx_hostname. \n + Modified only when using an intermediate process after receiver. + + Example + ------- + >>> d.zmqip + 192.168.0.101 + >>> d.zmqip = '192.168.0.101' + """ return element_if_equal(self.getClientZmqIp()) @zmqip.setter @@ -813,7 +841,8 @@ class Detector(CppDetectorApi): Ip address of the receiver (destination) udp interface. Note ---- - If 'auto' used, then ip is set to ip of rx_hostname. + If 'auto' used, then ip is set to ip of rx_hostname. \n + To set IPs for individual modules, use setDestinationUDPIP. Example ------ >>> d.udp_dstip = '192.168.1.110' @@ -836,7 +865,8 @@ class Detector(CppDetectorApi): ---- [Jungfrau] bottom half \n [Gotthard2] veto debugging \n - If 'auto' used, then ip is set to ip of rx_hostname. + If 'auto' used, then ip is set to ip of rx_hostname. \n + To set IPs for individual modules, use setDestinationUDPIP2. Example ------ >>> d.udp_dstip2 = '10.1.1.185' @@ -857,7 +887,8 @@ class Detector(CppDetectorApi): Mac address of the receiver (destination) udp interface. Note ---- - Not mandatory to set as udp_dstip retrieves it from slsReceiver process but must be set if you use a custom receiver (not slsReceiver). + Not mandatory to set as udp_dstip retrieves it from slsReceiver process but must be set if you use a custom receiver (not slsReceiver). \n + To set MACs for individual modules, use setDestinationUDPMAC. Example ------- >>> d.udp_dstmac = '00:1b:31:01:8a:de' @@ -876,7 +907,8 @@ class Detector(CppDetectorApi): [Jungfrau][Gotthard2] Mac address of the receiver (destination) udp interface 2. Note ---- - Not mandatory to set as udp_dstip2 retrieves it from slsReceiver process but must be set if you use a custom receiver (not slsReceiver). + Not mandatory to set as udp_dstip2 retrieves it from slsReceiver process but must be set if you use a custom receiver (not slsReceiver). \n + To set MACs for individual modules, use setDestinationUDPMAC2. \n [Jungfrau] bottom half \n [Gotthard2] veto debugging \n Example @@ -893,6 +925,18 @@ class Detector(CppDetectorApi): @property def udp_srcmac(self): + """ + Mac address of the receiver (source) udp interface. + Note + ---- + [Eiger] Do not set as detector will replace with its own DHCP Mac (1G) or DHCP Mac + 1 (10G). \n + To set MACs for individual modules, use setSourceUDPMAC. + Example + ------- + >>> d.udp_srcmac = '00:1b:31:01:8a:de' + d.udp_srcmac + 00:1b:31:01:8a:de + """ return element_if_equal(self.getSourceUDPMAC()) @udp_srcmac.setter @@ -905,6 +949,19 @@ class Detector(CppDetectorApi): @property def udp_srcmac2(self): + """ + [Jungfrau][Gotthard2] Mac address of the receiver (source) udp interface 2. + Note + ---- + [Jungfrau] bottom half \n + [Gotthard2] veto debugging \n + To set MACs for individual modules, use setSourceUDPMAC2. + Example + ------- + >>> d.udp_srcmac2 = '00:1b:31:01:8a:de' + d.udp_srcmac2 + 00:1b:31:01:8a:de + """ return element_if_equal(self.getSourceUDPMAC2()) @udp_srcmac2.setter @@ -917,6 +974,19 @@ class Detector(CppDetectorApi): @property def udp_srcip(self): + """ + Ip address of the detector (source) udp interface. + Note + ----- + Must be same subnet as destination udp ip.\n + [Eiger] Set only for 10G. For 1G, detector will replace with its own DHCP IP address. \n + To set IPs for individual modules, use setSourceUDPIP. + Example + ------- + >>> d.udp_srcip = '192.168.1.127' + >>> d.udp_srcip + 192.168.1.127 + """ return element_if_equal(self.getSourceUDPIP()) @udp_srcip.setter @@ -925,6 +995,20 @@ class Detector(CppDetectorApi): @property def udp_srcip2(self): + """ + [Jungfrau][Gotthard2] Ip address of the detector (source) udp interface 2. + Note + ----- + [Jungfrau] bottom half \n + [Gotthard2] veto debugging \n + Must be same subnet as destination udp ip2.\n + To set IPs for individual modules, use setSourceUDPIP2. + Example + ------- + >>> d.udp_srcip2 = '192.168.1.127' + >>> d.udp_srcip2 + 192.168.1.127 + """ return element_if_equal(self.getSourceUDPIP2()) @udp_srcip2.setter @@ -933,6 +1017,14 @@ class Detector(CppDetectorApi): @property def udp_dstport(self): + """ + Port number of the receiver (destination) udp interface. + Note + ---- + Default is 50001. \n + Ports for each module is calculated (incremented by 1 if no 2nd interface) \n + To set ports for individual modules, use setDestinationUDPPort. + """ return element_if_equal(self.getDestinationUDPPort()) @udp_dstport.setter @@ -941,6 +1033,17 @@ class Detector(CppDetectorApi): @property def udp_dstport2(self): + """ + Port number of the receiver (destination) udp interface. + Note + ---- + Default is 50002. \n + [Eiger] right half \n + [Jungfrau] bottom half \n + [Gotthard2] veto debugging \n + Ports for each module is calculated (incremented by 2) \n + To set ports for individual modules, use setDestinationUDPPort2. + """ return element_if_equal(self.getDestinationUDPPort2()) @udp_dstport2.setter @@ -965,6 +1068,9 @@ class Detector(CppDetectorApi): @property def user(self): + """ + Retrieve user details from shared memory (hostname, type, PID, User, Date) + """ return self.getUserDetails() @property @@ -979,7 +1085,7 @@ class Detector(CppDetectorApi): @property def status(self): """Gets detector status. Enum: runStatus - Notes + Note ----- Options: IDLE, ERROR, WAITING, RUN_FINISHED, TRANSMITTING, RUNNING, STOPPED >>> d.status @@ -990,7 +1096,7 @@ class Detector(CppDetectorApi): @property def rx_status(self): """Gets receiver listener status. Enum: runStatus - Notes + Note ----- Options: IDLE, TRANSMITTING, RUNNING >>> d.rx_status @@ -1170,7 +1276,7 @@ class Detector(CppDetectorApi): Setup with n virtual servers running on localhost starting with port p - Examples + Example --------- >>> d.virtual = n, p @@ -1205,7 +1311,7 @@ class Detector(CppDetectorApi): Or use setDefaultRateCorrection to set the default one from trimbit file - Examples + Example ----------- >>> d.ratecorr = 10e-9 >>> d.setDefaultRateCorrection() @@ -1223,7 +1329,7 @@ class Detector(CppDetectorApi): def speed(self): """ [Eiger][Jungfrau] Readout speed of chip. Enum: speedLevel - Notes + Note ----- Options: FULL_SPEED, HALF_SPEED, QUARTER_SPEED \n [Jungfrau] FULL_SPEED option only available from v2.0 boards and with setting number of interfaces to 2. \n @@ -1242,7 +1348,7 @@ class Detector(CppDetectorApi): the modules a list of strings will be returned. On setting the value is automatically converted to a string. - Examples: + Example ----------- >>> d.rx_jsonpara['emin'] @@ -1318,6 +1424,13 @@ class Detector(CppDetectorApi): @property def vthreshold(self): + """ + [Eiger][Mythen3] Detector threshold voltage for single photon counters in dac units. + Note + ---- + [Eiger] Sets vcmp_ll, vcmp_lr, vcmp_rl, vcmp_rr and vcp to the same value. \n + [Mythen3] Sets vth1, vth2 and vth3 to the same value. + """ return element_if_equal(self.getDAC(dacIndex.VTHRESHOLD, False)) @vthreshold.setter @@ -1368,7 +1481,7 @@ class Detector(CppDetectorApi): Subperiod = subexptime + subdeadtime. :getter: always returns in seconds. To get in datetime.delta, use getSubExptime - Examples + Example ----------- >>> d.subexptime = 1.230203 >>> d.subexptime = datetime.timedelta(seconds = 1.23, microseconds = 203) @@ -1403,7 +1516,7 @@ class Detector(CppDetectorApi): Subperiod = subexptime + subdeadtime. :getter: always returns in seconds. To get in datetime.delta, use getSubDeadTime - Examples + Example ----------- >>> d.subdeadtime = 1.230203 >>> d.subdeadtime = datetime.timedelta(seconds = 1.23, microseconds = 203) @@ -1584,7 +1697,7 @@ class Detector(CppDetectorApi): Value: 0-1638375 ns (resolution of 25ns) \n :getter: always returns in seconds. To get in datetime.delta, use getStorageCellDelay - Examples + Example ----------- >>> d.storagecell_delay = 0.00056 >>> d.storagecell_delay = datetime.timedelta(microseconds = 45) @@ -1655,7 +1768,7 @@ class Detector(CppDetectorApi): @element def selinterface(self): """[Jungfrau] The udp interface to stream data from detector. - Notes + Note ----- Effective only when number of interfaces is 1. Default: 0 (outer). Inner is 1. """ @@ -1683,7 +1796,10 @@ class Detector(CppDetectorApi): @element def veto(self): """ - [Gotthard2] Enable or disable veto data streaming from detector. Default is 0. + [Gotthard2] Enable or disable veto data streaming from detector. + Note + ---- + Default is 0. """ return self.getVeto() @@ -1698,7 +1814,7 @@ class Detector(CppDetectorApi): [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 - Examples + Example --------- d.vetofile = '/path/to/file.txt' #set for all chips @@ -1734,7 +1850,7 @@ class Detector(CppDetectorApi): """ [Gotthard2] Set veto reference for all 128 channels for all chips. - Examples: + Example ---------- >>> d.vetoref = chip, value @@ -1763,7 +1879,7 @@ class Detector(CppDetectorApi): :getter: always returns in seconds. To get in datetime.delta, use getGateDelayForAllGates or getGateDelay(gateIndex) - Examples + Example ----------- >>> d.gatedelay = 1.05 >>> d.gatedelay = datetime.timedelta(minutes = 3, seconds = 1.23) @@ -1798,7 +1914,7 @@ class Detector(CppDetectorApi): ----- Each element in list can be 0 - 2 and must be non repetitive. - Examples + Example ----------- >>> d.counters = [0, 1] @@ -1841,12 +1957,12 @@ class Detector(CppDetectorApi): """ [CTB] Readout mode of detector. Enum: readoutMode - Notes + Note ------ Options: ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL Default: ANALOG_ONLY - Examples + Example -------- >>> d.romode = readoutMode.ANALOG_ONLY >>> d.romode @@ -1922,11 +2038,11 @@ class Detector(CppDetectorApi): """ [Ctb] List of digital signal bits read out. - Notes + Note ----- Each element in list can be 0 - 63 and must be non repetitive. - Examples + Example --------- >>> d.rxdbitlist = [0, 1, 61, 9] >>> d.rxdbitlist @@ -2009,7 +2125,7 @@ class Detector(CppDetectorApi): def pattern(self): """[Mythen3][Moench][Ctb] Loads ASCII pattern file directly to server (instead of executing line by line). - Examples + Example --------- >>> d.pattern = '/tmp/pat.txt' """ @@ -2027,7 +2143,7 @@ class Detector(CppDetectorApi): def patioctrl(self): """[Ctb][Moench] 64 bit mask defining input (0) and output (1) signals. - Examples + Example -------- >>> d.patioctrl = 0x8f0effff6dbffdbf >>> hex(d.patioctrl) @@ -2043,7 +2159,7 @@ class Detector(CppDetectorApi): def patlimits(self): """[Ctb][Moench][Mythen3] Limits (start and stop address) of complete pattern. - Examples + Example --------- >>> d.patlimits = [0x0, 0x18c] >>> d.patlimits @@ -2062,7 +2178,7 @@ class Detector(CppDetectorApi): def patsetbit(self): """[Ctb][Moench][Mythen3] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern. - Examples + Example -------- >>> d.patsetbit = 0x8f0effff6dbffdbf >>> hex(d.patsetbit) @@ -2078,7 +2194,7 @@ class Detector(CppDetectorApi): def patmask(self): """[Ctb][Moench][Mythen3] Sets the mask applied to every pattern to the selected bits. - Examples + Example -------- >>> d.patmask = 0x8f0effff6dbffdbf >>> hex(d.patmask) @@ -2096,7 +2212,7 @@ class Detector(CppDetectorApi): def patwait0(self): """[Ctb][Moench][Mythen3] Wait 0 address. - Examples + Example -------- >>> d.patwait0 = 0xaa >>> d.patwait0 @@ -2114,7 +2230,7 @@ class Detector(CppDetectorApi): def patwait1(self): """[Ctb][Moench][Mythen3] Wait 1 address. - Examples + Example -------- >>> d.patwait1 = 0xaa >>> d.patwait1 @@ -2132,7 +2248,7 @@ class Detector(CppDetectorApi): def patwait2(self): """[Ctb][Moench][Mythen3] Wait 2 address. - Examples + Example -------- >>> d.patwait2 = 0xaa >>> d.patwait2 @@ -2177,7 +2293,7 @@ class Detector(CppDetectorApi): def patloop0(self): """[Ctb][Moench][Mythen3] Limits (start and stop address) of loop 0. - Examples + Example --------- >>> d.patloop0 = [0x0, 0x18c] >>> d.patloop0 @@ -2195,7 +2311,7 @@ class Detector(CppDetectorApi): def patloop1(self): """[Ctb][Moench][Mythen3] Limits (start and stop address) of loop 1. - Examples + Example --------- >>> d.patloop1 = [0x0, 0x18c] >>> d.patloop1 @@ -2214,7 +2330,7 @@ class Detector(CppDetectorApi): def patloop2(self): """[Ctb][Moench][Mythen3] Limits (start and stop address) of loop 2. - Examples + Example --------- >>> d.patloop2 = [0x0, 0x18c] >>> d.patloop2 @@ -2259,6 +2375,7 @@ class Detector(CppDetectorApi): @property @element def v_a(self): + """[Ctb] Voltage supply a in mV.""" return self.getDAC(dacIndex.V_POWER_A, True) @v_a.setter @@ -2268,6 +2385,7 @@ class Detector(CppDetectorApi): @property @element def v_b(self): + """[Ctb] Voltage supply a in mV.""" return self.getDAC(dacIndex.V_POWER_B, True) @v_b.setter @@ -2277,6 +2395,7 @@ class Detector(CppDetectorApi): @property @element def v_c(self): + """[Ctb] Voltage supply a in mV.""" return self.getDAC(dacIndex.V_POWER_C, True) @v_c.setter @@ -2286,6 +2405,7 @@ class Detector(CppDetectorApi): @property @element def v_d(self): + """[Ctb] Voltage supply a in mV.""" return self.getDAC(dacIndex.V_POWER_D, True) @v_d.setter @@ -2295,6 +2415,7 @@ class Detector(CppDetectorApi): @property @element def v_io(self): + """[Ctb] Voltage supply a in mV.""" return self.getDAC(dacIndex.V_POWER_IO, True) @v_io.setter @@ -2304,6 +2425,7 @@ class Detector(CppDetectorApi): @property @element def v_limit(self): + """[Ctb][Moench] Soft limit for power supplies (ctb only) and DACS in mV.""" return self.getDAC(dacIndex.V_LIMIT, True) @v_limit.setter @@ -2315,7 +2437,7 @@ class Detector(CppDetectorApi): def im_a(self): """[Ctb] Measured current of power supply a in mA. - Notes + Note ----- :setter: Not implemented """ @@ -2326,7 +2448,7 @@ class Detector(CppDetectorApi): def im_b(self): """[Ctb] Measured current of power supply b in mA. - Notes + Note ----- :setter: Not implemented """ @@ -2337,7 +2459,7 @@ class Detector(CppDetectorApi): def im_c(self): """[Ctb] Measured current of power supply c in mA. - Notes + Note ----- :setter: Not implemented """ @@ -2348,7 +2470,7 @@ class Detector(CppDetectorApi): def im_d(self): """[Ctb] Measured current of power supply d in mA. - Notes + Note ----- :setter: Not implemented """ @@ -2359,7 +2481,7 @@ class Detector(CppDetectorApi): def im_io(self): """[Ctb] Measured current of power supply io in mA. - Notes + Note ----- :setter: Not implemented """ diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 470b160ee..366b8d00e 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -520,15 +520,16 @@ class Detector { Result getSourceUDPIP(Positions pos = {}) const; /**For Eiger 1G, the detector will replace with its own DHCP IP - * 10G Eiger and other detectors, the source UDP IP must be in the + * 10G Eiger and other detectors. The source UDP IP must be in the * same subnet of the destination UDP IP */ void setSourceUDPIP(const IpAddr ip, Positions pos = {}); - /** [Jungfrau] bottom half */ + /** [Jungfrau] bottom half [Gotthard2] veto debugging */ Result getSourceUDPIP2(Positions pos = {}) const; - /** [Jungfrau] bottom half */ + /** [Jungfrau] bottom half [Gotthard2] veto debugging. \n The source UDP IP + * must be in the same subnet of the destination UDP IP2 */ void setSourceUDPIP2(const IpAddr ip, Positions pos = {}); Result getSourceUDPMAC(Positions pos = {}) const; @@ -537,13 +538,12 @@ class Detector { * For Eiger 10G, the detector will replace with its own DHCP MAC + 1 * Others can be anything (beware of certain bits) */ - void setSourceUDPMAC(const MacAddr mac, Positions pos = {}); - /** [Jungfrau] bottom half */ + /** [Jungfrau] bottom half [Gotthard2] veto debugging */ Result getSourceUDPMAC2(Positions pos = {}) const; - /** [Jungfrau] bottom half */ + /** [Jungfrau] bottom half [Gotthard2] veto debugging */ void setSourceUDPMAC2(const MacAddr mac, Positions pos = {}); Result getDestinationUDPIP(Positions pos = {}) const; @@ -577,17 +577,16 @@ class Detector { Result getDestinationUDPPort(Positions pos = {}) const; - /** module_id is -1 for all detectors, ports for each module is calculated - * (increments) */ + /** Default is 50001. \n If module_id is -1, ports for each module is + * calculated (incremented by 1 if no 2nd interface) */ void setDestinationUDPPort(int port, int module_id = -1); - /** [Eiger right port][Jungfrau bottom half] */ + /** [Eiger] right port[Jungfrau] bottom half [Gotthard2] veto debugging */ Result getDestinationUDPPort2(Positions pos = {}) const; - /** [Eiger right port][Jungfrau bottom half] - * module_id is -1 for all detectors, ports for each module is calculated - * (increments) - */ + /** [Eiger] right port[Jungfrau] bottom half [Gotthard2] veto debugging \n + * Default is 50002. \n If module_id is -1, ports for each module is + * calculated (incremented by 1 if no 2nd interface)*/ void setDestinationUDPPort2(int port, int module_id = -1); void reconfigureUDPDestination(Positions pos = {}); @@ -831,10 +830,10 @@ class Detector { /** Zmq port for data to be streamed out of the receiver. \n * Also restarts receiver zmq streaming if enabled. \n Default is 30001. \n - * Modified only when using an intermediate process after receiver. \n Must - * be different for every detector (and udp port). \n module_id is -1 for - * all detectors, ports for each module is calculated (increments) Restarts - * receiver zmq sockets only if it was already enabled + * Must be different for every detector (and udp port). \n module_id is -1 + * for all detectors, ports for each module is calculated (increment by 1 if + * no 2nd interface). \n Restarts receiver zmq sockets only if it was + * already enabled */ void setRxZmqPort(int port, int module_id = -1); @@ -848,16 +847,22 @@ class Detector { Result getClientZmqPort(Positions pos = {}) const; - /** - * Modified only when using an intermediate process between receiver and - * gui/client. Module_id is -1 for all detectors, ports for each module is - * calculated (increments) Restarts client zmq sockets only if it was - * already enabled + /** Port number to listen to zmq data streamed out from receiver or + * intermediate process. \n Must be different for every detector (and udp + * port). \n Module_id is -1 for all detectors, ports for each module is + * calculated (increment by 1 if no 2nd interface). \n Restarts client zmq + * sockets only if it was already enabled \n Default connects to receiver + * zmq streaming out port (30001). */ void setClientZmqPort(int port, int module_id = -1); 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. + */ void setClientZmqIp(const IpAddr ip, Positions pos = {}); ///@{ @@ -1165,7 +1170,7 @@ class Detector { /** [Gotthard2] */ Result getVeto(Positions pos = {}) const; - /** [Gotthard2] */ + /** [Gotthard2] Default disabled */ void setVeto(const bool enable, Positions pos = {}); /** [Gotthard2] */ @@ -1611,6 +1616,8 @@ class Detector { * [Gotthard2] only in continuous mode */ Result getMeasurementTime(Positions pos = {}) const; + /** get user details from shared memory (hostname, type, PID, User, Date) + */ std::string getUserDetails() const; Result getRxCurrentFrameIndex(Positions pos = {}) const; diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index 413a5faf8..54f9a4b43 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -2631,7 +2631,9 @@ std::string CmdProxy::UserDetails(int action) { std::ostringstream os; os << cmd << ' '; if (action == defs::HELP_ACTION) { - os << "\n\tUser details from shared memory." << '\n'; + os << "\n\tUser details from shared memory (hostname, type, PID, User, " + "Date)." + << '\n'; } else if (action == defs::GET_ACTION) { if (det_id != -1) { throw sls::RuntimeError("Cannot execute this at module level"); diff --git a/slsDetectorSoftware/src/CmdProxy.h b/slsDetectorSoftware/src/CmdProxy.h index 7ea2e0ac5..55451b49b 100644 --- a/slsDetectorSoftware/src/CmdProxy.h +++ b/slsDetectorSoftware/src/CmdProxy.h @@ -1303,9 +1303,12 @@ class CmdProxy { /* dacs */ - DAC_COMMAND(vthreshold, getDAC, setDAC, defs::VTHRESHOLD, - "[dac or mV value][(optional unit) mV] \n\t[Eiger][Mythen3] " - "Detector threshold voltage for single photon counters."); + DAC_COMMAND( + vthreshold, getDAC, setDAC, defs::VTHRESHOLD, + "[dac or mV value][(optional unit) mV] \n\t[Eiger][Mythen3] " + "Detector threshold voltage for single photon counters.\n\t[Eiger] " + "Sets vcmp_ll, vcmp_lr, vcmp_rl, vcmp_rr and vcp to the same value. " + "\n\t[Mythen3] Sets vth1, vth2 and vth3 to the same value."); DAC_COMMAND(vsvp, getDAC, setDAC, defs::VSVP, "[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for " @@ -1669,16 +1672,21 @@ class CmdProxy { INTEGER_COMMAND(udp_srcip, getSourceUDPIP, setSourceUDPIP, IpAddr, "[x.x.x.x]\n\tIp address of the detector (source) udp " - "interface. Must be same subnet as destination udp ip."); + "interface. Must be same subnet as destination udp " + "ip.\n\t[Eiger] Set only for 10G. For 1G, detector will " + "replace with its own DHCP IP address."); INTEGER_COMMAND( udp_srcip2, getSourceUDPIP2, setSourceUDPIP2, IpAddr, - "[x.x.x.x]\n\t[Jungfrau] Ip address of the bottom half of detector " - "(source) udp interface. Must be same subnet as destination udp ip2."); + "[x.x.x.x]\n\t[Jungfrau][Gotthard2] Ip address of the detector " + "(source) udp interface 2. Must be same subnet as destination udp " + "ip2.\n\t [Jungfrau] bottom half \n\t [Gotthard2] veto debugging."); - INTEGER_COMMAND(udp_srcmac, getSourceUDPMAC, setSourceUDPMAC, MacAddr, - "[x:x:x:x:x:x]\n\tMac address of the detector (source) udp " - "interface. "); + INTEGER_COMMAND( + udp_srcmac, getSourceUDPMAC, setSourceUDPMAC, MacAddr, + "[x:x:x:x:x:x]\n\tMac address of the detector (source) udp " + "interface. \n\t[Eiger] Do not set as detector will replace with its " + "own DHCP Mac (1G) or DHCP Mac + 1 (10G)."); INTEGER_COMMAND(udp_srcmac2, getSourceUDPMAC2, setSourceUDPMAC2, MacAddr, "[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the bottom " @@ -1696,21 +1704,23 @@ class CmdProxy { "[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the receiver (destination) " "udp interface 2. Not mandatory to set as udp_dstip2 retrieves it from " "slsReceiver process but must be set if you use a custom receiver (not " - "slsReceiver). \n [Jungfrau] bottom half \n [Gotthard2] veto debugging " - "\n"); - - INTEGER_COMMAND(udp_dstport, getDestinationUDPPort, setDestinationUDPPort, - StringTo, - "[n]\n\tPort number of the receiver (destination) udp " - "interface. Default is 50001."); + "slsReceiver). \n\t [Jungfrau] bottom half \n\t [Gotthard2] veto " + "debugging."); INTEGER_COMMAND( - udp_dstport2, getDestinationUDPPort2, setDestinationUDPPort2, + udp_dstport, getDestinationUDPPort, setDestinationUDPPort, StringTo, - "[n]\n\tDefault is 50002.\n\t[Jungfrau] Port number of the receiver " - "(destination) udp interface where the second half of detector data is " - "sent to. \n\t[Eiger] Port number of the reciever (desintation) udp " - "interface where the right half of the detector data is sent to."); + "[n]\n\tPort number of the receiver (destination) udp " + "interface. Default is 50001. \n\tIf multi command, ports for each " + "module is calculated (incremented by 1 if no 2nd interface)"); + + INTEGER_COMMAND(udp_dstport2, getDestinationUDPPort2, + setDestinationUDPPort2, StringTo, + "[n]\n\t[Jungfrau][Eiger][Gotthard2] Port number of the " + "receiver (destination) udp interface 2. Default is 50002. " + "\n\tIf multi command, ports for each module is calculated " + "(incremented by 2) \n\t[Jungfrau] bottom half \n\t[Eiger] " + "right half \n\t[Gotthard2] veto debugging"); EXECUTE_SET_COMMAND( udp_reconfigure, reconfigureUDPDestination, @@ -1890,7 +1900,7 @@ class CmdProxy { INTEGER_COMMAND( zmqport, getClientZmqPort, setClientZmqPort, StringTo, "[port]\n\tZmq port in client(gui) or intermediate process for data to " - "be streamed to from receiver. efault connects to receiver zmq " + "be streamed to from receiver. Default connects to receiver zmq " "streaming out port (30001). Modified only when using an intermediate " "process between receiver and client(gui). Also restarts client zmq " "streaming if enabled. Must be different for every detector (and udp " @@ -1906,8 +1916,8 @@ class CmdProxy { INTEGER_COMMAND( zmqip, getClientZmqIp, setClientZmqIp, IpAddr, - "[x.x.x.x]\n\tZmq IP Address in client(gui) or intermediate process " - "for data to be streamed to from receiver. Default connects to " + "[x.x.x.x]\n\tIp 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."); @@ -2082,7 +2092,7 @@ class CmdProxy { INTEGER_IND_COMMAND(v_limit, getVoltage, setVoltage, StringTo, defs::V_LIMIT, "[n_value]\n\t[Ctb][Moench] Soft limit for power " - "supplies(ctb only) and DACS in mV."); + "supplies (ctb only) and DACS in mV."); INTEGER_COMMAND_HEX(adcenable, getADCEnableMask, setADCEnableMask, StringTo,