mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 14:38:14 +02:00
Jf: Electron collection mode (#983)
* electron collection mode for jungfrau. also removing the config chip when using register command * collectionMode: HOLE/ELECTRON (enum)
This commit is contained in:
parent
7fa5b5d70a
commit
5b832cb6aa
@ -2910,6 +2910,18 @@ class Detector(CppDetectorApi):
|
|||||||
def pedestalmode(self, value):
|
def pedestalmode(self, value):
|
||||||
ut.set_using_dict(self.setPedestalMode, value)
|
ut.set_using_dict(self.setPedestalMode, value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def collectionmode(self):
|
||||||
|
"""[Jungfrau] Sets collection mode to HOLE or ELECTRON. Default is HOLE.
|
||||||
|
Enum: collectionMode
|
||||||
|
"""
|
||||||
|
return self.getCollectionMode()
|
||||||
|
|
||||||
|
@collectionmode.setter
|
||||||
|
def collectionmode(self, value):
|
||||||
|
ut.set_using_dict(self.setCollectionMode, value)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def maxclkphaseshift(self):
|
def maxclkphaseshift(self):
|
||||||
"""
|
"""
|
||||||
|
@ -1271,6 +1271,16 @@ void init_det(py::module &m) {
|
|||||||
(void (Detector::*)(const defs::pedestalParameters, sls::Positions)) &
|
(void (Detector::*)(const defs::pedestalParameters, sls::Positions)) &
|
||||||
Detector::setPedestalMode,
|
Detector::setPedestalMode,
|
||||||
py::arg(), py::arg() = Positions{});
|
py::arg(), py::arg() = Positions{});
|
||||||
|
CppDetectorApi.def(
|
||||||
|
"getCollectionMode",
|
||||||
|
(Result<defs::collectionMode>(Detector::*)(sls::Positions) const) &
|
||||||
|
Detector::getCollectionMode,
|
||||||
|
py::arg() = Positions{});
|
||||||
|
CppDetectorApi.def(
|
||||||
|
"setCollectionMode",
|
||||||
|
(void (Detector::*)(defs::collectionMode, sls::Positions)) &
|
||||||
|
Detector::setCollectionMode,
|
||||||
|
py::arg(), py::arg() = Positions{});
|
||||||
CppDetectorApi.def("getROI",
|
CppDetectorApi.def("getROI",
|
||||||
(Result<defs::ROI>(Detector::*)(sls::Positions) const) &
|
(Result<defs::ROI>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getROI,
|
Detector::getROI,
|
||||||
|
@ -327,4 +327,9 @@ void init_enums(py::module &m) {
|
|||||||
.value("POSITIVE", slsDetectorDefs::polarity::POSITIVE)
|
.value("POSITIVE", slsDetectorDefs::polarity::POSITIVE)
|
||||||
.value("NEGATIVE", slsDetectorDefs::polarity::NEGATIVE)
|
.value("NEGATIVE", slsDetectorDefs::polarity::NEGATIVE)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
|
py::enum_<slsDetectorDefs::collectionMode>(Defs, "collectionMode")
|
||||||
|
.value("HOLE", slsDetectorDefs::collectionMode::HOLE)
|
||||||
|
.value("ELECTRON", slsDetectorDefs::collectionMode::ELECTRON)
|
||||||
|
.export_values();
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
@ -572,6 +572,7 @@ void setupDetector() {
|
|||||||
#endif
|
#endif
|
||||||
setPedestalMode(DEFAULT_PEDESTAL_MODE, DEFAULT_PEDESTAL_FRAMES,
|
setPedestalMode(DEFAULT_PEDESTAL_MODE, DEFAULT_PEDESTAL_FRAMES,
|
||||||
DEFAULT_PEDESTAL_LOOPS);
|
DEFAULT_PEDESTAL_LOOPS);
|
||||||
|
setElectronCollectionMode(DEFAULT_ELECTRON_COLLECTION_MODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int resetToDefaultDacs(int hardReset) {
|
int resetToDefaultDacs(int hardReset) {
|
||||||
@ -2615,6 +2616,22 @@ void setPedestalMode(int enable, uint8_t frames, uint16_t loops) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getElectronCollectionMode() {
|
||||||
|
return ((bus_r(DAQ_REG) & DAQ_ELCTRN_CLLCTN_MDE_MSK) >>
|
||||||
|
DAQ_ELCTRN_CLLCTN_MDE_OFST);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setElectronCollectionMode(int enable) {
|
||||||
|
LOG(logINFO,
|
||||||
|
("Setting Collection Mode to %s\n", enable == 0 ? "Hole" : "Electron"));
|
||||||
|
if (enable) {
|
||||||
|
bus_w(DAQ_REG, bus_r(DAQ_REG) | DAQ_ELCTRN_CLLCTN_MDE_MSK);
|
||||||
|
} else {
|
||||||
|
bus_w(DAQ_REG, bus_r(DAQ_REG) & ~DAQ_ELCTRN_CLLCTN_MDE_MSK);
|
||||||
|
}
|
||||||
|
configureChip();
|
||||||
|
}
|
||||||
|
|
||||||
int getTenGigaFlowControl() {
|
int getTenGigaFlowControl() {
|
||||||
return ((bus_r(CONFIG_REG) & CONFIG_ETHRNT_FLW_CNTRL_MSK) >>
|
return ((bus_r(CONFIG_REG) & CONFIG_ETHRNT_FLW_CNTRL_MSK) >>
|
||||||
CONFIG_ETHRNT_FLW_CNTRL_OFST);
|
CONFIG_ETHRNT_FLW_CNTRL_OFST);
|
||||||
|
@ -37,28 +37,29 @@
|
|||||||
#define CONFIG_FILE ("config_jungfrau.txt")
|
#define CONFIG_FILE ("config_jungfrau.txt")
|
||||||
|
|
||||||
/** Default Parameters */
|
/** Default Parameters */
|
||||||
#define DEFAULT_NUM_FRAMES (100 * 1000 * 1000)
|
#define DEFAULT_NUM_FRAMES (100 * 1000 * 1000)
|
||||||
#define DEFAULT_STARTING_FRAME_NUMBER (1)
|
#define DEFAULT_STARTING_FRAME_NUMBER (1)
|
||||||
#define DEFAULT_NUM_CYCLES (1)
|
#define DEFAULT_NUM_CYCLES (1)
|
||||||
#define DEFAULT_EXPTIME (10 * 1000) // ns
|
#define DEFAULT_EXPTIME (10 * 1000) // ns
|
||||||
#define DEFAULT_PERIOD (2 * 1000 * 1000) // ns
|
#define DEFAULT_PERIOD (2 * 1000 * 1000) // ns
|
||||||
#define DEFAULT_DELAY (0)
|
#define DEFAULT_DELAY (0)
|
||||||
#define DEFAULT_HIGH_VOLTAGE (0)
|
#define DEFAULT_HIGH_VOLTAGE (0)
|
||||||
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
||||||
#define DEFAULT_SETTINGS (GAIN0)
|
#define DEFAULT_SETTINGS (GAIN0)
|
||||||
#define DEFAULT_GAINMODE (DYNAMIC)
|
#define DEFAULT_GAINMODE (DYNAMIC)
|
||||||
#define DEFAULT_TX_UDP_PORT (0x7e9a)
|
#define DEFAULT_TX_UDP_PORT (0x7e9a)
|
||||||
#define DEFAULT_TMP_THRSHLD (65 * 1000) // milli degree Celsius
|
#define DEFAULT_TMP_THRSHLD (65 * 1000) // milli degree Celsius
|
||||||
#define DEFAULT_NUM_STRG_CLLS (0)
|
#define DEFAULT_NUM_STRG_CLLS (0)
|
||||||
#define DEFAULT_STRG_CLL_STRT (0xf)
|
#define DEFAULT_STRG_CLL_STRT (0xf)
|
||||||
#define DEFAULT_STRG_CLL_STRT_CHIP11 (0x3)
|
#define DEFAULT_STRG_CLL_STRT_CHIP11 (0x3)
|
||||||
#define DEFAULT_STRG_CLL_DLY (0)
|
#define DEFAULT_STRG_CLL_DLY (0)
|
||||||
#define DEFAULT_FLIP_ROWS (0)
|
#define DEFAULT_FLIP_ROWS (0)
|
||||||
#define DEFAULT_FILTER_RESISTOR (1) // higher resistor
|
#define DEFAULT_FILTER_RESISTOR (1) // higher resistor
|
||||||
#define DEFAULT_FILTER_CELL (0)
|
#define DEFAULT_FILTER_CELL (0)
|
||||||
#define DEFAULT_PEDESTAL_MODE (0)
|
#define DEFAULT_PEDESTAL_MODE (0)
|
||||||
#define DEFAULT_PEDESTAL_FRAMES (1)
|
#define DEFAULT_PEDESTAL_FRAMES (1)
|
||||||
#define DEFAULT_PEDESTAL_LOOPS (1)
|
#define DEFAULT_PEDESTAL_LOOPS (1)
|
||||||
|
#define DEFAULT_ELECTRON_COLLECTION_MODE (0)
|
||||||
|
|
||||||
#define HIGHVOLTAGE_MIN (60)
|
#define HIGHVOLTAGE_MIN (60)
|
||||||
#define HIGHVOLTAGE_MAX (200)
|
#define HIGHVOLTAGE_MAX (200)
|
||||||
|
@ -607,6 +607,8 @@ uint64_t getSelectCurrentSource();
|
|||||||
int getPedestalMode();
|
int getPedestalMode();
|
||||||
void getPedestalParameters(uint8_t *frames, uint16_t *loops);
|
void getPedestalParameters(uint8_t *frames, uint16_t *loops);
|
||||||
void setPedestalMode(int enable, uint8_t frames, uint16_t loops);
|
void setPedestalMode(int enable, uint8_t frames, uint16_t loops);
|
||||||
|
int getElectronCollectionMode();
|
||||||
|
void setElectronCollectionMode(int enable);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// eiger specific - iodelay, pulse, rate, temp, activate, delay nw parameter
|
// eiger specific - iodelay, pulse, rate, temp, activate, delay nw parameter
|
||||||
|
@ -330,3 +330,5 @@ int setColumn(int);
|
|||||||
int get_pedestal_mode(int);
|
int get_pedestal_mode(int);
|
||||||
int set_pedestal_mode(int);
|
int set_pedestal_mode(int);
|
||||||
int config_transceiver(int);
|
int config_transceiver(int);
|
||||||
|
int get_collection_mode(int);
|
||||||
|
int set_collection_mode(int);
|
||||||
|
@ -85,21 +85,7 @@ u_int32_t readRegister(u_int32_t offset) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void writeRegister(u_int32_t offset, u_int32_t data) {
|
void writeRegister(u_int32_t offset, u_int32_t data) {
|
||||||
// if electron mode bit touched
|
|
||||||
#ifdef JUNGFRAUD
|
|
||||||
int electronCollectionModeChange = 0;
|
|
||||||
if ((offset << MEM_MAP_SHIFT) == DAQ_REG) {
|
|
||||||
if ((readRegister(offset) ^ data) & DAQ_ELCTRN_CLLCTN_MDE_MSK) {
|
|
||||||
electronCollectionModeChange = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
bus_w(offset << MEM_MAP_SHIFT, data);
|
bus_w(offset << MEM_MAP_SHIFT, data);
|
||||||
#ifdef JUNGFRAUD
|
|
||||||
if (electronCollectionModeChange) {
|
|
||||||
configureChip();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u_int32_t readRegister16(u_int32_t offset) {
|
u_int32_t readRegister16(u_int32_t offset) {
|
||||||
|
@ -492,6 +492,8 @@ void function_table() {
|
|||||||
flist[F_GET_PEDESTAL_MODE] = &get_pedestal_mode;
|
flist[F_GET_PEDESTAL_MODE] = &get_pedestal_mode;
|
||||||
flist[F_SET_PEDESTAL_MODE] = &set_pedestal_mode;
|
flist[F_SET_PEDESTAL_MODE] = &set_pedestal_mode;
|
||||||
flist[F_CONFIG_TRANSCEIVER] = &config_transceiver;
|
flist[F_CONFIG_TRANSCEIVER] = &config_transceiver;
|
||||||
|
flist[F_GET_COLLECTION_MODE] = &get_collection_mode;
|
||||||
|
flist[F_SET_COLLECTION_MODE] = &set_collection_mode;
|
||||||
|
|
||||||
// check
|
// check
|
||||||
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
|
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
|
||||||
@ -11086,3 +11088,62 @@ int config_transceiver(int file_des) {
|
|||||||
#endif
|
#endif
|
||||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int get_collection_mode(int file_des) {
|
||||||
|
ret = OK;
|
||||||
|
memset(mess, 0, sizeof(mess));
|
||||||
|
enum collectionMode retval = HOLE;
|
||||||
|
|
||||||
|
LOG(logDEBUG1, ("Getting collection mode\n"));
|
||||||
|
|
||||||
|
#ifndef JUNGFRAUD
|
||||||
|
functionNotImplemented();
|
||||||
|
#else
|
||||||
|
// get only
|
||||||
|
retval = getElectronCollectionMode() ? ELECTRON : HOLE;
|
||||||
|
LOG(logDEBUG1, ("collection mode retval: %u\n", retval));
|
||||||
|
#endif
|
||||||
|
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
|
||||||
|
}
|
||||||
|
|
||||||
|
int set_collection_mode(int file_des) {
|
||||||
|
ret = OK;
|
||||||
|
memset(mess, 0, sizeof(mess));
|
||||||
|
enum collectionMode arg = HOLE;
|
||||||
|
|
||||||
|
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
LOG(logDEBUG1, ("Setting collection mode: %u\n", (int)arg));
|
||||||
|
|
||||||
|
#ifndef JUNGFRAUD
|
||||||
|
functionNotImplemented();
|
||||||
|
#else
|
||||||
|
// only set
|
||||||
|
if (Server_VerifyLock() == OK) {
|
||||||
|
if (getChipVersion() == 11) {
|
||||||
|
ret = FAIL;
|
||||||
|
sprintf(mess,
|
||||||
|
"Cannot set addl. number of storage cells for chip v1.1\n");
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
} else {
|
||||||
|
switch (arg) {
|
||||||
|
case HOLE:
|
||||||
|
setElectronCollectionMode(0);
|
||||||
|
break;
|
||||||
|
case ELECTRON:
|
||||||
|
setElectronCollectionMode(1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
modeNotImplemented("Collection mode index", (int)arg);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
enum collectionMode retval =
|
||||||
|
getElectronCollectionMode() ? ELECTRON : HOLE;
|
||||||
|
validate(&ret, mess, (int)arg, (int)retval, "set collection mode",
|
||||||
|
DEC);
|
||||||
|
LOG(logDEBUG1, ("collection mode retval: %u\n", retval));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||||
|
}
|
@ -80,7 +80,7 @@ _sd() {
|
|||||||
local IS_PATH=0
|
local IS_PATH=0
|
||||||
|
|
||||||
|
|
||||||
local SLS_COMMANDS=" acquire activate adcclk adcenable adcenable10g adcindex adcinvert adclist adcname adcphase adcpipeline adcreg adcvpp apulse asamples autocompdisable badchannels blockingtrigger burstmode burstperiod bursts burstsl bustest cdsgain chipversion clearbit clearbusy clearroi clientversion clkdiv clkfreq clkphase column compdisabletime confadc config configtransceiver counters currentsource dac dacindex daclist dacname dacvalues datastream dbitclk dbitphase dbitpipeline defaultdac defaultpattern delay delayl detectorserverversion detsize diodelay dpulse dr drlist dsamples execcommand exptime exptime1 exptime2 exptime3 exptimel extrastoragecells extsampling extsamplingsrc extsig fformat filtercells filterresistor findex firmwaretest firmwareversion fliprows flowcontrol10g fmaster fname foverwrite fpath framecounter frames framesl frametime free fwrite gaincaps gainmode gappixels gatedelay gatedelay1 gatedelay2 gatedelay3 gates getbit hardwareversion highvoltage hostname im_a im_b im_c im_d im_io imagetest initialchecks inj_ch interpolation interruptsubframe kernelversion lastclient led lock master maxadcphaseshift maxclkphaseshift maxdbitphaseshift measuredperiod measuredsubperiod moduleid nextframenumber nmod numinterfaces overflow packageversion parallel parameters partialreset patfname patioctrl patlimits patloop patloop0 patloop1 patloop2 patmask patnloop patnloop0 patnloop1 patnloop2 patsetbit patternX patternstart patwait patwait0 patwait1 patwait2 patwaittime patwaittime0 patwaittime1 patwaittime2 patword pedestalmode period periodl polarity port powerchip powerindex powerlist powername powervalues programfpga pulse pulsechip pulsenmove pumpprobe quad ratecorr readnrows readout readoutspeed readoutspeedlist rebootcontroller reg resetdacs resetfpga roi romode row runclk runtime rx_arping rx_clearroi rx_dbitlist rx_dbitoffset rx_discardpolicy rx_fifodepth rx_frameindex rx_framescaught rx_framesperfile rx_hostname rx_jsonaddheader rx_jsonpara rx_lastclient rx_lock rx_missingpackets rx_padding rx_printconfig rx_realudpsocksize rx_roi rx_silent rx_start rx_status rx_stop rx_tcpport rx_threads rx_udpsocksize rx_version rx_zmqfreq rx_zmqhwm rx_zmqip rx_zmqport rx_zmqstartfnum rx_zmqstream samples savepattern scan scanerrmsg selinterface serialnumber setbit settings settingslist settingspath signalindex signallist signalname slowadc slowadcindex slowadclist slowadcname slowadcvalues start status stop stopport storagecell_delay storagecell_start subdeadtime subexptime sync syncclk temp_10ge temp_adc temp_control temp_dcdc temp_event temp_fpga temp_fpgaext temp_fpgafl temp_fpgafr temp_slowadc temp_sodl temp_sodr temp_threshold templist tempvalues tengiga threshold thresholdnotb timing timinglist timingsource top transceiverenable trigger triggers triggersl trimbits trimen trimval tsamples txdelay txdelay_frame txdelay_left txdelay_right type udp_cleardst udp_dstip udp_dstip2 udp_dstlist udp_dstmac udp_dstmac2 udp_dstport udp_dstport2 udp_firstdst udp_numdst udp_reconfigure udp_srcip udp_srcip2 udp_srcmac udp_srcmac2 udp_validate update updatedetectorserver updatekernel updatemode user v_a v_b v_c v_chip v_d v_io v_limit vchip_comp_adc vchip_comp_fe vchip_cs vchip_opa_1st vchip_opa_fd vchip_ref_comp_fe versions veto vetoalg vetofile vetophoton vetoref vetostream virtual vm_a vm_b vm_c vm_d vm_io zmqhwm zmqip zmqport "
|
local SLS_COMMANDS=" acquire activate adcclk adcenable adcenable10g adcindex adcinvert adclist adcname adcphase adcpipeline adcreg adcvpp apulse asamples autocompdisable badchannels blockingtrigger burstmode burstperiod bursts burstsl bustest cdsgain chipversion clearbit clearbusy clearroi clientversion clkdiv clkfreq clkphase collectionmode column compdisabletime confadc config configtransceiver counters currentsource dac dacindex daclist dacname dacvalues datastream dbitclk dbitphase dbitpipeline defaultdac defaultpattern delay delayl detectorserverversion detsize diodelay dpulse dr drlist dsamples execcommand exptime exptime1 exptime2 exptime3 exptimel extrastoragecells extsampling extsamplingsrc extsig fformat filtercells filterresistor findex firmwaretest firmwareversion fliprows flowcontrol10g fmaster fname foverwrite fpath framecounter frames framesl frametime free fwrite gaincaps gainmode gappixels gatedelay gatedelay1 gatedelay2 gatedelay3 gates getbit hardwareversion highvoltage hostname im_a im_b im_c im_d im_io imagetest initialchecks inj_ch interpolation interruptsubframe kernelversion lastclient led lock master maxadcphaseshift maxclkphaseshift maxdbitphaseshift measuredperiod measuredsubperiod moduleid nextframenumber nmod numinterfaces overflow packageversion parallel parameters partialreset patfname patioctrl patlimits patloop patloop0 patloop1 patloop2 patmask patnloop patnloop0 patnloop1 patnloop2 patsetbit patternX patternstart patwait patwait0 patwait1 patwait2 patwaittime patwaittime0 patwaittime1 patwaittime2 patword pedestalmode period periodl polarity port powerchip powerindex powerlist powername powervalues programfpga pulse pulsechip pulsenmove pumpprobe quad ratecorr readnrows readout readoutspeed readoutspeedlist rebootcontroller reg resetdacs resetfpga roi romode row runclk runtime rx_arping rx_clearroi rx_dbitlist rx_dbitoffset rx_discardpolicy rx_fifodepth rx_frameindex rx_framescaught rx_framesperfile rx_hostname rx_jsonaddheader rx_jsonpara rx_lastclient rx_lock rx_missingpackets rx_padding rx_printconfig rx_realudpsocksize rx_roi rx_silent rx_start rx_status rx_stop rx_tcpport rx_threads rx_udpsocksize rx_version rx_zmqfreq rx_zmqhwm rx_zmqip rx_zmqport rx_zmqstartfnum rx_zmqstream samples savepattern scan scanerrmsg selinterface serialnumber setbit settings settingslist settingspath signalindex signallist signalname slowadc slowadcindex slowadclist slowadcname slowadcvalues start status stop stopport storagecell_delay storagecell_start subdeadtime subexptime sync syncclk temp_10ge temp_adc temp_control temp_dcdc temp_event temp_fpga temp_fpgaext temp_fpgafl temp_fpgafr temp_slowadc temp_sodl temp_sodr temp_threshold templist tempvalues tengiga threshold thresholdnotb timing timinglist timingsource top transceiverenable trigger triggers triggersl trimbits trimen trimval tsamples txdelay txdelay_frame txdelay_left txdelay_right type udp_cleardst udp_dstip udp_dstip2 udp_dstlist udp_dstmac udp_dstmac2 udp_dstport udp_dstport2 udp_firstdst udp_numdst udp_reconfigure udp_srcip udp_srcip2 udp_srcmac udp_srcmac2 udp_validate update updatedetectorserver updatekernel updatemode user v_a v_b v_c v_chip v_d v_io v_limit vchip_comp_adc vchip_comp_fe vchip_cs vchip_opa_1st vchip_opa_fd vchip_ref_comp_fe versions veto vetoalg vetofile vetophoton vetoref vetostream virtual vm_a vm_b vm_c vm_d vm_io zmqhwm zmqip zmqport "
|
||||||
__acquire() {
|
__acquire() {
|
||||||
FCN_RETURN=""
|
FCN_RETURN=""
|
||||||
return 0
|
return 0
|
||||||
@ -413,6 +413,15 @@ fi
|
|||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
__collectionmode() {
|
||||||
|
FCN_RETURN=""
|
||||||
|
if [[ ${IS_GET} -eq 0 ]]; then
|
||||||
|
if [[ "${cword}" == "2" ]]; then
|
||||||
|
FCN_RETURN="electron hole"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
__column() {
|
__column() {
|
||||||
FCN_RETURN=""
|
FCN_RETURN=""
|
||||||
if [[ ${IS_GET} -eq 0 ]]; then
|
if [[ ${IS_GET} -eq 0 ]]; then
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,7 @@
|
|||||||
_sd() {
|
_sd() {
|
||||||
|
|
||||||
|
|
||||||
local SLS_COMMANDS=" acquire activate adcclk adcenable adcenable10g adcindex adcinvert adclist adcname adcphase adcpipeline adcreg adcvpp apulse asamples autocompdisable badchannels blockingtrigger burstmode burstperiod bursts burstsl bustest cdsgain chipversion clearbit clearbusy clearroi clientversion clkdiv clkfreq clkphase column compdisabletime confadc config configtransceiver counters currentsource dac dacindex daclist dacname dacvalues datastream dbitclk dbitphase dbitpipeline defaultdac defaultpattern delay delayl detectorserverversion detsize diodelay dpulse dr drlist dsamples execcommand exptime exptime1 exptime2 exptime3 exptimel extrastoragecells extsampling extsamplingsrc extsig fformat filtercells filterresistor findex firmwaretest firmwareversion fliprows flowcontrol10g fmaster fname foverwrite fpath framecounter frames framesl frametime free fwrite gaincaps gainmode gappixels gatedelay gatedelay1 gatedelay2 gatedelay3 gates getbit hardwareversion highvoltage hostname im_a im_b im_c im_d im_io imagetest initialchecks inj_ch interpolation interruptsubframe kernelversion lastclient led lock master maxadcphaseshift maxclkphaseshift maxdbitphaseshift measuredperiod measuredsubperiod moduleid nextframenumber nmod numinterfaces overflow packageversion parallel parameters partialreset patfname patioctrl patlimits patloop patloop0 patloop1 patloop2 patmask patnloop patnloop0 patnloop1 patnloop2 patsetbit patternX patternstart patwait patwait0 patwait1 patwait2 patwaittime patwaittime0 patwaittime1 patwaittime2 patword pedestalmode period periodl polarity port powerchip powerindex powerlist powername powervalues programfpga pulse pulsechip pulsenmove pumpprobe quad ratecorr readnrows readout readoutspeed readoutspeedlist rebootcontroller reg resetdacs resetfpga roi romode row runclk runtime rx_arping rx_clearroi rx_dbitlist rx_dbitoffset rx_discardpolicy rx_fifodepth rx_frameindex rx_framescaught rx_framesperfile rx_hostname rx_jsonaddheader rx_jsonpara rx_lastclient rx_lock rx_missingpackets rx_padding rx_printconfig rx_realudpsocksize rx_roi rx_silent rx_start rx_status rx_stop rx_tcpport rx_threads rx_udpsocksize rx_version rx_zmqfreq rx_zmqhwm rx_zmqip rx_zmqport rx_zmqstartfnum rx_zmqstream samples savepattern scan scanerrmsg selinterface serialnumber setbit settings settingslist settingspath signalindex signallist signalname slowadc slowadcindex slowadclist slowadcname slowadcvalues start status stop stopport storagecell_delay storagecell_start subdeadtime subexptime sync syncclk temp_10ge temp_adc temp_control temp_dcdc temp_event temp_fpga temp_fpgaext temp_fpgafl temp_fpgafr temp_slowadc temp_sodl temp_sodr temp_threshold templist tempvalues tengiga threshold thresholdnotb timing timinglist timingsource top transceiverenable trigger triggers triggersl trimbits trimen trimval tsamples txdelay txdelay_frame txdelay_left txdelay_right type udp_cleardst udp_dstip udp_dstip2 udp_dstlist udp_dstmac udp_dstmac2 udp_dstport udp_dstport2 udp_firstdst udp_numdst udp_reconfigure udp_srcip udp_srcip2 udp_srcmac udp_srcmac2 udp_validate update updatedetectorserver updatekernel updatemode user v_a v_b v_c v_chip v_d v_io v_limit vchip_comp_adc vchip_comp_fe vchip_cs vchip_opa_1st vchip_opa_fd vchip_ref_comp_fe versions veto vetoalg vetofile vetophoton vetoref vetostream virtual vm_a vm_b vm_c vm_d vm_io zmqhwm zmqip zmqport "
|
local SLS_COMMANDS=" acquire activate adcclk adcenable adcenable10g adcindex adcinvert adclist adcname adcphase adcpipeline adcreg adcvpp apulse asamples autocompdisable badchannels blockingtrigger burstmode burstperiod bursts burstsl bustest cdsgain chipversion clearbit clearbusy clearroi clientversion clkdiv clkfreq clkphase collectionmode column compdisabletime confadc config configtransceiver counters currentsource dac dacindex daclist dacname dacvalues datastream dbitclk dbitphase dbitpipeline defaultdac defaultpattern delay delayl detectorserverversion detsize diodelay dpulse dr drlist dsamples execcommand exptime exptime1 exptime2 exptime3 exptimel extrastoragecells extsampling extsamplingsrc extsig fformat filtercells filterresistor findex firmwaretest firmwareversion fliprows flowcontrol10g fmaster fname foverwrite fpath framecounter frames framesl frametime free fwrite gaincaps gainmode gappixels gatedelay gatedelay1 gatedelay2 gatedelay3 gates getbit hardwareversion highvoltage hostname im_a im_b im_c im_d im_io imagetest initialchecks inj_ch interpolation interruptsubframe kernelversion lastclient led lock master maxadcphaseshift maxclkphaseshift maxdbitphaseshift measuredperiod measuredsubperiod moduleid nextframenumber nmod numinterfaces overflow packageversion parallel parameters partialreset patfname patioctrl patlimits patloop patloop0 patloop1 patloop2 patmask patnloop patnloop0 patnloop1 patnloop2 patsetbit patternX patternstart patwait patwait0 patwait1 patwait2 patwaittime patwaittime0 patwaittime1 patwaittime2 patword pedestalmode period periodl polarity port powerchip powerindex powerlist powername powervalues programfpga pulse pulsechip pulsenmove pumpprobe quad ratecorr readnrows readout readoutspeed readoutspeedlist rebootcontroller reg resetdacs resetfpga roi romode row runclk runtime rx_arping rx_clearroi rx_dbitlist rx_dbitoffset rx_discardpolicy rx_fifodepth rx_frameindex rx_framescaught rx_framesperfile rx_hostname rx_jsonaddheader rx_jsonpara rx_lastclient rx_lock rx_missingpackets rx_padding rx_printconfig rx_realudpsocksize rx_roi rx_silent rx_start rx_status rx_stop rx_tcpport rx_threads rx_udpsocksize rx_version rx_zmqfreq rx_zmqhwm rx_zmqip rx_zmqport rx_zmqstartfnum rx_zmqstream samples savepattern scan scanerrmsg selinterface serialnumber setbit settings settingslist settingspath signalindex signallist signalname slowadc slowadcindex slowadclist slowadcname slowadcvalues start status stop stopport storagecell_delay storagecell_start subdeadtime subexptime sync syncclk temp_10ge temp_adc temp_control temp_dcdc temp_event temp_fpga temp_fpgaext temp_fpgafl temp_fpgafr temp_slowadc temp_sodl temp_sodr temp_threshold templist tempvalues tengiga threshold thresholdnotb timing timinglist timingsource top transceiverenable trigger triggers triggersl trimbits trimen trimval tsamples txdelay txdelay_frame txdelay_left txdelay_right type udp_cleardst udp_dstip udp_dstip2 udp_dstlist udp_dstmac udp_dstmac2 udp_dstport udp_dstport2 udp_firstdst udp_numdst udp_reconfigure udp_srcip udp_srcip2 udp_srcmac udp_srcmac2 udp_validate update updatedetectorserver updatekernel updatemode user v_a v_b v_c v_chip v_d v_io v_limit vchip_comp_adc vchip_comp_fe vchip_cs vchip_opa_1st vchip_opa_fd vchip_ref_comp_fe versions veto vetoalg vetofile vetophoton vetoref vetostream virtual vm_a vm_b vm_c vm_d vm_io zmqhwm zmqip zmqport "
|
||||||
__acquire() {
|
__acquire() {
|
||||||
FCN_RETURN=""
|
FCN_RETURN=""
|
||||||
return 0
|
return 0
|
||||||
@ -337,6 +337,15 @@ fi
|
|||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
__collectionmode() {
|
||||||
|
FCN_RETURN=""
|
||||||
|
if [[ ${IS_GET} -eq 0 ]]; then
|
||||||
|
if [[ "${cword}" == "2" ]]; then
|
||||||
|
FCN_RETURN="electron hole"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
__column() {
|
__column() {
|
||||||
FCN_RETURN=""
|
FCN_RETURN=""
|
||||||
if [[ ${IS_GET} -eq 0 ]]; then
|
if [[ ${IS_GET} -eq 0 ]]; then
|
||||||
|
@ -1209,6 +1209,16 @@ polarity:
|
|||||||
function: setPolarity
|
function: setPolarity
|
||||||
input_types: [ defs::polarity ]
|
input_types: [ defs::polarity ]
|
||||||
|
|
||||||
|
collectionmode:
|
||||||
|
help: "[hole|electron]\n\t[Jungfrau] Sets collection mode to hole or electron. Default is hole."
|
||||||
|
inherit_actions: INTEGER_COMMAND_VEC_ID
|
||||||
|
actions:
|
||||||
|
GET:
|
||||||
|
function: getCollectionMode
|
||||||
|
PUT:
|
||||||
|
function: setCollectionMode
|
||||||
|
input_types: [ defs::collectionMode ]
|
||||||
|
|
||||||
interpolation:
|
interpolation:
|
||||||
help: "[0, 1]\n\t[Mythen3] Enables or disables interpolation. Default is disabled. Interpolation mode enables all counters and disables vth3. Disabling sets back counter mask and vth3."
|
help: "[0, 1]\n\t[Mythen3] Enables or disables interpolation. Default is disabled. Interpolation mode enables all counters and disables vth3. Disabling sets back counter mask and vth3."
|
||||||
inherit_actions: INTEGER_COMMAND_VEC_ID
|
inherit_actions: INTEGER_COMMAND_VEC_ID
|
||||||
|
@ -1448,6 +1448,46 @@ clkphase:
|
|||||||
\ clock n_clock. If deg, then phase shift in degrees, else absolute phase shift\
|
\ clock n_clock. If deg, then phase shift in degrees, else absolute phase shift\
|
||||||
\ values."
|
\ values."
|
||||||
infer_action: true
|
infer_action: true
|
||||||
|
collectionmode:
|
||||||
|
actions:
|
||||||
|
GET:
|
||||||
|
args:
|
||||||
|
- arg_types: []
|
||||||
|
argc: 0
|
||||||
|
cast_input: []
|
||||||
|
check_det_id: false
|
||||||
|
convert_det_id: true
|
||||||
|
function: getCollectionMode
|
||||||
|
input: []
|
||||||
|
input_types: []
|
||||||
|
output:
|
||||||
|
- OutString(t)
|
||||||
|
require_det_id: true
|
||||||
|
store_result_in_t: true
|
||||||
|
PUT:
|
||||||
|
args:
|
||||||
|
- arg_types:
|
||||||
|
- defs::collectionMode
|
||||||
|
argc: 1
|
||||||
|
cast_input:
|
||||||
|
- true
|
||||||
|
check_det_id: false
|
||||||
|
convert_det_id: true
|
||||||
|
function: setCollectionMode
|
||||||
|
input:
|
||||||
|
- args[0]
|
||||||
|
input_types:
|
||||||
|
- defs::collectionMode
|
||||||
|
output:
|
||||||
|
- args.front()
|
||||||
|
require_det_id: true
|
||||||
|
store_result_in_t: false
|
||||||
|
command_name: collectionmode
|
||||||
|
function_alias: collectionmode
|
||||||
|
help: "[hole|electron]\n\t[Jungfrau] Sets collection mode to hole or electron. Default\
|
||||||
|
\ is hole."
|
||||||
|
infer_action: true
|
||||||
|
template: true
|
||||||
column:
|
column:
|
||||||
actions:
|
actions:
|
||||||
GET:
|
GET:
|
||||||
|
@ -1369,6 +1369,12 @@ class Detector {
|
|||||||
void setPedestalMode(const defs::pedestalParameters par,
|
void setPedestalMode(const defs::pedestalParameters par,
|
||||||
Positions pos = {});
|
Positions pos = {});
|
||||||
|
|
||||||
|
/** [Jungfrau] */
|
||||||
|
Result<defs::collectionMode> getCollectionMode(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** [Jungfrau] */
|
||||||
|
void setCollectionMode(defs::collectionMode value, Positions pos = {});
|
||||||
|
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
/** @name Gotthard Specific */
|
/** @name Gotthard Specific */
|
||||||
|
@ -1999,6 +1999,70 @@ std::string Caller::clkphase(int action) {
|
|||||||
return os.str();
|
return os.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Caller::collectionmode(int action) {
|
||||||
|
|
||||||
|
std::ostringstream os;
|
||||||
|
// print help
|
||||||
|
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||||
|
os << "Command: collectionmode" << std::endl;
|
||||||
|
os << R"V0G0N([hole|electron]
|
||||||
|
[Jungfrau] Sets collection mode to hole or electron. Default is hole. )V0G0N"
|
||||||
|
<< std::endl;
|
||||||
|
return os.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if action and arguments are valid
|
||||||
|
if (action == slsDetectorDefs::GET_ACTION) {
|
||||||
|
if (1 && args.size() != 0) {
|
||||||
|
throw RuntimeError("Wrong number of arguments for action GET");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.size() == 0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (action == slsDetectorDefs::PUT_ACTION) {
|
||||||
|
if (1 && args.size() != 1) {
|
||||||
|
throw RuntimeError("Wrong number of arguments for action PUT");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.size() == 1) {
|
||||||
|
try {
|
||||||
|
StringTo<defs::collectionMode>(args[0]);
|
||||||
|
} catch (...) {
|
||||||
|
throw RuntimeError(
|
||||||
|
"Could not convert argument 0 to defs::collectionMode");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
|
||||||
|
throw RuntimeError("INTERNAL ERROR: Invalid action: supported actions "
|
||||||
|
"are ['GET', 'PUT']");
|
||||||
|
}
|
||||||
|
|
||||||
|
// generate code for each action
|
||||||
|
if (action == slsDetectorDefs::GET_ACTION) {
|
||||||
|
if (args.size() == 0) {
|
||||||
|
auto t = det->getCollectionMode(std::vector<int>{det_id});
|
||||||
|
os << OutString(t) << '\n';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (action == slsDetectorDefs::PUT_ACTION) {
|
||||||
|
if (args.size() == 1) {
|
||||||
|
auto arg0 = StringTo<defs::collectionMode>(args[0]);
|
||||||
|
det->setCollectionMode(arg0, std::vector<int>{det_id});
|
||||||
|
os << args.front() << '\n';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return os.str();
|
||||||
|
}
|
||||||
|
|
||||||
std::string Caller::column(int action) {
|
std::string Caller::column(int action) {
|
||||||
|
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
|
@ -89,6 +89,7 @@ class Caller {
|
|||||||
std::string clkdiv(int action);
|
std::string clkdiv(int action);
|
||||||
std::string clkfreq(int action);
|
std::string clkfreq(int action);
|
||||||
std::string clkphase(int action);
|
std::string clkphase(int action);
|
||||||
|
std::string collectionmode(int action);
|
||||||
std::string column(int action);
|
std::string column(int action);
|
||||||
std::string compdisabletime(int action);
|
std::string compdisabletime(int action);
|
||||||
std::string confadc(int action);
|
std::string confadc(int action);
|
||||||
@ -436,6 +437,7 @@ class Caller {
|
|||||||
{"clkdiv", &Caller::clkdiv},
|
{"clkdiv", &Caller::clkdiv},
|
||||||
{"clkfreq", &Caller::clkfreq},
|
{"clkfreq", &Caller::clkfreq},
|
||||||
{"clkphase", &Caller::clkphase},
|
{"clkphase", &Caller::clkphase},
|
||||||
|
{"collectionmode", &Caller::collectionmode},
|
||||||
{"column", &Caller::column},
|
{"column", &Caller::column},
|
||||||
{"compdisabletime", &Caller::compdisabletime},
|
{"compdisabletime", &Caller::compdisabletime},
|
||||||
{"confadc", &Caller::confadc},
|
{"confadc", &Caller::confadc},
|
||||||
|
@ -1771,6 +1771,14 @@ void Detector::setPedestalMode(const defs::pedestalParameters par,
|
|||||||
pimpl->Parallel(&Module::setPedestalMode, pos, par);
|
pimpl->Parallel(&Module::setPedestalMode, pos, par);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result<defs::collectionMode> Detector::getCollectionMode(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&Module::getCollectionMode, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Detector::setCollectionMode(defs::collectionMode value, Positions pos) {
|
||||||
|
pimpl->Parallel(&Module::setCollectionMode, pos, value);
|
||||||
|
}
|
||||||
|
|
||||||
// Gotthard Specific
|
// Gotthard Specific
|
||||||
|
|
||||||
Result<defs::ROI> Detector::getROI(Positions pos) const {
|
Result<defs::ROI> Detector::getROI(Positions pos) const {
|
||||||
|
@ -1940,6 +1940,14 @@ void Module::setPedestalMode(const defs::pedestalParameters par) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defs::collectionMode Module::getCollectionMode() const {
|
||||||
|
return sendToDetector<defs::collectionMode>(F_GET_COLLECTION_MODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Module::setCollectionMode(const defs::collectionMode value) {
|
||||||
|
sendToDetector(F_SET_COLLECTION_MODE, static_cast<int>(value), nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
// Gotthard Specific
|
// Gotthard Specific
|
||||||
|
|
||||||
slsDetectorDefs::ROI Module::getROI() const {
|
slsDetectorDefs::ROI Module::getROI() const {
|
||||||
|
@ -419,6 +419,8 @@ class Module : public virtual slsDetectorDefs {
|
|||||||
void setNumberOfFilterCells(int value);
|
void setNumberOfFilterCells(int value);
|
||||||
defs::pedestalParameters getPedestalMode() const;
|
defs::pedestalParameters getPedestalMode() const;
|
||||||
void setPedestalMode(defs::pedestalParameters par);
|
void setPedestalMode(defs::pedestalParameters par);
|
||||||
|
defs::collectionMode getCollectionMode() const;
|
||||||
|
void setCollectionMode(const defs::collectionMode enable);
|
||||||
|
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
|
@ -500,6 +500,22 @@ int InferAction::clkphase() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int InferAction::collectionmode() {
|
||||||
|
|
||||||
|
if (args.size() == 0) {
|
||||||
|
return slsDetectorDefs::GET_ACTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.size() == 1) {
|
||||||
|
return slsDetectorDefs::PUT_ACTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
|
||||||
|
throw RuntimeError("Could not infer action: Wrong number of arguments");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int InferAction::column() {
|
int InferAction::column() {
|
||||||
|
|
||||||
if (args.size() == 0) {
|
if (args.size() == 0) {
|
||||||
|
@ -44,6 +44,7 @@ class InferAction {
|
|||||||
int clkdiv();
|
int clkdiv();
|
||||||
int clkfreq();
|
int clkfreq();
|
||||||
int clkphase();
|
int clkphase();
|
||||||
|
int collectionmode();
|
||||||
int column();
|
int column();
|
||||||
int compdisabletime();
|
int compdisabletime();
|
||||||
int confadc();
|
int confadc();
|
||||||
@ -379,6 +380,7 @@ class InferAction {
|
|||||||
{"clkdiv", &InferAction::clkdiv},
|
{"clkdiv", &InferAction::clkdiv},
|
||||||
{"clkfreq", &InferAction::clkfreq},
|
{"clkfreq", &InferAction::clkfreq},
|
||||||
{"clkphase", &InferAction::clkphase},
|
{"clkphase", &InferAction::clkphase},
|
||||||
|
{"collectionmode", &InferAction::collectionmode},
|
||||||
{"column", &InferAction::column},
|
{"column", &InferAction::column},
|
||||||
{"compdisabletime", &InferAction::compdisabletime},
|
{"compdisabletime", &InferAction::compdisabletime},
|
||||||
{"confadc", &InferAction::confadc},
|
{"confadc", &InferAction::confadc},
|
||||||
|
@ -667,6 +667,34 @@ TEST_CASE("Caller::pedestalmode", "[.cmdcall]") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("Caller::collectionmode", "[.cmdcall]") {
|
||||||
|
Detector det;
|
||||||
|
Caller caller(&det);
|
||||||
|
if (det.getDetectorType().squash() == defs::JUNGFRAU) {
|
||||||
|
auto prev_val = det.getCollectionMode();
|
||||||
|
{
|
||||||
|
std::ostringstream oss;
|
||||||
|
caller.call("collectionmode", {"electron"}, -1, PUT, oss);
|
||||||
|
REQUIRE(oss.str() == "collectionmode electron\n");
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::ostringstream oss;
|
||||||
|
caller.call("collectionmode", {"hole"}, -1, PUT, oss);
|
||||||
|
REQUIRE(oss.str() == "collectionmode hole\n");
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::ostringstream oss;
|
||||||
|
caller.call("collectionmode", {}, -1, GET, oss);
|
||||||
|
REQUIRE(oss.str() == "collectionmode hole\n");
|
||||||
|
}
|
||||||
|
for (int i = 0; i != det.size(); ++i) {
|
||||||
|
det.setCollectionMode(prev_val[i], {i});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
REQUIRE_THROWS(caller.call("collectionmode", {}, -1, GET));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE("Caller::sync", "[.cmdcall]") {
|
TEST_CASE("Caller::sync", "[.cmdcall]") {
|
||||||
Detector det;
|
Detector det;
|
||||||
Caller caller(&det);
|
Caller caller(&det);
|
||||||
|
@ -44,6 +44,7 @@ std::string ToString(const defs::streamingInterface s);
|
|||||||
std::string ToString(const defs::vetoAlgorithm s);
|
std::string ToString(const defs::vetoAlgorithm s);
|
||||||
std::string ToString(const defs::gainMode s);
|
std::string ToString(const defs::gainMode s);
|
||||||
std::string ToString(const defs::polarity s);
|
std::string ToString(const defs::polarity s);
|
||||||
|
std::string ToString(const defs::collectionMode s);
|
||||||
|
|
||||||
std::string ToString(const slsDetectorDefs::xy &coord);
|
std::string ToString(const slsDetectorDefs::xy &coord);
|
||||||
std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::xy &coord);
|
std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::xy &coord);
|
||||||
@ -318,6 +319,7 @@ template <> defs::streamingInterface StringTo(const std::string &s);
|
|||||||
template <> defs::vetoAlgorithm StringTo(const std::string &s);
|
template <> defs::vetoAlgorithm StringTo(const std::string &s);
|
||||||
template <> defs::gainMode StringTo(const std::string &s);
|
template <> defs::gainMode StringTo(const std::string &s);
|
||||||
template <> defs::polarity StringTo(const std::string &s);
|
template <> defs::polarity StringTo(const std::string &s);
|
||||||
|
template <> defs::collectionMode StringTo(const std::string &s);
|
||||||
|
|
||||||
template <> uint8_t StringTo(const std::string &s);
|
template <> uint8_t StringTo(const std::string &s);
|
||||||
template <> uint16_t StringTo(const std::string &s);
|
template <> uint16_t StringTo(const std::string &s);
|
||||||
|
@ -520,6 +520,8 @@ enum streamingInterface {
|
|||||||
|
|
||||||
enum polarity { POSITIVE, NEGATIVE };
|
enum polarity { POSITIVE, NEGATIVE };
|
||||||
|
|
||||||
|
enum collectionMode { HOLE, ELECTRON };
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
/** scan structure */
|
/** scan structure */
|
||||||
|
@ -293,6 +293,8 @@ enum detFuncs {
|
|||||||
F_GET_PEDESTAL_MODE,
|
F_GET_PEDESTAL_MODE,
|
||||||
F_SET_PEDESTAL_MODE,
|
F_SET_PEDESTAL_MODE,
|
||||||
F_CONFIG_TRANSCEIVER,
|
F_CONFIG_TRANSCEIVER,
|
||||||
|
F_GET_COLLECTION_MODE,
|
||||||
|
F_SET_COLLECTION_MODE,
|
||||||
|
|
||||||
NUM_DET_FUNCTIONS,
|
NUM_DET_FUNCTIONS,
|
||||||
RECEIVER_ENUM_START = 512, /**< detector function should not exceed this
|
RECEIVER_ENUM_START = 512, /**< detector function should not exceed this
|
||||||
@ -693,6 +695,8 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
|||||||
case F_GET_PEDESTAL_MODE: return "F_GET_PEDESTAL_MODE";
|
case F_GET_PEDESTAL_MODE: return "F_GET_PEDESTAL_MODE";
|
||||||
case F_SET_PEDESTAL_MODE: return "F_SET_PEDESTAL_MODE";
|
case F_SET_PEDESTAL_MODE: return "F_SET_PEDESTAL_MODE";
|
||||||
case F_CONFIG_TRANSCEIVER: return "F_CONFIG_TRANSCEIVER";
|
case F_CONFIG_TRANSCEIVER: return "F_CONFIG_TRANSCEIVER";
|
||||||
|
case F_GET_COLLECTION_MODE: return "F_GET_COLLECTION_MODE";
|
||||||
|
case F_SET_COLLECTION_MODE: return "F_SET_COLLECTION_MODE";
|
||||||
|
|
||||||
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
||||||
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
#define APICTB "developer 0x240918"
|
#define APICTB "developer 0x240918"
|
||||||
#define APIGOTTHARD "developer 0x240918"
|
#define APIGOTTHARD "developer 0x240918"
|
||||||
#define APIGOTTHARD2 "developer 0x240918"
|
#define APIGOTTHARD2 "developer 0x240918"
|
||||||
#define APIJUNGFRAU "developer 0x240918"
|
|
||||||
#define APIMYTHEN3 "developer 0x240918"
|
#define APIMYTHEN3 "developer 0x240918"
|
||||||
#define APIMOENCH "developer 0x240918"
|
#define APIMOENCH "developer 0x240918"
|
||||||
#define APIXILINXCTB "developer 0x240918"
|
#define APIXILINXCTB "developer 0x240918"
|
||||||
#define APIEIGER "developer 0x240918"
|
#define APIEIGER "developer 0x240918"
|
||||||
|
#define APIJUNGFRAU "developer 0x240930"
|
||||||
|
@ -679,6 +679,17 @@ std::string ToString(const defs::polarity s) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string ToString(const defs::collectionMode s) {
|
||||||
|
switch (s) {
|
||||||
|
case defs::HOLE:
|
||||||
|
return std::string("hole");
|
||||||
|
case defs::ELECTRON:
|
||||||
|
return std::string("electron");
|
||||||
|
default:
|
||||||
|
return std::string("Unknown");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const std::string &ToString(const std::string &s) { return s; }
|
const std::string &ToString(const std::string &s) { return s; }
|
||||||
|
|
||||||
template <> defs::detectorType StringTo(const std::string &s) {
|
template <> defs::detectorType StringTo(const std::string &s) {
|
||||||
@ -1104,6 +1115,14 @@ template <> defs::polarity StringTo(const std::string &s) {
|
|||||||
throw RuntimeError("Unknown polarity mode " + s);
|
throw RuntimeError("Unknown polarity mode " + s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <> defs::collectionMode StringTo(const std::string &s) {
|
||||||
|
if (s == "hole")
|
||||||
|
return defs::HOLE;
|
||||||
|
if (s == "electron")
|
||||||
|
return defs::ELECTRON;
|
||||||
|
throw RuntimeError("Unknown collection mode " + s);
|
||||||
|
}
|
||||||
|
|
||||||
template <> uint8_t StringTo(const std::string &s) {
|
template <> uint8_t StringTo(const std::string &s) {
|
||||||
int base = s.find("0x") != std::string::npos ? 16 : 10;
|
int base = s.find("0x") != std::string::npos ? 16 : 10;
|
||||||
int value = std::stoi(s, nullptr, base);
|
int value = std::stoi(s, nullptr, base);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user