mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-07-18 13:32:51 +02:00
Merge branch 'developer' into dev/ctb_clocks
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "sls/Detector.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
namespace sls {
|
||||
@@ -67,6 +68,7 @@ class Caller {
|
||||
|
||||
private:
|
||||
bool ReplaceIfDeprecated(std::string &command);
|
||||
void SuggestIfRemoved(const std::string &command);
|
||||
using FunctionMap = std::map<std::string, std::string (Caller::*)(int)>;
|
||||
using StringMap = std::map<std::string, std::string>;
|
||||
Detector *ptr; // pointer to the detector that executes the command
|
||||
@@ -91,6 +93,9 @@ class Caller {
|
||||
// applicable
|
||||
RegisterAddress getRegisterAddress(const std::string &saddr) const;
|
||||
BitAddress getBitAddress() const;
|
||||
defs::dacIndex parseDacIndex(int argIndex, bool isCtb);
|
||||
bool parseMV(int argIndex);
|
||||
defs::powerIndex parsePowerIndex(int argIndex);
|
||||
|
||||
FunctionMap functions{
|
||||
{"list", &Caller::list},
|
||||
@@ -104,6 +109,12 @@ class Caller {
|
||||
// THIS COMMENT TO BE REPLACED BY THE ACTUAL CODE (3)
|
||||
|
||||
};
|
||||
|
||||
StringMap removed_functions{
|
||||
|
||||
// THIS COMMENT TO BE REPLACED BY THE ACTUAL CODE (4)
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
@@ -80,7 +80,7 @@ _sd() {
|
||||
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 clientversion clkdiv clkfreq clkphase collectionmode column compdisabletime confadc config configtransceiver counters currentsource dac dacindex daclist dacname dacvalues datastream dbitclk dbitphase dbitpipeline defaultdac defaultpattern define_bit define_reg definelist_bit definelist_reg delay delayl detectorserverversion detsize diodelay dpulse dr drlist dsamples execcommand exptime exptime1 exptime2 exptime3 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 include 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 pattern 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 romode row runclk runtime rx_arping rx_clearroi rx_dbitlist rx_dbitoffset rx_dbitreorder 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 sleep 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 timing_info_decoder 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 clientversion clkdiv clkfreq clkphase collectionmode column compdisabletime confadc config configtransceiver counters currentsource dac dacindex daclist dacname dacvalues datastream dbitclk dbitphase dbitpipeline defaultdac defaultpattern define_bit define_reg definelist_bit definelist_reg delay delayl detectorserverversion detsize diodelay dpulse dr drlist dsamples execcommand exptime exptime1 exptime2 exptime3 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 include 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 pattern patternstart patwait patwait0 patwait1 patwait2 patwaittime patwaittime0 patwaittime1 patwaittime2 patword pedestalmode period periodl polarity port power powerchip powerdac powerindex powerlist powername powervalues programfpga pulse pulsechip pulsenmove pumpprobe quad ratecorr readnrows readout readoutspeed readoutspeedlist rebootcontroller reg resetdacs resetfpga romode row runclk runtime rx_arping rx_clearroi rx_dbitlist rx_dbitoffset rx_dbitreorder 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 sleep 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 timing_info_decoder 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_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() {
|
||||
FCN_RETURN=""
|
||||
return 0
|
||||
@@ -524,21 +524,21 @@ __dac() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 1 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN="`sls_detector_get daclist | sed -e 's/.*\[\(.*\)\].*/\1/' | sed 's/,//g'`"
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
if [[ "${cword}" == "3" ]]; then
|
||||
FCN_RETURN="mV mv"
|
||||
FCN_RETURN="0 1"
|
||||
fi
|
||||
fi
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN="`sls_detector_get daclist | sed -e 's/.*\[\(.*\)\].*/\1/' | sed 's/,//g'`"
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
if [[ "${cword}" == "3" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
if [[ "${cword}" == "4" ]]; then
|
||||
FCN_RETURN="mV mv"
|
||||
FCN_RETURN="0 1"
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
@@ -1843,6 +1843,10 @@ fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__power() {
|
||||
FCN_RETURN=""
|
||||
return 0
|
||||
}
|
||||
__powerchip() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
@@ -1852,6 +1856,23 @@ fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__powerdac() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 1 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
if [[ "${cword}" == "3" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__powerindex() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 1 ]]; then
|
||||
@@ -1874,12 +1895,12 @@ __powername() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 1 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN="`sls_detector_get daclist | sed -e 's/.*\[\(.*\)\].*/\1/' | sed 's/,//g'`"
|
||||
FCN_RETURN="v_a v_b v_c v_chip v_d v_io"
|
||||
fi
|
||||
fi
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN="`sls_detector_get daclist | sed -e 's/.*\[\(.*\)\].*/\1/' | sed 's/,//g'`"
|
||||
FCN_RETURN="v_a v_b v_c v_chip v_d v_io"
|
||||
fi
|
||||
if [[ "${cword}" == "3" ]]; then
|
||||
FCN_RETURN=""
|
||||
@@ -3117,60 +3138,6 @@ __user() {
|
||||
FCN_RETURN=""
|
||||
return 0
|
||||
}
|
||||
__v_a() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__v_b() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__v_c() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__v_chip() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__v_d() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__v_io() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__v_limit() {
|
||||
FCN_RETURN=""
|
||||
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() {
|
||||
|
||||
|
||||
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 clientversion clkdiv clkfreq clkphase collectionmode column compdisabletime confadc config configtransceiver counters currentsource dac dacindex daclist dacname dacvalues datastream dbitclk dbitphase dbitpipeline defaultdac defaultpattern define_bit define_reg definelist_bit definelist_reg delay delayl detectorserverversion detsize diodelay dpulse dr drlist dsamples execcommand exptime exptime1 exptime2 exptime3 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 include 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 pattern 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 romode row runclk runtime rx_arping rx_clearroi rx_dbitlist rx_dbitoffset rx_dbitreorder 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 sleep 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 timing_info_decoder 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 clientversion clkdiv clkfreq clkphase collectionmode column compdisabletime confadc config configtransceiver counters currentsource dac dacindex daclist dacname dacvalues datastream dbitclk dbitphase dbitpipeline defaultdac defaultpattern define_bit define_reg definelist_bit definelist_reg delay delayl detectorserverversion detsize diodelay dpulse dr drlist dsamples execcommand exptime exptime1 exptime2 exptime3 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 include 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 pattern patternstart patwait patwait0 patwait1 patwait2 patwaittime patwaittime0 patwaittime1 patwaittime2 patword pedestalmode period periodl polarity port power powerchip powerdac powerindex powerlist powername powervalues programfpga pulse pulsechip pulsenmove pumpprobe quad ratecorr readnrows readout readoutspeed readoutspeedlist rebootcontroller reg resetdacs resetfpga romode row runclk runtime rx_arping rx_clearroi rx_dbitlist rx_dbitoffset rx_dbitreorder 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 sleep 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 timing_info_decoder 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_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() {
|
||||
FCN_RETURN=""
|
||||
return 0
|
||||
@@ -448,21 +448,21 @@ __dac() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 1 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN="`sls_detector_get daclist | sed -e 's/.*\[\(.*\)\].*/\1/' | sed 's/,//g'`"
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
if [[ "${cword}" == "3" ]]; then
|
||||
FCN_RETURN="mV mv"
|
||||
FCN_RETURN="0 1"
|
||||
fi
|
||||
fi
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN="`sls_detector_get daclist | sed -e 's/.*\[\(.*\)\].*/\1/' | sed 's/,//g'`"
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
if [[ "${cword}" == "3" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
if [[ "${cword}" == "4" ]]; then
|
||||
FCN_RETURN="mV mv"
|
||||
FCN_RETURN="0 1"
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
@@ -1767,6 +1767,10 @@ fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__power() {
|
||||
FCN_RETURN=""
|
||||
return 0
|
||||
}
|
||||
__powerchip() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
@@ -1776,6 +1780,23 @@ fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__powerdac() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 1 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
if [[ "${cword}" == "3" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__powerindex() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 1 ]]; then
|
||||
@@ -1798,12 +1819,12 @@ __powername() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 1 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN="`sls_detector_get daclist | sed -e 's/.*\[\(.*\)\].*/\1/' | sed 's/,//g'`"
|
||||
FCN_RETURN="v_a v_b v_c v_chip v_d v_io"
|
||||
fi
|
||||
fi
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN="`sls_detector_get daclist | sed -e 's/.*\[\(.*\)\].*/\1/' | sed 's/,//g'`"
|
||||
FCN_RETURN="v_a v_b v_c v_chip v_d v_io"
|
||||
fi
|
||||
if [[ "${cword}" == "3" ]]; then
|
||||
FCN_RETURN=""
|
||||
@@ -3041,60 +3062,6 @@ __user() {
|
||||
FCN_RETURN=""
|
||||
return 0
|
||||
}
|
||||
__v_a() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__v_b() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__v_c() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__v_chip() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__v_d() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__v_io() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
if [[ "${cword}" == "2" ]]; then
|
||||
FCN_RETURN=""
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
__v_limit() {
|
||||
FCN_RETURN=""
|
||||
if [[ ${IS_GET} -eq 0 ]]; then
|
||||
|
||||
@@ -186,29 +186,6 @@ INTEGER_COMMAND_NOID:
|
||||
input_types: [ int ]
|
||||
output: [ 'args.front()' ]
|
||||
|
||||
INTEGER_IND_COMMAND:
|
||||
template: true
|
||||
infer_action: true
|
||||
help: ""
|
||||
actions:
|
||||
GET:
|
||||
# extra variable to store the index
|
||||
require_det_id: true
|
||||
function: ''
|
||||
argc: 0
|
||||
input: [ 'INDEX' ]
|
||||
input_types: [ int ]
|
||||
cast_input: [ false ]
|
||||
output: [ OutString(t) ]
|
||||
PUT:
|
||||
# extra variable to store the index
|
||||
function: ''
|
||||
require_det_id: true
|
||||
argc: 1
|
||||
input: [ 'INDEX', 'args[0]' ]
|
||||
input_types: [ int, int ]
|
||||
cast_input: [ false, true ]
|
||||
output: [ 'args.front()' ]
|
||||
|
||||
INTEGER_USER_IND_COMMAND:
|
||||
template: true
|
||||
@@ -306,6 +283,20 @@ GET_IND_COMMAND:
|
||||
input_types: [ int ]
|
||||
output: [ OutString(t) ]
|
||||
|
||||
GET_IND_COMMAND_NOID:
|
||||
template: true
|
||||
infer_action: true
|
||||
help: ""
|
||||
actions:
|
||||
GET:
|
||||
check_det_id: true
|
||||
function: ''
|
||||
argc: 0
|
||||
input: [ 'VAL' ]
|
||||
cast_input: [ false ]
|
||||
input_types: [ int ]
|
||||
output: [ OutString(t) ]
|
||||
|
||||
CTB_NAMED_LIST:
|
||||
template: true
|
||||
infer_action: true
|
||||
@@ -345,10 +336,7 @@ CTB_SINGLE_DACNAME:
|
||||
extra_variables:
|
||||
- name: index
|
||||
type: defs::dacIndex
|
||||
value: 0
|
||||
exceptions:
|
||||
- condition: 'det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD && det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD'
|
||||
message: 'cmd + " only allowed for CTB."'
|
||||
value: defs::DAC_0
|
||||
check_det_id: true
|
||||
argc: 1
|
||||
input: [ "static_cast<defs::dacIndex>(StringTo<int>(args[0]) + index)" ]
|
||||
@@ -359,10 +347,7 @@ CTB_SINGLE_DACNAME:
|
||||
extra_variables:
|
||||
- name: index
|
||||
type: defs::dacIndex
|
||||
value: 0
|
||||
exceptions:
|
||||
- condition: 'det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD && det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD'
|
||||
message: 'cmd + " only allowed for CTB."'
|
||||
value: defs::DAC_0
|
||||
check_det_id: true
|
||||
argc: 2
|
||||
input: [ "static_cast<defs::dacIndex>(StringTo<int>(args[0]) + index)","args[1]" ]
|
||||
@@ -377,12 +362,8 @@ CTB_GET_DACINDEX:
|
||||
extra_variables:
|
||||
- name: index
|
||||
type: defs::dacIndex
|
||||
value: 0
|
||||
|
||||
value: defs::DAC_0
|
||||
check_det_id: true
|
||||
exceptions:
|
||||
- condition: 'det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD && det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD'
|
||||
message: 'cmd + " only allowed for CTB."'
|
||||
argc: 1
|
||||
input: [ 'args[0]' ]
|
||||
input_types: [ std::string ]
|
||||
@@ -394,9 +375,6 @@ CTB_SINGLE_NAME:
|
||||
actions:
|
||||
GET:
|
||||
check_det_id: true
|
||||
exceptions:
|
||||
- condition: 'det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD && det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD'
|
||||
message: 'cmd + " only allowed for CTB."'
|
||||
argc: 1
|
||||
input: [ "args[0]" ]
|
||||
cast_input: [ true ]
|
||||
@@ -404,9 +382,6 @@ CTB_SINGLE_NAME:
|
||||
output: [ 'args[0]',"' '", 't' ]
|
||||
PUT:
|
||||
check_det_id: true
|
||||
exceptions:
|
||||
- condition: 'det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD && det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD'
|
||||
message: 'cmd + " only allowed for CTB."'
|
||||
argc: 2
|
||||
cast_input: [ true, false ]
|
||||
input: [ "args[0]","args[1]" ]
|
||||
@@ -419,9 +394,6 @@ CTB_GET_INDEX:
|
||||
actions:
|
||||
GET:
|
||||
check_det_id: true
|
||||
exceptions:
|
||||
- condition: 'det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD && det->getDetectorType().squash(defs::GENERIC) != defs::XILINX_CHIPTESTBOARD'
|
||||
message: 'cmd + " only allowed for CTB."'
|
||||
argc: 1
|
||||
input: [ 'args[0]' ]
|
||||
input_types: [ std::string ]
|
||||
@@ -700,7 +672,7 @@ highvoltage:
|
||||
function: setHighVoltage
|
||||
|
||||
powerchip:
|
||||
help: "[0, 1]\n\t[Jungfrau][Moench][Mythen3][Gotthard2][Xilinx Ctb] Power the chip. \n\t[Jungfrau][Moench] Default is 0. Get will return power status. Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled. Will configure chip (only chip v1.1)\n\t[Mythen3][Gotthard2] Default is 1. If module not connected or wrong module, powerchip will fail.\n\t[Xilinx Ctb] Default is 0. Also configures the chip if powered on."
|
||||
help: "[0, 1]\n\t[Jungfrau][Moench][Mythen3][Gotthard2] Power the chip. \n\t[Jungfrau][Moench] Default is 0. Get will return power status. Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled. Will configure chip (only chip v1.1)\n\t[Mythen3][Gotthard2] Default is 1. If module not connected or wrong module, powerchip will fail."
|
||||
inherit_actions: INTEGER_COMMAND_VEC_ID
|
||||
actions:
|
||||
GET:
|
||||
@@ -1565,83 +1537,15 @@ fmaster:
|
||||
function: setMasterFileWrite
|
||||
input_types: [ bool ]
|
||||
|
||||
################# INTEGER_IND_COMMAND #######################
|
||||
v_limit:
|
||||
inherit_actions: INTEGER_IND_COMMAND
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Soft limit for power supplies (ctb only) and DACS in mV."
|
||||
inherit_actions: INTEGER_COMMAND_NOID
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Soft limit for power supplies and DACS in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getPower
|
||||
input: [ 'defs::V_LIMIT' ]
|
||||
function: getVoltageLimit
|
||||
PUT:
|
||||
function: setPower
|
||||
input: [ 'defs::V_LIMIT', 'args[0]' ]
|
||||
|
||||
v_a:
|
||||
inherit_actions: INTEGER_IND_COMMAND
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply a in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getPower
|
||||
input: [ 'defs::V_POWER_A' ]
|
||||
PUT:
|
||||
function: setPower
|
||||
input: [ 'defs::V_POWER_A', 'args[0]' ]
|
||||
|
||||
v_b:
|
||||
inherit_actions: INTEGER_IND_COMMAND
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply b in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getPower
|
||||
input: [ 'defs::V_POWER_B' ]
|
||||
PUT:
|
||||
function: setPower
|
||||
input: [ 'defs::V_POWER_B', 'args[0]' ]
|
||||
|
||||
v_c:
|
||||
inherit_actions: INTEGER_IND_COMMAND
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply c in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getPower
|
||||
input: [ 'defs::V_POWER_C' ]
|
||||
PUT:
|
||||
function: setPower
|
||||
input: [ 'defs::V_POWER_C', 'args[0]' ]
|
||||
|
||||
v_d:
|
||||
inherit_actions: INTEGER_IND_COMMAND
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply d in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getPower
|
||||
input: [ 'defs::V_POWER_D' ]
|
||||
PUT:
|
||||
function: setPower
|
||||
input: [ 'defs::V_POWER_D', 'args[0]' ]
|
||||
|
||||
v_io:
|
||||
inherit_actions: INTEGER_IND_COMMAND
|
||||
help: "[n_value]\n\t[Ctb][Xilinx Ctb] Power supply io in mV. Minimum 1200 mV. Must be the first power regulator to be set after fpga reset (on-board detector server start up)."
|
||||
actions:
|
||||
GET:
|
||||
function: getPower
|
||||
input: [ 'defs::V_POWER_IO' ]
|
||||
PUT:
|
||||
function: setPower
|
||||
input: [ 'defs::V_POWER_IO', 'args[0]' ]
|
||||
|
||||
v_chip:
|
||||
inherit_actions: INTEGER_IND_COMMAND
|
||||
help: "[n_value]\n\t[Ctb] Power supply chip in mV. Do not use it unless you are completely sure you will not fry the board."
|
||||
actions:
|
||||
GET:
|
||||
function: getPower
|
||||
input: [ 'defs::V_POWER_CHIP' ]
|
||||
PUT:
|
||||
function: setPower
|
||||
input: [ 'defs::V_POWER_CHIP', 'args[0]' ]
|
||||
function: setVoltageLimit
|
||||
input_types: [ int ]
|
||||
|
||||
################# INTEGER_USER_IND_COMMAND ###################
|
||||
vchip_comp_fe:
|
||||
@@ -2179,85 +2083,99 @@ temp_slowadc:
|
||||
input: [ 'defs::SLOW_ADC_TEMP' ]
|
||||
output: [ OutString(t), '" °C"' ]
|
||||
|
||||
|
||||
|
||||
################# GET_IND_COMMAND_NOID #######################
|
||||
vm_a:
|
||||
inherit_actions: GET_IND_COMMAND
|
||||
inherit_actions: GET_IND_COMMAND_NOID
|
||||
help: "\n\t[Ctb] Measured voltage of power supply a in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getMeasuredPower
|
||||
input: [ 'defs::V_POWER_A' ]
|
||||
output: [ OutString(t), '" mV"' ]
|
||||
|
||||
vm_b:
|
||||
inherit_actions: GET_IND_COMMAND
|
||||
inherit_actions: GET_IND_COMMAND_NOID
|
||||
help: "\n\t[Ctb] Measured voltage of power supply b in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getMeasuredPower
|
||||
input: [ 'defs::V_POWER_B' ]
|
||||
output: [ OutString(t), '" mV"' ]
|
||||
|
||||
vm_c:
|
||||
inherit_actions: GET_IND_COMMAND
|
||||
inherit_actions: GET_IND_COMMAND_NOID
|
||||
help: "\n\t[Ctb] Measured voltage of power supply c in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getMeasuredPower
|
||||
input: [ 'defs::V_POWER_C' ]
|
||||
output: [ OutString(t), '" mV"' ]
|
||||
|
||||
vm_d:
|
||||
inherit_actions: GET_IND_COMMAND
|
||||
inherit_actions: GET_IND_COMMAND_NOID
|
||||
help: "\n\t[Ctb] Measured voltage of power supply d in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getMeasuredPower
|
||||
input: [ 'defs::V_POWER_D' ]
|
||||
output: [ OutString(t), '" mV"' ]
|
||||
|
||||
vm_io:
|
||||
inherit_actions: GET_IND_COMMAND
|
||||
inherit_actions: GET_IND_COMMAND_NOID
|
||||
help: "\n\t[Ctb] Measured voltage of power supply io in mV."
|
||||
actions:
|
||||
GET:
|
||||
function: getMeasuredPower
|
||||
input: [ 'defs::V_POWER_IO' ]
|
||||
output: [ OutString(t), '" mV"' ]
|
||||
|
||||
im_a:
|
||||
inherit_actions: GET_IND_COMMAND
|
||||
inherit_actions: GET_IND_COMMAND_NOID
|
||||
help: "\n\t[Ctb] Measured current of power supply a in mA."
|
||||
actions:
|
||||
GET:
|
||||
function: getMeasuredCurrent
|
||||
input: [ 'defs::I_POWER_A' ]
|
||||
output: [ OutString(t), '" mA"' ]
|
||||
|
||||
im_b:
|
||||
inherit_actions: GET_IND_COMMAND
|
||||
inherit_actions: GET_IND_COMMAND_NOID
|
||||
help: "\n\t[Ctb] Measured current of power supply b in mA."
|
||||
actions:
|
||||
GET:
|
||||
function: getMeasuredCurrent
|
||||
input: [ 'defs::I_POWER_B' ]
|
||||
output: [ OutString(t), '" mA"' ]
|
||||
|
||||
im_c:
|
||||
inherit_actions: GET_IND_COMMAND
|
||||
inherit_actions: GET_IND_COMMAND_NOID
|
||||
help: "\n\t[Ctb] Measured current of power supply c in mA."
|
||||
actions:
|
||||
GET:
|
||||
function: getMeasuredCurrent
|
||||
input: [ 'defs::I_POWER_C' ]
|
||||
output: [ OutString(t), '" mA"' ]
|
||||
|
||||
im_d:
|
||||
inherit_actions: GET_IND_COMMAND
|
||||
inherit_actions: GET_IND_COMMAND_NOID
|
||||
help: "\n\t[Ctb] Measured current of power supply d in mA."
|
||||
actions:
|
||||
GET:
|
||||
function: getMeasuredCurrent
|
||||
input: [ 'defs::I_POWER_D' ]
|
||||
output: [ OutString(t), '" mA"' ]
|
||||
|
||||
im_io:
|
||||
inherit_actions: GET_IND_COMMAND
|
||||
inherit_actions: GET_IND_COMMAND_NOID
|
||||
help: "\n\t[Ctb] Measured current of power supply io in mA."
|
||||
actions:
|
||||
GET:
|
||||
function: getMeasuredCurrent
|
||||
input: [ 'defs::I_POWER_IO' ]
|
||||
output: [ OutString(t), '" mA"' ]
|
||||
|
||||
|
||||
################# CTB_NAMED_LIST #############################
|
||||
daclist:
|
||||
@@ -2306,17 +2224,6 @@ slowadclist:
|
||||
function: setSlowADCNames
|
||||
|
||||
################# CTB_VALUES ################################
|
||||
powervalues:
|
||||
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get values of all powers."
|
||||
actions:
|
||||
GET:
|
||||
argc: 0
|
||||
ctb_output_list:
|
||||
GETFCNLIST: getPowerList
|
||||
GETFCNNAME: getPowerNames
|
||||
GETFCN: getPower
|
||||
suffix: "mV"
|
||||
printable_name: "*name_it++"
|
||||
|
||||
slowadcvalues:
|
||||
help: "[name] \n\t\t[Ctb][Xilinx_Ctb] Get values of all slow adcs."
|
||||
@@ -2361,21 +2268,24 @@ dacname:
|
||||
value: defs::DAC_0
|
||||
|
||||
powername:
|
||||
inherit_actions: CTB_SINGLE_DACNAME
|
||||
help: "[0-4][name] \n\t\t[Ctb][Xilinx_Ctb] Set the power at the given position to the given name."
|
||||
infer_action: true
|
||||
actions:
|
||||
GET:
|
||||
argc: 1
|
||||
check_det_id: true
|
||||
function: getPowerName
|
||||
extra_variables:
|
||||
- name: index
|
||||
type: defs::dacIndex
|
||||
value: defs::V_POWER_A
|
||||
input: [ 'static_cast<defs::powerIndex>(StringTo<int>(args[0]))' ]
|
||||
input_types: [ defs::powerIndex ]
|
||||
output: [ 'args[0]',"' '", 't' ]
|
||||
PUT:
|
||||
argc: 2
|
||||
check_det_id: true
|
||||
function: setPowerName
|
||||
extra_variables:
|
||||
- name: index
|
||||
type: defs::dacIndex
|
||||
value: defs::V_POWER_A
|
||||
input: [ 'static_cast<defs::powerIndex>(StringTo<int>(args[0]))', 'args[1]' ]
|
||||
input_types: [ defs::powerIndex, std::string ]
|
||||
output: [ 'ToString(args)' ]
|
||||
|
||||
|
||||
slowadcname:
|
||||
inherit_actions: CTB_SINGLE_DACNAME
|
||||
@@ -2412,10 +2322,7 @@ powerindex:
|
||||
actions:
|
||||
GET:
|
||||
function: getPowerIndex
|
||||
extra_variables:
|
||||
- name: index
|
||||
type: defs::dacIndex
|
||||
value: defs::V_POWER_A
|
||||
output: [ 'ToString(static_cast<int>(t))' ]
|
||||
|
||||
slowadcindex:
|
||||
inherit_actions: CTB_GET_DACINDEX
|
||||
@@ -2853,6 +2760,51 @@ clearbit:
|
||||
arg_types: [ std::string, std::string, special::validate ]
|
||||
|
||||
|
||||
dac:
|
||||
is_description: true
|
||||
actions:
|
||||
PUT:
|
||||
args:
|
||||
- argc: 2
|
||||
arg_types: [ std::string, int ]
|
||||
- argc: 3
|
||||
arg_types: [ std::string, int, bool ]
|
||||
GET:
|
||||
args:
|
||||
- argc: 1
|
||||
arg_types: [ std::string ]
|
||||
- argc: 2
|
||||
arg_types: [ std::string, bool ]
|
||||
|
||||
|
||||
powerdac:
|
||||
is_description: true
|
||||
actions:
|
||||
PUT:
|
||||
argc: 2
|
||||
arg_types: [ std::string, int ]
|
||||
GET:
|
||||
argc: 1
|
||||
arg_types: [ std::string ]
|
||||
|
||||
|
||||
power:
|
||||
is_description: true
|
||||
actions:
|
||||
GET:
|
||||
argc: 0
|
||||
PUT:
|
||||
argc: -1
|
||||
arg_types: [ std::string ]
|
||||
|
||||
powervalues:
|
||||
is_description: true
|
||||
actions:
|
||||
GET:
|
||||
args:
|
||||
- argc: 0
|
||||
|
||||
|
||||
################# special commands ##########################
|
||||
|
||||
virtual:
|
||||
@@ -3333,56 +3285,6 @@ extsig:
|
||||
cast_input: [ true, true ]
|
||||
output: [ 'args[0]', "' '", 'args[1]' ]
|
||||
|
||||
dac:
|
||||
help: "code: return GetHelpDacWrapper(cmd, args);\n" # this is a special case
|
||||
actions:
|
||||
GET:
|
||||
exceptions:
|
||||
- condition: "is_int(args[0]) && det->getDetectorType().squash() != defs::CHIPTESTBOARD && det->getDetectorType().squash() != defs::XILINX_CHIPTESTBOARD"
|
||||
message: '"Dac indices can only be used for chip test board. Use daclist to get list of dac names for current detector."'
|
||||
extra_variables:
|
||||
- name: dacIndex
|
||||
type: defs::dacIndex
|
||||
value: "((det->getDetectorType().squash() == defs::CHIPTESTBOARD || det->getDetectorType().squash() == defs::XILINX_CHIPTESTBOARD) && !is_int(args[0])) ? det->getDacIndex(args[0]) : StringTo<defs::dacIndex>(args[0])"
|
||||
function: getDAC
|
||||
require_det_id: true
|
||||
input_types: [ defs::dacIndex, bool ]
|
||||
cast_input: [ false, true ]
|
||||
args:
|
||||
- argc: 1
|
||||
arg_types: [defs::dacIndex]
|
||||
input: [ dacIndex, '"0"' ]
|
||||
output: [ 'args[0]', "' '", OutString(t) ]
|
||||
- argc: 2
|
||||
exceptions:
|
||||
- condition: "is_int(args[0]) && det->getDetectorType().squash() != defs::CHIPTESTBOARD && det->getDetectorType().squash() != defs::XILINX_CHIPTESTBOARD"
|
||||
message: '"Dac indices can only be used for chip test board. Use daclist to get list of dac names for current detector."'
|
||||
- condition: 'args[1] != "mv" && args[1] != "mV"'
|
||||
message: '"Unknown argument " + args[1] + ". Did you mean mV?"'
|
||||
arg_types: [defs::dacIndex, special::mv]
|
||||
input: [ dacIndex, '"1"' ]
|
||||
output: [ 'args[0]', "' '" , OutString(t), '" mV"' ]
|
||||
PUT:
|
||||
exceptions:
|
||||
- condition: "is_int(args[0]) && det->getDetectorType().squash() != defs::CHIPTESTBOARD && det->getDetectorType().squash() != defs::XILINX_CHIPTESTBOARD"
|
||||
message: '"Dac indices can only be used for chip test board. Use daclist to get list of dac names for current detector."'
|
||||
extra_variables:
|
||||
- name: dacIndex
|
||||
type: defs::dacIndex
|
||||
value: "((det->getDetectorType().squash() == defs::CHIPTESTBOARD || det->getDetectorType().squash() == defs::XILINX_CHIPTESTBOARD) && !is_int(args[0])) ? det->getDacIndex(args[0]) : StringTo<defs::dacIndex>(args[0])"
|
||||
function: setDAC
|
||||
require_det_id: true
|
||||
input_types: [ defs::dacIndex, int, bool ]
|
||||
cast_input: [ false, true, true ]
|
||||
args:
|
||||
- argc: 2
|
||||
arg_types: [defs::dacIndex, int]
|
||||
input: [ dacIndex, "args[1]", '"0"' ]
|
||||
output: [ "args[0]", "' '", "args[1]" ]
|
||||
- argc: 3
|
||||
arg_types: [defs::dacIndex, int, special::mv]
|
||||
input: [ dacIndex, "args[1]", '"1"' ]
|
||||
output: [ "args[0]", "' '", "args[1]", '" mV"' ]
|
||||
|
||||
resetdacs:
|
||||
help: "[(optional) hard] \n\t[Eiger][Jungfrau][Moench][Gotthard2][Mythen3]Reset dac values to the defaults. A 'hard' optional reset will reset the dacs to the hardcoded defaults in on-board detector server."
|
||||
|
||||
@@ -36,7 +36,7 @@ class CodeGenerator:
|
||||
self.file.write(line)
|
||||
self.template_file.close()
|
||||
|
||||
def write_header(self, in_path, out_path, commands, deprecated_commands):
|
||||
def write_header(self, in_path, out_path, commands, deprecated_commands, removed_commands):
|
||||
"""Write the header file for the caller.h file"""
|
||||
with out_path.open('w') as fp:
|
||||
with in_path.open('r') as fp2:
|
||||
@@ -59,6 +59,11 @@ class CodeGenerator:
|
||||
fp.write(f'{{"{key}", "{value}"}},\n')
|
||||
continue
|
||||
|
||||
if "THIS COMMENT TO BE REPLACED BY THE ACTUAL CODE (4)" in line:
|
||||
for key, value in removed_commands.items():
|
||||
fp.write(f'{{"{key}", "{value}"}},\n')
|
||||
continue
|
||||
|
||||
fp.write(line)
|
||||
|
||||
def write_infer_header(self, in_path, out_path, commands):
|
||||
|
||||
@@ -94,6 +94,7 @@ vcasc_sfp: dac
|
||||
vipre_cds: dac
|
||||
ibias_sfp: dac
|
||||
|
||||
|
||||
defaultdacs: resetdacs
|
||||
|
||||
#acquisition
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,7 @@ GEN_PATH = Path(__file__).parent
|
||||
|
||||
COMMANDS_PATH = GEN_PATH / 'extended_commands.yaml'
|
||||
DEPRECATED_COMMANDS_PATH = GEN_PATH / 'deprecated_commands.yaml'
|
||||
REMOVED_COMMANDS_PATH = GEN_PATH / 'removed_commands.yaml'
|
||||
CPP_INPUT_PATH = GEN_PATH / 'Caller.in.cpp'
|
||||
HEADER_INPUT_PATH = GEN_PATH / 'Caller.in.h'
|
||||
CPP_OUTPUT_PATH = GEN_PATH.parent / 'src' / 'Caller.cpp'
|
||||
@@ -39,6 +40,8 @@ def generate(
|
||||
):
|
||||
commands_config = yaml.unsafe_load(commands_path.open('r'))
|
||||
deprecated_commands_config = yaml.unsafe_load(DEPRECATED_COMMANDS_PATH.open('r'))
|
||||
removed_commands_config = yaml.unsafe_load(REMOVED_COMMANDS_PATH.open('r'))
|
||||
|
||||
type_dist, non_dist = check_infer(commands=commands_config)
|
||||
|
||||
codegen.open(cpp_output_path)
|
||||
@@ -167,7 +170,8 @@ def generate(
|
||||
codegen.close()
|
||||
print('[X] .cpp code generated')
|
||||
deprecated_commands = []
|
||||
codegen.write_header(header_input_path, header_output_path, commands_config, deprecated_commands_config)
|
||||
removed_commands = []
|
||||
codegen.write_header(header_input_path, header_output_path, commands_config, deprecated_commands_config, removed_commands_config)
|
||||
print('[X] header code generated')
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ If any changes to enums in slsDetectorDefs
|
||||
```sh
|
||||
# to generate the dump.json file
|
||||
cd slsSupportLib/src
|
||||
clang++ -Xclang -ast-dump=json -Xclang -ast-dump-filter -Xclang StringTo -c ToString.cpp -I ../include/ -std=gnu++11 > ../../slsDetectorSoftware/generator/autocomplete/dump.json
|
||||
clang++ -Xclang -ast-dump=json -Xclang -ast-dump-filter -Xclang StringTo -c ToString.cpp -I ../include/ -std=gnu++17 > ../../slsDetectorSoftware/generator/autocomplete/dump.json
|
||||
cd ../../slsDetectorSoftware/generator/autocomplete
|
||||
python autocomplete.py -f
|
||||
```
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
v_a: "'dac v_a' and 'power v_a'"
|
||||
v_b: "'dac v_b' and 'power v_b'"
|
||||
v_c: "'dac v_c' and 'power v_c'"
|
||||
v_d: "'dac v_d' and 'power v_d'"
|
||||
v_io: "'dac v_io' and 'power v_io'"
|
||||
v_chip: "'dac v_chip'"
|
||||
@@ -474,17 +474,16 @@ class Detector {
|
||||
*/
|
||||
void setHighVoltage(int value, Positions pos = {});
|
||||
|
||||
/** [Jungfrau][Moench][Mythen3][Gotthard2][Xilinx Ctb] */
|
||||
/** [Jungfrau][Moench][Mythen3][Gotthard2] */
|
||||
Result<bool> getPowerChip(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau][Moench][Mythen3][Gotthard2][Xilinx Ctb] Power the chip. \n
|
||||
/** [Jungfrau][Moench][Mythen3][Gotthard2] Power the chip. \n
|
||||
* Default is disabled. \n
|
||||
* [Jungfrau][Moench] Default is disabled. Get will return power status. Can
|
||||
* be off if temperature event occured (temperature over temp_threshold with
|
||||
* temp_control enabled. Will configure chip (only chip v1.1)\n
|
||||
* [Mythen3][Gotthard2] Default is 1. If module not connected or wrong
|
||||
* module, powerchip will fail.\n
|
||||
* [Xilinx CTB] Default is 0. Also configures chip if powered on.
|
||||
*/
|
||||
void setPowerChip(bool on, Positions pos = {});
|
||||
|
||||
@@ -535,6 +534,7 @@ class Detector {
|
||||
Result<int> getDAC(defs::dacIndex index, bool mV = false,
|
||||
Positions pos = {}) const;
|
||||
|
||||
/** Sets dac in dac units or mV1 */
|
||||
void setDAC(defs::dacIndex index, int value, bool mV = false,
|
||||
Positions pos = {});
|
||||
|
||||
@@ -1629,20 +1629,49 @@ class Detector {
|
||||
Result<int> getSYNCClock(Positions pos = {}) const;
|
||||
|
||||
/** gets list of power enums */
|
||||
std::vector<defs::dacIndex> getPowerList() const;
|
||||
std::vector<defs::powerIndex> getPowerList() const;
|
||||
|
||||
/** gets list of slow adc enums */
|
||||
std::vector<defs::dacIndex> getSlowADCList() const;
|
||||
/** [CTB] Options: V_POWER_A, V_POWER_B, V_POWER_C,
|
||||
* V_POWER_D, V_POWER_IO, V_POWER_CHIP
|
||||
* [Xilinx CTB] Options: V_POWER_A, V_POWER_B, V_POWER_C,
|
||||
* V_POWER_D, V_POWER_IO */
|
||||
int getPowerDAC(defs::powerIndex index) const;
|
||||
|
||||
/** [CTB][Xilinx CTB] Options: V_POWER_A, V_POWER_B, V_POWER_C,
|
||||
* V_POWER_D, V_POWER_IO */
|
||||
void setPowerDAC(defs::powerIndex index, int value);
|
||||
|
||||
/** [CTB][Xilinx CTB] */
|
||||
Result<int> getPower(defs::dacIndex index, Positions pos = {}) const;
|
||||
bool isPowerEnabled(defs::powerIndex index) const;
|
||||
|
||||
/**
|
||||
* [CTB][Xilinx CTB] mV
|
||||
* [Ctb][Xilinx CTB] Options: V_LIMIT, V_POWER_A, V_POWER_B, V_POWER_C,
|
||||
* V_POWER_D, V_POWER_IO, V_POWER_CHIP
|
||||
* [Ctb][Xilinx CTB] Options: V_POWER_A, V_POWER_B, V_POWER_C,
|
||||
* V_POWER_D, V_POWER_IO
|
||||
*/
|
||||
void setPower(defs::dacIndex index, int value, Positions pos = {});
|
||||
void setPowerEnabled(const std::vector<defs::powerIndex> &indices,
|
||||
bool enable);
|
||||
|
||||
/**
|
||||
* [CTB] mV
|
||||
* Options: V_POWER_A, V_POWER_B, V_POWER_C, V_POWER_D, V_POWER_IO */
|
||||
int getMeasuredPower(defs::powerIndex index) const;
|
||||
|
||||
/**
|
||||
* [CTB] mA
|
||||
* Options: I_POWER_A, I_POWER_B, I_POWER_C, I_POWER_D, I_POWER_IO */
|
||||
int getMeasuredCurrent(defs::powerIndex index) const;
|
||||
|
||||
/** [CTB][Xilinx CTB] */
|
||||
int getVoltageLimit() const;
|
||||
|
||||
/** [CTB][Xilinx CTB] set a voltage limit for dacs and power dacs */
|
||||
void setVoltageLimit(const int limit_in_mV);
|
||||
|
||||
/** [CTB][Xilinx CTB] gets list of slow adc enums */
|
||||
std::vector<defs::dacIndex> getSlowADCList() const;
|
||||
|
||||
/** [CTB][Xilinx CTB] Options: SLOW_ADC0 - SLOW_ADC7 in uV */
|
||||
Result<int> getSlowADC(defs::dacIndex index, Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* [CTB] Options: [0- 4] or [1V, 1.14V, 1.33V, 1.6V, 2V]
|
||||
@@ -1698,21 +1727,6 @@ class Detector {
|
||||
/** [CTB] in Hz, [XCTB] in Hz */
|
||||
void setDBITClock(int value_in_Hz, Positions pos = {});
|
||||
|
||||
/**
|
||||
* [CTB] mV
|
||||
* Options: V_POWER_A, V_POWER_B, V_POWER_C, V_POWER_D, V_POWER_IO */
|
||||
Result<int> getMeasuredPower(defs::dacIndex index,
|
||||
Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* [CTB] mA
|
||||
* Options: I_POWER_A, I_POWER_B, I_POWER_C, I_POWER_D, I_POWER_IO */
|
||||
Result<int> getMeasuredCurrent(defs::dacIndex index,
|
||||
Positions pos = {}) const;
|
||||
|
||||
/** [CTB][Xilinx CTB] Options: SLOW_ADC0 - SLOW_ADC7 in uV */
|
||||
Result<int> getSlowADC(defs::dacIndex index, Positions pos = {}) const;
|
||||
|
||||
/** [CTB] */
|
||||
Result<int> getExternalSamplingSource(Positions pos = {}) const;
|
||||
|
||||
@@ -1815,13 +1829,13 @@ class Detector {
|
||||
std::vector<std::string> getPowerNames() const;
|
||||
|
||||
/** [CTB][Xilinx CTB] */
|
||||
defs::dacIndex getPowerIndex(const std::string &name) const;
|
||||
defs::powerIndex getPowerIndex(const std::string &name) const;
|
||||
|
||||
/** [CTB][Xilinx CTB] */
|
||||
void setPowerName(const defs::dacIndex i, const std::string &name);
|
||||
void setPowerName(const defs::powerIndex i, const std::string &name);
|
||||
|
||||
/** [CTB][Xilinx CTB] */
|
||||
std::string getPowerName(const defs::dacIndex i) const;
|
||||
std::string getPowerName(const defs::powerIndex i) const;
|
||||
|
||||
/** [CTB][Xilinx CTB] */
|
||||
void setSlowADCNames(const std::vector<std::string> names);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,7 @@
|
||||
#include "sls/Detector.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
namespace sls {
|
||||
@@ -215,7 +216,9 @@ class Caller {
|
||||
std::string periodl(int action);
|
||||
std::string polarity(int action);
|
||||
std::string port(int action);
|
||||
std::string power(int action);
|
||||
std::string powerchip(int action);
|
||||
std::string powerdac(int action);
|
||||
std::string powerindex(int action);
|
||||
std::string powerlist(int action);
|
||||
std::string powername(int action);
|
||||
@@ -358,12 +361,6 @@ class Caller {
|
||||
std::string updatekernel(int action);
|
||||
std::string updatemode(int action);
|
||||
std::string user(int action);
|
||||
std::string v_a(int action);
|
||||
std::string v_b(int action);
|
||||
std::string v_c(int action);
|
||||
std::string v_chip(int action);
|
||||
std::string v_d(int action);
|
||||
std::string v_io(int action);
|
||||
std::string v_limit(int action);
|
||||
std::string vchip_comp_adc(int action);
|
||||
std::string vchip_comp_fe(int action);
|
||||
@@ -396,6 +393,7 @@ class Caller {
|
||||
|
||||
private:
|
||||
bool ReplaceIfDeprecated(std::string &command);
|
||||
void SuggestIfRemoved(const std::string &command);
|
||||
using FunctionMap = std::map<std::string, std::string (Caller::*)(int)>;
|
||||
using StringMap = std::map<std::string, std::string>;
|
||||
Detector *ptr; // pointer to the detector that executes the command
|
||||
@@ -420,6 +418,9 @@ class Caller {
|
||||
// applicable
|
||||
RegisterAddress getRegisterAddress(const std::string &saddr) const;
|
||||
BitAddress getBitAddress() const;
|
||||
defs::dacIndex parseDacIndex(int argIndex, bool isCtb);
|
||||
bool parseMV(int argIndex);
|
||||
defs::powerIndex parsePowerIndex(int argIndex);
|
||||
|
||||
FunctionMap functions{
|
||||
{"list", &Caller::list},
|
||||
@@ -585,7 +586,9 @@ class Caller {
|
||||
{"periodl", &Caller::periodl},
|
||||
{"polarity", &Caller::polarity},
|
||||
{"port", &Caller::port},
|
||||
{"power", &Caller::power},
|
||||
{"powerchip", &Caller::powerchip},
|
||||
{"powerdac", &Caller::powerdac},
|
||||
{"powerindex", &Caller::powerindex},
|
||||
{"powerlist", &Caller::powerlist},
|
||||
{"powername", &Caller::powername},
|
||||
@@ -729,12 +732,6 @@ class Caller {
|
||||
{"updatekernel", &Caller::updatekernel},
|
||||
{"updatemode", &Caller::updatemode},
|
||||
{"user", &Caller::user},
|
||||
{"v_a", &Caller::v_a},
|
||||
{"v_b", &Caller::v_b},
|
||||
{"v_c", &Caller::v_c},
|
||||
{"v_chip", &Caller::v_chip},
|
||||
{"v_d", &Caller::v_d},
|
||||
{"v_io", &Caller::v_io},
|
||||
{"v_limit", &Caller::v_limit},
|
||||
{"vchip_comp_adc", &Caller::vchip_comp_adc},
|
||||
{"vchip_comp_fe", &Caller::vchip_comp_fe},
|
||||
@@ -902,6 +899,17 @@ class Caller {
|
||||
{"frameindex", "rx_frameindex"},
|
||||
|
||||
};
|
||||
|
||||
StringMap removed_functions{
|
||||
|
||||
{"v_a", "'dac v_a' and 'power v_a'"},
|
||||
{"v_b", "'dac v_b' and 'power v_b'"},
|
||||
{"v_c", "'dac v_c' and 'power v_c'"},
|
||||
{"v_d", "'dac v_d' and 'power v_d'"},
|
||||
{"v_io", "'dac v_io' and 'power v_io'"},
|
||||
{"v_chip", "'dac v_chip'"},
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
@@ -4,8 +4,10 @@
|
||||
#include "sls/file_utils.h"
|
||||
#include "sls/logger.h"
|
||||
#include "sls/string_utils.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
|
||||
namespace sls {
|
||||
// some helper functions to print
|
||||
|
||||
@@ -25,6 +27,7 @@ void Caller::call(const std::string &command,
|
||||
int action, std::ostream &os, int receiver_id) {
|
||||
cmd = command;
|
||||
args = arguments; // copy args before replacing
|
||||
SuggestIfRemoved(cmd);
|
||||
std::string temp;
|
||||
while (temp != cmd) {
|
||||
temp = cmd;
|
||||
@@ -66,6 +69,16 @@ bool Caller::ReplaceIfDeprecated(std::string &command) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Caller::SuggestIfRemoved(const std::string &command) {
|
||||
auto r_it = removed_functions.find(command);
|
||||
if (r_it != removed_functions.end()) {
|
||||
std::ostringstream oss;
|
||||
oss << command << " is removed and is no longer available. Please use: "
|
||||
<< r_it->second;
|
||||
throw RuntimeError(oss.str());
|
||||
}
|
||||
}
|
||||
|
||||
std::string Caller::list(int action) {
|
||||
if (action == defs::HELP_ACTION) {
|
||||
return "[deprecated(optional)]\n\tlists all available commands, list "
|
||||
@@ -1798,4 +1811,298 @@ BitAddress Caller::getBitAddress() const {
|
||||
throw RuntimeError("Invalid number of parameters for bit address.");
|
||||
}
|
||||
|
||||
std::string Caller::dac(int action) {
|
||||
std::ostringstream os;
|
||||
|
||||
if (action == defs::HELP_ACTION) {
|
||||
if (args.size() == 0)
|
||||
os << GetHelpDac("");
|
||||
else
|
||||
os << args[0] << GetHelpDac(args[0]) << '\n';
|
||||
return os.str();
|
||||
}
|
||||
|
||||
bool isCtb = false;
|
||||
auto detType = det->getDetectorType().squash(defs::GENERIC);
|
||||
if (detType == defs::CHIPTESTBOARD ||
|
||||
detType == defs::XILINX_CHIPTESTBOARD) {
|
||||
isCtb = true;
|
||||
}
|
||||
|
||||
if (action == defs::GET_ACTION) {
|
||||
auto index = parseDacIndex(0, isCtb);
|
||||
auto mV = parseMV(1);
|
||||
auto t = det->getDAC(index, mV, std::vector<int>{det_id});
|
||||
os << args[0] << ' ' << OutString(t) << (mV ? " mV" : "") << '\n';
|
||||
}
|
||||
|
||||
else if (action == defs::PUT_ACTION) {
|
||||
auto index = parseDacIndex(0, isCtb);
|
||||
if (args.size() < 2) {
|
||||
WrongNumberOfParameters(2);
|
||||
}
|
||||
auto val = StringTo<int>(args[1]);
|
||||
auto mV = parseMV(2);
|
||||
det->setDAC(index, val, mV, std::vector<int>{det_id});
|
||||
os << args[0] << ' ' << args[1] << (mV ? " mV" : "") << '\n';
|
||||
}
|
||||
|
||||
else {
|
||||
throw RuntimeError("Unknown action");
|
||||
}
|
||||
|
||||
return os.str();
|
||||
}
|
||||
|
||||
defs::dacIndex Caller::parseDacIndex(int argIndex, bool isCtb) {
|
||||
if (argIndex >= (int)args.size()) {
|
||||
throw RuntimeError("Invalid arguments. DAC index is required.");
|
||||
}
|
||||
auto arg = args[argIndex];
|
||||
|
||||
if (isCtb) {
|
||||
// dac index
|
||||
if (is_int(arg)) {
|
||||
return StringTo<defs::dacIndex>(arg);
|
||||
}
|
||||
// dac name
|
||||
return det->getDacIndex(arg);
|
||||
}
|
||||
|
||||
// not ctb
|
||||
if (is_int(arg)) {
|
||||
throw RuntimeError("DAC index is not supported for your detector. "
|
||||
"Please use dac name. Use daclist command to get "
|
||||
"the list of dac names for your detector.");
|
||||
}
|
||||
return StringTo<defs::dacIndex>(arg);
|
||||
}
|
||||
|
||||
bool Caller::parseMV(int argIndex) {
|
||||
if (argIndex < (int)args.size()) {
|
||||
auto arg = args[argIndex];
|
||||
if (arg != "mv" && arg != "mV") {
|
||||
throw RuntimeError("Unknown argument " + arg +
|
||||
". Did you mean mV?");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string Caller::powerdac(int action) {
|
||||
std::ostringstream os;
|
||||
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[powername][mV value]\n\t[Ctb][Xilinx Ctb] Controls the dac "
|
||||
"used for Power supply. Default names for powername are v_a, "
|
||||
"v_b, v_c, v_d, v_io, v_chip(v_chip only applies to Ctb, not "
|
||||
"Xilinx_Ctb). If custom names are assigned using the 'powername' "
|
||||
"command, those names could be used instead instead of the "
|
||||
"defaults. By default, all are set to minimum values. \n\t[Ctb] "
|
||||
"v_chip can also be queried to get the vchip dac value, although "
|
||||
"its rail cannot be enabled or disabled by the user. It is "
|
||||
"enabled by default. Its dac value is automatically updated "
|
||||
"whenever a power dac is modified. It is then set to the max of "
|
||||
"power dacs + 200mV."
|
||||
<< '\n';
|
||||
return os.str();
|
||||
}
|
||||
|
||||
auto detType = det->getDetectorType().squash(defs::GENERIC);
|
||||
if (detType != defs::CHIPTESTBOARD &&
|
||||
detType != defs::XILINX_CHIPTESTBOARD) {
|
||||
throw RuntimeError("This command is only applicable for ChipTestBoard "
|
||||
"and Xilinx ChipTestBoard.");
|
||||
}
|
||||
if (det_id != -1) {
|
||||
throw RuntimeError("Cannot use powerdac at module level.");
|
||||
}
|
||||
auto index = parsePowerIndex(0);
|
||||
|
||||
if (action == defs::GET_ACTION) {
|
||||
if (args.size() != 1) {
|
||||
WrongNumberOfParameters(1);
|
||||
}
|
||||
auto t = det->getPowerDAC(index);
|
||||
os << args[0] << ' ' << OutString(t) << '\n';
|
||||
}
|
||||
|
||||
else if (action == defs::PUT_ACTION) {
|
||||
if (args.size() != 2) {
|
||||
WrongNumberOfParameters(2);
|
||||
}
|
||||
auto val = StringTo<int>(args[1]);
|
||||
det->setPowerDAC(index, val);
|
||||
os << args[0] << ' ' << args[1] << '\n';
|
||||
} else {
|
||||
throw RuntimeError("Unknown action");
|
||||
}
|
||||
|
||||
return os.str();
|
||||
}
|
||||
|
||||
defs::powerIndex Caller::parsePowerIndex(int argIndex) {
|
||||
if (argIndex >= (int)args.size()) {
|
||||
throw RuntimeError("Invalid arguments. Power name is required.");
|
||||
}
|
||||
auto arg = args[argIndex];
|
||||
|
||||
// power default names
|
||||
if (is_int(arg) || arg == "v_a" || arg == "v_b" || arg == "v_c" ||
|
||||
arg == "v_d" || arg == "v_io" || arg == "v_chip") {
|
||||
return StringTo<defs::powerIndex>(arg);
|
||||
}
|
||||
|
||||
// power name
|
||||
auto names = det->getPowerNames();
|
||||
auto it = std::find(names.begin(), names.end(), arg);
|
||||
if (it != names.end()) {
|
||||
return det->getPowerIndex(arg);
|
||||
}
|
||||
throw RuntimeError(
|
||||
"Unknown power name '" + arg +
|
||||
"'. Use 'powername' command to see defined power names.");
|
||||
}
|
||||
|
||||
std::string Caller::power(int action) {
|
||||
std::ostringstream os;
|
||||
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[all|list of power names] [on|off]\n\t[Ctb][Xilinx Ctb] Enable "
|
||||
"or "
|
||||
"disable power rails. Power name can be all, v_a, v_b, v_c, v_d "
|
||||
"or "
|
||||
"v_io or any defines using 'powername'. If power name is set to "
|
||||
"'all', the command applies to all 'powers'. Enabling the power "
|
||||
"rails is in parallel, whereas retrieving the states of multiple "
|
||||
"power rails, they are queried sequentially "
|
||||
"(one after another), not in parallel."
|
||||
<< '\n';
|
||||
return os.str();
|
||||
}
|
||||
|
||||
auto detType = det->getDetectorType().squash(defs::GENERIC);
|
||||
if (detType != defs::CHIPTESTBOARD &&
|
||||
detType != defs::XILINX_CHIPTESTBOARD) {
|
||||
throw RuntimeError("This command is only applicable for ChipTestBoard "
|
||||
"and Xilinx ChipTestBoard.");
|
||||
}
|
||||
|
||||
// 'all' argument
|
||||
bool all = false;
|
||||
if (std::find(args.begin(), args.end(), "all") != args.end()) {
|
||||
all = true;
|
||||
}
|
||||
|
||||
// number of args
|
||||
if (action == defs::GET_ACTION && args.size() != 1)
|
||||
WrongNumberOfParameters(1);
|
||||
if (all) {
|
||||
if (action == defs::PUT_ACTION && args.size() != 2) {
|
||||
WrongNumberOfParameters(2);
|
||||
}
|
||||
} else {
|
||||
if (args.size() < 1 || args.size() > 6)
|
||||
WrongNumberOfParameters(1);
|
||||
}
|
||||
|
||||
if (action == defs::GET_ACTION) {
|
||||
if (!all) {
|
||||
auto t = det->isPowerEnabled(parsePowerIndex(0));
|
||||
os << args[0] << ' ' << ToString(t, defs::OnOff) << '\n';
|
||||
} else {
|
||||
// get each state and store in map
|
||||
std::map<std::string, std::string> m;
|
||||
auto powerIndices = det->getPowerList();
|
||||
for (const auto &index : powerIndices) {
|
||||
auto name = ToString(index);
|
||||
auto state = det->isPowerEnabled(index);
|
||||
m[name] = ToString(state, defs::OnOff);
|
||||
}
|
||||
if (m.empty()) {
|
||||
throw RuntimeError("Could not get power states.");
|
||||
}
|
||||
auto first = m.begin()->second;
|
||||
// if all the same, print in short form, else print all states
|
||||
if (std::all_of(m.begin(), m.end(),
|
||||
[&](const auto &p) { return p.second == first; })) {
|
||||
os << "all " << first << '\n';
|
||||
} else {
|
||||
os << ToString(m) << '\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (action == defs::PUT_ACTION) {
|
||||
// enable arg
|
||||
std::string lastArg = args.back();
|
||||
if (lastArg != "on" && lastArg != "off") {
|
||||
throw RuntimeError("Last argument '" + lastArg +
|
||||
"' is enable. Options: 'on' or 'off'");
|
||||
}
|
||||
bool enable = StringTo(lastArg, defs::OnOff);
|
||||
|
||||
// power indices
|
||||
std::vector<defs::powerIndex> powerIndices;
|
||||
if (all) {
|
||||
powerIndices = det->getPowerList();
|
||||
} else {
|
||||
// push back indices from command line
|
||||
for (size_t i = 0; i < args.size() - 1; ++i) {
|
||||
powerIndices.push_back(parsePowerIndex(i));
|
||||
}
|
||||
}
|
||||
|
||||
det->setPowerEnabled(powerIndices, enable);
|
||||
args.pop_back();
|
||||
os << ToString(args) << ' ' << ToString(enable, defs::OnOff) << '\n';
|
||||
} else {
|
||||
throw RuntimeError("Unknown action");
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string Caller::powervalues(int action) {
|
||||
std::ostringstream os;
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "\n\t\t[Ctb][Xilinx_Ctb] Get dac values of all powers if "
|
||||
"enabled, else '0'."
|
||||
<< '\n';
|
||||
return os.str();
|
||||
}
|
||||
|
||||
auto detType = det->getDetectorType().squash(defs::GENERIC);
|
||||
if (detType != defs::CHIPTESTBOARD &&
|
||||
detType != defs::XILINX_CHIPTESTBOARD) {
|
||||
throw RuntimeError("This command is only applicable for ChipTestBoard "
|
||||
"and Xilinx ChipTestBoard.");
|
||||
}
|
||||
|
||||
if (action == defs::GET_ACTION) {
|
||||
if (!args.empty()) {
|
||||
WrongNumberOfParameters(0);
|
||||
}
|
||||
auto t = det->getPowerList();
|
||||
auto names = det->getPowerNames();
|
||||
auto name_it = names.begin();
|
||||
os << '[';
|
||||
auto it = t.cbegin();
|
||||
while (it != t.cend()) {
|
||||
if (it != t.cbegin())
|
||||
os << ", ";
|
||||
os << ToString(*name_it++) << ": [";
|
||||
os << ToString(det->isPowerEnabled(*it), defs::OnOff) << ", ";
|
||||
os << det->getPowerDAC(*it) << " mV ]";
|
||||
++it;
|
||||
}
|
||||
os << "]" << '\n';
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
throw RuntimeError("Cannot put");
|
||||
} else {
|
||||
throw RuntimeError("Unknown action");
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
@@ -20,11 +20,11 @@ CtbConfig::CtbConfig() {
|
||||
for (size_t i = 0; i != num_signals; ++i) {
|
||||
setSignalName(i, "BIT" + ToString(i));
|
||||
}
|
||||
setPowerName(0, "VA");
|
||||
setPowerName(1, "VB");
|
||||
setPowerName(2, "VC");
|
||||
setPowerName(3, "VD");
|
||||
setPowerName(4, "VIO");
|
||||
setPowerName(static_cast<int>(defs::V_POWER_A), "VA");
|
||||
setPowerName(static_cast<int>(defs::V_POWER_B), "VB");
|
||||
setPowerName(static_cast<int>(defs::V_POWER_C), "VC");
|
||||
setPowerName(static_cast<int>(defs::V_POWER_D), "VD");
|
||||
setPowerName(static_cast<int>(defs::V_POWER_IO), "VIO");
|
||||
for (size_t i = 0; i != num_slowADCs; ++i) {
|
||||
setSlowADCName(i, "SLOWADC" + ToString(i));
|
||||
}
|
||||
@@ -80,6 +80,15 @@ CtbConfig::getNames(size_t expected_size,
|
||||
|
||||
void CtbConfig::setDacName(size_t index, const std::string &name) {
|
||||
check_index(index, num_dacs, "DAC");
|
||||
std::vector<std::string> powers = {"v_a", "v_b", "v_c", "v_d", "v_io",
|
||||
"va", "vb", "vc", "vd", "vio"};
|
||||
std::string lower = name;
|
||||
std::transform(lower.begin(), lower.end(), lower.begin(),
|
||||
[](unsigned char c) { return std::tolower(c); });
|
||||
if (std::find(powers.begin(), powers.end(), lower) != powers.end()) {
|
||||
throw RuntimeError("DAC name cannot be a power name (VA, VB, VC, VD, "
|
||||
"VIO, V_A, V_B, V_C, V_D, V_IO)");
|
||||
}
|
||||
set_name(name, dacnames, index);
|
||||
}
|
||||
|
||||
|
||||
@@ -2166,15 +2166,80 @@ Result<int> Detector::getSYNCClock(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getClockFrequency, pos, defs::SYNC_CLOCK);
|
||||
}
|
||||
|
||||
std::vector<defs::dacIndex> Detector::getPowerList() const {
|
||||
std::vector<defs::powerIndex> Detector::getPowerList() const {
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD &&
|
||||
dettype != defs::XILINX_CHIPTESTBOARD) {
|
||||
throw RuntimeError("Power list not implemented for this detector");
|
||||
}
|
||||
return std::vector<defs::dacIndex>{defs::V_POWER_A, defs::V_POWER_B,
|
||||
defs::V_POWER_C, defs::V_POWER_D,
|
||||
defs::V_POWER_IO};
|
||||
return std::vector<defs::powerIndex>{defs::V_POWER_A, defs::V_POWER_B,
|
||||
defs::V_POWER_C, defs::V_POWER_D,
|
||||
defs::V_POWER_IO};
|
||||
}
|
||||
|
||||
int Detector::getPowerDAC(defs::powerIndex index) const {
|
||||
pimpl->verifyChipTestBoard(__func__);
|
||||
return pimpl->Parallel(&Module::getPowerDAC, {0}, index)[0];
|
||||
}
|
||||
|
||||
void Detector::setPowerDAC(defs::powerIndex index, int value) {
|
||||
pimpl->verifyChipTestBoard(__func__);
|
||||
pimpl->Parallel(&Module::setPowerDAC, {0}, index, value);
|
||||
}
|
||||
|
||||
bool Detector::isPowerEnabled(defs::powerIndex index) const {
|
||||
pimpl->verifyChipTestBoard(__func__);
|
||||
return pimpl->Parallel(&Module::isPowerEnabled, {0}, index)[0];
|
||||
}
|
||||
|
||||
void Detector::setPowerEnabled(const std::vector<defs::powerIndex> &indices,
|
||||
bool enable) {
|
||||
pimpl->verifyChipTestBoard(__func__);
|
||||
if (indices.empty()) {
|
||||
throw RuntimeError("No Power Index provided");
|
||||
}
|
||||
pimpl->Parallel(&Module::setPowerEnabled, {0}, indices, enable);
|
||||
}
|
||||
|
||||
int Detector::getMeasuredPower(defs::powerIndex index) const {
|
||||
pimpl->verifyChipTestBoard(__func__);
|
||||
switch (index) {
|
||||
case defs::V_POWER_A:
|
||||
case defs::V_POWER_B:
|
||||
case defs::V_POWER_C:
|
||||
case defs::V_POWER_D:
|
||||
case defs::V_POWER_IO:
|
||||
case defs::V_POWER_CHIP:
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Unknown Power Index " + std::to_string(index));
|
||||
}
|
||||
return pimpl->Parallel(&Module::getPowerADC, {0}, index)[0];
|
||||
}
|
||||
|
||||
int Detector::getMeasuredCurrent(defs::powerIndex index) const {
|
||||
pimpl->verifyChipTestBoard(__func__);
|
||||
switch (index) {
|
||||
case defs::I_POWER_A:
|
||||
case defs::I_POWER_B:
|
||||
case defs::I_POWER_C:
|
||||
case defs::I_POWER_D:
|
||||
case defs::I_POWER_IO:
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Unknown Current Index " + std::to_string(index));
|
||||
}
|
||||
return pimpl->Parallel(&Module::getPowerADC, {0}, index)[0];
|
||||
}
|
||||
|
||||
int Detector::getVoltageLimit() const {
|
||||
pimpl->verifyChipTestBoard(__func__);
|
||||
return pimpl->Parallel(&Module::getVoltageLimit, {0})[0];
|
||||
}
|
||||
|
||||
void Detector::setVoltageLimit(int value) {
|
||||
pimpl->verifyChipTestBoard(__func__);
|
||||
pimpl->Parallel(&Module::setVoltageLimit, {0}, value);
|
||||
}
|
||||
|
||||
std::vector<defs::dacIndex> Detector::getSlowADCList() const {
|
||||
@@ -2188,38 +2253,6 @@ std::vector<defs::dacIndex> Detector::getSlowADCList() const {
|
||||
defs::SLOW_ADC4, defs::SLOW_ADC5, defs::SLOW_ADC6, defs::SLOW_ADC7};
|
||||
}
|
||||
|
||||
Result<int> Detector::getPower(defs::dacIndex index, Positions pos) const {
|
||||
switch (index) {
|
||||
case defs::V_LIMIT:
|
||||
case defs::V_POWER_A:
|
||||
case defs::V_POWER_B:
|
||||
case defs::V_POWER_C:
|
||||
case defs::V_POWER_D:
|
||||
case defs::V_POWER_IO:
|
||||
case defs::V_POWER_CHIP:
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Unknown Power Index");
|
||||
}
|
||||
return pimpl->Parallel(&Module::getDAC, pos, index, true);
|
||||
}
|
||||
|
||||
void Detector::setPower(defs::dacIndex index, int value, Positions pos) {
|
||||
switch (index) {
|
||||
case defs::V_LIMIT:
|
||||
case defs::V_POWER_A:
|
||||
case defs::V_POWER_B:
|
||||
case defs::V_POWER_C:
|
||||
case defs::V_POWER_D:
|
||||
case defs::V_POWER_IO:
|
||||
case defs::V_POWER_CHIP:
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Unknown Power Index");
|
||||
}
|
||||
pimpl->Parallel(&Module::setDAC, pos, value, index, true);
|
||||
}
|
||||
|
||||
Result<int> Detector::getADCVpp(bool mV, Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getDAC, pos, defs::ADC_VPP, mV);
|
||||
}
|
||||
@@ -2286,37 +2319,6 @@ void Detector::setDBITClock(int value_in_Hz, Positions pos) {
|
||||
value_in_Hz);
|
||||
}
|
||||
|
||||
Result<int> Detector::getMeasuredPower(defs::dacIndex index,
|
||||
Positions pos) const {
|
||||
switch (index) {
|
||||
case defs::V_POWER_A:
|
||||
case defs::V_POWER_B:
|
||||
case defs::V_POWER_C:
|
||||
case defs::V_POWER_D:
|
||||
case defs::V_POWER_IO:
|
||||
case defs::V_POWER_CHIP:
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Unknown Power Index");
|
||||
}
|
||||
return pimpl->Parallel(&Module::getADC, pos, index);
|
||||
}
|
||||
|
||||
Result<int> Detector::getMeasuredCurrent(defs::dacIndex index,
|
||||
Positions pos) const {
|
||||
switch (index) {
|
||||
case defs::I_POWER_A:
|
||||
case defs::I_POWER_B:
|
||||
case defs::I_POWER_C:
|
||||
case defs::I_POWER_D:
|
||||
case defs::I_POWER_IO:
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Unknown Current Index");
|
||||
}
|
||||
return pimpl->Parallel(&Module::getADC, pos, index);
|
||||
}
|
||||
|
||||
Result<int> Detector::getSlowADC(defs::dacIndex index, Positions pos) const {
|
||||
if (index < defs::SLOW_ADC0 || index > defs::SLOW_ADC7) {
|
||||
throw RuntimeError("Unknown Slow ADC Index");
|
||||
@@ -2398,7 +2400,14 @@ defs::dacIndex Detector::getDacIndex(const std::string &name) const {
|
||||
throw RuntimeError("Dac name not found");
|
||||
return static_cast<defs::dacIndex>(it - names.begin());
|
||||
}
|
||||
return StringTo<defs::dacIndex>(name);
|
||||
auto retval = StringTo<defs::dacIndex>(name);
|
||||
auto list = getDacList();
|
||||
if (std::find(list.begin(), list.end(), retval) == list.end()) {
|
||||
throw RuntimeError("Dac name not found in dac list. Use 'daclist' or "
|
||||
"Detector::getDacNames() to get the list of dac "
|
||||
"names for this detector.");
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
void Detector::setDacName(const defs::dacIndex i, const std::string &name) {
|
||||
@@ -2408,6 +2417,13 @@ void Detector::setDacName(const defs::dacIndex i, const std::string &name) {
|
||||
std::string Detector::getDacName(const defs::dacIndex i) const {
|
||||
if (pimpl->isChipTestBoard())
|
||||
return pimpl->getCtbDacName(i);
|
||||
auto list = getDacList();
|
||||
if (std::find(list.begin(), list.end(), i) == list.end()) {
|
||||
auto count = getDacList().size();
|
||||
throw RuntimeError(
|
||||
"Dac index not found in dac list. Use an index from 0 to " +
|
||||
std::to_string(count - 1) + ".");
|
||||
}
|
||||
return ToString(i);
|
||||
}
|
||||
|
||||
@@ -2467,20 +2483,20 @@ std::vector<std::string> Detector::getPowerNames() const {
|
||||
return pimpl->getCtbPowerNames();
|
||||
}
|
||||
|
||||
defs::dacIndex Detector::getPowerIndex(const std::string &name) const {
|
||||
defs::powerIndex Detector::getPowerIndex(const std::string &name) const {
|
||||
auto names = getPowerNames();
|
||||
auto it = std::find(names.begin(), names.end(), name);
|
||||
if (it == names.end())
|
||||
throw RuntimeError("Power name not found");
|
||||
return static_cast<defs::dacIndex>(it - names.begin() + defs::V_POWER_A);
|
||||
return static_cast<defs::powerIndex>(it - names.begin());
|
||||
}
|
||||
|
||||
void Detector::setPowerName(const defs::dacIndex index,
|
||||
void Detector::setPowerName(const defs::powerIndex index,
|
||||
const std::string &name) {
|
||||
pimpl->setCtbPowerName(index, name);
|
||||
}
|
||||
|
||||
std::string Detector::getPowerName(const defs::dacIndex i) const {
|
||||
std::string Detector::getPowerName(const defs::powerIndex i) const {
|
||||
return pimpl->getCtbPowerName(i);
|
||||
}
|
||||
|
||||
|
||||
@@ -2026,17 +2026,17 @@ void DetectorImpl::setCtbPowerNames(const std::vector<std::string> &names) {
|
||||
ctb_shm()->setPowerNames(names);
|
||||
}
|
||||
|
||||
std::string DetectorImpl::getCtbPowerName(const defs::dacIndex i) const {
|
||||
std::string DetectorImpl::getCtbPowerName(const defs::powerIndex i) const {
|
||||
if (!isChipTestBoard())
|
||||
throw RuntimeError("Named Powers only for CTB");
|
||||
return ctb_shm()->getPowerName(static_cast<int>(i - defs::V_POWER_A));
|
||||
}
|
||||
|
||||
void DetectorImpl::setCtbPowerName(const defs::dacIndex index,
|
||||
void DetectorImpl::setCtbPowerName(const defs::powerIndex index,
|
||||
const std::string &name) {
|
||||
if (!isChipTestBoard())
|
||||
throw RuntimeError("Named Powers only for CTB");
|
||||
ctb_shm()->setPowerName(static_cast<int>(index - defs::V_POWER_A), name);
|
||||
ctb_shm()->setPowerName(static_cast<int>(index), name);
|
||||
}
|
||||
|
||||
std::vector<std::string> DetectorImpl::getCtbSlowADCNames() const {
|
||||
|
||||
@@ -188,6 +188,17 @@ class DetectorImpl : public virtual slsDetectorDefs {
|
||||
shm()->detType == defs::XILINX_CHIPTESTBOARD);
|
||||
}
|
||||
|
||||
inline void verifyChipTestBoard(const std::string &funcName) const {
|
||||
if (!isChipTestBoard())
|
||||
throw RuntimeError(funcName +
|
||||
" is not implemented for this detector. It is "
|
||||
"only valid for chip test board");
|
||||
if (size() != 1)
|
||||
throw RuntimeError(
|
||||
funcName +
|
||||
" is only valid for single module setup (chip test board).");
|
||||
}
|
||||
|
||||
/** set acquiring flag in shared memory */
|
||||
void setAcquiringFlag(bool flag);
|
||||
|
||||
@@ -324,9 +335,9 @@ class DetectorImpl : public virtual slsDetectorDefs {
|
||||
void setCtbSignalName(const int index, const std::string &name);
|
||||
|
||||
std::vector<std::string> getCtbPowerNames() const;
|
||||
std::string getCtbPowerName(const defs::dacIndex i) const;
|
||||
std::string getCtbPowerName(const defs::powerIndex i) const;
|
||||
void setCtbPowerNames(const std::vector<std::string> &names);
|
||||
void setCtbPowerName(const defs::dacIndex index, const std::string &name);
|
||||
void setCtbPowerName(const defs::powerIndex index, const std::string &name);
|
||||
|
||||
std::vector<std::string> getCtbSlowADCNames() const;
|
||||
std::string getCtbSlowADCName(const defs::dacIndex i) const;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
namespace sls {
|
||||
|
||||
std::string GetHelpDac(std::string dac) {
|
||||
if (sls::is_int(dac)) {
|
||||
if (dac.empty() || sls::is_int(dac)) {
|
||||
return std::string("[dac name] [dac or mV value] [(optional unit) mV] "
|
||||
"\n\t[Ctb] Use dac index for dac name.");
|
||||
}
|
||||
@@ -280,24 +280,10 @@ std::string GetHelpDac(std::string dac) {
|
||||
return std::string(
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Moench] Dac for 7");
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
if (dac == "vtgstv") { return std::string(""); }
|
||||
// clang-format on
|
||||
|
||||
if (dac == "vtgstv") {
|
||||
return std::string("");
|
||||
}
|
||||
throw sls::RuntimeError("Unknown dac command");
|
||||
}
|
||||
|
||||
std::string GetHelpDacWrapper(const std::string &cmd,
|
||||
const std::vector<std::string> &args) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (args.size() == 0) {
|
||||
os << GetHelpDac(std::to_string(0)) << '\n';
|
||||
} else {
|
||||
os << args[0] << ' ' << GetHelpDac(args[0]) << '\n';
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
||||
@@ -7,7 +7,4 @@ namespace sls {
|
||||
|
||||
std::string GetHelpDac(std::string dac);
|
||||
|
||||
std::string GetHelpDacWrapper(const std::string &cmd,
|
||||
const std::vector<std::string> &args);
|
||||
|
||||
} // namespace sls
|
||||
|
||||
@@ -819,6 +819,50 @@ void Module::setPowerChip(bool on) {
|
||||
sendToDetector<int>(F_POWER_CHIP, static_cast<int>(on));
|
||||
}
|
||||
|
||||
int Module::getPowerDAC(defs::powerIndex index) const {
|
||||
return sendToDetector<int>(F_GET_POWER_DAC, static_cast<int>(index));
|
||||
}
|
||||
|
||||
void Module::setPowerDAC(defs::powerIndex index, int value) {
|
||||
int args[]{static_cast<int>(index), value};
|
||||
sendToDetector(F_SET_POWER_DAC, args, nullptr);
|
||||
}
|
||||
|
||||
bool Module::isPowerEnabled(defs::powerIndex index) const {
|
||||
return sendToDetector<int>(F_GET_POWER, static_cast<int>(index));
|
||||
}
|
||||
|
||||
void Module::setPowerEnabled(const std::vector<defs::powerIndex> &indices,
|
||||
bool enable) {
|
||||
auto client = DetectorSocket(shm()->hostname, shm()->controlPort);
|
||||
client.Send(F_SET_POWER);
|
||||
client.setFnum(F_SET_POWER);
|
||||
int count = indices.size();
|
||||
client.Send(count);
|
||||
std::vector<int> indices_int(count);
|
||||
for (size_t i = 0; i < indices.size(); ++i) {
|
||||
indices_int[i] = static_cast<int>(indices[i]);
|
||||
}
|
||||
client.Send(indices_int);
|
||||
client.Send(static_cast<int>(enable));
|
||||
if (client.Receive<int>() == FAIL) {
|
||||
throw DetectorError("Detector " + std::to_string(moduleIndex) +
|
||||
" returned error: " + client.readErrorMessage());
|
||||
}
|
||||
}
|
||||
|
||||
int Module::getPowerADC(defs::powerIndex index) const {
|
||||
return sendToDetector<int>(F_GET_POWER_ADC, static_cast<int>(index));
|
||||
}
|
||||
|
||||
int Module::getVoltageLimit() const {
|
||||
return sendToDetector<int>(F_GET_VOLTAGE_LIMIT);
|
||||
}
|
||||
|
||||
void Module::setVoltageLimit(const int limit_in_mV) {
|
||||
sendToDetector(F_SET_VOLTAGE_LIMIT, limit_in_mV, nullptr);
|
||||
}
|
||||
|
||||
int Module::getImageTestMode() const {
|
||||
return sendToDetector<int>(F_GET_IMAGE_TEST_MODE);
|
||||
}
|
||||
|
||||
@@ -177,6 +177,14 @@ class Module : public virtual slsDetectorDefs {
|
||||
void setDAC(int val, dacIndex index, bool mV);
|
||||
bool getPowerChip() const;
|
||||
void setPowerChip(bool on);
|
||||
int getPowerDAC(defs::powerIndex index) const;
|
||||
void setPowerDAC(defs::powerIndex index, int value);
|
||||
bool isPowerEnabled(defs::powerIndex index) const;
|
||||
void setPowerEnabled(const std::vector<defs::powerIndex> &indices,
|
||||
bool enable);
|
||||
int getPowerADC(defs::powerIndex index) const;
|
||||
int getVoltageLimit() const;
|
||||
void setVoltageLimit(const int limit_in_mV);
|
||||
int getImageTestMode() const;
|
||||
void setImageTestMode(const int value);
|
||||
/* temperature in millidegrees */
|
||||
|
||||
@@ -2256,6 +2256,12 @@ int InferAction::port() {
|
||||
}
|
||||
}
|
||||
|
||||
int InferAction::power() {
|
||||
|
||||
throw RuntimeError("sls_detector is disabled for command: power. Use "
|
||||
"sls_detector_get or sls_detector_put");
|
||||
}
|
||||
|
||||
int InferAction::powerchip() {
|
||||
|
||||
if (args.size() == 0) {
|
||||
@@ -2272,6 +2278,22 @@ int InferAction::powerchip() {
|
||||
}
|
||||
}
|
||||
|
||||
int InferAction::powerdac() {
|
||||
|
||||
if (args.size() == 1) {
|
||||
return slsDetectorDefs::GET_ACTION;
|
||||
}
|
||||
|
||||
if (args.size() == 2) {
|
||||
return slsDetectorDefs::PUT_ACTION;
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
throw RuntimeError("Could not infer action: Wrong number of arguments");
|
||||
}
|
||||
}
|
||||
|
||||
int InferAction::powerindex() {
|
||||
|
||||
if (args.size() == 1) {
|
||||
@@ -4253,102 +4275,6 @@ int InferAction::user() {
|
||||
}
|
||||
}
|
||||
|
||||
int InferAction::v_a() {
|
||||
|
||||
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::v_b() {
|
||||
|
||||
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::v_c() {
|
||||
|
||||
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::v_chip() {
|
||||
|
||||
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::v_d() {
|
||||
|
||||
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::v_io() {
|
||||
|
||||
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::v_limit() {
|
||||
|
||||
if (args.size() == 0) {
|
||||
|
||||
@@ -170,7 +170,9 @@ class InferAction {
|
||||
int periodl();
|
||||
int polarity();
|
||||
int port();
|
||||
int power();
|
||||
int powerchip();
|
||||
int powerdac();
|
||||
int powerindex();
|
||||
int powerlist();
|
||||
int powername();
|
||||
@@ -313,12 +315,6 @@ class InferAction {
|
||||
int updatekernel();
|
||||
int updatemode();
|
||||
int user();
|
||||
int v_a();
|
||||
int v_b();
|
||||
int v_c();
|
||||
int v_chip();
|
||||
int v_d();
|
||||
int v_io();
|
||||
int v_limit();
|
||||
int vchip_comp_adc();
|
||||
int vchip_comp_fe();
|
||||
@@ -510,7 +506,9 @@ class InferAction {
|
||||
{"periodl", &InferAction::periodl},
|
||||
{"polarity", &InferAction::polarity},
|
||||
{"port", &InferAction::port},
|
||||
{"power", &InferAction::power},
|
||||
{"powerchip", &InferAction::powerchip},
|
||||
{"powerdac", &InferAction::powerdac},
|
||||
{"powerindex", &InferAction::powerindex},
|
||||
{"powerlist", &InferAction::powerlist},
|
||||
{"powername", &InferAction::powername},
|
||||
@@ -654,12 +652,6 @@ class InferAction {
|
||||
{"updatekernel", &InferAction::updatekernel},
|
||||
{"updatemode", &InferAction::updatemode},
|
||||
{"user", &InferAction::user},
|
||||
{"v_a", &InferAction::v_a},
|
||||
{"v_b", &InferAction::v_b},
|
||||
{"v_c", &InferAction::v_c},
|
||||
{"v_chip", &InferAction::v_chip},
|
||||
{"v_d", &InferAction::v_d},
|
||||
{"v_io", &InferAction::v_io},
|
||||
{"v_limit", &InferAction::v_limit},
|
||||
{"vchip_comp_adc", &InferAction::vchip_comp_adc},
|
||||
{"vchip_comp_fe", &InferAction::vchip_comp_fe},
|
||||
|
||||
@@ -46,6 +46,12 @@ TEST_CASE("dacname", "[.detectorintegration]") {
|
||||
REQUIRE(oss.str() ==
|
||||
std::string("dacname ") + str_dac_index + " bname\n");
|
||||
}
|
||||
REQUIRE_THROWS(caller.call("dacname", {str_dac_index, "v_a"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("dacname", {str_dac_index, "v_b"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("dacname", {str_dac_index, "v_c"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("dacname", {str_dac_index, "v_d"}, -1, PUT));
|
||||
REQUIRE_THROWS(
|
||||
caller.call("dacname", {str_dac_index, "v_io"}, -1, PUT));
|
||||
det.setDacName(ind, prev);
|
||||
|
||||
} else {
|
||||
@@ -309,7 +315,7 @@ TEST_CASE("powername", "[.detectorintegration]") {
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::V_POWER_A);
|
||||
defs::powerIndex ind = static_cast<defs::powerIndex>(2);
|
||||
std::string str_power_index = "2";
|
||||
auto prev = det.getPowerName(ind);
|
||||
|
||||
@@ -344,7 +350,7 @@ TEST_CASE("powerindex", "[.detectorintegration]") {
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::V_POWER_A);
|
||||
defs::powerIndex ind = static_cast<defs::powerIndex>(2);
|
||||
std::string str_power_index = "2";
|
||||
|
||||
// 1 arg throw
|
||||
@@ -356,8 +362,7 @@ TEST_CASE("powerindex", "[.detectorintegration]") {
|
||||
std::ostringstream oss;
|
||||
REQUIRE_NOTHROW(
|
||||
caller.call("powerindex", {powername}, -1, GET, oss));
|
||||
REQUIRE(oss.str() ==
|
||||
std::string("powerindex ") + str_power_index + '\n');
|
||||
REQUIRE(oss.str() == "powerindex 2\n");
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("powerindex", {"2"}, -1, GET));
|
||||
@@ -496,35 +501,8 @@ TEST_CASE("dac", "[.detectorintegration][dacs]") {
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
for (int i = 0; i < 18; ++i) {
|
||||
SECTION("dac " + std::to_string(i)) {
|
||||
test_dac_caller(static_cast<defs::dacIndex>(i), "dac", 0);
|
||||
}
|
||||
}
|
||||
|
||||
// normal dacs
|
||||
{
|
||||
defs::dacIndex idac = defs::DAC_5;
|
||||
auto previous = det.getDAC(idac, false);
|
||||
|
||||
REQUIRE_THROWS(
|
||||
caller.call("dac", {std::to_string(idac), "-2"}, -1, PUT));
|
||||
REQUIRE_THROWS(
|
||||
caller.call("dac", {std::to_string(idac), "-1"}, -1, PUT));
|
||||
REQUIRE_NOTHROW(
|
||||
caller.call("dac", {std::to_string(idac), "-100"}, -1, PUT));
|
||||
|
||||
// Reset all dacs to previous value
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setDAC(idac, previous[i], false, {i});
|
||||
}
|
||||
}
|
||||
REQUIRE_THROWS(caller.call("dac", {"18"}, -1, GET));
|
||||
REQUIRE_THROWS(caller.call("dac", {"5", "4096"}, -1, PUT));
|
||||
if (det_type == defs::CHIPTESTBOARD)
|
||||
REQUIRE_THROWS(caller.call("dac", {"5", "2501", "mV"}, -1, PUT));
|
||||
else
|
||||
REQUIRE_THROWS(caller.call("dac", {"5", "2049", "mV"}, -1, PUT));
|
||||
|
||||
// eiger
|
||||
// REQUIRE_THROWS(caller.call("dac", {"vthreshold"}, -1, GET));
|
||||
// REQUIRE_THROWS(caller.call("dac", {"vsvp"}, -1, GET));
|
||||
@@ -584,6 +562,250 @@ TEST_CASE("dac", "[.detectorintegration][dacs]") {
|
||||
REQUIRE_THROWS(caller.call("dac", {"vb_cs"}, -1, GET));
|
||||
REQUIRE_THROWS(caller.call("dac", {"vb_opa_fd"}, -1, GET));
|
||||
REQUIRE_THROWS(caller.call("dac", {"vcom_adc2"}, -1, GET));
|
||||
|
||||
// ctb and xilinx
|
||||
REQUIRE_THROWS(caller.call("dac", {"18"}, -1, GET));
|
||||
REQUIRE_THROWS(caller.call("dac", {"5", "4096"}, -1, PUT));
|
||||
if (det_type == defs::CHIPTESTBOARD)
|
||||
REQUIRE_THROWS(caller.call("dac", {"5", "2501", "mV"}, -1, PUT));
|
||||
else
|
||||
REQUIRE_THROWS(caller.call("dac", {"5", "2049", "mV"}, -1, PUT));
|
||||
|
||||
for (int idac = 0; idac < 18; ++idac) {
|
||||
|
||||
SECTION("dac " + std::to_string(idac)) {
|
||||
test_dac_caller(static_cast<defs::dacIndex>(idac), "dac", 0);
|
||||
test_dac_caller(static_cast<defs::dacIndex>(idac), "dac", 1200);
|
||||
test_dac_caller(static_cast<defs::dacIndex>(idac), "dac", 1200,
|
||||
true);
|
||||
test_dac_caller(static_cast<defs::dacIndex>(idac), "dac", -100);
|
||||
|
||||
// dac name
|
||||
det.setDacName(static_cast<defs::dacIndex>(idac),
|
||||
"dacname" + std::to_string(idac));
|
||||
test_dac_caller(defs::DAC_0, "dacname" + std::to_string(idac),
|
||||
-100);
|
||||
}
|
||||
REQUIRE_THROWS(
|
||||
caller.call("dac", {std::to_string(idac), "-2"}, -1, PUT));
|
||||
REQUIRE_THROWS(
|
||||
caller.call("dac", {std::to_string(idac), "-1"}, -1, PUT));
|
||||
}
|
||||
|
||||
// power dacs (shouldnt work anymore. TODO: remove after testing)
|
||||
REQUIRE_THROWS(caller.call("dac", {"v_a", "mV"}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("powerdac", "[.detectorintegration][dacs]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
if (det.isVirtualDetectorServer().tsquash(
|
||||
"Inconsistent virtual servers")) {
|
||||
|
||||
// test only get of vchip
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(
|
||||
caller.call("powerdac", {"v_chip", "1700", "mV"}, -1, PUT));
|
||||
REQUIRE_THROWS(
|
||||
caller.call("powerdac", {"v_chip", "mV"}, -1, GET));
|
||||
REQUIRE_NOTHROW(caller.call("powerdac", {"v_chip"}, -1, GET));
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("powerdac", {"v_chip"}, -1, GET));
|
||||
}
|
||||
|
||||
// other power dacs
|
||||
std::vector<std::string> names{"v_a", "v_b", "v_c", "v_d", "v_io"};
|
||||
std::vector<defs::powerIndex> indices{
|
||||
defs::V_POWER_A, defs::V_POWER_B, defs::V_POWER_C,
|
||||
defs::V_POWER_D, defs::V_POWER_IO};
|
||||
for (size_t iPower = 0; iPower < names.size(); ++iPower) {
|
||||
auto prev_val = det.getPowerDAC(indices[iPower]);
|
||||
auto prev_val_power = det.isPowerEnabled(indices[iPower]);
|
||||
|
||||
// this is the first command touching power dacs, should not be
|
||||
// -100
|
||||
REQUIRE(prev_val != -100);
|
||||
REQUIRE(prev_val != -1);
|
||||
REQUIRE(prev_val != 0);
|
||||
|
||||
REQUIRE_THROWS(
|
||||
caller.call("powerdac", {names[iPower], "-2"}, -1, PUT));
|
||||
REQUIRE_THROWS(
|
||||
caller.call("powerdac", {names[iPower], "-100"}, -1, PUT));
|
||||
REQUIRE_THROWS(
|
||||
caller.call("powerdac", {names[iPower], "-1"}, -1, PUT));
|
||||
REQUIRE_THROWS(
|
||||
caller.call("powerdac", {names[iPower], "0"}, -1, PUT));
|
||||
REQUIRE_THROWS(
|
||||
caller.call("powerdac", {names[iPower], "4096"}, -1, PUT));
|
||||
// dont need mV
|
||||
REQUIRE_THROWS(caller.call(
|
||||
"powerdac", {names[iPower], "1200", "mV"}, -1, PUT));
|
||||
REQUIRE_THROWS(
|
||||
caller.call("powerdac", {names[iPower], "mV"}, -1, GET));
|
||||
|
||||
// min
|
||||
if (names[iPower] == "v_io")
|
||||
REQUIRE_THROWS(caller.call(
|
||||
"powerdac", {names[iPower], "1199"}, -1, PUT));
|
||||
else {
|
||||
if (det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(caller.call(
|
||||
"powerdac", {names[iPower], "1040"}, -1, PUT));
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call(
|
||||
"powerdac", {names[iPower], "635"}, -1, PUT));
|
||||
}
|
||||
}
|
||||
// max
|
||||
if (det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(caller.call(
|
||||
"powerdac", {names[iPower], "2662"}, -1, PUT));
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call(
|
||||
"powerdac", {names[iPower], "2469"}, -1, PUT));
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("powerdac", {names[iPower], "1200"}, -1, PUT,
|
||||
oss1);
|
||||
REQUIRE(oss1.str() ==
|
||||
"powerdac " + names[iPower] + " 1200\n");
|
||||
caller.call("powerdac", {names[iPower]}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() ==
|
||||
"powerdac " + names[iPower] + " 1200\n");
|
||||
}
|
||||
{
|
||||
// power name
|
||||
det.setPowerName(indices[iPower],
|
||||
"pwrname_" + names[iPower]);
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("powerdac",
|
||||
{"pwrname_" + names[iPower], "1200"}, -1, PUT,
|
||||
oss1);
|
||||
REQUIRE(oss1.str() ==
|
||||
"powerdac pwrname_" + names[iPower] + " 1200\n");
|
||||
caller.call("powerdac", {"pwrname_" + names[iPower]}, -1,
|
||||
GET, oss2);
|
||||
REQUIRE(oss2.str() ==
|
||||
"powerdac pwrname_" + names[iPower] + " 1200\n");
|
||||
}
|
||||
// trying to set dac when power is on
|
||||
{
|
||||
det.setPowerEnabled(std::vector{indices[iPower]}, true);
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("powerdac", {names[iPower], "1200"}, -1, PUT,
|
||||
oss1);
|
||||
REQUIRE(oss1.str() ==
|
||||
"powerdac " + names[iPower] + " 1200\n");
|
||||
caller.call("powerdac", {names[iPower]}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() ==
|
||||
"powerdac " + names[iPower] + " 1200\n");
|
||||
}
|
||||
// Reset all dacs to previous value
|
||||
det.setPowerDAC(indices[iPower], prev_val);
|
||||
det.setPowerEnabled(std::vector{indices[iPower]},
|
||||
prev_val_power);
|
||||
}
|
||||
// all
|
||||
{
|
||||
int prev_val[5] = {0};
|
||||
int prev_power_val[5] = {0};
|
||||
for (size_t iPower = 0; iPower < names.size(); ++iPower) {
|
||||
prev_val[iPower] = det.getPowerDAC(indices[iPower]);
|
||||
prev_power_val[iPower] =
|
||||
det.isPowerEnabled(indices[iPower]);
|
||||
}
|
||||
|
||||
// all off
|
||||
REQUIRE_NOTHROW(caller.call("power", {"all", "off"}, -1, PUT));
|
||||
for (size_t iPower = 0; iPower < names.size(); ++iPower) {
|
||||
REQUIRE(det.isPowerEnabled(indices[iPower]) == false);
|
||||
}
|
||||
|
||||
// all on
|
||||
REQUIRE_NOTHROW(caller.call("power", {"all", "on"}, -1, PUT));
|
||||
for (size_t iPower = 0; iPower < names.size(); ++iPower) {
|
||||
REQUIRE(det.isPowerEnabled(indices[iPower]) == true);
|
||||
}
|
||||
|
||||
// all off
|
||||
REQUIRE_NOTHROW(caller.call("power", {"all", "off"}, -1, PUT));
|
||||
for (size_t iPower = 0; iPower < names.size(); ++iPower) {
|
||||
REQUIRE(det.isPowerEnabled(indices[iPower]) == false);
|
||||
}
|
||||
|
||||
// reset it to previous value
|
||||
for (size_t iPower = 0; iPower < names.size(); ++iPower) {
|
||||
det.setPowerDAC(indices[iPower], prev_val[iPower]);
|
||||
det.setPowerEnabled({indices[iPower]},
|
||||
prev_power_val[iPower]);
|
||||
}
|
||||
}
|
||||
// vchip val
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
const int min_vchip_val = 1673;
|
||||
int prev_val[5] = {0};
|
||||
int prev_power_val[5] = {0};
|
||||
for (size_t iPower = 0; iPower < names.size(); ++iPower) {
|
||||
prev_val[iPower] = det.getPowerDAC(indices[iPower]);
|
||||
prev_power_val[iPower] =
|
||||
det.isPowerEnabled(indices[iPower]);
|
||||
}
|
||||
|
||||
// all off, vchip = min
|
||||
REQUIRE_NOTHROW(caller.call("power", {"all", "off"}, -1, PUT));
|
||||
REQUIRE(det.getPowerDAC(defs::V_POWER_CHIP) == min_vchip_val);
|
||||
|
||||
// change dacs
|
||||
REQUIRE_NOTHROW(
|
||||
caller.call("powerdac", {"v_a", "1500"}, -1, PUT));
|
||||
REQUIRE_NOTHROW(
|
||||
caller.call("powerdac", {"v_b", "1200"}, -1, PUT));
|
||||
REQUIRE_NOTHROW(
|
||||
caller.call("powerdac", {"v_c", "1200"}, -1, PUT));
|
||||
REQUIRE_NOTHROW(
|
||||
caller.call("powerdac", {"v_d", "1200"}, -1, PUT));
|
||||
REQUIRE_NOTHROW(
|
||||
caller.call("powerdac", {"v_io", "1200"}, -1, PUT));
|
||||
// vchip = min
|
||||
REQUIRE(det.getPowerDAC(defs::V_POWER_CHIP) == min_vchip_val);
|
||||
|
||||
// all on, vchip changes
|
||||
REQUIRE_NOTHROW(caller.call("power", {"all", "on"}, -1, PUT));
|
||||
REQUIRE(det.getPowerDAC(defs::V_POWER_CHIP) == 1700);
|
||||
|
||||
// change dac, vchip changes to max + 200
|
||||
REQUIRE_NOTHROW(
|
||||
caller.call("powerdac", {"v_a", "1700"}, -1, PUT));
|
||||
REQUIRE(det.getPowerDAC(defs::V_POWER_CHIP) == 1900);
|
||||
REQUIRE_NOTHROW(
|
||||
caller.call("powerdac", {"v_b", "1500"}, -1, PUT));
|
||||
REQUIRE(det.getPowerDAC(defs::V_POWER_CHIP) == 1900);
|
||||
|
||||
// switch off v_a, vchip = max + 200 of those enabled
|
||||
REQUIRE_NOTHROW(caller.call("power", {"v_a", "off"}, -1, PUT));
|
||||
REQUIRE(det.getPowerDAC(defs::V_POWER_CHIP) == 1700);
|
||||
|
||||
// all off, vchip = min
|
||||
REQUIRE_NOTHROW(caller.call("power", {"all", "off"}, -1, PUT));
|
||||
REQUIRE(det.getPowerDAC(defs::V_POWER_CHIP) == min_vchip_val);
|
||||
|
||||
// reset it to previous value
|
||||
for (size_t iPower = 0; iPower < names.size(); ++iPower) {
|
||||
det.setPowerDAC(indices[iPower], prev_val[iPower]);
|
||||
det.setPowerEnabled({indices[iPower]},
|
||||
prev_power_val[iPower]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("powerdac", {"v_a"}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -815,32 +1037,32 @@ TEST_CASE("v_limit", "[.detectorintegration]") {
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_LIMIT);
|
||||
auto prev_val = det.getVoltageLimit();
|
||||
auto prev_dac_val = det.getDAC(defs::DAC_0, false);
|
||||
auto prev_power_dac_val = det.getPowerDAC(defs::V_POWER_A);
|
||||
|
||||
REQUIRE_THROWS(caller.call("v_limit", {"1200", "mV"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("v_limit", {"-100"}, -1, PUT));
|
||||
{
|
||||
std::ostringstream oss, oss2;
|
||||
caller.call("v_limit", {"0"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "v_limit 0\n");
|
||||
caller.call("v_limit", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "v_limit 0\n");
|
||||
REQUIRE_NOTHROW(caller.call("dac", {"0", "1200", "mV"}, -1, PUT));
|
||||
REQUIRE_NOTHROW(caller.call("powerdac", {"v_a", "1200"}, -1, PUT));
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("v_limit", {"1500"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "v_limit 1500\n");
|
||||
REQUIRE_THROWS(caller.call("dac", {"0", "1501", "mV"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("powerdac", {"v_a", "1501"}, -1, PUT));
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("v_limit", {"0"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "v_limit 0\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("v_limit", {"0"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "v_limit 0\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("v_limit", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "v_limit 0\n");
|
||||
}
|
||||
det.setVoltageLimit(prev_val);
|
||||
det.setPowerDAC(defs::V_POWER_A, prev_power_dac_val);
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
if (prev_val[i] == -100) {
|
||||
prev_val[i] = 0;
|
||||
}
|
||||
det.setPower(defs::V_LIMIT, prev_val[i], {i});
|
||||
det.setDAC(defs::DAC_0, prev_dac_val[i], false, {i});
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("v_limit", {}, -1, GET));
|
||||
@@ -1116,102 +1338,119 @@ TEST_CASE("dbitclk", "[.detectorintegration]") {
|
||||
TEST_CASE("v_abcd", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
std::vector<std::string> cmds{"v_a", "v_b", "v_c", "v_d"};
|
||||
std::vector<defs::dacIndex> indices{defs::V_POWER_A, defs::V_POWER_B,
|
||||
defs::V_POWER_C, defs::V_POWER_D};
|
||||
|
||||
if (det.isVirtualDetectorServer().tsquash("Inconsistent virtual servers")) {
|
||||
cmds.push_back("v_io");
|
||||
indices.push_back(defs::V_POWER_IO);
|
||||
}
|
||||
// removed in favor of "dac" and "power" commands
|
||||
std::vector<std::string> cmds{"v_a", "v_b", "v_c", "v_d", "v_io", "v_chip"};
|
||||
|
||||
for (size_t i = 0; i < cmds.size(); ++i) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(indices[i]);
|
||||
// this is the first command touching power dacs, should not be
|
||||
// -100
|
||||
if (det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE(prev_val.any(-100) == false);
|
||||
REQUIRE(prev_val.any(-1) == false);
|
||||
}
|
||||
REQUIRE_THROWS(caller.call(cmds[i], {"-2"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call(cmds[i], {"-100"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call(cmds[i], {"-1"}, -1, PUT));
|
||||
if (cmds[i] == "v_io")
|
||||
REQUIRE_THROWS(caller.call(cmds[i], {"1199"}, -1, PUT)); // min
|
||||
else {
|
||||
if (det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(
|
||||
caller.call(cmds[i], {"1040"}, -1, PUT)); // min v_a
|
||||
} else {
|
||||
REQUIRE_THROWS(
|
||||
caller.call(cmds[i], {"635"}, -1, PUT)); // min v_a
|
||||
}
|
||||
}
|
||||
if (det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(caller.call(cmds[i], {"2662"}, -1, PUT)); // max
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call(cmds[i], {"2469"}, -1, PUT)); // max
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call(cmds[i], {"0"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == cmds[i] + " 0\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call(cmds[i], {"1200"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == cmds[i] + " 1200\n");
|
||||
caller.call(cmds[i], {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == cmds[i] + " 1200\n");
|
||||
}
|
||||
{
|
||||
auto vlimit = det.getDAC(defs::V_LIMIT)[0];
|
||||
det.setDAC(defs::V_LIMIT, 1500, true, {0});
|
||||
REQUIRE_NOTHROW(caller.call(cmds[i], {"1200"}, -1, PUT));
|
||||
if (vlimit < 0)
|
||||
vlimit = 0;
|
||||
det.setDAC(defs::V_LIMIT, vlimit, true, {0});
|
||||
}
|
||||
for (int imod = 0; imod != det.size(); ++imod) {
|
||||
if (det_type == defs::XILINX_CHIPTESTBOARD &&
|
||||
prev_val[imod] == -100) {
|
||||
prev_val[imod] = 0;
|
||||
}
|
||||
det.setPower(indices[i], prev_val[imod], {imod});
|
||||
}
|
||||
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call(cmds[i], {}, -1, GET));
|
||||
try {
|
||||
caller.call(cmds[i], {}, -1, GET);
|
||||
} catch (const std::exception &e) {
|
||||
REQUIRE(std::string(e.what()).find(
|
||||
"removed and is no longer available") !=
|
||||
std::string::npos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("v_io", "[.detectorintegration]") {
|
||||
TEST_CASE("power", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
// better not to play with setting it
|
||||
REQUIRE_NOTHROW(caller.call("v_io", {}, -1, GET));
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("v_io", {}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("v_chip", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
// better not to play with setting it
|
||||
REQUIRE_NOTHROW(caller.call("v_chip", {}, -1, GET));
|
||||
std::vector<std::string> cmds{"v_a", "v_b", "v_c", "v_d", "v_io"};
|
||||
auto indices = det.getPowerList();
|
||||
std::vector<bool> prev_val(cmds.size());
|
||||
for (size_t iPower = 0; iPower < cmds.size(); ++iPower) {
|
||||
prev_val[iPower] = det.isPowerEnabled(indices[iPower]);
|
||||
}
|
||||
|
||||
REQUIRE_THROWS(caller.call("power", {"vrandom"}, -1, GET));
|
||||
REQUIRE_THROWS(caller.call("power", {"v_chip"}, -1, GET));
|
||||
REQUIRE_THROWS(caller.call("power", {"on", "v_a"}, -1, PUT));
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("power", {"v_a", "on"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "power [v_a] on\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("power", {"v_a"}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "power v_a on\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("power", {"v_a", "v_c", "on"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "power [v_a, v_c] on\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2, oss3;
|
||||
caller.call("power", {"v_a", "v_b", "off"}, -1, PUT);
|
||||
caller.call("power", {"v_a"}, -1, GET, oss1);
|
||||
caller.call("power", {"v_b"}, -1, GET, oss2);
|
||||
caller.call("power", {"v_c"}, -1, GET, oss3);
|
||||
REQUIRE(oss1.str() == "power v_a off\n");
|
||||
REQUIRE(oss2.str() == "power v_b off\n");
|
||||
REQUIRE(oss3.str() == "power v_c on\n");
|
||||
}
|
||||
{
|
||||
// power name
|
||||
std::ostringstream oss1;
|
||||
det.setPowerName(defs::V_POWER_B, "pwrname_v_b");
|
||||
det.setPowerName(defs::V_POWER_C, "pwrname_v_c");
|
||||
det.setPowerName(defs::V_POWER_D, "pwrname_v_d");
|
||||
caller.call("power", {"pwrname_v_c", "pwrname_v_d", "on"}, -1, PUT,
|
||||
oss1);
|
||||
std::ostringstream oss[8];
|
||||
caller.call("power", {"v_a"}, -1, GET, oss[0]);
|
||||
caller.call("power", {"pwrname_v_b"}, -1, GET, oss[1]);
|
||||
caller.call("power", {"v_b"}, -1, GET, oss[2]);
|
||||
caller.call("power", {"pwrname_v_c"}, -1, GET, oss[3]);
|
||||
caller.call("power", {"v_c"}, -1, GET, oss[4]);
|
||||
caller.call("power", {"pwrname_v_d"}, -1, GET, oss[5]);
|
||||
caller.call("power", {"v_d"}, -1, GET, oss[6]);
|
||||
caller.call("power", {"v_io"}, -1, GET, oss[7]);
|
||||
REQUIRE(oss[0].str() == "power v_a off\n");
|
||||
REQUIRE(oss[1].str() == "power pwrname_v_b off\n");
|
||||
REQUIRE(oss[2].str() == "power v_b off\n");
|
||||
REQUIRE(oss[3].str() == "power pwrname_v_c on\n");
|
||||
REQUIRE(oss[4].str() == "power v_c on\n");
|
||||
REQUIRE(oss[5].str() == "power pwrname_v_d on\n");
|
||||
REQUIRE(oss[6].str() == "power v_d on\n");
|
||||
REQUIRE(oss[7].str() == "power v_io off\n");
|
||||
}
|
||||
// all
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("power", {"all"}, -1, GET, oss);
|
||||
REQUIRE(
|
||||
oss.str() ==
|
||||
"power {v_a: off, v_b: off, v_c: on, v_d: on, v_io: off}\n");
|
||||
}
|
||||
{ // power on all
|
||||
caller.call("power", {"all", "on"}, -1, PUT);
|
||||
std::ostringstream oss1, oss2, oss3, oss4, oss5;
|
||||
caller.call("power", {"v_a"}, -1, GET, oss1);
|
||||
caller.call("power", {"v_b"}, -1, GET, oss2);
|
||||
caller.call("power", {"v_c"}, -1, GET, oss3);
|
||||
caller.call("power", {"v_d"}, -1, GET, oss4);
|
||||
caller.call("power", {"v_io"}, -1, GET, oss5);
|
||||
REQUIRE(oss1.str() == "power v_a on\n");
|
||||
REQUIRE(oss2.str() == "power v_b on\n");
|
||||
REQUIRE(oss3.str() == "power v_c on\n");
|
||||
REQUIRE(oss4.str() == "power v_d on\n");
|
||||
REQUIRE(oss5.str() == "power v_io on\n");
|
||||
std::ostringstream oss;
|
||||
caller.call("power", {"all"}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "power all on\n");
|
||||
}
|
||||
for (size_t iPower = 0; iPower < cmds.size(); ++iPower) {
|
||||
det.setPowerEnabled(std::vector{indices[iPower]}, prev_val[iPower]);
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("v_chip", {}, -1, GET));
|
||||
REQUIRE_THROWS(caller.call("power", {"v_a"}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,28 +33,34 @@ void test_valid_port_caller(const std::string &command,
|
||||
}
|
||||
|
||||
void test_dac_caller(defs::dacIndex index, const std::string &dacname,
|
||||
int dacvalue) {
|
||||
int dacvalue, bool mV) {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
std::ostringstream oss_set, oss_get;
|
||||
auto dacstr = std::to_string(dacvalue);
|
||||
std::string dac = dacname;
|
||||
auto value = std::to_string(dacvalue);
|
||||
auto previous = det.getDAC(index, false);
|
||||
// chip test board
|
||||
if (dacname == "dac") {
|
||||
auto dacIndexstr = std::to_string(static_cast<int>(index));
|
||||
caller.call(dacname, {dacIndexstr, dacstr}, -1, PUT, oss_set);
|
||||
REQUIRE(oss_set.str() ==
|
||||
dacname + " " + dacIndexstr + " " + dacstr + "\n");
|
||||
caller.call(dacname, {dacIndexstr}, -1, GET, oss_get);
|
||||
REQUIRE(oss_get.str() ==
|
||||
dacname + " " + dacIndexstr + " " + dacstr + "\n");
|
||||
dac = std::to_string(static_cast<int>(index));
|
||||
}
|
||||
// other detectors
|
||||
else {
|
||||
caller.call("dac", {dacname, dacstr}, -1, PUT, oss_set);
|
||||
REQUIRE(oss_set.str() == "dac " + dacname + " " + dacstr + "\n");
|
||||
caller.call("dac", {dacname}, -1, GET, oss_get);
|
||||
REQUIRE(oss_get.str() == "dac " + dacname + " " + dacstr + "\n");
|
||||
{
|
||||
std::ostringstream oss;
|
||||
std::vector<std::string> args = {dac, value};
|
||||
if (mV)
|
||||
args.push_back("mV");
|
||||
std::cout << "args:" << ToString(args) << std::endl;
|
||||
caller.call("dac", args, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == std::string("dac ") + dac + " " + value +
|
||||
(mV ? " mV\n" : "\n"));
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
std::vector<std::string> args = {dac};
|
||||
if (mV)
|
||||
args.push_back("mV");
|
||||
caller.call("dac", args, -1, GET, oss);
|
||||
REQUIRE(oss.str() ==
|
||||
"dac " + dac + " " + value + (mV ? " mV\n" : "\n"));
|
||||
}
|
||||
// Reset all dacs to previous value
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
|
||||
@@ -78,7 +78,7 @@ void test_valid_port_caller(const std::string &command,
|
||||
int detector_id, int action);
|
||||
|
||||
void test_dac_caller(slsDetectorDefs::dacIndex index,
|
||||
const std::string &dacname, int dacvalue);
|
||||
const std::string &dacname, int dacvalue, bool mV = false);
|
||||
void test_onchip_dac_caller(slsDetectorDefs::dacIndex index,
|
||||
const std::string &dacname, int dacvalue);
|
||||
|
||||
|
||||
@@ -19,17 +19,11 @@ using test::PUT;
|
||||
|
||||
/* dacs */
|
||||
|
||||
// not implemented at the moment
|
||||
TEST_CASE("configtransceiver", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(caller.call("configtransceiver", {}, -1, GET));
|
||||
REQUIRE_NOTHROW(caller.call("configtransceiver", {}, -1, PUT));
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("configtransceiver", {}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("configtransceiver", {}, -1, GET));
|
||||
}
|
||||
REQUIRE_THROWS(caller.call("configtransceiver", {}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("configtransceiver", {}, -1, GET));
|
||||
}
|
||||
} // namespace sls
|
||||
|
||||
@@ -1547,9 +1547,9 @@ TEST_CASE("powerchip", "[.detectorintegration]") {
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
|
||||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2 ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPowerChip();
|
||||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
|
||||
auto prev_val =
|
||||
det.getPowerChip().tsquash("Inconsistent power chip values");
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("powerchip", {"1"}, -1, PUT, oss);
|
||||
@@ -1583,10 +1583,7 @@ TEST_CASE("powerchip", "[.detectorintegration]") {
|
||||
REQUIRE(oss.str() == "powerchip 0\n");
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setPowerChip(prev_val[i], {i});
|
||||
if (det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
det.configureTransceiver();
|
||||
}
|
||||
det.setPowerChip(prev_val, {i});
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("powerchip", {}, -1, GET));
|
||||
|
||||
Reference in New Issue
Block a user