mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-09 14:20:03 +02:00
merge from mythen3 and gotthard2
This commit is contained in:
commit
41035808e9
@ -10,7 +10,7 @@ pycmd = dir(Detector)+dir(Eiger)+dir(Ctb)
|
||||
|
||||
pycmd += ['vrf', 'vtr', 'vrs', 'vtgstv', 'vsvn', 'vtrim',
|
||||
'vsvp', 'vth1', 'vth2', 'vth3', 'vshaper', 'vshaperneg', 'rxb_rb',
|
||||
'rxb_lb', 'vref_prech', 'vref_restore', 'vref_cds',
|
||||
'rxb_lb', 'vref_prech', 'vref_rstore', 'vref_cds',
|
||||
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
|
||||
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
|
||||
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
|
||||
|
@ -9,19 +9,7 @@ enums.cpp
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
|
||||
# def remove_comments(text):
|
||||
# def replacer(match):
|
||||
# s = match.group(0)
|
||||
# if s.startswith('/'):
|
||||
# return " " # note: a space and not an empty string
|
||||
# else:
|
||||
# return s
|
||||
# pattern = re.compile(
|
||||
# r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
|
||||
# re.DOTALL | re.MULTILINE
|
||||
# )
|
||||
# return re.sub(pattern, replacer, text)
|
||||
from parse import remove_comments
|
||||
|
||||
def extract_enums(lines):
|
||||
line_iter = iter(lines)
|
||||
|
@ -74,9 +74,12 @@ void init_det(py::module &m) {
|
||||
py::arg() = Positions{})
|
||||
.def("getNumberOfTriggersLeft", &Detector::getNumberOfTriggersLeft,
|
||||
py::arg() = Positions{})
|
||||
.def("getPeriodLeft", &Detector::getPeriodLeft, py::arg() = Positions{})
|
||||
.def("getDelayAfterTriggerLeft", &Detector::getDelayAfterTriggerLeft,
|
||||
py::arg() = Positions{})
|
||||
.def("getPeriodLeft", &Detector::getPeriodLeft, py::arg() = Positions{})
|
||||
.def("getTimingMode", &Detector::getTimingMode, py::arg() = Positions{})
|
||||
.def("setTimingMode", &Detector::setTimingMode, py::arg(),
|
||||
py::arg() = Positions{})
|
||||
.def("getSpeed", &Detector::getSpeed, py::arg() = Positions{})
|
||||
.def("setSpeed", &Detector::setSpeed, py::arg(),
|
||||
py::arg() = Positions{})
|
||||
@ -109,6 +112,9 @@ void init_det(py::module &m) {
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getHighVoltage", &Detector::getHighVoltage,
|
||||
py::arg() = Positions{})
|
||||
.def("getPowerChip", &Detector::getPowerChip, py::arg() = Positions{})
|
||||
.def("setPowerChip", &Detector::setPowerChip, py::arg(),
|
||||
py::arg() = Positions{})
|
||||
.def("setHighVoltage", &Detector::setHighVoltage, py::arg(),
|
||||
py::arg() = Positions{})
|
||||
.def("getTemperature", &Detector::getTemperature, py::arg(),
|
||||
@ -121,9 +127,6 @@ void init_det(py::module &m) {
|
||||
py::arg() = Positions{})
|
||||
.def("setOnChipDAC", &Detector::setOnChipDAC, py::arg(), py::arg(),
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getTimingMode", &Detector::getTimingMode, py::arg() = Positions{})
|
||||
.def("setTimingMode", &Detector::setTimingMode, py::arg(),
|
||||
py::arg() = Positions{})
|
||||
.def("acquire", &Detector::acquire)
|
||||
.def("clearAcquiringFlag", &Detector::clearAcquiringFlag)
|
||||
.def("startReceiver", &Detector::startReceiver)
|
||||
@ -395,9 +398,6 @@ void init_det(py::module &m) {
|
||||
py::arg() = Positions{})
|
||||
.def("resetTemperatureEvent", &Detector::resetTemperatureEvent,
|
||||
py::arg() = Positions{})
|
||||
.def("getPowerChip", &Detector::getPowerChip, py::arg() = Positions{})
|
||||
.def("setPowerChip", &Detector::setPowerChip, py::arg(),
|
||||
py::arg() = Positions{})
|
||||
.def("getAutoCompDisable", &Detector::getAutoCompDisable,
|
||||
py::arg() = Positions{})
|
||||
.def("setAutoCompDisable", &Detector::setAutoCompDisable, py::arg(),
|
||||
@ -438,9 +438,9 @@ void init_det(py::module &m) {
|
||||
py::arg(), py::arg(), py::arg() = Positions{})
|
||||
.def("setVetoReference", &Detector::setVetoReference, py::arg(),
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getBurstMode", &Detector::getBurstMode, py::arg() = Positions{})
|
||||
.def("setBurstMode", &Detector::setBurstMode, py::arg(),
|
||||
py::arg() = Positions{})
|
||||
.def("getBurstMode", &Detector::getBurstMode, py::arg() = Positions{})
|
||||
.def("getCounterMask", &Detector::getCounterMask,
|
||||
py::arg() = Positions{})
|
||||
.def("setCounterMask", &Detector::setCounterMask, py::arg(),
|
||||
|
@ -169,7 +169,7 @@ void init_enums(py::module &m) {
|
||||
.value("VB_COMP_FE", slsDetectorDefs::dacIndex::VB_COMP_FE)
|
||||
.value("VB_COMP_ADC", slsDetectorDefs::dacIndex::VB_COMP_ADC)
|
||||
.value("VCOM_CDS", slsDetectorDefs::dacIndex::VCOM_CDS)
|
||||
.value("VREF_RESTORE", slsDetectorDefs::dacIndex::VREF_RESTORE)
|
||||
.value("VREF_RSTORE", slsDetectorDefs::dacIndex::VREF_RSTORE)
|
||||
.value("VB_OPA_1ST", slsDetectorDefs::dacIndex::VB_OPA_1ST)
|
||||
.value("VREF_COMP_FE", slsDetectorDefs::dacIndex::VREF_COMP_FE)
|
||||
.value("VCOM_ADC1", slsDetectorDefs::dacIndex::VCOM_ADC1)
|
||||
@ -278,4 +278,10 @@ void init_enums(py::module &m) {
|
||||
slsDetectorDefs::detectorModeType::INTERPOLATING)
|
||||
.value("ANALOG", slsDetectorDefs::detectorModeType::ANALOG)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::burstMode>(Defs, "burstMode")
|
||||
.value("BURST_OFF", slsDetectorDefs::burstMode::BURST_OFF)
|
||||
.value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL)
|
||||
.value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL)
|
||||
.export_values();
|
||||
}
|
||||
|
Binary file not shown.
@ -56,9 +56,9 @@ uint32_t adcEnableMask_1g = 0;
|
||||
uint8_t adcEnableMask_10g = 0;
|
||||
|
||||
|
||||
int32_t clkPhase[NUM_CLOCKS] = {0, 0, 0, 0};
|
||||
int32_t clkPhase[NUM_CLOCKS] = {};
|
||||
uint32_t clkFrequency[NUM_CLOCKS] = {40, 20, 20, 200};
|
||||
int dacValues[NDAC] = {0};
|
||||
int dacValues[NDAC] = {};
|
||||
// software limit that depends on the current chip on the ctb
|
||||
int vLimit = 0;
|
||||
int highvoltage = 0;
|
||||
@ -1418,22 +1418,18 @@ int setHighVoltage(int val){
|
||||
|
||||
|
||||
void setTiming( enum timingMode arg){
|
||||
|
||||
if(arg != GET_TIMING_MODE){
|
||||
switch((int)arg){
|
||||
case AUTO_TIMING:
|
||||
FILE_LOG(logINFO, ("Set Timing: Auto\n"));
|
||||
bus_w(EXT_SIGNAL_REG, bus_r(EXT_SIGNAL_REG) & ~EXT_SIGNAL_MSK);
|
||||
break;
|
||||
case TRIGGER_EXPOSURE:
|
||||
FILE_LOG(logINFO, ("Set Timing: Trigger\n"));
|
||||
bus_w(EXT_SIGNAL_REG, bus_r(EXT_SIGNAL_REG) | EXT_SIGNAL_MSK);
|
||||
break;
|
||||
default:
|
||||
FILE_LOG(logERROR, ("Unknown timing mode %d\n", arg));
|
||||
return;
|
||||
}
|
||||
}
|
||||
switch(arg){
|
||||
case AUTO_TIMING:
|
||||
FILE_LOG(logINFO, ("Set Timing: Auto\n"));
|
||||
bus_w(EXT_SIGNAL_REG, bus_r(EXT_SIGNAL_REG) & ~EXT_SIGNAL_MSK);
|
||||
break;
|
||||
case TRIGGER_EXPOSURE:
|
||||
FILE_LOG(logINFO, ("Set Timing: Trigger\n"));
|
||||
bus_w(EXT_SIGNAL_REG, bus_r(EXT_SIGNAL_REG) | EXT_SIGNAL_MSK);
|
||||
break;
|
||||
default:
|
||||
FILE_LOG(logERROR, ("Unknown timing mode %d\n", arg));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2559,7 +2555,7 @@ int calculateDataBytes(){
|
||||
return dataBytes;
|
||||
}
|
||||
|
||||
int getTotalNumberOfChannels(){return ((int)getNumberOfChannelsPerChip() * (int)getNumberOfChips());}
|
||||
int getTotalNumberOfChannels() {return (getNumberOfChannelsPerChip() * getNumberOfChips());}
|
||||
int getNumberOfChips(){return NCHIP;}
|
||||
int getNumberOfDACs(){return NDAC;}
|
||||
int getNumberOfChannelsPerChip(){return NCHAN;}
|
||||
|
Binary file not shown.
@ -1106,36 +1106,46 @@ int setHighVoltage(int val) {
|
||||
/* parameters - timing, extsig */
|
||||
|
||||
void setTiming( enum timingMode arg) {
|
||||
enum timingMode ret=GET_TIMING_MODE;
|
||||
if (arg != GET_TIMING_MODE) {
|
||||
switch((int)arg) {
|
||||
case AUTO_TIMING: ret = 0; break;
|
||||
case TRIGGER_EXPOSURE: ret = 2; break;
|
||||
case BURST_TRIGGER: ret = 1; break;
|
||||
case GATED: ret = 3; break;
|
||||
}
|
||||
FILE_LOG(logDEBUG1, ("Setting Triggering Mode: %d\n", (int)ret));
|
||||
#ifndef VIRTUAL
|
||||
if (Feb_Control_SetTriggerMode(ret,1))
|
||||
#endif
|
||||
eiger_triggermode = ret;
|
||||
int ret = 0;
|
||||
switch(arg) {
|
||||
case AUTO_TIMING:
|
||||
ret = 0;
|
||||
break;
|
||||
case TRIGGER_EXPOSURE:
|
||||
ret = 2;
|
||||
break;
|
||||
case BURST_TRIGGER:
|
||||
ret = 1;
|
||||
break;
|
||||
case GATED:
|
||||
ret = 3;
|
||||
break;
|
||||
default:
|
||||
FILE_LOG(logERROR, ("Unknown timing mode %d\n", arg));
|
||||
return;
|
||||
}
|
||||
FILE_LOG(logDEBUG1, ("Setting Triggering Mode: %d\n", (int)ret));
|
||||
#ifndef VIRTUAL
|
||||
if (Feb_Control_SetTriggerMode(ret,1))
|
||||
#endif
|
||||
eiger_triggermode = ret;
|
||||
}
|
||||
|
||||
|
||||
enum timingMode getTiming() {
|
||||
enum timingMode ret = GET_TIMING_MODE;
|
||||
ret = eiger_triggermode;
|
||||
switch((int)ret) {
|
||||
case 0: ret = AUTO_TIMING; break;
|
||||
case 2: ret = TRIGGER_EXPOSURE; break;
|
||||
case 1: ret = BURST_TRIGGER; break;
|
||||
case 3: ret = GATED; break;
|
||||
switch(eiger_triggermode) {
|
||||
case 0:
|
||||
return AUTO_TIMING;
|
||||
case 2:
|
||||
return TRIGGER_EXPOSURE;
|
||||
case 1:
|
||||
return BURST_TRIGGER;
|
||||
case 3:
|
||||
return GATED;
|
||||
default:
|
||||
FILE_LOG(logERROR, ("Unknown trigger mode found %d\n", ret));
|
||||
ret = 0;
|
||||
FILE_LOG(logERROR, ("Unknown trigger mode found %d\n", eiger_triggermode));
|
||||
return GET_TIMING_MODE;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -2041,7 +2051,7 @@ int calculateDataBytes() {
|
||||
|
||||
|
||||
|
||||
int getTotalNumberOfChannels() {return ((int)getNumberOfChannelsPerChip() * (int)getNumberOfChips());}
|
||||
int getTotalNumberOfChannels() {return (getNumberOfChannelsPerChip() * getNumberOfChips());}
|
||||
int getNumberOfChips() {return NCHIP;}
|
||||
int getNumberOfDACs() {return NDAC;}
|
||||
int getNumberOfChannelsPerChip() {return NCHAN;}
|
||||
|
@ -22,7 +22,7 @@ target_include_directories(gotthard2DetectorServer_virtual
|
||||
)
|
||||
|
||||
target_compile_definitions(gotthard2DetectorServer_virtual
|
||||
PUBLIC GOTTHARD2D VIRTUAL STOP_SERVER
|
||||
PUBLIC GOTTHARD2D VIRTUAL STOP_SERVER DEBUG1
|
||||
)
|
||||
|
||||
target_link_libraries(gotthard2DetectorServer_virtual
|
||||
|
@ -14,13 +14,33 @@
|
||||
|
||||
/* Base addresses 0x1806 0000 ---------------------------------------------*/
|
||||
/* General purpose control and status registers */
|
||||
#define BASE_CONTROL (0x0000)
|
||||
/* Acquisition? TODO */
|
||||
#define BASE_ACQUISITION (0x0200)
|
||||
#define BASE_CONTROL (0x0000) // 0x1806_0000 - 0x1806_00FF
|
||||
// https://git.psi.ch/sls_detectors_firmware/gotthard_II_mcb/blob/master/code/hdl/ctrl/ctrl.vhd
|
||||
|
||||
/* ASIC Control */
|
||||
#define BASE_ASIC (0x0100) // 0x1806_0100 - 0x1806_011F
|
||||
// https://git.psi.ch/sls_detectors_firmware/gotthard_II_mcb/blob/master/code/hdl/asic/asic_ctrl.vhd
|
||||
|
||||
/* ASIC Digital Interface. Data recovery core */
|
||||
#define BASE_ADIF (0x0120) // 0x1806_0120 - 0x1806_012F
|
||||
// https://git.psi.ch/sls_detectors_firmware/gotthard_II_mcb/blob/master/code/hdl/adif/adif_ctrl.vhd
|
||||
|
||||
/* Formatting of data core */
|
||||
#define BASE_FMT (0x0130) // 0x1806_0130 - 0x1806_013F
|
||||
|
||||
/* Packetizer */
|
||||
#define BASE_PKT (0x0140) // 0x1806_0140 - 0x1806_014F
|
||||
// https://git.psi.ch/sls_detectors_firmware/gotthard_II_mcb/blob/master/code/hdl/pkt/pkt_ctrl.vhd
|
||||
|
||||
/* Flow control and status registers */
|
||||
#define BASE_FLOW_CONTROL (0x00200) // 0x1806_0200 - 0x1806_02FF
|
||||
// https://git.psi.ch/sls_detectors_firmware/vhdl_library/blob/f37608230b4721661f29aacc20124555705ee705/flow/flow_ctrl.vhd
|
||||
|
||||
/* UDP datagram generator */
|
||||
#define BASE_UDP_RAM (0x01000) // 0x1806_1000 - 0x1806_1FFF
|
||||
|
||||
|
||||
|
||||
/* Clock Generation registers ------------------------------------------------------*/
|
||||
#define PLL_RESET_REG (0x00 * REG_OFFSET + BASE_CLK_GENERATION)
|
||||
|
||||
@ -30,6 +50,7 @@
|
||||
#define PLL_RESET_SYSTEM_MSK (0x00000001 << PLL_RESET_SYSTEM_OFST)
|
||||
|
||||
|
||||
|
||||
/* Control registers --------------------------------------------------*/
|
||||
|
||||
/* Module Control Board Serial Number register */
|
||||
@ -61,11 +82,6 @@
|
||||
/* Status register */
|
||||
#define STATUS_REG (0x04 * REG_OFFSET + BASE_CONTROL)
|
||||
|
||||
#ifdef VIRTUAL
|
||||
#define RUN_BUSY_OFST (0)
|
||||
#define RUN_BUSY_MSK (0x00000001 << RUN_BUSY_OFST)
|
||||
#endif
|
||||
|
||||
/* Look at me read only register */
|
||||
#define LOOK_AT_ME_REG (0x05 * REG_OFFSET + BASE_CONTROL)
|
||||
|
||||
@ -88,43 +104,144 @@
|
||||
#define CONTROL_PRPHRL_RST_MSK (0x00000001 << CONTROL_PRPHRL_RST_OFST)
|
||||
#define CONTROL_CLR_ACQSTN_FIFO_OFST (15)
|
||||
#define CONTROL_CLR_ACQSTN_FIFO_MSK (0x00000001 << CONTROL_CLR_ACQSTN_FIFO_OFST)
|
||||
|
||||
/* Pattern IO Control 64 bit register */
|
||||
#define PATTERN_IO_CTRL_LSB_REG (0x22 * REG_OFFSET + BASE_CONTROL)
|
||||
#define PATTERN_IO_CTRL_MSB_REG (0x23 * REG_OFFSET + BASE_CONTROL)
|
||||
#define CONTROL_PWR_CHIP_OFST (31)
|
||||
#define CONTROL_PWR_CHIP_MSK (0x00000001 << CONTROL_PWR_CHIP_OFST)
|
||||
|
||||
/** DTA Offset Register */
|
||||
#define DTA_OFFSET_REG (0x24 * REG_OFFSET + BASE_CONTROL)
|
||||
|
||||
|
||||
|
||||
/* ASIC registers --------------------------------------------------*/
|
||||
|
||||
/* ASIC Config register */
|
||||
#define ASIC_CONFIG_REG (0x00 * REG_OFFSET + BASE_ASIC)
|
||||
|
||||
#define ASIC_CONFIG_RUN_MODE_OFST (0)
|
||||
#define ASIC_CONFIG_RUN_MODE_MSK (0x00000003 << ASIC_CONFIG_RUN_MODE_OFST)
|
||||
#define ASIC_CONFIG_RUN_MODE_INT_BURST_VAL ((0x1 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
||||
#define ASIC_CONFIG_RUN_MODE_CONT_VAL ((0x2 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
||||
#define ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL ((0x3 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
||||
#define ASIC_CONFIG_GAIN_OFST (4)
|
||||
#define ASIC_CONFIG_GAIN_MSK (0x00000003 << ASIC_CONFIG_GAIN_OFST)
|
||||
#define ASIC_CONFIG_DYNAMIC_GAIN_VAL ((0x0 << ASIC_CONFIG_GAIN_OFST) & ASIC_CONFIG_GAIN_MSK)
|
||||
#define ASIC_CONFIG_FIX_GAIN_1_VAL ((0x1 << ASIC_CONFIG_GAIN_OFST) & ASIC_CONFIG_GAIN_MSK)
|
||||
#define ASIC_CONFIG_FIX_GAIN_2_VAL ((0x2 << ASIC_CONFIG_GAIN_OFST) & ASIC_CONFIG_GAIN_MSK)
|
||||
#define ASIC_CONFIG_RESERVED_VAL ((0x3 << ASIC_CONFIG_GAIN_OFST) & ASIC_CONFIG_GAIN_MSK)
|
||||
#define ASIC_CONFIG_RST_DAC_OFST (15)
|
||||
#define ASIC_CONFIG_RST_DAC_MSK (0x00000001 << ASIC_CONFIG_RST_DAC_OFST)
|
||||
#define ASIC_CONFIG_DONE_OFST (31)
|
||||
#define ASIC_CONFIG_DONE_MSK (0x00000001 << ASIC_CONFIG_DONE_OFST)
|
||||
|
||||
/* ASIC Internal Frames Register */
|
||||
#define ASIC_INT_FRAMES_REG (0x01 * REG_OFFSET + BASE_ASIC)
|
||||
|
||||
#define ASIC_INT_FRAMES_OFST (0)
|
||||
#define ASIC_INT_FRAMES_MSK (0x00000FFF << ASIC_INT_FRAMES_OFST)
|
||||
|
||||
/* ASIC Period 64bit Register */
|
||||
#define ASIC_INT_PERIOD_LSB_REG (0x02 * REG_OFFSET + BASE_ASIC)
|
||||
#define ASIC_INT_PERIOD_MSB_REG (0x03 * REG_OFFSET + BASE_ASIC)
|
||||
|
||||
/* ASIC Exptime 64bit Register */
|
||||
#define ASIC_INT_EXPTIME_LSB_REG (0x04 * REG_OFFSET + BASE_ASIC)
|
||||
#define ASIC_INT_EXPTIME_MSB_REG (0x05 * REG_OFFSET + BASE_ASIC)
|
||||
|
||||
|
||||
|
||||
/* Packetizer -------------------------------------------------------------*/
|
||||
|
||||
/* Packetizer Config Register */
|
||||
#define PKT_CONFIG_REG (0x00 * REG_OFFSET + BASE_PKT)
|
||||
|
||||
#define PKT_CONFIG_NRXR_MAX_OFST (0)
|
||||
#define PKT_CONFIG_NRXR_MAX_MSK (0x0000003F << PKT_CONFIG_NRXR_MAX_OFST)
|
||||
#define PKT_CONFIG_RXR_START_ID_OFST (8)
|
||||
#define PKT_CONFIG_RXR_START_ID_MSK (0x0000003F << PKT_CONFIG_RXR_START_ID_OFST)
|
||||
|
||||
/* Module Coordinates Register */
|
||||
#define COORD_0_REG (0x02 * REG_OFFSET + BASE_PKT)
|
||||
#define COORD_ROW_OFST (0)
|
||||
#define COORD_ROW_MSK (0x0000FFFF << COORD_ROW_OFST)
|
||||
#define COORD_COL_OFST (16)
|
||||
#define COORD_COL_MSK (0x0000FFFF << COORD_COL_OFST)
|
||||
|
||||
/* Module ID Register */
|
||||
#define COORD_1_REG (0x03 * REG_OFFSET + BASE_PKT)
|
||||
#define COORD_RESERVED_OFST (0)
|
||||
#define COORD_RESERVED_MSK (0x0000FFFF << COORD_RESERVED_OFST)
|
||||
#define COORD_ID_OFST (16) // Not connected in firmware TODO
|
||||
#define COORD_ID_MSK (0x0000FFFF << COORD_ID_OFST) // Not connected in firmware TODO
|
||||
|
||||
|
||||
/* Flow control registers --------------------------------------------------*/
|
||||
|
||||
/* Flow status Register*/
|
||||
#define FLOW_STATUS_REG (0x00 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
|
||||
#define FLOW_STATUS_RUN_BUSY_OFST (0)
|
||||
#define FLOW_STATUS_RUN_BUSY_MSK (0x00000001 << FLOW_STATUS_RUN_BUSY_OFST)
|
||||
#define FLOW_STATUS_WAIT_FOR_TRGGR_OFST (3)
|
||||
#define FLOW_STATUS_WAIT_FOR_TRGGR_MSK (0x00000001 << FLOW_STATUS_WAIT_FOR_TRGGR_OFST)
|
||||
#define FLOW_STATUS_DLY_BFRE_TRGGR_OFST (4)
|
||||
#define FLOW_STATUS_DLY_BFRE_TRGGR_MSK (0x00000001 << FLOW_STATUS_DLY_BFRE_TRGGR_OFST)
|
||||
#define FLOW_STATUS_FIFO_FULL_OFST (5)
|
||||
#define FLOW_STATUS_FIFO_FULL_MSK (0x00000001 << FLOW_STATUS_FIFO_FULL_OFST)
|
||||
#define FLOW_STATUS_DLY_AFTR_TRGGR_OFST (15)
|
||||
#define FLOW_STATUS_DLY_AFTR_TRGGR_MSK (0x00000001 << FLOW_STATUS_DLY_AFTR_TRGGR_OFST)
|
||||
#define FLOW_STATUS_CSM_BUSY_OFST (17)
|
||||
#define FLOW_STATUS_CSM_BUSY_MSK (0x00000001 << FLOW_STATUS_CSM_BUSY_OFST)
|
||||
|
||||
/* Delay left 64bit Register */
|
||||
#define GET_DELAY_LSB_REG (0x02 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
#define GET_DELAY_MSB_REG (0x03 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
|
||||
/* Acquisition registers --------------------------------------------------*/
|
||||
//TODO
|
||||
/* Triggers left 64bit Register */
|
||||
#define GET_CYCLES_LSB_REG (0x10 + BASE_ACQUISITION)
|
||||
#define GET_CYCLES_MSB_REG (0x14 + BASE_ACQUISITION)
|
||||
#define GET_CYCLES_LSB_REG (0x04 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
#define GET_CYCLES_MSB_REG (0x05 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
|
||||
/* Frames left 64bit Register */
|
||||
#define GET_FRAMES_LSB_REG (0x18 + BASE_ACQUISITION)
|
||||
#define GET_FRAMES_MSB_REG (0x1C + BASE_ACQUISITION)
|
||||
#define GET_FRAMES_LSB_REG (0x06 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
#define GET_FRAMES_MSB_REG (0x07 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
|
||||
/* Period left 64bit Register */
|
||||
#define GET_PERIOD_LSB_REG (0x08 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
#define GET_PERIOD_MSB_REG (0x09 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
|
||||
/* Time from Start 64 bit register */
|
||||
#define TIME_FROM_START_LSB_REG (0x0A * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
#define TIME_FROM_START_MSB_REG (0x0B * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
|
||||
/* Get Frames from Start 64 bit register (frames from last reset using CONTROL_CRST) */
|
||||
#define FRAMES_FROM_START_LSB_REG (0x0C * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
#define FRAMES_FROM_START_MSB_REG (0x0D * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
|
||||
/* Measurement Time 64 bit register (timestamp at a frame start until reset)*/
|
||||
#define START_FRAME_TIME_LSB_REG (0x0E * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
#define START_FRAME_TIME_MSB_REG (0x0F * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
|
||||
/* Delay 64bit Write-register */
|
||||
#define SET_DELAY_LSB_REG (0x88 + BASE_ACQUISITION)
|
||||
#define SET_DELAY_MSB_REG (0x8C + BASE_ACQUISITION)
|
||||
#define SET_DELAY_LSB_REG (0x22 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
#define SET_DELAY_MSB_REG (0x23 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
|
||||
/* Cylces 64bit Write-register */
|
||||
#define SET_CYCLES_LSB_REG (0x90 + BASE_ACQUISITION)
|
||||
#define SET_CYCLES_MSB_REG (0x94 + BASE_ACQUISITION)
|
||||
#define SET_CYCLES_LSB_REG (0x24 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
#define SET_CYCLES_MSB_REG (0x25 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
|
||||
/* Frames 64bit Write-register */
|
||||
#define SET_FRAMES_LSB_REG (0x98 + BASE_ACQUISITION)
|
||||
#define SET_FRAMES_MSB_REG (0x9C + BASE_ACQUISITION)
|
||||
#define SET_FRAMES_LSB_REG (0x26 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
#define SET_FRAMES_MSB_REG (0x27 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
|
||||
/* Period 64bit Write-register */
|
||||
#define SET_PERIOD_LSB_REG (0xA0 + BASE_ACQUISITION)
|
||||
#define SET_PERIOD_MSB_REG (0xA4 + BASE_ACQUISITION)
|
||||
#define SET_PERIOD_LSB_REG (0x28 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
#define SET_PERIOD_MSB_REG (0x29 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
|
||||
/* Exptime 64bit Write-register */
|
||||
#define SET_EXPTIME_LSB_REG (0xA8 + BASE_ACQUISITION)
|
||||
#define SET_EXPTIME_MSB_REG (0xBC + BASE_ACQUISITION)
|
||||
/* External Signal register */
|
||||
#define EXT_SIGNAL_REG (0x30 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
|
||||
#define EXT_SIGNAL_OFST (0)
|
||||
#define EXT_SIGNAL_MSK (0x00000001 << EXT_SIGNAL_OFST)
|
||||
|
||||
/* Trigger Delay 64 bit register */
|
||||
#define SET_TRIGGER_DELAY_LSB_REG (0x32 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
#define SET_TRIGGER_DELAY_MSB_REG (0x33 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||
|
Binary file not shown.
@ -11,7 +11,7 @@ vref_h_adc 2099
|
||||
vb_comp_fe 0
|
||||
vb_comp_adc 0
|
||||
vcom_cds 1400
|
||||
vref_restore 640
|
||||
vref_rstore 640
|
||||
vb_opa_1st 0
|
||||
vref_comp_fe 0
|
||||
vcom_adc1 1400
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -17,22 +17,29 @@
|
||||
#define HV_DRIVER_FILE_NAME ("/etc/devlinks/hvdac")
|
||||
#define DAC_DRIVER_FILE_NAME ("/etc/devlinks/dac")
|
||||
#define ONCHIP_DAC_DRIVER_FILE_NAME ("/etc/devlinks/chipdac")
|
||||
#define TYPE_FILE_NAME ("/etc/devlinks/type")
|
||||
#define CONFIG_FILE ("config.txt")
|
||||
#define DAC_MAX_MV (2048)
|
||||
#define ONCHIP_DAC_MAX_VAL (0x3FF)
|
||||
#define ADU_MAX_VAL (0xFFF)
|
||||
#define ADU_MAX_BITS (12)
|
||||
#define MAX_FRAMES_IN_BURST_MODE (2720)
|
||||
|
||||
#define TYPE_GOTTHARD2_MODULE_VAL (512)
|
||||
#define TYPE_TOLERANCE (10)
|
||||
#define TYPE_NO_MODULE_STARTING_VAL (800)
|
||||
|
||||
/** Default Parameters */
|
||||
#define DEFAULT_BURST_MODE (BURST_INTERNAL)
|
||||
#define DEFAULT_NUM_FRAMES (1)
|
||||
#define DEFAULT_NUM_CYCLES (1)
|
||||
#define DEFAULT_EXPTIME (1 * 1000 * 1000) // 1 ms
|
||||
#define DEFAULT_PERIOD (1 * 1000 * 1000 * 1000) // 1 s
|
||||
#define DEFAULT_DELAY_AFTER_TRIGGER (0)
|
||||
#define DEFAULT_HIGH_VOLTAGE (0)
|
||||
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
||||
#define DEFAULT_SETTINGS (DYNAMICGAIN)
|
||||
#define DEFAULT_READOUT_C0 (144444448) // rdo_clk, 144 MHz
|
||||
#define DEFAULT_READOUT_C1 (288888896) // rdo_x2_clk, 288 MHz
|
||||
#define DEFAULT_READOUT_C1 (144444448) // rdo_x2_clk, 144 MHz
|
||||
#define DEFAULT_SYSTEM_C0 (144444448) // run_clk, 144 MHz
|
||||
#define DEFAULT_SYSTEM_C1 (72222224) // chip_clk, 72 MHz
|
||||
#define DEFAULT_SYSTEM_C2 (18055556) // sync_clk, 18 MHz
|
||||
@ -40,6 +47,7 @@
|
||||
|
||||
/* Firmware Definitions */
|
||||
#define IP_HEADER_SIZE (20)
|
||||
#define FIXED_PLL_FREQUENCY (020000000) // 20MHz
|
||||
#define READOUT_PLL_VCO_FREQ_HZ (866666688) // Hz
|
||||
#define SYSTEM_PLL_VCO_FREQ_HZ (722222240) // Hz
|
||||
|
||||
@ -52,7 +60,7 @@ enum DACINDEX {G2_VREF_H_ADC, /* 0 */ \
|
||||
G2_VB_COMP_FE, /* 2 */ \
|
||||
G2_VB_COMP_ADC, /* 3 */ \
|
||||
G2_VCOM_CDS, /* 4 */ \
|
||||
G2_VREF_RESTORE,/* 5 */ \
|
||||
G2_VREF_RSTORE,/* 5 */ \
|
||||
G2_VB_OPA_1ST, /* 6 */ \
|
||||
G2_VREF_COMP_FE,/* 7 */ \
|
||||
G2_VCOM_ADC1, /* 8 */ \
|
||||
@ -64,7 +72,7 @@ enum DACINDEX {G2_VREF_H_ADC, /* 0 */ \
|
||||
G2_DAC_UNUSED2, /* 14 */ \
|
||||
G2_VCOM_ADC2 /* 15*/ \
|
||||
};
|
||||
#define DAC_NAMES "vref_h_adc", "dac_unused", "vb_comp_fe", "vb_comp_adc", "vcom_cds", "vref_restore", "vb_opa_1st", "vref_comp_fe", "vcom_adc1", "vref_prech", "vref_l_adc", "vref_cds", "vb_cs", "vb_opa_fd", "dac_unused2", "vcom_adc2"
|
||||
#define DAC_NAMES "vref_h_adc", "dac_unused", "vb_comp_fe", "vb_comp_adc", "vcom_cds", "vref_rstore", "vb_opa_1st", "vref_comp_fe", "vcom_adc1", "vref_prech", "vref_l_adc", "vref_cds", "vb_cs", "vb_opa_fd", "dac_unused2", "vcom_adc2"
|
||||
|
||||
enum ONCHIP_DACINDEX {G2_VCHIP_COMP_FE, /* 0 */ \
|
||||
G2_VCHIP_OPA_1ST, /* 1 */ \
|
||||
|
Binary file not shown.
@ -30,10 +30,10 @@ int virtual_status = 0;
|
||||
int virtual_stop = 0;
|
||||
int highvoltage = 0;
|
||||
#endif
|
||||
int detPos[2] = {0, 0};
|
||||
int detPos[2] = {};
|
||||
|
||||
int detectorFirstServer = 1;
|
||||
int dacValues[NDAC] = {0};
|
||||
int dacValues[NDAC] = {};
|
||||
enum detectorSettings thisSettings = UNINITIALIZED;
|
||||
enum externalSignalFlag signalMode = 0;
|
||||
|
||||
@ -128,7 +128,7 @@ int checkType() {
|
||||
#ifdef VIRTUAL
|
||||
return OK;
|
||||
#endif
|
||||
volatile u_int32_t type = ((bus_r(BOARD_REVISION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST);
|
||||
u_int32_t type = ((bus_r(BOARD_REVISION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST);
|
||||
if (type == DETECTOR_TYPE_MOENCH_VAL){
|
||||
FILE_LOG(logERROR, ("This is not a Gotthard Server (read %d, expected ?)\n", type));
|
||||
return FAIL;
|
||||
@ -1178,27 +1178,23 @@ int setHighVoltage(int val){
|
||||
|
||||
void setTiming( enum timingMode arg){
|
||||
u_int32_t addr = EXT_SIGNAL_REG;
|
||||
|
||||
if (arg != GET_TIMING_MODE){
|
||||
switch((int)arg){
|
||||
case AUTO_TIMING:
|
||||
FILE_LOG(logINFO, ("Set Timing: Auto\n"));
|
||||
bus_w(addr, EXT_SIGNAL_OFF_VAL);
|
||||
break;
|
||||
case TRIGGER_EXPOSURE:
|
||||
if (signalMode == TRIGGER_IN_FALLING_EDGE) {
|
||||
FILE_LOG(logINFO, ("Set Timing: Trigger (Falling Edge)\n"));
|
||||
bus_w(addr, EXT_SIGNAL_TRGGR_IN_FLLNG_VAL);
|
||||
} else {
|
||||
FILE_LOG(logINFO, ("Set Timing: Trigger (Rising Edge)\n"));
|
||||
bus_w(addr, EXT_SIGNAL_TRGGR_IN_RSNG_VAL);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
FILE_LOG(logERROR, ("Unknown timing mode %d for this detector\n", (int)arg));
|
||||
return;
|
||||
}
|
||||
}
|
||||
switch(arg) {
|
||||
case AUTO_TIMING:
|
||||
FILE_LOG(logINFO, ("Set Timing: Auto\n"));
|
||||
bus_w(addr, EXT_SIGNAL_OFF_VAL);
|
||||
break;
|
||||
case TRIGGER_EXPOSURE:
|
||||
if (signalMode == TRIGGER_IN_FALLING_EDGE) {
|
||||
FILE_LOG(logINFO, ("Set Timing: Trigger (Falling Edge)\n"));
|
||||
bus_w(addr, EXT_SIGNAL_TRGGR_IN_FLLNG_VAL);
|
||||
} else {
|
||||
FILE_LOG(logINFO, ("Set Timing: Trigger (Rising Edge)\n"));
|
||||
bus_w(addr, EXT_SIGNAL_TRGGR_IN_RSNG_VAL);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
FILE_LOG(logERROR, ("Unknown timing mode %d for this detector\n", (int)arg));
|
||||
}
|
||||
}
|
||||
|
||||
enum timingMode getTiming() {
|
||||
@ -1680,7 +1676,7 @@ int calculateDataBytes(){
|
||||
return DATA_BYTES;
|
||||
}
|
||||
|
||||
int getTotalNumberOfChannels(){return ((int)getNumberOfChannelsPerChip() * (int)getNumberOfChips());}
|
||||
int getTotalNumberOfChannels() {return (getNumberOfChannelsPerChip() * getNumberOfChips());}
|
||||
int getNumberOfChips(){return NCHIP;}
|
||||
int getNumberOfDACs(){return NDAC;}
|
||||
int getNumberOfChannelsPerChip(){return NCHAN;}
|
||||
|
Binary file not shown.
@ -24,6 +24,7 @@
|
||||
// Global variable from slsDetectorServer_funcs
|
||||
extern int debugflag;
|
||||
extern udpStruct udpDetails;
|
||||
extern const enum detectorType myDetectorType;
|
||||
|
||||
int initError = OK;
|
||||
int initCheckDone = 0;
|
||||
@ -37,9 +38,9 @@ int virtual_stop = 0;
|
||||
|
||||
enum detectorSettings thisSettings = UNINITIALIZED;
|
||||
int highvoltage = 0;
|
||||
int dacValues[NDAC] = {0};
|
||||
int dacValues[NDAC] = {};
|
||||
int adcPhase = 0;
|
||||
int detPos[4] = {0, 0, 0, 0};
|
||||
int detPos[4] = {};
|
||||
int numUDPInterfaces = 1;
|
||||
|
||||
|
||||
@ -170,7 +171,7 @@ int checkType() {
|
||||
#ifdef VIRTUAL
|
||||
return OK;
|
||||
#endif
|
||||
volatile u_int32_t type = ((bus_r(FPGA_VERSION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST);
|
||||
u_int32_t type = ((bus_r(FPGA_VERSION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST);
|
||||
if (type != JUNGFRAU){
|
||||
FILE_LOG(logERROR, ("This is not a Jungfrau Server (read %d, expected %d)\n", type, JUNGFRAU));
|
||||
return FAIL;
|
||||
@ -918,22 +919,18 @@ int setHighVoltage(int val){
|
||||
|
||||
|
||||
void setTiming( enum timingMode arg){
|
||||
|
||||
if(arg != GET_TIMING_MODE){
|
||||
switch((int)arg){
|
||||
case AUTO_TIMING:
|
||||
FILE_LOG(logINFO, ("Set Timing: Auto\n"));
|
||||
bus_w(EXT_SIGNAL_REG, bus_r(EXT_SIGNAL_REG) & ~EXT_SIGNAL_MSK);
|
||||
break;
|
||||
case TRIGGER_EXPOSURE:
|
||||
FILE_LOG(logINFO, ("Set Timing: Trigger\n"));
|
||||
bus_w(EXT_SIGNAL_REG, bus_r(EXT_SIGNAL_REG) | EXT_SIGNAL_MSK);
|
||||
break;
|
||||
default:
|
||||
FILE_LOG(logERROR, ("Unknown timing mode %d\n", arg));
|
||||
return;
|
||||
}
|
||||
}
|
||||
switch(arg){
|
||||
case AUTO_TIMING:
|
||||
FILE_LOG(logINFO, ("Set Timing: Auto\n"));
|
||||
bus_w(EXT_SIGNAL_REG, bus_r(EXT_SIGNAL_REG) & ~EXT_SIGNAL_MSK);
|
||||
break;
|
||||
case TRIGGER_EXPOSURE:
|
||||
FILE_LOG(logINFO, ("Set Timing: Trigger\n"));
|
||||
bus_w(EXT_SIGNAL_REG, bus_r(EXT_SIGNAL_REG) | EXT_SIGNAL_MSK);
|
||||
break;
|
||||
default:
|
||||
FILE_LOG(logERROR, ("Unknown timing mode %d\n", arg));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1667,7 +1664,7 @@ void* start_timer(void* arg) {
|
||||
|
||||
usleep(exp_us);
|
||||
|
||||
const int size = datasize + 112;
|
||||
const int size = datasize + sizeof(sls_detector_header);
|
||||
char packetData[size];
|
||||
memset(packetData, 0, sizeof(sls_detector_header));
|
||||
|
||||
@ -1679,6 +1676,11 @@ void* start_timer(void* arg) {
|
||||
sls_detector_header* header = (sls_detector_header*)(packetData);
|
||||
header->frameNumber = frameNr;
|
||||
header->packetNumber = i;
|
||||
header->modId = 0;
|
||||
header->row = detPos[X];
|
||||
header->column = detPos[Y];
|
||||
header->detType = (uint16_t)myDetectorType;
|
||||
header->version = SLS_DETECTOR_HEADER_VERSION - 1;
|
||||
// fill data
|
||||
memcpy(packetData + sizeof(sls_detector_header), imageData + srcOffset, datasize);
|
||||
srcOffset += datasize;
|
||||
@ -1782,11 +1784,11 @@ enum runStatus getRunStatus(){
|
||||
|
||||
|
||||
void readFrame(int *ret, char *mess){
|
||||
#ifdef VIRTUAL
|
||||
// wait for status to be done
|
||||
while(runBusy()){
|
||||
usleep(500);
|
||||
}
|
||||
#ifdef VIRTUAL
|
||||
FILE_LOG(logINFOGREEN, ("acquisition successfully finished\n"));
|
||||
return;
|
||||
#endif
|
||||
@ -1826,7 +1828,7 @@ int calculateDataBytes(){
|
||||
return DATA_BYTES;
|
||||
}
|
||||
|
||||
int getTotalNumberOfChannels(){return ((int)getNumberOfChannelsPerChip() * (int)getNumberOfChips());}
|
||||
int getTotalNumberOfChannels() {return (getNumberOfChannelsPerChip() * getNumberOfChips());}
|
||||
int getNumberOfChips(){return NCHIP;}
|
||||
int getNumberOfDACs(){return NDAC;}
|
||||
int getNumberOfChannelsPerChip(){return NCHAN;}
|
||||
|
@ -4,29 +4,42 @@
|
||||
#define REG_OFFSET (4)
|
||||
|
||||
/* Base addresses 0x1804 0000 ---------------------------------------------*/
|
||||
|
||||
/* Reconfiguration core for readout pll */
|
||||
#define BASE_READOUT_PLL (0x0000) // 0x1804_0000 - 0x1804_07FF
|
||||
|
||||
/* Reconfiguration core for system pll */
|
||||
#define BASE_SYSTEM_PLL (0x0800) // 0x1804_0800 - 0x1804_0FFF
|
||||
|
||||
/* Clock Generation */
|
||||
#define BASE_CLK_GENERATION (0x1000) // 0x1804_1000 - 0x1804_XXXX //TODO
|
||||
|
||||
/* Base addresses 0x1806 0000 ---------------------------------------------*/
|
||||
/* General purpose control and status registers */
|
||||
#define BASE_CONTROL (0x0000) // 0x1806_0000 - 0x1806_00FF https://git.psi.ch/sls_detectors_firmware/mythen_III_mcb/blob/master/code/hdl/ctrl/ctrl.vhd
|
||||
#define BASE_CONTROL (0x0000) // 0x1806_0000 - 0x1806_00FF
|
||||
// https://git.psi.ch/sls_detectors_firmware/mythen_III_mcb/blob/master/code/hdl/ctrl/ctrl.vhd
|
||||
|
||||
/* ASIC Control */
|
||||
#define BASE_ASIC (0x0100) // 0x1806_0100 - 0x1806_010F
|
||||
|
||||
/* ASIC Digital Interface. Data recovery core */
|
||||
#define BASE_ADIF (0x0110) // 0x1806_0110 - 0x1806_011F https://git.psi.ch/sls_detectors_firmware/vhdl_library/blob/2e81ccbdbc5cb81813ba190fbdba43e8d6884eb9/adif/adif_ctrl.vhd
|
||||
#define BASE_ADIF (0x0110) // 0x1806_0110 - 0x1806_011F
|
||||
// https://git.psi.ch/sls_detectors_firmware/vhdl_library/blob/2e81ccbdbc5cb81813ba190fbdba43e8d6884eb9/adif/adif_ctrl.vhd
|
||||
|
||||
/* Formatting of data core */
|
||||
#define BASE_FMT (0x0120) // 0x1806_0120 - 0x1806_012F
|
||||
|
||||
/* Packetizer */
|
||||
#define BASE_PKT (0x0140) // 0x1806_0140 - 0x1806_014F
|
||||
// https://git.psi.ch/sls_detectors_firmware/mythen_III_mcb/blob/master/code/hdl/pkt/pkt_ctrl.vhd
|
||||
|
||||
/* Pattern control and status registers */
|
||||
#define BASE_PATTERN_CONTROL (0x00200) // 0x1806_0200 - 0x1806_02FF https://git.psi.ch/sls_detectors_firmware/vhdl_library/blob/2e81ccbdbc5cb81813ba190fbdba43e8d6884eb9/pattern_flow/pattern_flow_ctrl.vhd
|
||||
#define BASE_PATTERN_CONTROL (0x00200) // 0x1806_0200 - 0x1806_02FF
|
||||
// https://git.psi.ch/sls_detectors_firmware/vhdl_library/blob/2e81ccbdbc5cb81813ba190fbdba43e8d6884eb9/pattern_flow/pattern_flow_ctrl.vhd
|
||||
|
||||
/* UDP datagram generator */
|
||||
#define BASE_UDP_RAM (0x01000) // 0x1806_1000 - 0x1806_1FFF
|
||||
|
||||
/* Pattern RAM. Pattern table */
|
||||
#define BASE_PATTERN_RAM (0x10000) // 0x1807_0000 - 0x1807_FFFF
|
||||
|
||||
@ -119,6 +132,30 @@
|
||||
|
||||
|
||||
|
||||
/* Packetizer -------------------------------------------------------------*/
|
||||
|
||||
/* Packetizer Config Register */
|
||||
#define PKT_CONFIG_REG (0x00 * REG_OFFSET + BASE_PKT)
|
||||
|
||||
#define PKT_CONFIG_NRXR_MAX_OFST (0)
|
||||
#define PKT_CONFIG_NRXR_MAX_MSK (0x0000003F << PKT_CONFIG_NRXR_MAX_OFST)
|
||||
#define PKT_CONFIG_RXR_START_ID_OFST (8)
|
||||
#define PKT_CONFIG_RXR_START_ID_MSK (0x0000003F << PKT_CONFIG_RXR_START_ID_OFST)
|
||||
|
||||
/* Module Coordinates Register */
|
||||
#define COORD_0_REG (0x02 * REG_OFFSET + BASE_PKT)
|
||||
#define COORD_ROW_OFST (0)
|
||||
#define COORD_ROW_MSK (0x0000FFFF << COORD_ROW_OFST)
|
||||
#define COORD_COL_OFST (16)
|
||||
#define COORD_COL_MSK (0x0000FFFF << COORD_COL_OFST)
|
||||
|
||||
/* Module ID Register */
|
||||
#define COORD_1_REG (0x03 * REG_OFFSET + BASE_PKT)
|
||||
#define COORD_RESERVED_OFST (0)
|
||||
#define COORD_RESERVED_MSK (0x0000FFFF << COORD_RESERVED_OFST)
|
||||
#define COORD_ID_OFST (16) // Not connected in firmware TODO
|
||||
#define COORD_ID_MSK (0x0000FFFF << COORD_ID_OFST) // Not connected in firmware TODO
|
||||
|
||||
|
||||
/* Pattern Control registers --------------------------------------------------*/
|
||||
|
||||
@ -126,15 +163,15 @@
|
||||
#define PAT_STATUS_REG (0x00 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
#define PAT_STATUS_RUN_BUSY_OFST (0)
|
||||
#define PAT_STATUS_RUN_BUSY_MSK (0x00000001 << PAT_STATUS_RUN_BUSY_OFST)
|
||||
#define PAT_STATUS_WAIT_FOR_TRGGR_OFST (0)
|
||||
#define PAT_STATUS_WAIT_FOR_TRGGR_OFST (3)
|
||||
#define PAT_STATUS_WAIT_FOR_TRGGR_MSK (0x00000001 << PAT_STATUS_WAIT_FOR_TRGGR_OFST)
|
||||
#define PAT_STATUS_DLY_BFRE_TRGGR_OFST (0)
|
||||
#define PAT_STATUS_DLY_BFRE_TRGGR_OFST (4)
|
||||
#define PAT_STATUS_DLY_BFRE_TRGGR_MSK (0x00000001 << PAT_STATUS_DLY_BFRE_TRGGR_OFST)
|
||||
#define PAT_STATUS_FIFO_FULL_OFST (0)
|
||||
#define PAT_STATUS_FIFO_FULL_OFST (5)
|
||||
#define PAT_STATUS_FIFO_FULL_MSK (0x00000001 << PAT_STATUS_FIFO_FULL_OFST)
|
||||
#define PAT_STATUS_DLY_AFTR_TRGGR_OFST (0)
|
||||
#define PAT_STATUS_DLY_AFTR_TRGGR_OFST (15)
|
||||
#define PAT_STATUS_DLY_AFTR_TRGGR_MSK (0x00000001 << PAT_STATUS_DLY_AFTR_TRGGR_OFST)
|
||||
#define PAT_STATUS_CSM_BUSY_OFST (0)
|
||||
#define PAT_STATUS_CSM_BUSY_OFST (17)
|
||||
#define PAT_STATUS_CSM_BUSY_MSK (0x00000001 << PAT_STATUS_CSM_BUSY_OFST)
|
||||
|
||||
/* Delay left 64bit Register */
|
||||
@ -184,6 +221,9 @@
|
||||
/* External Signal register */
|
||||
#define EXT_SIGNAL_REG (0x30 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
|
||||
#define EXT_SIGNAL_OFST (0)
|
||||
#define EXT_SIGNAL_MSK (0x00000001 << EXT_SIGNAL_OFST)
|
||||
|
||||
/* Trigger Delay 64 bit register */
|
||||
#define SET_TRIGGER_DELAY_LSB_REG (0x32 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
#define SET_TRIGGER_DELAY_MSB_REG (0x33 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
|
Binary file not shown.
@ -21,6 +21,7 @@
|
||||
// Global variable from slsDetectorServer_funcs
|
||||
extern int debugflag;
|
||||
extern udpStruct udpDetails;
|
||||
extern const enum detectorType myDetectorType;
|
||||
|
||||
int initError = OK;
|
||||
int initCheckDone = 0;
|
||||
@ -32,12 +33,12 @@ int virtual_status = 0;
|
||||
int virtual_stop = 0;
|
||||
#endif
|
||||
|
||||
int32_t clkPhase[NUM_CLOCKS] = {0, 0, 0, 0, 0};
|
||||
uint32_t clkFrequency[NUM_CLOCKS] = {0, 0, 0, 0, 0};
|
||||
int32_t clkPhase[NUM_CLOCKS] = {};
|
||||
uint32_t clkFrequency[NUM_CLOCKS] = {};
|
||||
|
||||
int highvoltage = 0;
|
||||
int dacValues[NDAC] = {0};
|
||||
int detPos[2] = {0, 0};
|
||||
int detPos[2] = {};
|
||||
uint32_t countermask = 0; // will be removed later when in firmware converted to mask
|
||||
|
||||
int isInitCheckDone() {
|
||||
@ -84,13 +85,10 @@ void basictests() {
|
||||
uint64_t macadd = getDetectorMAC();
|
||||
int64_t fwversion = getFirmwareVersion();
|
||||
int64_t swversion = getServerVersion();
|
||||
int64_t sw_fw_apiversion = 0;
|
||||
int64_t sw_fw_apiversion = getFirmwareAPIVersion();;
|
||||
int64_t client_sw_apiversion = getClientServerAPIVersion();
|
||||
uint32_t requiredFirmwareVersion = REQRD_FRMWRE_VRSN;
|
||||
|
||||
|
||||
if (fwversion >= MIN_REQRD_VRSN_T_RD_API)
|
||||
sw_fw_apiversion = getFirmwareAPIVersion();
|
||||
FILE_LOG(logINFOBLUE, ("*************************************************\n"
|
||||
"Hardware Version:\t\t 0x%x\n"
|
||||
|
||||
@ -161,7 +159,7 @@ int checkType() {
|
||||
#ifdef VIRTUAL
|
||||
return OK;
|
||||
#endif
|
||||
volatile u_int32_t type = ((bus_r(FPGA_VERSION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST);
|
||||
u_int32_t type = ((bus_r(FPGA_VERSION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST);
|
||||
if (type != MYTHEN3){
|
||||
FILE_LOG(logERROR, ("This is not a Mythen3 Server (read %d, expected %d)\n", type, MYTHEN3));
|
||||
return FAIL;
|
||||
@ -609,7 +607,6 @@ int setDelayAfterTrigger(int64_t val) {
|
||||
|
||||
int64_t getDelayAfterTrigger() {
|
||||
return get64BitReg(SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG) / (1E-9 * FIXED_PLL_FREQUENCY);
|
||||
|
||||
}
|
||||
|
||||
int64_t getNumFramesLeft() {
|
||||
@ -706,10 +703,25 @@ int setHighVoltage(int val){
|
||||
|
||||
/* parameters - timing */
|
||||
void setTiming( enum timingMode arg){
|
||||
// to be implemented
|
||||
if(arg != GET_TIMING_MODE){
|
||||
switch (arg) {
|
||||
case AUTO_TIMING:
|
||||
FILE_LOG(logINFO, ("Set Timing: Auto\n"));
|
||||
bus_w(EXT_SIGNAL_REG, bus_r(EXT_SIGNAL_REG) & ~EXT_SIGNAL_MSK);
|
||||
break;
|
||||
case TRIGGER_EXPOSURE:
|
||||
FILE_LOG(logINFO, ("Set Timing: Trigger\n"));
|
||||
bus_w(EXT_SIGNAL_REG, bus_r(EXT_SIGNAL_REG) | EXT_SIGNAL_MSK);
|
||||
break;
|
||||
default:
|
||||
FILE_LOG(logERROR, ("Unknown timing mode %d\n", arg));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum timingMode getTiming() {
|
||||
if (bus_r(EXT_SIGNAL_REG) == EXT_SIGNAL_MSK)
|
||||
return TRIGGER_EXPOSURE;
|
||||
return AUTO_TIMING;
|
||||
}
|
||||
|
||||
@ -835,6 +847,43 @@ void calcChecksum(udp_header* udp) {
|
||||
udp->ip_checksum = checksum;
|
||||
}
|
||||
|
||||
int setDetectorPosition(int pos[]) {
|
||||
memcpy(detPos, pos, sizeof(detPos));
|
||||
|
||||
uint32_t addr = COORD_0_REG;
|
||||
int value = 0;
|
||||
int valueRead = 0;
|
||||
int ret = OK;
|
||||
|
||||
// row
|
||||
value = detPos[X];
|
||||
bus_w(addr, (bus_r(addr) &~COORD_ROW_MSK) | ((value << COORD_ROW_OFST) & COORD_ROW_MSK));
|
||||
valueRead = ((bus_r(addr) & COORD_ROW_MSK) >> COORD_ROW_OFST);
|
||||
if (valueRead != value) {
|
||||
FILE_LOG(logERROR, ("Could not set row. Set %d, read %d\n", value, valueRead));
|
||||
ret = FAIL;
|
||||
}
|
||||
|
||||
// col
|
||||
value = detPos[Y];
|
||||
bus_w(addr, (bus_r(addr) &~COORD_COL_MSK) | ((value << COORD_COL_OFST) & COORD_COL_MSK));
|
||||
valueRead = ((bus_r(addr) & COORD_COL_MSK) >> COORD_COL_OFST);
|
||||
if (valueRead != value) {
|
||||
FILE_LOG(logERROR, ("Could not set column. Set %d, read %d\n", value, valueRead));
|
||||
ret = FAIL;
|
||||
}
|
||||
|
||||
if (ret == OK) {
|
||||
FILE_LOG(logINFO, ("\tPosition set to [%d, %d]\n", detPos[X], detPos[Y]));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int* getDetectorPosition() {
|
||||
return detPos;
|
||||
}
|
||||
|
||||
/* pattern */
|
||||
|
||||
uint64_t readPatternWord(int addr) {
|
||||
@ -1052,6 +1101,22 @@ void setPatternLoop(int level, int *startAddr, int *stopAddr, int *nLoop) {
|
||||
}
|
||||
}
|
||||
|
||||
void setPatternMask(uint64_t mask) {
|
||||
set64BitReg(mask, PATTERN_MASK_LSB_REG, PATTERN_MASK_MSB_REG);
|
||||
}
|
||||
|
||||
uint64_t getPatternMask() {
|
||||
return get64BitReg(PATTERN_MASK_LSB_REG, PATTERN_MASK_MSB_REG);
|
||||
}
|
||||
|
||||
void setPatternBitMask(uint64_t mask) {
|
||||
set64BitReg(mask, PATTERN_SET_LSB_REG, PATTERN_SET_MSB_REG);
|
||||
}
|
||||
|
||||
uint64_t getPatternBitMask() {
|
||||
return get64BitReg(PATTERN_SET_LSB_REG, PATTERN_SET_MSB_REG);
|
||||
}
|
||||
|
||||
int checkDetectorType() {
|
||||
FILE_LOG(logINFO, ("Checking type of module\n"));
|
||||
FILE* fd = fopen(TYPE_FILE_NAME, "r");
|
||||
@ -1073,7 +1138,7 @@ int checkDetectorType() {
|
||||
}
|
||||
|
||||
if (abs(type - TYPE_MYTHEN3_MODULE_VAL) > TYPE_TOLERANCE) {
|
||||
FILE_LOG(logERROR, ("Wrong Module attached! Expected %d for Mythen, got %d\n", TYPE_MYTHEN3_MODULE_VAL, type));
|
||||
FILE_LOG(logERROR, ("Wrong Module attached! Expected %d for Mythen3, got %d\n", TYPE_MYTHEN3_MODULE_VAL, type));
|
||||
return FAIL;
|
||||
}
|
||||
return OK;
|
||||
@ -1134,8 +1199,8 @@ int setPhase(enum CLKINDEX ind, int val, int degrees) {
|
||||
relativePhase *= -1;
|
||||
direction = 0;
|
||||
}
|
||||
int pllIndex = ind >= SYSTEM_C0 ? SYSTEM_PLL : READOUT_PLL;
|
||||
int clkIndex = ind >= SYSTEM_C0 ? ind - SYSTEM_C0 : ind;
|
||||
int pllIndex = (int)(ind >= SYSTEM_C0 ? SYSTEM_PLL : READOUT_PLL);
|
||||
int clkIndex = (int)(ind >= SYSTEM_C0 ? ind - SYSTEM_C0 : ind);
|
||||
ALTERA_PLL_C10_SetPhaseShift(pllIndex, clkIndex, relativePhase, direction);
|
||||
|
||||
clkPhase[ind] = valShift;
|
||||
@ -1207,7 +1272,7 @@ int getVCOFrequency(enum CLKINDEX ind) {
|
||||
FILE_LOG(logERROR, ("Unknown clock index %d to get vco frequency\n", ind));
|
||||
return -1;
|
||||
}
|
||||
int pllIndex = ind >= SYSTEM_C0 ? SYSTEM_PLL : READOUT_PLL;
|
||||
int pllIndex = (int)(ind >= SYSTEM_C0 ? SYSTEM_PLL : READOUT_PLL);
|
||||
return ALTERA_PLL_C10_GetVCOFrequency(pllIndex);
|
||||
}
|
||||
|
||||
@ -1225,7 +1290,7 @@ int setClockDivider(enum CLKINDEX ind, int val) {
|
||||
}
|
||||
char* clock_names[] = {CLK_NAMES};
|
||||
int vcofreq = getVCOFrequency(ind);
|
||||
int currentdiv = vcofreq / clkFrequency[ind];
|
||||
int currentdiv = vcofreq / (int)clkFrequency[ind];
|
||||
int newfreq = vcofreq / val;
|
||||
|
||||
FILE_LOG(logINFO, ("\tSetting %s clock (%d) divider from %d (%d Hz) to %d (%d Hz). \n\t(Vcofreq: %d Hz)\n", clock_names[ind], ind, currentdiv, clkFrequency[ind], val, newfreq, vcofreq));
|
||||
@ -1240,8 +1305,8 @@ int setClockDivider(enum CLKINDEX ind, int val) {
|
||||
}
|
||||
|
||||
// Calculate and set output frequency
|
||||
int pllIndex = ind >= SYSTEM_C0 ? SYSTEM_PLL : READOUT_PLL;
|
||||
int clkIndex = ind >= SYSTEM_C0 ? ind - SYSTEM_C0 : ind;
|
||||
int pllIndex = (int)(ind >= SYSTEM_C0 ? SYSTEM_PLL : READOUT_PLL);
|
||||
int clkIndex = (int)(ind >= SYSTEM_C0 ? ind - SYSTEM_C0 : ind);
|
||||
ALTERA_PLL_C10_SetOuputFrequency (pllIndex, clkIndex, newfreq);
|
||||
clkFrequency[ind] = newfreq;
|
||||
FILE_LOG(logINFO, ("\t%s clock (%d) divider set to %d (%d Hz)\n", clock_names[ind], ind, val, clkFrequency[ind]));
|
||||
@ -1275,20 +1340,11 @@ int getClockDivider(enum CLKINDEX ind) {
|
||||
FILE_LOG(logERROR, ("Unknown clock index %d to get clock divider\n", ind));
|
||||
return -1;
|
||||
}
|
||||
return (getVCOFrequency(ind) / clkFrequency[ind]);
|
||||
return (getVCOFrequency(ind) / (int)clkFrequency[ind]);
|
||||
}
|
||||
|
||||
/* aquisition */
|
||||
|
||||
int setDetectorPosition(int pos[]) {
|
||||
memcpy(detPos, pos, sizeof(detPos));
|
||||
return OK;
|
||||
}
|
||||
|
||||
int* getDetectorPosition() {
|
||||
return detPos;
|
||||
}
|
||||
|
||||
int startStateMachine(){
|
||||
#ifdef VIRTUAL
|
||||
// create udp socket
|
||||
@ -1327,22 +1383,64 @@ void* start_timer(void* arg) {
|
||||
getNumTriggers() );
|
||||
int64_t exp_ns = getExpTime();
|
||||
|
||||
int imagesize = calculateDataBytes();
|
||||
int datasize = imagesize / PACKETS_PER_FRAME;
|
||||
int packetsize = datasize + sizeof(sls_detector_header);
|
||||
|
||||
int frameNr = 0;
|
||||
// Generate data
|
||||
char imageData[imagesize];
|
||||
memset(imageData, 0, imagesize);
|
||||
{
|
||||
int i = 0;
|
||||
for (i = 0; i < imagesize; i += sizeof(uint8_t)) {
|
||||
*((uint8_t*)(imageData + i)) = i;
|
||||
}
|
||||
}
|
||||
|
||||
int frameNr = 1;
|
||||
// loop over number of frames
|
||||
for(frameNr=0; frameNr!= numFrames; ++frameNr ) {
|
||||
for (frameNr = 0; frameNr != numFrames; ++frameNr) {
|
||||
|
||||
//check if virtual_stop is high
|
||||
if(virtual_stop == 1){
|
||||
break;
|
||||
}
|
||||
|
||||
int srcOffset = 0;
|
||||
|
||||
// sleep for exposure time
|
||||
struct timespec begin, end;
|
||||
clock_gettime(CLOCK_REALTIME, &begin);
|
||||
usleep(exp_ns / 1000);
|
||||
clock_gettime(CLOCK_REALTIME, &end);
|
||||
|
||||
// loop packet
|
||||
{
|
||||
int i = 0;
|
||||
for(i = 0; i!=PACKETS_PER_FRAME; ++i) {
|
||||
char packetData[packetsize];
|
||||
memset(packetData, 0, packetsize);
|
||||
|
||||
// set header
|
||||
sls_detector_header* header = (sls_detector_header*)(packetData);
|
||||
header->frameNumber = frameNr + 1;
|
||||
header->packetNumber = i;
|
||||
header->modId = 0;
|
||||
header->row = detPos[X];
|
||||
header->column = detPos[Y];
|
||||
header->detType = (uint16_t)myDetectorType;
|
||||
header->version = SLS_DETECTOR_HEADER_VERSION - 1;
|
||||
|
||||
// fill data
|
||||
memcpy(packetData + sizeof(sls_detector_header), imageData + srcOffset, datasize);
|
||||
srcOffset += datasize;
|
||||
|
||||
sendUDPPacket(0, packetData, packetsize);
|
||||
}
|
||||
}
|
||||
FILE_LOG(logINFO, ("Sent frame: %d\n", frameNr));
|
||||
|
||||
// calculate time left in period
|
||||
clock_gettime(CLOCK_REALTIME, &end);
|
||||
int64_t time_ns = ((end.tv_sec - begin.tv_sec) * 1E9 +
|
||||
(end.tv_nsec - begin.tv_nsec));
|
||||
|
||||
@ -1373,7 +1471,7 @@ int stopStateMachine(){
|
||||
#endif
|
||||
//stop state machine
|
||||
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_STP_ACQSTN_MSK);
|
||||
FILE_LOG(logINFO, ("Status Register: %08x\n",bus_r(STATUS_REG)));
|
||||
FILE_LOG(logINFO, ("Status Register: %08x\n", bus_r(STATUS_REG)));
|
||||
return OK;
|
||||
}
|
||||
|
||||
@ -1430,7 +1528,7 @@ enum runStatus getRunStatus(){
|
||||
return s;
|
||||
}
|
||||
|
||||
void readFrame(int *ret, char *mess){
|
||||
void readFrame(int *ret, char *mess) {
|
||||
// wait for status to be done
|
||||
while(runBusy()){
|
||||
usleep(500);
|
||||
@ -1450,7 +1548,6 @@ void readFrame(int *ret, char *mess){
|
||||
} else {
|
||||
FILE_LOG(logINFOGREEN, ("Acquisition successfully finished\n"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
u_int32_t runBusy() {
|
||||
@ -1458,17 +1555,25 @@ u_int32_t runBusy() {
|
||||
return virtual_status;
|
||||
#endif
|
||||
u_int32_t s = (bus_r(PAT_STATUS_REG) & PAT_STATUS_RUN_BUSY_MSK);
|
||||
FILE_LOG(logDEBUG1, ("Status Register: %08x\n", s));
|
||||
//FILE_LOG(logDEBUG1, ("Status Register: %08x\n", s));
|
||||
return s;
|
||||
}
|
||||
|
||||
/* common */
|
||||
|
||||
int calculateDataBytes(){
|
||||
return 0;
|
||||
int calculateDataBytes() {
|
||||
int numCounters = __builtin_popcount(getCounterMask());
|
||||
int dr = setDynamicRange(-1);
|
||||
int databytes = NCHAN_1_COUNTER * NCHIP * numCounters *
|
||||
((dr > 16) ? 4 : // 32 bit
|
||||
((dr > 8) ? 2 : // 16 bit
|
||||
((dr > 4) ? 0.5 : // 4 bit
|
||||
0.125))); // 1 bit
|
||||
|
||||
return databytes;
|
||||
}
|
||||
|
||||
int getTotalNumberOfChannels(){return ((int)getNumberOfChannelsPerChip() * (int)getNumberOfChips());}
|
||||
int getNumberOfChips(){return NCHIP;}
|
||||
int getNumberOfDACs(){return NDAC;}
|
||||
int getNumberOfChannelsPerChip(){return NCHAN;}
|
||||
int getTotalNumberOfChannels() {return (getNumberOfChannelsPerChip() * getNumberOfChips());}
|
||||
int getNumberOfChips() {return NCHIP;}
|
||||
int getNumberOfDACs() {return NDAC;}
|
||||
int getNumberOfChannelsPerChip() {return NCHAN;}
|
||||
|
@ -2,13 +2,13 @@
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
#define REQRD_FRMWRE_VRSN 0x190000
|
||||
#define MIN_REQRD_VRSN_T_RD_API 0x190000
|
||||
|
||||
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
||||
|
||||
/* Hardware Definitions */
|
||||
#define NCOUNTERS (3)
|
||||
#define MAX_COUNTER_MSK (0x7)
|
||||
#define MAX_COUNTER_MSK (0x7)
|
||||
#define NCHAN_1_COUNTER (128)
|
||||
#define NCHAN (128 * NCOUNTERS)
|
||||
#define NCHIP (10)
|
||||
#define NDAC (16)
|
||||
@ -45,7 +45,6 @@
|
||||
#define READOUT_PLL_VCO_FREQ_HZ (1250000000) // 1.25GHz
|
||||
#define SYSTEM_PLL_VCO_FREQ_HZ (1250000000) // 1.25GHz
|
||||
#define MAX_PATTERN_LENGTH (0x2000) // maximum number of words (64bit)
|
||||
#define WAIT_TIME_US_STP_ACQ (100)
|
||||
|
||||
/** Other Definitions */
|
||||
#define BIT16_MASK (0xFFFF)
|
||||
@ -97,4 +96,5 @@ typedef struct udp_header_struct {
|
||||
uint16_t udp_checksum;
|
||||
uint16_t udp_destport;
|
||||
} udp_header;
|
||||
#define UDP_IP_HEADER_LENGTH_BYTES (28)
|
||||
#define UDP_IP_HEADER_LENGTH_BYTES (28)
|
||||
#define PACKETS_PER_FRAME (2)
|
||||
|
@ -84,11 +84,10 @@ int updateDatabytesandAllocateRAM();
|
||||
void updateDataBytes();
|
||||
#endif
|
||||
|
||||
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MYTHEN3D) || GOTTHARD2D
|
||||
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MYTHEN3D)
|
||||
int setDefaultDacs();
|
||||
#endif
|
||||
#ifdef GOTTHARD2D
|
||||
int setDefaultOnChipDacs();
|
||||
int readConfigFile();
|
||||
#endif
|
||||
|
||||
@ -101,13 +100,13 @@ int readRegister(uint32_t offset, uint32_t* retval);
|
||||
uint32_t writeRegister16And32(uint32_t offset, uint32_t data); //FIXME its not there in ctb or moench?
|
||||
uint32_t readRegister16And32(uint32_t offset);
|
||||
#else
|
||||
extern u_int32_t writeRegister(u_int32_t offset, u_int32_t data); // blackfin.h
|
||||
extern u_int32_t readRegister(u_int32_t offset); // blackfin.h
|
||||
extern u_int32_t writeRegister(u_int32_t offset, u_int32_t data); // blackfin.h or nios.h
|
||||
extern u_int32_t readRegister(u_int32_t offset); // blackfin.h or nios.h
|
||||
#endif
|
||||
|
||||
|
||||
// firmware functions (resets)
|
||||
#if defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D)
|
||||
#if defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||
void cleanFifos();
|
||||
void resetCore();
|
||||
void resetPeripheral();
|
||||
@ -178,6 +177,20 @@ int setExpTime(int64_t val);
|
||||
int64_t getExpTime();
|
||||
int setPeriod(int64_t val);
|
||||
int64_t getPeriod();
|
||||
#ifdef GOTTHARD2D
|
||||
void setNumFramesBurst(int64_t val);
|
||||
int64_t getNumFramesBurst();
|
||||
void setNumFramesCont(int64_t val);
|
||||
int64_t getNumFramesCont();
|
||||
int setExptimeBurst(int64_t val);
|
||||
int setExptimeCont(int64_t val);
|
||||
int setExptimeBoth(int64_t val);
|
||||
int64_t getExptimeBoth();
|
||||
int setPeriodBurst(int64_t val);
|
||||
int64_t getPeriodBurst();
|
||||
int setPeriodCont(int64_t val);
|
||||
int64_t getPeriodCont();
|
||||
#endif
|
||||
#ifdef EIGERD
|
||||
int setSubExpTime(int64_t val);
|
||||
int64_t getSubExpTime();
|
||||
@ -203,22 +216,18 @@ void setCounterMask(uint32_t arg);
|
||||
uint32_t getCounterMask();
|
||||
#endif
|
||||
|
||||
#if defined(JUNGFRAUD) || defined(GOTTHARDD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D)
|
||||
#if defined(JUNGFRAUD) || defined(GOTTHARDD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||
int setDelayAfterTrigger(int64_t val);
|
||||
int64_t getDelayAfterTrigger();
|
||||
#endif
|
||||
#if defined(JUNGFRAUD) || defined(GOTTHARDD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||
int64_t getNumFramesLeft();
|
||||
int64_t getNumTriggersLeft();
|
||||
#endif
|
||||
#if defined(JUNGFRAUD) || defined(GOTTHARDD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D)
|
||||
int64_t getDelayAfterTriggerLeft();
|
||||
int64_t getPeriodLeft();
|
||||
#endif
|
||||
#ifdef GOTTHARDD
|
||||
int64_t getExpTimeLeft();
|
||||
#endif
|
||||
#if defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D)
|
||||
#if defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||
int64_t getFramesFromStart();
|
||||
int64_t getActualTime();
|
||||
int64_t getMeasurementTime();
|
||||
@ -230,9 +239,11 @@ int64_t getMeasurementTime();
|
||||
#if (!defined(CHIPTESTBOARDD)) && (!defined(MOENCHD)) && (!defined(MYTHEN3D)) && (!defined(GOTTHARD2D))
|
||||
int setModule(sls_detector_module myMod, char* mess);
|
||||
int getModule(sls_detector_module *myMod);
|
||||
#endif
|
||||
#if (!defined(CHIPTESTBOARDD)) && (!defined(MOENCHD)) && (!defined(MYTHEN3D))
|
||||
enum detectorSettings setSettings(enum detectorSettings sett);
|
||||
#endif
|
||||
#if !defined(MYTHEN3D) && !defined(GOTTHARD2D)
|
||||
#if !defined(MYTHEN3D)
|
||||
enum detectorSettings getSettings();
|
||||
#endif
|
||||
|
||||
@ -293,10 +304,8 @@ int setHighVoltage(int val);
|
||||
|
||||
|
||||
// parameters - timing, extsig
|
||||
#if !defined(GOTTHARD2D)
|
||||
void setTiming( enum timingMode arg);
|
||||
enum timingMode getTiming();
|
||||
#endif
|
||||
#ifdef GOTTHARDD
|
||||
void setExtSignal(enum externalSignalFlag mode);
|
||||
int getExtSignal();
|
||||
@ -324,7 +333,6 @@ int getAdcConfigured();
|
||||
int configureMAC();
|
||||
int setDetectorPosition(int pos[]);
|
||||
int* getDetectorPosition();
|
||||
int isConfigurable();
|
||||
|
||||
|
||||
#ifdef EIGERD
|
||||
@ -429,6 +437,10 @@ uint64_t writePatternWord(int addr, uint64_t word);
|
||||
int setPatternWaitAddress(int level, int addr);
|
||||
uint64_t setPatternWaitTime(int level, uint64_t t);
|
||||
void setPatternLoop(int level, int *startAddr, int *stopAddr, int *nLoop);
|
||||
void setPatternMask(uint64_t mask);
|
||||
uint64_t getPatternMask();
|
||||
void setPatternBitMask(uint64_t mask);
|
||||
uint64_t getPatternBitMask();
|
||||
int checkDetectorType();
|
||||
int powerChip (int on);
|
||||
int setPhase(enum CLKINDEX ind, int val, int degrees);
|
||||
@ -443,6 +455,8 @@ int setClockDivider(enum CLKINDEX ind, int val);
|
||||
int getClockDivider(enum CLKINDEX ind);
|
||||
|
||||
#elif GOTTHARD2D
|
||||
int checkDetectorType();
|
||||
int powerChip (int on);
|
||||
int setPhase(enum CLKINDEX ind, int val, int degrees);
|
||||
int getPhase(enum CLKINDEX ind, int degrees);
|
||||
int getMaxPhase(enum CLKINDEX ind);
|
||||
@ -460,8 +474,9 @@ int setVetoPhoton(int chipIndex, int gainIndex, int* values);
|
||||
int getVetoPhoton(int chipIndex, int* retvals);
|
||||
int configureSingleADCDriver(int chipIndex);
|
||||
int configureADC();
|
||||
int setBurstMode(int burst);
|
||||
int getBurstMode();
|
||||
int setBurstModeinFPGA(enum burstMode value);
|
||||
int setBurstMode(enum burstMode burst);
|
||||
enum burstMode getBurstMode();
|
||||
#endif
|
||||
|
||||
|
||||
@ -485,6 +500,9 @@ int setTransmissionDelayRight(int value);
|
||||
|
||||
|
||||
// aquisition
|
||||
#ifdef GOTTHARD2D
|
||||
int updateAcquisitionRegisters(char* mess);
|
||||
#endif
|
||||
#ifdef EIGERD
|
||||
int prepareAcquisition();
|
||||
#endif
|
||||
|
@ -199,10 +199,10 @@ int set_inject_channel(int);
|
||||
int get_inject_channel(int);
|
||||
int set_veto_photon(int);
|
||||
int get_veto_photon(int);
|
||||
int set_veto_refernce(int);
|
||||
int set_veto_reference(int);
|
||||
int get_burst_mode(int);
|
||||
int set_burst_mode(int);
|
||||
int set_adc_enable_mask_10g(int);
|
||||
int get_adc_enable_mask_10g(int);
|
||||
int set_counter_mask(int);
|
||||
int get_counter_mask(int);
|
||||
int get_counter_mask(int);
|
||||
|
@ -87,13 +87,9 @@ void ALTERA_PLL_C10_Reconfigure(int pllIndex) {
|
||||
void ALTERA_PLL_C10_ResetPLL (int pllIndex) {
|
||||
uint32_t resetreg = ALTERA_PLL_C10_Reset_Reg[pllIndex];
|
||||
uint32_t resetmsk = ALTERA_PLL_C10_Reset_Msk[pllIndex];
|
||||
|
||||
#ifdef MYTHEN3D
|
||||
FILE_LOG(logINFO, ("Resetting PLL %d\n", pllIndex));
|
||||
bus_w_csp1(resetreg, bus_r_csp1(resetreg) | resetmsk);
|
||||
#else
|
||||
FILE_LOG(logWARNING, ("Resetting PLL %d not implemented!\n", pllIndex));
|
||||
#endif
|
||||
|
||||
usleep(ALTERA_PLL_C10_WAIT_TIME_US);
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,9 @@ int ASIC_Driver_Set (int index, int length, char* buffer) {
|
||||
FILE_LOG(logDEBUG1, ("\t]\n"));
|
||||
}
|
||||
|
||||
#ifdef VIRTUAL
|
||||
return OK;
|
||||
#endif
|
||||
int fd=open(fname, O_RDWR);
|
||||
if (fd == -1) {
|
||||
FILE_LOG(logERROR, ("Could not open file %s for writing to control ASIC (%d)\n", fname, index));
|
||||
|
@ -19,6 +19,8 @@ extern int ret;
|
||||
// Global variables from slsDetectorServer_funcs
|
||||
extern int sockfd;
|
||||
extern int debugflag;
|
||||
extern int checkModuleFlag;
|
||||
|
||||
|
||||
// Global variables from slsDetectorFunctionList
|
||||
#ifdef GOTTHARDD
|
||||
@ -67,7 +69,11 @@ int main(int argc, char *argv[]){
|
||||
FILE_LOG(logINFO, ("Detected developer mode\n"));
|
||||
debugflag = 1;
|
||||
}
|
||||
else if(!strcasecmp(argv[i],"--port")){
|
||||
else if(!strcasecmp(argv[i],"-nomodule")){
|
||||
FILE_LOG(logINFO, ("Detected No Module mode\n"));
|
||||
checkModuleFlag = 0;
|
||||
}
|
||||
else if(!strcasecmp(argv[i],"-port")){
|
||||
if ((i + 1) >= argc) {
|
||||
FILE_LOG(logERROR, ("no port value given. Exiting.\n"));
|
||||
return -1;
|
||||
@ -105,7 +111,7 @@ int main(int argc, char *argv[]){
|
||||
int i;
|
||||
for (i = 0; i < argc; ++i)
|
||||
sprintf(cmd, "%s %s", cmd, argv[i]);
|
||||
sprintf(cmd,"%s -stopserver --port %d &", cmd, portno + 1);
|
||||
sprintf(cmd,"%s -stopserver -port %d &", cmd, portno + 1);
|
||||
FILE_LOG(logDEBUG1, ("Command to start stop server:%s\n", cmd));
|
||||
system(cmd);
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ extern char mess[MAX_STR_LENGTH];
|
||||
// Variables that will be exported
|
||||
int sockfd = 0;
|
||||
int debugflag = 0;
|
||||
int checkModuleFlag = 1;
|
||||
udpStruct udpDetails = {32410, 32411, 50001, 50002, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
int configured = FAIL;
|
||||
char configureMessage[MAX_STR_LENGTH]="udp parameters not configured yet";
|
||||
@ -484,7 +485,7 @@ void function_table() {
|
||||
flist[F_GET_INJECT_CHANNEL] = &get_inject_channel;
|
||||
flist[F_SET_VETO_PHOTON] = &set_veto_photon;
|
||||
flist[F_GET_VETO_PHOTON] = &get_veto_photon;
|
||||
flist[F_SET_VETO_REFERENCE] = &set_veto_refernce;
|
||||
flist[F_SET_VETO_REFERENCE] = &set_veto_reference;
|
||||
flist[F_GET_BURST_MODE] = &get_burst_mode;
|
||||
flist[F_SET_BURST_MODE] = &set_burst_mode;
|
||||
flist[F_SET_ADC_ENABLE_MASK_10G] = &set_adc_enable_mask_10g;
|
||||
@ -685,10 +686,6 @@ int set_timing_mode(int file_des) {
|
||||
return printSocketReadError();
|
||||
FILE_LOG(logDEBUG1, ("Setting external communication mode to %d\n", arg));
|
||||
|
||||
#ifdef GOTTHARD2D
|
||||
functionNotImplemented();
|
||||
#else
|
||||
|
||||
// set
|
||||
if ((arg != GET_TIMING_MODE) && (Server_VerifyLock() == OK)) {
|
||||
switch (arg) {
|
||||
@ -709,7 +706,6 @@ int set_timing_mode(int file_des) {
|
||||
retval = getTiming();
|
||||
validate((int)arg, (int)retval, "set timing mode", DEC);
|
||||
FILE_LOG(logDEBUG1, ("Timing Mode: %d\n",retval));
|
||||
#endif
|
||||
|
||||
return Server_SendResult(file_des, INT32, UPDATE, &retval, sizeof(retval));
|
||||
}
|
||||
@ -1000,8 +996,8 @@ int set_dac(int file_des) {
|
||||
case VCOM_CDS:
|
||||
serverDacIndex = G2_VCOM_CDS;
|
||||
break;
|
||||
case VREF_RESTORE:
|
||||
serverDacIndex = G2_VREF_RESTORE;
|
||||
case VREF_RSTORE:
|
||||
serverDacIndex = G2_VREF_RSTORE;
|
||||
break;
|
||||
case VB_OPA_1ST:
|
||||
serverDacIndex = G2_VB_OPA_1ST;
|
||||
@ -1658,7 +1654,7 @@ int set_settings(int file_des) {
|
||||
if (receiveData(file_des, &isett, sizeof(isett), INT32) < 0)
|
||||
return printSocketReadError();
|
||||
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
FILE_LOG(logDEBUG1, ("Setting settings %d\n", isett));
|
||||
@ -1682,12 +1678,16 @@ int set_settings(int file_des) {
|
||||
case LOWGAIN:
|
||||
case MEDIUMGAIN:
|
||||
case VERYHIGHGAIN:
|
||||
#elif GOTTHARD2D
|
||||
case DYNAMICGAIN:
|
||||
case FIXGAIN1:
|
||||
case FIXGAIN2:
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
if (myDetectorType == EIGER) {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Cannot set settings via SET_SETTINGS, use SET_MODULE\n");
|
||||
sprintf(mess, "Cannot set settings via SET_SETTINGS, use SET_MODULE (set threshold)\n");
|
||||
FILE_LOG(logERROR,(mess));
|
||||
} else
|
||||
modeNotImplemented("Settings Index", (int)isett);
|
||||
@ -1700,6 +1700,7 @@ int set_settings(int file_des) {
|
||||
FILE_LOG(logDEBUG1, ("Settings: %d\n", retval));
|
||||
validate((int)isett, (int)retval, "set settings", DEC);
|
||||
#if defined(JUNGFRAUD) || defined (GOTTHARDD)
|
||||
// gotthard2 does not set default dacs
|
||||
if (ret == OK && isett >= 0) {
|
||||
ret = setDefaultDacs();
|
||||
if (ret == FAIL) {
|
||||
@ -1782,6 +1783,12 @@ int start_acquisition(int file_des) {
|
||||
FILE_LOG(logERROR,(mess));
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef GOTTHARD2D
|
||||
if (updateAcquisitionRegisters(mess) == FAIL) {
|
||||
ret = FAIL;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (configured == FAIL) {
|
||||
ret = FAIL;
|
||||
@ -1792,12 +1799,8 @@ int start_acquisition(int file_des) {
|
||||
if (ret == FAIL) {
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(VIRTUAL)
|
||||
sprintf(mess, "Could not start acquisition. Could not create udp socket in server. Check udp_dstip & udp_dstport.\n");
|
||||
#else
|
||||
#if defined(GOTTHARD2D)
|
||||
sprintf(mess, "Could not start acquisition due to #frames > %d in burst mode\n", MAX_FRAMES_IN_BURST_MODE);
|
||||
#else
|
||||
sprintf(mess, "Could not start acquisition\n");
|
||||
#endif
|
||||
#endif
|
||||
FILE_LOG(logERROR,(mess));
|
||||
}
|
||||
@ -1916,6 +1919,12 @@ int start_and_read_all(int file_des) {
|
||||
FILE_LOG(logERROR,(mess));
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef GOTTHARD2D
|
||||
if (updateAcquisitionRegisters(mess) == FAIL) {
|
||||
ret = FAIL;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (configured == FAIL) {
|
||||
ret = FAIL;
|
||||
@ -1926,12 +1935,8 @@ int start_and_read_all(int file_des) {
|
||||
if (ret == FAIL) {
|
||||
#if defined(VIRTUAL) || defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||
sprintf(mess, "Could not start acquisition. Could not create udp socket in server. Check udp_dstip & udp_dstport.\n");
|
||||
#else
|
||||
#if defined(GOTTHARD2D)
|
||||
sprintf(mess, "Could not start acquisition due to #frames > %d in burst mode\n", MAX_FRAMES_IN_BURST_MODE);
|
||||
#else
|
||||
sprintf(mess, "Could not start acquisition\n");
|
||||
#endif
|
||||
#endif
|
||||
FILE_LOG(logERROR,(mess));
|
||||
}
|
||||
@ -2225,7 +2230,7 @@ int get_delay_after_trigger(int file_des) {
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int64_t retval = -1;
|
||||
|
||||
#if !defined(JUNGFRAUD) && !defined(GOTTHARDD) && !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D)
|
||||
#if !defined(JUNGFRAUD) && !defined(GOTTHARDD) && !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// get only
|
||||
@ -2244,7 +2249,7 @@ int set_delay_after_trigger(int file_des) {
|
||||
return printSocketReadError();
|
||||
FILE_LOG(logDEBUG1, ("Setting delay after trigger %lld ns\n", (long long int)arg));
|
||||
|
||||
#if !defined(JUNGFRAUD) && !defined(GOTTHARDD) && !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D)
|
||||
#if !defined(JUNGFRAUD) && !defined(GOTTHARDD) && !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// only set
|
||||
@ -2458,7 +2463,7 @@ int get_period_left(int file_des) {
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int64_t retval = -1;
|
||||
|
||||
#if !defined(JUNGFRAUD) && !defined(GOTTHARDD) && !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D)
|
||||
#if !defined(JUNGFRAUD) && !defined(GOTTHARDD) && !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// get only
|
||||
@ -2473,7 +2478,7 @@ int get_delay_after_trigger_left(int file_des) {
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int64_t retval = -1;
|
||||
|
||||
#if !defined(JUNGFRAUD) && !defined(GOTTHARDD) && !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D)
|
||||
#if !defined(JUNGFRAUD) && !defined(GOTTHARDD) && !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// get only
|
||||
@ -2518,7 +2523,7 @@ int get_frames_from_start(int file_des) {
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int64_t retval = -1;
|
||||
|
||||
#if !defined(JUNGFRAUD) && !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D)
|
||||
#if !defined(JUNGFRAUD) && !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// get only
|
||||
@ -2533,7 +2538,7 @@ int get_actual_time(int file_des) {
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int64_t retval = -1;
|
||||
|
||||
#if !defined(JUNGFRAUD) && !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D)
|
||||
#if !defined(JUNGFRAUD) && !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// get only
|
||||
@ -2548,7 +2553,7 @@ int get_measurement_time(int file_des) {
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int64_t retval = -1;
|
||||
|
||||
#if !defined(JUNGFRAUD) && !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D)
|
||||
#if !defined(JUNGFRAUD) && !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// get only
|
||||
@ -3190,7 +3195,7 @@ int set_pattern_mask(int file_des) {
|
||||
return printSocketReadError();
|
||||
FILE_LOG(logDEBUG1, ("Set Pattern Mask to %d\n", arg));
|
||||
|
||||
#if (!defined(MOENCHD)) && (!defined(CHIPTESTBOARDD))
|
||||
#if !defined(MOENCHD) && !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// only set
|
||||
@ -3211,7 +3216,7 @@ int get_pattern_mask(int file_des) {
|
||||
|
||||
FILE_LOG(logDEBUG1, ("Get Pattern Mask\n"));
|
||||
|
||||
#if (!defined(MOENCHD)) && (!defined(CHIPTESTBOARDD))
|
||||
#if !defined(MOENCHD) && !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// only get
|
||||
@ -3231,7 +3236,7 @@ int set_pattern_bit_mask(int file_des) {
|
||||
return printSocketReadError();
|
||||
FILE_LOG(logDEBUG1, ("Set Pattern Bit Mask to %d\n", arg));
|
||||
|
||||
#if (!defined(MOENCHD)) && (!defined(CHIPTESTBOARDD))
|
||||
#if !defined(MOENCHD) && !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// only set
|
||||
@ -3252,7 +3257,7 @@ int get_pattern_bit_mask(int file_des){
|
||||
|
||||
FILE_LOG(logDEBUG1, ("Get Pattern Bit Mask\n"));
|
||||
|
||||
#if (!defined(MOENCHD)) && (!defined(CHIPTESTBOARDD))
|
||||
#if !defined(MOENCHD) && !defined(CHIPTESTBOARDD) && !defined(MYTHEN3D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// only get
|
||||
@ -3836,27 +3841,31 @@ int power_chip(int file_des) {
|
||||
return printSocketReadError();
|
||||
FILE_LOG(logDEBUG1, ("Powering chip to %d\n", arg));
|
||||
|
||||
#if (!defined(JUNGFRAUD)) && (!defined(MOENCHD)) && (!defined(MYTHEN3D))
|
||||
#if !defined(JUNGFRAUD) && !defined(MOENCHD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// set & get
|
||||
if ((arg == -1) || (Server_VerifyLock() == OK)) {
|
||||
#ifdef MYTHEN3D
|
||||
#if defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||
// check only when powering on
|
||||
if (arg != -1 && arg != 0) {
|
||||
int type_ret = checkDetectorType();
|
||||
if (type_ret == -1) {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Could not power on chip. Could not open file to get type of module attached.\n");
|
||||
FILE_LOG(logERROR,(mess));
|
||||
} else if (type_ret == -2) {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Could not power on chip. No module attached!\n");
|
||||
FILE_LOG(logERROR,(mess));
|
||||
} else if (type_ret == FAIL) {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Could not power on chip. Wrong module attached!\n");
|
||||
FILE_LOG(logERROR,(mess));
|
||||
if (checkModuleFlag) {
|
||||
int type_ret = checkDetectorType();
|
||||
if (type_ret == -1) {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Could not power on chip. Could not open file to get type of module attached.\n");
|
||||
FILE_LOG(logERROR,(mess));
|
||||
} else if (type_ret == -2) {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Could not power on chip. No module attached!\n");
|
||||
FILE_LOG(logERROR,(mess));
|
||||
} else if (type_ret == FAIL) {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Could not power on chip. Wrong module attached!\n");
|
||||
FILE_LOG(logERROR,(mess));
|
||||
}
|
||||
} else {
|
||||
FILE_LOG(logINFOBLUE, ("In No-Module mode: Ignoring module type. Continuing.\n"));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -6446,7 +6455,7 @@ int get_veto_photon(int file_des) {
|
||||
}
|
||||
|
||||
|
||||
int set_veto_refernce(int file_des) {
|
||||
int set_veto_reference(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int args[2] = {-1, -1};
|
||||
@ -6486,22 +6495,35 @@ int set_veto_refernce(int file_des) {
|
||||
int set_burst_mode(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int arg = -1;
|
||||
enum burstMode arg = BURST_OFF;
|
||||
|
||||
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||
return printSocketReadError();
|
||||
FILE_LOG(logINFO, ("Setting burst mode: %d\n", arg));
|
||||
FILE_LOG(logDEBUG1, ("Setting burst mode: %d\n", arg));
|
||||
|
||||
#ifndef GOTTHARD2D
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// only set
|
||||
if (Server_VerifyLock() == OK) {
|
||||
arg = arg == 0 ? 0 : 1;
|
||||
ret = setBurstMode(arg);
|
||||
if (ret == FAIL) {
|
||||
sprintf(mess, "Could not set burst mode to %d\n", arg);
|
||||
FILE_LOG(logERROR, (mess));
|
||||
switch (arg) {
|
||||
case BURST_OFF:
|
||||
case BURST_INTERNAL:
|
||||
case BURST_EXTERNAL:
|
||||
break;
|
||||
default:
|
||||
modeNotImplemented("Burst mode", (int)arg);
|
||||
break;
|
||||
}
|
||||
if (ret == OK) {
|
||||
setBurstMode(arg);
|
||||
enum burstMode retval = getBurstMode();
|
||||
FILE_LOG(logDEBUG, ("burst mode retval: %d\n", retval));
|
||||
if (retval != arg) {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Could not set burst type. Set %d, got %d\n", arg, retval);
|
||||
FILE_LOG(logERROR, (mess));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -6512,7 +6534,7 @@ int set_burst_mode(int file_des) {
|
||||
int get_burst_mode(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int retval = -1;
|
||||
enum burstMode retval = BURST_OFF;
|
||||
|
||||
FILE_LOG(logDEBUG1, ("Getting burst mode\n"));
|
||||
|
||||
@ -6521,7 +6543,7 @@ int get_burst_mode(int file_des) {
|
||||
#else
|
||||
// get only
|
||||
retval = getBurstMode();
|
||||
FILE_LOG(logDEBUG1, ("Get burst mode:%d\n", retval));
|
||||
FILE_LOG(logDEBUG1, ("Get burst mode retval:%d\n", retval));
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, UPDATE, &retval, sizeof(retval));
|
||||
}
|
||||
@ -6580,4 +6602,4 @@ int get_counter_mask(int file_des) {
|
||||
FILE_LOG(logDEBUG, ("counter mask retval: 0x%x\n", retval));
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, UPDATE, &retval, sizeof(retval));
|
||||
}
|
||||
}
|
||||
|
@ -95,10 +95,13 @@ class Detector {
|
||||
*/
|
||||
void setDetectorSize(const defs::xy value);
|
||||
|
||||
/** [Jungfrau][Gotthard] */
|
||||
/** [Jungfrau][Gotthard][Gotthard2] */
|
||||
Result<defs::detectorSettings> getSettings(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau][Gotthard] */
|
||||
/** [Jungfrau] Options:DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2, FORCESWITCHG1, FORCESWITCHG2
|
||||
* [Gotthard] Options: DYNAMICGAIN, HIGHGAIN, LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN
|
||||
* [Gotthard2] Options: DYNAMICGAIN, FIXGAIN1, FIXGAIN2
|
||||
*/
|
||||
void setSettings(defs::detectorSettings value, Positions pos = {});
|
||||
|
||||
/**************************************************
|
||||
@ -152,23 +155,37 @@ class Detector {
|
||||
|
||||
void setPeriod(ns t, Positions pos = {});
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3] */
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
Result<ns> getDelayAfterTrigger(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3] */
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
void setDelayAfterTrigger(ns value, Positions pos = {});
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3][Gotthard2] */
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
Result<int64_t> getNumberOfFramesLeft(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3][Gotthard2] */
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
Result<int64_t> getNumberOfTriggersLeft(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB] */
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
Result<ns> getPeriodLeft(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
Result<ns> getDelayAfterTriggerLeft(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB] */
|
||||
Result<ns> getPeriodLeft(Positions pos = {}) const;
|
||||
Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* [Gotthard][Jungfrau][CTB] Options: AUTO_TIMING, TRIGGER_EXPOSURE
|
||||
* [Eiger] Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER
|
||||
*/
|
||||
void setTimingMode(defs::timingMode value, Positions pos = {});
|
||||
|
||||
/** [Eiger][Jungfrau] */
|
||||
Result<defs::speedLevel> getSpeed(Positions pos = {}) const;
|
||||
@ -192,39 +209,45 @@ class Detector {
|
||||
/** [Gotthard][Jungfrau][CTB] */
|
||||
void setADCPhaseInDegrees(int value, Positions pos = {});
|
||||
|
||||
/** [Gotthard2] Hz */
|
||||
/** [Mythen3][Gotthard2] Hz */
|
||||
Result<int> getClockFrequency(int clkIndex, Positions pos = {});
|
||||
|
||||
/** [not implemented] Hz */
|
||||
void setClockFrequency(int clkIndex, int value, Positions pos = {});
|
||||
|
||||
/** [Gotthard2] */
|
||||
/** [Mythen3][Gotthard2] */
|
||||
Result<int> getClockPhase(int clkIndex, Positions pos = {});
|
||||
|
||||
/** [Gotthard2] */
|
||||
/** [Mythen3][Gotthard2] */
|
||||
void setClockPhase(int clkIndex, int value, Positions pos = {});
|
||||
|
||||
/** [Gotthard2] */
|
||||
/** [Mythen3][Gotthard2] */
|
||||
Result<int> getMaxClockPhaseShift(int clkIndex, Positions pos = {});
|
||||
|
||||
/** [Gotthard2] */
|
||||
/** [Mythen3][Gotthard2] */
|
||||
Result<int> getClockPhaseinDegrees(int clkIndex, Positions pos = {});
|
||||
|
||||
/** [Gotthard2] */
|
||||
/** [Mythen3][Gotthard2] */
|
||||
void setClockPhaseinDegrees(int clkIndex, int value, Positions pos = {});
|
||||
|
||||
/** [Gotthard2] */
|
||||
/** [Mythen3][Gotthard2] */
|
||||
Result<int> getClockDivider(int clkIndex, Positions pos = {});
|
||||
|
||||
/** [Gotthard2] */
|
||||
/** [Mythen3][Gotthard2] */
|
||||
void setClockDivider(int clkIndex, int value, Positions pos = {});
|
||||
|
||||
Result<int> getHighVoltage(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau][Mythen3][Gotthard2] */
|
||||
Result<bool> getPowerChip(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau][Mythen3][Gotthard2] */
|
||||
void setPowerChip(bool on, Positions pos = {});
|
||||
|
||||
/**
|
||||
* [Gotthard Options: 0, 90, 110, 120, 150, 180, 200]
|
||||
* [Jungfrau, CTB Options: 0, 60 - 200]
|
||||
* [Eiger Options: 0 - 200]
|
||||
* [Gotthard] Options: 0, 90, 110, 120, 150, 180, 200
|
||||
* [Jungfrau], CTB Options: 0, 60 - 200
|
||||
* [Eiger][Mythen3][Gotthard2] Options: 0 - 200
|
||||
*/
|
||||
void setHighVoltage(int value, Positions pos = {});
|
||||
|
||||
@ -249,14 +272,6 @@ class Detector {
|
||||
/* [Gotthard2] */
|
||||
void setOnChipDAC(defs::dacIndex index, int chipIndex, int value, Positions pos = {});
|
||||
|
||||
Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* [Gotthard, Jungfrau, CTB Options: AUTO_TIMING, TRIGGER_EXPOSURE]
|
||||
* [Eiger Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER]
|
||||
*/
|
||||
void setTimingMode(defs::timingMode value, Positions pos = {});
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
* Acquisition *
|
||||
@ -807,12 +822,6 @@ class Detector {
|
||||
/** [Jungfrau] */
|
||||
void resetTemperatureEvent(Positions pos = {});
|
||||
|
||||
/** [Jungfrau] */
|
||||
Result<bool> getPowerChip(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau] */
|
||||
void setPowerChip(bool on, Positions pos = {});
|
||||
|
||||
/** [Jungfrau] */
|
||||
Result<bool> getAutoCompDisable(Positions pos = {}) const;
|
||||
|
||||
@ -906,11 +915,11 @@ class Detector {
|
||||
/** [Gotthard2] */
|
||||
void setVetoReference(const int gainIndex, const int value, Positions pos = {});
|
||||
|
||||
/** [Gotthard2] burst mode or continuous mode */
|
||||
void setBurstMode(bool enable, Positions pos = {});
|
||||
|
||||
/** [Gotthard2] */
|
||||
Result<bool> getBurstMode(Positions pos = {});
|
||||
Result<defs::burstMode> getBurstMode(Positions pos = {});
|
||||
|
||||
/** [Gotthard2] BURST_OFF, BURST_INTERNAL (default), BURST_EXTERNAL */
|
||||
void setBurstMode(defs::burstMode value, Positions pos = {});
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
@ -1100,52 +1109,54 @@ class Detector {
|
||||
/** [CTB] */
|
||||
void setPatternClockControl(uint64_t word, Positions pos = {});
|
||||
|
||||
/** [CTB] same as executing */
|
||||
/** [CTB] same as executing
|
||||
* [Mythen3] */
|
||||
Result<uint64_t> getPatternWord(int addr, Positions pos = {});
|
||||
|
||||
/** [CTB] Caution: If word is -1 reads the addr (same as
|
||||
* executing the pattern) */
|
||||
* executing the pattern)
|
||||
* [Mythen3] */
|
||||
void setPatternWord(int addr, uint64_t word, Positions pos = {});
|
||||
|
||||
/**[CTB] Options: level: -1 (complete pattern) and 0-2 levels
|
||||
/**[CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2 levels
|
||||
* @returns array of start address and stop address
|
||||
*/
|
||||
Result<std::array<int, 2>> getPatternLoopAddresses(int level,
|
||||
Positions pos = {}) const;
|
||||
|
||||
/** [CTB] Options: level: -1 (complete pattern) and 0-2 levels */
|
||||
/** [CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2 levels */
|
||||
void setPatternLoopAddresses(int level, int start, int stop, Positions pos = {});
|
||||
|
||||
/**[CTB] Options: level: -1 (complete pattern) and 0-2 levels
|
||||
/**[CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2 levels
|
||||
* @returns number of loops
|
||||
*/
|
||||
Result<int> getPatternLoopCycles(int level, Positions pos = {}) const;
|
||||
|
||||
/** [CTB] n: 0-2, level: -1 (complete pattern) and 0-2 levels */
|
||||
/** [CTB][Mythen3] n: 0-2, level: -1 (complete pattern) and 0-2 levels */
|
||||
void setPatternLoopCycles(int level, int n, Positions pos = {});
|
||||
|
||||
/* [CTB] */
|
||||
/* [CTB][Mythen3] */
|
||||
Result<int> getPatternWaitAddr(int level, Positions pos = {}) const;
|
||||
|
||||
/** [CTB] Options: level 0-2 */
|
||||
/** [CTB][Mythen3] Options: level 0-2 */
|
||||
void setPatternWaitAddr(int level, int addr, Positions pos = {});
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Mythen3] */
|
||||
Result<uint64_t> getPatternWaitTime(int level, Positions pos = {}) const;
|
||||
|
||||
/** [CTB] Options: level 0-2 */
|
||||
/** [CTB][Mythen3] Options: level 0-2 */
|
||||
void setPatternWaitTime(int level, uint64_t t, Positions pos = {});
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Mythen3] */
|
||||
Result<uint64_t> getPatternMask(Positions pos = {});
|
||||
|
||||
/** [CTB] Sets the mask applied to every pattern to the selected bit mask */
|
||||
/** [CTB][Mythen3] Sets the mask applied to every pattern to the selected bit mask */
|
||||
void setPatternMask(uint64_t mask, Positions pos = {});
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB][Mythen3] */
|
||||
Result<uint64_t> getPatternBitMask(Positions pos = {}) const;
|
||||
|
||||
/** [CTB] Sets the bitmask that the mask will be applied to for every
|
||||
/** [CTB][Mythen3] Sets the bitmask that the mask will be applied to for every
|
||||
* pattern
|
||||
*/
|
||||
void setPatternBitMask(uint64_t mask, Positions pos = {});
|
||||
@ -1243,10 +1254,10 @@ class Detector {
|
||||
|
||||
void clearBit(uint32_t addr, int bitnr, Positions pos = {});
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB] */
|
||||
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB] */
|
||||
void executeFirmwareTest(Positions pos = {});
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB] */
|
||||
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB] */
|
||||
void executeBusTest(Positions pos = {});
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB] not possible to read back*/
|
||||
@ -1280,13 +1291,16 @@ class Detector {
|
||||
/** Execute a command on the detector server console */
|
||||
void executeCommand(const std::string &value, Positions pos = {});
|
||||
|
||||
/** [Jungfrau][CTB] */
|
||||
/** [Jungfrau][Mythen3][CTB]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
Result<int64_t> getNumberOfFramesFromStart(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau][CTB] Get time from detector start */
|
||||
/** [Jungfrau][Mythen3][CTB] Get time from detector start
|
||||
* [Gotthard2] only in continuous mode */
|
||||
Result<ns> getActualTime(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau][CTB] Get timestamp at a frame start */
|
||||
/** [Jungfrau][Mythen3][CTB] Get timestamp at a frame start
|
||||
* [Gotthard2] only in continuous mode */
|
||||
Result<ns> getMeasurementTime(Positions pos = {}) const;
|
||||
|
||||
std::string getUserDetails() const;
|
||||
|
@ -581,6 +581,7 @@ std::string CmdProxy::ClockDivider(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
/** temperature */
|
||||
/* dacs */
|
||||
std::string CmdProxy::Dac(int action) {
|
||||
std::ostringstream os;
|
||||
@ -696,7 +697,7 @@ std::vector<std::string> CmdProxy::DacCommands() {
|
||||
case defs::GOTTHARD2:
|
||||
return std::vector<std::string>{
|
||||
"vref_h_adc", "vb_comp_fe", "vb_comp_adc", "vcom_cds",
|
||||
"vref_restore", "vb_opa_1st", "vref_comp_fe", "vcom_adc1",
|
||||
"vref_rstore", "vb_opa_1st", "vref_comp_fe", "vcom_adc1",
|
||||
"vref_prech", "vref_l_adc", "vref_cds", "vb_cs",
|
||||
"vb_opa_fd", "vcom_adc2"};
|
||||
break;
|
||||
@ -757,11 +758,8 @@ std::string CmdProxy::Threshold(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[eV] [(optinal settings) standard, fast, highgain, dynamicgain, "
|
||||
"lowgain, mediumgain, veryhighgain, dynamichg0, fixgain1, "
|
||||
"fixgain2, forceswitchg1, forceswitchg2]\n\t[Eiger] Threshold in "
|
||||
"eV"
|
||||
<< '\n';
|
||||
os << "[eV] [(optinal settings) standard, lowgain, veryhighgain, verylowgain]"
|
||||
"\n\t[Eiger] Threshold in eV" << '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (!args.empty()) {
|
||||
WrongNumberOfParameters(0);
|
||||
@ -792,10 +790,8 @@ std::string CmdProxy::ThresholdNoTb(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[eV] [(optional settings) standard, fast, highgain, "
|
||||
"dynamicgain, lowgain, mediumgain, veryhighgain, dynamichg0, "
|
||||
"fixgain1, fixgain2, forceswitchg1, forceswitchg2]\n\t[Eiger] "
|
||||
"Threshold in eV set without setting trimbits"
|
||||
os << "[eV] [(optional settings) standard, lowgain, veryhighgain, verylowgain]"
|
||||
"\n\t[Eiger] Threshold in eV set without setting trimbits"
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
throw sls::RuntimeError("cannot get");
|
||||
@ -1229,6 +1225,51 @@ std::string CmdProxy::VetoReference(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string CmdProxy::BurstMode(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[off or 0, internal or 1, external or 2]\n\t[Gotthard2] Default is burst internal type"
|
||||
<< '\n';
|
||||
} else {
|
||||
if (action == defs::GET_ACTION) {
|
||||
if (!args.empty()) {
|
||||
WrongNumberOfParameters(0);
|
||||
}
|
||||
auto t = det->getBurstMode({det_id});
|
||||
os << OutString(t) << '\n';
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
if (args.size() != 1) {
|
||||
WrongNumberOfParameters(1);
|
||||
}
|
||||
defs::burstMode t;
|
||||
try {
|
||||
int ival = std::stoi(args[0]);
|
||||
switch (ival) {
|
||||
case 0:
|
||||
t = defs::BURST_OFF;
|
||||
break;
|
||||
case 1:
|
||||
t = defs::BURST_INTERNAL;
|
||||
break;
|
||||
case 2:
|
||||
t = defs::BURST_EXTERNAL;
|
||||
break;
|
||||
default:
|
||||
throw sls::RuntimeError("Unknown burst mode " + args[0]);
|
||||
}
|
||||
} catch (...) {
|
||||
t = sls::StringTo<defs::burstMode>(args[0]);
|
||||
}
|
||||
det->setBurstMode(t, {det_id});
|
||||
os << sls::ToString(t) << '\n'; // no args to convert 0,1,2 as well
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown action");
|
||||
}
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
/* Mythen3 Specific */
|
||||
|
||||
std::string CmdProxy::Counters(int action) {
|
||||
@ -1454,7 +1495,7 @@ std::string CmdProxy::Pattern(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[fname]\n\t[Ctb] Loads binary pattern file with only pattern "
|
||||
os << "[fname]\n\t[Mythen3][Ctb] Loads binary pattern file with only pattern "
|
||||
"words"
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
@ -1475,7 +1516,7 @@ std::string CmdProxy::PatternWord(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[step or address] [64 bit mask]\n\t[Ctb] 64 bit pattern at "
|
||||
os << "[step or address] [64 bit mask]\n\t[Ctb][Mythen3] 64 bit pattern at "
|
||||
"address of pattern memory."
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
@ -1501,17 +1542,17 @@ std::string CmdProxy::PatternLoopAddresses(int action) {
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
if (cmd == "patlimits") {
|
||||
os << "[start addr] [stop addr] \n\t[Ctb] Limits of complete "
|
||||
os << "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of complete "
|
||||
"pattern."
|
||||
<< '\n';
|
||||
} else if (cmd == "patloop0") {
|
||||
os << "[start addr] [stop addr] \n\t[Ctb] Limits of loop 0."
|
||||
os << "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of loop 0."
|
||||
<< '\n';
|
||||
} else if (cmd == "patloop1") {
|
||||
os << "[start addr] [stop addr] \n\t[Ctb] Limits of loop 1."
|
||||
os << "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of loop 1."
|
||||
<< '\n';
|
||||
} else if (cmd == "patloop2") {
|
||||
os << "[start addr] [stop addr] \n\t[Ctb] Limits of loop 2."
|
||||
os << "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of loop 2."
|
||||
<< '\n';
|
||||
} else {
|
||||
throw sls::RuntimeError(
|
||||
@ -1556,11 +1597,11 @@ std::string CmdProxy::PatternLoopCycles(int action) {
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
if (cmd == "patnloop0") {
|
||||
os << "[n_cycles] \n\t[Ctb] Number of cycles of loop 0." << '\n';
|
||||
os << "[n_cycles] \n\t[Ctb][Mythen3] Number of cycles of loop 0." << '\n';
|
||||
} else if (cmd == "patnloop1") {
|
||||
os << "[n_cycles] \n\t[Ctb] Number of cycles of loop 1." << '\n';
|
||||
os << "[n_cycles] \n\t[Ctb][Mythen3] Number of cycles of loop 1." << '\n';
|
||||
} else if (cmd == "patnloop2") {
|
||||
os << "[n_cycles] \n\t[Ctb] Number of cycles of loop 2." << '\n';
|
||||
os << "[n_cycles] \n\t[Ctb][Mythen3] Number of cycles of loop 2." << '\n';
|
||||
} else {
|
||||
throw sls::RuntimeError(
|
||||
"Unknown command, use list to list all commands");
|
||||
@ -1601,11 +1642,11 @@ std::string CmdProxy::PatternWaitAddress(int action) {
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
if (cmd == "patwait0") {
|
||||
os << "[addr] \n\t[Ctb] Wait 0 address." << '\n';
|
||||
os << "[addr] \n\t[Ctb][Mythen3] Wait 0 address." << '\n';
|
||||
} else if (cmd == "patwait1") {
|
||||
os << "[addr] \n\t[Ctb] Wait 1 address." << '\n';
|
||||
os << "[addr] \n\t[Ctb][Mythen3] Wait 1 address." << '\n';
|
||||
} else if (cmd == "patwait2") {
|
||||
os << "[addr] \n\t[Ctb] Wait 2 address." << '\n';
|
||||
os << "[addr] \n\t[Ctb][Mythen3] Wait 2 address." << '\n';
|
||||
} else {
|
||||
throw sls::RuntimeError(
|
||||
"Unknown command, use list to list all commands");
|
||||
@ -1646,11 +1687,11 @@ std::string CmdProxy::PatternWaitTime(int action) {
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
if (cmd == "patwaittime0") {
|
||||
os << "[n_clk] \n\t[Ctb] Wait 0 time in clock cycles." << '\n';
|
||||
os << "[n_clk] \n\t[Ctb][Mythen3] Wait 0 time in clock cycles." << '\n';
|
||||
} else if (cmd == "patwaittime1") {
|
||||
os << "[n_clk] \n\t[Ctb] Wait 1 time in clock cycles." << '\n';
|
||||
os << "[n_clk] \n\t[Ctb][Mythen3] Wait 1 time in clock cycles." << '\n';
|
||||
} else if (cmd == "patwaittime2") {
|
||||
os << "[n_clk] \n\t[Ctb] Wait 2 time in clock cycles." << '\n';
|
||||
os << "[n_clk] \n\t[Ctb][Mythen3] Wait 2 time in clock cycles." << '\n';
|
||||
} else {
|
||||
throw sls::RuntimeError(
|
||||
"Unknown command, use list to list all commands");
|
||||
|
@ -478,6 +478,7 @@ class CmdProxy {
|
||||
{"cyclesl", "triggersl"},
|
||||
{"clkdivider", "speed"},
|
||||
|
||||
/** temperature */
|
||||
/** dacs */
|
||||
{"vcall", "vcal"},
|
||||
|
||||
@ -578,6 +579,7 @@ class CmdProxy {
|
||||
{"triggersl", &CmdProxy::triggersl},
|
||||
{"delayl", &CmdProxy::delayl},
|
||||
{"periodl", &CmdProxy::periodl},
|
||||
{"timing", &CmdProxy::timing},
|
||||
{"speed", &CmdProxy::Speed},
|
||||
{"adcphase", &CmdProxy::Adcphase},
|
||||
{"maxadcphaseshift", &CmdProxy::maxadcphaseshift},
|
||||
@ -586,6 +588,9 @@ class CmdProxy {
|
||||
{"maxclkphaseshift", &CmdProxy::MaxClockPhaseShift},
|
||||
{"clkdiv", &CmdProxy::ClockDivider},
|
||||
{"vhighvoltage", &CmdProxy::vhighvoltage},
|
||||
{"powerchip", &CmdProxy::powerchip},
|
||||
|
||||
/** temperature */
|
||||
{"temp_adc", &CmdProxy::temp_adc},
|
||||
{"temp_fpga", &CmdProxy::temp_fpga},
|
||||
{"temp_fpgaext", &CmdProxy::temp_fpgaext},
|
||||
@ -595,7 +600,6 @@ class CmdProxy {
|
||||
{"temp_sodr", &CmdProxy::temp_sodr},
|
||||
{"temp_fpgafl", &CmdProxy::temp_fpgafl},
|
||||
{"temp_fpgafr", &CmdProxy::temp_fpgafr},
|
||||
{"timing", &CmdProxy::timing},
|
||||
|
||||
/* dacs */
|
||||
{"vthreshold", &CmdProxy::vthreshold},
|
||||
@ -644,7 +648,7 @@ class CmdProxy {
|
||||
{"vb_comp_fe", &CmdProxy::vb_comp_fe},
|
||||
{"vb_comp_adc", &CmdProxy::vb_comp_adc},
|
||||
{"vcom_cds", &CmdProxy::vcom_cds},
|
||||
{"vref_restore", &CmdProxy::vref_restore},
|
||||
{"vref_rstore", &CmdProxy::vref_rstore},
|
||||
{"vb_opa_1st", &CmdProxy::vb_opa_1st},
|
||||
{"vref_comp_fe", &CmdProxy::vref_comp_fe},
|
||||
{"vcom_adc1", &CmdProxy::vcom_adc1},
|
||||
@ -767,7 +771,6 @@ class CmdProxy {
|
||||
{"temp_threshold", &CmdProxy::temp_threshold},
|
||||
{"temp_control", &CmdProxy::temp_control},
|
||||
{"temp_event", &CmdProxy::TemperatureEvent},
|
||||
{"powerchip", &CmdProxy::powerchip},
|
||||
{"auto_comp_disable", &CmdProxy::auto_comp_disable},
|
||||
{"storagecells", &CmdProxy::storagecells},
|
||||
{"storagecell_start", &CmdProxy::storagecell_start},
|
||||
@ -784,7 +787,7 @@ class CmdProxy {
|
||||
{"inj_ch", &CmdProxy::InjectChannel},
|
||||
{"vetophoton", &CmdProxy::VetoPhoton},
|
||||
{"vetoref", &CmdProxy::VetoReference},
|
||||
{"burstmode", &CmdProxy::burstmode},
|
||||
{"burstmode", &CmdProxy::BurstMode},
|
||||
|
||||
/* Mythen3 Specific */
|
||||
{"counters", &CmdProxy::Counters},
|
||||
@ -911,6 +914,7 @@ class CmdProxy {
|
||||
std::string ClockPhase(int action);
|
||||
std::string MaxClockPhaseShift(int action);
|
||||
std::string ClockDivider(int action);
|
||||
/** temperature */
|
||||
/* dacs */
|
||||
std::string Dac(int action);
|
||||
std::string DacList(int action);
|
||||
@ -943,6 +947,7 @@ class CmdProxy {
|
||||
std::string InjectChannel(int action);
|
||||
std::string VetoPhoton(int action);
|
||||
std::string VetoReference(int action);
|
||||
std::string BurstMode(int action);
|
||||
/* Mythen3 Specific */
|
||||
std::string Counters(int action);
|
||||
/* CTB Specific */
|
||||
@ -993,44 +998,71 @@ class CmdProxy {
|
||||
"\n\tSerial number or MAC of detector (hex).");
|
||||
|
||||
INTEGER_COMMAND(settings, getSettings, setSettings, sls::StringTo<slsDetectorDefs::detectorSettings>,
|
||||
"[standard, fast, highgain, dynamicgain, lowgain, mediumgain, veryhighgain, dynamichg0, fixgain1, fixgain2, forceswitchg1, forceswitchg2]\n\t[Jungfrau][Gotthard] Detector Settings.\n\t[Eiger] Use threshold or thresholdnotb.");
|
||||
"[standard, fast, highgain, dynamicgain, lowgain, mediumgain, veryhighgain, dynamichg0, fixgain1, fixgain2, forceswitchg1, forceswitchg2, verylowgain]"
|
||||
"\n\t[Jungfrau] - Detector Settings [dynamicgain | dynamichg0 | fixgain1 | fixgain2 | forceswitchg1 | forceswitchg2]"
|
||||
"\n\t[Gotthard] - Detector Settings [dynamicgain | highgain | lowgain | mediumgain | veryhighgain]"
|
||||
"\n\t[Gotthard2] - Detector Settings [dynamicgain | fixgain1 | fixgain2]"
|
||||
"\n\t[Eiger] Use threshold or thresholdnotb.");
|
||||
|
||||
/* acquisition parameters */
|
||||
|
||||
INTEGER_COMMAND_NOID(frames, getNumberOfFrames, setNumberOfFrames,
|
||||
std::stol,
|
||||
"[n_frames]\n\tNumber of frames per aquire. In trigger mode, number of frames per trigger.");
|
||||
"[n_frames]\n\tNumber of frames per aquire. In trigger mode, number of frames per trigger."
|
||||
"\n\t[Gotthard2] Burst mode has a maximum of 2720 frames. Frames number for both modes are uploaded to detector just before acquisition starts");
|
||||
|
||||
INTEGER_COMMAND_NOID(triggers, getNumberOfTriggers, setNumberOfTriggers,
|
||||
std::stol,
|
||||
"[n_triggers]\n\tNumber of triggers per aquire. Use timing command to set timing mode.");
|
||||
|
||||
TIME_COMMAND(exptime, getExptime, setExptime,
|
||||
"[duration] [(optional unit) ns|us|ms|s]\n\tExposure time");
|
||||
"[duration] [(optional unit) ns|us|ms|s]\n\tExposure time"
|
||||
"\n\t[Gotthard2] Uploaded to detector just before acquisition starts");
|
||||
|
||||
TIME_COMMAND(period, getPeriod, setPeriod,
|
||||
"[duration] [(optional unit) ns|us|ms|s]\n\tPeriod between frames");
|
||||
"[duration] [(optional unit) ns|us|ms|s]\n\tPeriod between frames"
|
||||
"\n\t[Gotthard2] Uploaded to detector just before acquisition starts");
|
||||
|
||||
TIME_COMMAND(delay, getDelayAfterTrigger, setDelayAfterTrigger,
|
||||
"[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau][Gotthard][Ctb][Mythen3] Delay after trigger");
|
||||
"[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb] Delay after trigger"
|
||||
"\n\t[Gotthard2] only in continuous mode.");
|
||||
|
||||
GET_COMMAND(framesl, getNumberOfFramesLeft,
|
||||
"\n\t[Gotthard][Jungfrau][CTB][Mythen3][Gotthard2] Number of frames left in acquisition.");
|
||||
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB] Number of frames left in acquisition."
|
||||
"\n\t[Gotthard2] only in continuous mode.");
|
||||
|
||||
GET_COMMAND(triggersl, getNumberOfTriggersLeft,
|
||||
"\n\t[Gotthard][Jungfrau][CTB][Mythen3][Gotthard2] Number of triggers left in acquisition.");
|
||||
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB] Number of triggers left in acquisition."
|
||||
"\n\t[Gotthard2] only in continuous mode.");
|
||||
|
||||
TIME_GET_COMMAND(delayl, getDelayAfterTriggerLeft,
|
||||
"\n\t[Gotthard][Jungfrau][CTB] DelayLeft Delay Left in Acquisition.");
|
||||
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB] DelayLeft Delay Left in Acquisition."
|
||||
"\n\t[Gotthard2] only in continuous mode.");
|
||||
|
||||
TIME_GET_COMMAND(periodl, getPeriodLeft,
|
||||
"\n\t[Gotthard][Jungfrau][CTB] Period left for current frame.");
|
||||
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB] Period left for current frame."
|
||||
"\n\t[Gotthard2] only in continuous mode.");
|
||||
|
||||
INTEGER_COMMAND(timing, getTimingMode, setTimingMode, sls::StringTo<slsDetectorDefs::timingMode>,
|
||||
"[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb] [auto|trigger]\n\t[Eiger] [auto|trigger|gating|burst_trigger]");
|
||||
|
||||
GET_COMMAND(maxadcphaseshift, getMaxADCPhaseShift,
|
||||
"\n\t[Jungfrau][CTB] Absolute maximum Phase shift of ADC clock.");
|
||||
|
||||
INTEGER_COMMAND(vhighvoltage, getHighVoltage, setHighVoltage, std::stoi,
|
||||
"[n_value]\n\tHigh voltage to the sensor in Voltage.\n\t[Gotthard] [0|90|110|120|150|180|200]\n\t[Eiger] 0-200\n\t[Jungfrau][Ctb] [0|60-200]");
|
||||
"[n_value]\n\tHigh voltage to the sensor in Voltage."
|
||||
"\n\t[Gotthard] [0|90|110|120|150|180|200]"
|
||||
"\n\t[Eiger][Mythen3][Gotthard2] 0-200"
|
||||
"\n\t[Jungfrau][Ctb] [0|60-200]");
|
||||
|
||||
INTEGER_COMMAND(powerchip, getPowerChip, setPowerChip, std::stoi,
|
||||
"[0, 1]\n\t[Jungfrau][Mythen3][Gotthard2] Power the chip. Default 0."
|
||||
"\n\t[Jungfrau] Get will return power status."
|
||||
"Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled."
|
||||
"\n\t[Mythen3] If module not connected or wrong module, 1 will fail. By default, not powered on"
|
||||
"\n\t[Gotthard2] If module not connected or wrong module, 1 will fail. By default, powered on at server start up.");
|
||||
|
||||
/** temperature */
|
||||
|
||||
GET_IND_COMMAND(temp_adc, getTemperature, slsDetectorDefs::TEMPERATURE_ADC, " °C",
|
||||
"[n_value]\n\t[Jungfrau][Gotthard] ADC Temperature");
|
||||
@ -1059,9 +1091,6 @@ class CmdProxy {
|
||||
GET_IND_COMMAND(temp_fpgafr, getTemperature, slsDetectorDefs::TEMPERATURE_FPGA3, " °C",
|
||||
"[n_value]\n\t[Eiger]Temperature of the left front end board fpga");
|
||||
|
||||
INTEGER_COMMAND(timing, getTimingMode, setTimingMode, sls::StringTo<slsDetectorDefs::timingMode>,
|
||||
"[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Gotthard][Ctb] [auto|trigger]\n\t[Eiger] [auto|trigger|gating|burst_trigger]");
|
||||
|
||||
/* dacs */
|
||||
|
||||
DAC_COMMAND(vthreshold, getDAC, setDAC, defs::THRESHOLD,
|
||||
@ -1202,7 +1231,7 @@ class CmdProxy {
|
||||
DAC_COMMAND(vcom_cds, getDAC, setDAC, defs::VCOM_CDS,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for common mode voltage of CDS stage.");
|
||||
|
||||
DAC_COMMAND(vref_restore, getDAC, setDAC, defs::VREF_RESTORE,
|
||||
DAC_COMMAND(vref_rstore, getDAC, setDAC, defs::VREF_RSTORE,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for reference charging voltage of temparory storage cell in high gain.");
|
||||
|
||||
DAC_COMMAND(vb_opa_1st, getDAC, setDAC, defs::VB_OPA_1ST,
|
||||
@ -1373,8 +1402,7 @@ class CmdProxy {
|
||||
INTEGER_COMMAND(rx_tcpport, getRxPort, setRxPort, std::stoi,
|
||||
"[port]\n\tTCP port for client-receiver communication. Default is 1954. Must be different if multiple receivers on same pc. Must be first command to set a receiver parameter. Multi command will automatically increment for individual modules.");
|
||||
|
||||
INTEGER_COMMAND(
|
||||
rx_fifodepth, getRxFifoDepth, setRxFifoDepth, std::stoi,
|
||||
INTEGER_COMMAND(rx_fifodepth, getRxFifoDepth, setRxFifoDepth, std::stoi,
|
||||
"[n_frames]\n\tSet the number of frames in the receiver fifo (buffer between listener and writer threads).");
|
||||
|
||||
INTEGER_COMMAND(rx_silent, getRxSilentMode, setRxSilentMode, std::stoi,
|
||||
@ -1502,9 +1530,6 @@ class CmdProxy {
|
||||
INTEGER_COMMAND(temp_control, getTemperatureControl, setTemperatureControl, std::stoi,
|
||||
"[0, 1]\n\t[Jungfrau] Temperature control enable. Default is 0 (disabled). If temperature crosses threshold temperature and temperature control is enabled, power to chip will be switched off and temperature event occurs. To power on chip again, temperature has to be less than threshold temperature and temperature event has to be cleared.");
|
||||
|
||||
INTEGER_COMMAND(powerchip, getPowerChip, setPowerChip, std::stoi,
|
||||
"[0, 1]\n\t[Jungfrau][Mythen3] Power the chip. Default 0. \n\t[Jungfrau] Get will return power status. Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled.");
|
||||
|
||||
INTEGER_COMMAND(auto_comp_disable, getAutoCompDisable, setAutoCompDisable, std::stoi,
|
||||
"[0, 1]\n\t[Jungfrau] Auto comparator disable mode. Default 0 or this mode disabled(comparator enabled throughout). 1 enables mode. 0 disables mode. This mode disables the on-chip gain switching comparator automatically after 93.75% of exposure time (only for longer than 100us).");
|
||||
|
||||
@ -1529,9 +1554,6 @@ class CmdProxy {
|
||||
"[0, 1]\n\t[Gotthard] 1 adds channel intensity with precalculated values when taking an acquisition. Default is 0.");
|
||||
|
||||
/* Gotthard2 Specific */
|
||||
INTEGER_COMMAND(burstmode, getBurstMode, setBurstMode, std::stoi,
|
||||
"[0, 1]\n\t[Gotthard2] 1 sets to burst mode. 0 sets to continuous mode. Default is burst mode.");
|
||||
|
||||
/* Mythen3 Specific */
|
||||
|
||||
/* CTB Specific */
|
||||
@ -1651,10 +1673,10 @@ class CmdProxy {
|
||||
"[64 bit mask]\n\t[Ctb] 64 bit mask defining output clock enable.");
|
||||
|
||||
INTEGER_COMMAND_HEX(patmask, getPatternMask, setPatternMask, stoulHex,
|
||||
"[64 bit mask]\n\t[Ctb] 64 bit mask applied to every pattern. Only these bits for each pattern will be masked against.");
|
||||
"[64 bit mask]\n\t[Ctb][Mythen3] 64 bit mask applied to every pattern. Only these bits for each pattern will be masked against.");
|
||||
|
||||
INTEGER_COMMAND_HEX(patsetbit, getPatternBitMask, setPatternBitMask, stoulHex,
|
||||
"[64 bit mask]\n\t[Ctb] 64 bit values applied to the selected patmask for every pattern.");
|
||||
"[64 bit mask]\n\t[Ctb][Mythen3] 64 bit values applied to the selected patmask for every pattern.");
|
||||
|
||||
/* Moench */
|
||||
|
||||
@ -1677,10 +1699,10 @@ class CmdProxy {
|
||||
"\n\t[Jungfrau][Ctb] Reboot controler (blackfin) of detector.");
|
||||
|
||||
EXECUTE_SET_COMMAND(firmwaretest, executeFirmwareTest,
|
||||
"\n\t[Jungfrau][Ctb][Gotthard] Firmware test, ie. reads a read fixed pattern from a register.");
|
||||
"\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb] Firmware test, ie. reads a read fixed pattern from a register.");
|
||||
|
||||
EXECUTE_SET_COMMAND(bustest, executeBusTest,
|
||||
"\n\t[Jungfrau][Ctb][Gotthard] Bus test, ie. keeps writing and reading back different values in R/W register.");
|
||||
"\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb] Bus test, ie. keeps writing and reading back different values in R/W register.");
|
||||
|
||||
|
||||
/* Insignificant */
|
||||
@ -1698,13 +1720,16 @@ class CmdProxy {
|
||||
"\n\tClient IP Address that last communicated with the detector.");
|
||||
|
||||
GET_COMMAND(nframes, getNumberOfFramesFromStart,
|
||||
"\n\t[Jungfrau][CTB] Number of frames from start run control.");
|
||||
"\n\t[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Number of frames from start run control."
|
||||
"\n\t[Gotthard2] only in continuous mode.");
|
||||
|
||||
TIME_GET_COMMAND(now, getActualTime,
|
||||
"[(optional unit) ns|us|ms|s]\n\t[Jungfrau][CTB] Time from detector start up.");
|
||||
"[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Time from detector start up."
|
||||
"\n\t[Gotthard2] only in continuous mode.");
|
||||
|
||||
TIME_GET_COMMAND(timestamp, getMeasurementTime,
|
||||
"[(optional unit) ns|us|ms|s]\n\t[Jungfrau][CTB] Timestamp at a frame start.");
|
||||
"[(optional unit) ns|us|ms|s]\n\t[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Timestamp at a frame start."
|
||||
"\n\t[Gotthard2] only in continuous mode.");
|
||||
|
||||
GET_COMMAND(rx_frameindex, getRxCurrentFrameIndex,
|
||||
"\n\tCurrent frame index received in receiver.");
|
||||
|
@ -224,6 +224,15 @@ Result<ns> Detector::getPeriodLeft(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getPeriodLeft, pos);
|
||||
}
|
||||
|
||||
Result<defs::timingMode> Detector::getTimingMode(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setTimingMode, pos,
|
||||
defs::GET_TIMING_MODE);
|
||||
}
|
||||
|
||||
void Detector::setTimingMode(defs::timingMode value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setTimingMode, pos, value);
|
||||
}
|
||||
|
||||
Result<defs::speedLevel> Detector::getSpeed(Positions pos) const {
|
||||
auto res =
|
||||
pimpl->Parallel(&slsDetector::getClockDivider, pos, defs::RUN_CLOCK);
|
||||
@ -309,6 +318,21 @@ void Detector::setHighVoltage(int value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setDAC, pos, value, defs::HIGH_VOLTAGE, 0);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getPowerChip(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::powerChip, pos, -1);
|
||||
}
|
||||
|
||||
void Detector::setPowerChip(bool on, Positions pos) {
|
||||
if ((pos.empty() || pos[0] == -1) && on && pimpl->size() > 3) {
|
||||
for (int i = 0; i != pimpl->size(); ++i) {
|
||||
pimpl->Parallel(&slsDetector::powerChip, {i}, static_cast<int>(on));
|
||||
usleep(1000 * 1000);
|
||||
}
|
||||
} else {
|
||||
pimpl->Parallel(&slsDetector::powerChip, pos, static_cast<int>(on));
|
||||
}
|
||||
}
|
||||
|
||||
Result<int> Detector::getTemperature(defs::dacIndex index,
|
||||
Positions pos) const {
|
||||
switch (index) {
|
||||
@ -359,15 +383,6 @@ void Detector::setOnChipDAC(defs::dacIndex index, int chipIndex, int value,
|
||||
pimpl->Parallel(&slsDetector::setOnChipDAC, pos, index, chipIndex, value);
|
||||
}
|
||||
|
||||
Result<defs::timingMode> Detector::getTimingMode(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setTimingMode, pos,
|
||||
defs::GET_TIMING_MODE);
|
||||
}
|
||||
|
||||
void Detector::setTimingMode(defs::timingMode value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setTimingMode, pos, value);
|
||||
}
|
||||
|
||||
// Acquisition
|
||||
|
||||
void Detector::acquire() { pimpl->acquire(); }
|
||||
@ -1069,21 +1084,6 @@ void Detector::resetTemperatureEvent(Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setTemperatureEvent, pos, 0);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getPowerChip(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::powerChip, pos, -1);
|
||||
}
|
||||
|
||||
void Detector::setPowerChip(bool on, Positions pos) {
|
||||
if ((pos.empty() || pos[0] == -1) && on && pimpl->size() > 3) {
|
||||
for (int i = 0; i != pimpl->size(); ++i) {
|
||||
pimpl->Parallel(&slsDetector::powerChip, {i}, static_cast<int>(on));
|
||||
usleep(1000 * 1000);
|
||||
}
|
||||
} else {
|
||||
pimpl->Parallel(&slsDetector::powerChip, pos, static_cast<int>(on));
|
||||
}
|
||||
}
|
||||
|
||||
Result<bool> Detector::getAutoCompDisable(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setAutoComparatorDisableMode, pos, -1);
|
||||
}
|
||||
@ -1180,13 +1180,13 @@ void Detector::setVetoReference(const int gainIndex, const int value, Positions
|
||||
pimpl->Parallel(&slsDetector::setVetoReference, pos, gainIndex, value);
|
||||
}
|
||||
|
||||
void Detector::setBurstMode(bool enable, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setBurstMode, pos, enable);
|
||||
Result<defs::burstMode> Detector::getBurstMode(Positions pos) {
|
||||
return pimpl->Parallel(&slsDetector::getBurstMode, pos);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getBurstMode(Positions pos) {
|
||||
return pimpl->Parallel(&slsDetector::getBurstMode, pos);
|
||||
}
|
||||
void Detector::setBurstMode(defs::burstMode value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setBurstMode, pos, value);
|
||||
}
|
||||
|
||||
// Mythen3 Specific
|
||||
|
||||
|
@ -1483,6 +1483,16 @@ int64_t slsDetector::getMeasurementTime() const {
|
||||
return retval;
|
||||
}
|
||||
|
||||
slsDetectorDefs::timingMode slsDetector::setTimingMode(timingMode value) {
|
||||
int fnum = F_SET_TIMING_MODE;
|
||||
//auto arg = static_cast<int>(pol);
|
||||
timingMode retval = GET_TIMING_MODE;
|
||||
FILE_LOG(logDEBUG1) << "Setting communication to mode " << value;
|
||||
sendToDetector(fnum, static_cast<int>(value), retval);
|
||||
FILE_LOG(logDEBUG1) << "Timing Mode: " << retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
int slsDetector::setDynamicRange(int n) {
|
||||
// TODO! Properly handle fail
|
||||
int prevDr = shm()->dynamicRange;
|
||||
@ -1549,16 +1559,6 @@ int slsDetector::getADC(dacIndex index) {
|
||||
return retval;
|
||||
}
|
||||
|
||||
slsDetectorDefs::timingMode slsDetector::setTimingMode(timingMode pol) {
|
||||
int fnum = F_SET_TIMING_MODE;
|
||||
auto arg = static_cast<int>(pol);
|
||||
timingMode retval = GET_TIMING_MODE;
|
||||
FILE_LOG(logDEBUG1) << "Setting communication to mode " << pol;
|
||||
sendToDetector(fnum, arg, retval);
|
||||
FILE_LOG(logDEBUG1) << "Timing Mode: " << retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
slsDetectorDefs::externalSignalFlag
|
||||
slsDetector::setExternalSignalFlags(externalSignalFlag pol) {
|
||||
int fnum = F_SET_EXTERNAL_SIGNAL_FLAG;
|
||||
@ -2476,15 +2476,15 @@ void slsDetector::setVetoReference(const int gainIndex, const int value) {
|
||||
sendToDetector(F_SET_VETO_REFERENCE, args, nullptr);
|
||||
}
|
||||
|
||||
bool slsDetector::getBurstMode() {
|
||||
slsDetectorDefs::burstMode slsDetector::getBurstMode() {
|
||||
int retval = -1;
|
||||
sendToDetector(F_GET_BURST_MODE, nullptr, retval);
|
||||
FILE_LOG(logDEBUG1) << "Burst mode:" << retval;
|
||||
return static_cast<bool>(retval);
|
||||
return static_cast<slsDetectorDefs::burstMode>(retval);
|
||||
}
|
||||
|
||||
void slsDetector::setBurstMode(bool enable) {
|
||||
int arg = static_cast<int>(enable);
|
||||
void slsDetector::setBurstMode(slsDetectorDefs::burstMode value) {
|
||||
int arg = static_cast<int>(value);
|
||||
FILE_LOG(logDEBUG1) << "Setting burst mode to " << arg;
|
||||
sendToDetector(F_SET_BURST_MODE, arg, nullptr);
|
||||
}
|
||||
|
@ -389,13 +389,10 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
*/
|
||||
detectorSettings getSettings();
|
||||
|
||||
/**
|
||||
* Load detector settings from the settings file picked from the
|
||||
* trimdir/settingsdir Eiger only stores in shared memory ( a get will
|
||||
* overwrite this) For Eiger, one must use threshold Gotthard, Propix,
|
||||
* Jungfrau and Moench only sends the settings enum to the detector
|
||||
* @param isettings settings
|
||||
* @returns current settings
|
||||
/** [Jungfrau] Options:DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2, FORCESWITCHG1, FORCESWITCHG2
|
||||
* [Gotthard] Options: DYNAMICGAIN, HIGHGAIN, LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN
|
||||
* [Gotthard2] Options: DYNAMICGAIN, FIXGAIN1, FIXGAIN2
|
||||
* [Eiger] Only stores them locally in shm Options: STANDARD, HIGHGAIN, LOWGAIN, VERYHIGHGAIN, VERYLOWGAIN
|
||||
*/
|
||||
detectorSettings setSettings(detectorSettings isettings);
|
||||
|
||||
@ -564,10 +561,12 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
|
||||
void setPeriod(int64_t value);
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3] */
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
int64_t getDelayAfterTrigger();
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3] */
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
void setDelayAfterTrigger(int64_t value);
|
||||
|
||||
/** [Eiger] in 32 bit mode */
|
||||
@ -589,19 +588,22 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
* Options: (0-1638375 ns (resolution of 25ns) */
|
||||
void setStorageCellDelay(int64_t value);
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3][Gotthard2] */
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
int64_t getNumberOfFramesLeft() const;
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3][Gotthard2] */
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
int64_t getNumberOfTriggersLeft() const;
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB] */
|
||||
/** [Gotthard][Jungfrau][CTB]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
int64_t getDelayAfterTriggerLeft() const;
|
||||
|
||||
/** [Gotthard] */
|
||||
int64_t getExptimeLeft() const;
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB] */
|
||||
/** [Gotthard][Jungfrau][CTB][Mythen3][Gotthard2] */
|
||||
int64_t getPeriodLeft() const;
|
||||
|
||||
/** [Eiger] minimum two frames */
|
||||
@ -610,15 +612,25 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
/** [Eiger] */
|
||||
int64_t getMeasuredSubFramePeriod() const;
|
||||
|
||||
/** [Jungfrau][CTB] */
|
||||
/** [Jungfrau][CTB][Mythen3]
|
||||
* [Gotthard2] only in continuous mode */
|
||||
int64_t getNumberOfFramesFromStart() const;
|
||||
|
||||
/** [Jungfrau][CTB] Get time from detector start */
|
||||
/** [Jungfrau][CTB][Mythen3] Get time from detector start
|
||||
* [Gotthard2] only in continuous mode */
|
||||
int64_t getActualTime() const;
|
||||
|
||||
/** [Jungfrau][CTB] Get timestamp at a frame start */
|
||||
/** [Jungfrau][CTB][Mythen3] Get timestamp at a frame start
|
||||
* [Gotthard2] only in continuous mode */
|
||||
int64_t getMeasurementTime() const;
|
||||
|
||||
/**
|
||||
* Set/get timing mode
|
||||
* @param value timing mode (-1 gets)
|
||||
* @returns current timing mode
|
||||
*/
|
||||
timingMode setTimingMode(timingMode value = GET_TIMING_MODE);
|
||||
|
||||
/**
|
||||
* Set/get dynamic range
|
||||
* (Eiger: If i is 32, also sets clkdivider to 2, if 16, sets clkdivider to
|
||||
@ -652,13 +664,6 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
*/
|
||||
int getADC(dacIndex index);
|
||||
|
||||
/**
|
||||
* Set/get timing mode
|
||||
* @param pol timing mode (-1 gets)
|
||||
* @returns current timing mode
|
||||
*/
|
||||
timingMode setTimingMode(timingMode pol = GET_TIMING_MODE);
|
||||
|
||||
/**
|
||||
* Set/get external signal flags (to specify triggerinrising edge etc)
|
||||
* (Gotthard, Mythen)
|
||||
@ -1125,12 +1130,12 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
|
||||
void setVetoReference(const int gainIndex, const int value);
|
||||
|
||||
/** [Gotthard2] burst mode or continuous mode */
|
||||
void setBurstMode(bool enable);
|
||||
|
||||
/** [Gotthard2] */
|
||||
bool getBurstMode();
|
||||
burstMode getBurstMode();
|
||||
|
||||
/** [Gotthard2] BURST_OFF, BURST_INTERNAL (default), BURST_EXTERNAL */
|
||||
void setBurstMode(burstMode value);
|
||||
|
||||
/**
|
||||
* Set/get counter bit in detector (Gotthard)
|
||||
* @param i is -1 to get, 0 to reset and any other value to set the counter
|
||||
@ -1753,16 +1758,16 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
uint64_t setPatternClockControl(uint64_t word = -1);
|
||||
|
||||
/**
|
||||
* Writes a pattern word (CTB/ Moench)
|
||||
* Writes a pattern word (CTB/ Moench/ Mythen3)
|
||||
* @param addr address of the word
|
||||
* @param word 64bit word to be written, -1 reads the addr (same as
|
||||
* executing the pattern)
|
||||
* executing the pattern for ctb)
|
||||
* @returns actual value
|
||||
*/
|
||||
uint64_t setPatternWord(int addr, uint64_t word);
|
||||
|
||||
/**
|
||||
* Sets the pattern or loop limits (CTB/ Moench)
|
||||
* Sets the pattern or loop limits (CTB/ Moench/ Mythen3)
|
||||
* @param level -1 complete pattern, 0,1,2, loop level
|
||||
* @param start start address for level 0-2, -1 gets
|
||||
* @param stop stop address for level 0-2, -1 gets
|
||||
@ -1772,7 +1777,7 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
int stop = -1);
|
||||
|
||||
/**
|
||||
* Sets the pattern or loop limits (CTB/ Moench)
|
||||
* Sets the pattern or loop limits (CTB/ Moench/ Mythen3)
|
||||
* @param level -1 complete pattern, 0,1,2, loop level
|
||||
* @param n number of loops for level 0-2, -1 gets
|
||||
* @returns number of loops
|
||||
@ -1781,7 +1786,7 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the wait address (CTB/ Moench)
|
||||
* Sets the wait address (CTB/ Moench/ Mythen3)
|
||||
* @param level 0,1,2, wait level
|
||||
* @param addr wait address, -1 gets
|
||||
* @returns actual value
|
||||
@ -1789,7 +1794,7 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
int setPatternWaitAddr(int level, int addr = -1);
|
||||
|
||||
/**
|
||||
* Sets the wait time (CTB/ Moench)
|
||||
* Sets the wait time (CTB/ Moench/ Mythen3)
|
||||
* @param level 0,1,2, wait level
|
||||
* @param t wait time, -1 gets
|
||||
* @returns actual value
|
||||
@ -1797,27 +1802,27 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
uint64_t setPatternWaitTime(int level, uint64_t t = -1);
|
||||
|
||||
/**
|
||||
* Sets the mask applied to every pattern (CTB/ Moench)
|
||||
* Sets the mask applied to every pattern (CTB/ Moench/ Mythen3)
|
||||
* @param mask mask to be applied
|
||||
*/
|
||||
void setPatternMask(uint64_t mask);
|
||||
|
||||
/**
|
||||
* Gets the mask applied to every pattern (CTB/ Moench)
|
||||
* Gets the mask applied to every pattern (CTB/ Moench/ Mythen3)
|
||||
* @returns mask set
|
||||
*/
|
||||
uint64_t getPatternMask();
|
||||
|
||||
/**
|
||||
* Selects the bits that the mask will be applied to for every pattern (CTB/
|
||||
* Moench)
|
||||
* Moench/ Mythen3)
|
||||
* @param mask mask to select bits
|
||||
*/
|
||||
void setPatternBitMask(uint64_t mask);
|
||||
|
||||
/**
|
||||
* Gets the bits that the mask will be applied to for every pattern (CTB/
|
||||
* Moench)
|
||||
* Moench/ Mythen3)
|
||||
* @returns mask of bits selected
|
||||
*/
|
||||
uint64_t getPatternBitMask();
|
||||
@ -1836,25 +1841,25 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
*/
|
||||
void setDigitalIODelay(uint64_t pinMask, int delay);
|
||||
|
||||
/** [Gotthard2] */
|
||||
/** [Mythen3][Gotthard2] */
|
||||
int getClockFrequency(int clkIndex);
|
||||
|
||||
/** [Gotthard2] */
|
||||
/** [Mythen3][Gotthard2] */
|
||||
void setClockFrequency(int clkIndex, int value);
|
||||
|
||||
/** [Gotthard2] */
|
||||
/** [Mythen3][Gotthard2] */
|
||||
int getClockPhase(int clkIndex, bool inDegrees);
|
||||
|
||||
/** [Gotthard2] */
|
||||
/** [Mythen3][Gotthard2] */
|
||||
void setClockPhase(int clkIndex, int value, bool inDegrees);
|
||||
|
||||
/** [Gotthard2] */
|
||||
/** [Mythen3][Gotthard2] */
|
||||
int getMaxClockPhaseShift(int clkIndex);
|
||||
|
||||
/** [Gotthard2] */
|
||||
/** [Mythen3][Gotthard2] */
|
||||
int getClockDivider(int clkIndex);
|
||||
|
||||
/** [Gotthard2] */
|
||||
/** [Mythen3][Gotthard2] */
|
||||
void setClockDivider(int clkIndex, int value);
|
||||
|
||||
/** [Ctb][Moench] */
|
||||
|
@ -364,7 +364,7 @@ TEST_CASE("Setting and reading back EIGER dacs", "[.cmd]") {
|
||||
REQUIRE_THROWS(proxy.Call("vb_comp_fe", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("vb_comp_adc", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("vcom_cds", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("vref_restore", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("vref_rstore", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("vb_opa_1st", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("vref_comp_fe", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("vcom_adc1", {}, -1, GET));
|
||||
|
@ -69,7 +69,7 @@ TEST_CASE("Setting and reading back MYTHEN3 dacs", "[.cmd][.dacs]") {
|
||||
REQUIRE_THROWS(proxy.Call("vb_comp_fe", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("vb_comp_adc", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("vcom_cds", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("vref_restore", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("vref_rstore", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("vb_opa_1st", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("vref_comp_fe", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("vcom_adc1", {}, -1, GET));
|
||||
|
@ -311,7 +311,7 @@ TEST_CASE("type", "[.cmd]"){
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vb_comp_fe", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vb_comp_adc", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcom_cds", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vref_restore", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vref_rstore", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vb_opa_1st", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vref_comp_fe", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcom_adc1", GET));
|
||||
@ -474,7 +474,7 @@ TEST_CASE("type", "[.cmd]"){
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vb_comp_fe", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vb_comp_adc", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcom_cds", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vref_restore", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vref_rstore", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vb_opa_1st", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vref_comp_fe", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcom_adc1", GET));
|
||||
@ -557,7 +557,7 @@ TEST_CASE("type", "[.cmd]"){
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vb_comp_fe", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vb_comp_adc", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcom_cds", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vref_restore", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vref_rstore", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vb_opa_1st", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vref_comp_fe", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcom_adc1", GET));
|
||||
@ -575,6 +575,237 @@ TEST_CASE("type", "[.cmd]"){
|
||||
// }
|
||||
|
||||
|
||||
// else if (test::type == slsDetectorDefs::GOTTHARD2) {
|
||||
// {
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_h_adc", GET,
|
||||
// nullptr, oss)); std::string s = (oss.str()).erase (0,
|
||||
// strlen("vref_h_adc ")); prev_val = std::stoi(s);
|
||||
// }
|
||||
// {
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_h_adc 1000", PUT));
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_h_adc", GET,
|
||||
// nullptr, oss)); REQUIRE(oss.str() == "vref_h_adc 1000\n");
|
||||
// }
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_h_adc " +
|
||||
// std::to_string(prev_val), PUT));
|
||||
// {
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_fe", GET,
|
||||
// nullptr, oss)); std::string s = (oss.str()).erase (0,
|
||||
// strlen("vb_comp_fe ")); prev_val = std::stoi(s);
|
||||
// }
|
||||
// {
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_fe 1000", PUT));
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_fe", GET,
|
||||
// nullptr, oss)); REQUIRE(oss.str() == "vb_comp_fe 1000\n");
|
||||
// }
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_fe " +
|
||||
// std::to_string(prev_val), PUT));
|
||||
// {
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_adc", GET,
|
||||
// nullptr, oss)); std::string s = (oss.str()).erase (0,
|
||||
// strlen("vb_comp_adc ")); prev_val = std::stoi(s);
|
||||
// }
|
||||
// {
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_adc 1000", PUT));
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_adc", GET,
|
||||
// nullptr, oss)); REQUIRE(oss.str() == "vb_comp_adc 1000\n");
|
||||
// }
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_adc " +
|
||||
// std::to_string(prev_val), PUT));
|
||||
// {
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_cds", GET, nullptr,
|
||||
// oss)); std::string s = (oss.str()).erase (0, strlen("vcom_cds
|
||||
// ")); prev_val = std::stoi(s);
|
||||
// }
|
||||
// {
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_cds 1000", PUT));
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_cds", GET, nullptr,
|
||||
// oss)); REQUIRE(oss.str() == "vcom_cds 1000\n");
|
||||
// }
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_cds " +
|
||||
// std::to_string(prev_val), PUT));
|
||||
// {
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_rstore", GET,
|
||||
// nullptr, oss)); std::string s = (oss.str()).erase (0,
|
||||
// strlen("vref_rstore ")); prev_val = std::stoi(s);
|
||||
// }
|
||||
// {
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_rstore 1000",
|
||||
// PUT)); std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_rstore", GET,
|
||||
// nullptr, oss)); REQUIRE(oss.str() == "vref_rstore 1000\n");
|
||||
// }
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_rstore " +
|
||||
// std::to_string(prev_val), PUT));
|
||||
// {
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_1st", GET,
|
||||
// nullptr, oss)); std::string s = (oss.str()).erase (0,
|
||||
// strlen("vb_opa_1st ")); prev_val = std::stoi(s);
|
||||
// }
|
||||
// {
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_1st 1000", PUT));
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_1st", GET,
|
||||
// nullptr, oss)); REQUIRE(oss.str() == "vb_opa_1st 1000\n");
|
||||
// }
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_1st " +
|
||||
// std::to_string(prev_val), PUT));
|
||||
// {
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_comp_fe", GET,
|
||||
// nullptr, oss)); std::string s = (oss.str()).erase (0,
|
||||
// strlen("vref_comp_fe ")); prev_val = std::stoi(s);
|
||||
// }
|
||||
// {
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_comp_fe 1000",
|
||||
// PUT)); std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_comp_fe", GET,
|
||||
// nullptr, oss)); REQUIRE(oss.str() == "vref_comp_fe 1000\n");
|
||||
// }
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_comp_fe " +
|
||||
// std::to_string(prev_val), PUT));
|
||||
// {
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc1", GET, nullptr,
|
||||
// oss)); std::string s = (oss.str()).erase (0, strlen("vcom_adc1
|
||||
// ")); prev_val = std::stoi(s);
|
||||
// }
|
||||
// {
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc1 1000", PUT));
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc1", GET, nullptr,
|
||||
// oss)); REQUIRE(oss.str() == "vcom_adc1 1000\n");
|
||||
// }
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc1 " +
|
||||
// std::to_string(prev_val), PUT));
|
||||
// {
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_prech", GET,
|
||||
// nullptr, oss)); std::string s = (oss.str()).erase (0,
|
||||
// strlen("vref_prech ")); prev_val = std::stoi(s);
|
||||
// }
|
||||
// {
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_prech 1000", PUT));
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_prech", GET,
|
||||
// nullptr, oss)); REQUIRE(oss.str() == "vref_prech 1000\n");
|
||||
// }
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_prech " +
|
||||
// std::to_string(prev_val), PUT));
|
||||
// {
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_l_adc", GET,
|
||||
// nullptr, oss)); std::string s = (oss.str()).erase (0,
|
||||
// strlen("vref_l_adc ")); prev_val = std::stoi(s);
|
||||
// }
|
||||
// {
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_l_adc 1000", PUT));
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_l_adc", GET,
|
||||
// nullptr, oss)); REQUIRE(oss.str() == "vref_l_adc 1000\n");
|
||||
// }
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_l_adc " +
|
||||
// std::to_string(prev_val), PUT));
|
||||
// {
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_cds", GET, nullptr,
|
||||
// oss)); std::string s = (oss.str()).erase (0, strlen("vref_cds
|
||||
// ")); prev_val = std::stoi(s);
|
||||
// }
|
||||
// {
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_cds 1000", PUT));
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_cds", GET, nullptr,
|
||||
// oss)); REQUIRE(oss.str() == "vref_cds 1000\n");
|
||||
// }
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_cds " +
|
||||
// std::to_string(prev_val), PUT));
|
||||
// {
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_cs", GET, nullptr,
|
||||
// oss)); std::string s = (oss.str()).erase (0, strlen("vb_cs "));
|
||||
// prev_val = std::stoi(s);
|
||||
// }
|
||||
// {
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_cs 1000", PUT));
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_cs", GET, nullptr,
|
||||
// oss)); REQUIRE(oss.str() == "vb_cs 1000\n");
|
||||
// }
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_cs " +
|
||||
// std::to_string(prev_val), PUT));
|
||||
// {
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_fd", GET, nullptr,
|
||||
// oss)); std::string s = (oss.str()).erase (0, strlen("vb_opa_fd
|
||||
// ")); prev_val = std::stoi(s);
|
||||
// }
|
||||
// {
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_fd 1000", PUT));
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_fd", GET, nullptr,
|
||||
// oss)); REQUIRE(oss.str() == "vb_opa_fd 1000\n");
|
||||
// }
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_fd " +
|
||||
// std::to_string(prev_val), PUT));
|
||||
// {
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc2", GET, nullptr,
|
||||
// oss)); std::string s = (oss.str()).erase (0, strlen("vcom_adc2
|
||||
// ")); prev_val = std::stoi(s);
|
||||
// }
|
||||
// {
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc2 1000", PUT));
|
||||
// std::ostringstream oss;
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc2", GET, nullptr,
|
||||
// oss)); REQUIRE(oss.str() == "vcom_adc2 1000\n");
|
||||
// }
|
||||
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc2 " +
|
||||
// std::to_string(prev_val), PUT));
|
||||
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vthreshold", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vsvp", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vsvn", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vtr", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vrf", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vrs", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vtgstv", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcmp_ll", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcmp_lr", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcal", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcmp_rl", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcmp_rr", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("rxb_rb", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("rxb_lb", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcp", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcn", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vis", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("iodelay", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vref_ds", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcascn_pb", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcascp_pb", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vout_cm", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vcasc_out", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vin_cm", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vref_comp", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("ib_test_c", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vb_ds", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vb_comp", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vb_pixbuf", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vin_com", GET));
|
||||
// REQUIRE_THROWS(multiSlsDetectorClient("vdd_prot", GET));
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
TEST_CASE("user", "[.cmd]") {
|
||||
|
@ -598,6 +598,28 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class Gotthard2Data : public GeneralData {
|
||||
public:
|
||||
|
||||
/** Constructor */
|
||||
Gotthard2Data(){
|
||||
myDetectorType = slsDetectorDefs::GOTTHARD2;
|
||||
nPixelsX = 128 * 10;
|
||||
nPixelsY = 1;
|
||||
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
|
||||
dataSize = 2560; // 1280 channels * 2 bytes
|
||||
packetSize = headerSizeinPacket + dataSize;
|
||||
packetsPerFrame = 1;
|
||||
imageSize = dataSize * packetsPerFrame;
|
||||
maxFramesPerFile = GOTTHARD2_MAX_FRAMES_PER_FILE;
|
||||
fifoBufferHeaderSize= FIFO_HEADER_NUMBYTES + sizeof(slsDetectorDefs::sls_receiver_header);
|
||||
defaultFifoDepth = 50000;
|
||||
standardheader = true;
|
||||
defaultUdpSocketBufferSize = (1000 * 1024 * 1024);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
class ChipTestBoardData : public GeneralData {
|
||||
private:
|
||||
/** Number of analog channels */
|
||||
|
@ -437,6 +437,7 @@ int ClientInterface::set_detector_type(Interface &socket) {
|
||||
case MOENCH:
|
||||
case JUNGFRAU:
|
||||
case MYTHEN3:
|
||||
case GOTTHARD2:
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Unknown detector type: " + std::to_string(arg));
|
||||
@ -581,7 +582,7 @@ int ClientInterface::set_dynamic_range(Interface &socket) {
|
||||
}
|
||||
break;
|
||||
case MYTHEN3:
|
||||
if (dr == 32) {
|
||||
if (dr == 1 || dr == 4 || dr == 16 || dr == 32) {
|
||||
exists = true;
|
||||
}
|
||||
break;
|
||||
|
@ -218,6 +218,7 @@ void Implementation::setDetectorType(const detectorType d) {
|
||||
case CHIPTESTBOARD:
|
||||
case MOENCH:
|
||||
case MYTHEN3:
|
||||
case GOTTHARD2:
|
||||
FILE_LOG(logINFO) << " ***** " << sls::ToString(d)
|
||||
<< " Receiver *****";
|
||||
break;
|
||||
@ -244,7 +245,10 @@ void Implementation::setDetectorType(const detectorType d) {
|
||||
break;
|
||||
case MYTHEN3:
|
||||
generalData = new Mythen3Data();
|
||||
break;
|
||||
break;
|
||||
case GOTTHARD2:
|
||||
generalData = new Gotthard2Data();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -204,6 +204,19 @@ inline std::string ToString(const defs::detectorModeType s) {
|
||||
}
|
||||
}
|
||||
|
||||
inline std::string ToString(const defs::burstMode s) {
|
||||
switch (s) {
|
||||
case defs::BURST_OFF:
|
||||
return std::string("off");
|
||||
case defs::BURST_INTERNAL:
|
||||
return std::string("internal");
|
||||
case defs::BURST_EXTERNAL:
|
||||
return std::string("external");
|
||||
default:
|
||||
return std::string("Unknown");
|
||||
}
|
||||
}
|
||||
|
||||
// in case we already have a string
|
||||
// causes a copy but might be needed in generic code
|
||||
inline std::string ToString(const std::string& s) {
|
||||
@ -550,6 +563,18 @@ inline defs::dacIndex StringTo(const std::string& s) {
|
||||
throw sls::RuntimeError("Unknown dac Index " + s);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline defs::burstMode StringTo(const std::string& s) {
|
||||
if (s == "off")
|
||||
return defs::BURST_OFF;
|
||||
if (s == "internal")
|
||||
return defs::BURST_INTERNAL;
|
||||
if (s == "external")
|
||||
return defs::BURST_EXTERNAL;
|
||||
throw sls::RuntimeError("Unknown burst mode " + s);
|
||||
}
|
||||
|
||||
|
||||
/** For types with a .str() method use this for conversion */
|
||||
template <typename T>
|
||||
typename std::enable_if<has_str<T>::value, std::string>::type
|
||||
|
@ -317,7 +317,7 @@ class slsDetectorDefs {
|
||||
VB_COMP_FE,
|
||||
VB_COMP_ADC,
|
||||
VCOM_CDS,
|
||||
VREF_RESTORE,
|
||||
VREF_RSTORE,
|
||||
VB_OPA_1ST,
|
||||
VREF_COMP_FE,
|
||||
VCOM_ADC1,
|
||||
@ -438,6 +438,15 @@ class slsDetectorDefs {
|
||||
ANALOG /** < analog */
|
||||
};
|
||||
|
||||
/**
|
||||
* burst mode for gotthard2
|
||||
*/
|
||||
enum burstMode {
|
||||
BURST_OFF,
|
||||
BURST_INTERNAL,
|
||||
BURST_EXTERNAL,
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
protected:
|
||||
|
@ -444,7 +444,6 @@ static const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_SET_COUNTER_MASK: return "F_SET_COUNTER_MASK";
|
||||
case F_GET_COUNTER_MASK: return "F_GET_COUNTER_MASK";
|
||||
|
||||
|
||||
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
||||
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
#define APIRECEIVER 0x190722
|
||||
#define APIGUI 0x190723
|
||||
#define APIMOENCH 0x190820
|
||||
#define APIGOTTHARD2 0x191127
|
||||
#define APIGOTTHARD 0x191127
|
||||
#define APIJUNGFRAU 0x191127
|
||||
#define APICTB 0x191210
|
||||
#define APIMYTHEN3 0x200120
|
||||
#define APIEIGER 0x200121
|
||||
#define APICTB 0x200122
|
||||
#define APIGOTTHARD 0x200122
|
||||
#define APIEIGER 0x200122
|
||||
#define APIMYTHEN3 0x200122
|
||||
#define APIGOTTHARD2 0x200123
|
||||
#define APIJUNGFRAU 0x200123
|
||||
|
Loading…
x
Reference in New Issue
Block a user